@povio/ui 2.3.0-rc.3 → 2.3.0-rc.31

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 +188 -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 +267 -87
  65. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  66. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +347 -182
  67. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  68. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +177 -69
  69. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
  70. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +530 -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 +245 -90
  77. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  78. package/dist/components/inputs/DateTime/shared/DateField.js +295 -112
  79. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -1
  80. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +375 -146
  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 +3 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +208 -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 -123
  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 +298 -89
  115. package/dist/components/inputs/Input/TextInput/TextInput.js +370 -121
  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 +139 -44
  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 +444 -124
  146. package/dist/components/inputs/Slider/Slider.js +247 -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 -41
  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
@@ -10,145 +10,435 @@ 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";
16
17
  import { useLocale, useTimeField } from "react-aria";
17
18
  import { mergeRefs } from "@react-aria/utils";
18
- import { Controller, useWatch } from "react-hook-form";
19
- import { getLocalTimeZone, now, toTime } from "@internationalized/date";
19
+ import { Controller } from "react-hook-form";
20
+ import { now, toTime } from "@internationalized/date";
20
21
  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(137);
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: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, disableManualEntry: disableManualEntryProp, ...rest } = props;
27
+ let asProp;
28
+ let className;
29
+ let disableDropdown;
30
+ let disableManualEntryProp;
31
+ let error;
32
+ let errorClassName;
33
+ let fireBlurOnChangeProp;
34
+ let headerClassName;
35
+ let helperText;
36
+ let hideLabelProp;
37
+ let inputClassName;
38
+ let isClearableProp;
39
+ let isDirty;
40
+ let isDisabled;
41
+ let isHeaderHidden;
42
+ let isRequired;
43
+ let label;
44
+ let onBlur;
45
+ let onChange;
46
+ let placeholder;
47
+ let ref;
48
+ let rest;
49
+ let rightContent;
50
+ let sizeProp;
51
+ let tooltipText;
52
+ let value;
53
+ let variantProp;
54
+ if ($[0] !== props) {
55
+ ({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, fireBlurOnChange: fireBlurOnChangeProp, ...rest} = props);
56
+ $[0] = props;
57
+ $[1] = asProp;
58
+ $[2] = className;
59
+ $[3] = disableDropdown;
60
+ $[4] = disableManualEntryProp;
61
+ $[5] = error;
62
+ $[6] = errorClassName;
63
+ $[7] = fireBlurOnChangeProp;
64
+ $[8] = headerClassName;
65
+ $[9] = helperText;
66
+ $[10] = hideLabelProp;
67
+ $[11] = inputClassName;
68
+ $[12] = isClearableProp;
69
+ $[13] = isDirty;
70
+ $[14] = isDisabled;
71
+ $[15] = isHeaderHidden;
72
+ $[16] = isRequired;
73
+ $[17] = label;
74
+ $[18] = onBlur;
75
+ $[19] = onChange;
76
+ $[20] = placeholder;
77
+ $[21] = ref;
78
+ $[22] = rest;
79
+ $[23] = rightContent;
80
+ $[24] = sizeProp;
81
+ $[25] = tooltipText;
82
+ $[26] = value;
83
+ $[27] = variantProp;
84
+ } else {
85
+ asProp = $[1];
86
+ className = $[2];
87
+ disableDropdown = $[3];
88
+ disableManualEntryProp = $[4];
89
+ error = $[5];
90
+ errorClassName = $[6];
91
+ fireBlurOnChangeProp = $[7];
92
+ headerClassName = $[8];
93
+ helperText = $[9];
94
+ hideLabelProp = $[10];
95
+ inputClassName = $[11];
96
+ isClearableProp = $[12];
97
+ isDirty = $[13];
98
+ isDisabled = $[14];
99
+ isHeaderHidden = $[15];
100
+ isRequired = $[16];
101
+ label = $[17];
102
+ onBlur = $[18];
103
+ onChange = $[19];
104
+ placeholder = $[20];
105
+ ref = $[21];
106
+ rest = $[22];
107
+ rightContent = $[23];
108
+ sizeProp = $[24];
109
+ tooltipText = $[25];
110
+ value = $[26];
111
+ variantProp = $[27];
112
+ }
26
113
  const variant = variantProp ?? ui.input.variant;
27
114
  const as = asProp ?? ui.input.as;
