@fluentui/react-calendar-compat 0.3.13 → 0.3.15

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/lib/components/Calendar/useCalendarStyles.styles.js +11 -11
  3. package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
  4. package/lib/components/CalendarDay/useCalendarDayStyles.styles.js +6 -2
  5. package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
  6. package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js +5 -1
  7. package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
  8. package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
  9. package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
  10. package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +108 -101
  11. package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
  12. package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +1 -1
  13. package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
  14. package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js +45 -45
  15. package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
  16. package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js +11 -11
  17. package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
  18. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js +10 -1
  19. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
  20. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js +5 -1
  21. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
  22. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
  23. package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
  24. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +139 -158
  25. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
  26. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +1 -1
  27. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
  28. package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js +45 -45
  29. package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
  30. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/CalendarDay/useCalendarDayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarDayStyles, CalendarDayStyleProps } from './CalendarDay.types';\n\n/**\n * @internal\n */\nexport const calendarDayClassNames: SlotClassNames<CalendarDayStyles> = {\n root: 'fui-CalendarDay',\n header: 'fui-CalendarDay__header',\n monthAndYear: 'fui-CalendarDay__monthAndYear',\n monthComponents: 'fui-CalendarDay__monthComponents',\n headerIconButton: 'fui-CalendarDay__headerIconButton',\n disabledStyle: 'fui-CalendarDay__disabledStyle',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n boxSizing: 'content-box',\n padding: '12px',\n width: '196px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n showWeekNumbers: {\n width: '226px',\n },\n});\n\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%',\n },\n});\n\nconst useMonthAndYearStyles = makeStyles({\n base: {\n alignItems: 'center',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground1,\n display: 'inline-block',\n flexGrow: 1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: '28px',\n overflow: 'hidden',\n padding: '0 4px 0 10px',\n textAlign: 'left',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n animation: {\n animationDuration: DURATION_2,\n animationFillMode: 'both',\n animationName: FADE_IN,\n animationTimingFunction: EASING_FUNCTION_2,\n },\n headerIsClickable: {\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n },\n});\n\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex',\n },\n});\n\nconst useHeaderIconButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '28px',\n lineHeight: '28px',\n overflow: 'visible',\n padding: '0',\n position: 'relative',\n textAlign: 'center',\n width: '28px',\n\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n },\n },\n});\n\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n },\n});\n\n/**\n * @internal\n *\n * Apply styling to the CalendarDay slots based on the state\n */\nexport const useCalendarDayStyles_unstable = (props: CalendarDayStyleProps): CalendarDayStyles => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const headerStyles = useHeaderStyles();\n const monthAndYearStyles = useMonthAndYearStyles();\n const monthComponentsStyles = useMonthComponentsStyles();\n const headerIconButtonStyles = useHeaderIconButtonStyles();\n const disabledStyleStyles = useDisabledStyleStyles();\n\n const { className, headerIsClickable, showWeekNumbers } = props;\n\n return {\n root: mergeClasses(\n calendarDayClassNames.root,\n rootStyles.normalize,\n rootStyles.base,\n showWeekNumbers && rootStyles.showWeekNumbers,\n className,\n ),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(\n calendarDayClassNames.monthAndYear,\n monthAndYearStyles.base,\n monthAndYearStyles.animation,\n headerIsClickable && monthAndYearStyles.headerIsClickable,\n ),\n monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),\n headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),\n disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","DURATION_2","EASING_FUNCTION_2","FADE_IN","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","boxSizing","padding","width","normalize","boxShadow","margin","showWeekNumbers","useHeaderStyles","display","height","lineHeight","position","useMonthAndYearStyles","alignItems","backgroundColor","colorTransparentBackground","borderStyle","borderRadius","borderRadiusMedium","color","colorNeutralForeground1","flexGrow","fontFamily","fontSize","fontSizeBase300","fontWeight","fontWeightSemibold","overflow","textAlign","textOverflow","whiteSpace","animation","animationDuration","animationFillMode","animationName","animationTimingFunction","headerIsClickable","colorBrandBackgroundInvertedHover","colorBrandForegroundOnLightHover","cursor","outline","colorTransparentStroke","colorBrandBackgroundInvertedPressed","colorBrandForegroundOnLightPressed","useMonthComponentsStyles","alignSelf","useHeaderIconButtonStyles","colorNeutralForeground3","fontSizeBase200","useDisabledStyleStyles","colorNeutralForegroundDisabled","pointerEvents","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"mappings":"AAAA;;;;;;;;;;;;IAWaO,qBAAAA;;;iCAgIA6D;;;;4BAzIU,wBAAwB;uBACM,iBAAiB;4BACf,yBAAyB;AAOzE,8BAAiE;IACtE5D,MAAM;IACNC,QAAQ;IACRC,cAAc;IACdC,iBAAiB;IACjBC,kBAAkB;IAClBC,eAAe;AACjB,EAAE;AAEF,MAAMC,oBAAgBb,iBAAAA,EAAW;IAC/Bc,MAAM;QACJC,WAAW;QACXC,SAAS;QACTC,OAAO;IACT;IACAC,WAAW;QACTC,WAAW;QACXJ,WAAW;QACXK,QAAQ;QACRJ,SAAS;IACX;IACAK,iBAAiB;QACfJ,OAAO;IACT;AACF;AAEA,MAAMK,sBAAkBtB,iBAAAA,EAAW;IACjCc,MAAM;QACJS,SAAS;QACTC,QAAQ;QACRC,YAAY;QACZC,UAAU;QACVT,OAAO;IACT;AACF;AAEA,MAAMU,wBAAwB3B,qBAAAA,EAAW;IACvCc,MAAM;QACJc,YAAY;QACZC,iBAAiB9B,kBAAAA,CAAO+B,0BAA0B;QAClD,GAAG5B,iBAAAA,CAAW6B,WAAW,CAAC,OAAO;QACjCC,cAAcjC,kBAAAA,CAAOkC,kBAAkB;QACvCC,OAAOnC,kBAAAA,CAAOoC,uBAAuB;QACrCZ,SAAS;QACTa,UAAU;QACVC,YAAY;QACZC,UAAUvC,kBAAAA,CAAOwC,eAAe;QAChCC,YAAYzC,kBAAAA,CAAO0C,kBAAkB;QACrChB,YAAY;QACZiB,UAAU;QACV1B,SAA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B9B,kBAAAA,CAAO0D,mCAAmC;YAC3DvB,OAAOnC,kBAAAA,CAAO2D,kCAAkC;QAClD;IACF;AACF;AAEA,MAAMM,6BAAyBhE,iBAAAA,EAAW;IACxCc,MAAM;QACJ,2BAA2B;YACzBoB,OAAOnC,kBAAAA,CAAOkE,8BAA8B;YAC5CC,eAAe;QACjB;IACF;AACF;AAOO,MAAMC,gCAAgC,CAACC;IAC5C;IAEA,MAAMC,aAAaxD;IACnB,MAAMyD,eAAehD;IACrB,MAAMiD,qBAAqB5C;IAC3B,MAAM6C,wBAAwBb;IAC9B,MAAMc,yBAAyBZ;IAC/B,MAAMa,sBAAsBV;IAE5B,MAAM,EAAEW,SAAS,EAAExB,iBAAiB,EAAE9B,eAAe,EAAE,GAAG+C;IAE1D,OAAO;QACL7D,UAAMN,mBAAAA,EACJK,sBAAsBC,IAAI,EAC1B8D,WAAWnD,SAAS,EACpBmD,WAAWvD,IAAI,EACfO,mBAAmBgD,WAAWhD,eAAe,EAC7CsD;QAEFnE,YAAQP,mBAAAA,EAAaK,sBAAsBE,MAAM,EAAE8D,aAAaxD,IAAI;QACpEL,kBAAcR,mBAAAA,EACZK,sBAAsBG,YAAY,EAClC8D,mBAAmBzD,IAAI,EACvByD,mBAAmBzB,SAAS,EAC5BK,qBAAqBoB,mBAAmBpB,iBAAiB;QAE3DzC,qBAAiBT,mBAAAA,EAAaK,sBAAsBI,eAAe,EAAE8D,sBAAsB1D,IAAI;QAC/FH,sBAAkBV,mBAAAA,EAAaK,sBAAsBK,gBAAgB,EAAE8D,uBAAuB3D,IAAI;QAClGF,mBAAeX,mBAAAA,EAAaK,sBAAsBM,aAAa,EAAE8D,oBAAoB5D,IAAI;IAC3F;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/CalendarDay/useCalendarDayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarDayStyles, CalendarDayStyleProps } from './CalendarDay.types';\n\n/**\n * @internal\n */\nexport const calendarDayClassNames: SlotClassNames<CalendarDayStyles> = {\n root: 'fui-CalendarDay',\n header: 'fui-CalendarDay__header',\n monthAndYear: 'fui-CalendarDay__monthAndYear',\n monthComponents: 'fui-CalendarDay__monthComponents',\n headerIconButton: 'fui-CalendarDay__headerIconButton',\n disabledStyle: 'fui-CalendarDay__disabledStyle',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n boxSizing: 'content-box',\n padding: '12px',\n width: '196px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n showWeekNumbers: {\n width: '226px',\n },\n});\n\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%',\n },\n});\n\nconst useMonthAndYearStyles = makeStyles({\n base: {\n alignItems: 'center',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground1,\n display: 'inline-block',\n flexGrow: 1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: '28px',\n overflow: 'hidden',\n padding: '0 4px 0 10px',\n textAlign: 'left',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n animation: {\n animationDuration: DURATION_2,\n animationFillMode: 'both',\n animationName: FADE_IN,\n animationTimingFunction: EASING_FUNCTION_2,\n },\n headerIsClickable: {\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n },\n});\n\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex',\n },\n});\n\nconst useHeaderIconButtonStyles = makeStyles({\n base: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground3,\n display: 'block',\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '28px',\n lineHeight: '28px',\n overflow: 'visible',\n padding: '0',\n position: 'relative',\n textAlign: 'center',\n width: '28px',\n\n '&:hover': {\n backgroundColor: tokens.colorBrandBackgroundInvertedHover,\n color: tokens.colorBrandForegroundOnLightHover,\n cursor: 'pointer',\n outline: `1px solid ${tokens.colorTransparentStroke}`,\n },\n '&:hover:active': {\n backgroundColor: tokens.colorBrandBackgroundInvertedPressed,\n color: tokens.colorBrandForegroundOnLightPressed,\n },\n },\n});\n\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n\n // add this explicitly for aria-disabled buttons that don't get default forced-colors disabled styles\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n },\n});\n\n/**\n * @internal\n *\n * Apply styling to the CalendarDay slots based on the state\n */\nexport const useCalendarDayStyles_unstable = (props: CalendarDayStyleProps): CalendarDayStyles => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const headerStyles = useHeaderStyles();\n const monthAndYearStyles = useMonthAndYearStyles();\n const monthComponentsStyles = useMonthComponentsStyles();\n const headerIconButtonStyles = useHeaderIconButtonStyles();\n const disabledStyleStyles = useDisabledStyleStyles();\n\n const { className, headerIsClickable, showWeekNumbers } = props;\n\n return {\n root: mergeClasses(\n calendarDayClassNames.root,\n rootStyles.normalize,\n rootStyles.base,\n showWeekNumbers && rootStyles.showWeekNumbers,\n className,\n ),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(\n calendarDayClassNames.monthAndYear,\n monthAndYearStyles.base,\n monthAndYearStyles.animation,\n headerIsClickable && monthAndYearStyles.headerIsClickable,\n ),\n monthComponents: mergeClasses(calendarDayClassNames.monthComponents, monthComponentsStyles.base),\n headerIconButton: mergeClasses(calendarDayClassNames.headerIconButton, headerIconButtonStyles.base),\n disabledStyle: mergeClasses(calendarDayClassNames.disabledStyle, disabledStyleStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","DURATION_2","EASING_FUNCTION_2","FADE_IN","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","boxSizing","padding","width","normalize","boxShadow","margin","showWeekNumbers","useHeaderStyles","display","height","lineHeight","position","useMonthAndYearStyles","alignItems","backgroundColor","colorTransparentBackground","borderStyle","borderRadius","borderRadiusMedium","color","colorNeutralForeground1","flexGrow","fontFamily","fontSize","fontSizeBase300","fontWeight","fontWeightSemibold","overflow","textAlign","textOverflow","whiteSpace","animation","animationDuration","animationFillMode","animationName","animationTimingFunction","headerIsClickable","colorBrandBackgroundInvertedHover","colorBrandForegroundOnLightHover","cursor","outline","colorTransparentStroke","colorBrandBackgroundInvertedPressed","colorBrandForegroundOnLightPressed","useMonthComponentsStyles","alignSelf","useHeaderIconButtonStyles","colorNeutralForeground3","fontSizeBase200","useDisabledStyleStyles","colorNeutralForegroundDisabled","pointerEvents","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"mappings":"AAAA;;;;;;;;;;;;IAWaO,qBAAAA;;;IAqIA6D,6BAAAA;;;;4BA9IU,wBAAwB;uBACM,iBAAiB;4BACf,yBAAyB;AAOzE,8BAAiE;IACtE5D,MAAM;IACNC,QAAQ;IACRC,cAAc;IACdC,iBAAiB;IACjBC,kBAAk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AE9B,eAAe,EAAE,GAAG+C;IAE1D,OAAO;QACL7D,UAAMN,mBAAAA,EACJK,sBAAsBC,IAAI,EAC1B8D,WAAWnD,SAAS,EACpBmD,WAAWvD,IAAI,EACfO,mBAAmBgD,WAAWhD,eAAe,EAC7CsD;QAEFnE,YAAQP,mBAAAA,EAAaK,sBAAsBE,MAAM,EAAE8D,aAAaxD,IAAI;QACpEL,kBAAcR,mBAAAA,EACZK,sBAAsBG,YAAY,EAClC8D,mBAAmBzD,IAAI,EACvByD,mBAAmBzB,SAAS,EAC5BK,qBAAqBoB,mBAAmBpB,iBAAiB;QAE3DzC,qBAAiBT,mBAAAA,EAAaK,sBAAsBI,eAAe,EAAE8D,sBAAsB1D,IAAI;QAC/FH,sBAAkBV,mBAAAA,EAAaK,sBAAsBK,gBAAgB,EAAE8D,uBAAuB3D,IAAI;QAClGF,mBAAeX,mBAAAA,EAAaK,sBAAsBM,aAAa,EAAE8D,oBAAoB5D,IAAI;IAC3F;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/CalendarDayGrid/CalendarDayGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useId } from '@fluentui/react-utilities';\nimport { getBoundedDateRange, getDateRangeArray, isRestrictedDate, DateRangeType, DayOfWeek } from '../../utils';\nimport { useCalendarDayGridStyles_unstable } from './useCalendarDayGridStyles.styles';\nimport { CalendarMonthHeaderRow } from './CalendarMonthHeaderRow';\nimport { CalendarGridRow } from './CalendarGridRow';\nimport { useWeeks } from './useWeeks';\nimport { useWeekCornerStyles, WeekCorners } from './useWeekCornerStyles.styles';\nimport { mergeClasses } from '@griffel/react';\nimport type { Day } from '../../utils';\nimport type { CalendarDayGridProps } from './CalendarDayGrid.types';\n\nexport interface DayInfo extends Day {\n onSelected: () => void;\n setRef(element: HTMLElement | null): void;\n}\n\nfunction useDayRefs() {\n const daysRef = React.useRef<Record<string, HTMLElement>>({});\n\n const getSetRefCallback = (dayKey: string) => (element: HTMLElement | null) => {\n if (element === null) {\n delete daysRef.current[dayKey];\n } else {\n daysRef.current[dayKey] = element;\n }\n };\n\n return [daysRef, getSetRefCallback] as const;\n}\n\nfunction useAnimateBackwards(weeks: DayInfo[][]): boolean | undefined {\n const previousNavigatedDateRef = React.useRef<Date | undefined>(undefined);\n React.useEffect(() => {\n previousNavigatedDateRef.current = weeks[0][0].originalDate;\n });\n const previousNavigatedDate = previousNavigatedDateRef.current;\n\n if (!previousNavigatedDate || previousNavigatedDate.getTime() === weeks[0][0].originalDate.getTime()) {\n return undefined;\n } else if (previousNavigatedDate <= weeks[0][0].originalDate) {\n return false;\n } else {\n return true;\n }\n}\n\nexport const CalendarDayGrid: React.FunctionComponent<CalendarDayGridProps> = props => {\n const navigatedDayRef = React.useRef<HTMLTableCellElement>(\n null,\n ) as React.MutableRefObject<HTMLTableCellElement | null>;\n\n const activeDescendantId = useId();\n\n const onSelectDate = (selectedDate: Date): void => {\n const { firstDayOfWeek, minDate, maxDate, workWeekDays, daysToSelectInDayView, restrictedDates } = props;\n const restrictedDatesOptions = { minDate, maxDate, restrictedDates };\n\n let dateRange = getDateRangeArray(selectedDate, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView);\n dateRange = getBoundedDateRange(dateRange, minDate, maxDate);\n\n dateRange = dateRange.filter((d: Date) => {\n return !isRestrictedDate(d, restrictedDatesOptions);\n });\n\n props.onSelectDate?.(selectedDate, dateRange);\n props.onNavigateDate?.(selectedDate, true);\n };\n\n const [daysRef, getSetRefCallback] = useDayRefs();\n\n const weeks = useWeeks(props, onSelectDate, getSetRefCallback);\n const animateBackwards = useAnimateBackwards(weeks);\n const [getWeekCornerStyles, calculateRoundedStyles] = useWeekCornerStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n navigatedDayRef.current?.focus?.();\n },\n }),\n [],\n );\n\n /**\n *\n * Section for setting hover/pressed styles. Because we want arbitrary blobs of days to be selectable, to support\n * highlighting every day in the month for month view, css :hover style isn't enough, so we need mouse callbacks\n * to set classnames on all relevant child refs to apply the styling\n *\n */\n const getDayInfosInRangeOfDay = (dayToCompare: DayInfo): DayInfo[] => {\n // The hover state looks weird with non-contiguous days in work week view. In work week, show week hover state\n const dateRangeHoverType = getDateRangeTypeToUse(props.dateRangeType, props.workWeekDays);\n\n // gets all the dates for the given date range type that are in the same date range as the given day\n const dateRange = getDateRangeArray(\n dayToCompare.originalDate,\n dateRangeHoverType,\n props.firstDayOfWeek,\n props.workWeekDays,\n props.daysToSelectInDayView,\n ).map((date: Date) => date.getTime());\n\n // gets all the day refs for the given dates\n const dayInfosInRange = weeks.reduce((accumulatedValue: DayInfo[], currentWeek: DayInfo[]) => {\n return accumulatedValue.concat(\n currentWeek.filter((weekDay: DayInfo) => dateRange.indexOf(weekDay.originalDate.getTime()) !== -1),\n );\n }, []);\n\n return dayInfosInRange;\n };\n\n const getRefsFromDayInfos = (dayInfosInRange: DayInfo[]): (HTMLElement | null)[] => {\n let dayRefs: (HTMLElement | null)[] = [];\n dayRefs = dayInfosInRange.map((dayInfo: DayInfo) => daysRef.current[dayInfo.key]);\n\n return dayRefs;\n };\n\n const {\n gridLabel,\n dateRangeType,\n showWeekNumbers,\n labelledBy,\n lightenDaysOutsideNavigatedMonth,\n animationDirection,\n } = props;\n\n const classNames = useCalendarDayGridStyles_unstable({\n animateBackwards,\n animationDirection,\n dateRangeType,\n lightenDaysOutsideNavigatedMonth:\n lightenDaysOutsideNavigatedMonth === undefined ? true : lightenDaysOutsideNavigatedMonth,\n showWeekNumbers,\n });\n\n // When the month is highlighted get the corner dates so that styles can be added to them\n const weekCorners: WeekCorners = getWeekCornerStyles(weeks!);\n const partialWeekProps = {\n weeks,\n navigatedDayRef,\n calculateRoundedStyles,\n activeDescendantId,\n classNames,\n weekCorners,\n getDayInfosInRangeOfDay,\n getRefsFromDayInfos,\n } as const;\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid' });\n\n return (\n <table\n className={mergeClasses(classNames.table, props.className)}\n aria-multiselectable=\"false\"\n aria-label={gridLabel}\n aria-labelledby={labelledBy}\n aria-activedescendant={activeDescendantId}\n role=\"grid\"\n {...arrowNavigationAttributes}\n >\n <tbody>\n <CalendarMonthHeaderRow {...props} classNames={classNames} weeks={weeks} />\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={weeks[0]}\n weekIndex={-1}\n rowClassName={classNames.firstTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n {weeks!.slice(1, weeks!.length - 1).map((week: DayInfo[], weekIndex: number) => (\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n key={weekIndex}\n week={week}\n weekIndex={weekIndex}\n rowClassName={classNames.weekRow}\n />\n ))}\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={weeks![weeks!.length - 1]}\n weekIndex={-2}\n rowClassName={classNames.lastTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n </tbody>\n </table>\n );\n};\nCalendarDayGrid.displayName = 'CalendarDayGrid';\n\n/**\n * When given work week, if the days are non-contiguous, the hover states look really weird. So for non-contiguous\n * work weeks, we'll just show week view instead.\n */\nfunction getDateRangeTypeToUse(dateRangeType: DateRangeType, workWeekDays: DayOfWeek[] | undefined): DateRangeType {\n if (workWeekDays && dateRangeType === DateRangeType.WorkWeek) {\n const sortedWWDays = workWeekDays.slice().sort();\n let isContiguous = true;\n for (let i = 1; i < sortedWWDays.length; i++) {\n if (sortedWWDays[i] !== sortedWWDays[i - 1] + 1) {\n isContiguous = false;\n break;\n }\n }\n\n if (!isContiguous || workWeekDays.length === 0) {\n return DateRangeType.Week;\n }\n }\n\n return dateRangeType;\n}\n"],"names":["React","useArrowNavigationGroup","useId","getBoundedDateRange","getDateRangeArray","isRestrictedDate","DateRangeType","useCalendarDayGridStyles_unstable","CalendarMonthHeaderRow","CalendarGridRow","useWeeks","useWeekCornerStyles","mergeClasses","useDayRefs","daysRef","useRef","getSetRefCallback","dayKey","element","current","useAnimateBackwards","weeks","previousNavigatedDateRef","undefined","useEffect","originalDate","previousNavigatedDate","getTime","CalendarDayGrid","props","navigatedDayRef","activeDescendantId","onSelectDate","selectedDate","firstDayOfWeek","minDate","maxDate","workWeekDays","daysToSelectInDayView","restrictedDates","restrictedDatesOptions","dateRange","dateRangeType","filter","d","onNavigateDate","animateBackwards","getWeekCornerStyles","calculateRoundedStyles","useImperativeHandle","componentRef","focus","getDayInfosInRangeOfDay","dayToCompare","dateRangeHoverType","getDateRangeTypeToUse","map","date","dayInfosInRange","reduce","accumulatedValue","currentWeek","concat","weekDay","indexOf","getRefsFromDayInfos","dayRefs","dayInfo","key","gridLabel","showWeekNumbers","labelledBy","lightenDaysOutsideNavigatedMonth","animationDirection","classNames","weekCorners","partialWeekProps","arrowNavigationAttributes","axis","table","className","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","role","tbody","week","weekIndex","rowClassName","firstTransitionWeek","aria-role","ariaHidden","slice","length","weekRow","lastTransitionWeek","displayName","WorkWeek","sortedWWDays","sort","isContiguous","i","Week"],"mappings":"AAAA;;;;;+BAkDa4B;;;;;;;iEAhDU,QAAQ;8BACS,0BAA0B;gCAC5C,4BAA4B;uBACiD,cAAc;gDAC/D,oCAAoC;wCAC/C,2BAA2B;iCAClC,oBAAoB;0BAC3B,aAAa;2CACW,+BAA+B;wBACnD,iBAAiB;AAS9C,SAASf;IACP,MAAMC,UAAUd,OAAMe,MAAM,CAA8B,CAAC;IAE3D,MAAMC,oBAAoB,CAACC,SAAmB,CAACC;YAC7C,IAAIA,YAAY,MAAM;gBACpB,OAAOJ,QAAQK,OAAO,CAACF,OAAO;YAChC,OAAO;gBACLH,QAAQK,OAAO,CAACF,OAAO,GAAGC;YAC5B;QACF;IAEA,OAAO;QAACJ;QAASE;KAAkB;AACrC;AAEA,SAASI,oBAAoBC,KAAkB;IAC7C,MAAMC,2BAA2BtB,OAAMe,MAAM,CAAmBQ;IA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QACE,GAAGoB,KAAK;QACR,GAAG+C,gBAAgB;QACpBW,MAAMlE,KAAM,CAACA,MAAOyE,MAAM,GAAG,EAAE;QAC/BN,WAAW,CAAC;QACZC,cAAcf,WAAWsB,kBAAkB;QAC3CL,aAAU;QACVC,YAAY;;AAKtB,EAAE;AACFhE,gBAAgBqE,WAAW,GAAG;AAE9B;;;CAGC,GACD,SAAS1C,sBAAsBb,aAA4B,EAAEL,YAAqC;IAChG,IAAIA,gBAAgBK,kBAAkBpC,oBAAAA,CAAc4F,QAAQ,EAAE;QAC5D,MAAMC,eAAe9D,aAAawD,KAAK,GAAGO,IAAI;QAC9C,IAAIC,eAAe;QACnB,IAAK,IAAIC,IAAI,GAAGA,IAAIH,aAAaL,MAAM,EAAEQ,IAAK;YAC5C,IAAIH,YAAY,CAACG,EAAE,KAAKH,YAAY,CAACG,IAAI,EAAE,GAAG,GAAG;gBAC/CD,eAAe;gBACf;YACF;QACF;QAEA,IAAI,CAACA,gBAAgBhE,aAAayD,MAAM,KAAK,GAAG;YAC9C,OAAOxF,oBAAAA,CAAciG,IAAI;QAC3B;IACF;IAEA,OAAO7D;AACT"}
