@fluentui/react-calendar-compat 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -2
- package/lib/components/Calendar/useCalendarStyles.styles.js +1 -0
- package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.raw.js +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.js +2 -1
- package/lib/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js +3 -10
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js +2 -9
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js +30 -8
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridRow.js +6 -5
- package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js +10 -3
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +16 -58
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +12 -67
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeeks.js +0 -1
- package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js +10 -4
- package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js +1 -0
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js +5 -33
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js +4 -41
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.js +14 -10
- package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js +1 -0
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.raw.js +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.raw.js.map +1 -1
- package/lib/utils/animations.js +24 -18
- package/lib/utils/animations.js.map +1 -1
- package/lib/utils/calendarMotions.js +93 -0
- package/lib/utils/calendarMotions.js.map +1 -0
- package/lib/utils/index.js +2 -2
- package/lib/utils/index.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js +1 -0
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js +2 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js +3 -15
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js +2 -9
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js +30 -8
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js +6 -5
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js +9 -3
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +16 -98
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +12 -67
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js +0 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js +10 -4
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js +1 -0
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js +6 -56
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js +4 -41
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.js +14 -10
- package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js +1 -0
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/utils/animations.js +12 -11
- package/lib-commonjs/utils/animations.js.map +1 -1
- package/lib-commonjs/utils/calendarMotions.js +105 -0
- package/lib-commonjs/utils/calendarMotions.js.map +1 -0
- package/lib-commonjs/utils/index.js +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/package.json +6 -4
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
|
3
3
|
import { makeStyles, mergeClasses, shorthands } from '@griffel/react';
|
|
4
|
-
import { DURATION_2, DURATION_3, EASING_FUNCTION_1, EASING_FUNCTION_2, FADE_IN, FADE_OUT, SLIDE_DOWN_IN20, SLIDE_DOWN_OUT20, SLIDE_LEFT_IN20, SLIDE_RIGHT_IN20, SLIDE_UP_IN20, SLIDE_UP_OUT20, TRANSITION_ROW_DISAPPEARANCE } from '../../utils';
|
|
5
|
-
import { AnimationDirection } from '../Calendar/Calendar.types';
|
|
6
4
|
import { weekCornersClassNames } from './useWeekCornerStyles.styles';
|
|
7
5
|
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
|
8
6
|
/**
|
|
@@ -145,44 +143,11 @@ const useWeekRowStyles = makeStyles({
|
|
|
145
143
|
':focus-within': {
|
|
146
144
|
zIndex: 1
|
|
147
145
|
}
|
|
148
|
-
},
|
|
149
|
-
animation: {
|
|
150
|
-
animationDuration: DURATION_3,
|
|
151
|
-
animationFillMode: 'both',
|
|
152
|
-
animationTimingFunction: EASING_FUNCTION_1
|
|
153
|
-
},
|
|
154
|
-
horizontalBackward: {
|
|
155
|
-
animationName: [
|
|
156
|
-
FADE_IN,
|
|
157
|
-
SLIDE_RIGHT_IN20
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
horizontalForward: {
|
|
161
|
-
animationName: [
|
|
162
|
-
FADE_IN,
|
|
163
|
-
SLIDE_LEFT_IN20
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
verticalBackward: {
|
|
167
|
-
animationName: [
|
|
168
|
-
FADE_IN,
|
|
169
|
-
SLIDE_DOWN_IN20
|
|
170
|
-
]
|
|
171
|
-
},
|
|
172
|
-
verticalForward: {
|
|
173
|
-
animationName: [
|
|
174
|
-
FADE_IN,
|
|
175
|
-
SLIDE_UP_IN20
|
|
176
|
-
]
|
|
177
146
|
}
|
|
178
147
|
});
|
|
179
148
|
const useWeekDayLabelCellStyles = makeStyles({
|
|
180
149
|
base: {
|
|
181
|
-
userSelect: 'none'
|
|
182
|
-
animationDuration: DURATION_2,
|
|
183
|
-
animationFillMode: 'both',
|
|
184
|
-
animationName: FADE_IN,
|
|
185
|
-
animationTimingFunction: EASING_FUNCTION_2
|
|
150
|
+
userSelect: 'none'
|
|
186
151
|
}
|
|
187
152
|
});
|
|
188
153
|
const useWeekNumberCellStyles = makeStyles({
|
|
@@ -281,41 +246,21 @@ const useDayTodayMarkerStyles = makeStyles({
|
|
|
281
246
|
});
|
|
282
247
|
const useFirstTransitionWeekStyles = makeStyles({
|
|
283
248
|
base: {
|
|
284
|
-
|
|
249
|
+
// Overlaid out of flow and transparent at rest; `pointerEvents: 'none'` stops the invisible
|
|
250
|
+
// overlay from intercepting clicks. `TransitionRowSlideOut` fades opacity 1 → 0, ending here.
|
|
285
251
|
opacity: 0,
|
|
286
252
|
overflow: 'hidden',
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
verticalForward: {
|
|
291
|
-
animationDuration: DURATION_3,
|
|
292
|
-
animationFillMode: 'both',
|
|
293
|
-
animationName: [
|
|
294
|
-
FADE_OUT,
|
|
295
|
-
SLIDE_UP_OUT20,
|
|
296
|
-
TRANSITION_ROW_DISAPPEARANCE
|
|
297
|
-
],
|
|
298
|
-
animationTimingFunction: EASING_FUNCTION_1
|
|
253
|
+
pointerEvents: 'none',
|
|
254
|
+
position: 'absolute'
|
|
299
255
|
}
|
|
300
256
|
});
|
|
301
257
|
const useLastTransitionWeekStyles = makeStyles({
|
|
302
258
|
base: {
|
|
303
|
-
height: 0,
|
|
304
259
|
marginTop: '-28px',
|
|
305
260
|
opacity: 0,
|
|
306
261
|
overflow: 'hidden',
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
},
|
|
310
|
-
verticalBackward: {
|
|
311
|
-
animationDuration: DURATION_3,
|
|
312
|
-
animationFillMode: 'both',
|
|
313
|
-
animationName: [
|
|
314
|
-
FADE_OUT,
|
|
315
|
-
SLIDE_DOWN_OUT20,
|
|
316
|
-
TRANSITION_ROW_DISAPPEARANCE
|
|
317
|
-
],
|
|
318
|
-
animationTimingFunction: EASING_FUNCTION_1
|
|
262
|
+
pointerEvents: 'none',
|
|
263
|
+
position: 'absolute'
|
|
319
264
|
}
|
|
320
265
|
});
|
|
321
266
|
const useDayMarkerStyles = makeStyles({
|
|
@@ -356,7 +301,7 @@ const useCornerBorderAndRadiusStyles = makeStyles({
|
|
|
356
301
|
*
|
|
357
302
|
* @internal
|
|
358
303
|
*/ export const useCalendarDayGridStyles_unstable = (props)=>{
|
|
359
|
-
'use no memo';
|
|
304
|
+
'use no memo'; // justified: compiler would optimize useCalendarDayGridStyles_unstable — manual opt-out to preserve runtime behavior
|
|
360
305
|
const wrapperStyles = useWrapperStyles();
|
|
361
306
|
const tableStyles = useTableStyles();
|
|
362
307
|
const dayCellStyles = useDayCellStyles();
|
|
@@ -374,22 +319,22 @@ const useCornerBorderAndRadiusStyles = makeStyles({
|
|
|
374
319
|
const dayMarkerStyles = useDayMarkerStyles();
|
|
375
320
|
const cornerBorderAndRadiusStyles = useCornerBorderAndRadiusStyles();
|
|
376
321
|
const dayTodayMarkerStyles = useDayTodayMarkerStyles();
|
|
377
|
-
const {
|
|
322
|
+
const { lightenDaysOutsideNavigatedMonth, showWeekNumbers } = props;
|
|
378
323
|
return {
|
|
379
324
|
wrapper: mergeClasses(calendarDayGridClassNames.wrapper, wrapperStyles.base),
|
|
380
325
|
table: mergeClasses(calendarDayGridClassNames.table, tableStyles.base, showWeekNumbers && tableStyles.showWeekNumbers),
|
|
381
326
|
dayCell: mergeClasses(calendarDayGridClassNames.dayCell, dayCellStyles.base, dayCellStyles.focusIndicator, cornerBorderAndRadiusStyles.corners),
|
|
382
327
|
daySelected: mergeClasses(calendarDayGridClassNames.daySelected, daySelectedStyles.base),
|
|
383
328
|
daySingleSelected: mergeClasses(calendarDayGridClassNames.daySingleSelected, daySingleSelectedStyles.base),
|
|
384
|
-
weekRow: mergeClasses(calendarDayGridClassNames.weekRow, weekRowStyles.base
|
|
329
|
+
weekRow: mergeClasses(calendarDayGridClassNames.weekRow, weekRowStyles.base),
|
|
385
330
|
weekDayLabelCell: mergeClasses(calendarDayGridClassNames.weekDayLabelCell, weekDayLabelCellStyles.base),
|
|
386
331
|
weekNumberCell: mergeClasses(calendarDayGridClassNames.weekNumberCell, weekNumberCellStyles.base),
|
|
387
332
|
dayOutsideBounds: mergeClasses(calendarDayGridClassNames.dayOutsideBounds, dayOutsideBoundsStyles.base),
|
|
388
333
|
dayOutsideNavigatedMonth: mergeClasses(calendarDayGridClassNames.dayOutsideNavigatedMonth, lightenDaysOutsideNavigatedMonth && dayOutsideNavigatedMonthStyles.lightenDaysOutsideNavigatedMonth),
|
|
389
334
|
dayButton: mergeClasses(calendarDayGridClassNames.dayButton, dayButtonStyles.base),
|
|
390
335
|
dayIsToday: mergeClasses(calendarDayGridClassNames.dayIsToday, dayIsTodayStyles.base),
|
|
391
|
-
firstTransitionWeek: mergeClasses(calendarDayGridClassNames.firstTransitionWeek, firstTransitionWeekStyles.base
|
|
392
|
-
lastTransitionWeek: mergeClasses(calendarDayGridClassNames.lastTransitionWeek, lastTransitionWeekStyles.base
|
|
336
|
+
firstTransitionWeek: mergeClasses(calendarDayGridClassNames.firstTransitionWeek, firstTransitionWeekStyles.base),
|
|
337
|
+
lastTransitionWeek: mergeClasses(calendarDayGridClassNames.lastTransitionWeek, lastTransitionWeekStyles.base),
|
|
393
338
|
dayMarker: mergeClasses(calendarDayGridClassNames.dayMarker, dayMarkerStyles.base),
|
|
394
339
|
dayTodayMarker: mergeClasses(calendarDayGridClassNames.dayTodayMarker, dayTodayMarkerStyles.base)
|
|
395
340
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarDayGrid/useCalendarDayGridStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport {\n DURATION_2,\n DURATION_3,\n EASING_FUNCTION_1,\n EASING_FUNCTION_2,\n FADE_IN,\n FADE_OUT,\n SLIDE_DOWN_IN20,\n SLIDE_DOWN_OUT20,\n SLIDE_LEFT_IN20,\n SLIDE_RIGHT_IN20,\n SLIDE_UP_IN20,\n SLIDE_UP_OUT20,\n TRANSITION_ROW_DISAPPEARANCE,\n} from '../../utils';\nimport { AnimationDirection } from '../Calendar/Calendar.types';\nimport { weekCornersClassNames } from './useWeekCornerStyles.styles';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarDayGridStyles, CalendarDayGridStyleProps } from './CalendarDayGrid.types';\n\n/**\n * @internal\n */\nexport const calendarDayGridClassNames: SlotClassNames<CalendarDayGridStyles> = {\n wrapper: 'fui-CalendarDayGrid__wrapper',\n table: 'fui-CalendarDayGrid__table',\n dayCell: 'fui-CalendarDayGrid__dayCell',\n daySelected: 'fui-CalendarDayGrid__daySelected',\n daySingleSelected: 'fui-CalendarDayGrid__daySingleSelected',\n weekRow: 'fui-CalendarDayGrid__weekRow',\n weekDayLabelCell: 'fui-CalendarDayGrid__weekDayLabelCell',\n weekNumberCell: 'fui-CalendarDayGrid__weekNumberCell',\n dayOutsideBounds: 'fui-CalendarDayGrid__dayOutsideBounds',\n dayOutsideNavigatedMonth: 'fui-CalendarDayGrid__dayOutsideNavigatedMonth',\n dayButton: 'fui-CalendarDayGrid__dayButton',\n dayIsToday: 'fui-CalendarDayGrid__dayIsToday',\n firstTransitionWeek: 'fui-CalendarDayGrid__firstTransitionWeek',\n lastTransitionWeek: 'fui-CalendarDayGrid__lastTransitionWeek',\n dayMarker: 'fui-CalendarDayGrid__dayMarker',\n dayTodayMarker: 'fui-CalendarDayGrid__dayTodayMarker',\n};\n\n/**\n * @internal\n */\nexport const extraCalendarDayGridClassNames = {\n hoverStyle: 'fui-CalendarDayGrid__hoverStyle',\n pressedStyle: 'fui-CalendarDayGrid__pressedStyle',\n};\n\nconst useWrapperStyles = makeStyles({\n base: {\n paddingBottom: '10px',\n },\n});\n\nconst useTableStyles = makeStyles({\n base: {\n borderCollapse: 'collapse',\n borderSpacing: 0,\n fontSize: 'inherit',\n marginTop: '4px',\n paddingBottom: '10px',\n position: 'relative',\n tableLayout: 'fixed',\n textAlign: 'center',\n width: '196px',\n },\n showWeekNumbers: {\n width: '226px',\n },\n});\n\nconst useDayCellStyles = makeStyles({\n base: {\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n margin: '0',\n padding: '2px',\n position: 'relative',\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n color: 'WindowText',\n },\n\n [`&.${extraCalendarDayGridClassNames.hoverStyle}`]: {\n color: tokens.colorNeutralForeground1Static,\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n '@media (forced-colors: active)': {\n outline: '1px solid Highlight',\n zIndex: 3,\n [`& .${calendarDayGridClassNames.dayTodayMarker}`]: {\n backgroundColor: 'Highlight',\n },\n },\n },\n\n [`&.${extraCalendarDayGridClassNames.pressedStyle}`]: {\n color: tokens.colorNeutralForeground1Static,\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n },\n },\n focusIndicator: createFocusOutlineStyle({\n style: {\n outlineWidth: tokens.strokeWidthThick,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n },\n }),\n});\n\nconst useDaySelectedStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n color: tokens.colorNeutralForeground1Static,\n\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n },\n\n [`&:hover, &.${extraCalendarDayGridClassNames.hoverStyle}, &.${extraCalendarDayGridClassNames.pressedStyle}`]: {\n color: tokens.colorNeutralForeground1Static,\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n color: 'HighlightText',\n },\n },\n\n [`& > .${calendarDayGridClassNames.dayMarker}`]: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n },\n },\n },\n});\n\nconst useDaySingleSelectedStyles = makeStyles({\n base: {\n color: tokens.colorNeutralForeground1Static,\n\n [`& > .${calendarDayGridClassNames.dayMarker}`]: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n },\n },\n\n [`& > .${calendarDayGridClassNames.dayButton}`]: {\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorBrandStroke1}`,\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n },\n },\n },\n});\n\nconst useWeekRowStyles = makeStyles({\n base: {\n position: 'relative',\n ':focus-within': {\n zIndex: 1,\n },\n },\n animation: {\n animationDuration: DURATION_3,\n animationFillMode: 'both',\n animationTimingFunction: EASING_FUNCTION_1,\n },\n horizontalBackward: {\n animationName: [FADE_IN, SLIDE_RIGHT_IN20],\n },\n horizontalForward: {\n animationName: [FADE_IN, SLIDE_LEFT_IN20],\n },\n verticalBackward: {\n animationName: [FADE_IN, SLIDE_DOWN_IN20],\n },\n verticalForward: {\n animationName: [FADE_IN, SLIDE_UP_IN20],\n },\n});\n\nconst useWeekDayLabelCellStyles = makeStyles({\n base: {\n userSelect: 'none',\n animationDuration: DURATION_2,\n animationFillMode: 'both',\n animationName: FADE_IN,\n animationTimingFunction: EASING_FUNCTION_2,\n },\n});\n\nconst useWeekNumberCellStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground4,\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n height: '28px',\n margin: '0',\n padding: '0',\n width: '28px',\n },\n});\n\nconst useDayOutsideBoundsStyles = makeStyles({\n base: {\n [`&, &:disabled, & button, &.${extraCalendarDayGridClassNames.hoverStyle}` +\n `, &.${extraCalendarDayGridClassNames.pressedStyle}`]: {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\nconst useDayOutsideNavigatedMonthStyles = makeStyles({\n lightenDaysOutsideNavigatedMonth: {\n color: tokens.colorNeutralForeground4,\n fontWeight: tokens.fontWeightRegular,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\nconst useDayButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n fontSize: tokens.fontSizeBase200,\n fontWeight: 'inherit',\n height: '24px',\n lineHeight: '24px',\n overflow: 'visible',\n padding: '0',\n width: '24px',\n\n '&span': {\n height: 'inherit',\n lineHeight: 'inherit',\n },\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n borderRadius: tokens.borderRadiusMedium,\n },\n ':active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n },\n },\n});\n\nconst useDayIsTodayStyles = makeStyles({\n base: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForegroundOnBrand,\n fontWeight: tokens.fontWeightSemibold,\n\n [`& > .${calendarDayGridClassNames.dayMarker}`]: {\n backgroundColor: tokens.colorNeutralForegroundOnBrand,\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n },\n },\n },\n});\n\nconst useDayTodayMarkerStyles = makeStyles({\n base: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: tokens.colorBrandBackground,\n borderRadius: '100%',\n width: '20px',\n height: '20px',\n lineHeight: '20px',\n '@media (forced-colors: active)': {\n backgroundColor: 'WindowText',\n ...shorthands.borderColor('WindowText'),\n color: 'Window',\n forcedColorAdjust: 'none',\n },\n },\n});\n\nconst useFirstTransitionWeekStyles = makeStyles({\n base: {\n height: 0,\n opacity: 0,\n overflow: 'hidden',\n\n position: 'absolute',\n width: 0,\n },\n verticalForward: {\n animationDuration: DURATION_3,\n animationFillMode: 'both',\n animationName: [FADE_OUT, SLIDE_UP_OUT20, TRANSITION_ROW_DISAPPEARANCE],\n animationTimingFunction: EASING_FUNCTION_1,\n },\n});\n\nconst useLastTransitionWeekStyles = makeStyles({\n base: {\n height: 0,\n marginTop: '-28px',\n opacity: 0,\n overflow: 'hidden',\n position: 'absolute',\n width: 0,\n },\n verticalBackward: {\n animationDuration: DURATION_3,\n animationFillMode: 'both',\n animationName: [FADE_OUT, SLIDE_DOWN_OUT20, TRANSITION_ROW_DISAPPEARANCE],\n animationTimingFunction: EASING_FUNCTION_1,\n },\n});\n\nconst useDayMarkerStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorBrandForeground2,\n borderRadius: '100%',\n bottom: '1px',\n height: '4px',\n left: 0,\n margin: 'auto',\n\n position: 'absolute',\n right: 0,\n width: '4px',\n\n '@media (forced-colors: active)': {\n backgroundColor: 'WindowText',\n forcedColorAdjust: 'none',\n },\n },\n});\n\nconst useCornerBorderAndRadiusStyles = makeStyles({\n corners: {\n [`&.${weekCornersClassNames.topRightCornerDate}`]: {\n borderTopRightRadius: tokens.borderRadiusMedium,\n },\n [`&.${weekCornersClassNames.topLeftCornerDate}`]: {\n borderTopLeftRadius: tokens.borderRadiusMedium,\n },\n [`&.${weekCornersClassNames.bottomRightCornerDate}`]: {\n borderBottomRightRadius: tokens.borderRadiusMedium,\n },\n [`&.${weekCornersClassNames.bottomLeftCornerDate}`]: {\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n },\n },\n});\n\n/**\n * Apply styling to the CalendarDayGrid slots based on the state\n *\n * @internal\n */\nexport const useCalendarDayGridStyles_unstable = (props: CalendarDayGridStyleProps): CalendarDayGridStyles => {\n 'use no memo';\n\n const wrapperStyles = useWrapperStyles();\n const tableStyles = useTableStyles();\n const dayCellStyles = useDayCellStyles();\n const daySelectedStyles = useDaySelectedStyles();\n const daySingleSelectedStyles = useDaySingleSelectedStyles();\n const weekRowStyles = useWeekRowStyles();\n const weekDayLabelCellStyles = useWeekDayLabelCellStyles();\n const weekNumberCellStyles = useWeekNumberCellStyles();\n const dayOutsideBoundsStyles = useDayOutsideBoundsStyles();\n const dayOutsideNavigatedMonthStyles = useDayOutsideNavigatedMonthStyles();\n const dayButtonStyles = useDayButtonStyles();\n const dayIsTodayStyles = useDayIsTodayStyles();\n const firstTransitionWeekStyles = useFirstTransitionWeekStyles();\n const lastTransitionWeekStyles = useLastTransitionWeekStyles();\n const dayMarkerStyles = useDayMarkerStyles();\n const cornerBorderAndRadiusStyles = useCornerBorderAndRadiusStyles();\n const dayTodayMarkerStyles = useDayTodayMarkerStyles();\n\n const { animateBackwards, animationDirection, lightenDaysOutsideNavigatedMonth, showWeekNumbers } = props;\n\n return {\n wrapper: mergeClasses(calendarDayGridClassNames.wrapper, wrapperStyles.base),\n table: mergeClasses(\n calendarDayGridClassNames.table,\n tableStyles.base,\n showWeekNumbers && tableStyles.showWeekNumbers,\n ),\n dayCell: mergeClasses(\n calendarDayGridClassNames.dayCell,\n dayCellStyles.base,\n dayCellStyles.focusIndicator,\n cornerBorderAndRadiusStyles.corners,\n ),\n daySelected: mergeClasses(calendarDayGridClassNames.daySelected, daySelectedStyles.base),\n daySingleSelected: mergeClasses(calendarDayGridClassNames.daySingleSelected, daySingleSelectedStyles.base),\n weekRow: mergeClasses(\n calendarDayGridClassNames.weekRow,\n weekRowStyles.base,\n animateBackwards !== undefined && weekRowStyles.animation,\n animateBackwards !== undefined &&\n (animationDirection === AnimationDirection.Horizontal\n ? animateBackwards\n ? weekRowStyles.horizontalBackward\n : weekRowStyles.horizontalForward\n : animateBackwards\n ? weekRowStyles.verticalBackward\n : weekRowStyles.verticalForward),\n ),\n weekDayLabelCell: mergeClasses(calendarDayGridClassNames.weekDayLabelCell, weekDayLabelCellStyles.base),\n weekNumberCell: mergeClasses(calendarDayGridClassNames.weekNumberCell, weekNumberCellStyles.base),\n dayOutsideBounds: mergeClasses(calendarDayGridClassNames.dayOutsideBounds, dayOutsideBoundsStyles.base),\n dayOutsideNavigatedMonth: mergeClasses(\n calendarDayGridClassNames.dayOutsideNavigatedMonth,\n lightenDaysOutsideNavigatedMonth && dayOutsideNavigatedMonthStyles.lightenDaysOutsideNavigatedMonth,\n ),\n dayButton: mergeClasses(calendarDayGridClassNames.dayButton, dayButtonStyles.base),\n dayIsToday: mergeClasses(calendarDayGridClassNames.dayIsToday, dayIsTodayStyles.base),\n firstTransitionWeek: mergeClasses(\n calendarDayGridClassNames.firstTransitionWeek,\n firstTransitionWeekStyles.base,\n animateBackwards !== undefined &&\n animationDirection !== AnimationDirection.Horizontal &&\n !animateBackwards &&\n firstTransitionWeekStyles.verticalForward,\n ),\n lastTransitionWeek: mergeClasses(\n calendarDayGridClassNames.lastTransitionWeek,\n lastTransitionWeekStyles.base,\n animateBackwards !== undefined &&\n animationDirection !== AnimationDirection.Horizontal &&\n animateBackwards &&\n lastTransitionWeekStyles.verticalBackward,\n ),\n dayMarker: mergeClasses(calendarDayGridClassNames.dayMarker, dayMarkerStyles.base),\n dayTodayMarker: mergeClasses(calendarDayGridClassNames.dayTodayMarker, dayTodayMarkerStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","DURATION_2","DURATION_3","EASING_FUNCTION_1","EASING_FUNCTION_2","FADE_IN","FADE_OUT","SLIDE_DOWN_IN20","SLIDE_DOWN_OUT20","SLIDE_LEFT_IN20","SLIDE_RIGHT_IN20","SLIDE_UP_IN20","SLIDE_UP_OUT20","TRANSITION_ROW_DISAPPEARANCE","AnimationDirection","weekCornersClassNames","createFocusOutlineStyle","calendarDayGridClassNames","wrapper","table","dayCell","daySelected","daySingleSelected","weekRow","weekDayLabelCell","weekNumberCell","dayOutsideBounds","dayOutsideNavigatedMonth","dayButton","dayIsToday","firstTransitionWeek","lastTransitionWeek","dayMarker","dayTodayMarker","extraCalendarDayGridClassNames","hoverStyle","pressedStyle","useWrapperStyles","base","paddingBottom","useTableStyles","borderCollapse","borderSpacing","fontSize","marginTop","position","tableLayout","textAlign","width","showWeekNumbers","useDayCellStyles","color","colorNeutralForeground1","cursor","fontSizeBase200","fontWeight","fontWeightRegular","margin","padding","backgroundColor","colorNeutralForeground1Static","colorBrandBackgroundInvertedHover","outline","zIndex","colorBrandBackgroundInvertedPressed","borderColor","focusIndicator","style","outlineWidth","strokeWidthThick","borderWidth","useDaySelectedStyles","colorBrandBackgroundInvertedSelected","forcedColorAdjust","useDaySingleSelectedStyles","borderRadius","borderRadiusMedium","border","colorBrandStroke1","useWeekRowStyles","animation","animationDuration","animationFillMode","animationTimingFunction","horizontalBackward","animationName","horizontalForward","verticalBackward","verticalForward","useWeekDayLabelCellStyles","userSelect","useWeekNumberCellStyles","colorTransparentBackground","borderRight","colorNeutralStroke2","boxSizing","colorNeutralForeground4","height","useDayOutsideBoundsStyles","colorNeutralForegroundDisabled","pointerEvents","useDayOutsideNavigatedMonthStyles","lightenDaysOutsideNavigatedMonth","useDayButtonStyles","lineHeight","overflow","useDayIsTodayStyles","display","justifyContent","alignItems","colorNeutralForegroundOnBrand","fontWeightSemibold","useDayTodayMarkerStyles","colorBrandBackground","useFirstTransitionWeekStyles","opacity","useLastTransitionWeekStyles","useDayMarkerStyles","colorBrandForeground2","bottom","left","right","useCornerBorderAndRadiusStyles","corners","topRightCornerDate","borderTopRightRadius","topLeftCornerDate","borderTopLeftRadius","bottomRightCornerDate","borderBottomRightRadius","bottomLeftCornerDate","borderBottomLeftRadius","useCalendarDayGridStyles_unstable","props","wrapperStyles","tableStyles","dayCellStyles","daySelectedStyles","daySingleSelectedStyles","weekRowStyles","weekDayLabelCellStyles","weekNumberCellStyles","dayOutsideBoundsStyles","dayOutsideNavigatedMonthStyles","dayButtonStyles","dayIsTodayStyles","firstTransitionWeekStyles","lastTransitionWeekStyles","dayMarkerStyles","cornerBorderAndRadiusStyles","dayTodayMarkerStyles","animateBackwards","animationDirection","undefined","Horizontal"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACtE,SACEC,UAAU,EACVC,UAAU,EACVC,iBAAiB,EACjBC,iBAAiB,EACjBC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,gBAAgB,EAChBC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,cAAc,EACdC,4BAA4B,QACvB,cAAc;AACrB,SAASC,kBAAk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B4I,UAAU,GACjDH,mBACEZ,cAAcvD,kBAAkB,GAChCuD,cAAcrD,iBAAiB,GACjCiE,mBACAZ,cAAcpD,gBAAgB,GAC9BoD,cAAcnD,eAAe,AAAD;QAEpChE,kBAAkBzB,aAAakB,0BAA0BO,gBAAgB,EAAEoH,uBAAuBtG,IAAI;QACtGb,gBAAgB1B,aAAakB,0BAA0BQ,cAAc,EAAEoH,qBAAqBvG,IAAI;QAChGZ,kBAAkB3B,aAAakB,0BAA0BS,gBAAgB,EAAEoH,uBAAuBxG,IAAI;QACtGX,0BAA0B5B,aACxBkB,0BAA0BU,wBAAwB,EAClD2E,oCAAoCyC,+BAA+BzC,gCAAgC;QAErG1E,WAAW7B,aAAakB,0BAA0BW,SAAS,EAAEoH,gBAAgB1G,IAAI;QACjFT,YAAY9B,aAAakB,0BAA0BY,UAAU,EAAEoH,iBAAiB3G,IAAI;QACpFR,qBAAqB/B,aACnBkB,0BAA0Ba,mBAAmB,EAC7CoH,0BAA0B5G,IAAI,EAC9BiH,qBAAqBE,aACnBD,uBAAuB1I,mBAAmB4I,UAAU,IACpD,CAACH,oBACDL,0BAA0B1D,eAAe;QAE7CzD,oBAAoBhC,aAClBkB,0BAA0Bc,kBAAkB,EAC5CoH,yBAAyB7G,IAAI,EAC7BiH,qBAAqBE,aACnBD,uBAAuB1I,mBAAmB4I,UAAU,IACpDH,oBACAJ,yBAAyB5D,gBAAgB;QAE7CvD,WAAWjC,aAAakB,0BAA0Be,SAAS,EAAEoH,gBAAgB9G,IAAI;QACjFL,gBAAgBlC,aAAakB,0BAA0BgB,cAAc,EAAEqH,qBAAqBhH,IAAI;IAClG;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarDayGrid/useCalendarDayGridStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { weekCornersClassNames } from './useWeekCornerStyles.styles';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarDayGridStyles, CalendarDayGridStyleProps } from './CalendarDayGrid.types';\n\n/**\n * @internal\n */\nexport const calendarDayGridClassNames: SlotClassNames<CalendarDayGridStyles> = {\n wrapper: 'fui-CalendarDayGrid__wrapper',\n table: 'fui-CalendarDayGrid__table',\n dayCell: 'fui-CalendarDayGrid__dayCell',\n daySelected: 'fui-CalendarDayGrid__daySelected',\n daySingleSelected: 'fui-CalendarDayGrid__daySingleSelected',\n weekRow: 'fui-CalendarDayGrid__weekRow',\n weekDayLabelCell: 'fui-CalendarDayGrid__weekDayLabelCell',\n weekNumberCell: 'fui-CalendarDayGrid__weekNumberCell',\n dayOutsideBounds: 'fui-CalendarDayGrid__dayOutsideBounds',\n dayOutsideNavigatedMonth: 'fui-CalendarDayGrid__dayOutsideNavigatedMonth',\n dayButton: 'fui-CalendarDayGrid__dayButton',\n dayIsToday: 'fui-CalendarDayGrid__dayIsToday',\n firstTransitionWeek: 'fui-CalendarDayGrid__firstTransitionWeek',\n lastTransitionWeek: 'fui-CalendarDayGrid__lastTransitionWeek',\n dayMarker: 'fui-CalendarDayGrid__dayMarker',\n dayTodayMarker: 'fui-CalendarDayGrid__dayTodayMarker',\n};\n\n/**\n * @internal\n */\nexport const extraCalendarDayGridClassNames = {\n hoverStyle: 'fui-CalendarDayGrid__hoverStyle',\n pressedStyle: 'fui-CalendarDayGrid__pressedStyle',\n};\n\nconst useWrapperStyles = makeStyles({\n base: {\n paddingBottom: '10px',\n },\n});\n\nconst useTableStyles = makeStyles({\n base: {\n borderCollapse: 'collapse',\n borderSpacing: 0,\n fontSize: 'inherit',\n marginTop: '4px',\n paddingBottom: '10px',\n position: 'relative',\n tableLayout: 'fixed',\n textAlign: 'center',\n width: '196px',\n },\n showWeekNumbers: {\n width: '226px',\n },\n});\n\nconst useDayCellStyles = makeStyles({\n base: {\n color: tokens.colorNeutralForeground1,\n cursor: 'pointer',\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n margin: '0',\n padding: '2px',\n position: 'relative',\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n color: 'WindowText',\n },\n\n [`&.${extraCalendarDayGridClassNames.hoverStyle}`]: {\n color: tokens.colorNeutralForeground1Static,\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n '@media (forced-colors: active)': {\n outline: '1px solid Highlight',\n zIndex: 3,\n [`& .${calendarDayGridClassNames.dayTodayMarker}`]: {\n backgroundColor: 'Highlight',\n },\n },\n },\n\n [`&.${extraCalendarDayGridClassNames.pressedStyle}`]: {\n color: tokens.colorNeutralForeground1Static,\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n },\n },\n focusIndicator: createFocusOutlineStyle({\n style: {\n outlineWidth: tokens.strokeWidthThick,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n },\n }),\n});\n\nconst useDaySelectedStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n color: tokens.colorNeutralForeground1Static,\n\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n },\n\n [`&:hover, &.${extraCalendarDayGridClassNames.hoverStyle}, &.${extraCalendarDayGridClassNames.pressedStyle}`]: {\n color: tokens.colorNeutralForeground1Static,\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n color: 'HighlightText',\n },\n },\n\n [`& > .${calendarDayGridClassNames.dayMarker}`]: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n },\n },\n },\n});\n\nconst useDaySingleSelectedStyles = makeStyles({\n base: {\n color: tokens.colorNeutralForeground1Static,\n\n [`& > .${calendarDayGridClassNames.dayMarker}`]: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n },\n },\n\n [`& > .${calendarDayGridClassNames.dayButton}`]: {\n backgroundColor: tokens.colorBrandBackgroundInvertedSelected,\n borderRadius: tokens.borderRadiusMedium,\n border: `1px solid ${tokens.colorBrandStroke1}`,\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n },\n },\n },\n});\n\nconst useWeekRowStyles = makeStyles({\n base: {\n position: 'relative',\n ':focus-within': {\n zIndex: 1,\n },\n },\n});\n\nconst useWeekDayLabelCellStyles = makeStyles({\n base: {\n userSelect: 'none',\n },\n});\n\nconst useWeekNumberCellStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground4,\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n height: '28px',\n margin: '0',\n padding: '0',\n width: '28px',\n },\n});\n\nconst useDayOutsideBoundsStyles = makeStyles({\n base: {\n [`&, &:disabled, & button, &.${extraCalendarDayGridClassNames.hoverStyle}` +\n `, &.${extraCalendarDayGridClassNames.pressedStyle}`]: {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\nconst useDayOutsideNavigatedMonthStyles = makeStyles({\n lightenDaysOutsideNavigatedMonth: {\n color: tokens.colorNeutralForeground4,\n fontWeight: tokens.fontWeightRegular,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\nconst useDayButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n border: 'none',\n color: 'inherit',\n cursor: 'pointer',\n fontSize: tokens.fontSizeBase200,\n fontWeight: 'inherit',\n height: '24px',\n lineHeight: '24px',\n overflow: 'visible',\n padding: '0',\n width: '24px',\n\n '&span': {\n height: 'inherit',\n lineHeight: 'inherit',\n },\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n borderRadius: tokens.borderRadiusMedium,\n },\n ':active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n },\n },\n});\n\nconst useDayIsTodayStyles = makeStyles({\n base: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n color: tokens.colorNeutralForegroundOnBrand,\n fontWeight: tokens.fontWeightSemibold,\n\n [`& > .${calendarDayGridClassNames.dayMarker}`]: {\n backgroundColor: tokens.colorNeutralForegroundOnBrand,\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n },\n },\n },\n});\n\nconst useDayTodayMarkerStyles = makeStyles({\n base: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: tokens.colorBrandBackground,\n borderRadius: '100%',\n width: '20px',\n height: '20px',\n lineHeight: '20px',\n '@media (forced-colors: active)': {\n backgroundColor: 'WindowText',\n ...shorthands.borderColor('WindowText'),\n color: 'Window',\n forcedColorAdjust: 'none',\n },\n },\n});\n\nconst useFirstTransitionWeekStyles = makeStyles({\n base: {\n // Overlaid out of flow and transparent at rest; `pointerEvents: 'none'` stops the invisible\n // overlay from intercepting clicks. `TransitionRowSlideOut` fades opacity 1 → 0, ending here.\n opacity: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n },\n});\n\nconst useLastTransitionWeekStyles = makeStyles({\n base: {\n marginTop: '-28px',\n opacity: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n },\n});\n\nconst useDayMarkerStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorBrandForeground2,\n borderRadius: '100%',\n bottom: '1px',\n height: '4px',\n left: 0,\n margin: 'auto',\n\n position: 'absolute',\n right: 0,\n width: '4px',\n\n '@media (forced-colors: active)': {\n backgroundColor: 'WindowText',\n forcedColorAdjust: 'none',\n },\n },\n});\n\nconst useCornerBorderAndRadiusStyles = makeStyles({\n corners: {\n [`&.${weekCornersClassNames.topRightCornerDate}`]: {\n borderTopRightRadius: tokens.borderRadiusMedium,\n },\n [`&.${weekCornersClassNames.topLeftCornerDate}`]: {\n borderTopLeftRadius: tokens.borderRadiusMedium,\n },\n [`&.${weekCornersClassNames.bottomRightCornerDate}`]: {\n borderBottomRightRadius: tokens.borderRadiusMedium,\n },\n [`&.${weekCornersClassNames.bottomLeftCornerDate}`]: {\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n },\n },\n});\n\n/**\n * Apply styling to the CalendarDayGrid slots based on the state\n *\n * @internal\n */\nexport const useCalendarDayGridStyles_unstable = (props: CalendarDayGridStyleProps): CalendarDayGridStyles => {\n 'use no memo'; // justified: compiler would optimize useCalendarDayGridStyles_unstable — manual opt-out to preserve runtime behavior\n\n const wrapperStyles = useWrapperStyles();\n const tableStyles = useTableStyles();\n const dayCellStyles = useDayCellStyles();\n const daySelectedStyles = useDaySelectedStyles();\n const daySingleSelectedStyles = useDaySingleSelectedStyles();\n const weekRowStyles = useWeekRowStyles();\n const weekDayLabelCellStyles = useWeekDayLabelCellStyles();\n const weekNumberCellStyles = useWeekNumberCellStyles();\n const dayOutsideBoundsStyles = useDayOutsideBoundsStyles();\n const dayOutsideNavigatedMonthStyles = useDayOutsideNavigatedMonthStyles();\n const dayButtonStyles = useDayButtonStyles();\n const dayIsTodayStyles = useDayIsTodayStyles();\n const firstTransitionWeekStyles = useFirstTransitionWeekStyles();\n const lastTransitionWeekStyles = useLastTransitionWeekStyles();\n const dayMarkerStyles = useDayMarkerStyles();\n const cornerBorderAndRadiusStyles = useCornerBorderAndRadiusStyles();\n const dayTodayMarkerStyles = useDayTodayMarkerStyles();\n\n const { lightenDaysOutsideNavigatedMonth, showWeekNumbers } = props;\n\n return {\n wrapper: mergeClasses(calendarDayGridClassNames.wrapper, wrapperStyles.base),\n table: mergeClasses(\n calendarDayGridClassNames.table,\n tableStyles.base,\n showWeekNumbers && tableStyles.showWeekNumbers,\n ),\n dayCell: mergeClasses(\n calendarDayGridClassNames.dayCell,\n dayCellStyles.base,\n dayCellStyles.focusIndicator,\n cornerBorderAndRadiusStyles.corners,\n ),\n daySelected: mergeClasses(calendarDayGridClassNames.daySelected, daySelectedStyles.base),\n daySingleSelected: mergeClasses(calendarDayGridClassNames.daySingleSelected, daySingleSelectedStyles.base),\n weekRow: mergeClasses(calendarDayGridClassNames.weekRow, weekRowStyles.base),\n weekDayLabelCell: mergeClasses(calendarDayGridClassNames.weekDayLabelCell, weekDayLabelCellStyles.base),\n weekNumberCell: mergeClasses(calendarDayGridClassNames.weekNumberCell, weekNumberCellStyles.base),\n dayOutsideBounds: mergeClasses(calendarDayGridClassNames.dayOutsideBounds, dayOutsideBoundsStyles.base),\n dayOutsideNavigatedMonth: mergeClasses(\n calendarDayGridClassNames.dayOutsideNavigatedMonth,\n lightenDaysOutsideNavigatedMonth && dayOutsideNavigatedMonthStyles.lightenDaysOutsideNavigatedMonth,\n ),\n dayButton: mergeClasses(calendarDayGridClassNames.dayButton, dayButtonStyles.base),\n dayIsToday: mergeClasses(calendarDayGridClassNames.dayIsToday, dayIsTodayStyles.base),\n firstTransitionWeek: mergeClasses(calendarDayGridClassNames.firstTransitionWeek, firstTransitionWeekStyles.base),\n lastTransitionWeek: mergeClasses(calendarDayGridClassNames.lastTransitionWeek, lastTransitionWeekStyles.base),\n dayMarker: mergeClasses(calendarDayGridClassNames.dayMarker, dayMarkerStyles.base),\n dayTodayMarker: mergeClasses(calendarDayGridClassNames.dayTodayMarker, dayTodayMarkerStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","weekCornersClassNames","createFocusOutlineStyle","calendarDayGridClassNames","wrapper","table","dayCell","daySelected","daySingleSelected","weekRow","weekDayLabelCell","weekNumberCell","dayOutsideBounds","dayOutsideNavigatedMonth","dayButton","dayIsToday","firstTransitionWeek","lastTransitionWeek","dayMarker","dayTodayMarker","extraCalendarDayGridClassNames","hoverStyle","pressedStyle","useWrapperStyles","base","paddingBottom","useTableStyles","borderCollapse","borderSpacing","fontSize","marginTop","position","tableLayout","textAlign","width","showWeekNumbers","useDayCellStyles","color","colorNeutralForeground1","cursor","fontSizeBase200","fontWeight","fontWeightRegular","margin","padding","backgroundColor","colorNeutralForeground1Static","colorBrandBackgroundInvertedHover","outline","zIndex","colorBrandBackgroundInvertedPressed","borderColor","focusIndicator","style","outlineWidth","strokeWidthThick","borderWidth","useDaySelectedStyles","colorBrandBackgroundInvertedSelected","forcedColorAdjust","useDaySingleSelectedStyles","borderRadius","borderRadiusMedium","border","colorBrandStroke1","useWeekRowStyles","useWeekDayLabelCellStyles","userSelect","useWeekNumberCellStyles","colorTransparentBackground","borderRight","colorNeutralStroke2","boxSizing","colorNeutralForeground4","height","useDayOutsideBoundsStyles","colorNeutralForegroundDisabled","pointerEvents","useDayOutsideNavigatedMonthStyles","lightenDaysOutsideNavigatedMonth","useDayButtonStyles","lineHeight","overflow","useDayIsTodayStyles","display","justifyContent","alignItems","colorNeutralForegroundOnBrand","fontWeightSemibold","useDayTodayMarkerStyles","colorBrandBackground","useFirstTransitionWeekStyles","opacity","useLastTransitionWeekStyles","useDayMarkerStyles","colorBrandForeground2","bottom","left","right","useCornerBorderAndRadiusStyles","corners","topRightCornerDate","borderTopRightRadius","topLeftCornerDate","borderTopLeftRadius","bottomRightCornerDate","borderBottomRightRadius","bottomLeftCornerDate","borderBottomLeftRadius","useCalendarDayGridStyles_unstable","props","wrapperStyles","tableStyles","dayCellStyles","daySelectedStyles","daySingleSelectedStyles","weekRowStyles","weekDayLabelCellStyles","weekNumberCellStyles","dayOutsideBoundsStyles","dayOutsideNavigatedMonthStyles","dayButtonStyles","dayIsTodayStyles","firstTransitionWeekStyles","lastTransitionWeekStyles","dayMarkerStyles","cornerBorderAndRadiusStyles","dayTodayMarkerStyles"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAAS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G;AACF,EAAE"}
|
|
@@ -4,7 +4,6 @@ import { compareDates, DAYS_IN_WEEK, getDayGrid } from '../../utils/index';
|
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/ export function useWeeks(props, onSelectDate, getSetRefCallback) {
|
|
7
|
-
'use no memo';
|
|
8
7
|
/**
|
|
9
8
|
* Initial parsing of the given props to generate IDayInfo two dimensional array, which contains a representation
|
|
10
9
|
* of every day in the grid. Convenient for helping with conversions between day refs and Date objects in callbacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarDayGrid/useWeeks.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { compareDates, DAYS_IN_WEEK, getDayGrid } from '../../utils/index';\nimport type { DayInfo } from './CalendarDayGrid';\nimport type { CalendarDayGridProps } from './CalendarDayGrid.types';\n\n/**\n * @internal\n */\nexport function useWeeks(\n props: CalendarDayGridProps,\n onSelectDate: (date: Date) => void,\n getSetRefCallback: (dayKey: string) => (element: HTMLElement | null) => void,\n): DayInfo[][] {\n
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarDayGrid/useWeeks.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { compareDates, DAYS_IN_WEEK, getDayGrid } from '../../utils/index';\nimport type { DayInfo } from './CalendarDayGrid';\nimport type { CalendarDayGridProps } from './CalendarDayGrid.types';\n\n/**\n * @internal\n */\nexport function useWeeks(\n props: CalendarDayGridProps,\n onSelectDate: (date: Date) => void,\n getSetRefCallback: (dayKey: string) => (element: HTMLElement | null) => void,\n): DayInfo[][] {\n /**\n * Initial parsing of the given props to generate IDayInfo two dimensional array, which contains a representation\n * of every day in the grid. Convenient for helping with conversions between day refs and Date objects in callbacks.\n */\n const weeks = React.useMemo((): DayInfo[][] => {\n const weeksGrid = getDayGrid(props);\n\n const firstVisibleDay = weeksGrid[1][0].originalDate;\n const lastVisibleDay = weeksGrid[weeksGrid.length - 1][6].originalDate;\n const markedDays = props.getMarkedDays?.(firstVisibleDay, lastVisibleDay) || [];\n\n /**\n * Weeks is a 2D array. Weeks[0] contains the last week of the prior range,\n * Weeks[weeks.length - 1] contains first week of next range. These are for transition states.\n *\n * Weeks[1... weeks.length - 2] contains the actual visible data\n */\n const returnValue: DayInfo[][] = [];\n\n for (let weekIndex = 0; weekIndex < weeksGrid.length; weekIndex++) {\n const week: DayInfo[] = [];\n for (let dayIndex = 0; dayIndex < DAYS_IN_WEEK; dayIndex++) {\n const day = weeksGrid[weekIndex][dayIndex];\n const dayInfo: DayInfo = {\n onSelected: () => onSelectDate(day.originalDate),\n setRef: getSetRefCallback(day.key),\n ...day,\n isMarked: day.isMarked || markedDays?.some(markedDay => compareDates(day.originalDate, markedDay)),\n };\n\n week.push(dayInfo);\n }\n returnValue.push(week);\n }\n\n return returnValue;\n // TODO: this is missing deps on getSetRefCallback and onSelectDate (and depending on the entire\n // props object may not be a good idea due to likely frequent mutation). It would be easy to\n // fix getSetRefCallback to not mutate every render, but onSelectDate is passed down from\n // Calendar and trying to fix it requires a huge cascade of changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props]);\n\n return weeks;\n}\n"],"names":["React","compareDates","DAYS_IN_WEEK","getDayGrid","useWeeks","props","onSelectDate","getSetRefCallback","weeks","useMemo","weeksGrid","firstVisibleDay","originalDate","lastVisibleDay","length","markedDays","getMarkedDays","returnValue","weekIndex","week","dayIndex","day","dayInfo","onSelected","setRef","key","isMarked","some","markedDay","push"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,YAAY,EAAEC,YAAY,EAAEC,UAAU,QAAQ,oBAAoB;AAI3E;;CAEC,GACD,OAAO,SAASC,SACdC,KAA2B,EAC3BC,YAAkC,EAClCC,iBAA4E;IAE5E;;;GAGC,GACD,MAAMC,QAAQR,MAAMS,OAAO,CAAC;YAKPJ;QAJnB,MAAMK,YAAYP,WAAWE;QAE7B,MAAMM,kBAAkBD,SAAS,CAAC,EAAE,CAAC,EAAE,CAACE,YAAY;QACpD,MAAMC,iBAAiBH,SAAS,CAACA,UAAUI,MAAM,GAAG,EAAE,CAAC,EAAE,CAACF,YAAY;QACtE,MAAMG,aAAaV,EAAAA,uBAAAA,MAAMW,aAAa,cAAnBX,2CAAAA,0BAAAA,OAAsBM,iBAAiBE,oBAAmB,EAAE;QAE/E;;;;;KAKC,GACD,MAAMI,cAA2B,EAAE;QAEnC,IAAK,IAAIC,YAAY,GAAGA,YAAYR,UAAUI,MAAM,EAAEI,YAAa;YACjE,MAAMC,OAAkB,EAAE;YAC1B,IAAK,IAAIC,WAAW,GAAGA,WAAWlB,cAAckB,WAAY;gBAC1D,MAAMC,MAAMX,SAAS,CAACQ,UAAU,CAACE,SAAS;gBAC1C,MAAME,UAAmB;oBACvBC,YAAY,IAAMjB,aAAae,IAAIT,YAAY;oBAC/CY,QAAQjB,kBAAkBc,IAAII,GAAG;oBACjC,GAAGJ,GAAG;oBACNK,UAAUL,IAAIK,QAAQ,KAAIX,uBAAAA,iCAAAA,WAAYY,IAAI,CAACC,CAAAA,YAAa3B,aAAaoB,IAAIT,YAAY,EAAEgB;gBACzF;gBAEAT,KAAKU,IAAI,CAACP;YACZ;YACAL,YAAYY,IAAI,CAACV;QACnB;QAEA,OAAOF;IACP,gGAAgG;IAChG,4FAA4F;IAC5F,yFAAyF;IACzF,oEAAoE;IACpE,uDAAuD;IACzD,GAAG;QAACZ;KAAM;IAEV,OAAOG;AACT"}
|
|
@@ -6,6 +6,8 @@ import { mergeClasses } from '@griffel/react';
|
|
|
6
6
|
import { addYears, compareDatePart, getMonthEnd, getMonthStart, getYearEnd, getYearStart, setMonth, DEFAULT_DATE_FORMATTING } from '../../utils';
|
|
7
7
|
import { CalendarYear } from '../CalendarYear/CalendarYear';
|
|
8
8
|
import { useCalendarMonthStyles_unstable } from './useCalendarMonthStyles.styles';
|
|
9
|
+
import { DirectionalSlideIn } from '../../utils/calendarMotions';
|
|
10
|
+
import { AnimationDirection } from '../../Calendar';
|
|
9
11
|
const MONTHS_PER_ROW = 4;
|
|
10
12
|
function useAnimateBackwards({ navigatedDate }) {
|
|
11
13
|
const currentYear = navigatedDate.getFullYear();
|
|
@@ -56,7 +58,7 @@ function useFocusLogic({ componentRef }) {
|
|
|
56
58
|
/**
|
|
57
59
|
* @internal
|
|
58
60
|
*/ export const CalendarMonth = (props)=>{
|
|
59
|
-
const { allFocusable, animationDirection, className, componentRef, dateTimeFormatter = DEFAULT_DATE_FORMATTING, highlightCurrentMonth, highlightSelectedMonth, maxDate, minDate, navigatedDate, navigationIcons, onHeaderSelect: onUserHeaderSelect, onNavigateDate, selectedDate, strings, today = new Date(), yearPickerHidden = false } = props;
|
|
61
|
+
const { allFocusable, animationDirection = AnimationDirection.Vertical, className, componentRef, dateTimeFormatter = DEFAULT_DATE_FORMATTING, highlightCurrentMonth, highlightSelectedMonth, maxDate, minDate, navigatedDate, navigationIcons, onHeaderSelect: onUserHeaderSelect, onNavigateDate, selectedDate, strings, today = new Date(), yearPickerHidden = false } = props;
|
|
60
62
|
const [navigatedMonthRef, calendarYearRef, focusOnNextUpdate] = useFocusLogic({
|
|
61
63
|
componentRef
|
|
62
64
|
});
|
|
@@ -193,8 +195,12 @@ function useFocusLogic({ componentRef }) {
|
|
|
193
195
|
"aria-label": yearString
|
|
194
196
|
}, rowIndexes.map((rowNum)=>{
|
|
195
197
|
const monthsForRow = strings.shortMonths.slice(rowNum * MONTHS_PER_ROW, (rowNum + 1) * MONTHS_PER_ROW);
|
|
196
|
-
return /*#__PURE__*/ React.createElement(
|
|
197
|
-
key:
|
|
198
|
+
return /*#__PURE__*/ React.createElement(DirectionalSlideIn, {
|
|
199
|
+
key: rowNum,
|
|
200
|
+
replayKey: navigatedDate.getFullYear(),
|
|
201
|
+
animationDirection: animationDirection,
|
|
202
|
+
animateBackwards: animateBackwards
|
|
203
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
198
204
|
role: "row",
|
|
199
205
|
className: classNames.buttonRow
|
|
200
206
|
}, monthsForRow.map((month, index)=>{
|
|
@@ -217,7 +223,7 @@ function useFocusLogic({ componentRef }) {
|
|
|
217
223
|
tabIndex: isInBounds ? 0 : -1,
|
|
218
224
|
type: "button"
|
|
219
225
|
}, month);
|
|
220
|
-
}));
|
|
226
|
+
})));
|
|
221
227
|
})));
|
|
222
228
|
};
|
|
223
229
|
CalendarMonth.displayName = 'CalendarMonth';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarMonth/CalendarMonth.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { mergeClasses } from '@griffel/react';\nimport {\n addYears,\n compareDatePart,\n getMonthEnd,\n getMonthStart,\n getYearEnd,\n getYearStart,\n setMonth,\n DEFAULT_DATE_FORMATTING,\n} from '../../utils';\nimport { CalendarYear } from '../CalendarYear/CalendarYear';\nimport { useCalendarMonthStyles_unstable } from './useCalendarMonthStyles.styles';\nimport type { CalendarMonthProps } from './CalendarMonth.types';\nimport type { CalendarYearRange, ICalendarYear } from '../CalendarYear/CalendarYear.types';\n\nconst MONTHS_PER_ROW = 4;\n\nfunction useAnimateBackwards({ navigatedDate }: { navigatedDate: CalendarMonthProps['navigatedDate'] }) {\n const currentYear = navigatedDate.getFullYear();\n\n const previousYearRef = React.useRef<number | undefined>(undefined);\n React.useEffect(() => {\n previousYearRef.current = currentYear;\n });\n // eslint-disable-next-line react-hooks/refs\n const previousYear = previousYearRef.current;\n\n // eslint-disable-next-line react-hooks/refs\n if (previousYear === undefined || previousYear === currentYear) {\n return undefined;\n } else {\n return previousYear > currentYear;\n }\n}\n\nfunction useFocusLogic({ componentRef }: { componentRef: CalendarMonthProps['componentRef'] }) {\n const navigatedMonthRef = React.useRef<HTMLButtonElement>(null);\n const calendarYearRef = React.useRef<ICalendarYear>(null);\n const focusOnUpdate = React.useRef(false);\n\n const focus = React.useCallback(() => {\n if (calendarYearRef.current) {\n calendarYearRef.current.focus();\n } else if (navigatedMonthRef.current) {\n navigatedMonthRef.current.focus();\n }\n }, []);\n\n React.useImperativeHandle(componentRef, () => ({ focus }), [focus]);\n\n React.useEffect(() => {\n if (focusOnUpdate.current) {\n focus();\n focusOnUpdate.current = false;\n }\n });\n\n const focusOnNextUpdate = () => {\n focusOnUpdate.current = true;\n };\n\n return [navigatedMonthRef, calendarYearRef, focusOnNextUpdate] as const;\n}\n\n/**\n * @internal\n */\nexport const CalendarMonth: React.FunctionComponent<CalendarMonthProps> = props => {\n const {\n allFocusable,\n animationDirection,\n className,\n componentRef,\n dateTimeFormatter = DEFAULT_DATE_FORMATTING,\n highlightCurrentMonth,\n highlightSelectedMonth,\n maxDate,\n minDate,\n navigatedDate,\n navigationIcons,\n onHeaderSelect: onUserHeaderSelect,\n onNavigateDate,\n selectedDate,\n strings,\n today = new Date(),\n yearPickerHidden = false,\n } = props;\n\n const [navigatedMonthRef, calendarYearRef, focusOnNextUpdate] = useFocusLogic({ componentRef });\n const [isYearPickerVisible, setIsYearPickerVisible] = React.useState(false);\n\n const animateBackwards = useAnimateBackwards({ navigatedDate });\n\n const selectMonthCallback = (newMonth: number): (() => void) => {\n return () => onSelectMonth(newMonth);\n };\n\n const onSelectNextYear = (): void => {\n onNavigateDate(addYears(navigatedDate, 1), false);\n };\n\n const onSelectPrevYear = (): void => {\n onNavigateDate(addYears(navigatedDate, -1), false);\n };\n\n const onSelectMonth = (newMonth: number): void => {\n // If header is clickable the calendars are overlayed, switch back to day picker when month is clicked\n onUserHeaderSelect?.();\n onNavigateDate(setMonth(navigatedDate, newMonth), true);\n };\n\n const onHeaderSelect = (): void => {\n if (!yearPickerHidden) {\n focusOnNextUpdate();\n setIsYearPickerVisible(true);\n } else {\n onUserHeaderSelect?.();\n }\n };\n\n const onSelectYear = (selectedYear: number) => {\n focusOnNextUpdate();\n const navYear = navigatedDate.getFullYear();\n if (navYear !== selectedYear) {\n let newNavigationDate = new Date(navigatedDate.getTime());\n newNavigationDate.setFullYear(selectedYear);\n // for min and max dates, adjust the new navigation date - perhaps this should be\n // checked on the master navigation date handler (i.e. in Calendar)\n if (maxDate && newNavigationDate > maxDate) {\n newNavigationDate = setMonth(newNavigationDate, maxDate.getMonth());\n } else if (minDate && newNavigationDate < minDate) {\n newNavigationDate = setMonth(newNavigationDate, minDate.getMonth());\n }\n onNavigateDate(newNavigationDate, true);\n }\n setIsYearPickerVisible(false);\n };\n\n const onYearPickerHeaderSelect = (focus: boolean): void => {\n focusOnNextUpdate();\n setIsYearPickerVisible(false);\n };\n\n const dateFormatter = dateTimeFormatter!;\n\n // determine if previous/next years are in bounds\n const isPrevYearInBounds = minDate ? compareDatePart(minDate, getYearStart(navigatedDate)) < 0 : true;\n const isNextYearInBounds = maxDate ? compareDatePart(getYearEnd(navigatedDate), maxDate) < 0 : true;\n\n const classNames = useCalendarMonthStyles_unstable({\n className,\n hasHeaderClickCallback: !!onUserHeaderSelect || !yearPickerHidden,\n highlightCurrent: highlightCurrentMonth,\n highlightSelected: highlightSelectedMonth,\n animateBackwards,\n animationDirection,\n });\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid' });\n\n if (isYearPickerVisible) {\n const [onRenderYear, yearStrings] = getYearStrings({ dateTimeFormatter, navigatedDate, strings });\n // use navigated date for the year picker\n return (\n <CalendarYear\n key={'calendarYear'}\n minYear={minDate ? minDate.getFullYear() : undefined}\n maxYear={maxDate ? maxDate.getFullYear() : undefined}\n // eslint-disable-next-line react/jsx-no-bind\n onSelectYear={onSelectYear}\n // eslint-disable-next-line react/jsx-no-bind\n onHeaderSelect={onYearPickerHeaderSelect}\n selectedYear={\n selectedDate ? selectedDate.getFullYear() : navigatedDate ? navigatedDate.getFullYear() : undefined\n }\n navigatedYear={navigatedDate.getFullYear()}\n navigationIcons={navigationIcons}\n onRenderYear={onRenderYear}\n strings={yearStrings}\n componentRef={calendarYearRef}\n highlightCurrentYear={highlightCurrentMonth}\n highlightSelectedYear={highlightSelectedMonth}\n animationDirection={animationDirection}\n />\n );\n }\n\n const rowIndexes = [];\n for (let i = 0; i < strings.shortMonths.length / MONTHS_PER_ROW; i++) {\n rowIndexes.push(i);\n }\n\n const yearString = dateFormatter.formatYear(navigatedDate);\n const headerAriaLabel = strings.monthPickerHeaderAriaLabel\n ? strings.monthPickerHeaderAriaLabel.replace('{0}', yearString)\n : yearString;\n\n return (\n <div className={classNames.root}>\n <div className={classNames.headerContainer}>\n <button\n className={classNames.currentItemButton}\n onClick={onHeaderSelect}\n onKeyDown={onButtonKeyDown(onHeaderSelect)}\n aria-label={headerAriaLabel}\n tabIndex={!!onUserHeaderSelect || !yearPickerHidden ? 0 : -1}\n type=\"button\"\n >\n <span aria-live=\"polite\" aria-atomic=\"true\">\n {yearString}\n </span>\n </button>\n <div className={classNames.navigationButtonsContainer}>\n <button\n className={mergeClasses(classNames.navigationButton, !isPrevYearInBounds && classNames.disabled)}\n aria-disabled={!isPrevYearInBounds}\n tabIndex={isPrevYearInBounds ? undefined : allFocusable ? 0 : -1}\n onClick={isPrevYearInBounds ? onSelectPrevYear : undefined}\n onKeyDown={isPrevYearInBounds ? onButtonKeyDown(onSelectPrevYear) : undefined}\n title={\n strings.prevYearAriaLabel\n ? strings.prevYearAriaLabel + ' ' + dateFormatter.formatYear(addYears(navigatedDate, -1))\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.upNavigation}\n </button>\n <button\n className={mergeClasses(classNames.navigationButton, !isNextYearInBounds && classNames.disabled)}\n aria-disabled={!isNextYearInBounds}\n tabIndex={isNextYearInBounds ? undefined : allFocusable ? 0 : -1}\n onClick={isNextYearInBounds ? onSelectNextYear : undefined}\n onKeyDown={isNextYearInBounds ? onButtonKeyDown(onSelectNextYear) : undefined}\n title={\n strings.nextYearAriaLabel\n ? strings.nextYearAriaLabel + ' ' + dateFormatter.formatYear(addYears(navigatedDate, 1))\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.downNavigation}\n </button>\n </div>\n </div>\n <div {...arrowNavigationAttributes} className={classNames.gridContainer} role=\"grid\" aria-label={yearString}>\n {rowIndexes.map((rowNum: number) => {\n const monthsForRow = strings!.shortMonths.slice(rowNum * MONTHS_PER_ROW, (rowNum + 1) * MONTHS_PER_ROW);\n return (\n <div key={'monthRow_' + rowNum + navigatedDate.getFullYear()} role=\"row\" className={classNames.buttonRow}>\n {monthsForRow.map((month: string, index: number) => {\n const monthIndex = rowNum * MONTHS_PER_ROW + index;\n const indexedMonth = setMonth(navigatedDate, monthIndex);\n const isNavigatedMonth = navigatedDate.getMonth() === monthIndex;\n const isSelectedMonth = selectedDate.getMonth() === monthIndex;\n const isSelectedYear = selectedDate.getFullYear() === navigatedDate.getFullYear();\n const isInBounds =\n (minDate ? compareDatePart(minDate, getMonthEnd(indexedMonth)) < 1 : true) &&\n (maxDate ? compareDatePart(getMonthStart(indexedMonth), maxDate) < 1 : true);\n\n return (\n <button\n ref={isNavigatedMonth ? navigatedMonthRef : undefined}\n role={'gridcell'}\n className={mergeClasses(\n classNames.itemButton,\n highlightCurrentMonth &&\n isCurrentMonth(monthIndex, navigatedDate.getFullYear(), today) &&\n classNames.current,\n highlightSelectedMonth && isSelectedMonth && isSelectedYear && classNames.selected,\n !isInBounds && classNames.disabled,\n )}\n disabled={!allFocusable && !isInBounds}\n key={monthIndex}\n onClick={isInBounds ? selectMonthCallback(monthIndex) : undefined}\n onKeyDown={isInBounds ? onButtonKeyDown(selectMonthCallback(monthIndex)) : undefined}\n aria-label={dateFormatter.formatMonth(indexedMonth, strings!)}\n aria-selected={isNavigatedMonth}\n tabIndex={isInBounds ? 0 : -1}\n type=\"button\"\n >\n {month}\n </button>\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n};\nCalendarMonth.displayName = 'CalendarMonth';\n\nfunction getYearStrings({\n dateTimeFormatter,\n navigatedDate,\n strings,\n}: Pick<CalendarMonthProps, 'dateTimeFormatter' | 'navigatedDate' | 'strings'>) {\n const yearToString = (year: number) => {\n if (dateTimeFormatter) {\n // create a date based on the current nav date\n const yearFormattingDate = new Date(navigatedDate.getTime());\n yearFormattingDate.setFullYear(year);\n return dateTimeFormatter.formatYear(yearFormattingDate);\n }\n return String(year);\n };\n\n const yearRangeToString = (yearRange: CalendarYearRange) => {\n return `${yearToString(yearRange.fromYear)} - ${yearToString(yearRange.toYear)}`;\n };\n\n const yearRangeToNextDecadeLabel = (yearRange: CalendarYearRange) => {\n return strings.nextYearRangeAriaLabel ? `${strings.nextYearRangeAriaLabel} ${yearRangeToString(yearRange)}` : '';\n };\n\n const yearRangeToPrevDecadeLabel = (yearRange: CalendarYearRange) => {\n return strings.prevYearRangeAriaLabel ? `${strings.prevYearRangeAriaLabel} ${yearRangeToString(yearRange)}` : '';\n };\n\n return [\n yearToString,\n {\n rangeAriaLabel: yearRangeToString,\n prevRangeAriaLabel: yearRangeToPrevDecadeLabel,\n nextRangeAriaLabel: yearRangeToNextDecadeLabel,\n headerAriaLabelFormatString: strings.monthPickerHeaderAriaLabel,\n } as const,\n ] as const;\n}\n\nfunction isCurrentMonth(month: number, year: number, today: Date): boolean {\n return today.getFullYear() === year && today.getMonth() === month;\n}\n\nfunction onButtonKeyDown(callback: () => void): (ev: React.KeyboardEvent<HTMLButtonElement>) => void {\n return (ev: React.KeyboardEvent<HTMLButtonElement>) => {\n switch (ev.key) {\n case Enter:\n callback();\n break;\n }\n };\n}\n"],"names":["React","Enter","useArrowNavigationGroup","mergeClasses","addYears","compareDatePart","getMonthEnd","getMonthStart","getYearEnd","getYearStart","setMonth","DEFAULT_DATE_FORMATTING","CalendarYear","useCalendarMonthStyles_unstable","MONTHS_PER_ROW","useAnimateBackwards","navigatedDate","currentYear","getFullYear","previousYearRef","useRef","undefined","useEffect","current","previousYear","useFocusLogic","componentRef","navigatedMonthRef","calendarYearRef","focusOnUpdate","focus","useCallback","useImperativeHandle","focusOnNextUpdate","CalendarMonth","props","allFocusable","animationDirection","className","dateTimeFormatter","highlightCurrentMonth","highlightSelectedMonth","maxDate","minDate","navigationIcons","onHeaderSelect","onUserHeaderSelect","onNavigateDate","selectedDate","strings","today","Date","yearPickerHidden","isYearPickerVisible","setIsYearPickerVisible","useState","animateBackwards","selectMonthCallback","newMonth","onSelectMonth","onSelectNextYear","onSelectPrevYear","onSelectYear","selectedYear","navYear","newNavigationDate","getTime","setFullYear","getMonth","onYearPickerHeaderSelect","dateFormatter","isPrevYearInBounds","isNextYearInBounds","classNames","hasHeaderClickCallback","highlightCurrent","highlightSelected","arrowNavigationAttributes","axis","onRenderYear","yearStrings","getYearStrings","key","minYear","maxYear","navigatedYear","highlightCurrentYear","highlightSelectedYear","rowIndexes","i","shortMonths","length","push","yearString","formatYear","headerAriaLabel","monthPickerHeaderAriaLabel","replace","div","root","headerContainer","button","currentItemButton","onClick","onKeyDown","onButtonKeyDown","aria-label","tabIndex","type","span","aria-live","aria-atomic","navigationButtonsContainer","navigationButton","disabled","aria-disabled","title","prevYearAriaLabel","upNavigation","nextYearAriaLabel","downNavigation","gridContainer","role","map","rowNum","monthsForRow","slice","buttonRow","month","index","monthIndex","indexedMonth","isNavigatedMonth","isSelectedMonth","isSelectedYear","isInBounds","ref","itemButton","isCurrentMonth","selected","formatMonth","aria-selected","displayName","yearToString","year","yearFormattingDate","String","yearRangeToString","yearRange","fromYear","toYear","yearRangeToNextDecadeLabel","nextYearRangeAriaLabel","yearRangeToPrevDecadeLabel","prevYearRangeAriaLabel","rangeAriaLabel","prevRangeAriaLabel","nextRangeAriaLabel","headerAriaLabelFormatString","callback","ev"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SACEC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,UAAU,EACVC,YAAY,EACZC,QAAQ,EACRC,uBAAuB,QAClB,cAAc;AACrB,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EA,SAASvB,gBAAgBsD,QAAoB;IAC3C,OAAO,CAACC;QACN,OAAQA,GAAG9E,GAAG;YACZ,KAAKjF;gBACH8J;gBACA;QACJ;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarMonth/CalendarMonth.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Enter } from '@fluentui/keyboard-keys';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { mergeClasses } from '@griffel/react';\nimport {\n addYears,\n compareDatePart,\n getMonthEnd,\n getMonthStart,\n getYearEnd,\n getYearStart,\n setMonth,\n DEFAULT_DATE_FORMATTING,\n} from '../../utils';\nimport { CalendarYear } from '../CalendarYear/CalendarYear';\nimport { useCalendarMonthStyles_unstable } from './useCalendarMonthStyles.styles';\nimport type { CalendarMonthProps } from './CalendarMonth.types';\nimport type { CalendarYearRange, ICalendarYear } from '../CalendarYear/CalendarYear.types';\nimport { DirectionalSlideIn } from '../../utils/calendarMotions';\nimport { AnimationDirection } from '../../Calendar';\n\nconst MONTHS_PER_ROW = 4;\n\nfunction useAnimateBackwards({ navigatedDate }: { navigatedDate: CalendarMonthProps['navigatedDate'] }) {\n const currentYear = navigatedDate.getFullYear();\n\n const previousYearRef = React.useRef<number | undefined>(undefined);\n React.useEffect(() => {\n previousYearRef.current = currentYear;\n });\n // eslint-disable-next-line react-hooks/refs\n const previousYear = previousYearRef.current;\n\n // eslint-disable-next-line react-hooks/refs\n if (previousYear === undefined || previousYear === currentYear) {\n return undefined;\n } else {\n return previousYear > currentYear;\n }\n}\n\nfunction useFocusLogic({ componentRef }: { componentRef: CalendarMonthProps['componentRef'] }) {\n const navigatedMonthRef = React.useRef<HTMLButtonElement>(null);\n const calendarYearRef = React.useRef<ICalendarYear>(null);\n const focusOnUpdate = React.useRef(false);\n\n const focus = React.useCallback(() => {\n if (calendarYearRef.current) {\n calendarYearRef.current.focus();\n } else if (navigatedMonthRef.current) {\n navigatedMonthRef.current.focus();\n }\n }, []);\n\n React.useImperativeHandle(componentRef, () => ({ focus }), [focus]);\n\n React.useEffect(() => {\n if (focusOnUpdate.current) {\n focus();\n focusOnUpdate.current = false;\n }\n });\n\n const focusOnNextUpdate = () => {\n focusOnUpdate.current = true;\n };\n\n return [navigatedMonthRef, calendarYearRef, focusOnNextUpdate] as const;\n}\n\n/**\n * @internal\n */\nexport const CalendarMonth: React.FunctionComponent<CalendarMonthProps> = props => {\n const {\n allFocusable,\n animationDirection = AnimationDirection.Vertical,\n className,\n componentRef,\n dateTimeFormatter = DEFAULT_DATE_FORMATTING,\n highlightCurrentMonth,\n highlightSelectedMonth,\n maxDate,\n minDate,\n navigatedDate,\n navigationIcons,\n onHeaderSelect: onUserHeaderSelect,\n onNavigateDate,\n selectedDate,\n strings,\n today = new Date(),\n yearPickerHidden = false,\n } = props;\n\n const [navigatedMonthRef, calendarYearRef, focusOnNextUpdate] = useFocusLogic({ componentRef });\n const [isYearPickerVisible, setIsYearPickerVisible] = React.useState(false);\n\n const animateBackwards = useAnimateBackwards({ navigatedDate });\n\n const selectMonthCallback = (newMonth: number): (() => void) => {\n return () => onSelectMonth(newMonth);\n };\n\n const onSelectNextYear = (): void => {\n onNavigateDate(addYears(navigatedDate, 1), false);\n };\n\n const onSelectPrevYear = (): void => {\n onNavigateDate(addYears(navigatedDate, -1), false);\n };\n\n const onSelectMonth = (newMonth: number): void => {\n // If header is clickable the calendars are overlayed, switch back to day picker when month is clicked\n onUserHeaderSelect?.();\n onNavigateDate(setMonth(navigatedDate, newMonth), true);\n };\n\n const onHeaderSelect = (): void => {\n if (!yearPickerHidden) {\n focusOnNextUpdate();\n setIsYearPickerVisible(true);\n } else {\n onUserHeaderSelect?.();\n }\n };\n\n const onSelectYear = (selectedYear: number) => {\n focusOnNextUpdate();\n const navYear = navigatedDate.getFullYear();\n if (navYear !== selectedYear) {\n let newNavigationDate = new Date(navigatedDate.getTime());\n newNavigationDate.setFullYear(selectedYear);\n // for min and max dates, adjust the new navigation date - perhaps this should be\n // checked on the master navigation date handler (i.e. in Calendar)\n if (maxDate && newNavigationDate > maxDate) {\n newNavigationDate = setMonth(newNavigationDate, maxDate.getMonth());\n } else if (minDate && newNavigationDate < minDate) {\n newNavigationDate = setMonth(newNavigationDate, minDate.getMonth());\n }\n onNavigateDate(newNavigationDate, true);\n }\n setIsYearPickerVisible(false);\n };\n\n const onYearPickerHeaderSelect = (focus: boolean): void => {\n focusOnNextUpdate();\n setIsYearPickerVisible(false);\n };\n\n const dateFormatter = dateTimeFormatter!;\n\n // determine if previous/next years are in bounds\n const isPrevYearInBounds = minDate ? compareDatePart(minDate, getYearStart(navigatedDate)) < 0 : true;\n const isNextYearInBounds = maxDate ? compareDatePart(getYearEnd(navigatedDate), maxDate) < 0 : true;\n\n const classNames = useCalendarMonthStyles_unstable({\n className,\n hasHeaderClickCallback: !!onUserHeaderSelect || !yearPickerHidden,\n highlightCurrent: highlightCurrentMonth,\n highlightSelected: highlightSelectedMonth,\n animateBackwards,\n animationDirection,\n });\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid' });\n\n if (isYearPickerVisible) {\n const [onRenderYear, yearStrings] = getYearStrings({ dateTimeFormatter, navigatedDate, strings });\n // use navigated date for the year picker\n return (\n <CalendarYear\n key={'calendarYear'}\n minYear={minDate ? minDate.getFullYear() : undefined}\n maxYear={maxDate ? maxDate.getFullYear() : undefined}\n // eslint-disable-next-line react/jsx-no-bind\n onSelectYear={onSelectYear}\n // eslint-disable-next-line react/jsx-no-bind\n onHeaderSelect={onYearPickerHeaderSelect}\n selectedYear={\n selectedDate ? selectedDate.getFullYear() : navigatedDate ? navigatedDate.getFullYear() : undefined\n }\n navigatedYear={navigatedDate.getFullYear()}\n navigationIcons={navigationIcons}\n onRenderYear={onRenderYear}\n strings={yearStrings}\n componentRef={calendarYearRef}\n highlightCurrentYear={highlightCurrentMonth}\n highlightSelectedYear={highlightSelectedMonth}\n animationDirection={animationDirection}\n />\n );\n }\n\n const rowIndexes = [];\n for (let i = 0; i < strings.shortMonths.length / MONTHS_PER_ROW; i++) {\n rowIndexes.push(i);\n }\n\n const yearString = dateFormatter.formatYear(navigatedDate);\n const headerAriaLabel = strings.monthPickerHeaderAriaLabel\n ? strings.monthPickerHeaderAriaLabel.replace('{0}', yearString)\n : yearString;\n\n return (\n <div className={classNames.root}>\n <div className={classNames.headerContainer}>\n <button\n className={classNames.currentItemButton}\n onClick={onHeaderSelect}\n onKeyDown={onButtonKeyDown(onHeaderSelect)}\n aria-label={headerAriaLabel}\n tabIndex={!!onUserHeaderSelect || !yearPickerHidden ? 0 : -1}\n type=\"button\"\n >\n <span aria-live=\"polite\" aria-atomic=\"true\">\n {yearString}\n </span>\n </button>\n <div className={classNames.navigationButtonsContainer}>\n <button\n className={mergeClasses(classNames.navigationButton, !isPrevYearInBounds && classNames.disabled)}\n aria-disabled={!isPrevYearInBounds}\n tabIndex={isPrevYearInBounds ? undefined : allFocusable ? 0 : -1}\n onClick={isPrevYearInBounds ? onSelectPrevYear : undefined}\n onKeyDown={isPrevYearInBounds ? onButtonKeyDown(onSelectPrevYear) : undefined}\n title={\n strings.prevYearAriaLabel\n ? strings.prevYearAriaLabel + ' ' + dateFormatter.formatYear(addYears(navigatedDate, -1))\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.upNavigation}\n </button>\n <button\n className={mergeClasses(classNames.navigationButton, !isNextYearInBounds && classNames.disabled)}\n aria-disabled={!isNextYearInBounds}\n tabIndex={isNextYearInBounds ? undefined : allFocusable ? 0 : -1}\n onClick={isNextYearInBounds ? onSelectNextYear : undefined}\n onKeyDown={isNextYearInBounds ? onButtonKeyDown(onSelectNextYear) : undefined}\n title={\n strings.nextYearAriaLabel\n ? strings.nextYearAriaLabel + ' ' + dateFormatter.formatYear(addYears(navigatedDate, 1))\n : undefined\n }\n type=\"button\"\n >\n {navigationIcons.downNavigation}\n </button>\n </div>\n </div>\n <div {...arrowNavigationAttributes} className={classNames.gridContainer} role=\"grid\" aria-label={yearString}>\n {rowIndexes.map((rowNum: number) => {\n const monthsForRow = strings!.shortMonths.slice(rowNum * MONTHS_PER_ROW, (rowNum + 1) * MONTHS_PER_ROW);\n return (\n <DirectionalSlideIn\n key={rowNum}\n replayKey={navigatedDate.getFullYear()}\n animationDirection={animationDirection}\n animateBackwards={animateBackwards}\n >\n <div role=\"row\" className={classNames.buttonRow}>\n {monthsForRow.map((month: string, index: number) => {\n const monthIndex = rowNum * MONTHS_PER_ROW + index;\n const indexedMonth = setMonth(navigatedDate, monthIndex);\n const isNavigatedMonth = navigatedDate.getMonth() === monthIndex;\n const isSelectedMonth = selectedDate.getMonth() === monthIndex;\n const isSelectedYear = selectedDate.getFullYear() === navigatedDate.getFullYear();\n const isInBounds =\n (minDate ? compareDatePart(minDate, getMonthEnd(indexedMonth)) < 1 : true) &&\n (maxDate ? compareDatePart(getMonthStart(indexedMonth), maxDate) < 1 : true);\n\n return (\n <button\n ref={isNavigatedMonth ? navigatedMonthRef : undefined}\n role={'gridcell'}\n className={mergeClasses(\n classNames.itemButton,\n highlightCurrentMonth &&\n isCurrentMonth(monthIndex, navigatedDate.getFullYear(), today) &&\n classNames.current,\n highlightSelectedMonth && isSelectedMonth && isSelectedYear && classNames.selected,\n !isInBounds && classNames.disabled,\n )}\n disabled={!allFocusable && !isInBounds}\n key={monthIndex}\n onClick={isInBounds ? selectMonthCallback(monthIndex) : undefined}\n onKeyDown={isInBounds ? onButtonKeyDown(selectMonthCallback(monthIndex)) : undefined}\n aria-label={dateFormatter.formatMonth(indexedMonth, strings!)}\n aria-selected={isNavigatedMonth}\n tabIndex={isInBounds ? 0 : -1}\n type=\"button\"\n >\n {month}\n </button>\n );\n })}\n </div>\n </DirectionalSlideIn>\n );\n })}\n </div>\n </div>\n );\n};\nCalendarMonth.displayName = 'CalendarMonth';\n\nfunction getYearStrings({\n dateTimeFormatter,\n navigatedDate,\n strings,\n}: Pick<CalendarMonthProps, 'dateTimeFormatter' | 'navigatedDate' | 'strings'>) {\n const yearToString = (year: number) => {\n if (dateTimeFormatter) {\n // create a date based on the current nav date\n const yearFormattingDate = new Date(navigatedDate.getTime());\n yearFormattingDate.setFullYear(year);\n return dateTimeFormatter.formatYear(yearFormattingDate);\n }\n return String(year);\n };\n\n const yearRangeToString = (yearRange: CalendarYearRange) => {\n return `${yearToString(yearRange.fromYear)} - ${yearToString(yearRange.toYear)}`;\n };\n\n const yearRangeToNextDecadeLabel = (yearRange: CalendarYearRange) => {\n return strings.nextYearRangeAriaLabel ? `${strings.nextYearRangeAriaLabel} ${yearRangeToString(yearRange)}` : '';\n };\n\n const yearRangeToPrevDecadeLabel = (yearRange: CalendarYearRange) => {\n return strings.prevYearRangeAriaLabel ? `${strings.prevYearRangeAriaLabel} ${yearRangeToString(yearRange)}` : '';\n };\n\n return [\n yearToString,\n {\n rangeAriaLabel: yearRangeToString,\n prevRangeAriaLabel: yearRangeToPrevDecadeLabel,\n nextRangeAriaLabel: yearRangeToNextDecadeLabel,\n headerAriaLabelFormatString: strings.monthPickerHeaderAriaLabel,\n } as const,\n ] as const;\n}\n\nfunction isCurrentMonth(month: number, year: number, today: Date): boolean {\n return today.getFullYear() === year && today.getMonth() === month;\n}\n\nfunction onButtonKeyDown(callback: () => void): (ev: React.KeyboardEvent<HTMLButtonElement>) => void {\n return (ev: React.KeyboardEvent<HTMLButtonElement>) => {\n switch (ev.key) {\n case Enter:\n callback();\n break;\n }\n };\n}\n"],"names":["React","Enter","useArrowNavigationGroup","mergeClasses","addYears","compareDatePart","getMonthEnd","getMonthStart","getYearEnd","getYearStart","setMonth","DEFAULT_DATE_FORMATTING","CalendarYear","useCalendarMonthStyles_unstable","DirectionalSlideIn","AnimationDirection","MONTHS_PER_ROW","useAnimateBackwards","navigatedDate","currentYear","getFullYear","previousYearRef","useRef","undefined","useEffect","current","previousYear","useFocusLogic","componentRef","navigatedMonthRef","calendarYearRef","focusOnUpdate","focus","useCallback","useImperativeHandle","focusOnNextUpdate","CalendarMonth","props","allFocusable","animationDirection","Vertical","className","dateTimeFormatter","highlightCurrentMonth","highlightSelectedMonth","maxDate","minDate","navigationIcons","onHeaderSelect","onUserHeaderSelect","onNavigateDate","selectedDate","strings","today","Date","yearPickerHidden","isYearPickerVisible","setIsYearPickerVisible","useState","animateBackwards","selectMonthCallback","newMonth","onSelectMonth","onSelectNextYear","onSelectPrevYear","onSelectYear","selectedYear","navYear","newNavigationDate","getTime","setFullYear","getMonth","onYearPickerHeaderSelect","dateFormatter","isPrevYearInBounds","isNextYearInBounds","classNames","hasHeaderClickCallback","highlightCurrent","highlightSelected","arrowNavigationAttributes","axis","onRenderYear","yearStrings","getYearStrings","key","minYear","maxYear","navigatedYear","highlightCurrentYear","highlightSelectedYear","rowIndexes","i","shortMonths","length","push","yearString","formatYear","headerAriaLabel","monthPickerHeaderAriaLabel","replace","div","root","headerContainer","button","currentItemButton","onClick","onKeyDown","onButtonKeyDown","aria-label","tabIndex","type","span","aria-live","aria-atomic","navigationButtonsContainer","navigationButton","disabled","aria-disabled","title","prevYearAriaLabel","upNavigation","nextYearAriaLabel","downNavigation","gridContainer","role","map","rowNum","monthsForRow","slice","replayKey","buttonRow","month","index","monthIndex","indexedMonth","isNavigatedMonth","isSelectedMonth","isSelectedYear","isInBounds","ref","itemButton","isCurrentMonth","selected","formatMonth","aria-selected","displayName","yearToString","year","yearFormattingDate","String","yearRangeToString","yearRange","fromYear","toYear","yearRangeToNextDecadeLabel","nextYearRangeAriaLabel","yearRangeToPrevDecadeLabel","prevYearRangeAriaLabel","rangeAriaLabel","prevRangeAriaLabel","nextRangeAriaLabel","headerAriaLabelFormatString","callback","ev"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SACEC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,UAAU,EACVC,YAAY,EACZC,QAAQ,EACR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BAA6B9G,QAAQ+C,0BAA0B;QACjE;KACD;AACH;AAEA,SAAS2C,eAAeV,KAAa,EAAEgB,IAAY,EAAE/F,KAAW;IAC9D,OAAOA,MAAMjC,WAAW,OAAOgI,QAAQ/F,MAAMkB,QAAQ,OAAO6D;AAC9D;AAEA,SAASxB,gBAAgBuD,QAAoB;IAC3C,OAAO,CAACC;QACN,OAAQA,GAAG/E,GAAG;YACZ,KAAKpF;gBACHkK;gBACA;QACJ;IACF;AACF"}
|
|
@@ -9,5 +9,6 @@ import { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarP
|
|
|
9
9
|
export const useCalendarMonthStyles_unstable = props => {
|
|
10
10
|
'use no memo';
|
|
11
11
|
|
|
12
|
+
// justified: compiler would optimize useCalendarMonthStyles_unstable — manual opt-out to preserve runtime behavior
|
|
12
13
|
return useCalendarPickerStyles_unstable(props);
|
|
13
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCalendarPickerStyles_unstable","useCalendarMonthStyles_unstable","props"],"sources":["useCalendarMonthStyles.styles.js"],"sourcesContent":["'use client';\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\n/**\n * Apply styling to the CalendarMonth slots based on the state\n *\n * @internal\n */ export const useCalendarMonthStyles_unstable = (props)=>{\n 'use no memo'
|
|
1
|
+
{"version":3,"names":["useCalendarPickerStyles_unstable","useCalendarMonthStyles_unstable","props"],"sources":["useCalendarMonthStyles.styles.js"],"sourcesContent":["'use client';\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\n/**\n * Apply styling to the CalendarMonth slots based on the state\n *\n * @internal\n */ export const useCalendarMonthStyles_unstable = (props)=>{\n 'use no memo'; // justified: compiler would optimize useCalendarMonthStyles_unstable — manual opt-out to preserve runtime behavior\n return useCalendarPickerStyles_unstable(props);\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,gCAAgC,QAAQ,kDAAkD;AACnG;AACA;AACA;AACA;AACA;AAAI,OAAO,MAAMC,+BAA+B,GAAIC,KAAK,IAAG;EACxD,aAAa;;EAAE;EACf,OAAOF,gCAAgC,CAACE,KAAK,CAAC;AAClD,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,6 @@ import { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarP
|
|
|
5
5
|
*
|
|
6
6
|
* @internal
|
|
7
7
|
*/ export const useCalendarMonthStyles_unstable = (props)=>{
|
|
8
|
-
'use no memo';
|
|
8
|
+
'use no memo'; // justified: compiler would optimize useCalendarMonthStyles_unstable — manual opt-out to preserve runtime behavior
|
|
9
9
|
return useCalendarPickerStyles_unstable(props);
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarMonth/useCalendarMonthStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\nimport type { CalendarMonthStyleProps, CalendarMonthStyles } from './CalendarMonth.types';\n\n/**\n * Apply styling to the CalendarMonth slots based on the state\n *\n * @internal\n */\nexport const useCalendarMonthStyles_unstable = (props: CalendarMonthStyleProps): CalendarMonthStyles => {\n 'use no memo'
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarMonth/useCalendarMonthStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\nimport type { CalendarMonthStyleProps, CalendarMonthStyles } from './CalendarMonth.types';\n\n/**\n * Apply styling to the CalendarMonth slots based on the state\n *\n * @internal\n */\nexport const useCalendarMonthStyles_unstable = (props: CalendarMonthStyleProps): CalendarMonthStyles => {\n 'use no memo'; // justified: compiler would optimize useCalendarMonthStyles_unstable — manual opt-out to preserve runtime behavior\n\n return useCalendarPickerStyles_unstable(props);\n};\n"],"names":["useCalendarPickerStyles_unstable","useCalendarMonthStyles_unstable","props"],"mappings":"AAAA;AAEA,SAASA,gCAAgC,QAAQ,mDAAmD;AAGpG;;;;CAIC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C,eAAe,mHAAmH;IAElI,OAAOF,iCAAiCE;AAC1C,EAAE"}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { tokens } from '@fluentui/react-theme';
|
|
4
4
|
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
5
|
-
import { DURATION_2, DURATION_3, EASING_FUNCTION_1, EASING_FUNCTION_2, FADE_IN, SLIDE_DOWN_IN20, SLIDE_LEFT_IN20, SLIDE_RIGHT_IN20, SLIDE_UP_IN20 } from '../../utils/animations';
|
|
6
|
-
import { AnimationDirection } from '../Calendar/Calendar.types';
|
|
7
5
|
/**
|
|
8
6
|
* @internal
|
|
9
7
|
*/
|
|
@@ -92,12 +90,6 @@ const useCurrentItemButtonStyles = /*#__PURE__*/__styles({
|
|
|
92
90
|
B0ocmuz: ["f1td8mcv", "f1udkdxo"],
|
|
93
91
|
fsow6f: ["f1o700av", "fes3tcz"]
|
|
94
92
|
},
|
|
95
|
-
animation: {
|
|
96
|
-
vin17d: "fhsqnsn",
|
|
97
|
-
Bf5fcs: "fywypte",
|
|
98
|
-
Bv12yb3: "f1h7u52p",
|
|
99
|
-
Ezkn3b: "fjq4c94"
|
|
100
|
-
},
|
|
101
93
|
hasHeaderClickCallback: {
|
|
102
94
|
Jwef8y: "f18a0fwf",
|
|
103
95
|
Bi91k9c: "f3sdaeg",
|
|
@@ -123,8 +115,7 @@ const useCurrentItemButtonStyles = /*#__PURE__*/__styles({
|
|
|
123
115
|
p: -1
|
|
124
116
|
}], [".f1udkdxo{padding:0 10px 0 4px;}", {
|
|
125
117
|
p: -1
|
|
126
|
-
}], ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}"
|
|
127
|
-
k: ["@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}"],
|
|
118
|
+
}], ".f1o700av{text-align:left;}", ".fes3tcz{text-align:right;}"],
|
|
128
119
|
h: [".f18a0fwf:hover{background-color:var(--colorBrandBackgroundInvertedHover);}", ".f3sdaeg:hover{color:var(--colorBrandForegroundOnLightHover);}", ".f8491dx:hover{cursor:pointer;}", [".f15rpok4:hover{outline:1px solid var(--colorTransparentStroke);}", {
|
|
129
120
|
p: -1
|
|
130
121
|
}], ".f1wvkgvo:hover:active{background-color:var(--colorBrandBackgroundInvertedPressed);}", ".f1wdoaqd:hover:active{color:var(--colorBrandForegroundOnLightPressed);}", ".f13c0t7h:hover:active{cursor:pointer;}", [".fy2scak:hover:active{outline:1px solid var(--colorTransparentStroke);}", {
|
|
@@ -218,27 +209,9 @@ const useButtonRowStyles = /*#__PURE__*/__styles({
|
|
|
218
209
|
base: {
|
|
219
210
|
jrapky: "f15tpi3i",
|
|
220
211
|
sw9gdo: "f1gdbdba"
|
|
221
|
-
},
|
|
222
|
-
animation: {
|
|
223
|
-
vin17d: "f5f2jbu",
|
|
224
|
-
Bf5fcs: "fywypte",
|
|
225
|
-
Ezkn3b: "f1ee2ue"
|
|
226
|
-
},
|
|
227
|
-
horizontalBackward: {
|
|
228
|
-
Bv12yb3: ["f1o9w3l8", "f1kwjajc"]
|
|
229
|
-
},
|
|
230
|
-
horizontalForward: {
|
|
231
|
-
Bv12yb3: ["f1kwjajc", "f1o9w3l8"]
|
|
232
|
-
},
|
|
233
|
-
verticalBackward: {
|
|
234
|
-
Bv12yb3: "fgl3yn7"
|
|
235
|
-
},
|
|
236
|
-
verticalForward: {
|
|
237
|
-
Bv12yb3: "faiu5ye"
|
|
238
212
|
}
|
|
239
213
|
}, {
|
|
240
|
-
d: [".f15tpi3i{margin-bottom:16px;}", ".f1gdbdba:last-of-type{margin-bottom:0;}"
|
|
241
|
-
k: ["@keyframes f5j8bii{from{opacity:0;}to{opacity:1;}}", "@keyframes f2lgmc3{from{pointer-events:none;transform:translate3d(-20px, 0, 0);}to{pointer-events:auto;transform:translate3d(0, 0, 0);}}", "@keyframes fpktcv7{from{pointer-events:none;transform:translate3d(20px, 0, 0);}to{pointer-events:auto;transform:translate3d(0, 0, 0);}}", "@keyframes f3bv9km{from{pointer-events:none;transform:translate3d(0, -20px, 0);}to{pointer-events:auto;transform:translate3d(0, 0, 0);}}", "@keyframes funtx0y{from{pointer-events:none;transform:translate3d(0, 20px, 0);}to{pointer-events:auto;transform:translate3d(0, 0, 0);}}"]
|
|
214
|
+
d: [".f15tpi3i{margin-bottom:16px;}", ".f1gdbdba:last-of-type{margin-bottom:0;}"]
|
|
242
215
|
});
|
|
243
216
|
const useItemButtonStyles = /*#__PURE__*/__styles({
|
|
244
217
|
base: {
|
|
@@ -429,6 +402,7 @@ const useDisabledStyles = /*#__PURE__*/__styles({
|
|
|
429
402
|
export const useCalendarPickerStyles_unstable = props => {
|
|
430
403
|
'use no memo';
|
|
431
404
|
|
|
405
|
+
// justified: compiler would optimize useCalendarPickerStyles_unstable — manual opt-out to preserve runtime behavior
|
|
432
406
|
const rootStyles = useRootStyles();
|
|
433
407
|
const headerContainerStyles = useHeaderContainerStyles();
|
|
434
408
|
const currentItemButtonStyles = useCurrentItemButtonStyles();
|
|
@@ -441,8 +415,6 @@ export const useCalendarPickerStyles_unstable = props => {
|
|
|
441
415
|
const selectedStyles = useSelectedStyles();
|
|
442
416
|
const disabledStyles = useDisabledStyles();
|
|
443
417
|
const {
|
|
444
|
-
animateBackwards,
|
|
445
|
-
animationDirection,
|
|
446
418
|
className,
|
|
447
419
|
hasHeaderClickCallback,
|
|
448
420
|
highlightCurrent,
|
|
@@ -451,11 +423,11 @@ export const useCalendarPickerStyles_unstable = props => {
|
|
|
451
423
|
return {
|
|
452
424
|
root: mergeClasses(calendarPickerClassNames.root, rootStyles.normalize, rootStyles.base, className),
|
|
453
425
|
headerContainer: mergeClasses(calendarPickerClassNames.headerContainer, headerContainerStyles.base),
|
|
454
|
-
currentItemButton: mergeClasses(calendarPickerClassNames.currentItemButton, currentItemButtonStyles.base,
|
|
426
|
+
currentItemButton: mergeClasses(calendarPickerClassNames.currentItemButton, currentItemButtonStyles.base, hasHeaderClickCallback && currentItemButtonStyles.hasHeaderClickCallback),
|
|
455
427
|
navigationButtonsContainer: mergeClasses(calendarPickerClassNames.navigationButtonsContainer, navigationButtonsContainerStyles.base),
|
|
456
428
|
navigationButton: mergeClasses(calendarPickerClassNames.navigationButton, navigationButtonStyles.base),
|
|
457
429
|
gridContainer: mergeClasses(calendarPickerClassNames.gridContainer, gridContainerStyles.base),
|
|
458
|
-
buttonRow: mergeClasses(calendarPickerClassNames.buttonRow, buttonRowStyles.base
|
|
430
|
+
buttonRow: mergeClasses(calendarPickerClassNames.buttonRow, buttonRowStyles.base),
|
|
459
431
|
itemButton: mergeClasses(calendarPickerClassNames.itemButton, itemButtonStyles.base),
|
|
460
432
|
selected: mergeClasses(calendarPickerClassNames.selected, highlightSelected && selectedStyles.highlightSelected),
|
|
461
433
|
current: mergeClasses(calendarPickerClassNames.current, highlightCurrent && currentStyles.highlightCurrent),
|