Skip to content

fix(date-picker): end-range is now rounded and has the correct box-shadow #6216

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

Merged
merged 7 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/date-picker-day/date-picker-day.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@
:host([end-of-range]:not(:focus)) {
:not(.calcite--rtl) {
.day {
box-shadow: 0 0 0 -2px var(--calcite-ui-foreground-1);
box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
}
}
.calcite--rtl {
.day {
box-shadow: 0 0 0 2px var(--calcite-ui-foreground-1);
box-shadow: 0 0 0 -2px var(--calcite-ui-foreground-1);
}
}
}
Expand Down Expand Up @@ -221,7 +221,7 @@
}

:host([highlighted]:not([active]:focus)) .day {
@apply text-color-1 rounded-none;
@apply text-color-1 rounded-full;
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need to add rounded-full here as it is the default style applied on .day

Copy link
Member

Choose a reason for hiding this comment

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

@Elijbet Based on ☝️, is the util class still needed?

}

:host([range-hover]:not([selected])) {
Expand Down
25 changes: 16 additions & 9 deletions src/components/date-picker/date-picker.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,24 @@ export const range = (): string =>
)}
</div>`;

const selectRangeString = html`
<script>
let weekDays = document.querySelector(".week-days");
weekDays.querySelector("calcite-date-picker-day:first-child").selected = true;
weekDays.querySelector("calcite-date-picker-day:last-child").selected = true;
</script>
`;
export const range_TestOnly = (): string =>
html`<div style="width: 400px">
<calcite-date-picker scale="m" range></calcite-date-picker>
</div>
${selectRangeString}`;

export const rangeRTL_TestOnly = (): string =>
html`<div style="width: 400px">
${create(
"calcite-date-picker",
createAttributes({ exceptions: ["min", "range", "dir"] }).concat([
{ name: "dir", value: "rtl" },
{ name: "min", value: "2016-08-09" },
{ name: "range", value: "true" }
])
)}
</div>`;
<calcite-date-picker dir="RTL" scale="m" range></calcite-date-picker>
</div>
${selectRangeString}`;

export const darkThemeRTL_TestOnly = (): string =>
html`<div style="width: 400px">
Expand Down