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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +166 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +35 -14
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +125 -109
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +33 -15
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +391 -117
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +4 -8
  83. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +8 -8
  84. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  85. package/dist/components/inputs/File/FileUpload.js +86 -44
  86. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  87. package/dist/components/inputs/File/InputUpload.js +317 -79
  88. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  89. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  90. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  91. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  92. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  93. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  94. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  95. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  96. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  97. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  98. package/dist/components/inputs/FormField/FormField.js +119 -37
  99. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  100. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  101. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  102. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  103. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  104. package/dist/components/inputs/Input/NumberInput/NumberInput.js +261 -84
  105. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  106. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +321 -77
  107. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  108. package/dist/components/inputs/Input/TextArea/TextArea.js +303 -90
  109. package/dist/components/inputs/Input/TextInput/TextInput.js +250 -84
  110. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  111. package/dist/components/inputs/Inputs/Form.js +40 -11
  112. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
  113. package/dist/components/inputs/Inputs/InputItem.js +65 -16
  114. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  115. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  116. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +11 -4
  117. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
  118. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  119. package/dist/components/inputs/Selection/Select/Select.js +24 -7
  120. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  121. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  122. package/dist/components/inputs/Selection/shared/SelectInput.js +335 -136
  123. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  124. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  125. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  126. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  127. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  128. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  129. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  130. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  131. package/dist/components/inputs/Selection/shared/select.context.js +35 -35
  132. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  133. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  134. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  135. package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
  136. package/dist/components/inputs/Skeleton/InputFrame.js +442 -116
  137. package/dist/components/inputs/Slider/Slider.js +250 -74
  138. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  139. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  140. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  141. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  142. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  143. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  144. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  145. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  146. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  147. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  148. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  149. package/dist/components/inputs/Toggle/Toggle.js +187 -40
  150. package/dist/components/inputs/shared/CheckContent.js +21 -10
  151. package/dist/components/inputs/shared/InputClear.js +78 -21
  152. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  153. package/dist/components/inputs/shared/input.cva.js +13 -3
  154. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
  155. package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
  156. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  157. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  158. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  159. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  160. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  161. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  162. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  163. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  164. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  165. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  166. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  167. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  168. package/dist/components/segment/Segment.js +218 -57
  169. package/dist/components/segment/SegmentItem.js +67 -10
  170. package/dist/components/shared/pagination/Pagination.js +108 -22
  171. package/dist/components/shared/pagination/PaginationList.js +167 -64
  172. package/dist/components/status/Alert/Alert.js +97 -30
  173. package/dist/components/status/Loader/Loader.js +77 -22
  174. package/dist/components/status/Toast/Toast.js +21 -13
  175. package/dist/components/status/Toast/useToast.js +62 -57
  176. package/dist/components/table/ColumnConfig.js +158 -54
  177. package/dist/components/table/InfiniteTable.js +67 -16
  178. package/dist/components/table/PaginatedTable.js +84 -18
  179. package/dist/components/table/Table.js +28 -27
  180. package/dist/components/text/Link/Link.js +19 -7
  181. package/dist/components/text/Typography/Typography.js +23 -8
  182. package/dist/config/confirmation.context.js +1 -1
  183. package/dist/config/link.context.js +23 -9
  184. package/dist/config/router.context.js +42 -16
  185. package/dist/config/theme.context.js +98 -45
  186. package/dist/config/uiConfig.context.js +39 -8
  187. package/dist/config/uiStyle.context.js +15 -5
  188. package/dist/helpers/dynamicInputs.d.ts +1 -1
  189. package/dist/hooks/useBreakpoint.js +16 -3
  190. package/dist/hooks/useDebounceCallback.js +51 -17
  191. package/dist/hooks/useFilters.js +125 -64
  192. package/dist/hooks/useForm.js +42 -8
  193. package/dist/hooks/useFormAutosave.js +101 -30
  194. package/dist/hooks/useIntersectionObserver.js +86 -32
  195. package/dist/hooks/useLocalStorage.js +43 -10
  196. package/dist/hooks/useLongPressRepeat.js +55 -20
  197. package/dist/hooks/usePagination.js +49 -19
  198. package/dist/hooks/useQueryAutocomplete.js +1 -0
  199. package/dist/hooks/useScrollableListBox.js +37 -16
  200. package/dist/hooks/useSorting.js +69 -28
  201. package/dist/hooks/useStateAndRef.js +21 -7
  202. package/dist/hooks/useTableColumnConfig.js +124 -31
  203. package/dist/hooks/useTranslationMemo.js +25 -5
  204. package/dist/index.js +2 -2
  205. package/dist/utils/date-time.utils.js +7 -13
  206. package/package.json +1 -1
