-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(Icons): icons should be decorative by default #360
feat(Icons): icons should be decorative by default #360
Conversation
WalkthroughThe changes across various packages aim to improve accessibility by replacing the Changes
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 Configration 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.
Review Status
Actionable comments generated: 1
Configuration used: .coderabbit.yaml
Files selected for processing (6)
- packages/documentation/.ladle/components.tsx (1 hunks)
- packages/documentation/src/System/Icons.stories.tsx (1 hunks)
- packages/ui-icons/src/components/Icons/IconsTypes.d.ts (2 hunks)
- packages/ui-private/src/components/SvgIcon/SvgIcon.tsx (2 hunks)
- packages/ui-private/src/components/SvgIcon/SvgIconTypes.d.ts (2 hunks)
- packages/ui-private/src/components/SvgIcon/tests/SvgIcon.test.tsx (1 hunks)
Additional comments: 8
packages/ui-icons/src/components/Icons/IconsTypes.d.ts (1)
- 16-21: The addition of the
semantic
property to theIconsProps
interface is correctly implemented, with clear documentation on its purpose and default value. This change enhances accessibility by providing a clearer distinction between decorative and semantic icons.packages/ui-private/src/components/SvgIcon/SvgIcon.tsx (3)
- 15-15: Setting the default value of
semantic
tofalse
in theSvgIcon
component is correctly implemented, aligning with the PR objectives.- 31-31: Correctly updating the
aria-hidden
attribute based on thesemantic
property enhances accessibility by ensuring that only semantic icons are announced to assistive technologies.- 37-37: Conditionally rendering the
title
element based on thesemantic
property is a good practice for accessibility, ensuring that titles are only provided for semantic icons.packages/ui-private/src/components/SvgIcon/SvgIconTypes.d.ts (1)
- 30-35: The addition of the
semantic
property to theSvgIconProps
type is correctly implemented, with clear documentation on its purpose and default value. This change enhances accessibility by explicitly specifying if the icon should be announced to assistive technologies.packages/documentation/.ladle/components.tsx (1)
- 56-56: The removal of the
decorative
prop from the<IconGitHub />
component aligns with the PR objectives of shifting the focus from decorative to semantic icons.packages/ui-private/src/components/SvgIcon/__tests__/SvgIcon.test.tsx (2)
- 51-64: The test verifying that icons render as decorative by default is correctly implemented, effectively validating the default behavior of the
SvgIcon
component.- 66-80: The test verifying that the
semantic
prop is honored is correctly implemented, ensuring that theSvgIcon
component behaves as expected when thesemantic
property is set.
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.
Review Status
Actionable comments generated: 1
Configuration used: .coderabbit.yaml
Files selected for processing (2)
- packages/ui-components/src/components/Bubble/Bubble.tsx (1 hunks)
- packages/ui-components/src/components/Button/tests/ButtonIcon.test.tsx (6 hunks)
Additional comments: 1
packages/ui-components/src/components/Bubble/Bubble.tsx (1)
- 76-76: The removal of the
decorative
prop from<IconCopied />
and<IconCopy />
aligns with the PR's objective to emphasize semantic over decorative icon handling. However, it's important to ensure that thesemantic
prop or equivalent logic is correctly implemented elsewhere to maintain accessibility standards. If thesemantic
prop is intended to replacedecorative
, its usage should be explicitly handled to ensure icons are accessible to assistive technologies.
packages/ui-components/src/components/Button/__tests__/ButtonIcon.test.tsx
Show resolved
Hide resolved
Bundle Size (components)
Overall bundle size: 87.91 KB (-2.77 KB -3.05%) Bundle Size (system)
Overall bundle size: 49.06 KB |
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.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- packages/documentation/src/System/Icons.stories.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/documentation/src/System/Icons.stories.tsx
Summary by CodeRabbit
New Features
semantic
property for icons, replacing thedecorative
property. This update ensures a clearer differentiation between decorative and semantic icons, improving support for assistive technologies.Refactor
decorative
prop tosemantic
across components, adjusting logic to align with accessibility enhancements.Tests
semantic
property, ensuring icons are properly announced by assistive technologies as needed.