@povio/ui 3.3.0-rc.4 → 3.4.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +15 -1
  2. package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
  3. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  4. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  5. package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -2
  6. package/dist/components/inputs/Checkbox/Checkbox.js +93 -100
  7. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  8. package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +1 -2
  9. package/dist/components/inputs/Checkbox/CheckboxGroup.js +109 -113
  10. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +1 -2
  11. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +97 -238
  12. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -2
  13. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +88 -214
  14. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -2
  15. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +64 -143
  16. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -2
  17. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +275 -294
  18. package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
  19. package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
  20. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
  21. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
  22. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
  23. package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
  24. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +1 -2
  25. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -343
  26. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  27. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
  28. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +43 -46
  29. package/dist/components/inputs/File/FileUpload.d.ts +1 -1
  30. package/dist/components/inputs/File/FileUpload.js +18 -18
  31. package/dist/components/inputs/File/InputUpload.d.ts +1 -1
  32. package/dist/components/inputs/File/InputUpload.js +82 -278
  33. package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
  34. package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
  35. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
  36. package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
  37. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
  38. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
  39. package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
  40. package/dist/components/inputs/FormField/FormField.js +34 -47
  41. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
  42. package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
  43. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
  44. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +93 -331
  45. package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
  46. package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
  47. package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
  48. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
  49. package/dist/components/inputs/Input/TextInput/TextInput.js +36 -38
  50. package/dist/components/inputs/Inputs/Form.d.ts +4 -4
  51. package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
  52. package/dist/components/inputs/Inputs/InputItem.js +35 -36
  53. package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
  54. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
  55. package/dist/components/inputs/RadioGroup/RadioGroup.js +107 -111
  56. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
  57. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +26 -86
  58. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
  59. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
  60. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
  61. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
  62. package/dist/components/inputs/Selection/Select/QuerySelect.js +49 -115
  63. package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
  64. package/dist/components/inputs/Selection/Select/Select.js +22 -22
  65. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +0 -1
  66. package/dist/components/inputs/Selection/shared/SelectBase.js +34 -37
  67. package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
  68. package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
  69. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
  70. package/dist/components/inputs/Selection/shared/select.context.js +4 -8
  71. package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
  72. package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
  73. package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
  74. package/dist/components/inputs/Slider/Slider.d.ts +1 -1
  75. package/dist/components/inputs/Slider/Slider.js +18 -18
  76. package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
  77. package/dist/components/inputs/TextEditor/TextEditor.js +105 -407
  78. package/dist/components/inputs/Toggle/Toggle.d.ts +1 -2
  79. package/dist/components/inputs/Toggle/Toggle.js +59 -63
  80. package/dist/components/inputs/shared/InputClear.js +24 -40
  81. package/dist/components/inputs/shared/form.binding.d.ts +27 -0
  82. package/dist/components/inputs/shared/form.binding.js +57 -0
  83. package/dist/components/inputs/shared/form.types.d.ts +9 -8
  84. package/dist/components/inputs/shared/form.types.js +8 -0
  85. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  86. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  87. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  88. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  89. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
  90. package/dist/components/segment/Segment.d.ts +1 -1
  91. package/dist/components/segment/Segment.js +17 -17
  92. package/dist/components/segment/segment.types.d.ts +1 -1
  93. package/dist/components/shared/pagination/Pagination.js +22 -108
  94. package/dist/components/status/Alert/Alert.js +30 -97
  95. package/dist/components/table/InfiniteTable.js +16 -67
  96. package/dist/components/table/Table.d.ts +2 -8
  97. package/dist/components/table/Table.js +33 -55
  98. package/dist/components/text/Typography/Typography.js +8 -23
  99. package/dist/config/confirmation.context.js +1 -1
  100. package/dist/config/theme.context.js +45 -98
  101. package/dist/config/uiConfig.context.d.ts +5 -5
  102. package/dist/config/uiConfig.context.js +11 -51
  103. package/dist/config/uiOverrides.context.d.ts +0 -1
  104. package/dist/helpers/dynamicColumns.d.ts +1 -1
  105. package/dist/helpers/dynamicInputs.d.ts +7 -7
  106. package/dist/hooks/useAutosave.d.ts +4 -4
  107. package/dist/hooks/useAutosave.js +64 -49
  108. package/dist/hooks/useDebounceCallback.js +17 -51
  109. package/dist/hooks/useForm.d.ts +39 -15
  110. package/dist/hooks/useForm.js +96 -43
  111. package/dist/hooks/useFormAutosave.d.ts +8 -9
  112. package/dist/hooks/useFormAutosave.js +49 -122
  113. package/dist/hooks/useLongPressRepeat.js +20 -55
  114. package/dist/index.d.ts +2 -3
  115. package/dist/index.js +3 -4
  116. package/package.json +3 -4
  117. package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
  118. package/dist/components/inputs/FormField/formField.cva.js +0 -16
  119. package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
  120. package/dist/components/table/TableColumnFilterInput.js +0 -108
  121. package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
  122. package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
  123. package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
  124. package/dist/components/table/TableColumnFilterRow.js +0 -68
  125. package/dist/hooks/useAutosave.spec.d.ts +0 -1