@@ -24,7 +24,20 @@ import { useCalendarState, useDatePickerState } from "react-stately";
24
24
  //#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
25
25
  var DateTimePickerBase = (props) => {
26
26
  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;
27
+ 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, autoFixYear: autoFixYearProp, format, setDateValueOnDateSelection: setDateValueOnDateSelectionProp, ...rest } = props;
28
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
29
+ const variant = variantProp ?? ui.input.variant;
30
+ const as = asProp ?? ui.input.as;
31
+ const size = sizeProp ?? ui.input.size;
32
+ const isClearable = isClearableProp ?? ui.input.isClearable;
33
+ const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
34
+ const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
35
+ const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
36
+ const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
37
+ const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
38
+ const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
39
+ const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
40
+ const setDateValueOnDateSelection = setDateValueOnDateSelectionProp ?? ui.dateInput.setDateValueOnDateSelection;
28
41
  let effectiveTimeZone = getLocalTimeZone();
29
42
  if (timeZone) effectiveTimeZone = timeZone;
30
43
  const formFieldProps = {
@@ -44,9 +57,12 @@ var DateTimePickerBase = (props) => {
44
57
  const datePickerRef = useMemo(() => ({ get current() {
45
58
  return datePickerInputRef.current?.getContainer?.() || null;
46
59
  } }), []);
47
- useImperativeHandle(ref, () => ({ clear: () => {
48
- datePickerInputRef.current?.clear();
49
- } }));
60
+ useImperativeHandle(ref, () => ({
61
+ clear: () => {
62
+ datePickerInputRef.current?.clear();
63
+ },
64
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
65
+ }));
50
66
  const handleBlur = (val) => {
51
67
  onBlur?.({ target: { value: val } });
52
68
  };
@@ -66,11 +82,11 @@ var DateTimePickerBase = (props) => {
66
82
  ...rest,
67
83
  shouldForceLeadingZeros,
68
84
  value,
69
- onChange: (val) => {
70
- onChange?.(val);
71
- dialogState.setValue(val);
72
- calendarState.setFocusedDate(val || today(getLocalTimeZone()));
73
- 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);
74
90
  },
75
91
  shouldCloseOnSelect: false,
76
92
  granularity: "minute",
@@ -165,9 +181,9 @@ var DateTimePickerBase = (props) => {
165
181
  groupProps,
166
182
  fieldProps: {
167
183
  ...fieldProps,
168
- onBlur: (e) => {
169
- fieldProps.onBlur?.(e);
170
- onInputBlur(e);
184
+ onBlur: (e_0) => {
185
+ fieldProps.onBlur?.(e_0);
186
+ onInputBlur(e_0);
171
187
  }
172
188
  },
173
189
  buttonProps,
@@ -230,7 +246,8 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
230
246
  renderInput,
231
247
  setRenderInput,
232
248
  getFocusTarget: (input) => {
233
- 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;
234
251
  }
235
252
  });
236
253
  const watchedValue = "formControl" in props && props.formControl ? useWatch({
@@ -265,7 +282,6 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
265
282
  const staticSegments = getStaticCalendarDateTimeSegments({
266
283
  value: dateTimeValue,
267
284
  locale,
268
- placeholder: props.placeholder,
269
285
  shouldForceLeadingZeros,
270
286
  isDisabled,
271
287
  hidePlaceholder: as === "floating" && !dateTimeValue
@@ -292,6 +308,8 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
292
308
  onStaticInteract: renderRealInput,
293
309
  actionContent: staticTodayIcon,
294
310
  actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
311
+ wrapContentAndTrailing: true,
312
+ contentAndTrailingClassName: "gap-2!",
295
313
  trailingClassName: "py-0! pl-0!",
296
314
  trailingContent: showDropdown ? ui.dateInput.dateTimeIcon : void 0,
297
315
  children: staticSegments
@@ -318,7 +336,7 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
318
336
  ...props,
319
337
  ref: mergeRefs(props.ref, inputRef),
320
338
  value: parseDateValue(props.value),
321
- onChange: (value) => props.onChange?.(formatDateValue(value))
339
+ onChange: (value_0) => props.onChange?.(formatDateValue(value_0))
322
340
  });
323
341
  };
324
342
  //#endregion
@@ -10,6 +10,7 @@ import { InputFrame } from "../../Skeleton/InputFrame.js";
10
10
  import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
11
11
  import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
12
12
  import { TimePickerInput } from "../shared/TimePickerInput.js";
13
+ import { c } from "react/compiler-runtime";
13
14
  import { jsx, jsxs } from "react/jsx-runtime";
14
15
  import { clsx } from "clsx";
15
16
  import { useEffect, useRef, useState } from "react";
@@ -21,123 +22,396 @@ import { DateTime } from "luxon";
21
22
  import { useTimeFieldState } from "react-stately";
22
23
  //#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
23
24
  var TimePickerBase = (props) => {
25
+ const $ = c(129);
24
26
  const ui = UIConfig.useConfig();
25
- const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, placeholder, className, inputClassName, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, hideLabel = ui.input.hideLabel, isClearable = ui.input.isClearable, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
26
- const formFieldProps = {
27
- error,
28
- label,
29
- tooltipText,
30
- helperText,
31
- isRequired,
32
- rightContent,
33
- isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
34
- hideLabel,
35
- isDisabled,
36
- headerClassName,
37
- errorClassName
38
- };
27
+ let asProp;
28
+ let className;
29
+ let disableDropdown;
30
+ let disableManualEntryProp;
31
+ let error;
32
+ let errorClassName;
33
+ let headerClassName;
34
+ let helperText;
35
+ let hideLabelProp;
36
+ let inputClassName;
37
+ let isClearableProp;
38
+ let isDirty;
39
+ let isDisabled;
40
+ let isHeaderHidden;
41
+ let isRequired;
42
+ let label;
43
+ let onBlur;
44
+ let onChange;
45
+ let placeholder;
46
+ let ref;
47
+ let rest;
48
+ let rightContent;
49
+ let sizeProp;
50
+ let tooltipText;
51
+ let value;
52
+ let variantProp;
53
+ if ($[0] !== props) {
54
+ ({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, placeholder, className, inputClassName, variant: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, disableManualEntry: disableManualEntryProp, ...rest} = props);
55
+ $[0] = props;
56
+ $[1] = asProp;
57
+ $[2] = className;
58
+ $[3] = disableDropdown;
59
+ $[4] = disableManualEntryProp;
60
+ $[5] = error;
61
+ $[6] = errorClassName;
62
+ $[7] = headerClassName;
63
+ $[8] = helperText;
64
+ $[9] = hideLabelProp;
65
+ $[10] = inputClassName;
66
+ $[11] = isClearableProp;
67
+ $[12] = isDirty;
68
+ $[13] = isDisabled;
69
+ $[14] = isHeaderHidden;
70
+ $[15] = isRequired;
71
+ $[16] = label;
72
+ $[17] = onBlur;
73
+ $[18] = onChange;
74
+ $[19] = placeholder;
75
+ $[20] = ref;
76
+ $[21] = rest;
77
+ $[22] = rightContent;
78
+ $[23] = sizeProp;
79
+ $[24] = tooltipText;
80
+ $[25] = value;
81
+ $[26] = variantProp;
82
+ } else {
83
+ asProp = $[1];
84
+ className = $[2];
85
+ disableDropdown = $[3];
86
+ disableManualEntryProp = $[4];
87
+ error = $[5];
88
+ errorClassName = $[6];
89
+ headerClassName = $[7];
90
+ helperText = $[8];
91
+ hideLabelProp = $[9];
92
+ inputClassName = $[10];
93
+ isClearableProp = $[11];
94
+ isDirty = $[12];
95
+ isDisabled = $[13];
96
+ isHeaderHidden = $[14];
97
+ isRequired = $[15];
98
+ label = $[16];
99
+ onBlur = $[17];
100
+ onChange = $[18];
101
+ placeholder = $[19];
102
+ ref = $[20];
103
+ rest = $[21];
104
+ rightContent = $[22];
105
+ sizeProp = $[23];
106
+ tooltipText = $[24];
107
+ value = $[25];
108
+ variantProp = $[26];
109
+ }
110
+ const variant = variantProp ?? ui.input.variant;
111
+ const as = asProp ?? ui.input.as;
112
+ const size = sizeProp ?? ui.input.size;
113
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
114
+ const isClearable = isClearableProp ?? ui.input.isClearable;
115
+ const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
116
+ const t0 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
117
+ let t1;
118
+ if ($[27] !== error || $[28] !== errorClassName || $[29] !== headerClassName || $[30] !== helperText || $[31] !== hideLabel || $[32] !== isDisabled || $[33] !== isRequired || $[34] !== label || $[35] !== rightContent || $[36] !== t0 || $[37] !== tooltipText) {
119
+ t1 = {
120
+ error,
121
+ label,
122
+ tooltipText,
123
+ helperText,
124
+ isRequired,
125
+ rightContent,
126
+ isHeaderHidden: t0,
127
+ hideLabel,
128
+ isDisabled,
129
+ headerClassName,
130
+ errorClassName
131
+ };
132
+ $[27] = error;
133
+ $[28] = errorClassName;
134
+ $[29] = headerClassName;
135
+ $[30] = helperText;
136
+ $[31] = hideLabel;
137
+ $[32] = isDisabled;
138
+ $[33] = isRequired;
139
+ $[34] = label;
140
+ $[35] = rightContent;
141
+ $[36] = t0;
142
+ $[37] = tooltipText;
143
+ $[38] = t1;
144
+ } else t1 = $[38];
145
+ const formFieldProps = t1;
39
146
  const [isOpen, setIsOpen] = useState(false);
40
147
  const initialDateEmitRef = useRef(true);
41
148
  const { locale } = useLocale();
42
- const dialogState = useTimeFieldState({
43
- ...rest,
44
- defaultValue: value || rest.defaultValue,
45
- locale
46
- });
47
- const handleBlur = (val) => {
48
- onBlur?.({ target: { value: val } });
49
- };
50
- const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
51
- const state = useTimeFieldState({
52
- ...rest,
53
- isDisabled,
54
- value,
55
- onChange: (val) => {
56
- onChange?.(val);
57
- debouncedBlur(val);
58
- },
59
- locale
60
- });
61
- useEffect(() => {
62
- if (initialDateEmitRef.current) {
63
- initialDateEmitRef.current = false;
64
- return;
65
- }
66
- if (state.timeValue) onChange?.(state.timeValue);
67
- }, [rest.date]);
149
+ const t2 = value || rest.defaultValue;
150
+ let t3;
151
+ if ($[39] !== locale || $[40] !== rest || $[41] !== t2) {
152
+ t3 = {
153
+ ...rest,
154
+ defaultValue: t2,
155
+ locale
156
+ };
157
+ $[39] = locale;
158
+ $[40] = rest;
159
+ $[41] = t2;
160
+ $[42] = t3;
161
+ } else t3 = $[42];
162
+ const dialogState = useTimeFieldState(t3);
163
+ let t4;
164
+ if ($[43] !== onBlur) {
165
+ t4 = (val) => {
166
+ onBlur?.({ target: { value: val } });
167
+ };
168
+ $[43] = onBlur;
169
+ $[44] = t4;
170
+ } else t4 = $[44];
171
+ const handleBlur = t4;
172
+ let t5;
173
+ if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
174
+ t5 = { delay: 500 };
175
+ $[45] = t5;
176
+ } else t5 = $[45];
177
+ const { callback: debouncedBlur } = useDebounceCallback(handleBlur, t5);
178
+ let t6;
179
+ if ($[46] !== debouncedBlur || $[47] !== onChange) {
180
+ t6 = (val_0) => {
181
+ onChange?.(val_0);
182
+ debouncedBlur(val_0);
183
+ };
184
+ $[46] = debouncedBlur;
185
+ $[47] = onChange;
186
+ $[48] = t6;
187
+ } else t6 = $[48];
188
+ let t7;
189
+ if ($[49] !== isDisabled || $[50] !== locale || $[51] !== rest || $[52] !== t6 || $[53] !== value) {
190
+ t7 = {
191
+ ...rest,
192
+ isDisabled,
193
+ value,
194
+ onChange: t6,
195
+ locale
196
+ };
197
+ $[49] = isDisabled;
198
+ $[50] = locale;
199
+ $[51] = rest;
200
+ $[52] = t6;
201
+ $[53] = value;
202
+ $[54] = t7;
203
+ } else t7 = $[54];
204
+ const state = useTimeFieldState(t7);
205
+ let t8;
206
+ if ($[55] !== onChange || $[56] !== state.timeValue) {
207
+ t8 = () => {
208
+ if (initialDateEmitRef.current) {
209
+ initialDateEmitRef.current = false;
210
+ return;
211
+ }
212
+ if (state.timeValue) onChange?.(state.timeValue);
213
+ };
214
+ $[55] = onChange;
215
+ $[56] = state.timeValue;
216
+ $[57] = t8;
217
+ } else t8 = $[57];
218
+ let t9;
219
+ if ($[58] !== rest.date) {
220
+ t9 = [rest.date];
221
+ $[58] = rest.date;
222
+ $[59] = t9;
223
+ } else t9 = $[59];
224
+ useEffect(t8, t9);
68
225
  const timeFieldRef = useRef(null);
69
- const { labelProps, fieldProps } = useTimeField({
70
- ...rest,
71
- label,
72
- isReadOnly: disableManualEntry
73
- }, state, timeFieldRef);
74
- const headerProps = {
75
- label,
76
- tooltipText,
77
- helperText,
78
- isRequired,
79
- rightContent,
80
- isHeaderHidden: hideLabel || isHeaderHidden,
81
- isDisabled,
82
- className: headerClassName,
83
- labelProps
84
- };
85
- const onApply = () => {
86
- const newValue = dialogState.value;
87
- state.setValue(newValue);
88
- setIsOpen(false);
89
- handleBlur(newValue);
90
- };
91
- const onOpenChange = (open) => {
92
- setIsOpen(open);
93
- if (!isOpen) dialogState.setValue(state.value);
94
- };
95
- const onOpen = () => {
96
- dialogState.setValue(state.value);
97
- setIsOpen(true);
98
- };
99
- return /* @__PURE__ */ jsx(TooltipWrapper, {
100
- as,
101
- error,
102
- triggerTabIndex: as === "inline" ? -1 : void 0,
103
- children: /* @__PURE__ */ jsxs(FormField, {
226
+ let t10;
227
+ if ($[60] !== disableManualEntry || $[61] !== label || $[62] !== rest) {
228
+ t10 = {
229
+ ...rest,
230
+ label,
231
+ isReadOnly: disableManualEntry
232
+ };
233
+ $[60] = disableManualEntry;
234
+ $[61] = label;
235
+ $[62] = rest;
236
+ $[63] = t10;
237
+ } else t10 = $[63];
238
+ const { labelProps, fieldProps } = useTimeField(t10, state, timeFieldRef);
239
+ const t11 = hideLabel || isHeaderHidden;
240
+ let t12;
241
+ if ($[64] !== headerClassName || $[65] !== helperText || $[66] !== isDisabled || $[67] !== isRequired || $[68] !== label || $[69] !== labelProps || $[70] !== rightContent || $[71] !== t11 || $[72] !== tooltipText) {
242
+ t12 = {
243
+ label,
244
+ tooltipText,
245
+ helperText,
246
+ isRequired,
247
+ rightContent,
248
+ isHeaderHidden: t11,
249
+ isDisabled,
250
+ className: headerClassName,
251
+ labelProps
252
+ };
253
+ $[64] = headerClassName;
254
+ $[65] = helperText;
255
+ $[66] = isDisabled;
256
+ $[67] = isRequired;
257
+ $[68] = label;
258
+ $[69] = labelProps;
259
+ $[70] = rightContent;
260
+ $[71] = t11;
261
+ $[72] = tooltipText;
262
+ $[73] = t12;
263
+ } else t12 = $[73];
264
+ const headerProps = t12;
265
+ let t13;
266
+ if ($[74] !== dialogState.value || $[75] !== handleBlur || $[76] !== state) {
267
+ t13 = () => {
268
+ const newValue = dialogState.value;
269
+ state.setValue(newValue);
270
+ setIsOpen(false);
271
+ handleBlur(newValue);
272
+ };
273
+ $[74] = dialogState.value;
274
+ $[75] = handleBlur;
275
+ $[76] = state;
276
+ $[77] = t13;
277
+ } else t13 = $[77];
278
+ const onApply = t13;
279
+ let t14;
280
+ if ($[78] !== dialogState || $[79] !== isOpen || $[80] !== state.value) {
281
+ t14 = (open) => {
282
+ setIsOpen(open);
283
+ if (!isOpen) dialogState.setValue(state.value);
284
+ };
285
+ $[78] = dialogState;
286
+ $[79] = isOpen;
287
+ $[80] = state.value;
288
+ $[81] = t14;
289
+ } else t14 = $[81];
290
+ const onOpenChange = t14;
291
+ let t15;
292
+ if ($[82] !== dialogState || $[83] !== state.value) {
293
+ t15 = () => {
294
+ dialogState.setValue(state.value);
295
+ setIsOpen(true);
296
+ };
297
+ $[82] = dialogState;
298
+ $[83] = state.value;
299
+ $[84] = t15;
300
+ } else t15 = $[84];
301
+ const onOpen = t15;
302
+ const t16 = as === "inline" ? -1 : void 0;
303
+ let t17;
304
+ if ($[85] !== className) {
305
+ t17 = clsx("relative inline-flex w-full flex-col text-left", className);
306
+ $[85] = className;
307
+ $[86] = t17;
308
+ } else t17 = $[86];
309
+ const t18 = as === "inline" ? -1 : void 0;
310
+ let t19;
311
+ if ($[87] !== ref) {
312
+ t19 = mergeRefs(ref, timeFieldRef);
313
+ $[87] = ref;
314
+ $[88] = t19;
315
+ } else t19 = $[88];
316
+ const t20 = !!error;
317
+ let t21;
318
+ if ($[89] !== as || $[90] !== disableDropdown || $[91] !== disableManualEntry || $[92] !== fieldProps || $[93] !== headerProps || $[94] !== inputClassName || $[95] !== isClearable || $[96] !== isDirty || $[97] !== isDisabled || $[98] !== isRequired || $[99] !== onOpen || $[100] !== placeholder || $[101] !== size || $[102] !== state || $[103] !== t19 || $[104] !== t20 || $[105] !== variant) {
319
+ t21 = /* @__PURE__ */ jsx(TimePickerInput, {
320
+ ref: t19,
321
+ as,
322
+ fieldProps,
323
+ state,
324
+ onPress: onOpen,
325
+ isDisabled,
326
+ isDirty,
327
+ isRequired,
328
+ isInvalid: t20,
329
+ disableDropdown,
330
+ variant,
331
+ size,
332
+ isClearable,
333
+ headerProps,
334
+ disableManualEntry,
335
+ placeholder,
336
+ className: inputClassName
337
+ });
338
+ $[89] = as;
339
+ $[90] = disableDropdown;
340
+ $[91] = disableManualEntry;
341
+ $[92] = fieldProps;
342
+ $[93] = headerProps;
343
+ $[94] = inputClassName;
344
+ $[95] = isClearable;
345
+ $[96] = isDirty;
346
+ $[97] = isDisabled;
347
+ $[98] = isRequired;
348
+ $[99] = onOpen;
349
+ $[100] = placeholder;
350
+ $[101] = size;
351
+ $[102] = state;
352
+ $[103] = t19;
353
+ $[104] = t20;
354
+ $[105] = variant;
355
+ $[106] = t21;
356
+ } else t21 = $[106];
357
+ let t22;
358
+ if ($[107] !== dialogState || $[108] !== disableDropdown || $[109] !== disableManualEntry || $[110] !== isDisabled || $[111] !== isOpen || $[112] !== label || $[113] !== onApply || $[114] !== onOpenChange) {
359
+ t22 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
360
+ footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
361
+ isDisabled,
362
+ onApply,
363
+ isValid: !dialogState.isInvalid && !!dialogState.value
364
+ }),
365
+ label,
366
+ triggerRef: timeFieldRef,
367
+ isOpen,
368
+ onOpenChange,
369
+ children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
370
+ });
371
+ $[107] = dialogState;
372
+ $[108] = disableDropdown;
373
+ $[109] = disableManualEntry;
374
+ $[110] = isDisabled;
375
+ $[111] = isOpen;
376
+ $[112] = label;
377
+ $[113] = onApply;
378
+ $[114] = onOpenChange;
379
+ $[115] = t22;
380
+ } else t22 = $[115];
381
+ let t23;
382
+ if ($[116] !== as || $[117] !== formFieldProps || $[118] !== labelProps || $[119] !== t17 || $[120] !== t18 || $[121] !== t21 || $[122] !== t22) {
383
+ t23 = /* @__PURE__ */ jsxs(FormField, {
104
384
  ...formFieldProps,
105
385
  as,
106
386
  labelProps,
107
- className: clsx("relative inline-flex w-full flex-col text-left", className),
108
- tabIndex: as === "inline" ? -1 : void 0,
109
- children: [/* @__PURE__ */ jsx(TimePickerInput, {
110
- ref: mergeRefs(ref, timeFieldRef),
111
- as,
112
- fieldProps,
113
- state,
114
- onPress: onOpen,
115
- isDisabled,
116
- isDirty,
117
- isRequired,
118
- isInvalid: !!error,
119
- disableDropdown,
120
- variant,
121
- size,
122
- isClearable,
123
- headerProps,
124
- disableManualEntry,
125
- placeholder,
126
- className: inputClassName
127
- }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
128
- footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
129
- isDisabled,
130
- onApply,
131
- isValid: !dialogState.isInvalid && !!dialogState.value
132
- }),
133
- label,
134
- triggerRef: timeFieldRef,
135
- isOpen,
136
- onOpenChange,
137
- children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
138
- })]
139
- })
140
- });
387
+ className: t17,
388
+ tabIndex: t18,
389
+ children: [t21, t22]
390
+ });
391
+ $[116] = as;
392
+ $[117] = formFieldProps;
393
+ $[118] = labelProps;
394
+ $[119] = t17;
395
+ $[120] = t18;
396
+ $[121] = t21;
397
+ $[122] = t22;
398
+ $[123] = t23;
399
+ } else t23 = $[123];
400
+ let t24;
401
+ if ($[124] !== as || $[125] !== error || $[126] !== t16 || $[127] !== t23) {
402
+ t24 = /* @__PURE__ */ jsx(TooltipWrapper, {
403
+ as,
404
+ error,
405
+ triggerTabIndex: t16,
406
+ children: t23
407
+ });
408
+ $[124] = as;
409
+ $[125] = error;
410
+ $[126] = t16;
411
+ $[127] = t23;
412
+ $[128] = t24;
413
+ } else t24 = $[128];
414
+ return t24;
141
415
  };
