@povio/ui 2.3.0-rc.9 → 2.3.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 (282) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  48. package/dist/components/Menu/Menu.js +2 -18
  49. package/dist/components/Menu/MenuDesktop.js +7 -41
  50. package/dist/components/Menu/MenuItem.js +9 -32
  51. package/dist/components/Menu/MenuMobile.js +38 -97
  52. package/dist/components/Menu/MenuPopover.js +29 -105
  53. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  56. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  57. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  58. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  59. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  60. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  61. package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  63. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  64. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  65. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
  66. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
  67. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
  68. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
  69. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
  70. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
  71. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
  72. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
  73. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  74. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
  75. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
  76. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
  77. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
  78. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
  79. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  80. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  81. package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
  82. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
  83. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
  84. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
  85. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
  86. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  87. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  88. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  89. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  90. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  91. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  92. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  93. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
  94. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  95. package/dist/components/inputs/File/FileUpload.js +44 -87
  96. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  97. package/dist/components/inputs/File/InputUpload.js +79 -317
  98. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  99. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  100. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  101. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  102. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  103. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  104. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  105. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  106. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  107. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  108. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  109. package/dist/components/inputs/FormField/FormField.js +37 -119
  110. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  111. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  112. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  113. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  114. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  115. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  116. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  117. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  118. package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
  119. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  120. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  121. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  122. package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
  123. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  124. package/dist/components/inputs/Inputs/Form.js +11 -40
  125. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
  126. package/dist/components/inputs/Inputs/InputItem.js +14 -71
  127. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  128. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  129. package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
  130. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  131. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  132. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  133. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
  134. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  135. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
  136. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  137. package/dist/components/inputs/Selection/Select/Select.js +5 -132
  138. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  139. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  140. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  141. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  142. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  143. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
  144. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  145. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  146. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  147. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  148. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  149. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  150. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  151. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  152. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  153. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  154. package/dist/components/inputs/Selection/shared/select.context.js +34 -57
  155. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  157. package/dist/components/inputs/Slider/Slider.js +74 -250
  158. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  159. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  160. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  161. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  162. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  163. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  164. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  165. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  166. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  167. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  168. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  169. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  170. package/dist/components/inputs/Toggle/Toggle.js +37 -189
  171. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  172. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  173. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  174. package/dist/components/inputs/shared/CheckContent.js +11 -21
  175. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  176. package/dist/components/inputs/shared/InputClear.js +13 -79
  177. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  178. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  179. package/dist/components/inputs/shared/input.cva.js +4 -32
  180. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  181. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  182. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  183. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  184. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  185. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  186. package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
  187. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  188. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  189. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  190. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  191. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  192. package/dist/components/segment/Segment.js +57 -218
  193. package/dist/components/segment/SegmentItem.js +10 -67
  194. package/dist/components/shared/pagination/Pagination.js +22 -108
  195. package/dist/components/shared/pagination/PaginationList.js +64 -167
  196. package/dist/components/status/Alert/Alert.js +30 -97
  197. package/dist/components/status/Loader/Loader.js +22 -77
  198. package/dist/components/status/Toast/Toast.js +13 -21
  199. package/dist/components/status/Toast/useToast.js +57 -62
  200. package/dist/components/table/ColumnConfig.js +54 -158
  201. package/dist/components/table/InfiniteTable.js +16 -67
  202. package/dist/components/table/PaginatedTable.js +18 -84
  203. package/dist/components/table/Table.js +27 -28
  204. package/dist/components/text/Link/Link.js +7 -19
  205. package/dist/components/text/Typography/Typography.js +8 -23
  206. package/dist/config/confirmation.context.js +1 -1
  207. package/dist/config/link.context.js +9 -23
  208. package/dist/config/router.context.js +16 -42
  209. package/dist/config/theme.context.js +45 -98
  210. package/dist/config/uiConfig.context.d.ts +6 -16
  211. package/dist/config/uiConfig.context.js +13 -56
  212. package/dist/config/uiStyle.context.d.ts +4 -27
  213. package/dist/config/uiStyle.context.js +5 -15
  214. package/dist/helpers/dynamicInputs.d.ts +5 -5
  215. package/dist/helpers/dynamicInputs.js +0 -3
  216. package/dist/hooks/useBreakpoint.js +3 -16
  217. package/dist/hooks/useDebounceCallback.js +17 -51
  218. package/dist/hooks/useFilters.js +64 -125
  219. package/dist/hooks/useForm.js +8 -42
  220. package/dist/hooks/useFormAutosave.js +30 -101
  221. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  222. package/dist/hooks/useIntersectionObserver.js +24 -91
  223. package/dist/hooks/useLocalStorage.js +10 -43
  224. package/dist/hooks/useLongPressRepeat.js +20 -55
  225. package/dist/hooks/usePagination.js +19 -49
  226. package/dist/hooks/useScrollableListBox.js +16 -37
  227. package/dist/hooks/useSorting.js +28 -69
  228. package/dist/hooks/useStateAndRef.js +7 -21
  229. package/dist/hooks/useTableColumnConfig.js +31 -124
  230. package/dist/hooks/useTranslationMemo.js +5 -25
  231. package/dist/index.d.ts +0 -7
  232. package/dist/index.js +3 -5
  233. package/dist/tw-ui-plugin.js +0 -2
  234. package/dist/utils/date-time.utils.d.ts +10 -31
  235. package/dist/utils/date-time.utils.js +22 -123
  236. package/dist/utils/dom.utils.js +1 -1
  237. package/package.json +1 -1
  238. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
  239. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  240. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  241. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
  242. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
  243. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  244. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  245. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
  246. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
  247. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  248. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  249. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  250. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  251. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  252. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
  254. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  255. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  256. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  257. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  258. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  259. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  260. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
  261. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  262. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  263. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
  264. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
  265. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  266. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  267. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  268. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  269. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  270. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  271. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  272. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
  273. package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
  274. package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
  275. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  276. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  277. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  278. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  279. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  280. package/dist/hooks/useQueryAutocomplete.js +0 -57
  281. package/dist/utils/query.utils.d.ts +0 -4
  282. package/dist/utils/query.utils.js +0 -8
@@ -3,436 +3,131 @@ 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";
7
6
  import { FormField } from "../../FormField/FormField.js";
8
7
  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";
12
8
  import { TimePickerInput } from "../shared/TimePickerInput.js";
13
- import { c } from "react/compiler-runtime";
14
9
  import { jsx, jsxs } from "react/jsx-runtime";
15
10
  import { clsx } from "clsx";
16
11
  import { useEffect, useRef, useState } from "react";
17
12
  import { useLocale, useTimeField } from "react-aria";
18
13
  import { mergeRefs } from "@react-aria/utils";
19
- import { Controller, useWatch } from "react-hook-form";
14
+ import { Controller } from "react-hook-form";
20
15
  import { getLocalTimeZone, now, toTime } from "@internationalized/date";
21
16
  import { DateTime } from "luxon";
22
17
  import { useTimeFieldState } from "react-stately";
23
18
  //#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
24
19
  var TimePickerBase = (props) => {
25
- const $ = c(129);
26
20
  const ui = UIConfig.useConfig();
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;
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
+ };
146
35
  const [isOpen, setIsOpen] = useState(false);
147
36
  const initialDateEmitRef = useRef(true);
148
37
  const { locale } = useLocale();
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);
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]);
225
57
  const timeFieldRef = useRef(null);
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, {
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, {
384
91
  ...formFieldProps,
385
92
  as,
386
93
  labelProps,
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;
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
+ });
415
127
  };
416
- var TimePicker = ({ renderStaticInput, ...props }) => {
417
- const ui = UIConfig.useConfig();
128
+ var TimePicker = (props) => {
418
129
  let effectiveTimeZone = getLocalTimeZone();
419
130
  if (props.timeZone) effectiveTimeZone = props.timeZone;
420
- const { locale } = useLocale();
421
- const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
422
- const inputRef = useRef(null);
423
- const { renderRealInput } = useStaticInputHandoff({
424
- inputRef,
425
- renderInput,
426
- setRenderInput,
427
- getFocusTarget: (input) => input.querySelector("input, button, [tabindex]:not([tabindex='-1'])")
428
- });
429
- const watchedValue = "formControl" in props && props.formControl ? useWatch({
430
- control: props.formControl.control,
431
- name: props.formControl.name
432
- }) : props.value;
433
- let isFormControlDisabled = false;
434
- if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
435
- const rawValue = watchedValue ?? props.value ?? null;
436
131
  const formatTimeValue = (timeValue) => {
437
132
  if (timeValue === null) return null;
438
133
  let parsedDate;
@@ -446,55 +141,17 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
446
141
  if (isoString == null) return isoString;
447
142
  return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, effectiveTimeZone));
448
143
  };
