-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Checkbox] Component and Hook #159
Conversation
8a2a511
to
b049801
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a very quick pass through! Excited to have this one out, particularly this fast — great work! 💥 One little thing, too, so we don't forget: removing the "Planned" tag from the Checkbox sidenav item on the pages.ts file!
docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js
Outdated
Show resolved
Hide resolved
docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js
Outdated
Show resolved
Hide resolved
docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js
Outdated
Show resolved
Hide resolved
docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.tsx
Outdated
Show resolved
Hide resolved
docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js
Outdated
Show resolved
Hide resolved
docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js
Outdated
Show resolved
Hide resolved
37bfe43
to
97147b4
Compare
5670d18
to
ec78eaf
Compare
skip: ['reactTestRenderer'], | ||
})); | ||
|
||
it('should not render indicator by default', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's worth having an indicator present at all times - to render a different content when the checkbox is unchecked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, it's useful to have it conditionally unmount so it doesn't render the children without needing to hide it with CSS. keepMounted
lets you implement CSS animations
I pushed an empty commit, it seems to fix Circle CI. I don't know why. |
d11f0a8
to
ab9b989
Compare
@oliviertassinari Seems like it started happening again once I pulled and pushed new commits 😞 What I can do is add the revert commit here so the tests can run for approval, then remove it & merge at the end. I hope it's just an artifact of these PRs being opened before the CI change for some reason, so new ones that get opened with fresh commits don't have the issue. |
This could be related: https://discuss.circleci.com/t/certain-jobs-within-workflow-hang-forever-with-no-explanation-just-for-me/39304 @oliviertassinari I suspect that only the org members can trigger workflows using the context you created. Adding @atomiks to the org is one thing, but this setting is not acceptable if we want to accept community contributions. |
The author of mui/mui-x#12484 isn't inside the MUI organization and yet has the same CircleCI context config, it runs. https://discuss.circleci.com/t/certain-jobs-within-workflow-hang-forever-with-no-explanation-just-for-me/39304 has an error message, we don't have one. There are no "restrictions" setup on this context. James is inside the MUI GiHub organization, no? I raised the bug to Circle CI: https://support.circleci.com/hc/en-us/requests/147508. At the very least, the UI should explain what's wrong. I will report back here. |
@oliviertassinari I did file a support request earlier. Here's their response:
So it looks like @michaldudak is right. We should remove the requirement to be in the org for community contributions. I don't know why it worked for the MUI X PR though... my CircleCI account is a bit strange, as when I tried to join the MUI org, I got UpdateSupport unlinked my account and I signed back in with GitHub to the MUI org, and now everything works again. It's possible this may be a problem for community contributors in this repo specifically, or maybe not, so we'll need to keep an eye on it. |
@atomiks the answer I got from CircleCI support:
Ok great, so we can continue to use CircleCI context 🎉 |
Fix test Fix doc wording Add tests for indeterminate prop Fix prop diff Update based on discussions Update demos Add conditional unmounting to CheckboxIndicator Avoid passing keepMounted prop to element Update docs/data/base/components/checkbox/UnstyledCheckboxIndeterminate.js Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: atomiks <[email protected]> Update docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: atomiks <[email protected]> Update docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: atomiks <[email protected]> Update docs/data/base/components/checkbox/UnstyledCheckboxIntroduction/tailwind/index.tsx Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: atomiks <[email protected]> Update docs/data/base/components/checkbox/UnstyledCheckboxIndeterminateGroup.js Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: atomiks <[email protected]> Update docs/data/base/components/checkbox/checkbox.md Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: atomiks <[email protected]> Use 24px size Fix formatting Remove planned from Checkbox Generate API docs and sync with Switch Simplify types Use undefined fallback due to defaults Remove unused file Remove unused colors Simplify API Resolve styling inconsistencies Remove unused inputRef prop Revert otherProps spread location Remove unused colors i18n Try deleting tests Add back CheckboxIndicator tests Bifurcate Checkbox tests Bifurcate Checkbox tests Bifurcate Checkbox tests Bifurcate Checkbox tests Bifurcate Checkbox tests Bifurcate Checkbox tests Bifurcate Checkbox tests Bifurcate Checkbox tests Try deleting Button test Skip tests rerun Reuse variable Update Rerun docs generation Use describeConformance Update tests Update docs ci
{isIndeterminate ? <HorizontalRuleIcon /> : <CheckIcon />} | ||
</Indicator> | ||
</Checkbox> | ||
<Label htmlFor={id} onMouseDown={(e) => e.preventDefault()}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We avoid using shorthands like e
in the codebase, especially for the docs as it makes it not very clear to entry-level developers what the variable is about.
<Label htmlFor={id} onMouseDown={(e) => e.preventDefault()}> | |
<Label htmlFor={id} onMouseDown={(event) => event.preventDefault()}> |
Fixed in 25eb16b to match with the rest of the codebase.
Closes #24.
This implementation closely follows #135. I reimplemented several of the utils files to get working, but they're mostly the same as in that PR, so they'll be merged without too many conflicts (aside from the
getStyleHookProps
utility function). Most of the logic here can actually be reused with that PR, but I assume that could be refactored in the future once both are merged to main.