@povio/ui 2.3.0-rc.13 → 2.3.0-rc.15

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.
@@ -19,10 +19,11 @@ import { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState
19
19
  import { useDatePicker, useLocale } from "react-aria";
20
20
  import { mergeRefs } from "@react-aria/utils";
21
21
  import { Controller, useWatch } from "react-hook-form";
22
- import { createCalendar, getLocalTimeZone, toCalendarDate, today } from "@internationalized/date";
22
+ import { createCalendar, toCalendarDate, today } from "@internationalized/date";
23
23
  import { DateTime } from "luxon";
24
24
  import { useCalendarState, useDatePickerState } from "react-stately";
25
25
  //#region src/components/inputs/DateTime/DatePicker/DatePicker.tsx
26
+ var DATE_PICKER_TIME_ZONE = "UTC";
26
27
  var DatePickerBase = (props) => {
27
28
  const ui = UIConfig.useConfig();
28
29
  const { ref, label, tooltipText, helperText, isRequired, rightContent, isDirty, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, className, placeholder, inputClassName, as: asProp, hideLabel: hideLabelProp, variant: variantProp, size: sizeProp, isClearable: isClearableProp, todayIcon: todayIconProp, todayIconButtonSize: todayIconButtonSizeProp, todayIconPlacement: todayIconPlacementProp, shouldForceLeadingZeros: shouldForceLeadingZerosProp, disableManualEntry: disableManualEntryProp, shouldUpdateDateOnMonthYearChange: shouldUpdateDateOnMonthYearChangeProp, granularity: granularityProp, autoFixYear: autoFixYearProp, format, ...rest } = props;
@@ -98,7 +99,7 @@ var DatePickerBase = (props) => {
98
99
  calendarState.setFocusedDate(normalizedValue);
99
100
  return;
100
101
  }
101
- calendarState.setFocusedDate(today(getLocalTimeZone()));
102
+ calendarState.setFocusedDate(today(DATE_PICKER_TIME_ZONE));
102
103
  },
103
104
  shouldCloseOnSelect: false
104
105
  });
@@ -137,7 +138,7 @@ var DatePickerBase = (props) => {
137
138
  };
