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

style date pickers #876

Merged
merged 5 commits into from
Aug 7, 2023
Merged

style date pickers #876

merged 5 commits into from
Aug 7, 2023

Conversation

brandonreid
Copy link
Contributor

Styles the DateInput, DatePicker, and DateRangeInput components. I also hit up some buttons I missed previously as my find-all was for <p-button but there were a number of <PButton instances out there.

@@ -33,6 +33,7 @@
const props = defineProps<{
primary?: boolean,
flat?: boolean,
selected?: boolean,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's selected in relation to a button? i believe this was moved from the button group component but I don't think it makes sense here. There's no model value on this component so all this does is provide alternate styling. I'd move this back to the button group.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A number of additional components in the date picker also utilize a selected style, so at that point I opted to centralize these styles in the button. In the context of a small module like this, it felt reasonably to allow for selected style buttons:

Screen.Recording.2023-08-07.at.11.50.55.AM.mov

So if keeping it, I should surface a model value for selected so it can be used like <p-button v-model:selected="condition" />, huh?

Copy link
Contributor

@znicholasbrown znicholasbrown Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to surface a v-model for it since the button doesn't change that value (so there's never a need to emit the value back to the parent) - selected isn't a typical button state. Perhaps active as a boolean attribute is more closely in line with how you intend to use this and would give you the opportunity to merge the logic here with what already exists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. So I had this prop named active, but changed it to selected just to be in alignment with the token name. The token name is selected > active since active is used as a token modifier for active states on things.

The experience of the button in this state does consistently constitute a selected button option in a group of others, just in the case of the date picker, there's lots of options spread out in a different layout than the ButtonGroup component.

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose there's no harm in naming the prop active or activated (which might be what I actually had before, to distinguish from the active/pressed button state). I might reach out for a huddle to think through this one. I'm not sure I fallow what you mean by "would give you the opportunity to merge the logic here with what already exists" as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm ok I think this is sort of muddying the waters of responsibility for this component but short of changing how you intend to use it I think this is fine. I'd prefer that button groups (which aren't semantic elements afaik) would instead be styled radio buttons or tablist elements and wouldn't actually be wrapping the PButton component. Since selected doesn't add any accessibility attributes it's probably ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great point on button groups actually.. I agree on the sentiment as well. To sleep well tonight I made a ticket for addressing bucket groups. Will push on for now.

Base automatically changed from context-nav-components to rebrand August 7, 2023 14:47
@netlify
Copy link

netlify bot commented Aug 7, 2023

Deploy Preview for prefect-design ready!

Name Link
🔨 Latest commit 9fe2772
🔍 Latest deploy log https://app.netlify.com/sites/prefect-design/deploys/64d11ee7432ea2000766f9be
😎 Deploy Preview https://deploy-preview-876--prefect-design.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brandonreid brandonreid merged commit 23bc3c4 into rebrand Aug 7, 2023
6 checks passed
@brandonreid brandonreid deleted the date-pickers branch August 7, 2023 16:55
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.

2 participants