@elliemae/ds-form-date-time-picker 3.80.0-next.8 → 3.80.0-next.81
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/dist/cjs/config/useControlledDateTimePicker.js +14 -1
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useGlobalKeyHandlers.js +9 -2
- package/dist/cjs/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/cjs/constants/index.js +15 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/parts/ClearButton/ClearButton.js +3 -1
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/cjs/parts/ClearButton/useClearButton.js +4 -2
- package/dist/cjs/parts/ClearButton/useClearButton.js.map +2 -2
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +20 -6
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js +4 -2
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +12 -8
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/cjs/parts/DateInputs/MMInput.js +4 -2
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +4 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/useDateInputs.js +2 -1
- package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +18 -14
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +6 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js +27 -22
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Day.js +4 -3
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +18 -5
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +12 -3
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +6 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/PickersIcons.js +2 -1
- package/dist/cjs/parts/Pickers/PickersIcons.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +8 -7
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +11 -9
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +8 -7
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +18 -5
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +6 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +4 -3
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Styleds.js +19 -40
- package/dist/cjs/parts/Styleds.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +12 -11
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js +2 -1
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +6 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/slot-arguments-polymorphic-typescript.js.map +1 -1
- package/dist/cjs/typescript-testing/slot-props.js +73 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +2 -2
- package/dist/esm/config/useControlledDateTimePicker.js +14 -1
- package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/esm/config/useGlobalKeyHandlers.js +9 -2
- package/dist/esm/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/esm/constants/index.js +15 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/parts/ClearButton/ClearButton.js +3 -1
- package/dist/esm/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/esm/parts/ClearButton/useClearButton.js +4 -2
- package/dist/esm/parts/ClearButton/useClearButton.js.map +2 -2
- package/dist/esm/parts/ControlledDateTimePickerContent.js +20 -6
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js +4 -2
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/DateInputs.js +12 -8
- package/dist/esm/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js +4 -2
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +4 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/useDateInputs.js +2 -1
- package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js +18 -14
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +6 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js +27 -22
- package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +4 -3
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +24 -7
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +12 -3
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +6 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/PickersIcons.js +2 -1
- package/dist/esm/parts/Pickers/PickersIcons.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +8 -7
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +11 -9
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +8 -7
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +24 -7
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +6 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +4 -3
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +2 -2
- package/dist/esm/parts/Styleds.js +25 -42
- package/dist/esm/parts/Styleds.js.map +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js +4 -2
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +4 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +4 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/TimeInputs.js +12 -11
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/esm/parts/TimeInputs/useTimeInputs.js +2 -1
- package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +6 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +73 -0
- package/dist/esm/typescript-testing/slot-props.js.map +2 -2
- package/dist/types/config/useControlledDateTimePicker.d.ts +2 -0
- package/dist/types/config/useGlobalKeyHandlers.d.ts +3 -1
- package/dist/types/constants/index.d.ts +48 -0
- package/dist/types/parts/DateInputs/DDInput.d.ts +2 -1
- package/dist/types/parts/DateInputs/MMInput.d.ts +2 -1
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +2 -1
- package/dist/types/parts/Styleds.d.ts +8 -11
- package/dist/types/parts/TimeInputs/HHInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +2 -1
- package/dist/types/slot-arguments-polymorphic-typescript.d.ts +18 -2
- package/package.json +12 -12
|
@@ -48,7 +48,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
48
48
|
const {
|
|
49
49
|
handleChangeComposedDateString,
|
|
50
50
|
getProps,
|
|
51
|
-
props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },
|
|
51
|
+
props: { preventCloseOnSelection, disabled, readOnly, applyAriaDisabled, lastElementRef },
|
|
52
52
|
appOnMonthChange,
|
|
53
53
|
appOnDayChange,
|
|
54
54
|
appOnYearChange,
|
|
@@ -86,7 +86,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
86
86
|
const handleOnDayClick = (0, import_react.useCallback)(
|
|
87
87
|
(e) => {
|
|
88
88
|
handleFocusMetaDayByDay(day);
|
|
89
|
-
if (!isDisabled && !isOutOfRange && !readOnly && !applyAriaDisabled) {
|
|
89
|
+
if (!isDisabled && !isOutOfRange && !disabled && !readOnly && !applyAriaDisabled) {
|
|
90
90
|
const newDateString = (0, import_dateHelpers.getDateStringFromDay)(day);
|
|
91
91
|
const metaInfo = { ...import_constants2.defaultMetaInfo, newDateString };
|
|
92
92
|
const { month, day: dayNumber, year } = (0, import_dateHelpers.getDateValuesFromDate)(day);
|
|
@@ -103,6 +103,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
103
103
|
day,
|
|
104
104
|
isDisabled,
|
|
105
105
|
isOutOfRange,
|
|
106
|
+
disabled,
|
|
106
107
|
readOnly,
|
|
107
108
|
applyAriaDisabled,
|
|
108
109
|
appOnMonthChange,
|
|
@@ -167,7 +168,7 @@ const Day = ({ metaDay, colIndex, isInvisible }) => {
|
|
|
167
168
|
$readOnlyStyles: readOnly || applyAriaDisabled,
|
|
168
169
|
"aria-pressed": isSelected || isStartRangeDay || isDayInRange || isEndRangeDay ? "true" : "false",
|
|
169
170
|
"aria-label": dayAriaLabel,
|
|
170
|
-
"aria-disabled": isOutOfRange || isDisabled || readOnly || applyAriaDisabled,
|
|
171
|
+
"aria-disabled": isOutOfRange || isDisabled || readOnly || applyAriaDisabled ? true : void 0,
|
|
171
172
|
"aria-hidden": !!isInvisible,
|
|
172
173
|
buttonType: "raw",
|
|
173
174
|
size: "m",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/Day.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport { compareTwoDatesDayEquality, getDateStringFromDay, getDateValuesFromDate } from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\nimport { useGetDayFlags } from './useGetDayFlags.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerT.MetaMonthDay;\n colIndex?: number;\n isInvisible?: boolean;\n}\nconst displayNone = { display: 'none' };\n\nexport const Day = ({ metaDay, colIndex, isInvisible }: CalendarDayPropsT): JSX.Element => {\n const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;\n const {\n handleChangeComposedDateString,\n getProps,\n props: { preventCloseOnSelection, readOnly, applyAriaDisabled, lastElementRef },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n isControllerOnly,\n } = useContext(ControlledDateTimePickerContext);\n\n const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } =\n useContext(CalendarContext);\n const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;\n /*\n * PUI-18077 https://jira.elliemae.io/browse/PUI-18077\n *\n * Fallback logic that mirrors the behavior in:\n * ./useKeyboardHandlers.tsx (tryToFocusDayRegion)\n *\n * When opening the calendar without an explicit focusedDay, this ensures that\n * in controller-only mode, Shift+Tab from the first focusable element focuses\n * the first current-month day instead of the previous month button.\n *\n * Once focusedDay is established, this fallback is no longer used.\n */\n const firstCurrMonthDay = useMemo(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);\n const isFirstCurrMonthFallback = useMemo(() => {\n if (!isControllerOnly) return false;\n if (focusedDay?.day) return false;\n if (!firstCurrMonthDay?.day) return false;\n return compareTwoDatesDayEquality(day, firstCurrMonthDay.day);\n }, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);\n\n // the following flags are useful to be able to condition aria-* attributes via slots\n // for example, the date-range-picker can chose to apply different aria-labels to the buttons based on these flags.\n const dayFlags = useGetDayFlags({ metaDay, isFirstCurrMonthFallback });\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n const {\n isSelected,\n isFocused,\n isDisabled,\n isOutOfRange,\n isStartRangeDay,\n isEndRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n } = dayFlags;\n const ownerPropsArguments = React.useRef({ ...dayFlags, metaDay });\n ownerPropsArguments.current = { ...dayFlags, metaDay };\n const getOwnerPropsArguments = React.useCallback(() => ownerPropsArguments.current, []);\n\n const handleOnDayClick = useCallback(\n (e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent) => {\n handleFocusMetaDayByDay(day);\n if (!isDisabled && !isOutOfRange && !readOnly && !applyAriaDisabled) {\n const newDateString = getDateStringFromDay(day);\n const metaInfo = { ...defaultMetaInfo, newDateString };\n const { month, day: dayNumber, year } = getDateValuesFromDate(day);\n appOnMonthChange(`${month + 1}`, e, metaInfo);\n if (dayNumber) appOnDayChange(`${dayNumber}`, e, metaInfo);\n appOnYearChange(`${year}`, e, metaInfo);\n handleChangeComposedDateString(newDateString, metaInfo);\n trackFocusCalendarMetafocusedDay();\n if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();\n }\n },\n [\n handleFocusMetaDayByDay,\n day,\n isDisabled,\n isOutOfRange,\n readOnly,\n applyAriaDisabled,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n handleChangeComposedDateString,\n trackFocusCalendarMetafocusedDay,\n isWithTimeWheelToo,\n preventCloseOnSelection,\n closeCalendar,\n ],\n );\n\n const handleInnerRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n window.requestAnimationFrame(() => {\n dayBtnRef.current = ButtonDomNode;\n if (isFocused) ButtonDomNode?.focus?.();\n /**\n * PUI-17922 https://jira.elliemae.io/browse/PUI-17922\n *\n * This allows consumers to plug this calendar into an external\n * focus trap by exposing the last focusable element through\n * `lastElementRef`.\n *\n * In the currently known scenarios (DSDataTable filters) that\n * last element is the day that is focused in the calendar when\n * the component is used in `controller-only` mode.\n *\n * Since this is a targeted bug fix, it is only applied for this\n * case for now (YAGNI). In the future we should review, for each\n * component configuration, which element should really be exposed\n * as `lastElementRef`.\n */\n if (lastElementRef && isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback)) {\n lastElementRef.current = ButtonDomNode;\n }\n });\n },\n [dayBtnRef, lastElementRef, isFocused, isFocusedMetaDay, isControllerOnly, isFirstCurrMonthFallback],\n );\n\n const handleOnDayFocus = useCallback(() => {\n trackFocusCalendarMetafocusedDay();\n }, [trackFocusCalendarMetafocusedDay]);\n\n const dayClassModifiers = useMemo(\n () =>\n `dayWrapper ${isSelected ? 'selectedDay ' : ''}${isDisabled ? 'disabledDay ' : ''}${\n isOutOfRange ? 'outOfRangeDay ' : ''\n }${isFocused ? 'focusedDay ' : ''}${isStartRangeDay ? 'startRangeDay ' : ''}${\n isDayInRangeImproper ? 'inRangeImproperDay ' : ''\n }${isDayInRange ? 'inRangeDay ' : ''}${isEndRangeDay ? 'endRangeDay ' : ''}${\n isCurrMonthDay ? '' : 'notCurrentMonth'\n }\n ${readOnly || applyAriaDisabled ? 'readOnly' : ''}`,\n [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\n readOnly,\n applyAriaDisabled,\n ],\n );\n\n let dataTestid: (typeof ControlledDateTimePickerDatatestid)['CALENDAR'][keyof (typeof ControlledDateTimePickerDatatestid)['CALENDAR']] =\n ControlledDateTimePickerDatatestid.CALENDAR.DAY;\n\n if (isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;\n if (isFocused) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;\n if (isFocused && isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;\n if (isStartRangeDay) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isEndRangeDay) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\n if (isDayInRange) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;\n\n return (\n <div\n className={dayClassModifiers}\n style={isHidden ? displayNone : undefined}\n role=\"gridcell\"\n {...(Number.isInteger(colIndex) && { 'aria-colindex': colIndex })}\n >\n <StyledDayBtn\n $readOnlyStyles={readOnly || applyAriaDisabled}\n aria-pressed={isSelected || isStartRangeDay || isDayInRange || isEndRangeDay ? 'true' : 'false'}\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled}\n /**\n * applyAriaDisabled is intentionally NOT passed here.\n *\n * DSButtonV2 with applyAriaDisabled suppresses the click event before onClick\n * fires. This prevents handleFocusMetaDayByDay from running, so focusedDay never\n * updates and the focus ring never appears \u2014 while keyboard navigation silently\n * anchors to the clicked position, causing offset arrow behavior.\n *\n * readOnly and applyAriaDisabled must produce the same click UX on day buttons:\n * focus moves (ring shows), value does not change. The value-change guard in\n * handleOnDayClick already covers both (!readOnly && !applyAriaDisabled).\n * aria-disabled above is already set explicitly, so AT state is unaffected.\n */\n aria-hidden={!!isInvisible}\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleOnDayClick} // DSButton triggers this with \"spacebar\" and \"enter\" too...\n onFocus={handleOnDayFocus}\n onKeyDown={(e: React.KeyboardEvent<Element>) => {\n handleDayOnKeyDown(e, metaDay);\n }}\n innerRef={handleInnerRef}\n /**\n * PUI-17432 https://jira.elliemae.io/browse/PUI-17432\n *\n * We tried to avoid this in PUI-17922 by adding `lastElementRef`.\n * That works when the last element is focused programmatically by useFocusTrap logic,\n * but when going through the calendar and the last element is within another\n * component, on Shift+Tab the focus goes to the next month instead of the\n * last focused or selected day.\n *\n * This ensures that when using controller-only mode, focus moves back to the\n * last focused day.\n */\n tabIndex={isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1}\n data-isfocused={isFocused}\n data-testid={dataTestid}\n type=\"button\"\n getOwnerProps={getProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { DSControlledDateTimePickerT } from '../../../react-desc-prop-types.js';\nimport { defaultMetaInfo, weekDays } from '../../../utils/constants.js';\nimport { compareTwoDatesDayEquality, getDateStringFromDay, getDateValuesFromDate } from '../../../utils/dateHelpers.js';\nimport { getAriaDayFromDateString } from '../../../utils/stringHelpers.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledDayBtn } from './Styleds.js';\nimport { useGetDayFlags } from './useGetDayFlags.js';\n\ninterface CalendarDayPropsT {\n metaDay: DSControlledDateTimePickerT.MetaMonthDay;\n colIndex?: number;\n isInvisible?: boolean;\n}\nconst displayNone = { display: 'none' };\n\nexport const Day = ({ metaDay, colIndex, isInvisible }: CalendarDayPropsT): JSX.Element => {\n const { day, isCurrMonthDay, isHidden, dayBtnRef, dayAsString } = metaDay;\n const {\n handleChangeComposedDateString,\n getProps,\n props: { preventCloseOnSelection, disabled, readOnly, applyAriaDisabled, lastElementRef },\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n isControllerOnly,\n } = useContext(ControlledDateTimePickerContext);\n\n const { focusedDay, daysArray, handleDayOnKeyDown, handleFocusMetaDayByDay, closeCalendar } =\n useContext(CalendarContext);\n const isFocusedMetaDay = focusedDay?.day ? compareTwoDatesDayEquality(metaDay?.day, focusedDay?.day) : false;\n /*\n * PUI-18077 https://jira.elliemae.io/browse/PUI-18077\n *\n * Fallback logic that mirrors the behavior in:\n * ./useKeyboardHandlers.tsx (tryToFocusDayRegion)\n *\n * When opening the calendar without an explicit focusedDay, this ensures that\n * in controller-only mode, Shift+Tab from the first focusable element focuses\n * the first current-month day instead of the previous month button.\n *\n * Once focusedDay is established, this fallback is no longer used.\n */\n const firstCurrMonthDay = useMemo(() => daysArray.find((metaMonthDay) => metaMonthDay.isCurrMonthDay), [daysArray]);\n const isFirstCurrMonthFallback = useMemo(() => {\n if (!isControllerOnly) return false;\n if (focusedDay?.day) return false;\n if (!firstCurrMonthDay?.day) return false;\n return compareTwoDatesDayEquality(day, firstCurrMonthDay.day);\n }, [isControllerOnly, focusedDay?.day, firstCurrMonthDay?.day, day]);\n\n // the following flags are useful to be able to condition aria-* attributes via slots\n // for example, the date-range-picker can chose to apply different aria-labels to the buttons based on these flags.\n const dayFlags = useGetDayFlags({ metaDay, isFirstCurrMonthFallback });\n const dayAriaLabel = useMemo(\n () => `${getAriaDayFromDateString(dayAsString)}, ${weekDays[metaDay.day.getDay()]}`,\n [dayAsString, metaDay],\n );\n const {\n isSelected,\n isFocused,\n isDisabled,\n isOutOfRange,\n isStartRangeDay,\n isEndRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n } = dayFlags;\n const ownerPropsArguments = React.useRef({ ...dayFlags, metaDay });\n ownerPropsArguments.current = { ...dayFlags, metaDay };\n const getOwnerPropsArguments = React.useCallback(() => ownerPropsArguments.current, []);\n\n const handleOnDayClick = useCallback(\n (e: DSControlledDateTimePickerT.OnInternalValuesChangeEvent) => {\n handleFocusMetaDayByDay(day);\n if (!isDisabled && !isOutOfRange && !disabled && !readOnly && !applyAriaDisabled) {\n const newDateString = getDateStringFromDay(day);\n const metaInfo = { ...defaultMetaInfo, newDateString };\n const { month, day: dayNumber, year } = getDateValuesFromDate(day);\n appOnMonthChange(`${month + 1}`, e, metaInfo);\n if (dayNumber) appOnDayChange(`${dayNumber}`, e, metaInfo);\n appOnYearChange(`${year}`, e, metaInfo);\n handleChangeComposedDateString(newDateString, metaInfo);\n trackFocusCalendarMetafocusedDay();\n if (!isWithTimeWheelToo && !preventCloseOnSelection) closeCalendar();\n }\n },\n [\n handleFocusMetaDayByDay,\n day,\n isDisabled,\n isOutOfRange,\n disabled,\n readOnly,\n applyAriaDisabled,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n handleChangeComposedDateString,\n trackFocusCalendarMetafocusedDay,\n isWithTimeWheelToo,\n preventCloseOnSelection,\n closeCalendar,\n ],\n );\n\n const handleInnerRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n window.requestAnimationFrame(() => {\n dayBtnRef.current = ButtonDomNode;\n if (isFocused) ButtonDomNode?.focus?.();\n /**\n * PUI-17922 https://jira.elliemae.io/browse/PUI-17922\n *\n * This allows consumers to plug this calendar into an external\n * focus trap by exposing the last focusable element through\n * `lastElementRef`.\n *\n * In the currently known scenarios (DSDataTable filters) that\n * last element is the day that is focused in the calendar when\n * the component is used in `controller-only` mode.\n *\n * Since this is a targeted bug fix, it is only applied for this\n * case for now (YAGNI). In the future we should review, for each\n * component configuration, which element should really be exposed\n * as `lastElementRef`.\n */\n if (lastElementRef && isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback)) {\n lastElementRef.current = ButtonDomNode;\n }\n });\n },\n [dayBtnRef, lastElementRef, isFocused, isFocusedMetaDay, isControllerOnly, isFirstCurrMonthFallback],\n );\n\n const handleOnDayFocus = useCallback(() => {\n trackFocusCalendarMetafocusedDay();\n }, [trackFocusCalendarMetafocusedDay]);\n\n const dayClassModifiers = useMemo(\n () =>\n `dayWrapper ${isSelected ? 'selectedDay ' : ''}${isDisabled ? 'disabledDay ' : ''}${\n isOutOfRange ? 'outOfRangeDay ' : ''\n }${isFocused ? 'focusedDay ' : ''}${isStartRangeDay ? 'startRangeDay ' : ''}${\n isDayInRangeImproper ? 'inRangeImproperDay ' : ''\n }${isDayInRange ? 'inRangeDay ' : ''}${isEndRangeDay ? 'endRangeDay ' : ''}${\n isCurrMonthDay ? '' : 'notCurrentMonth'\n }\n ${readOnly || applyAriaDisabled ? 'readOnly' : ''}`,\n [\n isSelected,\n isDisabled,\n isOutOfRange,\n isFocused,\n isStartRangeDay,\n isDayInRangeImproper,\n isDayInRange,\n isEndRangeDay,\n isCurrMonthDay,\n readOnly,\n applyAriaDisabled,\n ],\n );\n\n let dataTestid: (typeof ControlledDateTimePickerDatatestid)['CALENDAR'][keyof (typeof ControlledDateTimePickerDatatestid)['CALENDAR']] =\n ControlledDateTimePickerDatatestid.CALENDAR.DAY;\n\n if (isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY;\n if (isFocused) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY;\n if (isFocused && isSelected) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY;\n if (isStartRangeDay) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY;\n if (isEndRangeDay) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY;\n if (isDayInRange) dataTestid = ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY;\n\n return (\n <div\n className={dayClassModifiers}\n style={isHidden ? displayNone : undefined}\n role=\"gridcell\"\n {...(Number.isInteger(colIndex) && { 'aria-colindex': colIndex })}\n >\n <StyledDayBtn\n $readOnlyStyles={readOnly || applyAriaDisabled}\n aria-pressed={isSelected || isStartRangeDay || isDayInRange || isEndRangeDay ? 'true' : 'false'}\n aria-label={dayAriaLabel}\n aria-disabled={isOutOfRange || isDisabled || readOnly || applyAriaDisabled ? true : undefined}\n /**\n * applyAriaDisabled is intentionally NOT passed here.\n *\n * DSButtonV2 with applyAriaDisabled suppresses the click event before onClick\n * fires. This prevents handleFocusMetaDayByDay from running, so focusedDay never\n * updates and the focus ring never appears \u2014 while keyboard navigation silently\n * anchors to the clicked position, causing offset arrow behavior.\n *\n * readOnly and applyAriaDisabled must produce the same click UX on day buttons:\n * focus moves (ring shows), value does not change. The value-change guard in\n * handleOnDayClick already covers both (!readOnly && !applyAriaDisabled).\n * aria-disabled above is already set explicitly, so AT state is unaffected.\n */\n aria-hidden={!!isInvisible}\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleOnDayClick} // DSButton triggers this with \"spacebar\" and \"enter\" too...\n onFocus={handleOnDayFocus}\n onKeyDown={(e: React.KeyboardEvent<Element>) => {\n handleDayOnKeyDown(e, metaDay);\n }}\n innerRef={handleInnerRef}\n /**\n * PUI-17432 https://jira.elliemae.io/browse/PUI-17432\n *\n * We tried to avoid this in PUI-17922 by adding `lastElementRef`.\n * That works when the last element is focused programmatically by useFocusTrap logic,\n * but when going through the calendar and the last element is within another\n * component, on Shift+Tab the focus goes to the next month instead of the\n * last focused or selected day.\n *\n * This ensures that when using controller-only mode, focus moves back to the\n * last focused day.\n */\n tabIndex={isControllerOnly && (isFocusedMetaDay || isFirstCurrMonthFallback) ? 0 : -1}\n data-isfocused={isFocused}\n data-testid={dataTestid}\n type=\"button\"\n getOwnerProps={getProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {`${day.getDate()}`}\n </StyledDayBtn>\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4LjB;AAzLN,mBAAwD;AACxD,uBAAmD;AACnD,yCAAgD;AAEhD,IAAAA,oBAA0C;AAC1C,yBAAwF;AACxF,2BAAyC;AACzC,6BAAgC;AAChC,qBAA6B;AAC7B,4B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,UACT,WAAW,CAAC,MAAoC;AAC9C,+BAAmB,GAAG,OAAO;AAAA,UAC/B;AAAA,UACA,UAAU;AAAA,UAaV,UAAU,qBAAqB,oBAAoB,4BAA4B,IAAI;AAAA,UACnF,kBAAgB;AAAA,UAChB,eAAa;AAAA,UACb,MAAK;AAAA,UACL,eAAe;AAAA,UACf;AAAA,UAEC,aAAG,IAAI,QAAQ,CAAC;AAAA;AAAA,MACnB;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": ["import_constants", "React"]
|
|
7
7
|
}
|
|
@@ -97,13 +97,19 @@ const StyledShadowWrapper = (0, import_ds_system.styled)("div", {
|
|
|
97
97
|
name: import_constants.DSControlledDateTimePickerName,
|
|
98
98
|
slot: import_constants.DSControlledDateTimePickerSlots.CONTROLLER_COMPONENT.CALENDAR
|
|
99
99
|
})``;
|
|
100
|
-
const StyledCalendarWrapper = import_ds_system.styled
|
|
100
|
+
const StyledCalendarWrapper = (0, import_ds_system.styled)("div", {
|
|
101
|
+
name: import_constants.DSControlledDateTimePickerName,
|
|
102
|
+
slot: import_constants.FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_WRAPPER
|
|
103
|
+
})`
|
|
101
104
|
display: grid;
|
|
102
105
|
min-width: 260px;
|
|
103
106
|
background-color: ${({ theme, $readOnlyStyles }) => $readOnlyStyles ? theme.colors.neutral["050"] : theme.colors.neutral["000"]};
|
|
104
107
|
grid-template-rows: auto auto;
|
|
105
108
|
`;
|
|
106
|
-
const StyledHeader = import_ds_system.styled
|
|
109
|
+
const StyledHeader = (0, import_ds_system.styled)("section", {
|
|
110
|
+
name: import_constants.DSControlledDateTimePickerName,
|
|
111
|
+
slot: import_constants.FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER
|
|
112
|
+
})`
|
|
107
113
|
* {
|
|
108
114
|
margin: 0;
|
|
109
115
|
padding: 0;
|
|
@@ -148,7 +154,10 @@ const StyledHeaderButton = (0, import_ds_system.styled)(import_ds_button_v2.DSBu
|
|
|
148
154
|
background: ${({ theme }) => theme.colors.brand[200]};
|
|
149
155
|
}
|
|
150
156
|
`;
|
|
151
|
-
const StyledBody = import_ds_system.styled
|
|
157
|
+
const StyledBody = (0, import_ds_system.styled)("section", {
|
|
158
|
+
name: import_constants.DSControlledDateTimePickerName,
|
|
159
|
+
slot: import_constants.FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_BODY
|
|
160
|
+
})`
|
|
152
161
|
padding: ${({ theme }) => theme.space.xxxs};
|
|
153
162
|
`;
|
|
154
163
|
const StyledDayBtn = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2, {
|
|
@@ -164,7 +173,8 @@ const StyledDayBtn = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2
|
|
|
164
173
|
border-color: transparent;
|
|
165
174
|
line-height: 1;
|
|
166
175
|
color: ${({ theme }) => theme.colors.neutral[800]};
|
|
167
|
-
cursor:
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
${({ $readOnlyStyles }) => $readOnlyStyles && import_ds_system.ariaDisabledInteractionCss}
|
|
168
178
|
display: flex;
|
|
169
179
|
justify-content: center;
|
|
170
180
|
align-items: center;
|
|
@@ -537,7 +547,10 @@ const StyledWeekDaysListWrapper = (0, import_ds_system.styled)(import_ds_grid.Gr
|
|
|
537
547
|
box-shadow: none;
|
|
538
548
|
}
|
|
539
549
|
`;
|
|
540
|
-
const StyledWeekDaysHeaderItem = import_ds_system.styled
|
|
550
|
+
const StyledWeekDaysHeaderItem = (0, import_ds_system.styled)("div", {
|
|
551
|
+
name: import_constants.DSControlledDateTimePickerName,
|
|
552
|
+
slot: import_constants.FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_WEEKLY_DAY_ITEM
|
|
553
|
+
})`
|
|
541
554
|
min-width: 2.4615rem;
|
|
542
555
|
display: flex;
|
|
543
556
|
justify-content: center;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/Styleds.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { css, styled, type Theme } from '@elliemae/ds-system';\nimport { DSControlledDateTimePickerName, DSControlledDateTimePickerSlots } from '../../../constants/index.js';\n\n// Diagonal line \u2014 shape only. Caller supplies the color function.\nconst makeDiagonalLine = (getColor: (props: { theme: Theme }) => string) => css`\n &:before {\n position: absolute;\n content: '';\n top: 48%;\n left: -2px;\n height: 1px;\n width: calc(100% + 4px);\n transform: rotate(45deg);\n background-color: ${getColor};\n }\n`;\n// Default: neutral-500, used for active disabled/out-of-range days.\nconst diagonalLine = makeDiagonalLine(({ theme }) => theme.colors.neutral[500]);\n\n// Focus ring frame \u2014 shape only. Colour is always brand-700, injected in StyledWeekDaysListWrapper\n// under .focusedDay so a single rule governs the ring colour regardless of day state.\nconst focusBorder = css`\n &:after {\n position: absolute;\n content: '';\n top: -4px;\n left: -4px;\n width: calc(100% + 8px);\n height: calc(100% + 8px);\n border-radius: 50%;\n }\n`;\n\nconst backgroundDateRange = {\n inRange: css`\n background-color: ${({ theme }) => theme.colors.brand[100]};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[100]};\n `,\n startRange: css`\n background-color: ${({ theme }) => theme.colors.brand[100]};\n border-radius: 50% 0 0 50%;\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[100]};\n `,\n endRange: css`\n background-color: ${({ theme }) => theme.colors.brand[100]};\n border-radius: 0 50% 50% 0;\n `,\n};\n\nexport const StyledIconTriggerButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.PICKER_ICONS.CALENDAR,\n})`\n color: ${({ theme }) => theme.colors.brand['800']};\n width: 2rem;\n height: 2rem;\n`;\n\nexport const StyledShadowWrapper = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CONTROLLER_COMPONENT.CALENDAR,\n})``;\n\nexport const StyledCalendarWrapper = styled.div<{ $readOnlyStyles?: boolean }>`\n display: grid;\n min-width: 260px;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n grid-template-rows: auto auto;\n`;\n\nexport const StyledHeader = styled.section`\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n display: grid;\n padding: ${({ theme }) => theme.space.xxxs};\n grid-template-columns: min-content min-content 1fr min-content min-content;\n grid-template-rows: 1fr;\n align-items: center;\n justify-content: center;\n text-align: center;\n background: ${({ theme }) => theme.colors.neutral['050']};\n`;\n\nexport const StyledHeaderLabel = styled('h3', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_LABEL,\n})`\n font-size: 1rem;\n`;\n\nexport const StyledHeaderButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_BUTTON,\n})`\n position: relative;\n width: 2.1538rem;\n height: 2.1538rem;\n &:focus {\n &:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n border-radius: 2px;\n pointer-events: none;\n }\n }\n &:hover {\n background: ${({ theme }) => theme.colors.brand[200]};\n }\n`;\n\nexport const StyledBody = styled.section`\n padding: ${({ theme }) => theme.space.xxxs};\n`;\n\n// StyledDayBtn owns shape, cursor, and the focus ring frame.\n// Hover colours live in StyledWeekDaysListWrapper using parent-class selectors whose\n// specificity (\u22650,6,0) beats DSButtonV2's internal transparent hover at (0,2,0).\nexport const StyledDayBtn = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.DAY_BUTTON,\n})<{ $readOnlyStyles?: boolean }>`\n height: 2.4615rem;\n width: 2.4615rem;\n border-radius: 50%;\n position: relative;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n line-height: 1;\n color: ${({ theme }) => theme.colors.neutral[800]};\n cursor: ${({ $readOnlyStyles }) => ($readOnlyStyles ? 'not-allowed' : 'pointer')};\n display: flex;\n justify-content: center;\n align-items: center;\n &:focus {\n ${focusBorder}\n }\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const StyledWeekDaysListWrapper = styled(Grid, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_WEEKLY_DAY_LIST,\n})<{ isHeader?: boolean }>`\n font-size: ${({ theme }) => theme.fontSizes.label[400]};\n text-align: center;\n justify-items: center;\n ${({ isHeader, theme }) => (isHeader ? `background: ${theme.colors.neutral['050']}` : '')};\n ${({ isHeader }) => (isHeader ? 'text-transform: capitalize' : '')};\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n SELECTED (valid) \u2014 defect fix: brand-600, was brand-700\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.selectedDay,\n .dayWrapper.startRangeDay,\n .dayWrapper.endRangeDay {\n &:not(.disabledDay):not(.outOfRangeDay):not(.readOnly) {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.brand[600]};\n color: ${({ theme }) => theme.colors.neutral['000']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* selected invalid: danger-900 background */\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.danger[900]};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n INVALID (disabled / out-of-range) \u2014 base colour + diagonal\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.disabledDay,\n .dayWrapper.outOfRangeDay {\n ${StyledDayBtn} {\n cursor: not-allowed;\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${diagonalLine}\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n FOCUS RING \u2014 always brand-700 regardless of day state\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.focusedDay {\n ${StyledDayBtn} {\n ${focusBorder}\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n /* focused valid not-readOnly: brand text */\n &:not(.readOnly):not(.disabledDay):not(.outOfRangeDay):not(.selectedDay):not(.startRangeDay):not(.endRangeDay) {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n }\n\n /* focused invalid not-readOnly: brand text + brand diagonal */\n &.disabledDay:not(.readOnly):not(.selectedDay):not(.startRangeDay):not(.endRangeDay),\n &.outOfRangeDay:not(.readOnly):not(.selectedDay):not(.startRangeDay):not(.endRangeDay) {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n &:before {\n background-color: ${({ theme }) => theme.colors.brand[600]};\n }\n }\n }\n\n /* focused selected: white text, white inner border (gap), blue outer ring from generic rule */\n &.selectedDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n border-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n\n /* focused valid selected (non-readOnly): brand-800 background matches hover */\n &.selectedDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n &.startRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n &.endRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly) {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n /* focused selected invalid: white text + white diagonal */\n &.selectedDay.disabledDay,\n &.selectedDay.outOfRangeDay,\n &.startRangeDay.disabledDay,\n &.startRangeDay.outOfRangeDay,\n &.endRangeDay.disabledDay,\n &.endRangeDay.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n HOVER BACKGROUNDS \u2014 new spec\n Semi-bold on hover for all non-selected states.\n Rules ordered low \u2192 high specificity so readOnly always wins.\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n /* valid, not selected, not readOnly */\n .dayWrapper:not(.disabledDay):not(.outOfRangeDay):not(.readOnly):not(.selectedDay):not(.startRangeDay):not(\n .endRangeDay\n ) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.brand[100]};\n color: ${({ theme }) => theme.colors.brand[700]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* invalid, not selected, not readOnly */\n .dayWrapper.disabledDay:not(.selectedDay):not(.readOnly),\n .dayWrapper.outOfRangeDay:not(.selectedDay):not(.readOnly) {\n ${StyledDayBtn}:hover {\n /* TODO: danger[200] and danger[400] are currently the same token and both fail contrast\n against common dimsum color combinations. Hardcoded until the theme token is fixed. */\n background-color: #fffcfc; // this is hardcoded because danger 200 fails contrast, pending theme token fix\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* selected valid, not readOnly */\n .dayWrapper.selectedDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n .dayWrapper.startRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n .dayWrapper.endRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n /* selected invalid, not readOnly */\n .dayWrapper.selectedDay.disabledDay:not(.readOnly),\n .dayWrapper.selectedDay.outOfRangeDay:not(.readOnly),\n .dayWrapper.startRangeDay.disabledDay:not(.readOnly),\n .dayWrapper.startRangeDay.outOfRangeDay:not(.readOnly),\n .dayWrapper.endRangeDay.disabledDay:not(.readOnly),\n .dayWrapper.endRangeDay.outOfRangeDay:not(.readOnly) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.danger[950]};\n }\n }\n\n /* readOnly, not selected (any validity) \u2014 wins over all non-readOnly hover rules */\n .dayWrapper.readOnly:not(.selectedDay):not(.startRangeDay):not(.endRangeDay) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.neutral[100]};\n color: ${({ theme }) => theme.colors.neutral[700]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n READONLY REST STATES\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.selectedDay.readOnly,\n .dayWrapper.startRangeDay.readOnly,\n .dayWrapper.endRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n /* (0,6,0) beats DSButtonV2's .liKnyT:hover { background: transparent } at (0,2,0) */\n &:hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.disabledDay.readOnly,\n .dayWrapper.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n }\n }\n\n .dayWrapper.selectedDay.disabledDay.readOnly,\n .dayWrapper.selectedDay.outOfRangeDay.readOnly,\n .dayWrapper.startRangeDay.disabledDay.readOnly,\n .dayWrapper.startRangeDay.outOfRangeDay.readOnly,\n .dayWrapper.endRangeDay.disabledDay.readOnly,\n .dayWrapper.endRangeDay.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n color: ${({ theme }) => theme.colors.neutral['000']};\n ${makeDiagonalLine(({ theme }) => theme.colors.neutral['000'])}\n &:hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.inRangeDay.readOnly {\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.neutral['100']};\n }\n\n .dayWrapper.inRangeDay.disabledDay.readOnly,\n .dayWrapper.inRangeDay.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: transparent;\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${makeDiagonalLine(({ theme }) => theme.colors.neutral[700])}\n }\n }\n\n .dayWrapper.startRangeDay.inRangeImproperDay.readOnly {\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.neutral['100']};\n }\n\n .dayWrapper.endRangeDay.inRangeImproperDay.readOnly {\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n NOT CURRENT MONTH\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.notCurrentMonth {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.inRangeDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n &.selectedDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n RANGE DAYS\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.inRangeDay {\n ${backgroundDateRange.inRange}\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n background-color: transparent;\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${makeDiagonalLine(({ theme }) => theme.colors.neutral[700])}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n &:after {\n border-color: ${({ theme }) => theme.colors.brand[700]};\n }\n }\n }\n }\n }\n\n .dayWrapper.startRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.startRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.endRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay.startRangeDay {\n background-color: transparent;\n box-shadow: none;\n }\n`;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport const StyledWeekDaysHeaderItem = styled.div`\n min-width: 2.4615rem;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const CalendarFooterMessage = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.FOOTERS.CALENDAR,\n})<{ $readOnlyStyles?: boolean }>`\n border-top: solid 1px ${({ theme }) => theme.colors.neutral[300]};\n margin: 0 ${({ theme }) => theme.space.xxs2};\n padding: ${({ theme }) => theme.space.xxs2} 0;\n color: ${({ theme }) => theme.colors.danger[900]};\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n text-align: right;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,qBAAqB;AACrB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { css, styled, ariaDisabledInteractionCss, type Theme } from '@elliemae/ds-system';\nimport {\n DSControlledDateTimePickerName,\n DSControlledDateTimePickerSlots,\n FORM_DATE_TIME_PICKER_SLOTS,\n} from '../../../constants/index.js';\n\n// Diagonal line \u2014 shape only. Caller supplies the color function.\nconst makeDiagonalLine = (getColor: (props: { theme: Theme }) => string) => css`\n &:before {\n position: absolute;\n content: '';\n top: 48%;\n left: -2px;\n height: 1px;\n width: calc(100% + 4px);\n transform: rotate(45deg);\n background-color: ${getColor};\n }\n`;\n// Default: neutral-500, used for active disabled/out-of-range days.\nconst diagonalLine = makeDiagonalLine(({ theme }) => theme.colors.neutral[500]);\n\n// Focus ring frame \u2014 shape only. Colour is always brand-700, injected in StyledWeekDaysListWrapper\n// under .focusedDay so a single rule governs the ring colour regardless of day state.\nconst focusBorder = css`\n &:after {\n position: absolute;\n content: '';\n top: -4px;\n left: -4px;\n width: calc(100% + 8px);\n height: calc(100% + 8px);\n border-radius: 50%;\n }\n`;\n\nconst backgroundDateRange = {\n inRange: css`\n background-color: ${({ theme }) => theme.colors.brand[100]};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[100]};\n `,\n startRange: css`\n background-color: ${({ theme }) => theme.colors.brand[100]};\n border-radius: 50% 0 0 50%;\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.brand[100]};\n `,\n endRange: css`\n background-color: ${({ theme }) => theme.colors.brand[100]};\n border-radius: 0 50% 50% 0;\n `,\n};\n\nexport const StyledIconTriggerButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.PICKER_ICONS.CALENDAR,\n})`\n color: ${({ theme }) => theme.colors.brand['800']};\n width: 2rem;\n height: 2rem;\n`;\n\nexport const StyledShadowWrapper = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CONTROLLER_COMPONENT.CALENDAR,\n})``;\n\nexport const StyledCalendarWrapper = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_WRAPPER,\n})<{ $readOnlyStyles?: boolean }>`\n display: grid;\n min-width: 260px;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n grid-template-rows: auto auto;\n`;\n\nexport const StyledHeader = styled('section', {\n name: DSControlledDateTimePickerName,\n slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER,\n})`\n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n display: grid;\n padding: ${({ theme }) => theme.space.xxxs};\n grid-template-columns: min-content min-content 1fr min-content min-content;\n grid-template-rows: 1fr;\n align-items: center;\n justify-content: center;\n text-align: center;\n background: ${({ theme }) => theme.colors.neutral['050']};\n`;\n\nexport const StyledHeaderLabel = styled('h3', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_LABEL,\n})`\n font-size: 1rem;\n`;\n\nexport const StyledHeaderButton = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_BUTTON,\n})`\n position: relative;\n width: 2.1538rem;\n height: 2.1538rem;\n &:focus {\n &:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n border-radius: 2px;\n pointer-events: none;\n }\n }\n &:hover {\n background: ${({ theme }) => theme.colors.brand[200]};\n }\n`;\n\nexport const StyledBody = styled('section', {\n name: DSControlledDateTimePickerName,\n slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_BODY,\n})`\n padding: ${({ theme }) => theme.space.xxxs};\n`;\n\n// StyledDayBtn owns shape, cursor, and the focus ring frame.\n// Hover colours live in StyledWeekDaysListWrapper using parent-class selectors whose\n// specificity (\u22650,6,0) beats DSButtonV2's internal transparent hover at (0,2,0).\nexport const StyledDayBtn = styled(DSButtonV2, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.DAY_BUTTON,\n})<{ $readOnlyStyles?: boolean }>`\n height: 2.4615rem;\n width: 2.4615rem;\n border-radius: 50%;\n position: relative;\n border-width: 2px;\n border-style: solid;\n border-color: transparent;\n line-height: 1;\n color: ${({ theme }) => theme.colors.neutral[800]};\n cursor: pointer;\n ${({ $readOnlyStyles }) => $readOnlyStyles && ariaDisabledInteractionCss}\n display: flex;\n justify-content: center;\n align-items: center;\n &:focus {\n ${focusBorder}\n }\n`;\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport const StyledWeekDaysListWrapper = styled(Grid, {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.CALENDAR.HEADER_WEEKLY_DAY_LIST,\n})<{ isHeader?: boolean }>`\n font-size: ${({ theme }) => theme.fontSizes.label[400]};\n text-align: center;\n justify-items: center;\n ${({ isHeader, theme }) => (isHeader ? `background: ${theme.colors.neutral['050']}` : '')};\n ${({ isHeader }) => (isHeader ? 'text-transform: capitalize' : '')};\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n SELECTED (valid) \u2014 defect fix: brand-600, was brand-700\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.selectedDay,\n .dayWrapper.startRangeDay,\n .dayWrapper.endRangeDay {\n &:not(.disabledDay):not(.outOfRangeDay):not(.readOnly) {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.brand[600]};\n color: ${({ theme }) => theme.colors.neutral['000']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* selected invalid: danger-900 background */\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.danger[900]};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n INVALID (disabled / out-of-range) \u2014 base colour + diagonal\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.disabledDay,\n .dayWrapper.outOfRangeDay {\n ${StyledDayBtn} {\n cursor: not-allowed;\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${diagonalLine}\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n FOCUS RING \u2014 always brand-700 regardless of day state\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.focusedDay {\n ${StyledDayBtn} {\n ${focusBorder}\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n\n /* focused valid not-readOnly: brand text */\n &:not(.readOnly):not(.disabledDay):not(.outOfRangeDay):not(.selectedDay):not(.startRangeDay):not(.endRangeDay) {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n }\n\n /* focused invalid not-readOnly: brand text + brand diagonal */\n &.disabledDay:not(.readOnly):not(.selectedDay):not(.startRangeDay):not(.endRangeDay),\n &.outOfRangeDay:not(.readOnly):not(.selectedDay):not(.startRangeDay):not(.endRangeDay) {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n &:before {\n background-color: ${({ theme }) => theme.colors.brand[600]};\n }\n }\n }\n\n /* focused selected: white text, white inner border (gap), blue outer ring from generic rule */\n &.selectedDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n border-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n\n /* focused valid selected (non-readOnly): brand-800 background matches hover */\n &.selectedDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n &.startRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n &.endRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly) {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n /* focused selected invalid: white text + white diagonal */\n &.selectedDay.disabledDay,\n &.selectedDay.outOfRangeDay,\n &.startRangeDay.disabledDay,\n &.startRangeDay.outOfRangeDay,\n &.endRangeDay.disabledDay,\n &.endRangeDay.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n HOVER BACKGROUNDS \u2014 new spec\n Semi-bold on hover for all non-selected states.\n Rules ordered low \u2192 high specificity so readOnly always wins.\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n /* valid, not selected, not readOnly */\n .dayWrapper:not(.disabledDay):not(.outOfRangeDay):not(.readOnly):not(.selectedDay):not(.startRangeDay):not(\n .endRangeDay\n ) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.brand[100]};\n color: ${({ theme }) => theme.colors.brand[700]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* invalid, not selected, not readOnly */\n .dayWrapper.disabledDay:not(.selectedDay):not(.readOnly),\n .dayWrapper.outOfRangeDay:not(.selectedDay):not(.readOnly) {\n ${StyledDayBtn}:hover {\n /* TODO: danger[200] and danger[400] are currently the same token and both fail contrast\n against common dimsum color combinations. Hardcoded until the theme token is fixed. */\n background-color: #fffcfc; // this is hardcoded because danger 200 fails contrast, pending theme token fix\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* selected valid, not readOnly */\n .dayWrapper.selectedDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n .dayWrapper.startRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly),\n .dayWrapper.endRangeDay:not(.disabledDay):not(.outOfRangeDay):not(.readOnly) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n /* selected invalid, not readOnly */\n .dayWrapper.selectedDay.disabledDay:not(.readOnly),\n .dayWrapper.selectedDay.outOfRangeDay:not(.readOnly),\n .dayWrapper.startRangeDay.disabledDay:not(.readOnly),\n .dayWrapper.startRangeDay.outOfRangeDay:not(.readOnly),\n .dayWrapper.endRangeDay.disabledDay:not(.readOnly),\n .dayWrapper.endRangeDay.outOfRangeDay:not(.readOnly) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.danger[950]};\n }\n }\n\n /* readOnly, not selected (any validity) \u2014 wins over all non-readOnly hover rules */\n .dayWrapper.readOnly:not(.selectedDay):not(.startRangeDay):not(.endRangeDay) {\n ${StyledDayBtn}:hover {\n background-color: ${({ theme }) => theme.colors.neutral[100]};\n color: ${({ theme }) => theme.colors.neutral[700]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n READONLY REST STATES\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.selectedDay.readOnly,\n .dayWrapper.startRangeDay.readOnly,\n .dayWrapper.endRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n /* (0,6,0) beats DSButtonV2's .liKnyT:hover { background: transparent } at (0,2,0) */\n &:hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.disabledDay.readOnly,\n .dayWrapper.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[700]};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral[700]};\n }\n &:after {\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n }\n }\n }\n }\n\n .dayWrapper.selectedDay.disabledDay.readOnly,\n .dayWrapper.selectedDay.outOfRangeDay.readOnly,\n .dayWrapper.startRangeDay.disabledDay.readOnly,\n .dayWrapper.startRangeDay.outOfRangeDay.readOnly,\n .dayWrapper.endRangeDay.disabledDay.readOnly,\n .dayWrapper.endRangeDay.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: ${({ theme }) => theme.colors.neutral['500']};\n color: ${({ theme }) => theme.colors.neutral['000']};\n ${makeDiagonalLine(({ theme }) => theme.colors.neutral['000'])}\n &:hover {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral['700']};\n }\n }\n }\n\n .dayWrapper.inRangeDay.readOnly {\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.neutral['100']};\n }\n\n .dayWrapper.inRangeDay.disabledDay.readOnly,\n .dayWrapper.inRangeDay.outOfRangeDay.readOnly {\n ${StyledDayBtn} {\n background-color: transparent;\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${makeDiagonalLine(({ theme }) => theme.colors.neutral[700])}\n }\n }\n\n .dayWrapper.startRangeDay.inRangeImproperDay.readOnly {\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n box-shadow: 4px 0 0 0 ${({ theme }) => theme.colors.neutral['100']};\n }\n\n .dayWrapper.endRangeDay.inRangeImproperDay.readOnly {\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n NOT CURRENT MONTH\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.notCurrentMonth {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.brand[600]};\n }\n\n &.inRangeDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n &.selectedDay,\n &.startRangeDay,\n &.endRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n\n /* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n RANGE DAYS\n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n .dayWrapper.inRangeDay {\n ${backgroundDateRange.inRange}\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n background-color: transparent;\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${makeDiagonalLine(({ theme }) => theme.colors.neutral[700])}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n &:after {\n border-color: ${({ theme }) => theme.colors.brand[700]};\n }\n }\n }\n }\n }\n\n .dayWrapper.startRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.startRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay {\n &.inRangeImproperDay {\n ${backgroundDateRange.endRange}\n }\n &.focusedDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n &.disabledDay,\n &.outOfRangeDay {\n ${StyledDayBtn} {\n color: ${({ theme }) => theme.colors.neutral['000']};\n &:before {\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n }\n }\n }\n }\n\n .dayWrapper.endRangeDay.startRangeDay {\n background-color: transparent;\n box-shadow: none;\n }\n`;\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport const StyledWeekDaysHeaderItem = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_WEEKLY_DAY_ITEM,\n})`\n min-width: 2.4615rem;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nexport const CalendarFooterMessage = styled('div', {\n name: DSControlledDateTimePickerName,\n slot: DSControlledDateTimePickerSlots.FOOTERS.CALENDAR,\n})<{ $readOnlyStyles?: boolean }>`\n border-top: solid 1px ${({ theme }) => theme.colors.neutral[300]};\n margin: 0 ${({ theme }) => theme.space.xxs2};\n padding: ${({ theme }) => theme.space.xxs2} 0;\n color: ${({ theme }) => theme.colors.danger[900]};\n font-size: ${({ theme }) => theme.fontSizes.microText[200]};\n text-align: right;\n background-color: ${({ theme, $readOnlyStyles }) =>\n $readOnlyStyles ? theme.colors.neutral['050'] : theme.colors.neutral['000']};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAA2B;AAC3B,qBAAqB;AACrB,uBAAoE;AACpE,uBAIO;AAGP,MAAM,mBAAmB,CAAC,aAAkD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASpD,QAAQ;AAAA;AAAA;AAIhC,MAAM,eAAe,iBAAiB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAI9E,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYpB,MAAM,sBAAsB;AAAA,EAC1B,SAAS;AAAA,wBACa,CAAC,EAAE,M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AAA;AAAA;AAAA,QAG5B,YAAY;AAAA,iBACH,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,QAKnD,YAAY;AAAA,iBACH,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA,8BAE7B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAajE,MAAM,+BAA2B,yBAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,6CAA4B;AACpC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM,MAAM,4BAAwB,yBAAO,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,iDAAgC,QAAQ;AAChD,CAAC;AAAA,0BACyB,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,cACpD,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,IAAI;AAAA,aAChC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,IAAI;AAAA,WACjC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA,eACnC,CAAC,EAAE,MAAM,MAAM,MAAM,UAAU,UAAU,GAAG,CAAC;AAAA;AAAA,sBAEtC,CAAC,EAAE,OAAO,gBAAgB,MAC5C,kBAAkB,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -44,6 +44,7 @@ const usePopperTriggerLogic = ({
|
|
|
44
44
|
const {
|
|
45
45
|
props: { onPickerOpen, onPickerClose, disabled },
|
|
46
46
|
pickerButtonRef,
|
|
47
|
+
isWithTimeWheelToo,
|
|
47
48
|
trackFocusCalendarMetafocusedDay,
|
|
48
49
|
trackFocusCalendarPrevMonth,
|
|
49
50
|
trackFocusPicker,
|
|
@@ -52,8 +53,9 @@ const usePopperTriggerLogic = ({
|
|
|
52
53
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
53
54
|
const [referenceElement, setReferenceElement] = (0, import_react.useState)(null);
|
|
54
55
|
const handleOnPickerOpen = (0, import_react.useCallback)(() => {
|
|
56
|
+
if (isWithTimeWheelToo) return;
|
|
55
57
|
onPickerOpen();
|
|
56
|
-
}, [onPickerOpen]);
|
|
58
|
+
}, [isWithTimeWheelToo, onPickerOpen]);
|
|
57
59
|
const openCalendar = (0, import_react.useCallback)(() => {
|
|
58
60
|
if (disabled) return;
|
|
59
61
|
if (focusedDay) trackFocusCalendarMetafocusedDay();
|
|
@@ -70,11 +72,18 @@ const usePopperTriggerLogic = ({
|
|
|
70
72
|
]);
|
|
71
73
|
const closeCalendar = (0, import_react.useCallback)(() => {
|
|
72
74
|
setShowCalendar(false);
|
|
73
|
-
onPickerClose();
|
|
75
|
+
if (!isWithTimeWheelToo) onPickerClose();
|
|
74
76
|
resetFocusedDayToStartDate();
|
|
75
77
|
trackFocusPicker();
|
|
76
78
|
resetMonthYear();
|
|
77
|
-
}, [
|
|
79
|
+
}, [
|
|
80
|
+
setShowCalendar,
|
|
81
|
+
isWithTimeWheelToo,
|
|
82
|
+
onPickerClose,
|
|
83
|
+
resetFocusedDayToStartDate,
|
|
84
|
+
trackFocusPicker,
|
|
85
|
+
resetMonthYear
|
|
86
|
+
]);
|
|
78
87
|
const handleToggleCalendar = (0, import_react.useCallback)(() => {
|
|
79
88
|
const isOpening = !showCalendar;
|
|
80
89
|
if (isOpening) openCalendar();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/Calendar/usePopperTriggerLogic.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport type React from 'react';\nimport { useMemo, useCallback, useState, useContext } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { useFocusLogic } from './useFocusLogic.js';\n\ninterface UsePopperTriggerLogic {\n focusLogic: ReturnType<typeof useFocusLogic>;\n showCalendar: boolean;\n setShowCalendar: TypescriptHelpersT.StateSetter<boolean>;\n resetMonthYear: () => void;\n}\ninterface PopperTriggerLogicT {\n referenceElement: HTMLButtonElement | null;\n closeCalendar: () => void;\n handleToggleCalendar: () => void;\n handleSetTriggerRef: (instance: HTMLButtonElement) => void;\n handleMenuWrapperKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;\n}\nexport const usePopperTriggerLogic = ({\n focusLogic,\n showCalendar,\n setShowCalendar,\n resetMonthYear,\n}: UsePopperTriggerLogic): PopperTriggerLogicT => {\n const { focusedDay, resetFocusedDayToStartDate } = focusLogic;\n const {\n props: { onPickerOpen, onPickerClose, disabled },\n\n pickerButtonRef,\n trackFocusCalendarMetafocusedDay,\n trackFocusCalendarPrevMonth,\n trackFocusPicker,\n latestInteractionRegion,\n currFocusDescriber,\n } = useContext(ControlledDateTimePickerContext);\n const [referenceElement, setReferenceElement] = useState<HTMLButtonElement | null>(null);\n //
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAA2D;AAE3D,yCAAgD;AAgBzC,MAAM,wBAAwB,CAAC;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAkD;AAChD,QAAM,EAAE,YAAY,2BAA2B,IAAI;AACnD,QAAM;AAAA,IACJ,OAAO,EAAE,cAAc,eAAe,SAAS;AAAA,IAE/C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,CAAC,kBAAkB,mBAAmB,QAAI,uBAAmC,IAAI;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport type React from 'react';\nimport { useMemo, useCallback, useState, useContext } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport type { useFocusLogic } from './useFocusLogic.js';\n\ninterface UsePopperTriggerLogic {\n focusLogic: ReturnType<typeof useFocusLogic>;\n showCalendar: boolean;\n setShowCalendar: TypescriptHelpersT.StateSetter<boolean>;\n resetMonthYear: () => void;\n}\ninterface PopperTriggerLogicT {\n referenceElement: HTMLButtonElement | null;\n closeCalendar: () => void;\n handleToggleCalendar: () => void;\n handleSetTriggerRef: (instance: HTMLButtonElement) => void;\n handleMenuWrapperKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;\n}\nexport const usePopperTriggerLogic = ({\n focusLogic,\n showCalendar,\n setShowCalendar,\n resetMonthYear,\n}: UsePopperTriggerLogic): PopperTriggerLogicT => {\n const { focusedDay, resetFocusedDayToStartDate } = focusLogic;\n const {\n props: { onPickerOpen, onPickerClose, disabled },\n\n pickerButtonRef,\n isWithTimeWheelToo,\n trackFocusCalendarMetafocusedDay,\n trackFocusCalendarPrevMonth,\n trackFocusPicker,\n latestInteractionRegion,\n currFocusDescriber,\n } = useContext(ControlledDateTimePickerContext);\n const [referenceElement, setReferenceElement] = useState<HTMLButtonElement | null>(null);\n\n // True only for DATE_TIME, where this hook is nested inside `CalendarWithTimeWheel` \u2014 that parent\n // owns the popper and calls the consumer callbacks itself, so reporting from here too made\n // DATE_TIME fire them 3\u00D7 per interaction. Hard-false for DATE-only, which is unaffected.\n const handleOnPickerOpen = useCallback(() => {\n if (isWithTimeWheelToo) return;\n onPickerOpen();\n }, [isWithTimeWheelToo, onPickerOpen]);\n // onOpen we try to focus the day we should focus, if we should focus one\n const openCalendar = useCallback(() => {\n if (disabled) return;\n if (focusedDay) trackFocusCalendarMetafocusedDay();\n else setTimeout(() => trackFocusCalendarPrevMonth());\n setShowCalendar(true);\n handleOnPickerOpen();\n }, [\n disabled,\n focusedDay,\n handleOnPickerOpen,\n setShowCalendar,\n trackFocusCalendarMetafocusedDay,\n trackFocusCalendarPrevMonth,\n ]);\n\n const closeCalendar = useCallback(() => {\n setShowCalendar(false);\n if (!isWithTimeWheelToo) onPickerClose();\n resetFocusedDayToStartDate();\n trackFocusPicker();\n resetMonthYear();\n }, [\n setShowCalendar,\n isWithTimeWheelToo,\n onPickerClose,\n resetFocusedDayToStartDate,\n trackFocusPicker,\n resetMonthYear,\n ]);\n\n const handleToggleCalendar = useCallback(() => {\n const isOpening = !showCalendar;\n if (isOpening) openCalendar();\n else closeCalendar();\n }, [closeCalendar, openCalendar, showCalendar]);\n\n const handleSetTriggerRef = useCallback(\n (newRef: HTMLButtonElement) => {\n pickerButtonRef.current = newRef;\n setReferenceElement(newRef);\n if (latestInteractionRegion === 'picker-icon' && currFocusDescriber === 'date-picker-icon') newRef?.focus();\n },\n [currFocusDescriber, latestInteractionRegion, pickerButtonRef],\n );\n const handleMenuWrapperKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n const { key } = e;\n if (key === 'Escape') {\n closeCalendar();\n trackFocusPicker();\n }\n },\n [closeCalendar, trackFocusPicker],\n );\n\n return useMemo(\n () => ({\n referenceElement,\n closeCalendar,\n handleSetTriggerRef,\n handleToggleCalendar,\n handleMenuWrapperKeyDown,\n }),\n [closeCalendar, handleMenuWrapperKeyDown, handleSetTriggerRef, handleToggleCalendar, referenceElement],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAA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B,mBAAoB,SAAQ,MAAM;AAAA,IAC5G;AAAA,IACA,CAAC,oBAAoB,yBAAyB,eAAe;AAAA,EAC/D;AACA,QAAM,+BAA2B;AAAA,IAC/B,CAAC,MAAwC;AACvC,YAAM,EAAE,IAAI,IAAI;AAChB,UAAI,QAAQ,UAAU;AACpB,sBAAc;AACd,yBAAiB;AAAA,MACnB;AAAA,IACF;AAAA,IACA,CAAC,eAAe,gBAAgB;AAAA,EAClC;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,eAAe,0BAA0B,qBAAqB,sBAAsB,gBAAgB;AAAA,EACvG;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,13 +50,16 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
50
50
|
} = (0, import_react.useContext)(import_CalendarWithTimeWheelContext.CalendarWithTimeWheelContext);
|
|
51
51
|
const {
|
|
52
52
|
getProps,
|
|
53
|
-
props: { tabIndex }
|
|
53
|
+
props: { tabIndex, applyAriaDisabled, readOnly }
|
|
54
54
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
55
55
|
return (0, import_react.useMemo)(
|
|
56
56
|
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
57
|
import_Styleds.StyledIconTriggerButton,
|
|
58
58
|
{
|
|
59
59
|
"aria-label": `date time picker context menu trigger, ${ariaCurrentValueForInputs}`,
|
|
60
|
+
applyAriaDisabled,
|
|
61
|
+
readOnly,
|
|
62
|
+
onDeliberateActivationWhileSoftLocked: handleToggleCalendarWithTimeWheel,
|
|
60
63
|
buttonType: "icon",
|
|
61
64
|
type: "button",
|
|
62
65
|
size: import_ds_button_v2.BUTTON_SIZES.M,
|
|
@@ -72,6 +75,8 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
72
75
|
),
|
|
73
76
|
[
|
|
74
77
|
ariaCurrentValueForInputs,
|
|
78
|
+
applyAriaDisabled,
|
|
79
|
+
readOnly,
|
|
75
80
|
disabled,
|
|
76
81
|
getProps,
|
|
77
82
|
handlePickerIconKeyDown,
|
package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { CalendarWithTimeWheelContext } from './CalendarWithTimeWheelContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarWithTimeWheelIconTrigger = (): JSX.Element => {\n const {\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n handlePickerIconKeyDown,\n ariaCurrentValueForInputs,\n disabled,\n } = useContext(CalendarWithTimeWheelContext);\n const {\n getProps,\n props: { tabIndex },\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n type=\"button\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendarWithTimeWheel}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR_TIMEWHEEL}\n disabled={disabled}\n getOwnerProps={getProps}\n >\n <DatePicker color={disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n disabled,\n getProps,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n tabIndex,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { DatePicker } from '@elliemae/ds-icons';\nimport { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { CalendarWithTimeWheelContext } from './CalendarWithTimeWheelContext.js';\nimport { StyledIconTriggerButton } from './Styleds.js';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const CalendarWithTimeWheelIconTrigger = (): JSX.Element => {\n const {\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n handlePickerIconKeyDown,\n ariaCurrentValueForInputs,\n disabled,\n } = useContext(CalendarWithTimeWheelContext);\n const {\n getProps,\n props: { tabIndex, applyAriaDisabled, readOnly },\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`date time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n // opening a view-only popup is not an action of the soft lock (PUI-16695): the lock stays announced by DSButton\n // and the consumer's onClick stays withheld, only the toggle runs, deliberately\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n onDeliberateActivationWhileSoftLocked={handleToggleCalendarWithTimeWheel}\n buttonType=\"icon\"\n type=\"button\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n tabIndex={tabIndex}\n onClick={handleToggleCalendarWithTimeWheel}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR_TIMEWHEEL}\n disabled={disabled}\n getOwnerProps={getProps}\n >\n <DatePicker color={disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledIconTriggerButton>\n ),\n [\n ariaCurrentValueForInputs,\n applyAriaDisabled,\n readOnly,\n disabled,\n getProps,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleCalendarWithTimeWheel,\n tabIndex,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2Cf;AA3CR,0BAA6B;AAC7B,sBAA2B;AAC3B,mBAAoC;AACpC,yCAAgD;AAChD,uBAAmD;AACnD,0CAA6C;AAC7C,qBAAwC;AAKjC,MAAM,mCAAmC,MAAmB;AACjE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,gEAA4B;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,mBAAmB,SAAS;AAAA,EACjD,QAAI,yBAAW,kEAA+B;AAC9C,aAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,0CAA0C,yBAAyB;AAAA,QAG/E;AAAA,QACA;AAAA,QACA,uCAAuC;AAAA,QACvC,YAAW;AAAA,QACX,MAAK;AAAA,QACL,MAAM,iCAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,oDAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,eAAe;AAAA,QAEf,sDAAC,8BAAW,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC/E;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -45,9 +45,10 @@ const PickersIcons = () => {
|
|
|
45
45
|
hideTimePicker,
|
|
46
46
|
hideDateTimePicker,
|
|
47
47
|
isControllerOnly,
|
|
48
|
+
getProps,
|
|
48
49
|
props: { hasError }
|
|
49
50
|
} = import_react.default.useContext(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
50
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledPickersIconsWrapperGrid, { hasError, isControllerOnly, children: [
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledPickersIconsWrapperGrid, { hasError, isControllerOnly, getOwnerProps: getProps, children: [
|
|
51
52
|
!hideDatePicker && hideTimePicker && hideDateTimePicker ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Calendar.Calendar, {}) : null,
|
|
52
53
|
hideDatePicker && !hideTimePicker && hideDateTimePicker ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TimeWheel.TimeWheel, {}) : null,
|
|
53
54
|
hideDatePicker && hideTimePicker && !hideDateTimePicker ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_CalendarWithTimeWheel.CalendarWithTimeWheel, {}) : null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Pickers/PickersIcons.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { StyledPickersIconsWrapperGrid } from '../Styleds.js';\nimport { CalendarWithTimeWheel } from './CalendarWithTimeWheel/CalendarWithTimeWheel.js';\nimport { Calendar } from './Calendar/Calendar.js';\nimport { TimeWheel } from './TimeWheel/TimeWheel.js';\n\nexport const PickersIcons = (): JSX.Element => {\n const {\n hideDatePicker,\n hideTimePicker,\n hideDateTimePicker,\n isControllerOnly,\n props: { hasError },\n } = React.useContext(ControlledDateTimePickerContext);\n\n return (\n <StyledPickersIconsWrapperGrid hasError={hasError} isControllerOnly={isControllerOnly}>\n {!hideDatePicker && hideTimePicker && hideDateTimePicker ? <Calendar /> : null}\n {hideDatePicker && !hideTimePicker && hideDateTimePicker ? <TimeWheel /> : null}\n {hideDatePicker && hideTimePicker && !hideDateTimePicker ? <CalendarWithTimeWheel /> : null}\n </StyledPickersIconsWrapperGrid>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { StyledPickersIconsWrapperGrid } from '../Styleds.js';\nimport { CalendarWithTimeWheel } from './CalendarWithTimeWheel/CalendarWithTimeWheel.js';\nimport { Calendar } from './Calendar/Calendar.js';\nimport { TimeWheel } from './TimeWheel/TimeWheel.js';\n\nexport const PickersIcons = (): JSX.Element => {\n const {\n hideDatePicker,\n hideTimePicker,\n hideDateTimePicker,\n isControllerOnly,\n getProps,\n props: { hasError },\n } = React.useContext(ControlledDateTimePickerContext);\n\n return (\n <StyledPickersIconsWrapperGrid hasError={hasError} isControllerOnly={isControllerOnly} getOwnerProps={getProps}>\n {!hideDatePicker && hideTimePicker && hideDateTimePicker ? <Calendar /> : null}\n {hideDatePicker && !hideTimePicker && hideDateTimePicker ? <TimeWheel /> : null}\n {hideDatePicker && hideTimePicker && !hideDateTimePicker ? <CalendarWithTimeWheel /> : null}\n </StyledPickersIconsWrapperGrid>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBnB;AAlBJ,mBAAkB;AAClB,yCAAgD;AAChD,qBAA8C;AAC9C,mCAAsC;AACtC,sBAAyB;AACzB,uBAA0B;AAEnB,MAAM,eAAe,MAAmB;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,IAAI,aAAAA,QAAM,WAAW,kEAA+B;AAEpD,SACE,6CAAC,gDAA8B,UAAoB,kBAAoC,eAAe,UACnG;AAAA,KAAC,kBAAkB,kBAAkB,qBAAqB,4CAAC,4BAAS,IAAK;AAAA,IACzE,kBAAkB,CAAC,kBAAkB,qBAAqB,4CAAC,8BAAU,IAAK;AAAA,IAC1E,kBAAkB,kBAAkB,CAAC,qBAAqB,4CAAC,sDAAsB,IAAK;AAAA,KACzF;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -62,6 +62,7 @@ const HoursList = () => {
|
|
|
62
62
|
currFocusDescriber,
|
|
63
63
|
trackFocusTimewheelCurrHour,
|
|
64
64
|
getProps,
|
|
65
|
+
readOnlyHelperMsgId,
|
|
65
66
|
props: { readOnly, applyAriaDisabled }
|
|
66
67
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
67
68
|
const handleCurrYearRef = (0, import_react.useCallback)(
|
|
@@ -87,8 +88,8 @@ const HoursList = () => {
|
|
|
87
88
|
);
|
|
88
89
|
const hasDisabledStyles = readOnly || applyAriaDisabled;
|
|
89
90
|
const arrowColor = !hasDisabledStyles ? ["brand-primary", "700"] : void 0;
|
|
90
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledWheelList, { onFocus: handleWheelFocus, onBlur: handleWheelBlur, children: [
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledWheelList, { onFocus: handleWheelFocus, onBlur: handleWheelBlur, getOwnerProps: getProps, children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
93
|
import_Styleds.StyledWheelChangeTimeBtn,
|
|
93
94
|
{
|
|
94
95
|
"aria-label": "subtract one hour",
|
|
@@ -107,7 +108,7 @@ const HoursList = () => {
|
|
|
107
108
|
) }),
|
|
108
109
|
visibleHours.map((hourString) => {
|
|
109
110
|
const key = `timewheel-hour-${hourString || ""}`;
|
|
110
|
-
if (!hourString) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, {}, key);
|
|
111
|
+
if (!hourString) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { getOwnerProps: getProps }, key);
|
|
111
112
|
const currHourTimeString = `${hourString}:${currMinuteNum} ${currMeridiem}`;
|
|
112
113
|
const isEmptyCurrValueCurrentListItem = !hours && (0, import_numberHelpers.convertToPositiveNumberIfPossible)(hourString) === currHourNum;
|
|
113
114
|
const isTheItemVisuallyInTheCenter = isEmptyCurrValueCurrentListItem || hours === hourString;
|
|
@@ -123,13 +124,13 @@ const HoursList = () => {
|
|
|
123
124
|
"aria-valuemin": 1,
|
|
124
125
|
"aria-valuemax": 12,
|
|
125
126
|
"aria-label": `${hourString} hours`,
|
|
126
|
-
"aria-disabled":
|
|
127
|
+
"aria-disabled": applyAriaDisabled || readOnly ? true : void 0,
|
|
128
|
+
"aria-describedby": readOnly ? readOnlyHelperMsgId : void 0,
|
|
127
129
|
"aria-invalid": isNotAValidSelection,
|
|
128
|
-
"aria-readonly": readOnly || applyAriaDisabled,
|
|
129
130
|
onKeyDown: isTheItemVisuallyInTheCenter ? handleCurrHourOnKeyDown : void 0,
|
|
130
131
|
innerRef: isTheItemVisuallyInTheCenter ? handleCurrYearRef : void 0
|
|
131
132
|
};
|
|
132
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
134
|
import_Styleds.StyledTimeBtn,
|
|
134
135
|
{
|
|
135
136
|
$isTheItemVisuallyInTheCenter: isTheItemVisuallyInTheCenter,
|
|
@@ -148,7 +149,7 @@ const HoursList = () => {
|
|
|
148
149
|
}
|
|
149
150
|
) }, key);
|
|
150
151
|
}),
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
153
|
import_Styleds.StyledWheelChangeTimeBtn,
|
|
153
154
|
{
|
|
154
155
|
"aria-label": "add one hour",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/TimeWheel/HoursList.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\nimport { ChevronSmallDown, ChevronSmallUp, type SvgIconT } from '@elliemae/ds-icons';\nimport React, { useCallback, useContext, useState } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { convertToPositiveNumberIfPossible } from '../../../utils/numberHelpers.js';\nimport { StyledTimeBtn, StyledWheelChangeTimeBtn, StyledWheelList, StyledWheelListItem } from './Styleds.js';\nimport { TimeWheelContext } from './TimeWheelContext.js';\n\nexport const HoursList = (): JSX.Element => {\n const {\n currHourNum,\n currMinuteNum,\n currMeridiem,\n visibleHours,\n handlePrevHour,\n handleNextHour,\n handleTimeWheelBtnChangeHours,\n handleCurrHourOnKeyDown,\n } = useContext(TimeWheelContext);\n const {\n prevHourBtnRef,\n currHourBtnRef,\n nextHourBtnRef,\n getIsDisabledTime,\n autoFocusHourTimeWheel,\n hours,\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusTimewheelCurrHour,\n getProps,\n props: { readOnly, applyAriaDisabled },\n } = useContext(ControlledDateTimePickerContext);\n\n const handleCurrYearRef = useCallback(\n (ButtonDomNode: HTMLDivElement) => {\n setTimeout(() => {\n currHourBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n ButtonDomNode?.focus?.();\n });\n },\n [currFocusDescriber, latestInteractionRegion, currHourBtnRef],\n );\n\n const [isFocusedWheel, setIsFocusedWheel] = useState(false);\n\n const handleWheelFocus = useCallback(() => {\n setIsFocusedWheel(true);\n trackFocusTimewheelCurrHour();\n }, [setIsFocusedWheel, trackFocusTimewheelCurrHour]);\n\n const handleWheelBlur = useCallback(\n (e: React.FocusEvent<HTMLDivElement>) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node)) setIsFocusedWheel(false);\n },\n [setIsFocusedWheel],\n );\n\n const hasDisabledStyles = readOnly || applyAriaDisabled;\n\n const arrowColor = !hasDisabledStyles ? (['brand-primary', '700'] as SvgIconT.ColorType) : undefined;\n return (\n <StyledWheelList onFocus={handleWheelFocus} onBlur={handleWheelBlur}>\n <StyledWheelListItem>\n <StyledWheelChangeTimeBtn\n aria-label=\"subtract one hour\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handlePrevHour}\n innerRef={prevHourBtnRef}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_HOUR}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getProps}\n tabIndex={-1}\n type=\"button\"\n >\n <ChevronSmallUp color={arrowColor} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n {visibleHours.map((hourString) => {\n const key = `timewheel-hour-${hourString || ''}`;\n if (!hourString) return <StyledWheelListItem key={key} />;\n const currHourTimeString = `${hourString}:${currMinuteNum} ${currMeridiem}`;\n\n const isEmptyCurrValueCurrentListItem = !hours && convertToPositiveNumberIfPossible(hourString) === currHourNum;\n const isTheItemVisuallyInTheCenter = isEmptyCurrValueCurrentListItem || hours === hourString;\n const isNotAValidSelection = getIsDisabledTime(currHourTimeString);\n const tabIndex = isTheItemVisuallyInTheCenter ? 0 : -1;\n const isSelected = hours.length === 2 && convertToPositiveNumberIfPossible(hourString) === currHourNum;\n const btnProps = {\n role: 'spinbutton',\n ...(isSelected && {\n 'aria-valuenow': convertToPositiveNumberIfPossible(hourString),\n 'aria-valuetext': `${hourString} hours`,\n }),\n 'aria-valuemin': 1,\n 'aria-valuemax': 12,\n 'aria-label': `${hourString} hours`,\n 'aria-disabled':
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport { ChevronSmallDown, ChevronSmallUp, type SvgIconT } from '@elliemae/ds-icons';\nimport React, { useCallback, useContext, useState } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../constants/index.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { convertToPositiveNumberIfPossible } from '../../../utils/numberHelpers.js';\nimport { StyledTimeBtn, StyledWheelChangeTimeBtn, StyledWheelList, StyledWheelListItem } from './Styleds.js';\nimport { TimeWheelContext } from './TimeWheelContext.js';\n\nexport const HoursList = (): JSX.Element => {\n const {\n currHourNum,\n currMinuteNum,\n currMeridiem,\n visibleHours,\n handlePrevHour,\n handleNextHour,\n handleTimeWheelBtnChangeHours,\n handleCurrHourOnKeyDown,\n } = useContext(TimeWheelContext);\n const {\n prevHourBtnRef,\n currHourBtnRef,\n nextHourBtnRef,\n getIsDisabledTime,\n autoFocusHourTimeWheel,\n hours,\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusTimewheelCurrHour,\n getProps,\n readOnlyHelperMsgId,\n props: { readOnly, applyAriaDisabled },\n } = useContext(ControlledDateTimePickerContext);\n\n const handleCurrYearRef = useCallback(\n (ButtonDomNode: HTMLDivElement) => {\n setTimeout(() => {\n currHourBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n ButtonDomNode?.focus?.();\n });\n },\n [currFocusDescriber, latestInteractionRegion, currHourBtnRef],\n );\n\n const [isFocusedWheel, setIsFocusedWheel] = useState(false);\n\n const handleWheelFocus = useCallback(() => {\n setIsFocusedWheel(true);\n trackFocusTimewheelCurrHour();\n }, [setIsFocusedWheel, trackFocusTimewheelCurrHour]);\n\n const handleWheelBlur = useCallback(\n (e: React.FocusEvent<HTMLDivElement>) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node)) setIsFocusedWheel(false);\n },\n [setIsFocusedWheel],\n );\n\n const hasDisabledStyles = readOnly || applyAriaDisabled;\n\n const arrowColor = !hasDisabledStyles ? (['brand-primary', '700'] as SvgIconT.ColorType) : undefined;\n return (\n <StyledWheelList onFocus={handleWheelFocus} onBlur={handleWheelBlur} getOwnerProps={getProps}>\n <StyledWheelListItem getOwnerProps={getProps}>\n <StyledWheelChangeTimeBtn\n aria-label=\"subtract one hour\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handlePrevHour}\n innerRef={prevHourBtnRef}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_HOUR}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getProps}\n tabIndex={-1}\n type=\"button\"\n >\n <ChevronSmallUp color={arrowColor} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n {visibleHours.map((hourString) => {\n const key = `timewheel-hour-${hourString || ''}`;\n if (!hourString) return <StyledWheelListItem key={key} getOwnerProps={getProps} />;\n const currHourTimeString = `${hourString}:${currMinuteNum} ${currMeridiem}`;\n\n const isEmptyCurrValueCurrentListItem = !hours && convertToPositiveNumberIfPossible(hourString) === currHourNum;\n const isTheItemVisuallyInTheCenter = isEmptyCurrValueCurrentListItem || hours === hourString;\n const isNotAValidSelection = getIsDisabledTime(currHourTimeString);\n const tabIndex = isTheItemVisuallyInTheCenter ? 0 : -1;\n const isSelected = hours.length === 2 && convertToPositiveNumberIfPossible(hourString) === currHourNum;\n const btnProps = {\n role: 'spinbutton',\n ...(isSelected && {\n 'aria-valuenow': convertToPositiveNumberIfPossible(hourString),\n 'aria-valuetext': `${hourString} hours`,\n }),\n 'aria-valuemin': 1,\n 'aria-valuemax': 12,\n 'aria-label': `${hourString} hours`,\n 'aria-disabled': applyAriaDisabled || readOnly ? true : undefined,\n 'aria-describedby': readOnly ? readOnlyHelperMsgId : undefined,\n 'aria-invalid': isNotAValidSelection,\n onKeyDown: isTheItemVisuallyInTheCenter ? handleCurrHourOnKeyDown : undefined,\n innerRef: isTheItemVisuallyInTheCenter ? handleCurrYearRef : undefined,\n };\n return (\n <StyledWheelListItem key={key} getOwnerProps={getProps}>\n <StyledTimeBtn\n $isTheItemVisuallyInTheCenter={isTheItemVisuallyInTheCenter}\n $isNotAValidSelection={isNotAValidSelection}\n $selected={isSelected}\n $isUnset={!hours}\n $readOnly={readOnly || applyAriaDisabled}\n $isFocusedWheel={isFocusedWheel}\n autoFocus={autoFocusHourTimeWheel && isTheItemVisuallyInTheCenter}\n data-testid={\n ControlledDateTimePickerDatatestid.TIMEWHEEL[isTheItemVisuallyInTheCenter ? 'CURRENT_HOUR' : 'HOUR']\n }\n onClick={(e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) =>\n handleTimeWheelBtnChangeHours(hourString, e)\n }\n tabIndex={tabIndex}\n {...btnProps}\n getOwnerProps={getProps}\n >\n {hourString}\n </StyledTimeBtn>\n </StyledWheelListItem>\n );\n })}\n <StyledWheelListItem getOwnerProps={getProps}>\n <StyledWheelChangeTimeBtn\n aria-label=\"add one hour\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleNextHour}\n innerRef={nextHourBtnRef}\n tabIndex={-1}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_HOUR}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getProps}\n type=\"button\"\n >\n <ChevronSmallDown color={arrowColor} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n </StyledWheelList>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgEnB;AA/DJ,sBAAgE;AAChE,mBAAyD;AACzD,uBAAmD;AACnD,yCAAgD;AAChD,2BAAkD;AAClD,qBAA8F;AAC9F,8BAAiC;AAE1B,MAAM,YAAY,MAAmB;AAC1C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,wCAAgB;AAC/B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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