@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.
Files changed (49) hide show
  1. package/dist/components/inputs/Checkbox/Checkbox.js +50 -45
  2. package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
  3. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
  4. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
  5. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
  6. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
  7. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
  8. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
  9. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
  10. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
  11. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
  12. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
  13. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
  14. package/dist/components/inputs/File/InputUpload.js +1 -1
  15. package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
  16. package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
  17. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
  18. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
  19. package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
  20. package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
  21. package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
  22. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
  23. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  24. package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
  25. package/dist/components/inputs/Selection/Select/Select.js +1 -0
  26. package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
  27. package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
  28. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
  29. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
  30. package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
  31. package/dist/components/inputs/Selection/shared/select.context.js +3 -1
  32. package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
  33. package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
  34. package/dist/components/inputs/Slider/Slider.d.ts +2 -1
  35. package/dist/components/inputs/Slider/Slider.js +170 -156
  36. package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
  37. package/dist/components/inputs/Toggle/Toggle.js +70 -64
  38. package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
  39. package/dist/components/inputs/shared/InputClear.js +71 -61
  40. package/dist/components/inputs/shared/input.cva.js +22 -10
  41. package/dist/components/inputs/shared/label.cva.js +2 -2
  42. package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
  43. package/dist/config/uiConfig.context.d.ts +3 -1
  44. package/dist/config/uiConfig.context.js +2 -1
  45. package/dist/tw-ui-plugin.js +6 -1
  46. package/dist/utils/date-time.utils.d.ts +5 -0
  47. package/dist/utils/date-time.utils.js +10 -0
  48. package/dist/utils/dom.utils.js +1 -1
  49. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { UIStyle } from "../../../config/uiStyle.context.js";
2
2
  import { typography } from "../../text/Typography/typography.cva.js";
3
+ import { Loader } from "../../status/Loader/Loader.js";
3
4
  import { UIConfig } from "../../../config/uiConfig.context.js";
4
5
  import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
5
6
  import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
@@ -13,14 +14,14 @@ import { clsx } from "clsx";
13
14
  import { isValidElement, useId } from "react";
14
15
  //#region src/components/inputs/Skeleton/InputFrame.tsx
15
16
  var InputFrame = (props) => {
16
- const $ = c(181);
17
+ const $ = c(183);
17
18
  const ui = UIConfig.useConfig();
18
19
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
19
20
  const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
20
21
  const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
21
22
  const typographyCva = UIStyle.useCva("typography.cva", typography);
22
23
  const generatedInputId = useId();
23
- const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t1, labelPlacement: t2, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
24
+ const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t1, reserveTrailingContent, labelPlacement: t2, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
24
25
  const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
25
26
  const wrapTrailingContent = t1 === void 0 ? true : t1;
26
27
  const labelPlacement = t2 === void 0 ? "content-wrapper" : t2;
@@ -43,7 +44,7 @@ var InputFrame = (props) => {
43
44
  $[3] = t4;
44
45
  } else t4 = $[3];
45
46
  const isTrailingIconElement = t4;
46
- const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!action || !!trailingIcon || !!trailingAction;
47
+ const hasTrailingContent = reserveTrailingContent || hasClear || !!trailingContent || !!unit || !!isLoading || !!action || !!trailingIcon || !!trailingAction;
47
48
  const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
48
49
  let dataAttributeProps;
49
50
  let formFieldProps;
@@ -300,12 +301,13 @@ var InputFrame = (props) => {
300
301
  } else t15 = $[111];
301
302
  const contentRow = t15;
302
303
  let t16;
303
- if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !== onClear || $[118] !== renderStatic || $[119] !== showClear || $[120] !== trailingAction || $[121] !== trailingContent || $[122] !== trailingIcon || $[123] !== typographyCva || $[124] !== unit) {
304
+ if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !== isLoading || $[118] !== onClear || $[119] !== renderStatic || $[120] !== showClear || $[121] !== trailingAction || $[122] !== trailingContent || $[123] !== trailingIcon || $[124] !== typographyCva || $[125] !== unit) {
304
305
  t16 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
305
306
  hasClear && /* @__PURE__ */ jsx(InputClear, {
306
307
  onClear: () => onClear?.(),
307
308
  className: clearClassName,
308
309
  show: !!showClear,
310
+ style: showClear ? { visibility: "visible" } : void 0,
309
311
  renderStatic
310
312
  }),
311
313
  trailingContent,
@@ -318,7 +320,11 @@ var InputFrame = (props) => {
318
320
  }),