28
115
  const size = sizeProp ?? ui.input.size;
29
116
  const hideLabel = hideLabelProp ?? ui.input.hideLabel;
30
117
  const isClearable = isClearableProp ?? ui.input.isClearable;
31
118
  const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
32
- const formFieldProps = {
33
- error,
34
- label,
35
- tooltipText,
36
- helperText,
37
- isRequired,
38
- rightContent,
39
- isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
40
- hideLabel,
41
- isDisabled,
42
- headerClassName,
43
- errorClassName
44
- };
119
+ const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
120
+ const t0 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
121
+ let t1;
122
+ if ($[28] !== error || $[29] !== errorClassName || $[30] !== headerClassName || $[31] !== helperText || $[32] !== hideLabel || $[33] !== isDisabled || $[34] !== isRequired || $[35] !== label || $[36] !== rightContent || $[37] !== t0 || $[38] !== tooltipText) {
123
+ t1 = {
124
+ error,
125
+ label,
126
+ tooltipText,
127
+ helperText,
128
+ isRequired,
129
+ rightContent,
130
+ isHeaderHidden: t0,
131
+ hideLabel,
132
+ isDisabled,
133
+ headerClassName,
134
+ errorClassName
135
+ };
136
+ $[28] = error;
137
+ $[29] = errorClassName;
138
+ $[30] = headerClassName;
139
+ $[31] = helperText;
140
+ $[32] = hideLabel;
141
+ $[33] = isDisabled;
142
+ $[34] = isRequired;
143
+ $[35] = label;
144
+ $[36] = rightContent;
145
+ $[37] = t0;
146
+ $[38] = tooltipText;
147
+ $[39] = t1;
148
+ } else t1 = $[39];
149
+ const formFieldProps = t1;
45
150
  const [isOpen, setIsOpen] = useState(false);
46
151
  const initialDateEmitRef = useRef(true);
47
152
  const { locale } = useLocale();
48
- const dialogState = useTimeFieldState({
49
- ...rest,
50
- defaultValue: value || rest.defaultValue,
51
- locale
52
- });
53
- const handleBlur = (val) => {
54
- onBlur?.({ target: { value: val } });
55
- };
56
- const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
57
- const state = useTimeFieldState({
58
- ...rest,
59
- isDisabled,
60
- value,
61
- onChange: (val) => {
62
- onChange?.(val);
63
- debouncedBlur(val);
64
- },
65
- locale
66
- });
67
- useEffect(() => {
68
- if (initialDateEmitRef.current) {
69
- initialDateEmitRef.current = false;
70
- return;
71
- }
72
- if (state.timeValue) onChange?.(state.timeValue);
73
- }, [rest.date]);
153
+ const t2 = value ?? rest.defaultValue ?? null;
154
+ let t3;
155
+ if ($[40] !== locale || $[41] !== rest || $[42] !== t2) {
156
+ t3 = {
157
+ ...rest,
158
+ defaultValue: t2,
159
+ locale
160
+ };
161
+ $[40] = locale;
162
+ $[41] = rest;
163
+ $[42] = t2;
164
+ $[43] = t3;
165
+ } else t3 = $[43];
166
+ const dialogState = useTimeFieldState(t3);
167
+ let t4;
168
+ if ($[44] !== onBlur) {
169
+ t4 = (val) => {
170
+ onBlur?.({ target: { value: val } });
171
+ };
172
+ $[44] = onBlur;
173
+ $[45] = t4;
174
+ } else t4 = $[45];
175
+ const handleBlur = t4;
176
+ let t5;
177
+ if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
178
+ t5 = { delay: 500 };
179
+ $[46] = t5;
180
+ } else t5 = $[46];
181
+ const { callback: debouncedBlur } = useDebounceCallback(handleBlur, t5);
182
+ const t6 = value ?? null;
183
+ let t7;
184
+ if ($[47] !== debouncedBlur || $[48] !== fireBlurOnChange || $[49] !== onChange) {
185
+ t7 = (val_0) => {
186
+ onChange?.(val_0);
187
+ if (fireBlurOnChange) debouncedBlur(val_0);
188
+ };
189
+ $[47] = debouncedBlur;
190
+ $[48] = fireBlurOnChange;
191
+ $[49] = onChange;
192
+ $[50] = t7;
193
+ } else t7 = $[50];
194
+ let t8;
195
+ if ($[51] !== isDisabled || $[52] !== locale || $[53] !== rest || $[54] !== t6 || $[55] !== t7) {
196
+ t8 = {
197
+ ...rest,
198
+ isDisabled,
199
+ value: t6,
200
+ onChange: t7,
201
+ locale
202
+ };
203
+ $[51] = isDisabled;
204
+ $[52] = locale;
205
+ $[53] = rest;
206
+ $[54] = t6;
207
+ $[55] = t7;
208
+ $[56] = t8;
209
+ } else t8 = $[56];
210
+ const state = useTimeFieldState(t8);
211
+ let t9;
212
+ if ($[57] !== onChange || $[58] !== state.timeValue) {
213
+ t9 = () => {
214
+ if (initialDateEmitRef.current) {
215
+ initialDateEmitRef.current = false;
216
+ return;
217
+ }
218
+ if (state.timeValue) onChange?.(state.timeValue);
219
+ };
220
+ $[57] = onChange;
221
+ $[58] = state.timeValue;
222
+ $[59] = t9;
223
+ } else t9 = $[59];
224
+ let t10;
225
+ if ($[60] !== rest.date) {
226
+ t10 = [rest.date];
227
+ $[60] = rest.date;
228
+ $[61] = t10;
229
+ } else t10 = $[61];
230
+ useEffect(t9, t10);
74
231
  const timeFieldRef = useRef(null);
75
- const { labelProps, fieldProps } = useTimeField({
76
- ...rest,
77
- label,
78
- isReadOnly: disableManualEntry
79
- }, state, timeFieldRef);
80
- const headerProps = {
81
- label,
82
- tooltipText,
83
- helperText,
84
- isRequired,
85
- rightContent,
86
- isHeaderHidden: hideLabel || isHeaderHidden,
87
- isDisabled,
88
- className: headerClassName,
89
- labelProps
90
- };
91
- const onApply = () => {
92
- const newValue = dialogState.value;
93
- state.setValue(newValue);
94
- setIsOpen(false);
95
- handleBlur(newValue);
96
- };
97
- const onOpenChange = (open) => {
98
- setIsOpen(open);
99
- if (!isOpen) dialogState.setValue(state.value);
100
- };
101
- const onOpen = () => {
102
- dialogState.setValue(state.value);
103
- setIsOpen(true);
104
- };
105
- return /* @__PURE__ */ jsx(TooltipWrapper, {
106
- as,
107
- error,
108
- triggerTabIndex: as === "inline" ? -1 : void 0,
109
- children: /* @__PURE__ */ jsxs(FormField, {
232
+ let t11;
233
+ if ($[62] !== disableManualEntry || $[63] !== label || $[64] !== rest) {
234
+ t11 = {
235
+ ...rest,
236
+ label,
237
+ isReadOnly: disableManualEntry
238
+ };
239
+ $[62] = disableManualEntry;
240
+ $[63] = label;
241
+ $[64] = rest;
242
+ $[65] = t11;
243
+ } else t11 = $[65];
244
+ const { labelProps, fieldProps } = useTimeField(t11, state, timeFieldRef);
245
+ const t12 = hideLabel || isHeaderHidden;
246
+ let t13;
247
+ if ($[66] !== headerClassName || $[67] !== helperText || $[68] !== isDisabled || $[69] !== isRequired || $[70] !== label || $[71] !== labelProps || $[72] !== rightContent || $[73] !== t12 || $[74] !== tooltipText) {
248
+ t13 = {
249
+ label,
250
+ tooltipText,
251
+ helperText,
252
+ isRequired,
253
+ rightContent,
254
+ isHeaderHidden: t12,
255
+ isDisabled,
256
+ className: headerClassName,
257
+ labelProps
258
+ };
259
+ $[66] = headerClassName;
260
+ $[67] = helperText;
261
+ $[68] = isDisabled;
262
+ $[69] = isRequired;
263
+ $[70] = label;
264
+ $[71] = labelProps;
265
+ $[72] = rightContent;
266
+ $[73] = t12;
267
+ $[74] = tooltipText;
268
+ $[75] = t13;
269
+ } else t13 = $[75];
270
+ const headerProps = t13;
271
+ let t14;
272
+ if ($[76] !== dialogState.value || $[77] !== fireBlurOnChange || $[78] !== handleBlur || $[79] !== state) {
273
+ t14 = () => {
274
+ const newValue = dialogState.value;
275
+ state.setValue(newValue);
276
+ setIsOpen(false);
277
+ if (fireBlurOnChange) handleBlur(newValue);
278
+ };
279
+ $[76] = dialogState.value;
280
+ $[77] = fireBlurOnChange;
281
+ $[78] = handleBlur;
282
+ $[79] = state;
283
+ $[80] = t14;
284
+ } else t14 = $[80];
285
+ const onApply = t14;
286
+ let t15;
287
+ if ($[81] !== dialogState || $[82] !== isOpen || $[83] !== state.value) {
288
+ t15 = (open) => {
289
+ setIsOpen(open);
290
+ if (!isOpen) dialogState.setValue(state.value);
291
+ };
292
+ $[81] = dialogState;
293
+ $[82] = isOpen;
294
+ $[83] = state.value;
295
+ $[84] = t15;
296
+ } else t15 = $[84];
297
+ const onOpenChange = t15;
298
+ let t16;
299
+ if ($[85] !== dialogState || $[86] !== state.value) {
300
+ t16 = () => {
301
+ dialogState.setValue(state.value);
302
+ setIsOpen(true);
303
+ };
304
+ $[85] = dialogState;
305
+ $[86] = state.value;
306
+ $[87] = t16;
307
+ } else t16 = $[87];
308
+ const onOpen = t16;
309
+ let t17;
310
+ if ($[88] !== dialogState || $[89] !== onChange) {
311
+ t17 = () => {
312
+ onChange?.(null);
313
+ dialogState.setValue(null);
314
+ };
315
+ $[88] = dialogState;
316
+ $[89] = onChange;
317
+ $[90] = t17;
318
+ } else t17 = $[90];
319
+ const onInputClear = t17;
320
+ const t18 = as === "inline" ? -1 : void 0;
321
+ let t19;
322
+ if ($[91] !== className) {
323
+ t19 = clsx("relative inline-flex w-full flex-col text-left", className);
324
+ $[91] = className;
325
+ $[92] = t19;
326
+ } else t19 = $[92];
327
+ const t20 = as === "inline" ? -1 : void 0;
328
+ let t21;
329
+ if ($[93] !== ref) {
330
+ t21 = mergeRefs(ref, timeFieldRef);
331
+ $[93] = ref;
332
+ $[94] = t21;
333
+ } else t21 = $[94];
334
+ const t22 = !!error;
335
+ let t23;
336
+ if ($[95] !== as || $[96] !== disableDropdown || $[97] !== disableManualEntry || $[98] !== fieldProps || $[99] !== fireBlurOnChange || $[100] !== headerProps || $[101] !== inputClassName || $[102] !== isClearable || $[103] !== isDirty || $[104] !== isDisabled || $[105] !== isRequired || $[106] !== onInputClear || $[107] !== onOpen || $[108] !== placeholder || $[109] !== size || $[110] !== state || $[111] !== t21 || $[112] !== t22 || $[113] !== variant) {
337
+ t23 = /* @__PURE__ */ jsx(TimePickerInput, {
338
+ ref: t21,
339
+ as,
340
+ fieldProps,
341
+ state,
342
+ onPress: onOpen,
343
+ isDisabled,
344
+ isDirty,
345
+ isRequired,
346
+ isInvalid: t22,
347
+ disableDropdown,
348
+ variant,
349
+ size,
350
+ isClearable,
351
+ headerProps,
352
+ disableManualEntry,
353
+ placeholder,
354
+ className: inputClassName,
355
+ onClear: onInputClear,
356
+ fireBlurOnChange
357
+ });
358
+ $[95] = as;
359
+ $[96] = disableDropdown;
360
+ $[97] = disableManualEntry;
361
+ $[98] = fieldProps;
362
+ $[99] = fireBlurOnChange;
363
+ $[100] = headerProps;
364
+ $[101] = inputClassName;
365
+ $[102] = isClearable;
366
+ $[103] = isDirty;
367
+ $[104] = isDisabled;
368
+ $[105] = isRequired;
369
+ $[106] = onInputClear;
370
+ $[107] = onOpen;
371
+ $[108] = placeholder;
372
+ $[109] = size;
373
+ $[110] = state;
374
+ $[111] = t21;
375
+ $[112] = t22;
376
+ $[113] = variant;
377
+ $[114] = t23;
378
+ } else t23 = $[114];
379
+ let t24;
380
+ if ($[115] !== dialogState || $[116] !== disableDropdown || $[117] !== disableManualEntry || $[118] !== isDisabled || $[119] !== isOpen || $[120] !== label || $[121] !== onApply || $[122] !== onOpenChange) {
381
+ t24 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
382
+ footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
383
+ isDisabled,
384
+ onApply,
385
+ isValid: !dialogState.isInvalid && !!dialogState.value
386
+ }),
387
+ label,
388
+ triggerRef: timeFieldRef,
389
+ isOpen,
390
+ onOpenChange,
391
+ children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
392
+ });
393
+ $[115] = dialogState;
394
+ $[116] = disableDropdown;
395
+ $[117] = disableManualEntry;
396
+ $[118] = isDisabled;
397
+ $[119] = isOpen;
398
+ $[120] = label;
399
+ $[121] = onApply;
400
+ $[122] = onOpenChange;
401
+ $[123] = t24;
402
+ } else t24 = $[123];
403
+ let t25;
404
+ if ($[124] !== as || $[125] !== formFieldProps || $[126] !== labelProps || $[127] !== t19 || $[128] !== t20 || $[129] !== t23 || $[130] !== t24) {
405
+ t25 = /* @__PURE__ */ jsxs(FormField, {
110
406
  ...formFieldProps,
111
407
  as,
112
408
  labelProps,
113
- className: clsx("relative inline-flex w-full flex-col text-left", className),
114
- tabIndex: as === "inline" ? -1 : void 0,
115
- children: [/* @__PURE__ */ jsx(TimePickerInput, {
116
- ref: mergeRefs(ref, timeFieldRef),
117
- as,
118
- fieldProps,
119
- state,
120
- onPress: onOpen,
121
- isDisabled,
122
- isDirty,
123
- isRequired,
124
- isInvalid: !!error,
125
- disableDropdown,
126
- variant,
127
- size,
128
- isClearable,
129
- headerProps,
130
- disableManualEntry,
131
- placeholder,
132
- className: inputClassName
133
- }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
134
- footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
135
- isDisabled,
136
- onApply,
137
- isValid: !dialogState.isInvalid && !!dialogState.value
138
- }),
139
- label,
140
- triggerRef: timeFieldRef,
141
- isOpen,
142
- onOpenChange,
143
- children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
144
- })]
145
- })
146
- });
409
+ className: t19,
410
+ tabIndex: t20,
411
+ children: [t23, t24]
412
+ });
413
+ $[124] = as;
414
+ $[125] = formFieldProps;
415
+ $[126] = labelProps;
416
+ $[127] = t19;
417
+ $[128] = t20;
418
+ $[129] = t23;
419
+ $[130] = t24;
420
+ $[131] = t25;
421
+ } else t25 = $[131];
422
+ let t26;
423
+ if ($[132] !== as || $[133] !== error || $[134] !== t18 || $[135] !== t25) {
424
+ t26 = /* @__PURE__ */ jsx(TooltipWrapper, {
425
+ as,
426
+ error,
427
+ triggerTabIndex: t18,
428
+ children: t25
429
+ });
430
+ $[132] = as;
431
+ $[133] = error;
432
+ $[134] = t18;
433
+ $[135] = t25;
434
+ $[136] = t26;
435
+ } else t26 = $[136];
436
+ return t26;
147
437
  };
