se-design 1.0.83-dev.5 → 1.0.84-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.
package/dist/index19.js CHANGED
@@ -1,266 +1,251 @@
1
- import B, { forwardRef as ge, useState as F, useRef as oe, useEffect as M, useImperativeHandle as we } from "react";
1
+ import B, { forwardRef as we, useState as F, useRef as te, useEffect as M, useImperativeHandle as ge } from "react";
2
2
  import he from "react-dom";
3
3
  import { getA11yNameAttributes as be } from "./index81.js";
4
- import { useDismissOnFocusOut as Ee } from "./index80.js";
5
- import { getFirstFocusableElement as R, getLastFocusableElement as ye, getFocusableElements as T, FOCUSABLE_WITH_ROLES_SELECTOR as ke } from "./index71.js";
4
+ import { useDismissOnFocusOut as ye } from "./index80.js";
5
+ import { getFirstFocusableElement as D, getLastFocusableElement as Ee, getFocusableElements as N, FOCUSABLE_WITH_ROLES_SELECTOR as ke } from "./index71.js";
6
6
  import "./index72.js";
7
7
  import { useRegisterPortalWithFocusTrap as Pe } from "./index208.js";
8
- function C() {
9
- return C = Object.assign ? Object.assign.bind() : function(b) {
8
+ function T() {
9
+ return T = Object.assign ? Object.assign.bind() : function(y) {
10
10
  for (var E = 1; E < arguments.length; E++) {
11
11
  var m = arguments[E];
12
- for (var h in m) ({}).hasOwnProperty.call(m, h) && (b[h] = m[h]);
12
+ for (var h in m) ({}).hasOwnProperty.call(m, h) && (y[h] = m[h]);
13
13
  }
14
- return b;
15
- }, C.apply(null, arguments);
14
+ return y;
15
+ }, T.apply(null, arguments);
16
16
  }
17
- const Se = /* @__PURE__ */ ge(({
18
- className: b = "",
17
+ const He = /* @__PURE__ */ we(({
18
+ className: y = "",
19
19
  automationId: E = "",
20
20
  position: m = "bottom-center",
21
21
  popoverContentAutomationId: h = "",
22
- contentWidth: D = "max",
22
+ contentWidth: R = "max",
23
23
  renderPopoverContents: K,
24
- renderPopoverSrcElement: ne,
24
+ renderPopoverSrcElement: oe,
25
25
  onPopoverToggle: z,
26
- isPopoverOpen: q,
27
- disabled: y = !1,
26
+ isPopoverOpen: C,
27
+ disabled: k = !1,
28
28
  isWithPortal: f = !1,
29
- ariaLabel: re,
30
- ariaLabelledBy: se,
31
- sourceRole: _ = "button",
32
- popupType: $ = "true",
33
- popoverContentStyleProperty: U = {
29
+ ariaLabel: ne,
30
+ ariaLabelledBy: re,
31
+ sourceRole: q = "button",
32
+ popupType: _ = "true",
33
+ popoverContentStyleProperty: $ = {
34
34
  zIndex: 1e3,
35
35
  borderColor: "var(--color-gray-200)",
36
36
  color: "var(--color-gray-900)",
37
37
  backgroundColor: "var(--color-white)"
38
38
  },
39
- disableClickToggle: w = !1,
40
- noBorder: ce = !1,
39
+ disableClickToggle: g = !1,
40
+ noBorder: se = !1,
41
41
  disableAutoClose: v = !1,
42
- focusFirstOnOpen: O = !1,
43
- ...ie
42
+ focusFirstOnOpen: ie = !1,
43
+ ...ce
44
44
  }, ae) => {
45
- const [c, p] = F(!1), [k, V] = F(m), [le, X] = F(!1), l = oe(null), i = oe(null);
46
- Pe(i, f && c);
45
+ const [i, p] = F(!1), [P, U] = F(m), [le, V] = F(!1), l = te(null), c = te(null);
46
+ Pe(c, f && i);
47
47
  const ue = be({
48
- ariaLabel: re,
49
- ariaLabelledBy: se,
48
+ ariaLabel: ne,
49
+ ariaLabelledBy: re,
50
50
  ariaDescribedBy: void 0
51
51
  // Popover doesn't support describedBy yet
52
52
  }), {
53
53
  onBlurCapture: fe
54
- } = Ee({
55
- disabled: !c || v || f,
54
+ } = ye({
55
+ disabled: !i || v || f,
56
56
  onFocusOut: () => p(!1),
57
57
  closeOnEscape: !1
58
58
  }), [L, A] = F({
59
59
  top: 0,
60
60
  left: 0,
61
61
  srcWidth: 0
62
- }), [pe, j] = F(!1), P = () => {
63
- w ? (R({
62
+ }), [pe, W] = F(!1), b = () => {
63
+ g ? (D({
64
64
  container: l.current,
65
65
  includeRoles: !0
66
66
  }) ?? l.current)?.focus() : l.current?.focus();
67
- }, W = (e) => {
67
+ }, X = (e) => {
68
68
  p(!1), e?.returnFocus !== !1 && requestAnimationFrame(() => {
69
- e?.returnFocusTo ? (e.returnFocusTo instanceof HTMLElement ? e.returnFocusTo : e.returnFocusTo.current)?.focus() : P();
69
+ e?.returnFocusTo ? (e.returnFocusTo instanceof HTMLElement ? e.returnFocusTo : e.returnFocusTo.current)?.focus() : b();
70
70
  });
71
- }, H = (e = "bottom-center") => {
71
+ }, O = (e = "bottom-center") => {
72
72
  if (!l.current) return {
73
73
  top: 0,
74
74
  left: 0,
75
75
  srcWidth: 0
76
76
  };
77
77
  let o = e;
78
- const t = l.current.getBoundingClientRect(), n = window.innerWidth - document.documentElement.clientWidth, u = window.innerWidth - Math.max(n, 16), a = window.innerHeight;
79
- let r = 0, s = 0;
78
+ const t = l.current.getBoundingClientRect(), r = window.innerWidth - document.documentElement.clientWidth, u = window.innerWidth - Math.max(r, 16), a = window.innerHeight;
79
+ let n = 0, s = 0;
80
80
  switch (o) {
81
81
  case "bottom-left":
82
- r = t.bottom, s = t.left;
82
+ n = t.bottom, s = t.left;
83
83
  break;
84
84
  case "bottom-right":
85
- r = t.bottom, s = t.right - t.width * 0.5;
85
+ n = t.bottom, s = t.right - t.width * 0.5;
86
86
  break;
87
87
  case "bottom-center":
88
- r = t.bottom, s = t.left + t.width / 2;
88
+ n = t.bottom, s = t.left + t.width / 2;
89
89
  break;
90
90
  case "top-left":
91
- r = t.top - t.height * 1.9, s = t.left;
91
+ n = t.top - t.height * 1.9, s = t.left;
92
92
  break;
93
93
  case "top-right":
94
- r = t.top - t.height * 1.9, s = t.right - t.width * 0.5;
94
+ n = t.top - t.height * 1.9, s = t.right - t.width * 0.5;
95
95
  break;
96
96
  case "top-center":
97
- r = t.top - t.height * 1.9, s = t.left + t.width / 2;
97
+ n = t.top - t.height * 1.9, s = t.left + t.width / 2;
98
98
  break;
99
99
  default:
100
- r = t.bottom, s = t.left;
100
+ n = t.bottom, s = t.left;
101
101
  break;
102
102
  }
103
- const d = i.current?.getBoundingClientRect(), x = (D === "full" ? Math.max(t.width, d?.width || 0) : d?.width) || 0, g = d?.height || 0;
104
- if ((o === "bottom-center" || o === "top-center") && (s = s - x / 2), s + x > u && (s = Math.max(0, u - x)), s < 0 && (s = 0), r + g > a) {
105
- const te = t.top, ve = a - t.bottom;
106
- te >= g || te > ve ? (r = t.top - g, r < 48 && (r = 48)) : r = Math.max(48, a - g);
103
+ const d = c.current?.getBoundingClientRect(), x = (R === "full" ? Math.max(t.width, d?.width || 0) : d?.width) || 0, w = d?.height || 0;
104
+ if ((o === "bottom-center" || o === "top-center") && (s = s - x / 2), s + x > u && (s = Math.max(0, u - x)), s < 0 && (s = 0), n + w > a) {
105
+ const ee = t.top, ve = a - t.bottom;
106
+ ee >= w || ee > ve ? (n = t.top - w, n < 48 && (n = 48)) : n = Math.max(48, a - w);
107
107
  }
108
- return r < 48 && (r = t.bottom, r + g > a && (r = Math.max(48, a - g))), {
109
- top: Math.round(r),
108
+ return n < 48 && (n = t.bottom, n + w > a && (n = Math.max(48, a - w))), {
109
+ top: Math.round(n),
110
110
  left: Math.round(s),
111
111
  srcWidth: t.width
112
112
  };
113
113
  };
114
114
  M(() => {
115
- if (z && z(c), c && !f)
116
- return v || document.body.addEventListener("click", Y, !0), de(), () => {
117
- v || document.body.removeEventListener("click", Y, !0);
115
+ if (z && z(i), i && !f)
116
+ return v || document.body.addEventListener("click", j, !0), de(), () => {
117
+ v || document.body.removeEventListener("click", j, !0);
118
118
  };
119
- if (c && f) {
120
- v ? window.addEventListener("scroll", J) : (document.body.addEventListener("click", I, !0), window.addEventListener("scroll", I)), window.addEventListener("resize", G);
121
- const e = (n) => {
122
- n.key === "Escape" && i.current?.contains(document.activeElement) && (n.preventDefault(), n.stopPropagation(), p(!1), requestAnimationFrame(() => P()));
119
+ if (i && f) {
120
+ v ? window.addEventListener("scroll", G) : (document.body.addEventListener("click", I, !0), window.addEventListener("scroll", I)), window.addEventListener("resize", Y);
121
+ const e = (r) => {
122
+ r.key === "Escape" && c.current?.contains(document.activeElement) && (r.preventDefault(), r.stopPropagation(), p(!1), requestAnimationFrame(() => b()));
123
123
  };
124
- window.addEventListener("keydown", e, !0), S();
124
+ window.addEventListener("keydown", e, !0), H();
125
125
  let o, t;
126
126
  return o = requestAnimationFrame(() => {
127
127
  t = requestAnimationFrame(() => {
128
- const n = H(k);
129
- n && A(n), j(!0);
128
+ const r = O(P);
129
+ r && A(r), W(!0);
130
130
  });
131
131
  }), () => {
132
- v ? window.removeEventListener("scroll", J) : (document.body.removeEventListener("click", I, !0), window.removeEventListener("scroll", I)), window.removeEventListener("resize", G), window.removeEventListener("keydown", e, !0), cancelAnimationFrame(o), cancelAnimationFrame(t), j(!1);
132
+ v ? window.removeEventListener("scroll", G) : (document.body.removeEventListener("click", I, !0), window.removeEventListener("scroll", I)), window.removeEventListener("resize", Y), window.removeEventListener("keydown", e, !0), cancelAnimationFrame(o), cancelAnimationFrame(t), W(!1);
133
133
  };
134
134
  }
135
- }, [c, f, v]);
136
- const S = () => {
135
+ }, [i, f, v]);
136
+ const H = () => {
137
137
  if (!l.current) {
138
- X(!1);
138
+ V(!1);
139
139
  return;
140
140
  }
141
- const e = l.current.getBoundingClientRect(), o = window.innerHeight, t = window.innerWidth, n = e.top < o && e.bottom > 0 && e.left < t && e.right > 0;
142
- X(n);
141
+ const e = l.current.getBoundingClientRect(), o = window.innerHeight, t = window.innerWidth, r = e.top < o && e.bottom > 0 && e.left < t && e.right > 0;
142
+ V(r);
143
143
  };
144
144
  M(() => {
145
- p(q ?? !1);
146
- }, [q]), M(() => {
147
- c && setTimeout(() => {
148
- const e = R({
149
- container: i.current,
145
+ p(C ?? !1);
146
+ }, [C]), M(() => {
147
+ i && setTimeout(() => {
148
+ const e = D({
149
+ container: c.current,
150
150
  includeRoles: !0
151
151
  });
152
- console.log("[Popover open] focus check:", {
153
- hasFocusable: !!e,
154
- focusFirstOnOpen: O,
155
- isSrcFocused: document.activeElement === l.current,
156
- activeEl: document.activeElement?.className?.slice(0, 50),
157
- willFocus: !!(e && (O || document.activeElement === l.current)),
158
- isWithPortal: f,
159
- hasPortalContent: !!i.current
160
- }), e && (O || document.activeElement === l.current) && e.focus();
152
+ e && (ie || document.activeElement === l.current) && e.focus();
161
153
  }, f ? 60 : 0);
162
- }, [c]);
154
+ }, [i]);
163
155
  const de = () => {
164
- if (!i.current) return;
165
- const e = i.current.getBoundingClientRect(), o = window.innerHeight;
166
- e?.bottom > o ? V(m.includes("left") ? "top-left" : m.includes("right") ? "top-right" : "top-center") : e?.top < 0 && V(m.includes("left") ? "bottom-left" : m.includes("right") ? "bottom-right" : "bottom-center");
167
- }, Y = (e) => {
156
+ if (!c.current) return;
157
+ const e = c.current.getBoundingClientRect(), o = window.innerHeight;
158
+ e?.bottom > o ? U(m.includes("left") ? "top-left" : m.includes("right") ? "top-right" : "top-center") : e?.top < 0 && U(m.includes("left") ? "bottom-left" : m.includes("right") ? "bottom-right" : "bottom-center");
159
+ }, j = (e) => {
168
160
  const o = l.current;
169
161
  if (!o) return;
170
- const t = e.target, n = o.contains(t), u = i.current?.contains(t), r = t.closest?.(".se-design-popover-wrapper"), s = r && r !== o, d = i.current?.contains(r);
171
- v || (!n && !u || s && !d) && p(!1);
162
+ const t = e.target, r = o.contains(t), u = c.current?.contains(t), n = t.closest?.(".se-design-popover-wrapper"), s = n && n !== o, d = c.current?.contains(n);
163
+ v || (!r && !u || s && !d) && p(!1);
172
164
  }, I = (e) => {
173
- const o = l.current, t = i.current;
165
+ const o = l.current, t = c.current;
174
166
  if (!o) return;
175
- if (S(), e.type === "scroll" && c) {
176
- const g = H(k);
177
- g && A(g);
167
+ if (H(), e.type === "scroll" && i) {
168
+ const w = O(P);
169
+ w && A(w);
178
170
  }
179
- const n = e.target, u = o.contains(n), a = t?.contains(n), s = n.closest?.(".se-design-popover-wrapper"), d = s && s !== o, x = i.current?.contains(s);
171
+ const r = e.target, u = o.contains(r), a = t?.contains(r), s = r.closest?.(".se-design-popover-wrapper"), d = s && s !== o, x = c.current?.contains(s);
180
172
  v || (!u && !a || d && !x) && p(!1);
181
- }, G = () => {
182
- if (c && f && l.current) {
183
- S();
184
- const e = H(k);
173
+ }, Y = () => {
174
+ if (i && f && l.current) {
175
+ H();
176
+ const e = O(P);
185
177
  e && A(e);
186
178
  }
187
- }, J = () => {
188
- if (c && f && l.current) {
189
- S();
190
- const e = H(k);
179
+ }, G = () => {
180
+ if (i && f && l.current) {
181
+ H();
182
+ const e = O(P);
191
183
  e && A(e);
192
184
  }
193
- }, N = (e = !1) => {
194
- const o = c;
185
+ }, S = (e = !1) => {
186
+ const o = i;
195
187
  p((t) => !t), !o && e && setTimeout(() => {
196
188
  if (e === "last") {
197
- const t = ye({
198
- container: i.current,
189
+ const t = Ee({
190
+ container: c.current,
199
191
  includeRoles: !0
200
192
  });
201
193
  t && t.focus();
202
194
  } else {
203
- const t = R({
204
- container: i.current,
195
+ const t = D({
196
+ container: c.current,
205
197
  includeRoles: !0
206
198
  });
207
199
  t && t.focus();
208
200
  }
209
201
  }, 50);
210
- }, Q = (e, o) => {
202
+ }, J = (e, o) => {
211
203
  if (!o) return;
212
204
  const t = document.activeElement;
213
205
  if (t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.tagName === "SELECT")
214
206
  return;
215
- const n = Array.from(o.querySelectorAll(ke)).filter((r) => {
216
- const s = window.getComputedStyle(r);
217
- return !r.hasAttribute("disabled") && r.getAttribute("aria-disabled") !== "true" && s.display !== "none" && s.visibility !== "hidden" && (r.tabIndex >= 0 || r.hasAttribute("role"));
207
+ const r = Array.from(o.querySelectorAll(ke)).filter((n) => {
208
+ const s = window.getComputedStyle(n);
209
+ return !n.hasAttribute("disabled") && n.getAttribute("aria-disabled") !== "true" && s.display !== "none" && s.visibility !== "hidden" && (n.tabIndex >= 0 || n.hasAttribute("role"));
218
210
  });
219
- if (n.length === 0) return;
220
- const u = n.findIndex((r) => r === document.activeElement);
211
+ if (r.length === 0) return;
212
+ const u = r.findIndex((n) => n === document.activeElement);
221
213
  let a = -1;
222
- e.key === "ArrowDown" ? (e.preventDefault(), e.stopPropagation(), a = u < n.length - 1 ? u + 1 : 0) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), a = u > 0 ? u - 1 : n.length - 1) : e.key === "Home" ? (e.preventDefault(), e.stopPropagation(), a = 0) : e.key === "End" && (e.preventDefault(), e.stopPropagation(), a = n.length - 1), console.log("[Popover] arrowNav:", {
223
- focusableCount: n.length,
224
- currentIndex: u,
225
- nextIndex: a,
226
- activeEl: document.activeElement?.tagName,
227
- activeRole: document.activeElement?.getAttribute("role"),
228
- firstEl: n[0]?.tagName + "." + n[0]?.className?.slice(0, 30)
229
- }), a >= 0 && n[a] ? n[a].focus() : u === -1 && n.length > 0 && n[0].focus();
230
- }, Z = (e) => {
214
+ e.key === "ArrowDown" ? (e.preventDefault(), e.stopPropagation(), a = u < r.length - 1 ? u + 1 : 0) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), a = u > 0 ? u - 1 : r.length - 1) : e.key === "Home" ? (e.preventDefault(), e.stopPropagation(), a = 0) : e.key === "End" && (e.preventDefault(), e.stopPropagation(), a = r.length - 1), a >= 0 && r[a] ? r[a].focus() : u === -1 && r.length > 0 && r[0].focus();
215
+ }, Q = (e) => {
231
216
  if (e.key === "Escape")
232
- e.preventDefault(), e.stopPropagation(), p(!1), requestAnimationFrame(() => P());
217
+ e.preventDefault(), e.stopPropagation(), p(!1), requestAnimationFrame(() => b());
233
218
  else if (e.key === "Tab") {
234
- if ($ === "dialog") {
235
- const o = T({
236
- container: i.current,
219
+ if (_ === "dialog") {
220
+ const o = N({
221
+ container: c.current,
237
222
  filterHidden: !0
238
- }), t = o.indexOf(e.target), n = t === o.length - 1, u = t === 0 || t === -1;
223
+ }), t = o.indexOf(e.target), r = t === o.length - 1, u = t === 0 || t === -1;
239
224
  if (e.shiftKey && u)
240
- e.preventDefault(), p(!1), P();
241
- else if (!e.shiftKey && n && (p(!1), f)) {
225
+ e.preventDefault(), p(!1), b();
226
+ else if (!e.shiftKey && r && (p(!1), f)) {
242
227
  e.preventDefault();
243
- const a = l.current, r = T({
228
+ const a = l.current, n = N({
244
229
  container: document.body,
245
230
  filterHidden: !0
246
- }), s = a ? r.indexOf(a) : -1, d = r[s + 1];
231
+ }), s = a ? n.indexOf(a) : -1, d = n[s + 1];
247
232
  d ? d.focus() : a?.focus();
248
233
  }
249
234
  } else if (p(!1), e.shiftKey)
250
- e.preventDefault(), P();
235
+ e.preventDefault(), b();
251
236
  else if (f) {
252
237
  e.preventDefault();
253
- const o = l.current, t = T({
238
+ const o = l.current, t = N({
254
239
  container: document.body,
255
240
  filterHidden: !0
256
- }), n = o ? t.indexOf(o) : -1, u = t[n + 1];
241
+ }), r = o ? t.indexOf(o) : -1, u = t[r + 1];
257
242
  u ? u.focus() : o?.focus();
258
243
  }
259
- } else e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" ? Q(e, i.current) : (e.key === "Enter" || e.key === " ") && e.stopPropagation();
244
+ } else e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Home" || e.key === "End" ? J(e, c.current) : (e.key === "Enter" || e.key === " ") && e.stopPropagation();
260
245
  };
261
- we(ae, () => ({
262
- togglePopover: N,
263
- focusTrigger: () => l.current?.focus(),
246
+ ge(ae, () => ({
247
+ togglePopover: S,
248
+ focusTrigger: () => b(),
264
249
  element: l.current
265
250
  }), []);
266
251
  const me = {
@@ -290,36 +275,33 @@ const Se = /* @__PURE__ */ ge(({
290
275
  transform: "translateX(-50%)",
291
276
  bottom: "100%"
292
277
  }
293
- }, ee = ce ? "" : "shadow-md border rounded-md";
294
- return /* @__PURE__ */ B.createElement("div", C({
295
- className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (b.length > 0 ? ` ${b}` : "") + (c ? " open" : "") + (y ? " opacity-50 cursor-not-allowed pointer-events-none" : ""),
278
+ }, Z = se ? "" : "shadow-md border rounded-md";
279
+ return /* @__PURE__ */ B.createElement("div", T({
280
+ className: "se-design-popover-wrapper cursor-pointer relative focus-outline rounded-md" + (y.length > 0 ? ` ${y}` : "") + (i ? " open" : "") + (k ? " opacity-50 cursor-not-allowed pointer-events-none" : ""),
296
281
  ref: l,
297
282
  onClick: (e) => {
298
- y || w || (e.stopPropagation(), N());
283
+ k || g || (e.stopPropagation(), S());
299
284
  },
300
285
  onKeyDown: (e) => {
301
- if (!(y || w))
286
+ if (!(k || g))
302
287
  if (e.key === "Enter" || e.key === " ") {
303
288
  e.preventDefault(), e.stopPropagation();
304
- const o = c;
305
- N(), o || setTimeout(() => {
306
- const t = R({
307
- container: i.current,
289
+ const o = i;
290
+ S(), o || setTimeout(() => {
291
+ const t = D({
292
+ container: c.current,
308
293
  includeRoles: !0
309
294
  });
310
295
  t && t.focus();
311
296
  }, f ? 60 : 0);
312
- } else if (e.key === "Escape" && c)
297
+ } else if (e.key === "Escape" && i)
313
298
  e.preventDefault(), e.stopPropagation(), p(!1);
314
- else if ((e.key === "ArrowDown" || e.key === "ArrowUp") && c) {
315
- const o = i.current;
316
- console.log("[Popover] arrow on wrapper:", {
317
- key: e.key,
318
- hasRef: !!o
319
- }), o && Q(e, o);
320
- } else e.key === "ArrowDown" && !c && (e.preventDefault(), e.stopPropagation(), p(!0), setTimeout(() => {
321
- const o = R({
322
- container: i.current,
299
+ else if ((e.key === "ArrowDown" || e.key === "ArrowUp") && i) {
300
+ const o = c.current;
301
+ o && J(e, o);
302
+ } else e.key === "ArrowDown" && !i && (e.preventDefault(), e.stopPropagation(), p(!0), setTimeout(() => {
303
+ const o = D({
304
+ container: c.current,
323
305
  includeRoles: !0
324
306
  });
325
307
  o && o.focus();
@@ -327,34 +309,34 @@ const Se = /* @__PURE__ */ ge(({
327
309
  },
328
310
  onBlurCapture: fe,
329
311
  onBlur: (e) => {
330
- if (!c || v || !f) return;
331
- const o = e.relatedTarget, t = !!(o && l.current?.contains(o)), n = !!(o && i.current?.contains(o));
332
- !t && !n && p(!1);
312
+ if (!i || v || !f) return;
313
+ const o = e.relatedTarget, t = !!(o && l.current?.contains(o)), r = !!(o && c.current?.contains(o));
314
+ !t && !r && p(!1);
333
315
  },
334
- role: w ? "none" : _,
335
- "aria-expanded": w ? void 0 : c ? "true" : "false",
336
- "aria-haspopup": w ? void 0 : _ === "combobox" ? "listbox" : $,
337
- tabIndex: y || w ? -1 : 0,
338
- "aria-disabled": w ? void 0 : y ? "true" : void 0
316
+ role: g ? "none" : q,
317
+ "aria-expanded": g ? void 0 : i ? "true" : "false",
318
+ "aria-haspopup": g ? void 0 : q === "combobox" ? "listbox" : _,
319
+ tabIndex: k || g ? -1 : 0,
320
+ "aria-disabled": g ? void 0 : k ? "true" : void 0
339
321
  }, ue, {
340
322
  "data-automation-id": E
341
- }, ie), ne({
342
- displayPopover: c,
343
- togglePopover: N
344
- }), c && !f && /* @__PURE__ */ B.createElement("div", {
345
- className: `popover-content absolute ${ee} z-[1000] ${D == "full" ? "w-full" : "w-max"}`,
323
+ }, ce), oe({
324
+ displayPopover: i,
325
+ togglePopover: S
326
+ }), i && !f && /* @__PURE__ */ B.createElement("div", {
327
+ className: `popover-content absolute ${Z} z-[1000] ${R == "full" ? "w-full" : "w-max"}`,
346
328
  style: {
347
- ...U,
348
- ...me[k]
329
+ ...$,
330
+ ...me[P]
349
331
  },
350
332
  onClick: (e) => e.stopPropagation(),
351
- onKeyDown: Z,
352
- ref: i,
333
+ onKeyDown: Q,
334
+ ref: c,
353
335
  "data-automation-id": h
354
336
  }, K({
355
- closePopoverCb: W
356
- })), f && c && le && /* @__PURE__ */ he.createPortal(/* @__PURE__ */ B.createElement("div", {
357
- className: `popover-content-with-portal z-[2002] ${ee} ${D == "full" ? "" : "w-max"}`,
337
+ closePopoverCb: X
338
+ })), f && i && le && /* @__PURE__ */ he.createPortal(/* @__PURE__ */ B.createElement("div", {
339
+ className: `popover-content-with-portal z-[2002] ${Z} ${R == "full" ? "" : "w-max"}`,
358
340
  style: {
359
341
  position: "fixed",
360
342
  top: L.top,
@@ -362,21 +344,21 @@ const Se = /* @__PURE__ */ ge(({
362
344
  visibility: pe ? "visible" : "hidden",
363
345
  maxHeight: "calc(100vh - 96px)",
364
346
  overflowY: "hidden",
365
- ...D === "full" && L.srcWidth ? {
347
+ ...R === "full" && L.srcWidth ? {
366
348
  width: `${L.srcWidth}px`
367
349
  } : {},
368
- ...U,
350
+ ...$,
369
351
  zIndex: 2002
370
352
  },
371
353
  onClick: (e) => e.stopPropagation(),
372
- onKeyDown: Z,
373
- ref: i,
354
+ onKeyDown: Q,
355
+ ref: c,
374
356
  "data-automation-id": h
375
357
  }, K({
376
- closePopoverCb: W
358
+ closePopoverCb: X
377
359
  })), document.body));
378
360
  });
379
361
  export {
380
- Se as Popover
362
+ He as Popover
381
363
  };
382
364
  //# sourceMappingURL=index19.js.map