Skip to content

Commit

Permalink
chore(deps): update dependency typescript to ^5.7.3 (#5386)
Browse files Browse the repository at this point in the history
* chore(deps): update react monorepo

* chore(deps): update dependency rollup to ^4.29.1

* chore(deps): update dependency typescript to ^5.7.2

* fix MenuItem and Tab children types errors

---------

Co-authored-by: Michael Winter <[email protected]>
Co-authored-by: cultureamp-renovate[bot] <89962466+cultureamp-renovate[bot]@users.noreply.github.com>
  • Loading branch information
cultureamp-renovate[bot] and mcwinter07 authored Jan 14, 2025
1 parent aa11498 commit 797e8bc
Show file tree
Hide file tree
Showing 5 changed files with 382 additions and 241 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-shoes-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kaizen/components': patch
---

Update RC MenuItem and Tab child render to fix types issues after upgrade to typescript 5.7.3
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.17.9",
"@types/react": "^18.3.13",
"@types/react-dom": "^18.3.1",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitest/eslint-plugin": "^1.1.24",
"chromatic": "^11.20.0",
"eslint": "^9.18.0",
Expand All @@ -85,7 +85,7 @@
"stylelint-config-standard": "^36.0.1",
"stylelint-config-standard-scss": "^14.0.0",
"turbo": "^2.3.3",
"typescript": "^5.6.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0",
"vite": "^6.0.7",
"vitest": "^2.1.8",
Expand Down
18 changes: 8 additions & 10 deletions packages/components/src/__rc__/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ export const MenuItem = forwardRef<HTMLDivElement, MenuItemProps>(
textValue={determinedTextValue}
{...props}
>
<>
{typeof children === 'string' && icon ? (
<div className={styles.flexWrapper}>
<span className={styles.iconWrapper}>{icon}</span>
{children}
</div>
) : (
<>{children}</>
)}
</>
{typeof children === 'string' && icon ? (
<div className={styles.flexWrapper}>
<span className={styles.iconWrapper}>{icon}</span>
{children}
</div>
) : (
children
)}
</RACMenuItem>
)
},
Expand Down
14 changes: 11 additions & 3 deletions packages/components/src/__rc__/Tabs/subcomponents/Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ export const Tab = (props: TabProps): JSX.Element => {

return (
<RACTab data-kz-tab {...tabProps}>
{({ isSelected, isFocusVisible, isHovered }) => (
{(TabRenderProps) => (
<>
{children}
{typeof children === 'function' ? children(TabRenderProps) : children}
{badge && (
<span className={styles.badge}>
<Badge variant={isSelected || isFocusVisible || isHovered ? 'active' : 'default'}>
<Badge
variant={
TabRenderProps.isSelected ||
TabRenderProps.isFocusVisible ||
TabRenderProps.isHovered
? 'active'
: 'default'
}
>
{badge}
</Badge>
</span>
Expand Down
Loading

0 comments on commit 797e8bc

Please sign in to comment.