feat(DateTimePicker): integrate flatpickr for enhanced date/time selection and theming
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m29s
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m29s
This commit is contained in:
217
src/index.css
217
src/index.css
@@ -741,10 +741,219 @@
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
NATIVE DATE/TIME INPUTS — themed via CSS variables + color-scheme
|
||||
FLATPICKR THEMED OVERRIDES — fully driven by CSS variables
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
input[type="date"],
|
||||
input[type="time"] {
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
/* Calendar container — appended to body */
|
||||
.flatpickr-calendar {
|
||||
background: var(--card-bg) !important;
|
||||
border: 1px solid var(--border) !important;
|
||||
border-radius: 0.75rem !important;
|
||||
box-shadow: 0 10px 25px -5px var(--shadow-color), 0 4px 10px -6px var(--shadow-color) !important;
|
||||
font-family: inherit !important;
|
||||
color: var(--text-primary) !important;
|
||||
z-index: 9999 !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.flatpickr-calendar::before,
|
||||
.flatpickr-calendar::after {
|
||||
display: none !important; /* hide arrow */
|
||||
}
|
||||
|
||||
/* ── Month navigation ─────────────────────────────────────────── */
|
||||
.flatpickr-months {
|
||||
background: var(--bg-secondary) !important;
|
||||
border-bottom: 1px solid var(--border) !important;
|
||||
padding: 0.25rem 0 !important;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-month {
|
||||
background: transparent !important;
|
||||
color: var(--text-primary) !important;
|
||||
height: 2.25rem !important;
|
||||
}
|
||||
|
||||
.flatpickr-current-month {
|
||||
font-size: 0.875rem !important;
|
||||
font-weight: 600 !important;
|
||||
color: var(--text-primary) !important;
|
||||
padding-top: 0.375rem !important;
|
||||
}
|
||||
|
||||
.flatpickr-current-month .flatpickr-monthDropdown-months {
|
||||
background: var(--bg-secondary) !important;
|
||||
color: var(--text-primary) !important;
|
||||
border: none !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 0.875rem !important;
|
||||
appearance: none !important;
|
||||
-webkit-appearance: none !important;
|
||||
}
|
||||
|
||||
.flatpickr-current-month .flatpickr-monthDropdown-months option {
|
||||
background: var(--card-bg) !important;
|
||||
color: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
.flatpickr-current-month input.cur-year {
|
||||
color: var(--text-primary) !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 0.875rem !important;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-prev-month,
|
||||
.flatpickr-months .flatpickr-next-month {
|
||||
color: var(--text-secondary) !important;
|
||||
fill: var(--text-secondary) !important;
|
||||
padding: 0.375rem 0.625rem !important;
|
||||
transition: color 0.15s !important;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-prev-month:hover,
|
||||
.flatpickr-months .flatpickr-next-month:hover {
|
||||
color: var(--text-primary) !important;
|
||||
fill: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-prev-month svg,
|
||||
.flatpickr-months .flatpickr-next-month svg {
|
||||
fill: inherit !important;
|
||||
width: 12px !important;
|
||||
height: 12px !important;
|
||||
}
|
||||
|
||||
/* ── Day names row ────────────────────────────────────────────── */
|
||||
.flatpickr-weekdays {
|
||||
background: var(--bg-secondary) !important;
|
||||
border-bottom: 1px solid var(--border) !important;
|
||||
padding: 0.125rem 0 !important;
|
||||
}
|
||||
|
||||
span.flatpickr-weekday {
|
||||
color: var(--text-secondary) !important;
|
||||
font-size: 0.6875rem !important;
|
||||
font-weight: 600 !important;
|
||||
text-transform: uppercase !important;
|
||||
letter-spacing: 0.05em !important;
|
||||
}
|
||||
|
||||
/* ── Days grid ────────────────────────────────────────────────── */
|
||||
.flatpickr-days {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.dayContainer {
|
||||
padding: 0.25rem !important;
|
||||
min-width: 15.5rem !important;
|
||||
max-width: 15.5rem !important;
|
||||
}
|
||||
|
||||
.flatpickr-day {
|
||||
color: var(--text-primary) !important;
|
||||
border: none !important;
|
||||
border-radius: 0.375rem !important;
|
||||
font-size: 0.8125rem !important;
|
||||
line-height: 2.25rem !important;
|
||||
height: 2.25rem !important;
|
||||
max-width: 2.25rem !important;
|
||||
transition: background 0.12s, color 0.12s !important;
|
||||
}
|
||||
|
||||
.flatpickr-day:hover:not(.selected):not(.flatpickr-disabled) {
|
||||
background: var(--hover-bg) !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.selected,
|
||||
.flatpickr-day.selected:hover {
|
||||
background: var(--accent) !important;
|
||||
color: var(--accent-text) !important;
|
||||
border: none !important;
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.today:not(.selected) {
|
||||
font-weight: 700 !important;
|
||||
color: var(--accent) !important;
|
||||
border: none !important;
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.today:not(.selected)::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 3px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.flatpickr-day.prevMonthDay,
|
||||
.flatpickr-day.nextMonthDay {
|
||||
color: var(--text-secondary) !important;
|
||||
opacity: 0.4 !important;
|
||||
}
|
||||
|
||||
.flatpickr-day.flatpickr-disabled,
|
||||
.flatpickr-day.flatpickr-disabled:hover {
|
||||
color: var(--text-secondary) !important;
|
||||
opacity: 0.3 !important;
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
/* ── Time picker ──────────────────────────────────────────────── */
|
||||
.flatpickr-time {
|
||||
border-top: 1px solid var(--border) !important;
|
||||
background: var(--bg-secondary) !important;
|
||||
max-height: none !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.flatpickr-time input {
|
||||
color: var(--text-primary) !important;
|
||||
background: transparent !important;
|
||||
font-size: 0.9375rem !important;
|
||||
font-weight: 600 !important;
|
||||
font-variant-numeric: tabular-nums !important;
|
||||
}
|
||||
|
||||
.flatpickr-time input:hover,
|
||||
.flatpickr-time input:focus {
|
||||
background: var(--hover-bg) !important;
|
||||
border-radius: 0.375rem !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .flatpickr-time-separator {
|
||||
color: var(--text-secondary) !important;
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .flatpickr-am-pm {
|
||||
color: var(--text-primary) !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .numInputWrapper span {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .numInputWrapper span.arrowUp::after {
|
||||
border-bottom-color: var(--text-secondary) !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .numInputWrapper span.arrowDown::after {
|
||||
border-top-color: var(--text-secondary) !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .numInputWrapper:hover span.arrowUp::after {
|
||||
border-bottom-color: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
.flatpickr-time .numInputWrapper:hover span.arrowDown::after {
|
||||
border-top-color: var(--text-primary) !important;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user