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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
  61. package/dist/components/inputs/Checkbox/Checkbox.js +188 -34
  62. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  63. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -0
  64. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +267 -87
  65. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  66. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +347 -182
  67. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  68. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +177 -69
  69. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
  70. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +530 -157
  71. package/dist/components/inputs/DateTime/shared/Calendar.js +333 -137
  72. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
  73. package/dist/components/inputs/DateTime/shared/CalendarCell.js +301 -102
  74. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
  75. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +146 -33
  76. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  77. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  78. package/dist/components/inputs/DateTime/shared/DateField.js +295 -112
  79. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -1
  80. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +375 -146
  81. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  82. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  83. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  84. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  85. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  86. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  87. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  88. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +3 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +208 -70
  90. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  91. package/dist/components/inputs/File/FileUpload.js +86 -44
  92. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  93. package/dist/components/inputs/File/InputUpload.js +317 -79
  94. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  95. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  96. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  97. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  98. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  99. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  100. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  101. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  102. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  103. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  104. package/dist/components/inputs/FormField/FormField.js +119 -37
  105. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  106. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  107. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  108. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  109. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  110. package/dist/components/inputs/Input/NumberInput/NumberInput.js +392 -123
  111. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  112. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +463 -146
  113. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  114. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  115. package/dist/components/inputs/Input/TextInput/TextInput.js +370 -121
  116. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  117. package/dist/components/inputs/Inputs/Form.js +40 -11
  118. package/dist/components/inputs/Inputs/InputItem.d.ts +0 -1
  119. package/dist/components/inputs/Inputs/InputItem.js +65 -16
  120. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  121. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -0
  122. package/dist/components/inputs/RadioGroup/RadioGroup.js +333 -107
  123. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +145 -50
  124. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -2
  125. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  126. package/dist/components/inputs/Selection/Select/Select.js +139 -44
  127. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  128. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  129. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  130. package/dist/components/inputs/Selection/shared/SelectInput.js +326 -136
  131. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  132. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  133. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  134. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  135. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  136. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  137. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
  138. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
  139. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  140. package/dist/components/inputs/Selection/shared/select.context.js +44 -38
  141. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
  142. package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
  143. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  144. package/dist/components/inputs/Skeleton/InputFrame.d.ts +2 -0
  145. package/dist/components/inputs/Skeleton/InputFrame.js +444 -124
  146. package/dist/components/inputs/Slider/Slider.js +247 -74
  147. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  148. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  149. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  150. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  151. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  152. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  153. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  154. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  155. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  156. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  157. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  158. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
  159. package/dist/components/inputs/Toggle/Toggle.js +206 -41
  160. package/dist/components/inputs/shared/CheckContent.js +21 -10
  161. package/dist/components/inputs/shared/InputClear.js +78 -21
  162. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  163. package/dist/components/inputs/shared/input.cva.js +13 -3
  164. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +1 -0
  165. package/dist/components/inputs/shared/useStaticInputHandoff.js +87 -34
  166. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  167. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  168. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  169. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  170. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  171. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  172. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  173. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  174. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  175. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  176. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  177. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  178. package/dist/components/segment/Segment.js +218 -57
  179. package/dist/components/segment/SegmentItem.js +67 -10
  180. package/dist/components/shared/pagination/Pagination.js +108 -22
  181. package/dist/components/shared/pagination/PaginationList.js +167 -64
  182. package/dist/components/status/Alert/Alert.js +97 -30
  183. package/dist/components/status/Loader/Loader.js +77 -22
  184. package/dist/components/status/Toast/Toast.js +21 -13
  185. package/dist/components/status/Toast/useToast.js +62 -57
  186. package/dist/components/table/ColumnConfig.js +158 -54
  187. package/dist/components/table/InfiniteTable.js +67 -16
  188. package/dist/components/table/PaginatedTable.js +84 -18
  189. package/dist/components/table/Table.js +28 -27
  190. package/dist/components/text/Link/Link.js +19 -7
  191. package/dist/components/text/Typography/Typography.js +23 -8
  192. package/dist/config/confirmation.context.js +1 -1
  193. package/dist/config/link.context.js +23 -9
  194. package/dist/config/router.context.js +42 -16
  195. package/dist/config/theme.context.js +98 -45
  196. package/dist/config/uiConfig.context.d.ts +4 -4
  197. package/dist/config/uiConfig.context.js +50 -11
  198. package/dist/config/uiStyle.context.js +15 -5
  199. package/dist/helpers/dynamicInputs.d.ts +1 -1
  200. package/dist/hooks/useBreakpoint.js +16 -3
  201. package/dist/hooks/useDebounceCallback.js +51 -17
  202. package/dist/hooks/useFilters.js +125 -64
  203. package/dist/hooks/useForm.js +42 -8
  204. package/dist/hooks/useFormAutosave.js +101 -30
  205. package/dist/hooks/useIntersectionObserver.js +86 -32
  206. package/dist/hooks/useLocalStorage.js +43 -10
  207. package/dist/hooks/useLongPressRepeat.js +55 -20
  208. package/dist/hooks/usePagination.js +49 -19
  209. package/dist/hooks/useQueryAutocomplete.js +1 -0
  210. package/dist/hooks/useScrollableListBox.js +37 -16
  211. package/dist/hooks/useSorting.js +69 -28
  212. package/dist/hooks/useStateAndRef.js +21 -7
  213. package/dist/hooks/useTableColumnConfig.js +124 -31
  214. package/dist/hooks/useTranslationMemo.js +25 -5
  215. package/dist/index.js +2 -2
  216. package/dist/utils/date-time.utils.d.ts +2 -0
  217. package/dist/utils/date-time.utils.js +17 -13
  218. package/package.json +1 -1
@@ -2,182 +2,411 @@ import { UIStyle } from "../../../../config/uiStyle.context.js";
2
2
  import { Typography } from "../../../text/Typography/Typography.js";
3
3
  import { UIConfig } from "../../../../config/uiConfig.context.js";
4
4
  import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
5
+ import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
5
6
  import { DateField } from "./DateField.js";
6
7
  import { datePickerInputContentRow } from "./datePickerInput.cva.js";
7
8
  import { getDatePickerTodayIcon } from "./datePickerTodayIcon.js";
8
9
  import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
9
10
  import { InputClear } from "../../shared/InputClear.js";
10
11
  import { inputBase, inputSize } from "../../shared/input.cva.js";
12
+ import { c } from "react/compiler-runtime";
11
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
14
  import { clsx } from "clsx";
13
- import { useCallback, useImperativeHandle, useRef, useState } from "react";
15
+ import { useImperativeHandle, useRef, useState } from "react";
14
16
  import { Button } from "react-aria-components";
15
17
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
16
- import { getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
18
+ import { today } from "@internationalized/date";
17
19
  //#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
18
- var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone, isTimeOptional = false, format, ...props }) => {
20
+ var DatePickerInput = (t0) => {
21
+ const $ = c(106);
22
+ const { ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone, isTimeOptional: t5, format, fireBlurOnChange, onClear: onClearProp, ...props } = t0;
23
+ const todayIconButtonSize = t1 === void 0 ? "none" : t1;
24
+ const todayIconPlacement = t2 === void 0 ? "content" : t2;
25
+ const autoFixYear = t3 === void 0 ? false : t3;
26
+ const dateGranularity = t4 === void 0 ? "day" : t4;
27
+ const isTimeOptional = t5 === void 0 ? false : t5;
19
28
  const uiConfig = UIConfig.useConfig();
20
- let effectiveTimeZone = getLocalTimeZone();
21
- if (timeZone) effectiveTimeZone = timeZone;
29
+ const effectiveTimeZone = timeZone ?? "UTC";
22
30
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
23
31
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
24
32
  const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
25
33
  const [canClear, setCanClear] = useState(false);
26
- const { hoverProps, isHovered } = useHover({ isDisabled });
34
+ let t6;
35
+ if ($[0] !== isDisabled) {
36
+ t6 = { isDisabled };
37
+ $[0] = isDisabled;
38
+ $[1] = t6;
39
+ } else t6 = $[1];
40
+ const { hoverProps, isHovered } = useHover(t6);
27
41
  const [isFocused, setIsFocused] = useState(false);
28
- const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: (isFocusWithin) => {
29
- setIsFocused(isFocusWithin);
30
- if (!isFocusWithin && autoFixYear) {
31
- dateFieldRef.current?.autoFixYear();
32
- endDateFieldRef.current?.autoFixYear();
33
- }
34
- } });
42
+ let t7;
43
+ if ($[2] !== autoFixYear) {
44
+ t7 = { onFocusWithinChange: (isFocusWithin) => {
45
+ setIsFocused(isFocusWithin);
46
+ if (!isFocusWithin && autoFixYear) {
47
+ dateFieldRef.current?.autoFixYear();
48
+ endDateFieldRef.current?.autoFixYear();
49
+ }
50
+ } };
51
+ $[2] = autoFixYear;
52
+ $[3] = t7;
53
+ } else t7 = $[3];
54
+ const { focusWithinProps } = useFocusWithin(t7);
35
55
  const { isFocusVisible } = useFocusVisible();
