Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR converts the icons package (src/icons folder only) to TypeScript. The package has been published as v1.2.1 and is already in use in the Seller app. The conversion adds proper type safety for React SVG components while maintaining backward compatibility.
Key Changes:
- Converted helper files from JavaScript to TypeScript with proper type definitions
- Added TypeScript types to all icon components (props: React.SVGProps)
- Added build configuration (tsconfig.json, vite.config.js) for TypeScript compilation
- Maintained existing functionality while adding type safety
Reviewed changes
Copilot reviewed 21 out of 243 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/icons/tsconfig.json |
TypeScript configuration for the icons package with React support |
src/icons/vite.config.js |
Build configuration using Vite with TypeScript plugin for declaration generation |
src/icons/postcss.config.js |
PostCSS configuration for Tailwind CSS processing |
src/icons/src/helpers/icon.tsx |
Converted to TypeScript with proper type definitions for IconProps and IconComponent |
src/icons/src/helpers/iconSizes.ts |
Converted to TypeScript with const assertion for type safety |
src/icons/src/helpers/classnames.js |
New utility function for merging Tailwind classes |
src/icons/src/images/*.tsx |
All image components updated with React.SVGProps types |
src/icons/src/*.tsx |
All icon components updated with proper TypeScript types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Change React peerDependency from ^18.3.1 to >=17 - Allows icons package to work with React 17, 18, 19, and future versions - Provides better compatibility for projects on different React versions
- Downgraded Vite to v4.5.3 for Node 16 support - Downgraded vite-plugin-dts, @xola/jslint, and eslint to compatible versions - Added postcss-load-config override to ensure Node 16 compatibility - Converted postcss.config.js from ES module to CommonJS format - Package now exports both CJS and ESM formats for maximum compatibility
Update all icon imports from `from "../../icons"` to `from "../../icons/index.js"` to prevent Vite from treating src/icons as a package during build.
- Added ignorePatterns to .xo-config.json for src/icons and src/stories - Simplified lint scripts in package.json by removing redundant --ignore flags - Configuration now centralized in .xo-config.json file
- Fixed import order in ComboBox.jsx - Changed clsx import to named export in LocalizedDayPicker.tsx - Auto-fixed formatting issues (spacing, line breaks) - Auto-fixed switch case braces in GooglePlacesAutocomplete.jsx - Auto-fixed prefer-at and prefer-string-replace-all issues - Auto-fixed import type issues in TypeScript files
45e9344 to
951609b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts the icons package (
src/icons) to TypeScript and separates it from the main UI Kit package.Changes
.jsxto.tsxwith proper TypeScript types@xola/ui-kitpackage - icons now only available via@xola/iconsPackage Sizes
Published
This
@xola/iconspackage is already published on NPM as v1.2.4 and raised as a PR in the Seller app: https://github.com/xola/x2-seller/pull/6360