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