se-design 1.0.94 → 1.0.96-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/dist/assets/icons/document-commenting.svg +3 -0
  2. package/dist/assets/style.css +1 -1
  3. package/dist/components/BottomSheet/index.d.ts +1 -0
  4. package/dist/components/DropdownWithInputTags/index.d.ts +12 -0
  5. package/dist/components/Input/index.d.ts +1 -1
  6. package/dist/index12.js +2 -2
  7. package/dist/index126.js +1 -1
  8. package/dist/index126.js.map +1 -1
  9. package/dist/index127.js +1 -1
  10. package/dist/index127.js.map +1 -1
  11. package/dist/index128.js +1 -1
  12. package/dist/index128.js.map +1 -1
  13. package/dist/index129.js +1 -1
  14. package/dist/index129.js.map +1 -1
  15. package/dist/index13.js +2 -2
  16. package/dist/index130.js +1 -1
  17. package/dist/index130.js.map +1 -1
  18. package/dist/index131.js +2 -2
  19. package/dist/index131.js.map +1 -1
  20. package/dist/index132.js +1 -1
  21. package/dist/index132.js.map +1 -1
  22. package/dist/index133.js +2 -2
  23. package/dist/index133.js.map +1 -1
  24. package/dist/index134.js +2 -2
  25. package/dist/index134.js.map +1 -1
  26. package/dist/index135.js +1 -1
  27. package/dist/index135.js.map +1 -1
  28. package/dist/index136.js +2 -2
  29. package/dist/index136.js.map +1 -1
  30. package/dist/index137.js +2 -2
  31. package/dist/index137.js.map +1 -1
  32. package/dist/index138.js +1 -1
  33. package/dist/index138.js.map +1 -1
  34. package/dist/index139.js +1 -1
  35. package/dist/index139.js.map +1 -1
  36. package/dist/index140.js +1 -1
  37. package/dist/index140.js.map +1 -1
  38. package/dist/index141.js +2 -2
  39. package/dist/index141.js.map +1 -1
  40. package/dist/index142.js +2 -2
  41. package/dist/index142.js.map +1 -1
  42. package/dist/index143.js +2 -2
  43. package/dist/index143.js.map +1 -1
  44. package/dist/index144.js +1 -1
  45. package/dist/index144.js.map +1 -1
  46. package/dist/index145.js +1 -1
  47. package/dist/index145.js.map +1 -1
  48. package/dist/index146.js +1 -1
  49. package/dist/index146.js.map +1 -1
  50. package/dist/index147.js +1 -1
  51. package/dist/index147.js.map +1 -1
  52. package/dist/index148.js +1 -1
  53. package/dist/index148.js.map +1 -1
  54. package/dist/index149.js +1 -1
  55. package/dist/index149.js.map +1 -1
  56. package/dist/index150.js +1 -1
  57. package/dist/index150.js.map +1 -1
  58. package/dist/index151.js +1 -1
  59. package/dist/index151.js.map +1 -1
  60. package/dist/index152.js +2 -2
  61. package/dist/index152.js.map +1 -1
  62. package/dist/index153.js +2 -2
  63. package/dist/index153.js.map +1 -1
  64. package/dist/index154.js +1 -1
  65. package/dist/index154.js.map +1 -1
  66. package/dist/index155.js +1 -1
  67. package/dist/index155.js.map +1 -1
  68. package/dist/index156.js +1 -1
  69. package/dist/index156.js.map +1 -1
  70. package/dist/index157.js +1 -1
  71. package/dist/index157.js.map +1 -1
  72. package/dist/index158.js +1 -1
  73. package/dist/index158.js.map +1 -1
  74. package/dist/index159.js +1 -1
  75. package/dist/index159.js.map +1 -1
  76. package/dist/index16.js +1 -1
  77. package/dist/index160.js +1 -1
  78. package/dist/index160.js.map +1 -1
  79. package/dist/index161.js +2 -2
  80. package/dist/index161.js.map +1 -1
  81. package/dist/index162.js +1 -1
  82. package/dist/index162.js.map +1 -1
  83. package/dist/index163.js +2 -2
  84. package/dist/index163.js.map +1 -1
  85. package/dist/index164.js +2 -2
  86. package/dist/index164.js.map +1 -1
  87. package/dist/index165.js +2 -2
  88. package/dist/index165.js.map +1 -1
  89. package/dist/index166.js +2 -2
  90. package/dist/index166.js.map +1 -1
  91. package/dist/index167.js +1 -1
  92. package/dist/index167.js.map +1 -1
  93. package/dist/index168.js +1 -1
  94. package/dist/index168.js.map +1 -1
  95. package/dist/index169.js +1 -1
  96. package/dist/index169.js.map +1 -1
  97. package/dist/index170.js +1 -1
  98. package/dist/index170.js.map +1 -1
  99. package/dist/index171.js +1 -1
  100. package/dist/index171.js.map +1 -1
  101. package/dist/index172.js +1 -1
  102. package/dist/index172.js.map +1 -1
  103. package/dist/index173.js +1 -1
  104. package/dist/index173.js.map +1 -1
  105. package/dist/index174.js +1 -1
  106. package/dist/index174.js.map +1 -1
  107. package/dist/index175.js +1 -1
  108. package/dist/index175.js.map +1 -1
  109. package/dist/index176.js +1 -1
  110. package/dist/index176.js.map +1 -1
  111. package/dist/index177.js +1 -1
  112. package/dist/index177.js.map +1 -1
  113. package/dist/index178.js +1 -1
  114. package/dist/index178.js.map +1 -1
  115. package/dist/index179.js +1 -1
  116. package/dist/index179.js.map +1 -1
  117. package/dist/index180.js +1 -1
  118. package/dist/index180.js.map +1 -1
  119. package/dist/index181.js +1 -1
  120. package/dist/index181.js.map +1 -1
  121. package/dist/index182.js +1 -1
  122. package/dist/index182.js.map +1 -1
  123. package/dist/index183.js +1 -1
  124. package/dist/index183.js.map +1 -1
  125. package/dist/index184.js +1 -1
  126. package/dist/index184.js.map +1 -1
  127. package/dist/index185.js +1 -1
  128. package/dist/index185.js.map +1 -1
  129. package/dist/index186.js +1 -1
  130. package/dist/index186.js.map +1 -1
  131. package/dist/index187.js +1 -1
  132. package/dist/index187.js.map +1 -1
  133. package/dist/index188.js +1 -1
  134. package/dist/index188.js.map +1 -1
  135. package/dist/index189.js +1 -1
  136. package/dist/index189.js.map +1 -1
  137. package/dist/index19.js +1 -1
  138. package/dist/index190.js +1 -1
  139. package/dist/index190.js.map +1 -1
  140. package/dist/index191.js +1 -1
  141. package/dist/index191.js.map +1 -1
  142. package/dist/index192.js +2 -2
  143. package/dist/index192.js.map +1 -1
  144. package/dist/index193.js +2 -2
  145. package/dist/index193.js.map +1 -1
  146. package/dist/index194.js +1 -1
  147. package/dist/index194.js.map +1 -1
  148. package/dist/index195.js +1 -1
  149. package/dist/index195.js.map +1 -1
  150. package/dist/index196.js +2 -2
  151. package/dist/index196.js.map +1 -1
  152. package/dist/index197.js +2 -2
  153. package/dist/index197.js.map +1 -1
  154. package/dist/index198.js +1 -1
  155. package/dist/index198.js.map +1 -1
  156. package/dist/index199.js +1 -1
  157. package/dist/index199.js.map +1 -1
  158. package/dist/index200.js +1 -1
  159. package/dist/index200.js.map +1 -1
  160. package/dist/index201.js +1 -1
  161. package/dist/index201.js.map +1 -1
  162. package/dist/index202.js +1 -1
  163. package/dist/index202.js.map +1 -1
  164. package/dist/index203.js +1 -1
  165. package/dist/index203.js.map +1 -1
  166. package/dist/index204.js +1 -1
  167. package/dist/index204.js.map +1 -1
  168. package/dist/index205.js +1 -1
  169. package/dist/index205.js.map +1 -1
  170. package/dist/index206.js +1 -1
  171. package/dist/index206.js.map +1 -1
  172. package/dist/index207.js +2 -2
  173. package/dist/index207.js.map +1 -1
  174. package/dist/index208.js +2 -2
  175. package/dist/index208.js.map +1 -1
  176. package/dist/index209.js +2 -2
  177. package/dist/index209.js.map +1 -1
  178. package/dist/index210.js +2 -149
  179. package/dist/index210.js.map +1 -1
  180. package/dist/index211.js +149 -9
  181. package/dist/index211.js.map +1 -1
  182. package/dist/index212.js +8 -5
  183. package/dist/index212.js.map +1 -1
  184. package/dist/index213.js +5 -42
  185. package/dist/index213.js.map +1 -1
  186. package/dist/index214.js +40 -18
  187. package/dist/index214.js.map +1 -1
  188. package/dist/index215.js +24 -0
  189. package/dist/index215.js.map +1 -0
  190. package/dist/index222.js +24 -68
  191. package/dist/index222.js.map +1 -1
  192. package/dist/index223.js +75 -0
  193. package/dist/index223.js.map +1 -0
  194. package/dist/{index229.js → index230.js} +1 -1
  195. package/dist/{index229.js.map → index230.js.map} +1 -1
  196. package/dist/{index231.js → index232.js} +1 -1
  197. package/dist/{index231.js.map → index232.js.map} +1 -1
  198. package/dist/index24.js +1 -1
  199. package/dist/{index239.js → index240.js} +1 -1
  200. package/dist/{index239.js.map → index240.js.map} +1 -1
  201. package/dist/{index242.js → index243.js} +1 -1
  202. package/dist/{index242.js.map → index243.js.map} +1 -1
  203. package/dist/index252.js +169 -3
  204. package/dist/index252.js.map +1 -1
  205. package/dist/index253.js +7 -0
  206. package/dist/index253.js.map +1 -0
  207. package/dist/index255.js +18 -9
  208. package/dist/index255.js.map +1 -1
  209. package/dist/index256.js +9 -9
  210. package/dist/index256.js.map +1 -1
  211. package/dist/index257.js +9 -4
  212. package/dist/index257.js.map +1 -1
  213. package/dist/index258.js +5 -170
  214. package/dist/index258.js.map +1 -1
  215. package/dist/index259.js +170 -11
  216. package/dist/index259.js.map +1 -1
  217. package/dist/index26.js +1 -1
  218. package/dist/index260.js +11 -6
  219. package/dist/index260.js.map +1 -1
  220. package/dist/index261.js +5 -5
  221. package/dist/index261.js.map +1 -1
  222. package/dist/index262.js +5 -37
  223. package/dist/index262.js.map +1 -1
  224. package/dist/index263.js +38 -2
  225. package/dist/index263.js.map +1 -1
  226. package/dist/index264.js +2 -8
  227. package/dist/index264.js.map +1 -1
  228. package/dist/index265.js +7 -326
  229. package/dist/index265.js.map +1 -1
  230. package/dist/index266.js +324 -47
  231. package/dist/index266.js.map +1 -1
  232. package/dist/index267.js +50 -2
  233. package/dist/index267.js.map +1 -1
  234. package/dist/index268.js +2 -76
  235. package/dist/index268.js.map +1 -1
  236. package/dist/index269.js +65 -82
  237. package/dist/index269.js.map +1 -1
  238. package/dist/index270.js +89 -48
  239. package/dist/index270.js.map +1 -1
  240. package/dist/index271.js +51 -7
  241. package/dist/index271.js.map +1 -1
  242. package/dist/index272.js +7 -4
  243. package/dist/index272.js.map +1 -1
  244. package/dist/index273.js +4 -51
  245. package/dist/index273.js.map +1 -1
  246. package/dist/index274.js +52 -2
  247. package/dist/index274.js.map +1 -1
  248. package/dist/index275.js +2 -2
  249. package/dist/index276.js +5 -0
  250. package/dist/index276.js.map +1 -0
  251. package/dist/index29.js +2 -2
  252. package/dist/index30.js +1 -1
  253. package/dist/index31.js +1 -1
  254. package/dist/index33.js +10 -11
  255. package/dist/index34.js +1 -1
  256. package/dist/index36.js +1 -1
  257. package/dist/index37.js +1 -1
  258. package/dist/index38.js +1 -1
  259. package/dist/index39.js +166 -164
  260. package/dist/index39.js.map +1 -1
  261. package/dist/index40.js +45 -40
  262. package/dist/index40.js.map +1 -1
  263. package/dist/index41.js +1 -1
  264. package/dist/index43.js +7 -8
  265. package/dist/index44.js +2 -3
  266. package/dist/index46.js +1 -1
  267. package/dist/index51.js +2 -2
  268. package/dist/index54.js +1 -1
  269. package/dist/index56.js +1 -1
  270. package/dist/index57.js +1 -1
  271. package/dist/index58.js +1 -1
  272. package/dist/index6.js +97 -95
  273. package/dist/index6.js.map +1 -1
  274. package/dist/index60.js +16 -17
  275. package/dist/index62.js +1 -1
  276. package/dist/index64.js +49 -43
  277. package/dist/index64.js.map +1 -1
  278. package/dist/index66.js +1 -1
  279. package/dist/index68.js +1 -1
  280. package/dist/index7.js +8 -9
  281. package/dist/index70.js +2 -3
  282. package/dist/index84.js +1 -1
  283. package/dist/index86.js +1 -1
  284. package/dist/index9.js +1 -1
  285. package/package.json +1 -1
  286. package/dist/index221.js +0 -31
  287. package/dist/index221.js.map +0 -1
  288. package/dist/index251.js +0 -173
  289. package/dist/index251.js.map +0 -1
  290. package/dist/index254.js +0 -22
  291. package/dist/index254.js.map +0 -1
