@povio/ui 2.3.0-rc.2 → 2.3.0-rc.21

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 (218) 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.d.ts +1 -0
  61. package/dist/components/inputs/Checkbox/Checkbox.js +190 -34
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  63. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
  64. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +258 -76
  65. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  66. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +342 -177
  67. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  68. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +173 -63
  69. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
  70. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +522 -157
  71. package/dist/components/inputs/DateTime/shared/Calendar.js +333 -137
  72. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
  73. package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
  74. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
  75. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
  76. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  77. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  78. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  79. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
  80. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +352 -145
  81. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  82. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  83. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  84. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  85. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  86. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  87. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  88. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +206 -70
  90. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  91. package/dist/components/inputs/File/FileUpload.js +86 -44
  92. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  93. package/dist/components/inputs/File/InputUpload.js +317 -79
  94. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  95. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  96. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  97. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  98. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  99. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  100. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  101. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  102. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  103. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  104. package/dist/components/inputs/FormField/FormField.js +119 -37
  105. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  106. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  107. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  108. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  109. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  110. package/dist/components/inputs/Input/NumberInput/NumberInput.js +392 -122
  111. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  112. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +463 -146
  113. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  114. package/dist/components/inputs/Input/TextArea/TextArea.js +303 -90
  115. package/dist/components/inputs/Input/TextInput/TextInput.js +376 -122
  116. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  117. package/dist/components/inputs/Inputs/Form.js +40 -11
  118. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
  119. package/dist/components/inputs/Inputs/InputItem.js +65 -16
  120. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  121. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -0
  122. package/dist/components/inputs/RadioGroup/RadioGroup.js +333 -107
  123. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +145 -50
  124. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
  125. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  126. package/dist/components/inputs/Selection/Select/Select.js +140 -45
  127. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  128. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  129. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  130. package/dist/components/inputs/Selection/shared/SelectInput.js +326 -136
  131. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  132. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  133. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  134. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  135. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  136. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  137. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  138. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  139. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  140. package/dist/components/inputs/Selection/shared/select.context.js +44 -38
  141. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  142. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  143. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  144. package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
  145. package/dist/components/inputs/Skeleton/InputFrame.js +442 -116
  146. package/dist/components/inputs/Slider/Slider.js +250 -74
  147. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  148. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  149. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  150. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  151. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  152. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  153. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  154. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  155. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  156. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  157. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  158. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
  159. package/dist/components/inputs/Toggle/Toggle.js +206 -40
  160. package/dist/components/inputs/shared/CheckContent.js +21 -10
  161. package/dist/components/inputs/shared/InputClear.js +78 -21
  162. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  163. package/dist/components/inputs/shared/input.cva.js +13 -3
  164. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
  165. package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
  166. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  167. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  168. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  169. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  170. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  171. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  172. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  173. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  174. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  175. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  176. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  177. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  178. package/dist/components/segment/Segment.js +218 -57
  179. package/dist/components/segment/SegmentItem.js +67 -10
  180. package/dist/components/shared/pagination/Pagination.js +108 -22
  181. package/dist/components/shared/pagination/PaginationList.js +167 -64
  182. package/dist/components/status/Alert/Alert.js +97 -30
  183. package/dist/components/status/Loader/Loader.js +77 -22
  184. package/dist/components/status/Toast/Toast.js +21 -13
  185. package/dist/components/status/Toast/useToast.js +62 -57
  186. package/dist/components/table/ColumnConfig.js +158 -54
  187. package/dist/components/table/InfiniteTable.js +67 -16
  188. package/dist/components/table/PaginatedTable.js +84 -18
  189. package/dist/components/table/Table.js +28 -27
  190. package/dist/components/text/Link/Link.js +19 -7
  191. package/dist/components/text/Typography/Typography.js +23 -8
  192. package/dist/config/confirmation.context.js +1 -1
  193. package/dist/config/link.context.js +23 -9
  194. package/dist/config/router.context.js +42 -16
  195. package/dist/config/theme.context.js +98 -45
  196. package/dist/config/uiConfig.context.d.ts +4 -4
  197. package/dist/config/uiConfig.context.js +50 -11
  198. package/dist/config/uiStyle.context.js +15 -5
  199. package/dist/helpers/dynamicInputs.d.ts +1 -1
  200. package/dist/hooks/useBreakpoint.js +16 -3
  201. package/dist/hooks/useDebounceCallback.js +51 -17
  202. package/dist/hooks/useFilters.js +125 -64
  203. package/dist/hooks/useForm.js +42 -8
  204. package/dist/hooks/useFormAutosave.js +101 -30
  205. package/dist/hooks/useIntersectionObserver.js +86 -32
  206. package/dist/hooks/useLocalStorage.js +43 -10
  207. package/dist/hooks/useLongPressRepeat.js +55 -20
  208. package/dist/hooks/usePagination.js +49 -19
  209. package/dist/hooks/useQueryAutocomplete.js +1 -0
  210. package/dist/hooks/useScrollableListBox.js +37 -16
  211. package/dist/hooks/useSorting.js +69 -28
  212. package/dist/hooks/useStateAndRef.js +21 -7
  213. package/dist/hooks/useTableColumnConfig.js +124 -31
  214. package/dist/hooks/useTranslationMemo.js +25 -5
  215. package/dist/index.js +2 -2
  216. package/dist/utils/date-time.utils.d.ts +2 -0
  217. package/dist/utils/date-time.utils.js +17 -13
  218. package/package.json +1 -1
