Skip to content

Commit

Permalink
Fix types for mui@4 tabs (#4484)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasSlama authored Aug 16, 2024
1 parent fa1ae8c commit 30f8a78
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/slow-gifts-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@toptal/picasso-tabs': patch
---

- fix value type from `null` to `false` when empty
2 changes: 1 addition & 1 deletion packages/base/Tabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@toptal/picasso-provider": "5.0.0",
"@toptal/picasso-tailwind-merge": "1.2.0",
"@material-ui/core": "4.12.4",
"@toptal/picasso-test-utils": "1.1.1"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/base/Tabs/src/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TabScrollButton } from '../TabScrollButton'
import styles from './styles'
import useTabAction from './use-tab-action'

export type TabsValueType = string | number | null
export type TabsValueType = string | number | false

export interface Props<V extends TabsValueType> extends BaseProps {
/** Tabs content containing Tab components */
Expand Down
6 changes: 3 additions & 3 deletions packages/base/Tabs/src/Tabs/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Tabs', () => {
const { container, queryByTestId } = renderTabs(
[{ label: 'Tab 1' }, { label: 'Tab 2' }],
{
value: null,
value: false,
}
)

Expand All @@ -73,7 +73,7 @@ describe('Tabs', () => {
it('renders in vertical orientation', () => {
const { container } = renderTabs(
[{ label: 'Tab 1' }, { label: 'Tab 2' }],
{ value: null },
{ value: false },
'vertical'
)

Expand Down Expand Up @@ -159,7 +159,7 @@ describe('Tabs', () => {

it('renders in full width', () => {
const { container } = renderTabs([{ label: 'Tab 1' }, { label: 'Tab 2' }], {
value: null,
value: false,
variant: 'fullWidth',
})

Expand Down

0 comments on commit 30f8a78

Please sign in to comment.