Add style improvements to new date picker

This commit is contained in:
Andrew Kingston 2023-11-02 18:35:58 +00:00
parent 4fa4b2944f
commit 1b5bb8dd04
1 changed files with 8 additions and 5 deletions

View File

@ -69,6 +69,7 @@
}
const onOpen = () => {
calendarDate = dayjs(parsedValue || today).startOf("month")
isOpen = true
if (useKeyboardShortcuts) {
document.addEventListener("keyup", clearDateOnBackspace)
@ -307,13 +308,13 @@
aria-selected="false"
aria-invalid="false"
title={date.format("dddd, MMMM D, YYYY")}
on:click={outsideMonth ? null : handleChange(date)}
on:click={() => handleChange(date)}
>
<span
role="presentation"
class="spectrum-Calendar-date"
class:is-outsideMonth={outsideMonth}
class:is-today={date.isSame(today, "day")}
class:is-today={!outsideMonth && date.isSame(today, "day")}
class:is-selected={date.isSame(parsedValue, "day")}
>
{date.date()}
@ -350,9 +351,6 @@
.spectrum-Calendar {
padding: 8px;
}
.is-outsideMonth {
pointer-events: none;
}
.spectrum-Calendar-title {
display: flex;
justify-content: center;
@ -362,6 +360,10 @@
.spectrum-Calendar-header button {
border-radius: 4px;
}
.spectrum-Calendar-date.is-outsideMonth {
visibility: visible;
color: var(--spectrum-global-color-gray-400);
}
.month-selector :global(.spectrum-Picker),
.year-selector {
@ -377,6 +379,7 @@
font-family: var(--font-sans);
}
.month-selector :global(.spectrum-Picker:hover),
.month-selector :global(.spectrum-Picker.is-open),
.year-selector:hover {
background: var(--spectrum-global-color-gray-200);
}