142
416
  var TimePicker = ({ renderStaticInput, ...props }) => {
143
417
  const ui = UIConfig.useConfig();
@@ -173,17 +447,16 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
173
447
  return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, effectiveTimeZone));
174
448
  };
175
449
  if (!renderInput) {
176
- const timeValue = rawValue ? parseTimeValue(rawValue) : null;
450
+ const timeValue_0 = rawValue ? parseTimeValue(rawValue) : null;
177
451
  const as = props.as ?? ui.input.as;
178
452
  const isDisabled = isFormControlDisabled || !!props.isDisabled;
179
453
  const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
180
454
  const showDropdown = !props.disableDropdown || disableManualEntry;
181
455
  const staticSegments = getStaticTimeSegments({
182
- value: timeValue,
456
+ value: timeValue_0,
183
457
  locale,
184
- placeholder: props.placeholder,
185
458
  isDisabled,
186
- hidePlaceholder: as === "floating" && !timeValue
459
+ hidePlaceholder: as === "floating" && !timeValue_0
187
460
  });
188
461
  return /* @__PURE__ */ jsx(InputFrame, {
189
462
  ...props,
@@ -193,17 +466,18 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
193
466
  contentClassName: "pr-0!",
194
467
  labelPlacement: "content-row",
195
468
  dataAttributes: {
196
- dataIsEmpty: timeValue === null,
197
- dataIsFilled: timeValue !== null,
469
+ dataIsEmpty: timeValue_0 === null,
470
+ dataIsFilled: timeValue_0 !== null,
198
471
  dataIsDirty: props.isDirty,
199
472
  dataIsRequired: props.isRequired,
200
473
  dataIsDisabled: isDisabled,
201
474
  dataDisabled: isDisabled,
202
475
  dataInvalid: !!props.error,
203
- dataHasSelection: timeValue !== null
476
+ dataHasSelection: timeValue_0 !== null
204
477
  },
205
478
  renderStatic: true,
206
479
  onStaticInteract: renderRealInput,
480
+ wrapContentAndTrailing: true,
207
481
  trailingClassName: "py-0! pl-0!",
208
482
  trailingContent: showDropdown ? ui.dateInput.timeIcon : void 0,
209
483
  children: staticSegments
@@ -230,7 +504,7 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
230
504
  ...props,
231
505
  ref: mergeRefs(props.ref, inputRef),
232
506
  value: parseTimeValue(props.value),
233
- onChange: (value) => props.onChange?.(formatTimeValue(value))
507
+ onChange: (value_0) => props.onChange?.(formatTimeValue(value_0))
234
508
  });
235
509
  };
236
510
  //#endregion