se-design 1.0.90-dev.0 → 1.0.90

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 (462) hide show
  1. package/dist/assets/style.css +1 -1
  2. package/dist/components/AnchoredOverlay/index.d.ts +41 -0
  3. package/dist/components/index.d.ts +2 -0
  4. package/dist/index.js +132 -130
  5. package/dist/index.js.map +1 -1
  6. package/dist/index100.js +1 -1
  7. package/dist/index100.js.map +1 -1
  8. package/dist/index101.js +1 -1
  9. package/dist/index101.js.map +1 -1
  10. package/dist/index102.js +1 -1
  11. package/dist/index102.js.map +1 -1
  12. package/dist/index103.js +1 -1
  13. package/dist/index103.js.map +1 -1
  14. package/dist/index104.js +1 -1
  15. package/dist/index104.js.map +1 -1
  16. package/dist/index105.js +1 -1
  17. package/dist/index105.js.map +1 -1
  18. package/dist/index106.js +1 -1
  19. package/dist/index106.js.map +1 -1
  20. package/dist/index107.js +1 -1
  21. package/dist/index107.js.map +1 -1
  22. package/dist/index108.js +1 -1
  23. package/dist/index108.js.map +1 -1
  24. package/dist/index109.js +1 -1
  25. package/dist/index109.js.map +1 -1
  26. package/dist/index11.js +1 -1
  27. package/dist/index110.js +1 -1
  28. package/dist/index110.js.map +1 -1
  29. package/dist/index111.js +1 -1
  30. package/dist/index111.js.map +1 -1
  31. package/dist/index112.js +1 -1
  32. package/dist/index112.js.map +1 -1
  33. package/dist/index113.js +1 -1
  34. package/dist/index113.js.map +1 -1
  35. package/dist/index114.js +2 -2
  36. package/dist/index114.js.map +1 -1
  37. package/dist/index115.js +1 -1
  38. package/dist/index115.js.map +1 -1
  39. package/dist/index116.js +2 -2
  40. package/dist/index116.js.map +1 -1
  41. package/dist/index117.js +1 -1
  42. package/dist/index117.js.map +1 -1
  43. package/dist/index118.js +1 -1
  44. package/dist/index118.js.map +1 -1
  45. package/dist/index119.js +2 -2
  46. package/dist/index119.js.map +1 -1
  47. package/dist/index12.js +3 -3
  48. package/dist/index120.js +1 -1
  49. package/dist/index120.js.map +1 -1
  50. package/dist/index121.js +2 -2
  51. package/dist/index121.js.map +1 -1
  52. package/dist/index122.js +1 -1
  53. package/dist/index122.js.map +1 -1
  54. package/dist/index123.js +1 -1
  55. package/dist/index123.js.map +1 -1
  56. package/dist/index124.js +1 -1
  57. package/dist/index124.js.map +1 -1
  58. package/dist/index125.js +1 -1
  59. package/dist/index125.js.map +1 -1
  60. package/dist/index126.js +2 -2
  61. package/dist/index126.js.map +1 -1
  62. package/dist/index127.js +1 -1
  63. package/dist/index127.js.map +1 -1
  64. package/dist/index128.js +2 -2
  65. package/dist/index128.js.map +1 -1
  66. package/dist/index129.js +2 -2
  67. package/dist/index129.js.map +1 -1
  68. package/dist/index13.js +3 -3
  69. package/dist/index130.js +1 -1
  70. package/dist/index130.js.map +1 -1
  71. package/dist/index131.js +2 -2
  72. package/dist/index131.js.map +1 -1
  73. package/dist/index132.js +2 -2
  74. package/dist/index132.js.map +1 -1
  75. package/dist/index133.js +1 -1
  76. package/dist/index133.js.map +1 -1
  77. package/dist/index134.js +1 -1
  78. package/dist/index134.js.map +1 -1
  79. package/dist/index135.js +1 -1
  80. package/dist/index135.js.map +1 -1
  81. package/dist/index136.js +2 -2
  82. package/dist/index136.js.map +1 -1
  83. package/dist/index137.js +2 -2
  84. package/dist/index137.js.map +1 -1
  85. package/dist/index138.js +2 -2
  86. package/dist/index138.js.map +1 -1
  87. package/dist/index139.js +1 -1
  88. package/dist/index139.js.map +1 -1
  89. package/dist/index140.js +1 -1
  90. package/dist/index140.js.map +1 -1
  91. package/dist/index141.js +1 -1
  92. package/dist/index141.js.map +1 -1
  93. package/dist/index142.js +1 -1
  94. package/dist/index142.js.map +1 -1
  95. package/dist/index143.js +1 -1
  96. package/dist/index143.js.map +1 -1
  97. package/dist/index144.js +1 -1
  98. package/dist/index144.js.map +1 -1
  99. package/dist/index145.js +1 -1
  100. package/dist/index145.js.map +1 -1
  101. package/dist/index146.js +1 -1
  102. package/dist/index146.js.map +1 -1
  103. package/dist/index147.js +2 -2
  104. package/dist/index147.js.map +1 -1
  105. package/dist/index148.js +2 -2
  106. package/dist/index148.js.map +1 -1
  107. package/dist/index149.js +1 -1
  108. package/dist/index149.js.map +1 -1
  109. package/dist/index150.js +1 -1
  110. package/dist/index150.js.map +1 -1
  111. package/dist/index151.js +1 -1
  112. package/dist/index151.js.map +1 -1
  113. package/dist/index152.js +1 -1
  114. package/dist/index152.js.map +1 -1
  115. package/dist/index153.js +1 -1
  116. package/dist/index153.js.map +1 -1
  117. package/dist/index154.js +1 -1
  118. package/dist/index154.js.map +1 -1
  119. package/dist/index155.js +1 -1
  120. package/dist/index155.js.map +1 -1
  121. package/dist/index156.js +2 -2
  122. package/dist/index156.js.map +1 -1
  123. package/dist/index157.js +1 -1
  124. package/dist/index157.js.map +1 -1
  125. package/dist/index158.js +2 -2
  126. package/dist/index158.js.map +1 -1
  127. package/dist/index159.js +2 -2
  128. package/dist/index159.js.map +1 -1
  129. package/dist/index16.js +3 -3
  130. package/dist/index160.js +2 -2
  131. package/dist/index160.js.map +1 -1
  132. package/dist/index161.js +2 -2
  133. package/dist/index161.js.map +1 -1
  134. package/dist/index162.js +1 -1
  135. package/dist/index162.js.map +1 -1
  136. package/dist/index163.js +1 -1
  137. package/dist/index163.js.map +1 -1
  138. package/dist/index164.js +1 -1
  139. package/dist/index164.js.map +1 -1
  140. package/dist/index165.js +1 -1
  141. package/dist/index165.js.map +1 -1
  142. package/dist/index166.js +1 -1
  143. package/dist/index166.js.map +1 -1
  144. package/dist/index167.js +1 -1
  145. package/dist/index167.js.map +1 -1
  146. package/dist/index168.js +1 -1
  147. package/dist/index168.js.map +1 -1
  148. package/dist/index169.js +1 -1
  149. package/dist/index169.js.map +1 -1
  150. package/dist/index170.js +1 -1
  151. package/dist/index170.js.map +1 -1
  152. package/dist/index171.js +1 -1
  153. package/dist/index171.js.map +1 -1
  154. package/dist/index172.js +1 -1
  155. package/dist/index172.js.map +1 -1
  156. package/dist/index173.js +1 -1
  157. package/dist/index173.js.map +1 -1
  158. package/dist/index174.js +1 -1
  159. package/dist/index174.js.map +1 -1
  160. package/dist/index175.js +1 -1
  161. package/dist/index175.js.map +1 -1
  162. package/dist/index176.js +1 -1
  163. package/dist/index176.js.map +1 -1
  164. package/dist/index177.js +1 -1
  165. package/dist/index177.js.map +1 -1
  166. package/dist/index178.js +1 -1
  167. package/dist/index178.js.map +1 -1
  168. package/dist/index179.js +1 -1
  169. package/dist/index179.js.map +1 -1
  170. package/dist/index18.js +3 -3
  171. package/dist/index180.js +1 -1
  172. package/dist/index180.js.map +1 -1
  173. package/dist/index181.js +1 -1
  174. package/dist/index181.js.map +1 -1
  175. package/dist/index182.js +1 -1
  176. package/dist/index182.js.map +1 -1
  177. package/dist/index183.js +1 -1
  178. package/dist/index183.js.map +1 -1
  179. package/dist/index184.js +1 -1
  180. package/dist/index184.js.map +1 -1
  181. package/dist/index185.js +1 -1
  182. package/dist/index185.js.map +1 -1
  183. package/dist/index186.js +2 -2
  184. package/dist/index186.js.map +1 -1
  185. package/dist/index187.js +2 -2
  186. package/dist/index187.js.map +1 -1
  187. package/dist/index188.js +1 -1
  188. package/dist/index188.js.map +1 -1
  189. package/dist/index189.js +1 -1
  190. package/dist/index189.js.map +1 -1
  191. package/dist/index19.js +5 -5
  192. package/dist/index190.js +2 -2
  193. package/dist/index190.js.map +1 -1
  194. package/dist/index191.js +2 -2
  195. package/dist/index191.js.map +1 -1
  196. package/dist/index192.js +1 -1
  197. package/dist/index192.js.map +1 -1
  198. package/dist/index193.js +1 -1
  199. package/dist/index193.js.map +1 -1
  200. package/dist/index194.js +1 -1
  201. package/dist/index194.js.map +1 -1
  202. package/dist/index195.js +1 -1
  203. package/dist/index195.js.map +1 -1
  204. package/dist/index196.js +1 -1
  205. package/dist/index196.js.map +1 -1
  206. package/dist/index197.js +1 -1
  207. package/dist/index197.js.map +1 -1
  208. package/dist/index198.js +1 -1
  209. package/dist/index198.js.map +1 -1
  210. package/dist/index199.js +1 -1
  211. package/dist/index199.js.map +1 -1
  212. package/dist/index20.js +96 -18
  213. package/dist/index20.js.map +1 -1
  214. package/dist/index200.js +1 -1
  215. package/dist/index200.js.map +1 -1
  216. package/dist/index201.js +2 -2
  217. package/dist/index201.js.map +1 -1
  218. package/dist/index202.js +2 -2
  219. package/dist/index202.js.map +1 -1
  220. package/dist/index203.js +2 -2
  221. package/dist/index203.js.map +1 -1
  222. package/dist/index204.js +2 -149
  223. package/dist/index204.js.map +1 -1
  224. package/dist/index205.js +149 -9
  225. package/dist/index205.js.map +1 -1
  226. package/dist/index206.js +8 -5
  227. package/dist/index206.js.map +1 -1
  228. package/dist/index207.js +5 -42
  229. package/dist/index207.js.map +1 -1
  230. package/dist/index208.js +40 -18
  231. package/dist/index208.js.map +1 -1
  232. package/dist/index209.js +24 -0
  233. package/dist/index209.js.map +1 -0
  234. package/dist/index21.js +17 -32
  235. package/dist/index21.js.map +1 -1
  236. package/dist/index216.js +24 -68
  237. package/dist/index216.js.map +1 -1
  238. package/dist/index217.js +75 -0
  239. package/dist/index217.js.map +1 -0
  240. package/dist/index22.js +33 -66
  241. package/dist/index22.js.map +1 -1
  242. package/dist/{index223.js → index224.js} +1 -1
  243. package/dist/{index223.js.map → index224.js.map} +1 -1
  244. package/dist/{index225.js → index226.js} +1 -1
  245. package/dist/{index225.js.map → index226.js.map} +1 -1
  246. package/dist/index23.js +62 -83
  247. package/dist/index23.js.map +1 -1
  248. package/dist/{index233.js → index234.js} +1 -1
  249. package/dist/{index233.js.map → index234.js.map} +1 -1
  250. package/dist/{index236.js → index237.js} +1 -1
  251. package/dist/{index236.js.map → index237.js.map} +1 -1
  252. package/dist/index24.js +85 -21
  253. package/dist/index24.js.map +1 -1
  254. package/dist/index246.js +169 -3
  255. package/dist/index246.js.map +1 -1
  256. package/dist/index247.js +7 -0
  257. package/dist/index247.js.map +1 -0
  258. package/dist/index249.js +18 -9
  259. package/dist/index249.js.map +1 -1
  260. package/dist/index25.js +19 -401
  261. package/dist/index25.js.map +1 -1
  262. package/dist/index250.js +9 -9
  263. package/dist/index250.js.map +1 -1
  264. package/dist/index251.js +9 -4
  265. package/dist/index251.js.map +1 -1
  266. package/dist/index252.js +5 -170
  267. package/dist/index252.js.map +1 -1
  268. package/dist/index253.js +170 -11
  269. package/dist/index253.js.map +1 -1
  270. package/dist/index254.js +11 -6
  271. package/dist/index254.js.map +1 -1
  272. package/dist/index255.js +5 -5
  273. package/dist/index255.js.map +1 -1
  274. package/dist/index256.js +5 -37
  275. package/dist/index256.js.map +1 -1
  276. package/dist/index257.js +38 -2
  277. package/dist/index257.js.map +1 -1
  278. package/dist/index258.js +2 -8
  279. package/dist/index258.js.map +1 -1
  280. package/dist/index259.js +7 -326
  281. package/dist/index259.js.map +1 -1
  282. package/dist/index26.js +400 -44
  283. package/dist/index26.js.map +1 -1
  284. package/dist/index260.js +324 -47
  285. package/dist/index260.js.map +1 -1
  286. package/dist/index261.js +50 -2
  287. package/dist/index261.js.map +1 -1
  288. package/dist/index262.js +2 -76
  289. package/dist/index262.js.map +1 -1
  290. package/dist/index263.js +65 -82
  291. package/dist/index263.js.map +1 -1
  292. package/dist/index264.js +89 -48
  293. package/dist/index264.js.map +1 -1
  294. package/dist/index265.js +51 -7
  295. package/dist/index265.js.map +1 -1
  296. package/dist/index266.js +7 -4
  297. package/dist/index266.js.map +1 -1
  298. package/dist/index267.js +4 -51
  299. package/dist/index267.js.map +1 -1
  300. package/dist/index268.js +52 -2
  301. package/dist/index268.js.map +1 -1
  302. package/dist/index269.js +2 -2
  303. package/dist/index27.js +48 -23
  304. package/dist/index27.js.map +1 -1
  305. package/dist/index270.js +5 -0
  306. package/dist/index270.js.map +1 -0
  307. package/dist/index28.js +21 -108
  308. package/dist/index28.js.map +1 -1
  309. package/dist/index29.js +107 -147
  310. package/dist/index29.js.map +1 -1
  311. package/dist/index3.js +3 -3
  312. package/dist/index30.js +146 -132
  313. package/dist/index30.js.map +1 -1
  314. package/dist/index31.js +136 -76
  315. package/dist/index31.js.map +1 -1
  316. package/dist/index32.js +73 -94
  317. package/dist/index32.js.map +1 -1
  318. package/dist/index33.js +95 -73
  319. package/dist/index33.js.map +1 -1
  320. package/dist/index34.js +72 -38
  321. package/dist/index34.js.map +1 -1
  322. package/dist/index35.js +40 -72
  323. package/dist/index35.js.map +1 -1
  324. package/dist/index36.js +68 -94
  325. package/dist/index36.js.map +1 -1
  326. package/dist/index37.js +98 -77
  327. package/dist/index37.js.map +1 -1
  328. package/dist/index38.js +75 -311
  329. package/dist/index38.js.map +1 -1
  330. package/dist/index39.js +313 -75
  331. package/dist/index39.js.map +1 -1
  332. package/dist/index4.js +4 -4
  333. package/dist/index40.js +72 -79
  334. package/dist/index40.js.map +1 -1
  335. package/dist/index41.js +82 -32
  336. package/dist/index41.js.map +1 -1
  337. package/dist/index42.js +26 -43
  338. package/dist/index42.js.map +1 -1
  339. package/dist/index43.js +48 -109
  340. package/dist/index43.js.map +1 -1
  341. package/dist/index44.js +104 -50
  342. package/dist/index44.js.map +1 -1
  343. package/dist/index45.js +53 -142
  344. package/dist/index45.js.map +1 -1
  345. package/dist/index46.js +137 -188
  346. package/dist/index46.js.map +1 -1
  347. package/dist/index47.js +195 -35
  348. package/dist/index47.js.map +1 -1
  349. package/dist/index48.js +34 -32
  350. package/dist/index48.js.map +1 -1
  351. package/dist/index49.js +34 -147
  352. package/dist/index49.js.map +1 -1
  353. package/dist/index50.js +130 -67
  354. package/dist/index50.js.map +1 -1
  355. package/dist/index51.js +78 -453
  356. package/dist/index51.js.map +1 -1
  357. package/dist/index52.js +459 -96
  358. package/dist/index52.js.map +1 -1
  359. package/dist/index53.js +98 -43
  360. package/dist/index53.js.map +1 -1
  361. package/dist/index54.js +40 -35
  362. package/dist/index54.js.map +1 -1
  363. package/dist/index55.js +33 -87
  364. package/dist/index55.js.map +1 -1
  365. package/dist/index56.js +88 -159
  366. package/dist/index56.js.map +1 -1
  367. package/dist/index57.js +157 -143
  368. package/dist/index57.js.map +1 -1
  369. package/dist/index58.js +149 -33
  370. package/dist/index58.js.map +1 -1
  371. package/dist/index59.js +33 -86
  372. package/dist/index59.js.map +1 -1
  373. package/dist/index6.js +125 -125
  374. package/dist/index60.js +80 -113
  375. package/dist/index60.js.map +1 -1
  376. package/dist/index61.js +114 -73
  377. package/dist/index61.js.map +1 -1
  378. package/dist/index62.js +73 -147
  379. package/dist/index62.js.map +1 -1
  380. package/dist/index63.js +146 -312
  381. package/dist/index63.js.map +1 -1
  382. package/dist/index64.js +317 -46
  383. package/dist/index64.js.map +1 -1
  384. package/dist/index65.js +45 -142
  385. package/dist/index65.js.map +1 -1
  386. package/dist/index66.js +144 -12
  387. package/dist/index66.js.map +1 -1
  388. package/dist/index67.js +10 -53
  389. package/dist/index67.js.map +1 -1
  390. package/dist/index68.js +52 -110
  391. package/dist/index68.js.map +1 -1
  392. package/dist/index69.js +111 -17
  393. package/dist/index69.js.map +1 -1
  394. package/dist/index7.js +2 -2
  395. package/dist/index70.js +17 -64
  396. package/dist/index70.js.map +1 -1
  397. package/dist/index71.js +64 -25
  398. package/dist/index71.js.map +1 -1
  399. package/dist/index72.js +24 -105
  400. package/dist/index72.js.map +1 -1
  401. package/dist/index73.js +104 -58
  402. package/dist/index73.js.map +1 -1
  403. package/dist/index74.js +60 -19
  404. package/dist/index74.js.map +1 -1
  405. package/dist/index75.js +18 -168
  406. package/dist/index75.js.map +1 -1
  407. package/dist/index76.js +171 -18
  408. package/dist/index76.js.map +1 -1
  409. package/dist/index77.js +17 -10
  410. package/dist/index77.js.map +1 -1
  411. package/dist/index78.js +11 -5
  412. package/dist/index78.js.map +1 -1
  413. package/dist/index79.js +5 -62
  414. package/dist/index79.js.map +1 -1
  415. package/dist/index80.js +58 -23
  416. package/dist/index80.js.map +1 -1
  417. package/dist/index81.js +25 -9
  418. package/dist/index81.js.map +1 -1
  419. package/dist/index82.js +14 -0
  420. package/dist/index82.js.map +1 -0
  421. package/dist/index84.js +2 -2
  422. package/dist/index84.js.map +1 -1
  423. package/dist/index85.js +2 -2
  424. package/dist/index85.js.map +1 -1
  425. package/dist/index86.js +2 -2
  426. package/dist/index86.js.map +1 -1
  427. package/dist/index87.js +2 -2
  428. package/dist/index87.js.map +1 -1
  429. package/dist/index88.js +1 -1
  430. package/dist/index88.js.map +1 -1
  431. package/dist/index89.js +1 -1
  432. package/dist/index89.js.map +1 -1
  433. package/dist/index9.js +4 -4
  434. package/dist/index90.js +1 -1
  435. package/dist/index90.js.map +1 -1
  436. package/dist/index91.js +1 -1
  437. package/dist/index91.js.map +1 -1
  438. package/dist/index92.js +1 -1
  439. package/dist/index92.js.map +1 -1
  440. package/dist/index93.js +1 -1
  441. package/dist/index93.js.map +1 -1
  442. package/dist/index94.js +1 -1
  443. package/dist/index94.js.map +1 -1
  444. package/dist/index95.js +1 -1
  445. package/dist/index95.js.map +1 -1
  446. package/dist/index96.js +1 -1
  447. package/dist/index96.js.map +1 -1
  448. package/dist/index97.js +1 -1
  449. package/dist/index97.js.map +1 -1
  450. package/dist/index98.js +1 -1
  451. package/dist/index98.js.map +1 -1
  452. package/dist/index99.js +1 -1
  453. package/dist/index99.js.map +1 -1
  454. package/package.json +1 -1
  455. package/dist/index215.js +0 -31
  456. package/dist/index215.js.map +0 -1
  457. package/dist/index245.js +0 -173
  458. package/dist/index245.js.map +0 -1
  459. package/dist/index248.js +0 -22
  460. package/dist/index248.js.map +0 -1
  461. package/dist/index83.js +0 -5
  462. package/dist/index83.js.map +0 -1
@@ -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\"): 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,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,GAA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AM,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;"}
1
+ {"version":3,"file":"index46.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,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;AAAAA,IACAC,mBAAAA;AAAAA,EAAAA,IACEC,GA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AAU;AAAA,EAAA,GACZrE,EAAM4D,QAAO,KAAEzD,CACb,CAEJ,CAEJ;AAET,CACF;"}
package/dist/index47.js CHANGED
@@ -1,41 +1,201 @@
1
- import o from "react";
2
- const m = ({
3
- progress: a,
4
- backgroundColor: n = "#E8E8E8",
5
- progressColor: s = "#0066FF",
6
- size: e = 40,
7
- strokeWidth: r = 4
8
- }) => {
9
- const t = (e - r) / 2, c = t * 2 * Math.PI, l = c - a / 100 * c;
10
- return /* @__PURE__ */ o.createElement("svg", {
11
- width: e,
12
- height: e,
13
- style: {
14
- transform: "rotate(-90deg)"
1
+ import t, { useState as h, useRef as f, useCallback as g, useEffect as P } from "react";
2
+ /* empty css */
3
+ import C from "./index234.js";
4
+ import { Icon as H } from "./index6.js";
5
+ import { useStableId as b } from "./index207.js";
6
+ import { getA11yNameAttributes as J } from "./index82.js";
7
+ import "./index73.js";
8
+ import { useCombobox as le } from "./index69.js";
9
+ function c() {
10
+ return c = Object.assign ? Object.assign.bind() : function(i) {
11
+ for (var l = 1; l < arguments.length; l++) {
12
+ var r = arguments[l];
13
+ for (var u in r) ({}).hasOwnProperty.call(r, u) && (i[u] = r[u]);
15
14
  }
16
- }, /* @__PURE__ */ o.createElement("circle", {
17
- cx: e / 2,
18
- cy: e / 2,
19
- r: t,
20
- stroke: n,
21
- strokeWidth: r,
22
- fill: "none"
23
- }), /* @__PURE__ */ o.createElement("circle", {
24
- cx: e / 2,
25
- cy: e / 2,
26
- r: t,
27
- stroke: s,
28
- strokeWidth: r,
29
- strokeDasharray: c,
30
- strokeDashoffset: l,
31
- fill: "none",
32
- strokeLinecap: "round",
33
- style: {
34
- transition: "stroke-dashoffset 0.3s ease"
15
+ return i;
16
+ }, c.apply(null, arguments);
17
+ }
18
+ const ye = ({
19
+ onCountrycodeChange: i,
20
+ onNumberChange: l,
21
+ error: r,
22
+ errorMessage: u,
23
+ value: d,
24
+ label: s,
25
+ automationId: p = "",
26
+ ariaLabel: M,
27
+ ariaLabelledBy: T,
28
+ ariaDescribedBy: z,
29
+ phoneNumberAriaLabel: x,
30
+ countryCodeAriaLabel: G,
31
+ disabled: a = !1
32
+ }) => {
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
+ }, []), I = g((e) => {
36
+ e && (A(e), i(e)), V();
37
+ }, [i, V]), Y = g((e) => {
38
+ m.current = !0, I(e.dial_code);
39
+ }, [I]), {
40
+ containerProps: j,
41
+ inputProps: Z,
42
+ listboxProps: ee,
43
+ getOptionProps: te,
44
+ highlightedIndex: ne,
45
+ setHighlightedIndex: q
46
+ } = le({
47
+ items: w,
48
+ isOpen: n,
49
+ onOpenChange: y,
50
+ onSelect: Y,
51
+ listboxId: B
52
+ }), oe = (e) => {
53
+ const o = e.target.value;
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
+ }, D = f(n);
58
+ P(() => {
59
+ let e = null;
60
+ return D.current && !n && m.current && (e = requestAnimationFrame(() => {
61
+ F.current?.focus();
62
+ })), D.current && !n && (m.current = !1), D.current = n, () => {
63
+ e !== null && cancelAnimationFrame(e);
64
+ };
65
+ }, [n]), P(() => {
66
+ d && (A(d.countryCode), R(d.number));
67
+ }, [d]), P(() => {
68
+ let e = null;
69
+ return n && (e = requestAnimationFrame(() => {
70
+ O.current?.focus();
71
+ })), () => {
72
+ e !== null && cancelAnimationFrame(e);
73
+ };
74
+ }, [n]);
75
+ const re = (e) => {
76
+ const o = e.replace(/\D/g, "");
77
+ R(o), l(o);
78
+ }, S = g(() => {
79
+ a || y((e) => !e);
80
+ }, [a]), ae = g((e) => {
81
+ if (!a)
82
+ switch (e.key) {
83
+ case "Enter":
84
+ case " ":
85
+ e.preventDefault(), S();
86
+ break;
87
+ case "ArrowDown":
88
+ e.preventDefault(), n || y(!0);
89
+ break;
90
+ }
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}`;
100
+ return /* @__PURE__ */ t.createElement("div", c({
101
+ className: "phone-input-container-se-design-main-container",
102
+ "data-automation-id": p
103
+ }, j, {
104
+ onKeyDownCapture: (e) => {
105
+ e.key === "Escape" && n && (m.current = !0), j.onKeyDownCapture(e);
35
106
  }
36
- }));
107
+ }), s && /* @__PURE__ */ t.createElement("div", {
108
+ id: N,
109
+ className: "label-container"
110
+ }, s), /* @__PURE__ */ t.createElement("div", c({
111
+ role: "group"
112
+ }, ce, {
113
+ className: `phone-input-container-se-design-main ${r ? "error" : ""}`,
114
+ ref: W
115
+ }), /* @__PURE__ */ t.createElement("div", {
116
+ className: "phone-input-container-se-design"
117
+ }, /* @__PURE__ */ t.createElement("button", {
118
+ ref: F,
119
+ type: "button",
120
+ className: `phone-input-container-se-design-country-code focus-outline rounded ${a ? "cursor-not-allowed opacity-60" : ""}`,
121
+ onClick: S,
122
+ onKeyDown: ae,
123
+ "aria-haspopup": "listbox",
124
+ "aria-expanded": n,
125
+ "aria-controls": n ? B : void 0,
126
+ "aria-label": ie,
127
+ disabled: a,
128
+ "data-automation-id": "country-code-selector"
129
+ }, /* @__PURE__ */ t.createElement("img", {
130
+ src: `https://flagcdn.com/${E?.code.toLowerCase()}.svg`,
131
+ alt: "",
132
+ "aria-hidden": "true",
133
+ width: "16"
134
+ }), /* @__PURE__ */ t.createElement("span", null, E?.dial_code), /* @__PURE__ */ t.createElement(H, {
135
+ name: "chevron",
136
+ className: n ? "rotate-180" : "",
137
+ "aria-hidden": "true"
138
+ })), /* @__PURE__ */ t.createElement("span", {
139
+ className: "divider",
140
+ "aria-hidden": "true"
141
+ }), /* @__PURE__ */ t.createElement("input", c({
142
+ id: X,
143
+ type: "tel",
144
+ placeholder: "Enter phone number",
145
+ className: `phone-input-container-se-design-phone-number-input ${a ? "disabled" : ""}`,
146
+ onChange: (e) => re(e.target.value),
147
+ value: U,
148
+ pattern: "[0-9]*",
149
+ disabled: a,
150
+ "aria-invalid": r || void 0
151
+ }, se, {
152
+ "data-automation-id": "phone-number-input-field"
153
+ }))), n && /* @__PURE__ */ t.createElement("div", c({}, ee, {
154
+ className: "phone-input-container-se-design-country-code-list",
155
+ "aria-label": "Select country",
156
+ "data-automation-id": "country-code-list"
157
+ }), /* @__PURE__ */ t.createElement("div", {
158
+ className: "search-input-wrapper"
159
+ }, /* @__PURE__ */ t.createElement(H, {
160
+ name: "search",
161
+ className: "search-icon",
162
+ "aria-hidden": "true"
163
+ }), /* @__PURE__ */ t.createElement("input", c({
164
+ ref: O
165
+ }, Z, {
166
+ type: "text",
167
+ placeholder: "Search countries",
168
+ className: "phone-input-container-se-design-country-code-list-item-input",
169
+ onChange: oe,
170
+ value: Q,
171
+ "aria-label": "Search countries",
172
+ "data-automation-id": "country-code-search-input"
173
+ }))), w.length > 0 ? w.map((e, o) => {
174
+ const _ = te(o, e.dial_code === v);
175
+ return /* @__PURE__ */ t.createElement("div", c({
176
+ key: e.code
177
+ }, _, {
178
+ className: `phone-input-container-se-design-country-code-list-item ${ne === o ? "highlighted" : ""} ${e.dial_code === v ? "selected" : ""}`,
179
+ onClick: () => {
180
+ m.current = !0, I(e.dial_code);
181
+ },
182
+ onMouseEnter: () => q(o)
183
+ }), /* @__PURE__ */ t.createElement("img", {
184
+ src: `https://flagcdn.com/${e.code.toLowerCase()}.svg`,
185
+ alt: "",
186
+ "aria-hidden": "true",
187
+ width: "16"
188
+ }), /* @__PURE__ */ t.createElement("span", null, e.name), /* @__PURE__ */ t.createElement("span", null, "(", e.dial_code, ")"));
189
+ }) : /* @__PURE__ */ t.createElement("div", {
190
+ className: "phone-input-container-se-design-country-code-list-item-no-results",
191
+ role: "status"
192
+ }, "No results found"))), r && /* @__PURE__ */ t.createElement("div", {
193
+ id: K,
194
+ className: "error-message",
195
+ role: "alert"
196
+ }, u));
37
197
  };