@@ -10,22 +10,14 @@ import { datePickerInputContentRowDefinition } from "./datePickerInput.cva.js";
10
10
  import { renderDatePickerTodayIcon } from "./datePickerTodayIcon.js";
11
11
  import { useFirefoxDateSegmentSelectionGuard } from "./useFirefoxDateSegmentSelectionGuard.js";
12
12
  import { InputClear } from "../../shared/InputClear.js";
13
- import { c } from "react/compiler-runtime";
14
13
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
14
  import { clsx } from "clsx";
16
- import { useImperativeHandle, useRef, useState } from "react";
15
+ import { useCallback, useImperativeHandle, useRef, useState } from "react";
17
16
  import { Button } from "react-aria-components";
18
17
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
19
18
  import { getLocalTimeZone, today } from "@internationalized/date";
20
19
  //#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
21
- var DatePickerInput = (t0) => {
22
- const $ = c(98);
23
- const { ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconButtonComponent, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone: timeZoneProp, isTimeOptional: t5, format, fireBlurOnChange, onClear: onClearProp, ...props } = t0;
24
- const todayIconButtonSize = t1 === void 0 ? "none" : t1;
25
- const todayIconPlacement = t2 === void 0 ? "content" : t2;
26
- const autoFixYear = t3 === void 0 ? false : t3;
27
- const dateGranularity = t4 === void 0 ? "day" : t4;
28
- const isTimeOptional = t5 === void 0 ? false : t5;
20
+ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, fieldValue, endFieldValue, isValueControlled, hasValue, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, shouldShrinkInput, isClearable, headerProps, todayIcon, todayIconButtonSize = "none", todayIconButtonComponent, todayIconPlacement = "content", isDirty, isRequired, disableManualEntry, autoFixYear = false, placeholder, className, onOpenDropdown, dateGranularity = "day", timeZone: timeZoneProp, isTimeOptional = false, format, onClear: onClearProp, ...props }) => {
29
21
  const uiConfig = UIConfig.useConfig();
30
22
  const timeZone = timeZoneProp ?? uiConfig.dateInput.timeZone;
31
23
  let effectiveTimeZone = getLocalTimeZone();
@@ -34,107 +26,51 @@ var DatePickerInput = (t0) => {
34
26
  const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
35
27
  const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
36
28
  const [canClear, setCanClear] = useState(false);
37
- let t6;
38
- if ($[0] !== isDisabled) {
39
- t6 = { isDisabled };
40
- $[0] = isDisabled;
41
- $[1] = t6;
42
- } else t6 = $[1];
43
- const { hoverProps, isHovered } = useHover(t6);
29
+ const { hoverProps, isHovered } = useHover({ isDisabled });
44
30
  const [isFocused, setIsFocused] = useState(false);
45
- let t7;
46
- if ($[2] !== autoFixYear) {
47
- t7 = { onFocusWithinChange: (isFocusWithin) => {
48
- setIsFocused(isFocusWithin);
49
- if (!isFocusWithin && autoFixYear) {
50
- dateFieldRef.current?.autoFixYear();
51
- endDateFieldRef.current?.autoFixYear();
52
- }
53
- } };
54
- $[2] = autoFixYear;
55
- $[3] = t7;
56
- } else t7 = $[3];
57
- const { focusWithinProps } = useFocusWithin(t7);
31
+ const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: (isFocusWithin) => {
32
+ setIsFocused(isFocusWithin);
33
+ if (!isFocusWithin && autoFixYear) {
34
+ dateFieldRef.current?.autoFixYear();
35
+ endDateFieldRef.current?.autoFixYear();
36
+ }
37
+ } });
58
38
  const { isFocusVisible } = useFocusVisible();
59
39
  const dateFieldRef = useRef(null);
60
40
  const endDateFieldRef = useRef(null);
61
41
  const containerRef = useRef(null);
62
42
  useFirefoxDateSegmentSelectionGuard(containerRef);
63
- const t8 = isValueControlled ? fieldValue ?? null : fieldProps.value ?? null;
64
- let t9;
65
- if ($[4] !== autoFixYear || $[5] !== fieldProps || $[6] !== t8) {
66
- t9 = {
67
- ...fieldProps,
68
- value: t8,
69
- shouldAutoFixYear: autoFixYear
70
- };
71
- $[4] = autoFixYear;
72
- $[5] = fieldProps;
73
- $[6] = t8;
74
- $[7] = t9;
75
- } else t9 = $[7];
76
- const normalizedFieldProps = t9;
77
- let t10;
78
- if ($[8] !== autoFixYear || $[9] !== endFieldProps || $[10] !== endFieldValue || $[11] !== isValueControlled) {
79
- t10 = endFieldProps ? {
80
- ...endFieldProps,
81
- value: isValueControlled ? endFieldValue ?? null : endFieldProps.value ?? null,
82
- shouldAutoFixYear: autoFixYear
83
- } : void 0;
84
- $[8] = autoFixYear;
85
- $[9] = endFieldProps;
86
- $[10] = endFieldValue;
87
- $[11] = isValueControlled;
88
- $[12] = t10;
89
- } else t10 = $[12];
90
- const normalizedEndFieldProps = t10;
91
- let t11;
92
- if ($[13] !== endFieldProps || $[14] !== fieldProps || $[15] !== fireBlurOnChange || $[16] !== onClearProp) {
93
- t11 = () => {
94
- dateFieldRef.current?.clearField();
95
- endDateFieldRef.current?.clearField();
96
- if (onClearProp) onClearProp();
97
- else {
98
- fieldProps.onChange?.(null);
99
- endFieldProps?.onChange?.(null);
100
- if (fireBlurOnChange) {
101
- fieldProps.onBlur?.(null);
102
- endFieldProps?.onBlur?.(null);
103
- }
104
- }
105
- setCanClear(false);
106
- };
107
- $[13] = endFieldProps;
108
- $[14] = fieldProps;
109
- $[15] = fireBlurOnChange;
110
- $[16] = onClearProp;
111
- $[17] = t11;
112
- } else t11 = $[17];
113
- const clearInput = t11;
114
- let t12;
115
- let t13;
116
- if ($[18] !== clearInput) {
117
- t12 = () => ({
118
- clear: clearInput,
119
- getContainer: () => containerRef.current
120
- });
121
- t13 = [clearInput];
122
- $[18] = clearInput;
123
- $[19] = t12;
124
- $[20] = t13;
125
- } else {
126
- t12 = $[19];
127
- t13 = $[20];
128
- }
129
- useImperativeHandle(ref, t12, t13);
130
- let t14;
131
- if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
132
- t14 = (canClearInput) => {
133
- setCanClear(canClearInput);
134
- };
135
- $[21] = t14;
136
- } else t14 = $[21];
137
- const onClearChange = t14;
43
+ const normalizedFieldProps = {
44
+ ...fieldProps,
45
+ value: isValueControlled ? fieldValue ?? null : fieldProps.value ?? null,
46
+ shouldAutoFixYear: autoFixYear
47
+ };
48
+ const normalizedEndFieldProps = endFieldProps ? {
49
+ ...endFieldProps,
50
+ value: isValueControlled ? endFieldValue ?? null : endFieldProps.value ?? null,
51
+ shouldAutoFixYear: autoFixYear
52
+ } : void 0;
53
+ const clearInput = useCallback(() => {
54
+ dateFieldRef.current?.clearField();
55
+ endDateFieldRef.current?.clearField();
56
+ if (onClearProp) onClearProp();
57
+ else {
58
+ fieldProps.onChange?.(null);
59
+ endFieldProps?.onChange?.(null);
60
+ }
61
+ setCanClear(false);
62
+ }, [
63
+ endFieldProps,
64
+ fieldProps,
65
+ onClearProp
66
+ ]);
67
+ useImperativeHandle(ref, () => ({
68
+ clear: clearInput,
69
+ getContainer: () => containerRef.current
70
+ }), [clearInput]);
71
+ const onClearChange = useCallback((canClearInput) => {
72
+ setCanClear(canClearInput);
73
+ }, []);
138
74
  const showClear = canClear || hasValue || normalizedFieldProps.value != null || normalizedEndFieldProps?.value != null;
