@povio/ui 2.3.0-rc.5 → 2.3.0-rc.7

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 (195) 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 +164 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +16 -12
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -107
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +17 -13
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +384 -116
  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 +245 -90
  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/File/FileUpload.js +86 -44
  83. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  84. package/dist/components/inputs/File/InputUpload.js +317 -79
  85. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  86. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  87. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  88. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  89. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  90. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  91. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  92. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  93. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  94. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  95. package/dist/components/inputs/FormField/FormField.js +119 -37
  96. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  97. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  98. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  99. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  100. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  101. package/dist/components/inputs/Input/NumberInput/NumberInput.js +253 -82
  102. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  103. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +321 -77
  104. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  105. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  106. package/dist/components/inputs/Input/TextInput/TextInput.js +241 -81
  107. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  108. package/dist/components/inputs/Inputs/Form.js +40 -11
  109. package/dist/components/inputs/Inputs/InputItem.js +65 -14
  110. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  111. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  112. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +9 -3
  113. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  114. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  115. package/dist/components/inputs/Selection/Select/Select.js +9 -3
  116. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  117. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  118. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  119. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  120. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  121. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  122. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  123. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  124. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  125. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  126. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  127. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  128. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  129. package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
  130. package/dist/components/inputs/Skeleton/InputFrame.js +444 -116
  131. package/dist/components/inputs/Slider/Slider.js +247 -74
  132. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  133. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  134. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  135. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  136. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  137. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  138. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  139. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  140. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  141. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  142. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  143. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  144. package/dist/components/inputs/shared/CheckContent.js +21 -10
  145. package/dist/components/inputs/shared/InputClear.js +78 -21
  146. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  147. package/dist/components/inputs/shared/input.cva.js +13 -3
  148. package/dist/components/inputs/shared/useStaticInputHandoff.js +97 -39
  149. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  150. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  151. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  152. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  153. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  154. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  155. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  156. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  157. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  158. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  159. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  160. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  161. package/dist/components/segment/Segment.js +218 -57
  162. package/dist/components/segment/SegmentItem.js +67 -10
  163. package/dist/components/shared/pagination/Pagination.js +108 -22
  164. package/dist/components/shared/pagination/PaginationList.js +167 -64
  165. package/dist/components/status/Alert/Alert.js +97 -30
  166. package/dist/components/status/Loader/Loader.js +77 -22
  167. package/dist/components/status/Toast/Toast.js +21 -13
  168. package/dist/components/status/Toast/useToast.js +62 -57
  169. package/dist/components/table/ColumnConfig.js +158 -54
  170. package/dist/components/table/InfiniteTable.js +67 -16
  171. package/dist/components/table/PaginatedTable.js +84 -18
  172. package/dist/components/table/Table.js +23 -23
  173. package/dist/components/text/Link/Link.js +19 -7
  174. package/dist/components/text/Typography/Typography.js +23 -8
  175. package/dist/config/confirmation.context.js +1 -1
  176. package/dist/config/link.context.js +23 -9
  177. package/dist/config/router.context.js +42 -16
  178. package/dist/config/theme.context.js +98 -45
  179. package/dist/config/uiConfig.context.js +39 -8
  180. package/dist/config/uiStyle.context.js +15 -5
  181. package/dist/hooks/useBreakpoint.js +16 -3
  182. package/dist/hooks/useDebounceCallback.js +51 -17
  183. package/dist/hooks/useFilters.js +125 -64
  184. package/dist/hooks/useForm.js +42 -8
  185. package/dist/hooks/useFormAutosave.js +101 -30
  186. package/dist/hooks/useIntersectionObserver.js +86 -32
  187. package/dist/hooks/useLocalStorage.js +43 -10
  188. package/dist/hooks/useLongPressRepeat.js +55 -20
  189. package/dist/hooks/usePagination.js +49 -19
  190. package/dist/hooks/useScrollableListBox.js +37 -16
  191. package/dist/hooks/useSorting.js +69 -28
  192. package/dist/hooks/useStateAndRef.js +21 -7
  193. package/dist/hooks/useTableColumnConfig.js +124 -31
  194. package/dist/hooks/useTranslationMemo.js +25 -5
  195. package/package.json +1 -1
