@povio/ui 3.1.1 → 3.2.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 (296) 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 +102 -39
  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 +5 -2
  62. package/dist/components/inputs/Checkbox/Checkbox.js +216 -36
  63. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  64. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +23 -0
  65. package/dist/components/inputs/Checkbox/CheckboxGroup.js +363 -0
  66. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +65 -0
  67. package/dist/components/inputs/Checkbox/checkbox.cva.js +104 -1
  68. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
  69. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +381 -76
  70. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
  71. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +500 -187
  72. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
  73. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +281 -47
  74. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
  75. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +617 -122
  76. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
  77. package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
  78. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
  79. package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
  80. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
  81. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
  82. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
  83. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  84. package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
  85. package/dist/components/inputs/DateTime/shared/DateField.js +303 -113
  86. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
  87. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +361 -131
  88. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
  89. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
  90. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
  91. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  92. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  93. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  94. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  95. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  96. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
  97. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +212 -66
  98. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  99. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
  100. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
  101. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
  102. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
  103. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
  104. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
  105. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
  106. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
  107. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
  108. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
  109. package/dist/components/inputs/File/FileUpload.js +87 -44
  110. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  111. package/dist/components/inputs/File/InputUpload.js +317 -79
  112. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  113. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  114. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  115. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  116. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  117. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  118. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  119. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
  120. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  121. package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
  122. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  123. package/dist/components/inputs/FormField/FormField.js +119 -37
  124. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  125. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  126. package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
  127. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  128. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  129. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  130. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  131. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
  132. package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
  133. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
  134. package/dist/components/inputs/Input/NumberInput/NumberInput.js +447 -98
  135. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
  136. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
  137. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
  138. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
  139. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  140. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
  141. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
  142. package/dist/components/inputs/Input/TextArea/TextArea.js +307 -92
  143. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
  144. package/dist/components/inputs/Input/TextInput/TextInput.js +430 -91
  145. package/dist/components/inputs/Input/shared/InputContent.js +193 -59
  146. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
  147. package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
  148. package/dist/components/inputs/Inputs/Form.js +40 -11
  149. package/dist/components/inputs/Inputs/InputItem.d.ts +16 -21
  150. package/dist/components/inputs/Inputs/InputItem.js +71 -14
  151. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  152. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
  153. package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
  154. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
  155. package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
  156. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
  157. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
  158. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
  159. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
  160. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
  161. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
  162. package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
  163. package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
  164. package/dist/components/inputs/Selection/Select/Select.js +227 -18
  165. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
  166. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
  167. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  168. package/dist/components/inputs/Selection/shared/SelectDesktop.js +394 -139
  169. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  170. package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
  171. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  172. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  173. package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
  174. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  175. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  176. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  177. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  178. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  179. package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
  180. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  181. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  182. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
  183. package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
  184. package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
  185. package/dist/components/inputs/Selection/shared/select.context.js +67 -36
  186. package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
  187. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
  188. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
  189. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
  190. package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
  191. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
  192. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
  193. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
  194. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  195. package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
  196. package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
  197. package/dist/components/inputs/Slider/Slider.d.ts +2 -1
  198. package/dist/components/inputs/Slider/Slider.js +265 -76
  199. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
  200. package/dist/components/inputs/TextEditor/TextEditor.js +448 -99
  201. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  202. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  203. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  204. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  205. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  206. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  207. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  208. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  209. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  210. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  211. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
  212. package/dist/components/inputs/Toggle/Toggle.js +214 -37
  213. package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
  214. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  215. package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
  216. package/dist/components/inputs/shared/CheckContent.js +21 -11
  217. package/dist/components/inputs/shared/InputClear.d.ts +2 -1
  218. package/dist/components/inputs/shared/InputClear.js +88 -12
  219. package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
  220. package/dist/components/inputs/shared/input.cva.d.ts +28 -0
  221. package/dist/components/inputs/shared/input.cva.js +38 -4
  222. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
  223. package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
  224. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
  225. package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
  226. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  227. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  228. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  229. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  230. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  231. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  232. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  233. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  234. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  235. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
  236. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  237. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  238. package/dist/components/segment/Segment.js +218 -57
  239. package/dist/components/segment/SegmentItem.js +67 -10
  240. package/dist/components/shared/pagination/Pagination.js +108 -22
  241. package/dist/components/shared/pagination/PaginationList.js +167 -64
  242. package/dist/components/status/Alert/Alert.js +97 -30
  243. package/dist/components/status/Loader/Loader.js +77 -22
  244. package/dist/components/status/Toast/Toast.js +28 -14
  245. package/dist/components/status/Toast/useToast.js +62 -57
  246. package/dist/components/table/ColumnConfig.js +158 -54
  247. package/dist/components/table/InfiniteTable.js +67 -16
  248. package/dist/components/table/PaginatedTable.js +84 -18
  249. package/dist/components/table/Table.js +28 -27
  250. package/dist/components/text/Link/Link.js +19 -7
  251. package/dist/components/text/Typography/Typography.js +23 -8
  252. package/dist/config/confirmation.context.js +1 -1
  253. package/dist/config/link.context.js +23 -9
  254. package/dist/config/router.context.js +42 -16
  255. package/dist/config/theme.context.js +98 -45
  256. package/dist/config/uiConfig.context.d.ts +20 -6
  257. package/dist/config/uiConfig.context.js +68 -14
  258. package/dist/config/uiOverrides.context.d.ts +22 -0
  259. package/dist/config/uiOverrides.context.js +54 -14
  260. package/dist/helpers/dynamicInputs.d.ts +12 -9
  261. package/dist/helpers/dynamicInputs.js +13 -8
  262. package/dist/hooks/useAutosave.d.ts +2 -1
  263. package/dist/hooks/useAutosave.js +12 -4
  264. package/dist/hooks/useAutosave.spec.d.ts +1 -0
  265. package/dist/hooks/useBreakpoint.js +16 -3
  266. package/dist/hooks/useDebounceCallback.js +51 -17
  267. package/dist/hooks/useFilters.js +125 -64
  268. package/dist/hooks/useForm.js +42 -8
  269. package/dist/hooks/useFormAutosave.d.ts +3 -1
  270. package/dist/hooks/useFormAutosave.js +122 -30
  271. package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
  272. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  273. package/dist/hooks/useIntersectionObserver.js +91 -24
  274. package/dist/hooks/useKeyInteractions.d.ts +20 -0
  275. package/dist/hooks/useKeyInteractions.js +54 -0
  276. package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
  277. package/dist/hooks/useLocalStorage.js +43 -10
  278. package/dist/hooks/useLongPressRepeat.js +55 -20
  279. package/dist/hooks/usePagination.js +49 -19
  280. package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
  281. package/dist/hooks/useQueryAutocomplete.js +72 -0
  282. package/dist/hooks/useScrollableListBox.js +37 -16
  283. package/dist/hooks/useSorting.js +69 -28
  284. package/dist/hooks/useStateAndRef.js +21 -7
  285. package/dist/hooks/useTableColumnConfig.js +124 -31
  286. package/dist/hooks/useTranslationMemo.js +25 -5
  287. package/dist/index.d.ts +20 -3
  288. package/dist/index.js +19 -8
  289. package/dist/tw-ui-plugin.js +8 -0
  290. package/dist/utils/date-time.utils.d.ts +38 -10
  291. package/dist/utils/date-time.utils.js +136 -22
  292. package/dist/utils/query.utils.d.ts +4 -0
  293. package/dist/utils/query.utils.js +8 -0
  294. package/dist/utils/zod.utils.d.ts +2 -0
  295. package/dist/utils/zod.utils.js +5 -0
  296. package/package.json +5 -5
