@povio/ui 2.3.0-rc.39 → 2.3.0-rc.40
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.
- package/dist/components/inputs/Checkbox/Checkbox.js +50 -45
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
- package/dist/components/inputs/File/InputUpload.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
- package/dist/components/inputs/Selection/Select/Select.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
- package/dist/components/inputs/Selection/shared/select.context.js +3 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +170 -156
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +70 -64
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/InputClear.js +71 -61
- package/dist/components/inputs/shared/input.cva.js +22 -10
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
- package/dist/config/uiConfig.context.d.ts +3 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/tw-ui-plugin.js +6 -1
- package/dist/utils/date-time.utils.d.ts +5 -0
- package/dist/utils/date-time.utils.js +10 -0
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconBu
|
|
|
5
5
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
6
6
|
import { DateField } from "./DateField.js";
|
|
7
7
|
import { datePickerInputContentRow } from "./datePickerInput.cva.js";
|
|
8
|
-
import {
|
|
8
|
+
import { renderDatePickerTodayIcon } from "./datePickerTodayIcon.js";
|
|
9
9
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
10
|
import { InputClear } from "../../shared/InputClear.js";
|
|
11
11
|
import { inputBase, inputSize } from "../../shared/input.cva.js";
|
|
@@ -128,9 +128,11 @@ var DatePickerInput = (t0) => {
|
|
|
128
128
|
} else t14 = $[19];
|
|
129
129
|
const onClearChange = t14;
|
|
130
130
|
const showClear = canClear || hasValue || normalizedFieldProps.value != null || normalizedEndFieldProps?.value != null;
|
|
131
|
+
const isTodayIconDisabled = isDisabled || buttonProps.isDisabled;
|
|
131
132
|
let t15;
|
|
132
|
-
if ($[20] !== effectiveTimeZone || $[21] !== endFieldProps || $[22] !== fieldProps || $[23] !== fireBlurOnChange || $[24] !== isDateTime) {
|
|
133
|
+
if ($[20] !== effectiveTimeZone || $[21] !== endFieldProps || $[22] !== fieldProps || $[23] !== fireBlurOnChange || $[24] !== isDateTime || $[25] !== isTodayIconDisabled) {
|
|
133
134
|
t15 = () => {
|
|
135
|
+
if (isTodayIconDisabled) return;
|
|
134
136
|
if (isDateTime) {
|
|
135
137
|
const calendarDateTime = DateTimeUtils.getCurrentWallClockCalendarDateTime();
|
|
136
138
|
fieldProps.onChange?.(calendarDateTime);
|
|
@@ -149,82 +151,75 @@ var DatePickerInput = (t0) => {
|
|
|
149
151
|
$[22] = fieldProps;
|
|
150
152
|
$[23] = fireBlurOnChange;
|
|
151
153
|
$[24] = isDateTime;
|
|
152
|
-
$[25] =
|
|
153
|
-
|
|
154
|
+
$[25] = isTodayIconDisabled;
|
|
155
|
+
$[26] = t15;
|
|
156
|
+
} else t15 = $[26];
|
|
154
157
|
const onToday = t15;
|
|
155
158
|
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
156
159
|
let t16;
|
|
157
|
-
if ($[
|
|
158
|
-
t16 =
|
|
159
|
-
|
|
160
|
-
$[27] = t16;
|
|
161
|
-
} else t16 = $[27];
|
|
162
|
-
const todayIconComponent = t16;
|
|
163
|
-
let t17;
|
|
164
|
-
if ($[28] !== onToday || $[29] !== todayIconButtonSize || $[30] !== todayIconComponent) {
|
|
165
|
-
t17 = todayIconComponent ? /* @__PURE__ */ jsx(InlineIconButton, {
|
|
166
|
-
label: "",
|
|
167
|
-
icon: todayIconComponent,
|
|
168
|
-
size: todayIconButtonSize,
|
|
160
|
+
if ($[27] !== isTodayIconDisabled || $[28] !== onToday || $[29] !== todayIcon || $[30] !== todayIconButtonSize) {
|
|
161
|
+
t16 = renderDatePickerTodayIcon(todayIcon, {
|
|
162
|
+
isDisabled: isTodayIconDisabled,
|
|
169
163
|
onPress: onToday,
|
|
170
|
-
|
|
171
|
-
})
|
|
164
|
+
size: todayIconButtonSize
|
|
165
|
+
});
|
|
166
|
+
$[27] = isTodayIconDisabled;
|
|
172
167
|
$[28] = onToday;
|
|
173
|
-
$[29] =
|
|
174
|
-
$[30] =
|
|
175
|
-
$[31] =
|
|
176
|
-
} else
|
|
177
|
-
const todayIconButton =
|
|
168
|
+
$[29] = todayIcon;
|
|
169
|
+
$[30] = todayIconButtonSize;
|
|
170
|
+
$[31] = t16;
|
|
171
|
+
} else t16 = $[31];
|
|
172
|
+
const todayIconButton = t16;
|
|
178
173
|
const shouldRenderTodayIconWithFieldLabel = todayIconPlacement === "fieldLabel";
|
|
179
174
|
const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
|
|
180
|
-
const
|
|
175
|
+
const t17 = clsx("group group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", groupProps.className, inputBaseCva({
|
|
181
176
|
variant,
|
|
182
177
|
as,
|
|
183
178
|
...props
|
|
184
179
|
}), className);
|
|
185
|
-
const
|
|
180
|
+
const t18 = isHovered || void 0;
|
|
181
|
+
const t19 = isDisabled || void 0;
|
|
186
182
|
const t20 = isDisabled || void 0;
|
|
187
|
-
const t21 =
|
|
188
|
-
const t22 =
|
|
189
|
-
const t23 =
|
|
190
|
-
const t24 = isFocused || void 0;
|
|
191
|
-
const t25 =
|
|
192
|
-
const t26 =
|
|
193
|
-
const t27 =
|
|
194
|
-
const t28 =
|
|
195
|
-
|
|
196
|
-
let t30;
|
|
183
|
+
const t21 = isInvalid || void 0;
|
|
184
|
+
const t22 = normalizedFieldProps.value == null || void 0;
|
|
185
|
+
const t23 = isFocused || void 0;
|
|
186
|
+
const t24 = isFocused && isFocusVisible || void 0;
|
|
187
|
+
const t25 = normalizedFieldProps.value != null || void 0;
|
|
188
|
+
const t26 = isDirty || void 0;
|
|
189
|
+
const t27 = isRequired || void 0;
|
|
190
|
+
const t28 = normalizedFieldProps.value != null || void 0;
|
|
191
|
+
let t29;
|
|
197
192
|
if ($[32] !== as || $[33] !== inputSizeCva || $[34] !== size) {
|
|
198
|
-
|
|
193
|
+
t29 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
|
|
199
194
|
size,
|
|
200
195
|
as
|
|
201
196
|
}));
|
|
202
197
|
$[32] = as;
|
|
203
198
|
$[33] = inputSizeCva;
|
|
204
199
|
$[34] = size;
|
|
205
|
-
$[35] =
|
|
206
|
-
} else
|
|
207
|
-
let
|
|
200
|
+
$[35] = t29;
|
|
201
|
+
} else t29 = $[35];
|
|
202
|
+
let t30;
|
|
208
203
|
if ($[36] !== as || $[37] !== headerProps) {
|
|
209
|
-
|
|
204
|
+
t30 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
210
205
|
as,
|
|
211
206
|
...headerProps
|
|
212
207
|
});
|
|
213
208
|
$[36] = as;
|
|
214
209
|
$[37] = headerProps;
|
|
215
|
-
$[38] =
|
|
216
|
-
} else
|
|
217
|
-
const
|
|
218
|
-
let
|
|
210
|
+
$[38] = t30;
|
|
211
|
+
} else t30 = $[38];
|
|
212
|
+
const t31 = shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
213
|
+
let t32;
|
|
219
214
|
if ($[39] !== datePickerInputContentRowCva || $[40] !== size) {
|
|
220
|
-
|
|
215
|
+
t32 = datePickerInputContentRowCva({ size });
|
|
221
216
|
$[39] = datePickerInputContentRowCva;
|
|
222
217
|
$[40] = size;
|
|
223
|
-
$[41] =
|
|
224
|
-
} else
|
|
225
|
-
let
|
|
218
|
+
$[41] = t32;
|
|
219
|
+
} else t32 = $[41];
|
|
220
|
+
let t33;
|
|
226
221
|
if ($[42] !== disableManualEntry || $[43] !== isDisabled || $[44] !== onOpenDropdown) {
|
|
227
|
-
|
|
222
|
+
t33 = disableManualEntry && /* @__PURE__ */ jsx(Button, {
|
|
228
223
|
onPress: onOpenDropdown,
|
|
229
224
|
className: "absolute inset-0 z-0",
|
|
230
225
|
isDisabled
|
|
@@ -232,12 +227,12 @@ var DatePickerInput = (t0) => {
|
|
|
232
227
|
$[42] = disableManualEntry;
|
|
233
228
|
$[43] = isDisabled;
|
|
234
229
|
$[44] = onOpenDropdown;
|
|
235
|
-
$[45] =
|
|
236
|
-
} else
|
|
237
|
-
const
|
|
238
|
-
let
|
|
239
|
-
if ($[46] !== as || $[47] !== dateGranularity || $[48] !== disableManualEntry || $[49] !== effectiveTimeZone || $[50] !== fieldProps
|
|
240
|
-
|
|
230
|
+
$[45] = t33;
|
|
231
|
+
} else t33 = $[45];
|
|
232
|
+
const t34 = !shouldRenderTodayIconWithFieldLabel && todayIconButton;
|
|
233
|
+
let t35;
|
|
234
|
+
if ($[46] !== as || $[47] !== dateGranularity || $[48] !== disableManualEntry || $[49] !== effectiveTimeZone || $[50] !== fieldProps || $[51] !== format || $[52] !== hidePlaceholder || $[53] !== isDisabled || $[54] !== isInvalid || $[55] !== isTimeOptional || $[56] !== normalizedEndFieldProps || $[57] !== normalizedFieldProps || $[58] !== onClearChange || $[59] !== placeholder) {
|
|
235
|
+
t35 = disableManualEntry && placeholder && !fieldProps.value ? /* @__PURE__ */ jsx(Typography, {
|
|
241
236
|
size: "label-1",
|
|
242
237
|
className: "text-text-default-3",
|
|
243
238
|
children: placeholder
|
|
@@ -272,7 +267,7 @@ var DatePickerInput = (t0) => {
|
|
|
272
267
|
$[47] = dateGranularity;
|
|
273
268
|
$[48] = disableManualEntry;
|
|
274
269
|
$[49] = effectiveTimeZone;
|
|
275
|
-
$[50] = fieldProps
|
|
270
|
+
$[50] = fieldProps;
|
|
276
271
|
$[51] = format;
|
|
277
272
|
$[52] = hidePlaceholder;
|
|
278
273
|
$[53] = isDisabled;
|
|
@@ -282,54 +277,54 @@ var DatePickerInput = (t0) => {
|
|
|
282
277
|
$[57] = normalizedFieldProps;
|
|
283
278
|
$[58] = onClearChange;
|
|
284
279
|
$[59] = placeholder;
|
|
285
|
-
$[60] =
|
|
286
|
-
} else
|
|
287
|
-
let
|
|
288
|
-
if ($[61] !==
|
|
289
|
-
|
|
290
|
-
className:
|
|
280
|
+
$[60] = t35;
|
|
281
|
+
} else t35 = $[60];
|
|
282
|
+
let t36;
|
|
283
|
+
if ($[61] !== t32 || $[62] !== t33 || $[63] !== t34 || $[64] !== t35) {
|
|
284
|
+
t36 = /* @__PURE__ */ jsxs("div", {
|
|
285
|
+
className: t32,
|
|
291
286
|
children: [
|
|
287
|
+
t33,
|
|
292
288
|
t34,
|
|
293
|
-
t35
|
|
294
|
-
t36
|
|
289
|
+
t35
|
|
295
290
|
]
|
|
296
291
|
});
|
|
297
|
-
$[61] =
|
|
298
|
-
$[62] =
|
|
299
|
-
$[63] =
|
|
300
|
-
$[64] =
|
|
301
|
-
$[65] =
|
|
302
|
-
} else
|
|
303
|
-
let
|
|
304
|
-
if ($[66] !==
|
|
305
|
-
|
|
306
|
-
className:
|
|
292
|
+
$[61] = t32;
|
|
293
|
+
$[62] = t33;
|
|
294
|
+
$[63] = t34;
|
|
295
|
+
$[64] = t35;
|
|
296
|
+
$[65] = t36;
|
|
297
|
+
} else t36 = $[65];
|
|
298
|
+
let t37;
|
|
299
|
+
if ($[66] !== t29 || $[67] !== t30 || $[68] !== t31 || $[69] !== t36) {
|
|
300
|
+
t37 = /* @__PURE__ */ jsxs("div", {
|
|
301
|
+
className: t29,
|
|
307
302
|
children: [
|
|
303
|
+
t30,
|
|
308
304
|
t31,
|
|
309
|
-
|
|
310
|
-
t37
|
|
305
|
+
t36
|
|
311
306
|
]
|
|
312
307
|
});
|
|
313
|
-
$[66] =
|
|
314
|
-
$[67] =
|
|
315
|
-
$[68] =
|
|
316
|
-
$[69] =
|
|
317
|
-
$[70] =
|
|
318
|
-
} else
|
|
319
|
-
let
|
|
308
|
+
$[66] = t29;
|
|
309
|
+
$[67] = t30;
|
|
310
|
+
$[68] = t31;
|
|
311
|
+
$[69] = t36;
|
|
312
|
+
$[70] = t37;
|
|
313
|
+
} else t37 = $[70];
|
|
314
|
+
let t38;
|
|
320
315
|
if ($[71] !== as || $[72] !== inputSizeCva || $[73] !== size) {
|
|
321
|
-
|
|
316
|
+
t38 = clsx(inputSizeCva({
|
|
322
317
|
size,
|
|
323
318
|
as
|
|
324
319
|
}), "flex items-center gap-input-gap-trailing-elements py-0! pl-0!");
|
|
325
320
|
$[71] = as;
|
|
326
321
|
$[72] = inputSizeCva;
|
|
327
322
|
$[73] = size;
|
|
328
|
-
$[74] =
|
|
329
|
-
} else
|
|
330
|
-
let
|
|
323
|
+
$[74] = t38;
|
|
324
|
+
} else t38 = $[74];
|
|
325
|
+
let t39;
|
|
331
326
|
if ($[75] !== clearInput || $[76] !== isClearable || $[77] !== showClear) {
|
|
332
|
-
|
|
327
|
+
t39 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
333
328
|
onClear: clearInput,
|
|
334
329
|
show: showClear,
|
|
335
330
|
style: showClear ? { visibility: "visible" } : void 0
|
|
@@ -337,11 +332,11 @@ var DatePickerInput = (t0) => {
|
|
|
337
332
|
$[75] = clearInput;
|
|
338
333
|
$[76] = isClearable;
|
|
339
334
|
$[77] = showClear;
|
|
340
|
-
$[78] =
|
|
341
|
-
} else
|
|
342
|
-
let
|
|
335
|
+
$[78] = t39;
|
|
336
|
+
} else t39 = $[78];
|
|
337
|
+
let t40;
|
|
343
338
|
if ($[79] !== buttonProps || $[80] !== disableDropdown || $[81] !== disableManualEntry || $[82] !== isDisabled || $[83] !== pickerIcon) {
|
|
344
|
-
|
|
339
|
+
t40 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
345
340
|
label: "",
|
|
346
341
|
color: "secondary",
|
|
347
342
|
...buttonProps,
|
|
@@ -354,62 +349,62 @@ var DatePickerInput = (t0) => {
|
|
|
354
349
|
$[81] = disableManualEntry;
|
|
355
350
|
$[82] = isDisabled;
|
|
356
351
|
$[83] = pickerIcon;
|
|
357
|
-
$[84] =
|
|
358
|
-
} else
|
|
352
|
+
$[84] = t40;
|
|
353
|
+
} else t40 = $[84];
|
|
354
|
+
let t41;
|
|
355
|
+
if ($[85] !== t38 || $[86] !== t39 || $[87] !== t40) {
|
|
356
|
+
t41 = /* @__PURE__ */ jsxs("div", {
|
|
357
|
+
className: t38,
|
|
358
|
+
children: [t39, t40]
|
|
359
|
+
});
|
|
360
|
+
$[85] = t38;
|
|
361
|
+
$[86] = t39;
|
|
362
|
+
$[87] = t40;
|
|
363
|
+
$[88] = t41;
|
|
364
|
+
} else t41 = $[88];
|
|
359
365
|
let t42;
|
|
360
|
-
if ($[
|
|
366
|
+
if ($[89] !== focusWithinProps || $[90] !== groupProps || $[91] !== hoverProps || $[92] !== t17 || $[93] !== t18 || $[94] !== t19 || $[95] !== t20 || $[96] !== t21 || $[97] !== t22 || $[98] !== t23 || $[99] !== t24 || $[100] !== t25 || $[101] !== t26 || $[102] !== t27 || $[103] !== t28 || $[104] !== t37 || $[105] !== t41) {
|
|
361
367
|
t42 = /* @__PURE__ */ jsxs("div", {
|
|
362
|
-
className: t39,
|
|
363
|
-
children: [t40, t41]
|
|
364
|
-
});
|
|
365
|
-
$[85] = t39;
|
|
366
|
-
$[86] = t40;
|
|
367
|
-
$[87] = t41;
|
|
368
|
-
$[88] = t42;
|
|
369
|
-
} else t42 = $[88];
|
|
370
|
-
let t43;
|
|
371
|
-
if ($[89] !== focusWithinProps || $[90] !== groupProps || $[91] !== hoverProps || $[92] !== t18 || $[93] !== t19 || $[94] !== t20 || $[95] !== t21 || $[96] !== t22 || $[97] !== t23 || $[98] !== t24 || $[99] !== t25 || $[100] !== t26 || $[101] !== t27 || $[102] !== t28 || $[103] !== t29 || $[104] !== t38 || $[105] !== t42) {
|
|
372
|
-
t43 = /* @__PURE__ */ jsxs("div", {
|
|
373
368
|
ref: containerRef,
|
|
374
369
|
...groupProps,
|
|
375
370
|
...focusWithinProps,
|
|
376
371
|
...hoverProps,
|
|
377
|
-
className:
|
|
372
|
+
className: t17,
|
|
378
373
|
"data-rac": "",
|
|
379
374
|
"data-datetime-input": "",
|
|
380
|
-
"data-hovered":
|
|
381
|
-
"data-disabled":
|
|
382
|
-
"data-is-disabled":
|
|
383
|
-
"data-invalid":
|
|
384
|
-
"data-is-empty":
|
|
385
|
-
"data-focus-within":
|
|
386
|
-
"data-focus-visible":
|
|
387
|
-
"data-has-selection":
|
|
388
|
-
"data-is-dirty":
|
|
389
|
-
"data-is-required":
|
|
390
|
-
"data-is-filled":
|
|
391
|
-
children: [
|
|
375
|
+
"data-hovered": t18,
|
|
376
|
+
"data-disabled": t19,
|
|
377
|
+
"data-is-disabled": t20,
|
|
378
|
+
"data-invalid": t21,
|
|
379
|
+
"data-is-empty": t22,
|
|
380
|
+
"data-focus-within": t23,
|
|
381
|
+
"data-focus-visible": t24,
|
|
382
|
+
"data-has-selection": t25,
|
|
383
|
+
"data-is-dirty": t26,
|
|
384
|
+
"data-is-required": t27,
|
|
385
|
+
"data-is-filled": t28,
|
|
386
|
+
children: [t37, t41]
|
|
392
387
|
});
|
|
393
388
|
$[89] = focusWithinProps;
|
|
394
389
|
$[90] = groupProps;
|
|
395
390
|
$[91] = hoverProps;
|
|
396
|
-
$[92] =
|
|
397
|
-
$[93] =
|
|
398
|
-
$[94] =
|
|
399
|
-
$[95] =
|
|
400
|
-
$[96] =
|
|
401
|
-
$[97] =
|
|
402
|
-
$[98] =
|
|
403
|
-
$[99] =
|
|
404
|
-
$[100] =
|
|
405
|
-
$[101] =
|
|
406
|
-
$[102] =
|
|
407
|
-
$[103] =
|
|
408
|
-
$[104] =
|
|
409
|
-
$[105] =
|
|
410
|
-
$[106] =
|
|
411
|
-
} else
|
|
412
|
-
return
|
|
391
|
+
$[92] = t17;
|
|
392
|
+
$[93] = t18;
|
|
393
|
+
$[94] = t19;
|
|
394
|
+
$[95] = t20;
|
|
395
|
+
$[96] = t21;
|
|
396
|
+
$[97] = t22;
|
|
397
|
+
$[98] = t23;
|
|
398
|
+
$[99] = t24;
|
|
399
|
+
$[100] = t25;
|
|
400
|
+
$[101] = t26;
|
|
401
|
+
$[102] = t27;
|
|
402
|
+
$[103] = t28;
|
|
403
|
+
$[104] = t37;
|
|
404
|
+
$[105] = t41;
|
|
405
|
+
$[106] = t42;
|
|
406
|
+
} else t42 = $[106];
|
|
407
|
+
return t42;
|
|
413
408
|
};
|
|
414
409
|
//#endregion
|
|
415
410
|
export { DatePickerInput };
|
|
@@ -13,7 +13,7 @@ interface DateSegmentItemViewProps {
|
|
|
13
13
|
ref?: Ref<HTMLDivElement>;
|
|
14
14
|
segmentProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
15
|
role?: HTMLAttributes<HTMLDivElement>["role"];
|
|
16
|
-
type?: DateSegment["type"];
|
|
16
|
+
type?: DateSegment["type"] | Intl.DateTimeFormatPartTypes;
|
|
17
17
|
text: ReactNode;
|
|
18
18
|
placeholder?: ReactNode;
|
|
19
19
|
isPlaceholder?: boolean;
|
|
@@ -55,60 +55,62 @@ var DateSegmentItem = (t0) => {
|
|
|
55
55
|
return t5;
|
|
56
56
|
};
|
|
57
57
|
var DateSegmentItemView = (t0) => {
|
|
58
|
-
const $ = c(
|
|
58
|
+
const $ = c(19);
|
|
59
59
|
const { ref, segmentProps, role, type, text, placeholder, isPlaceholder, isInputEmpty, isDisabled, timePickerOnly, hidePlaceholder } = t0;
|
|
60
60
|
const t1 = role ?? segmentProps?.role;
|
|
61
|
-
const t2 = isDisabled && "text-interactive-text-secondary-disabled";
|
|
62
|
-
const t3 =
|
|
63
|
-
const t4 = !isDisabled &&
|
|
64
|
-
const t5 =
|
|
65
|
-
const t6 =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
const t2 = isDisabled && isInputEmpty && "text-interactive-text-secondary-disabled";
|
|
62
|
+
const t3 = isDisabled && !isInputEmpty && "text-text-default-3";
|
|
63
|
+
const t4 = !isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1";
|
|
64
|
+
const t5 = !isDisabled && !isInputEmpty && "text-text-default-1";
|
|
65
|
+
const t6 = type && (type === "hour" && !timePickerOnly || type === "dayPeriod") && "ml-1";
|
|
66
|
+
const t7 = hidePlaceholder && "opacity-0";
|
|
67
|
+
let t8;
|
|
68
|
+
if ($[0] !== t2 || $[1] !== t3 || $[2] !== t4 || $[3] !== t5 || $[4] !== t6 || $[5] !== t7) {
|
|
69
|
+
t8 = clsx("box-content rounded-input-rounding-default", t2, t3, t4, t5, "focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1", t6, t7);
|
|
69
70
|
$[0] = t2;
|
|
70
71
|
$[1] = t3;
|
|
71
72
|
$[2] = t4;
|
|
72
73
|
$[3] = t5;
|
|
73
74
|
$[4] = t6;
|
|
74
75
|
$[5] = t7;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
$[6] = t8;
|
|
77
|
+
} else t8 = $[6];
|
|
78
|
+
let t9;
|
|
79
|
+
if ($[7] !== isPlaceholder || $[8] !== placeholder) {
|
|
80
|
+
t9 = isPlaceholder && /* @__PURE__ */ jsx("span", {
|
|
79
81
|
"aria-hidden": "true",
|
|
80
82
|
className: "pointer-events-none",
|
|
81
83
|
children: placeholder
|
|
82
84
|
});
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
} else
|
|
87
|
-
const
|
|
88
|
-
let t10;
|
|
89
|
-
if ($[9] !== t8 || $[10] !== t9) {
|
|
90
|
-
t10 = /* @__PURE__ */ jsxs(Fragment, { children: [t8, t9] });
|
|
91
|
-
$[9] = t8;
|
|
92
|
-
$[10] = t9;
|
|
93
|
-
$[11] = t10;
|
|
94
|
-
} else t10 = $[11];
|
|
85
|
+
$[7] = isPlaceholder;
|
|
86
|
+
$[8] = placeholder;
|
|
87
|
+
$[9] = t9;
|
|
88
|
+
} else t9 = $[9];
|
|
89
|
+
const t10 = isPlaceholder ? "" : text;
|
|
95
90
|
let t11;
|
|
96
|
-
if ($[
|
|
97
|
-
t11 = /* @__PURE__ */
|
|
91
|
+
if ($[10] !== t10 || $[11] !== t9) {
|
|
92
|
+
t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t9, t10] });
|
|
93
|
+
$[10] = t10;
|
|
94
|
+
$[11] = t9;
|
|
95
|
+
$[12] = t11;
|
|
96
|
+
} else t11 = $[12];
|
|
97
|
+
let t12;
|
|
98
|
+
if ($[13] !== ref || $[14] !== segmentProps || $[15] !== t1 || $[16] !== t11 || $[17] !== t8) {
|
|
99
|
+
t12 = /* @__PURE__ */ jsx("div", {
|
|
98
100
|
...segmentProps,
|
|
99
101
|
role: t1,
|
|
100
102
|
ref,
|
|
101
|
-
className:
|
|
102
|
-
children:
|
|
103
|
+
className: t8,
|
|
104
|
+
children: t11
|
|
103
105
|
});
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
} else
|
|
111
|
-
return
|
|
106
|
+
$[13] = ref;
|
|
107
|
+
$[14] = segmentProps;
|
|
108
|
+
$[15] = t1;
|
|
109
|
+
$[16] = t11;
|
|
110
|
+
$[17] = t8;
|
|
111
|
+
$[18] = t12;
|
|
112
|
+
} else t12 = $[18];
|
|
113
|
+
return t12;
|
|
112
114
|
};
|
|
113
115
|
//#endregion
|
|
114
116
|
export { DateSegmentItem, DateSegmentItemView, getPlaceholder };
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { FC, ReactElement, SVGProps } from 'react';
|
|
2
|
+
import { PressEvent } from 'react-aria-components';
|
|
2
3
|
import { DatePickerTodayIcon, DatePickerTodayIconButtonSize } from './datePicker.types';
|
|
3
4
|
type TodayIconComponent = FC<SVGProps<SVGSVGElement>> | ReactElement;
|
|
5
|
+
type DatePickerTodayIconOptions = {
|
|
6
|
+
className?: string;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
onPress?: (event: PressEvent) => void;
|
|
9
|
+
renderStatic?: boolean;
|
|
10
|
+
size?: DatePickerTodayIconButtonSize;
|
|
11
|
+
};
|
|
4
12
|
export declare const getDatePickerTodayIcon: (todayIcon: DatePickerTodayIcon | undefined) => TodayIconComponent | null;
|
|
5
|
-
export declare const renderDatePickerTodayIcon: (todayIcon: DatePickerTodayIcon | undefined,
|
|
13
|
+
export declare const renderDatePickerTodayIcon: (todayIcon: DatePickerTodayIcon | undefined, options?: DatePickerTodayIconOptions) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
6
14
|
export {};
|
|
@@ -1,21 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { button, buttonContent, buttonIconSize, buttonSize } from "../../../buttons/Button/button.cva.js";
|
|
2
|
+
import { IconButton } from "../../../buttons/IconButton/IconButton.js";
|
|
2
3
|
import { TodayIcon } from "../../../../assets/icons/Today.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
|
+
import { cloneElement, isValidElement } from "react";
|
|
4
7
|
//#region src/components/inputs/DateTime/shared/datePickerTodayIcon.tsx
|
|
5
8
|
var getDatePickerTodayIcon = (todayIcon) => {
|
|
6
9
|
if (!todayIcon) return null;
|
|
7
10
|
return todayIcon === true ? TodayIcon : todayIcon;
|
|
8
11
|
};
|
|
9
|
-
var renderDatePickerTodayIcon = (todayIcon,
|
|
12
|
+
var renderDatePickerTodayIcon = (todayIcon, options) => {
|
|
10
13
|
const icon = getDatePickerTodayIcon(todayIcon);
|
|
11
14
|
if (!icon) return;
|
|
12
|
-
|
|
15
|
+
const { className, isDisabled, onPress, renderStatic, size = "none" } = options ?? {};
|
|
16
|
+
const todayIconClassName = className ?? "relative z-1";
|
|
17
|
+
if (renderStatic) {
|
|
18
|
+
const iconClassName = buttonIconSize({
|
|
19
|
+
size,
|
|
20
|
+
className: "shrink-0"
|
|
21
|
+
});
|
|
22
|
+
const renderedIcon = (() => {
|
|
23
|
+
if (isValidElement(icon)) return cloneElement(icon, { className: clsx(iconClassName, icon.props.className) });
|
|
24
|
+
return /* @__PURE__ */ jsx(icon, { className: iconClassName });
|
|
25
|
+
})();
|
|
26
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
tabIndex: -1,
|
|
30
|
+
disabled: isDisabled,
|
|
31
|
+
className: clsx(button({
|
|
32
|
+
className: todayIconClassName,
|
|
33
|
+
color: "primary",
|
|
34
|
+
variant: "contained",
|
|
35
|
+
width: "hug"
|
|
36
|
+
}), buttonSize({
|
|
37
|
+
iconOnly: true,
|
|
38
|
+
size
|
|
39
|
+
}), buttonContent({
|
|
40
|
+
iconPosition: "left",
|
|
41
|
+
iconOnly: true,
|
|
42
|
+
size
|
|
43
|
+
})),
|
|
44
|
+
children: [renderedIcon, /* @__PURE__ */ jsx("span", { className: "sr-only" })]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
13
48
|
label: "",
|
|
14
49
|
icon,
|
|
15
50
|
size,
|
|
16
|
-
|
|
17
|
-
|
|
51
|
+
isDisabled,
|
|
52
|
+
onPress,
|
|
53
|
+
className: todayIconClassName
|
|
18
54
|
});
|
|
19
55
|
};
|
|
20
56
|
//#endregion
|
|
21
|
-
export {
|
|
57
|
+
export { renderDatePickerTodayIcon };
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
import { CalendarDate } from '@internationalized/date';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
import { DateValue, TimeValue } from 'react-aria';
|
|
3
4
|
interface StaticSegmentProps {
|
|
4
5
|
isDisabled?: boolean;
|
|
5
6
|
hidePlaceholder?: boolean;
|
|
6
7
|
}
|
|
7
|
-
interface
|
|
8
|
+
interface StaticManualEntryPlaceholderProps {
|
|
9
|
+
disableManualEntry?: boolean;
|
|
10
|
+
placeholder?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
type StaticDateGranularity = "day" | "month" | "year";
|
|
13
|
+
interface StaticCalendarDateSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
|
|
8
14
|
value?: CalendarDate | null;
|
|
9
15
|
locale: string;
|
|
10
16
|
shouldForceLeadingZeros?: boolean;
|
|
17
|
+
dateGranularity?: StaticDateGranularity;
|
|
11
18
|
}
|
|
12
|
-
interface StaticCalendarDateTimeSegmentsProps extends StaticSegmentProps {
|
|
19
|
+
interface StaticCalendarDateTimeSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
|
|
13
20
|
value?: DateValue | null;
|
|
14
21
|
locale: string;
|
|
15
22
|
shouldForceLeadingZeros?: boolean;
|
|
16
23
|
}
|
|
17
|
-
interface StaticDateRangeSegmentsProps extends StaticSegmentProps {
|
|
24
|
+
interface StaticDateRangeSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
|
|
18
25
|
start?: CalendarDate | null;
|
|
19
26
|
end?: CalendarDate | null;
|
|
20
27
|
locale: string;
|
|
21
28
|
shouldForceLeadingZeros?: boolean;
|
|
22
29
|
}
|
|
23
|
-
interface StaticTimeSegmentsProps extends StaticSegmentProps {
|
|
30
|
+
interface StaticTimeSegmentsProps extends StaticSegmentProps, StaticManualEntryPlaceholderProps {
|
|
24
31
|
value?: TimeValue | null;
|
|
25
32
|
locale: string;
|
|
26
33
|
}
|
|
27
|
-
export declare const getStaticCalendarDateSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticCalendarDateSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const getStaticCalendarDateTimeSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticCalendarDateTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export declare const getStaticDateRangeSegments: ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, }: StaticDateRangeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export declare const getStaticTimeSegments: ({ value, locale, isDisabled, hidePlaceholder }: StaticTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const getStaticCalendarDateSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, dateGranularity, }: StaticCalendarDateSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const getStaticCalendarDateTimeSegments: ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, }: StaticCalendarDateTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const getStaticDateRangeSegments: ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, }: StaticDateRangeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const getStaticTimeSegments: ({ value, locale, isDisabled, hidePlaceholder, disableManualEntry, placeholder, }: StaticTimeSegmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const getStaticDateTimePlaceholder: (placeholder: ReactNode) => import("react/jsx-runtime").JSX.Element;
|
|
31
39
|
export {};
|