se-design 1.0.88-dev → 1.0.90-dev.0
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/assets/icons/cloud-check.svg +4 -0
- package/dist/assets/style.css +1 -1
- package/dist/components/Icon/index.d.ts +5 -0
- package/dist/components/InputWithTags/index.d.ts +4 -1
- package/dist/components/SidebarOverlay/index.d.ts +0 -41
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts +5 -1
- package/dist/index112.js +1 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +2 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +1 -1
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +2 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +1 -1
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +2 -2
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +1 -1
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +1 -1
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +1 -1
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +1 -1
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +1 -1
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +2 -2
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +2 -2
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +1 -1
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +1 -1
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +2 -2
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +1 -1
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +2 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +2 -2
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +2 -2
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +111 -107
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +2 -2
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +1 -1
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +1 -1
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +1 -1
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +1 -1
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +1 -1
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +1 -1
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +1 -1
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +1 -1
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +1 -1
- package/dist/index179.js.map +1 -1
- package/dist/index180.js +1 -1
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +1 -1
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +1 -1
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +1 -1
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +1 -1
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +2 -2
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +2 -2
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +1 -1
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +1 -1
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +2 -2
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +2 -2
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +1 -1
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +1 -1
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +1 -1
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +1 -1
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +1 -1
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +1 -1
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +1 -1
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +1 -1
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +1 -1
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -2
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -2
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +2 -149
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +149 -9
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +8 -5
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -4
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +1 -1
- package/dist/index223.js +8 -0
- package/dist/index223.js.map +1 -0
- package/dist/{index224.js → index225.js} +1 -1
- package/dist/{index224.js.map → index225.js.map} +1 -1
- package/dist/index23.js +16 -16
- package/dist/index23.js.map +1 -1
- package/dist/{index232.js → index233.js} +1 -1
- package/dist/{index232.js.map → index233.js.map} +1 -1
- package/dist/{index235.js → index236.js} +1 -1
- package/dist/{index235.js.map → index236.js.map} +1 -1
- package/dist/index245.js +169 -3
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +7 -0
- package/dist/index246.js.map +1 -0
- package/dist/index248.js +18 -9
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +9 -9
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -1
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +9 -4
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +5 -170
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +170 -11
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +11 -6
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +5 -5
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +5 -37
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +38 -2
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +2 -8
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +7 -326
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +324 -47
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +50 -2
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +2 -76
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +65 -82
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +89 -48
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +51 -7
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +7 -4
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +4 -51
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +52 -2
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +2 -2
- package/dist/index269.js +5 -0
- package/dist/index269.js.map +1 -0
- package/dist/index28.js +88 -149
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +72 -71
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +1 -1
- package/dist/index33.js +1 -1
- package/dist/index35.js +1 -1
- package/dist/index36.js +1 -1
- package/dist/index37.js +61 -37
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +163 -162
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +55 -51
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +66 -61
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +1 -1
- package/dist/index45.js +39 -38
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +52 -51
- package/dist/index46.js.map +1 -1
- package/dist/index49.js +1 -1
- package/dist/index51.js +1 -1
- package/dist/index52.js +1 -1
- package/dist/index53.js +1 -1
- package/dist/index57.js +1 -1
- package/dist/index6.js +305 -299
- package/dist/index6.js.map +1 -1
- package/dist/index61.js +1 -1
- package/dist/index63.js +1 -1
- package/dist/index65.js +1 -1
- package/dist/index7.js +1 -1
- package/dist/index79.js +1 -1
- package/dist/index81.js +9 -7
- package/dist/index81.js.map +1 -1
- package/dist/index9.js +20 -20
- package/dist/index9.js.map +1 -1
- package/package.json +1 -1
- package/dist/index244.js +0 -173
- package/dist/index244.js.map +0 -1
- package/dist/index247.js +0 -22
- package/dist/index247.js.map +0 -1
package/dist/index45.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e, { useState as k, useRef as S, useCallback as P, useEffect as
|
|
1
|
+
import e, { useState as k, useRef as S, useCallback as P, useEffect as Y } from "react";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { Icon as x } from "./index6.js";
|
|
4
|
-
import { useStableId as
|
|
4
|
+
import { useStableId as Z } from "./index206.js";
|
|
5
5
|
import { getA11yNameAttributes as ee } from "./index81.js";
|
|
6
6
|
import "./index72.js";
|
|
7
7
|
import { useCombobox as te } from "./index68.js";
|
|
@@ -19,65 +19,66 @@ const ce = /* @__PURE__ */ e.memo(({
|
|
|
19
19
|
onChange: i,
|
|
20
20
|
disabled: t = !1,
|
|
21
21
|
maxLength: a,
|
|
22
|
-
tag:
|
|
22
|
+
tag: F = "input",
|
|
23
23
|
error: l = !1,
|
|
24
|
-
errorMessage:
|
|
24
|
+
errorMessage: R,
|
|
25
25
|
label: p,
|
|
26
|
-
placeholder:
|
|
26
|
+
placeholder: j,
|
|
27
27
|
suggestions: c = [],
|
|
28
|
-
onSelect:
|
|
28
|
+
onSelect: E,
|
|
29
29
|
renderOption: d,
|
|
30
|
-
optionClassName:
|
|
31
|
-
automationId:
|
|
32
|
-
ariaLabel:
|
|
30
|
+
optionClassName: A,
|
|
31
|
+
automationId: B = "",
|
|
32
|
+
ariaLabel: $,
|
|
33
33
|
ariaLabelledBy: O,
|
|
34
34
|
ariaDescribedBy: V,
|
|
35
35
|
..._
|
|
36
36
|
}) => {
|
|
37
|
-
const [s,
|
|
38
|
-
g(!1),
|
|
39
|
-
}, [
|
|
37
|
+
const [s, b] = k([...c]), [v, g] = k(!1), H = S(null), N = S(null), f = Z(void 0, "autocomplete"), z = `${f}-input`, D = `${f}-listbox`, y = `${f}-label`, C = `${f}-error`, w = P((r) => {
|
|
38
|
+
g(!1), E?.(r);
|
|
39
|
+
}, [E]), {
|
|
40
40
|
containerProps: K,
|
|
41
41
|
inputProps: M,
|
|
42
42
|
listboxProps: q,
|
|
43
43
|
getOptionProps: G,
|
|
44
44
|
highlightedIndex: J,
|
|
45
45
|
setHighlightedIndex: h,
|
|
46
|
-
isKeyboardFocused:
|
|
46
|
+
isKeyboardFocused: L
|
|
47
47
|
} = te({
|
|
48
48
|
items: s,
|
|
49
|
-
isOpen:
|
|
49
|
+
isOpen: v,
|
|
50
50
|
onOpenChange: g,
|
|
51
51
|
onSelect: w,
|
|
52
52
|
listboxId: D
|
|
53
|
-
}),
|
|
53
|
+
}), Q = P((r) => {
|
|
54
54
|
const n = r.target.value;
|
|
55
55
|
if (h(-1), i(n), !d)
|
|
56
56
|
if (n === "")
|
|
57
|
-
|
|
57
|
+
b([...c]);
|
|
58
58
|
else {
|
|
59
59
|
const I = c?.filter((m) => typeof m == "object" && m?.label?.toLowerCase().includes(n?.toLowerCase() ?? ""));
|
|
60
|
-
|
|
60
|
+
b([...I]);
|
|
61
61
|
}
|
|
62
62
|
}, [i, c, d, h]);
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
Y(() => {
|
|
64
|
+
b([...c]);
|
|
65
65
|
}, [c]);
|
|
66
|
-
const
|
|
66
|
+
const T = () => {
|
|
67
67
|
g(!0);
|
|
68
|
-
},
|
|
68
|
+
}, U = () => {
|
|
69
69
|
s.length > 0 && g(!0);
|
|
70
|
-
},
|
|
70
|
+
}, W = () => {
|
|
71
71
|
i(""), h(-1), N.current?.focus();
|
|
72
|
-
},
|
|
73
|
-
ariaLabelledBy:
|
|
74
|
-
|
|
72
|
+
}, X = ee({
|
|
73
|
+
ariaLabelledBy: O,
|
|
74
|
+
internalLabelId: p ? y : void 0,
|
|
75
|
+
ariaLabel: $,
|
|
75
76
|
ariaDescribedBy: l ? C : V
|
|
76
77
|
});
|
|
77
78
|
return /* @__PURE__ */ e.createElement("div", u({
|
|
78
79
|
className: "main-container-autocomplete-se-design",
|
|
79
80
|
ref: H,
|
|
80
|
-
"data-automation-id":
|
|
81
|
+
"data-automation-id": B
|
|
81
82
|
}, K), p && /* @__PURE__ */ e.createElement("span", {
|
|
82
83
|
id: y,
|
|
83
84
|
className: `label-container ${t ? "label-container-disabled" : ""}`
|
|
@@ -88,36 +89,36 @@ const ce = /* @__PURE__ */ e.memo(({
|
|
|
88
89
|
style: {
|
|
89
90
|
pointerEvents: t ? "none" : "auto"
|
|
90
91
|
}
|
|
91
|
-
}, /* @__PURE__ */ e.createElement(
|
|
92
|
+
}, /* @__PURE__ */ e.createElement(F, {
|
|
92
93
|
ref: N,
|
|
93
94
|
id: z,
|
|
94
95
|
value: o,
|
|
95
|
-
onChange:
|
|
96
|
-
onClick:
|
|
97
|
-
onFocus:
|
|
96
|
+
onChange: Q,
|
|
97
|
+
onClick: T,
|
|
98
|
+
onFocus: U,
|
|
98
99
|
...M,
|
|
99
100
|
disabled: t,
|
|
100
101
|
className: `${l ? "input-container-error" : "input-container-default"} ${t ? "input-container-disabled" : ""} ${s.length > 0 || o ? "with-icon" : ""} ${s.length > 0 && o ? "with-icons" : ""}`,
|
|
101
102
|
maxLength: a,
|
|
102
|
-
placeholder:
|
|
103
|
+
placeholder: j,
|
|
103
104
|
"aria-invalid": l || void 0,
|
|
104
|
-
...
|
|
105
|
+
...X,
|
|
105
106
|
..._
|
|
106
107
|
}), o && /* @__PURE__ */ e.createElement(x, {
|
|
107
108
|
name: "close",
|
|
108
109
|
className: "input-icon-close",
|
|
109
110
|
size: 15,
|
|
110
|
-
onClick:
|
|
111
|
+
onClick: W,
|
|
111
112
|
stroke: t ? "var(--color-gray-600)" : "",
|
|
112
113
|
ariaLabel: "Clear input"
|
|
113
114
|
}), s.length > 0 && /* @__PURE__ */ e.createElement(x, {
|
|
114
115
|
name: "chevron",
|
|
115
|
-
rotation:
|
|
116
|
+
rotation: v ? "180" : "0",
|
|
116
117
|
className: "input-icon-chevron",
|
|
117
118
|
stroke: t ? "var(--color-gray-600)" : "",
|
|
118
119
|
"aria-hidden": "true"
|
|
119
|
-
})),
|
|
120
|
-
"aria-label": p ||
|
|
120
|
+
})), v && s.length > 0 && /* @__PURE__ */ e.createElement("div", u({}, q, {
|
|
121
|
+
"aria-label": p || $ || "Suggestions",
|
|
121
122
|
className: "suggestions-list",
|
|
122
123
|
"data-automation-id": "autocomplete-suggestions-list"
|
|
123
124
|
}), s.map((r, n) => {
|
|
@@ -125,7 +126,7 @@ const ce = /* @__PURE__ */ e.memo(({
|
|
|
125
126
|
return /* @__PURE__ */ e.createElement("div", u({
|
|
126
127
|
key: n
|
|
127
128
|
}, I, {
|
|
128
|
-
className: `${
|
|
129
|
+
className: `${A || "suggestion-item"} ${m ? `suggestion-item-highlighted${L ? " suggestion-item-keyboard-highlight" : ""}` : ""}`,
|
|
129
130
|
onClick: () => w(r),
|
|
130
131
|
onMouseEnter: () => h(n),
|
|
131
132
|
"data-automation-id": `autocomplete-suggestion-item-${n}`
|
|
@@ -139,7 +140,7 @@ const ce = /* @__PURE__ */ e.memo(({
|
|
|
139
140
|
id: C,
|
|
140
141
|
className: "error-message",
|
|
141
142
|
role: "alert"
|
|
142
|
-
},
|
|
143
|
+
}, R), a && /* @__PURE__ */ e.createElement("div", {
|
|
143
144
|
className: "max-word"
|
|
144
145
|
}, o.length, "/", a)));
|
|
145
146
|
});
|
package/dist/index45.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index45.js","sources":["../src/components/AutoCompleteInput/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useCallback, useState } from 'react';\nimport './style.scss';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes, useCombobox } from '../../utils/a11y';\n\nexport interface AutoCompleteInputProps {\n value: string;\n disabled?: boolean;\n maxLength?: number;\n /** Called when the user types in the input. Not called on suggestion selection. */\n onChange: (value: string) => void;\n tag?: string;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n /**\n * Suggestion items. Default rendering expects { label, value } shape.\n * When renderOption is provided, any shape is accepted.\n */\n suggestions?: any[];\n /**\n * Called when a suggestion is selected (click or Enter key).\n * Receives the full item object from the suggestions array.\n */\n onSelect?: (item: any) => void;\n /**\n * Render custom content for each suggestion option. The component handles the option wrapper\n * (ARIA props, highlight, click, keyboard navigation). You only provide the inner content.\n */\n renderOption?: (suggestion: any, context: { isHighlighted: boolean; index: number }) => React.ReactNode;\n /**\n * Custom CSS class for option elements. Replaces the default 'suggestion-item' class.\n * Useful with renderOption to apply custom styling to option wrappers.\n */\n optionClassName?: string;\n automationId?: string;\n /**\n * Accessible label for the input. Used when no visible label is provided.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this input. Takes precedence over ariaLabel.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) providing additional description.\n */\n ariaDescribedBy?: string;\n}\n\nexport const AutoCompleteInput: React.FC<AutoCompleteInputProps> = React.memo(\n ({\n value,\n onChange,\n disabled = false,\n maxLength,\n tag = 'input',\n error = false,\n errorMessage,\n label,\n placeholder,\n suggestions = [],\n onSelect,\n renderOption,\n optionClassName,\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ...props\n }) => {\n const [filteredSuggestions, setFilteredSuggestions] = useState<any[]>([...suggestions]);\n const [isSuggestionBoxVisible, setSuggestionBoxVisible] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Generate stable unique IDs per instance so label, input, listbox, and error never share IDs (HTML/ARIA require unique ids).\n const instanceId = useStableId(undefined, 'autocomplete');\n const inputId = `${instanceId}-input`;\n const listboxId = `${instanceId}-listbox`;\n const labelId = `${instanceId}-label`;\n const errorId = `${instanceId}-error`;\n\n const handleSelectSuggestion = useCallback(\n (item: any) => {\n setSuggestionBoxVisible(false);\n onSelect?.(item);\n },\n [onSelect]\n );\n\n // Use the comprehensive useCombobox hook\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex,\n isKeyboardFocused\n } = useCombobox<any>({\n items: filteredSuggestions,\n isOpen: isSuggestionBoxVisible,\n onOpenChange: setSuggestionBoxVisible,\n onSelect: handleSelectSuggestion,\n listboxId\n });\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n setHighlightedIndex(-1); // Reset highlight on input change\n onChange(inputValue);\n\n // Internal filtering for default rendering (when no renderOption, component manages filtering)\n if (!renderOption) {\n if (inputValue === '') {\n setFilteredSuggestions([...suggestions]);\n } else {\n const filtered = suggestions?.filter(\n (suggestion) =>\n typeof suggestion === 'object' &&\n suggestion?.label?.toLowerCase().includes(inputValue?.toLowerCase() ?? '')\n );\n setFilteredSuggestions([...filtered]);\n }\n }\n },\n [onChange, suggestions, renderOption, setHighlightedIndex]\n );\n\n useEffect(() => {\n setFilteredSuggestions([...suggestions]);\n }, [suggestions]);\n\n const handleInputClick = () => {\n setSuggestionBoxVisible(true);\n };\n\n const handleInputFocus = () => {\n if (filteredSuggestions.length > 0) {\n setSuggestionBoxVisible(true);\n }\n };\n\n const handleClearInput = () => {\n onChange('');\n setHighlightedIndex(-1);\n inputRef.current?.focus();\n };\n\n // Build ARIA name attributes: when ariaLabel is provided use it (e.g. \"Signer 1 name\"); otherwise use visible label or ariaLabelledBy\n const a11yNameProps = getA11yNameAttributes({\n ariaLabelledBy: label && !ariaLabel ? labelId : ariaLabelledBy,\n ariaLabel,\n ariaDescribedBy: error ? errorId : ariaDescribedBy\n });\n\n return (\n <div \n className=\"main-container-autocomplete-se-design\" \n ref={containerRef} \n data-automation-id={automationId}\n {...containerProps}\n >\n {label && (\n <span\n id={labelId}\n className={`label-container ${disabled ? 'label-container-disabled' : ''}`}\n >\n {label}\n </span>\n )}\n <div className=\"input-container-wrapper\">\n <div className=\"input-wrapper\" style={{ pointerEvents: disabled ? 'none' : 'auto' }}>\n {React.createElement(tag, {\n ref: inputRef,\n id: inputId,\n value: value,\n onChange: handleInputChange,\n onClick: handleInputClick,\n onFocus: handleInputFocus,\n ...comboboxInputProps,\n disabled,\n className: `${error ? 'input-container-error' : 'input-container-default'} ${disabled ? 'input-container-disabled' : ''} ${filteredSuggestions.length > 0 || value ? 'with-icon' : ''} ${filteredSuggestions.length > 0 && value ? 'with-icons' : ''}`,\n maxLength,\n placeholder,\n 'aria-invalid': error || undefined,\n ...a11yNameProps,\n ...props\n })}\n {value && (\n <Icon\n name=\"close\"\n className=\"input-icon-close\"\n size={15}\n onClick={handleClearInput}\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n ariaLabel=\"Clear input\"\n />\n )}\n {filteredSuggestions.length > 0 && (\n <Icon\n name=\"chevron\"\n rotation={isSuggestionBoxVisible ? '180' : '0'}\n className=\"input-icon-chevron\"\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isSuggestionBoxVisible && filteredSuggestions.length > 0 && (\n <div\n {...listboxProps}\n aria-label={label || ariaLabel || 'Suggestions'}\n className=\"suggestions-list\"\n data-automation-id=\"autocomplete-suggestions-list\"\n >\n {filteredSuggestions.map((suggestion, index) => {\n const optionProps = getOptionProps(index, false);\n const isHighlighted = highlightedIndex === index;\n return (\n <div\n key={index}\n {...optionProps}\n className={`${optionClassName || 'suggestion-item'} ${isHighlighted ? `suggestion-item-highlighted${isKeyboardFocused ? ' suggestion-item-keyboard-highlight' : ''}` : ''}`}\n onClick={() => handleSelectSuggestion(suggestion)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`autocomplete-suggestion-item-${index}`}\n >\n {renderOption\n ? renderOption(suggestion, { isHighlighted, index })\n : suggestion.label}\n </div>\n );\n })}\n </div>\n )}\n </div>\n {(error || maxLength) && (\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'} ${disabled ? 'disabled' : ''}`}>\n {error && (\n <div id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {maxLength && (\n <div className=\"max-word\">\n {value.length}/{maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n"],"names":["AutoCompleteInput","React","memo","value","onChange","disabled","maxLength","tag","error","errorMessage","label","placeholder","suggestions","onSelect","renderOption","optionClassName","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","props","filteredSuggestions","setFilteredSuggestions","useState","isSuggestionBoxVisible","setSuggestionBoxVisible","containerRef","useRef","inputRef","instanceId","useStableId","undefined","inputId","listboxId","labelId","errorId","handleSelectSuggestion","useCallback","item","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","isKeyboardFocused","useCombobox","items","isOpen","onOpenChange","handleInputChange","e","inputValue","target","filtered","filter","suggestion","toLowerCase","includes","useEffect","handleInputClick","handleInputFocus","length","handleClearInput","current","focus","a11yNameProps","getA11yNameAttributes","createElement","_extends","className","ref","id","style","pointerEvents","onClick","onFocus","Icon","name","size","stroke","rotation","map","index","optionProps","isHighlighted","key","onMouseEnter","role"],"mappings":";;;;;;;;;;;;;;;;AAoDO,MAAMA,KAAsDC,gBAAAA,EAAMC,KACvE,CAAC;AAAA,EACCC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,KAAAA,IAAM;AAAA,EACNC,OAAAA,IAAQ;AAAA,EACRC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,aAAAA,IAAc,CAAA;AAAA,EACdC,UAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,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iB,IAAIuE,IAAgB,8BAA8BxC,IAAoB,wCAAwC,EAAE,KAAK,EAAE;AAAA,MACzK8B,SAASA,MAAMxC,EAAuBqB,CAAU;AAAA,MAChD+B,cAAcA,MAAM3C,EAAoBuC,CAAK;AAAA,MAC7C,sBAAoB,gCAAgCA,CAAK;AAAA,IAAA,CAAG,GAE3DtE,IACGA,EAAa2C,GAAY;AAAA,MAAE6B,eAAAA;AAAAA,MAAeF,OAAAA;AAAAA,IAAAA,CAAO,IACjD3B,EAAW/C,KACZ;AAAA,EAET,CAAC,CACE,CAEJ,IACHF,KAASF,MACTL,gBAAAA,EAAAoE,cAAA,OAAA;AAAA,IAAKE,WAAW,GAAG/D,IAAQ,uBAAuB,oBAAoB,IAAIH,IAAW,aAAa,EAAE;AAAA,EAAA,GACjGG,KACCP,gBAAAA,EAAAoE,cAAA,OAAA;AAAA,IAAKI,IAAItC;AAAAA,IAASoC,WAAU;AAAA,IAAgBkB,MAAK;AAAA,EAAA,GAC9ChF,CACE,GAENH,KACCL,gBAAAA,EAAAoE,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,EAAA,GACZpE,EAAM4D,QAAO,KAAEzD,CACb,CAEJ,CAEJ;AAET,CACF;"}
|
|
1
|
+
{"version":3,"file":"index45.js","sources":["../src/components/AutoCompleteInput/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useCallback, useState } from 'react';\nimport './style.scss';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes, useCombobox } from '../../utils/a11y';\n\nexport interface AutoCompleteInputProps {\n value: string;\n disabled?: boolean;\n maxLength?: number;\n /** Called when the user types in the input. Not called on suggestion selection. */\n onChange: (value: string) => void;\n tag?: string;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n /**\n * Suggestion items. Default rendering expects { label, value } shape.\n * When renderOption is provided, any shape is accepted.\n */\n suggestions?: any[];\n /**\n * Called when a suggestion is selected (click or Enter key).\n * Receives the full item object from the suggestions array.\n */\n onSelect?: (item: any) => void;\n /**\n * Render custom content for each suggestion option. The component handles the option wrapper\n * (ARIA props, highlight, click, keyboard navigation). You only provide the inner content.\n */\n renderOption?: (suggestion: any, context: { isHighlighted: boolean; index: number }) => React.ReactNode;\n /**\n * Custom CSS class for option elements. Replaces the default 'suggestion-item' class.\n * Useful with renderOption to apply custom styling to option wrappers.\n */\n optionClassName?: string;\n automationId?: string;\n /**\n * Accessible label for the input. Used when no visible label is provided.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this input. Takes precedence over ariaLabel.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) providing additional description.\n */\n ariaDescribedBy?: string;\n}\n\nexport const AutoCompleteInput: React.FC<AutoCompleteInputProps> = React.memo(\n ({\n value,\n onChange,\n disabled = false,\n maxLength,\n tag = 'input',\n error = false,\n errorMessage,\n label,\n placeholder,\n suggestions = [],\n onSelect,\n renderOption,\n optionClassName,\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ...props\n }) => {\n const [filteredSuggestions, setFilteredSuggestions] = useState<any[]>([...suggestions]);\n const [isSuggestionBoxVisible, setSuggestionBoxVisible] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Generate stable unique IDs per instance so label, input, listbox, and error never share IDs (HTML/ARIA require unique ids).\n const instanceId = useStableId(undefined, 'autocomplete');\n const inputId = `${instanceId}-input`;\n const listboxId = `${instanceId}-listbox`;\n const labelId = `${instanceId}-label`;\n const errorId = `${instanceId}-error`;\n\n const handleSelectSuggestion = useCallback(\n (item: any) => {\n setSuggestionBoxVisible(false);\n onSelect?.(item);\n },\n [onSelect]\n );\n\n // Use the comprehensive useCombobox hook\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex,\n isKeyboardFocused\n } = useCombobox<any>({\n items: filteredSuggestions,\n isOpen: isSuggestionBoxVisible,\n onOpenChange: setSuggestionBoxVisible,\n onSelect: handleSelectSuggestion,\n listboxId\n });\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n setHighlightedIndex(-1); // Reset highlight on input change\n onChange(inputValue);\n\n // Internal filtering for default rendering (when no renderOption, component manages filtering)\n if (!renderOption) {\n if (inputValue === '') {\n setFilteredSuggestions([...suggestions]);\n } else {\n const filtered = suggestions?.filter(\n (suggestion) =>\n typeof suggestion === 'object' &&\n suggestion?.label?.toLowerCase().includes(inputValue?.toLowerCase() ?? '')\n );\n setFilteredSuggestions([...filtered]);\n }\n }\n },\n [onChange, suggestions, renderOption, setHighlightedIndex]\n );\n\n useEffect(() => {\n setFilteredSuggestions([...suggestions]);\n }, [suggestions]);\n\n const handleInputClick = () => {\n setSuggestionBoxVisible(true);\n };\n\n const handleInputFocus = () => {\n if (filteredSuggestions.length > 0) {\n setSuggestionBoxVisible(true);\n }\n };\n\n const handleClearInput = () => {\n onChange('');\n setHighlightedIndex(-1);\n inputRef.current?.focus();\n };\n\n // Build ARIA name attributes: when ariaLabel is provided use it (e.g. \"Signer 1 name\"); otherwise use visible label or ariaLabelledBy\n const a11yNameProps = getA11yNameAttributes({\n ariaLabelledBy,\n internalLabelId: label ? labelId : undefined,\n ariaLabel,\n ariaDescribedBy: error ? errorId : ariaDescribedBy\n });\n\n return (\n <div \n className=\"main-container-autocomplete-se-design\" \n ref={containerRef} \n data-automation-id={automationId}\n {...containerProps}\n >\n {label && (\n <span\n id={labelId}\n className={`label-container ${disabled ? 'label-container-disabled' : ''}`}\n >\n {label}\n </span>\n )}\n <div className=\"input-container-wrapper\">\n <div className=\"input-wrapper\" style={{ pointerEvents: disabled ? 'none' : 'auto' }}>\n {React.createElement(tag, {\n ref: inputRef,\n id: inputId,\n value: value,\n onChange: handleInputChange,\n onClick: handleInputClick,\n onFocus: handleInputFocus,\n ...comboboxInputProps,\n disabled,\n className: `${error ? 'input-container-error' : 'input-container-default'} ${disabled ? 'input-container-disabled' : ''} ${filteredSuggestions.length > 0 || value ? 'with-icon' : ''} ${filteredSuggestions.length > 0 && value ? 'with-icons' : ''}`,\n maxLength,\n placeholder,\n 'aria-invalid': error || undefined,\n ...a11yNameProps,\n ...props\n })}\n {value && (\n <Icon\n name=\"close\"\n className=\"input-icon-close\"\n size={15}\n onClick={handleClearInput}\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n ariaLabel=\"Clear input\"\n />\n )}\n {filteredSuggestions.length > 0 && (\n <Icon\n name=\"chevron\"\n rotation={isSuggestionBoxVisible ? '180' : '0'}\n className=\"input-icon-chevron\"\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isSuggestionBoxVisible && filteredSuggestions.length > 0 && (\n <div\n {...listboxProps}\n aria-label={label || ariaLabel || 'Suggestions'}\n className=\"suggestions-list\"\n data-automation-id=\"autocomplete-suggestions-list\"\n >\n {filteredSuggestions.map((suggestion, index) => {\n const optionProps = getOptionProps(index, false);\n const isHighlighted = highlightedIndex === index;\n return (\n <div\n key={index}\n {...optionProps}\n className={`${optionClassName || 'suggestion-item'} ${isHighlighted ? `suggestion-item-highlighted${isKeyboardFocused ? ' suggestion-item-keyboard-highlight' : ''}` : ''}`}\n onClick={() => handleSelectSuggestion(suggestion)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`autocomplete-suggestion-item-${index}`}\n >\n {renderOption\n ? renderOption(suggestion, { isHighlighted, index })\n : suggestion.label}\n </div>\n );\n })}\n </div>\n )}\n </div>\n {(error || maxLength) && (\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'} ${disabled ? 'disabled' : ''}`}>\n {error && (\n <div id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {maxLength && (\n <div className=\"max-word\">\n {value.length}/{maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n"],"names":["AutoCompleteInput","React","memo","value","onChange","disabled","maxLength","tag","error","errorMessage","label","placeholder","suggestions","onSelect","renderOption","optionClassName","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","props","filteredSuggestions","setFilteredSuggestions","useState","isSuggestionBoxVisible","setSuggestionBoxVisible","containerRef","useRef","inputRef","instanceId","useStableId","undefined","inputId","listboxId","labelId","errorId","handleSelectSuggestion","useCallback","item","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","isKeyboardFocused","useCombobox","items","isOpen","onOpenChange","handleInputChange","e","inputValue","target","filtered","filter","suggestion","toLowerCase","includes","useEffect","handleInputClick","handleInputFocus","length","handleClearInput","current","focus","a11yNameProps","getA11yNameAttributes","internalLabelId","createElement","_extends","className","ref","id","style","pointerEvents","onClick","onFocus","Icon","name","size","stroke","rotation","map","index","optionProps","isHighlighted","key","onMouseEnter","role"],"mappings":";;;;;;;;;;;;;;;;AAoDO,MAAMA,KAAsDC,gBAAAA,EAAMC,KACvE,CAAC;AAAA,EACCC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,KAAAA,IAAM;AAAA,EACNC,OAAAA,IAAQ;AAAA,EACRC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,aAAAA,IAAc,CAAA;AAAA,EACdC,UAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAgB,CAAC,GAAGX,CAAW,CAAC,GAChF,CAACY,GAAwBC,CAAuB,IAAIF,EAAkB,EAAK,GAC3EG,IAAeC,EAAuB,IAAI,GAC1CC,IAAWD,EAAyB,IAAI,G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AY;AAAA,MAAE8B,eAAAA;AAAAA,MAAeF,OAAAA;AAAAA,IAAAA,CAAO,IACjD5B,EAAW/C,KACZ;AAAA,EAET,CAAC,CACE,CAEJ,IACHF,KAASF,MACTL,gBAAAA,EAAAqE,cAAA,OAAA;AAAA,IAAKE,WAAW,GAAGhE,IAAQ,uBAAuB,oBAAoB,IAAIH,IAAW,aAAa,EAAE;AAAA,EAAA,GACjGG,KACCP,gBAAAA,EAAAqE,cAAA,OAAA;AAAA,IAAKI,IAAIvC;AAAAA,IAASqC,WAAU;AAAA,IAAgBkB,MAAK;AAAA,EAAA,GAC9CjF,CACE,GAENH,KACCL,gBAAAA,EAAAqE,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,EAAA,GACZrE,EAAM4D,QAAO,KAAEzD,CACb,CAEJ,CAEJ;AAET,CACF;"}
|
package/dist/index46.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import t, { useState as h, useRef as f, useCallback as g, useEffect as
|
|
1
|
+
import t, { useState as h, useRef as f, useCallback as g, useEffect as P } from "react";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import C from "./
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { useStableId as
|
|
6
|
-
import { getA11yNameAttributes as
|
|
3
|
+
import C from "./index233.js";
|
|
4
|
+
import { Icon as H } from "./index6.js";
|
|
5
|
+
import { useStableId as b } from "./index206.js";
|
|
6
|
+
import { getA11yNameAttributes as J } from "./index81.js";
|
|
7
7
|
import "./index72.js";
|
|
8
8
|
import { useCombobox as le } from "./index68.js";
|
|
9
9
|
function c() {
|
|
@@ -15,7 +15,7 @@ function c() {
|
|
|
15
15
|
return i;
|
|
16
16
|
}, c.apply(null, arguments);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const ye = ({
|
|
19
19
|
onCountrycodeChange: i,
|
|
20
20
|
onNumberChange: l,
|
|
21
21
|
error: r,
|
|
@@ -23,85 +23,86 @@ const ve = ({
|
|
|
23
23
|
value: d,
|
|
24
24
|
label: s,
|
|
25
25
|
automationId: p = "",
|
|
26
|
-
ariaLabel:
|
|
27
|
-
ariaLabelledBy:
|
|
26
|
+
ariaLabel: M,
|
|
27
|
+
ariaLabelledBy: T,
|
|
28
28
|
ariaDescribedBy: z,
|
|
29
|
-
phoneNumberAriaLabel:
|
|
29
|
+
phoneNumberAriaLabel: x,
|
|
30
30
|
countryCodeAriaLabel: G,
|
|
31
31
|
disabled: a = !1
|
|
32
32
|
}) => {
|
|
33
|
-
const [
|
|
34
|
-
y(!1),
|
|
33
|
+
const [v, A] = h(d?.countryCode || C[0].dial_code), [n, y] = h(!1), [w, $] = h(C), [Q, k] = h(""), [U, R] = h(""), W = f(null), F = f(null), O = f(null), m = f(!1), N = b(p, "phone-label"), B = b(p, "phone-listbox"), X = b(p, "phone-input"), K = b(p, "phone-error"), E = C.find((e) => e.dial_code === v), V = g(() => {
|
|
34
|
+
y(!1), k(""), $(C);
|
|
35
35
|
}, []), I = g((e) => {
|
|
36
|
-
e && (
|
|
37
|
-
}, [i,
|
|
36
|
+
e && (A(e), i(e)), V();
|
|
37
|
+
}, [i, V]), Y = g((e) => {
|
|
38
38
|
m.current = !0, I(e.dial_code);
|
|
39
39
|
}, [I]), {
|
|
40
|
-
containerProps:
|
|
40
|
+
containerProps: j,
|
|
41
41
|
inputProps: Z,
|
|
42
42
|
listboxProps: ee,
|
|
43
43
|
getOptionProps: te,
|
|
44
44
|
highlightedIndex: ne,
|
|
45
|
-
setHighlightedIndex:
|
|
45
|
+
setHighlightedIndex: q
|
|
46
46
|
} = le({
|
|
47
47
|
items: w,
|
|
48
48
|
isOpen: n,
|
|
49
49
|
onOpenChange: y,
|
|
50
50
|
onSelect: Y,
|
|
51
|
-
listboxId:
|
|
51
|
+
listboxId: B
|
|
52
52
|
}), oe = (e) => {
|
|
53
53
|
const o = e.target.value;
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
54
|
+
k(o), q(-1);
|
|
55
|
+
const _ = C.filter((L) => L.name.toLowerCase().includes(o.toLowerCase()) || L.dial_code.toLowerCase().includes(o.toLowerCase()) || L.code.toLowerCase().includes(o.toLowerCase()));
|
|
56
|
+
$(_);
|
|
57
57
|
}, D = f(n);
|
|
58
|
-
|
|
58
|
+
P(() => {
|
|
59
59
|
let e = null;
|
|
60
60
|
return D.current && !n && m.current && (e = requestAnimationFrame(() => {
|
|
61
|
-
|
|
61
|
+
F.current?.focus();
|
|
62
62
|
})), D.current && !n && (m.current = !1), D.current = n, () => {
|
|
63
63
|
e !== null && cancelAnimationFrame(e);
|
|
64
64
|
};
|
|
65
|
-
}, [n]),
|
|
66
|
-
d && (
|
|
67
|
-
}, [d]),
|
|
65
|
+
}, [n]), P(() => {
|
|
66
|
+
d && (A(d.countryCode), R(d.number));
|
|
67
|
+
}, [d]), P(() => {
|
|
68
68
|
let e = null;
|
|
69
69
|
return n && (e = requestAnimationFrame(() => {
|
|
70
|
-
|
|
70
|
+
O.current?.focus();
|
|
71
71
|
})), () => {
|
|
72
72
|
e !== null && cancelAnimationFrame(e);
|
|
73
73
|
};
|
|
74
74
|
}, [n]);
|
|
75
75
|
const re = (e) => {
|
|
76
76
|
const o = e.replace(/\D/g, "");
|
|
77
|
-
|
|
78
|
-
},
|
|
77
|
+
R(o), l(o);
|
|
78
|
+
}, S = g(() => {
|
|
79
79
|
a || y((e) => !e);
|
|
80
80
|
}, [a]), ae = g((e) => {
|
|
81
81
|
if (!a)
|
|
82
82
|
switch (e.key) {
|
|
83
83
|
case "Enter":
|
|
84
84
|
case " ":
|
|
85
|
-
e.preventDefault(),
|
|
85
|
+
e.preventDefault(), S();
|
|
86
86
|
break;
|
|
87
87
|
case "ArrowDown":
|
|
88
88
|
e.preventDefault(), n || y(!0);
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
|
-
}, [a, n,
|
|
92
|
-
ariaLabelledBy:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
}, [a, n, S]), ce = J({
|
|
92
|
+
ariaLabelledBy: T,
|
|
93
|
+
internalLabelId: s ? N : void 0,
|
|
94
|
+
ariaLabel: M || (s ? void 0 : "Phone number")
|
|
95
|
+
}), se = J({
|
|
96
|
+
ariaLabelledBy: !x && s ? N : void 0,
|
|
97
|
+
ariaLabel: x || (s ? void 0 : "Phone number"),
|
|
98
|
+
ariaDescribedBy: r ? K : z
|
|
99
|
+
}), ie = G || `Select country code. Current: ${E?.name} ${E?.dial_code}`;
|
|
99
100
|
return /* @__PURE__ */ t.createElement("div", c({
|
|
100
101
|
className: "phone-input-container-se-design-main-container",
|
|
101
102
|
"data-automation-id": p
|
|
102
|
-
},
|
|
103
|
+
}, j, {
|
|
103
104
|
onKeyDownCapture: (e) => {
|
|
104
|
-
e.key === "Escape" && n && (m.current = !0),
|
|
105
|
+
e.key === "Escape" && n && (m.current = !0), j.onKeyDownCapture(e);
|
|
105
106
|
}
|
|
106
107
|
}), s && /* @__PURE__ */ t.createElement("div", {
|
|
107
108
|
id: N,
|
|
@@ -114,23 +115,23 @@ const ve = ({
|
|
|
114
115
|
}), /* @__PURE__ */ t.createElement("div", {
|
|
115
116
|
className: "phone-input-container-se-design"
|
|
116
117
|
}, /* @__PURE__ */ t.createElement("button", {
|
|
117
|
-
ref:
|
|
118
|
+
ref: F,
|
|
118
119
|
type: "button",
|
|
119
120
|
className: `phone-input-container-se-design-country-code focus-outline rounded ${a ? "cursor-not-allowed opacity-60" : ""}`,
|
|
120
|
-
onClick:
|
|
121
|
+
onClick: S,
|
|
121
122
|
onKeyDown: ae,
|
|
122
123
|
"aria-haspopup": "listbox",
|
|
123
124
|
"aria-expanded": n,
|
|
124
|
-
"aria-controls": n ?
|
|
125
|
+
"aria-controls": n ? B : void 0,
|
|
125
126
|
"aria-label": ie,
|
|
126
127
|
disabled: a,
|
|
127
128
|
"data-automation-id": "country-code-selector"
|
|
128
129
|
}, /* @__PURE__ */ t.createElement("img", {
|
|
129
|
-
src: `https://flagcdn.com/${
|
|
130
|
+
src: `https://flagcdn.com/${E?.code.toLowerCase()}.svg`,
|
|
130
131
|
alt: "",
|
|
131
132
|
"aria-hidden": "true",
|
|
132
133
|
width: "16"
|
|
133
|
-
}), /* @__PURE__ */ t.createElement("span", null,
|
|
134
|
+
}), /* @__PURE__ */ t.createElement("span", null, E?.dial_code), /* @__PURE__ */ t.createElement(H, {
|
|
134
135
|
name: "chevron",
|
|
135
136
|
className: n ? "rotate-180" : "",
|
|
136
137
|
"aria-hidden": "true"
|
|
@@ -155,12 +156,12 @@ const ve = ({
|
|
|
155
156
|
"data-automation-id": "country-code-list"
|
|
156
157
|
}), /* @__PURE__ */ t.createElement("div", {
|
|
157
158
|
className: "search-input-wrapper"
|
|
158
|
-
}, /* @__PURE__ */ t.createElement(
|
|
159
|
+
}, /* @__PURE__ */ t.createElement(H, {
|
|
159
160
|
name: "search",
|
|
160
161
|
className: "search-icon",
|
|
161
162
|
"aria-hidden": "true"
|
|
162
163
|
}), /* @__PURE__ */ t.createElement("input", c({
|
|
163
|
-
ref:
|
|
164
|
+
ref: O
|
|
164
165
|
}, Z, {
|
|
165
166
|
type: "text",
|
|
166
167
|
placeholder: "Search countries",
|
|
@@ -170,15 +171,15 @@ const ve = ({
|
|
|
170
171
|
"aria-label": "Search countries",
|
|
171
172
|
"data-automation-id": "country-code-search-input"
|
|
172
173
|
}))), w.length > 0 ? w.map((e, o) => {
|
|
173
|
-
const
|
|
174
|
+
const _ = te(o, e.dial_code === v);
|
|
174
175
|
return /* @__PURE__ */ t.createElement("div", c({
|
|
175
176
|
key: e.code
|
|
176
|
-
},
|
|
177
|
-
className: `phone-input-container-se-design-country-code-list-item ${ne === o ? "highlighted" : ""} ${e.dial_code ===
|
|
177
|
+
}, _, {
|
|
178
|
+
className: `phone-input-container-se-design-country-code-list-item ${ne === o ? "highlighted" : ""} ${e.dial_code === v ? "selected" : ""}`,
|
|
178
179
|
onClick: () => {
|
|
179
180
|
m.current = !0, I(e.dial_code);
|
|
180
181
|
},
|
|
181
|
-
onMouseEnter: () =>
|
|
182
|
+
onMouseEnter: () => q(o)
|
|
182
183
|
}), /* @__PURE__ */ t.createElement("img", {
|
|
183
184
|
src: `https://flagcdn.com/${e.code.toLowerCase()}.svg`,
|
|
184
185
|
alt: "",
|
|
@@ -189,12 +190,12 @@ const ve = ({
|
|
|
189
190
|
className: "phone-input-container-se-design-country-code-list-item-no-results",
|
|
190
191
|
role: "status"
|
|
191
192
|
}, "No results found"))), r && /* @__PURE__ */ t.createElement("div", {
|
|
192
|
-
id:
|
|
193
|
+
id: K,
|
|
193
194
|
className: "error-message",
|
|
194
195
|
role: "alert"
|
|
195
196
|
}, u));
|
|
196
197
|
};
|
|
197
198
|
export {
|
|
198
|
-
|
|
199
|
+
ye as PhoneInput
|
|
199
200
|
};
|
|
200
201
|
//# sourceMappingURL=index46.js.map
|
package/dist/index46.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index46.js","sources":["../src/components/PhoneInput/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, useCallback } from 'react';\nimport './style.scss';\nimport countriesInfoJson from './countriesInfo.json';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes, useCombobox } from '../../utils/a11y';\n\nexport interface PhoneInputProps {\n onCountrycodeChange: (countryCode: string) => void;\n onNumberChange: (number: string) => void;\n error?: boolean;\n errorMessage?: string;\n value?: {\n countryCode: string;\n number: string;\n };\n label?: string;\n automationId?: string;\n /**\n * Accessible label for the entire phone input group (role=\"group\").\n * Provides context for screen readers (e.g., \"Two-step verification phone number for signer 1\").\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label the group (highest precedence over ariaLabel).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) providing additional description for the phone number input.\n */\n ariaDescribedBy?: string;\n /**\n * Override aria-label for the phone number input specifically.\n * Defaults to the visible label text or 'Phone number'.\n */\n phoneNumberAriaLabel?: string;\n /**\n * Override aria-label for the country code combobox button.\n * Defaults to \"Select country code. Current: {name} {dial_code}\".\n */\n countryCodeAriaLabel?: string;\n /**\n * Whether the input is disabled\n */\n disabled?: boolean;\n}\n\nexport const PhoneInput: React.FC<PhoneInputProps> = ({\n onCountrycodeChange,\n onNumberChange,\n error,\n errorMessage,\n value,\n label,\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n phoneNumberAriaLabel,\n countryCodeAriaLabel,\n disabled = false\n}) => {\n const [countryCode, setCountryCode] = useState(value?.countryCode || countriesInfoJson[0].dial_code);\n const [displaySelectCountryCode, setDisplaySelectCountryCode] = useState(false);\n const [countriesInfo, setCountriesInfo] = useState(countriesInfoJson);\n const [searchValue, setSearchValue] = useState('');\n const [enteredNumber, setEnteredNumber] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n const countryButtonRef = useRef<HTMLButtonElement>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const restoreFocusToButtonRef = useRef(false);\n\n // Generate stable IDs for ARIA relationships\n const labelId = useStableId(automationId, 'phone-label');\n const listboxId = useStableId(automationId, 'phone-listbox');\n const phoneInputId = useStableId(automationId, 'phone-input');\n const errorId = useStableId(automationId, 'phone-error');\n\n const countryInfo = countriesInfoJson.find((country) => country.dial_code === countryCode);\n\n // Close dropdown and reset state\n const closeDropdown = useCallback(() => {\n setDisplaySelectCountryCode(false);\n setSearchValue('');\n setCountriesInfo(countriesInfoJson);\n }, []);\n\n const handleCountryCodeSelect = useCallback(\n (country: string) => {\n if (country) {\n setCountryCode(country);\n onCountrycodeChange(country);\n }\n closeDropdown();\n // Focus return is handled by useEffect that watches displaySelectCountryCode\n },\n [onCountrycodeChange, closeDropdown]\n );\n\n const handleSelectFromDropdown = useCallback(\n (country: typeof countriesInfoJson[0]) => {\n restoreFocusToButtonRef.current = true;\n handleCountryCodeSelect(country.dial_code);\n },\n [handleCountryCodeSelect]\n );\n\n // Use comprehensive useCombobox hook for country search\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex\n } = useCombobox({\n items: countriesInfo,\n isOpen: displaySelectCountryCode,\n onOpenChange: setDisplaySelectCountryCode,\n onSelect: handleSelectFromDropdown,\n listboxId\n });\n\n const handleCountryCodeSearch = (event: React.ChangeEvent<HTMLInputElement>) => {\n const searchVal = event.target.value;\n setSearchValue(searchVal);\n setHighlightedIndex(-1);\n const filteredCountries = countriesInfoJson.filter(\n (country) =>\n country.name.toLowerCase().includes(searchVal.toLowerCase()) ||\n country.dial_code.toLowerCase().includes(searchVal.toLowerCase()) ||\n country.code.toLowerCase().includes(searchVal.toLowerCase())\n );\n setCountriesInfo(filteredCountries);\n };\n\n // Return focus to button when dropdown closes\n const prevDisplaySelectCountryCodeRef = useRef(displaySelectCountryCode);\n useEffect(() => {\n let rafId: number | null = null;\n // If dropdown was open and is now closed, return focus to button\n // ONLY when the close was triggered from within the component (Escape/selection),\n // not when the user moved focus outside (focus-out dismissal).\n if (prevDisplaySelectCountryCodeRef.current && !displaySelectCountryCode && restoreFocusToButtonRef.current) {\n rafId = requestAnimationFrame(() => {\n countryButtonRef.current?.focus();\n });\n }\n if (prevDisplaySelectCountryCodeRef.current && !displaySelectCountryCode) {\n restoreFocusToButtonRef.current = false;\n }\n prevDisplaySelectCountryCodeRef.current = displaySelectCountryCode;\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n };\n }, [displaySelectCountryCode]);\n\n useEffect(() => {\n if (value) {\n setCountryCode(value.countryCode);\n setEnteredNumber(value.number);\n }\n }, [value]);\n\n // Focus search input when dropdown opens\n useEffect(() => {\n let rafId: number | null = null;\n if (displaySelectCountryCode) {\n rafId = requestAnimationFrame(() => {\n searchInputRef.current?.focus();\n });\n }\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n };\n }, [displaySelectCountryCode]);\n\n const handleEnteredNumberChange = (val: string) => {\n const numericValue = val.replace(/\\D/g, ''); // Remove non-numeric characters\n setEnteredNumber(numericValue);\n onNumberChange(numericValue);\n };\n\n const toggleDropdown = useCallback(() => {\n if (disabled) return;\n setDisplaySelectCountryCode((prev) => !prev);\n }, [disabled]);\n\n const handleCountryButtonKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n switch (e.key) {\n case 'Enter':\n case ' ':\n e.preventDefault();\n toggleDropdown();\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (!displaySelectCountryCode) {\n setDisplaySelectCountryCode(true);\n }\n break;\n // Escape is handled by useDismissOnEscape hook\n }\n },\n [disabled, displaySelectCountryCode, toggleDropdown]\n );\n\n // Group label (role=\"group\"): ariaLabelledBy > ariaLabel > visible label > fallback\n const groupAriaLabelledBy = ariaLabelledBy || (!ariaLabel && label ? labelId : undefined);\n const groupAriaLabel = !ariaLabelledBy ? (ariaLabel || (!label ? 'Phone number' : undefined)) : undefined;\n const groupA11yProps = getA11yNameAttributes({ ariaLabelledBy: groupAriaLabelledBy, ariaLabel: groupAriaLabel });\n\n // Phone number input: caller override > visible label > fallback 'Phone number'\n const phoneInputA11yProps = getA11yNameAttributes({\n ariaLabelledBy: !phoneNumberAriaLabel && label ? labelId : undefined,\n ariaLabel: phoneNumberAriaLabel || (!label ? 'Phone number' : undefined),\n ariaDescribedBy: error ? errorId : ariaDescribedBy\n });\n\n // Country code button label: caller override > default dynamic label\n const computedCountryCodeAriaLabel = countryCodeAriaLabel ||\n `Select country code. Current: ${countryInfo?.name} ${countryInfo?.dial_code}`;\n\n return (\n <div \n className=\"phone-input-container-se-design-main-container\" \n data-automation-id={automationId}\n {...containerProps}\n onKeyDownCapture={(e) => {\n if (e.key === 'Escape' && displaySelectCountryCode) {\n restoreFocusToButtonRef.current = true;\n }\n containerProps.onKeyDownCapture(e);\n }}\n >\n {label && (\n <div id={labelId} className=\"label-container\">\n {label}\n </div>\n )}\n <div\n role=\"group\"\n {...groupA11yProps}\n className={`phone-input-container-se-design-main ${error ? 'error' : ''}`}\n ref={containerRef}\n >\n <div className=\"phone-input-container-se-design\">\n <button\n ref={countryButtonRef}\n type=\"button\"\n className={`phone-input-container-se-design-country-code focus-outline rounded ${disabled ? 'cursor-not-allowed opacity-60' : ''}`}\n onClick={toggleDropdown}\n onKeyDown={handleCountryButtonKeyDown}\n aria-haspopup=\"listbox\"\n aria-expanded={displaySelectCountryCode}\n aria-controls={displaySelectCountryCode ? listboxId : undefined}\n aria-label={computedCountryCodeAriaLabel}\n disabled={disabled}\n data-automation-id=\"country-code-selector\"\n >\n <img\n src={`https://flagcdn.com/${countryInfo?.code.toLowerCase()}.svg`}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"16\"\n />\n <span>{countryInfo?.dial_code}</span>\n <Icon\n name=\"chevron\"\n className={!displaySelectCountryCode ? '' : 'rotate-180'}\n aria-hidden=\"true\"\n />\n </button>\n <span className=\"divider\" aria-hidden=\"true\" />\n <input\n id={phoneInputId}\n type=\"tel\"\n placeholder=\"Enter phone number\"\n className={`phone-input-container-se-design-phone-number-input ${disabled ? 'disabled' : ''}`}\n onChange={(event) => handleEnteredNumberChange(event.target.value)}\n value={enteredNumber}\n pattern=\"[0-9]*\"\n disabled={disabled}\n aria-invalid={error || undefined}\n {...phoneInputA11yProps}\n data-automation-id=\"phone-number-input-field\"\n />\n </div>\n\n {displaySelectCountryCode && (\n <div\n {...listboxProps}\n className=\"phone-input-container-se-design-country-code-list\"\n aria-label=\"Select country\"\n data-automation-id=\"country-code-list\"\n >\n <div className=\"search-input-wrapper\">\n <Icon name=\"search\" className=\"search-icon\" aria-hidden=\"true\" />\n <input\n ref={searchInputRef}\n {...comboboxInputProps}\n type=\"text\"\n placeholder=\"Search countries\"\n className=\"phone-input-container-se-design-country-code-list-item-input\"\n onChange={handleCountryCodeSearch}\n value={searchValue}\n aria-label=\"Search countries\"\n data-automation-id=\"country-code-search-input\"\n />\n </div>\n {countriesInfo.length > 0 ? (\n countriesInfo.map((country, index) => {\n const optionProps = getOptionProps(index, country.dial_code === countryCode);\n return (\n <div\n key={country.code}\n {...optionProps}\n className={`phone-input-container-se-design-country-code-list-item ${\n highlightedIndex === index ? 'highlighted' : ''\n } ${country.dial_code === countryCode ? 'selected' : ''}`}\n onClick={() => {\n restoreFocusToButtonRef.current = true;\n handleCountryCodeSelect(country.dial_code);\n }}\n onMouseEnter={() => setHighlightedIndex(index)}\n >\n <img\n src={`https://flagcdn.com/${country.code.toLowerCase()}.svg`}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"16\"\n />\n <span>{country.name}</span>\n <span>({country.dial_code})</span>\n </div>\n );\n })\n ) : (\n <div className=\"phone-input-container-se-design-country-code-list-item-no-results\" role=\"status\">\n No results found\n </div>\n )}\n </div>\n )}\n </div>\n {error && (\n <div id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n </div>\n );\n};\n"],"names":["PhoneInput","onCountrycodeChange","onNumberChange","error","errorMessage","value","label","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","phoneNumberAriaLabel","countryCodeAriaLabel","disabled","countryCode","setCountryCode","useState","countriesInfoJson","dial_code","displaySelectCountryCode","setDisplaySelectCountryCode","countriesInfo","setCountriesInfo","searchValue","setSearchValue","enteredNumber","setEnteredNumber","containerRef","useRef","countryButtonRef","searchInputRef","restoreFocusToButtonRef","labelId","useStableId","listboxId","phoneInputId","errorId","countryInfo","find","country","closeDropdown","useCallback","handleCountryCodeSelect","handleSelectFromDropdown","current","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","useCombobox","items","isOpen","onOpenChange","onSelect","handleCountryCodeSearch","event","searchVal","target","filteredCountries","filter","name","toLowerCase","includes","code","prevDisplaySelectCountryCodeRef","useEffect","rafId","requestAnimationFrame","focus","cancelAnimationFrame","number","handleEnteredNumberChange","val","numericValue","replace","toggleDropdown","prev","handleCountryButtonKeyDown","e","key","preventDefault","groupA11yProps","getA11yNameAttributes","undefined","groupAriaLabel","phoneInputA11yProps","computedCountryCodeAriaLabel","React","createElement","_extends","className","onKeyDownCapture","id","role","ref","type","onClick","onKeyDown","src","alt","width","Icon","placeholder","onChange","pattern","length","map","index","optionProps","onMouseEnter"],"mappings":";;;;;;;;;;;;;;;;;AA+CO,MAAMA,KAAwCA,CAAC;AAAA,EACpDC,qBAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,sBAAAA;AAAAA,EACAC,sBAAAA;AAAAA,EACAC,UAAAA,IAAW;AACb,MAAM;AACJ,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAASX,GAAOS,eAAeG,EAAkB,CAAC,EAAEC,SAAS,GAC7F,CAACC,GAA0BC,CAA2B,IAAIJ,EAAS,EAAK,GACxE,CAACK,GAAeC,CAAgB,IAAIN,EAASC,CAAiB,GAC9D,CAACM,GAAaC,CAAc,IAAIR,EAAS,EAAE,GAC3C,CAACS,GAAeC,CAAgB,IAAIV,EAAS,EAAE,GAC/CW,IAAeC,EAAuB,IAAI,GAC1CC,IAAmBD,EAA0B,IAAI,GACjDE,IAAiBF,EAAyB,IAAI,GAC9CG,IAA0BH,EAAO,EAAK,GAGtCI,IAAUC,EAAY1B,GAAc,aAAa,GACjD2B,IAAYD,EAAY1B,GAAc,eAAe,GACrD4B,IAAeF,EAAY1B,GAAc,aAAa,GACtD6B,IAAUH,EAAY1B,GAAc,aAAa,GAEjD8B,IAAcpB,EAAkBqB,KAAMC,CAAAA,MAAYA,EAAQrB,cAAcJ,CAAW,GAGnF0B,IAAgBC,EAAY,MAAM;AACtCrB,IAAAA,EAA4B,EAAK,GACjCI,EAAe,EAAE,GACjBF,EAAiBL,CAAiB;AAAA,EACpC,GAAG,CAAA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AAAA,IAAgBG,MAAK;AAAA,EAAA,GAC9C5F,CACE,CAEJ;AAET;"}
|
|
1
|
+
{"version":3,"file":"index46.js","sources":["../src/components/PhoneInput/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState, useCallback } from 'react';\nimport './style.scss';\nimport countriesInfoJson from './countriesInfo.json';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes, useCombobox } from '../../utils/a11y';\n\nexport interface PhoneInputProps {\n onCountrycodeChange: (countryCode: string) => void;\n onNumberChange: (number: string) => void;\n error?: boolean;\n errorMessage?: string;\n value?: {\n countryCode: string;\n number: string;\n };\n label?: string;\n automationId?: string;\n /**\n * Accessible label for the entire phone input group (role=\"group\").\n * Provides context for screen readers (e.g., \"Two-step verification phone number for signer 1\").\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label the group (highest precedence over ariaLabel).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) providing additional description for the phone number input.\n */\n ariaDescribedBy?: string;\n /**\n * Override aria-label for the phone number input specifically.\n * Defaults to the visible label text or 'Phone number'.\n */\n phoneNumberAriaLabel?: string;\n /**\n * Override aria-label for the country code combobox button.\n * Defaults to \"Select country code. Current: {name} {dial_code}\".\n */\n countryCodeAriaLabel?: string;\n /**\n * Whether the input is disabled\n */\n disabled?: boolean;\n}\n\nexport const PhoneInput: React.FC<PhoneInputProps> = ({\n onCountrycodeChange,\n onNumberChange,\n error,\n errorMessage,\n value,\n label,\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n phoneNumberAriaLabel,\n countryCodeAriaLabel,\n disabled = false\n}) => {\n const [countryCode, setCountryCode] = useState(value?.countryCode || countriesInfoJson[0].dial_code);\n const [displaySelectCountryCode, setDisplaySelectCountryCode] = useState(false);\n const [countriesInfo, setCountriesInfo] = useState(countriesInfoJson);\n const [searchValue, setSearchValue] = useState('');\n const [enteredNumber, setEnteredNumber] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n const countryButtonRef = useRef<HTMLButtonElement>(null);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const restoreFocusToButtonRef = useRef(false);\n\n // Generate stable IDs for ARIA relationships\n const labelId = useStableId(automationId, 'phone-label');\n const listboxId = useStableId(automationId, 'phone-listbox');\n const phoneInputId = useStableId(automationId, 'phone-input');\n const errorId = useStableId(automationId, 'phone-error');\n\n const countryInfo = countriesInfoJson.find((country) => country.dial_code === countryCode);\n\n // Close dropdown and reset state\n const closeDropdown = useCallback(() => {\n setDisplaySelectCountryCode(false);\n setSearchValue('');\n setCountriesInfo(countriesInfoJson);\n }, []);\n\n const handleCountryCodeSelect = useCallback(\n (country: string) => {\n if (country) {\n setCountryCode(country);\n onCountrycodeChange(country);\n }\n closeDropdown();\n // Focus return is handled by useEffect that watches displaySelectCountryCode\n },\n [onCountrycodeChange, closeDropdown]\n );\n\n const handleSelectFromDropdown = useCallback(\n (country: typeof countriesInfoJson[0]) => {\n restoreFocusToButtonRef.current = true;\n handleCountryCodeSelect(country.dial_code);\n },\n [handleCountryCodeSelect]\n );\n\n // Use comprehensive useCombobox hook for country search\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex\n } = useCombobox({\n items: countriesInfo,\n isOpen: displaySelectCountryCode,\n onOpenChange: setDisplaySelectCountryCode,\n onSelect: handleSelectFromDropdown,\n listboxId\n });\n\n const handleCountryCodeSearch = (event: React.ChangeEvent<HTMLInputElement>) => {\n const searchVal = event.target.value;\n setSearchValue(searchVal);\n setHighlightedIndex(-1);\n const filteredCountries = countriesInfoJson.filter(\n (country) =>\n country.name.toLowerCase().includes(searchVal.toLowerCase()) ||\n country.dial_code.toLowerCase().includes(searchVal.toLowerCase()) ||\n country.code.toLowerCase().includes(searchVal.toLowerCase())\n );\n setCountriesInfo(filteredCountries);\n };\n\n // Return focus to button when dropdown closes\n const prevDisplaySelectCountryCodeRef = useRef(displaySelectCountryCode);\n useEffect(() => {\n let rafId: number | null = null;\n // If dropdown was open and is now closed, return focus to button\n // ONLY when the close was triggered from within the component (Escape/selection),\n // not when the user moved focus outside (focus-out dismissal).\n if (prevDisplaySelectCountryCodeRef.current && !displaySelectCountryCode && restoreFocusToButtonRef.current) {\n rafId = requestAnimationFrame(() => {\n countryButtonRef.current?.focus();\n });\n }\n if (prevDisplaySelectCountryCodeRef.current && !displaySelectCountryCode) {\n restoreFocusToButtonRef.current = false;\n }\n prevDisplaySelectCountryCodeRef.current = displaySelectCountryCode;\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n };\n }, [displaySelectCountryCode]);\n\n useEffect(() => {\n if (value) {\n setCountryCode(value.countryCode);\n setEnteredNumber(value.number);\n }\n }, [value]);\n\n // Focus search input when dropdown opens\n useEffect(() => {\n let rafId: number | null = null;\n if (displaySelectCountryCode) {\n rafId = requestAnimationFrame(() => {\n searchInputRef.current?.focus();\n });\n }\n return () => {\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n }\n };\n }, [displaySelectCountryCode]);\n\n const handleEnteredNumberChange = (val: string) => {\n const numericValue = val.replace(/\\D/g, ''); // Remove non-numeric characters\n setEnteredNumber(numericValue);\n onNumberChange(numericValue);\n };\n\n const toggleDropdown = useCallback(() => {\n if (disabled) return;\n setDisplaySelectCountryCode((prev) => !prev);\n }, [disabled]);\n\n const handleCountryButtonKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n switch (e.key) {\n case 'Enter':\n case ' ':\n e.preventDefault();\n toggleDropdown();\n break;\n case 'ArrowDown':\n e.preventDefault();\n if (!displaySelectCountryCode) {\n setDisplaySelectCountryCode(true);\n }\n break;\n // Escape is handled by useDismissOnEscape hook\n }\n },\n [disabled, displaySelectCountryCode, toggleDropdown]\n );\n\n // Group label (role=\"group\"): combines the visible label with any external ariaLabelledBy\n // (handled inside getA11yNameAttributes); ariaLabel overrides the visible label; falls back to 'Phone number'.\n const groupA11yProps = getA11yNameAttributes({\n ariaLabelledBy,\n internalLabelId: label ? labelId : undefined,\n ariaLabel: ariaLabel || (!label ? 'Phone number' : undefined)\n });\n\n // Phone number input: caller override > visible label > fallback 'Phone number'\n const phoneInputA11yProps = getA11yNameAttributes({\n ariaLabelledBy: !phoneNumberAriaLabel && label ? labelId : undefined,\n ariaLabel: phoneNumberAriaLabel || (!label ? 'Phone number' : undefined),\n ariaDescribedBy: error ? errorId : ariaDescribedBy\n });\n\n // Country code button label: caller override > default dynamic label\n const computedCountryCodeAriaLabel = countryCodeAriaLabel ||\n `Select country code. Current: ${countryInfo?.name} ${countryInfo?.dial_code}`;\n\n return (\n <div \n className=\"phone-input-container-se-design-main-container\" \n data-automation-id={automationId}\n {...containerProps}\n onKeyDownCapture={(e) => {\n if (e.key === 'Escape' && displaySelectCountryCode) {\n restoreFocusToButtonRef.current = true;\n }\n containerProps.onKeyDownCapture(e);\n }}\n >\n {label && (\n <div id={labelId} className=\"label-container\">\n {label}\n </div>\n )}\n <div\n role=\"group\"\n {...groupA11yProps}\n className={`phone-input-container-se-design-main ${error ? 'error' : ''}`}\n ref={containerRef}\n >\n <div className=\"phone-input-container-se-design\">\n <button\n ref={countryButtonRef}\n type=\"button\"\n className={`phone-input-container-se-design-country-code focus-outline rounded ${disabled ? 'cursor-not-allowed opacity-60' : ''}`}\n onClick={toggleDropdown}\n onKeyDown={handleCountryButtonKeyDown}\n aria-haspopup=\"listbox\"\n aria-expanded={displaySelectCountryCode}\n aria-controls={displaySelectCountryCode ? listboxId : undefined}\n aria-label={computedCountryCodeAriaLabel}\n disabled={disabled}\n data-automation-id=\"country-code-selector\"\n >\n <img\n src={`https://flagcdn.com/${countryInfo?.code.toLowerCase()}.svg`}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"16\"\n />\n <span>{countryInfo?.dial_code}</span>\n <Icon\n name=\"chevron\"\n className={!displaySelectCountryCode ? '' : 'rotate-180'}\n aria-hidden=\"true\"\n />\n </button>\n <span className=\"divider\" aria-hidden=\"true\" />\n <input\n id={phoneInputId}\n type=\"tel\"\n placeholder=\"Enter phone number\"\n className={`phone-input-container-se-design-phone-number-input ${disabled ? 'disabled' : ''}`}\n onChange={(event) => handleEnteredNumberChange(event.target.value)}\n value={enteredNumber}\n pattern=\"[0-9]*\"\n disabled={disabled}\n aria-invalid={error || undefined}\n {...phoneInputA11yProps}\n data-automation-id=\"phone-number-input-field\"\n />\n </div>\n\n {displaySelectCountryCode && (\n <div\n {...listboxProps}\n className=\"phone-input-container-se-design-country-code-list\"\n aria-label=\"Select country\"\n data-automation-id=\"country-code-list\"\n >\n <div className=\"search-input-wrapper\">\n <Icon name=\"search\" className=\"search-icon\" aria-hidden=\"true\" />\n <input\n ref={searchInputRef}\n {...comboboxInputProps}\n type=\"text\"\n placeholder=\"Search countries\"\n className=\"phone-input-container-se-design-country-code-list-item-input\"\n onChange={handleCountryCodeSearch}\n value={searchValue}\n aria-label=\"Search countries\"\n data-automation-id=\"country-code-search-input\"\n />\n </div>\n {countriesInfo.length > 0 ? (\n countriesInfo.map((country, index) => {\n const optionProps = getOptionProps(index, country.dial_code === countryCode);\n return (\n <div\n key={country.code}\n {...optionProps}\n className={`phone-input-container-se-design-country-code-list-item ${\n highlightedIndex === index ? 'highlighted' : ''\n } ${country.dial_code === countryCode ? 'selected' : ''}`}\n onClick={() => {\n restoreFocusToButtonRef.current = true;\n handleCountryCodeSelect(country.dial_code);\n }}\n onMouseEnter={() => setHighlightedIndex(index)}\n >\n <img\n src={`https://flagcdn.com/${country.code.toLowerCase()}.svg`}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"16\"\n />\n <span>{country.name}</span>\n <span>({country.dial_code})</span>\n </div>\n );\n })\n ) : (\n <div className=\"phone-input-container-se-design-country-code-list-item-no-results\" role=\"status\">\n No results found\n </div>\n )}\n </div>\n )}\n </div>\n {error && (\n <div id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n </div>\n );\n};\n"],"names":["PhoneInput","onCountrycodeChange","onNumberChange","error","errorMessage","value","label","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","phoneNumberAriaLabel","countryCodeAriaLabel","disabled","countryCode","setCountryCode","useState","countriesInfoJson","dial_code","displaySelectCountryCode","setDisplaySelectCountryCode","countriesInfo","setCountriesInfo","searchValue","setSearchValue","enteredNumber","setEnteredNumber","containerRef","useRef","countryButtonRef","searchInputRef","restoreFocusToButtonRef","labelId","useStableId","listboxId","phoneInputId","errorId","countryInfo","find","country","closeDropdown","useCallback","handleCountryCodeSelect","handleSelectFromDropdown","current","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","useCombobox","items","isOpen","onOpenChange","onSelect","handleCountryCodeSearch","event","searchVal","target","filteredCountries","filter","name","toLowerCase","includes","code","prevDisplaySelectCountryCodeRef","useEffect","rafId","requestAnimationFrame","focus","cancelAnimationFrame","number","handleEnteredNumberChange","val","numericValue","replace","toggleDropdown","prev","handleCountryButtonKeyDown","e","key","preventDefault","groupA11yProps","getA11yNameAttributes","internalLabelId","undefined","phoneInputA11yProps","computedCountryCodeAriaLabel","React","createElement","_extends","className","onKeyDownCapture","id","role","ref","type","onClick","onKeyDown","src","alt","width","Icon","placeholder","onChange","pattern","length","map","index","optionProps","onMouseEnter"],"mappings":";;;;;;;;;;;;;;;;;AA+CO,MAAMA,KAAwCA,CAAC;AAAA,EACpDC,qBAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,sBAAAA;AAAAA,EACAC,sBAAAA;AAAAA,EACAC,UAAAA,IAAW;AACb,MAAM;AACJ,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAASX,GAAOS,eAAeG,EAAkB,CAA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AAAA,EAAwBa,UAAU,IAClCF,EAAwBH,EAAQrB,SAAS;AAAA,MAC3C;AAAA,MACA8F,cAAcA,MAAM7D,EAAoB2D,CAAK;AAAA,IAAA,CAAE,GAE/CpB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,MACEU,KAAK,uBAAuB9D,EAAQ2B,KAAKF,aAAa;AAAA,MACtDsC,KAAI;AAAA,MACJ,eAAY;AAAA,MACZC,OAAM;AAAA,IAAA,CACP,GACDb,gBAAAA,EAAAC,cAAA,QAAA,MAAOpD,EAAQwB,IAAW,GAC1B2B,gBAAAA,EAAAC,cAAA,QAAA,MAAM,KAAEpD,EAAQrB,WAAU,GAAO,CAC9B;AAAA,EAET,CAAC,IAEDwE,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,IAAoEG,MAAK;AAAA,EAAA,GAAS,kBAE5F,CAEJ,CAEJ,GACJ7F,KACCuF,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKI,IAAI3D;AAAAA,IAASyD,WAAU;AAAA,IAAgBG,MAAK;AAAA,EAAA,GAC9C5F,CACE,CAEJ;AAET;"}
|
package/dist/index49.js
CHANGED
|
@@ -31,7 +31,7 @@ import { Popover as $ } from "./index19.js";
|
|
|
31
31
|
/* empty css */
|
|
32
32
|
/* empty css */
|
|
33
33
|
/* empty css */
|
|
34
|
-
import { TabButton as j } from "./
|
|
34
|
+
import { TabButton as j } from "./index236.js";
|
|
35
35
|
/* empty css */
|
|
36
36
|
/* empty css */
|
|
37
37
|
/* empty css */
|
package/dist/index51.js
CHANGED
|
@@ -2,7 +2,7 @@ import r, { useState as S } from "react";
|
|
|
2
2
|
import { Button as z } from "./index4.js";
|
|
3
3
|
import { Icon as _ } from "./index6.js";
|
|
4
4
|
import { Dropdown as te } from "./index25.js";
|
|
5
|
-
import { useDatePickerA11y as Fe, formatDateId as Pe, getCellAriaLabel as Ce } from "./
|
|
5
|
+
import { useDatePickerA11y as Fe, formatDateId as Pe, getCellAriaLabel as Ce } from "./index245.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
function T() {
|
|
8
8
|
return T = Object.assign ? Object.assign.bind() : function(p) {
|
package/dist/index52.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import { Icon as W } from "./index6.js";
|
|
3
|
-
import { useStableId as j } from "./
|
|
3
|
+
import { useStableId as j } from "./index206.js";
|
|
4
4
|
import { getA11yNameAttributes as q } from "./index81.js";
|
|
5
5
|
import "./index72.js";
|
|
6
6
|
/* empty css */
|
package/dist/index53.js
CHANGED
package/dist/index57.js
CHANGED