From cf28e032cf6fe468a51a925bfe5090ec584e06e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Bie=C5=84?= Date: Fri, 5 Jan 2024 15:41:54 +0100 Subject: [PATCH] fix: calendar style lint (#55) --- packages/frosted-ui/src/components/calendar.css | 11 ++++++----- packages/frosted-ui/src/components/calendar.tsx | 9 +++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/frosted-ui/src/components/calendar.css b/packages/frosted-ui/src/components/calendar.css index 06ff2944..20b943fd 100644 --- a/packages/frosted-ui/src/components/calendar.css +++ b/packages/frosted-ui/src/components/calendar.css @@ -27,7 +27,7 @@ isolation: isolate; } -.fui-CalendarGrid th { +.fui-CalendarGrid { font-size: var(--font-size-2); font-weight: var(--font-weight-regular); color: var(--gray-a10); @@ -72,7 +72,8 @@ .fui-CalendarGridCellInner[data-selection-state='range']::before { border-radius: 0; } -.fui-CalendarGridCellInner.selected + .fui-CalendarGridCellInner.selected { +.fui-CalendarGridCellInner.fui-CalendarGridCell-selected + + .fui-CalendarGridCellInner.fui-CalendarGridCell-selected { border-top-right-radius: 0; border-bottom-right-radius: 0; } @@ -90,7 +91,7 @@ border-bottom-right-radius: 6px; } -.fui-CalendarGridCellInner.selected { +.fui-CalendarGridCellInner.fui-CalendarGridCell-selected { background: var(--accent-9); color: white; } @@ -122,7 +123,7 @@ border-bottom-right-radius: 0; } -.fui-CalendarGridCellInner.focusRing:focus-visible:after { +.fui-CalendarGridCellInner.fui-CalendarGridCell-focusRing:focus-visible:after { content: ''; position: absolute; inset: 0px; @@ -138,7 +139,7 @@ opacity: 0.6; } -.fui-CalendarGridCellInner.unavailable { +.fui-CalendarGridCellInner.fui-CalendarGridCell-unavailable { color: var(--danger-9); text-decoration: line-through; } diff --git a/packages/frosted-ui/src/components/calendar.tsx b/packages/frosted-ui/src/components/calendar.tsx index e208cb94..eeb366b3 100644 --- a/packages/frosted-ui/src/components/calendar.tsx +++ b/packages/frosted-ui/src/components/calendar.tsx @@ -353,7 +353,6 @@ function CalendarCell({ buttonProps, formattedDate, isSelected, - isDisabled, isOutsideVisibleRange, isUnavailable, } = useCalendarCell(props, state, ref); @@ -421,12 +420,10 @@ function CalendarCell({ isRoundedLeft ? 'left' : isRoundedRight ? 'right' : undefined } className={classNames('fui-CalendarGridCellInner', { - ['selected']: + ['fui-CalendarGridCell-selected']: isSelectionStart || isSelectionEnd || isSingleDateSelected, - ['range-selected']: !(isSelectionStart || isSelectionEnd), - ['focusRing']: isFocused && isFocusVisible, - ['disabled']: isDisabled, - ['unavailable']: isUnavailable, + ['fui-CalendarGridCell-focusRing']: isFocused && isFocusVisible, + ['fui-CalendarGridCell-unavailable']: isUnavailable, })} > {formattedDate}