@povio/ui 2.3.0-rc.2 → 2.3.0-rc.21

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 +190 -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 +258 -76
  65. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
  66. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +342 -177
  67. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
  68. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +173 -63
  69. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
  70. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +522 -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 +249 -93
  77. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  78. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  79. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
  80. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +352 -145
  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 +2 -1
  89. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +206 -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 -122
  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 +303 -90
  115. package/dist/components/inputs/Input/TextInput/TextInput.js +376 -122
  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 +140 -45
  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 +442 -116
  146. package/dist/components/inputs/Slider/Slider.js +250 -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 -40
  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,389 @@ 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(99);
22
+ const { ref, as, groupProps, fieldProps, endFieldProps, 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, ...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
+ let t8;
60
+ if ($[4] !== endFieldProps || $[5] !== fieldProps || $[6] !== fireBlurOnChange) {
61
+ t8 = () => ({
62
+ clear: () => {
63
+ dateFieldRef.current?.clearField();
64
+ fieldProps.onChange?.(null);
65
+ endDateFieldRef.current?.clearField();
66
+ if (endFieldProps) endFieldProps.onChange?.(null);
67
+ setCanClear(false);
68
+ if (fireBlurOnChange) {
69
+ fieldProps.onBlur?.(null);
70
+ endFieldProps?.onBlur?.(null);
71
+ }
72
+ },
73
+ getContainer: () => containerRef.current
74
+ });
75
+ $[4] = endFieldProps;
76
+ $[5] = fieldProps;
77
+ $[6] = fireBlurOnChange;
78
+ $[7] = t8;
79
+ } else t8 = $[7];
80
+ useImperativeHandle(ref, t8);
81
+ let t9;
82
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
83
+ t9 = (canClearInput) => {
84
+ setCanClear(canClearInput);
85
+ };
86
+ $[8] = t9;
87
+ } else t9 = $[8];
88
+ const onClearChange = t9;
89
+ let t10;
90
+ if ($[9] !== endFieldProps || $[10] !== fieldProps || $[11] !== fireBlurOnChange) {
91
+ t10 = () => {
41
92
  dateFieldRef.current?.clearField();
42
93
  fieldProps.onChange?.(null);
43
94
  endDateFieldRef.current?.clearField();
44
- if (endFieldProps) endFieldProps.onChange?.(null);
95
+ endFieldProps?.onChange?.(null);
45
96
  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
- };
97
+ if (fireBlurOnChange) {
98
+ fieldProps.onBlur?.(null);
99
+ endFieldProps?.onBlur?.(null);
100
+ }
101
+ };
102
+ $[9] = endFieldProps;
103
+ $[10] = fieldProps;
104
+ $[11] = fireBlurOnChange;
105
+ $[12] = t10;
106
+ } else t10 = $[12];
107
+ const onClear = t10;
108
+ let t11;
109
+ if ($[13] !== effectiveTimeZone || $[14] !== endFieldProps || $[15] !== fieldProps || $[16] !== fireBlurOnChange || $[17] !== isDateTime) {
110
+ t11 = () => {
111
+ if (isDateTime) {
112
+ const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
113
+ fieldProps.onChange?.(calendarDateTime);
114
+ if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
115
+ } else {
116
+ fieldProps.onChange?.(today(effectiveTimeZone));
117
+ if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
118
+ }
119
+ if (fireBlurOnChange) {
120
+ fieldProps.onBlur?.(null);
121
+ endFieldProps?.onBlur?.(null);
122
+ }
123
+ };
124
+ $[13] = effectiveTimeZone;
125
+ $[14] = endFieldProps;
126
+ $[15] = fieldProps;
127
+ $[16] = fireBlurOnChange;
128
+ $[17] = isDateTime;
129
+ $[18] = t11;
130
+ } else t11 = $[18];
131
+ const onToday = t11;
75
132
  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;
133
+ let t12;
134
+ if ($[19] !== todayIcon) {
135
+ t12 = getDatePickerTodayIcon(todayIcon);
136
+ $[19] = todayIcon;
137
+ $[20] = t12;
138
+ } else t12 = $[20];
139
+ const todayIconComponent = t12;
140
+ let t13;
141
+ if ($[21] !== onToday || $[22] !== todayIconButtonSize || $[23] !== todayIconComponent) {
142
+ t13 = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
143
+ label: "",
144
+ icon: todayIconComponent,
145
+ size: todayIconButtonSize,
146
+ onPress: onToday,
147
+ className: "relative z-1 !border-none"
148
+ }) : null;
149
+ $[21] = onToday;
150
+ $[22] = todayIconButtonSize;
151
+ $[23] = todayIconComponent;
152
+ $[24] = t13;
153
+ } else t13 = $[24];
154
+ const todayIconButton = t13;
84
155
  const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
85
156
  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,
157
+ const t14 = clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", inputBaseCva({
158
+ variant,
159
+ as,
160
+ ...props
161
+ }), className);
162
+ const t15 = isHovered || void 0;
163
+ const t16 = isDisabled || void 0;
164
+ const t17 = isDisabled || void 0;
165
+ const t18 = isInvalid || void 0;
166
+ const t19 = fieldProps.value === null || void 0;
167
+ const t20 = isFocused || void 0;
168
+ const t21 = isFocused && isFocusVisible || void 0;
169
+ const t22 = fieldProps.value !== null || void 0;
170
+ const t23 = isDirty || void 0;
171
+ const t24 = isRequired || void 0;
172
+ const t25 = fieldProps.value !== null || void 0;
173
+ let t26;
174
+ if ($[25] !== as || $[26] !== inputSizeCva || $[27] !== size) {
175
+ t26 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
176
+ size,
177
+ as
178
+ }));
179
+ $[25] = as;
180
+ $[26] = inputSizeCva;
181
+ $[27] = size;
182
+ $[28] = t26;
183
+ } else t26 = $[28];
184
+ let t27;
185
+ if ($[29] !== as || $[30] !== headerProps) {
186
+ t27 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
90
187
  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
- })),
188
+ ...headerProps
189
+ });
190
+ $[29] = as;
191
+ $[30] = headerProps;
192
+ $[31] = t27;
193
+ } else t27 = $[31];
194
+ const t28 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
195
+ let t29;
196
+ if ($[32] !== datePickerInputContentRowCva || $[33] !== size) {
197
+ t29 = datePickerInputContentRowCva({ size });
198
+ $[32] = datePickerInputContentRowCva;
199
+ $[33] = size;
200
+ $[34] = t29;
201
+ } else t29 = $[34];
202
+ let t30;
203
+ if ($[35] !== disableManualEntry || $[36] !== isDisabled || $[37] !== onOpenDropdown) {
204
+ t30 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
205
+ onPress: onOpenDropdown,
206
+ className: "absolute inset-0 z-0",
207
+ isDisabled
208
+ });
209
+ $[35] = disableManualEntry;
210
+ $[36] = isDisabled;
211
+ $[37] = onOpenDropdown;
212
+ $[38] = t30;
213
+ } else t30 = $[38];
214
+ const t31 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
215
+ let t32;
216
+ if ($[39] !== as || $[40] !== dateGranularity || $[41] !== disableManualEntry || $[42] !== effectiveTimeZone || $[43] !== endFieldProps || $[44] !== fieldProps || $[45] !== format || $[46] !== hidePlaceholder || $[47] !== isDisabled || $[48] !== isInvalid || $[49] !== isTimeOptional || $[50] !== onClearChange || $[51] !== placeholder) {
217
+ t32 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
218
+ size: "label-1",
219
+ className: "text-text-default-3",
220
+ children: placeholder
221
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
222
+ ref: dateFieldRef,
223
+ ...fieldProps,
224
+ isDisabled,
225
+ isInvalid,
226
+ onClearChange,
227
+ hidePlaceholder,
228
+ disableManualEntry,
229
+ dateGranularity,
230
+ isTimeOptional,
231
+ format,
232
+ timeZone: effectiveTimeZone
233
+ }), endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
234
+ className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
235
+ children: "–"
236
+ }), /* @__PURE__ */ jsx(DateField, {
237
+ ref: endDateFieldRef,
238
+ ...endFieldProps,
239
+ isDisabled,
240
+ isInvalid,
241
+ onClearChange,
242
+ hidePlaceholder,
243
+ disableManualEntry,
244
+ isTimeOptional,
245
+ format,
246
+ timeZone: effectiveTimeZone
247
+ })] })] });
248
+ $[39] = as;
249
+ $[40] = dateGranularity;
250
+ $[41] = disableManualEntry;
251
+ $[42] = effectiveTimeZone;
252
+ $[43] = endFieldProps;
253
+ $[44] = fieldProps;
254
+ $[45] = format;
255
+ $[46] = hidePlaceholder;
256
+ $[47] = isDisabled;
257
+ $[48] = isInvalid;
258
+ $[49] = isTimeOptional;
259
+ $[50] = onClearChange;
260
+ $[51] = placeholder;
261
+ $[52] = t32;
262
+ } else t32 = $[52];
263
+ let t33;
264
+ if ($[53] !== t29 || $[54] !== t30 || $[55] !== t31 || $[56] !== t32) {
265
+ t33 = /* @__PURE__ */ jsxs("div", {
266
+ className: t29,
114
267
  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
- })
268
+ t30,
269
+ t31,
270
+ t32
162
271
  ]
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
- });
272
+ });
273
+ $[53] = t29;
274
+ $[54] = t30;
275
+ $[55] = t31;
276
+ $[56] = t32;
277
+ $[57] = t33;
278
+ } else t33 = $[57];
279
+ let t34;
280
+ if ($[58] !== t26 || $[59] !== t27 || $[60] !== t28 || $[61] !== t33) {
281
+ t34 = /* @__PURE__ */ jsxs("div", {
282
+ className: t26,
283
+ children: [
284
+ t27,
285
+ t28,
286
+ t33
287
+ ]
288
+ });
289
+ $[58] = t26;
290
+ $[59] = t27;
291
+ $[60] = t28;
292
+ $[61] = t33;
293
+ $[62] = t34;
294
+ } else t34 = $[62];
295
+ let t35;
296
+ if ($[63] !== as || $[64] !== inputSizeCva || $[65] !== size) {
297
+ t35 = clsx(inputSizeCva({
298
+ size,
299
+ as
300
+ }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
301
+ $[63] = as;
302
+ $[64] = inputSizeCva;
303
+ $[65] = size;
304
+ $[66] = t35;
305
+ } else t35 = $[66];
306
+ let t36;
307
+ if ($[67] !== canClear || $[68] !== isClearable || $[69] !== onClear) {
308
+ t36 = isClearable && /* @__PURE__ */ jsx(InputClear, {
309
+ onClear,
310
+ show: canClear
311
+ });
312
+ $[67] = canClear;
313
+ $[68] = isClearable;
314
+ $[69] = onClear;
315
+ $[70] = t36;
316
+ } else t36 = $[70];
317
+ let t37;
318
+ if ($[71] !== buttonProps || $[72] !== disableDropdown || $[73] !== disableManualEntry || $[74] !== isDisabled || $[75] !== pickerIcon) {
319
+ t37 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
320
+ label: "",
321
+ color: "secondary",
322
+ ...buttonProps,
323
+ icon: pickerIcon,
324
+ isDisabled,
325
+ className: "border-0!"
326
+ });
327
+ $[71] = buttonProps;
328
+ $[72] = disableDropdown;
329
+ $[73] = disableManualEntry;
330
+ $[74] = isDisabled;
331
+ $[75] = pickerIcon;
332
+ $[76] = t37;
333
+ } else t37 = $[76];
334
+ let t38;
335
+ if ($[77] !== t35 || $[78] !== t36 || $[79] !== t37) {
336
+ t38 = /* @__PURE__ */ jsxs("div", {
337
+ className: t35,
338
+ children: [t36, t37]
339
+ });
340
+ $[77] = t35;
341
+ $[78] = t36;
342
+ $[79] = t37;
343
+ $[80] = t38;
344
+ } else t38 = $[80];
345
+ let t39;
346
+ if ($[81] !== focusWithinProps || $[82] !== groupProps || $[83] !== hoverProps || $[84] !== t14 || $[85] !== t15 || $[86] !== t16 || $[87] !== t17 || $[88] !== t18 || $[89] !== t19 || $[90] !== t20 || $[91] !== t21 || $[92] !== t22 || $[93] !== t23 || $[94] !== t24 || $[95] !== t25 || $[96] !== t34 || $[97] !== t38) {
347
+ t39 = /* @__PURE__ */ jsxs("div", {
348
+ ref: containerRef,
349
+ className: t14,
350
+ "data-rac": "",
351
+ "data-datetime-input": "",
352
+ "data-hovered": t15,
353
+ "data-disabled": t16,
354
+ "data-is-disabled": t17,
355
+ "data-invalid": t18,
356
+ "data-is-empty": t19,
357
+ "data-focus-within": t20,
358
+ "data-focus-visible": t21,
359
+ "data-has-selection": t22,
360
+ "data-is-dirty": t23,
361
+ "data-is-required": t24,
362
+ "data-is-filled": t25,
363
+ ...groupProps,
364
+ ...focusWithinProps,
365
+ ...hoverProps,
366
+ children: [t34, t38]
367
+ });
368
+ $[81] = focusWithinProps;
369
+ $[82] = groupProps;
370
+ $[83] = hoverProps;
371
+ $[84] = t14;
372
+ $[85] = t15;
373
+ $[86] = t16;
374
+ $[87] = t17;
375
+ $[88] = t18;
376
+ $[89] = t19;
377
+ $[90] = t20;
378
+ $[91] = t21;
379
+ $[92] = t22;
380
+ $[93] = t23;
381
+ $[94] = t24;
382
+ $[95] = t25;
383
+ $[96] = t34;
384
+ $[97] = t38;
385
+ $[98] = t39;
386
+ } else t39 = $[98];
387
+ return t39;
181
388
  };