138
139
  const onMonthYearChange = (selectedDate) => {
139
140
  if (!(shouldUpdateDateOnMonthYearChange || granularity !== "day")) return;
140
- const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(getLocalTimeZone())).set({
141
+ const updatedDate = normalizeByGranularity((dialogState.value || state.value || today(DATE_PICKER_TIME_ZONE)).set({
141
142
  year: selectedDate.year,
142
143
  month: selectedDate.month
143
144
  }));
@@ -148,7 +149,7 @@ var DatePickerBase = (props) => {
148
149
  onApply();
149
150
  };
150
151
  const onTodayPress = () => {
151
- const todayValue = normalizeByGranularity(today(getLocalTimeZone()));
152
+ const todayValue = normalizeByGranularity(today(DATE_PICKER_TIME_ZONE));
152
153
  dialogState.setValue(todayValue);
153
154
  calendarState.setFocusedDate(todayValue);
154
155
  };
@@ -156,7 +157,7 @@ var DatePickerBase = (props) => {
156
157
  if (!state.isOpen) return;
157
158
  if (granularity !== "year") return;
158
159
  if (dialogState.value) return;
159
- const defaultYearValue = normalizeByGranularity(today(getLocalTimeZone()));
160
+ const defaultYearValue = normalizeByGranularity(today(DATE_PICKER_TIME_ZONE));
160
161
  dialogState.setValue(defaultYearValue);
161
162
  calendarState.setFocusedDate(defaultYearValue);
162
163
  }, [
@@ -170,7 +171,7 @@ var DatePickerBase = (props) => {
170
171
  const onOpenChange = (isOpen) => {
171
172
  state.toggle();
172
173
  if (state.value) calendarState.setFocusedDate(normalizeByGranularity(state.value));
173
- if (!state.value) calendarState.setFocusedDate(today(getLocalTimeZone()));
174
+ if (!state.value) calendarState.setFocusedDate(today(DATE_PICKER_TIME_ZONE));
174
175
  if (!isOpen) dialogState.setValue(state.value);
175
176
  };
176
177
  return /* @__PURE__ */ jsx(TooltipWrapper, {
@@ -206,7 +207,8 @@ var DatePickerBase = (props) => {
206
207
  placeholder,
207
208
  className: inputClassName,
208
209
  dateGranularity: granularity,
209
- format
210
+ format,
211
+ timeZone: DATE_PICKER_TIME_ZONE
210
212
  }), (!disableDropdown || disableManualEntry) && state.isOpen && /* @__PURE__ */ jsx(DateTimeDialog, {
211
213
  footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
212
214
  isDisabled,
@@ -23,10 +23,11 @@ import { useDateRangePicker, useLocale as useLocale$1 } from "react-aria";
23
23
  import { mergeRefs } from "@react-aria/utils";
24
24
  import { useTranslation } from "react-i18next";
25
25
  import { Controller, useWatch } from "react-hook-form";
26
- import { createCalendar, endOfMonth, endOfWeek, endOfYear, getLocalTimeZone, startOfMonth, startOfWeek, startOfYear, toCalendarDate, today } from "@internationalized/date";
26
+ import { createCalendar, endOfMonth, endOfWeek, endOfYear, startOfMonth, startOfWeek, startOfYear, toCalendarDate, today } from "@internationalized/date";
27
27
  import { DateTime } from "luxon";
28
28
  import { useDateRangePickerState, useRangeCalendarState } from "react-stately";
29
29
  //#region src/components/inputs/DateTime/DateRangePicker/DateRangePicker.tsx
30
+ var DATE_PICKER_TIME_ZONE = "UTC";
30
31
  var DateRangePickerBase = (props) => {
31
32
  const ui = UIConfig.useConfig();
32
33
  const { t } = useTranslation();
@@ -114,7 +115,7 @@ var DateRangePickerBase = (props) => {
114
115
  createCalendar,
115
116
  pageBehavior: "single",
116
117
  visibleDuration: { months: 1 },
117
- defaultFocusedValue: today(getLocalTimeZone()).add({ months: 1 }),
118
+ defaultFocusedValue: today(DATE_PICKER_TIME_ZONE).add({ months: 1 }),
118
119
  minValue: void 0,
119
120
  maxValue: void 0
120
121
  });
@@ -354,7 +355,7 @@ var DateRangePickerBase = (props) => {
354
355
  state.toggle();
355
356
  };
356
357
  const onTodayPress = () => {
357
- const todayDate = today(getLocalTimeZone());
358
+ const todayDate = today(DATE_PICKER_TIME_ZONE);
358
359
  leftCalendarState.setFocusedDate(todayDate);
359
360
  rightCalendarState.setFocusedDate(todayDate.add({ months: 1 }));
360
361
  syncCalendarStates({
@@ -369,8 +370,8 @@ var DateRangePickerBase = (props) => {
369
370
  dialogState.setValue(state.value);
370
371
  leftCalendarState.setValue(state.value);
371
372
  rightCalendarState.setValue(state.value);
372
- const startDate_1 = state.value.start || today(getLocalTimeZone());
373
- const endDate_1 = state.value.end || today(getLocalTimeZone()).add({ months: 1 });
373
+ const startDate_1 = state.value.start || today(DATE_PICKER_TIME_ZONE);
374
+ const endDate_1 = state.value.end || today(DATE_PICKER_TIME_ZONE).add({ months: 1 });
374
375
  leftCalendarState.setFocusedDate(startDate_1);
375
376
  if (startDate_1.year === endDate_1.year && startDate_1.month === endDate_1.month) rightCalendarState.setFocusedDate(startDate_1.add({ months: 1 }));
376
377
  else rightCalendarState.setFocusedDate(endDate_1);
@@ -382,7 +383,7 @@ var DateRangePickerBase = (props) => {
382
383
  }
383
384
  }
384
385
  };
385
- const todayDate_0 = today(getLocalTimeZone());
386
+ const todayDate_0 = today(DATE_PICKER_TIME_ZONE);
386
387
  const getThisWeekRange = () => {
387
388
  return {
388
389
  start: startOfWeek(todayDate_0, locale),
@@ -511,7 +512,8 @@ var DateRangePickerBase = (props) => {
511
512
  autoFixYear,
512
513
  placeholder,
513
514
  className: inputClassName,
514
- onOpenDropdown: () => state.toggle()
515
+ onOpenDropdown: () => state.toggle(),
516
+ timeZone: DATE_PICKER_TIME_ZONE
515
517
  }), /* @__PURE__ */ jsx(DateTimeDialog, {
516
518
  hideSidebar,
517
519
  sidebar: /* @__PURE__ */ jsx("div", {
@@ -34,5 +34,5 @@ export interface DateTimePickerProps extends Omit<DateTimePickerBaseProps, "valu
34
34
  timeZone?: string;
35
35
  }
36
36
  export type ControlledDateTimePickerProps<TFieldValues extends FieldValues> = ControlProps<DateTimePickerProps, TFieldValues>;
37
- export declare const DateTimePicker: <TFieldValues extends FieldValues>({ fullIso, renderStaticInput, ...props }: ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const DateTimePicker: <TFieldValues extends FieldValues>({ fullIso: _fullIso, renderStaticInput, ...props }: ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
38
38
  export {};
@@ -19,7 +19,7 @@ import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react
19
19
  import { useDatePicker, useLocale } from "react-aria";
20
20
  import { mergeRefs } from "@react-aria/utils";
21
21
  import { Controller, useWatch } from "react-hook-form";
22
- import { Time, createCalendar, now, toCalendarDateTime, today } from "@internationalized/date";
22
+ import { Time, createCalendar, toCalendarDate, toCalendarDateTime, today } from "@internationalized/date";
23
23
  import { useCalendarState, useDatePickerState } from "react-stately";
24
24
  //#region src/components/inputs/DateTime/DateTimePicker/DateTimePicker.tsx
25
25
  var DateTimePickerBase = (props) => {
@@ -142,8 +142,9 @@ var DateTimePickerBase = (props) => {
142
142
  calendarState.setFocusedDate(selectedDate);
143
143
  };
144
144
  const onTodayPress = () => {
145
- dialogState.setValue(toCalendarDateTime(now(effectiveTimeZone)));
146
- calendarState.setFocusedDate(today(effectiveTimeZone));
145
+ const currentValue = DateTimeUtils.getCurrentWallClockCalendarDateTime();
146
+ dialogState.setValue(currentValue);
147
+ calendarState.setFocusedDate(toCalendarDate(currentValue));
147
148
  };
148
149
  const onOpenChange = (isOpen) => {
149
150
  state.toggle();
@@ -233,7 +234,7 @@ var DateTimePickerBase = (props) => {
233
234
  })
234
235
  });
235
236
  };
236
- var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
237
+ var DateTimePicker = ({ fullIso: _fullIso = true, renderStaticInput, ...props }) => {
237
238
  const ui = UIConfig.useConfig();
238
239
  const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
239
240
  const { locale } = useLocale();
@@ -259,8 +260,7 @@ var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
259
260
  const effectiveTimeZone = "UTC";
260
261
  const formatDateValue = (dateValue) => {
261
262
  if (dateValue === null) return null;
262
- if (fullIso) return DateTimeUtils.fromDateValueToISO(dateValue, effectiveTimeZone);
263
- return DateTimeUtils.fromDateValueToISO(dateValue, effectiveTimeZone);
263
+ return DateTimeUtils.fromDateValueFieldsToUTCISO(dateValue);
264
264
  };
265
265
  const parseDateValue = (isoString) => {
266
266
  if (isoString == null) return isoString;
@@ -2,6 +2,7 @@ import { UIStyle } from "../../../../config/uiStyle.context.js";
2
2
  import { Typography } from "../../../text/Typography/Typography.js";
3
3
  import { UIConfig } from "../../../../config/uiConfig.context.js";
4
4
  import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
5
+ import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
5
6
  import { DateField } from "./DateField.js";
6
7
  import { datePickerInputContentRow } from "./datePickerInput.cva.js";
7
8
  import { getDatePickerTodayIcon } from "./datePickerTodayIcon.js";
@@ -14,10 +15,10 @@ import { clsx } from "clsx";
14
15
  import { useImperativeHandle, useRef, useState } from "react";
15
16
  import { Button } from "react-aria-components";
16
17
  import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
17
- import { getLocalTimeZone, now, toCalendarDateTime, today } from "@internationalized/date";
18
+ import { today } from "@internationalized/date";
18
19
  //#region src/components/inputs/DateTime/shared/DatePickerInput.tsx
19
20
  var DatePickerInput = (t0) => {
20
- const $ = c(98);
21
+ const $ = c(96);
21
22
  const { ref, as, groupProps, fieldProps, endFieldProps, buttonProps, isDisabled, isInvalid, disableDropdown, variant, size, isDateTime, isClearable, headerProps, todayIcon, todayIconButtonSize: t1, todayIconPlacement: t2, isDirty, isRequired, disableManualEntry, autoFixYear: t3, placeholder, className, onOpenDropdown, dateGranularity: t4, timeZone, isTimeOptional: t5, format, ...props } = t0;
22
23
  const todayIconButtonSize = t1 === void 0 ? "none" : t1;
23
24
  const todayIconPlacement = t2 === void 0 ? "content" : t2;
@@ -25,27 +26,21 @@ var DatePickerInput = (t0) => {
25
26
  const dateGranularity = t4 === void 0 ? "day" : t4;
26
27
  const isTimeOptional = t5 === void 0 ? false : t5;
27
28
  const uiConfig = UIConfig.useConfig();
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];
29
+ const effectiveTimeZone = timeZone ?? "UTC";
35
30
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
36
31
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
37
32
  const datePickerInputContentRowCva = UIStyle.useCva("datePickerInput.contentRowCva", datePickerInputContentRow);
38
33
  const [canClear, setCanClear] = useState(false);
39
34
  let t6;
40
- if ($[2] !== isDisabled) {
35
+ if ($[0] !== isDisabled) {
41
36
  t6 = { isDisabled };
42
- $[2] = isDisabled;
43
- $[3] = t6;
44
- } else t6 = $[3];
37
+ $[0] = isDisabled;
38
+ $[1] = t6;
39
+ } else t6 = $[1];
45
40
  const { hoverProps, isHovered } = useHover(t6);
46
41
  const [isFocused, setIsFocused] = useState(false);
47
42
  let t7;
48
- if ($[4] !== autoFixYear) {
43
+ if ($[2] !== autoFixYear) {
49
44
  t7 = { onFocusWithinChange: (isFocusWithin) => {
50
45
  setIsFocused(isFocusWithin);
51
46
  if (!isFocusWithin && autoFixYear) {
@@ -53,16 +48,16 @@ var DatePickerInput = (t0) => {
53
48
  endDateFieldRef.current?.autoFixYear();
54
49
  }
55
50
  } };
56
- $[4] = autoFixYear;
57
- $[5] = t7;
58
- } else t7 = $[5];
51
+ $[2] = autoFixYear;
52
+ $[3] = t7;
53
+ } else t7 = $[3];
59
54
  const { focusWithinProps } = useFocusWithin(t7);
60
55
  const { isFocusVisible } = useFocusVisible();
61
56
  const dateFieldRef = useRef(null);
62
57
  const endDateFieldRef = useRef(null);
63
58
  const containerRef = useRef(null);
64
59
  let t8;
65
- if ($[6] !== endFieldProps || $[7] !== fieldProps) {
60
+ if ($[4] !== endFieldProps || $[5] !== fieldProps) {
66
61
  t8 = () => ({
67
62
  clear: () => {
68
63
  dateFieldRef.current?.clearField();
@@ -75,21 +70,21 @@ var DatePickerInput = (t0) => {
75
70
  },
76
71
  getContainer: () => containerRef.current
77
72
  });
78
- $[6] = endFieldProps;
79
- $[7] = fieldProps;
80
- $[8] = t8;
81
- } else t8 = $[8];
73
+ $[4] = endFieldProps;
74
+ $[5] = fieldProps;
75
+ $[6] = t8;
76
+ } else t8 = $[6];
82
77
  useImperativeHandle(ref, t8);
83
78
  let t9;
84
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
79
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
85
80
  t9 = (canClearInput) => {
86
81
  setCanClear(canClearInput);
87
82
  };
88
- $[9] = t9;
89
- } else t9 = $[9];
83
+ $[7] = t9;
84
+ } else t9 = $[7];
90
85
  const onClearChange = t9;
91
86
  let t10;
92
- if ($[10] !== endFieldProps || $[11] !== fieldProps) {
87
+ if ($[8] !== endFieldProps || $[9] !== fieldProps) {
93
88
  t10 = () => {
94
89
  dateFieldRef.current?.clearField();
95
90
  fieldProps.onChange?.(null);
@@ -99,16 +94,16 @@ var DatePickerInput = (t0) => {
99
94
  fieldProps.onBlur?.(null);
100
95
  endFieldProps?.onBlur?.(null);
101
96
  };
102
- $[10] = endFieldProps;
103
- $[11] = fieldProps;
104
- $[12] = t10;
105
- } else t10 = $[12];
97
+ $[8] = endFieldProps;
98
+ $[9] = fieldProps;
99
+ $[10] = t10;
100
+ } else t10 = $[10];
106
101
  const onClear = t10;
107
102
  let t11;
108
- if ($[13] !== effectiveTimeZone || $[14] !== endFieldProps || $[15] !== fieldProps || $[16] !== isDateTime) {
103
+ if ($[11] !== effectiveTimeZone || $[12] !== endFieldProps || $[13] !== fieldProps || $[14] !== isDateTime) {
109
104
  t11 = () => {
110
105
  if (isDateTime) {
111
- const calendarDateTime = toCalendarDateTime(now(effectiveTimeZone));
106
+ const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
112
107
  fieldProps.onChange?.(calendarDateTime);
113
108
  if (endFieldProps) endFieldProps.onChange?.(calendarDateTime);
114
109
  } else {
@@ -118,23 +113,23 @@ var DatePickerInput = (t0) => {
118
113
  fieldProps.onBlur?.(null);
119
114
  endFieldProps?.onBlur?.(null);
120
115
  };
121
- $[13] = effectiveTimeZone;
122
- $[14] = endFieldProps;
123
- $[15] = fieldProps;
124
- $[16] = isDateTime;
125
- $[17] = t11;
126
- } else t11 = $[17];
116
+ $[11] = effectiveTimeZone;
117
+ $[12] = endFieldProps;
118
+ $[13] = fieldProps;
119
+ $[14] = isDateTime;
120
+ $[15] = t11;
121
+ } else t11 = $[15];
127
122
  const onToday = t11;
128
123
  const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
129
124
  let t12;
130
- if ($[18] !== todayIcon) {
125
+ if ($[16] !== todayIcon) {
131
126
  t12 = getDatePickerTodayIcon(todayIcon);
132
- $[18] = todayIcon;
133
- $[19] = t12;
134
- } else t12 = $[19];
127
+ $[16] = todayIcon;
128
+ $[17] = t12;
129
+ } else t12 = $[17];
135
130
  const todayIconComponent = t12;
136
131
  let t13;
137
- if ($[20] !== onToday || $[21] !== todayIconButtonSize || $[22] !== todayIconComponent) {
132
+ if ($[18] !== onToday || $[19] !== todayIconButtonSize || $[20] !== todayIconComponent) {
138
133
  t13 = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
139
134
  label: "",
140
135
  icon: todayIconComponent,
@@ -142,11 +137,11 @@ var DatePickerInput = (t0) => {
142
137
  onPress: onToday,
143
138
  className: "relative z-1 !border-none"
144
139
  }) : null;
145
- $[20] = onToday;
146
- $[21] = todayIconButtonSize;
147
- $[22] = todayIconComponent;
148
- $[23] = t13;
149
- } else t13 = $[23];
140
+ $[18] = onToday;
141
+ $[19] = todayIconButtonSize;
142
+ $[20] = todayIconComponent;
143
+ $[21] = t13;
144
+ } else t13 = $[21];
150
145
  const todayIconButton = t13;
151
146
  const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
152
147
  const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
@@ -167,49 +162,49 @@ var DatePickerInput = (t0) => {
167
162
  const t24 = isRequired || void 0;
168
163
  const t25 = fieldProps.value !== null || void 0;
169
164
  let t26;
170
- if ($[24] !== as || $[25] !== inputSizeCva || $[26] !== size) {
165
+ if ($[22] !== as || $[23] !== inputSizeCva || $[24] !== size) {
171
166
  t26 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
172
167
  size,
173
168
  as
174
169
  }));
175
- $[24] = as;
176
- $[25] = inputSizeCva;
177
- $[26] = size;
178
- $[27] = t26;
179
- } else t26 = $[27];
170
+ $[22] = as;
171
+ $[23] = inputSizeCva;
172
+ $[24] = size;
173
+ $[25] = t26;
174
+ } else t26 = $[25];
180
175
  let t27;
181
- if ($[28] !== as || $[29] !== headerProps) {
176
+ if ($[26] !== as || $[27] !== headerProps) {
182
177
  t27 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
183
178
  as,
184
179
  ...headerProps
185
180
  });
186
- $[28] = as;
187
- $[29] = headerProps;
188
- $[30] = t27;
189
- } else t27 = $[30];
181
+ $[26] = as;
182
+ $[27] = headerProps;
183
+ $[28] = t27;
184
+ } else t27 = $[28];
190
185
  const t28 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
191
186
  let t29;
192
- if ($[31] !== datePickerInputContentRowCva || $[32] !== size) {
187
+ if ($[29] !== datePickerInputContentRowCva || $[30] !== size) {
193
188
  t29 = datePickerInputContentRowCva({ size });
194
- $[31] = datePickerInputContentRowCva;
195
- $[32] = size;
196
- $[33] = t29;
197
- } else t29 = $[33];
189
+ $[29] = datePickerInputContentRowCva;
190
+ $[30] = size;
191
+ $[31] = t29;
192
+ } else t29 = $[31];
198
193
  let t30;
199
- if ($[34] !== disableManualEntry || $[35] !== isDisabled || $[36] !== onOpenDropdown) {
194
+ if ($[32] !== disableManualEntry || $[33] !== isDisabled || $[34] !== onOpenDropdown) {
200
195
  t30 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
201
196
  onPress: onOpenDropdown,
202
197
  className: "absolute inset-0 z-0",
203
198
  isDisabled
204
199
  });
205
- $[34] = disableManualEntry;
206
- $[35] = isDisabled;
207
- $[36] = onOpenDropdown;
208
- $[37] = t30;
209
- } else t30 = $[37];
200
+ $[32] = disableManualEntry;
201
+ $[33] = isDisabled;
202
+ $[34] = onOpenDropdown;
203
+ $[35] = t30;
204
+ } else t30 = $[35];
210
205
  const t31 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
211
206
  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) {
207
+ if ($[36] !== as || $[37] !== dateGranularity || $[38] !== disableManualEntry || $[39] !== effectiveTimeZone || $[40] !== endFieldProps || $[41] !== fieldProps || $[42] !== format || $[43] !== hidePlaceholder || $[44] !== isDisabled || $[45] !== isInvalid || $[46] !== isTimeOptional || $[47] !== onClearChange || $[48] !== placeholder) {
213
208
  t32 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
214
209
  size: "label-1",
215
210
  className: "text-text-default-3",
@@ -241,23 +236,23 @@ var DatePickerInput = (t0) => {
241
236
  format,
242
237
  timeZone: effectiveTimeZone
243
238
  })] })] });
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];
239
+ $[36] = as;
240
+ $[37] = dateGranularity;
241
+ $[38] = disableManualEntry;
242
+ $[39] = effectiveTimeZone;
243
+ $[40] = endFieldProps;
244
+ $[41] = fieldProps;
245
+ $[42] = format;
246
+ $[43] = hidePlaceholder;
247
+ $[44] = isDisabled;
248
+ $[45] = isInvalid;
249
+ $[46] = isTimeOptional;
250
+ $[47] = onClearChange;
251
+ $[48] = placeholder;
252
+ $[49] = t32;
253
+ } else t32 = $[49];
259
254
  let t33;
260
- if ($[52] !== t29 || $[53] !== t30 || $[54] !== t31 || $[55] !== t32) {
255
+ if ($[50] !== t29 || $[51] !== t30 || $[52] !== t31 || $[53] !== t32) {
261
256
  t33 = /* @__PURE__ */ jsxs("div", {
262
257
  className: t29,
263
258
  children: [
@@ -266,14 +261,14 @@ var DatePickerInput = (t0) => {
266
261
  t32
267
262
  ]
268
263
  });
269
- $[52] = t29;
270
- $[53] = t30;
271
- $[54] = t31;
272
- $[55] = t32;
273
- $[56] = t33;
274
- } else t33 = $[56];
264
+ $[50] = t29;
265
+ $[51] = t30;
266
+ $[52] = t31;
267
+ $[53] = t32;
268
+ $[54] = t33;
269
+ } else t33 = $[54];
275
270
  let t34;
276
- if ($[57] !== t26 || $[58] !== t27 || $[59] !== t28 || $[60] !== t33) {
271
+ if ($[55] !== t26 || $[56] !== t27 || $[57] !== t28 || $[58] !== t33) {
277
272
  t34 = /* @__PURE__ */ jsxs("div", {
278
273
  className: t26,
279
274
  children: [
@@ -282,36 +277,36 @@ var DatePickerInput = (t0) => {
282
277
  t33
283
278
  ]
284
279
  });
285
- $[57] = t26;
286
- $[58] = t27;
287
- $[59] = t28;
288
- $[60] = t33;
289
- $[61] = t34;
290
- } else t34 = $[61];
280
+ $[55] = t26;
281
+ $[56] = t27;
282
+ $[57] = t28;
283
+ $[58] = t33;
284
+ $[59] = t34;
285
+ } else t34 = $[59];
291
286
  let t35;
292
- if ($[62] !== as || $[63] !== inputSizeCva || $[64] !== size) {
287
+ if ($[60] !== as || $[61] !== inputSizeCva || $[62] !== size) {
293
288
  t35 = clsx(inputSizeCva({
294
289
  size,
295
290
  as
296
291
  }), "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];
292
+ $[60] = as;
293
+ $[61] = inputSizeCva;
294
+ $[62] = size;
295
+ $[63] = t35;
296
+ } else t35 = $[63];
302
297
  let t36;
303
- if ($[66] !== canClear || $[67] !== isClearable || $[68] !== onClear) {
298
+ if ($[64] !== canClear || $[65] !== isClearable || $[66] !== onClear) {
304
299
  t36 = isClearable && /* @__PURE__ */ jsx(InputClear, {
305
300
  onClear,
306
301
  show: canClear
307
302
  });
308
- $[66] = canClear;
309
- $[67] = isClearable;
310
- $[68] = onClear;
311
- $[69] = t36;
312
- } else t36 = $[69];
303
+ $[64] = canClear;
304
+ $[65] = isClearable;
305
+ $[66] = onClear;
306
+ $[67] = t36;
307
+ } else t36 = $[67];
313
308
  let t37;
314
- if ($[70] !== buttonProps || $[71] !== disableDropdown || $[72] !== disableManualEntry || $[73] !== isDisabled || $[74] !== pickerIcon) {
309
+ if ($[68] !== buttonProps || $[69] !== disableDropdown || $[70] !== disableManualEntry || $[71] !== isDisabled || $[72] !== pickerIcon) {
315
310
  t37 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
316
311
  label: "",
317
312
  color: "secondary",
@@ -320,26 +315,26 @@ var DatePickerInput = (t0) => {
320
315
  isDisabled,
321
316
  className: "border-0!"
322
317
  });
323
- $[70] = buttonProps;
324
- $[71] = disableDropdown;
325
- $[72] = disableManualEntry;
326
- $[73] = isDisabled;
327
- $[74] = pickerIcon;
328
- $[75] = t37;
329
- } else t37 = $[75];
318
+ $[68] = buttonProps;
319
+ $[69] = disableDropdown;
320
+ $[70] = disableManualEntry;
321
+ $[71] = isDisabled;
322
+ $[72] = pickerIcon;
323
+ $[73] = t37;
324
+ } else t37 = $[73];
330
325
  let t38;
331
- if ($[76] !== t35 || $[77] !== t36 || $[78] !== t37) {
326
+ if ($[74] !== t35 || $[75] !== t36 || $[76] !== t37) {
332
327
  t38 = /* @__PURE__ */ jsxs("div", {
333
328
  className: t35,
334
329
  children: [t36, t37]
335
330
  });
336
- $[76] = t35;
337
- $[77] = t36;
338
- $[78] = t37;
339
- $[79] = t38;
340
- } else t38 = $[79];
331
+ $[74] = t35;
332
+ $[75] = t36;
333
+ $[76] = t37;
334
+ $[77] = t38;
335
+ } else t38 = $[77];
341
336
  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) {
337
+ if ($[78] !== focusWithinProps || $[79] !== groupProps || $[80] !== hoverProps || $[81] !== t14 || $[82] !== t15 || $[83] !== t16 || $[84] !== t17 || $[85] !== t18 || $[86] !== t19 || $[87] !== t20 || $[88] !== t21 || $[89] !== t22 || $[90] !== t23 || $[91] !== t24 || $[92] !== t25 || $[93] !== t34 || $[94] !== t38) {
343
338
  t39 = /* @__PURE__ */ jsxs("div", {
344
339
  ref: containerRef,
345
340
  className: t14,
@@ -361,25 +356,25 @@ var DatePickerInput = (t0) => {
361
356
  ...hoverProps,
362
357
  children: [t34, t38]
363
358
  });
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];
359
+ $[78] = focusWithinProps;
360
+ $[79] = groupProps;
361
+ $[80] = hoverProps;
362
+ $[81] = t14;
363
+ $[82] = t15;
364
+ $[83] = t16;
365
+ $[84] = t17;
366
+ $[85] = t18;
367
+ $[86] = t19;
368
+ $[87] = t20;
369
+ $[88] = t21;
370
+ $[89] = t22;
371
+ $[90] = t23;
372
+ $[91] = t24;
373
+ $[92] = t25;
374
+ $[93] = t34;
375
+ $[94] = t38;
376
+ $[95] = t39;
377
+ } else t39 = $[95];
383
378
  return t39;
384
379
  };
385
380
  //#endregion
@@ -19,7 +19,7 @@ declare const componentRegistry: {
19
19
  readonly queryAutocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TSelectItem extends import('../../..').SelectItem<any>, TQueryFn extends import('../Selection/Autocomplete/queryAutocomplete.types').QueryFn>({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }: import('../Selection/Autocomplete/queryAutocomplete.types').QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
20
20
  readonly segment: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key>(props: import('../../..').ControlledSegmentProps<TFieldValues, TKey>) => import("react/jsx-runtime").JSX.Element;
21
21
  readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, granularity, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
22
- readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, renderStaticInput, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
22
+ readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso: _fullIso, renderStaticInput, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
23
23
  readonly timePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../DateTime/TimePicker/TimePicker').ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
24
24
  readonly dateRangePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DateRangePicker/DateRangePicker').ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
25
25
  readonly unknown: null;
@@ -22,6 +22,8 @@ export declare namespace DateTimeUtils {
22
22
  export function formatCalendarDateTimeLocalized(calendarDateTime: Pick<CalendarDateTime, "day" | "month" | "year" | "hour" | "minute">, locale?: string, options?: LocalizedDateFormatOptions): string;
23
23
  export function fromISOtoZonedDateTime(isoString: string, timeZone?: string): ZonedDateTime;
24
24
  export function fromDateValueToISO(dateValue: DateValue, timeZone?: string): string;
25
+ export function fromDateValueFieldsToUTCISO(dateValue: DateValue): string;
26
+ export function getCurrentWallClockCalendarDateTime(): CalendarDateTime;
25
27
  export function fromDateValueToOffsetISO(dateValue: DateValue, timeZone?: string): string;
26
28
  export function fromLocalToZonedDateTime(date: Date, timeZone?: string): ZonedDateTime;
27
29
  export function fromDateValueToLocal(dateValue: DateValue, timeZone?: string): Date;
@@ -136,6 +136,16 @@ var DateTimeUtils;
136
136
  return dateValue.toDate(resolvedTimeZone).toISOString();
137
137
  }
138
138
  _DateTimeUtils.fromDateValueToISO = fromDateValueToISO;
139
+ function fromDateValueFieldsToUTCISO(dateValue) {
140
+ const dateTimeFields = dateValue;
141
+ return new CalendarDateTime(dateValue.year, dateValue.month, dateValue.day, dateTimeFields.hour ?? 0, dateTimeFields.minute ?? 0, dateTimeFields.second ?? 0, dateTimeFields.millisecond ?? 0).toDate("UTC").toISOString();
142
+ }
143
+ _DateTimeUtils.fromDateValueFieldsToUTCISO = fromDateValueFieldsToUTCISO;
144
+ function getCurrentWallClockCalendarDateTime() {
145
+ const date = /* @__PURE__ */ new Date();
146
+ return new CalendarDateTime(date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
147
+ }
148
+ _DateTimeUtils.getCurrentWallClockCalendarDateTime = getCurrentWallClockCalendarDateTime;
139
149
  function fromDateValueToOffsetISO(dateValue, timeZone) {
140
150
  const resolvedTimeZone = resolveTimeZone(timeZone);
141
151
  const date = dateValue.toDate(resolvedTimeZone);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.3.0-rc.13",
3
+ "version": "2.3.0-rc.15",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",