package/dist/index39.js CHANGED
@@ -1,44 +1,46 @@
1
- import o, { forwardRef as Ce, useState as R, useRef as M, useCallback as U, useEffect as W, useImperativeHandle as De } from "react";
2
- import { Popover as $e } from "./index19.js";
1
+ import r, { forwardRef as Oe, useState as R, useRef as U, useCallback as W, useEffect as x, useImperativeHandle as Ie } from "react";
2
+ import { Popover as Ae } from "./index19.js";
3
3
  import { Icon as Te } from "./index6.js";
4
- import { Checkbox as Ie } from "./index24.js";
5
- import { Button as ee } from "./index4.js";
6
- import { getA11yNameAttributes as Oe } from "./index86.js";
4
+ import { Checkbox as Re } from "./index24.js";
5
+ import { Button as ne } from "./index4.js";
6
+ import { getA11yNameAttributes as Le } from "./index86.js";
7
7
  import "./index77.js";
8
- import { useCombobox as Ae } from "./index73.js";
9
- import { useStableId as te } from "./index212.js";
10
- import { announce as Re } from "./index80.js";
8
+ import { useCombobox as He } from "./index73.js";
9
+ import { useStableId as le } from "./index213.js";
10
+ import { announce as Ke } from "./index80.js";
11
11
  /* empty css */
12
12
  function d() {
13
13
  return d = Object.assign ? Object.assign.bind() : function(v) {
14
14
  for (var i = 1; i < arguments.length; i++) {
15
- var E = arguments[i];
16
- for (var k in E) ({}).hasOwnProperty.call(E, k) && (v[k] = E[k]);
15
+ var b = arguments[i];
16
+ for (var k in b) ({}).hasOwnProperty.call(b, k) && (v[k] = b[k]);
17
17
  }
18
18
  return v;
19
19
  }, d.apply(null, arguments);
20
20
  }
21
- const Ge = /* @__PURE__ */ Ce(({
21
+ const Qe = /* @__PURE__ */ Oe(({
22
22
  value: v,
23
23
  onChange: i,
24
- placeholder: E = "Type to search or add custom tags...",
24
+ placeholder: b = "Type to search or add custom tags...",
25
25
  className: k = "",
26
26
  options: g = [],
27
- renderOption: x,
27
+ renderOption: j,
28
28
  label: D,
29
- ariaLabel: ne,
29
+ ariaLabel: re,
30
30
  ariaLabelledBy: oe,
31
- ariaDescribedBy: le,
31
+ ariaDescribedBy: ae,
32
32
  automationId: c = "",
33
33
  noOptionsMessage: L = "No options found",
34
- allowCustomTags: j = !0,
35
- disabled: l = !1,
34
+ allowCustomTags: z = !0,
35
+ disabled: o = !1,
36
36
  type: H = "select",
37
- showInput: z = !0,
38
- displayTagBy: B = "label",
39
- isWithPortal: ae = !1
40
- }, re) => {
41
- const G = (e) => e.map((t) => {
37
+ showInput: B = !0,
38
+ displayTagBy: G = "label",
39
+ nonRemovableTags: K = [],
40
+ hideSelectedOptions: se = !1,
41
+ isWithPortal: ie = !1
42
+ }, ce) => {
43
+ const q = (e) => e.map((t) => {
42
44
  const n = g.find((s) => s.value === t);
43
45
  return n ? {
44
46
  label: n.label,
@@ -47,30 +49,30 @@ const Ge = /* @__PURE__ */ Ce(({
47
49
  label: t,
48
50
  value: t
49
51
  };
50
- }), [a, f] = R(() => G(v || [])), [r, y] = R(""), [K, se] = R(g), [u, p] = R(!1), ie = M(null), $ = M(null), T = M(!1), S = H === "multi-select-without-cta", m = H === "multi-select" || S, ce = te(c, "dropdown-input-tags-listbox"), q = te(c ? `${c}-label` : void 0, "dropdown-input-tags-label"), I = U((e) => {
51
- if (l) return;
52
- const t = [...a];
52
+ }), [l, f] = R(() => q(v || [])), [a, y] = R(""), [V, ue] = R(g), [u, p] = R(!1), pe = U(null), $ = U(null), O = U(!1), S = H === "multi-select-without-cta", m = H === "multi-select" || S, me = le(c, "dropdown-input-tags-listbox"), J = le(c ? `${c}-label` : void 0, "dropdown-input-tags-label"), I = W((e) => {
53
+ if (o) return;
54
+ const t = [...l];
53
55
  t.some((n) => n.value === e.value) || (t.push({
54
56
  label: e.label,
55
57
  value: e.value
56
58
  }), f(t), i?.(t.map((n) => n.value))), y(""), p(!1);
57
- }, [l, a, i]), V = U((e, t) => {
59
+ }, [o, l, i]), F = W((e, t) => {
58
60
  let n = [];
59
- e ? n = [...a, {
61
+ e ? n = [...l, {
60
62
  label: t.label,
61
63
  value: t.value
62
- }] : n = a.filter((s) => s.value !== t.value), f(n), y(""), S && (T.current = !0, i?.(n.map((s) => s.value)));
63
- }, [a, S, i]), O = "__add_custom_tag__", J = "__no_results__", ue = {
64
- id: J,
64
+ }] : n = l.filter((s) => s.value !== t.value), f(n), y(""), S && (O.current = !0, i?.(n.map((s) => s.value)));
65
+ }, [l, S, i]), A = "__add_custom_tag__", Q = "__no_results__", de = {
66
+ id: Q,
65
67
  label: L,
66
- value: J,
68
+ value: Q,
67
69
  __noResults: !0
68
- }, pe = (e) => !!e?.__noResults, Q = U((e) => {
69
- if (!l) {
70
- if (e.value === O) {
71
- const t = r.trim();
70
+ }, fe = (e) => !!e?.__noResults, X = W((e) => {
71
+ if (!o) {
72
+ if (e.value === A) {
73
+ const t = a.trim();
72
74
  if (!t) return;
73
- const n = [...a];
75
+ const n = [...l];
74
76
  n.some((s) => s.value === t) || (n.push({
75
77
  label: t,
76
78
  value: t
@@ -78,126 +80,126 @@ const Ge = /* @__PURE__ */ Ce(({
78
80
  return;
79
81
  }
80
82
  if (m) {
81
- const t = a.some((n) => n.value === e.value);
82
- V(!t, e);
83
+ const t = l.some((n) => n.value === e.value);
84
+ F(!t, e);
83
85
  } else
84
86
  I(e);
85
87
  }
86
- }, [l, m, a, r, i, V, I]), w = K.length > 0 ? K : j && r.trim() ? [{
87
- id: O,
88
- label: `Add "${r.trim()}"`,
89
- value: O
90
- }] : [], X = w.length === 0 && u ? [ue] : w, {
91
- containerProps: me,
92
- inputProps: Y,
93
- listboxProps: de,
88
+ }, [o, m, l, a, i, F, I]), Y = se ? V.filter((e) => !l.some((t) => t.value === e.value)) : V, w = Y.length > 0 ? Y : z && a.trim() ? [{
89
+ id: A,
90
+ label: `Add "${a.trim()}"`,
91
+ value: A
92
+ }] : [], Z = w.length === 0 && u ? [de] : w, {
93
+ containerProps: ge,
94
+ inputProps: ee,
95
+ listboxProps: he,
94
96
  getOptionProps: N,
95
97
  highlightedIndex: h,
96
- setHighlightedIndex: b,
97
- isKeyboardFocused: Z
98
- } = Ae({
99
- items: X,
98
+ setHighlightedIndex: E,
99
+ isKeyboardFocused: te
100
+ } = He({
101
+ items: Z,
100
102
  isOpen: u,
101
103
  onOpenChange: p,
102
- onSelect: Q,
103
- listboxId: ce,
104
- hasItems: X.length > 0,
104
+ onSelect: X,
105
+ listboxId: me,
106
+ hasItems: Z.length > 0,
105
107
  keepHighlightOnSelect: m,
106
108
  closeOnTab: H !== "multi-select",
107
- isItemDisabled: pe
108
- }), _ = (e) => e ? `highlighted${Z ? " keyboard-highlight" : ""}` : "";
109
- W(() => {
110
- if (T.current) {
111
- T.current = !1;
109
+ isItemDisabled: fe
110
+ }), _ = (e) => e ? `highlighted${te ? " keyboard-highlight" : ""}` : "";
111
+ x(() => {
112
+ if (O.current) {
113
+ O.current = !1;
112
114
  return;
113
115
  }
114
- f(G(v || []));
115
- }, [v, g, u]), W(() => {
116
- const e = g.filter((t) => t.label.toLowerCase().includes(r.toLowerCase()) || t.value.toLowerCase().includes(r.toLowerCase()));
117
- se(e);
118
- }, [r, g]), W(() => {
119
- u && w.length === 0 && r.trim() && h === -1 && Re(L, {
116
+ f(q(v || []));
117
+ }, [v, g, u]), x(() => {
118
+ const e = g.filter((t) => t.label.toLowerCase().includes(a.toLowerCase()) || t.value.toLowerCase().includes(a.toLowerCase()));
119
+ ue(e);
120
+ }, [a, g]), x(() => {
121
+ u && w.length === 0 && a.trim() && h === -1 && Ke(L, {
120
122
  assertiveness: "polite",
121
123
  batchId: "dropdown-input-tags-empty-state",
122
124
  delay: 300
123
125
  });
124
- }, [w.length, u, r, h]);
125
- const fe = (e) => {
126
- if (l) return;
127
- const t = a.filter((n, s) => s !== e);
126
+ }, [w.length, u, a, h]);
127
+ const ve = (e) => {
128
+ if (o || K.includes(l[e]?.value)) return;
129
+ const t = l.filter((n, s) => s !== e);
128
130
  f(t), (!m || S || m && !u) && i?.(t.map((n) => n.value));
129
- }, ge = (e) => {
130
- if (!l) {
131
- if (e.key === "Backspace" && r === "" && a.length > 0) {
132
- e.preventDefault();
133
- const t = a.slice(0, -1);
131
+ }, we = (e) => {
132
+ if (!o) {
133
+ if (e.key === "Backspace" && a === "" && l.length > 0) {
134
+ if (e.preventDefault(), K.includes(l[l.length - 1]?.value)) return;
135
+ const t = l.slice(0, -1);
134
136
  f(t), i?.(t.map((n) => n.value));
135
137
  return;
136
138
  }
137
- if (e.key === "Enter" && r.trim() && K.length === 0 && j) {
139
+ if (e.key === "Enter" && a.trim() && V.length === 0 && z) {
138
140
  e.preventDefault();
139
- const t = [...a];
140
- t.some((n) => n.value === r.trim()) || (t.push({
141
- label: r.trim(),
142
- value: r.trim()
143
- }), f(t), i?.(t.map((n) => n.value))), y(""), b(-1), p(!1);
141
+ const t = [...l];
142
+ t.some((n) => n.value === a.trim()) || (t.push({
143
+ label: a.trim(),
144
+ value: a.trim()
145
+ }), f(t), i?.(t.map((n) => n.value))), y(""), E(-1), p(!1);
144
146
  return;
145
147
  }
146
- Y.onKeyDown(e);
148
+ ee.onKeyDown(e);
147
149
  }
148
- }, he = (e) => {
149
- if (l) return;
150
+ }, Ee = (e) => {
151
+ if (o) return;
150
152
  const t = e.target.value;
151
- y(t), b(-1), t.trim() && !u && p(!0);
152
- }, ve = () => {
153
- l || (r.trim() || g.length > 0) && p(!0);
154
- }, we = (e) => {
155
- l || (e.stopPropagation(), $.current?.focus(), !u && (r.trim() || g.length > 0) && p(!0));
156
- }, be = (e) => {
157
- if (l) {
153
+ y(t), E(-1), t.trim() && !u && p(!0);
154
+ }, be = () => {
155
+ o || (a.trim() || g.length > 0) && p(!0);
156
+ }, ke = (e) => {
157
+ o || (e.stopPropagation(), $.current?.focus(), !u && (a.trim() || g.length > 0) && p(!0));
158
+ }, ye = (e) => {
159
+ if (o) {
158
160
  e.preventDefault(), e.stopPropagation();
159
161
  return;
160
162
  }
161
163
  e.target.closest(".input-with-tags-container") && e.stopPropagation();
162
- }, Ee = () => {
163
- l || p(!u);
164
+ }, Se = () => {
165
+ o || p(!u);
164
166
  };
165
- De(re, () => ({
166
- toggleDropdown: Ee
167
+ Ie(ce, () => ({
168
+ toggleDropdown: Se
167
169
  }), []);
168
- const ke = (e, t, n, s) => {
169
- const P = a.some((C) => C.value === e.value), A = h === t, F = N(t, P);
170
- return /* @__PURE__ */ o.createElement("div", d({
170
+ const Ne = (e, t, n, s) => {
171
+ const P = l.some((C) => C.value === e.value), T = h === t, M = N(t, P);
172
+ return /* @__PURE__ */ r.createElement("div", d({
171
173
  key: e.id
172
- }, F, {
173
- className: `dropdown-with-input-tags-option ${_(A)}`,
174
+ }, M, {
175
+ className: `dropdown-with-input-tags-option ${_(T)}`,
174
176
  onClick: () => !s && n(e),
175
- onMouseEnter: () => b(t),
177
+ onMouseEnter: () => E(t),
176
178
  "data-automation-id": `${c}-option-${e.id}`
177
- }), /* @__PURE__ */ o.createElement("span", {
179
+ }), /* @__PURE__ */ r.createElement("span", {
178
180
  className: "option-label"
179
- }, e.label), e.value !== e.label && /* @__PURE__ */ o.createElement("span", {
181
+ }, e.label), e.value !== e.label && /* @__PURE__ */ r.createElement("span", {
180
182
  className: "option-value"
181
183
  }, e.value));
182
- }, ye = () => {
183
- T.current = !0;
184
- const e = a.map((t) => t.value);
184
+ }, _e = () => {
185
+ O.current = !0;
186
+ const e = l.map((t) => t.value);
185
187
  i?.(e), p(!1);
186
- }, Se = () => {
188
+ }, Pe = () => {
187
189
  f([]);
188
- }, Ne = (e, t) => {
189
- const n = a.some((A) => A.value === e.value), s = h === t, P = N(t, n);
190
- return /* @__PURE__ */ o.createElement("div", d({
190
+ }, Ce = (e, t) => {
191
+ const n = l.some((T) => T.value === e.value), s = h === t, P = N(t, n);
192
+ return /* @__PURE__ */ r.createElement("div", d({
191
193
  key: e.id
192
194
  }, P, {
193
195
  className: `dropdown-with-input-tags-option dropdown-with-input-tags-multi-select-option ${_(s)}`,
194
196
  "aria-checked": n,
195
197
  onClick: () => {
196
- l || (V(!n, e), $.current?.focus());
198
+ o || (F(!n, e), $.current?.focus());
197
199
  },
198
- onMouseEnter: () => b(t),
200
+ onMouseEnter: () => E(t),
199
201
  "data-automation-id": `${c}-option-${e.id}`
200
- }), /* @__PURE__ */ o.createElement(Ie, {
202
+ }), /* @__PURE__ */ r.createElement(Re, {
201
203
  automationId: "checkbox",
202
204
  className: "checkbox",
203
205
  checked: n,
@@ -206,113 +208,113 @@ const Ge = /* @__PURE__ */ Ce(({
206
208
  label: e.label,
207
209
  tabIndex: -1
208
210
  }));
209
- }, _e = () => /* @__PURE__ */ o.createElement("div", {
211
+ }, De = () => /* @__PURE__ */ r.createElement("div", {
210
212
  className: "dropdown-with-input-tags-ctas-container",
211
213
  onKeyDown: (e) => {
212
214
  (e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End") && e.stopPropagation();
213
215
  }
214
- }, /* @__PURE__ */ o.createElement(ee, {
216
+ }, /* @__PURE__ */ r.createElement(ne, {
215
217
  label: "Clear",
216
218
  type: "link",
217
219
  size: "sm",
218
- onClick: Se,
220
+ onClick: Pe,
219
221
  automationId: `${c}-clear-button`
220
- }), /* @__PURE__ */ o.createElement(ee, {
222
+ }), /* @__PURE__ */ r.createElement(ne, {
221
223
  label: "Apply",
222
224
  type: "primary",
223
225
  size: "sm",
224
- onClick: ye,
226
+ onClick: _e,
225
227
  automationId: `${c}-apply-button`
226
228
  }));
227
- return /* @__PURE__ */ o.createElement("div", d({
228
- className: `dropdown-with-input-tags-wrapper ${k} ${l ? "disabled-wrapper" : ""}`,
229
+ return /* @__PURE__ */ r.createElement("div", d({
230
+ className: `dropdown-with-input-tags-wrapper ${k} ${o ? "disabled-wrapper" : ""}`,
229
231
  "data-automation-id": c
230
- }, me), D && /* @__PURE__ */ o.createElement("label", {
231
- id: q,
232
+ }, ge), D && /* @__PURE__ */ r.createElement("label", {
233
+ id: J,
232
234
  className: "dropdown-with-input-tags-label"
233
- }, D), /* @__PURE__ */ o.createElement("div", {
234
- onClick: be
235
- }, /* @__PURE__ */ o.createElement($e, {
236
- ref: ie,
235
+ }, D), /* @__PURE__ */ r.createElement("div", {
236
+ onClick: ye
237
+ }, /* @__PURE__ */ r.createElement(Ae, {
238
+ ref: pe,
237
239
  className: "dropdown-with-input-tags-popover",
238
240
  contentWidth: "full",
239
241
  position: "bottom-left",
240
- isPopoverOpen: !l && u,
241
- onPopoverToggle: l ? () => {
242
+ isPopoverOpen: !o && u,
243
+ onPopoverToggle: o ? () => {
242
244
  } : p,
243
245
  disableClickToggle: !0,
244
- isWithPortal: ae,
246
+ isWithPortal: ie,
245
247
  renderPopoverContents: ({
246
248
  closePopoverCb: e
247
- }) => /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("div", d({}, de, {
249
+ }) => /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", d({}, he, {
248
250
  className: "dropdown-with-input-tags-content"
249
251
  }, m && {
250
252
  "aria-multiselectable": "true"
251
253
  }), w.length > 0 ? w.map((t, n) => {
252
- if (t.value === O) {
253
- const C = h === n, Pe = N(n, !1);
254
- return /* @__PURE__ */ o.createElement("div", d({
254
+ if (t.value === A) {
255
+ const C = h === n, $e = N(n, !1);
256
+ return /* @__PURE__ */ r.createElement("div", d({
255
257
  key: t.id
256
- }, Pe, {
258
+ }, $e, {
257
259
  className: `dropdown-with-input-tags-option dropdown-with-input-tags-custom-option ${_(C)}`,
258
260
  onClick: () => {
259
- l || (Q(t), e());
261
+ o || (X(t), e());
260
262
  },
261
- onMouseEnter: () => b(n)
262
- }), 'Add "', r.trim(), '"');
263
+ onMouseEnter: () => E(n)
264
+ }), 'Add "', a.trim(), '"');
263
265
  }
264
266
  if (m)
265
- return Ne(t, n);
266
- const s = a.some((C) => C.value === t.value), P = h === n, F = {
267
+ return Ce(t, n);
268
+ const s = l.some((C) => C.value === t.value), P = h === n, M = {
267
269
  ...N(n, s),
268
- onMouseEnter: () => b(n),
270
+ onMouseEnter: () => E(n),
269
271
  className: `dropdown-with-input-tags-option ${_(P)}`
270
272
  };
271
- return x ? x(t, F, I) : ke(t, n, I, l);
272
- }) : /* @__PURE__ */ o.createElement("div", d({}, N(0, !1), {
273
+ return j ? j(t, M, I) : Ne(t, n, I, o);
274
+ }) : /* @__PURE__ */ r.createElement("div", d({}, N(0, !1), {
273
275
  className: `dropdown-with-input-tags-no-options ${_(h === 0)}`
274
- }), /* @__PURE__ */ o.createElement("div", {
276
+ }), /* @__PURE__ */ r.createElement("div", {
275
277
  className: "dropdown-with-input-tags-no-options-text"
276
- }, L))), m && !S && _e()),
277
- renderPopoverSrcElement: () => /* @__PURE__ */ o.createElement("div", {
278
+ }, L))), m && !S && De()),
279
+ renderPopoverSrcElement: () => /* @__PURE__ */ r.createElement("div", {
278
280
  className: "dropdown-with-input-tags-input-container"
279
- }, /* @__PURE__ */ o.createElement("div", {
280
- className: `input-with-tags-container ${l ? "disabled-input-with-tags-container" : ""} ${Z ? "keyboard-focused" : ""}`,
281
- onClick: we,
281
+ }, /* @__PURE__ */ r.createElement("div", {
282
+ className: `input-with-tags-container ${o ? "disabled-input-with-tags-container" : ""} ${te ? "keyboard-focused" : ""}`,
283
+ onClick: ke,
282
284
  onKeyDown: (e) => {
283
285
  e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && $.current?.focus();
284
286
  }
285
- }, a.map((e, t) => /* @__PURE__ */ o.createElement("span", {
287
+ }, l.map((e, t) => /* @__PURE__ */ r.createElement("span", {
286
288
  key: t,
287
289
  className: "tag-in-inputwithtags"
288
- }, e[B], !l && /* @__PURE__ */ o.createElement(Te, {
290
+ }, e[G], !o && !K.includes(e.value) && /* @__PURE__ */ r.createElement(Te, {
289
291
  name: "close",
290
292
  className: "close-icon-in-inputwithtags",
291
- ariaLabel: `Remove tag ${e[B]}`,
292
- onClick: () => fe(t),
293
+ ariaLabel: `Remove tag ${e[G]}`,
294
+ onClick: () => ve(t),
293
295
  shouldStopPropagation: !0
294
- }))), (z || !a.length || m) && /* @__PURE__ */ o.createElement("input", d({
296
+ }))), (B || !l.length || m) && /* @__PURE__ */ r.createElement("input", d({
295
297
  ref: $
296
- }, Y, {
298
+ }, ee, {
297
299
  type: "text",
298
- value: r,
299
- onChange: he,
300
- onKeyDown: ge,
301
- onFocus: ve,
302
- placeholder: a.length === 0 ? E : "",
303
- className: `input-with-tags-input${!z && a.length > 0 && !r ? " sr-only" : ""}`,
304
- disabled: l
305
- }, Oe({
306
- ariaLabel: ne || (D ? void 0 : "Search and select options"),
300
+ value: a,
301
+ onChange: Ee,
302
+ onKeyDown: we,
303
+ onFocus: be,
304
+ placeholder: l.length === 0 ? b : "",
305
+ className: `input-with-tags-input${!B && l.length > 0 && !a ? " sr-only" : ""}`,
306
+ disabled: o
307
+ }, Le({
308
+ ariaLabel: re || (D ? void 0 : "Search and select options"),
307
309
  ariaLabelledBy: oe,
308
- internalLabelId: D ? q : void 0,
309
- ariaDescribedBy: le
310
+ internalLabelId: D ? J : void 0,
311
+ ariaDescribedBy: ae
310
312
  }))))),
311
313
  automationId: c,
312
314
  popoverContentAutomationId: `${c}-content`
313
315
  })));
314
316
  });
315
317
  export {
316
- Ge as DropdownWithInputTags
318
+ Qe as DropdownWithInputTags
317
319
  };
318
320
  //# sourceMappingURL=index39.js.map