38
198
  export {
39
- m as CircularProgressBar
199
+ ye as PhoneInput
40
200
  };
41
201
  //# sourceMappingURL=index47.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index47.js","sources":["../src/components/CircularProgressBar/index.tsx"],"sourcesContent":["import React from 'react';\n\ninterface CircularProgressBarProps {\n progress: number;\n backgroundColor?: string;\n progressColor?: string;\n size?: number;\n strokeWidth?: number;\n}\n\nexport const CircularProgressBar = ({\n progress,\n backgroundColor = '#E8E8E8',\n progressColor = '#0066FF',\n size = 40,\n strokeWidth = 4\n}: CircularProgressBarProps) => {\n const radius = (size - strokeWidth) / 2;\n const circumference = radius * 2 * Math.PI;\n const strokeDashoffset = circumference - (progress / 100) * circumference;\n\n return (\n <svg width={size} height={size} style={{ transform: 'rotate(-90deg)' }}>\n {/* Background circle */}\n <circle cx={size / 2} cy={size / 2} r={radius} stroke={backgroundColor} strokeWidth={strokeWidth} fill=\"none\" />\n {/* Progress circle */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n stroke={progressColor}\n strokeWidth={strokeWidth}\n strokeDasharray={circumference}\n strokeDashoffset={strokeDashoffset}\n fill=\"none\"\n strokeLinecap=\"round\"\n style={{ transition: 'stroke-dashoffset 0.3s ease' }}\n />\n </svg>\n );\n};\n"],"names":["CircularProgressBar","progress","backgroundColor","progressColor","size","strokeWidth","radius","circumference","Math","PI","strokeDashoffset","React","createElement","width","height","style","transform","cx","cy","r","stroke","fill","strokeDasharray","strokeLinecap","transition"],"mappings":";AAUO,MAAMA,IAAsBA,CAAC;AAAA,EAClCC,UAAAA;AAAAA,EACAC,iBAAAA,IAAkB;AAAA,EAClBC,eAAAA,IAAgB;AAAA,EAChBC,MAAAA,IAAO;AAAA,EACPC,aAAAA,IAAc;AACU,MAAM;AAC9B,QAAMC,KAAUF,IAAOC,KAAe,GAChCE,IAAgBD,IAAS,IAAIE,KAAKC,IAClCC,IAAmBH,IAAiBN,IAAW,MAAOM;AAE5D,SACEI,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,OAAOT;AAAAA,IAAMU,QAAQV;AAAAA,IAAMW,OAAO;AAAA,MAAEC,WAAW;AAAA,IAAA;AAAA,EAAiB,GAEnEL,gBAAAA,EAAAC,cAAA,UAAA;AAAA,IAAQK,IAAIb,IAAO;AAAA,IAAGc,IAAId,IAAO;AAAA,IAAGe,GAAGb;AAAAA,IAAQc,QAAQlB;AAAAA,IAAiBG,aAAAA;AAAAA,IAA0BgB,MAAK;AAAA,EAAA,CAAQ,GAE/GV,gBAAAA,EAAAC,cAAA,UAAA;AAAA,IACEK,IAAIb,IAAO;AAAA,IACXc,IAAId,IAAO;AAAA,IACXe,GAAGb;AAAAA,IACHc,QAAQjB;AAAAA,IACRE,aAAAA;AAAAA,IACAiB,iBAAiBf;AAAAA,IACjBG,kBAAAA;AAAAA,IACAW,MAAK;AAAA,IACLE,eAAc;AAAA,IACdR,OAAO;AAAA,MAAES,YAAY;AAAA,IAAA;AAAA,EAA8B,CACpD,CACE;AAET;"}