182
389
  //#endregion
183
390
  export { DatePickerInput };
@@ -1,3 +1,4 @@
1
+ import { c } from "react/compiler-runtime";
1
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import { clsx } from "clsx";
3
4
  import { useRef } from "react";
@@ -12,33 +13,105 @@ var getPlaceholder = (segment) => {
12
13
  default: return segment.placeholder;
13
14
  }
14
15
  };
15
- var DateSegmentItem = ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }) => {
16
+ var DateSegmentItem = (t0) => {
17
+ const $ = c(12);
18
+ const { segment, state, isDisabled, timePickerOnly, hidePlaceholder } = t0;
16
19
  const ref = useRef(null);
17
20
  const { segmentProps } = useDateSegment(segment, state, ref);
18
- return /* @__PURE__ */ jsx(DateSegmentItemView, {
19
- ref,
20
- segmentProps,
21
- type: segment.type,
22
- text: segment.text,
23
- placeholder: getPlaceholder(segment),
24
- isPlaceholder: segment.isPlaceholder,
25
- isInputEmpty: !state.value,
26
- isDisabled,
27
- timePickerOnly,
28
- hidePlaceholder
29
- });
21
+ const t1 = segment.type;
22
+ const t2 = segment.text;
23
+ let t3;
24
+ if ($[0] !== segment) {
25
+ t3 = getPlaceholder(segment);
26
+ $[0] = segment;
27
+ $[1] = t3;
28
+ } else t3 = $[1];
29
+ const t4 = !state.value;
30
+ let t5;
31
+ if ($[2] !== hidePlaceholder || $[3] !== isDisabled || $[4] !== segment.isPlaceholder || $[5] !== segment.text || $[6] !== segment.type || $[7] !== segmentProps || $[8] !== t3 || $[9] !== t4 || $[10] !== timePickerOnly) {
32
+ t5 = /* @__PURE__ */ jsx(DateSegmentItemView, {
33
+ ref,
34
+ segmentProps,
35
+ type: t1,
36
+ text: t2,
37
+ placeholder: t3,
38
+ isPlaceholder: segment.isPlaceholder,
39
+ isInputEmpty: t4,
40
+ isDisabled,
41
+ timePickerOnly,
42
+ hidePlaceholder
43
+ });
44
+ $[2] = hidePlaceholder;
45
+ $[3] = isDisabled;
46
+ $[4] = segment.isPlaceholder;
47
+ $[5] = segment.text;
48
+ $[6] = segment.type;
49
+ $[7] = segmentProps;
50
+ $[8] = t3;
51
+ $[9] = t4;
52
+ $[10] = timePickerOnly;
53
+ $[11] = t5;
54
+ } else t5 = $[11];
55
+ return t5;
30
56
  };
31
- var DateSegmentItemView = ({ ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder }) => {
32
- return /* @__PURE__ */ jsx("div", {
33
- ...segmentProps,
34
- ref,
35
- className: clsx("box-content rounded-input-rounding-default", isDisabled && "text-interactive-text-secondary-disabled", !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1", !isDisabled && !isInputEmpty && "text-text-default-1", "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", type && ["hour", "dayPeriod"].includes(type) && !timePickerOnly && "ml-1", hidePlaceholder && "opacity-0"),
36
- children: /* @__PURE__ */ jsxs(Fragment, { children: [isPlaceholder && /* @__PURE__ */ jsx("span", {
57
+ var DateSegmentItemView = (t0) => {
58
+ const $ = c(20);
59
+ const { ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
60
+ const t1 = isDisabled && "text-interactive-text-secondary-disabled";
61
+ const t2 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
62
+ const t3 = !isDisabled && !isInputEmpty && "text-text-default-1";
63
+ let t4;
64
+ if ($[0] !== timePickerOnly || $[1] !== type) {
65
+ t4 = type && ["hour", "dayPeriod"].includes(type) && !timePickerOnly && "ml-1";
66
+ $[0] = timePickerOnly;
67
+ $[1] = type;
68
+ $[2] = t4;
69
+ } else t4 = $[2];
70
+ const t5 = hidePlaceholder && "opacity-0";
71
+ let t6;
72
+ if ($[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== t5) {
73
+ t6 = clsx("box-content rounded-input-rounding-default", t1, t2, t3, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t4, t5);
74
+ $[3] = t1;
75
+ $[4] = t2;
76
+ $[5] = t3;
77
+ $[6] = t4;
78
+ $[7] = t5;
79
+ $[8] = t6;
80
+ } else t6 = $[8];
81
+ let t7;
82
+ if ($[9] !== isPlaceholder || $[10] !== placeholder) {
83
+ t7 = isPlaceholder && /* @__PURE__ */ jsx("span", {
37
84
  "aria-hidden": "true",
38
85
  className: "pointer-events-none",
39
86
  children: placeholder
40
- }), isPlaceholder ? "" : text] })
41
- });
87
+ });
88
+ $[9] = isPlaceholder;
89
+ $[10] = placeholder;
90
+ $[11] = t7;
91
+ } else t7 = $[11];
92
+ const t8 = isPlaceholder ? "" : text;
93
+ let t9;
94
+ if ($[12] !== t7 || $[13] !== t8) {
95
+ t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
96
+ $[12] = t7;
97
+ $[13] = t8;
98
+ $[14] = t9;
99
+ } else t9 = $[14];
100
+ let t10;
101
+ if ($[15] !== ref || $[16] !== segmentProps || $[17] !== t6 || $[18] !== t9) {
102
+ t10 = /* @__PURE__ */ jsx("div", {
103
+ ...segmentProps,
104
+ ref,
105
+ className: t6,
106
+ children: t9
107
+ });
108
+ $[15] = ref;
109
+ $[16] = segmentProps;
110
+ $[17] = t6;
111
+ $[18] = t9;
112
+ $[19] = t10;
113
+ } else t10 = $[19];
114
+ return t10;
42
115
  };
43
116
  //#endregion
44
117
  export { DateSegmentItem, DateSegmentItemView, getPlaceholder };