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

FORNO-1690: Add toggle-group component #415

Merged
merged 13 commits into from
Jul 4, 2024
Merged

Conversation

aswasif007
Copy link
Contributor

@aswasif007 aswasif007 commented Jun 23, 2024

Description

Add toggle group component.
Click for design.

Screenshot 2024-06-24 at 12 38 45 AM

Checklist

  • This PR has good automated test coverage
  • The storybook for the component has been updated

Steps to Test

  1. Pull down PR.
  2. npm run dev.
  3. Open Storybook.
  4. Eat cookies.
  5. Verify cookies are delicious.

Copy link

netlify bot commented Jun 23, 2024

Deploy Preview for vip-design-system-components ready!

Name Link
🔨 Latest commit f25ad0f
🔍 Latest deploy log https://app.netlify.com/sites/vip-design-system-components/deploys/668693866177dd0008c949ad
😎 Deploy Preview https://deploy-preview-415--vip-design-system-components.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 configuration.

Copy link
Contributor

@djalmaaraujo djalmaaraujo left a comment

Choose a reason for hiding this comment

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

Thanks for bringing this to the vip-design-system, I really appreciate!

It looks like the implementation of this component is very similar to the RadioBoxGroup. Also, there are some concerning accessibility issues with the tabIndex implemented.

Can you check how much work would take to improve RadioBoxGroup and make this a variant of that component? Maybe a chip variant. I am not the best for names, but I can see a big future on extending RadioBoxGroup.

Thank you!

src/system/Form/ToggleGroup.tsx Outdated Show resolved Hide resolved
src/system/Form/ToggleGroup.tsx Outdated Show resolved Hide resolved
src/system/Form/ToggleGroup.stories.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@djalmaaraujo djalmaaraujo left a comment

Choose a reason for hiding this comment

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

@aswasif007 Can you check Storybook A11Y issues?

image

Ps: This is a "radio" choice, so it must have a "radio" input under the hood. You should be able to navigate the keyboard keys left and right. Could you check the original RadioBoxGroup and navigate using the arrow keys?

src/system/Form/RadioBoxGroup.js Outdated Show resolved Hide resolved
src/system/Form/RadioBoxGroup.js Outdated Show resolved Hide resolved
src/system/Form/RadioBoxGroup.js Outdated Show resolved Hide resolved
src/system/Form/RadioBoxGroup.js Outdated Show resolved Hide resolved
src/system/Form/RadioBoxGroup.stories.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@djalmaaraujo djalmaaraujo left a comment

Choose a reason for hiding this comment

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

I left comments in the existing threads.

Co-authored-by: Todd Wright <4177859+t-wright@users.noreply.github.com>
Copy link
Contributor

@t-wright t-wright left a comment

Choose a reason for hiding this comment

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

Thanks for working on this 🎉 LGTM

@aswasif007
Copy link
Contributor Author

Thanks Todd!

Djalma is on vacation so merging without his approval.

@aswasif007 aswasif007 merged commit d82b3ee into trunk Jul 4, 2024
8 checks passed
@aswasif007 aswasif007 deleted the forno-1690/add/toggle-group branch July 4, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants