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

draft new idea for selector component #7222

Closed

Conversation

britt6612
Copy link
Collaborator

What does this PR do?

Status: Early draft state for component/API feedback. Selection, accessibility, theming, keyboard logic has not been implemented.

Implemented the same storybook example as in Taylor PR

Introduces new set of "Selector" components:

  • SelectorGroup
  • Selector
  • SelectorIndicator
Component Styling responsibilities State/behavior responsibilities Configurable props
SelectorGroup None Manages selected state, passes down via context --
Selector none We will use selected state from this component --
SelectorIndicator none Renders selection indicator (RadioButton/CheckBox)

Considerations for how this was built

In this approach there are just 3 components:

  • SelectorGroup (just a context provider but doesn’t enforce any layout)
  • Selector (just a context consumer that passes selected state to its child render function and maybe Box container for proper accessibility role)
  • SelectorIndicator (RadioButton/CheckBox)

Where should the reviewer start?

What testing has been done on this PR?

How should this be manually tested?

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

Closes grommet/hpe-design-system#3840

Screenshots (if appropriate)

Do the grommet docs need to be updated?

Should this PR be mentioned in the release notes?

Is this change backwards compatible or is it a breaking change?

@britt6612 britt6612 marked this pull request as draft May 6, 2024 17:11
@britt6612
Copy link
Collaborator Author

Closing this PR as we've decided it doesn't warrant a Grommet component at this time.

@britt6612 britt6612 closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Draft PR for Selector component
1 participant