Skip to content

Refactor: Standardize Icon Handle Types to Use AnimatedIconHandle#25

Merged
Abhijit-Jha merged 4 commits intoitshover:masterfrom
luth-v:fix/icon-type
Jan 4, 2026
Merged

Refactor: Standardize Icon Handle Types to Use AnimatedIconHandle#25
Abhijit-Jha merged 4 commits intoitshover:masterfrom
luth-v:fix/icon-type

Conversation

@luth-v
Copy link
Copy Markdown
Contributor

@luth-v luth-v commented Jan 3, 2026

Summary

Refactors all icon components to use the shared AnimatedIconHandle type instead of individual component-specific handle types (e.g., YoutubeIconHandle, TerminalIconHandle, etc.)

// Before: Each icon had its own type
export type YoutubeIconHandle = {
  startAnimation: () => void;
  stopAnimation: () => void;
};

export type TerminalIconHandle = {
  startAnimation: () => void;
  stopAnimation: () => void;
};
// ... repeated 170+ times

Changes

  • Removed component-specific handle type definitions (e.g., YoutubeIconHandle, TerminalIconHandle)
  • Updated imports to include AnimatedIconHandle from ./types
  • Changed forwardRef generic types from forwardRef<SpecificIconHandle, AnimatedIconProps> to forwardRef<AnimatedIconHandle, AnimatedIconProps>
  • Bonus: add Testing section in CONTRIBUTING.md for simple tutorial on testing the icons in both doc site & as library consumer

Special Cases

  • trash-icon.tsx: Preserved the custom TrashIconProps interface as it extends AnimatedIconProps with additional properties (shakeOnClick, dangerHover, keepOpenOnDelete)
  • layout-sidebar-right-collapse-icon.tsx: Skipped as it uses a different pattern (functional component without forwardRef)

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Jan 3, 2026

@luth-v is attempting to deploy a commit to the itshover's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Abhijit-Jha
Copy link
Copy Markdown
Member

Amazing work @luth-v , great refactor overall

Since icon handle types have changed, you’ll need to run npm run registry:build to regenerate the registry.
For more details, please refer to CONTRIBUTION.md.

Also, please test the icons once to ensure everything works as expected after the changes.

@Abhijit-Jha
Copy link
Copy Markdown
Member

Also, since this PR changes the icon handles, the previous Hero section update will need to be adjusted accordingly. Please make sure to update that part as well.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 4, 2026

Important

Review skipped

Too many files!

149 files out of 299 files are above the max files limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@luth-v
Copy link
Copy Markdown
Contributor Author

luth-v commented Jan 4, 2026

@Abhijit-Jha I've built & tested the registry to make sure the icons are working both in documentation page & as library

Doc page

  • All icons in /icons are moving fine on hover

Registry

  • Built the registry files
  • Created new dummy project and run shadcn cli to import icons from registry
  • Icons works and looks fine
image

I also added new section in Contributing.md for simple tutorial on how to test the library locally

@Abhijit-Jha Abhijit-Jha merged commit cef9d63 into itshover:master Jan 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants