@povio/ui 3.3.0-rc.1 → 3.3.0-rc.2
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,5 +1,7 @@
|
|
|
1
1
|
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
2
|
+
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
3
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
4
|
+
import { buttonIconSizeDefinition } from "../../buttons/Button/button.cva.js";
|
|
3
5
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
4
6
|
import "../../../config/i18n.js";
|
|
5
7
|
import { c } from "react/compiler-runtime";
|
|
@@ -8,56 +10,70 @@ import { clsx } from "clsx";
|
|
|
8
10
|
import { useTranslation } from "react-i18next";
|
|
9
11
|
//#region src/components/inputs/shared/InputClear.tsx
|
|
10
12
|
var InputClear = (t0) => {
|
|
11
|
-
const $ = c(
|
|
13
|
+
const $ = c(16);
|
|
12
14
|
const { onClear, className, style, show, renderStatic } = t0;
|
|
13
|
-
const
|
|
15
|
+
const ui = UIConfig.useConfig();
|
|
16
|
+
const buttonIconSizeCva = UIOverrides.useCva("button.iconSize", buttonIconSizeDefinition);
|
|
17
|
+
const alwaysShowClear = ui.input.alwaysShowClear;
|
|
14
18
|
let clearClassName;
|
|
15
19
|
let t1;
|
|
16
|
-
if ($[0] !== alwaysShowClear || $[1] !==
|
|
20
|
+
if ($[0] !== alwaysShowClear || $[1] !== buttonIconSizeCva || $[2] !== className || $[3] !== renderStatic || $[4] !== show || $[5] !== style) {
|
|
17
21
|
t1 = Symbol.for("react.early_return_sentinel");
|
|
18
22
|
bb0: {
|
|
19
23
|
clearClassName = clsx("relative z-raised flex items-center", !alwaysShowClear && "md:invisible group-focus-within:visible group-hover/date-picker-content:visible group-hover/select-content:visible group-hover/text-area:visible group-hover:visible", "border-0!", !show && "invisible!", className);
|
|
20
24
|
if (renderStatic) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const t2 = clsx("group inline-flex items-center justify-center border border-solid border-support-transparent-outline", "rounded-button-rounding-s p-0 text-interactive-text-secondary-idle", clearClassName);
|
|
26
|
+
let t3;
|
|
27
|
+
if ($[8] !== buttonIconSizeCva) {
|
|
28
|
+
t3 = buttonIconSizeCva({
|
|
29
|
+
size: "none",
|
|
30
|
+
className: "shrink-0"
|
|
31
|
+
});
|
|
32
|
+
$[8] = buttonIconSizeCva;
|
|
33
|
+
$[9] = t3;
|
|
34
|
+
} else t3 = $[9];
|
|
35
|
+
let t4;
|
|
36
|
+
if ($[10] !== t3) {
|
|
37
|
+
t4 = /* @__PURE__ */ jsx(CloseIcon, { className: t3 });
|
|
38
|
+
$[10] = t3;
|
|
39
|
+
$[11] = t4;
|
|
40
|
+
} else t4 = $[11];
|
|
26
41
|
t1 = /* @__PURE__ */ jsx("button", {
|
|
27
42
|
type: "button",
|
|
28
43
|
"aria-hidden": "true",
|
|
29
44
|
tabIndex: -1,
|
|
30
|
-
className:
|
|
45
|
+
className: t2,
|
|
31
46
|
style,
|
|
32
|
-
children:
|
|
47
|
+
children: t4
|
|
33
48
|
});
|
|
34
49
|
break bb0;
|
|
35
50
|
}
|
|
36
51
|
}
|
|
37
52
|
$[0] = alwaysShowClear;
|
|
38
|
-
$[1] =
|
|
39
|
-
$[2] =
|
|
40
|
-
$[3] =
|
|
41
|
-
$[4] =
|
|
42
|
-
$[5] =
|
|
43
|
-
$[6] =
|
|
53
|
+
$[1] = buttonIconSizeCva;
|
|
54
|
+
$[2] = className;
|
|
55
|
+
$[3] = renderStatic;
|
|
56
|
+
$[4] = show;
|
|
57
|
+
$[5] = style;
|
|
58
|
+
$[6] = clearClassName;
|
|
59
|
+
$[7] = t1;
|
|
44
60
|
} else {
|
|
45
|
-
clearClassName = $[
|
|
46
|
-
t1 = $[
|
|
61
|
+
clearClassName = $[6];
|
|
62
|
+
t1 = $[7];
|
|
47
63
|
}
|
|
48
64
|
if (t1 !== Symbol.for("react.early_return_sentinel")) return t1;
|
|
49
65
|
let t2;
|
|
50
|
-
if ($[
|
|
66
|
+
if ($[12] !== clearClassName || $[13] !== onClear || $[14] !== style) {
|
|
51
67
|
t2 = /* @__PURE__ */ jsx(InputClearButton, {
|
|
52
68
|
onClear,
|
|
53
69
|
className: clearClassName,
|
|
54
70
|
style
|
|
55
71
|
});
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
} else t2 = $[
|
|
72
|
+
$[12] = clearClassName;
|
|
73
|
+
$[13] = onClear;
|
|
74
|
+
$[14] = style;
|
|
75
|
+
$[15] = t2;
|
|
76
|
+
} else t2 = $[15];
|
|
61
77
|
return t2;
|
|
62
78
|
};
|
|
63
79
|
var InputClearButton = (t0) => {
|