139
75
  const isTodayIconDisabled = isDisabled || buttonProps.isDisabled;
140
76
  const onToday = () => {
@@ -147,10 +83,6 @@ var DatePickerInput = (t0) => {
147
83
  fieldProps.onChange?.(today(effectiveTimeZone));
148
84
  if (endFieldProps) endFieldProps.onChange?.(today(effectiveTimeZone));
149
85
  }
150
- if (fireBlurOnChange) {
151
- fieldProps.onBlur?.(null);
152
- endFieldProps?.onBlur?.(null);
153
- }
154
86
  };
155
87
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
156
88
  const todayIconButton = renderDatePickerTodayIcon(todayIcon, {
@@ -161,243 +93,104 @@ var DatePickerInput = (t0) => {
161
93
  });
162
94
  const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
163
95
  const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
164
- const t15 = clsx("group group/date-picker-content relative flex items-center justify-between gap-2", shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", groupProps.className, inputBaseCva({
165
- variant,
166
- as,
167
- ...props
168
- }), className);
169
- const t16 = isHovered || void 0;
170
- const t17 = isDisabled || void 0;
171
- const t18 = isDisabled || void 0;
172
- const t19 = isInvalid || void 0;
173
- const t20 = normalizedFieldProps.value == null || void 0;
174
- const t21 = isFocused || void 0;
175
- const t22 = isFocused && isFocusVisible || void 0;
176
- const t23 = normalizedFieldProps.value != null || void 0;
177
- const t24 = isDirty || void 0;
178
- const t25 = isRequired || void 0;
179
- const t26 = normalizedFieldProps.value != null || void 0;
180
- const t27 = shouldShrinkInput ? "min-w-0 flex-1 w-full" : "w-full";
181
- let t28;
182
- if ($[22] !== as || $[23] !== inputSizeCva || $[24] !== size || $[25] !== t27) {
183
- t28 = clsx("flex items-center gap-input-gap-input-text-to-elements pr-0!", t27, inputSizeCva({
184
- size,
185
- as
186
- }));
187
- $[22] = as;
188
- $[23] = inputSizeCva;
189
- $[24] = size;
190
- $[25] = t27;
191
- $[26] = t28;
192
- } else t28 = $[26];
193
- let t29;
194
- if ($[27] !== as || $[28] !== headerProps) {
195
- t29 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
96
+ return /* @__PURE__ */ jsxs("div", {
97
+ ref: containerRef,
98
+ ...groupProps,
99
+ ...focusWithinProps,
100
+ ...hoverProps,
101
+ className: clsx("group group/date-picker-content relative flex items-center justify-between gap-2", shouldShrinkInput ? "min-w-0" : "min-w-input-width-min-width", groupProps.className, inputBaseCva({
102
+ variant,
196
103
  as,
197
- ...headerProps
198
- });
199
- $[27] = as;
200
- $[28] = headerProps;
201
- $[29] = t29;
202
- } else t29 = $[29];
203
- const t30 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
204
- let t31;
205
- if ($[30] !== datePickerInputContentRowCva || $[31] !== size) {
206
- t31 = datePickerInputContentRowCva({ size });
207
- $[30] = datePickerInputContentRowCva;
208
- $[31] = size;
209
- $[32] = t31;
210
- } else t31 = $[32];
211
- let t32;
212
- if ($[33] !== disableManualEntry || $[34] !== isDisabled || $[35] !== onOpenDropdown) {
213
- t32 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
214
- onPress: onOpenDropdown,
215
- className: "absolute inset-0 z-base",
216
- isDisabled
217
- });
218
- $[33] = disableManualEntry;
219
- $[34] = isDisabled;
220
- $[35] = onOpenDropdown;
221
- $[36] = t32;
222
- } else t32 = $[36];
223
- const t33 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
224
- let t34;
225
- if ($[37] !== as || $[38] !== dateGranularity || $[39] !== disableManualEntry || $[40] !== effectiveTimeZone || $[41] !== fieldProps || $[42] !== format || $[43] !== hidePlaceholder || $[44] !== isDisabled || $[45] !== isInvalid || $[46] !== isTimeOptional || $[47] !== normalizedEndFieldProps || $[48] !== normalizedFieldProps || $[49] !== onClearChange || $[50] !== placeholder) {
226
- t34 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
227
- size: "label-1",
228
- className: "text-text-default-3",
229
- children: placeholder
230
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
231
- ref: dateFieldRef,
232
- ...normalizedFieldProps,
233
- isDisabled,
234
- isInvalid,
235
- onClearChange,
236
- hidePlaceholder,
237
- disableManualEntry,
238
- dateGranularity,
239
- isTimeOptional,
240
- format,
241
- timeZone: effectiveTimeZone,
242
- segmentGroup: normalizedEndFieldProps ? "start" : void 0
243
- }), normalizedEndFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
244
- className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
245
- children: "–"
246
- }), /* @__PURE__ */ jsx(DateField, {
247
- ref: endDateFieldRef,
248
- ...normalizedEndFieldProps,
249
- isDisabled,
250
- isInvalid,
251
- onClearChange,
252
- hidePlaceholder,
253
- disableManualEntry,
254
- isTimeOptional,
255
- format,
256
- timeZone: effectiveTimeZone,
257
- segmentGroup: "end"
258
- })] })] });
259
- $[37] = as;
260
- $[38] = dateGranularity;
261
- $[39] = disableManualEntry;
262
- $[40] = effectiveTimeZone;
263
- $[41] = fieldProps;
264
- $[42] = format;
265
- $[43] = hidePlaceholder;
266
- $[44] = isDisabled;
267
- $[45] = isInvalid;
268
- $[46] = isTimeOptional;
269
- $[47] = normalizedEndFieldProps;
270
- $[48] = normalizedFieldProps;
271
- $[49] = onClearChange;
272
- $[50] = placeholder;
273
- $[51] = t34;
274
- } else t34 = $[51];
275
- let t35;
276
- if ($[52] !== t31 || $[53] !== t32 || $[54] !== t33 || $[55] !== t34) {
277
- t35 = /* @__PURE__ */ jsxs("div", {
278
- className: t31,
104
+ ...props
105
+ }), className),
106
+ "data-rac": "",
107
+ "data-datetime-input": "",
108
+ "data-hovered": isHovered || void 0,
109
+ "data-disabled": isDisabled || void 0,
110
+ "data-is-disabled": isDisabled || void 0,
111
+ "data-invalid": isInvalid || void 0,
112
+ "data-is-empty": normalizedFieldProps.value == null || void 0,
113
+ "data-focus-within": isFocused || void 0,
114
+ "data-focus-visible": isFocused && isFocusVisible || void 0,
115
+ "data-has-selection": normalizedFieldProps.value != null || void 0,
116
+ "data-is-dirty": isDirty || void 0,
117
+ "data-is-required": isRequired || void 0,
118
+ "data-is-filled": normalizedFieldProps.value != null || void 0,
119
+ children: [/* @__PURE__ */ jsxs("div", {
120
+ className: clsx("flex items-center gap-input-gap-input-text-to-elements pr-0!", shouldShrinkInput ? "min-w-0 flex-1 w-full" : "w-full", inputSizeCva({
121
+ size,
122
+ as
123
+ })),
279
124
  children: [
280
- t32,
281
- t33,
282
- t34
125
+ as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
126
+ as,
127
+ ...headerProps
128
+ }),
129
+ shouldRenderTodayIconWithFieldLabel && todayIconButton,
130
+ /* @__PURE__ */ jsxs("div", {
131
+ className: datePickerInputContentRowCva({ size }),
132
+ children: [
133
+ disableManualEntry && /* @__PURE__ */ jsx(Button, {
134
+ onPress: onOpenDropdown,
135
+ className: "absolute inset-0 z-base",
136
+ isDisabled
137
+ }),
138
+ !shouldRenderTodayIconWithFieldLabel && todayIconButton,
139
+ disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
140
+ size: "label-1",
141
+ className: "text-text-default-3",
142
+ children: placeholder
143
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DateField, {
144
+ ref: dateFieldRef,
145
+ ...normalizedFieldProps,
146
+ isDisabled,
147
+ isInvalid,
148
+ onClearChange,
149
+ hidePlaceholder,
150
+ disableManualEntry,
151
+ dateGranularity,
152
+ isTimeOptional,
153
+ format,
154
+ timeZone: effectiveTimeZone,
155
+ segmentGroup: normalizedEndFieldProps ? "start" : void 0
156
+ }), normalizedEndFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", {
157
+ className: clsx("pointer-events-none select-none", isDisabled && "text-interactive-text-secondary-disabled"),
158
+ children: "–"
159
+ }), /* @__PURE__ */ jsx(DateField, {
160
+ ref: endDateFieldRef,
161
+ ...normalizedEndFieldProps,
162
+ isDisabled,
163
+ isInvalid,
164
+ onClearChange,
165
+ hidePlaceholder,
166
+ disableManualEntry,
167
+ isTimeOptional,
168
+ format,
169
+ timeZone: effectiveTimeZone,
170
+ segmentGroup: "end"
171
+ })] })] })
172
+ ]
173
+ })
283
174
  ]
