-
-
Notifications
You must be signed in to change notification settings - Fork 461
feat(checkbox): add checkbox indeterminate prop #1155
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(checkbox): add checkbox indeterminate prop #1155
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1155 +/- ##
==========================================
- Coverage 99.54% 97.29% -2.26%
==========================================
Files 163 216 +53
Lines 6621 9244 +2623
Branches 401 541 +140
==========================================
+ Hits 6591 8994 +2403
- Misses 30 250 +220 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f1a8478
to
22e6f68
Compare
Hey thanks for the contribution! I don't have the time to look at this right now but forgive me for jumping in and rebasing, we're trying to figure out what's wrong with codecov. Thank you for your patience! @grasdira |
const theme = mergeDeep(getTheme().checkbox, customTheme); | ||
|
||
const inputRef = useRef<HTMLInputElement | null>(null); |
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.
can't this be done using custom data attribute prop (eg: data-...
) instead of injecting it through ref and checking the data attribute with tailwind directly in this file? 🤔
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.
Hi, @SutuSebastian . I have provided my responses in this comment. Please review them at your earliest convenience.
Anyone still working on this? |
Doesn't seem like it 🤔 |
I'm really sorry for not keeping up with this PR 😔 |
Hi!
What are your opinions on these changes? |
tailwind.config.ts
Outdated
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.
Enforcing the users to apply the same config into their tailwind config is not the way to go, the only thing they'd have to configure is primary and secondary colors override, if needed.
On top of that, needing a custom tailwind config just for a simple component state, is a bit over-engineered. We need to find a simple solution here, that does not spill out more than the components context/folder.
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 certainly understand we should not ask user to update their Tailwind config. But I do noticed that the indeterminate state's style definition isn't covered by default in Flowbite.
Is it a better way to integrate indeterminate state's styles directly into Flowbite's default stylesheet, so that all users have access without extra configuration?
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.
U mean to include the indeterminate into flowbite/plugin?
I'd rather have it at the component level, its just a matter of a dash icon and an extra prop.
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 can also see in the core library plugin, we already have it: https://github.com/themesberg/flowbite/blob/main/plugin.js#L350
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 wasn't aware that the indeterminate state's style had already been defined in the plugin. Thank you for pointing me to it.
I'll update and resubmit shortly.
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.
@SutuSebastian Hey, am I allowed to update flowbite
to the latest version.
I just found out the indeterminate state icon changed in a recent commit , and it's causing the icon keep showing the check icon before. 😲
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.
Sure, go ahead
…f checkbox :indeterminate Override the original style of [type='checkbox']:indeterminate. themesberg#871
…r indeterminate checkbox Add an example of using the indeterminate state to handle multiple checkboxes in a group of tree structure. themesberg#871
Added extended theme 'colors.current' and 'backgroundImage.indeterminate' to set default styles for indeterminate checkbox themesberg#871
…yles remove [type='checkbox']:indeterminate styles to make development more flexibility themesberg#871
…the indeterminate state 'indeterminate:bg-indeterminate' uses the extended backgroundImage in `tailwind.config.ts`; 'dark:indeterminate:bg-current dark:indeterminate:border-gray-600' fixes checkbox's bg-color and border under dark mode themesberg#871
a1bfc21
to
1943cc3
Compare
The indeterminate icon fixed in a recent commit: themesberg/flowbite@ec0eab5 Upgrade flowbite version to apply changes. themesberg#871
Start from the discussion #870
Related to #871
There are no breaking API changes.
Here are my changes:
.storybook/style.css
anddocs.css
to override the default styles: