se-design 1.0.82 → 1.0.83-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/dist/assets/icons/chat.svg +4 -0
  2. package/dist/assets/icons/tag.svg +2 -2
  3. package/dist/assets/style.css +1 -1
  4. package/dist/components/AccessibleDiv/index.d.ts +23 -1
  5. package/dist/components/Dropdown/index.d.ts +2 -0
  6. package/dist/components/DropdownWithInputTags/index.d.ts +3 -0
  7. package/dist/components/Link/index.d.ts +6 -2
  8. package/dist/index.js +62 -54
  9. package/dist/index.js.map +1 -1
  10. package/dist/index100.js +1 -1
  11. package/dist/index100.js.map +1 -1
  12. package/dist/index101.js +1 -1
  13. package/dist/index101.js.map +1 -1
  14. package/dist/index102.js +1 -1
  15. package/dist/index102.js.map +1 -1
  16. package/dist/index103.js +1 -1
  17. package/dist/index103.js.map +1 -1
  18. package/dist/index104.js +1 -1
  19. package/dist/index104.js.map +1 -1
  20. package/dist/index105.js +1 -1
  21. package/dist/index105.js.map +1 -1
  22. package/dist/index106.js +1 -1
  23. package/dist/index106.js.map +1 -1
  24. package/dist/index107.js +1 -1
  25. package/dist/index107.js.map +1 -1
  26. package/dist/index108.js +1 -1
  27. package/dist/index108.js.map +1 -1
  28. package/dist/index109.js +2 -2
  29. package/dist/index109.js.map +1 -1
  30. package/dist/index110.js +2 -2
  31. package/dist/index110.js.map +1 -1
  32. package/dist/index111.js +1 -1
  33. package/dist/index111.js.map +1 -1
  34. package/dist/index112.js +1 -1
  35. package/dist/index112.js.map +1 -1
  36. package/dist/index113.js +2 -2
  37. package/dist/index113.js.map +1 -1
  38. package/dist/index114.js +1 -1
  39. package/dist/index114.js.map +1 -1
  40. package/dist/index115.js +2 -2
  41. package/dist/index115.js.map +1 -1
  42. package/dist/index116.js +1 -1
  43. package/dist/index116.js.map +1 -1
  44. package/dist/index117.js +1 -1
  45. package/dist/index117.js.map +1 -1
  46. package/dist/index118.js +2 -2
  47. package/dist/index118.js.map +1 -1
  48. package/dist/index119.js +2 -2
  49. package/dist/index119.js.map +1 -1
  50. package/dist/index12.js +2 -2
  51. package/dist/index120.js +1 -1
  52. package/dist/index120.js.map +1 -1
  53. package/dist/index121.js +2 -2
  54. package/dist/index121.js.map +1 -1
  55. package/dist/index122.js +2 -2
  56. package/dist/index122.js.map +1 -1
  57. package/dist/index123.js +2 -2
  58. package/dist/index123.js.map +1 -1
  59. package/dist/index124.js +1 -1
  60. package/dist/index124.js.map +1 -1
  61. package/dist/index125.js +2 -2
  62. package/dist/index125.js.map +1 -1
  63. package/dist/index126.js +2 -2
  64. package/dist/index126.js.map +1 -1
  65. package/dist/index127.js +2 -2
  66. package/dist/index127.js.map +1 -1
  67. package/dist/index128.js +1 -1
  68. package/dist/index128.js.map +1 -1
  69. package/dist/index129.js +1 -1
  70. package/dist/index129.js.map +1 -1
  71. package/dist/index13.js +1 -1
  72. package/dist/index130.js +2 -2
  73. package/dist/index130.js.map +1 -1
  74. package/dist/index131.js +2 -2
  75. package/dist/index131.js.map +1 -1
  76. package/dist/index132.js +2 -2
  77. package/dist/index132.js.map +1 -1
  78. package/dist/index133.js +1 -1
  79. package/dist/index133.js.map +1 -1
  80. package/dist/index134.js +1 -1
  81. package/dist/index134.js.map +1 -1
  82. package/dist/index135.js +2 -2
  83. package/dist/index135.js.map +1 -1
  84. package/dist/index136.js +2 -2
  85. package/dist/index136.js.map +1 -1
  86. package/dist/index137.js +1 -1
  87. package/dist/index137.js.map +1 -1
  88. package/dist/index138.js +1 -1
  89. package/dist/index138.js.map +1 -1
  90. package/dist/index139.js +1 -1
  91. package/dist/index139.js.map +1 -1
  92. package/dist/index140.js +1 -1
  93. package/dist/index140.js.map +1 -1
  94. package/dist/index141.js +1 -1
  95. package/dist/index141.js.map +1 -1
  96. package/dist/index142.js +2 -2
  97. package/dist/index142.js.map +1 -1
  98. package/dist/index143.js +1 -1
  99. package/dist/index143.js.map +1 -1
  100. package/dist/index144.js +1 -1
  101. package/dist/index144.js.map +1 -1
  102. package/dist/index145.js +1 -1
  103. package/dist/index145.js.map +1 -1
  104. package/dist/index146.js +2 -2
  105. package/dist/index146.js.map +1 -1
  106. package/dist/index147.js +1 -1
  107. package/dist/index147.js.map +1 -1
  108. package/dist/index148.js +1 -1
  109. package/dist/index148.js.map +1 -1
  110. package/dist/index149.js +1 -1
  111. package/dist/index149.js.map +1 -1
  112. package/dist/index150.js +1 -1
  113. package/dist/index150.js.map +1 -1
  114. package/dist/index151.js +2 -2
  115. package/dist/index151.js.map +1 -1
  116. package/dist/index152.js +2 -2
  117. package/dist/index152.js.map +1 -1
  118. package/dist/index153.js +1 -1
  119. package/dist/index153.js.map +1 -1
  120. package/dist/index154.js +2 -2
  121. package/dist/index154.js.map +1 -1
  122. package/dist/index155.js +1 -1
  123. package/dist/index155.js.map +1 -1
  124. package/dist/index156.js +2 -2
  125. package/dist/index156.js.map +1 -1
  126. package/dist/index157.js +1 -1
  127. package/dist/index157.js.map +1 -1
  128. package/dist/index158.js +2 -2
  129. package/dist/index158.js.map +1 -1
  130. package/dist/index159.js +2 -2
  131. package/dist/index159.js.map +1 -1
  132. package/dist/index16.js +25 -23
  133. package/dist/index16.js.map +1 -1
  134. package/dist/index160.js +1 -1
  135. package/dist/index160.js.map +1 -1
  136. package/dist/index161.js +1 -1
  137. package/dist/index161.js.map +1 -1
  138. package/dist/index162.js +1 -1
  139. package/dist/index162.js.map +1 -1
  140. package/dist/index163.js +1 -1
  141. package/dist/index163.js.map +1 -1
  142. package/dist/index164.js +1 -1
  143. package/dist/index164.js.map +1 -1
  144. package/dist/index165.js +1 -1
  145. package/dist/index165.js.map +1 -1
  146. package/dist/index166.js +1 -1
  147. package/dist/index166.js.map +1 -1
  148. package/dist/index167.js +1 -1
  149. package/dist/index167.js.map +1 -1
  150. package/dist/index168.js +1 -1
  151. package/dist/index168.js.map +1 -1
  152. package/dist/index169.js +1 -1
  153. package/dist/index169.js.map +1 -1
  154. package/dist/index17.js +29 -29
  155. package/dist/index17.js.map +1 -1
  156. package/dist/index170.js +1 -1
  157. package/dist/index170.js.map +1 -1
  158. package/dist/index171.js +1 -1
  159. package/dist/index171.js.map +1 -1
  160. package/dist/index172.js +1 -1
  161. package/dist/index172.js.map +1 -1
  162. package/dist/index173.js +1 -1
  163. package/dist/index173.js.map +1 -1
  164. package/dist/index174.js +1 -1
  165. package/dist/index174.js.map +1 -1
  166. package/dist/index175.js +1 -1
  167. package/dist/index175.js.map +1 -1
  168. package/dist/index176.js +1 -1
  169. package/dist/index176.js.map +1 -1
  170. package/dist/index177.js +1 -1
  171. package/dist/index177.js.map +1 -1
  172. package/dist/index178.js +1 -1
  173. package/dist/index178.js.map +1 -1
  174. package/dist/index179.js +1 -1
  175. package/dist/index179.js.map +1 -1
  176. package/dist/index18.js +85 -63
  177. package/dist/index18.js.map +1 -1
  178. package/dist/index180.js +1 -1
  179. package/dist/index180.js.map +1 -1
  180. package/dist/index181.js +2 -2
  181. package/dist/index181.js.map +1 -1
  182. package/dist/index182.js +1 -1
  183. package/dist/index182.js.map +1 -1
  184. package/dist/index183.js +1 -1
  185. package/dist/index183.js.map +1 -1
  186. package/dist/index184.js +1 -1
  187. package/dist/index184.js.map +1 -1
  188. package/dist/index185.js +2 -2
  189. package/dist/index185.js.map +1 -1
  190. package/dist/index186.js +1 -1
  191. package/dist/index186.js.map +1 -1
  192. package/dist/index187.js +1 -1
  193. package/dist/index187.js.map +1 -1
  194. package/dist/index188.js +1 -1
  195. package/dist/index188.js.map +1 -1
  196. package/dist/index189.js +2 -2
  197. package/dist/index189.js.map +1 -1
  198. package/dist/index19.js +181 -166
  199. package/dist/index19.js.map +1 -1
  200. package/dist/index190.js +1 -1
  201. package/dist/index190.js.map +1 -1
  202. package/dist/index191.js +1 -1
  203. package/dist/index191.js.map +1 -1
  204. package/dist/index192.js +1 -1
  205. package/dist/index192.js.map +1 -1
  206. package/dist/index193.js +1 -1
  207. package/dist/index193.js.map +1 -1
  208. package/dist/index194.js +1 -1
  209. package/dist/index194.js.map +1 -1
  210. package/dist/index195.js +1 -1
  211. package/dist/index195.js.map +1 -1
  212. package/dist/index196.js +2 -2
  213. package/dist/index196.js.map +1 -1
  214. package/dist/index197.js +1 -1
  215. package/dist/index197.js.map +1 -1
  216. package/dist/index198.js +2 -2
  217. package/dist/index198.js.map +1 -1
  218. package/dist/index199.js +2 -149
  219. package/dist/index199.js.map +1 -1
  220. package/dist/index200.js +2 -9
  221. package/dist/index200.js.map +1 -1
  222. package/dist/index201.js +2 -6
  223. package/dist/index201.js.map +1 -1
  224. package/dist/index202.js +2 -5
  225. package/dist/index202.js.map +1 -1
  226. package/dist/index203.js +149 -42
  227. package/dist/index203.js.map +1 -1
  228. package/dist/index204.js +8 -20
  229. package/dist/index204.js.map +1 -1
  230. package/dist/index205.js +9 -0
  231. package/dist/index205.js.map +1 -0
  232. package/dist/index206.js +8 -0
  233. package/dist/index206.js.map +1 -0
  234. package/dist/index207.js +45 -0
  235. package/dist/index207.js.map +1 -0
  236. package/dist/index208.js +24 -0
  237. package/dist/index208.js.map +1 -0
  238. package/dist/{index211.js → index215.js} +1 -1
  239. package/dist/{index211.js.map → index215.js.map} +1 -1
  240. package/dist/{index212.js → index216.js} +13 -9
  241. package/dist/index216.js.map +1 -0
  242. package/dist/{index220.js → index224.js} +1 -1
  243. package/dist/{index220.js.map → index224.js.map} +1 -1
  244. package/dist/index23.js +3 -3
  245. package/dist/{index228.js → index232.js} +1 -1
  246. package/dist/{index228.js.map → index232.js.map} +1 -1
  247. package/dist/{index231.js → index235.js} +1 -1
  248. package/dist/{index231.js.map → index235.js.map} +1 -1
  249. package/dist/index244.js +168 -8
  250. package/dist/index244.js.map +1 -1
  251. package/dist/index245.js +3 -9
  252. package/dist/index245.js.map +1 -1
  253. package/dist/index247.js +18 -169
  254. package/dist/index247.js.map +1 -1
  255. package/dist/index248.js +10 -11
  256. package/dist/index248.js.map +1 -1
  257. package/dist/index249.js +8 -4
  258. package/dist/index249.js.map +1 -1
  259. package/dist/index25.js +175 -161
  260. package/dist/index25.js.map +1 -1
  261. package/dist/index250.js +4 -5
  262. package/dist/index250.js.map +1 -1
  263. package/dist/index251.js +168 -36
  264. package/dist/index251.js.map +1 -1
  265. package/dist/index252.js +11 -2
  266. package/dist/index252.js.map +1 -1
  267. package/dist/index253.js +5 -7
  268. package/dist/index253.js.map +1 -1
  269. package/dist/index254.js +5 -326
  270. package/dist/index254.js.map +1 -1
  271. package/dist/index255.js +36 -48
  272. package/dist/index255.js.map +1 -1
  273. package/dist/index256.js +2 -2
  274. package/dist/index257.js +7 -75
  275. package/dist/index257.js.map +1 -1
  276. package/dist/index258.js +308 -74
  277. package/dist/index258.js.map +1 -1
  278. package/dist/index259.js +45 -47
  279. package/dist/index259.js.map +1 -1
  280. package/dist/index260.js +2 -8
  281. package/dist/index260.js.map +1 -1
  282. package/dist/index261.js +75 -4
  283. package/dist/index261.js.map +1 -1
  284. package/dist/index262.js +89 -48
  285. package/dist/index262.js.map +1 -1
  286. package/dist/index263.js +52 -2
  287. package/dist/index263.js.map +1 -1
  288. package/dist/index264.js +8 -2
  289. package/dist/index264.js.map +1 -1
  290. package/dist/index265.js +8 -0
  291. package/dist/index265.js.map +1 -0
  292. package/dist/index266.js +55 -0
  293. package/dist/index266.js.map +1 -0
  294. package/dist/index267.js +5 -0
  295. package/dist/index267.js.map +1 -0
  296. package/dist/index268.js +5 -0
  297. package/dist/index268.js.map +1 -0
  298. package/dist/index28.js +5 -5
  299. package/dist/index28.js.map +1 -1
  300. package/dist/index29.js +1 -1
  301. package/dist/index3.js +59 -49
  302. package/dist/index3.js.map +1 -1
  303. package/dist/index30.js +1 -1
  304. package/dist/index33.js +1 -1
  305. package/dist/index35.js +1 -1
  306. package/dist/index36.js +2 -2
  307. package/dist/index38.js +209 -194
  308. package/dist/index38.js.map +1 -1
  309. package/dist/index39.js +3 -3
  310. package/dist/index4.js +1 -1
  311. package/dist/index40.js +1 -1
  312. package/dist/index43.js +16 -16
  313. package/dist/index43.js.map +1 -1
  314. package/dist/index45.js +60 -59
  315. package/dist/index45.js.map +1 -1
  316. package/dist/index46.js +3 -3
  317. package/dist/index49.js +1 -1
  318. package/dist/index51.js +1 -1
  319. package/dist/index52.js +2 -2
  320. package/dist/index53.js +1 -1
  321. package/dist/index55.js +2 -2
  322. package/dist/index55.js.map +1 -1
  323. package/dist/index57.js +1 -1
  324. package/dist/index6.js +238 -236
  325. package/dist/index6.js.map +1 -1
  326. package/dist/index61.js +9 -8
  327. package/dist/index61.js.map +1 -1
  328. package/dist/index63.js +1 -1
  329. package/dist/index64.js +35 -34
  330. package/dist/index64.js.map +1 -1
  331. package/dist/index65.js +1 -1
  332. package/dist/index67.js +1 -1
  333. package/dist/index68.js +80 -58
  334. package/dist/index68.js.map +1 -1
  335. package/dist/index7.js +1 -1
  336. package/dist/index70.js +1 -1
  337. package/dist/index75.js +108 -5
  338. package/dist/index75.js.map +1 -1
  339. package/dist/index76.js +18 -54
  340. package/dist/index76.js.map +1 -1
  341. package/dist/index77.js +10 -23
  342. package/dist/index77.js.map +1 -1
  343. package/dist/index78.js +5 -9
  344. package/dist/index78.js.map +1 -1
  345. package/dist/index79.js +62 -0
  346. package/dist/index79.js.map +1 -0
  347. package/dist/index80.js +24 -2
  348. package/dist/index80.js.map +1 -1
  349. package/dist/index81.js +9 -2
  350. package/dist/index81.js.map +1 -1
  351. package/dist/index83.js +1 -1
  352. package/dist/index83.js.map +1 -1
  353. package/dist/index84.js +2 -2
  354. package/dist/index84.js.map +1 -1
  355. package/dist/index85.js +1 -1
  356. package/dist/index85.js.map +1 -1
  357. package/dist/index86.js +2 -2
  358. package/dist/index86.js.map +1 -1
  359. package/dist/index87.js +1 -1
  360. package/dist/index87.js.map +1 -1
  361. package/dist/index88.js +1 -1
  362. package/dist/index88.js.map +1 -1
  363. package/dist/index89.js +1 -1
  364. package/dist/index89.js.map +1 -1
  365. package/dist/index9.js +3 -3
  366. package/dist/index90.js +1 -1
  367. package/dist/index90.js.map +1 -1
  368. package/dist/index91.js +1 -1
  369. package/dist/index91.js.map +1 -1
  370. package/dist/index92.js +1 -1
  371. package/dist/index92.js.map +1 -1
  372. package/dist/index93.js +1 -1
  373. package/dist/index93.js.map +1 -1
  374. package/dist/index94.js +1 -1
  375. package/dist/index94.js.map +1 -1
  376. package/dist/index95.js +1 -1
  377. package/dist/index95.js.map +1 -1
  378. package/dist/index96.js +1 -1
  379. package/dist/index96.js.map +1 -1
  380. package/dist/index97.js +1 -1
  381. package/dist/index97.js.map +1 -1
  382. package/dist/index98.js +1 -1
  383. package/dist/index98.js.map +1 -1
  384. package/dist/index99.js +1 -1
  385. package/dist/index99.js.map +1 -1
  386. package/package.json +1 -1
  387. package/dist/index212.js.map +0 -1
  388. package/dist/index240.js +0 -173
  389. package/dist/index240.js.map +0 -1
  390. package/dist/index241.js +0 -7
  391. package/dist/index241.js.map +0 -1
  392. package/dist/index243.js +0 -22
  393. package/dist/index243.js.map +0 -1
  394. package/dist/index246.js +0 -8
  395. package/dist/index246.js.map +0 -1
  396. package/dist/index82.js +0 -5
  397. package/dist/index82.js.map +0 -1