1
+ {"version":3,"file":"index47.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,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,GACjD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,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/index48.js CHANGED
@@ -1,39 +1,41 @@
1
- import m from "react";
2
- const a = ["var(--color-green-500)", "var(--color-blue-500)", "var(--color-purple-600)", "var(--color-red-400)", "var(--color-yellow-600)"], h = ({
3
- size: r = 40,
4
- text: l,
5
- textColor: i = "var(--color-white)",
6
- backgroundColor: t = "",
7
- className: n = "",
8
- onClick: e,
9
- automationId: c = "",
10
- ariaLabel: o
1
+ import o from "react";
2
+ const m = ({
3
+ progress: a,
4
+ backgroundColor: n = "#E8E8E8",
5
+ progressColor: s = "#0066FF",
6
+ size: e = 40,
7
+ strokeWidth: r = 4
11
8
  }) => {
12
- const d = l?.split(" ")?.map((s) => s[0])?.join("")?.toUpperCase()?.slice(0, 2), u = () => t || a[Math.floor(Math.random() * a.length)];
13
- return /* @__PURE__ */ m.createElement("div", {
14
- className: `
15
- se-design-avatar
16
- flex items-center justify-center
17
- rounded-full font-medium
18
- ${e ? "cursor-pointer" : "cursor-default"}
19
- ${n}
20
- `,
21
- onClick: e,
22
- "data-automation-id": c,
23
- "aria-hidden": o ? void 0 : !0,
24
- "aria-label": o,
9
+ const t = (e - r) / 2, c = t * 2 * Math.PI, l = c - a / 100 * c;
10
+ return /* @__PURE__ */ o.createElement("svg", {
11
+ width: e,
12
+ height: e,
25
13
  style: {
26
- width: r,
27
- height: r,
28
- minWidth: 20,
29
- minHeight: 20,
30
- backgroundColor: u(),
31
- color: i,
32
- fontSize: `${r * 0.4}px`
14
+ transform: "rotate(-90deg)"
33
15
  }
34
- }, d);
16
+ }, /* @__PURE__ */ o.createElement("circle", {
17
+ cx: e / 2,
18
+ cy: e / 2,
19
+ r: t,
20
+ stroke: n,
21
+ strokeWidth: r,
22
+ fill: "none"
23
+ }), /* @__PURE__ */ o.createElement("circle", {
24
+ cx: e / 2,
25
+ cy: e / 2,
26
+ r: t,
27
+ stroke: s,
28
+ strokeWidth: r,
29
+ strokeDasharray: c,
30
+ strokeDashoffset: l,
31
+ fill: "none",
32
+ strokeLinecap: "round",
33
+ style: {
34
+ transition: "stroke-dashoffset 0.3s ease"
35
+ }
36
+ }));
35
37
  };
36
38
  export {
37
- h as Avatar
39
+ m as CircularProgressBar
38
40
  };
39
41
  //# sourceMappingURL=index48.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index48.js","sources":["../src/components/Avatar/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nexport type AvatarProps = {\n size?: number;\n text: string;\n textColor?: string;\n backgroundColor?: string;\n className?: string;\n onClick?: () => void;\n automationId?: string;\n ariaLabel?: string;\n};\n\nconst AVATAR_COLORS = [\n 'var(--color-green-500)',\n 'var(--color-blue-500)',\n 'var(--color-purple-600)',\n 'var(--color-red-400)',\n 'var(--color-yellow-600)'\n];\n\nexport const Avatar: FC<AvatarProps> = ({\n size = 40,\n text,\n textColor = 'var(--color-white)',\n backgroundColor = '',\n className = '',\n onClick,\n automationId = '',\n ariaLabel\n}) => {\n const initials = text\n ?.split(' ')\n ?.map((word) => word[0])\n ?.join('')\n ?.toUpperCase()\n ?.slice(0, 2);\n\n const getBackgroundColor = () => {\n if (backgroundColor) {\n return backgroundColor;\n }\n return AVATAR_COLORS[Math.floor(Math.random() * AVATAR_COLORS.length)];\n };\n\n return (\n <div\n className={`\n se-design-avatar \n flex items-center justify-center \n rounded-full font-medium\n ${onClick ? 'cursor-pointer' : 'cursor-default'}\n ${className}\n `}\n onClick={onClick}\n data-automation-id={automationId}\n aria-hidden={ariaLabel ? undefined : true}\n aria-label={ariaLabel}\n style={{\n width: size,\n height: size,\n minWidth: 20,\n minHeight: 20,\n backgroundColor: getBackgroundColor(),\n color: textColor,\n fontSize: `${size * 0.4}px`\n }}\n >\n {initials}\n </div>\n );\n};\n"],"names":["React__default","AVATAR_COLORS","Avatar","size","text","textColor","backgroundColor","className","onClick","automationId","ariaLabel","initials","split","map","word","join","toUpperCase","slice","getBackgroundColor","Math","floor","random","length","React","createElement","undefined","style","width","height","minWidth","minHeight","color","fontSize"],"mappings":"AAaA,OAAAA,OAAA;AAAA,MAAMC,IAAgB,CACpB,0BACA,yBACA,2BACA,wBACA,yBAAyB,GAGdC,IAA0BA,CAAC;AAAA,EACtCC,MAAAA,IAAO;AAAA,EACPC,MAAAA;AAAAA,EACAC,WAAAA,IAAY;AAAA,EACZC,iBAAAA,IAAkB;AAAA,EAClBC,WAAAA,IAAY;AAAA,EACZC,SAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AACF,MAAM;AACJ,QAAMC,IAAWP,GACbQ,MAAM,GAAG,GACTC,IAAKC,OAASA,EAAK,CAAC,CAAC,GACrBC,KAAK,EAAE,GACPC,eACAC,MAAM,GAAG,CAAC,GAERC,IAAqBA,MACrBZ,KAGGL,EAAckB,KAAKC,MAAMD,KAAKE,WAAWpB,EAAcqB,MAAM,CAAC;AAGvE,SACEC,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IACEjB,WAAW;AAAA;AAAA;AAAA;AAAA,UAIPC,IAAU,mBAAmB,gBAAgB;AAAA,UAC7CD,CAAS;AAAA;AAAA,IAEbC,SAAAA;AAAAA,IACA,sBAAoBC;AAAAA,IACpB,eAAaC,IAAYe,SAAY;AAAA,IACrC,cAAYf;AAAAA,IACZgB,OAAO;AAAA,MACLC,OAAOxB;AAAAA,MACPyB,QAAQzB;AAAAA,MACR0B,UAAU;AAAA,MACVC,WAAW;AAAA,MACXxB,iBAAiBY,EAAAA;AAAAA,MACjBa,OAAO1B;AAAAA,MACP2B,UAAU,GAAG7B,IAAO,GAAG;AAAA,IAAA;AAAA,EACzB,GAECQ,CACE;AAET;"}
1
+ {"version":3,"file":"index48.js","sources":["../src/components/CircularProgressBar/index.tsx"],"sourcesContent":["import React from 'react';\n\ninterface CircularProgressBarProps {\n progress: number;\n backgroundColor?: string;\n progressColor?: string;\n size?: number;\n strokeWidth?: number;\n}\n\nexport const CircularProgressBar = ({\n progress,\n backgroundColor = '#E8E8E8',\n progressColor = '#0066FF',\n size = 40,\n strokeWidth = 4\n}: CircularProgressBarProps) => {\n const radius = (size - strokeWidth) / 2;\n const circumference = radius * 2 * Math.PI;\n const strokeDashoffset = circumference - (progress / 100) * circumference;\n\n return (\n <svg width={size} height={size} style={{ transform: 'rotate(-90deg)' }}>\n {/* Background circle */}\n <circle cx={size / 2} cy={size / 2} r={radius} stroke={backgroundColor} strokeWidth={strokeWidth} fill=\"none\" />\n {/* Progress circle */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n stroke={progressColor}\n strokeWidth={strokeWidth}\n strokeDasharray={circumference}\n strokeDashoffset={strokeDashoffset}\n fill=\"none\"\n strokeLinecap=\"round\"\n style={{ transition: 'stroke-dashoffset 0.3s ease' }}\n />\n </svg>\n );\n};\n"],"names":["CircularProgressBar","progress","backgroundColor","progressColor","size","strokeWidth","radius","circumference","Math","PI","strokeDashoffset","React","createElement","width","height","style","transform","cx","cy","r","stroke","fill","strokeDasharray","strokeLinecap","transition"],"mappings":";AAUO,MAAMA,IAAsBA,CAAC;AAAA,EAClCC,UAAAA;AAAAA,EACAC,iBAAAA,IAAkB;AAAA,EAClBC,eAAAA,IAAgB;AAAA,EAChBC,MAAAA,IAAO;AAAA,EACPC,aAAAA,IAAc;AACU,MAAM;AAC9B,QAAMC,KAAUF,IAAOC,KAAe,GAChCE,IAAgBD,IAAS,IAAIE,KAAKC,IAClCC,IAAmBH,IAAiBN,IAAW,MAAOM;AAE5D,SACEI,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,OAAOT;AAAAA,IAAMU,QAAQV;AAAAA,IAAMW,OAAO;AAAA,MAAEC,WAAW;AAAA,IAAA;AAAA,EAAiB,GAEnEL,gBAAAA,EAAAC,cAAA,UAAA;AAAA,IAAQK,IAAIb,IAAO;AAAA,IAAGc,IAAId,IAAO;AAAA,IAAGe,GAAGb;AAAAA,IAAQc,QAAQlB;AAAAA,IAAiBG,aAAAA;AAAAA,IAA0BgB,MAAK;AAAA,EAAA,CAAQ,GAE/GV,gBAAAA,EAAAC,cAAA,UAAA;AAAA,IACEK,IAAIb,IAAO;AAAA,IACXc,IAAId,IAAO;AAAA,IACXe,GAAGb;AAAAA,IACHc,QAAQjB;AAAAA,IACRE,aAAAA;AAAAA,IACAiB,iBAAiBf;AAAAA,IACjBG,kBAAAA;AAAAA,IACAW,MAAK;AAAA,IACLE,eAAc;AAAA,IACdR,OAAO;AAAA,MAAES,YAAY;AAAA,IAAA;AAAA,EAA8B,CACpD,CACE;AAET;"}