@new-black/lyra 1.29.0-next.1 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/components/inputs/date-picker/date-picker.d.ts +40 -2
  2. package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
  3. package/dist/components/inputs/date-picker/date-range-picker.d.ts +40 -2
  4. package/dist/components/inputs/date-picker/date-range-picker.d.ts.map +1 -1
  5. package/dist/components/inputs/number-field/number-field.d.ts +40 -2
  6. package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
  7. package/dist/components/inputs/search-field/search-field.d.ts +40 -2
  8. package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
  9. package/dist/components/inputs/shared/input-footer.d.ts +14 -1
  10. package/dist/components/inputs/shared/input-footer.d.ts.map +1 -1
  11. package/dist/components/inputs/shared/styles.d.ts +45 -0
  12. package/dist/components/inputs/shared/styles.d.ts.map +1 -1
  13. package/dist/components/inputs/tag-input/tag-input.d.ts +40 -2
  14. package/dist/components/inputs/tag-input/tag-input.d.ts.map +1 -1
  15. package/dist/components/inputs/text-field/text-field.d.ts +41 -3
  16. package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
  17. package/dist/components/inputs/text-field-area/text-field-area.d.ts +39 -1
  18. package/dist/components/inputs/text-field-area/text-field-area.d.ts.map +1 -1
  19. package/dist/components/inputs/text-field-area/text-field-area.types.d.ts +2 -2
  20. package/dist/components/inputs/text-field-area/text-field-area.types.d.ts.map +1 -1
  21. package/dist/components/inputs/time-field/time-field.d.ts +40 -2
  22. package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
  23. package/dist/components/lists/shared-list-item.d.ts +6 -6
  24. package/dist/components/svg-icon/svg-icon.d.ts +1 -1
  25. package/dist/components/text/text.d.ts +7 -0
  26. package/dist/components/text/text.d.ts.map +1 -1
  27. package/dist/components/text/text.styles.d.ts +7 -0
  28. package/dist/components/text/text.styles.d.ts.map +1 -1
  29. package/dist/index.css +2 -0
  30. package/dist/lyra.css +1 -1
  31. package/dist/lyra1133.cjs.map +1 -1
  32. package/dist/lyra1134.js.map +1 -1
  33. package/dist/lyra1135.cjs +1 -1
  34. package/dist/lyra1135.cjs.map +1 -1
  35. package/dist/lyra1136.js +36 -33
  36. package/dist/lyra1136.js.map +1 -1
  37. package/dist/lyra1137.cjs.map +1 -1
  38. package/dist/lyra1138.js.map +1 -1
  39. package/dist/lyra757.cjs +1 -1
  40. package/dist/lyra757.cjs.map +1 -1
  41. package/dist/lyra758.js +1 -0
  42. package/dist/lyra758.js.map +1 -1
  43. package/dist/lyra790.cjs +1 -1
  44. package/dist/lyra790.cjs.map +1 -1
  45. package/dist/lyra791.js +8 -0
  46. package/dist/lyra791.js.map +1 -1
  47. package/dist/lyra792.cjs +1 -1
  48. package/dist/lyra792.cjs.map +1 -1
  49. package/dist/lyra793.js +28 -18
  50. package/dist/lyra793.js.map +1 -1
  51. package/dist/lyra808.cjs.map +1 -1
  52. package/dist/lyra809.js.map +1 -1
  53. package/dist/lyra813.cjs.map +1 -1
  54. package/dist/lyra814.js.map +1 -1
  55. package/dist/lyra822.cjs.map +1 -1
  56. package/dist/lyra823.js.map +1 -1
  57. package/dist/lyra824.cjs +1 -1
  58. package/dist/lyra824.cjs.map +1 -1
  59. package/dist/lyra825.js +27 -24
  60. package/dist/lyra825.js.map +1 -1
  61. package/dist/lyra831.cjs.map +1 -1
  62. package/dist/lyra832.js.map +1 -1
  63. package/package.json +1 -1
package/dist/lyra793.js CHANGED
@@ -6,23 +6,33 @@ import { sharedInputStyles as r } from "./lyra791.js";
6
6
  import "./lyra794.js";
7
7
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
8
8
  // src/components/inputs/shared/input-footer.tsx