package/dist/index38.js CHANGED
@@ -1,288 +1,303 @@
1
- import a, { forwardRef as de, useState as I, useRef as V, useCallback as H, useEffect as B, useImperativeHandle as ve } from "react";
2
- import { Popover as we } from "./index19.js";
3
- import { Icon as Ee } from "./index6.js";
4
- import { Checkbox as ke } from "./index23.js";
5
- import { Button as G } from "./index4.js";
1
+ import a, { forwardRef as Ee, useState as _, useRef as L, useCallback as F, useEffect as J, useImperativeHandle as ye } from "react";
2
+ import { Popover as Ce } from "./index19.js";
3
+ import { Icon as Pe } from "./index6.js";
4
+ import { Checkbox as Se } from "./index23.js";
5
+ import { Button as Q } from "./index4.js";
6
+ import { getA11yNameAttributes as Ne } from "./index81.js";
6
7
  import "./index72.js";
7
- import { useCombobox as be } from "./index68.js";
8
- import { useStableId as Ce } from "./index201.js";
8
+ import { useCombobox as $e } from "./index68.js";
9
+ import { useStableId as De } from "./index205.js";
9
10
  /* empty css */
10
- function g() {
11
- return g = Object.assign ? Object.assign.bind() : function(v) {
11
+ function f() {
12
+ return f = Object.assign ? Object.assign.bind() : function(h) {
12
13
  for (var i = 1; i < arguments.length; i++) {
13
- var E = arguments[i];
14
- for (var k in E) ({}).hasOwnProperty.call(E, k) && (v[k] = E[k]);
14
+ var w = arguments[i];
15
+ for (var b in w) ({}).hasOwnProperty.call(w, b) && (h[b] = w[b]);
15
16
  }
16
- return v;
17
- }, g.apply(null, arguments);
17
+ return h;
18
+ }, f.apply(null, arguments);
18
19
  }
19
- const _e = /* @__PURE__ */ de(({
20
- value: v,
20
+ const Le = /* @__PURE__ */ Ee(({
21
+ value: h,
21
22
  onChange: i,
22
- placeholder: E = "Type to search or add custom tags...",
23
- className: k = "",
24
- options: h = [],
25
- renderOption: L,
26
- label: _,
23
+ placeholder: w = "Type to search or add custom tags...",
24
+ className: b = "",
25
+ options: g = [],
26
+ renderOption: W,
27
+ label: R,
28
+ ariaLabel: X,
29
+ ariaLabelledBy: Y,
30
+ ariaDescribedBy: Z,
27
31
  automationId: u = "",
28
- noOptionsMessage: q = "No options found",
29
- allowCustomTags: F = !0,
32
+ noOptionsMessage: ee = "No options found",
33
+ allowCustomTags: x = !0,
30
34
  disabled: l = !1,
31
- type: W = "select",
32
- showInput: J = !0,
33
- displayTagBy: K = "label",
34
- isWithPortal: Q = !1
35
- }, X) => {
36
- const j = (t) => t.map((e) => {
37
- const n = h.find((o) => o.value === e);
35
+ type: H = "select",
36
+ showInput: j = !0,
37
+ displayTagBy: z = "label",
38
+ isWithPortal: te = !1
39
+ }, ne) => {
40
+ const U = (e) => e.map((t) => {
41
+ const n = g.find((s) => s.value === t);
38
42
  return n ? {
39
43
  label: n.label,
40
44
  value: n.value
41
45
  } : {
42
- label: e,
43
- value: e
46
+ label: t,
47
+ value: t
44
48
  };
45
- }), [r, p] = I(() => j(v || [])), [s, S] = I(""), [A, Y] = I(h), [f, c] = I(!1), Z = V(null), x = V(null), R = V(!1), b = W === "multi-select-without-cta", d = W === "multi-select" || b, ee = Ce(u, "dropdown-input-tags-listbox"), N = H((t) => {
49
+ }), [r, m] = _(() => U(h || [])), [o, k] = _(""), [K, ae] = _(g), [d, c] = _(!1), le = L(null), P = L(null), S = L(!1), E = H === "multi-select-without-cta", p = H === "multi-select" || E, re = De(u, "dropdown-input-tags-listbox"), N = F((e) => {
46
50
  if (l) return;
47
- const e = [...r];
48
- e.some((n) => n.value === t.value) || (e.push({
49
- label: t.label,
50
- value: t.value
51
- }), p(e), i?.(e.map((n) => n.value))), S(""), c(!1);
52
- }, [l, r, i]), D = H((t, e) => {
53
- let n = [];
54
- t ? n = [...r, {
51
+ const t = [...r];
52
+ t.some((n) => n.value === e.value) || (t.push({
55
53
  label: e.label,
56
54
  value: e.value
57
- }] : n = r.filter((o) => o.value !== e.value), p(n), b && i?.(n.map((o) => o.value));
58
- }, [r, b, i]), y = "__add_custom_tag__", z = H((t) => {
55
+ }), m(t), i?.(t.map((n) => n.value))), k(""), c(!1);
56
+ }, [l, r, i]), M = F((e, t) => {
57
+ let n = [];
58
+ e ? n = [...r, {
59
+ label: t.label,
60
+ value: t.value
61
+ }] : n = r.filter((s) => s.value !== t.value), m(n), k(""), E && (S.current = !0, i?.(n.map((s) => s.value)));
62
+ }, [r, E, i]), $ = "__add_custom_tag__", B = F((e) => {
59
63
  if (!l) {
60
- if (t.value === y) {
61
- const e = s.trim();
62
- if (!e) return;
64
+ if (e.value === $) {
65
+ const t = o.trim();
66
+ if (!t) return;
63
67
  const n = [...r];
64
- n.some((o) => o.value === e) || (n.push({
65
- label: e,
66
- value: e
67
- }), p(n), i?.(n.map((o) => o.value))), S(""), c(!1);
68
+ n.some((s) => s.value === t) || (n.push({
69
+ label: t,
70
+ value: t
71
+ }), m(n), i?.(n.map((s) => s.value))), k(""), c(!1);
68
72
  return;
69
73
  }
70
- if (d) {
71
- const e = r.some((n) => n.value === t.value);
72
- D(!e, t);
74
+ if (p) {
75
+ const t = r.some((n) => n.value === e.value);
76
+ M(!t, e);
73
77
  } else
74
- N(t);
78
+ N(e);
75
79
  }
76
- }, [l, d, r, s, i, D, N]), $ = A.length > 0 ? A : F && s.trim() ? [{
77
- id: y,
78
- label: `Add "${s.trim()}"`,
79
- value: y
80
+ }, [l, p, r, o, i, M, N]), D = K.length > 0 ? K : x && o.trim() ? [{
81
+ id: $,
82
+ label: `Add "${o.trim()}"`,
83
+ value: $
80
84
  }] : [], {
81
- containerProps: te,
82
- inputProps: U,
83
- listboxProps: ne,
85
+ containerProps: oe,
86
+ inputProps: G,
87
+ listboxProps: se,
84
88
  getOptionProps: O,
85
89
  highlightedIndex: T,
86
- setHighlightedIndex: w
87
- } = be({
88
- items: $,
89
- isOpen: f,
90
+ setHighlightedIndex: v,
91
+ isKeyboardFocused: q
92
+ } = $e({
93
+ items: D,
94
+ isOpen: d,
90
95
  onOpenChange: c,
91
- onSelect: z,
92
- listboxId: ee,
93
- hasItems: $.length > 0
94
- });
95
- B(() => {
96
- if (R.current) {
97
- R.current = !1;
96
+ onSelect: B,
97
+ listboxId: re,
98
+ hasItems: D.length > 0,
99
+ keepHighlightOnSelect: p,
100
+ closeOnTab: H !== "multi-select"
101
+ }), A = (e) => e ? `highlighted${q ? " keyboard-highlight" : ""}` : "";
102
+ J(() => {
103
+ if (S.current) {
104
+ S.current = !1;
98
105
  return;
99
106
  }
100
- p(j(v || []));
101
- }, [v, h, f]), B(() => {
102
- const t = h.filter((e) => e.label.toLowerCase().includes(s.toLowerCase()) || e.value.toLowerCase().includes(s.toLowerCase()));
103
- Y(t);
104
- }, [s, h]);
105
- const ae = (t) => {
107
+ m(U(h || []));
108
+ }, [h, g, d]), J(() => {
109
+ const e = g.filter((t) => t.label.toLowerCase().includes(o.toLowerCase()) || t.value.toLowerCase().includes(o.toLowerCase()));
110
+ ae(e);
111
+ }, [o, g]);
112
+ const ie = (e) => {
106
113
  if (l) return;
107
- const e = r.filter((n, o) => o !== t);
108
- p(e), (!d || b || d && !f) && i?.(e.map((n) => n.value));
109
- }, le = (t) => {
114
+ const t = r.filter((n, s) => s !== e);
115
+ m(t), (!p || E || p && !d) && i?.(t.map((n) => n.value));
116
+ }, ce = (e) => {
110
117
  if (!l) {
111
- if (t.key === "Backspace" && s === "" && r.length > 0) {
112
- t.preventDefault();
113
- const e = r.slice(0, -1);
114
- p(e), i?.(e.map((n) => n.value));
118
+ if (e.key === "Backspace" && o === "" && r.length > 0) {
119
+ e.preventDefault();
120
+ const t = r.slice(0, -1);
121
+ m(t), i?.(t.map((n) => n.value));
115
122
  return;
116
123
  }
117
- if (t.key === "Enter" && s.trim() && A.length === 0 && F) {
118
- t.preventDefault();
119
- const e = [...r];
120
- e.some((n) => n.value === s.trim()) || (e.push({
121
- label: s.trim(),
122
- value: s.trim()
123
- }), p(e), i?.(e.map((n) => n.value))), S(""), w(-1), c(!1);
124
+ if (e.key === "Enter" && o.trim() && K.length === 0 && x) {
125
+ e.preventDefault();
126
+ const t = [...r];
127
+ t.some((n) => n.value === o.trim()) || (t.push({
128
+ label: o.trim(),
129
+ value: o.trim()
130
+ }), m(t), i?.(t.map((n) => n.value))), k(""), v(-1), c(!1);
124
131
  return;
125
132
  }
126
- U.onKeyDown(t);
133
+ G.onKeyDown(e);
127
134
  }
128
- }, re = (t) => {
135
+ }, ue = (e) => {
129
136
  if (l) return;
130
- const e = t.target.value;
131
- S(e), w(-1), e.trim() && !f && c(!0);
132
- }, oe = () => {
133
- l || (s.trim() || h.length > 0) && c(!0);
134
- }, se = (t) => {
135
- l || (t.stopPropagation(), x.current?.focus(), !f && (s.trim() || h.length > 0) && c(!0));
136
- }, ie = (t) => {
137
+ const t = e.target.value;
138
+ k(t), v(-1), t.trim() && !d && c(!0);
139
+ }, pe = () => {
140
+ l || (o.trim() || g.length > 0) && c(!0);
141
+ }, me = (e) => {
142
+ l || (e.stopPropagation(), P.current?.focus(), !d && (o.trim() || g.length > 0) && c(!0));
143
+ }, fe = (e) => {
137
144
  if (l) {
138
- t.preventDefault(), t.stopPropagation();
145
+ e.preventDefault(), e.stopPropagation();
139
146
  return;
140
147
  }
141
- t.target.closest(".input-with-tags-container") && t.stopPropagation();
142
- }, ce = () => {
143
- l || c(!f);
148
+ e.target.closest(".input-with-tags-container") && e.stopPropagation();
149
+ }, ge = () => {
150
+ l || c(!d);
144
151
  };
145
- ve(X, () => ({
146
- toggleDropdown: ce
152
+ ye(ne, () => ({
153
+ toggleDropdown: ge
147
154
  }), []);
148
- const ue = (t, e, n, o) => {
149
- const C = r.some((P) => P.value === t.value), m = T === e, M = O(e, C);
150
- return /* @__PURE__ */ a.createElement("div", g({
151
- key: t.id
152
- }, M, {
153
- className: `dropdown-with-input-tags-option ${m ? "highlighted" : ""}`,
154
- onClick: () => !o && n(t),
155
- onMouseEnter: () => w(e),
156
- "data-automation-id": `${u}-option-${t.id}`
155
+ const de = (e, t, n, s) => {
156
+ const y = r.some((C) => C.value === e.value), I = T === t, V = O(t, y);
157
+ return /* @__PURE__ */ a.createElement("div", f({
158
+ key: e.id
159
+ }, V, {
160
+ className: `dropdown-with-input-tags-option ${A(I)}`,
161
+ onClick: () => !s && n(e),
162
+ onMouseEnter: () => v(t),
163
+ "data-automation-id": `${u}-option-${e.id}`
157
164
  }), /* @__PURE__ */ a.createElement("span", {
158
165
  className: "option-label"
159
- }, t.label), t.value !== t.label && /* @__PURE__ */ a.createElement("span", {
166
+ }, e.label), e.value !== e.label && /* @__PURE__ */ a.createElement("span", {
160
167
  className: "option-value"
161
- }, t.value));
162
- }, pe = () => {
163
- R.current = !0;
164
- const t = r.map((e) => e.value);
165
- i?.(t), c(!1);
166
- }, me = () => {
167
- p([]);
168
- }, ge = (t, e) => {
169
- const n = r.some((m) => m.value === t.value), o = T === e, C = O(e, n);
170
- return /* @__PURE__ */ a.createElement("div", g({
171
- key: t.id
172
- }, C, {
173
- className: `dropdown-with-input-tags-option dropdown-with-input-tags-multi-select-option ${o ? "highlighted" : ""}`,
168
+ }, e.value));
169
+ }, he = () => {
170
+ S.current = !0;
171
+ const e = r.map((t) => t.value);
172
+ i?.(e), c(!1);
173
+ }, ve = () => {
174
+ m([]);
175
+ }, we = (e, t) => {
176
+ const n = r.some((I) => I.value === e.value), s = T === t, y = O(t, n);
177
+ return /* @__PURE__ */ a.createElement("div", f({
178
+ key: e.id
179
+ }, y, {
180
+ className: `dropdown-with-input-tags-option dropdown-with-input-tags-multi-select-option ${A(s)}`,
174
181
  "aria-checked": n,
175
- onClick: () => !l && D(!n, t),
176
- onMouseEnter: () => w(e),
177
- "data-automation-id": `${u}-option-${t.id}`
178
- }), /* @__PURE__ */ a.createElement("span", {
179
- onClick: (m) => m.stopPropagation()
180
- }, /* @__PURE__ */ a.createElement(ke, {
182
+ onClick: () => {
183
+ l || (M(!n, e), P.current?.focus());
184
+ },
185
+ onMouseEnter: () => v(t),
186
+ "data-automation-id": `${u}-option-${e.id}`
187
+ }), /* @__PURE__ */ a.createElement(Se, {
181
188
  automationId: "checkbox",
182
189
  className: "checkbox",
183
- defaultChecked: n,
184
- onChange: (m) => D(m, t),
185
- label: t.label
186
- })));
187
- }, he = () => /* @__PURE__ */ a.createElement("div", {
190
+ checked: n,
191
+ onChange: () => {
192
+ },
193
+ label: e.label,
194
+ tabIndex: -1
195
+ }));
196
+ }, be = () => /* @__PURE__ */ a.createElement("div", {
188
197
  className: "dropdown-with-input-tags-ctas-container"
189
- }, /* @__PURE__ */ a.createElement(G, {
198
+ }, /* @__PURE__ */ a.createElement(Q, {
190
199
  label: "Clear",
191
200
  type: "link",
192
201
  size: "sm",
193
- onClick: me,
202
+ onClick: ve,
194
203
  automationId: `${u}-clear-button`
195
- }), /* @__PURE__ */ a.createElement(G, {
204
+ }), /* @__PURE__ */ a.createElement(Q, {
196
205
  label: "Apply",
197
206
  type: "primary",
198
207
  size: "sm",
199
- onClick: pe,
208
+ onClick: he,
200
209
  automationId: `${u}-apply-button`
201
210
  }));
202
- return /* @__PURE__ */ a.createElement("div", g({
203
- className: `dropdown-with-input-tags-wrapper ${k} ${l ? "disabled-wrapper" : ""}`,
211
+ return /* @__PURE__ */ a.createElement("div", f({
212
+ className: `dropdown-with-input-tags-wrapper ${b} ${l ? "disabled-wrapper" : ""}`,
204
213
  "data-automation-id": u
205
- }, te), _ && /* @__PURE__ */ a.createElement("label", {
214
+ }, oe), R && /* @__PURE__ */ a.createElement("label", {
206
215
  id: `${u}-label`,
207
216
  className: "dropdown-with-input-tags-label"
208
- }, _), /* @__PURE__ */ a.createElement("div", {
209
- onClick: ie
210
- }, /* @__PURE__ */ a.createElement(we, {
211
- ref: Z,
217
+ }, R), /* @__PURE__ */ a.createElement("div", {
218
+ onClick: fe
219
+ }, /* @__PURE__ */ a.createElement(Ce, {
220
+ ref: le,
212
221
  className: "dropdown-with-input-tags-popover",
213
222
  contentWidth: "full",
214
223
  position: "bottom-left",
215
- isPopoverOpen: !l && f,
224
+ isPopoverOpen: !l && d,
216
225
  onPopoverToggle: l ? () => {
217
226
  } : c,
218
227
  disableClickToggle: !0,
219
- isWithPortal: Q,
228
+ isWithPortal: te,
220
229
  renderPopoverContents: ({
221
- closePopoverCb: t
222
- }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("div", g({}, ne, {
230
+ closePopoverCb: e
231
+ }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("div", f({}, se, {
223
232
  className: "dropdown-with-input-tags-content"
224
- }, d && {
233
+ }, p && {
225
234
  "aria-multiselectable": "true"
226
- }), $.length > 0 ? $.map((e, n) => {
227
- if (e.value === y) {
228
- const P = T === n, fe = O(n, !1);
229
- return /* @__PURE__ */ a.createElement("div", g({
230
- key: e.id
231
- }, fe, {
232
- className: `dropdown-with-input-tags-option dropdown-with-input-tags-custom-option ${P ? "highlighted" : ""}`,
235
+ }), D.length > 0 ? D.map((t, n) => {
236
+ if (t.value === $) {
237
+ const C = T === n, ke = O(n, !1);
238
+ return /* @__PURE__ */ a.createElement("div", f({
239
+ key: t.id
240
+ }, ke, {
241
+ className: `dropdown-with-input-tags-option dropdown-with-input-tags-custom-option ${A(C)}`,
233
242
  onClick: () => {
234
- l || (z(e), t());
243
+ l || (B(t), e());
235
244
  },
236
- onMouseEnter: () => w(n)
237
- }), 'Add "', s.trim(), '"');
245
+ onMouseEnter: () => v(n)
246
+ }), 'Add "', o.trim(), '"');
238
247
  }
239
- if (d)
240
- return ge(e, n);
241
- const o = r.some((P) => P.value === e.value), C = T === n, M = {
242
- ...O(n, o),
243
- onMouseEnter: () => w(n),
244
- className: `dropdown-with-input-tags-option ${C ? "highlighted" : ""}`
248
+ if (p)
249
+ return we(t, n);
250
+ const s = r.some((C) => C.value === t.value), y = T === n, V = {
251
+ ...O(n, s),
252
+ onMouseEnter: () => v(n),
253
+ className: `dropdown-with-input-tags-option ${A(y)}`
245
254
  };
246
- return L ? L(e, M, N) : ue(e, n, N, l);
255
+ return W ? W(t, V, N) : de(t, n, N, l);
247
256
  }) : /* @__PURE__ */ a.createElement("div", {
248
257
  className: "dropdown-with-input-tags-no-options"
249
258
  }, /* @__PURE__ */ a.createElement("div", {
250
259
  className: "dropdown-with-input-tags-no-options-text",
251
260
  role: "status",
252
261
  "aria-live": "polite"
253
- }, q))), d && !b && he()),
262
+ }, ee))), p && !E && be()),
254
263
  renderPopoverSrcElement: () => /* @__PURE__ */ a.createElement("div", {
255
264
  className: "dropdown-with-input-tags-input-container"
256
265
  }, /* @__PURE__ */ a.createElement("div", {
257
- className: `input-with-tags-container ${l ? "disabled-input-with-tags-container" : ""}`,
258
- onClick: se
259
- }, r.map((t, e) => /* @__PURE__ */ a.createElement("span", {
260
- key: e,
266
+ className: `input-with-tags-container ${l ? "disabled-input-with-tags-container" : ""} ${q ? "keyboard-focused" : ""}`,
267
+ onClick: me,
268
+ onKeyDown: (e) => {
269
+ e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && P.current?.focus();
270
+ }
271
+ }, r.map((e, t) => /* @__PURE__ */ a.createElement("span", {
272
+ key: t,
261
273
  className: "tag-in-inputwithtags"
262
- }, t[K], !l && /* @__PURE__ */ a.createElement(Ee, {
274
+ }, e[z], !l && /* @__PURE__ */ a.createElement(Pe, {
263
275
  name: "close",
264
276
  className: "close-icon-in-inputwithtags",
265
- ariaLabel: `Remove tag ${t[K]}`,
266
- onClick: () => ae(e),
277
+ ariaLabel: `Remove tag ${e[z]}`,
278
+ onClick: () => ie(t),
267
279
  shouldStopPropagation: !0
268
- }))), (J || !r.length) && /* @__PURE__ */ a.createElement("input", g({
269
- ref: x
270
- }, U, {
280
+ }))), (j || !r.length || p) && /* @__PURE__ */ a.createElement("input", f({
281
+ ref: P
282
+ }, G, {
271
283
  type: "text",
272
- value: s,
273
- onChange: re,
274
- onKeyDown: le,
275
- onFocus: oe,
276
- placeholder: r.length === 0 ? E : "",
277
- className: "input-with-tags-input",
278
- disabled: l,
279
- "aria-label": _ || "Search and select options"
280
- })))),
284
+ value: o,
285
+ onChange: ue,
286
+ onKeyDown: ce,
287
+ onFocus: pe,
288
+ placeholder: r.length === 0 ? w : "",
289
+ className: `input-with-tags-input${!j && r.length > 0 && !o ? " sr-only" : ""}`,
290
+ disabled: l
291
+ }, Ne({
292
+ ariaLabel: X || R || "Search and select options",
293
+ ariaLabelledBy: Y,
294
+ ariaDescribedBy: Z
295
+ }))))),
281
296
  automationId: u,
282
297
  popoverContentAutomationId: `${u}-content`
283
298
  })));
284
299
  });
285
300
  export {
286
- _e as DropdownWithInputTags
301
+ Le as DropdownWithInputTags
287
302
  };
288
303
  //# sourceMappingURL=index38.js.map