@povio/ui 2.3.0-rc.36 → 2.3.0-rc.38

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.
@@ -122,15 +122,6 @@ var DatePickerBase = (props) => {
122
122
  locale,
123
123
  createCalendar
124
124
  });
125
- useEffect(() => {
126
- if (normalizedValue !== null) return;
127
- if (state.value !== null) state.setValue(null);
128
- if (dialogState.value !== null) dialogState.setValue(null);
129
- }, [
130
- normalizedValue,
131
- state,
132
- dialogState
133
- ]);
134
125
  const headerProps = {
135
126
  label,
136
127
  tooltipText,
@@ -167,10 +158,6 @@ var DatePickerBase = (props) => {
167
158
  };
168
159
  const onInputClear = () => {
169
160
  onChange?.(null);
170
- state.setValue(null);
171
- dialogState.setValue(null);
172
- calendarState.setFocusedDate(today(DATE_PICKER_TIME_ZONE));
173
- if (fireBlurOnChange) handleBlur(null);
174
161
  };
175
162
  useEffect(() => {
176
163
  if (!state.isOpen) return;
@@ -307,7 +294,7 @@ var DatePickerInner = (t0) => {
307
294
  let t5;
308
295
  if ($[5] !== fullIso || $[6] !== normalizeByGranularity) {
309
296
  t5 = (formattedDate) => {
310
- if (formattedDate == null) return formattedDate;
297
+ if (formattedDate == null) return null;
311
298
  if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
312
299
  const date_1 = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
313
300
  return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1, "UTC")));
@@ -472,7 +459,7 @@ var DatePicker = (t0) => {
472
459
  ...innerProps,
473
460
  ref: mergeRefs(ref, field.ref),
474
461
  value: field.value ?? null,
475
- onChange: (value) => field.onChange(value ?? null),
462
+ onChange: field.onChange,
476
463
  onBlur: field.onBlur,
477
464
  isDirty,
478
465
  isDisabled: field.disabled || props.isDisabled,
@@ -18,7 +18,7 @@ import { RangeCalendar } from "../shared/RangeCalendar.js";
18
18
  import { c } from "react/compiler-runtime";
19
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
20
  import { clsx } from "clsx";
21
- import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
21
+ import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
22
22
  import { Button } from "react-aria-components";
23
23
  import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
24
24
  import { mergeRefs } from "@react-aria/utils";
@@ -183,27 +183,6 @@ var DateRangePickerBase = (props) => {
183
183
  setActivePreset(null);
184
184
  }
185
185
  };
186
- useEffect(() => {
187
- if (normalizedValue !== null) return;
188
- if (state.value !== null) state.setValue(null);
189
- setValidationRangeError(void 0);
190
- dialogState.setValue(null);
191
- leftCalendarState.setValue(null);
192
- rightCalendarState.setValue(null);
193
- setRangeSelection({
194
- start: null,
195
- end: null,
196
- isSelecting: false
197
- });
198
- setHoverDate(null);
199
- setActivePreset(null);
200
- }, [
201
- normalizedValue,
202
- state,
203
- dialogState,
204
- leftCalendarState,
205
- rightCalendarState
206
- ]);
207
186
  const throttledSetHoverDate = useCallback((date) => {
208
187
  requestAnimationFrame(() => {
209
188
  setHoverDate(date);
@@ -389,9 +368,6 @@ var DateRangePickerBase = (props) => {
389
368
  };
390
369
  const onInputClear = () => {
391
370
  onChange?.(null);
392
- state.setValue(null);
393
- handleCalendarStatesChange(null);
394
- if (fireBlurOnChange) handleBlur(null);
395
371
  };
396
372
  const onOpenChange = (isOpen) => {
397
373
  state.toggle();
@@ -638,7 +614,7 @@ var DateRangePickerInner = (t0) => {
638
614
  let t3;
639
615
  if ($[2] !== fullIso) {
640
616
  t3 = (formattedRange) => {
641
- if (!formattedRange?.start || !formattedRange?.end) return formattedRange;
617
+ if (!formattedRange?.start || !formattedRange?.end) return null;
642
618
  if (fullIso) return {
643
619
  start: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.start),
644
620
  end: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.end)
@@ -659,7 +635,7 @@ var DateRangePickerInner = (t0) => {
659
635
  let t4;
660
636
  if ($[4] !== fullIso) {
661
637
  t4 = (formattedDate) => {
662
- if (formattedDate == null) return formattedDate;
638
+ if (formattedDate == null) return null;
663
639
  if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
664
640
  const date = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
665
641
  return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date, "UTC"));
@@ -820,7 +796,7 @@ var DateRangePicker = (t0) => {
820
796
  ...innerProps,
821
797
  ref: mergeRefs(ref, field.ref),
822
798
  value: field.value ?? null,
823
- onChange: (value) => field.onChange(value ?? null),
799
+ onChange: field.onChange,
824
800
  onBlur: field.onBlur,
825
801
  isDirty,
826
802
  isDisabled: field.disabled || props.isDisabled,
@@ -55,7 +55,6 @@ var DateTimePickerBase = (props) => {
55
55
  errorClassName
56
56
  };
57
57
  const datePickerInputRef = useRef(null);
58
- const isClearingInputRef = useRef(false);
59
58
  const datePickerRef = useMemo(() => ({ get current() {
60
59
  return datePickerInputRef.current?.getContainer?.() || null;
61
60
  } }), []);
@@ -113,15 +112,6 @@ var DateTimePickerBase = (props) => {
113
112
  locale,
114
113
  createCalendar
115
114
  });
116
- useEffect(() => {
117
- if (normalizedValue !== null) return;
118
- if (state.value !== null) state.setValue(null);
119
- if (dialogState.value !== null) dialogState.setValue(null);
120
- }, [
121
- normalizedValue,
122
- state,
123
- dialogState
124
- ]);
125
115
  const headerProps = {
126
116
  label,
127
117
  tooltipText,
@@ -160,15 +150,7 @@ var DateTimePickerBase = (props) => {
160
150
  calendarState.setFocusedDate(toCalendarDate(currentValue));
161
151
  };
162
152
  const onInputClear = () => {
163
- isClearingInputRef.current = true;
164
153
  onChange?.(null);
165
- state.setValue(null);
166
- dialogState.setValue(null);
167
- calendarState.setFocusedDate(today(effectiveTimeZone));
168
- if (fireBlurOnChange) handleBlur(null);
169
- window.setTimeout(() => {
170
- isClearingInputRef.current = false;
171
- }, 0);
172
154
  };
173
155
  const onOpenChange = (isOpen) => {
174
156
  state.toggle();
@@ -177,12 +159,11 @@ var DateTimePickerBase = (props) => {
177
159
  };
178
160
  const onInputBlur = (e) => {
179
161
  if (!isTimeOptional) return;
180
- if (isClearingInputRef.current) return;
181
162
  if (state.value) {
182
163
  dialogState.setValue(state.value);
183
164
  return;
184
165
  }
185
- const textValue = e?.currentTarget.textContent ?? null;
166
+ const textValue = e?.currentTarget?.textContent ?? null;
186
167
  const dateTimeValue = DateTimeUtils.formatTextDateToCalendarDateTime(textValue, effectiveTimeZone, locale);
187
168
  if (dateTimeValue) {
188
169
  state.setValue(dateTimeValue);
@@ -398,7 +379,7 @@ var DateTimePicker = (t0) => {
398
379
  ...innerProps,
399
380
  ref: mergeRefs(ref, field.ref),
400
381
  value: field.value ?? null,
401
- onChange: (value) => field.onChange(value ?? null),
382
+ onChange: field.onChange,
402
383
  onBlur: field.onBlur,
403
384
  isDirty,
404
385
  isDisabled: field.disabled || props.isDisabled,
@@ -454,7 +435,7 @@ function _temp2(dateValue) {
454
435
  return DateTimeUtils.fromDateValueFieldsToUTCISO(dateValue);
455
436
  }
456
437
  function _temp3(isoString) {
457
- if (isoString == null) return isoString;
438
+ if (isoString == null) return null;
458
439
  return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, "UTC");
459
440
  }
460
441
  //#endregion
@@ -22,7 +22,7 @@ import { DateTime } from "luxon";
22
22
  import { useTimeFieldState } from "react-stately";
23
23
  //#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
24
24
  var TimePickerBase = (props) => {
25
- const $ = c(142);
25
+ const $ = c(136);
26
26
  const ui = UIConfig.useConfig();
27
27
  let asProp;
28
28
  let className;
@@ -209,156 +209,131 @@ var TimePickerBase = (props) => {
209
209
  } else t7 = $[56];
210
210
  const state = useTimeFieldState(t7);
211
211
  let t8;
212
- let t9;
213
- if ($[57] !== dialogState || $[58] !== normalizedValue || $[59] !== state) {
212
+ if ($[57] !== onChange || $[58] !== state.timeValue) {
214
213
  t8 = () => {
215
- if (normalizedValue !== null) return;
216
- if (state.value !== null) state.setValue(null);
217
- if (dialogState.value !== null) dialogState.setValue(null);
218
- };
219
- t9 = [
220
- normalizedValue,
221
- state,
222
- dialogState
223
- ];
224
- $[57] = dialogState;
225
- $[58] = normalizedValue;
226
- $[59] = state;
227
- $[60] = t8;
228
- $[61] = t9;
229
- } else {
230
- t8 = $[60];
231
- t9 = $[61];
232
- }
233
- useEffect(t8, t9);
234
- let t10;
235
- if ($[62] !== onChange || $[63] !== state.timeValue) {
236
- t10 = () => {
237
214
  if (initialDateEmitRef.current) {
238
215
  initialDateEmitRef.current = false;
239
216
  return;
240
217
  }
241
218
  if (state.timeValue) onChange?.(state.timeValue);
242
219
  };
243
- $[62] = onChange;
244
- $[63] = state.timeValue;
245
- $[64] = t10;
246
- } else t10 = $[64];
247
- let t11;
248
- if ($[65] !== rest.date) {
249
- t11 = [rest.date];
250
- $[65] = rest.date;
251
- $[66] = t11;
252
- } else t11 = $[66];
253
- useEffect(t10, t11);
220
+ $[57] = onChange;
221
+ $[58] = state.timeValue;
222
+ $[59] = t8;
223
+ } else t8 = $[59];
224
+ let t9;
225
+ if ($[60] !== rest.date) {
226
+ t9 = [rest.date];
227
+ $[60] = rest.date;
228
+ $[61] = t9;
229
+ } else t9 = $[61];
230
+ useEffect(t8, t9);
254
231
  const timeFieldRef = useRef(null);
255
- let t12;
256
- if ($[67] !== disableManualEntry || $[68] !== label || $[69] !== rest) {
257
- t12 = {
232
+ let t10;
233
+ if ($[62] !== disableManualEntry || $[63] !== label || $[64] !== rest) {
234
+ t10 = {
258
235
  ...rest,
259
236
  label,
260
237
  isReadOnly: disableManualEntry
261
238
  };
262
- $[67] = disableManualEntry;
263
- $[68] = label;
264
- $[69] = rest;
265
- $[70] = t12;
266
- } else t12 = $[70];
267
- const { labelProps, fieldProps } = useTimeField(t12, state, timeFieldRef);
268
- const t13 = hideLabel || isHeaderHidden;
269
- let t14;
270
- if ($[71] !== headerClassName || $[72] !== helperText || $[73] !== isDisabled || $[74] !== isRequired || $[75] !== label || $[76] !== labelProps || $[77] !== rightContent || $[78] !== t13 || $[79] !== tooltipText) {
271
- t14 = {
239
+ $[62] = disableManualEntry;
240
+ $[63] = label;
241
+ $[64] = rest;
242
+ $[65] = t10;
243
+ } else t10 = $[65];
244
+ const { labelProps, fieldProps } = useTimeField(t10, state, timeFieldRef);
245
+ const t11 = hideLabel || isHeaderHidden;
246
+ let t12;
247
+ if ($[66] !== headerClassName || $[67] !== helperText || $[68] !== isDisabled || $[69] !== isRequired || $[70] !== label || $[71] !== labelProps || $[72] !== rightContent || $[73] !== t11 || $[74] !== tooltipText) {
248
+ t12 = {
272
249
  label,
273
250
  tooltipText,
274
251
  helperText,
275
252
  isRequired,
276
253
  rightContent,
277
- isHeaderHidden: t13,
254
+ isHeaderHidden: t11,
278
255
  isDisabled,
279
256
  className: headerClassName,
280
257
  labelProps
281
258
  };
282
- $[71] = headerClassName;
283
- $[72] = helperText;
284
- $[73] = isDisabled;
285
- $[74] = isRequired;
286
- $[75] = label;
287
- $[76] = labelProps;
288
- $[77] = rightContent;
289
- $[78] = t13;
290
- $[79] = tooltipText;
291
- $[80] = t14;
292
- } else t14 = $[80];
293
- const headerProps = t14;
294
- let t15;
295
- if ($[81] !== dialogState.value || $[82] !== fireBlurOnChange || $[83] !== handleBlur || $[84] !== state) {
296
- t15 = () => {
259
+ $[66] = headerClassName;
260
+ $[67] = helperText;
261
+ $[68] = isDisabled;
262
+ $[69] = isRequired;
263
+ $[70] = label;
264
+ $[71] = labelProps;
265
+ $[72] = rightContent;
266
+ $[73] = t11;
267
+ $[74] = tooltipText;
268
+ $[75] = t12;
269
+ } else t12 = $[75];
270
+ const headerProps = t12;
271
+ let t13;
272
+ if ($[76] !== dialogState.value || $[77] !== fireBlurOnChange || $[78] !== handleBlur || $[79] !== state) {
273
+ t13 = () => {
297
274
  const newValue = dialogState.value;
298
275
  state.setValue(newValue);
299
276
  setIsOpen(false);
300
277
  if (fireBlurOnChange) handleBlur(newValue);
301
278
  };
302
- $[81] = dialogState.value;
303
- $[82] = fireBlurOnChange;
304
- $[83] = handleBlur;
305
- $[84] = state;
306
- $[85] = t15;
307
- } else t15 = $[85];
308
- const onApply = t15;
309
- let t16;
310
- if ($[86] !== dialogState || $[87] !== isOpen || $[88] !== state.value) {
311
- t16 = (open) => {
279
+ $[76] = dialogState.value;
280
+ $[77] = fireBlurOnChange;
281
+ $[78] = handleBlur;
282
+ $[79] = state;
283
+ $[80] = t13;
284
+ } else t13 = $[80];
285
+ const onApply = t13;
286
+ let t14;
287
+ if ($[81] !== dialogState || $[82] !== isOpen || $[83] !== state.value) {
288
+ t14 = (open) => {
312
289
  setIsOpen(open);
313
290
  if (!isOpen) dialogState.setValue(state.value);
314
291
  };
315
- $[86] = dialogState;
316
- $[87] = isOpen;
317
- $[88] = state.value;
318
- $[89] = t16;
319
- } else t16 = $[89];
320
- const onOpenChange = t16;
321
- let t17;
322
- if ($[90] !== dialogState || $[91] !== state.value) {
323
- t17 = () => {
292
+ $[81] = dialogState;
293
+ $[82] = isOpen;
294
+ $[83] = state.value;
295
+ $[84] = t14;
296
+ } else t14 = $[84];
297
+ const onOpenChange = t14;
298
+ let t15;
299
+ if ($[85] !== dialogState || $[86] !== state.value) {
300
+ t15 = () => {
324
301
  dialogState.setValue(state.value);
325
302
  setIsOpen(true);
326
303
  };
327
- $[90] = dialogState;
328
- $[91] = state.value;
329
- $[92] = t17;
330
- } else t17 = $[92];
331
- const onOpen = t17;
332
- let t18;
333
- if ($[93] !== dialogState || $[94] !== onChange) {
334
- t18 = () => {
304
+ $[85] = dialogState;
305
+ $[86] = state.value;
306
+ $[87] = t15;
307
+ } else t15 = $[87];
308
+ const onOpen = t15;
309
+ let t16;
310
+ if ($[88] !== onChange) {
311
+ t16 = () => {
335
312
  onChange?.(null);
336
- dialogState.setValue(null);
337
313
  };
338
- $[93] = dialogState;
339
- $[94] = onChange;
340
- $[95] = t18;
341
- } else t18 = $[95];
342
- const onInputClear = t18;
314
+ $[88] = onChange;
315
+ $[89] = t16;
316
+ } else t16 = $[89];
317
+ const onInputClear = t16;
318
+ const t17 = as === "inline" ? -1 : void 0;
319
+ let t18;
320
+ if ($[90] !== className) {
321
+ t18 = clsx("relative inline-flex w-full flex-col text-left", className);
322
+ $[90] = className;
323
+ $[91] = t18;
324
+ } else t18 = $[91];
343
325
  const t19 = as === "inline" ? -1 : void 0;
344
326
  let t20;
345
- if ($[96] !== className) {
346
- t20 = clsx("relative inline-flex w-full flex-col text-left", className);
347
- $[96] = className;
348
- $[97] = t20;
349
- } else t20 = $[97];
350
- const t21 = as === "inline" ? -1 : void 0;
327
+ if ($[92] !== ref) {
328
+ t20 = mergeRefs(ref, timeFieldRef);
329
+ $[92] = ref;
330
+ $[93] = t20;
331
+ } else t20 = $[93];
332
+ const t21 = !!error;
351
333
  let t22;
352
- if ($[98] !== ref) {
353
- t22 = mergeRefs(ref, timeFieldRef);
354
- $[98] = ref;
355
- $[99] = t22;
356
- } else t22 = $[99];
357
- const t23 = !!error;
358
- let t24;
359
- if ($[100] !== as || $[101] !== disableDropdown || $[102] !== disableManualEntry || $[103] !== fieldProps || $[104] !== fireBlurOnChange || $[105] !== headerProps || $[106] !== inputClassName || $[107] !== isClearable || $[108] !== isDirty || $[109] !== isDisabled || $[110] !== isRequired || $[111] !== onInputClear || $[112] !== onOpen || $[113] !== placeholder || $[114] !== size || $[115] !== state || $[116] !== t22 || $[117] !== t23 || $[118] !== variant) {
360
- t24 = /* @__PURE__ */ jsx(TimePickerInput, {
361
- ref: t22,
334
+ if ($[94] !== as || $[95] !== disableDropdown || $[96] !== disableManualEntry || $[97] !== fieldProps || $[98] !== fireBlurOnChange || $[99] !== headerProps || $[100] !== inputClassName || $[101] !== isClearable || $[102] !== isDirty || $[103] !== isDisabled || $[104] !== isRequired || $[105] !== onInputClear || $[106] !== onOpen || $[107] !== placeholder || $[108] !== size || $[109] !== state || $[110] !== t20 || $[111] !== t21 || $[112] !== variant) {
335
+ t22 = /* @__PURE__ */ jsx(TimePickerInput, {
336
+ ref: t20,
362
337
  as,
363
338
  fieldProps,
364
339
  state,
@@ -366,7 +341,7 @@ var TimePickerBase = (props) => {
366
341
  isDisabled,
367
342
  isDirty,
368
343
  isRequired,
369
- isInvalid: t23,
344
+ isInvalid: t21,
370
345
  disableDropdown,
371
346
  variant,
372
347
  size,
@@ -378,30 +353,30 @@ var TimePickerBase = (props) => {
378
353
  onClear: onInputClear,
379
354
  fireBlurOnChange
380
355
  });
381
- $[100] = as;
382
- $[101] = disableDropdown;
383
- $[102] = disableManualEntry;
384
- $[103] = fieldProps;
385
- $[104] = fireBlurOnChange;
386
- $[105] = headerProps;
387
- $[106] = inputClassName;
388
- $[107] = isClearable;
389
- $[108] = isDirty;
390
- $[109] = isDisabled;
391
- $[110] = isRequired;
392
- $[111] = onInputClear;
393
- $[112] = onOpen;
394
- $[113] = placeholder;
395
- $[114] = size;
396
- $[115] = state;
397
- $[116] = t22;
398
- $[117] = t23;
399
- $[118] = variant;
400
- $[119] = t24;
401
- } else t24 = $[119];
402
- let t25;
403
- if ($[120] !== dialogState || $[121] !== disableDropdown || $[122] !== disableManualEntry || $[123] !== isDisabled || $[124] !== isOpen || $[125] !== label || $[126] !== onApply || $[127] !== onOpenChange) {
404
- t25 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
356
+ $[94] = as;
357
+ $[95] = disableDropdown;
358
+ $[96] = disableManualEntry;
359
+ $[97] = fieldProps;
360
+ $[98] = fireBlurOnChange;
361
+ $[99] = headerProps;
362
+ $[100] = inputClassName;
363
+ $[101] = isClearable;
364
+ $[102] = isDirty;
365
+ $[103] = isDisabled;
366
+ $[104] = isRequired;
367
+ $[105] = onInputClear;
368
+ $[106] = onOpen;
369
+ $[107] = placeholder;
370
+ $[108] = size;
371
+ $[109] = state;
372
+ $[110] = t20;
373
+ $[111] = t21;
374
+ $[112] = variant;
375
+ $[113] = t22;
376
+ } else t22 = $[113];
377
+ let t23;
378
+ if ($[114] !== dialogState || $[115] !== disableDropdown || $[116] !== disableManualEntry || $[117] !== isDisabled || $[118] !== isOpen || $[119] !== label || $[120] !== onApply || $[121] !== onOpenChange) {
379
+ t23 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
405
380
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
406
381
  isDisabled,
407
382
  onApply,
@@ -413,50 +388,50 @@ var TimePickerBase = (props) => {
413
388
  onOpenChange,
414
389
  children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
415
390
  });
416
- $[120] = dialogState;
417
- $[121] = disableDropdown;
418
- $[122] = disableManualEntry;
419
- $[123] = isDisabled;
420
- $[124] = isOpen;
421
- $[125] = label;
422
- $[126] = onApply;
423
- $[127] = onOpenChange;
424
- $[128] = t25;
425
- } else t25 = $[128];
426
- let t26;
427
- if ($[129] !== as || $[130] !== formFieldProps || $[131] !== labelProps || $[132] !== t20 || $[133] !== t21 || $[134] !== t24 || $[135] !== t25) {
428
- t26 = /* @__PURE__ */ jsxs(FormField, {
391
+ $[114] = dialogState;
392
+ $[115] = disableDropdown;
393
+ $[116] = disableManualEntry;
394
+ $[117] = isDisabled;
395
+ $[118] = isOpen;
396
+ $[119] = label;
397
+ $[120] = onApply;
398
+ $[121] = onOpenChange;
399
+ $[122] = t23;
400
+ } else t23 = $[122];
401
+ let t24;
402
+ if ($[123] !== as || $[124] !== formFieldProps || $[125] !== labelProps || $[126] !== t18 || $[127] !== t19 || $[128] !== t22 || $[129] !== t23) {
403
+ t24 = /* @__PURE__ */ jsxs(FormField, {
429
404
  ...formFieldProps,
430
405
  as,
431
406
  labelProps,
432
- className: t20,
433
- tabIndex: t21,
434
- children: [t24, t25]
407
+ className: t18,
408
+ tabIndex: t19,
409
+ children: [t22, t23]
435
410
  });
436
- $[129] = as;
437
- $[130] = formFieldProps;
438
- $[131] = labelProps;
439
- $[132] = t20;
440
- $[133] = t21;
441
- $[134] = t24;
442
- $[135] = t25;
443
- $[136] = t26;
444
- } else t26 = $[136];
445
- let t27;
446
- if ($[137] !== as || $[138] !== error || $[139] !== t19 || $[140] !== t26) {
447
- t27 = /* @__PURE__ */ jsx(TooltipWrapper, {
411
+ $[123] = as;
412
+ $[124] = formFieldProps;
413
+ $[125] = labelProps;
414
+ $[126] = t18;
415
+ $[127] = t19;
416
+ $[128] = t22;
417
+ $[129] = t23;
418
+ $[130] = t24;
419
+ } else t24 = $[130];
420
+ let t25;
421
+ if ($[131] !== as || $[132] !== error || $[133] !== t17 || $[134] !== t24) {
422
+ t25 = /* @__PURE__ */ jsx(TooltipWrapper, {
448
423
  as,
449
424
  error,
450
- triggerTabIndex: t19,
451
- children: t26
425
+ triggerTabIndex: t17,
426
+ children: t24
452
427
  });
453
- $[137] = as;
454
- $[138] = error;
455
- $[139] = t19;
456
- $[140] = t26;
457
- $[141] = t27;
458
- } else t27 = $[141];
459
- return t27;
428
+ $[131] = as;
429
+ $[132] = error;
430
+ $[133] = t17;
431
+ $[134] = t24;
432
+ $[135] = t25;
433
+ } else t25 = $[135];
434
+ return t25;
460
435
  };
461
436
  var TimePickerInner = (t0) => {
462
437
  const $ = c(9);
@@ -584,7 +559,7 @@ var TimePicker = (t0) => {
584
559
  ...innerProps,
585
560
  ref: mergeRefs(ref, field.ref),
586
561
  value: field.value ?? null,
587
- onChange: (value) => field.onChange(value ?? null),
562
+ onChange: field.onChange,
588
563
  onBlur: field.onBlur,
589
564
  isDirty,
590
565
  isDisabled: field.disabled || props.isDisabled,
@@ -631,7 +606,7 @@ function _temp(input) {
631
606
  return input.querySelector("input, button, [tabindex]:not([tabindex='-1'])");
632
607
  }
633
608
  function _temp2(isoString) {
634
- if (isoString == null) return isoString;
609
+ if (isoString == null) return null;
635
610
  return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, "UTC"));
636
611
  }
637
612
  //#endregion
@@ -85,12 +85,14 @@ var DatePickerInput = (t0) => {
85
85
  t11 = () => {
86
86
  dateFieldRef.current?.clearField();
87
87
  endDateFieldRef.current?.clearField();
88
- fieldProps.onChange?.(null);
89
- endFieldProps?.onChange?.(null);
90
88
  if (onClearProp) onClearProp();
91
- else if (fireBlurOnChange) {
92
- fieldProps.onBlur?.(null);
93
- endFieldProps?.onBlur?.(null);
89
+ else {
90
+ fieldProps.onChange?.(null);
91
+ endFieldProps?.onChange?.(null);
92
+ if (fireBlurOnChange) {
93
+ fieldProps.onBlur?.(null);
94
+ endFieldProps?.onBlur?.(null);
95
+ }
94
96
  }
95
97
  setCanClear(false);
96
98
  };
@@ -55,62 +55,56 @@ var DateSegmentItem = (t0) => {
55
55
  return t5;
56
56
  };
57
57
  var DateSegmentItemView = (t0) => {
58
- const $ = c(20);
58
+ const $ = c(17);
59
59
  const { ref, segmentProps, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
60
60
  const t1 = isDisabled && "text-interactive-text-secondary-disabled";
61
61
  const t2 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
62
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];
63
+ const t4 = type && (type === "hour" && !timePickerOnly || type === "dayPeriod") && "ml-1";
70
64
  const t5 = hidePlaceholder && "opacity-0";
71
65
  let t6;
72
- if ($[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== t5) {
66
+ if ($[0] !== t1 || $[1] !== t2 || $[2] !== t3 || $[3] !== t4 || $[4] !== t5) {
73
67
  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];
68
+ $[0] = t1;
69
+ $[1] = t2;
70
+ $[2] = t3;
71
+ $[3] = t4;
72
+ $[4] = t5;
73
+ $[5] = t6;
74
+ } else t6 = $[5];
81
75
  let t7;
82
- if ($[9] !== isPlaceholder || $[10] !== placeholder) {
76
+ if ($[6] !== isPlaceholder || $[7] !== placeholder) {
83
77
  t7 = isPlaceholder && /* @__PURE__ */ jsx("span", {
84
78
  "aria-hidden": "true",
85
79
  className: "pointer-events-none",
86
80
  children: placeholder
87
81
  });
88
- $[9] = isPlaceholder;
89
- $[10] = placeholder;
90
- $[11] = t7;
91
- } else t7 = $[11];
82
+ $[6] = isPlaceholder;
83
+ $[7] = placeholder;
84
+ $[8] = t7;
85
+ } else t7 = $[8];
92
86
  const t8 = isPlaceholder ? "" : text;
93
87
  let t9;
94
- if ($[12] !== t7 || $[13] !== t8) {
88
+ if ($[9] !== t7 || $[10] !== t8) {
95
89
  t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
96
- $[12] = t7;
97
- $[13] = t8;
98
- $[14] = t9;
99
- } else t9 = $[14];
90
+ $[9] = t7;
91
+ $[10] = t8;
92
+ $[11] = t9;
93
+ } else t9 = $[11];
100
94
  let t10;
101
- if ($[15] !== ref || $[16] !== segmentProps || $[17] !== t6 || $[18] !== t9) {
95
+ if ($[12] !== ref || $[13] !== segmentProps || $[14] !== t6 || $[15] !== t9) {
102
96
  t10 = /* @__PURE__ */ jsx("div", {
103
97
  ...segmentProps,
104
98
  ref,
105
99
  className: t6,
106
100
  children: t9
107
101
  });
108
- $[15] = ref;
109
- $[16] = segmentProps;
110
- $[17] = t6;
111
- $[18] = t9;
112
- $[19] = t10;
113
- } else t10 = $[19];
102
+ $[12] = ref;
103
+ $[13] = segmentProps;
104
+ $[14] = t6;
105
+ $[15] = t9;
106
+ $[16] = t10;
107
+ } else t10 = $[16];
114
108
  return t10;
115
109
  };
116
110
  //#endregion
@@ -47,7 +47,7 @@ var InputClear = (t0) => {
47
47
  return t1;
48
48
  };
49
49
  var InputClearButton = (t0) => {
50
- const $ = c(13);
50
+ const $ = c(10);
51
51
  const { onClear, className, style, show } = t0;
52
52
  const { t } = useTranslation("ui");
53
53
  const t1 = !show && "invisible!";
@@ -65,35 +65,23 @@ var InputClearButton = (t0) => {
65
65
  $[4] = t3;
66
66
  } else t3 = $[4];
67
67
  let t4;
68
- if ($[5] !== onClear) {
69
- t4 = (event) => {
70
- event.preventDefault();
71
- event.stopPropagation();
72
- onClear();
73
- };
74
- $[5] = onClear;
75
- $[6] = t4;
76
- } else t4 = $[6];
77
- let t5;
78
- if ($[7] !== onClear || $[8] !== style || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
79
- t5 = /* @__PURE__ */ jsx(InlineIconButton, {
68
+ if ($[5] !== onClear || $[6] !== style || $[7] !== t2 || $[8] !== t3) {
69
+ t4 = /* @__PURE__ */ jsx(InlineIconButton, {
80
70
  color: "secondary",
81
71
  className: t2,
82
72
  label: t3,
83
73
  icon: CloseIcon,
84
74
  onPress: onClear,
85
- onPointerDown: t4,
86
75
  excludeFromTabOrder: true,
87
76
  style
88
77
  });
89
- $[7] = onClear;
90
- $[8] = style;
91
- $[9] = t2;
92
- $[10] = t3;
93
- $[11] = t4;
94
- $[12] = t5;
95
- } else t5 = $[12];
96
- return t5;
78
+ $[5] = onClear;
79
+ $[6] = style;
80
+ $[7] = t2;
81
+ $[8] = t3;
82
+ $[9] = t4;
83
+ } else t4 = $[9];
84
+ return t4;
97
85
  };
98
86
  function _temp($) {
99
87
  return $.ui.clearAlt;
@@ -4,7 +4,7 @@ import { DateTime } from "luxon";
4
4
  var DateTimeUtils;
5
5
  (function(_DateTimeUtils) {
6
6
  const DATE_SAMPLE_DATE_UTC = new Date(Date.UTC(2e3, 10, 22));
7
- const TIME_SAMPLE_DATE_UTC = new Date(Date.UTC(2e3, 10, 22, 13, 45));
7
+ const TIME_SAMPLE_DATE_UTC = new Date(Date.UTC(2e3, 10, 22, 6, 45));
8
8
  const getDayMonthFormat = (shouldForceLeadingZeros = false) => shouldForceLeadingZeros ? "2-digit" : "numeric";
9
9
  const getDatePlaceholderFormatter = (locale, options) => new Intl.DateTimeFormat(locale, {
10
10
  day: getDayMonthFormat(options?.shouldForceLeadingZeros),
@@ -13,8 +13,7 @@ var DateTimeUtils;
13
13
  });
14
14
  const getTimePlaceholderFormatter = (locale) => new Intl.DateTimeFormat(locale, {
15
15
  hour: "2-digit",
16
- minute: "2-digit",
17
- hourCycle: "h23"
16
+ minute: "2-digit"
18
17
  });
19
18
  const getResolvedLocale = (locale) => {
20
19
  if (locale) return locale;
@@ -27,18 +26,16 @@ var DateTimeUtils;
27
26
  timeZone: "UTC"
28
27
  });
29
28
  const getTimeFormatter = (locale) => new DateFormatter(getResolvedLocale(locale), {
30
- hour: "2-digit",
29
+ hour: "numeric",
31
30
  minute: "2-digit",
32
- hourCycle: "h23",
33
31
  timeZone: "UTC"
34
32
  });
35
33
  const getDateTimeFormatter = (locale, options) => new Intl.DateTimeFormat(getResolvedLocale(locale), {
36
34
  day: getDayMonthFormat(options?.shouldForceLeadingZeros),
37
35
  month: getDayMonthFormat(options?.shouldForceLeadingZeros),
38
36
  year: "numeric",
39
- hour: "2-digit",
37
+ hour: "numeric",
40
38
  minute: "2-digit",
41
- hourCycle: "h23",
42
39
  timeZone: "UTC"
43
40
  });
44
41
  const getLocaleDateFormat = (locale) => {
@@ -71,9 +68,9 @@ var DateTimeUtils;
71
68
  }
72
69
  };
73
70
  const formatPlaceholder = (formatter, sampleDate) => {
74
- return formatter.formatToParts(sampleDate).map((part) => mapTypeToPlaceholder(part.type, formatter.resolvedOptions().locale) ?? part.value.replace(/\s+/gu, "")).join("");
71
+ return formatter.formatToParts(sampleDate).map((part) => mapTypeToPlaceholder(part.type, formatter.resolvedOptions().locale) ?? part.value).join("");
75
72
  };
76
- const removeDateSeparatorSpacing = (value) => value.replace(/([./-])\s+(?=\d)/gu, "$1");
73
+ const removeDateSeparatorSpacing = (value) => value.replace(/([./-])\s+(?=[\p{Letter}\p{Number}])/gu, "$1");
77
74
  const formatLocalizedDateParts = (formatter, date) => {
78
75
  return removeDateSeparatorSpacing(formatter.format(date));
79
76
  };
@@ -89,7 +86,7 @@ var DateTimeUtils;
89
86
  });
90
87
  };
91
88
  function getDatePlaceholder(locale, options) {
92
- return formatPlaceholder(getDatePlaceholderFormatter(locale, options), DATE_SAMPLE_DATE_UTC);
89
+ return removeDateSeparatorSpacing(formatPlaceholder(getDatePlaceholderFormatter(locale, options), DATE_SAMPLE_DATE_UTC));
93
90
  }
94
91
  _DateTimeUtils.getDatePlaceholder = getDatePlaceholder;
95
92
  function getTimePlaceholder(locale) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.3.0-rc.36",
3
+ "version": "2.3.0-rc.38",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",