@@ -64,9 +64,12 @@ var DatePickerBase = (props) => {
64
64
  const datePickerRef = useMemo(() => ({ get current() {
65
65
  return datePickerInputRef.current?.getContainer?.() || null;
66
66
  } }), []);
67
- useImperativeHandle(ref, () => ({ clear: () => {
68
- datePickerInputRef.current?.clear();
69
- } }));
67
+ useImperativeHandle(ref, () => ({
68
+ clear: () => {
69
+ datePickerInputRef.current?.clear();
70
+ },
71
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
72
+ }));
70
73
  const handleBlur = (val) => {
71
74
  onBlur?.({ target: { value: val } });
72
75
  };
@@ -81,9 +84,9 @@ var DatePickerBase = (props) => {
81
84
  ...rest,
82
85
  shouldForceLeadingZeros,
83
86
  value,
84
- onChange: (val) => {
85
- let normalizedValue = val;
86
- if (val) normalizedValue = normalizeByGranularity(val);
87
+ onChange: (val_0) => {
88
+ let normalizedValue = val_0;
89
+ if (val_0) normalizedValue = normalizeByGranularity(val_0);
87
90
  if (normalizedValue && (rest.minValue && normalizedValue < rest?.minValue || rest?.maxValue && normalizedValue > rest?.maxValue)) {
88
91
  state.setValue(state.value);
89
92
  return;
@@ -241,7 +244,8 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
241
244
  renderInput,
242
245
  setRenderInput,
243
246
  getFocusTarget: (input) => {
244
- 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;
245
249
  }
246
250
  });
247
251
  const watchedValue = "formControl" in props && props.formControl ? useWatch({
@@ -263,14 +267,14 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
263
267
  if (calendarDate === null) return null;
264
268
  const normalizedDate = normalizeByGranularity(calendarDate);
265
269
  if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
266
- const date = DateTimeUtils.fromDateValueToLocal(normalizedDate);
267
- return DateTime.fromJSDate(date).toISODate();
270
+ const date_0 = DateTimeUtils.fromDateValueToLocal(normalizedDate);
271
+ return DateTime.fromJSDate(date_0).toISODate();
268
272
  };
269
273
  const parseCalendarDate = (formattedDate) => {
270
274
  if (formattedDate == null) return formattedDate;
271
275
  if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
272
- const date = DateTime.fromISO(formattedDate).toJSDate();
273
- return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date)));
276
+ const date_1 = DateTime.fromISO(formattedDate).toJSDate();
277
+ return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1)));
274
278
  };
275
279
  const dateLimits = {
276
280
  minValue: typeof minValue === "string" ? parseCalendarDate(minValue) : minValue,
@@ -347,7 +351,7 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
347
351
  ref: mergeRefs(props.ref, inputRef),
348
352
  granularity,
349
353
  value: parseCalendarDate(props.value),
350
- onChange: (value) => props.onChange?.(formatCalendarDate(value))
354
+ onChange: (value_0) => props.onChange?.(formatCalendarDate(value_0))
351
355
  });
352
356
  };
353
357
  //#endregion
@@ -76,11 +76,14 @@ var DateRangePickerBase = (props) => {
76
76
  shouldForceLeadingZeros
77
77
  }, dialogState, dateRangePickerRef);
78
78
  const { locale } = useLocale$1();
79
- useImperativeHandle(ref, () => ({ clear: () => {
80
- datePickerInputRef.current?.clear();
81
- } }));
82
- const handleBlur = (newValue) => {
83
- 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 } });
84
87
  };