36
56
  const dateFieldRef = useRef(null);
37
57
  const endDateFieldRef = useRef(null);
38
58
  const containerRef = useRef(null);
39
- useImperativeHandle(ref, () => ({
40
- clear: () => {
59
+ const t8 = fieldValue !== void 0 ? fieldValue : fieldProps.value ?? null;
60
+ let t9;
61
+ if ($[4] !== fieldProps || $[5] !== t8) {
62
+ t9 = {
63
+ ...fieldProps,
64
+ value: t8
65
+ };
66
+ $[4] = fieldProps;
67
+ $[5] = t8;
68
+ $[6] = t9;
69
+ } else t9 = $[6];
70
+ const normalizedFieldProps = t9;
71
+ let t10;
72
+ if ($[7] !== endFieldProps || $[8] !== endFieldValue) {
73
+ t10 = endFieldProps ? {
74
+ ...endFieldProps,
75
+ value: endFieldValue !== void 0 ? endFieldValue : endFieldProps.value ?? null
76
+ } : void 0;
77
+ $[7] = endFieldProps;
78
+ $[8] = endFieldValue;
79
+ $[9] = t10;
80
+ } else t10 = $[9];
81
+ const normalizedEndFieldProps = t10;
82
+ let t11;
83
+ if ($[10] !== endFieldProps || $[11] !== fieldProps || $[12] !== fireBlurOnChange || $[13] !== onClearProp) {
84
+ t11 = () => {
41
85
  dateFieldRef.current?.clearField();
42
- fieldProps.onChange?.(null);
43
86
  endDateFieldRef.current?.clearField();
44
- if (endFieldProps) endFieldProps.onChange?.(null);
87
+ fieldProps.onChange?.(null);
88
+ endFieldProps?.onChange?.(null);
89
+ if (onClearProp) onClearProp();
90
+ else if (fireBlurOnChange) {
91
+ fieldProps.onBlur?.(null);
92
+ endFieldProps?.onBlur?.(null);
93
+ }
45
94
  setCanClear(false);
46
- fieldProps.onBlur?.(null);
47
- endFieldProps?.onBlur?.(null);
48
- },
49
- getContainer: () => containerRef.current
50
- }));
51
- const onClearChange = useCallback((canClearInput) => {
52
- setCanClear(canClearInput);
53
- }, []);
54
- const onClear = () => {
55
- dateFieldRef.current?.clearField();
56
- fieldProps.onChange?.(null);
57
- endDateFieldRef.current?.clearField();
58
- endFieldProps?.onChange?.(null);
59
- setCanClear(false);
60
- fieldProps.onBlur?.(null);
61
- endFieldProps?.onBlur?.(null);
62
- };
63
- const onToday = () => {
64
- if (isDateTime) {
65
- const calendarDateTime = toCalendarDateTime(now(effectiveTimeZone));
66
- fieldProps.onChange?.(calendarDateTime);
67
- if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
68
- } else {
69
- fieldProps.onChange?.(today(effectiveTimeZone));
70
- if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
71
- }
72
- fieldProps.onBlur?.(null);
73
- endFieldProps?.onBlur?.(null);
74
- };
95
+ };
96
+ $[10] = endFieldProps;
97
+ $[11] = fieldProps;
98
+ $[12] = fireBlurOnChange;
99
+ $[13] = onClearProp;
100
+ $[14] = t11;
101
+ } else t11 = $[14];
102
+ const clearInput = t11;
103
+ let t12;
104
+ let t13;
105
+ if ($[15] !== clearInput) {
106
+ t12 = () => ({
107
+ clear: clearInput,
108
+ getContainer: () => containerRef.current
109
+ });
110
+ t13 = [clearInput];
111
+ $[15] = clearInput;
112
+ $[16] = t12;
113
+ $[17] = t13;
114
+ } else {
115
+ t12 = $[16];
116
+ t13 = $[17];
117
+ }
118
+ useImperativeHandle(ref, t12, t13);
119
+ let t14;
120
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
121
+ t14 = (canClearInput) => {
122
+ setCanClear(canClearInput);
123
+ };
124
+ $[18] = t14;
125
+ } else t14 = $[18];
126
+ const onClearChange = t14;
127
+ const showClear = canClear || hasValue || normalizedFieldProps.value != null || normalizedEndFieldProps?.value != null;
128
+ let t15;
129
+ if ($[19] !== effectiveTimeZone || $[20] !== endFieldProps || $[21] !== fieldProps || $[22] !== fireBlurOnChange || $[23] !== isDateTime) {
130
+ t15 = () => {
131
+ if (isDateTime) {
132
+ const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
133
+ fieldProps.onChange?.(calendarDateTime);
134
+ if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
135
+ } else {
136
+ fieldProps.onChange?.(today(effectiveTimeZone));
137
+ if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
138
+ }
139
+ if (fireBlurOnChange) {
140
+ fieldProps.onBlur?.(null);
141
+ endFieldProps?.onBlur?.(null);
142
+ }
143
+ };
144
+ $[19] = effectiveTimeZone;
145
+ $[20] = endFieldProps;
146
+ $[21] = fieldProps;
147
+ $[22] = fireBlurOnChange;
148
+ $[23] = isDateTime;
149
+ $[24] = t15;
150
+ } else t15 = $[24];
151
+ const onToday = t15;
75
152
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
76
- const todayIconComponent = getDatePickerTodayIcon(todayIcon);
77
- const todayIconButton = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
78
- label: "",
79
- icon: todayIconComponent,
80
- size: todayIconButtonSize,
81
- onPress: onToday,
82
- className: "relative z-1 !border-none"
83
- }) : null;
153
+ let t16;
154
+ if ($[25] !== todayIcon) {
155
+ t16 = getDatePickerTodayIcon(todayIcon);
156
+ $[25] = todayIcon;
157
+ $[26] = t16;
158
+ } else t16 = $[26];
159
+ const todayIconComponent = t16;
160
+ let t17;
161
+ if ($[27] !== onToday || $[28] !== todayIconButtonSize || $[29] !== todayIconComponent) {
162
+ t17 = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
163
+ label: "",
164
+ icon: todayIconComponent,
165
+ size: todayIconButtonSize,
166
+ onPress: onToday,
167
+ className: "relative z-1 !border-none"
168
+ }) : null;
169
+ $[27] = onToday;
170
+ $[28] = todayIconButtonSize;
171
+ $[29] = todayIconComponent;
172
+ $[30] = t17;
173
+ } else t17 = $[30];
174
+ const todayIconButton = t17;
84
175
  const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
