@povio/ui 2.3.0 → 2.3.2-rc.1

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