Skip to content

Commit

Permalink
upgrade TS and fix SubNavTabs types
Browse files Browse the repository at this point in the history
  • Loading branch information
winkerVSbecks committed Aug 22, 2023
1 parent 72bd494 commit 7f342f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"storybook": "^7.0.18",
"storybook-addon-pseudo-states": "^2.0.1",
"ts-loader": "^7.0.5",
"typescript": "^4.7.4"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@docsearch/css": "^3.1.0",
Expand Down
7 changes: 5 additions & 2 deletions src/components/SubNav/SubNavTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ComponentProps, FunctionComponent, useMemo } from 'react';
import { styled } from '@storybook/theming';
import { LinkTabs } from '@storybook/design-system';
import { LinkProps, LinkTabs } from '@storybook/design-system';
import { breakpoints } from '../shared/styles';
import { Menu } from '../Menu';

Expand All @@ -23,8 +23,11 @@ const TabsMenu = styled(Menu)`
}
`;

type Unpacked<T> = T extends (infer U)[] ? U : T;
type Item = Unpacked<ComponentProps<typeof LinkTabs>['items']> & LinkProps;

interface SubNavTabsProps {
items: ComponentProps<typeof LinkTabs>['items'];
items: Item[];
label: string;
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13797,10 +13797,10 @@ typescript-memoize@^1.0.0-alpha.3:
resolved "https://registry.npmjs.org/typescript-memoize/-/typescript-memoize-1.0.1.tgz#0a8199aa28f6fe18517f6e9308ef7bfbe9a98d59"
integrity sha512-oJNge1qUrOK37d5Y6Ly2txKeuelYVsFtNF6U9kXIN7juudcQaHJQg2MxLOy0CqtkW65rVDYuTCOjnSIVPd8z3w==

typescript@^4.7.4:
version "4.7.4"
resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
typescript@^5.0.4:
version "5.0.4"
resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==

typical@^4.0.0:
version "4.0.0"
Expand Down

0 comments on commit 7f342f0

Please sign in to comment.