@elliemae/ds-form-date-time-picker 3.80.0-next.8 → 3.80.0-next.80
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
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { DSButtonV2 } from "@elliemae/ds-button-v2";
|
|
3
3
|
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
-
import { css, styled } from "@elliemae/ds-system";
|
|
5
|
-
import {
|
|
4
|
+
import { css, styled, ariaDisabledInteractionCss } from "@elliemae/ds-system";
|
|
5
|
+
import {
|
|
6
|
+
DSControlledDateTimePickerName,
|
|
7
|
+
DSControlledDateTimePickerSlots,
|
|
8
|
+
FORM_DATE_TIME_PICKER_SLOTS
|
|
9
|
+
} from "../../../constants/index.js";
|
|
6
10
|
const makeDiagonalLine = (getColor) => css`
|
|
7
11
|
&:before {
|
|
8
12
|
position: absolute;
|
|
@@ -54,13 +58,19 @@ const StyledShadowWrapper = styled("div", {
|
|
|
54
58
|
name: DSControlledDateTimePickerName,
|
|
55
59
|
slot: DSControlledDateTimePickerSlots.CONTROLLER_COMPONENT.CALENDAR
|
|
56
60
|
})``;
|
|
57
|
-
const StyledCalendarWrapper = styled
|
|
61
|
+
const StyledCalendarWrapper = styled("div", {
|
|
62
|
+
name: DSControlledDateTimePickerName,
|
|
63
|
+
slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_WRAPPER
|
|
64
|
+
})`
|
|
58
65
|
display: grid;
|
|
59
66
|
min-width: 260px;
|
|
60
67
|
background-color: ${({ theme, $readOnlyStyles }) => $readOnlyStyles ? theme.colors.neutral["050"] : theme.colors.neutral["000"]};
|
|
61
68
|
grid-template-rows: auto auto;
|
|
62
69
|
`;
|
|
63
|
-
const StyledHeader = styled
|
|
70
|
+
const StyledHeader = styled("section", {
|
|
71
|
+
name: DSControlledDateTimePickerName,
|
|
72
|
+
slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER
|
|
73
|
+
})`
|
|
64
74
|
* {
|
|
65
75
|
margin: 0;
|
|
66
76
|
padding: 0;
|
|
@@ -105,7 +115,10 @@ const StyledHeaderButton = styled(DSButtonV2, {
|
|
|
105
115
|
background: ${({ theme }) => theme.colors.brand[200]};
|
|
106
116
|
}
|
|
107
117
|
`;
|
|
108
|
-
const StyledBody = styled
|
|
118
|
+
const StyledBody = styled("section", {
|
|
119
|
+
name: DSControlledDateTimePickerName,
|
|
120
|
+
slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_BODY
|
|
121
|
+
})`
|
|
109
122
|
padding: ${({ theme }) => theme.space.xxxs};
|
|
110
123
|
`;
|
|
111
124
|
const StyledDayBtn = styled(DSButtonV2, {
|
|
@@ -121,7 +134,8 @@ const StyledDayBtn = styled(DSButtonV2, {
|
|
|
121
134
|
border-color: transparent;
|
|
122
135
|
line-height: 1;
|
|
123
136
|
color: ${({ theme }) => theme.colors.neutral[800]};
|
|
124
|
-
cursor:
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
${({ $readOnlyStyles }) => $readOnlyStyles && ariaDisabledInteractionCss}
|
|
125
139
|
display: flex;
|
|
126
140
|
justify-content: center;
|
|
127
141
|
align-items: center;
|
|
@@ -494,7 +508,10 @@ const StyledWeekDaysListWrapper = styled(Grid, {
|
|
|
494
508
|
box-shadow: none;
|
|
495
509
|
}
|
|
496
510
|
`;
|
|
497
|
-
const StyledWeekDaysHeaderItem = styled
|
|
511
|
+
const StyledWeekDaysHeaderItem = styled("div", {
|
|
512
|
+
name: DSControlledDateTimePickerName,
|
|
513
|
+
slot: FORM_DATE_TIME_PICKER_SLOTS.CALENDAR_HEADER_WEEKLY_DAY_ITEM
|
|
514
|
+
})`
|
|
498
515
|
min-width: 2.4615rem;
|
|
499
516
|
display: flex;
|
|
500
517
|
justify-content: center;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/Styleds.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,KAAK,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,KAAK,QAAQ,kCAA8C;AACpE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAG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,MAC5C,kBAAkB,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -11,6 +11,7 @@ const usePopperTriggerLogic = ({
|
|
|
11
11
|
const {
|
|
12
12
|
props: { onPickerOpen, onPickerClose, disabled },
|
|
13
13
|
pickerButtonRef,
|
|
14
|
+
isWithTimeWheelToo,
|
|
14
15
|
trackFocusCalendarMetafocusedDay,
|
|
15
16
|
trackFocusCalendarPrevMonth,
|
|
16
17
|
trackFocusPicker,
|
|
@@ -19,8 +20,9 @@ const usePopperTriggerLogic = ({
|
|
|
19
20
|
} = useContext(ControlledDateTimePickerContext);
|
|
20
21
|
const [referenceElement, setReferenceElement] = useState(null);
|
|
21
22
|
const handleOnPickerOpen = useCallback(() => {
|
|
23
|
+
if (isWithTimeWheelToo) return;
|
|
22
24
|
onPickerOpen();
|
|
23
|
-
}, [onPickerOpen]);
|
|
25
|
+
}, [isWithTimeWheelToo, onPickerOpen]);
|
|
24
26
|
const openCalendar = useCallback(() => {
|
|
25
27
|
if (disabled) return;
|
|
26
28
|
if (focusedDay) trackFocusCalendarMetafocusedDay();
|
|
@@ -37,11 +39,18 @@ const usePopperTriggerLogic = ({
|
|
|
37
39
|
]);
|
|
38
40
|
const closeCalendar = useCallback(() => {
|
|
39
41
|
setShowCalendar(false);
|
|
40
|
-
onPickerClose();
|
|
42
|
+
if (!isWithTimeWheelToo) onPickerClose();
|
|
41
43
|
resetFocusedDayToStartDate();
|
|
42
44
|
trackFocusPicker();
|
|
43
45
|
resetMonthYear();
|
|
44
|
-
}, [
|
|
46
|
+
}, [
|
|
47
|
+
setShowCalendar,
|
|
48
|
+
isWithTimeWheelToo,
|
|
49
|
+
onPickerClose,
|
|
50
|
+
resetFocusedDayToStartDate,
|
|
51
|
+
trackFocusPicker,
|
|
52
|
+
resetMonthYear
|
|
53
|
+
]);
|
|
45
54
|
const handleToggleCalendar = useCallback(() => {
|
|
46
55
|
const isOpening = !showCalendar;
|
|
47
56
|
if (isOpening) openCalendar();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/usePopperTriggerLogic.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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,YAAY,WAAW;ACIvB,SAAS,SAAS,aAAa,UAAU,kBAAkB;AAE3D,SAAS,uCAAuC;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,IAAI,WAAW,+BAA+B;AAC9C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAmC,IAAI;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,SAAS,aAAa,UAAU,kBAAkB;AAE3D,SAAS,uCAAuC;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,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAmC,IAAI;AAKvF,QAAM,qBAAqB,YAAY,MAAM;AAC3C,QAAI,mBAAoB;AACxB,iBAAa;AAAA,EACf,GAAG,CAAC,oBAAoB,YAAY,CAAC;AAErC,QAAM,eAAe,YAAY,MAAM;AACrC,QAAI,SAAU;AACd,QAAI,WAAY,kCAAiC;AAAA,QAC5C,YAAW,MAAM,4BAA4B,CAAC;AACnD,oBAAgB,IAAI;AACpB,uBAAmB;AAAA,EACrB,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,gBAAgB,YAAY,MAAM;AACtC,oBAAgB,KAAK;AACrB,QAAI,CAAC,mBAAoB,eAAc;AACvC,+BAA2B;AAC3B,qBAAiB;AACjB,mBAAe;AAAA,EACjB,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,uBAAuB,YAAY,MAAM;AAC7C,UAAM,YAAY,CAAC;AACnB,QAAI,UAAW,cAAa;AAAA,QACvB,eAAc;AAAA,EACrB,GAAG,CAAC,eAAe,cAAc,YAAY,CAAC;AAE9C,QAAM,sBAAsB;AAAA,IAC1B,CAAC,WAA8B;AAC7B,sBAAgB,UAAU;AAC1B,0BAAoB,MAAM;AAC1B,UAAI,4BAA4B,iBAAiB,uBAAuB,mBAAoB,SAAQ,MAAM;AAAA,IAC5G;AAAA,IACA,CAAC,oBAAoB,yBAAyB,eAAe;AAAA,EAC/D;AACA,QAAM,2BAA2B;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,SAAO;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
|
}
|
|
@@ -17,13 +17,16 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
17
17
|
} = useContext(CalendarWithTimeWheelContext);
|
|
18
18
|
const {
|
|
19
19
|
getProps,
|
|
20
|
-
props: { tabIndex }
|
|
20
|
+
props: { tabIndex, applyAriaDisabled, readOnly }
|
|
21
21
|
} = useContext(ControlledDateTimePickerContext);
|
|
22
22
|
return useMemo(
|
|
23
23
|
() => /* @__PURE__ */ jsx(
|
|
24
24
|
StyledIconTriggerButton,
|
|
25
25
|
{
|
|
26
26
|
"aria-label": `date time picker context menu trigger, ${ariaCurrentValueForInputs}`,
|
|
27
|
+
applyAriaDisabled,
|
|
28
|
+
readOnly,
|
|
29
|
+
onDeliberateActivationWhileSoftLocked: handleToggleCalendarWithTimeWheel,
|
|
27
30
|
buttonType: "icon",
|
|
28
31
|
type: "button",
|
|
29
32
|
size: BUTTON_SIZES.M,
|
|
@@ -39,6 +42,8 @@ const CalendarWithTimeWheelIconTrigger = () => {
|
|
|
39
42
|
),
|
|
40
43
|
[
|
|
41
44
|
ariaCurrentValueForInputs,
|
|
45
|
+
applyAriaDisabled,
|
|
46
|
+
readOnly,
|
|
42
47
|
disabled,
|
|
43
48
|
getProps,
|
|
44
49
|
handlePickerIconKeyDown,
|
package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2Cf;AA3CR,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,YAAY,eAAe;AACpC,SAAS,uCAAuC;AAChD,SAAS,0CAA0C;AACnD,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AAKjC,MAAM,mCAAmC,MAAmB;AACjE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,4BAA4B;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,mBAAmB,SAAS;AAAA,EACjD,IAAI,WAAW,+BAA+B;AAC9C,SAAO;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,aAAa;AAAA,QACnB,UAAU;AAAA,QACV;AAAA,QACA,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,mCAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,eAAe;AAAA,QAEf,8BAAC,cAAW,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
|
}
|
|
@@ -12,9 +12,10 @@ const PickersIcons = () => {
|
|
|
12
12
|
hideTimePicker,
|
|
13
13
|
hideDateTimePicker,
|
|
14
14
|
isControllerOnly,
|
|
15
|
+
getProps,
|
|
15
16
|
props: { hasError }
|
|
16
17
|
} = React2.useContext(ControlledDateTimePickerContext);
|
|
17
|
-
return /* @__PURE__ */ jsxs(StyledPickersIconsWrapperGrid, { hasError, isControllerOnly, children: [
|
|
18
|
+
return /* @__PURE__ */ jsxs(StyledPickersIconsWrapperGrid, { hasError, isControllerOnly, getOwnerProps: getProps, children: [
|
|
18
19
|
!hideDatePicker && hideTimePicker && hideDateTimePicker ? /* @__PURE__ */ jsx(Calendar, {}) : null,
|
|
19
20
|
hideDatePicker && !hideTimePicker && hideDateTimePicker ? /* @__PURE__ */ jsx(TimeWheel, {}) : null,
|
|
20
21
|
hideDatePicker && hideTimePicker && !hideDateTimePicker ? /* @__PURE__ */ jsx(CalendarWithTimeWheel, {}) : null
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Pickers/PickersIcons.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkBnB,SAC6D,KAD7D;AAlBJ,OAAOA,YAAW;AAClB,SAAS,uCAAuC;AAChD,SAAS,qCAAqC;AAC9C,SAAS,6BAA6B;AACtC,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAEnB,MAAM,eAAe,MAAmB;AAC7C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,IAAIA,OAAM,WAAW,+BAA+B;AAEpD,SACE,qBAAC,iCAA8B,UAAoB,kBAAoC,eAAe,UACnG;AAAA,KAAC,kBAAkB,kBAAkB,qBAAqB,oBAAC,YAAS,IAAK;AAAA,IACzE,kBAAkB,CAAC,kBAAkB,qBAAqB,oBAAC,aAAU,IAAK;AAAA,IAC1E,kBAAkB,kBAAkB,CAAC,qBAAqB,oBAAC,yBAAsB,IAAK;AAAA,KACzF;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -29,6 +29,7 @@ const HoursList = () => {
|
|
|
29
29
|
currFocusDescriber,
|
|
30
30
|
trackFocusTimewheelCurrHour,
|
|
31
31
|
getProps,
|
|
32
|
+
readOnlyHelperMsgId,
|
|
32
33
|
props: { readOnly, applyAriaDisabled }
|
|
33
34
|
} = useContext(ControlledDateTimePickerContext);
|
|
34
35
|
const handleCurrYearRef = useCallback(
|
|
@@ -54,8 +55,8 @@ const HoursList = () => {
|
|
|
54
55
|
);
|
|
55
56
|
const hasDisabledStyles = readOnly || applyAriaDisabled;
|
|
56
57
|
const arrowColor = !hasDisabledStyles ? ["brand-primary", "700"] : void 0;
|
|
57
|
-
return /* @__PURE__ */ jsxs(StyledWheelList, { onFocus: handleWheelFocus, onBlur: handleWheelBlur, children: [
|
|
58
|
-
/* @__PURE__ */ jsx(StyledWheelListItem, { children: /* @__PURE__ */ jsx(
|
|
58
|
+
return /* @__PURE__ */ jsxs(StyledWheelList, { onFocus: handleWheelFocus, onBlur: handleWheelBlur, getOwnerProps: getProps, children: [
|
|
59
|
+
/* @__PURE__ */ jsx(StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
59
60
|
StyledWheelChangeTimeBtn,
|
|
60
61
|
{
|
|
61
62
|
"aria-label": "subtract one hour",
|
|
@@ -74,7 +75,7 @@ const HoursList = () => {
|
|
|
74
75
|
) }),
|
|
75
76
|
visibleHours.map((hourString) => {
|
|
76
77
|
const key = `timewheel-hour-${hourString || ""}`;
|
|
77
|
-
if (!hourString) return /* @__PURE__ */ jsx(StyledWheelListItem, {}, key);
|
|
78
|
+
if (!hourString) return /* @__PURE__ */ jsx(StyledWheelListItem, { getOwnerProps: getProps }, key);
|
|
78
79
|
const currHourTimeString = `${hourString}:${currMinuteNum} ${currMeridiem}`;
|
|
79
80
|
const isEmptyCurrValueCurrentListItem = !hours && convertToPositiveNumberIfPossible(hourString) === currHourNum;
|
|
80
81
|
const isTheItemVisuallyInTheCenter = isEmptyCurrValueCurrentListItem || hours === hourString;
|
|
@@ -90,13 +91,13 @@ const HoursList = () => {
|
|
|
90
91
|
"aria-valuemin": 1,
|
|
91
92
|
"aria-valuemax": 12,
|
|
92
93
|
"aria-label": `${hourString} hours`,
|
|
93
|
-
"aria-disabled":
|
|
94
|
+
"aria-disabled": applyAriaDisabled || readOnly ? true : void 0,
|
|
95
|
+
"aria-describedby": readOnly ? readOnlyHelperMsgId : void 0,
|
|
94
96
|
"aria-invalid": isNotAValidSelection,
|
|
95
|
-
"aria-readonly": readOnly || applyAriaDisabled,
|
|
96
97
|
onKeyDown: isTheItemVisuallyInTheCenter ? handleCurrHourOnKeyDown : void 0,
|
|
97
98
|
innerRef: isTheItemVisuallyInTheCenter ? handleCurrYearRef : void 0
|
|
98
99
|
};
|
|
99
|
-
return /* @__PURE__ */ jsx(StyledWheelListItem, { children: /* @__PURE__ */ jsx(
|
|
100
|
+
return /* @__PURE__ */ jsx(StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
100
101
|
StyledTimeBtn,
|
|
101
102
|
{
|
|
102
103
|
$isTheItemVisuallyInTheCenter: isTheItemVisuallyInTheCenter,
|
|
@@ -115,7 +116,7 @@ const HoursList = () => {
|
|
|
115
116
|
}
|
|
116
117
|
) }, key);
|
|
117
118
|
}),
|
|
118
|
-
/* @__PURE__ */ jsx(StyledWheelListItem, { children: /* @__PURE__ */ jsx(
|
|
119
|
+
/* @__PURE__ */ jsx(StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
119
120
|
StyledWheelChangeTimeBtn,
|
|
120
121
|
{
|
|
121
122
|
"aria-label": "add one hour",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/TimeWheel/HoursList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 </StyledWheelChangeTim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oB;AAAA,MAC/D;AACA,aACE,oBAAC,uBAA8B,eAAe,UAC5C;AAAA,QAAC;AAAA;AAAA,UACC,+BAA+B;AAAA,UAC/B,uBAAuB;AAAA,UACvB,WAAW;AAAA,UACX,UAAU,CAAC;AAAA,UACX,WAAW,YAAY;AAAA,UACvB,iBAAiB;AAAA,UACjB,WAAW,0BAA0B;AAAA,UACrC,eACE,mCAAmC,UAAU,+BAA+B,iBAAiB,MAAM;AAAA,UAErG,SAAS,CAAC,MACR,8BAA8B,YAAY,CAAC;AAAA,UAE7C;AAAA,UACC,GAAG;AAAA,UACJ,eAAe;AAAA,UAEd;AAAA;AAAA,MACH,KApBwB,GAqB1B;AAAA,IAEJ,CAAC;AAAA,IACD,oBAAC,uBAAoB,eAAe,UAClC;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,UAAU;AAAA,QACV,eAAa,mCAAmC,UAAU;AAAA,QAC1D;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf,MAAK;AAAA,QAEL,8BAAC,oBAAiB,OAAO,YAAY;AAAA;AAAA,IACvC,GACF;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -24,6 +24,7 @@ const MeridiemA11yLayer = () => {
|
|
|
24
24
|
currMeridiemBtnRef,
|
|
25
25
|
meridiem,
|
|
26
26
|
instanceUid,
|
|
27
|
+
readOnlyHelperMsgId,
|
|
27
28
|
latestInteractionRegion,
|
|
28
29
|
currFocusDescriber,
|
|
29
30
|
getIsDisabledTime,
|
|
@@ -52,7 +53,8 @@ const MeridiemA11yLayer = () => {
|
|
|
52
53
|
role: "listbox",
|
|
53
54
|
"aria-label": "Meridiem",
|
|
54
55
|
"aria-orientation": "vertical",
|
|
55
|
-
"aria-disabled":
|
|
56
|
+
"aria-disabled": applyAriaDisabled || readOnly ? true : void 0,
|
|
57
|
+
"aria-describedby": readOnly ? readOnlyHelperMsgId : void 0,
|
|
56
58
|
"aria-invalid": isCurrentMeridiemInvalid,
|
|
57
59
|
"aria-activedescendant": isAmCurrent ? amId : pmId,
|
|
58
60
|
tabIndex: 0,
|
|
@@ -88,7 +90,7 @@ const MeridiemVisualLayer = ({ isFocusedWheel }) => {
|
|
|
88
90
|
const hasDisabledStyles = readOnly || applyAriaDisabled;
|
|
89
91
|
const arrowColor = !hasDisabledStyles ? ["brand-primary", "700"] : void 0;
|
|
90
92
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
-
/* @__PURE__ */ jsx(StyledWheelListItem, { children: /* @__PURE__ */ jsx(
|
|
93
|
+
/* @__PURE__ */ jsx(StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
92
94
|
StyledWheelChangeTimeBtn,
|
|
93
95
|
{
|
|
94
96
|
"aria-label": "set am meridiem",
|
|
@@ -108,8 +110,8 @@ const MeridiemVisualLayer = ({ isFocusedWheel }) => {
|
|
|
108
110
|
children: /* @__PURE__ */ jsx(ChevronSmallUp, { color: arrowColor })
|
|
109
111
|
}
|
|
110
112
|
) }),
|
|
111
|
-
currMeridiem === "AM" || currMeridiem === "" ? /* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true" }) : null,
|
|
112
|
-
/* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
113
|
+
currMeridiem === "AM" || currMeridiem === "" ? /* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true", getOwnerProps: getProps }) : null,
|
|
114
|
+
/* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true", getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
113
115
|
StyledTimeBtn,
|
|
114
116
|
{
|
|
115
117
|
$isTheItemVisuallyInTheCenter: isAmCurrent,
|
|
@@ -127,7 +129,7 @@ const MeridiemVisualLayer = ({ isFocusedWheel }) => {
|
|
|
127
129
|
children: "AM"
|
|
128
130
|
}
|
|
129
131
|
) }),
|
|
130
|
-
/* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
132
|
+
/* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true", getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
131
133
|
StyledTimeBtn,
|
|
132
134
|
{
|
|
133
135
|
$isTheItemVisuallyInTheCenter: isPmCurrent,
|
|
@@ -145,8 +147,8 @@ const MeridiemVisualLayer = ({ isFocusedWheel }) => {
|
|
|
145
147
|
children: "PM"
|
|
146
148
|
}
|
|
147
149
|
) }),
|
|
148
|
-
currMeridiem === "PM" ? /* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true" }) : null,
|
|
149
|
-
/* @__PURE__ */ jsx(StyledWheelListItem, { children: /* @__PURE__ */ jsx(
|
|
150
|
+
currMeridiem === "PM" ? /* @__PURE__ */ jsx(StyledWheelListItem, { "aria-hidden": "true", getOwnerProps: getProps }) : null,
|
|
151
|
+
/* @__PURE__ */ jsx(StyledWheelListItem, { getOwnerProps: getProps, children: /* @__PURE__ */ jsx(
|
|
150
152
|
StyledWheelChangeTimeBtn,
|
|
151
153
|
{
|
|
152
154
|
"aria-label": "set pm meridiem",
|
|
@@ -170,7 +172,7 @@ const MeridiemVisualLayer = ({ isFocusedWheel }) => {
|
|
|
170
172
|
};
|
|
171
173
|
const MeridiemList = () => {
|
|
172
174
|
const [isFocusedWheel, setIsFocusedWheel] = useState(false);
|
|
173
|
-
const { trackFocusTimewheelCurrMeridiem } = useContext(ControlledDateTimePickerContext);
|
|
175
|
+
const { trackFocusTimewheelCurrMeridiem, getProps } = useContext(ControlledDateTimePickerContext);
|
|
174
176
|
const handleWheelFocus = useCallback(() => {
|
|
175
177
|
setIsFocusedWheel(true);
|
|
176
178
|
trackFocusTimewheelCurrMeridiem();
|
|
@@ -181,7 +183,7 @@ const MeridiemList = () => {
|
|
|
181
183
|
},
|
|
182
184
|
[setIsFocusedWheel]
|
|
183
185
|
);
|
|
184
|
-
return /* @__PURE__ */ jsxs(StyledWheelList, { onFocus: handleWheelFocus, onBlur: handleWheelBlur, children: [
|
|
186
|
+
return /* @__PURE__ */ jsxs(StyledWheelList, { onFocus: handleWheelFocus, onBlur: handleWheelBlur, getOwnerProps: getProps, children: [
|
|
185
187
|
/* @__PURE__ */ jsx(MeridiemA11yLayer, {}),
|
|
186
188
|
/* @__PURE__ */ jsx(MeridiemVisualLayer, { isFocusedWheel })
|
|
187
189
|
] });
|