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: DatePicker and DateRangePicker #1544

Merged
merged 13 commits into from
Dec 20, 2024
Merged

Conversation

kevinalexliu
Copy link
Contributor

@kevinalexliu kevinalexliu commented Dec 18, 2024

πŸ“ Changes

  • Fix calendar styles
  • Add DatePicker and DateRangePicker

βœ… Checklist

Easy UI has certain UX standards that must be met. In general, non-trivial changes should meet the following criteria:

  • Visuals match Design Specs in Figma(There is no design spec)
  • Stories accompany any component changes
  • Code is in accordance with our style guide
  • Design tokens are utilized
  • Unit tests accompany any component changes
  • TSDoc is written for any API surface area
  • Specs are up-to-date
  • Console is free from warnings
  • No accessibility violations are reported
  • Cross-browser check is performed (Chrome, Safari, Firefox)
  • Changeset is added

Strikethrough any items that are not applicable to this pull request.

@kevinalexliu kevinalexliu marked this pull request as ready for review December 19, 2024 19:55
@kevinalexliu kevinalexliu changed the title DatePicker Draft feat: DatePicker and DateRangePicker Dec 19, 2024
/>
</UnstyledButton>
</div>
{(isInvalid || state.isInvalid) && (
Copy link
Member

Choose a reason for hiding this comment

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

question: are there instances where isInvalid and state.isInvalid would be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

state.isInvalid is determined by useDatePickerState. For example, it handles end date before start date error and provides a default error message.

Users pass isInvalid props to DatePicker based on their business logic.

@@ -1,6 +1,8 @@
@use "../styles/common" as *;
.CalendarGrid {
border-collapse: collapse;
z-index: 999;
Copy link
Member

Choose a reason for hiding this comment

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

question: does it make sense for us to add a z-index token for calendars?

{
  "z-index": {
    "input_icon": { "value": "1" },
    "calendar": { "value": "999" },
    "nav": { "value": "1000" },
    "drawer": { "value": "1200" },
    "modal": { "value": "1300" },
    "notification": { "value": "999999" }
  }
}

or is this z-index specific to a certain interaction and doesnt really make sense to have a z-index token?

Copy link
Contributor Author

@kevinalexliu kevinalexliu Dec 20, 2024

Choose a reason for hiding this comment

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

after looking at it again, z-index should be on the diaglog to show on top of the popover instead of Calendar.

Copy link
Member

@stephenjwatkins stephenjwatkins left a comment

Choose a reason for hiding this comment

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

can you ensure the sizes are the same as the Select and TextField?

looks like it's about 8px bigger and the calendar icon isn't vertically center on my browser:

image

similarly the sm size calendar icon isn't vertically centered on my screen:

image

pointer-events: auto;
outline: none;
position: relative;
z-index: design-token("z-index.input_icon");
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: up to you and a minor thing, but i think we could just use the value of 1 here or define a component level token. generally so far we've been assigning z-index tokens in association with some semantics

@kevinalexliu kevinalexliu merged commit 15a0b00 into main Dec 20, 2024
5 checks passed
@kevinalexliu kevinalexliu deleted the T81025_feat_DatePicker branch December 20, 2024 20:46
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.

3 participants