284
- });
285
- $[52] = t31;
286
- $[53] = t32;
287
- $[54] = t33;
288
- $[55] = t34;
289
- $[56] = t35;
290
- } else t35 = $[56];
291
- let t36;
292
- if ($[57] !== t28 || $[58] !== t29 || $[59] !== t30 || $[60] !== t35) {
293
- t36 = /* @__PURE__ */ jsxs("div", {
294
- className: t28,
295
- children: [
296
- t29,
297
- t30,
298
- t35
299
- ]
300
- });
301
- $[57] = t28;
302
- $[58] = t29;
303
- $[59] = t30;
304
- $[60] = t35;
305
- $[61] = t36;
306
- } else t36 = $[61];
307
- let t37;
308
- if ($[62] !== as || $[63] !== inputSizeCva || $[64] !== size) {
309
- t37 = clsx(inputSizeCva({
310
- size,
311
- as
312
- }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
313
- $[62] = as;
314
- $[63] = inputSizeCva;
315
- $[64] = size;
316
- $[65] = t37;
317
- } else t37 = $[65];
318
- let t38;
319
- if ($[66] !== clearInput || $[67] !== isClearable || $[68] !== showClear) {
320
- t38 = isClearable && /* @__PURE__ */ jsx(InputClear, {
321
- onClear: clearInput,
322
- show: showClear
323
- });
324
- $[66] = clearInput;
325
- $[67] = isClearable;
326
- $[68] = showClear;
327
- $[69] = t38;
328
- } else t38 = $[69];
329
- let t39;
330
- if ($[70] !== buttonProps || $[71] !== disableDropdown || $[72] !== disableManualEntry || $[73] !== isDisabled || $[74] !== pickerIcon) {
331
- t39 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
332
- label: "",
333
- color: "secondary",
334
- ...buttonProps,
335
- icon: pickerIcon,
336
- isDisabled,
337
- className: "border-0!",
338
- "data-static-press-action": ""
339
- });
340
- $[70] = buttonProps;
341
- $[71] = disableDropdown;
342
- $[72] = disableManualEntry;
343
- $[73] = isDisabled;
344
- $[74] = pickerIcon;
345
- $[75] = t39;
346
- } else t39 = $[75];
347
- let t40;
348
- if ($[76] !== t37 || $[77] !== t38 || $[78] !== t39) {
349
- t40 = /* @__PURE__ */ jsxs("div", {
350
- className: t37,
351
- children: [t38, t39]
352
- });
353
- $[76] = t37;
354
- $[77] = t38;
355
- $[78] = t39;
356
- $[79] = t40;
357
- } else t40 = $[79];
358
- let t41;
359
- if ($[80] !== focusWithinProps || $[81] !== groupProps || $[82] !== hoverProps || $[83] !== t15 || $[84] !== t16 || $[85] !== t17 || $[86] !== t18 || $[87] !== t19 || $[88] !== t20 || $[89] !== t21 || $[90] !== t22 || $[91] !== t23 || $[92] !== t24 || $[93] !== t25 || $[94] !== t26 || $[95] !== t36 || $[96] !== t40) {
360
- t41 = /* @__PURE__ */ jsxs("div", {
361
- ref: containerRef,
362
- ...groupProps,
363
- ...focusWithinProps,
364
- ...hoverProps,
365
- className: t15,
366
- "data-rac": "",
367
- "data-datetime-input": "",
368
- "data-hovered": t16,
369
- "data-disabled": t17,
370
- "data-is-disabled": t18,
371
- "data-invalid": t19,
372
- "data-is-empty": t20,
373
- "data-focus-within": t21,
374
- "data-focus-visible": t22,
375
- "data-has-selection": t23,
376
- "data-is-dirty": t24,
377
- "data-is-required": t25,
378
- "data-is-filled": t26,
379
- children: [t36, t40]
380
- });
381
- $[80] = focusWithinProps;
382
- $[81] = groupProps;
383
- $[82] = hoverProps;
384
- $[83] = t15;
385
- $[84] = t16;
386
- $[85] = t17;
387
- $[86] = t18;
388
- $[87] = t19;
389
- $[88] = t20;
390
- $[89] = t21;
391
- $[90] = t22;
392
- $[91] = t23;
393
- $[92] = t24;
394
- $[93] = t25;
395
- $[94] = t26;
396
- $[95] = t36;
397
- $[96] = t40;
398
- $[97] = t41;
399
- } else t41 = $[97];
400
- return t41;
175
+ }), /* @__PURE__ */ jsxs("div", {
176
+ className: clsx(inputSizeCva({
177
+ size,
178
+ as
179
+ }), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!"),
180
+ children: [isClearable && /* @__PURE__ */ jsx(InputClear, {
181
+ onClear: clearInput,
182
+ show: showClear
183
+ }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
184
+ label: "",
185
+ color: "secondary",
186
+ ...buttonProps,
187
+ icon: pickerIcon,
188
+ isDisabled,
189
+ className: "border-0!",
190
+ "data-static-press-action": ""
191
+ })]
192
+ })]
193
+ });
401
194
  };