@@ -12,19 +12,36 @@ 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";
16
+ import { c } from "react/compiler-runtime";
15
17
  import { jsx, jsxs } from "react/jsx-runtime";
16
18
  import { clsx } from "clsx";
17
19
  import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
18
20
  import { useDatePicker, useLocale } from "react-aria";
19
21
  import { mergeRefs } from "@react-aria/utils";
20
- import { Controller, useWatch } from "react-hook-form";
21
- import { createCalendar, getLocalTimeZone, toCalendarDate, today } from "@internationalized/date";
22
+ import { Controller } from "react-hook-form";
23
+ import { createCalendar, toCalendarDate, today } from "@internationalized/date";
22
24
  import { DateTime } from "luxon";
23
25
  import { useCalendarState, useDatePickerState } from "react-stately";
24
26
  //#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
27
+ var DATE_PICKER_TIME_ZONE = "UTC";
25
28
  var DatePickerBase = (props) => {
26
29
  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;
30
+ 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, fireBlurOnChange: fireBlurOnChangeProp, format, ...rest } = props;
31
+ const as = asProp ?? ui.input.as;
32
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
33
+ const variant = variantProp ?? ui.input.variant;
34
+ const size = sizeProp ?? ui.input.size;
35
+ const isClearable = isClearableProp ?? ui.input.isClearable;
36
+ const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
37
+ const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
38
+ const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
39
+ const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
40
+ const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
41
+ const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
42
+ const granularity = granularityProp ?? ui.dateInput.granularity;
43
+ const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
44
+ const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
28
45
  const normalizeByGranularity = useCallback((date) => {
29
46
  if (granularity === "year") return date.set({
30
47
  month: 1,
@@ -50,12 +67,16 @@ var DatePickerBase = (props) => {
50
67
  const datePickerRef = useMemo(() => ({ get current() {
51
68
  return datePickerInputRef.current?.getContainer?.() || null;
52
69
  } }), []);
53
- useImperativeHandle(ref, () => ({ clear: () => {
54
- datePickerInputRef.current?.clear();
55
- } }));
70
+ useImperativeHandle(ref, () => ({
71
+ clear: () => {
72
+ datePickerInputRef.current?.clear();
73
+ },
74
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
75
+ }));
56
76
  const handleBlur = (val) => {
57
77
  onBlur?.({ target: { value: val } });
58
78
  };
79
+ const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
59
80
  const dialogState = useDatePickerState({
60
81
  ...rest,
61
82
  defaultValue: value || rest.defaultValue,
@@ -66,20 +87,21 @@ var DatePickerBase = (props) => {
66
87
  ...rest,
67
88
  shouldForceLeadingZeros,
68
89
  value,
69
- onChange: (val) => {
70
- let normalizedValue = val;
71
- if (val) normalizedValue = normalizeByGranularity(val);
90
+ onChange: (val_0) => {
91
+ let normalizedValue = val_0;
92
+ if (val_0) normalizedValue = normalizeByGranularity(val_0);
72
93
  if (normalizedValue && (rest.minValue && normalizedValue < rest?.minValue || rest?.maxValue && normalizedValue > rest?.maxValue)) {
73
94
  state.setValue(state.value);
74
95
  return;
75
96
  }
76
97
  onChange?.(normalizedValue);
77
98
  dialogState.setValue(normalizedValue);
99
+ if (fireBlurOnChange) debouncedBlur(normalizedValue);
78
100
  if (normalizedValue) {
79
101
  calendarState.setFocusedDate(normalizedValue);
80
102
  return;
81
103
  }
82
- calendarState.setFocusedDate(today(getLocalTimeZone()));
104
+ calendarState.setFocusedDate(today(DATE_PICKER_TIME_ZONE));
83
105
  },
84
106
  shouldCloseOnSelect: false
85
107
  });
@@ -114,11 +136,11 @@ var DatePickerBase = (props) => {
114
136
  const newValue = dialogState.value ? normalizeByGranularity(dialogState.value) : dialogState.value;
115
137
  state.setValue(newValue);
116
138
  state.toggle();
117
- handleBlur(newValue);
139
+ if (fireBlurOnChange) handleBlur(newValue);
118
140
  };
119
141
  const onMonthYearChange = (selectedDate) => {
120
142
  if (!(shouldUpdateDateOnMonthYearChange || granularity !== "day")) return;
121
- const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(getLocalTimeZone())).set({
143
+ const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(DATE_PICKER_TIME_ZONE)).set({
122
144
  year: selectedDate.year,
123
145
  month: selectedDate.month
124
146
  }));
@@ -129,7 +151,7 @@ var DatePickerBase = (props) => {
129
151
  onApply();
130
152
  };
131
153
  const onTodayPress = () => {
132
- const todayValue = normalizeByGranularity(today(getLocalTimeZone()));
154
+ const todayValue = normalizeByGranularity(today(DATE_PICKER_TIME_ZONE));
133
155
  dialogState.setValue(todayValue);
134
156
  calendarState.setFocusedDate(todayValue);
135
157
  };
@@ -137,7 +159,7 @@ var DatePickerBase = (props) => {
137
159
  if (!state.isOpen) return;
138
160
  if (granularity !== "year") return;
139
161
  if (dialogState.value) return;
140
- const defaultYearValue = normalizeByGranularity(today(getLocalTimeZone()));
162
+ const defaultYearValue = normalizeByGranularity(today(DATE_PICKER_TIME_ZONE));
141
163
  dialogState.setValue(defaultYearValue);
142
164
  calendarState.setFocusedDate(defaultYearValue);
143
165
  }, [
@@ -151,7 +173,7 @@ var DatePickerBase = (props) => {
151
173
  const onOpenChange = (isOpen) => {
152
174
  state.toggle();
153
175
  if (state.value) calendarState.setFocusedDate(normalizeByGranularity(state.value));
154
- if (!state.value) calendarState.setFocusedDate(today(getLocalTimeZone()));
176
+ if (!state.value) calendarState.setFocusedDate(today(DATE_PICKER_TIME_ZONE));
155
177
  if (!isOpen) dialogState.setValue(state.value);
156
178
  };
157
179
  return /* @__PURE__ */ jsx(TooltipWrapper, {
@@ -187,7 +209,9 @@ var DatePickerBase = (props) => {
187
209
  placeholder,
188
210
  className: inputClassName,
189
211
  dateGranularity: granularity,
190
- format
212
+ format,
213
+ timeZone: DATE_PICKER_TIME_ZONE,
214
+ fireBlurOnChange
191
215
  }), (!disableDropdown || disableManualEntry) && state.isOpen && /* @__PURE__ */ jsx(DateTimeDialog, {
192
216
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
193
217
  isDisabled,
@@ -213,7 +237,11 @@ var DatePickerBase = (props) => {
213
237
  })
214
238
  });
215
239
  };
216
- var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, renderStaticInput, ...props }) => {
240
+ var DatePickerInner = (t0) => {
241
+ const $ = c(28);
242
+ const { fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
243
+ const fullIso = t1 === void 0 ? true : t1;
244
+ const granularity = t2 === void 0 ? "day" : t2;
217
245
  const ui = UIConfig.useConfig();
218
246
  const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
219
247
  const { locale } = useLocale();
@@ -224,42 +252,75 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
224
252
  inputRef,
225
253
  renderInput,
226
254
  setRenderInput,
227
- getFocusTarget: (input) => {
228
- return (input.getContainer?.() ?? input).querySelector("input, button, [tabindex]:not([tabindex='-1'])");
229
- }
255
+ getFocusTarget: _temp
230
256
  });
231
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
232
- control: props.formControl.control,
233
- name: props.formControl.name
234
- }) : props.value;
235
- let isFormControlDisabled = false;
236
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
237
- const rawValue = watchedValue ?? props.value ?? null;
238
- const normalizeByGranularity = (date) => {
239
- if (granularity === "year") return date.set({
240
- month: 1,
241
- day: 1
242
- });
243
- if (granularity === "month") return date.set({ day: 1 });
244
- return date;
245
- };
246
- const formatCalendarDate = (calendarDate) => {
247
- if (calendarDate === null) return null;
248
- const normalizedDate = normalizeByGranularity(calendarDate);
249
- if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
250
- const date = DateTimeUtils.fromDateValueToLocal(normalizedDate);
251
- return DateTime.fromJSDate(date).toISODate();
252
- };
253
- const parseCalendarDate = (formattedDate) => {
254
- if (formattedDate == null) return formattedDate;
255
- if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
256
- const date = DateTime.fromISO(formattedDate).toJSDate();
257
- return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date)));
258
- };
259
- const dateLimits = {
260
- minValue: typeof minValue === "string" ? parseCalendarDate(minValue) : minValue,
261
- maxValue: typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue
262
- };
257
+ const rawValue = props.value ?? null;
258
+ let t3;
259
+ if ($[0] !== granularity) {
260
+ t3 = (date) => {
261
+ if (granularity === "year") return date.set({
262
+ month: 1,
263
+ day: 1
264
+ });
265
+ if (granularity === "month") return date.set({ day: 1 });
266
+ return date;
267
+ };
268
+ $[0] = granularity;
269
+ $[1] = t3;
270
+ } else t3 = $[1];
271
+ const normalizeByGranularity = t3;
272
+ let t4;
273
+ if ($[2] !== fullIso || $[3] !== normalizeByGranularity) {
274
+ t4 = (calendarDate) => {
275
+ if (calendarDate === null) return null;
276
+ const normalizedDate = normalizeByGranularity(calendarDate);
277
+ if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
278
+ const date_0 = DateTimeUtils.fromDateValueToLocal(normalizedDate, "UTC");
279
+ return DateTime.fromJSDate(date_0, { zone: "UTC" }).toISODate();
280
+ };
281
+ $[2] = fullIso;
282
+ $[3] = normalizeByGranularity;
283
+ $[4] = t4;
284
+ } else t4 = $[4];
285
+ const formatCalendarDate = t4;
286
+ let t5;
287
+ if ($[5] !== fullIso || $[6] !== normalizeByGranularity) {
288
+ t5 = (formattedDate) => {
289
+ if (formattedDate == null) return formattedDate;
290
+ if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
291
+ const date_1 = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
292
+ return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1, "UTC")));
293
+ };
294
+ $[5] = fullIso;
295
+ $[6] = normalizeByGranularity;
296
+ $[7] = t5;
297
+ } else t5 = $[7];
298
+ const parseCalendarDate = t5;
299
+ let t6;
300
+ if ($[8] !== minValue || $[9] !== parseCalendarDate) {
301
+ t6 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
302
+ $[8] = minValue;
303
+ $[9] = parseCalendarDate;
304
+ $[10] = t6;
305
+ } else t6 = $[10];
306
+ let t7;
307
+ if ($[11] !== maxValue || $[12] !== parseCalendarDate) {
308
+ t7 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
309
+ $[11] = maxValue;
310
+ $[12] = parseCalendarDate;
311
+ $[13] = t7;
312
+ } else t7 = $[13];
313
+ let t8;
314
+ if ($[14] !== t6 || $[15] !== t7) {
315
+ t8 = {
316
+ minValue: t6,
317
+ maxValue: t7
318
+ };
319
+ $[14] = t6;
320
+ $[15] = t7;
321
+ $[16] = t8;
322
+ } else t8 = $[16];
323
+ const dateLimits = t8;
263
324
  if (!renderInput) {
264
325
  const dateValue = rawValue ? parseCalendarDate(rawValue) : null;
265
326
  const as = props.as ?? ui.input.as;
@@ -300,37 +361,158 @@ var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ren
300
361
  onStaticInteract: renderRealInput,
301
362
  actionContent: staticTodayIcon,
302
363
  actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
364
+ wrapContentAndTrailing: true,
365
+ contentAndTrailingClassName: "gap-2!",
303
366
  trailingClassName: "py-0! pl-0!",
304
367
  trailingContent: showDropdown ? ui.dateInput.calendarIcon : void 0,
305
368
  children: staticSegments
306
369
  });
