Skip to content

Commit f33f77a

Browse files
committed
fix: update @tenphi/tasty to 1.4.2 and resolve all TypeScript errors
Update tasty to 1.4.2 for the filterBaseProps generic fix (T extends object). Fix 127 pre-existing TypeScript errors across the codebase: - Widen extractStyles param to object with internal cast - Add storybook/test type shim for vitest version mismatch - Migrate @storybook/react imports to @storybook/react-vite - Type CSF2 story functions with StoryFn - Fix forwardRef casts for DateInput/DateRangePicker - Fix test APIs (fake timers, rerender args, HTMLCollection) - Fix misc type mismatches in stories and components Made-with: Cursor
1 parent f8ef25e commit f33f77a

34 files changed

Lines changed: 281 additions & 71 deletions

File tree

.changeset/tasty-1-4-0-update.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
"@cube-dev/ui-kit": minor
3-
---
42

5-
Update `@tenphi/tasty` to `1.4.0`.
3+
## "@cube-dev/ui-kit": minor
4+
5+
Update `@tenphi/tasty` to `1.4.2`.
66

77
- Hook-free `tasty()` components, enabling React Server Component compatibility.
88
- New `tokenProps` option for exposing token keys as top-level component props.
99
- Popularity-aware garbage collector for unused styles with `gc()`, `maybeGC()`, and `touch()` APIs.
1010
- Internal properties now overridable via `configure({ properties })`.
11+
- `filterBaseProps` is now generic — accepts strongly-typed props without casting.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@react-types/shared": "^3.32.1",
7575
"@tabler/icons-react": "^3.31.0",
7676
"@tanstack/react-virtual": "^3.13.12",
77-
"@tenphi/tasty": "1.4.0",
77+
"@tenphi/tasty": "1.4.2",
7878
"clipboard-copy": "^4.0.1",
7979
"clsx": "^1.1.1",
8080
"diff": "^8.0.3",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/_internal/hooks/use-timer/use-timer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('useTimer', () => {
77
const callback = vi.fn();
88

99
beforeAll(() => {
10-
vi.useFakeTimers('modern');
10+
vi.useFakeTimers();
1111
});
1212

1313
beforeEach(() => {
@@ -81,7 +81,7 @@ describe('useTimer', () => {
8181

8282
expect(result.current.timer?.status).toBe('running');
8383

84-
rerender({ isDisabled: true });
84+
rerender({ callback, delay: 10, isDisabled: true });
8585

8686
vi.runAllTimers();
8787

src/components/actions/Banner/Banner.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Space } from '../../layout/Space';
55

66
import { Banner, BannerProps } from './Banner';
77

8-
import type { Meta, StoryFn } from '@storybook/react';
8+
import type { Meta, StoryFn } from '@storybook/react-vite';
99

1010
const meta = {
1111
title: 'Actions/Banner',

src/components/actions/CommandMenu/CommandMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ function CommandMenu<T extends object>(
542542

543543
return (
544544
<StyledCommandMenu
545-
{...filterBaseProps(props)}
545+
{...(filterBaseProps(props) as Record<string, unknown>)}
546546
ref={domRef}
547547
qa={qa || 'CommandMenu'}
548548
data-size={size}

src/components/actions/Link/Link.stories.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { baseProps } from '../../../stories/lists/baseProps';
22

33
import { Link } from './Link';
44

5+
import type { StoryFn } from '@storybook/react-vite';
6+
57
export default {
68
title: 'Navigation/Link',
79
component: Link,
@@ -28,7 +30,7 @@ const Template = ({ isDisabled, label }) => (
2830
</Link>
2931
);
3032

31-
export const Default = Template.bind({});
33+
export const Default: StoryFn = Template.bind({});
3234
Default.args = {
3335
label: 'Link',
3436
};

src/components/actions/Menu/Menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ function Menu<T extends object>(
232232
qa={qa}
233233
styles={styles}
234234
mods={wrapperMods}
235-
{...filterBaseProps(completeProps)}
235+
{...(filterBaseProps(completeProps) as Record<string, unknown>)}
236236
>
237237
{header ? (
238238
<StyledHeader data-size={size} styles={headerStyles}>

src/components/content/ActiveZone/ActiveZone.stories.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { TooltipTrigger } from '../../overlays/Tooltip/TooltipTrigger';
44

55
import { ActiveZone } from './ActiveZone';
66

7+
import type { StoryFn } from '@storybook/react-vite';
8+
79
export default {
810
title: 'Content/ActiveZone',
911
component: ActiveZone,
@@ -25,12 +27,12 @@ const TooltipTemplate = ({ isDisabled, label }) => (
2527
</TooltipTrigger>
2628
);
2729

28-
export const Default = Template.bind({});
30+
export const Default: StoryFn = Template.bind({});
2931
Default.args = {
3032
label: 'ActiveZone',
3133
};
3234

33-
export const WithTooltip = TooltipTemplate.bind({});
35+
export const WithTooltip: StoryFn = TooltipTemplate.bind({});
3436
WithTooltip.args = {
3537
label: 'ActiveZone',
3638
};

src/components/content/Disclosure/Disclosure.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ describe('Nested Disclosures', () => {
490490

491491
describe('Content Preservation', () => {
492492
beforeEach(() => {
493-
vi.useFakeTimers({ legacyFakeTimers: false });
493+
vi.useFakeTimers();
494494
});
495495

496496
afterEach(() => {

0 commit comments

Comments
 (0)