-
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
fix(Toggle): better dark and light modes #418
Conversation
Bundle Size (components)
Overall bundle size: 79.29 KB (-4 B 0.00%) Bundle Size (form components)
Overall bundle size: 49.22 KB (+71 B +0.14%) Bundle Size (system)
Overall bundle size: 52.98 KB (+55 B +0.10%) |
WalkthroughThe update introduces a new 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: 0
Configuration used: .coderabbit.yaml
Files selected for processing (6)
- packages/documentation/nodemon.json (1 hunks)
- packages/documentation/src/Form/Toggle.stories.tsx (1 hunks)
- packages/ui-form/src/components/Toggle/Toggle.tsx (1 hunks)
- packages/ui-form/src/components/Toggle/ToggleTypes.d.ts (2 hunks)
- packages/ui-form/src/components/Toggle/tests/Toggle.test.tsx (3 hunks)
- packages/ui-form/src/components/Toggle/utilities.ts (4 hunks)
Additional comments: 9
packages/documentation/nodemon.json (1)
- 9-9: The addition of
"../ui-form/src/**/*.*"
to thenodemon.json
configuration is a good enhancement for automatically restarting the server on changes within theui-form
package. This should improve the development experience for those working on the Toggle component and related functionalities.Just a note: If the
ui-form/src
directory contains a large number of files or if files within it are frequently modified, this could potentially increase CPU usage during development. It might be beneficial to monitor this aspect if developers experience slower performance.packages/ui-form/src/components/Toggle/Toggle.tsx (1)
- 11-11: The addition of the
focusMode
property with a default value of"system"
is a thoughtful enhancement, allowing the Toggle component to better adapt to different UI themes by adjusting the focus ring color. This change aligns well with the PR's objectives.It's important to test these changes across different browsers and devices to ensure consistent behavior, especially since focus styles can sometimes behave differently across environments.
packages/documentation/src/Form/Toggle.stories.tsx (2)
- 14-14: Initializing the
checked
state astrue
in theBasic
story is a good practice, as it provides a clear example of the Toggle component's behavior when it's active.- 24-26: Including
focusMode
,labelHidden
, andlabel
props in theBasic
story is an excellent way to showcase the new functionalities of the Toggle component. This enhances the documentation and provides developers with clear examples of how to use these properties.packages/ui-form/src/components/Toggle/ToggleTypes.d.ts (1)
- 17-26: The addition of the
checked
andfocusMode
properties to theToggleProps
type is well-implemented. These changes enhance the component's configurability and ensure type safety, which is crucial for maintaining code quality and improving the developer experience.packages/ui-form/src/components/Toggle/utilities.ts (3)
- 11-29: The introduction of the
getToggleKnobFocusClasses
function is a significant enhancement, enabling dynamic adjustment of focus styles based on thefocusMode
. This is a thoughtful addition that contributes to the component's adaptability and user experience.- 59-63: Adjusting the
getToggleColorClasses
function to accept themode
parameter is a good practice, as it allows for more flexible styling based on the component's mode. This contributes to the component's adaptability to different UI themes.- 97-114: The update to the
getToggleClasses
function to incorporate thefocusMode
parameter and the refinements to other utility functions enhance the component's performance, appearance, and maintainability. These changes are well-aligned with the PR's objectives.packages/ui-form/src/components/Toggle/__tests__/Toggle.test.tsx (1)
- 26-63: The updated test cases, including assertions for classes on toggle elements based on the toggle state and mode, are comprehensive and well-implemented. These changes are crucial for ensuring the component's reliability and consistency across different modes.
It's important to continue expanding test coverage as new features are added, to maintain high code quality and reliability.
🤖 I have created a release *beep* *boop* --- <details><summary>ui-form: 1.1.1</summary> ## [1.1.1](ui-form-v1.1.0...ui-form-v1.1.1) (2024-03-15) ### Bug Fixes * **Toggle:** better dark and light modes ([#418](#418)) ([e3231cf](e3231cf)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: aversini <[email protected]>
Summary by CodeRabbit
focusMode
property for the Toggle component, allowing users to customize the focus ring color according to their preference or system settings.focusMode
feature and other enhancements likelabelHidden
andlabel
props.