se-design 1.0.83-dev.3 → 1.0.83-dev.5

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