@poveste/controls 0.14.0 → 0.16.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 (60) hide show
  1. package/README.md +1 -1
  2. package/dist/HstColor-DHgxKTkm.es.js +2405 -0
  3. package/dist/HstDate-Ct5Jp_ZD.es.js +4954 -0
  4. package/dist/{HstJson-Dz6cYiFP.es.js → HstJson-D83KEa9o.es.js} +2846 -2554
  5. package/dist/HstWrapper-Bm5H3_to.es.js +2835 -0
  6. package/dist/PopoverTrigger-BVAfE9fE.es.js +974 -0
  7. package/dist/VisuallyHiddenInput-0it-_FH2.es.js +183 -0
  8. package/dist/components/HstCopyIcon.story.vue.d.ts +2 -1
  9. package/dist/components/HstCopyIcon.vue.d.ts +3 -2
  10. package/dist/components/HstTooltip.vue.d.ts +39 -0
  11. package/dist/components/HstWrapper.vue.d.ts +10 -9
  12. package/dist/components/button/HstButton.story.vue.d.ts +2 -1
  13. package/dist/components/button/HstButton.vue.d.ts +6 -5
  14. package/dist/components/button/HstButtonGroup.story.vue.d.ts +2 -1
  15. package/dist/components/button/HstButtonGroup.vue.d.ts +3 -2
  16. package/dist/components/checkbox/CheckboxVisual.vue.d.ts +7 -0
  17. package/dist/components/checkbox/HstCheckbox.story.vue.d.ts +2 -1
  18. package/dist/components/checkbox/HstCheckbox.vue.d.ts +4 -3
  19. package/dist/components/checkbox/HstCheckboxList.story.vue.d.ts +2 -1
  20. package/dist/components/checkbox/HstCheckboxList.vue.d.ts +3 -2
  21. package/dist/components/checkbox/HstSimpleCheckbox.story.vue.d.ts +2 -1
  22. package/dist/components/checkbox/HstSimpleCheckbox.vue.d.ts +8 -7
  23. package/dist/components/color/HstColor.story.vue.d.ts +3 -0
  24. package/dist/components/color/HstColor.vue.d.ts +25 -0
  25. package/dist/components/colorselect/HstColorSelect.story.vue.d.ts +2 -1
  26. package/dist/components/colorselect/HstColorSelect.vue.d.ts +4 -3
  27. package/dist/components/date/HstDate.story.vue.d.ts +3 -0
  28. package/dist/components/date/HstDate.vue.d.ts +30 -0
  29. package/dist/components/date/iso.d.ts +5 -0
  30. package/dist/components/design-tokens/HstColorShades.story.vue.d.ts +2 -1
  31. package/dist/components/design-tokens/HstColorShades.vue.d.ts +3 -2
  32. package/dist/components/design-tokens/HstTokenGrid.story.vue.d.ts +2 -1
  33. package/dist/components/design-tokens/HstTokenGrid.vue.d.ts +3 -3
  34. package/dist/components/design-tokens/HstTokenList.story.vue.d.ts +2 -1
  35. package/dist/components/design-tokens/HstTokenList.vue.d.ts +3 -2
  36. package/dist/components/json/HstJson.story.vue.d.ts +2 -1
  37. package/dist/components/json/HstJson.vue.d.ts +3 -2
  38. package/dist/components/json/serialize.d.ts +10 -12
  39. package/dist/components/number/HstNumber.story.vue.d.ts +2 -1
  40. package/dist/components/number/HstNumber.vue.d.ts +4 -3
  41. package/dist/components/radio/HstRadio.story.vue.d.ts +2 -1
  42. package/dist/components/radio/HstRadio.vue.d.ts +3 -2
  43. package/dist/components/select/CustomSelect.vue.d.ts +4 -3
  44. package/dist/components/select/HstSelect.story.vue.d.ts +2 -1
  45. package/dist/components/select/HstSelect.vue.d.ts +3 -2
  46. package/dist/components/slider/HstSlider.story.vue.d.ts +2 -1
  47. package/dist/components/slider/HstSlider.vue.d.ts +3 -2
  48. package/dist/components/text/HstText.story.vue.d.ts +2 -1
  49. package/dist/components/text/HstText.vue.d.ts +4 -3
  50. package/dist/components/textarea/HstTextarea.story.vue.d.ts +2 -1
  51. package/dist/components/textarea/HstTextarea.vue.d.ts +4 -3
  52. package/dist/index.d.ts +332 -50
  53. package/dist/index.es.css +1 -1
  54. package/dist/index.es.js +2179 -414
  55. package/dist/portal-target.d.ts +13 -0
  56. package/dist/style-standalone.css +126 -447
  57. package/dist/useKbd-DQM4Oqri.es.js +41 -0
  58. package/dist/useLocale-Dr4PRYn1.es.js +27 -0
  59. package/package.json +24 -22
  60. package/dist/HstWrapper-C557fRoN.es.js +0 -22
