@povio/ui 2.3.0-rc.1 → 2.3.0-rc.10

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 (206) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +166 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +35 -14
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +125 -109
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +33 -15
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +391 -117
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +4 -8
  83. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +8 -8
  84. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  85. package/dist/components/inputs/File/FileUpload.js +86 -44
  86. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  87. package/dist/components/inputs/File/InputUpload.js +317 -79
  88. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  89. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  90. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  91. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  92. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  93. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  94. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  95. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  96. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  97. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  98. package/dist/components/inputs/FormField/FormField.js +119 -37
  99. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  100. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  101. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  102. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  103. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  104. package/dist/components/inputs/Input/NumberInput/NumberInput.js +261 -84
  105. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  106. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +321 -77
  107. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  108. package/dist/components/inputs/Input/TextArea/TextArea.js +303 -90
  109. package/dist/components/inputs/Input/TextInput/TextInput.js +250 -84
  110. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  111. package/dist/components/inputs/Inputs/Form.js +40 -11
  112. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
  113. package/dist/components/inputs/Inputs/InputItem.js +65 -16
  114. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  115. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  116. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +11 -4
  117. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
  118. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  119. package/dist/components/inputs/Selection/Select/Select.js +24 -7
  120. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  121. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  122. package/dist/components/inputs/Selection/shared/SelectInput.js +335 -136
  123. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  124. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  125. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  126. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  127. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  128. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  129. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  130. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  131. package/dist/components/inputs/Selection/shared/select.context.js +35 -35
  132. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  133. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  134. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  135. package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
  136. package/dist/components/inputs/Skeleton/InputFrame.js +442 -116
  137. package/dist/components/inputs/Slider/Slider.js +250 -74
  138. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  139. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  140. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  141. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  142. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  143. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  144. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  145. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  146. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  147. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  148. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  149. package/dist/components/inputs/Toggle/Toggle.js +187 -40
  150. package/dist/components/inputs/shared/CheckContent.js +21 -10
  151. package/dist/components/inputs/shared/InputClear.js +78 -21
  152. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  153. package/dist/components/inputs/shared/input.cva.js +13 -3
  154. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
  155. package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
  156. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  157. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  158. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  159. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  160. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  161. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  162. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  163. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  164. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  165. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  166. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  167. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  168. package/dist/components/segment/Segment.js +218 -57
  169. package/dist/components/segment/SegmentItem.js +67 -10
  170. package/dist/components/shared/pagination/Pagination.js +108 -22
  171. package/dist/components/shared/pagination/PaginationList.js +167 -64
  172. package/dist/components/status/Alert/Alert.js +97 -30
  173. package/dist/components/status/Loader/Loader.js +77 -22
  174. package/dist/components/status/Toast/Toast.js +21 -13
  175. package/dist/components/status/Toast/useToast.js +62 -57
  176. package/dist/components/table/ColumnConfig.js +158 -54
  177. package/dist/components/table/InfiniteTable.js +67 -16
  178. package/dist/components/table/PaginatedTable.js +84 -18
  179. package/dist/components/table/Table.js +28 -27
  180. package/dist/components/text/Link/Link.js +19 -7
  181. package/dist/components/text/Typography/Typography.js +23 -8
  182. package/dist/config/confirmation.context.js +1 -1
  183. package/dist/config/link.context.js +23 -9
  184. package/dist/config/router.context.js +42 -16
  185. package/dist/config/theme.context.js +98 -45
  186. package/dist/config/uiConfig.context.js +39 -8
  187. package/dist/config/uiStyle.context.js +15 -5
  188. package/dist/helpers/dynamicInputs.d.ts +1 -1
  189. package/dist/hooks/useBreakpoint.js +16 -3
  190. package/dist/hooks/useDebounceCallback.js +51 -17
  191. package/dist/hooks/useFilters.js +125 -64
  192. package/dist/hooks/useForm.js +42 -8
  193. package/dist/hooks/useFormAutosave.js +101 -30
  194. package/dist/hooks/useIntersectionObserver.js +86 -32
  195. package/dist/hooks/useLocalStorage.js +43 -10
  196. package/dist/hooks/useLongPressRepeat.js +55 -20
  197. package/dist/hooks/usePagination.js +49 -19
  198. package/dist/hooks/useQueryAutocomplete.js +1 -0
  199. package/dist/hooks/useScrollableListBox.js +37 -16
  200. package/dist/hooks/useSorting.js +69 -28
  201. package/dist/hooks/useStateAndRef.js +21 -7
  202. package/dist/hooks/useTableColumnConfig.js +124 -31
  203. package/dist/hooks/useTranslationMemo.js +25 -5
  204. package/dist/index.js +2 -2
  205. package/dist/utils/date-time.utils.js +7 -13
  206. package/package.json +1 -1