449
- if (!renderInput) {
450
- const timeValue_0 = rawValue ? parseTimeValue(rawValue) : null;
451
- const as = props.as ?? ui.input.as;
452
- const isDisabled = isFormControlDisabled || !!props.isDisabled;
453
- const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
454
- const showDropdown = !props.disableDropdown || disableManualEntry;
455
- const staticSegments = getStaticTimeSegments({
456
- value: timeValue_0,
457
- locale,
458
- isDisabled,
459
- hidePlaceholder: as === "floating" && !timeValue_0
460
- });
461
- return /* @__PURE__ */ jsx(InputFrame, {
462
- ...props,
463
- isDisabled,
464
- className: clsx("relative inline-flex w-full flex-col text-left", props.className),
465
- inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
466
- contentClassName: "pr-0!",
467
- labelPlacement: "content-row",
468
- dataAttributes: {
469
- dataIsEmpty: timeValue_0 === null,
470
- dataIsFilled: timeValue_0 !== null,
471
- dataIsDirty: props.isDirty,
472
- dataIsRequired: props.isRequired,
473
- dataIsDisabled: isDisabled,
474
- dataDisabled: isDisabled,
475
- dataInvalid: !!props.error,
476
- dataHasSelection: timeValue_0 !== null
477
- },
478
- renderStatic: true,
479
- onStaticInteract: renderRealInput,
480
- wrapContentAndTrailing: true,
481
- trailingClassName: "py-0! pl-0!",
482
- trailingContent: showDropdown ? ui.dateInput.timeIcon : void 0,
483
- children: staticSegments
484
- });
485
- }
486
144
  if ("formControl" in props && props.formControl) {
487
145
  const { formControl, ref, ...innerProps } = props;
488
146
  return /* @__PURE__ */ jsx(Controller, {
489
147
  control: formControl.control,
490
148
  name: formControl.name,
491
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(TimePickerBase, {
149
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(TimePickerBase, {
492
150
  ...innerProps,
493
- ref: mergeRefs(ref, field.ref, inputRef),
151
+ ref: mergeRefs(ref, field.ref),
494
152
  value: parseTimeValue(field.value),
495
153
  onChange: (value) => field.onChange(formatTimeValue(value)),
496
154
  onBlur: field.onBlur,
497
- isDirty,
498
155
  isDisabled: field.disabled || props.isDisabled,
499
156
  error: props.error ?? error?.message
500
157
  })
@@ -502,9 +159,8 @@ var TimePicker = ({ renderStaticInput, ...props }) => {
502
159
  }
503
160
  return /* @__PURE__ */ jsx(TimePickerBase, {
504
161
  ...props,
505
- ref: mergeRefs(props.ref, inputRef),
506
162
  value: parseTimeValue(props.value),
507
- onChange: (value_0) => props.onChange?.(formatTimeValue(value_0))
163
+ onChange: (value) => props.onChange?.(formatTimeValue(value))
508
164
  });
509
165
  };
510
166
  //#endregion
@@ -1,6 +1,5 @@
1
1
  import { CalendarDate } from '@internationalized/date';
2
2
  import { CalendarState, CalendarStateOptions } from '@react-stately/calendar';
3
- import { DateValue } from 'react-aria';
4
3
  import { DatePickerState } from 'react-stately';
5
4
  type DateTimeCalendarProps = {
6
5
  includesTime?: false;
@@ -15,14 +14,12 @@ type CalendarProps = DateTimeCalendarProps & {
15
14
  className?: string;
16
15
  state: CalendarState;
17
16
  calendarProps: Omit<CalendarStateOptions, "locale" | "createCalendar">;
18
- onApply: (selectedDate?: DateValue) => void;
19
- onDateSelectionChange?: (selectedDate: DateValue) => void;
20
- setDateValueOnDateSelection?: boolean;
17
+ onApply: () => void;
21
18
  onMonthYearChange?: (selectedDate: CalendarDate) => void;
22
19
  onMonthYearCommit?: () => void;
23
20
  selectedDate?: CalendarDate | null;
24
21
  granularity?: "day" | "month" | "year";
25
22
  };
26
23
  export type ToggleState = "month" | "year" | "time";
27
- export declare const Calendar: ({ className, includesTime, datePickerState, hourCycle, onApply, onMonthYearChange, onMonthYearCommit, selectedDate, granularity, setDateValueOnDateSelection, onDateSelectionChange, ...props }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const Calendar: ({ className, includesTime, datePickerState, hourCycle, onApply, onMonthYearChange, onMonthYearCommit, selectedDate, granularity, ...props }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
28
25
  export {};