@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
@@ -25,6 +25,7 @@ interface DateTimePickerBaseProps extends FormFieldProps, InputVariantProps, Omi
25
25
  timeZone?: string;
26
26
  format?: string;
27
27
  onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
28
+ fireBlurOnChange?: boolean;
28
29
  }
29
30
  export interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "value" | "onChange"> {
30
31
  value?: string | null;
@@ -13,20 +13,34 @@ import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
13
13
  import { InputFrame } from "../../Skeleton/InputFrame.js";
14
14
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
15
15
  import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
16
+ import { c } from "react/compiler-runtime";
16
17
  import { jsx, jsxs } from "react/jsx-runtime";
17
18
  import { clsx } from "clsx";
18
19
  import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
19
20
  import { useDatePicker, useLocale } from "react-aria";
20
21
  import { mergeRefs } from "@react-aria/utils";
21
- import { Controller, useWatch } from "react-hook-form";
22
- import { Time, createCalendar, getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
22
+ import { Controller } from "react-hook-form";
23
+ import { Time, createCalendar, toCalendarDate, toCalendarDateTime, today } from "@internationalized/date";
23
24
  import { useCalendarState, useDatePickerState } from "react-stately";
24
25
  //#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
25
26
  var DateTimePickerBase = (props) => {
26
27
  const ui = UIConfig.useConfig();
27
- const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, 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, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange, timeZone, autoFixYear = ui.dateInput.autoFixYear, format, setDateValueOnDateSelection = ui.dateInput.setDateValueOnDateSelection, ...rest } = props;
28
- let effectiveTimeZone = getLocalTimeZone();
29
- if (timeZone) effectiveTimeZone = timeZone;
28
+ const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, isTimeOptional, placeholder, inputClassName, hideLabel: hideLabelProp, variant: variantProp, as: asProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, timeZone: _timeZone, autoFixYear: autoFixYearProp, fireBlurOnChange: fireBlurOnChangeProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
29
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
30
+ const variant = variantProp ?? ui.input.variant;
31
+ const as = asProp ?? ui.input.as;
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 autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
41
+ const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
42
+ const setDateValueOnDateSelection = setDateValueOnDateSelectionProp ?? ui.dateInput.setDateValueOnDateSelection;
43
+ const effectiveTimeZone = "UTC";
30
44
  const formFieldProps = {
31
45
  error,
32
46
  label,
@@ -44,9 +58,12 @@ var DateTimePickerBase = (props) => {
44
58
  const datePickerRef = useMemo(() => ({ get current() {
45
59
  return datePickerInputRef.current?.getContainer?.() || null;
46
60
  } }), []);
47
- useImperativeHandle(ref, () => ({ clear: () => {
48
- datePickerInputRef.current?.clear();
49
- } }));
61
+ useImperativeHandle(ref, () => ({
62
+ clear: () => {
63
+ datePickerInputRef.current?.clear();
64
+ },
65
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
66
+ }));
50
67
  const handleBlur = (val) => {
51
68
  onBlur?.({ target: { value: val } });
52
69
  };
@@ -66,11 +83,11 @@ var DateTimePickerBase = (props) => {
66
83
  ...rest,
67
84
  shouldForceLeadingZeros,
68
85
  value,
69
- onChange: (val) => {
70
- onChange?.(val);
71
- dialogState.setValue(val);
72
- calendarState.setFocusedDate(val || today(getLocalTimeZone()));
73
- debouncedBlur(val);
86
+ onChange: (val_0) => {
87
+ onChange?.(val_0);
88
+ dialogState.setValue(val_0);
89
+ calendarState.setFocusedDate(val_0 || today(effectiveTimeZone));
90
+ if (fireBlurOnChange) debouncedBlur(val_0);
74
91
  },
75
92
  shouldCloseOnSelect: false,
76
93
  granularity: "minute",
@@ -109,7 +126,7 @@ var DateTimePickerBase = (props) => {
109
126
  const newValue = dialogState.value;
110
127
  state.setValue(newValue);
111
128
  state.toggle();
112
- handleBlur(newValue);
129
+ if (fireBlurOnChange) handleBlur(newValue);
113
130
  };
114
131
  const onMonthYearChange = (selectedDate) => {
115
132
  if (!shouldUpdateDateOnMonthYearChange) return;
@@ -127,8 +144,9 @@ var DateTimePickerBase = (props) => {
127
144
  calendarState.setFocusedDate(selectedDate);
128
145
  };
129
146
  const onTodayPress = () => {
130
- dialogState.setValue(toCalendarDateTime(now(effectiveTimeZone)));
131
- calendarState.setFocusedDate(today(effectiveTimeZone));
147
+ const currentValue = DateTimeUtils.getCurrentWallClockCalendarDateTime();
148
+ dialogState.setValue(currentValue);
149
+ calendarState.setFocusedDate(toCalendarDate(currentValue));
132
150
  };
133
151
  const onOpenChange = (isOpen) => {
134
152
  state.toggle();
@@ -165,9 +183,9 @@ var DateTimePickerBase = (props) => {
165
183
  groupProps,
166
184
  fieldProps: {
167
185
  ...fieldProps,
168
- onBlur: (e) => {
169
- fieldProps.onBlur?.(e);
170
- onInputBlur(e);
186
+ onBlur: (e_0) => {
187
+ fieldProps.onBlur?.(e_0);
188
+ onInputBlur(e_0);
171
189
  }
172
190
  },
173
191
  buttonProps,
@@ -191,7 +209,8 @@ var DateTimePickerBase = (props) => {
191
209
  className: inputClassName,
192
210
  timeZone: effectiveTimeZone,
193
211
  isTimeOptional,
194
- format
212
+ format,
213
+ fireBlurOnChange
195
214
  }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
196
215
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
197
216
  isDisabled,
@@ -218,7 +237,9 @@ var DateTimePickerBase = (props) => {
218
237
  })
219
238
  });
220
239
  };
221
- var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
240
+ var DateTimePickerInner = (t0) => {
241
+ const $ = c(9);
242
+ const { fullIso: t1, renderStaticInput, isFormControlDisabled, ...props } = t0;
222
243
  const ui = UIConfig.useConfig();
223
244
  const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
224
245
  const { locale } = useLocale();
@@ -229,28 +250,11 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
229
250
  inputRef,
230
251
  renderInput,
231
252
  setRenderInput,
232
- getFocusTarget: (input) => {
233
- return (input.getContainer?.() ?? input).querySelector("input, button, [tabindex]:not([tabindex='-1'])");
234
- }
253
+ getFocusTarget: _temp
235
254
  });
236
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
237
- control: props.formControl.control,
238
- name: props.formControl.name
239
- }) : props.value;
240
- let isFormControlDisabled = false;
241
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
242
- const rawValue = watchedValue ?? props.value ?? null;
243
- let effectiveTimeZone = getLocalTimeZone();
244
- if (props.timeZone) effectiveTimeZone = props.timeZone;
245
- const formatDateValue = (dateValue) => {
246
- if (dateValue === null) return null;
247
- if (fullIso) return DateTimeUtils.fromDateValueToISO(dateValue, effectiveTimeZone);
248
- return DateTimeUtils.fromDateValueToISO(dateValue, effectiveTimeZone);
249
- };
250
- const parseDateValue = (isoString) => {
251
- if (isoString == null) return isoString;
252
- return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, effectiveTimeZone);
253
- };
255
+ const rawValue = props.value ?? null;
256
+ const formatDateValue = _temp2;
257
+ const parseDateValue = _temp3;
254
258
  if (!renderInput) {
255
259
  const dateTimeValue = rawValue ? parseDateValue(rawValue) : null;
256
260
  const as = props.as ?? ui.input.as;
@@ -291,34 +295,140 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
291
295
  onStaticInteract: renderRealInput,
292
296
  actionContent: staticTodayIcon,
293
297
  actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
298
+ wrapContentAndTrailing: true,
299
+ contentAndTrailingClassName: "gap-2!",
294
300
  trailingClassName: "py-0! pl-0!",
295
301
  trailingContent: showDropdown ? ui.dateInput.dateTimeIcon : void 0,
296
302
  children: staticSegments
297
303
  });
298
304
  }