@@ -1,14 +1,22 @@
1
+ import { UIOverrides } from "../../../../config/uiOverrides.context.js";
1
2
  import { UIConfig } from "../../../../config/uiConfig.context.js";
3
+ import { FormField } from "../../FormField/FormField.js";
2
4
  import { Calendar } from "../shared/Calendar.js";
3
5
  import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
6
+ import { datePickerInputContentRowDefinition } from "../shared/datePickerInput.cva.js";
7
+ import { renderDatePickerTodayIcon } from "../shared/datePickerTodayIcon.js";
4
8
  import { DatePickerInput } from "../shared/DatePickerInput.js";
5
9
  import { DateTimeDialog } from "../shared/DateTimeDialog.js";
6
10
  import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
7
- import { FormField } from "../../FormField/FormField.js";
11
+ import { getStaticCalendarDateSegments, getStaticDateTimeFocusTarget } from "../shared/staticDateTimeSegments.js";
8
12
  import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
13
+ import { InputFrame } from "../../Skeleton/InputFrame.js";
14
+ import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
15
+ import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
16
+ import { c } from "react/compiler-runtime";
9
17
  import { jsx, jsxs } from "react/jsx-runtime";
10
18
  import { clsx } from "clsx";
11
- import { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from "react";
19
+ import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
12
20
  import { useDatePicker, useLocale } from "react-aria";
13
21
  import { mergeRefs } from "@react-aria/utils";
14
22
  import { Controller } from "react-hook-form";
@@ -18,7 +26,25 @@ import { useCalendarState, useDatePickerState } from "react-stately";
18
26
  //#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
19
27
  var DatePickerBase = (props) => {
20
28
  const ui = UIConfig.useConfig();
21
- const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, className, placeholder, inputClassName, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, todayIcon = ui.dateInput.todayIcon, shouldForceLeadingZeros = ui.dateInput.shouldForceLeadingZeros, disableManualEntry = ui.dateInput.disableManualEntry, shouldUpdateDateOnMonthYearChange = ui.dateInput.shouldUpdateDateOnMonthYearChange, granularity = ui.dateInput.granularity, autoFixYear = ui.dateInput.autoFixYear, format, ...rest } = props;
29
+ const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconButtonComponent: todayIconButtonComponentProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp, fireBlurOnChange: fireBlurOnChangeProp, format, ...rest } = props;
30
+ const as = asProp ?? ui.input.as;
31
+ const hideLabel = hideLabelProp ?? ui.input.hideLabel;
32
+ const variant = variantProp ?? ui.input.variant;
33
+ const size = sizeProp ?? ui.input.size;
34
+ const isClearable = isClearableProp ?? ui.input.isClearable;
35
+ const todayIcon = todayIconProp ?? ui.dateInput.todayIcon;
36
+ const todayIconButtonSize = todayIconButtonSizeProp ?? ui.dateInput.todayIconButtonSize;
37
+ const todayIconButtonComponent = todayIconButtonComponentProp ?? ui.dateInput.todayIconButtonComponent;
38
+ const todayIconPlacement = todayIconPlacementProp ?? ui.dateInput.todayIconPlacement;
39
+ const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
40
+ const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
41
+ const shouldUpdateDateOnMonthYearChange = shouldUpdateDateOnMonthYearChangeProp ?? ui.dateInput.shouldUpdateDateOnMonthYearChange;
42
+ const granularity = granularityProp ?? ui.dateInput.granularity;
43
+ const autoFixYear = autoFixYearProp ?? ui.dateInput.autoFixYear;
44
+ const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
45
+ const timeZone = ui.dateInput.timeZone;
46
+ let effectiveTimeZone = getLocalTimeZone();
47
+ if (timeZone !== "clientLocal") effectiveTimeZone = timeZone;
22
48
  const normalizeByGranularity = useCallback((date) => {
23
49
  if (granularity === "year") return date.set({
24
50
  month: 1,
@@ -44,33 +70,42 @@ var DatePickerBase = (props) => {
44
70
  const datePickerRef = useMemo(() => ({ get current() {
45
71
  return datePickerInputRef.current?.getContainer?.() || null;
46
72
  } }), []);
47
- useImperativeHandle(ref, () => ({ clear: () => {
48
- datePickerInputRef.current?.clear();
49
- } }));
73
+ useImperativeHandle(ref, () => ({
74
+ clear: () => {
75
+ datePickerInputRef.current?.clear();
76
+ },
77
+ getContainer: () => datePickerInputRef.current?.getContainer?.() ?? null
78
+ }));
79
+ const handleBlur = (val) => {
80
+ onBlur?.({ target: { value: val } });
81
+ };
82
+ const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
83
+ const normalizedValue = value ?? null;
50
84
  const dialogState = useDatePickerState({
51
85
  ...rest,
52
- defaultValue: value || rest.defaultValue,
86
+ defaultValue: normalizedValue ?? rest.defaultValue ?? null,
53
87
  shouldCloseOnSelect: false,
54
88
  shouldForceLeadingZeros
55
89
  });
56
90
  const state = useDatePickerState({
57
91
  ...rest,
58
92
  shouldForceLeadingZeros,
59
- value,
60
- onChange: (val) => {
61
- let normalizedValue = val;
62
- if (val) normalizedValue = normalizeByGranularity(val);
63
- if (normalizedValue && (rest.minValue && normalizedValue < rest?.minValue || rest?.maxValue && normalizedValue > rest?.maxValue)) {
93
+ value: normalizedValue,
94
+ onChange: (val_0) => {
95
+ let normalizedValue_0 = val_0;
96
+ if (val_0) normalizedValue_0 = normalizeByGranularity(val_0);
97
+ if (normalizedValue_0 && (rest.minValue && normalizedValue_0 < rest?.minValue || rest?.maxValue && normalizedValue_0 > rest?.maxValue)) {
64
98
  state.setValue(state.value);
65
99
  return;
66
100
  }
67
- onChange?.(normalizedValue);
68
- dialogState.setValue(normalizedValue);
69
- if (normalizedValue) {
70
- calendarState.setFocusedDate(normalizedValue);
101
+ onChange?.(normalizedValue_0);
102
+ dialogState.setValue(normalizedValue_0);
103
+ if (fireBlurOnChange) debouncedBlur(normalizedValue_0);
104
+ if (normalizedValue_0) {
105
+ calendarState.setFocusedDate(normalizedValue_0);
71
106
  return;
72
107
  }
73
- calendarState.setFocusedDate(today(getLocalTimeZone()));
108
+ calendarState.setFocusedDate(today(effectiveTimeZone));
74
109
  },
75
110
  shouldCloseOnSelect: false
76
111
  });
@@ -102,13 +137,14 @@ var DatePickerBase = (props) => {
102
137
  labelProps
103
138
  };
104
139
  const onApply = () => {
105
- if (dialogState.value) state.setValue(normalizeByGranularity(dialogState.value));
106
- if (!dialogState.value) state.setValue(dialogState.value);
140
+ const newValue = dialogState.value ? normalizeByGranularity(dialogState.value) : dialogState.value;
141
+ state.setValue(newValue);
107
142
  state.toggle();
143
+ if (fireBlurOnChange) handleBlur(newValue);
108
144
  };
109
145
  const onMonthYearChange = (selectedDate) => {
110
146
  if (!(shouldUpdateDateOnMonthYearChange || granularity !== "day")) return;
111
- const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(getLocalTimeZone())).set({
147
+ const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(effectiveTimeZone)).set({
112
148
  year: selectedDate.year,
113
149
  month: selectedDate.month
114
150
  }));
@@ -119,15 +155,20 @@ var DatePickerBase = (props) => {
119
155
  onApply();
120
156
  };
121
157
  const onTodayPress = () => {
122
- const todayValue = normalizeByGranularity(today(getLocalTimeZone()));
158
+ const todayValue = normalizeByGranularity(today(effectiveTimeZone));
123
159
  dialogState.setValue(todayValue);
124
160
  calendarState.setFocusedDate(todayValue);
125
161
  };
162
+ const onInputClear = () => {
163
+ onChange?.(null);
164
+ dialogState.setValue(null);
165
+ if (fireBlurOnChange) handleBlur(null);
166
+ };
126
167
  useEffect(() => {
127
168
  if (!state.isOpen) return;
128
169
  if (granularity !== "year") return;
129
170
  if (dialogState.value) return;
130
- const defaultYearValue = normalizeByGranularity(today(getLocalTimeZone()));
171
+ const defaultYearValue = normalizeByGranularity(today(effectiveTimeZone));
131
172
  dialogState.setValue(defaultYearValue);
132
173
  calendarState.setFocusedDate(defaultYearValue);
133
174
  }, [
@@ -136,12 +177,13 @@ var DatePickerBase = (props) => {
136
177
  dialogState.value,
137
178
  dialogState,
138
179
  calendarState,
139
- normalizeByGranularity
180
+ normalizeByGranularity,
181
+ effectiveTimeZone
140
182
  ]);
141
183
  const onOpenChange = (isOpen) => {
142
184
  state.toggle();
143
185
  if (state.value) calendarState.setFocusedDate(normalizeByGranularity(state.value));
144
- if (!state.value) calendarState.setFocusedDate(today(getLocalTimeZone()));
186
+ if (!state.value) calendarState.setFocusedDate(today(effectiveTimeZone));
145
187
  if (!isOpen) dialogState.setValue(state.value);
146
188
  };
147
189
  return /* @__PURE__ */ jsx(TooltipWrapper, {
@@ -158,11 +200,21 @@ var DatePickerBase = (props) => {
158
200
  ref: mergeRefs(ref, datePickerInputRef),
159
201
  as,
160
202
  groupProps,
161
- fieldProps,
203
+ fieldProps: {
204
+ ...fieldProps,
205
+ onBlur: (event) => {
206
+ fieldProps.onBlur?.(event);
207
+ handleBlur(state.value);
208
+ }
209
+ },
210
+ fieldValue: normalizedValue,
211
+ isValueControlled: true,
212
+ hasValue: normalizedValue != null,
162
213
  buttonProps,
163
214
  isDirty,
164
215
  isDisabled,
165
216
  disableManualEntry,
217
+ autoFixYear,
166
218
  isInvalid: !!error,
167
219
  disableDropdown,
168
220
  variant,
@@ -170,13 +222,18 @@ var DatePickerBase = (props) => {
170
222
  isClearable,
171
223
  headerProps,
172
224
  todayIcon,
225
+ todayIconButtonSize,
226
+ todayIconButtonComponent,
227
+ todayIconPlacement,
173
228
  onOpenDropdown: () => state.toggle(),
174
229
  placeholder,
175
230
  className: inputClassName,
176
231
  dateGranularity: granularity,
177
- autoFixYear,
178
- format
179
- }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
232
+ format,
233
+ timeZone: effectiveTimeZone,
234
+ fireBlurOnChange,
235
+ onClear: onInputClear
236
+ }), (!disableDropdown || disableManualEntry) && state.isOpen && /* @__PURE__ */ jsx(DateTimeDialog, {
180
237
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
181
238
  isDisabled,
182
239
  isValid: !dialogState.isInvalid && !!dialogState.value,
@@ -201,57 +258,305 @@ var DatePickerBase = (props) => {
201
258
  })
202
259
  });
203
260
  };
204
- var DatePicker = ({ fullIso = true, granularity = "day", minValue, maxValue, ...props }) => {
205
- const normalizeByGranularity = (date) => {
206
- if (granularity === "year") return date.set({
207
- month: 1,
208
- day: 1
261
+ var DatePickerInner = (t0) => {
262
+ const $ = c(28);
263
+ const { fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, isFormControlDisabled, ...props } = t0;
264
+ const fullIso = t1 === void 0 ? true : t1;
265
+ const granularity = t2 === void 0 ? "day" : t2;
266
+ const ui = UIConfig.useConfig();
267
+ const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
268
+ const { locale } = useLocale();
269
+ const shouldForceLeadingZeros = props.shouldForceLeadingZeros ?? ui.dateInput.shouldForceLeadingZeros;
270
+ const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
271
+ const inputRef = useRef(null);
272
+ const { renderRealInput, replayStaticInputPress } = useStaticInputHandoff({
273
+ inputRef,
274
+ renderInput,
275
+ setRenderInput,
276
+ getFocusTarget: _temp,
277
+ getPressTarget: _temp2
278
+ });
279
+ const normalizedValue = props.value ?? null;
280
+ let t3;
281
+ if ($[0] !== granularity) {
282
+ t3 = (date) => {
283
+ if (granularity === "year") return date.set({
284
+ month: 1,
285
+ day: 1
286
+ });
287
+ if (granularity === "month") return date.set({ day: 1 });
288
+ return date;
289
+ };
290
+ $[0] = granularity;
291
+ $[1] = t3;
292
+ } else t3 = $[1];
293
+ const normalizeByGranularity = t3;
294
+ let t4;
295
+ if ($[2] !== fullIso || $[3] !== normalizeByGranularity) {
296
+ t4 = (calendarDate) => {
297
+ if (calendarDate === null) return null;
298
+ const normalizedDate = normalizeByGranularity(calendarDate);
299
+ if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
300
+ const date_0 = DateTimeUtils.fromDateValueToLocal(normalizedDate, "UTC");
301
+ return DateTime.fromJSDate(date_0, { zone: "UTC" }).toISODate();
302
+ };
303
+ $[2] = fullIso;
304
+ $[3] = normalizeByGranularity;
305
+ $[4] = t4;
306
+ } else t4 = $[4];
307
+ const formatCalendarDate = t4;
308
+ let t5;
309
+ if ($[5] !== fullIso || $[6] !== normalizeByGranularity) {
310
+ t5 = (formattedDate) => {
311
+ if (formattedDate == null) return null;
312
+ if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
313
+ const date_1 = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
314
+ return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1, "UTC")));
315
+ };
316
+ $[5] = fullIso;
317
+ $[6] = normalizeByGranularity;
318
+ $[7] = t5;
319
+ } else t5 = $[7];
320
+ const parseCalendarDate = t5;
321
+ let t6;
322
+ if ($[8] !== minValue || $[9] !== parseCalendarDate) {
323
+ t6 = typeof minValue === "string" ? parseCalendarDate(minValue) : minValue;
324
+ $[8] = minValue;
325
+ $[9] = parseCalendarDate;
326
+ $[10] = t6;
327
+ } else t6 = $[10];
328
+ let t7;
329
+ if ($[11] !== maxValue || $[12] !== parseCalendarDate) {
330
+ t7 = typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue;
331
+ $[11] = maxValue;
332
+ $[12] = parseCalendarDate;
333
+ $[13] = t7;
334
+ } else t7 = $[13];
335
+ let t8;
336
+ if ($[14] !== t6 || $[15] !== t7) {
337
+ t8 = {
338
+ minValue: t6,
339
+ maxValue: t7
340
+ };
341
+ $[14] = t6;
342
+ $[15] = t7;
343
+ $[16] = t8;
344
+ } else t8 = $[16];
345
+ const dateLimits = t8;
346
+ if (!renderInput) {
347
+ const dateValue = normalizedValue ? parseCalendarDate(normalizedValue) : null;
348
+ const as = props.as ?? ui.input.as;
349
+ const size = props.size ?? ui.input.size;
350
+ const isDisabled = isFormControlDisabled || !!props.isDisabled;
351
+ const todayIcon = props.todayIcon ?? ui.dateInput.todayIcon;
352
+ const todayIconButtonSize = props.todayIconButtonSize ?? ui.dateInput.todayIconButtonSize;
353
+ const todayIconButtonComponent = props.todayIconButtonComponent ?? ui.dateInput.todayIconButtonComponent;
354
+ const todayIconPlacement = props.todayIconPlacement ?? ui.dateInput.todayIconPlacement;
355
+ const staticTodayIcon = renderDatePickerTodayIcon(todayIcon, {
356
+ isDisabled,
357
+ renderStatic: true,
358
+ size: todayIconButtonSize,
359
+ todayIconButtonComponent
209
360
  });
210
- if (granularity === "month") return date.set({ day: 1 });
211
- return date;
212
- };
213
- const formatCalendarDate = (calendarDate) => {
214
- if (calendarDate === null) return null;
215
- const normalizedDate = normalizeByGranularity(calendarDate);
216
- if (fullIso) return DateTimeUtils.fromCalendarDateToUTCISO(normalizedDate);
217
- const date = DateTimeUtils.fromDateValueToLocal(normalizedDate);
218
- return DateTime.fromJSDate(date).toISODate();
219
- };
220
- const parseCalendarDate = (formattedDate) => {
221
- if (formattedDate == null) return formattedDate;
222
- if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
223
- const date = DateTime.fromISO(formattedDate).toJSDate();
224
- return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date)));
225
- };
226
- const dateLimits = {
227
- minValue: typeof minValue === "string" ? parseCalendarDate(minValue) : minValue,
228
- maxValue: typeof maxValue === "string" ? parseCalendarDate(maxValue) : maxValue
229
- };
230
- if ("formControl" in props && props.formControl) {
231
- const { formControl, ref, ...innerProps } = props;
232
- return /* @__PURE__ */ jsx(Controller, {
233
- control: formControl.control,
234
- name: formControl.name,
235
- render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DatePickerBase, {
236
- ...innerProps,
237
- ...dateLimits,
238
- ref: mergeRefs(ref, field.ref),
239
- value: parseCalendarDate(field.value),
240
- onChange: (value) => field.onChange(formatCalendarDate(value)),
241
- onBlur: field.onBlur,
242
- isDirty,
243
- isDisabled: field.disabled || props.isDisabled,
244
- error: props.error ?? error?.message
245
- })
361
+ const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
362
+ const showDropdown = !props.disableDropdown || disableManualEntry;
363
+ const staticSegments = getStaticCalendarDateSegments({
364
+ value: dateValue,
365
+ locale,
366
+ shouldForceLeadingZeros,
367
+ isDisabled,
368
+ hidePlaceholder: as === "floating" && !dateValue,
369
+ disableManualEntry,
370
+ placeholder: props.placeholder,
371
+ dateGranularity: granularity
372
+ });
373
+ return /* @__PURE__ */ jsx(InputFrame, {
374
+ ...props,
375
+ isDisabled,
376
+ className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
377
+ inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
378
+ contentClassName: "pr-0!",
379
+ contentWrapperClassName: datePickerInputContentRowCva({ size }),
380
+ contentGroup: "date-picker",
381
+ labelPlacement: "content-row",
382
+ dataAttributes: {
383
+ dataIsEmpty: dateValue == null,
384
+ dataIsFilled: dateValue != null,
385
+ dataIsDirty: props.isDirty,
386
+ dataIsRequired: props.isRequired,
387
+ dataIsDisabled: isDisabled,
388
+ dataDisabled: isDisabled,
389
+ dataInvalid: !!props.error,
390
+ dataHasSelection: dateValue != null
391
+ },
392
+ onStaticInteract: renderRealInput,
393
+ onStaticPress: replayStaticInputPress,
394
+ staticPressTarget: "action",
395
+ actionContent: staticTodayIcon,
396
+ actionContentPlacement: todayIconPlacement === "fieldLabel" ? "content-row" : "content-wrapper",
397
+ showClear: dateValue != null,
398
+ wrapContentAndTrailing: true,
399
+ contentAndTrailingClassName: "gap-2!",
400
+ trailingClassName: "py-0! pl-0!",
401
+ action: showDropdown ? {
402
+ icon: ui.dateInput.calendarIcon,
403
+ onClick: _temp3,
404
+ altText: ""
405
+ } : void 0,
406
+ children: staticSegments
246
407
  });
247
408
  }
248
- return /* @__PURE__ */ jsx(DatePickerBase, {
249
- ...props,
250
- ...dateLimits,
251
- granularity,
252
- value: parseCalendarDate(props.value),
253
- onChange: (value) => props.onChange?.(formatCalendarDate(value))
254
- });
409
+ const T0 = DatePickerBase;
410
+ const t9 = mergeRefs(props.ref, inputRef);
411
+ const t10 = parseCalendarDate(normalizedValue);
412
+ let t11;
413
+ if ($[17] !== formatCalendarDate || $[18] !== props) {
414
+ t11 = (value) => props.onChange?.(formatCalendarDate(value));
415
+ $[17] = formatCalendarDate;
416
+ $[18] = props;
417
+ $[19] = t11;
418
+ } else t11 = $[19];
419
+ let t12;
420
+ if ($[20] !== T0 || $[21] !== dateLimits || $[22] !== granularity || $[23] !== props || $[24] !== t10 || $[25] !== t11 || $[26] !== t9) {
421
+ t12 = /* @__PURE__ */ jsx(T0, {
422
+ ...props,
423
+ ...dateLimits,
424
+ ref: t9,
425
+ granularity,
426
+ value: t10,
427
+ onChange: t11
428
+ });
429
+ $[20] = T0;
430
+ $[21] = dateLimits;
431
+ $[22] = granularity;
432
+ $[23] = props;
433
+ $[24] = t10;
434
+ $[25] = t11;
435
+ $[26] = t9;
436
+ $[27] = t12;
437
+ } else t12 = $[27];
438
+ return t12;
439
+ };
440
+ var DatePicker = (t0) => {
441
+ const $ = c(33);
442
+ let maxValue;
443
+ let minValue;
444
+ let props;
445
+ let renderStaticInput;
446
+ let t1;
447
+ let t2;
448
+ if ($[0] !== t0) {
449
+ ({fullIso: t1, granularity: t2, minValue, maxValue, renderStaticInput, ...props} = t0);
450
+ $[0] = t0;
451
+ $[1] = maxValue;
452
+ $[2] = minValue;
453
+ $[3] = props;
454
+ $[4] = renderStaticInput;
455
+ $[5] = t1;
456
+ $[6] = t2;
457
+ } else {
458
+ maxValue = $[1];
459
+ minValue = $[2];
460
+ props = $[3];
461
+ renderStaticInput = $[4];
462
+ t1 = $[5];
463
+ t2 = $[6];
464
+ }
465
+ const fullIso = t1 === void 0 ? true : t1;
466
+ const granularity = t2 === void 0 ? "day" : t2;
467
+ if ("formControl" in props && props.formControl) {
468
+ let formControl;
469
+ let innerProps;
470
+ let ref;
471
+ if ($[7] !== props) {
472
+ ({formControl, ref, ...innerProps} = props);
473
+ $[7] = props;
474
+ $[8] = formControl;
475
+ $[9] = innerProps;
476
+ $[10] = ref;
477
+ } else {
478
+ formControl = $[8];
479
+ innerProps = $[9];
480
+ ref = $[10];
481
+ }
482
+ const controlWithOptions = formControl.control;
483
+ let t3;
484
+ if ($[11] !== controlWithOptions._options?.disabled || $[12] !== fullIso || $[13] !== granularity || $[14] !== innerProps || $[15] !== maxValue || $[16] !== minValue || $[17] !== props.error || $[18] !== props.isDisabled || $[19] !== ref || $[20] !== renderStaticInput) {
485
+ t3 = (t4) => {
486
+ const { field, fieldState: t5 } = t4;
487
+ const { error, isDirty } = t5;
488
+ return /* @__PURE__ */ jsx(DatePickerInner, {
489
+ ...innerProps,
490
+ ref: mergeRefs(ref, field.ref),
491
+ value: field.value ?? null,
492
+ onChange: field.onChange,
493
+ onBlur: field.onBlur,
494
+ isDirty,
495
+ isDisabled: field.disabled || props.isDisabled,
496
+ isFormControlDisabled: !!controlWithOptions._options?.disabled,
497
+ error: props.error ?? error?.message,
498
+ fullIso,
499
+ granularity,
500
+ minValue,
501
+ maxValue,
502
+ renderStaticInput
503
+ });
504
+ };
505
+ $[11] = controlWithOptions._options?.disabled;
506
+ $[12] = fullIso;
507
+ $[13] = granularity;
508
+ $[14] = innerProps;
509
+ $[15] = maxValue;
510
+ $[16] = minValue;
511
+ $[17] = props.error;
512
+ $[18] = props.isDisabled;
513
+ $[19] = ref;
514
+ $[20] = renderStaticInput;
515
+ $[21] = t3;
516
+ } else t3 = $[21];
517
+ let t4;
518
+ if ($[22] !== formControl.control || $[23] !== formControl.name || $[24] !== t3) {
519
+ t4 = /* @__PURE__ */ jsx(Controller, {
520
+ control: formControl.control,
521
+ name: formControl.name,
522
+ render: t3
523
+ });
524
+ $[22] = formControl.control;
525
+ $[23] = formControl.name;
526
+ $[24] = t3;
527
+ $[25] = t4;
528
+ } else t4 = $[25];
529
+ return t4;
530
+ }
531
+ let t3;
532
+ if ($[26] !== fullIso || $[27] !== granularity || $[28] !== maxValue || $[29] !== minValue || $[30] !== props || $[31] !== renderStaticInput) {
533
+ t3 = /* @__PURE__ */ jsx(DatePickerInner, {
534
+ ...props,
535
+ fullIso,
536
+ granularity,
537
+ minValue,
538
+ maxValue,
539
+ renderStaticInput
540
+ });
541
+ $[26] = fullIso;
542
+ $[27] = granularity;
543
+ $[28] = maxValue;
544
+ $[29] = minValue;
545
+ $[30] = props;
546
+ $[31] = renderStaticInput;
547
+ $[32] = t3;
548
+ } else t3 = $[32];
549
+ return t3;
255
550
  };
551
+ function _temp(input, staticTarget) {
552
+ const container = input.getContainer?.() ?? input;
553
+ return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
554
+ }
555
+ function _temp2(input_0) {
556
+ const container_0 = input_0.getContainer?.() ?? input_0;
557
+ if (!(container_0 instanceof HTMLElement)) return null;
558
+ return container_0.querySelector("[data-static-press-action]");
559
+ }
560
+ function _temp3() {}
256
561
  //#endregion
257
562
  export { DatePicker };
@@ -1,24 +1,30 @@
1
1
  import { CalendarDate } from '@internationalized/date';
2
- import { Ref } from 'react';
2
+ import { FocusEvent, Ref } from 'react';
3
3
  import { DateValue } from 'react-aria';
4
4
  import { FieldValues } from 'react-hook-form';
5
5
  import { DateRangePickerStateOptions } from 'react-stately';
6
6
  import { DatePickerInputHandle } from '../shared/DatePickerInput';
7
+ import { DatePickerTodayIcon, DatePickerTodayIconButtonComponent, DatePickerTodayIconButtonSize, DatePickerTodayIconPlacement } from '../shared/datePicker.types';
7
8
  import { FormFieldProps } from '../../FormField/FormField';
8
9
  import { ControlProps } from '../../shared/form.types';
9
10
  import { InputVariantProps } from '../../shared/input.cva';
10
- interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<DateRangePickerStateOptions<CalendarDate>, "granularity" | "shouldCloseOnSelect" | "label"> {
11
+ interface DateRangePickerBaseProps extends FormFieldProps, InputVariantProps, Omit<DateRangePickerStateOptions<CalendarDate>, "granularity" | "shouldCloseOnSelect" | "label" | "onBlur"> {
11
12
  ref?: Ref<DatePickerInputHandle & HTMLDivElement>;
12
13
  disableDropdown?: boolean;
13
14
  isClearable?: boolean;
14
15
  hideSidebar?: boolean;
15
16
  className?: string;
16
- todayIcon?: boolean;
17
+ todayIcon?: DatePickerTodayIcon;
18
+ todayIconButtonSize?: DatePickerTodayIconButtonSize;
19
+ todayIconButtonComponent?: DatePickerTodayIconButtonComponent;
20
+ todayIconPlacement?: DatePickerTodayIconPlacement;
17
21
  isDirty?: boolean;
18
22
  disableManualEntry?: boolean;
23
+ autoFixYear?: boolean;
19
24
  placeholder?: string;
20
25
  inputClassName?: string;
21
- autoFixYear?: boolean;
26
+ onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
27
+ fireBlurOnChange?: boolean;
22
28
  }
23
29
  export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "value" | "onChange" | "minValue" | "maxValue"> {
24
30
  value?: {
@@ -32,7 +38,8 @@ export interface DateRangePickerProps extends Omit<DateRangePickerBaseProps, "va
32
38
  fullIso?: boolean;
33
39
  minValue?: DateValue | string;
34
40
  maxValue?: DateValue | string;
41
+ renderStaticInput?: boolean;
35
42
  }
36
43
  export type ControlledDateRangePickerProps<TFieldValues extends FieldValues> = ControlProps<DateRangePickerProps, TFieldValues>;
37
- export declare const DateRangePicker: <TFieldValues extends FieldValues>({ fullIso, minValue, maxValue, ...props }: ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const DateRangePicker: <TFieldValues extends FieldValues>({ fullIso, minValue, maxValue, renderStaticInput, ...props }: ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
38
45
  export {};