402
195
  //#endregion
403
196
  export { DatePickerInput };
@@ -1,76 +1,27 @@
1
1
  import "../../../../config/i18n.js";
2
2
  import { TextButton } from "../../../buttons/TextButton/TextButton.js";
3
- import { c } from "react/compiler-runtime";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { clsx } from "clsx";
6
5
  import { useTranslation } from "react-i18next";
7
6
  //#region src/components/inputs/DateTime/shared/DateTimeDialogFooter.tsx
8
- var DateTimeDialogFooter = (t0) => {
9
- const $ = c(16);
10
- const { isValid: t1, isDisabled: t2, onTodayPress, onApply } = t0;
11
- const isValid = t1 === void 0 ? true : t1;
12
- const isDisabled = t2 === void 0 ? false : t2;
7
+ var DateTimeDialogFooter = ({ isValid = true, isDisabled = false, onTodayPress, onApply }) => {
13
8
  const { t } = useTranslation("ui");
14
- const t3 = onTodayPress ? "justify-between" : "justify-end";
15
- let t4;
16
- if ($[0] !== t3) {
17
- t4 = clsx("flex shrink-0 items-center gap-2 bg-elevation-fill-default-2 px-4 py-3 md:border-elevation-outline-default-1 md:border-t md:bg-elevation-fill-default-1 md:py-1-5", t3);
18
- $[0] = t3;
19
- $[1] = t4;
20
- } else t4 = $[1];
21
- let t5;
22
- if ($[2] !== isDisabled || $[3] !== onTodayPress || $[4] !== t) {
23
- t5 = onTodayPress && /* @__PURE__ */ jsx(TextButton, {
9
+ return /* @__PURE__ */ jsxs("footer", {
10
+ className: clsx("flex shrink-0 items-center gap-2 bg-elevation-fill-default-2 px-4 py-3 md:border-elevation-outline-default-1 md:border-t md:bg-elevation-fill-default-1 md:py-1-5", onTodayPress ? "justify-between" : "justify-end"),
11
+ children: [onTodayPress && /* @__PURE__ */ jsx(TextButton, {
24
12
  type: "button",
25
13
  color: "primary",
26
14
  isDisabled,
27
15
  onPress: onTodayPress,
28
- children: t(_temp)
29
- });
30
- $[2] = isDisabled;
31
- $[3] = onTodayPress;
32
- $[4] = t;
33
- $[5] = t5;
34
- } else t5 = $[5];
35
- const t6 = !isValid;
36
- let t7;
37
- if ($[6] !== t) {
38
- t7 = t(_temp2);
39
- $[6] = t;
40
- $[7] = t7;
41
- } else t7 = $[7];
42
- let t8;
43
- if ($[8] !== onApply || $[9] !== t6 || $[10] !== t7) {
44
- t8 = /* @__PURE__ */ jsx(TextButton, {
16
+ children: t(($) => $.ui.datePicker.today)
17
+ }), /* @__PURE__ */ jsx(TextButton, {
45
18
  type: "button",
46
19
  color: "secondary",
47
20
  onPress: onApply,
48
- isDisabled: t6,
49
- children: t7
50
- });
51
- $[8] = onApply;
52
- $[9] = t6;
53
- $[10] = t7;
54
- $[11] = t8;
55
- } else t8 = $[11];
56
- let t9;
57
- if ($[12] !== t4 || $[13] !== t5 || $[14] !== t8) {
58
- t9 = /* @__PURE__ */ jsxs("footer", {
59
- className: t4,
60
- children: [t5, t8]
61
- });
62
- $[12] = t4;
63
- $[13] = t5;
64
- $[14] = t8;
65
- $[15] = t9;
66
- } else t9 = $[15];
67
- return t9;
21
+ isDisabled: !isValid,
22
+ children: t(($_0) => $_0.ui.datePicker.save)
23
+ })]
24
+ });
68
25
  };
69
- function _temp($) {
70
- return $.ui.datePicker.today;
71
- }
72
- function _temp2($_0) {
73
- return $_0.ui.datePicker.save;
74
- }
75
26
  //#endregion
76
27
  export { DateTimeDialogFooter };
@@ -19,7 +19,6 @@ interface DatePickerInputProps extends InputVariantProps {
19
19
  className?: string;
20
20
  onPress: () => void;
21
21
  onClear?: () => void;
22
- fireBlurOnChange?: boolean;
23
22
  }
24
- export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, fireBlurOnChange, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, onClear, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
25
24
  export {};