299
- if ("formControl" in props && props.formControl) {
300
- const { formControl, ref, ...innerProps } = props;
301
- return /* @__PURE__ */ jsx(Controller, {
302
- control: formControl.control,
303
- name: formControl.name,
304
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateTimePickerBase, {
305
- ...innerProps,
306
- ref: mergeRefs(ref, field.ref, inputRef),
307
- value: parseDateValue(field.value),
308
- onChange: (value) => field.onChange(formatDateValue(value)),
309
- onBlur: field.onBlur,
310
- isDirty,
311
- isDisabled: field.disabled || props.isDisabled,
312
- error: props.error ?? error?.message
313
- })
305
+ const T0 = DateTimePickerBase;
306
+ const t2 = mergeRefs(props.ref, inputRef);
307
+ const t3 = parseDateValue(props.value);
308
+ let t4;
309
+ if ($[0] !== formatDateValue || $[1] !== props) {
310
+ t4 = (value) => props.onChange?.(formatDateValue(value));
311
+ $[0] = formatDateValue;
312
+ $[1] = props;
313
+ $[2] = t4;
314
+ } else t4 = $[2];
315
+ let t5;
316
+ if ($[3] !== T0 || $[4] !== props || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
317
+ t5 = /* @__PURE__ */ jsx(T0, {
318
+ ...props,
319
+ ref: t2,
320
+ value: t3,
321
+ onChange: t4
314
322
  });
323
+ $[3] = T0;
324
+ $[4] = props;
325
+ $[5] = t2;
326
+ $[6] = t3;
327
+ $[7] = t4;
328
+ $[8] = t5;
329
+ } else t5 = $[8];
330
+ return t5;
331
+ };
332
+ var DateTimePicker = (t0) => {
333
+ const $ = c(24);
334
+ let props;
335
+ let renderStaticInput;
336
+ let t1;
337
+ if ($[0] !== t0) {
338
+ ({fullIso: t1, renderStaticInput, ...props} = t0);
339
+ $[0] = t0;
340
+ $[1] = props;
341
+ $[2] = renderStaticInput;
342
+ $[3] = t1;
343
+ } else {
344
+ props = $[1];
345
+ renderStaticInput = $[2];
346
+ t1 = $[3];
315
347
  }
316
- return /* @__PURE__ */ jsx(DateTimePickerBase, {
317
- ...props,
318
- ref: mergeRefs(props.ref, inputRef),
319
- value: parseDateValue(props.value),
320
- onChange: (value) => props.onChange?.(formatDateValue(value))
321
- });
348
+ const fullIso = t1 === void 0 ? true : t1;
349
+ if ("formControl" in props && props.formControl) {
350
+ let formControl;
351
+ let innerProps;
352
+ let ref;
353
+ if ($[4] !== props) {
354
+ ({formControl, ref, ...innerProps} = props);
355
+ $[4] = props;
356
+ $[5] = formControl;
357
+ $[6] = innerProps;
358
+ $[7] = ref;
359
+ } else {
360
+ formControl = $[5];
361
+ innerProps = $[6];
362
+ ref = $[7];
363
+ }
364
+ const controlWithOptions = formControl.control;
365
+ let t2;
366
+ if ($[8] !== controlWithOptions._options?.disabled || $[9] !== fullIso || $[10] !== innerProps || $[11] !== props.error || $[12] !== props.isDisabled || $[13] !== ref || $[14] !== renderStaticInput) {
367
+ t2 = (t3) => {
368
+ const { field, fieldState: t4 } = t3;
369
+ const { error, isDirty } = t4;
370
+ return /* @__PURE__ */ jsx(DateTimePickerInner, {
371
+ ...innerProps,
372
+ ref: mergeRefs(ref, field.ref),
373
+ value: field.value,
374
+ onChange: field.onChange,
375
+ onBlur: field.onBlur,
376
+ isDirty,
377
+ isDisabled: field.disabled || props.isDisabled,
378
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
379
+ error: props.error ?? error?.message,
380
+ fullIso,
381
+ renderStaticInput
382
+ });
383
+ };
384
+ $[8] = controlWithOptions._options?.disabled;
385
+ $[9] = fullIso;
386
+ $[10] = innerProps;
387
+ $[11] = props.error;
388
+ $[12] = props.isDisabled;
389
+ $[13] = ref;
390
+ $[14] = renderStaticInput;
391
+ $[15] = t2;
392
+ } else t2 = $[15];
393
+ let t3;
394
+ if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
395
+ t3 = /* @__PURE__ */ jsx(Controller, {
396
+ control: formControl.control,
397
+ name: formControl.name,
398
+ render: t2
399
+ });
400
+ $[16] = formControl.control;
401
+ $[17] = formControl.name;
402
+ $[18] = t2;
403
+ $[19] = t3;
404
+ } else t3 = $[19];
405
+ return t3;
406
+ }
407
+ let t2;
408
+ if ($[20] !== fullIso || $[21] !== props || $[22] !== renderStaticInput) {
409
+ t2 = /* @__PURE__ */ jsx(DateTimePickerInner, {
410
+ ...props,
411
+ fullIso,
412
+ renderStaticInput
413
+ });
414
+ $[20] = fullIso;
415
+ $[21] = props;
416
+ $[22] = renderStaticInput;
417
+ $[23] = t2;
418
+ } else t2 = $[23];
419
+ return t2;
322
420
  };
421
+ function _temp(input) {
422
+ const container = input.getContainer?.() ?? input;
423
+ return container instanceof HTMLElement ? container.querySelector("input, button, [tabindex]:not([tabindex='-1'])") : null;
424
+ }
425
+ function _temp2(dateValue) {
426
+ if (dateValue === null) return null;
427
+ return DateTimeUtils.fromDateValueFieldsToUTCISO(dateValue);
428
+ }
429
+ function _temp3(isoString) {
430
+ if (isoString == null) return isoString;
431
+ return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, "UTC");
432
+ }
323
433
  //#endregion
324
434
  export { DateTimePicker };
@@ -14,6 +14,7 @@ interface TimePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<Ar
14
14
  placeholder?: string;
15
15
  inputClassName?: string;
16
16
  onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
17
+ fireBlurOnChange?: boolean;
17
18
  }
18
19
  export interface TimePickerProps extends Omit<TimePickerBaseProps, "value" | "onChange"> {
19
20
  value?: string | null;