148
- var TimePicker = ({ renderStaticInput, ...props }) => {
438
+ var TimePickerInner = (t0) => {
439
+ const $ = c(9);
440
+ const { renderStaticInput, isFormControlDisabled, ...props } = t0;
149
441
  const ui = UIConfig.useConfig();
150
- let effectiveTimeZone = getLocalTimeZone();
151
- if (props.timeZone) effectiveTimeZone = props.timeZone;
152
442
  const { locale } = useLocale();
153
443
  const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
154
444
  const inputRef = useRef(null);
@@ -156,39 +446,30 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
156
446
  inputRef,
157
447
  renderInput,
158
448
  setRenderInput,
159
- getFocusTarget: (input) => input.querySelector("input, button, [tabindex]:not([tabindex='-1'])")
449
+ getFocusTarget: _temp
160
450
  });
161
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
162
- control: props.formControl.control,
163
- name: props.formControl.name
164
- }) : props.value;
165
- let isFormControlDisabled = false;
166
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
167
- const rawValue = watchedValue ?? props.value ?? null;
451
+ const normalizedValue = props.value ?? null;
168
452
  const formatTimeValue = (timeValue) => {
169
453
  if (timeValue === null) return null;
170
454
  let parsedDate;
171
- if (props.date) parsedDate = DateTime.fromISO(props.date, { zone: effectiveTimeZone }).toJSDate();
172
- let dateValue = now(effectiveTimeZone);
173
- if (parsedDate) dateValue = DateTimeUtils.fromLocalToZonedDateTime(parsedDate, effectiveTimeZone);
455
+ if (props.date) parsedDate = DateTime.fromISO(props.date, { zone: "UTC" }).toJSDate();
456
+ let dateValue = now("UTC");
457
+ if (parsedDate) dateValue = DateTimeUtils.fromLocalToZonedDateTime(parsedDate, "UTC");
174
458
  const dateTimeValue = dateValue.set(timeValue);
175
- return DateTimeUtils.fromDateValueToISO(dateTimeValue, effectiveTimeZone);
176
- };
177
- const parseTimeValue = (isoString) => {
178
- if (isoString == null) return isoString;
179
- return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, effectiveTimeZone));
459
+ return DateTimeUtils.fromDateValueToISO(dateTimeValue, "UTC");
180
460
  };