85
88
  const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
86
89
  const formFieldProps = {
@@ -133,10 +136,10 @@ var DateRangePickerBase = (props) => {
133
136
  className: headerClassName,
134
137
  labelProps
135
138
  };
136
- const isValidRange = useCallback((newValue) => {
137
- if (newValue?.start && newValue?.end) {
138
- const startDate = newValue.start;
139
- 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) {
140
143
  setValidationRangeError(t(($) => $.ui.datePicker.errors.endDateBeforeStart, { ns: "ui" }));
141
144
  return true;
142
145
  }
@@ -144,20 +147,20 @@ var DateRangePickerBase = (props) => {
144
147
  } else setValidationRangeError(void 0);
145
148
  return false;
146
149
  }, [t]);
147
- const handleCalendarStatesChange = (newValue) => {
148
- if (newValue) {
149
- if (isValidRange(newValue)) return;
150
- dialogState.setValue(newValue);
151
- const startDate = newValue.start;
152
- const endDate = newValue.end;
153
- leftCalendarState.setFocusedDate(startDate);
154
- if (startDate.year === endDate.year && startDate.month === endDate.month) rightCalendarState.setFocusedDate(startDate.add({ months: 1 }));
155
- else rightCalendarState.setFocusedDate(endDate);
156
- leftCalendarState.setValue(newValue);
157
- 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);
158
161
  setRangeSelection({
159
- start: newValue.start,
160
- end: newValue.end,
162
+ start: newValue_2.start,
163
+ end: newValue_2.end,
161
164
  isSelecting: false
162
165
  });
163
166
  setHoverDate(null);
@@ -181,27 +184,27 @@ var DateRangePickerBase = (props) => {
181
184
  setHoverDate(date);
182
185
  });
183
186
  }, []);