85
176
  const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
86
- return /* @__PURE__ */ jsxs("div", {
87
- ref: containerRef,
88
- className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", inputBaseCva({
89
- variant,
177
+ const t18 = clsx("group group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", groupProps.className, inputBaseCva({
178
+ variant,
179
+ as,
180
+ ...props
181
+ }), className);
182
+ const t19 = isHovered || void 0;
183
+ const t20 = isDisabled || void 0;
184
+ const t21 = isDisabled || void 0;
185
+ const t22 = isInvalid || void 0;
186
+ const t23 = normalizedFieldProps.value == null || void 0;
187
+ const t24 = isFocused || void 0;
188
+ const t25 = isFocused && isFocusVisible || void 0;
189
+ const t26 = normalizedFieldProps.value != null || void 0;
190
+ const t27 = isDirty || void 0;
191
+ const t28 = isRequired || void 0;
192
+ const t29 = normalizedFieldProps.value != null || void 0;
193
+ let t30;
194
+ if ($[31] !== as || $[32] !== inputSizeCva || $[33] !== size) {
195
+ t30 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
196
+ size,
197
+ as
198
+ }));
199
+ $[31] = as;
200
+ $[32] = inputSizeCva;
201
+ $[33] = size;
202
+ $[34] = t30;
203
+ } else t30 = $[34];
204
+ let t31;
205
+ if ($[35] !== as || $[36] !== headerProps) {
206
+ t31 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
90
207
  as,
91
- ...props
92
- }), className),
93
- "data-rac": "",
94
- "data-datetime-input": "",
95
- "data-hovered": isHovered || void 0,
96
- "data-disabled": isDisabled || void 0,
97
- "data-is-disabled": isDisabled || void 0,
98
- "data-invalid": isInvalid || void 0,
99
- "data-is-empty": fieldProps.value === null || void 0,
100
- "data-focus-within": isFocused || void 0,
101
- "data-focus-visible": isFocused && isFocusVisible || void 0,
102
- "data-has-selection": fieldProps.value !== null || void 0,
103
- "data-is-dirty": isDirty || void 0,
104
- "data-is-required": isRequired || void 0,
105
- "data-is-filled": fieldProps.value !== null || void 0,
106
- ...groupProps,
107
- ...focusWithinProps,
108
- ...hoverProps,
109
- children: [/* @__PURE__ */ jsxs("div", {
110
- className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
111
- size,
112
- as
113
- })),
208
+ ...headerProps
209
+ });
210
+ $[35] = as;
211
+ $[36] = headerProps;
212
+ $[37] = t31;
213
+ } else t31 = $[37];
214
+ const t32 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
215
+ let t33;
216
+ if ($[38] !== datePickerInputContentRowCva || $[39] !== size) {
217
+ t33 = datePickerInputContentRowCva({ size });
218
+ $[38] = datePickerInputContentRowCva;
219
+ $[39] = size;
220
+ $[40] = t33;
221
+ } else t33 = $[40];
222
+ let t34;
223
+ if ($[41] !== disableManualEntry || $[42] !== isDisabled || $[43] !== onOpenDropdown) {
224
+ t34 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
225
+ onPress: onOpenDropdown,
226
+ className: "absolute inset-0 z-0",
227
+ isDisabled
228
+ });
229
+ $[41] = disableManualEntry;
230
+ $[42] = isDisabled;
231
+ $[43] = onOpenDropdown;
232
+ $[44] = t34;
233
+ } else t34 = $[44];
234
+ const t35 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
235
+ let t36;
236
+ if ($[45] !== as || $[46] !== dateGranularity || $[47] !== disableManualEntry || $[48] !== effectiveTimeZone || $[49] !== fieldProps.value || $[50] !== format || $[51] !== hidePlaceholder || $[52] !== isDisabled || $[53] !== isInvalid || $[54] !== isTimeOptional || $[55] !== normalizedEndFieldProps || $[56] !== normalizedFieldProps || $[57] !== onClearChange || $[58] !== placeholder) {
237
+ t36 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
238
+ size: "label-1",
239
+ className: "text-text-default-3",
240
+ children: placeholder
241
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
242
+ ref: dateFieldRef,
243
+ ...normalizedFieldProps,
244
+ isDisabled,
245
+ isInvalid,
246
+ onClearChange,
247
+ hidePlaceholder,
248
+ disableManualEntry,
249
+ dateGranularity,
250
+ isTimeOptional,
251
+ format,
252
+ timeZone: effectiveTimeZone
253
+ }), normalizedEndFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
254
+ className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
255
+ children: "–"
256
+ }), /* @__PURE__ */ jsx(DateField, {
257
+ ref: endDateFieldRef,
258
+ ...normalizedEndFieldProps,
259
+ isDisabled,
260
+ isInvalid,
261
+ onClearChange,
262
+ hidePlaceholder,
263
+ disableManualEntry,
264
+ isTimeOptional,
265
+ format,
266
+ timeZone: effectiveTimeZone
267
+ })] })] });
268
+ $[45] = as;
269
+ $[46] = dateGranularity;
270
+ $[47] = disableManualEntry;
271
+ $[48] = effectiveTimeZone;
272
+ $[49] = fieldProps.value;
273
+ $[50] = format;
274
+ $[51] = hidePlaceholder;
275
+ $[52] = isDisabled;
276
+ $[53] = isInvalid;
277
+ $[54] = isTimeOptional;
278
+ $[55] = normalizedEndFieldProps;
279
+ $[56] = normalizedFieldProps;
280
+ $[57] = onClearChange;
281
+ $[58] = placeholder;
282
+ $[59] = t36;
283
+ } else t36 = $[59];
284
+ let t37;
285
+ if ($[60] !== t33 || $[61] !== t34 || $[62] !== t35 || $[63] !== t36) {
286
+ t37 = /* @__PURE__ */ jsxs("div", {
287
+ className: t33,
288
+ children: [
289
+ t34,
290
+ t35,
291
+ t36
292
+ ]
293
+ });
294
+ $[60] = t33;
295
+ $[61] = t34;
296
+ $[62] = t35;
297
+ $[63] = t36;
298
+ $[64] = t37;
299
+ } else t37 = $[64];
300
+ let t38;
301
+ if ($[65] !== t30 || $[66] !== t31 || $[67] !== t32 || $[68] !== t37) {
302
+ t38 = /* @__PURE__ */ jsxs("div", {
303
+ className: t30,
114
304
  children: [
115
- as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
116
- as,
117
- ...headerProps
118
- }),
119
- shouldRenderTodayIconWithFieldLabel && todayIconButton,
120
- /* @__PURE__ */ jsxs("div", {
121
- className: datePickerInputContentRowCva({ size }),
122
- children: [
123
- disableManualEntry && /* @__PURE__ */ jsx(Button, {
124
- onPress: onOpenDropdown,
125
- className: "absolute inset-0 z-0",
126
- isDisabled
127
- }),
128
- !shouldRenderTodayIconWithFieldLabel && todayIconButton,
129
- disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
130
- size: "label-1",
131
- className: "text-text-default-3",
132
- children: placeholder
133
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
134
- ref: dateFieldRef,
135
- ...fieldProps,
136
- isDisabled,
137
- isInvalid,
138
- onClearChange,
139
- hidePlaceholder,
140
- disableManualEntry,
141
- dateGranularity,
142
- isTimeOptional,
143
- format,
144
- timeZone: effectiveTimeZone
145
- }), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
146
- className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
147
- children: "–"
148
- }), /* @__PURE__ */ jsx(DateField, {
149
- ref: endDateFieldRef,
150
- ...endFieldProps,
151
- isDisabled,
152
- isInvalid,
153
- onClearChange,
154
- hidePlaceholder,
155
- disableManualEntry,
156
- isTimeOptional,
157
- format,
158
- timeZone: effectiveTimeZone
159
- })] })] })
160
- ]
161
- })
305
+ t31,
306
+ t32,
307
+ t37
162
308
  ]