461
+ const parseTimeValue = _temp2;
181
462
  if (!renderInput) {
182
- const timeValue = rawValue ? parseTimeValue(rawValue) : null;
463
+ const timeValue_0 = normalizedValue ? parseTimeValue(normalizedValue) : null;
183
464
  const as = props.as ?? ui.input.as;
184
465
  const isDisabled = isFormControlDisabled || !!props.isDisabled;
185
466
  const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
186
467
  const showDropdown = !props.disableDropdown || disableManualEntry;
187
468
  const staticSegments = getStaticTimeSegments({
188
- value: timeValue,
469
+ value: timeValue_0,
189
470
  locale,
190
471
  isDisabled,
191
- hidePlaceholder: as === "floating" && !timeValue
472
+ hidePlaceholder: as === "floating" && !timeValue_0
192
473
  });
193
474
  return /* @__PURE__ */ jsx(InputFrame, {
194
475
  ...props,
@@ -198,45 +479,137 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
198
479
  contentClassName: "pr-0!",
199
480
  labelPlacement: "content-row",
200
481
  dataAttributes: {
201
- dataIsEmpty: timeValue === null,
202
- dataIsFilled: timeValue !== null,
482
+ dataIsEmpty: timeValue_0 == null,
483
+ dataIsFilled: timeValue_0 != null,
203
484
  dataIsDirty: props.isDirty,
204
485
  dataIsRequired: props.isRequired,
205
486
  dataIsDisabled: isDisabled,
206
487
  dataDisabled: isDisabled,
207
488
  dataInvalid: !!props.error,
208
- dataHasSelection: timeValue !== null
489
+ dataHasSelection: timeValue_0 != null
209
490
  },
210
491
  renderStatic: true,
211
492
  onStaticInteract: renderRealInput,
493
+ wrapContentAndTrailing: true,
212
494
  trailingClassName: "py-0! pl-0!",
213
495
  trailingContent: showDropdown ? ui.dateInput.timeIcon : void 0,
214
496
  children: staticSegments
215
497
  });
216
498
  }
