Skip to content

Commit

Permalink
fix(Calendar): fix hover/active calendar day states (#7738)
Browse files Browse the repository at this point in the history
* fix(Calendar): fix hover/active calendar day states

* fix: calendar day background
  • Loading branch information
BlackySoul authored Oct 14, 2024
1 parent b487d38 commit 819c65b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
16 changes: 14 additions & 2 deletions packages/vkui/src/components/CalendarDay/CalendarDay.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}

.selected {
background-color: var(--vkui--color_background_secondary);
background-color: var(--vkui--color_background_secondary_alpha);
}

.selectionStart.selected,
Expand Down Expand Up @@ -74,11 +74,23 @@
}

.hintedActive,
.hover :not(.hintedActive) .inner {
.hostHovered :not(.hintedActive) .inner {
background-color: var(--vkui--color_background_secondary_alpha--hover);
}

.hostActivated :not(.hintedActive) .inner {
background-color: var(--vkui--color_background_secondary_alpha--active);
}

.innerActive {
background-color: var(--vkui--color_background_accent);
color: var(--vkui--color_text_contrast);
}

.hostHovered .inner.innerActive {
background-color: var(--vkui--color_background_accent--hover);
}

.hostActivated .inner.innerActive {
background-color: var(--vkui--color_background_accent--active);
}
3 changes: 2 additions & 1 deletion packages/vkui/src/components/CalendarDay/CalendarDay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export const CalendarDay: React.FC<CalendarDayProps> = React.memo(
!sameMonth && styles.notSameMonth,
className,
)}
hoverMode={active ? '' : styles.hover}
hoverMode={styles.hostHovered}
activeMode={styles.hostActivated}
hasActive={false}
onClick={onClick}
disabled={disabled}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 819c65b

Please sign in to comment.