@fluentui/react-calendar-compat 0.3.20 → 0.4.0
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 +20 -2
- package/dist/index.d.ts +17 -12
- package/lib/components/Calendar/useCalendarStyles.styles.js +2 -2
- package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.raw.js +2 -2
- package/lib/components/Calendar/useCalendarStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js +2 -2
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js +2 -2
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +2 -2
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js +2 -2
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js +2 -2
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js +2 -2
- package/lib/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js +2 -2
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js +2 -2
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.js +7 -3
- package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js +2 -2
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.raw.js +2 -2
- package/lib/components/CalendarYear/useCalendarYearStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.js +7 -3
- package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.raw.js.map +1 -1
- package/package.json +1 -1
|
@@ -232,7 +232,7 @@ function useAnimateBackwards({ selectedYear, navigatedYear }) {
|
|
|
232
232
|
return false;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function useYearRangeState({ selectedYear, navigatedYear }) {
|
|
235
|
+
function useYearRangeState({ selectedYear, navigatedYear, onNavigateDate }) {
|
|
236
236
|
const rangeYear = React.useMemo(()=>{
|
|
237
237
|
return selectedYear || navigatedYear || Math.floor(new Date().getFullYear() / 10) * 10;
|
|
238
238
|
}, [
|
|
@@ -241,10 +241,14 @@ function useYearRangeState({ selectedYear, navigatedYear }) {
|
|
|
241
241
|
]);
|
|
242
242
|
const [fromYear, setFromYear] = React.useState(rangeYear);
|
|
243
243
|
const onNavNext = ()=>{
|
|
244
|
-
|
|
244
|
+
const newFromYear = fromYear + CELL_COUNT;
|
|
245
|
+
setFromYear(newFromYear);
|
|
246
|
+
onNavigateDate === null || onNavigateDate === void 0 ? void 0 : onNavigateDate(newFromYear);
|
|
245
247
|
};
|
|
246
248
|
const onNavPrevious = ()=>{
|
|
247
|
-
|
|
249
|
+
const newFromYear = fromYear - CELL_COUNT;
|
|
250
|
+
setFromYear(newFromYear);
|
|
251
|
+
onNavigateDate === null || onNavigateDate === void 0 ? void 0 : onNavigateDate(newFromYear);
|
|
248
252
|
};
|
|
249
253
|
React.useEffect(()=>{
|
|
250
254
|
setFromYear(rangeYear);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarYear/CalendarYear.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { mergeClasses } from '@griffel/react';\nimport { useCalendarYearStyles_unstable } from './useCalendarYearStyles.styles';\nimport type {\n CalendarYearStrings,\n CalendarYearProps,\n CalendarYearRange,\n CalendarYearHeaderProps,\n} from './CalendarYear.types';\n\nconst CELL_COUNT = 12;\nconst CELLS_PER_ROW = 4;\n\nconst DefaultCalendarYearStrings: CalendarYearStrings = {\n prevRangeAriaLabel: undefined,\n nextRangeAriaLabel: undefined,\n};\ninterface CalendarYearGrid {\n focus(): void;\n}\n\ninterface CalendarYearGridCellProps extends CalendarYearProps {\n year: number;\n current?: boolean;\n selected?: boolean;\n disabled?: boolean;\n onSelectYear?: (year: number) => void;\n onRenderYear?: (year: number) => React.ReactNode;\n}\n\ninterface CalendarYearGridProps extends CalendarYearProps, CalendarYearRange {\n selectedYear?: number;\n animateBackwards?: boolean;\n componentRef?: React.RefObject<CalendarYearGridCell | null>;\n}\n\ninterface CalendarYearGridCell {\n focus(): void;\n}\n\nconst CalendarYearGridCell: React.FunctionComponent<CalendarYearGridCellProps> = props => {\n const {\n className,\n highlightCurrentYear,\n highlightSelectedYear,\n year,\n selected,\n disabled,\n componentRef,\n onSelectYear,\n onRenderYear,\n } = props;\n\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n\n React.useImperativeHandle(\n componentRef,\n () => ({\n focus() {\n buttonRef.current?.focus?.();\n },\n }),\n [],\n );\n\n const onClick = () => {\n onSelectYear?.(year);\n };\n\n const onKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n if (ev.key === Enter) {\n onSelectYear?.(year);\n }\n };\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n highlightCurrent: highlightCurrentYear,\n highlightSelected: highlightSelectedYear,\n });\n\n return (\n <button\n className={mergeClasses(classNames.itemButton, selected && classNames.selected, disabled && classNames.disabled)}\n type=\"button\"\n role=\"gridcell\"\n onClick={!disabled ? onClick : undefined}\n onKeyDown={!disabled ? onKeyDown : undefined}\n disabled={disabled}\n aria-selected={selected}\n ref={buttonRef}\n >\n {onRenderYear?.(year) ?? year}\n </button>\n );\n};\nCalendarYearGridCell.displayName = 'CalendarYearGridCell';\n\nconst CalendarYearGrid: React.FunctionComponent<CalendarYearGridProps> = props => {\n const {\n className,\n fromYear,\n toYear,\n animationDirection,\n animateBackwards,\n minYear,\n maxYear,\n onSelectYear,\n selectedYear,\n componentRef,\n } = props;\n\n const selectedCellRef = React.useRef<CalendarYearGridCell>(null);\n\n const currentCellRef = React.useRef<CalendarYearGridCell>(null);\n\n React.useImperativeHandle(\n componentRef,\n () => ({\n focus() {\n (selectedCellRef.current || currentCellRef.current)?.focus?.();\n },\n }),\n [],\n );\n\n const renderCell = (yearToRender: number): React.ReactNode => {\n const selected = yearToRender === selectedYear;\n const disabled =\n (minYear !== undefined && yearToRender < minYear) || (maxYear !== undefined && yearToRender > maxYear);\n const current = yearToRender === new Date().getFullYear();\n\n return (\n <CalendarYearGridCell\n {...props}\n key={yearToRender}\n year={yearToRender}\n selected={selected}\n current={current}\n disabled={disabled}\n onSelectYear={onSelectYear}\n componentRef={selected ? selectedCellRef : current ? currentCellRef : undefined}\n />\n );\n };\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n animateBackwards,\n animationDirection,\n });\n\n const onRenderYear = (value: number) => {\n return props.onRenderYear?.(value) ?? value;\n };\n\n const gridAriaLabel = `${onRenderYear(fromYear)} - ${onRenderYear(toYear)}`;\n\n let year = fromYear;\n const cells: React.ReactNode[][] = [];\n\n for (let i = 0; i < (toYear - fromYear + 1) / CELLS_PER_ROW; i++) {\n cells.push([]);\n for (let j = 0; j < CELLS_PER_ROW; j++) {\n cells[i].push(renderCell(year));\n year++;\n }\n }\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid' });\n\n return (\n <div {...arrowNavigationAttributes} className={classNames.gridContainer} role=\"grid\" aria-label={gridAriaLabel}>\n {cells.map((cellRow: React.ReactNode[], index: number) => {\n return (\n <div key={'yearPickerRow_' + index + '_' + fromYear} role=\"row\" className={classNames.buttonRow}>\n {cellRow}\n </div>\n );\n })}\n </div>\n );\n};\nCalendarYearGrid.displayName = 'CalendarYearGrid';\n\nconst CalendarYearNavDirection = {\n Previous: 0 as const,\n Next: 1 as const,\n};\n\ninterface CalendarYearNavArrowProps extends CalendarYearHeaderProps {\n direction: (typeof CalendarYearNavDirection)[keyof typeof CalendarYearNavDirection];\n}\n\nconst CalendarYearNavArrow: React.FunctionComponent<CalendarYearNavArrowProps> = props => {\n const {\n className,\n strings = DefaultCalendarYearStrings,\n direction,\n onSelectPrev,\n onSelectNext,\n fromYear,\n toYear,\n maxYear,\n minYear,\n navigationIcons,\n } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n });\n\n const ariaLabel =\n direction === CalendarYearNavDirection.Previous ? strings.prevRangeAriaLabel : strings.nextRangeAriaLabel;\n const newRangeOffset = direction === CalendarYearNavDirection.Previous ? -CELL_COUNT : CELL_COUNT;\n const newRange = { fromYear: fromYear + newRangeOffset, toYear: toYear + newRangeOffset };\n const ariaLabelString = ariaLabel ? (typeof ariaLabel === 'string' ? ariaLabel : ariaLabel(newRange)) : undefined;\n const disabled =\n direction === CalendarYearNavDirection.Previous\n ? minYear !== undefined && fromYear < minYear\n : maxYear !== undefined && props.fromYear + CELL_COUNT > maxYear;\n\n const onNavigate = () => {\n direction === CalendarYearNavDirection.Previous ? onSelectPrev?.() : onSelectNext?.();\n };\n\n const onKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n if (ev.key === Enter) {\n onNavigate();\n }\n };\n\n return (\n <button\n className={mergeClasses(classNames.navigationButton, disabled && classNames.disabled)}\n onClick={!disabled ? onNavigate : undefined}\n onKeyDown={!disabled ? onKeyDown : undefined}\n type=\"button\"\n title={ariaLabelString}\n disabled={disabled}\n >\n {direction === CalendarYearNavDirection.Previous ? navigationIcons.upNavigation : navigationIcons.downNavigation}\n </button>\n );\n};\nCalendarYearNavArrow.displayName = 'CalendarYearNavArrow';\n\nconst CalendarYearNav: React.FunctionComponent<CalendarYearHeaderProps> = props => {\n const { className } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n });\n\n return (\n <div className={classNames.navigationButtonsContainer}>\n <CalendarYearNavArrow {...props} direction={CalendarYearNavDirection.Previous} />\n <CalendarYearNavArrow {...props} direction={CalendarYearNavDirection.Next} />\n </div>\n );\n};\nCalendarYearNav.displayName = 'CalendarYearNav';\n\nconst CalendarYearTitle: React.FunctionComponent<CalendarYearHeaderProps> = props => {\n const {\n className,\n fromYear,\n toYear,\n strings = DefaultCalendarYearStrings,\n animateBackwards,\n animationDirection,\n } = props;\n\n const onHeaderSelect = () => {\n props.onHeaderSelect?.(true);\n };\n\n const onHeaderKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n if (ev.key === Enter || ev.key === Space) {\n onHeaderSelect();\n }\n };\n\n const onRenderYear = (year: number) => {\n return props.onRenderYear?.(year) ?? year;\n };\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n hasHeaderClickCallback: !!props.onHeaderSelect,\n animateBackwards,\n animationDirection,\n });\n\n if (props.onHeaderSelect) {\n const rangeAriaLabel = strings.rangeAriaLabel;\n const headerAriaLabelFormatString = strings.headerAriaLabelFormatString;\n const currentDateRange = rangeAriaLabel\n ? typeof rangeAriaLabel === 'string'\n ? rangeAriaLabel\n : rangeAriaLabel(props)\n : undefined;\n\n const ariaLabel = headerAriaLabelFormatString\n ? headerAriaLabelFormatString.replace('{0}', currentDateRange ?? '')\n : currentDateRange;\n\n return (\n <button\n className={classNames.currentItemButton}\n onClick={onHeaderSelect}\n onKeyDown={onHeaderKeyDown}\n aria-label={ariaLabel}\n role=\"button\"\n type=\"button\"\n >\n <span aria-live=\"assertive\" aria-atomic=\"true\">\n {onRenderYear(fromYear)} - {onRenderYear(toYear)}\n </span>\n </button>\n );\n }\n\n return (\n <div className={classNames.current}>\n {onRenderYear(fromYear)} - {onRenderYear(toYear)}\n </div>\n );\n};\nCalendarYearTitle.displayName = 'CalendarYearTitle';\n\nconst CalendarYearHeader: React.FunctionComponent<CalendarYearHeaderProps> = props => {\n const { className, animateBackwards, animationDirection, onRenderTitle } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n hasHeaderClickCallback: !!props.onHeaderSelect,\n animateBackwards,\n animationDirection,\n });\n\n return (\n <div className={classNames.headerContainer}>\n {onRenderTitle?.(props) ?? <CalendarYearTitle {...props} />}\n <CalendarYearNav {...props} />\n </div>\n );\n};\nCalendarYearHeader.displayName = 'CalendarYearHeader';\n\nfunction useAnimateBackwards({ selectedYear, navigatedYear }: CalendarYearProps) {\n const rangeYear = selectedYear || navigatedYear || new Date().getFullYear();\n const fromYear = Math.floor(rangeYear / 10) * 10;\n\n const previousFromYearRef = React.useRef<number | undefined>(fromYear);\n React.useRef(() => {\n previousFromYearRef.current = fromYear;\n });\n const previousFromYear = previousFromYearRef.current;\n\n if (!previousFromYear || previousFromYear === fromYear) {\n return undefined;\n } else if (previousFromYear > fromYear) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction useYearRangeState({ selectedYear, navigatedYear }: CalendarYearProps) {\n const rangeYear = React.useMemo(() => {\n return selectedYear || navigatedYear || Math.floor(new Date().getFullYear() / 10) * 10;\n }, [navigatedYear, selectedYear]);\n\n const [fromYear, setFromYear] = React.useState<number>(rangeYear);\n\n const onNavNext = () => {\n setFromYear(year => year + CELL_COUNT);\n };\n\n const onNavPrevious = () => {\n setFromYear(year => year - CELL_COUNT);\n };\n\n React.useEffect(() => {\n setFromYear(rangeYear);\n }, [rangeYear]);\n\n const toYear = fromYear + CELL_COUNT - 1;\n\n return [fromYear, toYear, onNavNext, onNavPrevious] as const;\n}\n\n/**\n * @internal\n */\nexport const CalendarYear: React.FunctionComponent<CalendarYearProps> = props => {\n const animateBackwards = useAnimateBackwards(props);\n const [fromYear, toYear, onNavNext, onNavPrevious] = useYearRangeState(props);\n\n const gridRef = React.useRef<CalendarYearGrid>(null);\n\n React.useImperativeHandle(props.componentRef, () => ({\n focus() {\n gridRef.current?.focus?.();\n },\n }));\n\n const { className } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n });\n\n return (\n <div className={classNames.root}>\n <CalendarYearHeader\n {...props}\n fromYear={fromYear}\n toYear={toYear}\n onSelectPrev={onNavPrevious}\n onSelectNext={onNavNext}\n animateBackwards={animateBackwards}\n />\n <CalendarYearGrid\n {...props}\n fromYear={fromYear}\n toYear={toYear}\n animateBackwards={animateBackwards}\n componentRef={gridRef}\n />\n </div>\n );\n};\nCalendarYear.displayName = 'CalendarYear';\n"],"names":["React","Enter","Space","useArrowNavigationGroup","mergeClasses","useCalendarYearStyles_unstable","CELL_COUNT","CELLS_PER_ROW","DefaultCalendarYearStrings","prevRangeAriaLabel","undefined","nextRangeAriaLabel","CalendarYearGridCell","props","className","highlightCurrentYear","highlightSelectedYear","year","selected","disabled","componentRef","onSelectYear","onRenderYear","buttonRef","useRef","useImperativeHandle","focus","current","onClick","onKeyDown","ev","key","classNames","highlightCurrent","highlightSelected","button","itemButton","type","role","aria-selected","ref","displayName","CalendarYearGrid","fromYear","toYear","animationDirection","animateBackwards","minYear","maxYear","selectedYear","selectedCellRef","currentCellRef","renderCell","yearToRender","Date","getFullYear","value","gridAriaLabel","cells","i","push","j","arrowNavigationAttributes","axis","div","gridContainer","aria-label","map","cellRow","index","buttonRow","CalendarYearNavDirection","Previous","Next","CalendarYearNavArrow","strings","direction","onSelectPrev","onSelectNext","navigationIcons","ariaLabel","newRangeOffset","newRange","ariaLabelString","onNavigate","navigationButton","title","upNavigation","downNavigation","CalendarYearNav","navigationButtonsContainer","CalendarYearTitle","onHeaderSelect","onHeaderKeyDown","hasHeaderClickCallback","rangeAriaLabel","headerAriaLabelFormatString","currentDateRange","replace","currentItemButton","span","aria-live","aria-atomic","CalendarYearHeader","onRenderTitle","headerContainer","useAnimateBackwards","navigatedYear","rangeYear","Math","floor","previousFromYearRef","previousFromYear","useYearRangeState","useMemo","setFromYear","useState","onNavNext","onNavPrevious","useEffect","CalendarYear","gridRef","root"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AACvD,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,8BAA8B,QAAQ,iCAAiC;AAQhF,MAAMC,aAAa;AACnB,MAAMC,gBAAgB;AAEtB,MAAMC,6BAAkD;IACtDC,oB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AkBpG;IAEvE,MAAM4G,UAAUzH,MAAMwB,MAAM,CAAmB;IAE/CxB,MAAMyB,mBAAmB,CAACZ,MAAMO,YAAY,EAAE,IAAO,CAAA;YACnDM;oBACE+F,wBAAAA;iBAAAA,mBAAAA,QAAQ9F,OAAO,cAAf8F,wCAAAA,yBAAAA,iBAAiB/F,KAAK,cAAtB+F,6CAAAA,4BAAAA;YACF;QACF,CAAA;IAEA,MAAM,EAAE3G,SAAS,EAAE,GAAGD;IAEtB,MAAMmB,aAAa3B,+BAA+B;QAChDS;IACF;IAEA,qBACE,oBAACkD;QAAIlD,WAAWkB,WAAW0F,IAAI;qBAC7B,oBAACnB;QACE,GAAG1F,KAAK;QACT8B,UAAUA;QACVC,QAAQA;QACRiC,cAAcyC;QACdxC,cAAcuC;QACdvE,kBAAkBA;sBAEpB,oBAACJ;QACE,GAAG7B,KAAK;QACT8B,UAAUA;QACVC,QAAQA;QACRE,kBAAkBA;QAClB1B,cAAcqG;;AAItB,EAAE;AACFD,aAAa/E,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarYear/CalendarYear.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { mergeClasses } from '@griffel/react';\nimport { useCalendarYearStyles_unstable } from './useCalendarYearStyles.styles';\nimport type {\n CalendarYearStrings,\n CalendarYearProps,\n CalendarYearRange,\n CalendarYearHeaderProps,\n} from './CalendarYear.types';\n\nconst CELL_COUNT = 12;\nconst CELLS_PER_ROW = 4;\n\nconst DefaultCalendarYearStrings: CalendarYearStrings = {\n prevRangeAriaLabel: undefined,\n nextRangeAriaLabel: undefined,\n};\ninterface CalendarYearGrid {\n focus(): void;\n}\n\ninterface CalendarYearGridCellProps extends CalendarYearProps {\n year: number;\n current?: boolean;\n selected?: boolean;\n disabled?: boolean;\n onSelectYear?: (year: number) => void;\n onRenderYear?: (year: number) => React.ReactNode;\n}\n\ninterface CalendarYearGridProps extends CalendarYearProps, CalendarYearRange {\n selectedYear?: number;\n animateBackwards?: boolean;\n componentRef?: React.RefObject<CalendarYearGridCell | null>;\n}\n\ninterface CalendarYearGridCell {\n focus(): void;\n}\n\nconst CalendarYearGridCell: React.FunctionComponent<CalendarYearGridCellProps> = props => {\n const {\n className,\n highlightCurrentYear,\n highlightSelectedYear,\n year,\n selected,\n disabled,\n componentRef,\n onSelectYear,\n onRenderYear,\n } = props;\n\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n\n React.useImperativeHandle(\n componentRef,\n () => ({\n focus() {\n buttonRef.current?.focus?.();\n },\n }),\n [],\n );\n\n const onClick = () => {\n onSelectYear?.(year);\n };\n\n const onKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n if (ev.key === Enter) {\n onSelectYear?.(year);\n }\n };\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n highlightCurrent: highlightCurrentYear,\n highlightSelected: highlightSelectedYear,\n });\n\n return (\n <button\n className={mergeClasses(classNames.itemButton, selected && classNames.selected, disabled && classNames.disabled)}\n type=\"button\"\n role=\"gridcell\"\n onClick={!disabled ? onClick : undefined}\n onKeyDown={!disabled ? onKeyDown : undefined}\n disabled={disabled}\n aria-selected={selected}\n ref={buttonRef}\n >\n {onRenderYear?.(year) ?? year}\n </button>\n );\n};\nCalendarYearGridCell.displayName = 'CalendarYearGridCell';\n\nconst CalendarYearGrid: React.FunctionComponent<CalendarYearGridProps> = props => {\n const {\n className,\n fromYear,\n toYear,\n animationDirection,\n animateBackwards,\n minYear,\n maxYear,\n onSelectYear,\n selectedYear,\n componentRef,\n } = props;\n\n const selectedCellRef = React.useRef<CalendarYearGridCell>(null);\n\n const currentCellRef = React.useRef<CalendarYearGridCell>(null);\n\n React.useImperativeHandle(\n componentRef,\n () => ({\n focus() {\n (selectedCellRef.current || currentCellRef.current)?.focus?.();\n },\n }),\n [],\n );\n\n const renderCell = (yearToRender: number): React.ReactNode => {\n const selected = yearToRender === selectedYear;\n const disabled =\n (minYear !== undefined && yearToRender < minYear) || (maxYear !== undefined && yearToRender > maxYear);\n const current = yearToRender === new Date().getFullYear();\n\n return (\n <CalendarYearGridCell\n {...props}\n key={yearToRender}\n year={yearToRender}\n selected={selected}\n current={current}\n disabled={disabled}\n onSelectYear={onSelectYear}\n componentRef={selected ? selectedCellRef : current ? currentCellRef : undefined}\n />\n );\n };\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n animateBackwards,\n animationDirection,\n });\n\n const onRenderYear = (value: number) => {\n return props.onRenderYear?.(value) ?? value;\n };\n\n const gridAriaLabel = `${onRenderYear(fromYear)} - ${onRenderYear(toYear)}`;\n\n let year = fromYear;\n const cells: React.ReactNode[][] = [];\n\n for (let i = 0; i < (toYear - fromYear + 1) / CELLS_PER_ROW; i++) {\n cells.push([]);\n for (let j = 0; j < CELLS_PER_ROW; j++) {\n cells[i].push(renderCell(year));\n year++;\n }\n }\n\n const arrowNavigationAttributes = useArrowNavigationGroup({ axis: 'grid' });\n\n return (\n <div {...arrowNavigationAttributes} className={classNames.gridContainer} role=\"grid\" aria-label={gridAriaLabel}>\n {cells.map((cellRow: React.ReactNode[], index: number) => {\n return (\n <div key={'yearPickerRow_' + index + '_' + fromYear} role=\"row\" className={classNames.buttonRow}>\n {cellRow}\n </div>\n );\n })}\n </div>\n );\n};\nCalendarYearGrid.displayName = 'CalendarYearGrid';\n\nconst CalendarYearNavDirection = {\n Previous: 0 as const,\n Next: 1 as const,\n};\n\ninterface CalendarYearNavArrowProps extends CalendarYearHeaderProps {\n direction: (typeof CalendarYearNavDirection)[keyof typeof CalendarYearNavDirection];\n}\n\nconst CalendarYearNavArrow: React.FunctionComponent<CalendarYearNavArrowProps> = props => {\n const {\n className,\n strings = DefaultCalendarYearStrings,\n direction,\n onSelectPrev,\n onSelectNext,\n fromYear,\n toYear,\n maxYear,\n minYear,\n navigationIcons,\n } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n });\n\n const ariaLabel =\n direction === CalendarYearNavDirection.Previous ? strings.prevRangeAriaLabel : strings.nextRangeAriaLabel;\n const newRangeOffset = direction === CalendarYearNavDirection.Previous ? -CELL_COUNT : CELL_COUNT;\n const newRange = { fromYear: fromYear + newRangeOffset, toYear: toYear + newRangeOffset };\n const ariaLabelString = ariaLabel ? (typeof ariaLabel === 'string' ? ariaLabel : ariaLabel(newRange)) : undefined;\n const disabled =\n direction === CalendarYearNavDirection.Previous\n ? minYear !== undefined && fromYear < minYear\n : maxYear !== undefined && props.fromYear + CELL_COUNT > maxYear;\n\n const onNavigate = () => {\n direction === CalendarYearNavDirection.Previous ? onSelectPrev?.() : onSelectNext?.();\n };\n\n const onKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n if (ev.key === Enter) {\n onNavigate();\n }\n };\n\n return (\n <button\n className={mergeClasses(classNames.navigationButton, disabled && classNames.disabled)}\n onClick={!disabled ? onNavigate : undefined}\n onKeyDown={!disabled ? onKeyDown : undefined}\n type=\"button\"\n title={ariaLabelString}\n disabled={disabled}\n >\n {direction === CalendarYearNavDirection.Previous ? navigationIcons.upNavigation : navigationIcons.downNavigation}\n </button>\n );\n};\nCalendarYearNavArrow.displayName = 'CalendarYearNavArrow';\n\nconst CalendarYearNav: React.FunctionComponent<CalendarYearHeaderProps> = props => {\n const { className } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n });\n\n return (\n <div className={classNames.navigationButtonsContainer}>\n <CalendarYearNavArrow {...props} direction={CalendarYearNavDirection.Previous} />\n <CalendarYearNavArrow {...props} direction={CalendarYearNavDirection.Next} />\n </div>\n );\n};\nCalendarYearNav.displayName = 'CalendarYearNav';\n\nconst CalendarYearTitle: React.FunctionComponent<CalendarYearHeaderProps> = props => {\n const {\n className,\n fromYear,\n toYear,\n strings = DefaultCalendarYearStrings,\n animateBackwards,\n animationDirection,\n } = props;\n\n const onHeaderSelect = () => {\n props.onHeaderSelect?.(true);\n };\n\n const onHeaderKeyDown = (ev: React.KeyboardEvent<HTMLElement>) => {\n if (ev.key === Enter || ev.key === Space) {\n onHeaderSelect();\n }\n };\n\n const onRenderYear = (year: number) => {\n return props.onRenderYear?.(year) ?? year;\n };\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n hasHeaderClickCallback: !!props.onHeaderSelect,\n animateBackwards,\n animationDirection,\n });\n\n if (props.onHeaderSelect) {\n const rangeAriaLabel = strings.rangeAriaLabel;\n const headerAriaLabelFormatString = strings.headerAriaLabelFormatString;\n const currentDateRange = rangeAriaLabel\n ? typeof rangeAriaLabel === 'string'\n ? rangeAriaLabel\n : rangeAriaLabel(props)\n : undefined;\n\n const ariaLabel = headerAriaLabelFormatString\n ? headerAriaLabelFormatString.replace('{0}', currentDateRange ?? '')\n : currentDateRange;\n\n return (\n <button\n className={classNames.currentItemButton}\n onClick={onHeaderSelect}\n onKeyDown={onHeaderKeyDown}\n aria-label={ariaLabel}\n role=\"button\"\n type=\"button\"\n >\n <span aria-live=\"assertive\" aria-atomic=\"true\">\n {onRenderYear(fromYear)} - {onRenderYear(toYear)}\n </span>\n </button>\n );\n }\n\n return (\n <div className={classNames.current}>\n {onRenderYear(fromYear)} - {onRenderYear(toYear)}\n </div>\n );\n};\nCalendarYearTitle.displayName = 'CalendarYearTitle';\n\nconst CalendarYearHeader: React.FunctionComponent<CalendarYearHeaderProps> = props => {\n const { className, animateBackwards, animationDirection, onRenderTitle } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n hasHeaderClickCallback: !!props.onHeaderSelect,\n animateBackwards,\n animationDirection,\n });\n\n return (\n <div className={classNames.headerContainer}>\n {onRenderTitle?.(props) ?? <CalendarYearTitle {...props} />}\n <CalendarYearNav {...props} />\n </div>\n );\n};\nCalendarYearHeader.displayName = 'CalendarYearHeader';\n\nfunction useAnimateBackwards({ selectedYear, navigatedYear }: CalendarYearProps) {\n const rangeYear = selectedYear || navigatedYear || new Date().getFullYear();\n const fromYear = Math.floor(rangeYear / 10) * 10;\n\n const previousFromYearRef = React.useRef<number | undefined>(fromYear);\n React.useRef(() => {\n previousFromYearRef.current = fromYear;\n });\n const previousFromYear = previousFromYearRef.current;\n\n if (!previousFromYear || previousFromYear === fromYear) {\n return undefined;\n } else if (previousFromYear > fromYear) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction useYearRangeState({ selectedYear, navigatedYear, onNavigateDate }: CalendarYearProps) {\n const rangeYear = React.useMemo(() => {\n return selectedYear || navigatedYear || Math.floor(new Date().getFullYear() / 10) * 10;\n }, [navigatedYear, selectedYear]);\n\n const [fromYear, setFromYear] = React.useState<number>(rangeYear);\n\n const onNavNext = () => {\n const newFromYear = fromYear + CELL_COUNT;\n setFromYear(newFromYear);\n onNavigateDate?.(newFromYear);\n };\n\n const onNavPrevious = () => {\n const newFromYear = fromYear - CELL_COUNT;\n setFromYear(newFromYear);\n onNavigateDate?.(newFromYear);\n };\n\n React.useEffect(() => {\n setFromYear(rangeYear);\n }, [rangeYear]);\n\n const toYear = fromYear + CELL_COUNT - 1;\n\n return [fromYear, toYear, onNavNext, onNavPrevious] as const;\n}\n\n/**\n * @internal\n */\nexport const CalendarYear: React.FunctionComponent<CalendarYearProps> = props => {\n const animateBackwards = useAnimateBackwards(props);\n const [fromYear, toYear, onNavNext, onNavPrevious] = useYearRangeState(props);\n\n const gridRef = React.useRef<CalendarYearGrid>(null);\n\n React.useImperativeHandle(props.componentRef, () => ({\n focus() {\n gridRef.current?.focus?.();\n },\n }));\n\n const { className } = props;\n\n const classNames = useCalendarYearStyles_unstable({\n className,\n });\n\n return (\n <div className={classNames.root}>\n <CalendarYearHeader\n {...props}\n fromYear={fromYear}\n toYear={toYear}\n onSelectPrev={onNavPrevious}\n onSelectNext={onNavNext}\n animateBackwards={animateBackwards}\n />\n <CalendarYearGrid\n {...props}\n fromYear={fromYear}\n toYear={toYear}\n animateBackwards={animateBackwards}\n componentRef={gridRef}\n />\n </div>\n );\n};\nCalendarYear.displayName = 'CalendarYear';\n"],"names":["React","Enter","Space","useArrowNavigationGroup","mergeClasses","useCalendarYearStyles_unstable","CELL_COUNT","CELLS_PER_ROW","DefaultCalendarYearStrings","prevRangeAriaLabel","undefined","nextRangeAriaLabel","CalendarYearGridCell","props","className","highlightCurrentYear","highlightSelectedYear","year","selected","disabled","componentRef","onSelectYear","onRenderYear","buttonRef","useRef","useImperativeHandle","focus","current","onClick","onKeyDown","ev","key","classNames","highlightCurrent","highlightSelected","button","itemButton","type","role","aria-selected","ref","displayName","CalendarYearGrid","fromYear","toYear","animationDirection","animateBackwards","minYear","maxYear","selectedYear","selectedCellRef","currentCellRef","renderCell","yearToRender","Date","getFullYear","value","gridAriaLabel","cells","i","push","j","arrowNavigationAttributes","axis","div","gridContainer","aria-label","map","cellRow","index","buttonRow","CalendarYearNavDirection","Previous","Next","CalendarYearNavArrow","strings","direction","onSelectPrev","onSelectNext","navigationIcons","ariaLabel","newRangeOffset","newRange","ariaLabelString","onNavigate","navigationButton","title","upNavigation","downNavigation","CalendarYearNav","navigationButtonsContainer","CalendarYearTitle","onHeaderSelect","onHeaderKeyDown","hasHeaderClickCallback","rangeAriaLabel","headerAriaLabelFormatString","currentDateRange","replace","currentItemButton","span","aria-live","aria-atomic","CalendarYearHeader","onRenderTitle","headerContainer","useAnimateBackwards","navigatedYear","rangeYear","Math","floor","previousFromYearRef","previousFromYear","useYearRangeState","onNavigateDate","useMemo","setFromYear","useState","onNavNext","newFromYear","onNavPrevious","useEffect","CalendarYear","gridRef","root"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,KAAK,EAAEC,KAAK,QAAQ,0BAA0B;AACvD,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,8BAA8B,QAAQ,iCAAiC;AAQhF,MAAMC,aAAa;AACnB,MAAMC,gBAAgB;AAEtB,MAAMC,6BAAkD;IACtDC,oBAAoBC;IACpBC,oBAAoBD;AACtB;AAwBA,MAAME,uBAA2EC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,UAAUC,QAAQ0E,WAAWE,cAAc,GAAGP,kBAAkBpG;IAEvE,MAAM8G,UAAU3H,MAAMwB,MAAM,CAAmB;IAE/CxB,MAAMyB,mBAAmB,CAACZ,MAAMO,YAAY,EAAE,IAAO,CAAA;YACnDM;oBACEiG,wBAAAA;iBAAAA,mBAAAA,QAAQhG,OAAO,cAAfgG,wCAAAA,yBAAAA,iBAAiBjG,KAAK,cAAtBiG,6CAAAA,4BAAAA;YACF;QACF,CAAA;IAEA,MAAM,EAAE7G,SAAS,EAAE,GAAGD;IAEtB,MAAMmB,aAAa3B,+BAA+B;QAChDS;IACF;IAEA,qBACE,oBAACkD;QAAIlD,WAAWkB,WAAW4F,IAAI;qBAC7B,oBAACrB;QACE,GAAG1F,KAAK;QACT8B,UAAUA;QACVC,QAAQA;QACRiC,cAAc2C;QACd1C,cAAcwC;QACdxE,kBAAkBA;sBAEpB,oBAACJ;QACE,GAAG7B,KAAK;QACT8B,UAAUA;QACVC,QAAQA;QACRE,kBAAkBA;QAClB1B,cAAcuG;;AAItB,EAAE;AACFD,aAAajF,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarYear/CalendarYear.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { AnimationDirection } from '../Calendar/Calendar.types';\nimport type { CalendarNavigationIcons } from '../Calendar/calendarNavigationIcons';\nimport type { CalendarPickerStyleProps, CalendarPickerStyles } from '../CalendarPicker/CalendarPicker.types';\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ICalendarYear {\n focus(): void;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearRange {\n fromYear: number;\n toYear: number;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearRangeToString {\n (range: CalendarYearRange): string;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearStrings {\n rangeAriaLabel?: string | CalendarYearRangeToString;\n prevRangeAriaLabel?: string | CalendarYearRangeToString;\n nextRangeAriaLabel?: string | CalendarYearRangeToString;\n headerAriaLabelFormatString?: string;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearProps {\n /**\n * Optional callback to access the ICalendarYear interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<ICalendarYear | null>;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarYearStrings;\n\n /**\n * The currently selected year\n */\n selectedYear?: number;\n\n /**\n * The currently navigated year\n */\n navigatedYear?: number;\n\n /**\n * Callback action when a year is selected\n * @param year - The year the user selected\n */\n onSelectYear?: (year: number) => void;\n\n /**\n * Callback action when the header is selected\n */\n onHeaderSelect?: (focus: boolean) => void;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a year earlier than this value.\n */\n minYear?: number;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a year later than this value.\n */\n maxYear?: number;\n\n /**\n * Whether the year picker should highlight the current year\n * @default false\n */\n highlightCurrentYear?: boolean;\n\n /**\n * Whether the year picker should highlight the selected year\n * @default false\n */\n highlightSelectedYear?: boolean;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * Custom renderer for the title\n */\n onRenderTitle?: (props: CalendarYearHeaderProps) => React.ReactNode;\n\n /**\n * Custom renderer for the year\n */\n onRenderYear?: (year: number) => React.ReactNode;\n\n /**\n * The cardinal directions for animation to occur during transitions, either horizontal or veritcal\n */\n animationDirection?: AnimationDirection;\n\n /**\n * Custom navigation icons.\n */\n navigationIcons: CalendarNavigationIcons;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearStyleProps extends CalendarPickerStyleProps {}\n\n/**\n * @internal\n */\nexport interface CalendarYearStyles extends CalendarPickerStyles {}\n\n/**\n * @internal\n */\nexport interface CalendarYearHeaderProps extends CalendarYearProps, CalendarYearRange {\n /**\n * Callback action when the 'previous' navigation button is selected\n */\n onSelectPrev?: () => void;\n\n /**\n * Callback action when the 'next' navigation button is selected\n */\n onSelectNext?: () => void;\n\n /**\n * Whether title entering animation should be forwards or backwards\n */\n animateBackwards?: boolean;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarYear/CalendarYear.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { AnimationDirection } from '../Calendar/Calendar.types';\nimport type { CalendarNavigationIcons } from '../Calendar/calendarNavigationIcons';\nimport type { CalendarPickerStyleProps, CalendarPickerStyles } from '../CalendarPicker/CalendarPicker.types';\n\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ICalendarYear {\n focus(): void;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearRange {\n fromYear: number;\n toYear: number;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearRangeToString {\n (range: CalendarYearRange): string;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearStrings {\n rangeAriaLabel?: string | CalendarYearRangeToString;\n prevRangeAriaLabel?: string | CalendarYearRangeToString;\n nextRangeAriaLabel?: string | CalendarYearRangeToString;\n headerAriaLabelFormatString?: string;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearProps {\n /**\n * Optional callback to access the ICalendarYear interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<ICalendarYear | null>;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarYearStrings;\n\n /**\n * The currently selected year\n */\n selectedYear?: number;\n\n /**\n * The currently navigated year\n */\n navigatedYear?: number;\n\n /**\n * Callback action when a year is selected\n * @param year - The year the user selected\n */\n onSelectYear?: (year: number) => void;\n\n /**\n * Callback action when the decade is navigated\n * @param year - The year at the start of the new decade range being navigated to\n */\n onNavigateDate?: (year: number) => void;\n\n /**\n * Callback action when the header is selected\n */\n onHeaderSelect?: (focus: boolean) => void;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a year earlier than this value.\n */\n minYear?: number;\n\n /**\n * If set the Calendar will not allow navigation to or selection of a year later than this value.\n */\n maxYear?: number;\n\n /**\n * Whether the year picker should highlight the current year\n * @default false\n */\n highlightCurrentYear?: boolean;\n\n /**\n * Whether the year picker should highlight the selected year\n * @default false\n */\n highlightSelectedYear?: boolean;\n\n /**\n * Accept custom classNames\n */\n className?: string;\n\n /**\n * Custom renderer for the title\n */\n onRenderTitle?: (props: CalendarYearHeaderProps) => React.ReactNode;\n\n /**\n * Custom renderer for the year\n */\n onRenderYear?: (year: number) => React.ReactNode;\n\n /**\n * The cardinal directions for animation to occur during transitions, either horizontal or veritcal\n */\n animationDirection?: AnimationDirection;\n\n /**\n * Custom navigation icons.\n */\n navigationIcons: CalendarNavigationIcons;\n}\n\n/**\n * @internal\n */\nexport interface CalendarYearStyleProps extends CalendarPickerStyleProps {}\n\n/**\n * @internal\n */\nexport interface CalendarYearStyles extends CalendarPickerStyles {}\n\n/**\n * @internal\n */\nexport interface CalendarYearHeaderProps extends CalendarYearProps, CalendarYearRange {\n /**\n * Callback action when the 'previous' navigation button is selected\n */\n onSelectPrev?: () => void;\n\n /**\n * Callback action when the 'next' navigation button is selected\n */\n onSelectNext?: () => void;\n\n /**\n * Whether title entering animation should be forwards or backwards\n */\n animateBackwards?: boolean;\n}\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';
|
|
4
4
|
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*
|
|
7
5
|
* Apply styling to the CalendarYear slots based on the state
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export const useCalendarYearStyles_unstable = props => {
|
|
10
10
|
'use no memo';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCalendarPickerStyles_unstable","useCalendarYearStyles_unstable","props"],"sources":["useCalendarYearStyles.styles.js"],"sourcesContent":["'use client';\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\n/**\n *
|
|
1
|
+
{"version":3,"names":["useCalendarPickerStyles_unstable","useCalendarYearStyles_unstable","props"],"sources":["useCalendarYearStyles.styles.js"],"sourcesContent":["'use client';\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\n/**\n * Apply styling to the CalendarYear slots based on the state\n *\n * @internal\n */ export const useCalendarYearStyles_unstable = (props)=>{\n 'use no memo';\n return useCalendarPickerStyles_unstable(props);\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,gCAAgC,QAAQ,kDAAkD;AACnG;AACA;AACA;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,aAAa;;EACb,OAAOF,gCAAgC,CAACE,KAAK,CAAC;AAClD,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';
|
|
3
3
|
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*
|
|
6
4
|
* Apply styling to the CalendarYear slots based on the state
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
7
|
*/ export const useCalendarYearStyles_unstable = (props)=>{
|
|
8
8
|
'use no memo';
|
|
9
9
|
return useCalendarPickerStyles_unstable(props);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/CalendarYear/useCalendarYearStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\nimport type { CalendarYearStyleProps, CalendarYearStyles } from './CalendarYear.types';\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../src/components/CalendarYear/useCalendarYearStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\nimport type { CalendarYearStyleProps, CalendarYearStyles } from './CalendarYear.types';\n\n/**\n * Apply styling to the CalendarYear slots based on the state\n *\n * @internal\n */\nexport const useCalendarYearStyles_unstable = (props: CalendarYearStyleProps): CalendarYearStyles => {\n 'use no memo';\n\n return useCalendarPickerStyles_unstable(props);\n};\n"],"names":["useCalendarPickerStyles_unstable","useCalendarYearStyles_unstable","props"],"mappings":"AAAA;AAEA,SAASA,gCAAgC,QAAQ,mDAAmD;AAGpG;;;;CAIC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7C;IAEA,OAAOF,iCAAiCE;AAC1C,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCalendarStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */ export const calendarClassNames = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion'\n};\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n monthPickerNotVisible: {\n flexDirection: 'column'\n },\n dayAndMonthPickersVisible: {\n width: '440px'\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px'\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px'\n }\n});\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0\n }\n});\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n '& div': {\n fontSize: tokens.fontSizeBase200\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall\n }\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none'\n }\n }\n});\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n *
|
|
1
|
+
{"version":3,"sources":["useCalendarStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\n/**\n * @internal\n */ export const calendarClassNames = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion'\n};\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px'\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0'\n },\n monthPickerNotVisible: {\n flexDirection: 'column'\n },\n dayAndMonthPickersVisible: {\n width: '440px'\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px'\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px'\n }\n});\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0\n }\n});\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column'\n }\n});\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n '& div': {\n fontSize: tokens.fontSizeBase200\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall\n }\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none'\n }\n }\n});\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n }\n});\n/**\n * Apply styling to the Calendar slots based on the state\n *\n * @internal\n */ export const useCalendarStyles_unstable = (props)=>{\n 'use no memo';\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n const { className, isDayPickerVisible, isMonthPickerVisible, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarClassNames.root, rootStyles.base, rootStyles.normalize, !isMonthPickerVisible && rootStyles.monthPickerNotVisible, isDayPickerVisible && isMonthPickerVisible && !showWeekNumbers && rootStyles.dayAndMonthPickersVisible, isDayPickerVisible && !isMonthPickerVisible && showWeekNumbers && rootStyles.dayPickerVisibleAndWeekNumbersShown, isDayPickerVisible && isMonthPickerVisible && showWeekNumbers && rootStyles.dayAndMonthPickersVisibleAndWeekNumbersShown, className),\n divider: mergeClasses(calendarClassNames.divider, dividerStyles.base),\n monthPickerWrapper: mergeClasses(calendarClassNames.monthPickerWrapper, monthPickerWrapperStyles.base),\n goTodayButton: mergeClasses(calendarClassNames.goTodayButton, goTodayButtonStyles.base),\n liveRegion: mergeClasses(calendarClassNames.liveRegion, liveRegionStyles.base)\n };\n};\n"],"names":["tokens","__styles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","mc9l5x","a9b677","normalize","E5pizo","B7ck84d","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","monthPickerNotVisible","Beiy3e4","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","d","p","useDividerStyles","h3c5rm","vrafjx","Bekrc4i","u1mtju","Bhzewxz","useMonthPickerWrapperStyles","useGoTodayButtonStyles","qb2dma","De3pzq","icvyot","oivjwe","wvpqe5","B5kzvoi","sj55zd","Bahqtrf","Be2twd7","Bqenvij","Bg96gwp","B68tc82","Bmxbyg5","Bpg54ce","seuwu7","Jwef8y","Bi91k9c","eoavqd","Bv6y5q5","uq1ffc","Bokaozi","Bfrni1f","Bkzqrjd","hu2duy","n9pfp1","dfw8yp","qugvs6","B2d53fq","Dyrjrp","Be90el1","h","m","useLiveRegionStyles","Bgfg5da","B9xav0g","Bn0qgzm","B4g9neb","zhjwy3","ibv6hh","i8vvqc","g2u3we","B4j52fo","irswps","qhf8xq","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAKKI,kBAAkB;;;8BA+FQ;eAA1BkF;;;uBAlGoC,gBAAgB;AAG1D,2BAA2B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C;QACtGJ,aAAa,MAAEL,mBAAY,EAACE,kBAAkB,CAACG,aAAa,EAAEoF,mBAAmB,CAAChF,IAAI,CAAC;QACvFF,UAAU,MAAEP,mBAAY,EAACE,kBAAkB,CAACK,UAAU,EAAEmF,gBAAgB,CAACjF,IAAI;IACjF,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Calendar/useCalendarStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarStyles, CalendarStyleProps } from './Calendar.types';\n\n/**\n * @internal\n */\nexport const calendarClassNames: SlotClassNames<CalendarStyles> = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n monthPickerNotVisible: {\n flexDirection: 'column',\n },\n dayAndMonthPickersVisible: {\n width: '440px',\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px',\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px',\n },\n});\n\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0,\n },\n});\n\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n\n '& div': {\n fontSize: tokens.fontSizeBase200,\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall,\n },\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2,\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n },\n});\n\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px',\n },\n});\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../src/components/Calendar/useCalendarStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CalendarStyles, CalendarStyleProps } from './Calendar.types';\n\n/**\n * @internal\n */\nexport const calendarClassNames: SlotClassNames<CalendarStyles> = {\n root: 'fui-Calendar',\n divider: 'fui-Calendar__divider',\n goTodayButton: 'fui-Calendar__goTodayButton',\n monthPickerWrapper: 'fui-Calendar__monthPickerWrapper',\n liveRegion: 'fui-Calendar__liveRegion',\n};\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'flex',\n width: '220px',\n },\n normalize: {\n boxShadow: 'none',\n boxSizing: 'border-box',\n margin: '0',\n padding: '0',\n },\n monthPickerNotVisible: {\n flexDirection: 'column',\n },\n dayAndMonthPickersVisible: {\n width: '440px',\n },\n dayPickerVisibleAndWeekNumbersShown: {\n width: '250px',\n },\n dayAndMonthPickersVisibleAndWeekNumbersShown: {\n width: '470px',\n },\n});\n\nconst useDividerStyles = makeStyles({\n base: {\n borderRight: `1px solid ${tokens.colorNeutralStroke2}`,\n top: 0,\n },\n});\n\nconst useMonthPickerWrapperStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n },\n});\n\nconst useGoTodayButtonStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderStyle('none'),\n bottom: 0,\n boxSizing: 'content-box',\n color: tokens.colorNeutralForeground1,\n fontFamily: 'inherit',\n fontSize: tokens.fontSizeBase200,\n height: '30px',\n lineHeight: '30px',\n marginRight: '16px',\n marginTop: '3px',\n overflow: 'visible',\n padding: '0 4px',\n\n '& div': {\n fontSize: tokens.fontSizeBase200,\n },\n '&:hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorBrandForeground1,\n cursor: 'pointer',\n\n '@media (forced-colors: active)': {\n outline: tokens.strokeWidthThin,\n borderRadius: tokens.borderRadiusSmall,\n },\n },\n '&:hover:active': {\n color: tokens.colorBrandForeground2,\n },\n '&:disabled': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\n },\n },\n});\n\nconst useLiveRegionStyles = makeStyles({\n base: {\n border: 'none',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px',\n },\n});\n\n/**\n * Apply styling to the Calendar slots based on the state\n *\n * @internal\n */\nexport const useCalendarStyles_unstable = (props: CalendarStyleProps): CalendarStyles => {\n 'use no memo';\n\n const rootStyles = useRootStyles();\n const dividerStyles = useDividerStyles();\n const monthPickerWrapperStyles = useMonthPickerWrapperStyles();\n const goTodayButtonStyles = useGoTodayButtonStyles();\n const liveRegionStyles = useLiveRegionStyles();\n\n const { className, isDayPickerVisible, isMonthPickerVisible, showWeekNumbers } = props;\n\n return {\n root: mergeClasses(\n calendarClassNames.root,\n rootStyles.base,\n rootStyles.normalize,\n !isMonthPickerVisible && rootStyles.monthPickerNotVisible,\n isDayPickerVisible && isMonthPickerVisible && !showWeekNumbers && rootStyles.dayAndMonthPickersVisible,\n isDayPickerVisible && !isMonthPickerVisible && showWeekNumbers && rootStyles.dayPickerVisibleAndWeekNumbersShown,\n isDayPickerVisible &&\n isMonthPickerVisible &&\n showWeekNumbers &&\n rootStyles.dayAndMonthPickersVisibleAndWeekNumbersShown,\n className,\n ),\n divider: mergeClasses(calendarClassNames.divider, dividerStyles.base),\n monthPickerWrapper: mergeClasses(calendarClassNames.monthPickerWrapper, monthPickerWrapperStyles.base),\n goTodayButton: mergeClasses(calendarClassNames.goTodayButton, goTodayButtonStyles.base),\n liveRegion: mergeClasses(calendarClassNames.liveRegion, liveRegionStyles.base),\n };\n};\n"],"names":["tokens","makeStyles","mergeClasses","shorthands","calendarClassNames","root","divider","goTodayButton","monthPickerWrapper","liveRegion","useRootStyles","base","display","width","normalize","boxShadow","boxSizing","margin","padding","monthPickerNotVisible","flexDirection","dayAndMonthPickersVisible","dayPickerVisibleAndWeekNumbersShown","dayAndMonthPickersVisibleAndWeekNumbersShown","useDividerStyles","borderRight","colorNeutralStroke2","top","useMonthPickerWrapperStyles","useGoTodayButtonStyles","alignSelf","backgroundColor","colorTransparentBackground","borderStyle","bottom","color","colorNeutralForeground1","fontFamily","fontSize","fontSizeBase200","height","lineHeight","marginRight","marginTop","overflow","colorBrandForeground1","cursor","outline","strokeWidthThin","borderRadius","borderRadiusSmall","colorBrandForeground2","colorNeutralForegroundDisabled","pointerEvents","useLiveRegionStyles","border","position","useCalendarStyles_unstable","props","rootStyles","dividerStyles","monthPickerWrapperStyles","goTodayButtonStyles","liveRegionStyles","className","isDayPickerVisible","isMonthPickerVisible","showWeekNumbers"],"mappings":"AAAA;;;;;;;;;;;;IAUaI,kBAAAA;;;IAwGAqD,0BAAAA;;;;4BAhHU,wBAAwB;uBACM,iBAAiB;AAO/D,2BAA2D;IAChEpD,MAAM;IACNC,SAAS;IACTC,eAAe;IACfC,oBAAoB;IACpBC,YAAY;AACd,EAAE;AAEF,M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AA8B;YAC5CC,eAAe;QACjB;IACF;AACF;AAEA,MAAMC,0BAAsBrD,iBAAAA,EAAW;IACrCU,MAAM;QACJ4C,QAAQ;QACRf,QAAQ;QACRvB,QAAQ;QACR2B,UAAU;QACV1B,SAAS;QACTsC,UAAU;QACV3C,OAAO;IACT;AACF;AAOO,mCAAmC,CAAC6C;IACzC;IAEA,MAAMC,aAAajD;IACnB,MAAMkD,gBAAgBpC;IACtB,MAAMqC,2BAA2BjC;IACjC,MAAMkC,sBAAsBjC;IAC5B,MAAMkC,mBAAmBT;IAEzB,MAAM,EAAEU,SAAS,EAAEC,kBAAkB,EAAEC,oBAAoB,EAAEC,eAAe,EAAE,GAAGT;IAEjF,OAAO;QACLrD,UAAMH,mBAAAA,EACJE,mBAAmBC,IAAI,EACvBsD,WAAWhD,IAAI,EACfgD,WAAW7C,SAAS,EACpB,CAACoD,wBAAwBP,WAAWxC,qBAAqB,EACzD8C,sBAAsBC,wBAAwB,CAACC,mBAAmBR,WAAWtC,yBAAyB,EACtG4C,sBAAsB,CAACC,wBAAwBC,mBAAmBR,WAAWrC,mCAAmC,EAChH2C,sBACEC,wBACAC,mBACAR,WAAWpC,4CAA4C,EACzDyC;QAEF1D,aAASJ,mBAAAA,EAAaE,mBAAmBE,OAAO,EAAEsD,cAAcjD,IAAI;QACpEH,wBAAoBN,mBAAAA,EAAaE,mBAAmBI,kBAAkB,EAAEqD,yBAAyBlD,IAAI;QACrGJ,mBAAeL,mBAAAA,EAAaE,mBAAmBG,aAAa,EAAEuD,oBAAoBnD,IAAI;QACtFF,gBAAYP,mBAAAA,EAAaE,mBAAmBK,UAAU,EAAEsD,iBAAiBpD,IAAI;IAC/E;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCalendarDayStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';\n/**\n * @internal\n */ export const calendarDayClassNames = {\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};\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});\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%'\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});\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex'\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 '&: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});\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\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 * @internal\n *\n * Apply styling to the CalendarDay slots based on the state\n */ export const useCalendarDayStyles_unstable = (props)=>{\n 'use no memo';\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 const { className, headerIsClickable, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarDayClassNames.root, rootStyles.normalize, rootStyles.base, showWeekNumbers && rootStyles.showWeekNumbers, className),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base, monthAndYearStyles.animation, headerIsClickable && monthAndYearStyles.headerIsClickable),\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","__styles","mergeClasses","shorthands","DURATION_2","EASING_FUNCTION_2","FADE_IN","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","B7ck84d","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","a9b677","normalize","E5pizo","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","showWeekNumbers","d","p","useHeaderStyles","mc9l5x","Bqenvij","Bg96gwp","qhf8xq","useMonthAndYearStyles","Bt984gj","De3pzq","icvyot","vrafjx","oivjwe","wvpqe5","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","sj55zd","Bh6795r","Bahqtrf","Be2twd7","Bhrd7zp","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","ygn44y","Huce71","animation","vin17d","Bf5fcs","Bv12yb3","Ezkn3b","headerIsClickable","Jwef8y","Bi91k9c","eoavqd","pugfm4","ukgb2i","Dwtyhm","Biisq0s","iro3zm","B2d53fq","c3iz72","mghro0","Bx68yb","syojd9","E5hylx","k","h","useMonthComponentsStyles","qb2dma","useHeaderIconButtonStyles","useDisabledStyleStyles","Bg33ivm","t69wg0","Bnh7jwd","m","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAMKO,qBAAqB;;;IA2HrBoF,6BAA6B;;;;uBA/HO,gBAAgB;AAI1D,8BAA8B;IACrCnF,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE,yBAAyB;IACjCC,YAAY,EAAE,+BAA+B;IAC7CC,eAAe,EAAE,kCAAkC;IACnDC,gBAAgB,EAAE,mCAAmC;IACrDC,aAAa,EAAE;AAC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F,IAAI,MAAEN,mBAAY,EAACK,qBAAqB,CAACC,IAAI,EAAEqF,UAAU,CAACtE,SAAS,EAAEsE,UAAU,CAAC9E,IAAI,EAAEe,eAAe,IAAI+D,UAAU,CAAC/D,eAAe,EAAEqE,SAAS,CAAC;QAC/I1F,MAAM,MAAEP,mBAAY,EAACK,qBAAqB,CAACE,MAAM,EAAEqF,YAAY,CAAC/E,IAAI,CAAC;QACrEL,YAAY,MAAER,mBAAY,EAACK,qBAAqB,CAACG,YAAY,EAAEqF,kBAAkB,CAAChF,IAAI,EAAEgF,kBAAkB,CAAClC,SAAS,EAAEK,iBAAiB,IAAI6B,kBAAkB,CAAC7B,iBAAiB,CAAC;QAChLvD,eAAe,MAAET,mBAAY,EAACK,qBAAqB,CAACI,eAAe,EAAEqF,qBAAqB,CAACjF,IAAI,CAAC;QAChGH,gBAAgB,MAAEV,mBAAY,EAACK,qBAAqB,CAACK,gBAAgB,EAAEqF,sBAAsB,CAAClF,IAAI,CAAC;QACnGF,aAAa,MAAEX,mBAAY,EAACK,qBAAqB,CAACM,aAAa,EAAEqF,mBAAmB,CAACnF,IAAI;IAC7F,CAAC;AACL,CAAC"}
|
|
1
|
+
{"version":3,"sources":["useCalendarDayStyles.styles.js"],"sourcesContent":["'use client';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { DURATION_2, EASING_FUNCTION_2, FADE_IN } from '../../utils/animations';\n/**\n * @internal\n */ export const calendarDayClassNames = {\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};\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});\nconst useHeaderStyles = makeStyles({\n base: {\n display: 'inline-flex',\n height: '28px',\n lineHeight: '44px',\n position: 'relative',\n width: '100%'\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});\nconst useMonthComponentsStyles = makeStyles({\n base: {\n alignSelf: 'flex-end',\n display: 'inline-flex'\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 '&: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});\nconst useDisabledStyleStyles = makeStyles({\n base: {\n '&, &:disabled, & button': {\n color: tokens.colorNeutralForegroundDisabled,\n pointerEvents: 'none',\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 * Apply styling to the CalendarDay slots based on the state\n *\n * @internal\n */ export const useCalendarDayStyles_unstable = (props)=>{\n 'use no memo';\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 const { className, headerIsClickable, showWeekNumbers } = props;\n return {\n root: mergeClasses(calendarDayClassNames.root, rootStyles.normalize, rootStyles.base, showWeekNumbers && rootStyles.showWeekNumbers, className),\n header: mergeClasses(calendarDayClassNames.header, headerStyles.base),\n monthAndYear: mergeClasses(calendarDayClassNames.monthAndYear, monthAndYearStyles.base, monthAndYearStyles.animation, headerIsClickable && monthAndYearStyles.headerIsClickable),\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","__styles","mergeClasses","shorthands","DURATION_2","EASING_FUNCTION_2","FADE_IN","calendarDayClassNames","root","header","monthAndYear","monthComponents","headerIconButton","disabledStyle","useRootStyles","base","B7ck84d","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","a9b677","normalize","E5pizo","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","showWeekNumbers","d","p","useHeaderStyles","mc9l5x","Bqenvij","Bg96gwp","qhf8xq","useMonthAndYearStyles","Bt984gj","De3pzq","icvyot","vrafjx","oivjwe","wvpqe5","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","sj55zd","Bh6795r","Bahqtrf","Be2twd7","Bhrd7zp","B68tc82","Bmxbyg5","Bpg54ce","fsow6f","ygn44y","Huce71","animation","vin17d","Bf5fcs","Bv12yb3","Ezkn3b","headerIsClickable","Jwef8y","Bi91k9c","eoavqd","pugfm4","ukgb2i","Dwtyhm","Biisq0s","iro3zm","B2d53fq","c3iz72","mghro0","Bx68yb","syojd9","E5hylx","k","h","useMonthComponentsStyles","qb2dma","useHeaderIconButtonStyles","useDisabledStyleStyles","Bg33ivm","t69wg0","Bnh7jwd","m","useCalendarDayStyles_unstable","props","rootStyles","headerStyles","monthAndYearStyles","monthComponentsStyles","headerIconButtonStyles","disabledStyleStyles","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAMKO,qBAAqB;;;IA2HrBoF,6BAA6B;;;;uBA/HO,gBAAgB;AAI1D,8BAA8B;IACrCnF,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE,yBAAyB;IACjCC,YAAY,EAAE,+BAA+B;IAC7CC,eAAe,EAAE,kCAAkC;IACnDC,gBAAgB,EAAE,mCAAmC;IACrDC,aAAa,EAAE;AACnB,CAAC;AACD,MAAMC,aAAa,GAAA,WAAA,OAAGb,eAAA,EAAA;IAAAc,IAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAC,SAAA,EAAA;QAAAC,MAAA,EAAA;QAAAR,OAAA,EAAA;QAAAS,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA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BAAkB,CAAClC,SAAS,EAAEK,iBAAiB,IAAI6B,kBAAkB,CAAC7B,iBAAiB,CAAC;QAChLvD,eAAe,MAAET,mBAAY,EAACK,qBAAqB,CAACI,eAAe,EAAEqF,qBAAqB,CAACjF,IAAI,CAAC;QAChGH,gBAAgB,MAAEV,mBAAY,EAACK,qBAAqB,CAACK,gBAAgB,EAAEqF,sBAAsB,CAAClF,IAAI,CAAC;QACnGF,aAAa,MAAEX,mBAAY,EAACK,qBAAqB,CAACM,aAAa,EAAEqF,mBAAmB,CAACnF,IAAI;IAC7F,CAAC;AACL,CAAC"}
|
|
@@ -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 // 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 *
|
|
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 * Apply styling to the CalendarDay slots based on the state\n *\n * @internal\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,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,SAAS;QACT2B,WAAW;QACXC,cAAc;QACdC,YAAY;IACd;IACAC,WAAW;QACTC,mBAAmB5C,sBAAAA;QACnB6C,mBAAmB;QACnBC,eAAe5C,mBAAAA;QACf6C,yBAAyB9C,6BA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,2BAA2B;YACzBoB,OAAOnC,kBAAAA,CAAOkE,8BAA8B;YAC5CC,eAAe;YAEf,qGAAqG;YACrG,kCAAkC;gBAChChC,OAAO;YACT;QACF;IACF;AACF;AAOO,sCAAsC,CAACkC;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"}
|
|
@@ -120,7 +120,7 @@ const CalendarDayGrid = (props)=>{
|
|
|
120
120
|
getRefsFromDayInfos
|
|
121
121
|
};
|
|
122
122
|
const arrowNavigationAttributes = (0, _reacttabster.useArrowNavigationGroup)({
|
|
123
|
-
axis: 'grid'
|
|
123
|
+
axis: 'grid-linear'
|
|
124
124
|
});
|
|
125
125
|
return /*#__PURE__*/ _react.createElement("table", {
|
|
126
126
|
className: (0, _react1.mergeClasses)(classNames.table, props.className),
|
|
@@ -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 // 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,OAAO;QAACJ;QAASE;KAAkB;AACrC;AAEA,SAASI,oBAAoBC,KAAkB;IAC7C,MAAMC,2BAA2BtB,OAAMe,MAAM,CAAmBQ;IAChEvB,OAAMwB,SAAS,CAAC;QACdF,yBAAyBH,OAAO,GAAGE,KAAK,CAAC,EAAE,CAAC,EAAE,CAACI,YAAY;IAC7D;IACA,MAAMC,wBAAwBJ,yBAAyBH,OAAO;IAE9D,IAAI,CAACO,yBAAyBA,sBAAsBC,OAAO,OAAON,KAAK,CAAC,EAAE,CAAC,EAAE,CAACI,YAAY,CAACE,OAAO,IAAI;QACpG,OAAOJ;IACT,OAAO,IAAIG,yBAAyBL,KAAK,CAAC,EAAE,CAAC,EAAE,CAACI,YAAY,EAAE;QAC5D,OAAO;IACT,OAAO;QACL,OAAO;IACT;AACF;AAEO,wBAAuEI,CAAAA;IAC5E,MAAMC,kBAAkB9B,OAAMe,MAAM,CAClC;IAIF,MAAMgB,yBAAqB7B,qBAAAA;IAE3B,MAAM8B,eAAe,CAACC;YAWpBJ,qBACAA;QAXA,M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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-linear' });\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;IAChEvB,OAAMwB,SAAS,CAAC;QACdF,yBAAyBH,OAAO,GAAGE,KAAK,CAAC,EAAE,CAAC,EAAE,CAACI,YAAY;IAC7D;IACA,MAAMC,wBAAwBJ,yBAAyBH,OAAO;IAE9D,IAAI,CAACO,yBAAyBA,sBAAsBC,OAAO,OAAON,KAAK,CAAC,EAAE,CAAC,EAAE,CAACI,YAAY,CAACE,OAAO,IAAI;QACpG,OAAOJ;IACT,OAAO,IAAIG,yBAAyBL,KAAK,CAAC,EAAE,CAAC,EAAE,CAACI,YAAY,EAAE;QAC5D,OAAO;IACT,OAAO;QACL,OAAO;IACT;AACF;AAEO,wBAAuEI,CAAAA;IAC5E,MA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