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

Proposal: start using enums instead of booleans for prop variants #187

Closed
haworku opened this issue May 20, 2020 · 2 comments · Fixed by #229
Closed

Proposal: start using enums instead of booleans for prop variants #187

haworku opened this issue May 20, 2020 · 2 comments · Fixed by #229
Assignees
Labels
high priority Active blocker for a current project or just urgent

Comments

@haworku
Copy link
Contributor

haworku commented May 20, 2020

We have several components such as Header, Footer, Button, and maybe even aspects of Grid, with boolean props that can conflict.

For example, you should not have the big and medium prop applied to the same footer. Some of this should be on the developer to use our props ... properly 😝... AND we also could starting using variants as well when helpful.

Instead of booleans we could move towards a single prop named something like size or type that accepts one of these types. The types would be enums. How do folks feel about this? Is this something we could start code reviewing for and document as practice?

Proposed requirements to close this issue:

@suzubara suzubara added status: needs requirements This issue is NOT ready for development - it needs further scope clarification or questions answered and removed looking for feedback labels May 20, 2020
@suzubara
Copy link
Contributor

agreed this is the way to go!

@suzubara suzubara added the high priority Active blocker for a current project or just urgent label Jun 1, 2020
@haworku
Copy link
Contributor Author

haworku commented Jun 2, 2020

For requirements, I reworded this ticket to be about adding a type variant to the Button component to start.

@haworku haworku removed the status: needs requirements This issue is NOT ready for development - it needs further scope clarification or questions answered label Jun 2, 2020
ahobson pushed a commit that referenced this issue Jun 4, 2020
Provide a size enum to eventually replace the small and big boolean props on Button

re #187
ahobson pushed a commit that referenced this issue Jun 4, 2020
Provide a size enum to eventually replace the small and big boolean props on Button

re #187
@ahobson ahobson self-assigned this Jun 4, 2020
ahobson pushed a commit that referenced this issue Jun 4, 2020
Provide a size enum to eventually replace the small and big boolean props on Button

re #187
ahobson pushed a commit that referenced this issue Jun 5, 2020
Provide a size enum to eventually replace the small and big boolean props on Button

re #187
@haworku haworku linked a pull request Jun 5, 2020 that will close this issue
ahobson pushed a commit that referenced this issue Jun 5, 2020
Provide a size enum to eventually replace the small and big boolean props on Button

re #187
ahobson added a commit that referenced this issue Jun 5, 2020
* feat(button): size enum on Button component

Provide a size enum to eventually replace the small and big boolean props on Button

re #187

* feat(Button): Add deprecation warnings, size preferred

* Log deprecation warnings
* Prefer size over big/small; test that interaction

* Comment deprecationWarning in production

* Button prop deprecation starts in v1.6.0
DanielMiller-agile6 pushed a commit to DanielMiller-agile6/react-uswds that referenced this issue Jun 25, 2020
…works#229)

* feat(button): size enum on Button component

Provide a size enum to eventually replace the small and big boolean props on Button

re trussworks#187

* feat(Button): Add deprecation warnings, size preferred

* Log deprecation warnings
* Prefer size over big/small; test that interaction

* Comment deprecationWarning in production

* Button prop deprecation starts in v1.6.0
haworku pushed a commit that referenced this issue Jun 29, 2020
* feat(button): size enum on Button component

Provide a size enum to eventually replace the small and big boolean props on Button

re #187

* feat(Button): Add deprecation warnings, size preferred

* Log deprecation warnings
* Prefer size over big/small; test that interaction

* Comment deprecationWarning in production

* Button prop deprecation starts in v1.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority Active blocker for a current project or just urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants