Skip to content
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: readonly toggle #12402

Merged
merged 6 commits into from
Nov 14, 2022
Merged

Conversation

lee-chase
Copy link
Member

@lee-chase lee-chase commented Oct 26, 2022

Contributes to #2177
Closes #12407

Adds the read-only feature to the Toggle component

Changelog

Added

  • Adds readOnly property to Toggle and functionality
  • Adds test for read-only Toggle
  • Adds styling for read-only Toggle (on and off).

Testing / Reviewing

Reviewed the result in Storybook and a added read-only test.

@lee-chase
Copy link
Member Author

@quarryboy current implementation assumes 1px offset of readonly switch 'md' size was a mistake and commission of check mark at small sizes an oversight.

Both are easy to fix.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c456206
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/63728e5eb743af00087ae8b2
😎 Deploy Preview https://deploy-preview-12402--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 26, 2022

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit c456206
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/63728e5e462e6a0008ef5f75
😎 Deploy Preview https://deploy-preview-12402--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, but otherwise looks great

// ----------------------------------------
// readonly
// ----------------------------------------
// should this be a token of it's own?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we've determined we won't be making tokens for these

Suggested change
// should this be a token of it's own?

@tw15egan tw15egan requested review from a team and laurenmrice and removed request for a team November 8, 2022 16:07
Copy link
Member

@laurenmrice laurenmrice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@kodiakhq kodiakhq bot merged commit 4fd8c24 into carbon-design-system:main Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Read-only inputs]: Toggle implementation
4 participants