diff --git a/.changeset/selfish-carpets-breathe.md b/.changeset/selfish-carpets-breathe.md new file mode 100644 index 000000000000..b7e33098ea32 --- /dev/null +++ b/.changeset/selfish-carpets-breathe.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Update tab in UnderlinePanels to set explicit type diff --git a/.eslintrc.js b/.eslintrc.js index ad4b613cd449..b61b249e1dd2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -61,6 +61,7 @@ module.exports = { // rules which apply to JS, TS, etc. rules: { 'no-shadow': 'off', + 'react/button-has-type': 'error', 'react/prop-types': 'off', 'react/display-name': 'off', 'react-hooks/exhaustive-deps': 'error', diff --git a/packages/react/src/ActionList/ActionList.features.stories.tsx b/packages/react/src/ActionList/ActionList.features.stories.tsx index e2beee85f9e2..c7e6c6be821e 100644 --- a/packages/react/src/ActionList/ActionList.features.stories.tsx +++ b/packages/react/src/ActionList/ActionList.features.stories.tsx @@ -637,7 +637,11 @@ export const InsideOverlay = () => { open={open} onOpen={toggle} onClose={toggle} - renderAnchor={props => } + renderAnchor={props => ( + + )} > diff --git a/packages/react/src/ActionList/ActionList.test.tsx b/packages/react/src/ActionList/ActionList.test.tsx index 892d68f0c479..79b50978b4c4 100644 --- a/packages/react/src/ActionList/ActionList.test.tsx +++ b/packages/react/src/ActionList/ActionList.test.tsx @@ -465,7 +465,9 @@ describe('ActionList', () => { return ( - + Item 1 Item 2 diff --git a/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx b/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx index 3a237603182e..0bf8c8b31498 100644 --- a/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx +++ b/packages/react/src/TooltipV2/__tests__/Tooltip.test.tsx @@ -128,7 +128,7 @@ describe('Tooltip', () => {
Legend - +
, ) diff --git a/packages/react/src/TreeView/TreeView.test.tsx b/packages/react/src/TreeView/TreeView.test.tsx index 3dc535270fa1..74fd658ed856 100644 --- a/packages/react/src/TreeView/TreeView.test.tsx +++ b/packages/react/src/TreeView/TreeView.test.tsx @@ -249,7 +249,7 @@ describe('Markup', () => { const user = userEvent.setup({delay: null}) const {getByRole} = renderWithTheme(
- + Item 1 @@ -277,7 +277,7 @@ describe('Markup', () => { const user = userEvent.setup({delay: null}) const {getByRole} = renderWithTheme(
- + Item 1 @@ -318,13 +318,13 @@ describe('Markup', () => { Item 1 Item 2 - Item 3 - +
, ) @@ -1359,7 +1359,9 @@ describe('Asyncronous loading', () => { return (
{/* Mimic the completion of async loading by clicking the button */} - + Parent diff --git a/packages/react/src/UnderlineNav/UnderlineNav.test.tsx b/packages/react/src/UnderlineNav/UnderlineNav.test.tsx index bd1551a39225..5d7793390a31 100644 --- a/packages/react/src/UnderlineNav/UnderlineNav.test.tsx +++ b/packages/react/src/UnderlineNav/UnderlineNav.test.tsx @@ -67,7 +67,7 @@ const ResponsiveUnderlineNav = ({ ))} - {displayExtraEl && } + {displayExtraEl && }
) } diff --git a/packages/react/src/__tests__/Dialog.test.tsx b/packages/react/src/__tests__/Dialog.test.tsx index 281f4c5d641d..0fed5ca5172c 100644 --- a/packages/react/src/__tests__/Dialog.test.tsx +++ b/packages/react/src/__tests__/Dialog.test.tsx @@ -61,7 +61,7 @@ const DialogWithCustomFocusRef = () => { Title Some content - @@ -90,7 +90,7 @@ const DialogWithCustomFocusRefAndReturnFocusRef = () => { Title Some content - diff --git a/packages/react/src/__tests__/TextInputWithTokens.test.tsx b/packages/react/src/__tests__/TextInputWithTokens.test.tsx index d70ec90d97d5..10a21222184c 100644 --- a/packages/react/src/__tests__/TextInputWithTokens.test.tsx +++ b/packages/react/src/__tests__/TextInputWithTokens.test.tsx @@ -317,7 +317,9 @@ describe('TextInputWithTokens', () => { onTokenRemove={onRemoveMock} visibleTokenCount={visibleTokenCount} /> - + , ) const inputNode = getByLabelText('Tokens') @@ -373,7 +375,9 @@ describe('TextInputWithTokens', () => { onTokenRemove={onRemoveMock} visibleTokenCount={visibleTokenCount} /> - + , ) const inputNode = getByLabelText('Tokens') diff --git a/packages/react/src/__tests__/ThemeProvider.test.tsx b/packages/react/src/__tests__/ThemeProvider.test.tsx index c94e6d3fd722..66d79d2590c1 100644 --- a/packages/react/src/__tests__/ThemeProvider.test.tsx +++ b/packages/react/src/__tests__/ThemeProvider.test.tsx @@ -203,7 +203,9 @@ it('updates when colorMode prop changes', async () => { return ( {colorMode} - + ) } @@ -229,7 +231,9 @@ it('updates when dayScheme prop changes', async () => { return ( {dayScheme} - + ) } @@ -255,7 +259,9 @@ it('updates when nightScheme prop changes', async () => { return ( {nightScheme} - + ) } @@ -280,7 +286,9 @@ it('inherits colorMode from parent', async () => { const [colorMode, setcolorMode] = React.useState<'day' | 'night'>('day') return ( - + {colorMode} @@ -304,7 +312,9 @@ it('inherits dayScheme from parent', async () => { const [dayScheme, setDayScheme] = React.useState('light') return ( - + {dayScheme} @@ -328,7 +338,9 @@ it('inherits nightScheme from parent', async () => { const [nightScheme, setNightScheme] = React.useState('dark') return ( - + {nightScheme} @@ -351,7 +363,11 @@ describe('setColorMode', () => { function ToggleMode() { const {colorMode, setColorMode} = useTheme() - return + return ( + + ) } render( @@ -377,7 +393,11 @@ describe('setDayScheme', () => { function ToggleDayScheme() { const {dayScheme, setDayScheme} = useTheme() - return + return ( + + ) } render( @@ -403,7 +423,11 @@ describe('setNightScheme', () => { function ToggleNightScheme() { const {nightScheme, setNightScheme} = useTheme() - return + return ( + + ) } render( @@ -429,7 +453,11 @@ describe('useColorSchemeVar', () => { function ToggleMode() { const {colorMode, setColorMode} = useTheme() - return + return ( + + ) } function CustomBg() { @@ -464,7 +492,11 @@ describe('useColorSchemeVar', () => { function ToggleMode() { const {colorMode, setColorMode} = useTheme() - return + return ( + + ) } function CustomBg() { diff --git a/packages/react/src/__tests__/hooks/useMenuInitialFocus.test.tsx b/packages/react/src/__tests__/hooks/useMenuInitialFocus.test.tsx index e5d5dc65ce7f..7519ca1a1d59 100644 --- a/packages/react/src/__tests__/hooks/useMenuInitialFocus.test.tsx +++ b/packages/react/src/__tests__/hooks/useMenuInitialFocus.test.tsx @@ -12,15 +12,15 @@ const Component = () => { return ( <> - {open && (
not focusable - - - + + + not focusable
)} diff --git a/packages/react/src/__tests__/hooks/useMnemonics.test.tsx b/packages/react/src/__tests__/hooks/useMnemonics.test.tsx index 6b2949c74048..2070db576219 100644 --- a/packages/react/src/__tests__/hooks/useMnemonics.test.tsx +++ b/packages/react/src/__tests__/hooks/useMnemonics.test.tsx @@ -21,12 +21,22 @@ const Fixture = ({
{hasInput && } {hasTextarea &&