@incodetech/web 0.0.0-dev-20260302-ad37d43 → 0.0.0-dev-20260302-e38ab90
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/{Trans-Bdg0o_Cr.js → Trans-BHurUlNG.js} +3 -3
- package/dist/authentication/authentication.es.js +5 -5
- package/dist/base.css +41 -1
- package/dist/{baseTutorial-BgA1dpRi.js → baseTutorial-Bbadb04i.js} +5 -5
- package/dist/{chevronDown-C5Kn1woB.js → chevronDown-CIyU9-x9.js} +1 -1
- package/dist/countries-DDCxQhGs.js +3206 -0
- package/dist/curp-validation/curp-validation.es.js +182 -797
- package/dist/curp-validation/styles.css +4 -1
- package/dist/dateInputComposed-BwjWmZFc.js +172 -0
- package/dist/{documentUpload-h5GfSa2m.js → documentUpload-BnXvLmkL.js} +4 -4
- package/dist/dropdownComposed-vWK3dHjS.js +461 -0
- package/dist/ekyb/styles.css +107 -0
- package/dist/ekybModule-Dm04An2k.js +243 -0
- package/dist/ekyc/styles.css +274 -0
- package/dist/ekycModule-DQO4I6h1.js +451 -0
- package/dist/email/email.es.js +4 -4
- package/dist/{errorIcon-BT7Rf4z7.js → errorIcon-hyIEsKoP.js} +1 -1
- package/dist/{faceMatch-DL5ICOMJ.js → faceMatch-CTYWaJ2M.js} +4 -4
- package/dist/flow/flow.es.js +191 -161
- package/dist/flow/styles.css +536 -1
- package/dist/geolocation/geolocation.es.js +5 -5
- package/dist/governmentValidation/governmentValidation.es.js +8 -8
- package/dist/id/id.es.js +7 -7
- package/dist/{incodeComponent-BUltqUSz.js → incodeComponent-DSqGVqSo.js} +3 -3
- package/dist/{incodeModule-BwGymwZT.js → incodeModule-_kfNnq5z.js} +1 -1
- package/dist/index.es.js +2 -2
- package/dist/{otpInput-B7TR21xE.js → otpInput-Bx16y6dR.js} +2 -2
- package/dist/phone/phone.es.js +133 -3332
- package/dist/{processing-B7fzlPZl.js → processing-BuaxyhmY.js} +3 -3
- package/dist/selfie/selfie.es.js +6 -6
- package/dist/{setup-CFo1IZlN.js → setup-B6jZts5S.js} +2 -2
- package/dist/{spinner-BiENeSCl.js → spinner-Ogo-u91P.js} +2 -2
- package/dist/{successIcon-CTA9p_2h.js → successIcon-Ci24t3I5.js} +1 -1
- package/dist/{tutorial-DGo0fw3f.js → tutorial-637lvO4s.js} +7 -7
- package/dist/types/ekyb/styles.d.ts +1 -0
- package/dist/types/ekyc/styles.d.ts +1 -0
- package/dist/{uiConfig-BG6lJ_HG.js → uiConfig-CbMyDWix.js} +1 -1
- package/dist/{useTranslation-Cm51-Wm-.js → useTranslation-B1jrtqlW.js} +1 -1
- package/dist/{vendor-preact-CM6KQyKc.js → vendor-preact-BDue3y7V.js} +1 -0
- package/dist/verificationResult-BMHBsZ8s.js +106 -0
- package/package.json +17 -3
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
--tw-outline-style: none;
|
|
66
66
|
appearance: none;
|
|
67
67
|
-moz-appearance: textfield;
|
|
68
|
-
|
|
68
|
+
height: 56px;
|
|
69
|
+
min-height: 56px;
|
|
69
70
|
font-family: var(--input-text-field-font-family);
|
|
70
71
|
outline-style: none;
|
|
71
72
|
padding-right: 44px;
|
|
@@ -253,6 +254,8 @@
|
|
|
253
254
|
transition-duration: var(--tw-duration, var(--default-transition-duration, .15s));
|
|
254
255
|
--tw-duration: .2s;
|
|
255
256
|
--tw-outline-style: none;
|
|
257
|
+
height: 56px;
|
|
258
|
+
min-height: 56px;
|
|
256
259
|
color: var(--color-dropdown-text-input-default, var(--dropdown-text-input-default));
|
|
257
260
|
font-family: var(--dropdown-text-input-font-family);
|
|
258
261
|
outline-style: none;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { u as e, c as E } from "./incodeModule-_kfNnq5z.js";
|
|
2
|
+
import { g as W, D as Z, A as $ } from "./vendor-preact-BDue3y7V.js";
|
|
3
|
+
import { E as g } from "./errorIcon-hyIEsKoP.js";
|
|
4
|
+
import { S as x } from "./successIcon-Ci24t3I5.js";
|
|
5
|
+
const B = ({ class: o }) => {
|
|
6
|
+
const t = W();
|
|
7
|
+
return /* @__PURE__ */ e(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
width: "24",
|
|
11
|
+
height: "24",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
role: "img",
|
|
16
|
+
"aria-labelledby": t,
|
|
17
|
+
class: o,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e("title", { id: t, children: "Calendar icon" }),
|
|
20
|
+
/* @__PURE__ */ e(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
fillRule: "evenodd",
|
|
24
|
+
clipRule: "evenodd",
|
|
25
|
+
d: "M7.50244 10.1563C7.50244 9.74204 7.83823 9.40625 8.25244 9.40625H16.7485C17.1627 9.40625 17.4985 9.74204 17.4985 10.1563C17.4985 10.5705 17.1627 10.9063 16.7485 10.9063H8.25244C7.83823 10.9063 7.50244 10.5705 7.50244 10.1563Z",
|
|
26
|
+
fill: "currentColor"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
"path",
|
|
31
|
+
{
|
|
32
|
+
fillRule: "evenodd",
|
|
33
|
+
clipRule: "evenodd",
|
|
34
|
+
d: "M16.1406 2.25C16.5548 2.25 16.8906 2.58579 16.8906 3V5.96174C16.8906 6.37595 16.5548 6.71174 16.1406 6.71174C15.7264 6.71174 15.3906 6.37595 15.3906 5.96174V3C15.3906 2.58579 15.7264 2.25 16.1406 2.25Z",
|
|
35
|
+
fill: "currentColor"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
d: "M8.86816 2.25C9.28238 2.25 9.61816 2.58579 9.61816 3V5.96174C9.61816 6.37595 9.28238 6.71174 8.86816 6.71174C8.45395 6.71174 8.11816 6.37595 8.11816 5.96174V3C8.11816 2.58579 8.45395 2.25 8.86816 2.25Z",
|
|
44
|
+
fill: "currentColor"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
"path",
|
|
49
|
+
{
|
|
50
|
+
fillRule: "evenodd",
|
|
51
|
+
clipRule: "evenodd",
|
|
52
|
+
d: "M5.0392 4.95256C5.95822 4.07897 7.23731 3.67188 8.69414 3.67188H16.3145C17.7746 3.67188 19.0544 4.07865 19.9721 4.95323C20.8955 5.83327 21.3546 7.094 21.3504 8.60132C21.3504 8.6011 21.3504 8.60154 21.3504 8.60132V16.8137C21.3504 18.3212 20.8891 19.5831 19.9657 20.4646C19.0476 21.341 17.768 21.7504 16.3067 21.7504H8.69414C7.23281 21.7504 5.95209 21.3322 5.03394 20.4423C4.11207 19.5488 3.65039 18.2716 3.65039 16.7456V8.59984C3.65039 7.09167 4.11438 5.83167 5.0392 4.95256ZM6.07265 6.03976C5.51149 6.57317 5.15039 7.40215 5.15039 8.59984V16.7456C5.15039 17.9683 5.5138 18.8185 6.0779 19.3652C6.64573 19.9156 7.51189 20.2504 8.69414 20.2504H16.3067C17.4968 20.2504 18.364 19.9198 18.93 19.3796C19.4906 18.8445 19.8504 18.013 19.8504 16.8137V8.59984V8.59768C19.8539 7.39945 19.4958 6.57144 18.9372 6.03908C18.3728 5.50115 17.5058 5.17187 16.3145 5.17187H8.69414C7.50739 5.17187 6.6396 5.50083 6.07265 6.03976Z",
|
|
53
|
+
fill: "currentColor"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}, M = Z(
|
|
60
|
+
({
|
|
61
|
+
id: o,
|
|
62
|
+
label: t,
|
|
63
|
+
value: s,
|
|
64
|
+
onInput: m,
|
|
65
|
+
min: f,
|
|
66
|
+
max: v,
|
|
67
|
+
placeholder: D = "mm/dd/yyyy",
|
|
68
|
+
error: n,
|
|
69
|
+
showErrorIcon: y,
|
|
70
|
+
helper: a,
|
|
71
|
+
showHelperIcon: R,
|
|
72
|
+
suppressMessages: r = !1,
|
|
73
|
+
disabled: i,
|
|
74
|
+
required: p,
|
|
75
|
+
class: w,
|
|
76
|
+
"data-testid": H,
|
|
77
|
+
...V
|
|
78
|
+
}, c) => {
|
|
79
|
+
const C = $(null), u = `${o}-helper`, I = `${o}-error`, b = r ? "" : [a ? u : null, n ? I : null].filter(Boolean).join(" "), k = (l) => {
|
|
80
|
+
C.current = l, typeof c == "function" ? c(l) : c && (c.current = l);
|
|
81
|
+
}, h = (l) => {
|
|
82
|
+
l.preventDefault();
|
|
83
|
+
const d = C.current;
|
|
84
|
+
if (!(!d || i))
|
|
85
|
+
if (d.focus(), "showPicker" in HTMLInputElement.prototype)
|
|
86
|
+
try {
|
|
87
|
+
d.showPicker();
|
|
88
|
+
} catch {
|
|
89
|
+
d.click();
|
|
90
|
+
}
|
|
91
|
+
else
|
|
92
|
+
d.click();
|
|
93
|
+
};
|
|
94
|
+
return /* @__PURE__ */ e("div", { class: E("IncodeDateInputComposed", w), children: [
|
|
95
|
+
t && /* @__PURE__ */ e(
|
|
96
|
+
"label",
|
|
97
|
+
{
|
|
98
|
+
class: "IncodeDateInputComposedLabel",
|
|
99
|
+
htmlFor: o,
|
|
100
|
+
"data-testid": `${o}-label`,
|
|
101
|
+
children: [
|
|
102
|
+
t,
|
|
103
|
+
p && /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedRequired", children: " *" })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ e("div", { class: "IncodeDateInputComposedWrapper", children: [
|
|
108
|
+
/* @__PURE__ */ e(
|
|
109
|
+
"input",
|
|
110
|
+
{
|
|
111
|
+
ref: k,
|
|
112
|
+
id: o,
|
|
113
|
+
type: "date",
|
|
114
|
+
class: "IncodeDateInputComposedInput",
|
|
115
|
+
value: s,
|
|
116
|
+
onInput: m,
|
|
117
|
+
min: f,
|
|
118
|
+
max: v,
|
|
119
|
+
placeholder: D,
|
|
120
|
+
disabled: i,
|
|
121
|
+
required: p,
|
|
122
|
+
"data-has-value": !!s,
|
|
123
|
+
"data-testid": H,
|
|
124
|
+
"aria-describedby": b || void 0,
|
|
125
|
+
"aria-required": p ? "true" : void 0,
|
|
126
|
+
"aria-invalid": n ? "true" : void 0,
|
|
127
|
+
...V
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ e(
|
|
131
|
+
"button",
|
|
132
|
+
{
|
|
133
|
+
type: "button",
|
|
134
|
+
class: "IncodeDateInputComposedIconButton",
|
|
135
|
+
onClick: h,
|
|
136
|
+
onTouchEnd: h,
|
|
137
|
+
disabled: i,
|
|
138
|
+
"aria-label": t ?? "Date",
|
|
139
|
+
tabIndex: -1,
|
|
140
|
+
children: /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedIcon", children: /* @__PURE__ */ e(B, {}) })
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] }),
|
|
144
|
+
!r && n && /* @__PURE__ */ e(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
class: "IncodeDateInputComposedErrorWrapper",
|
|
148
|
+
"data-testid": `${o}-error-wrapper`,
|
|
149
|
+
children: [
|
|
150
|
+
y && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(g, { size: 17 }) }),
|
|
151
|
+
/* @__PURE__ */ e("p", { id: I, class: "IncodeDateInputComposedError", children: n })
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
!r && a && !n && /* @__PURE__ */ e(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
class: "IncodeDateInputComposedHelperWrapper",
|
|
159
|
+
"data-testid": `${o}-helper-wrapper`,
|
|
160
|
+
children: [
|
|
161
|
+
R && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(x, { size: 17 }) }),
|
|
162
|
+
/* @__PURE__ */ e("p", { id: u, class: "IncodeDateInputComposedHelper", children: a })
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
M.displayName = "DateInputComposed";
|
|
170
|
+
export {
|
|
171
|
+
M as D
|
|
172
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as e, B as u, a as s, r as p } from "./incodeModule-
|
|
1
|
+
import { u as e, B as u, a as s, r as p } from "./incodeModule-_kfNnq5z.js";
|
|
2
2
|
import { createDocumentUploadManager as m } from "@incodetech/core/document-upload";
|
|
3
|
-
import { A as h, y as g, q as I } from "./vendor-preact-
|
|
3
|
+
import { A as h, y as g, q as I } from "./vendor-preact-BDue3y7V.js";
|
|
4
4
|
import "@incodetech/core";
|
|
5
|
-
import { I as f, P as c } from "./incodeComponent-
|
|
6
|
-
import { S as l } from "./spinner-
|
|
5
|
+
import { I as f, P as c } from "./incodeComponent-DSqGVqSo.js";
|
|
6
|
+
import { S as l } from "./spinner-Ogo-u91P.js";
|
|
7
7
|
function U(a) {
|
|
8
8
|
if (a.readyState < 2 || a.videoWidth === 0 || a.videoHeight === 0)
|
|
9
9
|
return null;
|
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import { u as e, c as E } from "./incodeModule-_kfNnq5z.js";
|
|
2
|
+
import { D as _, d as R, A as w, y as W } from "./vendor-preact-BDue3y7V.js";
|
|
3
|
+
import { E as G } from "./errorIcon-hyIEsKoP.js";
|
|
4
|
+
import { S as J } from "./successIcon-Ci24t3I5.js";
|
|
5
|
+
import { C as ie } from "./chevronDown-CIyU9-x9.js";
|
|
6
|
+
const pe = ({
|
|
7
|
+
width: n = 14,
|
|
8
|
+
height: c = 14,
|
|
9
|
+
class: h
|
|
10
|
+
}) => /* @__PURE__ */ e(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
width: n,
|
|
14
|
+
height: c,
|
|
15
|
+
viewBox: "0 0 14 14",
|
|
16
|
+
fill: "none",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
class: `IncodeCloseIcon ${h || ""}`,
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
children: /* @__PURE__ */ e(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
fillRule: "evenodd",
|
|
24
|
+
clipRule: "evenodd",
|
|
25
|
+
d: "M1.61595 0.355755C1.26799 0.00779831 0.70414 0.00779831 0.356183 0.355755C0.00822556 0.703713 0.00822556 1.26756 0.356183 1.61552L5.74046 6.9998L0.356183 12.3841C0.00825542 12.732 0.00831515 13.2959 0.356183 13.6438C0.70414 13.9918 1.26799 13.9918 1.61595 13.6438L7.00023 8.25956L12.3845 13.6438C12.7325 13.9918 13.2963 13.9918 13.6443 13.6438C13.9922 13.2959 13.9922 12.732 13.6443 12.3841L8.25999 6.9998L13.6443 1.61552C13.9922 1.26756 13.9922 0.703713 13.6443 0.355755C13.2963 0.0078879 12.7324 0.00782818 12.3845 0.355755L7.00023 5.74003L1.61595 0.355755Z",
|
|
26
|
+
fill: "var(--icon-neutral-800)"
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
), ue = ({ size: n = 20 }) => /* @__PURE__ */ e(
|
|
31
|
+
"svg",
|
|
32
|
+
{
|
|
33
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
+
width: n,
|
|
35
|
+
height: n,
|
|
36
|
+
viewBox: "0 0 20 20",
|
|
37
|
+
fill: "none",
|
|
38
|
+
class: "IncodeSearchIcon",
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ e("title", { children: "Search" }),
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
|
+
"path",
|
|
44
|
+
{
|
|
45
|
+
d: "M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z",
|
|
46
|
+
stroke: "var(--icon-neutral-300)",
|
|
47
|
+
"stroke-width": "2",
|
|
48
|
+
"stroke-linecap": "round",
|
|
49
|
+
"stroke-linejoin": "round"
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ e(
|
|
53
|
+
"path",
|
|
54
|
+
{
|
|
55
|
+
d: "M19 19L14.65 14.65",
|
|
56
|
+
stroke: "var(--icon-neutral-300)",
|
|
57
|
+
"stroke-width": "2",
|
|
58
|
+
"stroke-linecap": "round",
|
|
59
|
+
"stroke-linejoin": "round"
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
), he = _((n, c) => {
|
|
65
|
+
const { class: h, type: I = "text", ...i } = n;
|
|
66
|
+
return /* @__PURE__ */ e(
|
|
67
|
+
"input",
|
|
68
|
+
{
|
|
69
|
+
...i,
|
|
70
|
+
ref: c,
|
|
71
|
+
type: I,
|
|
72
|
+
class: E("IncodeInput", h)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}), De = _(
|
|
76
|
+
({
|
|
77
|
+
id: n,
|
|
78
|
+
label: c,
|
|
79
|
+
"aria-label": h,
|
|
80
|
+
type: I,
|
|
81
|
+
error: i,
|
|
82
|
+
showErrorIcon: A,
|
|
83
|
+
helper: p,
|
|
84
|
+
showHelperIcon: D,
|
|
85
|
+
closeButton: k,
|
|
86
|
+
required: y,
|
|
87
|
+
suppressMessages: v = !1,
|
|
88
|
+
class: f,
|
|
89
|
+
value: m,
|
|
90
|
+
...C
|
|
91
|
+
}, $) => {
|
|
92
|
+
const S = `${n}-helper`, b = `${n}-error`, F = v ? "" : [p ? S : null, i ? b : null].filter(Boolean).join(" ");
|
|
93
|
+
return /* @__PURE__ */ e("div", { class: E("IncodeInputComposed", f), children: [
|
|
94
|
+
c && /* @__PURE__ */ e(
|
|
95
|
+
"label",
|
|
96
|
+
{
|
|
97
|
+
class: "IncodeInputComposedLabel",
|
|
98
|
+
htmlFor: n,
|
|
99
|
+
"data-testid": `${n}-label`,
|
|
100
|
+
children: c
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
/* @__PURE__ */ e("div", { class: "IncodeInputComposedWrapper", children: [
|
|
104
|
+
/* @__PURE__ */ e(
|
|
105
|
+
he,
|
|
106
|
+
{
|
|
107
|
+
id: n,
|
|
108
|
+
type: I,
|
|
109
|
+
...C,
|
|
110
|
+
ref: $,
|
|
111
|
+
required: y,
|
|
112
|
+
"data-has-value": !!(m && String(m).length > 0),
|
|
113
|
+
...!c && h ? { "aria-label": h } : {},
|
|
114
|
+
"aria-describedby": F || void 0,
|
|
115
|
+
"aria-required": y ? "true" : void 0,
|
|
116
|
+
"aria-invalid": i ? "true" : void 0,
|
|
117
|
+
value: m
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
k?.show && /* @__PURE__ */ e(
|
|
121
|
+
"button",
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
"aria-label": "Clear",
|
|
125
|
+
class: "IncodeInputComposedClearButton",
|
|
126
|
+
onClick: k.onClose,
|
|
127
|
+
"data-testid": `${n}-clear`,
|
|
128
|
+
children: /* @__PURE__ */ e(pe, {})
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] }),
|
|
132
|
+
!v && i && /* @__PURE__ */ e(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
class: "IncodeInputComposedErrorWrapper",
|
|
136
|
+
"data-testid": `${n}-error-wrapper`,
|
|
137
|
+
children: [
|
|
138
|
+
A && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(G, { size: 17 }) }),
|
|
139
|
+
/* @__PURE__ */ e("p", { id: b, class: "IncodeInputComposedError", children: i })
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
!v && p && !i && /* @__PURE__ */ e(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
class: "IncodeInputComposedHelperWrapper",
|
|
147
|
+
"data-testid": `${n}-helper-wrapper`,
|
|
148
|
+
children: [
|
|
149
|
+
D && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(J, { size: 17 }) }),
|
|
150
|
+
/* @__PURE__ */ e("p", { id: S, class: "IncodeInputComposedHelper", children: p })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] });
|
|
155
|
+
}
|
|
156
|
+
), be = ({
|
|
157
|
+
id: n,
|
|
158
|
+
label: c,
|
|
159
|
+
placeholder: h = "Choose an option",
|
|
160
|
+
value: I,
|
|
161
|
+
options: i,
|
|
162
|
+
onChange: A,
|
|
163
|
+
error: p,
|
|
164
|
+
helper: D,
|
|
165
|
+
showErrorIcon: k,
|
|
166
|
+
showHelperIcon: y,
|
|
167
|
+
suppressMessages: v = !1,
|
|
168
|
+
disabled: f = !1,
|
|
169
|
+
required: m,
|
|
170
|
+
searchable: C = !1,
|
|
171
|
+
searchPlaceholder: $ = "Search...",
|
|
172
|
+
noResultsText: S = "No results found",
|
|
173
|
+
name: b,
|
|
174
|
+
tabIndex: F,
|
|
175
|
+
onKeyDown: X,
|
|
176
|
+
onBlur: Y,
|
|
177
|
+
renderSelectedLabel: N,
|
|
178
|
+
siblingElement: H,
|
|
179
|
+
enterKeyHint: fe,
|
|
180
|
+
class: ee,
|
|
181
|
+
"data-testid": oe
|
|
182
|
+
}) => {
|
|
183
|
+
const [t, l] = R(!1), [ne, Z] = R(!1), [s, a] = R(-1), [B, q] = R(""), Q = w(null), x = w(null), U = w(null), K = w([]), O = w(null), z = w(""), g = w(), T = i.find((o) => o.value === I), d = C && B ? i.filter(
|
|
184
|
+
(o) => o.label.toLowerCase().includes(B.toLowerCase())
|
|
185
|
+
) : i, j = `${n}-label`, V = `${n}-listbox`, M = `${n}-helper`, P = `${n}-error`, re = v ? "" : [D ? M : null, p ? P : null].filter(Boolean).join(" ");
|
|
186
|
+
W(() => {
|
|
187
|
+
if (!t) return;
|
|
188
|
+
const o = requestAnimationFrame(() => {
|
|
189
|
+
C && O.current && O.current.focus(), requestAnimationFrame(() => {
|
|
190
|
+
U.current?.scrollIntoView({
|
|
191
|
+
behavior: "smooth",
|
|
192
|
+
block: "nearest",
|
|
193
|
+
inline: "nearest"
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
return () => cancelAnimationFrame(o);
|
|
198
|
+
}, [t, C]), W(() => {
|
|
199
|
+
t || (a(-1), q(""));
|
|
200
|
+
}, [t]), W(() => {
|
|
201
|
+
s >= 0 && K.current[s] && K.current[s]?.scrollIntoView({
|
|
202
|
+
block: "nearest",
|
|
203
|
+
inline: "nearest"
|
|
204
|
+
});
|
|
205
|
+
}, [s]), W(() => () => {
|
|
206
|
+
g.current && clearTimeout(g.current);
|
|
207
|
+
}, []);
|
|
208
|
+
const te = () => {
|
|
209
|
+
f || l((o) => !o);
|
|
210
|
+
}, L = (o) => {
|
|
211
|
+
A(o), l(!1), a(-1), x.current?.focus();
|
|
212
|
+
}, ae = () => {
|
|
213
|
+
Z(!0);
|
|
214
|
+
}, se = (o) => {
|
|
215
|
+
Z(!1), Q.current?.contains(o.relatedTarget) || (l(!1), Y?.());
|
|
216
|
+
}, ce = (o) => {
|
|
217
|
+
if (f) return;
|
|
218
|
+
X?.(o);
|
|
219
|
+
const { key: u } = o;
|
|
220
|
+
if (u.length === 1 && /^[a-zA-Z0-9]$/.test(u)) {
|
|
221
|
+
o.preventDefault(), g.current && clearTimeout(g.current), z.current += u.toLowerCase();
|
|
222
|
+
const r = d.findIndex(
|
|
223
|
+
(le) => le.label.toLowerCase().startsWith(z.current)
|
|
224
|
+
);
|
|
225
|
+
r !== -1 && (t || l(!0), a(r)), g.current = setTimeout(() => {
|
|
226
|
+
z.current = "";
|
|
227
|
+
}, 500);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
switch (u) {
|
|
231
|
+
case "ArrowDown":
|
|
232
|
+
o.preventDefault(), t ? a(
|
|
233
|
+
(r) => r < d.length - 1 ? r + 1 : r
|
|
234
|
+
) : (l(!0), a(0));
|
|
235
|
+
break;
|
|
236
|
+
case "ArrowUp":
|
|
237
|
+
o.preventDefault(), t ? a((r) => r > 0 ? r - 1 : r) : (l(!0), a(d.length - 1));
|
|
238
|
+
break;
|
|
239
|
+
case "Home":
|
|
240
|
+
o.preventDefault(), t && a(0);
|
|
241
|
+
break;
|
|
242
|
+
case "End":
|
|
243
|
+
o.preventDefault(), t && a(d.length - 1);
|
|
244
|
+
break;
|
|
245
|
+
case "Enter":
|
|
246
|
+
o.preventDefault(), t && s >= 0 && d[s] ? L(d[s].value) : t || l(!0);
|
|
247
|
+
break;
|
|
248
|
+
case " ":
|
|
249
|
+
o.preventDefault(), t && s >= 0 && d[s] ? L(d[s].value) : t || (l(!0), a(0));
|
|
250
|
+
break;
|
|
251
|
+
case "Escape":
|
|
252
|
+
o.preventDefault(), t && (l(!1), a(-1), x.current?.focus());
|
|
253
|
+
break;
|
|
254
|
+
case "Tab":
|
|
255
|
+
t && (l(!1), a(-1));
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
}, de = (o) => {
|
|
259
|
+
const { key: u } = o;
|
|
260
|
+
switch (u) {
|
|
261
|
+
case "ArrowDown":
|
|
262
|
+
o.preventDefault(), a(
|
|
263
|
+
(r) => r < d.length - 1 ? r + 1 : r
|
|
264
|
+
);
|
|
265
|
+
break;
|
|
266
|
+
case "ArrowUp":
|
|
267
|
+
o.preventDefault(), a((r) => r > 0 ? r - 1 : r);
|
|
268
|
+
break;
|
|
269
|
+
case "Home":
|
|
270
|
+
o.preventDefault(), a(0);
|
|
271
|
+
break;
|
|
272
|
+
case "End":
|
|
273
|
+
o.preventDefault(), a(d.length - 1);
|
|
274
|
+
break;
|
|
275
|
+
case "Enter":
|
|
276
|
+
o.preventDefault(), s >= 0 && d[s] && L(d[s].value);
|
|
277
|
+
break;
|
|
278
|
+
case "Escape":
|
|
279
|
+
o.preventDefault(), l(!1), a(-1), x.current?.focus();
|
|
280
|
+
break;
|
|
281
|
+
case "Tab":
|
|
282
|
+
l(!1), a(-1);
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
return /* @__PURE__ */ e(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
class: E("IncodeDropdownComposed", ee),
|
|
290
|
+
ref: Q,
|
|
291
|
+
onBlur: se,
|
|
292
|
+
children: [
|
|
293
|
+
b && /* @__PURE__ */ e(
|
|
294
|
+
"input",
|
|
295
|
+
{
|
|
296
|
+
type: "hidden",
|
|
297
|
+
name: b,
|
|
298
|
+
value: I || "",
|
|
299
|
+
disabled: f,
|
|
300
|
+
required: m
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
c && /* @__PURE__ */ e(
|
|
304
|
+
"label",
|
|
305
|
+
{
|
|
306
|
+
class: "IncodeDropdownComposedLabel",
|
|
307
|
+
id: j,
|
|
308
|
+
htmlFor: n,
|
|
309
|
+
"data-testid": `${n}-label`,
|
|
310
|
+
children: [
|
|
311
|
+
c,
|
|
312
|
+
m && /* @__PURE__ */ e("span", { class: "IncodeDropdownComposedRequired", children: " *" })
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ e("div", { class: "IncodeDropdownComposedWrapper", children: [
|
|
317
|
+
/* @__PURE__ */ e(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
class: E("IncodeDropdownComposedTriggerRow", {
|
|
321
|
+
IncodeDropdownComposedTriggerRowWithSibling: !!H
|
|
322
|
+
}),
|
|
323
|
+
children: [
|
|
324
|
+
/* @__PURE__ */ e(
|
|
325
|
+
"button",
|
|
326
|
+
{
|
|
327
|
+
ref: x,
|
|
328
|
+
type: "button",
|
|
329
|
+
id: n,
|
|
330
|
+
class: "IncodeDropdownComposedTrigger",
|
|
331
|
+
onClick: te,
|
|
332
|
+
onFocus: ae,
|
|
333
|
+
onKeyDown: ce,
|
|
334
|
+
tabIndex: f ? -1 : F ?? 0,
|
|
335
|
+
disabled: f,
|
|
336
|
+
"aria-haspopup": "listbox",
|
|
337
|
+
"aria-expanded": t ? "true" : "false",
|
|
338
|
+
"aria-disabled": f ? "true" : void 0,
|
|
339
|
+
"aria-labelledby": c ? j : void 0,
|
|
340
|
+
"aria-label": c ? void 0 : h,
|
|
341
|
+
"aria-controls": t ? V : void 0,
|
|
342
|
+
"aria-activedescendant": t && s >= 0 ? `${n}-option-${s}` : void 0,
|
|
343
|
+
"aria-invalid": p ? "true" : void 0,
|
|
344
|
+
"aria-required": m ? "true" : void 0,
|
|
345
|
+
"aria-describedby": re || void 0,
|
|
346
|
+
"data-error": p ? "true" : void 0,
|
|
347
|
+
"data-focused": ne || t ? "true" : void 0,
|
|
348
|
+
"data-testid": oe,
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ e(
|
|
351
|
+
"span",
|
|
352
|
+
{
|
|
353
|
+
class: T ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
|
|
354
|
+
children: T ? N ? N(T) : T.label : h
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ e(
|
|
358
|
+
"span",
|
|
359
|
+
{
|
|
360
|
+
class: "IncodeDropdownComposedTriggerIcon",
|
|
361
|
+
"aria-hidden": "true",
|
|
362
|
+
"data-open": t,
|
|
363
|
+
children: /* @__PURE__ */ e(ie, {})
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
H && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSibling", children: H })
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
t && /* @__PURE__ */ e(
|
|
374
|
+
"div",
|
|
375
|
+
{
|
|
376
|
+
ref: U,
|
|
377
|
+
id: V,
|
|
378
|
+
class: "IncodeDropdownComposedList",
|
|
379
|
+
role: "listbox",
|
|
380
|
+
"aria-labelledby": c ? j : void 0,
|
|
381
|
+
"aria-label": c ? void 0 : h,
|
|
382
|
+
"data-error": p ? "true" : void 0,
|
|
383
|
+
children: [
|
|
384
|
+
C && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSearchWrapper", children: /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSearchInner", children: [
|
|
385
|
+
/* @__PURE__ */ e(
|
|
386
|
+
"input",
|
|
387
|
+
{
|
|
388
|
+
ref: O,
|
|
389
|
+
type: "text",
|
|
390
|
+
class: "IncodeDropdownComposedSearchInput",
|
|
391
|
+
value: B,
|
|
392
|
+
onInput: (o) => {
|
|
393
|
+
q(o.target.value), a(0);
|
|
394
|
+
},
|
|
395
|
+
onKeyDown: de,
|
|
396
|
+
placeholder: $,
|
|
397
|
+
"aria-label": $,
|
|
398
|
+
autocomplete: "off"
|
|
399
|
+
}
|
|
400
|
+
),
|
|
401
|
+
/* @__PURE__ */ e(
|
|
402
|
+
"span",
|
|
403
|
+
{
|
|
404
|
+
class: "IncodeDropdownComposedSearchIcon",
|
|
405
|
+
"aria-hidden": "true",
|
|
406
|
+
children: /* @__PURE__ */ e(ue, { size: 20 })
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] }) }),
|
|
410
|
+
/* @__PURE__ */ e("div", { class: "IncodeDropdownComposedOptionsScroll", children: d.length === 0 ? /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedNoResults", children: S }) : d.map((o, u) => /* @__PURE__ */ e(
|
|
411
|
+
"div",
|
|
412
|
+
{
|
|
413
|
+
id: `${n}-option-${u}`,
|
|
414
|
+
role: "option",
|
|
415
|
+
"aria-selected": I === o.value ? "true" : "false",
|
|
416
|
+
class: "IncodeDropdownComposedOption",
|
|
417
|
+
"data-highlighted": s === u,
|
|
418
|
+
ref: (r) => {
|
|
419
|
+
K.current[u] = r;
|
|
420
|
+
},
|
|
421
|
+
onClick: () => L(o.value),
|
|
422
|
+
onMouseDown: (r) => r.preventDefault(),
|
|
423
|
+
onMouseEnter: () => a(u),
|
|
424
|
+
children: o.label
|
|
425
|
+
},
|
|
426
|
+
o.value
|
|
427
|
+
)) })
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
] }),
|
|
432
|
+
!v && p && /* @__PURE__ */ e(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
class: "IncodeDropdownComposedErrorWrapper",
|
|
436
|
+
"data-testid": `${n}-error-wrapper`,
|
|
437
|
+
children: [
|
|
438
|
+
k && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(G, { size: 17 }) }),
|
|
439
|
+
/* @__PURE__ */ e("p", { id: P, class: "IncodeDropdownComposedError", children: p })
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
!v && D && !p && /* @__PURE__ */ e(
|
|
444
|
+
"div",
|
|
445
|
+
{
|
|
446
|
+
class: "IncodeDropdownComposedHelperWrapper",
|
|
447
|
+
"data-testid": `${n}-helper-wrapper`,
|
|
448
|
+
children: [
|
|
449
|
+
y && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(J, { size: 17 }) }),
|
|
450
|
+
/* @__PURE__ */ e("p", { id: M, class: "IncodeDropdownComposedHelper", children: D })
|
|
451
|
+
]
|
|
452
|
+
}
|
|
453
|
+
)
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
);
|
|
457
|
+
};
|
|
458
|
+
export {
|
|
459
|
+
be as D,
|
|
460
|
+
De as I
|
|
461
|
+
};
|