163
- }), /* @__PURE__ */ jsxs("div", {
164
- className: clsx(inputSizeCva({
165
- size,
166
- as
167
- }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
168
- children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
169
- onClear,
170
- show: canClear
171
- }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
172
- label: "",
173
- color: "secondary",
174
- ...buttonProps,
175
- icon: pickerIcon,
176
- isDisabled,
177
- className: "border-0!"
178
- })]
179
- })]
180
- });
309
+ });
310
+ $[65] = t30;
311
+ $[66] = t31;
312
+ $[67] = t32;
313
+ $[68] = t37;
314
+ $[69] = t38;
315
+ } else t38 = $[69];
316
+ let t39;
317
+ if ($[70] !== as || $[71] !== inputSizeCva || $[72] !== size) {
318
+ t39 = clsx(inputSizeCva({
319
+ size,
320
+ as
321
+ }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
322
+ $[70] = as;
323
+ $[71] = inputSizeCva;
324
+ $[72] = size;
325
+ $[73] = t39;
326
+ } else t39 = $[73];
327
+ let t40;
328
+ if ($[74] !== clearInput || $[75] !== isClearable || $[76] !== showClear) {
329
+ t40 = isClearable && /* @__PURE__ */ jsx(InputClear, {
330
+ onClear: clearInput,
331
+ show: showClear,
332
+ style: showClear ? { visibility: "visible" } : void 0
333
+ });
334
+ $[74] = clearInput;
335
+ $[75] = isClearable;
336
+ $[76] = showClear;
337
+ $[77] = t40;
338
+ } else t40 = $[77];
339
+ let t41;
340
+ if ($[78] !== buttonProps || $[79] !== disableDropdown || $[80] !== disableManualEntry || $[81] !== isDisabled || $[82] !== pickerIcon) {
341
+ t41 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
342
+ label: "",
343
+ color: "secondary",
344
+ ...buttonProps,
345
+ icon: pickerIcon,
346
+ isDisabled,
347
+ className: "border-0!"
348
+ });
349
+ $[78] = buttonProps;
350
+ $[79] = disableDropdown;
351
+ $[80] = disableManualEntry;
352
+ $[81] = isDisabled;
353
+ $[82] = pickerIcon;
354
+ $[83] = t41;
355
+ } else t41 = $[83];
356
+ let t42;
357
+ if ($[84] !== t39 || $[85] !== t40 || $[86] !== t41) {
358
+ t42 = /* @__PURE__ */ jsxs("div", {
359
+ className: t39,
360
+ children: [t40, t41]
361
+ });
362
+ $[84] = t39;
363
+ $[85] = t40;
364
+ $[86] = t41;
365
+ $[87] = t42;
366
+ } else t42 = $[87];
367
+ let t43;
368
+ if ($[88] !== focusWithinProps || $[89] !== groupProps || $[90] !== hoverProps || $[91] !== t18 || $[92] !== t19 || $[93] !== t20 || $[94] !== t21 || $[95] !== t22 || $[96] !== t23 || $[97] !== t24 || $[98] !== t25 || $[99] !== t26 || $[100] !== t27 || $[101] !== t28 || $[102] !== t29 || $[103] !== t38 || $[104] !== t42) {
369
+ t43 = /* @__PURE__ */ jsxs("div", {
370
+ ref: containerRef,
371
+ ...groupProps,
372
+ ...focusWithinProps,
373
+ ...hoverProps,
374
+ className: t18,
375
+ "data-rac": "",
376
+ "data-datetime-input": "",
377
+ "data-hovered": t19,
378
+ "data-disabled": t20,
379
+ "data-is-disabled": t21,
380
+ "data-invalid": t22,
381
+ "data-is-empty": t23,
382
+ "data-focus-within": t24,
383
+ "data-focus-visible": t25,
384
+ "data-has-selection": t26,
385
+ "data-is-dirty": t27,
386
+ "data-is-required": t28,
387
+ "data-is-filled": t29,
388
+ children: [t38, t42]
389
+ });
390
+ $[88] = focusWithinProps;
391
+ $[89] = groupProps;
392
+ $[90] = hoverProps;
393
+ $[91] = t18;
394
+ $[92] = t19;
395
+ $[93] = t20;
396
+ $[94] = t21;
397
+ $[95] = t22;
398
+ $[96] = t23;
399
+ $[97] = t24;
400
+ $[98] = t25;
401
+ $[99] = t26;
402
+ $[100] = t27;
403
+ $[101] = t28;
404
+ $[102] = t29;
405
+ $[103] = t38;
406
+ $[104] = t42;
407
+ $[105] = t43;
408
+ } else t43 = $[105];
409
+ return t43;
181
410
  };
182
411
  //#endregion
183
412
  export { DatePickerInput };