307
370
  }
308
- if ("formControl" in props && props.formControl) {
309
- const { formControl, ref, ...innerProps } = props;
310
- return /* @__PURE__ */ jsx(Controller, {
311
- control: formControl.control,
312
- name: formControl.name,
313
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DatePickerBase, {
314
- ...innerProps,
315
- ...dateLimits,
316
- ref: mergeRefs(ref, field.ref, inputRef),
317
- value: parseCalendarDate(field.value),
318
- onChange: (value) => field.onChange(formatCalendarDate(value)),
319
- onBlur: field.onBlur,
320
- isDirty,
321
- isDisabled: field.disabled || props.isDisabled,
322
- error: props.error ?? error?.message
323
- })
371
+ const T0 = DatePickerBase;
372
+ const t9 = mergeRefs(props.ref, inputRef);
373
+ const t10 = parseCalendarDate(props.value);
374
+ let t11;
375
+ if ($[17] !== formatCalendarDate || $[18] !== props) {
376
+ t11 = (value) => props.onChange?.(formatCalendarDate(value));
377
+ $[17] = formatCalendarDate;
378
+ $[18] = props;
379
+ $[19] = t11;
380
+ } else t11 = $[19];
381
+ let t12;
382
+ if ($[20] !== T0 || $[21] !== dateLimits || $[22] !== granularity || $[23] !== props || $[24] !== t10 || $[25] !== t11 || $[26] !== t9) {
383
+ t12 = /* @__PURE__ */ jsx(T0, {
384
+ ...props,
385
+ ...dateLimits,
386
+ ref: t9,
387
+ granularity,
388
+ value: t10,
389
+ onChange: t11
324
390
  });
391
+ $[20] = T0;
392
+ $[21] = dateLimits;
393
+ $[22] = granularity;
394
+ $[23] = props;
395
+ $[24] = t10;
396
+ $[25] = t11;
397
+ $[26] = t9;
398
+ $[27] = t12;
399
+ } else t12 = $[27];
400
+ return t12;
401
+ };
402
+ var DatePicker = (t0) => {
403
+ const $ = c(33);
404
+ let maxValue;
405
+ let minValue;
406
+ let props;
407
+ let renderStaticInput;
408
+ let t1;
409
+ let t2;
410
+ if ($[0] !== t0) {
411
+ ({fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, ...props} = t0);
412
+ $[0] = t0;
413
+ $[1] = maxValue;
414
+ $[2] = minValue;
415
+ $[3] = props;
416
+ $[4] = renderStaticInput;
417
+ $[5] = t1;
418
+ $[6] = t2;
419
+ } else {
420
+ maxValue = $[1];
421
+ minValue = $[2];
422
+ props = $[3];
423
+ renderStaticInput = $[4];
424
+ t1 = $[5];
425
+ t2 = $[6];
325
426
  }
326
- return /* @__PURE__ */ jsx(DatePickerBase, {
327
- ...props,
328
- ...dateLimits,
329
- ref: mergeRefs(props.ref, inputRef),
330
- granularity,
331
- value: parseCalendarDate(props.value),
332
- onChange: (value) => props.onChange?.(formatCalendarDate(value))
333
- });
427
+ const fullIso = t1 === void 0 ? true : t1;
428
+ const granularity = t2 === void 0 ? "day" : t2;
429
+ if ("formControl" in props && props.formControl) {
430
+ let formControl;
431
+ let innerProps;
432
+ let ref;
433
+ if ($[7] !== props) {
434
+ ({formControl, ref, ...innerProps} = props);
435
+ $[7] = props;
436
+ $[8] = formControl;
437
+ $[9] = innerProps;
438
+ $[10] = ref;
439
+ } else {
440
+ formControl = $[8];
441
+ innerProps = $[9];
442
+ ref = $[10];
443
+ }
444
+ const controlWithOptions = formControl.control;
445
+ let t3;
446
+ if ($[11] !== controlWithOptions._options?.disabled || $[12] !== fullIso || $[13] !== granularity || $[14] !== innerProps || $[15] !== maxValue || $[16] !== minValue || $[17] !== props.error || $[18] !== props.isDisabled || $[19] !== ref || $[20] !== renderStaticInput) {
447
+ t3 = (t4) => {
448
+ const { field, fieldState: t5 } = t4;
449
+ const { error, isDirty } = t5;
450
+ return /* @__PURE__ */ jsx(DatePickerInner, {
451
+ ...innerProps,
452
+ ref: mergeRefs(ref, field.ref),
453
+ value: field.value,
454
+ onChange: field.onChange,
455
+ onBlur: field.onBlur,
456
+ isDirty,
457
+ isDisabled: field.disabled || props.isDisabled,
458
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
459
+ error: props.error ?? error?.message,
460
+ fullIso,
461
+ granularity,
462
+ minValue,
463
+ maxValue,
464
+ renderStaticInput
465
+ });
466
+ };
467
+ $[11] = controlWithOptions._options?.disabled;
468
+ $[12] = fullIso;
469
+ $[13] = granularity;
470
+ $[14] = innerProps;
471
+ $[15] = maxValue;
472
+ $[16] = minValue;
473
+ $[17] = props.error;
474
+ $[18] = props.isDisabled;
475
+ $[19] = ref;
476
+ $[20] = renderStaticInput;
477
+ $[21] = t3;
478
+ } else t3 = $[21];
479
+ let t4;
480
+ if ($[22] !== formControl.control || $[23] !== formControl.name || $[24] !== t3) {
481
+ t4 = /* @__PURE__ */ jsx(Controller, {
482
+ control: formControl.control,
483
+ name: formControl.name,
484
+ render: t3
485
+ });
486
+ $[22] = formControl.control;
487
+ $[23] = formControl.name;
488
+ $[24] = t3;
489
+ $[25] = t4;
490
+ } else t4 = $[25];
491
+ return t4;
492
+ }
493
+ let t3;
494
+ if ($[26] !== fullIso || $[27] !== granularity || $[28] !== maxValue || $[29] !== minValue || $[30] !== props || $[31] !== renderStaticInput) {
495
+ t3 = /* @__PURE__ */ jsx(DatePickerInner, {
496
+ ...props,
497
+ fullIso,
498
+ granularity,
499
+ minValue,
500
+ maxValue,
501
+ renderStaticInput
502
+ });
503
+ $[26] = fullIso;
504
+ $[27] = granularity;
505
+ $[28] = maxValue;
506
+ $[29] = minValue;
507
+ $[30] = props;
508
+ $[31] = renderStaticInput;
509
+ $[32] = t3;
510
+ } else t3 = $[32];
511
+ return t3;
334
512
  };
513
+ function _temp(input) {
514
+ const container = input.getContainer?.() ?? input;
515
+ return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
516
+ }
335
517
  //#endregion
336
518
  export { DatePicker };
@@ -23,6 +23,7 @@ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Om
23
23
  placeholder?: string;
24
24
  inputClassName?: string;
25
25
  onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
26
+ fireBlurOnChange?: boolean;
26
27
  }
27
28
  export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
28
29
  value?: {