@@ -0,0 +1,974 @@
1
+ import { E as e, S as t, T as n, _ as r, a as i, b as a, c as o, f as s, g as c, h as l, i as u, k as d, l as f, m as p, o as ee, u as m, w as te, x as h, y as g } from "./HstWrapper-Bm5H3_to.es.js";
2
+ import { computed as _, createBlock as v, createVNode as y, defineComponent as b, guardReactiveProps as ne, mergeProps as x, nextTick as S, normalizeProps as re, onMounted as ie, onUnmounted as ae, openBlock as C, reactive as oe, ref as w, renderSlot as T, resolveDynamicComponent as se, toRefs as E, unref as D, watch as O, watchEffect as k, withCtx as A, withModifiers as j } from "@poveste/vendors/vue";
3
+ import { createGlobalState as ce, createSharedComposable as le, unrefElement as M, useEventListener as ue, useVModel as de } from "@poveste/vendors/vue-use";
4
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/shared/getActiveElement.js
5
+ function N() {
6
+ let e = document.activeElement;
7
+ if (e == null) return null;
8
+ for (; e != null && e.shadowRoot != null && e.shadowRoot.activeElement != null;) e = e.shadowRoot.activeElement;
9
+ return e;
10
+ }
11
+ //#endregion
12
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/shared/useBodyScrollLock.js
13
+ var fe = le(() => {
14
+ let t = w(/* @__PURE__ */ new Map()), r = w(), i = _(() => {
15
+ for (let e of t.value.values()) if (e) return !0;
16
+ return !1;
17
+ }), o = e({ scrollBody: w(!0) }), s = null, c = () => {
18
+ document.body.style.paddingRight = "", document.body.style.marginRight = "", n.layersWithOutsidePointerEventsDisabled.size === 0 && (document.body.style.pointerEvents = ""), document.documentElement.style.removeProperty("--scrollbar-width"), document.body.style.overflow = r.value ?? "", h && s?.(), r.value = void 0;
19
+ };
20
+ return O(i, (e, t) => {
21
+ if (!a) return;
22
+ if (!e) {
23
+ t && c();
24
+ return;
25
+ }
26
+ r.value === void 0 && (r.value = document.body.style.overflow);
27
+ let n = window.innerWidth - document.documentElement.clientWidth, l = {
28
+ padding: n,
29
+ margin: 0
30
+ }, u = o.scrollBody?.value ? typeof o.scrollBody.value == "object" ? g({
31
+ padding: o.scrollBody.value.padding === !0 ? n : o.scrollBody.value.padding,
32
+ margin: o.scrollBody.value.margin === !0 ? n : o.scrollBody.value.margin
33
+ }, l) : l : {
34
+ padding: 0,
35
+ margin: 0
36
+ };
37
+ n > 0 && (document.body.style.paddingRight = typeof u.padding == "number" ? `${u.padding}px` : String(u.padding), document.body.style.marginRight = typeof u.margin == "number" ? `${u.margin}px` : String(u.margin), document.documentElement.style.setProperty("--scrollbar-width", `${n}px`), document.body.style.overflow = "hidden"), h && (s = ue(document, "touchmove", (e) => me(e), { passive: !1 })), S(() => {
38
+ i.value && (document.body.style.pointerEvents = "none", document.body.style.overflow = "hidden");
39
+ });
40
+ }, {
41
+ immediate: !0,
42
+ flush: "sync"
43
+ }), t;
44
+ });
45
+ function pe(e) {
46
+ let t = Math.random().toString(36).substring(2, 7), n = fe();
47
+ n.value.set(t, e ?? !1);
48
+ let r = _({
49
+ get: () => n.value.get(t) ?? !1,
50
+ set: (e) => n.value.set(t, e)
51
+ });
52
+ return te(() => {
53
+ n.value.delete(t);
54
+ }), r;
55
+ }
56
+ function P(e) {
57
+ let t = window.getComputedStyle(e);
58
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight) return !0;
59
+ {
60
+ let t = e.parentNode;
61
+ return !(t instanceof Element) || t.tagName === "BODY" ? !1 : P(t);
62
+ }
63
+ }
64
+ function me(e) {
65
+ let t = e || window.event, n = t.target;
66
+ return n instanceof Element && P(n) ? !1 : t.touches.length > 1 || (t.preventDefault && t.cancelable && t.preventDefault(), !1);
67
+ }
68
+ //#endregion
69
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/shared/useFocusGuards.js
70
+ var F = 0;
71
+ function I() {
72
+ k((e) => {
73
+ if (!a) return;
74
+ let t = document.querySelectorAll("[data-reka-focus-guard]");
75
+ document.body.insertAdjacentElement("afterbegin", t[0] ?? L()), document.body.insertAdjacentElement("beforeend", t[1] ?? L()), F++, e(() => {
76
+ F === 1 && document.querySelectorAll("[data-reka-focus-guard]").forEach((e) => e.remove()), F--;
77
+ });
78
+ });
79
+ }
80
+ function L() {
81
+ let e = document.createElement("span");
82
+ return e.setAttribute("data-reka-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
83
+ }
84
+ //#endregion
85
+ //#region ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
86
+ var R = function(e) {
87
+ return typeof document > "u" ? null : (Array.isArray(e) ? e[0] : e).ownerDocument.body;
88
+ }, z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = {}, H = 0, U = function(e) {
89
+ return e && (e.host || U(e.parentNode));
90
+ }, he = function(e, t) {
91
+ return t.map(function(t) {
92
+ if (e.contains(t)) return t;
93
+ var n = U(t);
94
+ return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
95
+ }).filter(function(e) {
96
+ return !!e;
97
+ });
98
+ }, ge = function(e, t, n, r) {
99
+ var i = he(t, Array.isArray(e) ? e : [e]);
100
+ V[n] || (V[n] = /* @__PURE__ */ new WeakMap());
101
+ var a = V[n], o = [], s = /* @__PURE__ */ new Set(), c = new Set(i), l = function(e) {
102
+ e && !s.has(e) && (s.add(e), l(e.parentNode));
103
+ };
104
+ i.forEach(l);
105
+ var u = function(e) {
106
+ e && !c.has(e) && Array.prototype.forEach.call(e.children, function(e) {
107
+ if (s.has(e)) u(e);
108
+ else try {
109
+ var t = e.getAttribute(r), i = t !== null && t !== "false", c = (z.get(e) || 0) + 1, l = (a.get(e) || 0) + 1;
110
+ z.set(e, c), a.set(e, l), o.push(e), c === 1 && i && B.set(e, !0), l === 1 && e.setAttribute(n, "true"), i || e.setAttribute(r, "true");
111
+ } catch (t) {
112
+ console.error("aria-hidden: cannot operate on ", e, t);
113
+ }
114
+ });
115
+ };
116
+ return u(t), s.clear(), H++, function() {
117
+ o.forEach(function(e) {
118
+ var t = z.get(e) - 1, i = a.get(e) - 1;
119
+ z.set(e, t), a.set(e, i), t || (B.has(e) || e.removeAttribute(r), B.delete(e)), i || e.removeAttribute(n);
120
+ }), H--, H || (z = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), V = {});
121
+ };
122
+ }, _e = function(e, t, n) {
123
+ n === void 0 && (n = "data-aria-hidden");
124
+ var r = Array.from(Array.isArray(e) ? e : [e]), i = t || R(e);
125
+ return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))), ge(r, i, n, "aria-hidden")) : function() {
126
+ return null;
127
+ };
128
+ };
129
+ //#endregion
130
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/shared/useHideOthers.js
131
+ function ve(e) {
132
+ let t;
133
+ O(() => M(e), (e) => {
134
+ let n = !1;
135
+ try {
136
+ n = !!e?.closest("[popover]:not(:popover-open)");
137
+ } catch {}
138
+ e && !n ? t = _e(e) : t && t();
139
+ }), ae(() => {
140
+ t && t();
141
+ });
142
+ }
143
+ //#endregion
144
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/Primitive/usePrimitiveElement.js
145
+ function ye() {
146
+ let e = w();
147
+ return {
148
+ primitiveElement: e,
149
+ currentElement: _(() => ["#text", "#comment"].includes(e.value?.$el.nodeName) ? e.value?.$el.nextElementSibling : M(e))
150
+ };
151
+ }
152
+ //#endregion
153
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/FocusScope/stack.js
154
+ var be = ce(() => w([]));
155
+ function xe() {
156
+ let e = be();
157
+ return {
158
+ add(t) {
159
+ let n = e.value[0];
160
+ t !== n && n?.pause(), e.value = W(e.value, t), e.value.unshift(t);
161
+ },
162
+ remove(t) {
163
+ e.value = W(e.value, t), e.value[0]?.resume();
164
+ }
165
+ };
166
+ }
167
+ function W(e, t) {
168
+ let n = [...e], r = n.indexOf(t);
169
+ return r !== -1 && n.splice(r, 1), n;
170
+ }
171
+ //#endregion
172
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/FocusScope/utils.js
173
+ var G = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", q = {
174
+ bubbles: !1,
175
+ cancelable: !0
176
+ };
177
+ function Se(e, { select: t = !1 } = {}) {
178
+ let n = N();
179
+ for (let r of e) if (Z(r, { select: t }), N() !== n) return !0;
180
+ }
181
+ function Ce(e) {
182
+ let t = J(e);
183
+ return [Y(t, e), Y(t.reverse(), e)];
184
+ }
185
+ function J(e) {
186
+ let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
187
+ let t = e.tagName === "INPUT" && e.type === "hidden";
188
+ return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
189
+ } });
190
+ for (; n.nextNode();) t.push(n.currentNode);
191
+ return t;
192
+ }
193
+ function Y(e, t) {
194
+ for (let n of e) if (!X(n, { upTo: t })) return n;
195
+ }
196
+ function X(e, { upTo: t }) {
197
+ if (getComputedStyle(e).visibility === "hidden") return !0;
198
+ for (; e;) {
199
+ if (t !== void 0 && e === t) return !1;
200
+ if (getComputedStyle(e).display === "none") return !0;
201
+ e = e.parentElement;
202
+ }
203
+ return !1;
204
+ }
205
+ function we(e) {
206
+ return e instanceof HTMLInputElement && "select" in e;
207
+ }
208
+ function Z(e, { select: t = !1 } = {}) {
209
+ if (e && e.focus) {
210
+ let n = N();
211
+ e.focus({ preventScroll: !0 }), e !== n && we(e) && t && e.select();
212
+ }
213
+ }
214
+ //#endregion
215
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/FocusScope/FocusScope.js
216
+ var Te = /* @__PURE__ */ b({
217
+ __name: "FocusScope",
218
+ props: {
219
+ loop: {
220
+ type: Boolean,
221
+ required: !1,
222
+ default: !1
223
+ },
224
+ trapped: {
225
+ type: Boolean,
226
+ required: !1,
227
+ default: !1
228
+ },
229
+ present: {
230
+ type: Boolean,
231
+ required: !1,
232
+ default: !0
233
+ },
234
+ asChild: {
235
+ type: Boolean,
236
+ required: !1
237
+ },
238
+ as: {
239
+ type: null,
240
+ required: !1
241
+ }
242
+ },
243
+ emits: ["mountAutoFocus", "unmountAutoFocus"],
244
+ setup(e, { emit: t }) {
245
+ let n = e, i = t, { currentRef: o, currentElement: s } = r(), c = w(null), l = xe(), u = /*#__PURE__*/ oe({
246
+ paused: !1,
247
+ pause() {
248
+ this.paused = !0;
249
+ },
250
+ resume() {
251
+ this.paused = !1;
252
+ }
253
+ });
254
+ k((e) => {
255
+ if (!a) return;
256
+ let t = s.value;
257
+ if (!n.trapped) return;
258
+ function r(e) {
259
+ if (u.paused || !t) return;
260
+ let n = e.target;
261
+ t.contains(n) ? c.value = n : Z(c.value, { select: !0 });
262
+ }
263
+ function i(e) {
264
+ if (u.paused || !t) return;
265
+ let n = e.relatedTarget;
266
+ n !== null && (t.contains(n) || Z(c.value, { select: !0 }));
267
+ }
268
+ function o(e) {
269
+ let n = c.value;
270
+ if (n === null || !e.some((e) => e.removedNodes.length > 0)) return;
271
+ let r = N();
272
+ r && t.contains(r) || t.contains(n) || Z(t);
273
+ }
274
+ document.addEventListener("focusin", r), document.addEventListener("focusout", i);
275
+ let l = new MutationObserver(o);
276
+ t && l.observe(t, {
277
+ childList: !0,
278
+ subtree: !0
279
+ }), e(() => {
280
+ document.removeEventListener("focusin", r), document.removeEventListener("focusout", i), l.disconnect();
281
+ });
282
+ });
283
+ function d(e, t) {
284
+ let n = new CustomEvent(G, q), r = (e) => i("mountAutoFocus", e);
285
+ e.addEventListener(G, r), e.dispatchEvent(n), e.removeEventListener(G, r), n.defaultPrevented || (Se(J(e), { select: !0 }), N() === t && Z(e));
286
+ }
287
+ k(async (e) => {
288
+ let t = s.value;
289
+ if (await S(), !t) return;
290
+ n.present !== !1 && l.add(u);
291
+ let r = N();
292
+ !t.contains(r) && n.present !== !1 && d(t, r), e(() => {
293
+ let e = new CustomEvent(K, q), n = (e) => {
294
+ i("unmountAutoFocus", e);
295
+ };
296
+ t.addEventListener(K, n), t.dispatchEvent(e), t.setAttribute("data-focus-scope-unmounting", ""), setTimeout(() => {
297
+ e.defaultPrevented || Z(r ?? document.body, { select: !0 }), t.removeEventListener(K, n), l.remove(u), t.removeAttribute("data-focus-scope-unmounting");
298
+ }, 0);
299
+ });
300
+ }), O(() => n.present, async (e, t) => {
301
+ if (!a) return;
302
+ if (e === !1 && t === !0) {
303
+ l.remove(u);
304
+ return;
305
+ }
306
+ if (e !== !0 || t !== !1) return;
307
+ l.add(u), await S();
308
+ let n = s.value;
309
+ if (!n) return;
310
+ let r = N();
311
+ n.contains(r) || d(n, r);
312
+ });
313
+ function f(e) {
314
+ if (!n.loop && !n.trapped || u.paused) return;
315
+ let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, r = N();
316
+ if (t && r) {
317
+ let t = e.currentTarget, [i, a] = Ce(t);
318
+ i && a ? !e.shiftKey && r === a ? (e.preventDefault(), n.loop && Z(i, { select: !0 })) : e.shiftKey && r === i && (e.preventDefault(), n.loop && Z(a, { select: !0 })) : r === t && e.preventDefault();
319
+ }
320
+ }
321
+ return (e, t) => (C(), v(D(m), {
322
+ ref_key: "currentRef",
323
+ ref: o,
324
+ tabindex: "-1",
325
+ "as-child": e.asChild,
326
+ as: e.as,
327
+ onKeydown: f
328
+ }, {
329
+ default: A(() => [T(e.$slots, "default")]),
330
+ _: 3
331
+ }, 8, ["as-child", "as"]));
332
+ }
333
+ }), [Q, Ee] = /*#__PURE__*/ d("PopoverRoot"), De = /* @__PURE__ */ b({
334
+ __name: "PopoverRoot",
335
+ props: {
336
+ defaultOpen: {
337
+ type: Boolean,
338
+ required: !1,
339
+ default: !1
340
+ },
341
+ open: {
342
+ type: Boolean,
343
+ required: !1,
344
+ default: void 0
345
+ },
346
+ modal: {
347
+ type: Boolean,
348
+ required: !1,
349
+ default: !1
350
+ }
351
+ },
352
+ emits: ["update:open"],
353
+ setup(e, { emit: t }) {
354
+ let n = e, r = t, { modal: i } = E(n), a = de(n, "open", r, {
355
+ defaultValue: n.defaultOpen,
356
+ passive: n.open === void 0
357
+ });
358
+ return Ee({
359
+ contentId: "",
360
+ triggerId: "",
361
+ modal: i,
362
+ open: a,
363
+ onOpenChange: (e) => {
364
+ a.value = e;
365
+ },
366
+ onOpenToggle: () => {
367
+ a.value = !a.value;
368
+ },
369
+ triggerElement: w(),
370
+ hasCustomAnchor: w(!1)
371
+ }), (e, t) => (C(), v(D(ee), null, {
372
+ default: A(() => [T(e.$slots, "default", {
373
+ open: D(a),
374
+ close: () => a.value = !1
375
+ })]),
376
+ _: 3
377
+ }));
378
+ }
379
+ }), $ = /* @__PURE__ */ b({
380
+ __name: "PopoverContentImpl",
381
+ props: {
382
+ trapFocus: {
383
+ type: Boolean,
384
+ required: !1
385
+ },
386
+ memoDependencies: {
387
+ type: Array,
388
+ required: !1
389
+ },
390
+ side: {
391
+ type: null,
392
+ required: !1
393
+ },
394
+ sideOffset: {
395
+ type: Number,
396
+ required: !1
397
+ },
398
+ sideFlip: {
399
+ type: Boolean,
400
+ required: !1
401
+ },
402
+ align: {
403
+ type: null,
404
+ required: !1
405
+ },
406
+ alignOffset: {
407
+ type: Number,
408
+ required: !1
409
+ },
410
+ alignFlip: {
411
+ type: Boolean,
412
+ required: !1
413
+ },
414
+ avoidCollisions: {
415
+ type: Boolean,
416
+ required: !1
417
+ },
418
+ collisionBoundary: {
419
+ type: null,
420
+ required: !1
421
+ },
422
+ collisionPadding: {
423
+ type: [Number, Object],
424
+ required: !1
425
+ },
426
+ arrowPadding: {
427
+ type: Number,
428
+ required: !1
429
+ },
430
+ hideShiftedArrow: {
431
+ type: Boolean,
432
+ required: !1
433
+ },
434
+ sticky: {
435
+ type: String,
436
+ required: !1
437
+ },
438
+ hideWhenDetached: {
439
+ type: Boolean,
440
+ required: !1
441
+ },
442
+ positionStrategy: {
443
+ type: String,
444
+ required: !1
445
+ },
446
+ updatePositionStrategy: {
447
+ type: String,
448
+ required: !1
449
+ },
450
+ disableUpdateOnLayoutShift: {
451
+ type: Boolean,
452
+ required: !1
453
+ },
454
+ prioritizePosition: {
455
+ type: Boolean,
456
+ required: !1
457
+ },
458
+ reference: {
459
+ type: null,
460
+ required: !1
461
+ },
462
+ dir: {
463
+ type: String,
464
+ required: !1
465
+ },
466
+ asChild: {
467
+ type: Boolean,
468
+ required: !1
469
+ },
470
+ as: {
471
+ type: null,
472
+ required: !1
473
+ },
474
+ disableOutsidePointerEvents: {
475
+ type: Boolean,
476
+ required: !1
477
+ }
478
+ },
479
+ emits: [
480
+ "escapeKeyDown",
481
+ "pointerDownOutside",
482
+ "focusOutside",
483
+ "interactOutside",
484
+ "openAutoFocus",
485
+ "closeAutoFocus"
486
+ ],
487
+ setup(e, { emit: n }) {
488
+ let i = e, a = n, o = c(t(i, "trapFocus", "disableOutsidePointerEvents")), { forwardRef: s } = r(), l = Q();
489
+ return I(), (e, t) => (C(), v(D(Te), {
490
+ "as-child": "",
491
+ loop: "",
492
+ trapped: e.trapFocus,
493
+ onMountAutoFocus: t[5] ||= (e) => a("openAutoFocus", e),
494
+ onUnmountAutoFocus: t[6] ||= (e) => a("closeAutoFocus", e)
495
+ }, {
496
+ default: A(() => [y(D(f), {
497
+ "as-child": "",
498
+ "disable-outside-pointer-events": e.disableOutsidePointerEvents,
499
+ onPointerDownOutside: t[0] ||= (e) => a("pointerDownOutside", e),
500
+ onInteractOutside: t[1] ||= (e) => a("interactOutside", e),
501
+ onEscapeKeyDown: t[2] ||= (e) => a("escapeKeyDown", e),
502
+ onFocusOutside: t[3] ||= (e) => a("focusOutside", e),
503
+ onDismiss: t[4] ||= (e) => D(l).onOpenChange(!1)
504
+ }, {
505
+ default: A(() => [y(D(u), x(D(o), {
506
+ id: D(l).contentId,
507
+ ref: D(s),
508
+ "data-state": D(l).open.value ? "open" : "closed",
509
+ "aria-labelledby": D(l).triggerId,
510
+ style: {
511
+ "--reka-popover-content-transform-origin": "var(--reka-popper-transform-origin)",
512
+ "--reka-popover-content-available-width": "var(--reka-popper-available-width)",
513
+ "--reka-popover-content-available-height": "var(--reka-popper-available-height)",
514
+ "--reka-popover-trigger-width": "var(--reka-popper-anchor-width)",
515
+ "--reka-popover-trigger-height": "var(--reka-popper-anchor-height)"
516
+ },
517
+ role: "dialog"
518
+ }), {
519
+ default: A(() => [T(e.$slots, "default")]),
520
+ _: 3
521
+ }, 16, [
522
+ "id",
523
+ "data-state",
524
+ "aria-labelledby"
525
+ ])]),
526
+ _: 3
527
+ }, 8, ["disable-outside-pointer-events"])]),
528
+ _: 3
529
+ }, 8, ["trapped"]));
530
+ }
531
+ }), Oe = /* @__PURE__ */ b({
532
+ __name: "PopoverContentModal",
533
+ props: {
534
+ memoDependencies: {
535
+ type: Array,
536
+ required: !1
537
+ },
538
+ side: {
539
+ type: null,
540
+ required: !1
541
+ },
542
+ sideOffset: {
543
+ type: Number,
544
+ required: !1
545
+ },
546
+ sideFlip: {
547
+ type: Boolean,
548
+ required: !1
549
+ },
550
+ align: {
551
+ type: null,
552
+ required: !1
553
+ },
554
+ alignOffset: {
555
+ type: Number,
556
+ required: !1
557
+ },
558
+ alignFlip: {
559
+ type: Boolean,
560
+ required: !1
561
+ },
562
+ avoidCollisions: {
563
+ type: Boolean,
564
+ required: !1
565
+ },
566
+ collisionBoundary: {
567
+ type: null,
568
+ required: !1
569
+ },
570
+ collisionPadding: {
571
+ type: [Number, Object],
572
+ required: !1
573
+ },
574
+ arrowPadding: {
575
+ type: Number,
576
+ required: !1
577
+ },
578
+ hideShiftedArrow: {
579
+ type: Boolean,
580
+ required: !1
581
+ },
582
+ sticky: {
583
+ type: String,
584
+ required: !1
585
+ },
586
+ hideWhenDetached: {
587
+ type: Boolean,
588
+ required: !1
589
+ },
590
+ positionStrategy: {
591
+ type: String,
592
+ required: !1
593
+ },
594
+ updatePositionStrategy: {
595
+ type: String,
596
+ required: !1
597
+ },
598
+ disableUpdateOnLayoutShift: {
599
+ type: Boolean,
600
+ required: !1
601
+ },
602
+ prioritizePosition: {
603
+ type: Boolean,
604
+ required: !1
605
+ },
606
+ reference: {
607
+ type: null,
608
+ required: !1
609
+ },
610
+ dir: {
611
+ type: String,
612
+ required: !1
613
+ },
614
+ asChild: {
615
+ type: Boolean,
616
+ required: !1
617
+ },
618
+ as: {
619
+ type: null,
620
+ required: !1
621
+ },
622
+ disableOutsidePointerEvents: {
623
+ type: Boolean,
624
+ required: !1
625
+ }
626
+ },
627
+ emits: [
628
+ "escapeKeyDown",
629
+ "pointerDownOutside",
630
+ "focusOutside",
631
+ "interactOutside",
632
+ "openAutoFocus",
633
+ "closeAutoFocus"
634
+ ],
635
+ setup(e, { emit: t }) {
636
+ let n = e, i = t, a = Q(), o = w(!1);
637
+ pe(!0);
638
+ let s = l(n, i), { forwardRef: c, currentElement: u } = r();
639
+ return ve(u), (e, t) => (C(), v($, x(D(s), {
640
+ ref: D(c),
641
+ "trap-focus": D(a).open.value,
642
+ "disable-outside-pointer-events": "",
643
+ onCloseAutoFocus: t[0] ||= j((e) => {
644
+ i("closeAutoFocus", e), o.value || D(a).triggerElement.value?.focus();
645
+ }, ["prevent"]),
646
+ onPointerDownOutside: t[1] ||= (e) => {
647
+ i("pointerDownOutside", e);
648
+ let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0, r = t.button === 2 || n;
649
+ o.value = r;
650
+ },
651
+ onFocusOutside: t[2] ||= j(() => {}, ["prevent"])
652
+ }), {
653
+ default: A(() => [T(e.$slots, "default")]),
654
+ _: 3
655
+ }, 16, ["trap-focus"]));
656
+ }
657
+ }), ke = /* @__PURE__ */ b({
658
+ __name: "PopoverContentNonModal",
659
+ props: {
660
+ memoDependencies: {
661
+ type: Array,
662
+ required: !1
663
+ },
664
+ side: {
665
+ type: null,
666
+ required: !1
667
+ },
668
+ sideOffset: {
669
+ type: Number,
670
+ required: !1
671
+ },
672
+ sideFlip: {
673
+ type: Boolean,
674
+ required: !1
675
+ },
676
+ align: {
677
+ type: null,
678
+ required: !1
679
+ },
680
+ alignOffset: {
681
+ type: Number,
682
+ required: !1
683
+ },
684
+ alignFlip: {
685
+ type: Boolean,
686
+ required: !1
687
+ },
688
+ avoidCollisions: {
689
+ type: Boolean,
690
+ required: !1
691
+ },
692
+ collisionBoundary: {
693
+ type: null,
694
+ required: !1
695
+ },
696
+ collisionPadding: {
697
+ type: [Number, Object],
698
+ required: !1
699
+ },
700
+ arrowPadding: {
701
+ type: Number,
702
+ required: !1
703
+ },
704
+ hideShiftedArrow: {
705
+ type: Boolean,
706
+ required: !1
707
+ },
708
+ sticky: {
709
+ type: String,
710
+ required: !1
711
+ },
712
+ hideWhenDetached: {
713
+ type: Boolean,
714
+ required: !1
715
+ },
716
+ positionStrategy: {
717
+ type: String,
718
+ required: !1
719
+ },
720
+ updatePositionStrategy: {
721
+ type: String,
722
+ required: !1
723
+ },
724
+ disableUpdateOnLayoutShift: {
725
+ type: Boolean,
726
+ required: !1
727
+ },
728
+ prioritizePosition: {
729
+ type: Boolean,
730
+ required: !1
731
+ },
732
+ reference: {
733
+ type: null,
734
+ required: !1
735
+ },
736
+ dir: {
737
+ type: String,
738
+ required: !1
739
+ },
740
+ asChild: {
741
+ type: Boolean,
742
+ required: !1
743
+ },
744
+ as: {
745
+ type: null,
746
+ required: !1
747
+ },
748
+ disableOutsidePointerEvents: {
749
+ type: Boolean,
750
+ required: !1
751
+ }
752
+ },
753
+ emits: [
754
+ "escapeKeyDown",
755
+ "pointerDownOutside",
756
+ "focusOutside",
757
+ "interactOutside",
758
+ "openAutoFocus",
759
+ "closeAutoFocus"
760
+ ],
761
+ setup(e, { emit: t }) {
762
+ let n = e, r = t, i = Q(), a = w(!1), o = w(!1), s = l(n, r);
763
+ return (e, t) => (C(), v($, x(D(s), {
764
+ "trap-focus": !1,
765
+ "disable-outside-pointer-events": !1,
766
+ onCloseAutoFocus: t[0] ||= (e) => {
767
+ r("closeAutoFocus", e), e.defaultPrevented || (a.value || D(i).triggerElement.value?.focus(), e.preventDefault()), a.value = !1, o.value = !1;
768
+ },
769
+ onInteractOutside: t[1] ||= async (e) => {
770
+ r("interactOutside", e), e.defaultPrevented || (a.value = !0, e.detail.originalEvent.type === "pointerdown" && (o.value = !0));
771
+ let t = e.target;
772
+ D(i).triggerElement.value?.contains(t) && e.preventDefault(), e.detail.originalEvent.type === "focusin" && o.value && e.preventDefault();
773
+ }
774
+ }), {
775
+ default: A(() => [T(e.$slots, "default")]),
776
+ _: 3
777
+ }, 16));
778
+ }
779
+ }), Ae = /* @__PURE__ */ b({
780
+ __name: "PopoverContent",
781
+ props: {
782
+ forceMount: {
783
+ type: Boolean,
784
+ required: !1
785
+ },
786
+ memoDependencies: {
787
+ type: Array,
788
+ required: !1
789
+ },
790
+ side: {
791
+ type: null,
792
+ required: !1
793
+ },
794
+ sideOffset: {
795
+ type: Number,
796
+ required: !1
797
+ },
798
+ sideFlip: {
799
+ type: Boolean,
800
+ required: !1
801
+ },
802
+ align: {
803
+ type: null,
804
+ required: !1
805
+ },
806
+ alignOffset: {
807
+ type: Number,
808
+ required: !1
809
+ },
810
+ alignFlip: {
811
+ type: Boolean,
812
+ required: !1
813
+ },
814
+ avoidCollisions: {
815
+ type: Boolean,
816
+ required: !1
817
+ },
818
+ collisionBoundary: {
819
+ type: null,
820
+ required: !1
821
+ },
822
+ collisionPadding: {
823
+ type: [Number, Object],
824
+ required: !1
825
+ },
826
+ arrowPadding: {
827
+ type: Number,
828
+ required: !1
829
+ },
830
+ hideShiftedArrow: {
831
+ type: Boolean,
832
+ required: !1
833
+ },
834
+ sticky: {
835
+ type: String,
836
+ required: !1
837
+ },
838
+ hideWhenDetached: {
839
+ type: Boolean,
840
+ required: !1
841
+ },
842
+ positionStrategy: {
843
+ type: String,
844
+ required: !1
845
+ },
846
+ updatePositionStrategy: {
847
+ type: String,
848
+ required: !1
849
+ },
850
+ disableUpdateOnLayoutShift: {
851
+ type: Boolean,
852
+ required: !1
853
+ },
854
+ prioritizePosition: {
855
+ type: Boolean,
856
+ required: !1
857
+ },
858
+ reference: {
859
+ type: null,
860
+ required: !1
861
+ },
862
+ dir: {
863
+ type: String,
864
+ required: !1
865
+ },
866
+ asChild: {
867
+ type: Boolean,
868
+ required: !1
869
+ },
870
+ as: {
871
+ type: null,
872
+ required: !1
873
+ },
874
+ disableOutsidePointerEvents: {
875
+ type: Boolean,
876
+ required: !1
877
+ }
878
+ },
879
+ emits: [
880
+ "escapeKeyDown",
881
+ "pointerDownOutside",
882
+ "focusOutside",
883
+ "interactOutside",
884
+ "openAutoFocus",
885
+ "closeAutoFocus"
886
+ ],
887
+ setup(e, { emit: t }) {
888
+ let n = e, i = t, a = Q(), o = l(n, i), { forwardRef: c } = r();
889
+ return a.contentId ||= p(void 0, "reka-popover-content"), (e, t) => (C(), v(D(s), { present: e.forceMount || D(a).open.value }, {
890
+ default: A(() => [D(a).modal.value ? (C(), v(Oe, x({ key: 0 }, D(o), { ref: D(c) }), {
891
+ default: A(() => [T(e.$slots, "default")]),
892
+ _: 3
893
+ }, 16)) : (C(), v(ke, x({ key: 1 }, D(o), { ref: D(c) }), {
894
+ default: A(() => [T(e.$slots, "default")]),
895
+ _: 3
896
+ }, 16))]),
897
+ _: 3
898
+ }, 8, ["present"]));
899
+ }
900
+ }), je = /* @__PURE__ */ b({
901
+ __name: "PopoverPortal",
902
+ props: {
903
+ to: {
904
+ type: null,
905
+ required: !1
906
+ },
907
+ disabled: {
908
+ type: Boolean,
909
+ required: !1
910
+ },
911
+ defer: {
912
+ type: Boolean,
913
+ required: !1
914
+ },
915
+ forceMount: {
916
+ type: Boolean,
917
+ required: !1
918
+ }
919
+ },
920
+ setup(e) {
921
+ let t = e;
922
+ return (e, n) => (C(), v(D(o), re(ne(t)), {
923
+ default: A(() => [T(e.$slots, "default")]),
924
+ _: 3
925
+ }, 16));
926
+ }
927
+ }), Me = /* @__PURE__ */ b({
928
+ __name: "PopoverTrigger",
929
+ props: {
930
+ asChild: {
931
+ type: Boolean,
932
+ required: !1
933
+ },
934
+ as: {
935
+ type: null,
936
+ required: !1,
937
+ default: "button"
938
+ }
939
+ },
940
+ setup(e) {
941
+ let t = e, n = Q(), { forwardRef: a, currentElement: o } = r();
942
+ return n.triggerId ||= p(void 0, "reka-popover-trigger"), n.contentId ||= p(void 0, "reka-popover-content"), ie(() => {
943
+ n.triggerElement.value = o.value;
944
+ }), (e, r) => (C(), v(se(D(n).hasCustomAnchor.value ? D(m) : D(i)), { "as-child": "" }, {
945
+ default: A(() => [y(D(m), {
946
+ id: D(n).triggerId,
947
+ ref: D(a),
948
+ type: e.as === "button" ? "button" : void 0,
949
+ "aria-haspopup": "dialog",
950
+ "aria-expanded": D(n).open.value,
951
+ "aria-controls": D(n).open.value ? D(n).contentId : void 0,
952
+ "data-state": D(n).open.value ? "open" : "closed",
953
+ as: e.as,
954
+ "as-child": t.asChild,
955
+ onClick: D(n).onOpenToggle
956
+ }, {
957
+ default: A(() => [T(e.$slots, "default")]),
958
+ _: 3
959
+ }, 8, [
960
+ "id",
961
+ "type",
962
+ "aria-expanded",
963
+ "aria-controls",
964
+ "data-state",
965
+ "as",
966
+ "as-child",
967
+ "onClick"
968
+ ])]),
969
+ _: 3
970
+ }));
971
+ }
972
+ });
973
+ //#endregion
974
+ export { Q as a, De as i, je as n, ye as o, Ae as r, N as s, Me as t };