From de236343a2ea7e2e53fbb8f66a294890ea3d1bbb Mon Sep 17 00:00:00 2001 From: Valentina Date: Tue, 4 Jun 2024 02:40:05 -0700 Subject: [PATCH] feat(react-calendar-compat): changed design for the selected state (#31509) Co-authored-by: Esteban Munoz Facusse --- ...-acdf3646-9c24-46d9-85eb-7f68e84c551d.json | 7 ++ .../etc/react-calendar-compat.api.md | 2 + .../useCalendarDayStyles.styles.ts | 4 +- .../CalendarDayGrid/CalendarDayGrid.types.ts | 10 ++ .../CalendarDayGrid/CalendarGridDayCell.tsx | 7 +- .../useCalendarDayGridStyles.styles.ts | 91 ++++++++++++++----- .../useCalendarPickerStyles.styles.ts | 5 +- .../src/utils/dateGrid/dateGrid.types.ts | 4 +- .../src/utils/dateGrid/getDayGrid.ts | 1 + 9 files changed, 102 insertions(+), 29 deletions(-) create mode 100644 change/@fluentui-react-calendar-compat-acdf3646-9c24-46d9-85eb-7f68e84c551d.json diff --git a/change/@fluentui-react-calendar-compat-acdf3646-9c24-46d9-85eb-7f68e84c551d.json b/change/@fluentui-react-calendar-compat-acdf3646-9c24-46d9-85eb-7f68e84c551d.json new file mode 100644 index 0000000000000..1e12b98c02186 --- /dev/null +++ b/change/@fluentui-react-calendar-compat-acdf3646-9c24-46d9-85eb-7f68e84c551d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "feat(calendar-compat): changed design for the selected state", + "packageName": "@fluentui/react-calendar-compat", + "email": "vkozlova@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-calendar-compat/etc/react-calendar-compat.api.md b/packages/react-components/react-calendar-compat/etc/react-calendar-compat.api.md index 13bdab20585c8..ccd2482c53962 100644 --- a/packages/react-components/react-calendar-compat/etc/react-calendar-compat.api.md +++ b/packages/react-components/react-calendar-compat/etc/react-calendar-compat.api.md @@ -97,6 +97,8 @@ export interface CalendarDayGridStyles { dayOutsideBounds?: string; dayOutsideNavigatedMonth?: string; daySelected?: string; + daySingleSelected?: string; + dayTodayMarker?: string; firstTransitionWeek?: string; lastTransitionWeek?: string; table?: string; diff --git a/packages/react-components/react-calendar-compat/src/components/CalendarDay/useCalendarDayStyles.styles.ts b/packages/react-components/react-calendar-compat/src/components/CalendarDay/useCalendarDayStyles.styles.ts index 4d0b92ca2c222..c30d36f8d9422 100644 --- a/packages/react-components/react-calendar-compat/src/components/CalendarDay/useCalendarDayStyles.styles.ts +++ b/packages/react-components/react-calendar-compat/src/components/CalendarDay/useCalendarDayStyles.styles.ts @@ -48,7 +48,7 @@ const useMonthAndYearStyles = makeStyles({ alignItems: 'center', backgroundColor: tokens.colorTransparentBackground, ...shorthands.borderStyle('none'), - borderRadius: '2px', + borderRadius: tokens.borderRadiusMedium, color: tokens.colorNeutralForeground1, display: 'inline-block', flexGrow: 1, @@ -95,7 +95,7 @@ const useHeaderIconButtonStyles = makeStyles({ base: { backgroundColor: tokens.colorTransparentBackground, ...shorthands.borderStyle('none'), - borderRadius: '2px', + borderRadius: tokens.borderRadiusMedium, color: tokens.colorNeutralForeground3, display: 'block', fontFamily: 'inherit', diff --git a/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarDayGrid.types.ts b/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarDayGrid.types.ts index a1ef13b5c6ce7..5af9b7a189432 100644 --- a/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarDayGrid.types.ts +++ b/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarDayGrid.types.ts @@ -234,6 +234,11 @@ export interface CalendarDayGridStyles { */ daySelected?: string; + /** + * The classname applied when a single day is selected + */ + daySingleSelected?: string; + /** * The style to apply to row around weeks */ @@ -283,4 +288,9 @@ export interface CalendarDayGridStyles { * The style applied to the marker on days to mark as important */ dayMarker?: string; + + /** + * The classname applied to the day "today" span + */ + dayTodayMarker?: string; } diff --git a/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarGridDayCell.tsx b/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarGridDayCell.tsx index 2d4aaca5114ca..6dbf3beb5a03b 100644 --- a/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarGridDayCell.tsx +++ b/packages/react-components/react-calendar-compat/src/components/CalendarDayGrid/CalendarGridDayCell.tsx @@ -215,7 +215,8 @@ export const CalendarGridDayCell: React.FunctionComponent - + {day.isMarked &&