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/index25.js CHANGED
@@ -1,11 +1,11 @@
1
- import o, { useState as K, useRef as ne, useEffect as R, useLayoutEffect as Le } from "react";
2
- import { Popover as Fe } from "./index19.js";
3
- import { Icon as re } from "./index6.js";
4
- import { Checkbox as Oe } from "./index23.js";
1
+ import n, { useState as F, useRef as ne, useEffect as R, useLayoutEffect as Pe } from "react";
2
+ import { Popover as Ae } from "./index19.js";
3
+ import { Icon as oe } from "./index6.js";
4
+ import { Checkbox as $e } from "./index23.js";
5
5
  import { Button as le } from "./index4.js";
6
- import { InputWithIcon as Be } from "./index52.js";
6
+ import { InputWithIcon as Le } from "./index56.js";
7
7
  import { useStableId as q } from "./index205.js";
8
- import { useCombobox as ae } from "./index68.js";
8
+ import { useCombobox as re } from "./index72.js";
9
9
  function p() {
10
10
  return p = Object.assign ? Object.assign.bind() : function(t) {
11
11
  for (var g = 1; g < arguments.length; g++) {
@@ -15,32 +15,32 @@ function p() {
15
15
  return t;
16
16
  }, p.apply(null, arguments);
17
17
  }
18
- const _e = (t) => {
19
- const g = t.selectedValue !== void 0, x = t.isOpen !== void 0, [S, se] = K(!1), [V, M] = K(""), [ie, T] = K(() => t?.defaultSelectedValue ? Array.isArray(t?.defaultSelectedValue) ? t?.defaultSelectedValue : [t.defaultSelectedValue] : []), b = ne(null), I = ne(null), $ = q(void 0, "dropdown-label"), H = q(void 0, "dropdown-value"), D = q(void 0, "dropdown-listbox"), c = x ? t.isOpen : S, l = g ? Array.isArray(t.selectedValue) ? t.selectedValue : t.selectedValue ? [t.selectedValue] : [] : ie, P = (e) => {
20
- x || se(e), t.onOpenChange?.(e);
18
+ const je = (t) => {
19
+ const g = t.selectedValue !== void 0, x = t.isOpen !== void 0, [S, ae] = F(!1), [V, K] = F(""), [se, T] = F(() => t?.defaultSelectedValue ? Array.isArray(t?.defaultSelectedValue) ? t?.defaultSelectedValue : [t.defaultSelectedValue] : []), y = ne(null), I = ne(null), P = q(void 0, "dropdown-label"), H = q(void 0, "dropdown-value"), C = q(void 0, "dropdown-listbox"), i = x ? t.isOpen : S, r = g ? Array.isArray(t.selectedValue) ? t.selectedValue : t.selectedValue ? [t.selectedValue] : [] : se, D = (e) => {
20
+ x || ae(e), t.onOpenChange?.(e);
21
21
  }, A = (e) => {
22
22
  g || T(e);
23
23
  }, {
24
24
  selectBy: d = "",
25
25
  optionsUniqueBy: s = "",
26
26
  displaySelected: ce = !1,
27
- dropDownOptions: j,
27
+ dropDownOptions: M,
28
28
  defaultText: u = "Select",
29
- iconColor: U = "var(--color-gray-700)",
29
+ iconColor: j = "var(--color-gray-700)",
30
30
  disabled: k = !1,
31
- dropdownClassName: de = "",
31
+ dropdownClassName: ie = "",
32
32
  hasError: W = !1,
33
- errorMessage: ue = "",
33
+ errorMessage: de = "",
34
34
  customDropdownContent: _ = null,
35
- isBorderless: me = !1,
35
+ isBorderless: ue = !1,
36
36
  shouldShowSearch: h = !1,
37
- showSearchIcon: fe = !0,
37
+ showSearchIcon: me = !0,
38
38
  searchPlaceholder: z = "Search...",
39
39
  searchResultEmptyMessage: J = "No results found",
40
- ariaLabel: y = "",
41
- customSelectedValue: L = "",
40
+ ariaLabel: b = "",
41
+ customSelectedValue: $ = "",
42
42
  isWithPortal: Q = !1,
43
- firstOptionAsHeading: X = !1
43
+ firstOptionAsHeading: U = !1
44
44
  } = t;
45
45
  R(() => {
46
46
  if (!g) {
@@ -48,78 +48,74 @@ const _e = (t) => {
48
48
  T(e);
49
49
  }
50
50
  }, [t?.defaultSelectedValue, g]), R(() => {
51
- c || M("");
52
- }, [c]), R(() => {
53
- c && h && I.current && requestAnimationFrame(() => I.current?.focus());
54
- }, [c, h]), Le(() => {
55
- t.popoverElementRef && (t.popoverElementRef.current = b.current?.element ?? null);
51
+ i || K("");
52
+ }, [i]), R(() => {
53
+ i && h && I.current && requestAnimationFrame(() => I.current?.focus());
54
+ }, [i, h]), Pe(() => {
55
+ t.popoverElementRef && (t.popoverElementRef.current = y.current?.element ?? null);
56
56
  });
57
- const a = t?.type === "multi-select", ge = () => V.trim() ? (j || []).filter((e) => (e?.[d]?.toString().toLowerCase() || "").includes(V.toLowerCase())) : j || [], F = (e) => {
58
- A([e]), P(!1), t?.onOptionClick?.(e), requestAnimationFrame(() => {
57
+ const a = t?.type === "multi-select", fe = () => V.trim() ? (M || []).filter((e) => (e?.[d]?.toString().toLowerCase() || "").includes(V.toLowerCase())) : M || [], L = (e) => {
58
+ A([e]), D(!1), t?.onOptionClick?.(e), requestAnimationFrame(() => {
59
59
  requestAnimationFrame(() => {
60
- b.current?.focusTrigger();
60
+ y.current?.focusTrigger();
61
61
  });
62
62
  });
63
- }, i = ge(), {
64
- listboxProps: ye,
63
+ }, c = fe(), {
64
+ listboxProps: ge,
65
65
  getOptionProps: be,
66
- highlightedIndex: he,
67
- setHighlightedIndex: ve,
68
- containerProps: pe,
69
- inputProps: G,
70
- isKeyboardFocused: xe
71
- } = ae({
72
- items: a ? [] : i,
66
+ highlightedIndex: ye,
67
+ setHighlightedIndex: he,
68
+ containerProps: ve,
69
+ inputProps: X
70
+ } = re({
71
+ items: a ? [] : c,
73
72
  // Only use for single-select
74
- isOpen: c && !a,
75
- onOpenChange: P,
73
+ isOpen: i && !a,
74
+ onOpenChange: D,
76
75
  onSelect: (e) => {
77
- F(e);
76
+ L(e);
78
77
  },
79
- listboxId: D,
78
+ listboxId: C,
80
79
  disabled: a || k,
81
- hasItems: i.length > 0
80
+ hasItems: c.length > 0
82
81
  }), {
83
- inputProps: O,
84
- listboxProps: B,
85
- containerProps: w,
86
- highlightedIndex: E,
87
- setHighlightedIndex: Se,
88
- isKeyboardFocused: we
89
- } = ae({
90
- items: a ? i : [],
91
- isOpen: c && a,
92
- onOpenChange: P,
82
+ inputProps: B,
83
+ listboxProps: O,
84
+ highlightedIndex: w,
85
+ setHighlightedIndex: pe
86
+ } = re({
87
+ items: a ? c : [],
88
+ isOpen: i && a,
89
+ onOpenChange: D,
93
90
  onSelect: () => {
94
91
  },
95
- listboxId: D,
92
+ listboxId: C,
96
93
  disabled: !a,
97
94
  loop: !1,
98
- hasItems: i.length > 0,
99
- closeOnTab: !1
100
- }), Ee = (e, n = !1) => a ? u : n && L ? L : e?.[d] || u, Ce = () => {
95
+ hasItems: c.length > 0
96
+ }), xe = (e, o = !1) => a ? u : o && $ ? $ : e?.[d] || u, Se = () => {
101
97
  A([]), t?.onClear?.();
102
- }, Y = (e, n = !1) => {
98
+ }, G = (e, o = !1) => {
103
99
  if (t?.renderOptionChip)
104
- return t?.renderOptionChip(e, n);
105
- if (a && l?.length > 0) {
106
- const f = l[0]?.[d] || "", C = l.length - 1;
107
- return /* @__PURE__ */ o.createElement("div", {
100
+ return t?.renderOptionChip(e, o);
101
+ if (a && r?.length > 0) {
102
+ const f = r[0]?.[d] || "", E = r.length - 1;
103
+ return /* @__PURE__ */ n.createElement("div", {
108
104
  className: "option-chip flex items-center w-full"
109
- }, /* @__PURE__ */ o.createElement("div", {
110
- className: `${C > 0 ? "w-full" : "flex-1"} truncate`
111
- }, `${u}: ${f}`), C > 0 && /* @__PURE__ */ o.createElement("div", {
105
+ }, /* @__PURE__ */ n.createElement("div", {
106
+ className: `${E > 0 ? "w-full" : "flex-1"} truncate`
107
+ }, `${u}: ${f}`), E > 0 && /* @__PURE__ */ n.createElement("div", {
112
108
  className: "flex-shrink-0"
113
- }, "+", C));
109
+ }, "+", E));
114
110
  }
115
- const r = Ee(e, n), m = !!t?.label || !!t?.ariaLabelledBy, v = n && u && e?.[d] && !L && !m;
116
- return /* @__PURE__ */ o.createElement("p", {
111
+ const l = xe(e, o), m = !!t?.label || !!t?.ariaLabelledBy, v = o && u && e?.[d] && !$ && !m;
112
+ return /* @__PURE__ */ n.createElement("p", {
117
113
  className: "option-chip flex flex-1 items-center justify-between"
118
- }, v ? `${u}: ${r}` : r);
119
- }, Z = (e) => /* @__PURE__ */ o.createElement("div", {
114
+ }, v ? `${u}: ${l}` : l);
115
+ }, Y = (e) => /* @__PURE__ */ n.createElement("div", {
120
116
  className: " w-full relative flex items-center border-b border-[var(--color-gray-300)]"
121
- }, /* @__PURE__ */ o.createElement(Be, {
122
- leftIcon: fe ? {
117
+ }, /* @__PURE__ */ n.createElement(Le, {
118
+ leftIcon: me ? {
123
119
  name: "search",
124
120
  position: "left",
125
121
  style: {
@@ -127,7 +123,7 @@ const _e = (t) => {
127
123
  }
128
124
  } : void 0,
129
125
  value: V,
130
- onChange: (n) => M(n),
126
+ onChange: (o) => K(o),
131
127
  placeholder: z,
132
128
  style: {
133
129
  margin: 0,
@@ -142,88 +138,87 @@ const _e = (t) => {
142
138
  ariaLabel: z,
143
139
  inputRef: I,
144
140
  inputProps: e
145
- })), ee = () => Z(a ? {
146
- ...O,
147
- onKeyDown: (e) => oe(e, !0)
141
+ })), Z = () => Y(a ? {
142
+ ...B,
143
+ onKeyDown: (e) => te(e, !0)
148
144
  } : {
149
- ...G,
145
+ ...X,
150
146
  onKeyDown: (e) => {
151
- G.onKeyDown(e), e.key === "Escape" && requestAnimationFrame(() => b.current?.focusTrigger());
147
+ X.onKeyDown(e), e.key === "Escape" && requestAnimationFrame(() => y.current?.focusTrigger());
152
148
  }
153
- }), Ie = (e, n) => {
154
- const r = e[d], m = l[0]?.[d] || u, v = s?.length ? e[s] == l[0]?.[s] : !0, f = ce && r === m && v, C = he === n, Ae = a ? {} : be(n, f);
155
- return /* @__PURE__ */ o.createElement("div", p({
149
+ }), we = (e, o) => {
150
+ const l = e[d], m = r[0]?.[d] || u, v = s?.length ? e[s] == r[0]?.[s] : !0, f = ce && l === m && v, E = ye === o, Ve = a ? {} : be(o, f);
151
+ return /* @__PURE__ */ n.createElement("div", p({
156
152
  key: e.id || e.value,
157
- className: `option break-words px-3 py-2 hover:bg-[var(--color-gray-100)] focus:bg-[var(--color-gray-100)] focus-outline cursor-pointer select-none flex items-center justify-between ${f ? "selected" : ""} ${C ? `bg-[var(--color-gray-100)]${xe ? " outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]" : ""}` : ""}`,
158
- onClick: () => F(e),
153
+ className: `option break-words px-3 py-2 hover:bg-[var(--color-gray-100)] focus:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center justify-between ${f ? "selected" : ""} ${E ? "bg-[var(--color-blue-50)]" : ""}`,
154
+ onClick: () => L(e),
159
155
  onKeyDown: (N) => {
160
- N.key === "Enter" || N.key === " " ? (N.preventDefault(), F(e)) : N.key === "Escape" && requestAnimationFrame(() => b.current?.focusTrigger());
156
+ N.key === "Enter" || N.key === " " ? (N.preventDefault(), L(e)) : N.key === "Escape" && requestAnimationFrame(() => y.current?.focusTrigger());
161
157
  },
162
158
  tabIndex: -1,
163
- "data-automation-id": `dropdown-option-${e?.automationId || n}`
164
- }, Ae, {
159
+ "data-automation-id": `dropdown-option-${e?.automationId || o}`
160
+ }, Ve, {
165
161
  "aria-selected": f ? "true" : "false"
166
- }), Y({
162
+ }), G({
167
163
  ...e,
168
164
  isOptionSelected: f
169
- }, !1), f && /* @__PURE__ */ o.createElement(re, {
165
+ }, !1), f && /* @__PURE__ */ n.createElement(oe, {
170
166
  name: "checkmark",
171
- stroke: U
167
+ stroke: j
172
168
  }));
173
- }, De = () => /* @__PURE__ */ o.createElement(o.Fragment, null, t?.label && X && /* @__PURE__ */ o.createElement("div", {
169
+ }, Ee = () => /* @__PURE__ */ n.createElement(n.Fragment, null, t?.label && U && /* @__PURE__ */ n.createElement("div", {
174
170
  "aria-hidden": "true",
175
171
  className: "px-3 pt-2 pb-1 text-[var(--color-gray-650)] text-xs cursor-default select-none"
176
- }, t.label), h && ee(), /* @__PURE__ */ o.createElement("div", p({
172
+ }, t.label), /* @__PURE__ */ n.createElement("div", p({
177
173
  className: "dropdown-content dropdown-options",
178
174
  "aria-label": `${u} options`
179
- }, ye), /* @__PURE__ */ o.createElement("div", {
175
+ }, ge), h && Z(), /* @__PURE__ */ n.createElement("div", {
180
176
  className: "flex flex-col max-h-80 overflow-y-auto"
181
- }, i.length > 0 ? i.map((e, n) => Ie(e, n)) : /* @__PURE__ */ o.createElement("div", {
177
+ }, c.length > 0 ? c.map((e, o) => we(e, o)) : /* @__PURE__ */ n.createElement("div", {
182
178
  className: "px-3 py-4 text-center text-[var(--color-gray-700)] text-sm",
183
179
  role: "status",
184
180
  "aria-live": "polite"
185
- }, J)))), te = (e, n) => {
186
- let r = [];
187
- e ? r = [...l, n] : r = l?.filter((m) => m[s] !== n[s]), A(r);
188
- }, Pe = () => {
189
- b.current?.togglePopover(), t?.onApply?.(l);
190
- }, oe = (e, n = !1) => {
191
- if (!(n && e.key === " ")) {
181
+ }, J)))), ee = (e, o) => {
182
+ let l = [];
183
+ e ? l = [...r, o] : l = r?.filter((m) => m[s] !== o[s]), A(l);
184
+ }, Ie = () => {
185
+ y.current?.togglePopover(), t?.onApply?.(r);
186
+ }, te = (e, o = !1) => {
187
+ if (!(o && e.key === " ")) {
192
188
  if (e.key === "Enter" || e.key === " ") {
193
- if (e.preventDefault(), E >= 0 && E < i.length) {
194
- const r = i[E], m = l.some((v) => v[s] === r[s]);
195
- te(!m, r);
189
+ if (e.preventDefault(), w >= 0 && w < c.length) {
190
+ const l = c[w], m = r.some((v) => v[s] === l[s]);
191
+ ee(!m, l);
196
192
  }
197
193
  return;
198
194
  }
199
- O.onKeyDown(e), e.key === "Escape" && (e.stopPropagation(), requestAnimationFrame(() => b.current?.focusTrigger()));
195
+ B.onKeyDown(e), e.key === "Escape" && (e.stopPropagation(), requestAnimationFrame(() => y.current?.focusTrigger()));
200
196
  }
201
- }, ke = (e, n) => {
202
- const r = l.some((f) => f[s] === e[s]), m = `${D}-option-${n}`, v = E === n;
203
- return /* @__PURE__ */ o.createElement("div", {
197
+ }, Ce = (e, o) => {
198
+ const l = r.some((f) => f[s] === e[s]), m = `${C}-option-${o}`, v = w === o;
199
+ return /* @__PURE__ */ n.createElement("div", {
204
200
  key: e.id || e.value,
205
201
  id: m,
206
202
  role: "option",
207
- "aria-selected": r,
208
- className: `option px-3 py-2 hover:bg-[var(--color-gray-100)] focus:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center gap-2 ${v ? `bg-[var(--color-gray-100)]${we ? " outline outline-[length:var(--focus-width)] -outline-offset-2 outline-[var(--focus-color)]" : ""}` : ""}`,
209
- onClick: () => te(!r, e),
210
- "data-automation-id": `dropdown-option-${e?.automationId || n}`
211
- }, /* @__PURE__ */ o.createElement(Oe, {
203
+ "aria-selected": l,
204
+ className: `option px-3 py-2 hover:bg-[var(--color-gray-100)] focus:bg-[var(--color-gray-100)] cursor-pointer select-none flex items-center gap-2 ${v ? "bg-[var(--color-blue-50)]" : ""}`,
205
+ onClick: () => ee(!l, e),
206
+ "data-automation-id": `dropdown-option-${e?.automationId || o}`
207
+ }, /* @__PURE__ */ n.createElement($e, {
212
208
  tabIndex: -1,
213
209
  ariaHidden: !0,
214
- checked: r,
210
+ checked: l,
215
211
  onChange: () => {
216
- },
217
- className: "pointer-events-none"
218
- }), /* @__PURE__ */ o.createElement("span", {
212
+ }
213
+ }), /* @__PURE__ */ n.createElement("span", {
219
214
  className: "checkbox-label"
220
215
  }, e?.label));
221
- }, Ne = () => /* @__PURE__ */ o.createElement("div", {
216
+ }, De = () => /* @__PURE__ */ n.createElement("div", {
222
217
  className: "dropdown-content dropdown-options",
223
218
  onKeyDown: (e) => {
224
219
  e.key === "Tab" && e.stopPropagation();
225
220
  }
226
- }, h && ee(), /* @__PURE__ */ o.createElement("div", p({}, B, {
221
+ }, h && Z(), /* @__PURE__ */ n.createElement("div", p({}, O, {
227
222
  "aria-label": `${u} options`,
228
223
  "aria-multiselectable": "true",
229
224
  style: {
@@ -231,115 +226,106 @@ const _e = (t) => {
231
226
  }
232
227
  }, h ? {} : {
233
228
  tabIndex: -1,
234
- "aria-activedescendant": O["aria-activedescendant"],
235
- onKeyDown: (e) => oe(e, !1),
229
+ "aria-activedescendant": B["aria-activedescendant"],
230
+ onKeyDown: (e) => te(e, !1),
236
231
  onFocus: () => {
237
- E === -1 && i.length > 0 && Se(0);
232
+ w === -1 && c.length > 0 && pe(0);
238
233
  }
239
- }), /* @__PURE__ */ o.createElement("div", {
234
+ }), /* @__PURE__ */ n.createElement("div", {
240
235
  className: "flex flex-col max-h-80 overflow-y-auto"
241
- }, i.length > 0 ? i.map((e, n) => ke(e, n)) : /* @__PURE__ */ o.createElement("div", {
236
+ }, c.length > 0 ? c.map((e, o) => Ce(e, o)) : /* @__PURE__ */ n.createElement("div", {
242
237
  className: "px-3 py-4 text-center text-[var(--color-gray-700)] text-sm",
243
238
  role: "status",
244
239
  "aria-live": "polite"
245
- }, J))), /* @__PURE__ */ o.createElement("div", {
240
+ }, J))), /* @__PURE__ */ n.createElement("div", {
246
241
  className: "flex items-center justify-end gap-4 p-3 border-t border-[var(--color-gray-200)]",
247
242
  onKeyDown: (e) => {
248
- e.key === "Tab" && e.shiftKey && (e.preventDefault(), e.stopPropagation(), h ? I.current?.focus() : B.ref.current?.focus());
243
+ e.key === "Tab" && e.shiftKey && (e.preventDefault(), e.stopPropagation(), h ? I.current?.focus() : O.ref.current?.focus());
249
244
  }
250
- }, /* @__PURE__ */ o.createElement(le, {
245
+ }, /* @__PURE__ */ n.createElement(le, {
251
246
  label: "Clear",
252
247
  type: "link",
253
248
  size: "sm",
254
- onClick: Ce,
249
+ onClick: Se,
255
250
  automationId: "se-design-dropdown-clear-button"
256
- }), /* @__PURE__ */ o.createElement(le, {
251
+ }), /* @__PURE__ */ n.createElement(le, {
257
252
  label: "Apply",
258
253
  type: "primary",
259
254
  size: "sm",
260
- onClick: Pe,
255
+ onClick: Ie,
261
256
  automationId: "se-design-dropdown-apply-button"
262
- }))), Ve = () => {
263
- const e = c ? "border-[var(--color-blue-500)]" : k ? "border-[var(--color-gray-300)]" : "border-[var(--color-gray-600)]", n = W ? "border-[var(--color-red-500)]" : "", r = `dropdown-src-element bg-[var(--color-white)] flex px-3 py-2 ${me ? "border-0" : `border rounded-md ${n || e}`} flex items-center ${de}`;
264
- return /* @__PURE__ */ o.createElement("div", {
265
- className: r
266
- }, /* @__PURE__ */ o.createElement("div", {
257
+ }))), ke = () => {
258
+ const e = i ? "border-[var(--color-blue-500)]" : k ? "border-[var(--color-gray-300)]" : "border-[var(--color-gray-600)]", o = W ? "border-[var(--color-red-500)]" : "", l = `dropdown-src-element bg-[var(--color-white)] flex px-3 py-2 ${ue ? "border-0" : `border rounded-md ${o || e}`} flex items-center ${ie}`;
259
+ return /* @__PURE__ */ n.createElement("div", {
260
+ className: l
261
+ }, /* @__PURE__ */ n.createElement("div", {
267
262
  id: H,
268
263
  className: "flex-1 min-w-0",
269
264
  "data-automation-id": t?.dropDownSelectAutomationId || "selected-dropdown-value"
270
- }, Y(l[0], !0)), /* @__PURE__ */ o.createElement("div", {
265
+ }, G(r[0], !0)), /* @__PURE__ */ n.createElement("div", {
271
266
  className: "flex-shrink-0 ml-2",
272
267
  "aria-hidden": "true"
273
- }, /* @__PURE__ */ o.createElement(re, {
268
+ }, /* @__PURE__ */ n.createElement(oe, {
274
269
  name: "chevron",
275
- rotation: c ? "180" : "0",
270
+ rotation: i ? "180" : "0",
276
271
  className: "transition-transform",
277
- stroke: U
272
+ stroke: j
278
273
  })));
279
- }, $e = () => {
280
- const e = l[0]?.[d];
281
- return y && e ? `${y}, ${e}` : y || u || "Select option";
274
+ }, Ne = () => {
275
+ const e = r[0]?.[d];
276
+ return b && e ? `${b}, ${e}` : b || u || "Select option";
282
277
  };
283
- return /* @__PURE__ */ o.createElement("div", {
278
+ return /* @__PURE__ */ n.createElement("div", {
284
279
  className: `se-design-dropdown-container${t?.className ? ` ${t?.className}` : ""}`,
285
280
  style: t?.style
286
- }, t?.label ? /* @__PURE__ */ o.createElement("div", {
287
- id: $,
288
- className: `se-design-dropdown-label ${X ? "sr-only" : "mb-[3px] text-[var(--color-gray-700)] text-sm"}`
289
- }, t?.label) : !t?.ariaLabelledBy && y ? /* @__PURE__ */ o.createElement("span", {
290
- id: $,
281
+ }, t?.label ? /* @__PURE__ */ n.createElement("div", {
282
+ id: P,
283
+ className: `se-design-dropdown-label ${U ? "sr-only" : "mb-[3px] text-[var(--color-gray-700)] text-sm"}`
284
+ }, t?.label) : !t?.ariaLabelledBy && b ? /* @__PURE__ */ n.createElement("span", {
285
+ id: P,
291
286
  className: "sr-only"
292
- }, y) : null, /* @__PURE__ */ o.createElement("div", p({
287
+ }, b) : null, /* @__PURE__ */ n.createElement("div", p({
293
288
  style: t?.style,
294
289
  className: `${k ? "bg-[var(--color-gray-50)] rounded-md cursor-not-allowed" : ""}`
295
- }, a ? {
296
- // Multi-select: only spread focus-tracking handlers for isKeyboardFocused.
297
- // Dismiss is handled by Popover — don't spread onBlurCapture.
298
- onPointerMove: w.onPointerMove,
299
- onPointerDown: w.onPointerDown,
300
- onPointerUp: w.onPointerUp,
301
- onFocusCapture: w.onFocusCapture,
302
- onKeyDownCapture: w.onKeyDownCapture
303
- } : {
304
- ...pe,
290
+ }, a ? {} : {
291
+ ...ve,
305
292
  // Portal content lives in document.body — focus moving into it looks like "focus out" to
306
293
  // the container's blur handler, causing immediate close. Suppress it; the Popover's own
307
294
  // onBlur handler checks both source and portal content and handles dismissal correctly.
308
295
  ...Q ? {
309
296
  onBlurCapture: void 0
310
297
  } : {}
311
- }), /* @__PURE__ */ o.createElement(Fe, p({
312
- ref: b,
313
- isPopoverOpen: c,
298
+ }), /* @__PURE__ */ n.createElement(Ae, p({
299
+ ref: y,
300
+ isPopoverOpen: i,
314
301
  isWithPortal: Q,
315
- renderPopoverContents: _ || (a ? Ne : De),
302
+ renderPopoverContents: _ || (a ? De : Ee),
316
303
  contentWidth: "full",
317
- popoverContentStyleProperty: t.popoverContentStyleProperty,
318
304
  renderPopoverSrcElement: t.renderSrcElement ? () => t.renderSrcElement({
319
- isOpen: c,
320
- selectedValue: l
321
- }) : Ve,
305
+ isOpen: i,
306
+ selectedValue: r
307
+ }) : ke,
322
308
  onPopoverToggle: (e) => {
323
- if (P(e), e && !a && l.length > 0) {
324
- const n = i.findIndex((r) => s ? r[s] === l[0]?.[s] : r[d] === l[0]?.[d]);
325
- n >= 0 && ve(n);
309
+ if (D(e), e && !a && r.length > 0) {
310
+ const o = c.findIndex((l) => s ? l[s] === r[0]?.[s] : l[d] === r[0]?.[d]);
311
+ o >= 0 && he(o);
326
312
  }
327
- e && a && !h && requestAnimationFrame(() => requestAnimationFrame(() => B.ref.current?.focus()));
313
+ e && a && !h && requestAnimationFrame(() => requestAnimationFrame(() => O.ref.current?.focus()));
328
314
  },
329
315
  disabled: k,
330
316
  automationId: t?.dropDownSrcAutomationId,
331
317
  popoverContentAutomationId: t?.dropDownContentAutomationId,
332
- ariaLabelledBy: t?.label || t?.ariaLabelledBy || y ? [t?.label || !t?.ariaLabelledBy && y ? $ : t?.ariaLabelledBy, H].filter(Boolean).join(" ") : void 0,
333
- ariaLabel: !t?.label && !y && !t?.ariaLabelledBy ? $e() : void 0,
318
+ ariaLabelledBy: t?.label || t?.ariaLabelledBy || b ? [t?.label || !t?.ariaLabelledBy && b ? P : t?.ariaLabelledBy, H].filter(Boolean).join(" ") : void 0,
319
+ ariaLabel: !t?.label && !b && !t?.ariaLabelledBy ? Ne() : void 0,
334
320
  sourceRole: "button",
335
321
  "aria-haspopup": "listbox"
336
- }, c ? {
337
- "aria-controls": D
338
- } : {}))), W && /* @__PURE__ */ o.createElement("div", {
322
+ }, i ? {
323
+ "aria-controls": C
324
+ } : {}))), W && /* @__PURE__ */ n.createElement("div", {
339
325
  className: "text-[var(--color-red-500)] text-sm"
340
- }, ue));
326
+ }, de));
341
327
  };
342
328
  export {
343
- _e as Dropdown
329
+ je as Dropdown
344
330
  };
345
331
  //# sourceMappingURL=index25.js.map