@povio/ui 2.3.0-rc.22 → 2.3.0-rc.23
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.
|
@@ -1,6 +1,5 @@
|
|
|
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";
|
|
4
3
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
4
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
6
5
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
@@ -14,14 +13,14 @@ import { clsx } from "clsx";
|
|
|
14
13
|
import { isValidElement, useId } from "react";
|
|
15
14
|
//#region src/components/inputs/Skeleton/InputFrame.tsx
|
|
16
15
|
var InputFrame = (props) => {
|
|
17
|
-
const $ = c(
|
|
16
|
+
const $ = c(181);
|
|
18
17
|
const ui = UIConfig.useConfig();
|
|
19
18
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
20
19
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
21
20
|
const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
|
|
22
21
|
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
23
22
|
const generatedInputId = useId();
|
|
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,
|
|
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;
|
|
25
24
|
const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
|
|
26
25
|
const wrapTrailingContent = t1 === void 0 ? true : t1;
|
|
27
26
|
const labelPlacement = t2 === void 0 ? "content-wrapper" : t2;
|
|
@@ -44,7 +43,7 @@ var InputFrame = (props) => {
|
|
|
44
43
|
$[3] = t4;
|
|
45
44
|
} else t4 = $[3];
|
|
46
45
|
const isTrailingIconElement = t4;
|
|
47
|
-
const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!
|
|
46
|
+
const hasTrailingContent = hasClear || !!trailingContent || !!unit || !!action || !!trailingIcon || !!trailingAction;
|
|
48
47
|
const isTrailingInteractive = !!action || !!trailingAction || !!isTrailingIconElement || hasClear && !!showClear || !!trailingContent;
|
|
49
48
|
let dataAttributeProps;
|
|
50
49
|
let formFieldProps;
|
|
@@ -301,7 +300,7 @@ var InputFrame = (props) => {
|
|
|
301
300
|
} else t15 = $[111];
|
|
302
301
|
const contentRow = t15;
|
|
303
302
|
let t16;
|
|
304
|
-
if ($[112] !== action || $[113] !== clearClassName || $[114] !== hasClear || $[115] !== hasTrailingContent || $[116] !== isDisabled || $[117] !==
|
|
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) {
|
|
305
304
|
t16 = hasTrailingContent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
306
305
|
hasClear && /* @__PURE__ */ jsx(InputClear, {
|
|
307
306
|
onClear: () => onClear?.(),
|
|
@@ -319,11 +318,7 @@ var InputFrame = (props) => {
|
|
|
319
318
|
}),
|
|
320
319
|
children: unit
|
|
321
320
|
}),
|
|
322
|
-
|
|
323
|
-
className: "inline-flex",
|
|
324
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
325
|
-
}),
|
|
326
|
-
!isLoading && action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
321
|
+
action && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
327
322
|
color: "secondary",
|
|
328
323
|
icon: action.icon,
|
|
329
324
|
isDisabled,
|
|
@@ -332,7 +327,7 @@ var InputFrame = (props) => {
|
|
|
332
327
|
label: action.altText,
|
|
333
328
|
className: clsx("border-0!", action.className)
|
|
334
329
|
}),
|
|
335
|
-
!
|
|
330
|
+
!action && trailingIcon && renderIconVisual(trailingIcon),
|
|
336
331
|
trailingAction
|
|
337
332
|
] }) : null;
|
|
338
333
|
$[112] = action;
|
|
@@ -340,20 +335,19 @@ var InputFrame = (props) => {
|
|
|
340
335
|
$[114] = hasClear;
|
|
341
336
|
$[115] = hasTrailingContent;
|
|
342
337
|
$[116] = isDisabled;
|
|
343
|
-
$[117] =
|
|
344
|
-
$[118] =
|
|
345
|
-
$[119] =
|
|
346
|
-
$[120] =
|
|
347
|
-
$[121] =
|
|
348
|
-
$[122] =
|
|
349
|
-
$[123] =
|
|
350
|
-
$[124] =
|
|
351
|
-
$[125] =
|
|
352
|
-
|
|
353
|
-
} else t16 = $[126];
|
|
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];
|
|
354
348
|
const trailingContentNodes = t16;
|
|
355
349
|
let t17;
|
|
356
|
-
if ($[
|
|
350
|
+
if ($[126] !== as || $[127] !== inputSizeCva || $[128] !== isTrailingInteractive || $[129] !== size || $[130] !== trailingClassName || $[131] !== trailingContentNodes || $[132] !== wrapTrailingContent) {
|
|
357
351
|
t17 = wrapTrailingContent && trailingContentNodes ? /* @__PURE__ */ jsx("div", {
|
|
358
352
|
className: clsx("flex items-center gap-input-gap-trailing-elements", inputSizeCva({
|
|
359
353
|
size,
|
|
@@ -361,70 +355,70 @@ var InputFrame = (props) => {
|
|
|
361
355
|
}), !isTrailingInteractive && "pointer-events-none", trailingClassName),
|
|
362
356
|
children: trailingContentNodes
|
|
363
357
|
}) : trailingContentNodes;
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
} else t17 = $[
|
|
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];
|
|
373
367
|
const trailingRow = t17;
|
|
374
368
|
let t18;
|
|
375
|
-
if ($[
|
|
369
|
+
if ($[134] !== contentAndTrailingClassName || $[135] !== contentRow || $[136] !== trailingRow || $[137] !== wrapContentAndTrailing) {
|
|
376
370
|
t18 = wrapContentAndTrailing ? /* @__PURE__ */ jsxs("div", {
|
|
377
371
|
className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements", contentAndTrailingClassName),
|
|
378
372
|
children: [contentRow, trailingRow]
|
|
379
373
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [contentRow, trailingRow] });
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
} else t18 = $[
|
|
374
|
+
$[134] = contentAndTrailingClassName;
|
|
375
|
+
$[135] = contentRow;
|
|
376
|
+
$[136] = trailingRow;
|
|
377
|
+
$[137] = wrapContentAndTrailing;
|
|
378
|
+
$[138] = t18;
|
|
379
|
+
} else t18 = $[138];
|
|
386
380
|
const inputFrameContent = t18;
|
|
387
381
|
const t19 = as === "inline" ? -1 : void 0;
|
|
388
382
|
const t20 = as === "inline" ? -1 : void 0;
|
|
389
383
|
let t21;
|
|
390
|
-
if ($[
|
|
384
|
+
if ($[139] !== onMouseEnter || $[140] !== onStaticInteract || $[141] !== renderStatic) {
|
|
391
385
|
t21 = (event) => {
|
|
392
386
|
onMouseEnter?.(event);
|
|
393
387
|
if (renderStatic) onStaticInteract?.(false);
|
|
394
388
|
};
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
} else t21 = $[
|
|
389
|
+
$[139] = onMouseEnter;
|
|
390
|
+
$[140] = onStaticInteract;
|
|
391
|
+
$[141] = renderStatic;
|
|
392
|
+
$[142] = t21;
|
|
393
|
+
} else t21 = $[142];
|
|
400
394
|
let t22;
|
|
401
|
-
if ($[
|
|
395
|
+
if ($[143] !== onFocusCapture || $[144] !== onStaticInteract || $[145] !== renderStatic) {
|
|
402
396
|
t22 = (event_0) => {
|
|
403
397
|
onFocusCapture?.(event_0);
|
|
404
398
|
if (renderStatic) onStaticInteract?.(true);
|
|
405
399
|
};
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
} else t22 = $[
|
|
400
|
+
$[143] = onFocusCapture;
|
|
401
|
+
$[144] = onStaticInteract;
|
|
402
|
+
$[145] = renderStatic;
|
|
403
|
+
$[146] = t22;
|
|
404
|
+
} else t22 = $[146];
|
|
411
405
|
let t23;
|
|
412
|
-
if ($[
|
|
406
|
+
if ($[147] !== as || $[148] !== inputBaseCva || $[149] !== inputClassName || $[150] !== variant) {
|
|
413
407
|
t23 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
414
408
|
variant,
|
|
415
409
|
as
|
|
416
410
|
}), inputClassName);
|
|
417
|
-
$[
|
|
418
|
-
$[
|
|
419
|
-
$[
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
} else t23 = $[
|
|
411
|
+
$[147] = as;
|
|
412
|
+
$[148] = inputBaseCva;
|
|
413
|
+
$[149] = inputClassName;
|
|
414
|
+
$[150] = variant;
|
|
415
|
+
$[151] = t23;
|
|
416
|
+
} else t23 = $[151];
|
|
423
417
|
const t24 = renderStatic ? isDisabled ? -1 : 0 : void 0;
|
|
424
418
|
let t25;
|
|
425
419
|
let t26;
|
|
426
420
|
let t27;
|
|
427
|
-
if ($[
|
|
421
|
+
if ($[152] !== onStaticInteract || $[153] !== renderStatic) {
|
|
428
422
|
t25 = () => {
|
|
429
423
|
if (renderStatic) onStaticInteract?.(true);
|
|
430
424
|
};
|
|
@@ -434,18 +428,18 @@ var InputFrame = (props) => {
|
|
|
434
428
|
t27 = () => {
|
|
435
429
|
if (renderStatic) onStaticInteract?.(true);
|
|
436
430
|
};
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
431
|
+
$[152] = onStaticInteract;
|
|
432
|
+
$[153] = renderStatic;
|
|
433
|
+
$[154] = t25;
|
|
434
|
+
$[155] = t26;
|
|
435
|
+
$[156] = t27;
|
|
442
436
|
} else {
|
|
443
|
-
t25 = $[
|
|
444
|
-
t26 = $[
|
|
445
|
-
t27 = $[
|
|
437
|
+
t25 = $[154];
|
|
438
|
+
t26 = $[155];
|
|
439
|
+
t27 = $[156];
|
|
446
440
|
}
|
|
447
441
|
let t28;
|
|
448
|
-
if ($[
|
|
442
|
+
if ($[157] !== dataAttributeProps || $[158] !== inputFrameContent || $[159] !== ref || $[160] !== t23 || $[161] !== t24 || $[162] !== t25 || $[163] !== t26 || $[164] !== t27) {
|
|
449
443
|
t28 = /* @__PURE__ */ jsx("div", {
|
|
450
444
|
ref,
|
|
451
445
|
...dataAttributeProps,
|
|
@@ -457,18 +451,18 @@ var InputFrame = (props) => {
|
|
|
457
451
|
"data-rac": "",
|
|
458
452
|
children: inputFrameContent
|
|
459
453
|
});
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
469
|
-
} else t28 = $[
|
|
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];
|
|
470
464
|
let t29;
|
|
471
|
-
if ($[
|
|
465
|
+
if ($[166] !== as || $[167] !== dataAttributeProps || $[168] !== formFieldProps || $[169] !== formFieldRef || $[170] !== labelProps || $[171] !== t20 || $[172] !== t21 || $[173] !== t22 || $[174] !== t28) {
|
|
472
466
|
t29 = /* @__PURE__ */ jsx(FormField, {
|
|
473
467
|
...formFieldProps,
|
|
474
468
|
...dataAttributeProps,
|
|
@@ -480,31 +474,31 @@ var InputFrame = (props) => {
|
|
|
480
474
|
onFocusCapture: t22,
|
|
481
475
|
children: t28
|
|
482
476
|
});
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
} else t29 = $[
|
|
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];
|
|
494
488
|
let t30;
|
|
495
|
-
if ($[
|
|
489
|
+
if ($[176] !== as || $[177] !== error || $[178] !== t19 || $[179] !== t29) {
|
|
496
490
|
t30 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
497
491
|
as,
|
|
498
492
|
error,
|
|
499
493
|
triggerTabIndex: t19,
|
|
500
494
|
children: t29
|
|
501
495
|
});
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
} else t30 = $[
|
|
496
|
+
$[176] = as;
|
|
497
|
+
$[177] = error;
|
|
498
|
+
$[178] = t19;
|
|
499
|
+
$[179] = t29;
|
|
500
|
+
$[180] = t30;
|
|
501
|
+
} else t30 = $[180];
|
|
508
502
|
return t30;
|
|
509
503
|
};
|
|
510
504
|
var renderIconVisual = (icon) => {
|