319
321
  children: unit
320
322
  }),
321
- action && /* @__PURE__ */ jsx(InlineIconButton, {
323
+ isLoading && /* @__PURE__ */ jsx("div", {
324
+ className: "inline-flex",
325
+ children: /* @__PURE__ */ jsx(Loader, {})
326
+ }),
327
+ !isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
322
328
  color: "secondary",
323
329
  icon: action.icon,
324
330
  isDisabled,
@@ -327,7 +333,7 @@ var InputFrame = (props) => {
327
333
  label: action.altText,
328
334
  className: clsx("border-0!", action.className)
329
335
  }),
330
- !action && trailingIcon && renderIconVisual(trailingIcon),
336
+ !isLoading && !action && trailingIcon && renderIconVisual(trailingIcon),
331
337
  trailingAction
332
338
  ] }) : null;
333
339
  $[112] = action;
@@ -335,90 +341,92 @@ var InputFrame = (props) => {
335
341
  $[114] = hasClear;
336
342
  $[115] = hasTrailingContent;
337
343
  $[116] = isDisabled;
338
- $[117] = onClear;
339
- $[118] = renderStatic;
340
- $[119] = showClear;
341
- $[120] = trailingAction;
342
- $[121] = trailingContent;
343
- $[122] = trailingIcon;
344
- $[123] = typographyCva;
345
- $[124] = unit;
346
- $[125] = t16;
347
- } else t16 = $[125];
344
+ $[117] = isLoading;
345
+ $[118] = onClear;
346
+ $[119] = renderStatic;
347
+ $[120] = showClear;
348
+ $[121] = trailingAction;
349
+ $[122] = trailingContent;
350
+ $[123] = trailingIcon;
351
+ $[124] = typographyCva;
352
+ $[125] = unit;
353
+ $[126] = t16;
354
+ } else t16 = $[126];
348
355
  const trailingContentNodes = t16;
349
356
  let t17;
350
- if ($[126] !== as || $[127] !== inputSizeCva || $[128] !== isTrailingInteractive || $[129] !== size || $[130] !== trailingClassName || $[131] !== trailingContentNodes || $[132] !== wrapTrailingContent) {
357
+ if ($[127] !== as || $[128] !== inputSizeCva || $[129] !== isDisabled || $[130] !== isTrailingInteractive || $[131] !== size || $[132] !== trailingClassName || $[133] !== trailingContentNodes || $[134] !== wrapTrailingContent) {
351
358
  t17 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
352
359
  className: clsx("flex items-center gap-input-gap-trailing-elements", inputSizeCva({
353
360
  size,
354
361
  as
355
- }), !isTrailingInteractive && "pointer-events-none", trailingClassName),
362
+ }), !isTrailingInteractive && "pointer-events-none", isDisabled && "text-interactive-text-secondary-disabled", trailingClassName),
356
363
  children: trailingContentNodes
357
364
  }) : trailingContentNodes;
358
- $[126] = as;
359
- $[127] = inputSizeCva;
360
- $[128] = isTrailingInteractive;
361
- $[129] = size;
362
- $[130] = trailingClassName;
363
- $[131] = trailingContentNodes;
364
- $[132] = wrapTrailingContent;
365
- $[133] = t17;
366
- } else t17 = $[133];
365
+ $[127] = as;
366
+ $[128] = inputSizeCva;
367
+ $[129] = isDisabled;
368
+ $[130] = isTrailingInteractive;
369
+ $[131] = size;
370
+ $[132] = trailingClassName;
371
+ $[133] = trailingContentNodes;
372
+ $[134] = wrapTrailingContent;
373
+ $[135] = t17;
374
+ } else t17 = $[135];
367
375
  const trailingRow = t17;
368
376
  let t18;
369
- if ($[134] !== contentAndTrailingClassName || $[135] !== contentRow || $[136] !== trailingRow || $[137] !== wrapContentAndTrailing) {
377
+ if ($[136] !== contentAndTrailingClassName || $[137] !== contentRow || $[138] !== trailingRow || $[139] !== wrapContentAndTrailing) {
370
378
  t18 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
371
379
  className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements", contentAndTrailingClassName),
372
380
  children: [contentRow, trailingRow]
373
381
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
374
- $[134] = contentAndTrailingClassName;
375
- $[135] = contentRow;
376
- $[136] = trailingRow;
377
- $[137] = wrapContentAndTrailing;
378
- $[138] = t18;
379
- } else t18 = $[138];
382
+ $[136] = contentAndTrailingClassName;
383
+ $[137] = contentRow;
384
+ $[138] = trailingRow;
385
+ $[139] = wrapContentAndTrailing;
386
+ $[140] = t18;
387
+ } else t18 = $[140];
380
388
  const inputFrameContent = t18;
381
389
  const t19 = as === "inline" ? -1 : void 0;
382
390
  const t20 = as === "inline" ? -1 : void 0;
383
391
  let t21;
384
- if ($[139] !== onMouseEnter || $[140] !== onStaticInteract || $[141] !== renderStatic) {
392
+ if ($[141] !== onMouseEnter || $[142] !== onStaticInteract || $[143] !== renderStatic) {
385
393
  t21 = (event) => {
386
394
  onMouseEnter?.(event);
387
395
  if (renderStatic) onStaticInteract?.(false);
388
396
  };
389
- $[139] = onMouseEnter;
390
- $[140] = onStaticInteract;
391
- $[141] = renderStatic;
392
- $[142] = t21;
393
- } else t21 = $[142];
397
+ $[141] = onMouseEnter;
398
+ $[142] = onStaticInteract;
399
+ $[143] = renderStatic;
400
+ $[144] = t21;
401
+ } else t21 = $[144];
394
402
  let t22;
395
- if ($[143] !== onFocusCapture || $[144] !== onStaticInteract || $[145] !== renderStatic) {
403
+ if ($[145] !== onFocusCapture || $[146] !== onStaticInteract || $[147] !== renderStatic) {
396
404
  t22 = (event_0) => {
397
405
  onFocusCapture?.(event_0);
398
406
  if (renderStatic) onStaticInteract?.(true);
399
407
  };
400
- $[143] = onFocusCapture;
401
- $[144] = onStaticInteract;
402
- $[145] = renderStatic;
403
- $[146] = t22;
404
- } else t22 = $[146];
408
+ $[145] = onFocusCapture;
409
+ $[146] = onStaticInteract;
410
+ $[147] = renderStatic;
411
+ $[148] = t22;
412
+ } else t22 = $[148];
405
413
  let t23;
406
- if ($[147] !== as || $[148] !== inputBaseCva || $[149] !== inputClassName || $[150] !== variant) {
414
+ if ($[149] !== as || $[150] !== inputBaseCva || $[151] !== inputClassName || $[152] !== variant) {
407
415
  t23 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
408
416
  variant,
409
417
  as
410
418
  }), inputClassName);
411
- $[147] = as;
412
- $[148] = inputBaseCva;
413
- $[149] = inputClassName;
414
- $[150] = variant;
415
- $[151] = t23;
416
- } else t23 = $[151];
419
+ $[149] = as;
420
+ $[150] = inputBaseCva;
421
+ $[151] = inputClassName;
422
+ $[152] = variant;
423
+ $[153] = t23;
424
+ } else t23 = $[153];
417
425
  const t24 = renderStatic ? isDisabled ? -1 : 0 : void 0;
418
426
  let t25;
419
427
  let t26;
420
428
  let t27;
