se-design 1.0.87-dev.1 → 1.0.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/dist/components/InputWithTags/index.d.ts +2 -3
  2. package/dist/index112.js +1 -1
  3. package/dist/index112.js.map +1 -1
  4. package/dist/index113.js +2 -2
  5. package/dist/index113.js.map +1 -1
  6. package/dist/index114.js +1 -1
  7. package/dist/index114.js.map +1 -1
  8. package/dist/index115.js +2 -2
  9. package/dist/index115.js.map +1 -1
  10. package/dist/index116.js +1 -1
  11. package/dist/index116.js.map +1 -1
  12. package/dist/index117.js +1 -1
  13. package/dist/index117.js.map +1 -1
  14. package/dist/index118.js +2 -2
  15. package/dist/index118.js.map +1 -1
  16. package/dist/index119.js +1 -1
  17. package/dist/index119.js.map +1 -1
  18. package/dist/index120.js +2 -2
  19. package/dist/index120.js.map +1 -1
  20. package/dist/index121.js +1 -1
  21. package/dist/index121.js.map +1 -1
  22. package/dist/index122.js +1 -1
  23. package/dist/index122.js.map +1 -1
  24. package/dist/index123.js +1 -1
  25. package/dist/index123.js.map +1 -1
  26. package/dist/index124.js +1 -1
  27. package/dist/index124.js.map +1 -1
  28. package/dist/index125.js +2 -2
  29. package/dist/index125.js.map +1 -1
  30. package/dist/index126.js +1 -1
  31. package/dist/index126.js.map +1 -1
  32. package/dist/index127.js +2 -2
  33. package/dist/index127.js.map +1 -1
  34. package/dist/index128.js +2 -2
  35. package/dist/index128.js.map +1 -1
  36. package/dist/index129.js +1 -1
  37. package/dist/index129.js.map +1 -1
  38. package/dist/index130.js +2 -2
  39. package/dist/index130.js.map +1 -1
  40. package/dist/index131.js +2 -2
  41. package/dist/index131.js.map +1 -1
  42. package/dist/index132.js +1 -1
  43. package/dist/index132.js.map +1 -1
  44. package/dist/index133.js +1 -1
  45. package/dist/index133.js.map +1 -1
  46. package/dist/index134.js +1 -1
  47. package/dist/index134.js.map +1 -1
  48. package/dist/index135.js +2 -2
  49. package/dist/index135.js.map +1 -1
  50. package/dist/index136.js +2 -2
  51. package/dist/index136.js.map +1 -1
  52. package/dist/index137.js +2 -2
  53. package/dist/index137.js.map +1 -1
  54. package/dist/index138.js +1 -1
  55. package/dist/index138.js.map +1 -1
  56. package/dist/index139.js +1 -1
  57. package/dist/index139.js.map +1 -1
  58. package/dist/index140.js +1 -1
  59. package/dist/index140.js.map +1 -1
  60. package/dist/index141.js +1 -1
  61. package/dist/index141.js.map +1 -1
  62. package/dist/index142.js +1 -1
  63. package/dist/index142.js.map +1 -1
  64. package/dist/index143.js +1 -1
  65. package/dist/index143.js.map +1 -1
  66. package/dist/index144.js +1 -1
  67. package/dist/index144.js.map +1 -1
  68. package/dist/index145.js +1 -1
  69. package/dist/index145.js.map +1 -1
  70. package/dist/index146.js +2 -2
  71. package/dist/index146.js.map +1 -1
  72. package/dist/index147.js +2 -2
  73. package/dist/index147.js.map +1 -1
  74. package/dist/index148.js +1 -1
  75. package/dist/index148.js.map +1 -1
  76. package/dist/index149.js +1 -1
  77. package/dist/index149.js.map +1 -1
  78. package/dist/index150.js +1 -1
  79. package/dist/index150.js.map +1 -1
  80. package/dist/index151.js +1 -1
  81. package/dist/index151.js.map +1 -1
  82. package/dist/index152.js +1 -1
  83. package/dist/index152.js.map +1 -1
  84. package/dist/index153.js +1 -1
  85. package/dist/index153.js.map +1 -1
  86. package/dist/index154.js +1 -1
  87. package/dist/index154.js.map +1 -1
  88. package/dist/index155.js +2 -2
  89. package/dist/index155.js.map +1 -1
  90. package/dist/index156.js +1 -1
  91. package/dist/index156.js.map +1 -1
  92. package/dist/index157.js +2 -2
  93. package/dist/index157.js.map +1 -1
  94. package/dist/index158.js +2 -2
  95. package/dist/index158.js.map +1 -1
  96. package/dist/index159.js +2 -2
  97. package/dist/index159.js.map +1 -1
  98. package/dist/index16.js +1 -1
  99. package/dist/index160.js +2 -2
  100. package/dist/index160.js.map +1 -1
  101. package/dist/index161.js +1 -1
  102. package/dist/index161.js.map +1 -1
  103. package/dist/index162.js +1 -1
  104. package/dist/index162.js.map +1 -1
  105. package/dist/index163.js +1 -1
  106. package/dist/index163.js.map +1 -1
  107. package/dist/index164.js +1 -1
  108. package/dist/index164.js.map +1 -1
  109. package/dist/index165.js +1 -1
  110. package/dist/index165.js.map +1 -1
  111. package/dist/index166.js +1 -1
  112. package/dist/index166.js.map +1 -1
  113. package/dist/index167.js +1 -1
  114. package/dist/index167.js.map +1 -1
  115. package/dist/index168.js +1 -1
  116. package/dist/index168.js.map +1 -1
  117. package/dist/index169.js +1 -1
  118. package/dist/index169.js.map +1 -1
  119. package/dist/index170.js +1 -1
  120. package/dist/index170.js.map +1 -1
  121. package/dist/index171.js +1 -1
  122. package/dist/index171.js.map +1 -1
  123. package/dist/index172.js +1 -1
  124. package/dist/index172.js.map +1 -1
  125. package/dist/index173.js +1 -1
  126. package/dist/index173.js.map +1 -1
  127. package/dist/index174.js +1 -1
  128. package/dist/index174.js.map +1 -1
  129. package/dist/index175.js +1 -1
  130. package/dist/index175.js.map +1 -1
  131. package/dist/index176.js +1 -1
  132. package/dist/index176.js.map +1 -1
  133. package/dist/index177.js +1 -1
  134. package/dist/index177.js.map +1 -1
  135. package/dist/index178.js +1 -1
  136. package/dist/index178.js.map +1 -1
  137. package/dist/index179.js +1 -1
  138. package/dist/index179.js.map +1 -1
  139. package/dist/index180.js +1 -1
  140. package/dist/index180.js.map +1 -1
  141. package/dist/index181.js +1 -1
  142. package/dist/index181.js.map +1 -1
  143. package/dist/index182.js +1 -1
  144. package/dist/index182.js.map +1 -1
  145. package/dist/index183.js +1 -1
  146. package/dist/index183.js.map +1 -1
  147. package/dist/index184.js +1 -1
  148. package/dist/index184.js.map +1 -1
  149. package/dist/index185.js +2 -2
  150. package/dist/index185.js.map +1 -1
  151. package/dist/index186.js +2 -2
  152. package/dist/index186.js.map +1 -1
  153. package/dist/index187.js +1 -1
  154. package/dist/index187.js.map +1 -1
  155. package/dist/index188.js +1 -1
  156. package/dist/index188.js.map +1 -1
  157. package/dist/index189.js +2 -2
  158. package/dist/index189.js.map +1 -1
  159. package/dist/index190.js +2 -2
  160. package/dist/index190.js.map +1 -1
  161. package/dist/index191.js +1 -1
  162. package/dist/index191.js.map +1 -1
  163. package/dist/index192.js +1 -1
  164. package/dist/index192.js.map +1 -1
  165. package/dist/index193.js +1 -1
  166. package/dist/index193.js.map +1 -1
  167. package/dist/index194.js +1 -1
  168. package/dist/index194.js.map +1 -1
  169. package/dist/index195.js +1 -1
  170. package/dist/index195.js.map +1 -1
  171. package/dist/index196.js +1 -1
  172. package/dist/index196.js.map +1 -1
  173. package/dist/index197.js +1 -1
  174. package/dist/index197.js.map +1 -1
  175. package/dist/index198.js +1 -1
  176. package/dist/index198.js.map +1 -1
  177. package/dist/index199.js +1 -1
  178. package/dist/index199.js.map +1 -1
  179. package/dist/index200.js +2 -2
  180. package/dist/index200.js.map +1 -1
  181. package/dist/index201.js +2 -2
  182. package/dist/index201.js.map +1 -1
  183. package/dist/index202.js +2 -2
  184. package/dist/index202.js.map +1 -1
  185. package/dist/index203.js +149 -2
  186. package/dist/index203.js.map +1 -1
  187. package/dist/index204.js +9 -149
  188. package/dist/index204.js.map +1 -1
  189. package/dist/index205.js +5 -8
  190. package/dist/index205.js.map +1 -1
  191. package/dist/index206.js +4 -5
  192. package/dist/index206.js.map +1 -1
  193. package/dist/index207.js +1 -1
  194. package/dist/{index225.js → index224.js} +1 -1
  195. package/dist/{index225.js.map → index224.js.map} +1 -1
  196. package/dist/index23.js +16 -16
  197. package/dist/index23.js.map +1 -1
  198. package/dist/{index233.js → index232.js} +1 -1
  199. package/dist/{index233.js.map → index232.js.map} +1 -1
  200. package/dist/{index236.js → index235.js} +1 -1
  201. package/dist/{index236.js.map → index235.js.map} +1 -1
  202. package/dist/index244.js +173 -0
  203. package/dist/index244.js.map +1 -0
  204. package/dist/index245.js +3 -169
  205. package/dist/index245.js.map +1 -1
  206. package/dist/index247.js +22 -0
  207. package/dist/index247.js.map +1 -0
  208. package/dist/index248.js +9 -18
  209. package/dist/index248.js.map +1 -1
  210. package/dist/index249.js +9 -9
  211. package/dist/index249.js.map +1 -1
  212. package/dist/index25.js +1 -2
  213. package/dist/index25.js.map +1 -1
  214. package/dist/index250.js +4 -9
  215. package/dist/index250.js.map +1 -1
  216. package/dist/index251.js +170 -5
  217. package/dist/index251.js.map +1 -1
  218. package/dist/index252.js +11 -170
  219. package/dist/index252.js.map +1 -1
  220. package/dist/index253.js +6 -11
  221. package/dist/index253.js.map +1 -1
  222. package/dist/index254.js +5 -5
  223. package/dist/index254.js.map +1 -1
  224. package/dist/index255.js +37 -5
  225. package/dist/index255.js.map +1 -1
  226. package/dist/index256.js +2 -38
  227. package/dist/index256.js.map +1 -1
  228. package/dist/index257.js +8 -2
  229. package/dist/index257.js.map +1 -1
  230. package/dist/index258.js +326 -7
  231. package/dist/index258.js.map +1 -1
  232. package/dist/index259.js +47 -324
  233. package/dist/index259.js.map +1 -1
  234. package/dist/index260.js +2 -50
  235. package/dist/index260.js.map +1 -1
  236. package/dist/index261.js +76 -2
  237. package/dist/index261.js.map +1 -1
  238. package/dist/index262.js +82 -65
  239. package/dist/index262.js.map +1 -1
  240. package/dist/index263.js +48 -89
  241. package/dist/index263.js.map +1 -1
  242. package/dist/index264.js +7 -51
  243. package/dist/index264.js.map +1 -1
  244. package/dist/index265.js +4 -7
  245. package/dist/index265.js.map +1 -1
  246. package/dist/index266.js +51 -4
  247. package/dist/index266.js.map +1 -1
  248. package/dist/index267.js +2 -52
  249. package/dist/index267.js.map +1 -1
  250. package/dist/index268.js +2 -2
  251. package/dist/index29.js +1 -1
  252. package/dist/index30.js +1 -1
  253. package/dist/index33.js +1 -1
  254. package/dist/index35.js +1 -1
  255. package/dist/index36.js +1 -1
  256. package/dist/index37.js +40 -54
  257. package/dist/index37.js.map +1 -1
  258. package/dist/index38.js +112 -113
  259. package/dist/index38.js.map +1 -1
  260. package/dist/index39.js +51 -55
  261. package/dist/index39.js.map +1 -1
  262. package/dist/index40.js +1 -1
  263. package/dist/index45.js +38 -39
  264. package/dist/index45.js.map +1 -1
  265. package/dist/index46.js +51 -52
  266. package/dist/index46.js.map +1 -1
  267. package/dist/index49.js +1 -1
  268. package/dist/index51.js +1 -1
  269. package/dist/index52.js +1 -1
  270. package/dist/index53.js +1 -1
  271. package/dist/index57.js +1 -1
  272. package/dist/index6.js +102 -104
  273. package/dist/index6.js.map +1 -1
  274. package/dist/index61.js +1 -1
  275. package/dist/index63.js +1 -1
  276. package/dist/index65.js +1 -1
  277. package/dist/index7.js +1 -1
  278. package/dist/index79.js +1 -1
  279. package/dist/index81.js +7 -9
  280. package/dist/index81.js.map +1 -1
  281. package/dist/index9.js +20 -20
  282. package/dist/index9.js.map +1 -1
  283. package/package.json +1 -1
  284. package/dist/assets/icons/cloud-check.svg +0 -4
  285. package/dist/index223.js +0 -8
  286. package/dist/index223.js.map +0 -1
  287. package/dist/index246.js +0 -7
  288. package/dist/index246.js.map +0 -1
  289. package/dist/index269.js +0 -5
  290. package/dist/index269.js.map +0 -1
package/dist/index39.js CHANGED
@@ -1,80 +1,76 @@
1
1
  import e from "react";
2
- import { useStableId as P } from "./index206.js";
3
- import { mergeIds as _ } from "./index223.js";
4
- import { getA11yNameAttributes as k } from "./index81.js";
2
+ import { useStableId as A } from "./index205.js";
3
+ import { mergeIds as P } from "./index206.js";
4
+ import { getA11yNameAttributes as _ } from "./index81.js";
5
5
  import "./index72.js";
6
6
  /* empty css */
7
- function H({
8
- value: r,
9
- onChange: p,
10
- onBlur: v,
11
- onFocus: b,
12
- disabled: i,
13
- maxLength: n,
14
- tag: E,
7
+ function G({
8
+ value: l,
9
+ onChange: m,
10
+ onBlur: u,
11
+ onFocus: p,
12
+ disabled: n,
13
+ maxLength: a,
14
+ tag: v,
15
15
  error: t,
16
- errorMessage: o,
17
- label: c,
18
- placeholder: I,
16
+ errorMessage: i,
17
+ label: r,
18
+ placeholder: E,
19
19
  style: N,
20
- inputStyle: $,
20
+ inputStyle: b,
21
21
  automationId: f = "",
22
- id: h,
23
- ariaLabel: y,
24
- ariaLabelledBy: d,
25
- ariaDescribedBy: F,
26
- ...w
22
+ id: $,
23
+ ariaLabel: h,
24
+ ariaLabelledBy: I,
25
+ ariaDescribedBy: y,
26
+ ...F
27
27
  }) {
28
- const C = E || "input", a = P(h, "se-input"), s = c ? `${a}-label` : void 0, m = `${a}-error`, u = `${a}-count`, g = _(t && o ? m : void 0, n ? u : void 0, F), x = k({
29
- ariaLabel: y,
30
- ariaLabelledBy: d,
31
- // Native <label htmlFor> provides the name on its own; only fold the label id into
32
- // aria-labelledby when an external suffix is supplied, so the common case stays native-only.
33
- internalLabelId: d ? s : void 0,
34
- ariaDescribedBy: g
35
- }), A = {
36
- ...w,
37
- id: a,
38
- value: r,
39
- onChange: (l) => {
40
- const B = l.target.value;
41
- p(B);
28
+ const w = v || "input", o = A($, "se-input"), s = `${o}-error`, d = `${o}-count`, B = P(t && i ? s : void 0, a ? d : void 0, y), C = _({
29
+ ariaLabel: h,
30
+ ariaLabelledBy: I,
31
+ ariaDescribedBy: B
32
+ }), g = {
33
+ ...F,
34
+ id: o,
35
+ value: l,
36
+ onChange: (c) => {
37
+ const x = c.target.value;
38
+ m(x);
42
39
  },
43
- onBlur: v,
44
- onFocus: (l) => {
45
- b?.(l);
40
+ onBlur: u,
41
+ onFocus: (c) => {
42
+ p?.(c);
46
43
  },
47
- disabled: i,
48
- className: `${t ? "input-container-error" : "input-container-default"} ${i ? "input-container-disabled" : ""}`,
49
- maxLength: n ?? void 0,
50
- placeholder: I,
51
- style: $,
44
+ disabled: n,
45
+ className: `${t ? "input-container-error" : "input-container-default"} ${n ? "input-container-disabled" : ""}`,
46
+ maxLength: a ?? void 0,
47
+ placeholder: E,
48
+ style: b,
52
49
  "aria-invalid": t ? "true" : void 0,
53
- ...x
50
+ ...C
54
51
  };
55
52
  return /* @__PURE__ */ e.createElement("div", {
56
53
  className: "input-main-container",
57
54
  style: N,
58
55
  "data-automation-id": f
59
- }, c && /* @__PURE__ */ e.createElement("label", {
56
+ }, r && /* @__PURE__ */ e.createElement("label", {
57
+ className: `label-container ${n ? "label-container-disabled" : ""}`,
58
+ htmlFor: o
59
+ }, r), /* @__PURE__ */ e.createElement(w, g), (t || a) && /* @__PURE__ */ e.createElement("div", {
60
+ className: `${t ? "error-and-max-word" : "max-word-container"} ${n ? "disabled" : ""}`
61
+ }, t && i && /* @__PURE__ */ e.createElement("div", {
62
+ key: i,
60
63
  id: s,
61
- className: `label-container ${i ? "label-container-disabled" : ""}`,
62
- htmlFor: a
63
- }, c), /* @__PURE__ */ e.createElement(C, A), (t || n) && /* @__PURE__ */ e.createElement("div", {
64
- className: `${t ? "error-and-max-word" : "max-word-container"} ${i ? "disabled" : ""}`
65
- }, t && o && /* @__PURE__ */ e.createElement("div", {
66
- key: o,
67
- id: m,
68
64
  className: "error-message",
69
65
  role: "alert"
70
- }, o), n && /* @__PURE__ */ e.createElement("div", {
71
- id: u,
66
+ }, i), a && /* @__PURE__ */ e.createElement("div", {
67
+ id: d,
72
68
  className: "max-word",
73
69
  "aria-live": "polite",
74
70
  "aria-atomic": "true"
75
- }, /* @__PURE__ */ e.createElement("span", null, r?.length + "/" + n))));
71
+ }, /* @__PURE__ */ e.createElement("span", null, l?.length + "/" + a))));
76
72
  }
77
73
  export {
78
- H as Input
74
+ G as Input
79
75
  };
80
76
  //# sourceMappingURL=index39.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index39.js","sources":["../src/components/Input/index.tsx"],"sourcesContent":["import React from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport { mergeIds } from '../../utils/mergeIds';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport './style.scss';\n\ntype InputTag = 'input' | 'textarea';\n\ntype NativeInputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n | 'value'\n | 'onChange'\n | 'disabled'\n | 'maxLength'\n | 'id'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-describedby'\n | 'children'\n>;\ntype NativeTextareaProps = Omit<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | 'value'\n | 'onChange'\n | 'disabled'\n | 'maxLength'\n | 'id'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-describedby'\n | 'children'\n>;\n\ntype CommonInputProps = {\n value: string;\n disabled?: boolean;\n maxLength?: number;\n onChange: (value: string) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n onFocus?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n tag?: InputTag;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n style?: React.CSSProperties;\n inputStyle?: React.CSSProperties;\n automationId?: string;\n id?: string;\n /**\n * Accessible name when no visible label exists (icon-only / placeholder-only inputs).\n * Prefer ariaLabelledBy when a visible label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of visible element(s) that label this input.\n * Useful for external labels outside the Input component.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this input (hints, helper text, etc.).\n * Will be merged with internal error/counter IDs.\n */\n ariaDescribedBy?: string;\n};\n\n/**\n * Input component with built-in label, error, and counter support.\n * \n * Native HTML input/textarea attributes are passed through, including:\n * - `required`, `readOnly`, `autoFocus`, `name`, `type`\n * - `autoComplete`, `inputMode`, `enterKeyHint`, `pattern`\n * - Note: accessible name/description is provided via ariaLabel/ariaLabelledBy/ariaDescribedBy props.\n * - `min`, `max`, `step` (for number inputs)\n * - `onKeyDown`, `onPaste`, and other event handlers\n */\nexport type InputProps = CommonInputProps & (NativeInputProps | NativeTextareaProps);\n\nexport function Input({\n value,\n onChange,\n onBlur,\n onFocus,\n disabled,\n maxLength,\n tag,\n error,\n errorMessage,\n label,\n placeholder,\n style,\n inputStyle,\n automationId = '',\n id,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ...nativeProps\n}: InputProps) {\n const Element: InputTag = tag || 'input';\n\n const inputId = useStableId(id, 'se-input');\n const labelId = label ? `${inputId}-label` : undefined;\n const errorId = `${inputId}-error`;\n const countId = `${inputId}-count`;\n\n const describedBy = mergeIds(\n error && errorMessage ? errorId : undefined,\n maxLength ? countId : undefined,\n ariaDescribedBy\n );\n\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n // Native <label htmlFor> provides the name on its own; only fold the label id into\n // aria-labelledby when an external suffix is supplied, so the common case stays native-only.\n internalLabelId: ariaLabelledBy ? labelId : undefined,\n ariaDescribedBy: describedBy\n });\n\n const handleFocus = (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n onFocus?.(e);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const nextValue = e.target.value;\n onChange(nextValue);\n };\n\n const inputPropsBase = {\n ...(nativeProps as Record<string, unknown>),\n id: inputId,\n value,\n onChange: handleChange,\n onBlur,\n onFocus: handleFocus,\n disabled,\n className: `${error ? 'input-container-error' : 'input-container-default'} ${\n disabled ? 'input-container-disabled' : ''\n }`,\n maxLength: maxLength ?? undefined,\n placeholder: placeholder,\n style: inputStyle,\n 'aria-invalid': error ? 'true' : undefined,\n ...accessibleNameProps\n };\n\n return (\n <div className=\"input-main-container\" style={style} data-automation-id={automationId}>\n {label && (\n <label\n id={labelId}\n className={`label-container ${disabled ? 'label-container-disabled' : ''}`}\n htmlFor={inputId}\n >\n {label}\n </label>\n )}\n {React.createElement(Element, inputPropsBase)}\n {(error || maxLength) &&\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'} ${disabled ? 'disabled' : ''}`}>\n {error && errorMessage && (\n <div key={errorMessage} id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {maxLength && (\n <div id={countId} className=\"max-word\" aria-live=\"polite\" aria-atomic=\"true\">\n <span>{value?.length + '/' + maxLength}</span>\n </div>\n )}\n </div>\n }\n </div>\n );\n}\n"],"names":["React__default","useStableId","mergeIds","getA11yNameAttributes","Input","value","onChange","onBlur","onFocus","disabled","maxLength","tag","error","errorMessage","label","placeholder","style","inputStyle","automationId","id","ariaLabel","ariaLabelledBy","ariaDescribedBy","nativeProps","Element","inputId","labelId","undefined","errorId","countId","describedBy","accessibleNameProps","internalLabelId","inputPropsBase","handleChange","e","nextValue","target","handleFocus","className","React","createElement","htmlFor","key","role","length"],"mappings":"AA8EO,OAAAA,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;AAAA,SAASC,EAAM;AAAA,EACpBC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,IAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACA,GAAGC;AACO,GAAG;AACb,QAAMC,IAAoBb,KAAO,SAE3Bc,IAAUxB,EAAYkB,GAAI,UAAU,GACpCO,IAAUZ,IAAQ,GAAGW,CAAO,WAAWE,QACvCC,IAAU,GAAGH,CAAO,UACpBI,IAAU,GAAGJ,CAAO,UAEpBK,IAAc5B,EAClBU,KAASC,IAAee,IAAUD,QAClCjB,IAAYmB,IAAUF,QACtBL,CACF,GAEMS,IAAsB5B,EAAsB;AAAA,IAChDiB,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA;AAAAA;AAAAA,IAGAW,iBAAiBX,IAAiBK,IAAUC;AAAAA,IAC5CL,iBAAiBQ;AAAAA,EAAAA,CAClB,GAWKG,IAAiB;AAAA,IACrB,GAAIV;AAAAA,IACJJ,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A,GACpEC,gBAAAA,EAAAC,cAAA,QAAA,MAAOpC,GAAOwC,SAAS,MAAMnC,CAAgB,CAC1C,CAEJ,CAEJ;AAET;"}
1
+ {"version":3,"file":"index39.js","sources":["../src/components/Input/index.tsx"],"sourcesContent":["import React from 'react';\nimport { useStableId } from '../../utils/useStableId';\nimport { mergeIds } from '../../utils/mergeIds';\nimport { getA11yNameAttributes } from '../../utils/a11y';\nimport './style.scss';\n\ntype InputTag = 'input' | 'textarea';\n\ntype NativeInputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n | 'value'\n | 'onChange'\n | 'disabled'\n | 'maxLength'\n | 'id'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-describedby'\n | 'children'\n>;\ntype NativeTextareaProps = Omit<\n React.TextareaHTMLAttributes<HTMLTextAreaElement>,\n | 'value'\n | 'onChange'\n | 'disabled'\n | 'maxLength'\n | 'id'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-describedby'\n | 'children'\n>;\n\ntype CommonInputProps = {\n value: string;\n disabled?: boolean;\n maxLength?: number;\n onChange: (value: string) => void;\n onBlur?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n onFocus?: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n tag?: InputTag;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n style?: React.CSSProperties;\n inputStyle?: React.CSSProperties;\n automationId?: string;\n id?: string;\n /**\n * Accessible name when no visible label exists (icon-only / placeholder-only inputs).\n * Prefer ariaLabelledBy when a visible label exists.\n */\n ariaLabel?: string;\n /**\n * ID(s) of visible element(s) that label this input.\n * Useful for external labels outside the Input component.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this input (hints, helper text, etc.).\n * Will be merged with internal error/counter IDs.\n */\n ariaDescribedBy?: string;\n};\n\n/**\n * Input component with built-in label, error, and counter support.\n * \n * Native HTML input/textarea attributes are passed through, including:\n * - `required`, `readOnly`, `autoFocus`, `name`, `type`\n * - `autoComplete`, `inputMode`, `enterKeyHint`, `pattern`\n * - Note: accessible name/description is provided via ariaLabel/ariaLabelledBy/ariaDescribedBy props.\n * - `min`, `max`, `step` (for number inputs)\n * - `onKeyDown`, `onPaste`, and other event handlers\n */\nexport type InputProps = CommonInputProps & (NativeInputProps | NativeTextareaProps);\n\nexport function Input({\n value,\n onChange,\n onBlur,\n onFocus,\n disabled,\n maxLength,\n tag,\n error,\n errorMessage,\n label,\n placeholder,\n style,\n inputStyle,\n automationId = '',\n id,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ...nativeProps\n}: InputProps) {\n const Element: InputTag = tag || 'input';\n\n const inputId = useStableId(id, 'se-input');\n const errorId = `${inputId}-error`;\n const countId = `${inputId}-count`;\n\n const describedBy = mergeIds(\n error && errorMessage ? errorId : undefined,\n maxLength ? countId : undefined,\n ariaDescribedBy\n );\n\n const accessibleNameProps = getA11yNameAttributes({\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy: describedBy\n });\n\n const handleFocus = (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n onFocus?.(e);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const nextValue = e.target.value;\n onChange(nextValue);\n };\n\n const inputPropsBase = {\n ...(nativeProps as Record<string, unknown>),\n id: inputId,\n value,\n onChange: handleChange,\n onBlur,\n onFocus: handleFocus,\n disabled,\n className: `${error ? 'input-container-error' : 'input-container-default'} ${\n disabled ? 'input-container-disabled' : ''\n }`,\n maxLength: maxLength ?? undefined,\n placeholder: placeholder,\n style: inputStyle,\n 'aria-invalid': error ? 'true' : undefined,\n ...accessibleNameProps\n };\n\n return (\n <div className=\"input-main-container\" style={style} data-automation-id={automationId}>\n {label && (\n <label\n className={`label-container ${disabled ? 'label-container-disabled' : ''}`}\n htmlFor={inputId}\n >\n {label}\n </label>\n )}\n {React.createElement(Element, inputPropsBase)}\n {(error || maxLength) &&\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'} ${disabled ? 'disabled' : ''}`}>\n {error && errorMessage && (\n <div key={errorMessage} id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {maxLength && (\n <div id={countId} className=\"max-word\" aria-live=\"polite\" aria-atomic=\"true\">\n <span>{value?.length + '/' + maxLength}</span>\n </div>\n )}\n </div>\n }\n </div>\n );\n}\n"],"names":["React__default","useStableId","mergeIds","getA11yNameAttributes","Input","value","onChange","onBlur","onFocus","disabled","maxLength","tag","error","errorMessage","label","placeholder","style","inputStyle","automationId","id","ariaLabel","ariaLabelledBy","ariaDescribedBy","nativeProps","Element","inputId","errorId","countId","describedBy","undefined","accessibleNameProps","inputPropsBase","handleChange","e","nextValue","target","handleFocus","className","React","createElement","htmlFor","key","role","length"],"mappings":"AA8EO,OAAAA,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,YAAAC,SAAA;AAAA,SAAA,yBAAAC,SAAA;AAAA,OAAA;AAAA,OAAA;AAAA,SAASC,EAAM;AAAA,EACpBC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,QAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,IAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACA,GAAGC;AACO,GAAG;AACb,QAAMC,IAAoBb,KAAO,SAE3Bc,IAAUxB,EAAYkB,GAAI,UAAU,GACpCO,IAAU,GAAGD,CAAO,UACpBE,IAAU,GAAGF,CAAO,UAEpBG,IAAc1B,EAClBU,KAASC,IAAea,IAA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U;AAAA,IAAgBK,MAAK;AAAA,EAAA,GACjE7B,CACE,GAENH,KACC4B,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKpB,IAAIQ;AAAAA,IAASU,WAAU;AAAA,IAAW,aAAU;AAAA,IAAS,eAAY;AAAA,EAAA,GACpEC,gBAAAA,EAAAC,cAAA,QAAA,MAAOlC,GAAOsC,SAAS,MAAMjC,CAAgB,CAC1C,CAEJ,CAEJ;AAET;"}
package/dist/index40.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import a, { useState as d, useRef as $, useEffect as r, useMemo as D } from "react";
2
2
  import { Icon as g } from "./index6.js";
3
3
  import { LabelChip as F } from "./index11.js";
4
- import { debounce as L } from "./index225.js";
4
+ import { debounce as L } from "./index224.js";
5
5
  /* empty css */
6
6
  function z(p) {
7
7
  const {
package/dist/index45.js CHANGED
@@ -1,7 +1,7 @@
1
- import e, { useState as k, useRef as S, useCallback as P, useEffect as Y } from "react";
1
+ import e, { useState as k, useRef as S, useCallback as P, useEffect as Z } from "react";
2
2
  /* empty css */
3
3
  import { Icon as x } from "./index6.js";
4
- import { useStableId as Z } from "./index206.js";
4
+ import { useStableId as L } from "./index205.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,66 +19,65 @@ const ce = /* @__PURE__ */ e.memo(({
19
19
  onChange: i,
20
20
  disabled: t = !1,
21
21
  maxLength: a,
22
- tag: F = "input",
22
+ tag: B = "input",
23
23
  error: l = !1,
24
- errorMessage: R,
24
+ errorMessage: F,
25
25
  label: p,
26
- placeholder: j,
26
+ placeholder: R,
27
27
  suggestions: c = [],
28
- onSelect: E,
28
+ onSelect: $,
29
29
  renderOption: d,
30
- optionClassName: A,
31
- automationId: B = "",
32
- ariaLabel: $,
30
+ optionClassName: j,
31
+ automationId: A = "",
32
+ ariaLabel: b,
33
33
  ariaLabelledBy: O,
34
34
  ariaDescribedBy: V,
35
35
  ..._
36
36
  }) => {
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]), {
37
+ const [s, v] = k([...c]), [E, g] = k(!1), H = S(null), N = S(null), f = L(void 0, "autocomplete"), z = `${f}-input`, D = `${f}-listbox`, y = `${f}-label`, C = `${f}-error`, w = P((r) => {
38
+ g(!1), $?.(r);
39
+ }, [$]), {
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: L
46
+ isKeyboardFocused: Q
47
47
  } = te({
48
48
  items: s,
49
- isOpen: v,
49
+ isOpen: E,
50
50
  onOpenChange: g,
51
51
  onSelect: w,
52
52
  listboxId: D
53
- }), Q = P((r) => {
53
+ }), T = P((r) => {
54
54
  const n = r.target.value;
55
55
  if (h(-1), i(n), !d)
56
56
  if (n === "")
57
- b([...c]);
57
+ v([...c]);
58
58
  else {
59
59
  const I = c?.filter((m) => typeof m == "object" && m?.label?.toLowerCase().includes(n?.toLowerCase() ?? ""));
60
- b([...I]);
60
+ v([...I]);
61
61
  }
62
62
  }, [i, c, d, h]);
63
- Y(() => {
64
- b([...c]);
63
+ Z(() => {
64
+ v([...c]);
65
65
  }, [c]);
66
- const T = () => {
66
+ const U = () => {
67
67
  g(!0);
68
- }, U = () => {
69
- s.length > 0 && g(!0);
70
68
  }, W = () => {
69
+ s.length > 0 && g(!0);
70
+ }, X = () => {
71
71
  i(""), h(-1), N.current?.focus();
72
- }, X = ee({
73
- ariaLabelledBy: O,
74
- internalLabelId: p ? y : void 0,
75
- ariaLabel: $,
72
+ }, Y = ee({
73
+ ariaLabelledBy: p && !b ? y : O,
74
+ ariaLabel: b,
76
75
  ariaDescribedBy: l ? C : V
77
76
  });
78
77
  return /* @__PURE__ */ e.createElement("div", u({
79
78
  className: "main-container-autocomplete-se-design",
80
79
  ref: H,
81
- "data-automation-id": B
80
+ "data-automation-id": A
82
81
  }, K), p && /* @__PURE__ */ e.createElement("span", {
83
82
  id: y,
84
83
  className: `label-container ${t ? "label-container-disabled" : ""}`
@@ -89,36 +88,36 @@ const ce = /* @__PURE__ */ e.memo(({
89
88
  style: {
90
89
  pointerEvents: t ? "none" : "auto"
91
90
  }
92
- }, /* @__PURE__ */ e.createElement(F, {
91
+ }, /* @__PURE__ */ e.createElement(B, {
93
92
  ref: N,
94
93
  id: z,
95
94
  value: o,
96
- onChange: Q,
97
- onClick: T,
98
- onFocus: U,
95
+ onChange: T,
96
+ onClick: U,
97
+ onFocus: W,
99
98
  ...M,
100
99
  disabled: t,
101
100
  className: `${l ? "input-container-error" : "input-container-default"} ${t ? "input-container-disabled" : ""} ${s.length > 0 || o ? "with-icon" : ""} ${s.length > 0 && o ? "with-icons" : ""}`,
102
101
  maxLength: a,
103
- placeholder: j,
102
+ placeholder: R,
104
103
  "aria-invalid": l || void 0,
105
- ...X,
104
+ ...Y,
106
105
  ..._
107
106
  }), o && /* @__PURE__ */ e.createElement(x, {
108
107
  name: "close",
109
108
  className: "input-icon-close",
110
109
  size: 15,
111
- onClick: W,
110
+ onClick: X,
112
111
  stroke: t ? "var(--color-gray-600)" : "",
113
112
  ariaLabel: "Clear input"
114
113
  }), s.length > 0 && /* @__PURE__ */ e.createElement(x, {
115
114
  name: "chevron",
116
- rotation: v ? "180" : "0",
115
+ rotation: E ? "180" : "0",
117
116
  className: "input-icon-chevron",
118
117
  stroke: t ? "var(--color-gray-600)" : "",
119
118
  "aria-hidden": "true"
120
- })), v && s.length > 0 && /* @__PURE__ */ e.createElement("div", u({}, q, {
121
- "aria-label": p || $ || "Suggestions",
119
+ })), E && s.length > 0 && /* @__PURE__ */ e.createElement("div", u({}, q, {
120
+ "aria-label": p || b || "Suggestions",
122
121
  className: "suggestions-list",
123
122
  "data-automation-id": "autocomplete-suggestions-list"
124
123
  }), s.map((r, n) => {
@@ -126,7 +125,7 @@ const ce = /* @__PURE__ */ e.memo(({
126
125
  return /* @__PURE__ */ e.createElement("div", u({
127
126
  key: n
128
127
  }, I, {
129
- className: `${A || "suggestion-item"} ${m ? `suggestion-item-highlighted${L ? " suggestion-item-keyboard-highlight" : ""}` : ""}`,
128
+ className: `${j || "suggestion-item"} ${m ? `suggestion-item-highlighted${Q ? " suggestion-item-keyboard-highlight" : ""}` : ""}`,
130
129
  onClick: () => w(r),
131
130
  onMouseEnter: () => h(n),
132
131
  "data-automation-id": `autocomplete-suggestion-item-${n}`
@@ -140,7 +139,7 @@ const ce = /* @__PURE__ */ e.memo(({
140
139
  id: C,
141
140
  className: "error-message",
142
141
  role: "alert"
143
- }, R), a && /* @__PURE__ */ e.createElement("div", {
142
+ }, F), a && /* @__PURE__ */ e.createElement("div", {
144
143
  className: "max-word"
145
144
  }, o.length, "/", a)));
146
145
  });
@@ -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,\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,GAGxCE,IAAaC,EAAYC,QAAW,cAAc,GAClDC,IAAU,GAAGH,CAAU,UACvBI,IAAY,GAAGJ,CAAU,YACzBK,IAAU,GAAGL,CAAU,UACvBM,IAAU,GAAGN,CAAU,UAEvBO,IAA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,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;"}
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,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,GAGxCE,IAAaC,EAAYC,QAAW,cAAc,GAClDC,IAAU,GAAGH,CAAU,UACvBI,IAAY,GAAGJ,CAAU,YACzBK,IAAU,GAAGL,CAAU,UACvBM,IAAU,GAAGN,CAAU,UAEvBO,IAAyBC,EAC7B,CAACC,MAAc;AACbb,IAAAA,EAAwB,EAAK,GAC7BZ,IAAWyB,CAAI;AAAA,EACjB,GACA,CAACzB,CAAQ,CACX,GAGM;AAAA,IACJ0B,gBAAAA;AAAAA,IACAC,YAAYC;AAAAA,IACZC,cAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,qBAAAA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