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(date-picker): add component tokens #11380

Merged
merged 16 commits into from
Feb 6, 2025

Conversation

anveshmekala
Copy link
Contributor

@anveshmekala anveshmekala commented Jan 24, 2025

Related Issue: #7180

Summary

Adds following tokens for calcite-date-picker component:

--calcite-date-picker-border-color: Specifies the component's border color.
--calcite-date-picker-corner-radius: Specifies the component's border radius.
--calcite-date-picker-range-calendar-divider-color: Specifies the divider color between calendar's when range="true".
--calcite-date-picker-week-header-text-color: Specifies the week header text color.
--calcite-date-picker-header-action-background-color: Specifies the background color of header action's of the component.
--calcite-date-picker-header-action-background-color-hover: Specifies the background color of header action's of the component when hovered.
--calcite-date-picker-header-action-background-color-press: Specifies the background color of header action's of the component when pressed.
--calcite-date-picker-header-action-text-color: Specifies the text color of header action's of the component.
--calcite-date-picker-header-action-text-color-press: Specifies the text color of header action's of the component when pressed.
--calcite-date-picker-year-text-color: Specifies the text color of year & suffix of the component.
--calcite-date-picker-month-select-font-size: Specifies the font size of month select of the component.
--calcite-date-picker-month-select-text-color: Specifies the text color of month select of the component.
--calcite-date-picker-month-select-icon-color: Specifies the icon color of month select of the component.
--calcite-date-picker-month-select-icon-color-hover: Specifies the icon color of month select of the component when hovered.
--calcite-date-picker-day-background-color: Specifies the background color of day of the component.
--calcite-date-picker-day-background-color-hover: Specifies the background color of day of the component when hovered.
--calcite-date-picker-day-text-color: Specifies the text color of day of the component.
--calcite-date-picker-day-text-color-hover: Specifies the text color of day of the component when hovered.
--calcite-date-picker-current-day-text-color: Specifies the text color of current day of the component.
--calcite-date-picker-day-background-color-selected: Specifies the background color of selected day of the component.
--calcite-date-picker-day-text-color-selected: Specifies the text color of selected day of the component.
--calcite-date-picker-day-range-text-color: Specifies the text color of select day range of the component.
--calcite-date-picker-day-range-background-color: Specifies the background color of select day range of the component.
--calcite-date-picker-day-outside-range-background-color-hover: Specifies the background color of day's outside current range when hovered.
--calcite-date-picker-day-outside-range-text-color-hover: Specifies the text color of day's outside current range when hovered.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Jan 24, 2025
@anveshmekala
Copy link
Contributor Author

@alisonailea can we add a core token for box-shadow here

@anveshmekala anveshmekala marked this pull request as ready for review January 29, 2025 18:38
@anveshmekala anveshmekala added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Jan 29, 2025
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

Proposal looks good!

Can we add a themed demo html example too?

block-size: var(--calcite-internal-day-size);
outline-color: var(--calcite-color-transparent);
background: var(--calcite-date-picker-day-background-color, none);
Copy link
Member

Choose a reason for hiding this comment

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

Should this be background-color so that the token isn't allowed to do other background things? I wonder why none is even necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should be background-color and default value isn't required.

