-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added new icons #1323
added new icons #1323
Conversation
WalkthroughWalkthroughThe recent changes involve the addition of multiple new SVG icon components to a React application. Icons such as Add, Profile, PdfIcon, DocIcon, XlsxIcon, JpgIcon, and PngIcon have been introduced, along with corresponding Storybook configurations for each. The updates include adjustments to export statements and the integration of prop type validation, ensuring consistency and usability across the application. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant IconComponent
participant Storybook
User->>UI: Request to view icons
UI->>IconComponent: Load new SVG icons
IconComponent-->>UI: Render icons
User->>Storybook: View icon stories
Storybook-->>User: Display stories for icons
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (15)
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1)
16-23
: Consider adding more argTypes for enhanced Storybook controls.While the current setup is functional, consider expanding the
argTypes
to include more props that theProfile
component might use. This will provide more interactive controls in Storybook.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1)
16-23
: Consider adding more argTypes for enhanced Storybook controls.Similar to the
Profile
component, consider expanding theargTypes
to include more props that theDocIcon
component might use. This will provide more interactive controls in Storybook.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1)
16-23
: Consider adding more argTypes for enhanced Storybook controls.As with the other components, consider expanding the
argTypes
to include more props that theJpgIcon
component might use. This will provide more interactive controls in Storybook.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.stories.js (2)
1-14
: Ensure consistent prop types and controls.The
argTypes
configuration is minimal. Consider adding more props ifPdfIcon
supports additional props to enhance the Storybook documentation.
16-23
: Consider adding more interactive examples.The current stories provide a default and a playground example. Consider adding more interactive examples if the
PdfIcon
component supports additional props or states.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.stories.js (2)
1-14
: Ensure consistent prop types and controls.The
argTypes
configuration is minimal. Consider adding more props ifPngIcon
supports additional props to enhance the Storybook documentation.
16-23
: Consider adding more interactive examples.The current stories provide a default and a playground example. Consider adding more interactive examples if the
PngIcon
component supports additional props or states.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.stories.js (2)
1-14
: Ensure consistent prop types and controls.The
argTypes
configuration is minimal. Consider adding more props ifXlsxIcon
supports additional props to enhance the Storybook documentation.
16-23
: Consider adding more interactive examples.The current stories provide a default and a playground example. Consider adding more interactive examples if the
XlsxIcon
component supports additional props or states.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js (1)
1-38
: LGTM! Consider using a default value for the style prop.The component is well-structured, and the use of prop types is appropriate. Consider setting a default value for the
style
prop to ensure consistency.Apply this diff to set a default value for the style prop:
export const Profile = ({ className, style = {}, width = "32", height = "32" }) => ( - <svg - className={className} - style={{ ...style }} - width={width} - height={height} - viewBox="0 0 64 64" - fill="none" - xmlns="http://www.w3.org/2000/svg" - > + <svg className={className} style={style} width={width} height={height} viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js (1)
1-38
: LGTM! Consider using a default value for the style prop.The component is well-structured, and the use of prop types is appropriate. Consider setting a default value for the
style
prop to ensure consistency.Apply this diff to set a default value for the style prop:
export const PdfIcon = ({ className, style = {}, width = "33", height = "36", fill = "none" }) => ( - <svg - style={style} - width={width} - height={height} - viewBox="0 0 33 36" - fill={fill} - xmlns="http://www.w3.org/2000/svg" - className={className} - > + <svg style={style} width={width} height={height} viewBox="0 0 33 36" fill={fill} xmlns="http://www.w3.org/2000/svg" className={className}>micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js (1)
1-44
: LGTM! Consider using a default value for the style prop.The component is well-structured, and the use of prop types is appropriate. Consider setting a default value for the
style
prop to ensure consistency.Apply this diff to set a default value for the style prop:
export const XlsxIcon = ({ className, style = {}, width = "38", height = "38", fill = "none" }) => ( - <svg style={style} width={width} height={height} viewBox="0 0 38 38" fill={fill} xmlns="http://www.w3.org/2000/svg" className={className}> + <svg style={style} width={width} height={height} viewBox="0 0 38 38" fill={fill} xmlns="http://www.w3.org/2000/svg" className={className}>micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1)
22-31
: Consider adding more detailed prop type validation.While the current prop types provide basic validation, consider using more specific types or default values for
style
to ensure consistency and prevent runtime errors.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1)
21-30
: Consider adding more detailed prop type validation.While the current prop types provide basic validation, consider using more specific types or default values for
style
to ensure consistency and prevent runtime errors.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1)
35-44
: Consider adding more detailed prop type validation.While the current prop types provide basic validation, consider using more specific types or default values for
style
to ensure consistency and prevent runtime errors.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
micro-ui/web/micro-ui-internals/packages/svg-components/package.json
is excluded by!**/*.json
Files selected for processing (17)
- micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/CHANGELOG.md (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/index.js (2 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.stories.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.stories.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.stories.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js (1 hunks)
- micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.stories.js (1 hunks)
Additional context used
Path-based instructions (16)
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.stories.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js (1)
Pattern
**/*.js
: checkmicro-ui/web/micro-ui-internals/packages/svg-components/src/index.js (1)
Pattern
**/*.js
: check
Additional comments not posted (13)
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.stories.js (1)
1-14
: Storybook setup looks good.The default export and component setup for Storybook are correctly configured.
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.stories.js (1)
1-14
: Storybook setup looks good.The default export and component setup for Storybook are correctly configured.
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.stories.js (1)
1-14
: Storybook setup looks good.The default export and component setup for Storybook are correctly configured.
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.stories.js (1)
1-29
: LGTM!The Storybook configuration for the
Add
component is well-structured and follows best practices.micro-ui/web/micro-ui-internals/packages/svg-components/CHANGELOG.md (1)
3-4
: LGTM!The changelog entry for version 1.0.11 is clear and consistent with previous entries.
micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js (1)
1-47
: LGTM!The
Add
component is well-implemented with prop types validation and default props. The use of the spread operator for additional props is a good practice.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js (1)
4-20
: Ensure default prop values are appropriate.The component provides default values for
width
,height
,fill
, andstyle
. Ensure these defaults align with the design specifications and requirements.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js (1)
4-19
: Ensure default prop values are appropriate.The component provides default values for
width
,height
,fill
, andstyle
. Ensure these defaults align with the design specifications and requirements.micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js (1)
4-33
: Ensure default prop values are appropriate.The component provides default values for
width
,height
,fill
, andstyle
. Ensure these defaults align with the design specifications and requirements.micro-ui/web/micro-ui-internals/packages/react-components/src/atoms/SVG.js (2)
791-797
: Ensure consistency in the export object.The newly added icons
Add
,Profile
,PdfIcon
,DocIcon
,XlsxIcon
,JpgIcon
, andPngIcon
should maintain consistency with the existing export structure.Ensure that the export object structure is consistent with the rest of the file.
2-8
: Verify the availability of new icons in the package.Ensure that the newly added icons
Add
,Profile
,PdfIcon
,DocIcon
,XlsxIcon
,JpgIcon
, andPngIcon
are available in the@egovernments/digit-ui-svg-components
package.Run the following script to verify the availability of these icons:
micro-ui/web/micro-ui-internals/packages/svg-components/src/index.js (2)
809-815
: Ensure consistency in export statements.The newly added icons (
Add
,Profile
,PdfIcon
,DocIcon
,XlsxIcon
,PngIcon
,JpgIcon
) are correctly included in the export list. Ensure that these components are used consistently across the application.
1-7
: Verify import paths.Ensure that the paths for the newly added SVG components (
Add
,Profile
,PdfIcon
,DocIcon
,XlsxIcon
,PngIcon
,JpgIcon
) are correct and that these files exist in the specified directory.Run the following script to verify the existence of these files:
Verification successful
All import paths are correct.
The specified SVG component files (
Add.js
,Profile.js
,PdfIcon.js
,DocIcon.js
,XlsxIcon.js
,PngIcon.js
,JpgIcon.js
) exist in the directory./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/
. The import paths in the code are correct.
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Add.js
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Profile.js
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PdfIcon.js
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/DocIcon.js
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/XlsxIcon.js
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/PngIcon.js
./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/JpgIcon.js
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of newly added SVG components. # Test: Check if the SVG component files exist. Expect: All files should exist. fd --type f --name "Add.js" --name "Profile.js" --name "PdfIcon.js" --name "DocIcon.js" --name "XlsxIcon.js" --name "PngIcon.js" --name "JpgIcon.js" ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Length of output: 454
Script:
#!/bin/bash # Description: Verify the existence of newly added SVG components. # Test: Check if the SVG component files exist. Expect: All files should exist. fd --type f --regex "(Add|Profile|PdfIcon|DocIcon|XlsxIcon|PngIcon|JpgIcon)\.js" ./micro-ui/web/micro-ui-internals/packages/svg-components/src/svg/Length of output: 997
No description provided.