1
+ {"version":3,"sources":["../src/components/CalendarDayGrid/CalendarDayGrid.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { useId } from '@fluentui/react-utilities';\nimport { getBoundedDateRange, getDateRangeArray, isRestrictedDate, DateRangeType, DayOfWeek } from '../../utils';\nimport { useCalendarDayGridStyles_unstable } from './useCalendarDayGridStyles.styles';\nimport { CalendarMonthHeaderRow } from './CalendarMonthHeaderRow';\nimport { CalendarGridRow } from './CalendarGridRow';\nimport { useWeeks } from './useWeeks';\nimport { useWeekCornerStyles, WeekCorners } from './useWeekCornerStyles.styles';\nimport { mergeClasses } from '@griffel/react';\nimport type { Day } from '../../utils';\nimport type { CalendarDayGridProps } from './CalendarDayGrid.types';\n\nexport interface DayInfo extends Day {\n onSelected: () => void;\n setRef(element: HTMLElement | null): void;\n}\n\nfunction useDayRefs() {\n const daysRef = React.useRef<Record<string, HTMLElement>>({});\n\n const getSetRefCallback = (dayKey: string) => (element: HTMLElement | null) => {\n if (element === null) {\n delete daysRef.current[dayKey];\n } else {\n daysRef.current[dayKey] = element;\n }\n };\n\n return [daysRef, getSetRefCallback] as const;\n}\n\nfunction useAnimateBackwards(weeks: DayInfo[][]): boolean | undefined {\n const previousNavigatedDateRef = React.useRef<Date | undefined>(undefined);\n React.useEffect(() => {\n previousNavigatedDateRef.current = weeks[0][0].originalDate;\n });\n const previousNavigatedDate = previousNavigatedDateRef.current;\n\n if (!previousNavigatedDate || previousNavigatedDate.getTime() === weeks[0][0].originalDate.getTime()) {\n return undefined;\n } else if (previousNavigatedDate <= weeks[0][0].originalDate) {\n return false;\n } else {\n return true;\n }\n}\n\nexport const CalendarDayGrid: React.FunctionComponent<CalendarDayGridProps> = props => {\n const navigatedDayRef = React.useRef<HTMLTableCellElement>(\n null,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ) as React.MutableRefObject<HTMLTableCellElement | null>;\n\n const activeDescendantId = useId();\n\n const onSelectDate = (selectedDate: Date): void => {\n const { firstDayOfWeek, minDate, maxDate, workWeekDays, daysToSelectInDayView, restrictedDates } = props;\n const restrictedDatesOptions = { minDate, maxDate, restrictedDates };\n\n let dateRange = getDateRangeArray(selectedDate, dateRangeType, firstDayOfWeek, workWeekDays, daysToSelectInDayView);\n dateRange = getBoundedDateRange(dateRange, minDate, maxDate);\n\n dateRange = dateRange.filter((d: Date) => {\n return !isRestrictedDate(d, restrictedDatesOptions);\n });\n\n props.onSelectDate?.(selectedDate, dateRange);\n props.onNavigateDate?.(selectedDate, true);\n };\n\n const [daysRef, getSetRefCallback] = useDayRefs();\n\n const weeks = useWeeks(props, onSelectDate, getSetRefCallback);\n const animateBackwards = useAnimateBackwards(weeks);\n const [getWeekCornerStyles, calculateRoundedStyles] = useWeekCornerStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n focus() {\n navigatedDayRef.current?.focus?.();\n },\n }),\n [],\n );\n\n /**\n *\n * Section for setting hover/pressed styles. Because we want arbitrary blobs of days to be selectable, to support\n * highlighting every day in the month for month view, css :hover style isn't enough, so we need mouse callbacks\n * to set classnames on all relevant child refs to apply the styling\n *\n */\n const getDayInfosInRangeOfDay = (dayToCompare: DayInfo): DayInfo[] => {\n // The hover state looks weird with non-contiguous days in work week view. In work week, show week hover state\n const dateRangeHoverType = getDateRangeTypeToUse(props.dateRangeType, props.workWeekDays);\n\n // gets all the dates for the given date range type that are in the same date range as the given day\n const dateRange = getDateRangeArray(\n dayToCompare.originalDate,\n dateRangeHoverType,\n props.firstDayOfWeek,\n props.workWeekDays,\n props.daysToSelectInDayView,\n ).map((date: Date) => date.getTime());\n\n // gets all the day refs for the given dates\n const dayInfosInRange = weeks.reduce((accumulatedValue: DayInfo[], currentWeek: DayInfo[]) => {\n return accumulatedValue.concat(\n currentWeek.filter((weekDay: DayInfo) => dateRange.indexOf(weekDay.originalDate.getTime()) !== -1),\n );\n }, []);\n\n return dayInfosInRange;\n };\n\n const getRefsFromDayInfos = (dayInfosInRange: DayInfo[]): (HTMLElement | null)[] => {\n let dayRefs: (HTMLElement | null)[] = [];\n dayRefs = dayInfosInRange.map((dayInfo: DayInfo) => daysRef.current[dayInfo.key]);\n\n return dayRefs;\n };\n\n const {\n gridLabel,\n dateRangeType,\n showWeekNumbers,\n labelledBy,\n lightenDaysOutsideNavigatedMonth,\n animationDirection,\n } = props;\n\n const classNames = useCalendarDayGridStyles_unstable({\n animateBackwards,\n animationDirection,\n dateRangeType,\n lightenDaysOutsideNavigatedMonth:\n lightenDaysOutsideNavigatedMonth === undefined ? true : lightenDaysOutsideNavigatedMonth,\n showWeekNumbers,\n });\n\n // When the month is highlighted get the corner dates so that styles can be added to them\n const weekCorners: WeekCorners = getWeekCornerStyles(weeks!);\n const partialWeekProps = {\n weeks,\n navigatedDayRef,\n calculateRoundedStyles,\n activeDescendantId,\n classNames,\n weekCorners,\n getDayInfosInRangeOfDay,\n getRefsFromDayInfos,\n } as const;\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid' });\n\n return (\n <table\n className={mergeClasses(classNames.table, props.className)}\n aria-multiselectable=\"false\"\n aria-label={gridLabel}\n aria-labelledby={labelledBy}\n aria-activedescendant={activeDescendantId}\n role=\"grid\"\n {...arrowNavigationAttributes}\n >\n <tbody>\n <CalendarMonthHeaderRow {...props} classNames={classNames} weeks={weeks} />\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={weeks[0]}\n weekIndex={-1}\n rowClassName={classNames.firstTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n {weeks!.slice(1, weeks!.length - 1).map((week: DayInfo[], weekIndex: number) => (\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n key={weekIndex}\n week={week}\n weekIndex={weekIndex}\n rowClassName={classNames.weekRow}\n />\n ))}\n <CalendarGridRow\n {...props}\n {...partialWeekProps}\n week={weeks![weeks!.length - 1]}\n weekIndex={-2}\n rowClassName={classNames.lastTransitionWeek}\n aria-role=\"presentation\"\n ariaHidden={true}\n />\n </tbody>\n </table>\n );\n};\nCalendarDayGrid.displayName = 'CalendarDayGrid';\n\n/**\n * When given work week, if the days are non-contiguous, the hover states look really weird. So for non-contiguous\n * work weeks, we'll just show week view instead.\n */\nfunction getDateRangeTypeToUse(dateRangeType: DateRangeType, workWeekDays: DayOfWeek[] | undefined): DateRangeType {\n if (workWeekDays && dateRangeType === DateRangeType.WorkWeek) {\n const sortedWWDays = workWeekDays.slice().sort();\n let isContiguous = true;\n for (let i = 1; i < sortedWWDays.length; i++) {\n if (sortedWWDays[i] !== sortedWWDays[i - 1] + 1) {\n isContiguous = false;\n break;\n }\n }\n\n if (!isContiguous || workWeekDays.length === 0) {\n return DateRangeType.Week;\n }\n }\n\n return dateRangeType;\n}\n"],"names":["React","useArrowNavigationGroup","useId","getBoundedDateRange","getDateRangeArray","isRestrictedDate","DateRangeType","useCalendarDayGridStyles_unstable","CalendarMonthHeaderRow","CalendarGridRow","useWeeks","useWeekCornerStyles","mergeClasses","useDayRefs","daysRef","useRef","getSetRefCallback","dayKey","element","current","useAnimateBackwards","weeks","previousNavigatedDateRef","undefined","useEffect","originalDate","previousNavigatedDate","getTime","CalendarDayGrid","props","navigatedDayRef","activeDescendantId","onSelectDate","selectedDate","firstDayOfWeek","minDate","maxDate","workWeekDays","daysToSelectInDayView","restrictedDates","restrictedDatesOptions","dateRange","dateRangeType","filter","d","onNavigateDate","animateBackwards","getWeekCornerStyles","calculateRoundedStyles","useImperativeHandle","componentRef","focus","getDayInfosInRangeOfDay","dayToCompare","dateRangeHoverType","getDateRangeTypeToUse","map","date","dayInfosInRange","reduce","accumulatedValue","currentWeek","concat","weekDay","indexOf","getRefsFromDayInfos","dayRefs","dayInfo","key","gridLabel","showWeekNumbers","labelledBy","lightenDaysOutsideNavigatedMonth","animationDirection","classNames","weekCorners","partialWeekProps","arrowNavigationAttributes","axis","table","className","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","role","tbody","week","weekIndex","rowClassName","firstTransitionWeek","aria-role","ariaHidden","slice","length","weekRow","lastTransitionWeek","displayName","WorkWeek","sortedWWDays","sort","isContiguous","i","Week"],"mappings":"AAAA;;;;;+BAkDa4B;;;;;;;iEAhDU,QAAQ;8BACS,0BAA0B;gCAC5C,4BAA4B;uBACiD,cAAc;gDAC/D,oCAAoC;wCAC/C,2BAA2B;iCAClC,oBAAoB;0BAC3B,aAAa;2CACW,+BAA+B;wBACnD,iBAAiB;AAS9C,SAASf;IACP,MAAMC,UAAUd,OAAMe,MAAM,CAA8B,CAAC;IAE3D,MAAMC,oBAAoB,CAACC,SAAmB,CAACC;YAC7C,IAAIA,YAAY,MAAM;gBACpB,OAAOJ,QAAQK,OAAO,CAACF,OAAO;YAChC,OAAO;gBACLH,QAAQK,OAAO,CAACF,OAAO,GAAGC;YAC5B;QACF;IAEA,OA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BR,KAAKoB;YACLD,MAAMA;YACNC,WAAWA;YACXC,cAAcf,WAAWqB,OAAO;2BAGpC,OAAA,aAAA,CAACtF,gCAAAA,EAAAA;QACE,GAAGoB,KAAK;QACR,GAAG+C,gBAAgB;QACpBW,MAAMlE,KAAM,CAACA,MAAOyE,MAAM,GAAG,EAAE;QAC/BN,WAAW,CAAC;QACZC,cAAcf,WAAWsB,kBAAkB;QAC3CL,aAAU;QACVC,YAAY;;AAKtB,EAAE;AACFhE,gBAAgBqE,WAAW,GAAG;AAE9B;;;CAGC,GACD,SAAS1C,sBAAsBb,aAA4B,EAAEL,YAAqC;IAChG,IAAIA,gBAAgBK,kBAAkBpC,oBAAAA,CAAc4F,QAAQ,EAAE;QAC5D,MAAMC,eAAe9D,aAAawD,KAAK,GAAGO,IAAI;QAC9C,IAAIC,eAAe;QACnB,IAAK,IAAIC,IAAI,GAAGA,IAAIH,aAAaL,MAAM,EAAEQ,IAAK;YAC5C,IAAIH,YAAY,CAACG,EAAE,KAAKH,YAAY,CAACG,IAAI,EAAE,GAAG,GAAG;gBAC/CD,eAAe;gBACf;YACF;QACF;QAEA,IAAI,CAACA,gBAAgBhE,aAAayD,MAAM,KAAK,GAAG;YAC9C,OAAOxF,oBAAAA,CAAciG,IAAI;QAC3B;IACF;IAEA,OAAO7D;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/CalendarDayGrid/CalendarGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getWeekNumbersInMonth } from '../../utils';\nimport { CalendarGridDayCell } from './CalendarGridDayCell';\nimport type { CalendarDayGridProps, CalendarDayGridStyles } from './CalendarDayGrid.types';\nimport type { DayInfo } from './CalendarDayGrid';\nimport type { WeekCorners } from './useWeekCornerStyles.styles';\n\n/**\n * @internal\n */\nexport interface CalendarGridRowProps extends CalendarDayGridProps {\n classNames: CalendarDayGridStyles;\n weeks: DayInfo[][];\n week: DayInfo[];\n weekIndex: number;\n weekCorners?: WeekCorners;\n ariaHidden?: boolean;\n rowClassName?: string;\n ariaRole?: string;\n navigatedDayRef: React.MutableRefObject<HTMLTableCellElement | null>;\n activeDescendantId: string;\n calculateRoundedStyles(above: boolean, below: boolean, left: boolean, right: boolean): string;\n getDayInfosInRangeOfDay(dayToCompare: DayInfo): DayInfo[];\n getRefsFromDayInfos(dayInfosInRange: DayInfo[]): (HTMLElement | null)[];\n}\n\n/**\n * @internal\n */\nexport const CalendarGridRow: React.FunctionComponent<CalendarGridRowProps> = props => {\n const {\n ariaHidden,\n classNames,\n week,\n weeks,\n weekIndex,\n rowClassName,\n ariaRole,\n showWeekNumbers,\n firstDayOfWeek,\n firstWeekOfYear,\n navigatedDate,\n strings,\n } = props;\n const weekNumbers = showWeekNumbers\n ? getWeekNumbersInMonth(weeks!.length, firstDayOfWeek, firstWeekOfYear, navigatedDate)\n : null;\n\n const titleString = weekNumbers\n ? strings.weekNumberFormatString && strings.weekNumberFormatString.replace('{0}', `${weekNumbers[weekIndex]}`)\n : '';\n\n return (\n <tr role={ariaRole} aria-hidden={ariaHidden} className={rowClassName} key={weekIndex + '_' + week[0].key}>\n {showWeekNumbers && weekNumbers && (\n <th\n className={classNames.weekNumberCell}\n key={weekIndex}\n title={titleString}\n aria-label={titleString}\n scope=\"row\"\n >\n <span>{weekNumbers[weekIndex]}</span>\n </th>\n )}\n {week.map((day: DayInfo, dayIndex: number) => (\n <CalendarGridDayCell {...props} key={day.key} day={day} dayIndex={dayIndex} />\n ))}\n </tr>\n );\n};\n"],"names":["React","getWeekNumbersInMonth","CalendarGridDayCell","CalendarGridRow","props","ariaHidden","classNames","week","weeks","weekIndex","rowClassName","ariaRole","showWeekNumbers","firstDayOfWeek","firstWeekOfYear","navigatedDate","strings","weekNumbers","length","titleString","weekNumberFormatString","replace","tr","role","aria-hidden","className","key","th","weekNumberCell","title","aria-label","scope","span","map","day","dayIndex"],"mappings":";;;;+BA6BaG;;;;;;;iEA7BU,QAAQ;uBACO,cAAc;qCAChB,wBAAwB;AA2BrD,wBAAuEC,CAAAA;IAC5E,MAAM,EACJC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,eAAe,EACfC,cAAc,EACdC,eAAe,EACfC,aAAa,EACbC,OAAO,EACR,GAAGZ;IACJ,MAAMa,cAAcL,sBAChBX,4BAAAA,EAAsBO,MAAOU,MAAM,EAAEL,gBAAgBC,iBAAiBC,iBACtE;IAEJ,MAAMI,cAAcF,cAChBD,QAAQI,sBAAsB,IAAIJ,QAAQI,sBAAsB,CAACC,OAAO,CAAC,OAAO,GAAGJ,WAAW,CAACR,UAAU,EAAE,IAC3G;IAEJ,OAAA,WAAA,GACE,OAAA,aAAA,CAACa,MAAAA;QAAGC,MAAMZ;QAAUa,eAAanB;QAAYoB,WAAWf;QAAcgB,KAAKjB,YAAY,MAAMF,IAAI,CAAC,EAAE,CAACmB,GAAG;OACrGd,mBAAmBK,eAAAA,WAAAA,GAClB,OAAA,aAAA,CAACU,MAAAA;QACCF,WAAWnB,WAAWsB,cAAc;QACpCF,KAAKjB;QACLoB,OAAOV;QACPW,cAAYX;QACZY,OAAM;qBAEN,OAAA,aAAA,CAACC,QAAAA,MAAMf,WAAW,CAACR,UAAU,IAGhCF,KAAK0B,GAAG,CAAC,CAACC,KAAcC,WAAAA,WAAAA,GACvB,OAAA,aAAA,CAACjC,wCAAAA,EAAAA;YAAqB,GAAGE,KAAK;YAAEsB,KAAKQ,IAAIR,GAAG;YAAEQ,KAAKA;YAAKC,UAAUA;;AAI1E,EAAE"}
1
+ {"version":3,"sources":["../src/components/CalendarDayGrid/CalendarGridRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getWeekNumbersInMonth } from '../../utils';\nimport { CalendarGridDayCell } from './CalendarGridDayCell';\nimport type { CalendarDayGridProps, CalendarDayGridStyles } from './CalendarDayGrid.types';\nimport type { DayInfo } from './CalendarDayGrid';\nimport type { WeekCorners } from './useWeekCornerStyles.styles';\n\n/**\n * @internal\n */\nexport interface CalendarGridRowProps extends CalendarDayGridProps {\n classNames: CalendarDayGridStyles;\n weeks: DayInfo[][];\n week: DayInfo[];\n weekIndex: number;\n weekCorners?: WeekCorners;\n ariaHidden?: boolean;\n rowClassName?: string;\n ariaRole?: string;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n navigatedDayRef: React.MutableRefObject<HTMLTableCellElement | null>;\n activeDescendantId: string;\n calculateRoundedStyles(above: boolean, below: boolean, left: boolean, right: boolean): string;\n getDayInfosInRangeOfDay(dayToCompare: DayInfo): DayInfo[];\n getRefsFromDayInfos(dayInfosInRange: DayInfo[]): (HTMLElement | null)[];\n}\n\n/**\n * @internal\n */\nexport const CalendarGridRow: React.FunctionComponent<CalendarGridRowProps> = props => {\n const {\n ariaHidden,\n classNames,\n week,\n weeks,\n weekIndex,\n rowClassName,\n ariaRole,\n showWeekNumbers,\n firstDayOfWeek,\n firstWeekOfYear,\n navigatedDate,\n strings,\n } = props;\n const weekNumbers = showWeekNumbers\n ? getWeekNumbersInMonth(weeks!.length, firstDayOfWeek, firstWeekOfYear, navigatedDate)\n : null;\n\n const titleString = weekNumbers\n ? strings.weekNumberFormatString && strings.weekNumberFormatString.replace('{0}', `${weekNumbers[weekIndex]}`)\n : '';\n\n return (\n <tr role={ariaRole} aria-hidden={ariaHidden} className={rowClassName} key={weekIndex + '_' + week[0].key}>\n {showWeekNumbers && weekNumbers && (\n <th\n className={classNames.weekNumberCell}\n key={weekIndex}\n title={titleString}\n aria-label={titleString}\n scope=\"row\"\n >\n <span>{weekNumbers[weekIndex]}</span>\n </th>\n )}\n {week.map((day: DayInfo, dayIndex: number) => (\n <CalendarGridDayCell {...props} key={day.key} day={day} dayIndex={dayIndex} />\n ))}\n </tr>\n );\n};\n"],"names":["React","getWeekNumbersInMonth","CalendarGridDayCell","CalendarGridRow","props","ariaHidden","classNames","week","weeks","weekIndex","rowClassName","ariaRole","showWeekNumbers","firstDayOfWeek","firstWeekOfYear","navigatedDate","strings","weekNumbers","length","titleString","weekNumberFormatString","replace","tr","role","aria-hidden","className","key","th","weekNumberCell","title","aria-label","scope","span","map","day","dayIndex"],"mappings":";;;;+BA8BaG;;;;;;;iEA9BU,QAAQ;uBACO,cAAc;qCAChB,wBAAwB;AA4BrD,wBAAuEC,CAAAA;IAC5E,MAAM,EACJC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,YAAY,EACZC,QAAQ,EACRC,eAAe,EACfC,cAAc,EACdC,eAAe,EACfC,aAAa,EACbC,OAAO,EACR,GAAGZ;IACJ,MAAMa,cAAcL,sBAChBX,4BAAAA,EAAsBO,MAAOU,MAAM,EAAEL,gBAAgBC,iBAAiBC,iBACtE;IAEJ,MAAMI,cAAcF,cAChBD,QAAQI,sBAAsB,IAAIJ,QAAQI,sBAAsB,CAACC,OAAO,CAAC,OAAO,GAAGJ,WAAW,CAACR,UAAU,EAAE,IAC3G;IAEJ,OAAA,WAAA,GACE,OAAA,aAAA,CAACa,MAAAA;QAAGC,MAAMZ;QAAUa,eAAanB;QAAYoB,WAAWf;QAAcgB,KAAKjB,YAAY,MAAMF,IAAI,CAAC,EAAE,CAACmB,GAAG;OACrGd,mBAAmBK,eAAAA,WAAAA,GAClB,OAAA,aAAA,CAACU,MAAAA;QACCF,WAAWnB,WAAWsB,cAAc;QACpCF,KAAKjB;QACLoB,OAAOV;QACPW,cAAYX;QACZY,OAAM;qBAEN,OAAA,aAAA,CAACC,QAAAA,MAAMf,WAAW,CAACR,UAAU,IAGhCF,KAAK0B,GAAG,CAAC,CAACC,KAAcC,WAAAA,WAAAA,GACvB,OAAA,aAAA,CAACjC,wCAAAA,EAAAA;YAAqB,GAAGE,KAAK;YAAEsB,KAAKQ,IAAIR,GAAG;YAAEQ,KAAKA;YAAKC,UAAUA;;AAI1E,EAAE"}