@@ -99,8 +99,7 @@ select:disabled {
@apply border-color-input text-color-2 pointer-events-none absolute inset-y-0 flex items-center border-0 border-solid bg-transparent;
inset-inline-end: theme("inset.0");
border-color: var(--calcite-select-border-color, var(--calcite-color-border-input));
border-inline-width: theme("borderWidth.0")
var(--calcite-select-internal-icon-border-inline-end-width, theme("borderWidth.DEFAULT"));
border-inline-width: theme("borderWidth.0") theme("borderWidth.DEFAULT");
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: can we use tokens here instead of the theme() if possible?

Copy link
Member

Choose a reason for hiding this comment

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

Would select modifications be out of scope?

Copy link
Contributor Author

@anveshmekala anveshmekala Jan 29, 2025

Choose a reason for hiding this comment

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

In terms of tokens, there is scope for refactoring internal tokens in select added as part of date-picker enhancement.
(Ex: using border-color instead of border-width

@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 29, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 29, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Jan 29, 2025
@anveshmekala
Copy link
Contributor Author

screenshot changes are expected due to change in border-width for month select menu.

In current version, border-width is set to 0 for the submerged look of select menu. While adding tokens, felt it may be more beneficial to add border-width with transparent color to achieve the desired UI and users can leverage border-color token if they choose to apply border. Thoughts? @SkyeSeitz

@anveshmekala anveshmekala requested a review from driskull January 30, 2025 17:48
Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

LGTM! Should we get another review before merging? Maybe @alisonailea

@alisonailea
Copy link
Contributor

alisonailea commented Feb 3, 2025

@alisonailea can we add a core token for box-shadow here

If we need to consider a new box shadow can you open an issue and/or post in the tokens channel so we can discuss it with the rest of design?

@alisonailea
Copy link
Contributor

Chromatic test diffs look good as well. Thanks @anveshmekala! LGTM!

@alisonailea
Copy link
Contributor

@alisonailea can we add a core token for box-shadow here

Actually can you comment on this issue #10050 which design is using to review shadow tokens?

@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 5, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 5, 2025
@anveshmekala anveshmekala added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 6, 2025
@anveshmekala anveshmekala merged commit e63beb5 into dev Feb 6, 2025
14 checks passed
@anveshmekala anveshmekala deleted the anveshmekala/7180-date-picker-add-tokens branch February 6, 2025 00:38
benelan pushed a commit that referenced this pull request Feb 8, 2025
**Related Issue:** #7180 

## Summary

Adds following tokens for `calcite-date-picker` component:

`--calcite-date-picker-border-color`: Specifies the component's border
color.
`--calcite-date-picker-corner-radius`: Specifies the component's border
radius.
`--calcite-date-picker-range-calendar-divider-color`: Specifies the
divider color between calendar's when `range="true"`.
`--calcite-date-picker-week-header-text-color`: Specifies the week
header text color.
`--calcite-date-picker-header-action-background-color`: Specifies the
background color of header action's of the component.
`--calcite-date-picker-header-action-background-color-hover`: Specifies
the background color of header action's of the component when hovered.
`--calcite-date-picker-header-action-background-color-press`: Specifies
the background color of header action's of the component when pressed.
`--calcite-date-picker-header-action-text-color`: Specifies the text
color of header action's of the component.
`--calcite-date-picker-header-action-text-color-press`: Specifies the
text color of header action's of the component when pressed.
`--calcite-date-picker-year-text-color`: Specifies the text color of
year & suffix of the component.
`--calcite-date-picker-month-select-font-size`: Specifies the font size
of month select of the component.
`--calcite-date-picker-month-select-text-color`: Specifies the text
color of month select of the component.
`--calcite-date-picker-month-select-icon-color`: Specifies the icon
color of month select of the component.
`--calcite-date-picker-month-select-icon-color-hover`: Specifies the
icon color of month select of the component when hovered.
`--calcite-date-picker-day-background-color`: Specifies the background
color of day of the component.
`--calcite-date-picker-day-background-color-hover`: Specifies the
background color of day of the component when hovered.
`--calcite-date-picker-day-text-color`: Specifies the text color of day
of the component.
`--calcite-date-picker-day-text-color-hover`: Specifies the text color
of day of the component when hovered.
`--calcite-date-picker-current-day-text-color`: Specifies the text color
of current day of the component.
`--calcite-date-picker-day-background-color-selected`: Specifies the
background color of selected day of the component.
`--calcite-date-picker-day-text-color-selected`: Specifies the text
color of selected day of the component.
`--calcite-date-picker-day-range-text-color`: Specifies the text color
of select day range of the component.
`--calcite-date-picker-day-range-background-color`: Specifies the
background color of select day range of the component.
`--calcite-date-picker-day-outside-range-background-color-hover`:
Specifies the background color of day's outside current range when
hovered.
`--calcite-date-picker-day-outside-range-text-color-hover`: Specifies
the text color of day's outside current range when hovered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants