se-design 1.0.83-dev.4 → 1.0.83-r-dev.1

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 (269) hide show
  1. package/dist/assets/icons/tag.svg +2 -2
  2. package/dist/assets/style.css +1 -1
  3. package/dist/components/AccessibleDiv/index.d.ts +1 -23
  4. package/dist/components/Dropdown/index.d.ts +0 -2
  5. package/dist/components/DropdownWithInputTags/index.d.ts +0 -3
  6. package/dist/components/Link/index.d.ts +2 -6
  7. package/dist/components/NLSearch/ClearAiFiltersBar.d.ts +21 -0
  8. package/dist/components/NLSearch/NLDynamicChip.d.ts +26 -0
  9. package/dist/components/NLSearch/NLSearchInput.d.ts +46 -0
  10. package/dist/components/NLSearch/index.d.ts +6 -0
  11. package/dist/components/index.d.ts +2 -0
  12. package/dist/index.js +139 -140
  13. package/dist/index.js.map +1 -1
  14. package/dist/index100.js.map +1 -1
  15. package/dist/index101.js.map +1 -1
  16. package/dist/index102.js.map +1 -1
  17. package/dist/index103.js.map +1 -1
  18. package/dist/index104.js.map +1 -1
  19. package/dist/index105.js.map +1 -1
  20. package/dist/index106.js.map +1 -1
  21. package/dist/index107.js.map +1 -1
  22. package/dist/index108.js.map +1 -1
  23. package/dist/index109.js.map +1 -1
  24. package/dist/index11.js +1 -1
  25. package/dist/index110.js.map +1 -1
  26. package/dist/index111.js.map +1 -1
  27. package/dist/index112.js.map +1 -1
  28. package/dist/index113.js.map +1 -1
  29. package/dist/index114.js.map +1 -1
  30. package/dist/index115.js.map +1 -1
  31. package/dist/index116.js.map +1 -1
  32. package/dist/index117.js.map +1 -1
  33. package/dist/index118.js.map +1 -1
  34. package/dist/index119.js.map +1 -1
  35. package/dist/index12.js +1 -1
  36. package/dist/index120.js.map +1 -1
  37. package/dist/index121.js.map +1 -1
  38. package/dist/index122.js.map +1 -1
  39. package/dist/index123.js.map +1 -1
  40. package/dist/index124.js.map +1 -1
  41. package/dist/index125.js.map +1 -1
  42. package/dist/index126.js.map +1 -1
  43. package/dist/index127.js.map +1 -1
  44. package/dist/index128.js.map +1 -1
  45. package/dist/index129.js.map +1 -1
  46. package/dist/index13.js +1 -1
  47. package/dist/index130.js.map +1 -1
  48. package/dist/index131.js.map +1 -1
  49. package/dist/index132.js.map +1 -1
  50. package/dist/index133.js.map +1 -1
  51. package/dist/index134.js.map +1 -1
  52. package/dist/index135.js.map +1 -1
  53. package/dist/index136.js.map +1 -1
  54. package/dist/index137.js.map +1 -1
  55. package/dist/index138.js.map +1 -1
  56. package/dist/index139.js.map +1 -1
  57. package/dist/index140.js.map +1 -1
  58. package/dist/index141.js.map +1 -1
  59. package/dist/index142.js.map +1 -1
  60. package/dist/index143.js.map +1 -1
  61. package/dist/index144.js.map +1 -1
  62. package/dist/index145.js.map +1 -1
  63. package/dist/index146.js.map +1 -1
  64. package/dist/index147.js.map +1 -1
  65. package/dist/index148.js.map +1 -1
  66. package/dist/index149.js.map +1 -1
  67. package/dist/index150.js.map +1 -1
  68. package/dist/index151.js.map +1 -1
  69. package/dist/index152.js.map +1 -1
  70. package/dist/index153.js.map +1 -1
  71. package/dist/index154.js.map +1 -1
  72. package/dist/index155.js.map +1 -1
  73. package/dist/index156.js.map +1 -1
  74. package/dist/index157.js.map +1 -1
  75. package/dist/index158.js.map +1 -1
  76. package/dist/index159.js.map +1 -1
  77. package/dist/index16.js +23 -25
  78. package/dist/index16.js.map +1 -1
  79. package/dist/index160.js.map +1 -1
  80. package/dist/index161.js.map +1 -1
  81. package/dist/index162.js.map +1 -1
  82. package/dist/index163.js.map +1 -1
  83. package/dist/index164.js.map +1 -1
  84. package/dist/index165.js.map +1 -1
  85. package/dist/index166.js.map +1 -1
  86. package/dist/index167.js.map +1 -1
  87. package/dist/index168.js.map +1 -1
  88. package/dist/index169.js.map +1 -1
  89. package/dist/index17.js +29 -29
  90. package/dist/index17.js.map +1 -1
  91. package/dist/index170.js.map +1 -1
  92. package/dist/index171.js.map +1 -1
  93. package/dist/index172.js.map +1 -1
  94. package/dist/index173.js.map +1 -1
  95. package/dist/index174.js.map +1 -1
  96. package/dist/index175.js.map +1 -1
  97. package/dist/index176.js.map +1 -1
  98. package/dist/index177.js.map +1 -1
  99. package/dist/index178.js.map +1 -1
  100. package/dist/index179.js.map +1 -1
  101. package/dist/index18.js +63 -85
  102. package/dist/index18.js.map +1 -1
  103. package/dist/index180.js.map +1 -1
  104. package/dist/index181.js.map +1 -1
  105. package/dist/index182.js.map +1 -1
  106. package/dist/index183.js.map +1 -1
  107. package/dist/index184.js.map +1 -1
  108. package/dist/index185.js.map +1 -1
  109. package/dist/index186.js.map +1 -1
  110. package/dist/index187.js.map +1 -1
  111. package/dist/index188.js.map +1 -1
  112. package/dist/index189.js.map +1 -1
  113. package/dist/index19.js +167 -182
  114. package/dist/index19.js.map +1 -1
  115. package/dist/index190.js.map +1 -1
  116. package/dist/index191.js.map +1 -1
  117. package/dist/index192.js.map +1 -1
  118. package/dist/index193.js +1 -1
  119. package/dist/index193.js.map +1 -1
  120. package/dist/index194.js.map +1 -1
  121. package/dist/index195.js.map +1 -1
  122. package/dist/index196.js.map +1 -1
  123. package/dist/index197.js.map +1 -1
  124. package/dist/index198.js.map +1 -1
  125. package/dist/index199.js.map +1 -1
  126. package/dist/index200.js.map +1 -1
  127. package/dist/index201.js.map +1 -1
  128. package/dist/index202.js.map +1 -1
  129. package/dist/index203.js.map +1 -1
  130. package/dist/index207.js +2 -2
  131. package/dist/index208.js +3 -3
  132. package/dist/index208.js.map +1 -1
  133. package/dist/index216.js +9 -13
  134. package/dist/index216.js.map +1 -1
  135. package/dist/index23.js +2 -2
  136. package/dist/index244.js +1 -1
  137. package/dist/index25.js +160 -174
  138. package/dist/index25.js.map +1 -1
  139. package/dist/index27.js +1 -1
  140. package/dist/index28.js +4 -4
  141. package/dist/index28.js.map +1 -1
  142. package/dist/index29.js +30 -34
  143. package/dist/index29.js.map +1 -1
  144. package/dist/index3.js +50 -60
  145. package/dist/index3.js.map +1 -1
  146. package/dist/index30.js +3 -3
  147. package/dist/index32.js +10 -11
  148. package/dist/index35.js +3 -3
  149. package/dist/index36.js +4 -4
  150. package/dist/index38.js +195 -210
  151. package/dist/index38.js.map +1 -1
  152. package/dist/index39.js +2 -2
  153. package/dist/index4.js +3 -3
  154. package/dist/index42.js +7 -8
  155. package/dist/index43.js +13 -14
  156. package/dist/index43.js.map +1 -1
  157. package/dist/index45.js +60 -61
  158. package/dist/index45.js.map +1 -1
  159. package/dist/index46.js +198 -194
  160. package/dist/index46.js.map +1 -1
  161. package/dist/index47.js +40 -38
  162. package/dist/index47.js.map +1 -1
  163. package/dist/index48.js +36 -33
  164. package/dist/index48.js.map +1 -1
  165. package/dist/index50.js +189 -78
  166. package/dist/index50.js.map +1 -1
  167. package/dist/index51.js +36 -459
  168. package/dist/index51.js.map +1 -1
  169. package/dist/index52.js +33 -98
  170. package/dist/index52.js.map +1 -1
  171. package/dist/index53.js +151 -36
  172. package/dist/index53.js.map +1 -1
  173. package/dist/index54.js +84 -36
  174. package/dist/index54.js.map +1 -1
  175. package/dist/index55.js +456 -88
  176. package/dist/index55.js.map +1 -1
  177. package/dist/index56.js +96 -161
  178. package/dist/index56.js.map +1 -1
  179. package/dist/index57.js +35 -146
  180. package/dist/index57.js.map +1 -1
  181. package/dist/index58.js +38 -33
  182. package/dist/index58.js.map +1 -1
  183. package/dist/index59.js +89 -83
  184. package/dist/index59.js.map +1 -1
  185. package/dist/index6.js +237 -239
  186. package/dist/index6.js.map +1 -1
  187. package/dist/index60.js +157 -113
  188. package/dist/index60.js.map +1 -1
  189. package/dist/index61.js +143 -62
  190. package/dist/index61.js.map +1 -1
  191. package/dist/index62.js +33 -152
  192. package/dist/index62.js.map +1 -1
  193. package/dist/index63.js +80 -312
  194. package/dist/index63.js.map +1 -1
  195. package/dist/index64.js +118 -46
  196. package/dist/index64.js.map +1 -1
  197. package/dist/index65.js +62 -140
  198. package/dist/index65.js.map +1 -1
  199. package/dist/index66.js +152 -12
  200. package/dist/index66.js.map +1 -1
  201. package/dist/index67.js +316 -44
  202. package/dist/index67.js.map +1 -1
  203. package/dist/index68.js +44 -104
  204. package/dist/index68.js.map +1 -1
  205. package/dist/index69.js +143 -18
  206. package/dist/index69.js.map +1 -1
  207. package/dist/index7.js +8 -9
  208. package/dist/index70.js +9 -63
  209. package/dist/index70.js.map +1 -1
  210. package/dist/index71.js +45 -26
  211. package/dist/index71.js.map +1 -1
  212. package/dist/index72.js +78 -102
  213. package/dist/index72.js.map +1 -1
  214. package/dist/index73.js +18 -61
  215. package/dist/index73.js.map +1 -1
  216. package/dist/index74.js +63 -18
  217. package/dist/index74.js.map +1 -1
  218. package/dist/index75.js +24 -105
  219. package/dist/index75.js.map +1 -1
  220. package/dist/index76.js +108 -18
  221. package/dist/index76.js.map +1 -1
  222. package/dist/index77.js +61 -10
  223. package/dist/index77.js.map +1 -1
  224. package/dist/index78.js +21 -5
  225. package/dist/index78.js.map +1 -1
  226. package/dist/index79.js +5 -56
  227. package/dist/index79.js.map +1 -1
  228. package/dist/index80.js +50 -23
  229. package/dist/index80.js.map +1 -1
  230. package/dist/index81.js +22 -7
  231. package/dist/index81.js.map +1 -1
  232. package/dist/index82.js +12 -0
  233. package/dist/index82.js.map +1 -0
  234. package/dist/index84.js +2 -2
  235. package/dist/index84.js.map +1 -1
  236. package/dist/index85.js +2 -2
  237. package/dist/index85.js.map +1 -1
  238. package/dist/index86.js +2 -2
  239. package/dist/index86.js.map +1 -1
  240. package/dist/index87.js +2 -2
  241. package/dist/index87.js.map +1 -1
  242. package/dist/index88.js +1 -1
  243. package/dist/index88.js.map +1 -1
  244. package/dist/index89.js +1 -1
  245. package/dist/index89.js.map +1 -1
  246. package/dist/index9.js +3 -3
  247. package/dist/index90.js +1 -1
  248. package/dist/index90.js.map +1 -1
  249. package/dist/index91.js +1 -1
  250. package/dist/index91.js.map +1 -1
  251. package/dist/index92.js +1 -1
  252. package/dist/index92.js.map +1 -1
  253. package/dist/index93.js +1 -1
  254. package/dist/index93.js.map +1 -1
  255. package/dist/index94.js +1 -1
  256. package/dist/index94.js.map +1 -1
  257. package/dist/index95.js +1 -1
  258. package/dist/index95.js.map +1 -1
  259. package/dist/index96.js +1 -1
  260. package/dist/index96.js.map +1 -1
  261. package/dist/index97.js.map +1 -1
  262. package/dist/index98.js.map +1 -1
  263. package/dist/index99.js.map +1 -1
  264. package/package.json +1 -1
  265. package/dist/assets/icons/chat.svg +0 -4
  266. package/dist/index49.js +0 -152
  267. package/dist/index49.js.map +0 -1
  268. package/dist/index83.js +0 -5
  269. package/dist/index83.js.map +0 -1
package/dist/index38.js CHANGED
@@ -1,303 +1,288 @@
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";
7
- import "./index72.js";
8
- import { useCombobox as $e } from "./index68.js";
9
- import { useStableId as De } from "./index205.js";
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";
6
+ import "./index76.js";
7
+ import { useCombobox as be } from "./index72.js";
8
+ import { useStableId as Ce } from "./index205.js";
10
9
  /* empty css */
11
- function f() {
12
- return f = Object.assign ? Object.assign.bind() : function(h) {
10
+ function g() {
11
+ return g = Object.assign ? Object.assign.bind() : function(v) {
13
12
  for (var i = 1; i < arguments.length; i++) {
14
- var w = arguments[i];
15
- for (var b in w) ({}).hasOwnProperty.call(w, b) && (h[b] = w[b]);
13
+ var E = arguments[i];
14
+ for (var k in E) ({}).hasOwnProperty.call(E, k) && (v[k] = E[k]);
16
15
  }
17
- return h;
18
- }, f.apply(null, arguments);
16
+ return v;
17
+ }, g.apply(null, arguments);
19
18
  }
20
- const Le = /* @__PURE__ */ Ee(({
21
- value: h,
19
+ const _e = /* @__PURE__ */ de(({
20
+ value: v,
22
21
  onChange: i,
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,
22
+ placeholder: E = "Type to search or add custom tags...",
23
+ className: k = "",
24
+ options: h = [],
25
+ renderOption: L,
26
+ label: _,
31
27
  automationId: u = "",
32
- noOptionsMessage: ee = "No options found",
33
- allowCustomTags: x = !0,
28
+ noOptionsMessage: q = "No options found",
29
+ allowCustomTags: F = !0,
34
30
  disabled: l = !1,
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);
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);
42
38
  return n ? {
43
39
  label: n.label,
44
40
  value: n.value
45
41
  } : {
46
- label: t,
47
- value: t
42
+ label: e,
43
+ value: e
48
44
  };
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) => {
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) => {
50
46
  if (l) return;
51
- const t = [...r];
52
- t.some((n) => n.value === e.value) || (t.push({
53
- label: e.label,
54
- value: e.value
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, {
47
+ const e = [...r];
48
+ e.some((n) => n.value === t.value) || (e.push({
59
49
  label: t.label,
60
50
  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) => {
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, {
55
+ label: e.label,
56
+ 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) => {
63
59
  if (!l) {
64
- if (e.value === $) {
65
- const t = o.trim();
66
- if (!t) return;
60
+ if (t.value === y) {
61
+ const e = s.trim();
62
+ if (!e) return;
67
63
  const n = [...r];
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);
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);
72
68
  return;
73
69
  }
74
- if (p) {
75
- const t = r.some((n) => n.value === e.value);
76
- M(!t, e);
70
+ if (d) {
71
+ const e = r.some((n) => n.value === t.value);
72
+ D(!e, t);
77
73
  } else
78
- N(e);
74
+ N(t);
79
75
  }
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: $
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
84
80
  }] : [], {
85
- containerProps: oe,
86
- inputProps: G,
87
- listboxProps: se,
81
+ containerProps: te,
82
+ inputProps: U,
83
+ listboxProps: ne,
88
84
  getOptionProps: O,
89
85
  highlightedIndex: T,
90
- setHighlightedIndex: v,
91
- isKeyboardFocused: q
92
- } = $e({
93
- items: D,
94
- isOpen: d,
86
+ setHighlightedIndex: w
87
+ } = be({
88
+ items: $,
89
+ isOpen: f,
95
90
  onOpenChange: c,
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;
91
+ onSelect: z,
92
+ listboxId: ee,
93
+ hasItems: $.length > 0
94
+ });
95
+ B(() => {
96
+ if (R.current) {
97
+ R.current = !1;
105
98
  return;
106
99
  }
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) => {
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) => {
113
106
  if (l) return;
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) => {
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) => {
117
110
  if (!l) {
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));
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));
122
115
  return;
123
116
  }
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);
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);
131
124
  return;
132
125
  }
133
- G.onKeyDown(e);
126
+ U.onKeyDown(t);
134
127
  }
135
- }, ue = (e) => {
128
+ }, re = (t) => {
136
129
  if (l) return;
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) => {
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) => {
144
137
  if (l) {
145
- e.preventDefault(), e.stopPropagation();
138
+ t.preventDefault(), t.stopPropagation();
146
139
  return;
147
140
  }
148
- e.target.closest(".input-with-tags-container") && e.stopPropagation();
149
- }, ge = () => {
150
- l || c(!d);
141
+ t.target.closest(".input-with-tags-container") && t.stopPropagation();
142
+ }, ce = () => {
143
+ l || c(!f);
151
144
  };
152
- ye(ne, () => ({
153
- toggleDropdown: ge
145
+ ve(X, () => ({
146
+ toggleDropdown: ce
154
147
  }), []);
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}`
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}`
164
157
  }), /* @__PURE__ */ a.createElement("span", {
165
158
  className: "option-label"
166
- }, e.label), e.value !== e.label && /* @__PURE__ */ a.createElement("span", {
159
+ }, t.label), t.value !== t.label && /* @__PURE__ */ a.createElement("span", {
167
160
  className: "option-value"
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)}`,
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" : ""}`,
181
174
  "aria-checked": n,
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, {
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, {
188
181
  automationId: "checkbox",
189
182
  className: "checkbox",
190
- checked: n,
191
- onChange: () => {
192
- },
193
- label: e.label,
194
- tabIndex: -1
195
- }));
196
- }, be = () => /* @__PURE__ */ a.createElement("div", {
183
+ defaultChecked: n,
184
+ onChange: (m) => D(m, t),
185
+ label: t.label
186
+ })));
187
+ }, he = () => /* @__PURE__ */ a.createElement("div", {
197
188
  className: "dropdown-with-input-tags-ctas-container"
198
- }, /* @__PURE__ */ a.createElement(Q, {
189
+ }, /* @__PURE__ */ a.createElement(G, {
199
190
  label: "Clear",
200
191
  type: "link",
201
192
  size: "sm",
202
- onClick: ve,
193
+ onClick: me,
203
194
  automationId: `${u}-clear-button`
204
- }), /* @__PURE__ */ a.createElement(Q, {
195
+ }), /* @__PURE__ */ a.createElement(G, {
205
196
  label: "Apply",
206
197
  type: "primary",
207
198
  size: "sm",
208
- onClick: he,
199
+ onClick: pe,
209
200
  automationId: `${u}-apply-button`
210
201
  }));
211
- return /* @__PURE__ */ a.createElement("div", f({
212
- className: `dropdown-with-input-tags-wrapper ${b} ${l ? "disabled-wrapper" : ""}`,
202
+ return /* @__PURE__ */ a.createElement("div", g({
203
+ className: `dropdown-with-input-tags-wrapper ${k} ${l ? "disabled-wrapper" : ""}`,
213
204
  "data-automation-id": u
214
- }, oe), R && /* @__PURE__ */ a.createElement("label", {
205
+ }, te), _ && /* @__PURE__ */ a.createElement("label", {
215
206
  id: `${u}-label`,
216
207
  className: "dropdown-with-input-tags-label"
217
- }, R), /* @__PURE__ */ a.createElement("div", {
218
- onClick: fe
219
- }, /* @__PURE__ */ a.createElement(Ce, {
220
- ref: le,
208
+ }, _), /* @__PURE__ */ a.createElement("div", {
209
+ onClick: ie
210
+ }, /* @__PURE__ */ a.createElement(we, {
211
+ ref: Z,
221
212
  className: "dropdown-with-input-tags-popover",
222
213
  contentWidth: "full",
223
214
  position: "bottom-left",
224
- isPopoverOpen: !l && d,
215
+ isPopoverOpen: !l && f,
225
216
  onPopoverToggle: l ? () => {
226
217
  } : c,
227
218
  disableClickToggle: !0,
228
- isWithPortal: te,
219
+ isWithPortal: Q,
229
220
  renderPopoverContents: ({
230
- closePopoverCb: e
231
- }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("div", f({}, se, {
221
+ closePopoverCb: t
222
+ }) => /* @__PURE__ */ a.createElement(a.Fragment, null, /* @__PURE__ */ a.createElement("div", g({}, ne, {
232
223
  className: "dropdown-with-input-tags-content"
233
- }, p && {
224
+ }, d && {
234
225
  "aria-multiselectable": "true"
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)}`,
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" : ""}`,
242
233
  onClick: () => {
243
- l || (B(t), e());
234
+ l || (z(e), t());
244
235
  },
245
- onMouseEnter: () => v(n)
246
- }), 'Add "', o.trim(), '"');
236
+ onMouseEnter: () => w(n)
237
+ }), 'Add "', s.trim(), '"');
247
238
  }
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)}`
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" : ""}`
254
245
  };
255
- return W ? W(t, V, N) : de(t, n, N, l);
246
+ return L ? L(e, M, N) : ue(e, n, N, l);
256
247
  }) : /* @__PURE__ */ a.createElement("div", {
257
248
  className: "dropdown-with-input-tags-no-options"
258
249
  }, /* @__PURE__ */ a.createElement("div", {
259
250
  className: "dropdown-with-input-tags-no-options-text",
260
251
  role: "status",
261
252
  "aria-live": "polite"
262
- }, ee))), p && !E && be()),
253
+ }, q))), d && !b && he()),
263
254
  renderPopoverSrcElement: () => /* @__PURE__ */ a.createElement("div", {
264
255
  className: "dropdown-with-input-tags-input-container"
265
256
  }, /* @__PURE__ */ a.createElement("div", {
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,
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,
273
261
  className: "tag-in-inputwithtags"
274
- }, e[z], !l && /* @__PURE__ */ a.createElement(Pe, {
262
+ }, t[K], !l && /* @__PURE__ */ a.createElement(Ee, {
275
263
  name: "close",
276
264
  className: "close-icon-in-inputwithtags",
277
- ariaLabel: `Remove tag ${e[z]}`,
278
- onClick: () => ie(t),
265
+ ariaLabel: `Remove tag ${t[K]}`,
266
+ onClick: () => ae(e),
279
267
  shouldStopPropagation: !0
280
- }))), (j || !r.length || p) && /* @__PURE__ */ a.createElement("input", f({
281
- ref: P
282
- }, G, {
268
+ }))), (J || !r.length) && /* @__PURE__ */ a.createElement("input", g({
269
+ ref: x
270
+ }, U, {
283
271
  type: "text",
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
- }))))),
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
+ })))),
296
281
  automationId: u,
297
282
  popoverContentAutomationId: `${u}-content`
298
283
  })));
299
284
  });
300
285
  export {
301
- Le as DropdownWithInputTags
286
+ _e as DropdownWithInputTags
302
287
  };
303
288
  //# sourceMappingURL=index38.js.map