@povio/ui 2.3.0-rc.5 → 2.3.0-rc.7

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