421
- if ($[152] !== onStaticInteract || $[153] !== renderStatic) {
429
+ if ($[154] !== onStaticInteract || $[155] !== renderStatic) {
422
430
  t25 = () => {
423
431
  if (renderStatic) onStaticInteract?.(true);
424
432
  };
@@ -428,18 +436,18 @@ var InputFrame = (props) => {
428
436
  t27 = () => {
429
437
  if (renderStatic) onStaticInteract?.(true);
430
438
  };
431
- $[152] = onStaticInteract;
432
- $[153] = renderStatic;
433
- $[154] = t25;
434
- $[155] = t26;
435
- $[156] = t27;
439
+ $[154] = onStaticInteract;
440
+ $[155] = renderStatic;
441
+ $[156] = t25;
442
+ $[157] = t26;
443
+ $[158] = t27;
436
444
  } else {
437
- t25 = $[154];
438
- t26 = $[155];
439
- t27 = $[156];
445
+ t25 = $[156];
446
+ t26 = $[157];
447
+ t27 = $[158];
440
448
  }
441
449
  let t28;
442
- if ($[157] !== dataAttributeProps || $[158] !== inputFrameContent || $[159] !== ref || $[160] !== t23 || $[161] !== t24 || $[162] !== t25 || $[163] !== t26 || $[164] !== t27) {
450
+ if ($[159] !== dataAttributeProps || $[160] !== inputFrameContent || $[161] !== ref || $[162] !== t23 || $[163] !== t24 || $[164] !== t25 || $[165] !== t26 || $[166] !== t27) {
443
451
  t28 = /* @__PURE__ */ jsx("div", {
444
452
  ref,
445
453
  ...dataAttributeProps,
@@ -451,18 +459,18 @@ var InputFrame = (props) => {
451
459
  "data-rac": "",
452
460
  children: inputFrameContent
453
461
  });
454
- $[157] = dataAttributeProps;
455
- $[158] = inputFrameContent;
456
- $[159] = ref;
457
- $[160] = t23;
458
- $[161] = t24;
459
- $[162] = t25;
460
- $[163] = t26;
461
- $[164] = t27;
462
- $[165] = t28;
463
- } else t28 = $[165];
462
+ $[159] = dataAttributeProps;
463
+ $[160] = inputFrameContent;
464
+ $[161] = ref;
465
+ $[162] = t23;
466
+ $[163] = t24;
467
+ $[164] = t25;
468
+ $[165] = t26;
469
+ $[166] = t27;
470
+ $[167] = t28;
471
+ } else t28 = $[167];
464
472
  let t29;
465
- if ($[166] !== as || $[167] !== dataAttributeProps || $[168] !== formFieldProps || $[169] !== formFieldRef || $[170] !== labelProps || $[171] !== t20 || $[172] !== t21 || $[173] !== t22 || $[174] !== t28) {
473
+ if ($[168] !== as || $[169] !== dataAttributeProps || $[170] !== formFieldProps || $[171] !== formFieldRef || $[172] !== labelProps || $[173] !== t20 || $[174] !== t21 || $[175] !== t22 || $[176] !== t28) {
466
474
  t29 = /* @__PURE__ */ jsx(FormField, {
467
475
  ...formFieldProps,
468
476
  ...dataAttributeProps,
@@ -474,31 +482,31 @@ var InputFrame = (props) => {
474
482
  onFocusCapture: t22,
475
483
  children: t28
476
484
  });
477
- $[166] = as;
478
- $[167] = dataAttributeProps;
479
- $[168] = formFieldProps;
480
- $[169] = formFieldRef;
481
- $[170] = labelProps;
482
- $[171] = t20;
483
- $[172] = t21;
484
- $[173] = t22;
485
- $[174] = t28;
486
- $[175] = t29;
487
- } else t29 = $[175];
485
+ $[168] = as;
486
+ $[169] = dataAttributeProps;
487
+ $[170] = formFieldProps;
488
+ $[171] = formFieldRef;
489
+ $[172] = labelProps;
490
+ $[173] = t20;
491
+ $[174] = t21;
492
+ $[175] = t22;
493
+ $[176] = t28;
494
+ $[177] = t29;
495
+ } else t29 = $[177];
488
496
  let t30;
489
- if ($[176] !== as || $[177] !== error || $[178] !== t19 || $[179] !== t29) {
497
+ if ($[178] !== as || $[179] !== error || $[180] !== t19 || $[181] !== t29) {
490
498
  t30 = /* @__PURE__ */ jsx(TooltipWrapper, {
491
499
  as,
492
500
  error,
493
501
  triggerTabIndex: t19,
494
502
  children: t29
495
503
  });
496
- $[176] = as;
497
- $[177] = error;
498
- $[178] = t19;
499
- $[179] = t29;
500
- $[180] = t30;
501
- } else t30 = $[180];
504
+ $[178] = as;
505
+ $[179] = error;
506
+ $[180] = t19;
507
+ $[181] = t29;
508
+ $[182] = t30;
509
+ } else t30 = $[182];
502
510
  return t30;
503
511
  };
504
512
  var renderIconVisual = (icon) => {
@@ -1,4 +1,4 @@
1
- import { Ref } from 'react';
1
+ import { FocusEvent, Ref } from 'react';
2
2
  import { SliderProps as AriaSliderProps } from 'react-aria-components';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
  import { FormFieldProps } from '../FormField/FormField';
@@ -10,6 +10,7 @@ interface SliderBaseProps<IsRange extends boolean = false> extends FormFieldProp
10
10
  isRange?: IsRange;
11
11
  defaultValue?: SliderValue<IsRange>;
12
12
  value?: SliderValue<IsRange>;
13
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
13
14
  onChange?: (value: SliderValue<IsRange>) => void;
14
15
  }
15
16
  export type SliderProps<IsRange extends boolean = false> = SliderBaseProps<IsRange>;