@@ -12,6 +12,7 @@ import { FormField } from "../../FormField/FormField.js";
12
12
  import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
13
13
  import { InputFrame } from "../../Skeleton/InputFrame.js";
14
14
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
15
+ import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
15
16
  import { jsx, jsxs } from "react/jsx-runtime";
16
17
  import { clsx } from "clsx";
17
18
  import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
@@ -24,7 +25,20 @@ import { useCalendarState, useDatePickerState } from "react-stately";
24
25
  //#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
25
26
  var DatePickerBase = (props) => {
26
27
  const ui = UIConfig.useConfig();
27
- const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, todayIconButtonSize = ui.dateInput.todayIconButtonSize, todayIconPlacement = ui.dateInput.todayIconPlacement, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange, granularity = ui.dateInput.granularity, autoFixYear = ui.dateInput.autoFixYear, format, ...rest } = props;
28
+ const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp, format, ...rest } = props;
29
+ const as = asProp ?? ui.input.as;
30
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
31
+ const variant = variantProp ?? ui.input.variant;
32
+ const size = sizeProp ?? ui.input.size;
33
+ const isClearable = isClearableProp ?? ui.input.isClearable;
34
+ const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
35
+ const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
36
+ const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
37
+ const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
38
+ const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
39
+ const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
40
+ const granularity = granularityProp ?? ui.dateInput.granularity;
41
+ const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
28
42
  const normalizeByGranularity = useCallback((date) => {
29
43
  if (granularity === "year") return date.set({
30
44
  month: 1,
@@ -50,12 +64,16 @@ var DatePickerBase = (props) => {
50
64
  const datePickerRef = useMemo(() => ({ get current() {
51
65
  return datePickerInputRef.current?.getContainer?.() || null;
52
66
  } }), []);
53
- useImperativeHandle(ref, () => ({ clear: () => {
54
- datePickerInputRef.current?.clear();
55
- } }));
67
+ useImperativeHandle(ref, () => ({
68
+ clear: () => {
69
+ datePickerInputRef.current?.clear();
70
+ },
71
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
72
+ }));
56
73
  const handleBlur = (val) => {
57
74
  onBlur?.({ target: { value: val } });
58
75
  };
76
+ const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
59
77
  const dialogState = useDatePickerState({
60
78
  ...rest,
61
79
  defaultValue: value || rest.defaultValue,
@@ -66,15 +84,16 @@ var DatePickerBase = (props) => {
66
84
  ...rest,
67
85
  shouldForceLeadingZeros,
68
86
  value,
69
- onChange: (val) => {
70
- let normalizedValue = val;
71
- if (val) normalizedValue = normalizeByGranularity(val);
87
+ onChange: (val_0) => {
88
+ let normalizedValue = val_0;
89
+ if (val_0) normalizedValue = normalizeByGranularity(val_0);
72
90
  if (normalizedValue && (rest.minValue && normalizedValue < rest?.minValue || rest?.maxValue && normalizedValue > rest?.maxValue)) {
73
91
  state.setValue(state.value);
74
92
  return;
75
93
  }
76
94
  onChange?.(normalizedValue);
77
95
  dialogState.setValue(normalizedValue);
96
+ debouncedBlur(normalizedValue);
78
97
  if (normalizedValue) {
79
98
  calendarState.setFocusedDate(normalizedValue);
80
99
  return;
@@ -225,7 +244,8 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
225
244
  renderInput,
226
245
  setRenderInput,
227
246
  getFocusTarget: (input) => {
228
- return (input.getContainer?.() ?? input).querySelector("input, button, [tabindex]:not([tabindex='-1'])");
247
+ const container = input.getContainer?.() ?? input;
248
+ return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
229
249
  }
230
250
  });
231
251
  const watchedValue = "formControl" in props && props.formControl ? useWatch({
@@ -247,14 +267,14 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
247
267
  if (calendarDate === null) return null;
248
268
  const normalizedDate = normalizeByGranularity(calendarDate);
249
269
  if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
250
- const date = DateTimeUtils.fromDateValueToLocal(normalizedDate);
251
- return DateTime.fromJSDate(date).toISODate();
270
+ const date_0 = DateTimeUtils.fromDateValueToLocal(normalizedDate);
271
+ return DateTime.fromJSDate(date_0).toISODate();
252
272
  };
253
273
  const parseCalendarDate = (formattedDate) => {
254
274
  if (formattedDate == null) return formattedDate;
255
275
  if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
256
- const date = DateTime.fromISO(formattedDate).toJSDate();
257
- return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date)));
276
+ const date_1 = DateTime.fromISO(formattedDate).toJSDate();
277
+ return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1)));
258
278
  };
259
279
  const dateLimits = {
260
280
  minValue: typeof minValue === "string" ? parseCalendarDate(minValue) : minValue,
@@ -274,7 +294,6 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
274
294
  const staticSegments = getStaticCalendarDateSegments({
275
295
  value: dateValue,
276
296
  locale,
277
- placeholder: props.placeholder,
278
297
  shouldForceLeadingZeros,
279
298
  isDisabled,
280
299
  hidePlaceholder: as === "floating" && !dateValue
@@ -301,6 +320,8 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
301
320
  onStaticInteract: renderRealInput,
302
321
  actionContent: staticTodayIcon,
303
322
  actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
323
+ wrapContentAndTrailing: true,
324
+ contentAndTrailingClassName: "gap-2!",
304
325
  trailingClassName: "py-0! pl-0!",
305
326
  trailingContent: showDropdown ? ui.dateInput.calendarIcon : void 0,
306
327
  children: staticSegments
@@ -330,7 +351,7 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
330
351
  ref: mergeRefs(props.ref, inputRef),
331
352
  granularity,
332
353
  value: parseCalendarDate(props.value),
333
- onChange: (value) => props.onChange?.(formatCalendarDate(value))
354
+ onChange: (value_0) => props.onChange?.(formatCalendarDate(value_0))
334
355
  });
335
356
  };
336
357
  //#endregion
@@ -30,7 +30,18 @@ import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
30
30
  var DateRangePickerBase = (props) => {
31
31
  const ui = UIConfig.useConfig();
32
32
  const { t } = useTranslation();
33
- const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel = ui.input.hideLabel, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, todayIconButtonSize = ui.dateInput.todayIconButtonSize, todayIconPlacement = ui.dateInput.todayIconPlacement, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, autoFixYear = ui.dateInput.autoFixYear, ...rest } = props;
33
+ const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, hideSidebar, placeholder, inputClassName, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, autoFixYear: autoFixYearProp, ...rest } = props;
34
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
35
+ const variant = variantProp ?? ui.input.variant;
36
+ const as = asProp ?? ui.input.as;
37
+ const size = sizeProp ?? ui.input.size;
38
+ const isClearable = isClearableProp ?? ui.input.isClearable;
39
+ const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
40
+ const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
41
+ const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
42
+ const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
43
+ const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
44
+ const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
34
45
  const [validationRangeError, setValidationRangeError] = useState();
35
46
  const datePickerInputRef = useRef(null);
36
47
  const dateRangePickerRef = useMemo(() => ({ get current() {
@@ -65,11 +76,14 @@ var DateRangePickerBase = (props) => {
65
76
  shouldForceLeadingZeros
66
77
  }, dialogState, dateRangePickerRef);
67
78
  const { locale } = useLocale$1();
68
- useImperativeHandle(ref, () => ({ clear: () => {
69
- datePickerInputRef.current?.clear();
70
- } }));
71
- const handleBlur = (newValue) => {
72
- onBlur?.({ target: { value: newValue } });
79
+ useImperativeHandle(ref, () => ({
80
+ clear: () => {
81
+ datePickerInputRef.current?.clear();
82
+ },
83
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
84
+ }));
85
+ const handleBlur = (newValue_0) => {
86
+ onBlur?.({ target: { value: newValue_0 } });
73
87
  };
74
88
  const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
75
89
  const formFieldProps = {
@@ -122,10 +136,10 @@ var DateRangePickerBase = (props) => {
122
136
  className: headerClassName,
123
137
  labelProps
124
138
  };
125
- const isValidRange = useCallback((newValue) => {
126
- if (newValue?.start && newValue?.end) {
127
- const startDate = newValue.start;
128
- if (newValue.end.compare(startDate) < 0) {
139
+ const isValidRange = useCallback((newValue_1) => {
140
+ if (newValue_1?.start && newValue_1?.end) {
141
+ const startDate = newValue_1.start;
142
+ if (newValue_1.end.compare(startDate) < 0) {
129
143
  setValidationRangeError(t(($) => $.ui.datePicker.errors.endDateBeforeStart, { ns: "ui" }));
130
144
  return true;
131
145
  }
@@ -133,20 +147,20 @@ var DateRangePickerBase = (props) => {
133
147
  } else setValidationRangeError(void 0);
134
148
  return false;
135
149
  }, [t]);
136
- const handleCalendarStatesChange = (newValue) => {
137
- if (newValue) {
138
- if (isValidRange(newValue)) return;
139
- dialogState.setValue(newValue);
140
- const startDate = newValue.start;
141
- const endDate = newValue.end;
142
- leftCalendarState.setFocusedDate(startDate);
143
- if (startDate.year === endDate.year && startDate.month === endDate.month) rightCalendarState.setFocusedDate(startDate.add({ months: 1 }));
144
- else rightCalendarState.setFocusedDate(endDate);
145
- leftCalendarState.setValue(newValue);
146
- rightCalendarState.setValue(newValue);
150
+ const handleCalendarStatesChange = (newValue_2) => {
151
+ if (newValue_2) {
152
+ if (isValidRange(newValue_2)) return;
153
+ dialogState.setValue(newValue_2);
154
+ const startDate_0 = newValue_2.start;
155
+ const endDate_0 = newValue_2.end;
156
+ leftCalendarState.setFocusedDate(startDate_0);
157
+ if (startDate_0.year === endDate_0.year && startDate_0.month === endDate_0.month) rightCalendarState.setFocusedDate(startDate_0.add({ months: 1 }));
158
+ else rightCalendarState.setFocusedDate(endDate_0);
159
+ leftCalendarState.setValue(newValue_2);
160
+ rightCalendarState.setValue(newValue_2);
147
161
  setRangeSelection({
148
- start: newValue.start,
149
- end: newValue.end,
162
+ start: newValue_2.start,
163
+ end: newValue_2.end,
150
164
  isSelecting: false
151
165
  });
152
166
  setHoverDate(null);
@@ -170,27 +184,27 @@ var DateRangePickerBase = (props) => {
170
184
  setHoverDate(date);
171
185
  });
172
186
  }, []);
173
- const handleDateHover = useCallback((date) => {
174
- if (rangeSelection.isSelecting && rangeSelection.start) throttledSetHoverDate(date);
187
+ const handleDateHover = useCallback((date_0) => {
188
+ if (rangeSelection.isSelecting && rangeSelection.start) throttledSetHoverDate(date_0);
175
189
  }, [
176
190
  rangeSelection.isSelecting,
177
191
  rangeSelection.start,
178
192
  throttledSetHoverDate
179
193
  ]);
180
- const handleDateSelection = useCallback((date, calendarSide) => {
194
+ const handleDateSelection = useCallback((date_1, calendarSide) => {
181
195
  if (calendarSide) {
182
196
  const currentVisibleMonth = (calendarSide === "left" ? leftCalendarState : rightCalendarState).visibleRange.start;
183
- if (date.month !== currentVisibleMonth.month || date.year !== currentVisibleMonth.year) if (calendarSide === "left") {
184
- leftCalendarState.setFocusedDate(date);
185
- rightCalendarState.setFocusedDate(date.add({ months: 1 }));
197
+ if (date_1.month !== currentVisibleMonth.month || date_1.year !== currentVisibleMonth.year) if (calendarSide === "left") {
198
+ leftCalendarState.setFocusedDate(date_1);
199
+ rightCalendarState.setFocusedDate(date_1.add({ months: 1 }));
186
200
  } else {
187
- rightCalendarState.setFocusedDate(date);
188
- leftCalendarState.setFocusedDate(date.subtract({ months: 1 }));
201
+ rightCalendarState.setFocusedDate(date_1);
202
+ leftCalendarState.setFocusedDate(date_1.subtract({ months: 1 }));
189
203
  }
190
204
  }
191
205
  if (!rangeSelection.isSelecting || !rangeSelection.start) {
192
206
  setRangeSelection({
193
- start: date,
207
+ start: date_1,
194
208
  end: null,
195
209
  isSelecting: true
196
210
  });
@@ -199,7 +213,7 @@ var DateRangePickerBase = (props) => {
199
213
  rightCalendarState.setValue(null);
200
214
  } else {
201
215
  const { start } = rangeSelection;
202
- const end = date;
216
+ const end = date_1;
203
217
  const finalStart = start.compare(end) <= 0 ? start : end;
204
218
  const finalEnd = start.compare(end) <= 0 ? end : start;
205
219
  const newRange = {
@@ -223,16 +237,16 @@ var DateRangePickerBase = (props) => {
223
237
  rightCalendarState,
224
238
  dialogState
225
239
  ]);
226
- const handleKeyboardNavigation = useCallback((event, date, calendarSide) => {
227
- const currentState = calendarSide === "left" ? leftCalendarState : rightCalendarState;
228
- const otherState = calendarSide === "left" ? rightCalendarState : leftCalendarState;
240
+ const handleKeyboardNavigation = useCallback((event, date_2, calendarSide_0) => {
241
+ const currentState_0 = calendarSide_0 === "left" ? leftCalendarState : rightCalendarState;
242
+ const otherState = calendarSide_0 === "left" ? rightCalendarState : leftCalendarState;
229
243
  let shouldPreventDefault = false;
230
244
  switch (event.key) {
231
245
  case "ArrowRight": {
232
- const nextDate = date.add({ days: 1 });
233
- const currentMonth = currentState.visibleRange.start;
234
- const otherMonth = otherState.visibleRange.start;
235
- if (calendarSide === "left" && nextDate.month !== currentMonth.month) if (nextDate.year === otherMonth.year && nextDate.month === otherMonth.month) {
246
+ const nextDate = date_2.add({ days: 1 });
247
+ const currentMonth_2 = currentState_0.visibleRange.start;
248
+ const otherMonth_2 = otherState.visibleRange.start;
249
+ if (calendarSide_0 === "left" && nextDate.month !== currentMonth_2.month) if (nextDate.year === otherMonth_2.year && nextDate.month === otherMonth_2.month) {
236
250
  otherState.setFocusedDate(nextDate);
237
251
  shouldPreventDefault = true;
238
252
  } else {
@@ -242,10 +256,10 @@ var DateRangePickerBase = (props) => {
242
256
  break;
243
257
  }
244
258
  case "ArrowLeft": {
245
- const prevDate = date.subtract({ days: 1 });
246
- const currentMonth = currentState.visibleRange.start;
247
- const otherMonth = otherState.visibleRange.start;
248
- if (calendarSide === "right" && prevDate.month !== currentMonth.month) if (prevDate.year === otherMonth.year && prevDate.month === otherMonth.month) {
259
+ const prevDate = date_2.subtract({ days: 1 });
260
+ const currentMonth_1 = currentState_0.visibleRange.start;
261
+ const otherMonth_1 = otherState.visibleRange.start;
262
+ if (calendarSide_0 === "right" && prevDate.month !== currentMonth_1.month) if (prevDate.year === otherMonth_1.year && prevDate.month === otherMonth_1.month) {
249
263
  otherState.setFocusedDate(prevDate);
250
264
  shouldPreventDefault = true;
251
265
  } else {
@@ -255,10 +269,10 @@ var DateRangePickerBase = (props) => {
255
269
  break;
256
270
  }
257
271
  case "ArrowDown": {
258
- const nextWeekDate = date.add({ weeks: 1 });
259
- const currentMonth = currentState.visibleRange.start;
260
- const otherMonth = otherState.visibleRange.start;
261
- if (calendarSide === "left" && nextWeekDate.month !== currentMonth.month) if (nextWeekDate.year === otherMonth.year && nextWeekDate.month === otherMonth.month) {
272
+ const nextWeekDate = date_2.add({ weeks: 1 });
273
+ const currentMonth_0 = currentState_0.visibleRange.start;
274
+ const otherMonth_0 = otherState.visibleRange.start;
275
+ if (calendarSide_0 === "left" && nextWeekDate.month !== currentMonth_0.month) if (nextWeekDate.year === otherMonth_0.year && nextWeekDate.month === otherMonth_0.month) {
262
276
  otherState.setFocusedDate(nextWeekDate);
263
277
  shouldPreventDefault = true;
264
278
  } else {
@@ -268,10 +282,10 @@ var DateRangePickerBase = (props) => {
268
282
  break;
269
283
  }
270
284
  case "ArrowUp": {
271
- const prevWeekDate = date.subtract({ weeks: 1 });
272
- const currentMonth = currentState.visibleRange.start;
285
+ const prevWeekDate = date_2.subtract({ weeks: 1 });
286
+ const currentMonth = currentState_0.visibleRange.start;
273
287
  const otherMonth = otherState.visibleRange.start;
274
- if (calendarSide === "right" && prevWeekDate.month !== currentMonth.month) if (prevWeekDate.year === otherMonth.year && prevWeekDate.month === otherMonth.month) {
288
+ if (calendarSide_0 === "right" && prevWeekDate.month !== currentMonth.month) if (prevWeekDate.year === otherMonth.year && prevWeekDate.month === otherMonth.month) {
275
289
  otherState.setFocusedDate(prevWeekDate);
276
290
  shouldPreventDefault = true;
277
291
  } else {
@@ -282,7 +296,7 @@ var DateRangePickerBase = (props) => {
282
296
  }
283
297
  case "Enter":
284
298
  case " ":
285
- handleDateSelection(date);
299
+ handleDateSelection(date_2);
286
300
  shouldPreventDefault = true;
287
301
  break;
288
302
  case "Escape":
@@ -306,14 +320,14 @@ var DateRangePickerBase = (props) => {
306
320
  rightCalendarState,
307
321
  handleDateSelection
308
322
  ]);
309
- const syncCalendarStates = useCallback((newValue) => {
310
- if (isValidRange(newValue)) return;
311
- leftCalendarState.setValue(newValue);
312
- rightCalendarState.setValue(newValue);
313
- dialogState.setValue(newValue);
314
- if (newValue) setRangeSelection({
315
- start: newValue.start,
316
- end: newValue.end,
323
+ const syncCalendarStates = useCallback((newValue_3) => {
324
+ if (isValidRange(newValue_3)) return;
325
+ leftCalendarState.setValue(newValue_3);
326
+ rightCalendarState.setValue(newValue_3);
327
+ dialogState.setValue(newValue_3);
328
+ if (newValue_3) setRangeSelection({
329
+ start: newValue_3.start,
330
+ end: newValue_3.end,
317
331
  isSelecting: false
318
332
  });
319
333
  else setRangeSelection({
@@ -355,11 +369,11 @@ var DateRangePickerBase = (props) => {
355
369
  dialogState.setValue(state.value);
356
370
  leftCalendarState.setValue(state.value);
357
371
  rightCalendarState.setValue(state.value);
358
- const startDate = state.value.start || today(getLocalTimeZone());
359
- const endDate = state.value.end || today(getLocalTimeZone()).add({ months: 1 });
360
- leftCalendarState.setFocusedDate(startDate);
361
- if (startDate.year === endDate.year && startDate.month === endDate.month) rightCalendarState.setFocusedDate(startDate.add({ months: 1 }));
362
- else rightCalendarState.setFocusedDate(endDate);
372
+ const startDate_1 = state.value.start || today(getLocalTimeZone());
373
+ const endDate_1 = state.value.end || today(getLocalTimeZone()).add({ months: 1 });
374
+ leftCalendarState.setFocusedDate(startDate_1);
375
+ if (startDate_1.year === endDate_1.year && startDate_1.month === endDate_1.month) rightCalendarState.setFocusedDate(startDate_1.add({ months: 1 }));
376
+ else rightCalendarState.setFocusedDate(endDate_1);
363
377
  setRangeSelection({
364
378
  start: state.value.start,
365
379
  end: state.value.end,
@@ -368,87 +382,87 @@ var DateRangePickerBase = (props) => {
368
382
  }
369
383
  }
370
384
  };
371
- const todayDate = today(getLocalTimeZone());
385
+ const todayDate_0 = today(getLocalTimeZone());
372
386
  const getThisWeekRange = () => {
373
387
  return {
374
- start: startOfWeek(todayDate, locale),
375
- end: endOfWeek(todayDate, locale)
388
+ start: startOfWeek(todayDate_0, locale),
389
+ end: endOfWeek(todayDate_0, locale)
376
390
  };
377
391
  };
378
392
  const getLastWeekRange = () => {
379
- const thisWeekStart = startOfWeek(todayDate, locale);
393
+ const thisWeekStart = startOfWeek(todayDate_0, locale);
380
394
  return {
381
395
  start: thisWeekStart.subtract({ weeks: 1 }),
382
396
  end: thisWeekStart.subtract({ days: 1 })
383
397
  };
384
398
  };
385
399
  const getThisAndLastWeekRange = () => {
386
- const thisWeekEnd = endOfWeek(todayDate, locale);
400
+ const thisWeekEnd = endOfWeek(todayDate_0, locale);
387
401
  return {
388
- start: startOfWeek(todayDate, locale).subtract({ weeks: 1 }),
402
+ start: startOfWeek(todayDate_0, locale).subtract({ weeks: 1 }),
389
403
  end: thisWeekEnd
390
404
  };
391
405
  };
392
406
  const getThisMonthRange = () => {
393
407
  return {
394
- start: startOfMonth(todayDate),
395
- end: endOfMonth(todayDate)
408
+ start: startOfMonth(todayDate_0),
409
+ end: endOfMonth(todayDate_0)
396
410
  };
397
411
  };
398
412
  const getThisAndLastMonthRange = () => {
399
- const thisMonthEnd = endOfMonth(todayDate);
413
+ const thisMonthEnd = endOfMonth(todayDate_0);
400
414
  return {
401
- start: startOfMonth(todayDate).subtract({ months: 1 }),
415
+ start: startOfMonth(todayDate_0).subtract({ months: 1 }),
402
416
  end: thisMonthEnd
403
417
  };
404
418
  };
405
419
  const presets = [
406
420
  {
407
- label: t(($) => $.ui.datePicker.presets.thisWeek, { ns: "ui" }),
421
+ label: t(($_0) => $_0.ui.datePicker.presets.thisWeek, { ns: "ui" }),
408
422
  getValue: getThisWeekRange
409
423
  },
410
424
  {
411
- label: t(($) => $.ui.datePicker.presets.lastWeek, { ns: "ui" }),
425
+ label: t(($_1) => $_1.ui.datePicker.presets.lastWeek, { ns: "ui" }),
412
426
  getValue: getLastWeekRange
413
427
  },
414
428
  {
415
- label: t(($) => $.ui.datePicker.presets.thisAndLastWeek, { ns: "ui" }),
429
+ label: t(($_2) => $_2.ui.datePicker.presets.thisAndLastWeek, { ns: "ui" }),
416
430
  getValue: getThisAndLastWeekRange
417
431
  },
418
432
  {
419
- label: t(($) => $.ui.datePicker.presets.thisMonth, { ns: "ui" }),
433
+ label: t(($_3) => $_3.ui.datePicker.presets.thisMonth, { ns: "ui" }),
420
434
  getValue: getThisMonthRange
421
435
  },
422
436
  {
423
- label: t(($) => $.ui.datePicker.presets.thisAndLastMonth, { ns: "ui" }),
437
+ label: t(($_4) => $_4.ui.datePicker.presets.thisAndLastMonth, { ns: "ui" }),
424
438
  getValue: getThisAndLastMonthRange
425
439
  },
426
440
  {
427
- label: t(($) => $.ui.datePicker.presets.thisYear, { ns: "ui" }),
441
+ label: t(($_5) => $_5.ui.datePicker.presets.thisYear, { ns: "ui" }),
428
442
  getValue: () => ({
429
- start: startOfYear(todayDate),
430
- end: todayDate
443
+ start: startOfYear(todayDate_0),
444
+ end: todayDate_0
431
445
  })
432
446
  },
433
447
  {
434
- label: t(($) => $.ui.datePicker.presets.lastYear, { ns: "ui" }),
448
+ label: t(($_6) => $_6.ui.datePicker.presets.lastYear, { ns: "ui" }),
435
449
  getValue: () => ({
436
- start: startOfYear(todayDate.subtract({ years: 1 })),
437
- end: endOfYear(todayDate.subtract({ years: 1 }))
450
+ start: startOfYear(todayDate_0.subtract({ years: 1 })),
451
+ end: endOfYear(todayDate_0.subtract({ years: 1 }))
438
452
  })
439
453
  },
440
454
  {
441
- label: t(($) => $.ui.datePicker.presets.thisAndLastYear, { ns: "ui" }),
455
+ label: t(($_7) => $_7.ui.datePicker.presets.thisAndLastYear, { ns: "ui" }),
442
456
  getValue: () => ({
443
- start: startOfYear(todayDate.subtract({ years: 1 })),
444
- end: todayDate
457
+ start: startOfYear(todayDate_0.subtract({ years: 1 })),
458
+ end: todayDate_0
445
459
  })
446
460
  },
447
461
  {
448
- label: t(($) => $.ui.datePicker.presets.soFar, { ns: "ui" }),
462
+ label: t(($_8) => $_8.ui.datePicker.presets.soFar, { ns: "ui" }),
449
463
  getValue: () => ({
450
- start: startOfYear(todayDate),
451
- end: todayDate
464
+ start: startOfYear(todayDate_0),
465
+ end: todayDate_0
452
466
  })
453
467
  }
454
468
  ];
@@ -456,12 +470,12 @@ var DateRangePickerBase = (props) => {
456
470
  setActivePreset(preset.label);
457
471
  const presetValue = preset.getValue();
458
472
  syncCalendarStates(presetValue);
459
- const startDate = presetValue.start;
460
- leftCalendarState.setFocusedDate(startDate);
461
- const endDate = presetValue.end;
462
- if ((endDate.year - startDate.year) * 12 + (endDate.month - startDate.month) > 2) rightCalendarState.setFocusedDate(endDate);
473
+ const startDate_2 = presetValue.start;
474
+ leftCalendarState.setFocusedDate(startDate_2);
475
+ const endDate_2 = presetValue.end;
476
+ if ((endDate_2.year - startDate_2.year) * 12 + (endDate_2.month - startDate_2.month) > 2) rightCalendarState.setFocusedDate(endDate_2);
463
477
  else {
464
- const rightCalendarMonth = startDate.add({ months: 1 });
478
+ const rightCalendarMonth = startDate_2.add({ months: 1 });
465
479
  rightCalendarState.setFocusedDate(rightCalendarMonth);
466
480
  }
467
481
  };
@@ -502,17 +516,17 @@ var DateRangePickerBase = (props) => {
502
516
  hideSidebar,
503
517
  sidebar: /* @__PURE__ */ jsx("div", {
504
518
  className: "flex w-full flex-row overflow-auto border-elevation-outline-default-1 border-solid [-ms-overflow-style:none] [scrollbar-width:none] md:w-[156px] md:flex-col md:border-r [&::-webkit-scrollbar]:hidden",
505
- children: presets.map((preset) => /* @__PURE__ */ jsx(Button, {
506
- onClick: () => selectPreset(preset),
507
- className: clsx("w-full px-2 py-1 text-left md:px-list-side-item-left md:py-list-height-item", activePreset !== preset.label && "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover", activePreset === preset.label && "bg-interactive-contained-primary-idle text-interactive-text-secondary-idle-inverted"),
519
+ children: presets.map((preset_0) => /* @__PURE__ */ jsx(Button, {
520
+ onClick: () => selectPreset(preset_0),
521
+ className: clsx("w-full px-2 py-1 text-left md:px-list-side-item-left md:py-list-height-item", activePreset !== preset_0.label && "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover", activePreset === preset_0.label && "bg-interactive-contained-primary-idle text-interactive-text-secondary-idle-inverted"),
508
522
  children: /* @__PURE__ */ jsx(Typography, {
509
523
  size: "label-2",
510
524
  sizeMobile: "label-3",
511
525
  as: "span",
512
526
  className: "whitespace-nowrap",
513
- children: preset.label
527
+ children: preset_0.label
514
528
  })
515
- }, preset.label))
529
+ }, preset_0.label))
516
530
  }),
517
531
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
518
532
  isDisabled,
@@ -559,7 +573,8 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
559
573
  renderInput,
560
574
  setRenderInput,
561
575
  getFocusTarget: (input) => {
562
- return (input.getContainer?.() ?? input).querySelector("input, button, [tabindex]:not([tabindex='-1'])");
576
+ const container = input.getContainer?.() ?? input;
577
+ return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
563
578
  }
564
579
  });
565
580
  const watchedValue = "formControl" in props && props.formControl ? useWatch({
@@ -588,10 +603,10 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
588
603
  start: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.start),
589
604
  end: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.end)
590
605
  };
591
- const startDate = DateTime.fromISO(formattedRange.start).toJSDate();
592
- const endDate = DateTime.fromISO(formattedRange.end).toJSDate();
593
- const startZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(startDate);
594
- const endZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(endDate);
606
+ const startDate_0 = DateTime.fromISO(formattedRange.start).toJSDate();
607
+ const endDate_0 = DateTime.fromISO(formattedRange.end).toJSDate();
608
+ const startZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(startDate_0);
609
+ const endZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(endDate_0);
595
610
  return {
596
611
  start: toCalendarDate(startZonedDateTime),
597
612
  end: toCalendarDate(endZonedDateTime)
@@ -624,7 +639,6 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
624
639
  start: startDateValue,
625
640
  end: endDateValue,
626
641
  locale,
627
- placeholder: props.placeholder,
628
642
  shouldForceLeadingZeros,
629
643
  isDisabled,
630
644
  hidePlaceholder: as === "floating" && !hasProvidedRangeValue
@@ -651,6 +665,8 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
651
665
  onStaticInteract: renderRealInput,
652
666
  actionContent: staticTodayIcon,
653
667
  actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
668
+ wrapContentAndTrailing: true,
669
+ contentAndTrailingClassName: "gap-2!",
654
670
  trailingClassName: "py-0! pl-0!",
655
671
  trailingContent: showDropdown ? ui.dateInput.calendarIcon : void 0,
656
672
  children: staticSegments
@@ -679,7 +695,7 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
679
695
  ...dateLimits,
680
696
  ref: mergeRefs(props.ref, inputRef),
681
697
  value: parseDateRange(props.value),
682
- onChange: (value) => props.onChange?.(formatDateRange(value))
698
+ onChange: (value_0) => props.onChange?.(formatDateRange(value_0))
683
699
  });
684
700
  };
685
701
  //#endregion