217
- if ("formControl" in props && props.formControl) {
218
- const { formControl, ref, ...innerProps } = props;
219
- return /* @__PURE__ */ jsx(Controller, {
220
- control: formControl.control,
221
- name: formControl.name,
222
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(TimePickerBase, {
223
- ...innerProps,
224
- ref: mergeRefs(ref, field.ref, inputRef),
225
- value: parseTimeValue(field.value),
226
- onChange: (value) => field.onChange(formatTimeValue(value)),
227
- onBlur: field.onBlur,
228
- isDirty,
229
- isDisabled: field.disabled || props.isDisabled,
230
- error: props.error ?? error?.message
231
- })
499
+ const T0 = TimePickerBase;
500
+ const t1 = mergeRefs(props.ref, inputRef);
501
+ const t2 = parseTimeValue(normalizedValue);
502
+ let t3;
503
+ if ($[0] !== formatTimeValue || $[1] !== props) {
504
+ t3 = (value) => props.onChange?.(formatTimeValue(value));
505
+ $[0] = formatTimeValue;
506
+ $[1] = props;
507
+ $[2] = t3;
508
+ } else t3 = $[2];
509
+ let t4;
510
+ if ($[3] !== T0 || $[4] !== props || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
511
+ t4 = /* @__PURE__ */ jsx(T0, {
512
+ ...props,
513
+ ref: t1,
514
+ value: t2,
515
+ onChange: t3
232
516
  });
517
+ $[3] = T0;
518
+ $[4] = props;
519
+ $[5] = t1;
520
+ $[6] = t2;
521
+ $[7] = t3;
522
+ $[8] = t4;
523
+ } else t4 = $[8];
524
+ return t4;
525
+ };
526
+ var TimePicker = (t0) => {
527
+ const $ = c(21);
528
+ let props;
529
+ let renderStaticInput;
530
+ if ($[0] !== t0) {
531
+ ({renderStaticInput, ...props} = t0);
532
+ $[0] = t0;
533
+ $[1] = props;
534
+ $[2] = renderStaticInput;
535
+ } else {
536
+ props = $[1];
537
+ renderStaticInput = $[2];
233
538
  }
234
- return /* @__PURE__ */ jsx(TimePickerBase, {
235
- ...props,
236
- ref: mergeRefs(props.ref, inputRef),
237
- value: parseTimeValue(props.value),
238
- onChange: (value) => props.onChange?.(formatTimeValue(value))
239
- });
539
+ if ("formControl" in props && props.formControl) {
540
+ let formControl;
541
+ let innerProps;
542
+ let ref;
543
+ if ($[3] !== props) {
544
+ ({formControl, ref, ...innerProps} = props);
545
+ $[3] = props;
546
+ $[4] = formControl;
547
+ $[5] = innerProps;
548
+ $[6] = ref;
549
+ } else {
550
+ formControl = $[4];
551
+ innerProps = $[5];
552
+ ref = $[6];
553
+ }
554
+ const controlWithOptions = formControl.control;
555
+ let t1;
556
+ if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
557
+ t1 = (t2) => {
558
+ const { field, fieldState: t3 } = t2;
559
+ const { error, isDirty } = t3;
560
+ return /* @__PURE__ */ jsx(TimePickerInner, {
561
+ ...innerProps,
562
+ ref: mergeRefs(ref, field.ref),
563
+ value: field.value,
564
+ onChange: field.onChange,
565
+ onBlur: field.onBlur,
566
+ isDirty,
567
+ isDisabled: field.disabled || props.isDisabled,
568
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
569
+ error: props.error ?? error?.message,
570
+ renderStaticInput
571
+ });
572
+ };
573
+ $[7] = controlWithOptions._options?.disabled;
574
+ $[8] = innerProps;
575
+ $[9] = props.error;
576
+ $[10] = props.isDisabled;
577
+ $[11] = ref;
578
+ $[12] = renderStaticInput;
579
+ $[13] = t1;
580
+ } else t1 = $[13];
581
+ let t2;
582
+ if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
583
+ t2 = /* @__PURE__ */ jsx(Controller, {
584
+ control: formControl.control,
585
+ name: formControl.name,
586
+ render: t1
587
+ });
588
+ $[14] = formControl.control;
589
+ $[15] = formControl.name;
590
+ $[16] = t1;
591
+ $[17] = t2;
592
+ } else t2 = $[17];
593
+ return t2;
594
+ }
595
+ let t1;
596
+ if ($[18] !== props || $[19] !== renderStaticInput) {
597
+ t1 = /* @__PURE__ */ jsx(TimePickerInner, {
598
+ ...props,
599
+ renderStaticInput
600
+ });
601
+ $[18] = props;
602
+ $[19] = renderStaticInput;
603
+ $[20] = t1;
604
+ } else t1 = $[20];
605
+ return t1;
240
606
  };
607
+ function _temp(input) {
608
+ return input.querySelector("input, button, [tabindex]:not([tabindex='-1'])");
609
+ }
610
+ function _temp2(isoString) {
611
+ if (isoString == null) return isoString;
612
+ return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, "UTC"));
613
+ }
241
614
  //#endregion
242
615
  export { TimePicker };