9
- var s = ({ customHtmlValidationMessages: s, description: c, errorMessage: l, hideInputFooter: u = !1 }) => {
10
- let { description: d, errorMessage: f } = r();
11
- return u ? null : /* @__PURE__ */ o(i, { children: [l ? /* @__PURE__ */ a(n, {
12
- className: f(),
13
- variant: "body-small",
14
- color: "error",
15
- slot: "errorMessage",
16
- children: l
17
- }) : /* @__PURE__ */ a(t, {
18
- className: f(),
19
- children: ({ defaultChildren: t, validationDetails: n }) => e(n, s) || t
20
- }), c && /* @__PURE__ */ a(n, {
21
- className: d(),
22
- variant: "body-small",
23
- color: "secondary",
24
- slot: "description",
25
- children: c
26
- })] });
9
+ var s = ({ customHtmlValidationMessages: s, description: c, errorMessage: l, hideInputFooter: u = !1, isInvalid: d = !1, warningMessage: f }) => {
10
+ let { description: p, errorMessage: m, warningMessage: h } = r(), g = !!f && !l && !d;
11
+ return u ? null : /* @__PURE__ */ o(i, { children: [
12
+ l ? /* @__PURE__ */ a(n, {
13
+ className: m(),
14
+ variant: "body-small",
15
+ color: "error",
16
+ slot: "errorMessage",
17
+ children: l
18
+ }) : /* @__PURE__ */ a(t, {
19
+ className: m(),
20
+ children: ({ defaultChildren: t, validationDetails: n }) => e(n, s) || t
21
+ }),
22
+ g ? /* @__PURE__ */ a(n, {
23
+ className: h(),
24
+ variant: "body-small",
25
+ color: "warning",
26
+ role: "status",
27
+ children: f
28
+ }) : null,
29
+ c && /* @__PURE__ */ a(n, {
30
+ className: p(),
31
+ variant: "body-small",
32
+ color: "secondary",
33
+ slot: "description",
34
+ children: c
35
+ })
36
+ ] });
27
37
  };
28
38
  export { s as InputFooter };
@@ -1 +1 @@
1
- {"version":3,"file":"lyra793.js","names":["_Fragment","FieldError","$1f3c3b1a70cec653$export$f551688fc98f2e09","InputFooter","descriptionStyle","errorMessageStyle","sharedInputStyles","hideInputFooter","Fragment","errorMessage","Text","getCustomHtmlValidationMessage","validationDetails","customHtmlValidationMessages","defaultChildren","description"],"sources":["../src/components/inputs/shared/input-footer.tsx"],"sourcesContent":["import { FieldError } from \"react-aria-components\";\n\nimport { getCustomHtmlValidationMessage } from \"../../../utils/helpers\";\nimport { Text } from \"../../text\";\n\nimport { sharedInputStyles } from \".\";\n\nexport type InputFooterProps = {\n customHtmlValidationMessages?: Partial<Record<keyof ValidityState, string>>;\n description?: string;\n errorMessage?: string;\n hideInputFooter?: boolean; // Defaults to false\n};\n\nexport const InputFooter = ({\n customHtmlValidationMessages,\n description,\n errorMessage,\n hideInputFooter = false,\n}: InputFooterProps) => {\n const { description: descriptionStyle, errorMessage: errorMessageStyle } = sharedInputStyles();\n\n if (hideInputFooter) return null;\n\n return (\n <>\n {errorMessage ? (\n <Text\n className={errorMessageStyle()}\n variant=\"body-small\"\n color=\"error\"\n slot=\"errorMessage\"\n >\n {errorMessage}\n </Text>\n ) : (\n <FieldError className={errorMessageStyle()}>\n {({ defaultChildren, validationDetails }) => {\n const customHtmlValidationMessage = getCustomHtmlValidationMessage(\n validationDetails,\n customHtmlValidationMessages,\n );\n return customHtmlValidationMessage || defaultChildren;\n }}\n </FieldError>\n )}\n {description && (\n <Text\n className={descriptionStyle()}\n variant=\"body-small\"\n color=\"secondary\"\n slot=\"description\"\n >\n {description}\n </Text>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;AAcA,IAAaG,KAAe,EAC1B,iCACA,gBACA,iBACA,qBAAkB,SACI;CACtB,IAAM,EAAE,aAAaC,GAAkB,cAAcC,MAAsBC,EAAkB;CAI7F,OAFIC,IAAwB,OAG1B,kBAAAP,GAAA,EAAA,UAAA,CACGS,IACC,kBAACC,GAAD;EACE,WAAWL,EAAkB;EAC7B,SAAQ;EACR,OAAM;EACN,MAAK;EAEJ,UAAAI;CACG,CAAA,IAEN,kBAACR,GAAD;EAAY,WAAWI,EAAkB;EACrC,WAAA,EAAE,oBAAiB,2BACiBM,EAClCC,GACAC,CAEK,KAA+BC;CAE9B,CAAA,GAEbC,KACC,kBAACL,GAAD;EACE,WAAWN,EAAiB;EAC5B,SAAQ;EACR,OAAM;EACN,MAAK;EAEJ,UAAAW;CACG,CAAA,CAER,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"lyra793.js","names":["_Fragment","FieldError","$1f3c3b1a70cec653$export$f551688fc98f2e09","InputFooter","descriptionStyle","errorMessageStyle","warningMessageStyle","sharedInputStyles","showWarning","warningMessage","errorMessage","isInvalid","hideInputFooter","Fragment","Text","getCustomHtmlValidationMessage","validationDetails","customHtmlValidationMessages","defaultChildren","description"],"sources":["../src/components/inputs/shared/input-footer.tsx"],"sourcesContent":["import { FieldError } from \"react-aria-components\";\n\nimport { getCustomHtmlValidationMessage } from \"../../../utils/helpers\";\nimport { Text } from \"../../text\";\n\nimport { sharedInputStyles } from \".\";\n\nexport type InputFooterProps = {\n customHtmlValidationMessages?: Partial<Record<keyof ValidityState, string>>;\n description?: string;\n errorMessage?: string;\n hideInputFooter?: boolean; // Defaults to false\n};\n\nexport type InputWarningProps = {\n /**\n * Non-blocking warning shown below the field with a warning border. Unlike `errorMessage` it\n * does not mark the field as invalid, so the form can still be submitted. Hidden while the\n * field is invalid.\n */\n warningMessage?: string;\n};\n\ntype InputFooterComponentProps = InputFooterProps &\n InputWarningProps & {\n /** Whether the field is currently invalid; suppresses `warningMessage`. */\n isInvalid?: boolean;\n };\n\nexport const InputFooter = ({\n customHtmlValidationMessages,\n description,\n errorMessage,\n hideInputFooter = false,\n isInvalid = false,\n warningMessage,\n}: InputFooterComponentProps) => {\n const {\n description: descriptionStyle,\n errorMessage: errorMessageStyle,\n warningMessage: warningMessageStyle,\n } = sharedInputStyles();\n\n const showWarning = !!warningMessage && !errorMessage && !isInvalid;\n\n if (hideInputFooter) return null;\n\n return (\n <>\n {errorMessage ? (\n <Text\n className={errorMessageStyle()}\n variant=\"body-small\"\n color=\"error\"\n slot=\"errorMessage\"\n >\n {errorMessage}\n </Text>\n ) : (\n <FieldError className={errorMessageStyle()}>\n {({ defaultChildren, validationDetails }) => {\n const customHtmlValidationMessage = getCustomHtmlValidationMessage(\n validationDetails,\n customHtmlValidationMessages,\n );\n return customHtmlValidationMessage || defaultChildren;\n }}\n </FieldError>\n )}\n {showWarning ? (\n <Text className={warningMessageStyle()} variant=\"body-small\" color=\"warning\" role=\"status\">\n {warningMessage}\n </Text>\n ) : null}\n {description && (\n <Text\n className={descriptionStyle()}\n variant=\"body-small\"\n color=\"secondary\"\n slot=\"description\"\n >\n {description}\n </Text>\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;AA6BA,IAAaG,KAAe,EAC1B,iCACA,gBACA,iBACA,qBAAkB,IAClB,eAAY,IACZ,wBAC+B;CAC/B,IAAM,EACJ,aAAaC,GACb,cAAcC,GACd,gBAAgBC,MACdC,EAAkB,GAEhBC,IAAc,CAAC,CAACC,KAAkB,CAACC,KAAgB,CAACC;CAI1D,OAFIC,IAAwB,OAG1B,kBAAAZ,GAAA,EAAA,UAAA;EACGU,IACC,kBAACI,GAAD;GACE,WAAWT,EAAkB;GAC7B,SAAQ;GACR,OAAM;GACN,MAAK;GAEJ,UAAAK;EACG,CAAA,IAEN,kBAACT,GAAD;GAAY,WAAWI,EAAkB;GACrC,WAAA,EAAE,oBAAiB,2BACiBU,EAClCC,GACAC,CAEK,KAA+BC;EAE9B,CAAA;EAEbV,IACC,kBAACM,GAAD;GAAM,WAAWR,EAAoB;GAAG,SAAQ;GAAa,OAAM;GAAU,MAAK;GAC/E,UAAAG;EACG,CAAA,IACJ;EACHU,KACC,kBAACL,GAAD;GACE,WAAWV,EAAiB;GAC5B,SAAQ;GACR,OAAM;GACN,MAAK;GAEJ,UAAAe;EACG,CAAA;CAER,EAAA,CAAA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"lyra808.cjs","names":["useContextProps","DatePickerContext","useState","useMemo","shouldRenderInputHeader","useCallback","sharedInputStyles","AriaDatePicker","_Fragment","Popover","Calendar","CalendarGrid","DatePickerCalendarGridHeader","fixedForwardRef","dateFieldStyles","useDictionary","useContext","DatePickerStateContext","useRef","InputHeader","Group","DateInput","DateSegment","Tooltip","AriaButton","SvgIcon","InputFooter","datePickerHeaderStyles","CalendarStateContext","MonthPicker","YearPicker","dataPickerCalendarGridStyles","CalendarGridBody","CalendarCell","require_helpers","require_utils","require_Button","require_Calendar","require_Group","require_DateField","require_DatePicker","require_dictionary_provider","require_svg_icon","require_tooltip","require_styles","require_input_header","require_input_footer","require_popover","require_helpers$1","require_date_picker_styles","require_shared","react","react_jsx_runtime","DatePicker","props","ref","internalValue","setInternalValue","value","defaultValue","isControlled","hasInputHeader","hideHintLabel","hideInputHeader","label","handleChange","newValue","onChange","startSlot","controlledProps","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","DatePickerInput","e","state","isDisabled","disableClearLogic","DatePickerHeader","DatePickerCalendarGridBody","outerEndSlot","segmentStyles","context","calendarButtonRef","inputField","isFocusWithin","isInvalid","errorMessage","input","segment","clear","buttonExcludedFromTabOrder","setValue","button","isFocusVisible","buttons","focusedDate","setFocusedDate","bodyCell"],"sources":["../src/components/inputs/date-picker/date-picker.tsx"],"sourcesContent":["import {\n ElementRef,\n ForwardedRef,\n KeyboardEventHandler,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { JSX } from \"react\";\nimport {\n Button as AriaButton,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarStateContext,\n DateInput,\n DatePicker as AriaDatePicker,\n DatePickerContext,\n DatePickerProps as AriaDatePickerProps,\n DatePickerStateContext,\n DateSegment,\n DateValue,\n Group,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { Popover } from \"../../overlays\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { Tooltip } from \"../../tooltip\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nimport {\n dataPickerCalendarGridStyles,\n dateFieldStyles,\n datePickerHeaderStyles,\n} from \"./date-picker.styles\";\nimport { DatePickerCalendarGridHeader, MonthPicker, YearPicker } from \"./shared\";\n\nexport type DatePickerProps<T extends DateValue> = Omit<AriaDatePickerProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasStartSlot\" | \"hasEndSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n disableClearLogic?: boolean;\n };\n\nexport type { DateValue };\n\nconst _DatePicker = <T extends DateValue>(\n {\n className,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth = true,\n granularity = \"day\",\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: DatePickerProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaDatePicker>>,\n) => {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n const { defaultValue, isInvalid, isRequired, onChange, value } = props;\n\n const [internalValue, setInternalValue] = useState(value || defaultValue || null);\n\n // Sync internal value with external value prop and handle resets\n // Only run this effect when we're in controlled mode (value prop is explicitly passed)\n const isControlled = \"value\" in props;\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n setInternalValue(value || null);\n }, [value, isControlled]);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const handleChange = useCallback(\n (newValue: Parameters<NonNullable<typeof onChange>>[0]) => {\n setInternalValue(newValue as typeof internalValue);\n\n if (!newValue || newValue.year.toString().length === 4) {\n onChange?.(newValue);\n }\n },\n [onChange],\n );\n\n const { outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const controlledProps = isControlled ? { value: internalValue, onChange: handleChange } : {};\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaDatePicker\n {...props}\n {...controlledProps}\n granularity={granularity}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled, state }) => (\n <>\n <DatePickerInput\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n startSlot={startSlot}\n customHint={props.customHint}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" && state.value && !isDisabled && !disableClearLogic) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n <Popover disablePadding className=\"group\">\n <Calendar>\n <div className=\"flex flex-col gap-3 p-3\">\n <DatePickerHeader />\n <div className=\"flex justify-center\">\n <CalendarGrid className=\"w-full text-center\">\n <DatePickerCalendarGridHeader />\n <DatePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n </div>\n </Calendar>\n </Popover>\n </>\n )}\n </AriaDatePicker>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const DatePicker = fixedForwardRef(_DatePicker);\n//@ts-ignore\nDatePicker.displayName = \"DatePicker\";\ntype DatePickerInputProps = VariantProps<typeof sharedInputStyles> &\n InputHeaderProps &\n InputFooterProps & {\n startSlot?: JSX.Element;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n disableClearLogic?: boolean;\n };\n\nconst DatePickerInput = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DatePickerInputProps) => {\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { button, buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n const { clear } = useDictionary();\n\n const context = useContext(DatePickerStateContext);\n\n if (!context) {\n throw new Error(\"DatePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n\n const calendarButtonRef = useRef<HTMLButtonElement>(null);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <DateInput className={input()}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n <div className=\"ms-auto flex gap-2\">\n {!isDisabled && value && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n // focus the calendar button after clearing the value\n // this way the user can easily open the calendar again\n // plus focusing another element afterwards makes sure that the focus is moved\n // https://n6k.atlassian.net/browse/OPTR-31779\n calendarButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n <AriaButton\n ref={calendarButtonRef}\n isDisabled={isDisabled}\n className={({ isDisabled, isFocusVisible, isHovered }) =>\n button({ isDisabled, isFocused: isFocusVisible, isHovered })\n }\n >\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n </div>\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\nconst DatePickerHeader = () => {\n const { buttons } = datePickerHeaderStyles();\n\n const context = useContext(CalendarStateContext);\n\n if (!context) {\n throw new Error(\"CalendarStateContext is not provided.\");\n }\n\n const { focusedDate, setFocusedDate } = context;\n\n return (\n <header className=\"flex justify-between gap-3\">\n <AriaButton slot=\"previous\" className={buttons()}>\n <SvgIcon name=\"chevron-left\" />\n </AriaButton>\n\n <div className=\"flex gap-1\">\n <MonthPicker\n value={focusedDate.month}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ month: value }));\n }}\n />\n <YearPicker\n value={focusedDate.year}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ year: value }));\n }}\n />\n </div>\n\n <AriaButton slot=\"next\" className={buttons()}>\n <SvgIcon name=\"chevron-right\" />\n </AriaButton>\n </header>\n );\n};\n\nconst DatePickerCalendarGridBody = () => {\n const { bodyCell } = dataPickerCalendarGridStyles();\n\n return (\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({\n isDisabled,\n isFocusVisible,\n isHovered,\n isOutsideMonth,\n isPressed,\n isSelected,\n isUnavailable,\n }) =>\n bodyCell({\n isSelected,\n isFocusVisible,\n isHovered,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isPressed,\n })\n }\n />\n )}\n </CalendarGridBody>\n );\n};\n"],"mappings":"A,moBA8LA,IAAaqD,EAAaxC,EAAAA,iBAxHxB,CACE,YACA,cACA,oBACA,eACA,YAAY,GACZ,cAAc,MACd,gBACA,kBACA,kBACA,QACA,eACA,iBACA,YACA,GAAGyC,GAEL,IACG,CACH,CAACA,EAAOC,GAAOvD,EAAAA,gBAAgBsD,EAAOC,EAAKtD,EAAAA,iBAAiB,EAC5D,G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OoE,EAAY,KACnB,SAAW,GAAU,CACnBC,EAAeD,EAAY,KAAK,CAAC,CAAC,IAAI,CAAE,KAAMxC,CAAM,CAAC,CAAC,CACxD,CACD,CAAA,CACE,C,IAEL,EAAAN,EAAA,IAAA,CAAC5B,EAAAA,OAAD,CAAY,KAAK,OAAO,UAAWyE,EAAQ,EACzC,UAAA,EAAA7C,EAAA,IAAA,CAAC3B,EAAAA,QAAD,CAAS,KAAK,eAAiB,CAAA,CACrB,CAAA,CACN,C,EAEZ,EAEMwD,MAAmC,CACvC,GAAM,CAAE,YAAalD,EAAAA,6BAA6B,EAElD,OACE,EAAAqB,EAAA,IAAA,CAACpB,EAAAA,iBAAD,CAAA,SACI,IACA,EAAAoB,EAAA,IAAA,CAACnB,EAAAA,aAAD,CACQ,OACN,WAAY,CACV,aACA,iBACA,YACA,iBACA,YACA,aACA,mBAEAmE,EAAS,CACP,aACA,iBACA,YACA,gBACA,aACA,iBACA,WACF,CAAC,CAEJ,CAAA,CAEa,CAAA,CAEtB,E"}
1
+ {"version":3,"file":"lyra808.cjs","names":["useContextProps","DatePickerContext","useState","useMemo","shouldRenderInputHeader","useCallback","sharedInputStyles","AriaDatePicker","_Fragment","Popover","Calendar","CalendarGrid","DatePickerCalendarGridHeader","fixedForwardRef","dateFieldStyles","useDictionary","useContext","DatePickerStateContext","useRef","InputHeader","Group","DateInput","DateSegment","Tooltip","AriaButton","SvgIcon","InputFooter","datePickerHeaderStyles","CalendarStateContext","MonthPicker","YearPicker","dataPickerCalendarGridStyles","CalendarGridBody","CalendarCell","require_helpers","require_utils","require_Button","require_Calendar","require_Group","require_DateField","require_DatePicker","require_dictionary_provider","require_svg_icon","require_tooltip","require_styles","require_input_header","require_input_footer","require_popover","require_helpers$1","require_date_picker_styles","require_shared","react","react_jsx_runtime","DatePicker","props","ref","internalValue","setInternalValue","value","defaultValue","isControlled","hasInputHeader","hideHintLabel","hideInputHeader","label","handleChange","newValue","onChange","startSlot","controlledProps","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","DatePickerInput","e","state","isDisabled","disableClearLogic","DatePickerHeader","DatePickerCalendarGridBody","outerEndSlot","segmentStyles","context","calendarButtonRef","inputField","isFocusWithin","isInvalid","errorMessage","input","segment","clear","buttonExcludedFromTabOrder","setValue","button","isFocusVisible","buttons","focusedDate","setFocusedDate","bodyCell"],"sources":["../src/components/inputs/date-picker/date-picker.tsx"],"sourcesContent":["import {\n ElementRef,\n ForwardedRef,\n KeyboardEventHandler,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { JSX } from \"react\";\nimport {\n Button as AriaButton,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarStateContext,\n DateInput,\n DatePicker as AriaDatePicker,\n DatePickerContext,\n DatePickerProps as AriaDatePickerProps,\n DatePickerStateContext,\n DateSegment,\n DateValue,\n Group,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { Popover } from \"../../overlays\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { Tooltip } from \"../../tooltip\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nimport {\n dataPickerCalendarGridStyles,\n dateFieldStyles,\n datePickerHeaderStyles,\n} from \"./date-picker.styles\";\nimport { DatePickerCalendarGridHeader, MonthPicker, YearPicker } from \"./shared\";\n\nexport type DatePickerProps<T extends DateValue> = Omit<AriaDatePickerProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasStartSlot\" | \"hasEndSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\" | \"isWarning\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n disableClearLogic?: boolean;\n };\n\nexport type { DateValue };\n\nconst _DatePicker = <T extends DateValue>(\n {\n className,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth = true,\n granularity = \"day\",\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: DatePickerProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaDatePicker>>,\n) => {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n const { defaultValue, isInvalid, isRequired, onChange, value } = props;\n\n const [internalValue, setInternalValue] = useState(value || defaultValue || null);\n\n // Sync internal value with external value prop and handle resets\n // Only run this effect when we're in controlled mode (value prop is explicitly passed)\n const isControlled = \"value\" in props;\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n setInternalValue(value || null);\n }, [value, isControlled]);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const handleChange = useCallback(\n (newValue: Parameters<NonNullable<typeof onChange>>[0]) => {\n setInternalValue(newValue as typeof internalValue);\n\n if (!newValue || newValue.year.toString().length === 4) {\n onChange?.(newValue);\n }\n },\n [onChange],\n );\n\n const { outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const controlledProps = isControlled ? { value: internalValue, onChange: handleChange } : {};\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaDatePicker\n {...props}\n {...controlledProps}\n granularity={granularity}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled, state }) => (\n <>\n <DatePickerInput\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n startSlot={startSlot}\n customHint={props.customHint}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" && state.value && !isDisabled && !disableClearLogic) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n <Popover disablePadding className=\"group\">\n <Calendar>\n <div className=\"flex flex-col gap-3 p-3\">\n <DatePickerHeader />\n <div className=\"flex justify-center\">\n <CalendarGrid className=\"w-full text-center\">\n <DatePickerCalendarGridHeader />\n <DatePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n </div>\n </Calendar>\n </Popover>\n </>\n )}\n </AriaDatePicker>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const DatePicker = fixedForwardRef(_DatePicker);\n//@ts-ignore\nDatePicker.displayName = \"DatePicker\";\ntype DatePickerInputProps = VariantProps<typeof sharedInputStyles> &\n InputHeaderProps &\n InputFooterProps & {\n startSlot?: JSX.Element;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n disableClearLogic?: boolean;\n };\n\nconst DatePickerInput = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DatePickerInputProps) => {\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { button, buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n const { clear } = useDictionary();\n\n const context = useContext(DatePickerStateContext);\n\n if (!context) {\n throw new Error(\"DatePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n\n const calendarButtonRef = useRef<HTMLButtonElement>(null);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <DateInput className={input()}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n <div className=\"ms-auto flex gap-2\">\n {!isDisabled && value && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n // focus the calendar button after clearing the value\n // this way the user can easily open the calendar again\n // plus focusing another element afterwards makes sure that the focus is moved\n // https://n6k.atlassian.net/browse/OPTR-31779\n calendarButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n <AriaButton\n ref={calendarButtonRef}\n isDisabled={isDisabled}\n className={({ isDisabled, isFocusVisible, isHovered }) =>\n button({ isDisabled, isFocused: isFocusVisible, isHovered })\n }\n >\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n </div>\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\nconst DatePickerHeader = () => {\n const { buttons } = datePickerHeaderStyles();\n\n const context = useContext(CalendarStateContext);\n\n if (!context) {\n throw new Error(\"CalendarStateContext is not provided.\");\n }\n\n const { focusedDate, setFocusedDate } = context;\n\n return (\n <header className=\"flex justify-between gap-3\">\n <AriaButton slot=\"previous\" className={buttons()}>\n <SvgIcon name=\"chevron-left\" />\n </AriaButton>\n\n <div className=\"flex gap-1\">\n <MonthPicker\n value={focusedDate.month}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ month: value }));\n }}\n />\n <YearPicker\n value={focusedDate.year}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ year: value }));\n }}\n />\n </div>\n\n <AriaButton slot=\"next\" className={buttons()}>\n <SvgIcon name=\"chevron-right\" />\n </AriaButton>\n </header>\n );\n};\n\nconst DatePickerCalendarGridBody = () => {\n const { bodyCell } = dataPickerCalendarGridStyles();\n\n return (\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({\n isDisabled,\n isFocusVisible,\n isHovered,\n isOutsideMonth,\n isPressed,\n isSelected,\n isUnavailable,\n }) =>\n bodyCell({\n isSelected,\n isFocusVisible,\n isHovered,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isPressed,\n })\n }\n />\n )}\n </CalendarGridBody>\n );\n};\n"],"mappings":"A,moBA8LA,IAAaqD,EAAaxC,EAAAA,iBAxHxB,CACE,YACA,cACA,oBACA,eACA,YAAY,GACZ,cAAc,MACd,gBACA,kBACA,kBACA,QACA,eACA,iBACA,YACA,GAAGyC,GAEL,IACG,CACH,CAACA,EAAOC,GAAOvD,EAAAA,gBAAgBsD,EAAOC,EAAKtD,EAAAA,iBAAiB,EAC5D,GAAM,CAAE,eAAc,YAAW,aAAY,WAAU,SAAUqD,EAE3D,CAACE,EAAeC,IAAA,EAAoBvD,EAAAA,SAAAA,CAASwD,GAASC,GAAgB,IAAI,EAI1EC,EAAe,UAAWN,GAEhC,EAAAH,EAAA,UAAA,KAAgB,CACTS,GAILH,EAAiBC,GAAS,IAAI,CAChC,EAAG,CAACA,EAAOE,CAAY,CAAC,EAExB,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EAAAA,QAAD,CAAS,KAAK,eAAiB,CAAA,CACrB,CAAA,CACN,C,EAEZ,EAEMwD,MAAmC,CACvC,GAAM,CAAE,YAAalD,EAAAA,6BAA6B,EAElD,OACE,EAAAqB,EAAA,IAAA,CAACpB,EAAAA,iBAAD,CAAA,SACI,IACA,EAAAoB,EAAA,IAAA,CAACnB,EAAAA,aAAD,CACQ,OACN,WAAY,CACV,aACA,iBACA,YACA,iBACA,YACA,aACA,mBAEAmE,EAAS,CACP,aACA,iBACA,YACA,gBACA,aACA,iBACA,WACF,CAAC,CAEJ,CAAA,CAEa,CAAA,CAEtB,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"lyra809.js","names":["useContextProps","DatePickerContext","AriaDatePicker","_Fragment","Calendar","CalendarGrid","DatePickerStateContext","Group","DateInput","DateSegment","AriaButton","CalendarStateContext","CalendarGridBody","CalendarCell","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$7705c033048f6da7$export$353f5b6fc5456de1","$6f9a1820b787aac7$export$e1aef45b828286de","$6f9a1820b787aac7$export$5d847498420df57b","$6f9a1820b787aac7$export$5bd780d491cfc46c","$6f9a1820b787aac7$export$e11f8ba65d857bff","$6f9a1820b787aac7$export$9e31dcedda1dadc7","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$5400c097f4765e59$export$7edc06cf1783b30f","$5400c097f4765e59$export$336ab7fa954c4b5f","$e539d00f123fdfd8$export$5109c6dd95d8fb00","$e539d00f123fdfd8$export$cf316c7f3b44c11e","$e539d00f123fdfd8$export$50a10c048fdcdee9","Fragment$1","DatePicker","fixedForwardRef","props","ref","internalValue","setInternalValue","useState","value","defaultValue","isControlled","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","handleChange","useCallback","newValue","onChange","sharedInputStyles","startSlot","controlledProps","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","DatePickerInput","e","state","isDisabled","disableClearLogic","Popover","DatePickerHeader","DatePickerCalendarGridHeader","DatePickerCalendarGridBody","outerEndSlot","segmentStyles","dateFieldStyles","useDictionary","context","useContext","calendarButtonRef","useRef","InputHeader","inputField","isFocusWithin","isInvalid","errorMessage","input","segment","Tooltip","clear","buttonExcludedFromTabOrder","setValue","SvgIcon","button","isFocusVisible","InputFooter","datePickerHeaderStyles","buttons","MonthPicker","focusedDate","YearPicker","dataPickerCalendarGridStyles","bodyCell"],"sources":["../src/components/inputs/date-picker/date-picker.tsx"],"sourcesContent":["import {\n ElementRef,\n ForwardedRef,\n KeyboardEventHandler,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { JSX } from \"react\";\nimport {\n Button as AriaButton,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarStateContext,\n DateInput,\n DatePicker as AriaDatePicker,\n DatePickerContext,\n DatePickerProps as AriaDatePickerProps,\n DatePickerStateContext,\n DateSegment,\n DateValue,\n Group,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { Popover } from \"../../overlays\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { Tooltip } from \"../../tooltip\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nimport {\n dataPickerCalendarGridStyles,\n dateFieldStyles,\n datePickerHeaderStyles,\n} from \"./date-picker.styles\";\nimport { DatePickerCalendarGridHeader, MonthPicker, YearPicker } from \"./shared\";\n\nexport type DatePickerProps<T extends DateValue> = Omit<AriaDatePickerProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasStartSlot\" | \"hasEndSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n disableClearLogic?: boolean;\n };\n\nexport type { DateValue };\n\nconst _DatePicker = <T extends DateValue>(\n {\n className,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth = true,\n granularity = \"day\",\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: DatePickerProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaDatePicker>>,\n) => {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n const { defaultValue, isInvalid, isRequired, onChange, value } = props;\n\n const [internalValue, setInternalValue] = useState(value || defaultValue || null);\n\n // Sync internal value with external value prop and handle resets\n // Only run this effect when we're in controlled mode (value prop is explicitly passed)\n const isControlled = \"value\" in props;\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n setInternalValue(value || null);\n }, [value, isControlled]);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const handleChange = useCallback(\n (newValue: Parameters<NonNullable<typeof onChange>>[0]) => {\n setInternalValue(newValue as typeof internalValue);\n\n if (!newValue || newValue.year.toString().length === 4) {\n onChange?.(newValue);\n }\n },\n [onChange],\n );\n\n const { outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const controlledProps = isControlled ? { value: internalValue, onChange: handleChange } : {};\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaDatePicker\n {...props}\n {...controlledProps}\n granularity={granularity}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled, state }) => (\n <>\n <DatePickerInput\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n startSlot={startSlot}\n customHint={props.customHint}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" && state.value && !isDisabled && !disableClearLogic) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n <Popover disablePadding className=\"group\">\n <Calendar>\n <div className=\"flex flex-col gap-3 p-3\">\n <DatePickerHeader />\n <div className=\"flex justify-center\">\n <CalendarGrid className=\"w-full text-center\">\n <DatePickerCalendarGridHeader />\n <DatePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n </div>\n </Calendar>\n </Popover>\n </>\n )}\n </AriaDatePicker>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const DatePicker = fixedForwardRef(_DatePicker);\n//@ts-ignore\nDatePicker.displayName = \"DatePicker\";\ntype DatePickerInputProps = VariantProps<typeof sharedInputStyles> &\n InputHeaderProps &\n InputFooterProps & {\n startSlot?: JSX.Element;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n disableClearLogic?: boolean;\n };\n\nconst DatePickerInput = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DatePickerInputProps) => {\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { button, buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n const { clear } = useDictionary();\n\n const context = useContext(DatePickerStateContext);\n\n if (!context) {\n throw new Error(\"DatePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n\n const calendarButtonRef = useRef<HTMLButtonElement>(null);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <DateInput className={input()}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n <div className=\"ms-auto flex gap-2\">\n {!isDisabled && value && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n // focus the calendar button after clearing the value\n // this way the user can easily open the calendar again\n // plus focusing another element afterwards makes sure that the focus is moved\n // https://n6k.atlassian.net/browse/OPTR-31779\n calendarButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n <AriaButton\n ref={calendarButtonRef}\n isDisabled={isDisabled}\n className={({ isDisabled, isFocusVisible, isHovered }) =>\n button({ isDisabled, isFocused: isFocusVisible, isHovered })\n }\n >\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n </div>\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\nconst DatePickerHeader = () => {\n const { buttons } = datePickerHeaderStyles();\n\n const context = useContext(CalendarStateContext);\n\n if (!context) {\n throw new Error(\"CalendarStateContext is not provided.\");\n }\n\n const { focusedDate, setFocusedDate } = context;\n\n return (\n <header className=\"flex justify-between gap-3\">\n <AriaButton slot=\"previous\" className={buttons()}>\n <SvgIcon name=\"chevron-left\" />\n </AriaButton>\n\n <div className=\"flex gap-1\">\n <MonthPicker\n value={focusedDate.month}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ month: value }));\n }}\n />\n <YearPicker\n value={focusedDate.year}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ year: value }));\n }}\n />\n </div>\n\n <AriaButton slot=\"next\" className={buttons()}>\n <SvgIcon name=\"chevron-right\" />\n </AriaButton>\n </header>\n );\n};\n\nconst DatePickerCalendarGridBody = () => {\n const { bodyCell } = dataPickerCalendarGridStyles();\n\n return (\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({\n isDisabled,\n isFocusVisible,\n isHovered,\n isOutsideMonth,\n isPressed,\n isSelected,\n isUnavailable,\n }) =>\n bodyCell({\n isSelected,\n isFocusVisible,\n isHovered,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isPressed,\n })\n }\n />\n )}\n </CalendarGridBody>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8LA,IAAa4B,IAAaC,GAxHxB,EACE,cACA,gBACA,sBACA,iBACA,eAAY,IACZ,iBAAc,OACd,kBACA,oBACA,oBACA,UACA,iBACA,mBACA,cACA,GAAGC,KAEL,MACG;CACH,CAACA,GAAOC,KAAO/B,EAAgB8B,GAAOC,GAAK9B,CAAiB;CAC5D,IAAM,EAAE,iBAAc,cAAW,eAAY,aAAU,aAAU6B,GAE3D,CAACE,GAAeC,KAAoBC,EAASC,KAASC,KAAgB,IAAI,GAI1EC,IAAe,WAAWP;CAEhC,QAAgB;EACd,AAAKO,KAILJ,EAAiBE,KAAS,IAAI;CAChC,GAAG,CAACA,GAAOE,CAAY,CAAC;CAExB,IAAMC,IAAiBC,QAC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AeA,EAAY,KAAK,CAAC,CAAC,IAAI,EAAE,MAAMxD,EAAM,CAAC,CAAC;KACxD;IACD,CAAA,CACE;;GAEL,kBAACzB,GAAD;IAAY,MAAK;IAAO,WAAW+E,EAAQ;IACzC,UAAA,kBAACL,GAAD,EAAS,MAAK,gBAAiB,CAAA;GACrB,CAAA;EACN;;AAEZ,GAEMpB,UAAmC;CACvC,IAAM,EAAE,gBAAa6B,EAA6B;CAElD,OACE,kBAACjF,GAAD,EAAA,WACI,MACA,kBAACC,GAAD;EACQ;EACN,YAAY,EACV,eACA,mBACA,cACA,mBACA,cACA,eACA,uBAEAiF,EAAS;GACP;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;CAEJ,CAAA,EAEa,CAAA;AAEtB"}
1
+ {"version":3,"file":"lyra809.js","names":["useContextProps","DatePickerContext","AriaDatePicker","_Fragment","Calendar","CalendarGrid","DatePickerStateContext","Group","DateInput","DateSegment","AriaButton","CalendarStateContext","CalendarGridBody","CalendarCell","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$7705c033048f6da7$export$353f5b6fc5456de1","$6f9a1820b787aac7$export$e1aef45b828286de","$6f9a1820b787aac7$export$5d847498420df57b","$6f9a1820b787aac7$export$5bd780d491cfc46c","$6f9a1820b787aac7$export$e11f8ba65d857bff","$6f9a1820b787aac7$export$9e31dcedda1dadc7","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$5400c097f4765e59$export$7edc06cf1783b30f","$5400c097f4765e59$export$336ab7fa954c4b5f","$e539d00f123fdfd8$export$5109c6dd95d8fb00","$e539d00f123fdfd8$export$cf316c7f3b44c11e","$e539d00f123fdfd8$export$50a10c048fdcdee9","Fragment$1","DatePicker","fixedForwardRef","props","ref","internalValue","setInternalValue","useState","value","defaultValue","isControlled","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","handleChange","useCallback","newValue","onChange","sharedInputStyles","startSlot","controlledProps","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","DatePickerInput","e","state","isDisabled","disableClearLogic","Popover","DatePickerHeader","DatePickerCalendarGridHeader","DatePickerCalendarGridBody","outerEndSlot","segmentStyles","dateFieldStyles","useDictionary","context","useContext","calendarButtonRef","useRef","InputHeader","inputField","isFocusWithin","isInvalid","errorMessage","input","segment","Tooltip","clear","buttonExcludedFromTabOrder","setValue","SvgIcon","button","isFocusVisible","InputFooter","datePickerHeaderStyles","buttons","MonthPicker","focusedDate","YearPicker","dataPickerCalendarGridStyles","bodyCell"],"sources":["../src/components/inputs/date-picker/date-picker.tsx"],"sourcesContent":["import {\n ElementRef,\n ForwardedRef,\n KeyboardEventHandler,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { JSX } from \"react\";\nimport {\n Button as AriaButton,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarStateContext,\n DateInput,\n DatePicker as AriaDatePicker,\n DatePickerContext,\n DatePickerProps as AriaDatePickerProps,\n DatePickerStateContext,\n DateSegment,\n DateValue,\n Group,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { Popover } from \"../../overlays\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { Tooltip } from \"../../tooltip\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nimport {\n dataPickerCalendarGridStyles,\n dateFieldStyles,\n datePickerHeaderStyles,\n} from \"./date-picker.styles\";\nimport { DatePickerCalendarGridHeader, MonthPicker, YearPicker } from \"./shared\";\n\nexport type DatePickerProps<T extends DateValue> = Omit<AriaDatePickerProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasStartSlot\" | \"hasEndSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\" | \"isWarning\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n disableClearLogic?: boolean;\n };\n\nexport type { DateValue };\n\nconst _DatePicker = <T extends DateValue>(\n {\n className,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth = true,\n granularity = \"day\",\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: DatePickerProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaDatePicker>>,\n) => {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n const { defaultValue, isInvalid, isRequired, onChange, value } = props;\n\n const [internalValue, setInternalValue] = useState(value || defaultValue || null);\n\n // Sync internal value with external value prop and handle resets\n // Only run this effect when we're in controlled mode (value prop is explicitly passed)\n const isControlled = \"value\" in props;\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n setInternalValue(value || null);\n }, [value, isControlled]);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const handleChange = useCallback(\n (newValue: Parameters<NonNullable<typeof onChange>>[0]) => {\n setInternalValue(newValue as typeof internalValue);\n\n if (!newValue || newValue.year.toString().length === 4) {\n onChange?.(newValue);\n }\n },\n [onChange],\n );\n\n const { outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const controlledProps = isControlled ? { value: internalValue, onChange: handleChange } : {};\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaDatePicker\n {...props}\n {...controlledProps}\n granularity={granularity}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled, state }) => (\n <>\n <DatePickerInput\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n startSlot={startSlot}\n customHint={props.customHint}\n onKeyDown={(e) => {\n if (e.key === \"Escape\" && state.value && !isDisabled && !disableClearLogic) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n <Popover disablePadding className=\"group\">\n <Calendar>\n <div className=\"flex flex-col gap-3 p-3\">\n <DatePickerHeader />\n <div className=\"flex justify-center\">\n <CalendarGrid className=\"w-full text-center\">\n <DatePickerCalendarGridHeader />\n <DatePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n </div>\n </Calendar>\n </Popover>\n </>\n )}\n </AriaDatePicker>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const DatePicker = fixedForwardRef(_DatePicker);\n//@ts-ignore\nDatePicker.displayName = \"DatePicker\";\ntype DatePickerInputProps = VariantProps<typeof sharedInputStyles> &\n InputHeaderProps &\n InputFooterProps & {\n startSlot?: JSX.Element;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n disableClearLogic?: boolean;\n };\n\nconst DatePickerInput = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DatePickerInputProps) => {\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { button, buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n const { clear } = useDictionary();\n\n const context = useContext(DatePickerStateContext);\n\n if (!context) {\n throw new Error(\"DatePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n\n const calendarButtonRef = useRef<HTMLButtonElement>(null);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <DateInput className={input()}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n <div className=\"ms-auto flex gap-2\">\n {!isDisabled && value && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n // focus the calendar button after clearing the value\n // this way the user can easily open the calendar again\n // plus focusing another element afterwards makes sure that the focus is moved\n // https://n6k.atlassian.net/browse/OPTR-31779\n calendarButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n <AriaButton\n ref={calendarButtonRef}\n isDisabled={isDisabled}\n className={({ isDisabled, isFocusVisible, isHovered }) =>\n button({ isDisabled, isFocused: isFocusVisible, isHovered })\n }\n >\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n </div>\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\nconst DatePickerHeader = () => {\n const { buttons } = datePickerHeaderStyles();\n\n const context = useContext(CalendarStateContext);\n\n if (!context) {\n throw new Error(\"CalendarStateContext is not provided.\");\n }\n\n const { focusedDate, setFocusedDate } = context;\n\n return (\n <header className=\"flex justify-between gap-3\">\n <AriaButton slot=\"previous\" className={buttons()}>\n <SvgIcon name=\"chevron-left\" />\n </AriaButton>\n\n <div className=\"flex gap-1\">\n <MonthPicker\n value={focusedDate.month}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ month: value }));\n }}\n />\n <YearPicker\n value={focusedDate.year}\n onChange={(value) => {\n setFocusedDate(focusedDate.copy().set({ year: value }));\n }}\n />\n </div>\n\n <AriaButton slot=\"next\" className={buttons()}>\n <SvgIcon name=\"chevron-right\" />\n </AriaButton>\n </header>\n );\n};\n\nconst DatePickerCalendarGridBody = () => {\n const { bodyCell } = dataPickerCalendarGridStyles();\n\n return (\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({\n isDisabled,\n isFocusVisible,\n isHovered,\n isOutsideMonth,\n isPressed,\n isSelected,\n isUnavailable,\n }) =>\n bodyCell({\n isSelected,\n isFocusVisible,\n isHovered,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isPressed,\n })\n }\n />\n )}\n </CalendarGridBody>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8LA,IAAa4B,IAAaC,GAxHxB,EACE,cACA,gBACA,sBACA,iBACA,eAAY,IACZ,iBAAc,OACd,kBACA,oBACA,oBACA,UACA,iBACA,mBACA,cACA,GAAGC,KAEL,MACG;CACH,CAACA,GAAOC,KAAO/B,EAAgB8B,GAAOC,GAAK9B,CAAiB;CAC5D,IAAM,EAAE,iBAAc,cAAW,eAAY,aAAU,aAAU6B,GAE3D,CAACE,GAAeC,KAAoBC,EAASC,KAASC,KAAgB,IAAI,GAI1EC,IAAe,WAAWP;CAEhC,QAAgB;EACd,AAAKO,KA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CAAC;KACzD;IACD,CAAA,GACD,kBAACyD,GAAD;KACE,OAAOD,EAAY;KACnB,WAAW,MAAU;MACnB,EAAeA,EAAY,KAAK,CAAC,CAAC,IAAI,EAAE,MAAMxD,EAAM,CAAC,CAAC;KACxD;IACD,CAAA,CACE;;GAEL,kBAACzB,GAAD;IAAY,MAAK;IAAO,WAAW+E,EAAQ;IACzC,UAAA,kBAACL,GAAD,EAAS,MAAK,gBAAiB,CAAA;GACrB,CAAA;EACN;;AAEZ,GAEMpB,UAAmC;CACvC,IAAM,EAAE,gBAAa6B,EAA6B;CAElD,OACE,kBAACjF,GAAD,EAAA,WACI,MACA,kBAACC,GAAD;EACQ;EACN,YAAY,EACV,eACA,mBACA,cACA,mBACA,cACA,eACA,uBAEAiF,EAAS;GACP;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;CAEJ,CAAA,EAEa,CAAA;AAEtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"lyra813.cjs","names":["useContextProps","DateRangePickerContext","useLocale","useState","useMemo","shouldRenderInputHeader","useCallback","sharedInputStyles","resolveDateRangePresets","AriaDateRangePicker","_Fragment","Popover","RangeCalendar","datePickerHeaderStyles","useContext","RangeCalendarStateContext","DateRangePickerStateContext","useRef","Separator","AriaButton","SvgIcon","MonthPicker","YearPicker","CalendarGrid","DatePickerCalendarGridHeader","fixedForwardRef","useDictionary","dateRangePickerStyles","DateFormatter","getLocalTimeZone","InputHeader","Group","DateInput","DateSegment","Tooltip","InputFooter","dateFieldStyles","dataPickerCalendarGridStyles","CalendarGridBody","CalendarCell","require_I18nProvider","require_queries","require_DateFormatter","require_helpers","require_utils","require_Button","require_Calendar","require_Group","require_DateField","require_DatePicker","require_dictionary_provider","require_svg_icon","require_tooltip","require_styles","require_input_header","require_input_footer","require_popover","require_helpers$1","require_date_picker_styles","require_shared","require_separator","require_date_range_presets","react","react_jsx_runtime","toLocalizedDatePlaceholder","dateFormatter","part","_DateRangePicker","props","ref","internalValue","setInternalValue","value","defaultValue","isControlled","hasInputHeader","hideHintLabel","hideInputHeader","label","handleChange","newValue","startYearComplete","endYearComplete","onChange","startSlot","controlledProps","isDayGranularity","granularity","resolvedPresets","hidePresets","additionalPresets","presets","disabledPresetIds","isDateUnavailable","locale","maxValue","minValue","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","DateRangePickerButtonInput","e","state","isDisabled","disableClearLogic","DateRangePickerSegmentInputs","PopoverCalendarGrid","DateRangePickerPresetPanel","outerEndSlot","context","dateRangePickerState","hasCompleteSelection","previousSelectionCompleteRef","autoCloseOnCompleteSelection","getNextMonth","month","getPreviousMonth","onStartMonthChange","visibleRange","focusPreviousPage","focusNextPage","newMonth","newFocusedDate","focusedDate","setFocusedDate","onStartYearChange","onEndMonthChange","onEndYearChange","presetPanel","buttons","anchorDate","DateRangePickerCalendarGridBody","DateRangePicker","formatTriggerDate","timeZone","date","singleDatePlaceholder","emptyRangePlaceholder","triggerButtonRef","triggerLabel","inputField","isFocusWithin","isInvalid","errorMessage","triggerButton","triggerText","clear","buttonExcludedFromTabOrder","setValue","dictionary","getPresetLabel","preset","isPresetSelected","presetList","presetButton","onPresetSelect","setOpen","segmentStyles","calendarButtonRef","input","segment","button","isFocusVisible","rangeBodyCell"],"sources":["../src/components/inputs/date-picker/date-range-picker.tsx"],"sourcesContent":["import {\n ElementRef,\n ForwardedRef,\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { JSX } from \"react\";\nimport {\n Button as AriaButton,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n DateInput,\n DateRangePicker as AriaDateRangePicker,\n DateRangePickerContext,\n DateRangePickerProps as AriaDateRangePickerProps,\n DateRangePickerStateContext,\n DateSegment,\n DateValue,\n Group,\n RangeCalendar,\n RangeCalendarStateContext,\n useContextProps,\n useLocale,\n} from \"react-aria-components\";\n\nimport { DateFormatter, getLocalTimeZone } from \"@internationalized/date\";\nimport { RangeValue } from \"@react-types/shared\";\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { Popover } from \"../../overlays\";\nimport { Separator } from \"../../separator\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { Tooltip } from \"../../tooltip\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nimport {\n dataPickerCalendarGridStyles,\n dateFieldStyles,\n datePickerHeaderStyles,\n dateRangePickerStyles,\n} from \"./date-picker.styles\";\nimport {\n DateRangePresetDescriptor,\n ResolvedDateRangePreset,\n resolveDateRangePresets,\n} from \"./date-range-presets\";\nimport { DatePickerCalendarGridHeader, MonthPicker, YearPicker } from \"./shared\";\n\nexport type DateRangePickerProps<T extends DateValue> = Omit<\n AriaDateRangePickerProps<T>,\n \"className\"\n> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasStartSlot\" | \"hasEndSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\"\n > &\n InputHeaderProps &\n InputOuterSlotsProps &\n InputFooterProps & {\n className?: string;\n startSlot?: JSX.Element;\n disableClearLogic?: boolean;\n hidePresets?: boolean;\n additionalPresets?: DateRangePresetDescriptor[];\n disabledPresetIds?: string[];\n /**\n * Legacy full override.\n * Prefer `additionalPresets` + `disabledPresetIds`.\n */\n presets?: DateRangePresetDescriptor[];\n onPresetSelect?: (presetId: string, range: RangeValue<DateValue>) => void;\n };\n\nexport type { DateRangePresetDescriptor, DateValue };\n\nconst toLocalizedDatePlaceholder = (dateFormatter: DateFormatter) => {\n return dateFormatter\n .formatToParts(new Date(2006, 0, 2))\n .map((part) => {\n switch (part.type) {\n case \"day\":\n return \"dd\";\n case \"month\":\n return \"mm\";\n case \"year\":\n return \"yyyy\";\n default:\n return part.value;\n }\n })\n .join(\"\");\n};\n\nconst _DateRangePicker = <T extends DateValue>(\n {\n className,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth = true,\n granularity = \"day\",\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n hidePresets,\n additionalPresets,\n disabledPresetIds,\n label,\n onPresetSelect,\n outerEndSlot,\n outerStartSlot,\n presets,\n startSlot,\n ...props\n }: DateRangePickerProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaDateRangePicker>>,\n) => {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n const { defaultValue, isDateUnavailable, isInvalid, isRequired, maxValue, minValue, onChange, value } =\n props;\n const { locale } = useLocale();\n\n const [internalValue, setInternalValue] = useState(value || defaultValue || null);\n\n // Sync internal value with external value prop and handle resets\n // Only run this effect when we're in controlled mode (value prop is explicitly passed)\n const isControlled = \"value\" in props;\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n setInternalValue(value || null);\n }, [value, isControlled]);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n // Handle changes - update internal state only in uncontrolled mode, conditionally call external onChange\n const handleChange = useCallback(\n (newValue: Parameters<NonNullable<typeof onChange>>[0]) => {\n // AriaDateRangePicker passes MappedDateValue<T> which TypeScript can't reconcile with T\n // This single assertion is unavoidable due to the library's type design\n setInternalValue(newValue as typeof internalValue);\n\n // Check if both years are complete (4 digits each)\n const startYearComplete = !newValue?.start || newValue.start.year.toString().length === 4;\n const endYearComplete = !newValue?.end || newValue.end.year.toString().length === 4;\n\n // Only fire external onChange callback if newValue is null or both years are complete\n if (!newValue || (startYearComplete && endYearComplete)) {\n onChange?.(newValue);\n }\n },\n [onChange],\n );\n\n const { outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const controlledProps = isControlled ? { value: internalValue, onChange: handleChange } : {};\n const isDayGranularity = granularity === \"day\";\n\n const resolvedPresets = useMemo(\n () =>\n isDayGranularity && !hidePresets\n ? resolveDateRangePresets({\n additionalDescriptors: additionalPresets,\n descriptors: presets,\n disabledPresetIds,\n isDateUnavailable: isDateUnavailable as ((date: DateValue) => boolean) | undefined,\n locale,\n maxValue: maxValue as DateValue | undefined,\n minValue: minValue as DateValue | undefined,\n })\n : [],\n [\n additionalPresets,\n disabledPresetIds,\n hidePresets,\n isDateUnavailable,\n isDayGranularity,\n locale,\n maxValue,\n minValue,\n presets,\n ],\n );\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaDateRangePicker\n {...props}\n {...controlledProps}\n granularity={granularity}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled, state }) => (\n <>\n {isDayGranularity ? (\n <DateRangePickerButtonInput\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n customHint={props.customHint}\n startSlot={startSlot}\n onKeyDown={(e) => {\n if (\n e.key === \"Escape\" &&\n state.value?.end &&\n state.value?.start &&\n !isDisabled &&\n !disableClearLogic\n ) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n ) : (\n <DateRangePickerSegmentInputs\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n customHint={props.customHint}\n startSlot={startSlot}\n onKeyDown={(e) => {\n if (\n e.key === \"Escape\" &&\n state.value?.end &&\n state.value?.start &&\n !isDisabled &&\n !disableClearLogic\n ) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n )}\n\n <Popover disablePadding className=\"group\">\n <RangeCalendar visibleDuration={{ months: 2 }} pageBehavior=\"single\">\n <PopoverCalendarGrid\n autoCloseOnCompleteSelection={isDayGranularity}\n presetPanel={\n resolvedPresets.length ? (\n <DateRangePickerPresetPanel\n isDisabled={isDisabled}\n presets={resolvedPresets}\n onPresetSelect={onPresetSelect}\n />\n ) : null\n }\n />\n </RangeCalendar>\n </Popover>\n </>\n )}\n </AriaDateRangePicker>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\ntype PopoverCalendarGridProps = {\n presetPanel?: ReactNode;\n autoCloseOnCompleteSelection?: boolean;\n};\n\nconst PopoverCalendarGrid = ({\n autoCloseOnCompleteSelection,\n presetPanel,\n}: PopoverCalendarGridProps) => {\n const { buttons } = datePickerHeaderStyles();\n\n const context = useContext(RangeCalendarStateContext);\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"RangeCalendarStateContext is not provided.\");\n }\n\n if (!dateRangePickerState) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const {\n anchorDate,\n focusedDate,\n focusNextPage,\n focusPreviousPage,\n setFocusedDate,\n visibleRange,\n } = context;\n\n const hasCompleteSelection = !!dateRangePickerState.value?.start && !!dateRangePickerState.value?.end;\n const previousSelectionCompleteRef = useRef(hasCompleteSelection);\n\n useEffect(() => {\n if (\n autoCloseOnCompleteSelection &&\n dateRangePickerState.isOpen &&\n hasCompleteSelection &&\n !previousSelectionCompleteRef.current\n ) {\n dateRangePickerState.setOpen(false);\n }\n\n previousSelectionCompleteRef.current = hasCompleteSelection;\n }, [autoCloseOnCompleteSelection, dateRangePickerState, hasCompleteSelection]);\n\n const getNextMonth = (month: number) => (month === 12 ? 1 : month + 1);\n const getPreviousMonth = (month: number) => (month === 1 ? 12 : month - 1);\n\n /**\n * Visible range logic from react-aria\n * - when setting a focused date before the current start range, the focused date is set to the end of the visible range\n * - when setting a focused date after the current end range, the focused date is set to the start of the visible range\n */\n const onStartMonthChange = useCallback(\n (value: number) => {\n if (value === visibleRange.start.month - 1) {\n focusPreviousPage();\n } else if (value === visibleRange.start.month + 1) {\n focusNextPage();\n } else {\n // when going in the past we need to make sure the focused date is in the next month so the visible range starts where we want\n const newMonth = value < visibleRange.start.month ? getNextMonth(value) : value;\n const newFocusedDate = visibleRange.start.copy().set({\n month: newMonth,\n day: focusedDate.day,\n });\n setFocusedDate(newFocusedDate);\n }\n },\n [focusNextPage, focusPreviousPage, focusedDate.day, setFocusedDate, visibleRange.start],\n );\n\n const onStartYearChange = useCallback(\n (value: number): void => {\n // handle Dec-Jan visible range separately\n if (visibleRange.start.year !== visibleRange.end.year) {\n // when going in the past the focused date should be in January so the visible range starts where we want\n if (value < visibleRange.start.year) {\n const newFocusedDate = visibleRange.start.copy().set({\n year: value + 1,\n day: focusedDate.day,\n month: 1,\n });\n\n setFocusedDate(newFocusedDate);\n }\n // when going in the future the focused date should be in December so the visible range starts where we want\n if (value > visibleRange.start.year) {\n const newFocusedDate = visibleRange.start.copy().set({\n year: value,\n day: focusedDate.day,\n month: 12,\n });\n\n setFocusedDate(newFocusedDate);\n }\n } else {\n // when going in the past we need to make sure the focused date is in the next month so the visible range starts where we want\n const newMonth =\n value < visibleRange.start.year\n ? getNextMonth(visibleRange.start.month)\n : visibleRange.start.month;\n const newFocusedDate = visibleRange.start.copy().set({\n year: value,\n day: focusedDate.day,\n month: newMonth,\n });\n\n setFocusedDate(newFocusedDate);\n }\n },\n [focusedDate.day, setFocusedDate, visibleRange.end.year, visibleRange.start],\n );\n\n const onEndMonthChange = useCallback(\n (value: number): void => {\n if (value === visibleRange.end.month - 1) {\n focusPreviousPage();\n } else if (value === visibleRange.end.month + 1) {\n focusNextPage();\n } else {\n // when going in the future we need to make sure the focused date is in the previous month so the visible range starts where we want\n const newMonth = value > visibleRange.end.month ? getPreviousMonth(value) : value;\n const newFocusedDate = visibleRange.end.copy().set({\n month: newMonth,\n day: focusedDate.day,\n });\n setFocusedDate(newFocusedDate);\n }\n },\n [focusNextPage, focusPreviousPage, focusedDate.day, setFocusedDate, visibleRange.end],\n );\n\n const onEndYearChange = useCallback(\n (value: number): void => {\n // handle Dec-Jan visible range separately\n if (visibleRange.start.year !== visibleRange.end.year) {\n // when going in the past the focused date should be in January so the visible range starts where we want\n if (value < visibleRange.end.year) {\n const newFocusedDate = visibleRange.end.copy().set({\n year: value,\n day: focusedDate.day,\n month: 1,\n });\n\n setFocusedDate(newFocusedDate);\n }\n if (value > visibleRange.end.year) {\n // when going in the future the focused date should be in December so the visible range starts where we want\n const newFocusedDate = visibleRange.end.copy().set({\n year: value - 1,\n day: focusedDate.day,\n month: 12,\n });\n\n setFocusedDate(newFocusedDate);\n }\n } else {\n // when going in the future we need to make sure the focused date is in the previous month so the visible range starts where we want\n const newMonth =\n value > visibleRange.end.year\n ? getPreviousMonth(visibleRange.end.month)\n : visibleRange.end.month;\n const newFocusedDate = visibleRange.end.copy().set({\n year: value,\n day: focusedDate.day,\n month: newMonth,\n });\n\n setFocusedDate(newFocusedDate);\n }\n },\n [focusedDate.day, setFocusedDate, visibleRange.end, visibleRange.start.year],\n );\n\n return (\n <div className=\"flex flex-col gap-3 p-3 lg:flex-row\">\n {presetPanel ? (\n <>\n <div className=\"lg:w-52\">{presetPanel}</div>\n <Separator orientation=\"vertical\" className=\"hidden h-[unset] self-stretch lg:block\" />\n <Separator className=\"lg:hidden\" />\n </>\n ) : null}\n\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex justify-between gap-1\">\n <AriaButton slot=\"previous\" className={buttons()}>\n <SvgIcon name=\"chevron-left\" />\n </AriaButton>\n <div className=\"flex gap-1\">\n <MonthPicker\n value={visibleRange.start.month}\n isDisabled={!!anchorDate}\n onChange={onStartMonthChange}\n />\n <YearPicker\n value={visibleRange.start.year}\n isDisabled={!!anchorDate}\n onChange={onStartYearChange}\n />\n </div>\n <div className=\"w-6\" />\n </div>\n <CalendarGrid className=\"w-full text-center\">\n <DatePickerCalendarGridHeader />\n <DateRangePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n\n <Separator orientation=\"vertical\" className=\"hidden h-[unset] self-stretch sm:block\" />\n <Separator className=\"sm:hidden\" />\n\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex justify-between gap-1\">\n <div className=\"w-6\" />\n <div className=\"flex gap-1\">\n <MonthPicker\n value={visibleRange.end.month}\n isDisabled={!!anchorDate}\n onChange={onEndMonthChange}\n />\n <YearPicker\n value={visibleRange.end.year}\n isDisabled={!!anchorDate}\n onChange={onEndYearChange}\n />\n </div>\n <AriaButton slot=\"next\" className={buttons()}>\n <SvgIcon name=\"chevron-right\" />\n </AriaButton>\n </div>\n <CalendarGrid className=\"w-full text-center\" offset={{ months: 1 }}>\n <DatePickerCalendarGridHeader />\n <DateRangePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n </div>\n </div>\n );\n};\n\nexport const DateRangePicker = fixedForwardRef(_DateRangePicker);\n//@ts-ignore\nDateRangePicker.displayName = \"DateRangePicker\";\n\ntype DateRangePickerInputProps = VariantProps<typeof sharedInputStyles> &\n InputHeaderProps &\n InputFooterProps & {\n startSlot?: JSX.Element;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n disableClearLogic?: boolean;\n };\n\nconst DateRangePickerButtonInput = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DateRangePickerInputProps) => {\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n\n const { clear } = useDictionary();\n const { locale } = useLocale();\n\n const context = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n const { triggerButton, triggerText } = dateRangePickerStyles();\n\n const dateFormatter = useMemo(\n () =>\n new DateFormatter(locale, {\n day: \"2-digit\",\n month: \"2-digit\",\n year: \"numeric\",\n }),\n [locale],\n );\n const formatTriggerDate = useCallback(\n (date: DateValue) => {\n const timeZone = \"timeZone\" in date ? date.timeZone : getLocalTimeZone();\n return dateFormatter.format(date.toDate(timeZone));\n },\n [dateFormatter],\n );\n const singleDatePlaceholder = useMemo(\n () => toLocalizedDatePlaceholder(dateFormatter),\n [dateFormatter],\n );\n const emptyRangePlaceholder = useMemo(\n () => `${singleDatePlaceholder} - ${singleDatePlaceholder}`,\n [singleDatePlaceholder],\n );\n\n const triggerButtonRef = useRef<HTMLButtonElement | null>(null);\n\n const triggerLabel = useMemo(() => {\n if (!value?.start && !value?.end) {\n return emptyRangePlaceholder;\n }\n\n const startText = value?.start ? formatTriggerDate(value.start) : singleDatePlaceholder;\n const endText = value?.end ? formatTriggerDate(value.end) : singleDatePlaceholder;\n\n return `${startText} - ${endText}`;\n }, [emptyRangePlaceholder, formatTriggerDate, singleDatePlaceholder, value?.end, value?.start]);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <div className=\"hidden\" aria-hidden=\"true\">\n <DateInput slot=\"start\">\n {(segment) => <DateSegment segment={segment} className=\"hidden\" />}\n </DateInput>\n <DateInput slot=\"end\">\n {(segment) => <DateSegment segment={segment} className=\"hidden\" />}\n </DateInput>\n </div>\n\n <AriaButton\n ref={triggerButtonRef}\n isDisabled={isDisabled}\n className={triggerButton()}\n data-testid=\"date-range-picker-trigger\"\n >\n <span className={triggerText({ hasValue: !!value?.start || !!value?.end })}>{triggerLabel}</span>\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n\n {!isDisabled && value?.end && value?.start && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n triggerButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\ntype DateRangePickerPresetPanelProps = {\n isDisabled?: boolean;\n presets: ResolvedDateRangePreset[];\n onPresetSelect?: (presetId: string, range: RangeValue<DateValue>) => void;\n};\n\nconst DateRangePickerPresetPanel = ({\n isDisabled,\n onPresetSelect,\n presets,\n}: DateRangePickerPresetPanelProps) => {\n const dictionary = useDictionary();\n const context = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const { setOpen, setValue, value } = context;\n const { presetButton, presetList } = dateRangePickerStyles();\n\n const getPresetLabel = useCallback(\n (preset: ResolvedDateRangePreset) => {\n if (preset.descriptor.label) {\n return preset.descriptor.label;\n }\n\n switch (preset.descriptor.kind) {\n case \"today\":\n return dictionary.dateRangePresetToday;\n case \"yesterday\":\n return dictionary.dateRangePresetYesterday;\n case \"tomorrow\":\n return dictionary.dateRangePresetTomorrow;\n case \"lastDays\":\n return dictionary.dateRangePresetLastDays(preset.descriptor.days);\n case \"nextDays\":\n return dictionary.dateRangePresetNextDays(preset.descriptor.days);\n case \"thisWeek\":\n return dictionary.dateRangePresetThisWeek;\n case \"lastWeek\":\n return dictionary.dateRangePresetLastWeek;\n case \"nextWeek\":\n return dictionary.dateRangePresetNextWeek;\n case \"thisMonth\":\n return dictionary.dateRangePresetThisMonth;\n case \"lastMonth\":\n return dictionary.dateRangePresetLastMonth;\n case \"nextMonth\":\n return dictionary.dateRangePresetNextMonth;\n case \"thisQuarter\":\n return dictionary.dateRangePresetThisQuarter;\n case \"lastQuarter\":\n return dictionary.dateRangePresetLastQuarter;\n case \"nextQuarter\":\n return dictionary.dateRangePresetNextQuarter;\n case \"thisYear\":\n return dictionary.dateRangePresetThisYear;\n case \"lastYear\":\n return dictionary.dateRangePresetLastYear;\n case \"nextYear\":\n return dictionary.dateRangePresetNextYear;\n default:\n return \"\";\n }\n },\n [dictionary],\n );\n\n const isPresetSelected = useCallback(\n (preset: ResolvedDateRangePreset) => {\n if (!value?.start || !value.end) {\n return false;\n }\n\n return value.start.compare(preset.range.start) === 0 && value.end.compare(preset.range.end) === 0;\n },\n [value?.end, value?.start],\n );\n\n return (\n <div className={presetList()} data-testid=\"date-range-preset-list\">\n {presets.map((preset) => (\n <AriaButton\n key={preset.descriptor.id}\n slot={null}\n isDisabled={isDisabled}\n data-testid={`date-range-preset-${preset.descriptor.id}`}\n className={presetButton({ isPresetSelected: isPresetSelected(preset) })}\n onPress={() => {\n setValue(preset.range as Parameters<typeof setValue>[0]);\n onPresetSelect?.(preset.descriptor.id, preset.range);\n setOpen(false);\n }}\n >\n {getPresetLabel(preset)}\n </AriaButton>\n ))}\n </div>\n );\n};\n\nconst DateRangePickerSegmentInputs = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DateRangePickerInputProps) => {\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { input, segment: segmentStyles } = dateFieldStyles();\n const { button, buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n\n const { clear } = useDictionary();\n\n const context = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n\n const calendarButtonRef = useRef<HTMLButtonElement | null>(null);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <DateInput className={input()} slot=\"start\">\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value?.start : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n <span\n aria-hidden=\"true\"\n className={\n !!value?.start && !!value.end && !isDisabled ? \"text-primary\" : \"text-tertiary\"\n }\n >\n &nbsp;–&nbsp;\n </span>\n\n <DateInput className={input()} slot=\"end\">\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value?.end : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n {/* We reverse the order so we can go back to the date input by pressing the left arrow when the calendar button is focused. \n Otherwise the clear button would be focused instead and it would move the focus back to the calendar button */}\n <div className=\"ms-auto flex flex-row-reverse gap-2\">\n <AriaButton\n isDisabled={isDisabled}\n className={({ isDisabled, isFocusVisible, isHovered }) =>\n button({ isDisabled, isFocused: isFocusVisible, isHovered })\n }\n ref={calendarButtonRef}\n >\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n\n {!isDisabled && value?.end && value?.start && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n onFocus={(e) => {\n e.preventDefault();\n // when filling in a full value in the input this button gets focus automatically, we move focus the calendar button instead\n calendarButtonRef?.current?.focus();\n }}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n // focus the calendar button after clearing the value\n // this way the user can easily open the calendar again\n // plus focusing another element afterwards makes sure that the focus is moved\n // https://n6k.atlassian.net/browse/OPTR-31779\n calendarButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n </div>\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\nconst DateRangePickerCalendarGridBody = () => {\n const { rangeBodyCell } = dataPickerCalendarGridStyles();\n\n return (\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({\n isDisabled,\n isFocusVisible,\n isHovered,\n isOutsideMonth,\n isPressed,\n isSelected,\n isSelectionEnd,\n isSelectionStart,\n isUnavailable,\n }) =>\n rangeBodyCell({\n isSelected,\n isSelectionStart,\n isSelectionEnd,\n isFocusVisible,\n isHovered,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isPressed,\n })\n }\n />\n )}\n </CalendarGridBody>\n );\n};\n"],"mappings":"A,wyBA4FA,IAAMgE,EAA8B,GAC3BC,EACJ,cAAc,IAAI,KAAK,KAAM,EAAG,CAAC,CAAC,CAAC,CACnC,IAAK,GAAS,CACb,OAAQC,EAAK,KAAb,CACE,IAAK,MACH,MAAO,KACT,IAAK,QACH,MAAO,KACT,IAAK,OACH,M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AAAA,YAAD,CACe,cACC,eACG,iBAClB,CAAA,CACD,CAAA,CAAA,CAEN,EAEMkG,MAAwC,CAC5C,GAAM,CAAE,iBAAkBhG,EAAAA,6BAA6B,EAEvD,OACE,EAAA0B,EAAA,IAAA,CAACzB,EAAAA,iBAAD,CAAA,SACI,IACA,EAAAyB,EAAA,IAAA,CAACxB,EAAAA,aAAD,CACQ,OACN,WAAY,CACV,aACA,iBACA,YACA,iBACA,YACA,aACA,iBACA,mBACA,mBAEA8H,EAAc,CACZ,aACA,mBACA,iBACA,iBACA,YACA,gBACA,aACA,iBACA,WACF,CAAC,CAEJ,CAAA,CAEa,CAAA,CAEtB,E"}
1
+ {"version":3,"file":"lyra813.cjs","names":["useContextProps","DateRangePickerContext","useLocale","useState","useMemo","shouldRenderInputHeader","useCallback","sharedInputStyles","resolveDateRangePresets","AriaDateRangePicker","_Fragment","Popover","RangeCalendar","datePickerHeaderStyles","useContext","RangeCalendarStateContext","DateRangePickerStateContext","useRef","Separator","AriaButton","SvgIcon","MonthPicker","YearPicker","CalendarGrid","DatePickerCalendarGridHeader","fixedForwardRef","useDictionary","dateRangePickerStyles","DateFormatter","getLocalTimeZone","InputHeader","Group","DateInput","DateSegment","Tooltip","InputFooter","dateFieldStyles","dataPickerCalendarGridStyles","CalendarGridBody","CalendarCell","require_I18nProvider","require_queries","require_DateFormatter","require_helpers","require_utils","require_Button","require_Calendar","require_Group","require_DateField","require_DatePicker","require_dictionary_provider","require_svg_icon","require_tooltip","require_styles","require_input_header","require_input_footer","require_popover","require_helpers$1","require_date_picker_styles","require_shared","require_separator","require_date_range_presets","react","react_jsx_runtime","toLocalizedDatePlaceholder","dateFormatter","part","_DateRangePicker","props","ref","internalValue","setInternalValue","value","defaultValue","isControlled","hasInputHeader","hideHintLabel","hideInputHeader","label","handleChange","newValue","startYearComplete","endYearComplete","onChange","startSlot","controlledProps","isDayGranularity","granularity","resolvedPresets","hidePresets","additionalPresets","presets","disabledPresetIds","isDateUnavailable","locale","maxValue","minValue","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","DateRangePickerButtonInput","e","state","isDisabled","disableClearLogic","DateRangePickerSegmentInputs","PopoverCalendarGrid","DateRangePickerPresetPanel","outerEndSlot","context","dateRangePickerState","hasCompleteSelection","previousSelectionCompleteRef","autoCloseOnCompleteSelection","getNextMonth","month","getPreviousMonth","onStartMonthChange","visibleRange","focusPreviousPage","focusNextPage","newMonth","newFocusedDate","focusedDate","setFocusedDate","onStartYearChange","onEndMonthChange","onEndYearChange","presetPanel","buttons","anchorDate","DateRangePickerCalendarGridBody","DateRangePicker","formatTriggerDate","timeZone","date","singleDatePlaceholder","emptyRangePlaceholder","triggerButtonRef","triggerLabel","inputField","isFocusWithin","isInvalid","errorMessage","triggerButton","triggerText","clear","buttonExcludedFromTabOrder","setValue","dictionary","getPresetLabel","preset","isPresetSelected","presetList","presetButton","onPresetSelect","setOpen","segmentStyles","calendarButtonRef","input","segment","button","isFocusVisible","rangeBodyCell"],"sources":["../src/components/inputs/date-picker/date-range-picker.tsx"],"sourcesContent":["import {\n ElementRef,\n ForwardedRef,\n KeyboardEventHandler,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { JSX } from \"react\";\nimport {\n Button as AriaButton,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n DateInput,\n DateRangePicker as AriaDateRangePicker,\n DateRangePickerContext,\n DateRangePickerProps as AriaDateRangePickerProps,\n DateRangePickerStateContext,\n DateSegment,\n DateValue,\n Group,\n RangeCalendar,\n RangeCalendarStateContext,\n useContextProps,\n useLocale,\n} from \"react-aria-components\";\n\nimport { DateFormatter, getLocalTimeZone } from \"@internationalized/date\";\nimport { RangeValue } from \"@react-types/shared\";\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { Popover } from \"../../overlays\";\nimport { Separator } from \"../../separator\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { Tooltip } from \"../../tooltip\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nimport {\n dataPickerCalendarGridStyles,\n dateFieldStyles,\n datePickerHeaderStyles,\n dateRangePickerStyles,\n} from \"./date-picker.styles\";\nimport {\n DateRangePresetDescriptor,\n ResolvedDateRangePreset,\n resolveDateRangePresets,\n} from \"./date-range-presets\";\nimport { DatePickerCalendarGridHeader, MonthPicker, YearPicker } from \"./shared\";\n\nexport type DateRangePickerProps<T extends DateValue> = Omit<\n AriaDateRangePickerProps<T>,\n \"className\"\n> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasStartSlot\" | \"hasEndSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\" | \"isWarning\"\n > &\n InputHeaderProps &\n InputOuterSlotsProps &\n InputFooterProps & {\n className?: string;\n startSlot?: JSX.Element;\n disableClearLogic?: boolean;\n hidePresets?: boolean;\n additionalPresets?: DateRangePresetDescriptor[];\n disabledPresetIds?: string[];\n /**\n * Legacy full override.\n * Prefer `additionalPresets` + `disabledPresetIds`.\n */\n presets?: DateRangePresetDescriptor[];\n onPresetSelect?: (presetId: string, range: RangeValue<DateValue>) => void;\n };\n\nexport type { DateRangePresetDescriptor, DateValue };\n\nconst toLocalizedDatePlaceholder = (dateFormatter: DateFormatter) => {\n return dateFormatter\n .formatToParts(new Date(2006, 0, 2))\n .map((part) => {\n switch (part.type) {\n case \"day\":\n return \"dd\";\n case \"month\":\n return \"mm\";\n case \"year\":\n return \"yyyy\";\n default:\n return part.value;\n }\n })\n .join(\"\");\n};\n\nconst _DateRangePicker = <T extends DateValue>(\n {\n className,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth = true,\n granularity = \"day\",\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n hidePresets,\n additionalPresets,\n disabledPresetIds,\n label,\n onPresetSelect,\n outerEndSlot,\n outerStartSlot,\n presets,\n startSlot,\n ...props\n }: DateRangePickerProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaDateRangePicker>>,\n) => {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n const { defaultValue, isDateUnavailable, isInvalid, isRequired, maxValue, minValue, onChange, value } =\n props;\n const { locale } = useLocale();\n\n const [internalValue, setInternalValue] = useState(value || defaultValue || null);\n\n // Sync internal value with external value prop and handle resets\n // Only run this effect when we're in controlled mode (value prop is explicitly passed)\n const isControlled = \"value\" in props;\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n\n setInternalValue(value || null);\n }, [value, isControlled]);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n // Handle changes - update internal state only in uncontrolled mode, conditionally call external onChange\n const handleChange = useCallback(\n (newValue: Parameters<NonNullable<typeof onChange>>[0]) => {\n // AriaDateRangePicker passes MappedDateValue<T> which TypeScript can't reconcile with T\n // This single assertion is unavoidable due to the library's type design\n setInternalValue(newValue as typeof internalValue);\n\n // Check if both years are complete (4 digits each)\n const startYearComplete = !newValue?.start || newValue.start.year.toString().length === 4;\n const endYearComplete = !newValue?.end || newValue.end.year.toString().length === 4;\n\n // Only fire external onChange callback if newValue is null or both years are complete\n if (!newValue || (startYearComplete && endYearComplete)) {\n onChange?.(newValue);\n }\n },\n [onChange],\n );\n\n const { outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const controlledProps = isControlled ? { value: internalValue, onChange: handleChange } : {};\n const isDayGranularity = granularity === \"day\";\n\n const resolvedPresets = useMemo(\n () =>\n isDayGranularity && !hidePresets\n ? resolveDateRangePresets({\n additionalDescriptors: additionalPresets,\n descriptors: presets,\n disabledPresetIds,\n isDateUnavailable: isDateUnavailable as ((date: DateValue) => boolean) | undefined,\n locale,\n maxValue: maxValue as DateValue | undefined,\n minValue: minValue as DateValue | undefined,\n })\n : [],\n [\n additionalPresets,\n disabledPresetIds,\n hidePresets,\n isDateUnavailable,\n isDayGranularity,\n locale,\n maxValue,\n minValue,\n presets,\n ],\n );\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaDateRangePicker\n {...props}\n {...controlledProps}\n granularity={granularity}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled, state }) => (\n <>\n {isDayGranularity ? (\n <DateRangePickerButtonInput\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n customHint={props.customHint}\n startSlot={startSlot}\n onKeyDown={(e) => {\n if (\n e.key === \"Escape\" &&\n state.value?.end &&\n state.value?.start &&\n !isDisabled &&\n !disableClearLogic\n ) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n ) : (\n <DateRangePickerSegmentInputs\n description={description}\n fullWidth={fullWidth}\n errorMessage={errorMessage}\n hideHintLabel={hideHintLabel}\n hideInputFooter={hideInputFooter}\n hideInputHeader={hideInputHeader}\n isDisabled={isDisabled}\n isRequired={isRequired}\n label={label}\n customHint={props.customHint}\n startSlot={startSlot}\n onKeyDown={(e) => {\n if (\n e.key === \"Escape\" &&\n state.value?.end &&\n state.value?.start &&\n !isDisabled &&\n !disableClearLogic\n ) {\n e.preventDefault();\n state.setValue(null);\n }\n }}\n disableClearLogic={disableClearLogic}\n />\n )}\n\n <Popover disablePadding className=\"group\">\n <RangeCalendar visibleDuration={{ months: 2 }} pageBehavior=\"single\">\n <PopoverCalendarGrid\n autoCloseOnCompleteSelection={isDayGranularity}\n presetPanel={\n resolvedPresets.length ? (\n <DateRangePickerPresetPanel\n isDisabled={isDisabled}\n presets={resolvedPresets}\n onPresetSelect={onPresetSelect}\n />\n ) : null\n }\n />\n </RangeCalendar>\n </Popover>\n </>\n )}\n </AriaDateRangePicker>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\ntype PopoverCalendarGridProps = {\n presetPanel?: ReactNode;\n autoCloseOnCompleteSelection?: boolean;\n};\n\nconst PopoverCalendarGrid = ({\n autoCloseOnCompleteSelection,\n presetPanel,\n}: PopoverCalendarGridProps) => {\n const { buttons } = datePickerHeaderStyles();\n\n const context = useContext(RangeCalendarStateContext);\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"RangeCalendarStateContext is not provided.\");\n }\n\n if (!dateRangePickerState) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const {\n anchorDate,\n focusedDate,\n focusNextPage,\n focusPreviousPage,\n setFocusedDate,\n visibleRange,\n } = context;\n\n const hasCompleteSelection = !!dateRangePickerState.value?.start && !!dateRangePickerState.value?.end;\n const previousSelectionCompleteRef = useRef(hasCompleteSelection);\n\n useEffect(() => {\n if (\n autoCloseOnCompleteSelection &&\n dateRangePickerState.isOpen &&\n hasCompleteSelection &&\n !previousSelectionCompleteRef.current\n ) {\n dateRangePickerState.setOpen(false);\n }\n\n previousSelectionCompleteRef.current = hasCompleteSelection;\n }, [autoCloseOnCompleteSelection, dateRangePickerState, hasCompleteSelection]);\n\n const getNextMonth = (month: number) => (month === 12 ? 1 : month + 1);\n const getPreviousMonth = (month: number) => (month === 1 ? 12 : month - 1);\n\n /**\n * Visible range logic from react-aria\n * - when setting a focused date before the current start range, the focused date is set to the end of the visible range\n * - when setting a focused date after the current end range, the focused date is set to the start of the visible range\n */\n const onStartMonthChange = useCallback(\n (value: number) => {\n if (value === visibleRange.start.month - 1) {\n focusPreviousPage();\n } else if (value === visibleRange.start.month + 1) {\n focusNextPage();\n } else {\n // when going in the past we need to make sure the focused date is in the next month so the visible range starts where we want\n const newMonth = value < visibleRange.start.month ? getNextMonth(value) : value;\n const newFocusedDate = visibleRange.start.copy().set({\n month: newMonth,\n day: focusedDate.day,\n });\n setFocusedDate(newFocusedDate);\n }\n },\n [focusNextPage, focusPreviousPage, focusedDate.day, setFocusedDate, visibleRange.start],\n );\n\n const onStartYearChange = useCallback(\n (value: number): void => {\n // handle Dec-Jan visible range separately\n if (visibleRange.start.year !== visibleRange.end.year) {\n // when going in the past the focused date should be in January so the visible range starts where we want\n if (value < visibleRange.start.year) {\n const newFocusedDate = visibleRange.start.copy().set({\n year: value + 1,\n day: focusedDate.day,\n month: 1,\n });\n\n setFocusedDate(newFocusedDate);\n }\n // when going in the future the focused date should be in December so the visible range starts where we want\n if (value > visibleRange.start.year) {\n const newFocusedDate = visibleRange.start.copy().set({\n year: value,\n day: focusedDate.day,\n month: 12,\n });\n\n setFocusedDate(newFocusedDate);\n }\n } else {\n // when going in the past we need to make sure the focused date is in the next month so the visible range starts where we want\n const newMonth =\n value < visibleRange.start.year\n ? getNextMonth(visibleRange.start.month)\n : visibleRange.start.month;\n const newFocusedDate = visibleRange.start.copy().set({\n year: value,\n day: focusedDate.day,\n month: newMonth,\n });\n\n setFocusedDate(newFocusedDate);\n }\n },\n [focusedDate.day, setFocusedDate, visibleRange.end.year, visibleRange.start],\n );\n\n const onEndMonthChange = useCallback(\n (value: number): void => {\n if (value === visibleRange.end.month - 1) {\n focusPreviousPage();\n } else if (value === visibleRange.end.month + 1) {\n focusNextPage();\n } else {\n // when going in the future we need to make sure the focused date is in the previous month so the visible range starts where we want\n const newMonth = value > visibleRange.end.month ? getPreviousMonth(value) : value;\n const newFocusedDate = visibleRange.end.copy().set({\n month: newMonth,\n day: focusedDate.day,\n });\n setFocusedDate(newFocusedDate);\n }\n },\n [focusNextPage, focusPreviousPage, focusedDate.day, setFocusedDate, visibleRange.end],\n );\n\n const onEndYearChange = useCallback(\n (value: number): void => {\n // handle Dec-Jan visible range separately\n if (visibleRange.start.year !== visibleRange.end.year) {\n // when going in the past the focused date should be in January so the visible range starts where we want\n if (value < visibleRange.end.year) {\n const newFocusedDate = visibleRange.end.copy().set({\n year: value,\n day: focusedDate.day,\n month: 1,\n });\n\n setFocusedDate(newFocusedDate);\n }\n if (value > visibleRange.end.year) {\n // when going in the future the focused date should be in December so the visible range starts where we want\n const newFocusedDate = visibleRange.end.copy().set({\n year: value - 1,\n day: focusedDate.day,\n month: 12,\n });\n\n setFocusedDate(newFocusedDate);\n }\n } else {\n // when going in the future we need to make sure the focused date is in the previous month so the visible range starts where we want\n const newMonth =\n value > visibleRange.end.year\n ? getPreviousMonth(visibleRange.end.month)\n : visibleRange.end.month;\n const newFocusedDate = visibleRange.end.copy().set({\n year: value,\n day: focusedDate.day,\n month: newMonth,\n });\n\n setFocusedDate(newFocusedDate);\n }\n },\n [focusedDate.day, setFocusedDate, visibleRange.end, visibleRange.start.year],\n );\n\n return (\n <div className=\"flex flex-col gap-3 p-3 lg:flex-row\">\n {presetPanel ? (\n <>\n <div className=\"lg:w-52\">{presetPanel}</div>\n <Separator orientation=\"vertical\" className=\"hidden h-[unset] self-stretch lg:block\" />\n <Separator className=\"lg:hidden\" />\n </>\n ) : null}\n\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex justify-between gap-1\">\n <AriaButton slot=\"previous\" className={buttons()}>\n <SvgIcon name=\"chevron-left\" />\n </AriaButton>\n <div className=\"flex gap-1\">\n <MonthPicker\n value={visibleRange.start.month}\n isDisabled={!!anchorDate}\n onChange={onStartMonthChange}\n />\n <YearPicker\n value={visibleRange.start.year}\n isDisabled={!!anchorDate}\n onChange={onStartYearChange}\n />\n </div>\n <div className=\"w-6\" />\n </div>\n <CalendarGrid className=\"w-full text-center\">\n <DatePickerCalendarGridHeader />\n <DateRangePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n\n <Separator orientation=\"vertical\" className=\"hidden h-[unset] self-stretch sm:block\" />\n <Separator className=\"sm:hidden\" />\n\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex justify-between gap-1\">\n <div className=\"w-6\" />\n <div className=\"flex gap-1\">\n <MonthPicker\n value={visibleRange.end.month}\n isDisabled={!!anchorDate}\n onChange={onEndMonthChange}\n />\n <YearPicker\n value={visibleRange.end.year}\n isDisabled={!!anchorDate}\n onChange={onEndYearChange}\n />\n </div>\n <AriaButton slot=\"next\" className={buttons()}>\n <SvgIcon name=\"chevron-right\" />\n </AriaButton>\n </div>\n <CalendarGrid className=\"w-full text-center\" offset={{ months: 1 }}>\n <DatePickerCalendarGridHeader />\n <DateRangePickerCalendarGridBody />\n </CalendarGrid>\n </div>\n </div>\n </div>\n );\n};\n\nexport const DateRangePicker = fixedForwardRef(_DateRangePicker);\n//@ts-ignore\nDateRangePicker.displayName = \"DateRangePicker\";\n\ntype DateRangePickerInputProps = VariantProps<typeof sharedInputStyles> &\n InputHeaderProps &\n InputFooterProps & {\n startSlot?: JSX.Element;\n onKeyDown?: KeyboardEventHandler<HTMLElement>;\n disableClearLogic?: boolean;\n };\n\nconst DateRangePickerButtonInput = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DateRangePickerInputProps) => {\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n\n const { clear } = useDictionary();\n const { locale } = useLocale();\n\n const context = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n const { triggerButton, triggerText } = dateRangePickerStyles();\n\n const dateFormatter = useMemo(\n () =>\n new DateFormatter(locale, {\n day: \"2-digit\",\n month: \"2-digit\",\n year: \"numeric\",\n }),\n [locale],\n );\n const formatTriggerDate = useCallback(\n (date: DateValue) => {\n const timeZone = \"timeZone\" in date ? date.timeZone : getLocalTimeZone();\n return dateFormatter.format(date.toDate(timeZone));\n },\n [dateFormatter],\n );\n const singleDatePlaceholder = useMemo(\n () => toLocalizedDatePlaceholder(dateFormatter),\n [dateFormatter],\n );\n const emptyRangePlaceholder = useMemo(\n () => `${singleDatePlaceholder} - ${singleDatePlaceholder}`,\n [singleDatePlaceholder],\n );\n\n const triggerButtonRef = useRef<HTMLButtonElement | null>(null);\n\n const triggerLabel = useMemo(() => {\n if (!value?.start && !value?.end) {\n return emptyRangePlaceholder;\n }\n\n const startText = value?.start ? formatTriggerDate(value.start) : singleDatePlaceholder;\n const endText = value?.end ? formatTriggerDate(value.end) : singleDatePlaceholder;\n\n return `${startText} - ${endText}`;\n }, [emptyRangePlaceholder, formatTriggerDate, singleDatePlaceholder, value?.end, value?.start]);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <div className=\"hidden\" aria-hidden=\"true\">\n <DateInput slot=\"start\">\n {(segment) => <DateSegment segment={segment} className=\"hidden\" />}\n </DateInput>\n <DateInput slot=\"end\">\n {(segment) => <DateSegment segment={segment} className=\"hidden\" />}\n </DateInput>\n </div>\n\n <AriaButton\n ref={triggerButtonRef}\n isDisabled={isDisabled}\n className={triggerButton()}\n data-testid=\"date-range-picker-trigger\"\n >\n <span className={triggerText({ hasValue: !!value?.start || !!value?.end })}>{triggerLabel}</span>\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n\n {!isDisabled && value?.end && value?.start && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n triggerButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\ntype DateRangePickerPresetPanelProps = {\n isDisabled?: boolean;\n presets: ResolvedDateRangePreset[];\n onPresetSelect?: (presetId: string, range: RangeValue<DateValue>) => void;\n};\n\nconst DateRangePickerPresetPanel = ({\n isDisabled,\n onPresetSelect,\n presets,\n}: DateRangePickerPresetPanelProps) => {\n const dictionary = useDictionary();\n const context = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const { setOpen, setValue, value } = context;\n const { presetButton, presetList } = dateRangePickerStyles();\n\n const getPresetLabel = useCallback(\n (preset: ResolvedDateRangePreset) => {\n if (preset.descriptor.label) {\n return preset.descriptor.label;\n }\n\n switch (preset.descriptor.kind) {\n case \"today\":\n return dictionary.dateRangePresetToday;\n case \"yesterday\":\n return dictionary.dateRangePresetYesterday;\n case \"tomorrow\":\n return dictionary.dateRangePresetTomorrow;\n case \"lastDays\":\n return dictionary.dateRangePresetLastDays(preset.descriptor.days);\n case \"nextDays\":\n return dictionary.dateRangePresetNextDays(preset.descriptor.days);\n case \"thisWeek\":\n return dictionary.dateRangePresetThisWeek;\n case \"lastWeek\":\n return dictionary.dateRangePresetLastWeek;\n case \"nextWeek\":\n return dictionary.dateRangePresetNextWeek;\n case \"thisMonth\":\n return dictionary.dateRangePresetThisMonth;\n case \"lastMonth\":\n return dictionary.dateRangePresetLastMonth;\n case \"nextMonth\":\n return dictionary.dateRangePresetNextMonth;\n case \"thisQuarter\":\n return dictionary.dateRangePresetThisQuarter;\n case \"lastQuarter\":\n return dictionary.dateRangePresetLastQuarter;\n case \"nextQuarter\":\n return dictionary.dateRangePresetNextQuarter;\n case \"thisYear\":\n return dictionary.dateRangePresetThisYear;\n case \"lastYear\":\n return dictionary.dateRangePresetLastYear;\n case \"nextYear\":\n return dictionary.dateRangePresetNextYear;\n default:\n return \"\";\n }\n },\n [dictionary],\n );\n\n const isPresetSelected = useCallback(\n (preset: ResolvedDateRangePreset) => {\n if (!value?.start || !value.end) {\n return false;\n }\n\n return value.start.compare(preset.range.start) === 0 && value.end.compare(preset.range.end) === 0;\n },\n [value?.end, value?.start],\n );\n\n return (\n <div className={presetList()} data-testid=\"date-range-preset-list\">\n {presets.map((preset) => (\n <AriaButton\n key={preset.descriptor.id}\n slot={null}\n isDisabled={isDisabled}\n data-testid={`date-range-preset-${preset.descriptor.id}`}\n className={presetButton({ isPresetSelected: isPresetSelected(preset) })}\n onPress={() => {\n setValue(preset.range as Parameters<typeof setValue>[0]);\n onPresetSelect?.(preset.descriptor.id, preset.range);\n setOpen(false);\n }}\n >\n {getPresetLabel(preset)}\n </AriaButton>\n ))}\n </div>\n );\n};\n\nconst DateRangePickerSegmentInputs = ({\n customHint,\n description,\n disableClearLogic,\n errorMessage,\n fullWidth,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n isDisabled,\n isRequired,\n label,\n onKeyDown,\n startSlot,\n}: DateRangePickerInputProps) => {\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { input, segment: segmentStyles } = dateFieldStyles();\n const { button, buttonExcludedFromTabOrder, inputField } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: true,\n isInputOnly: false,\n });\n\n const { clear } = useDictionary();\n\n const context = useContext(DateRangePickerStateContext);\n\n if (!context) {\n throw new Error(\"DateRangePickerStateContext is not provided.\");\n }\n\n const { setValue, value } = context;\n\n const calendarButtonRef = useRef<HTMLButtonElement | null>(null);\n\n return (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8\",\n })\n }\n onKeyDown={onKeyDown}\n >\n {startSlot}\n <DateInput className={input()} slot=\"start\">\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value?.start : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n <span\n aria-hidden=\"true\"\n className={\n !!value?.start && !!value.end && !isDisabled ? \"text-primary\" : \"text-tertiary\"\n }\n >\n &nbsp;–&nbsp;\n </span>\n\n <DateInput className={input()} slot=\"end\">\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n // consider literals (separators between segments) to have a value when a full date is entered\n hasValue: segment.type === \"literal\" ? !!value?.end : !segment.isPlaceholder,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n\n {/* We reverse the order so we can go back to the date input by pressing the left arrow when the calendar button is focused. \n Otherwise the clear button would be focused instead and it would move the focus back to the calendar button */}\n <div className=\"ms-auto flex flex-row-reverse gap-2\">\n <AriaButton\n isDisabled={isDisabled}\n className={({ isDisabled, isFocusVisible, isHovered }) =>\n button({ isDisabled, isFocused: isFocusVisible, isHovered })\n }\n ref={calendarButtonRef}\n >\n <SvgIcon name=\"calendar\" />\n </AriaButton>\n\n {!isDisabled && value?.end && value?.start && !disableClearLogic ? (\n <Tooltip tooltip={clear}>\n <AriaButton\n slot={null}\n onFocus={(e) => {\n e.preventDefault();\n // when filling in a full value in the input this button gets focus automatically, we move focus the calendar button instead\n calendarButtonRef?.current?.focus();\n }}\n excludeFromTabOrder\n className={buttonExcludedFromTabOrder()}\n onPress={() => {\n setValue(null);\n // focus the calendar button after clearing the value\n // this way the user can easily open the calendar again\n // plus focusing another element afterwards makes sure that the focus is moved\n // https://n6k.atlassian.net/browse/OPTR-31779\n calendarButtonRef.current?.focus();\n }}\n >\n <SvgIcon name=\"clear\" />\n </AriaButton>\n </Tooltip>\n ) : null}\n </div>\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n );\n};\n\nconst DateRangePickerCalendarGridBody = () => {\n const { rangeBodyCell } = dataPickerCalendarGridStyles();\n\n return (\n <CalendarGridBody>\n {(date) => (\n <CalendarCell\n date={date}\n className={({\n isDisabled,\n isFocusVisible,\n isHovered,\n isOutsideMonth,\n isPressed,\n isSelected,\n isSelectionEnd,\n isSelectionStart,\n isUnavailable,\n }) =>\n rangeBodyCell({\n isSelected,\n isSelectionStart,\n isSelectionEnd,\n isFocusVisible,\n isHovered,\n isUnavailable,\n isDisabled,\n isOutsideMonth,\n isPressed,\n })\n }\n />\n )}\n </CalendarGridBody>\n );\n};\n"],"mappings":"A,wyBA4FA,IAAMgE,EAA8B,GAC3BC,EACJ,cAAc,IAAI,KAAK,KAAM,EAAG,CAAC,CAAC,CAAC,CACnC,IAAK,GAAS,CACb,OAAQC,EAAK,KAAb,CACE,IAAK,MACH,MAAO,KACT,IAAK,QACH,MAAO,KACT,IAAK,OACH,MAAO,OACT,QACE,OAAOA,EAAK,KAChB,CACF,CAAC,CAAC,CACD,KAAK,EAAE,EAGNC,GACJ,CACE,YACA,cACA,oBACA,eACA,YAAY,GACZ,cAAc,MACd,gBACA,kBACA,kBACA,cAC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