@povio/ui 2.3.0-rc.37 → 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.
@@ -294,7 +294,7 @@ var DatePickerInner = (t0) => {
294
294
  let t5;
295
295
  if ($[5] !== fullIso || $[6] !== normalizeByGranularity) {
296
296
  t5 = (formattedDate) => {
297
- if (formattedDate == null) return formattedDate;
297
+ if (formattedDate == null) return null;
298
298
  if (fullIso) return normalizeByGranularity(DateTimeUtils.fromUTCISOToCalendarDate(formattedDate));
299
299
  const date_1 = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
300
300
  return normalizeByGranularity(toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date_1, "UTC")));
@@ -614,7 +614,7 @@ var DateRangePickerInner = (t0) => {
614
614
  let t3;
615
615
  if ($[2] !== fullIso) {
616
616
  t3 = (formattedRange) => {
617
- if (!formattedRange?.start || !formattedRange?.end) return formattedRange;
617
+ if (!formattedRange?.start || !formattedRange?.end) return null;
618
618
  if (fullIso) return {
619
619
  start: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.start),
620
620
  end: DateTimeUtils.fromUTCISOToCalendarDate(formattedRange.end)
@@ -635,7 +635,7 @@ var DateRangePickerInner = (t0) => {
635
635
  let t4;
636
636
  if ($[4] !== fullIso) {
637
637
  t4 = (formattedDate) => {
638
- if (formattedDate == null) return formattedDate;
638
+ if (formattedDate == null) return null;
639
639
  if (fullIso) return DateTimeUtils.fromUTCISOToCalendarDate(formattedDate);
640
640
  const date = DateTime.fromISO(formattedDate, { zone: "UTC" }).toJSDate();
641
641
  return toCalendarDate(DateTimeUtils.fromLocalToZonedDateTime(date, "UTC"));
@@ -163,7 +163,7 @@ var DateTimePickerBase = (props) => {
163
163
  dialogState.setValue(state.value);
164
164
  return;
165
165
  }
166
- const textValue = e?.currentTarget.textContent ?? null;
166
+ const textValue = e?.currentTarget?.textContent ?? null;
167
167
  const dateTimeValue = DateTimeUtils.formatTextDateToCalendarDateTime(textValue, effectiveTimeZone, locale);
168
168
  if (dateTimeValue) {
169
169
  state.setValue(dateTimeValue);
@@ -435,7 +435,7 @@ function _temp2(dateValue) {
435
435
  return DateTimeUtils.fromDateValueFieldsToUTCISO(dateValue);
436
436
  }
437
437
  function _temp3(isoString) {
438
- if (isoString == null) return isoString;
438
+ if (isoString == null) return null;
439
439
  return DateTimeUtils.fromUTCISOToCalendarDateTime(isoString, "UTC");
440
440
  }
441
441
  //#endregion
@@ -606,7 +606,7 @@ function _temp(input) {
606
606
  return input.querySelector("input, button, [tabindex]:not([tabindex='-1'])");
607
607
  }
608
608
  function _temp2(isoString) {
609
- if (isoString == null) return isoString;
609
+ if (isoString == null) return null;
610
610
  return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, "UTC"));
611
611
  }
612
612
  //#endregion
@@ -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
@@ -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.37",
3
+ "version": "2.3.0-rc.38",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",