184
- const handleDateHover = useCallback((date) => {
185
- if (rangeSelection.isSelecting && rangeSelection.start) throttledSetHoverDate(date);
187
+ const handleDateHover = useCallback((date_0) => {
188
+ if (rangeSelection.isSelecting && rangeSelection.start) throttledSetHoverDate(date_0);
186
189
  }, [
187
190
  rangeSelection.isSelecting,
188
191
  rangeSelection.start,
189
192
  throttledSetHoverDate
190
193
  ]);
191
- const handleDateSelection = useCallback((date, calendarSide) => {
194
+ const handleDateSelection = useCallback((date_1, calendarSide) => {
192
195
  if (calendarSide) {
193
196
  const currentVisibleMonth = (calendarSide === "left" ? leftCalendarState : rightCalendarState).visibleRange.start;
194
- if (date.month !== currentVisibleMonth.month || date.year !== currentVisibleMonth.year) if (calendarSide === "left") {
195
- leftCalendarState.setFocusedDate(date);
196
- 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 }));
197
200
  } else {
198
- rightCalendarState.setFocusedDate(date);
199
- leftCalendarState.setFocusedDate(date.subtract({ months: 1 }));
201
+ rightCalendarState.setFocusedDate(date_1);
202
+ leftCalendarState.setFocusedDate(date_1.subtract({ months: 1 }));
200
203
  }
201
204
  }
202
205
  if (!rangeSelection.isSelecting || !rangeSelection.start) {
203
206
  setRangeSelection({
204
- start: date,
207
+ start: date_1,
205
208
  end: null,
206
209
  isSelecting: true
207
210
  });
@@ -210,7 +213,7 @@ var DateRangePickerBase = (props) => {
210
213
  rightCalendarState.setValue(null);
211
214
  } else {
212
215
  const { start } = rangeSelection;
213
- const end = date;
216
+ const end = date_1;
214
217
  const finalStart = start.compare(end) <= 0 ? start : end;
215
218
  const finalEnd = start.compare(end) <= 0 ? end : start;
216
219
  const newRange = {
@@ -234,16 +237,16 @@ var DateRangePickerBase = (props) => {
234
237
  rightCalendarState,
235
238
  dialogState
236
239
  ]);
237
- const handleKeyboardNavigation = useCallback((event, date, calendarSide) => {
238
- const currentState = calendarSide === "left" ? leftCalendarState : rightCalendarState;
239
- 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;
240
243
  let shouldPreventDefault = false;
241
244
  switch (event.key) {
242
245
  case "ArrowRight": {
243
- const nextDate = date.add({ days: 1 });
244
- const currentMonth = currentState.visibleRange.start;
245
- const otherMonth = otherState.visibleRange.start;
246
- 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) {
247
250
  otherState.setFocusedDate(nextDate);
248
251
  shouldPreventDefault = true;
249
252
  } else {
@@ -253,10 +256,10 @@ var DateRangePickerBase = (props) => {
253
256
  break;
254
257
  }
255
258
  case "ArrowLeft": {
256
- const prevDate = date.subtract({ days: 1 });
257
- const currentMonth = currentState.visibleRange.start;
258
- const otherMonth = otherState.visibleRange.start;
259
- 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) {
260
263
  otherState.setFocusedDate(prevDate);
261
264
  shouldPreventDefault = true;
262
265
  } else {
@@ -266,10 +269,10 @@ var DateRangePickerBase = (props) => {
266
269
  break;
267
270
  }
268
271
  case "ArrowDown": {
269
- const nextWeekDate = date.add({ weeks: 1 });
270
- const currentMonth = currentState.visibleRange.start;
271
- const otherMonth = otherState.visibleRange.start;
272
- 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) {
273
276
  otherState.setFocusedDate(nextWeekDate);
274
277
  shouldPreventDefault = true;
275
278
  } else {
@@ -279,10 +282,10 @@ var DateRangePickerBase = (props) => {
279
282
  break;
280
283
  }
281
284
  case "ArrowUp": {
282
- const prevWeekDate = date.subtract({ weeks: 1 });
283
- const currentMonth = currentState.visibleRange.start;
285
+ const prevWeekDate = date_2.subtract({ weeks: 1 });
286
+ const currentMonth = currentState_0.visibleRange.start;
284
287
  const otherMonth = otherState.visibleRange.start;
285
- 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) {
286
289
  otherState.setFocusedDate(prevWeekDate);
287
290
  shouldPreventDefault = true;
288
291
  } else {
@@ -293,7 +296,7 @@ var DateRangePickerBase = (props) => {
293
296
  }
294
297
  case "Enter":
295
298
  case " ":
296
- handleDateSelection(date);
299
+ handleDateSelection(date_2);
297
300
  shouldPreventDefault = true;
298
301
  break;
299
302
  case "Escape":
@@ -317,14 +320,14 @@ var DateRangePickerBase = (props) => {
317
320
  rightCalendarState,
318
321
  handleDateSelection
319
322
  ]);
320
- const syncCalendarStates = useCallback((newValue) => {
321
- if (isValidRange(newValue)) return;
322
- leftCalendarState.setValue(newValue);
323
- rightCalendarState.setValue(newValue);
324
- dialogState.setValue(newValue);
325
- if (newValue) setRangeSelection({
326
- start: newValue.start,
327
- 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,
328
331
  isSelecting: false
329
332
  });
330
333
  else setRangeSelection({
@@ -366,11 +369,11 @@ var DateRangePickerBase = (props) => {
366
369
  dialogState.setValue(state.value);
367
370
  leftCalendarState.setValue(state.value);
368
371
  rightCalendarState.setValue(state.value);
369
- const startDate = state.value.start || today(getLocalTimeZone());
370
- const endDate = state.value.end || today(getLocalTimeZone()).add({ months: 1 });
371
- leftCalendarState.setFocusedDate(startDate);
372
- if (startDate.year === endDate.year && startDate.month === endDate.month) rightCalendarState.setFocusedDate(startDate.add({ months: 1 }));
373
- 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);
374
377
  setRangeSelection({
375
378
  start: state.value.start,
376
379
  end: state.value.end,
@@ -379,87 +382,87 @@ var DateRangePickerBase = (props) => {
379
382
  }
380
383
  }
381
384
  };
382
- const todayDate = today(getLocalTimeZone());
385
+ const todayDate_0 = today(getLocalTimeZone());
383
386
  const getThisWeekRange = () => {
384
387
  return {
385
- start: startOfWeek(todayDate, locale),
386
- end: endOfWeek(todayDate, locale)
388
+ start: startOfWeek(todayDate_0, locale),
389
+ end: endOfWeek(todayDate_0, locale)
387
390
  };
388
391
  };
389
392
  const getLastWeekRange = () => {
390
- const thisWeekStart = startOfWeek(todayDate, locale);
393
+ const thisWeekStart = startOfWeek(todayDate_0, locale);
391
394
  return {
392
395
  start: thisWeekStart.subtract({ weeks: 1 }),
393
396
  end: thisWeekStart.subtract({ days: 1 })
394
397
  };
395
398
  };
396
399
  const getThisAndLastWeekRange = () => {
397
- const thisWeekEnd = endOfWeek(todayDate, locale);
400
+ const thisWeekEnd = endOfWeek(todayDate_0, locale);
398
401
  return {
399
- start: startOfWeek(todayDate, locale).subtract({ weeks: 1 }),
402
+ start: startOfWeek(todayDate_0, locale).subtract({ weeks: 1 }),
400
403
  end: thisWeekEnd
401
404
  };
402
405
  };
403
406
  const getThisMonthRange = () => {
404
407
  return {
405
- start: startOfMonth(todayDate),
406
- end: endOfMonth(todayDate)
408
+ start: startOfMonth(todayDate_0),
409
+ end: endOfMonth(todayDate_0)
407
410
  };
408
411
  };
409
412
  const getThisAndLastMonthRange = () => {
410
- const thisMonthEnd = endOfMonth(todayDate);
413
+ const thisMonthEnd = endOfMonth(todayDate_0);
411
414
  return {
412
- start: startOfMonth(todayDate).subtract({ months: 1 }),
415
+ start: startOfMonth(todayDate_0).subtract({ months: 1 }),
413
416
  end: thisMonthEnd
414
417
  };
415
418
  };
416
419
  const presets = [
417
420
  {
418
- label: t(($) => $.ui.datePicker.presets.thisWeek, { ns: "ui" }),
421
+ label: t(($_0) => $_0.ui.datePicker.presets.thisWeek, { ns: "ui" }),
419
422
  getValue: getThisWeekRange
420
423
  },
421
424
  {
422
- label: t(($) => $.ui.datePicker.presets.lastWeek, { ns: "ui" }),
425
+ label: t(($_1) => $_1.ui.datePicker.presets.lastWeek, { ns: "ui" }),
423
426
  getValue: getLastWeekRange
424
427
  },
425
428
  {
426
- label: t(($) => $.ui.datePicker.presets.thisAndLastWeek, { ns: "ui" }),
429
+ label: t(($_2) => $_2.ui.datePicker.presets.thisAndLastWeek, { ns: "ui" }),
427
430
  getValue: getThisAndLastWeekRange
428
431
  },
429
432
  {
430
- label: t(($) => $.ui.datePicker.presets.thisMonth, { ns: "ui" }),
433
+ label: t(($_3) => $_3.ui.datePicker.presets.thisMonth, { ns: "ui" }),
431
434
  getValue: getThisMonthRange
432
435
  },
433
436
  {
434
- label: t(($) => $.ui.datePicker.presets.thisAndLastMonth, { ns: "ui" }),
437
+ label: t(($_4) => $_4.ui.datePicker.presets.thisAndLastMonth, { ns: "ui" }),
435
438
  getValue: getThisAndLastMonthRange
436
439
  },
437
440
  {
438
- label: t(($) => $.ui.datePicker.presets.thisYear, { ns: "ui" }),
441
+ label: t(($_5) => $_5.ui.datePicker.presets.thisYear, { ns: "ui" }),
439
442
  getValue: () => ({
440
- start: startOfYear(todayDate),
441
- end: todayDate
443
+ start: startOfYear(todayDate_0),
444
+ end: todayDate_0
442
445
  })
443
446
  },
444
447
  {
445
- label: t(($) => $.ui.datePicker.presets.lastYear, { ns: "ui" }),
448
+ label: t(($_6) => $_6.ui.datePicker.presets.lastYear, { ns: "ui" }),
446
449
  getValue: () => ({
447
- start: startOfYear(todayDate.subtract({ years: 1 })),
448
- end: endOfYear(todayDate.subtract({ years: 1 }))
450
+ start: startOfYear(todayDate_0.subtract({ years: 1 })),
451
+ end: endOfYear(todayDate_0.subtract({ years: 1 }))
449
452
  })
450
453
  },
451
454
  {
452
- label: t(($) => $.ui.datePicker.presets.thisAndLastYear, { ns: "ui" }),
455
+ label: t(($_7) => $_7.ui.datePicker.presets.thisAndLastYear, { ns: "ui" }),
453
456
  getValue: () => ({
454
- start: startOfYear(todayDate.subtract({ years: 1 })),
455
- end: todayDate
457
+ start: startOfYear(todayDate_0.subtract({ years: 1 })),
458
+ end: todayDate_0
456
459
  })
457
460
  },
458
461
  {
459
- label: t(($) => $.ui.datePicker.presets.soFar, { ns: "ui" }),
462
+ label: t(($_8) => $_8.ui.datePicker.presets.soFar, { ns: "ui" }),
460
463
  getValue: () => ({
461
- start: startOfYear(todayDate),
462
- end: todayDate
464
+ start: startOfYear(todayDate_0),
465
+ end: todayDate_0
463
466
  })
464
467
  }
465
468
  ];
@@ -467,12 +470,12 @@ var DateRangePickerBase = (props) => {
467
470
  setActivePreset(preset.label);
468
471
  const presetValue = preset.getValue();
469
472
  syncCalendarStates(presetValue);
470
- const startDate = presetValue.start;
471
- leftCalendarState.setFocusedDate(startDate);
472
- const endDate = presetValue.end;
473
- 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);
474
477
  else {
475
- const rightCalendarMonth = startDate.add({ months: 1 });
478
+ const rightCalendarMonth = startDate_2.add({ months: 1 });
476
479
  rightCalendarState.setFocusedDate(rightCalendarMonth);
477
480
  }
478
481
  };
@@ -513,17 +516,17 @@ var DateRangePickerBase = (props) => {
513
516
  hideSidebar,
514
517
  sidebar: /* @__PURE__ */ jsx("div", {
515
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",
516
- children: presets.map((preset) => /* @__PURE__ */ jsx(Button, {
517
- onClick: () => selectPreset(preset),
518
- 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"),
519
522
  children: /* @__PURE__ */ jsx(Typography, {
520
523
  size: "label-2",
521
524
  sizeMobile: "label-3",
522
525
  as: "span",
523
526
  className: "whitespace-nowrap",
524
- children: preset.label
527
+ children: preset_0.label
525
528
  })
526
- }, preset.label))
529
+ }, preset_0.label))
527
530
  }),
528
531
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
529
532
  isDisabled,
@@ -570,7 +573,8 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
570
573
  renderInput,
571
574
  setRenderInput,
572
575
  getFocusTarget: (input) => {
573
- 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;
574
578
  }
575
579
  });
576
580
  const watchedValue = "formControl" in props && props.formControl ? useWatch({
@@ -599,10 +603,10 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
599
603
  start: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.start),
600
604
  end: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.end)
601
605
  };
602
- const startDate = DateTime.fromISO(formattedRange.start).toJSDate();
603
- const endDate = DateTime.fromISO(formattedRange.end).toJSDate();
604
- const startZonedDateTime = DateTimeUtils.fromLocalToZonedDateTime(startDate);
605
- 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);
606
610
  return {
607
611
  start: toCalendarDate(startZonedDateTime),
608
612
  end: toCalendarDate(endZonedDateTime)
@@ -691,7 +695,7 @@ var DateRangePicker = ({ fullIso = true, minValue, maxValue, renderStaticInput,
691
695
  ...dateLimits,
692
696
  ref: mergeRefs(props.ref, inputRef),
693
697
  value: parseDateRange(props.value),
694
- onChange: (value) => props.onChange?.(formatDateRange(value))
698
+ onChange: (value_0) => props.onChange?.(formatDateRange(value_0))
695
699
  });
696
700
  };
697
701
  //#endregion
@@ -57,9 +57,12 @@ var DateTimePickerBase = (props) => {
57
57
  const datePickerRef = useMemo(() => ({ get current() {
58
58
  return datePickerInputRef.current?.getContainer?.() || null;
59
59
  } }), []);
60
- useImperativeHandle(ref, () => ({ clear: () => {
61
- datePickerInputRef.current?.clear();
62
- } }));
60
+ useImperativeHandle(ref, () => ({
61
+ clear: () => {
62
+ datePickerInputRef.current?.clear();
63
+ },
64
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
65
+ }));
63
66
  const handleBlur = (val) => {
64
67
  onBlur?.({ target: { value: val } });
65
68
  };
@@ -79,11 +82,11 @@ var DateTimePickerBase = (props) => {
79
82
  ...rest,
80
83
  shouldForceLeadingZeros,
81
84
  value,
82
- onChange: (val) => {
83
- onChange?.(val);
84
- dialogState.setValue(val);
85
- calendarState.setFocusedDate(val || today(getLocalTimeZone()));
86
- debouncedBlur(val);
85
+ onChange: (val_0) => {
86
+ onChange?.(val_0);
87
+ dialogState.setValue(val_0);
88
+ calendarState.setFocusedDate(val_0 || today(getLocalTimeZone()));
89
+ debouncedBlur(val_0);
87
90
  },
88
91
  shouldCloseOnSelect: false,
89
92
  granularity: "minute",
@@ -178,9 +181,9 @@ var DateTimePickerBase = (props) => {
178
181
  groupProps,
179
182
  fieldProps: {
180
183
  ...fieldProps,
181
- onBlur: (e) => {
182
- fieldProps.onBlur?.(e);
183
- onInputBlur(e);
184
+ onBlur: (e_0) => {
185
+ fieldProps.onBlur?.(e_0);
186
+ onInputBlur(e_0);
184
187
  }
185
188
  },
186
189
  buttonProps,
@@ -243,7 +246,8 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
243
246
  renderInput,
244
247
  setRenderInput,
245
248
  getFocusTarget: (input) => {
246
- return (input.getContainer?.() ?? input).querySelector("input, button, [tabindex]:not([tabindex='-1'])");
249
+ const container = input.getContainer?.() ?? input;
250
+ return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
247
251
  }
248
252
  });
249
253
  const watchedValue = "formControl" in props && props.formControl ? useWatch({
@@ -332,7 +336,7 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
332
336
  ...props,
333
337
  ref: mergeRefs(props.ref, inputRef),
334
338
  value: parseDateValue(props.value),
335
- onChange: (value) => props.onChange?.(formatDateValue(value))
339
+ onChange: (value_0) => props.onChange?.(formatDateValue(value_0))
336
340
  });
337
341
  };
338
342
  //#endregion