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] Consistently export component props (CheckboxProps, etc) so they can be easily overridden #2778

Closed
TomNUSDS opened this issue Feb 23, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists type: feature New feature or request

Comments

@TomNUSDS
Copy link

TomNUSDS commented Feb 23, 2024

Does your feature request relate to a specific USWDS component?

Some input elements have their props exported allowing them to be easily wrapped and customized, but some others do not. It's inconsistent and requires work-arounds like this from nasa.gov and this one from trussworks and this one from dept of labor

Examples of exported props:

Examples of non-exported props:

What USWDS Version is this feature present in?

6.2.0

Is your feature request related to a problem? Please describe.

Searching github shows lots of different work-around for something that could be solved by simply as adding an export keyword to your library.

Describe the solution you'd like

Add export to common component props?

Describe alternatives you've considered

I'm seeing various work-around in open source github repos like:

checkboxProps?: Omit<ComponentProps<typeof CheckboxField>, OptionOmitProps>;`

and

type CheckboxArgs = Parameters<typeof Checkbox>
type CheckboxProps = CheckboxArgs[0]

Additional context

While there are work-arounds, they are more complex and probably shouldn't be required.

@TomNUSDS TomNUSDS added the type: feature New feature or request label Feb 23, 2024
@werdnanoslen
Copy link
Contributor

Hi Tom, this is something we've been looking into, and there is a draft PR that addresses this. If there is anything you'd add to those two, can you comment there please, and we can close this as a duplicate?

@TomNUSDS
Copy link
Author

Sorry for the duplicate request. I thought I searched before opening it.

Thanks again for your continued work on this project!

@werdnanoslen werdnanoslen added the duplicate This issue or pull request already exists label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants