@codemonster-ru/vueforge-core 1.1.0 → 1.2.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 (55) hide show
  1. package/README.md +1 -0
  2. package/dist/components/accordion/VfAccordion.vue.d.ts.map +1 -1
  3. package/dist/components/alert/VfAlert.vue.d.ts.map +1 -1
  4. package/dist/components/checkbox/VfCheckbox.vue.d.ts +38 -0
  5. package/dist/components/checkbox/VfCheckbox.vue.d.ts.map +1 -0
  6. package/dist/components/checkbox/index.d.ts +2 -0
  7. package/dist/components/checkbox/index.d.ts.map +1 -0
  8. package/dist/components/dialog/VfDialog.vue.d.ts +5 -1
  9. package/dist/components/dialog/VfDialog.vue.d.ts.map +1 -1
  10. package/dist/components/drawer/VfDrawer.vue.d.ts +68 -0
  11. package/dist/components/drawer/VfDrawer.vue.d.ts.map +1 -0
  12. package/dist/components/drawer/index.d.ts +2 -0
  13. package/dist/components/drawer/index.d.ts.map +1 -0
  14. package/dist/components/dropdown/VfDropdown.vue.d.ts +4 -0
  15. package/dist/components/dropdown/VfDropdown.vue.d.ts.map +1 -1
  16. package/dist/components/index.d.ts +5 -0
  17. package/dist/components/index.d.ts.map +1 -1
  18. package/dist/components/link/VfLink.vue.d.ts +7 -2
  19. package/dist/components/link/VfLink.vue.d.ts.map +1 -1
  20. package/dist/components/nav-menu/VfNavMenu.vue.d.ts +24 -0
  21. package/dist/components/nav-menu/VfNavMenu.vue.d.ts.map +1 -0
  22. package/dist/components/nav-menu/VfNavMenuItemNode.vue.d.ts +23 -0
  23. package/dist/components/nav-menu/VfNavMenuItemNode.vue.d.ts.map +1 -0
  24. package/dist/components/nav-menu/index.d.ts +2 -0
  25. package/dist/components/nav-menu/index.d.ts.map +1 -0
  26. package/dist/components/popover/VfPopover.vue.d.ts +5 -1
  27. package/dist/components/popover/VfPopover.vue.d.ts.map +1 -1
  28. package/dist/components/radio/VfRadio.vue.d.ts +40 -0
  29. package/dist/components/radio/VfRadio.vue.d.ts.map +1 -0
  30. package/dist/components/radio/index.d.ts +2 -0
  31. package/dist/components/radio/index.d.ts.map +1 -0
  32. package/dist/components/switch/VfSwitch.vue.d.ts +36 -0
  33. package/dist/components/switch/VfSwitch.vue.d.ts.map +1 -0
  34. package/dist/components/switch/index.d.ts +2 -0
  35. package/dist/components/switch/index.d.ts.map +1 -0
  36. package/dist/components/tooltip/VfTooltip.vue.d.ts +4 -0
  37. package/dist/components/tooltip/VfTooltip.vue.d.ts.map +1 -1
  38. package/dist/index.d.ts +2 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/providers/VfThemeProvider.vue.d.ts.map +1 -1
  41. package/dist/public-CFcLjh0P.js +306 -0
  42. package/dist/styles.css +1 -1
  43. package/dist/theme/default-preset.d.ts.map +1 -1
  44. package/dist/theme/motion.d.ts +10 -0
  45. package/dist/theme/motion.d.ts.map +1 -0
  46. package/dist/theme-api.js +1 -1
  47. package/dist/theme.css +39 -1
  48. package/dist/tokens.css +70 -2
  49. package/dist/types/components.d.ts +17 -3
  50. package/dist/types/components.d.ts.map +1 -1
  51. package/dist/types/theme.d.ts +69 -1
  52. package/dist/types/theme.d.ts.map +1 -1
  53. package/dist/vueforge-core.js +1497 -737
  54. package/package.json +14 -5
  55. package/dist/public-D2viaiWv.js +0 -202
@@ -1,167 +1,176 @@
1
- import { r as be, a as ge, b as $e, D as we, c as ke, i as Ve } from "./public-D2viaiWv.js";
2
- import { d as Gt, e as Jt } from "./public-D2viaiWv.js";
3
- import { defineComponent as D, ref as w, inject as pe, computed as r, watch as W, onMounted as Q, onBeforeUnmount as N, provide as Te, renderSlot as $, toValue as A, nextTick as G, openBlock as m, createElementBlock as h, createElementVNode as C, unref as c, toDisplayString as R, normalizeClass as M, createVNode as ee, createCommentVNode as I, useAttrs as P, mergeProps as F, createTextVNode as ve, useSlots as xe, createBlock as X, Teleport as J, normalizeStyle as U, Fragment as Ce, renderList as Oe, normalizeProps as De, guardReactiveProps as Ie } from "vue";
4
- import { d as Ee } from "./useScrollLock-B7pq1ybb.js";
5
- import { t as eo, a as to, u as oo, b as no, c as ao, v as so } from "./useScrollLock-B7pq1ybb.js";
6
- import { VueIconify as te, icons as H } from "@codemonster-ru/vueiconify";
7
- import { autoUpdate as Be, computePosition as Ae, offset as oe, flip as ne, shift as ae, arrow as se } from "@codemonster-ru/floater.js";
8
- const me = Symbol("VueForgeConfig");
9
- function Se() {
1
+ import { r as Le, a as Se, b as ze, D as Me, c as Pe, i as Ne, v as U } from "./public-CFcLjh0P.js";
2
+ import { d as Hn, e as Kn } from "./public-CFcLjh0P.js";
3
+ import { defineComponent as L, ref as A, inject as we, computed as s, watch as Z, onMounted as de, onBeforeUnmount as ee, provide as Fe, renderSlot as B, toValue as K, nextTick as ae, openBlock as c, createElementBlock as m, createElementVNode as T, unref as h, toDisplayString as F, normalizeClass as P, createVNode as j, Transition as ne, withCtx as Q, createCommentVNode as O, useAttrs as R, mergeProps as H, createTextVNode as oe, normalizeStyle as W, useSlots as Te, createBlock as q, Teleport as le, resolveDynamicComponent as re, normalizeProps as Ve, guardReactiveProps as xe, resolveComponent as Re, Fragment as ue, renderList as ce } from "vue";
4
+ import { d as Ce } from "./useScrollLock-B7pq1ybb.js";
5
+ import { t as qn, a as Wn, u as Un, b as Yn, c as Xn, v as Gn } from "./useScrollLock-B7pq1ybb.js";
6
+ import { VueIconify as te, icons as X } from "@codemonster-ru/vueiconify";
7
+ import { autoUpdate as He, computePosition as Ke, offset as ve, flip as pe, shift as me, arrow as he } from "@codemonster-ru/floater.js";
8
+ const Be = Symbol("VueForgeConfig");
9
+ function je() {
10
10
  return {
11
- install(t, e = {}) {
12
- const s = be(e.theme);
13
- t.provide(me, { theme: s }), typeof document < "u" && ge(s);
11
+ install(n, e = {}) {
12
+ const i = Le(e.theme);
13
+ n.provide(Be, { theme: i }), typeof document < "u" && Se(i);
14
14
  }
15
15
  };
16
16
  }
17
- const It = Se(), _e = Symbol("VfThemeContext"), Et = /* @__PURE__ */ D({
17
+ const hn = je(), Ee = Symbol("VfThemeContext"), yn = /* @__PURE__ */ L({
18
18
  __name: "VfThemeProvider",
19
19
  props: {
20
20
  defaultTheme: { default: "system" },
21
21
  storageKey: {},
22
22
  attribute: {}
23
23
  },
24
- setup(o) {
25
- const t = o, e = w(t.defaultTheme), s = w("light"), n = w(null), l = pe(me, null), d = r(() => $e(e.value, s.value)), f = r(
26
- () => t.storageKey ?? (l == null ? void 0 : l.theme.options.storageKey) ?? we
27
- ), _ = r(
28
- () => t.attribute ?? (l == null ? void 0 : l.theme.options.attribute) ?? ke
29
- );
30
- function b() {
24
+ setup(t) {
25
+ const n = t, e = A(n.defaultTheme), i = A("light"), l = A(null), r = we(Be, null), u = s(() => ze(e.value, i.value)), p = s(
26
+ () => n.storageKey ?? (r == null ? void 0 : r.theme.options.storageKey) ?? Me
27
+ ), g = s(
28
+ () => n.attribute ?? (r == null ? void 0 : r.theme.options.attribute) ?? Pe
29
+ ), b = A(!1);
30
+ let v = null;
31
+ function E() {
31
32
  if (typeof window > "u")
32
33
  return;
33
- const y = window.localStorage.getItem(f.value);
34
- Ve(y) && (e.value = y);
34
+ const d = window.localStorage.getItem(p.value);
35
+ Ne(d) && (e.value = d);
35
36
  }
36
- function u(y) {
37
- typeof document > "u" || document.documentElement.setAttribute(_.value, y);
37
+ function V() {
38
+ v !== null && (window.clearTimeout(v), v = null);
39
+ }
40
+ function w(d, _ = {}) {
41
+ if (typeof document > "u")
42
+ return;
43
+ const o = document.documentElement;
44
+ _.animate && (V(), o.classList.add("vf-theme-transitioning")), o.setAttribute(g.value, d), _.animate && (v = window.setTimeout(() => {
45
+ o.classList.remove("vf-theme-transitioning"), v = null;
46
+ }, 320));
38
47
  }
39
- function V(y) {
40
- var B;
41
- if (y) {
42
- s.value = y.matches ? "dark" : "light";
48
+ function I(d) {
49
+ var _;
50
+ if (d) {
51
+ i.value = d.matches ? "dark" : "light";
43
52
  return;
44
53
  }
45
- s.value = (B = n.value) != null && B.matches ? "dark" : "light";
54
+ i.value = (_ = l.value) != null && _.matches ? "dark" : "light";
46
55
  }
47
- function k(y) {
48
- e.value = y;
56
+ function S(d) {
57
+ e.value = d;
49
58
  }
50
- function O() {
51
- const y = d.value === "dark" ? "light" : "dark";
52
- e.value = y;
59
+ function z() {
60
+ const d = u.value === "dark" ? "light" : "dark";
61
+ e.value = d;
53
62
  }
54
- return W(e, (y) => {
55
- typeof window > "u" || window.localStorage.setItem(f.value, y);
56
- }), W(
57
- d,
58
- (y) => {
59
- u(y);
63
+ return Z(e, (d) => {
64
+ typeof window > "u" || window.localStorage.setItem(p.value, d);
65
+ }), Z(
66
+ u,
67
+ (d) => {
68
+ w(d, { animate: b.value });
60
69
  },
61
70
  { immediate: !0 }
62
- ), Q(() => {
63
- b(), n.value = window.matchMedia("(prefers-color-scheme: dark)"), V(), n.value.addEventListener("change", V);
64
- }), N(() => {
65
- var y;
66
- (y = n.value) == null || y.removeEventListener("change", V);
67
- }), Te(_e, {
71
+ ), de(() => {
72
+ E(), l.value = window.matchMedia("(prefers-color-scheme: dark)"), I(), l.value.addEventListener("change", I), b.value = !0;
73
+ }), ee(() => {
74
+ var d;
75
+ (d = l.value) == null || d.removeEventListener("change", I), V();
76
+ }), Fe(Ee, {
68
77
  mode: e,
69
- resolvedTheme: d,
70
- setTheme: k,
71
- toggleTheme: O
72
- }), (y, B) => $(y.$slots, "default");
78
+ resolvedTheme: u,
79
+ setTheme: S,
80
+ toggleTheme: z
81
+ }), (d, _) => B(d.$slots, "default");
73
82
  }
74
83
  });
75
- function he(o, t, e = {}) {
76
- const s = e.event ?? "pointerdown", n = (l) => {
77
- if (A(e.enabled) === !1)
84
+ function Oe(t, n, e = {}) {
85
+ const i = e.event ?? "pointerdown", l = (r) => {
86
+ if (K(e.enabled) === !1)
78
87
  return;
79
- const d = l.target;
80
- if (!(d instanceof Node))
88
+ const u = r.target;
89
+ if (!(u instanceof Node))
81
90
  return;
82
- const f = Array.isArray(o) ? o.map((_) => _.value).filter((_) => _ instanceof HTMLElement) : [o.value].filter((_) => _ instanceof HTMLElement);
83
- f.length === 0 || f.some((_) => _.contains(d)) || t(l);
91
+ const p = Array.isArray(t) ? t.map((g) => g.value).filter((g) => g instanceof HTMLElement) : [t.value].filter((g) => g instanceof HTMLElement);
92
+ p.length === 0 || p.some((g) => g.contains(u)) || n(r);
84
93
  };
85
- Q(() => {
86
- document.addEventListener(s, n);
87
- }), N(() => {
88
- document.removeEventListener(s, n);
94
+ de(() => {
95
+ document.addEventListener(i, l);
96
+ }), ee(() => {
97
+ document.removeEventListener(i, l);
89
98
  });
90
99
  }
91
- function Z(o = {}) {
92
- const t = r(() => A(o.open) !== void 0), e = w(o.defaultOpen ?? !1), s = r(() => t.value ? !!A(o.open) : e.value);
93
- W(
94
- () => A(o.open),
95
- (l) => {
96
- l !== void 0 && (e.value = l);
100
+ function se(t = {}) {
101
+ const n = s(() => K(t.open) !== void 0), e = A(t.defaultOpen ?? !1), i = s(() => n.value ? !!K(t.open) : e.value);
102
+ Z(
103
+ () => K(t.open),
104
+ (r) => {
105
+ r !== void 0 && (e.value = r);
97
106
  }
98
107
  );
99
- function n(l) {
100
- var d;
101
- t.value || (e.value = l), (d = o.onOpenChange) == null || d.call(o, l);
108
+ function l(r) {
109
+ var u;
110
+ n.value || (e.value = r), (u = t.onOpenChange) == null || u.call(t, r);
102
111
  }
103
112
  return {
104
- isOpen: s,
105
- open: () => n(!0),
106
- close: () => n(!1),
107
- toggle: () => n(!s.value),
108
- setOpen: n
113
+ isOpen: i,
114
+ open: () => l(!0),
115
+ close: () => l(!1),
116
+ toggle: () => l(!i.value),
117
+ setOpen: l
109
118
  };
110
119
  }
111
- function le(o, t = {}) {
112
- const e = t.event ?? "keydown", s = (n) => {
113
- A(t.enabled) === !1 || n.key !== "Escape" || o(n);
120
+ function fe(t, n = {}) {
121
+ const e = n.event ?? "keydown", i = (l) => {
122
+ K(n.enabled) === !1 || l.key !== "Escape" || t(l);
114
123
  };
115
- Q(() => {
116
- document.addEventListener(e, s);
117
- }), N(() => {
118
- document.removeEventListener(e, s);
124
+ de(() => {
125
+ document.addEventListener(e, i);
126
+ }), ee(() => {
127
+ document.removeEventListener(e, i);
119
128
  });
120
129
  }
121
- function re(o, t, e = {}) {
122
- const s = w(0), n = w(0), l = w(A(e.placement) ?? "bottom"), d = w({}), f = w(null);
123
- let _ = 0;
124
- const b = r(() => ({
125
- left: `${s.value}px`,
126
- top: `${n.value}px`
130
+ function ye(t, n, e = {}) {
131
+ const i = A(0), l = A(0), r = A(K(e.placement) ?? "bottom"), u = A({}), p = A(null);
132
+ let g = 0;
133
+ const b = s(() => ({
134
+ left: `${i.value}px`,
135
+ top: `${l.value}px`
127
136
  }));
128
- async function u() {
129
- if (!o.value || !t.value)
137
+ async function v() {
138
+ if (!t.value || !n.value)
130
139
  return;
131
- const k = await Ae(o.value, t.value, {
132
- placement: A(e.placement) ?? l.value,
133
- middleware: A(e.middleware),
134
- strategy: A(e.strategy)
140
+ const V = await Ke(t.value, n.value, {
141
+ placement: K(e.placement) ?? r.value,
142
+ middleware: K(e.middleware),
143
+ strategy: K(e.strategy)
135
144
  });
136
- s.value = k.x, n.value = k.y, l.value = k.placement, d.value = k.middlewareData ?? {};
145
+ i.value = V.x, l.value = V.y, r.value = V.placement, u.value = V.middlewareData ?? {};
137
146
  }
138
- function V() {
139
- var k;
140
- (k = f.value) == null || k.call(f), f.value = null;
147
+ function E() {
148
+ var V;
149
+ (V = p.value) == null || V.call(p), p.value = null;
141
150
  }
142
- return W(
143
- [() => A(e.enabled) !== !1, o, t],
144
- async ([k]) => {
145
- _ += 1;
146
- const O = _;
147
- V(), !(!k || !o.value || !t.value) && (await G(), !(O !== _ || A(e.enabled) === !1 || !o.value || !t.value) && (await u(), !(O !== _ || A(e.enabled) === !1 || !o.value || !t.value) && (f.value = Be(o.value, () => {
148
- u();
151
+ return Z(
152
+ [() => K(e.enabled) !== !1, t, n],
153
+ async ([V]) => {
154
+ g += 1;
155
+ const w = g;
156
+ E(), !(!V || !t.value || !n.value) && (await ae(), !(w !== g || K(e.enabled) === !1 || !t.value || !n.value) && (await v(), !(w !== g || K(e.enabled) === !1 || !t.value || !n.value) && (p.value = He(t.value, () => {
157
+ v();
149
158
  }))));
150
159
  },
151
160
  { immediate: !0 }
152
- ), N(() => {
153
- V();
161
+ ), ee(() => {
162
+ E();
154
163
  }), {
155
- x: s,
156
- y: n,
157
- placement: l,
158
- middlewareData: d,
164
+ x: i,
165
+ y: l,
166
+ placement: r,
167
+ middlewareData: u,
159
168
  styles: b,
160
- update: u,
161
- cleanup: V
169
+ update: v,
170
+ cleanup: E
162
171
  };
163
172
  }
164
- const ze = [
173
+ const qe = [
165
174
  "a[href]",
166
175
  "button:not([disabled])",
167
176
  "input:not([disabled])",
@@ -169,53 +178,53 @@ const ze = [
169
178
  "textarea:not([disabled])",
170
179
  '[tabindex]:not([tabindex="-1"])'
171
180
  ].join(", ");
172
- function Pe(o) {
173
- return Array.from(o.querySelectorAll(ze)).filter(
174
- (t) => !t.hasAttribute("hidden") && t.getAttribute("aria-hidden") !== "true"
181
+ function We(t) {
182
+ return Array.from(t.querySelectorAll(qe)).filter(
183
+ (n) => !n.hasAttribute("hidden") && n.getAttribute("aria-hidden") !== "true"
175
184
  );
176
185
  }
177
- function Fe(o, t = {}) {
178
- const e = (s) => {
179
- if (s.key !== "Tab" || A(t.enabled) === !1)
186
+ function De(t, n = {}) {
187
+ const e = (i) => {
188
+ if (i.key !== "Tab" || K(n.enabled) === !1)
180
189
  return;
181
- const n = o.value;
182
- if (!n)
190
+ const l = t.value;
191
+ if (!l)
183
192
  return;
184
- const l = Pe(n);
185
- if (l.length === 0) {
186
- s.preventDefault(), n.focus();
193
+ const r = We(l);
194
+ if (r.length === 0) {
195
+ i.preventDefault(), l.focus();
187
196
  return;
188
197
  }
189
- const d = l[0], f = l[l.length - 1], _ = document.activeElement;
190
- if (s.shiftKey) {
191
- (_ === d || _ === n) && (s.preventDefault(), f.focus());
198
+ const u = r[0], p = r[r.length - 1], g = document.activeElement;
199
+ if (i.shiftKey) {
200
+ (g === u || g === l) && (i.preventDefault(), p.focus());
192
201
  return;
193
202
  }
194
- _ === f && (s.preventDefault(), d.focus());
203
+ g === p && (i.preventDefault(), u.focus());
195
204
  };
196
- Q(() => {
205
+ de(() => {
197
206
  document.addEventListener("keydown", e);
198
- }), N(() => {
207
+ }), ee(() => {
199
208
  document.removeEventListener("keydown", e);
200
209
  });
201
210
  }
202
- let Ke = 0;
203
- function K(o = {}) {
204
- const t = `${o.prefix ?? "vf"}-${++Ke}`;
205
- return r(() => A(o.providedId) ?? t);
211
+ let Ue = 0;
212
+ function G(t = {}) {
213
+ const n = `${t.prefix ?? "vf"}-${++Ue}`;
214
+ return s(() => K(t.providedId) ?? n);
206
215
  }
207
- function Bt() {
208
- const o = pe(_e);
209
- if (!o)
216
+ function _n() {
217
+ const t = we(Ee);
218
+ if (!t)
210
219
  throw new Error("useTheme must be used inside VfThemeProvider.");
211
220
  return {
212
- theme: o.mode,
213
- resolvedTheme: o.resolvedTheme,
214
- setTheme: o.setTheme,
215
- toggleTheme: o.toggleTheme
221
+ theme: t.mode,
222
+ resolvedTheme: t.resolvedTheme,
223
+ setTheme: t.setTheme,
224
+ toggleTheme: t.toggleTheme
216
225
  };
217
226
  }
218
- const Le = { class: "vf-accordion" }, Re = ["id", "aria-controls", "aria-expanded", "disabled"], Me = ["id", "aria-labelledby"], At = /* @__PURE__ */ D({
227
+ const Ye = { class: "vf-accordion" }, Xe = ["id", "aria-controls", "aria-expanded", "disabled"], Ge = ["id", "aria-labelledby"], Qe = { class: "vf-accordion__content-inner" }, gn = /* @__PURE__ */ L({
219
228
  __name: "VfAccordion",
220
229
  props: {
221
230
  open: { type: Boolean, default: void 0 },
@@ -224,113 +233,161 @@ const Le = { class: "vf-accordion" }, Re = ["id", "aria-controls", "aria-expande
224
233
  disabled: { type: Boolean, default: !1 }
225
234
  },
226
235
  emits: ["update:open", "openChange"],
227
- setup(o, { emit: t }) {
228
- const e = o, s = t, n = K({ prefix: "vf-accordion-trigger" }), l = K({ prefix: "vf-accordion-content" }), d = Z({
236
+ setup(t, { emit: n }) {
237
+ const e = t, i = n, l = G({ prefix: "vf-accordion-trigger" }), r = G({ prefix: "vf-accordion-content" }), u = se({
229
238
  defaultOpen: e.defaultOpen,
230
- open: r(() => e.open),
231
- onOpenChange: (u) => {
232
- s("update:open", u), s("openChange", u);
239
+ open: s(() => e.open),
240
+ onOpenChange: (_) => {
241
+ i("update:open", _), i("openChange", _);
233
242
  }
234
- }), f = d.isOpen;
235
- function _() {
236
- e.disabled || d.toggle();
237
- }
238
- function b(u) {
239
- (u.key === "Enter" || u.key === " ") && (u.preventDefault(), _());
240
- }
241
- return (u, V) => (m(), h("section", Le, [
242
- C("button", {
243
- id: c(n),
244
- "aria-controls": c(l),
245
- "aria-expanded": c(f),
246
- disabled: o.disabled,
243
+ }), p = u.isOpen, g = [
244
+ "height var(--vf-motion-duration-normal) var(--vf-motion-ease-standard)",
245
+ "opacity var(--vf-motion-duration-normal) var(--vf-motion-ease-standard)"
246
+ ].join(", ");
247
+ function b(_) {
248
+ const o = _.firstElementChild;
249
+ return (o == null ? void 0 : o.offsetHeight) ?? _.scrollHeight;
250
+ }
251
+ function v() {
252
+ e.disabled || u.toggle();
253
+ }
254
+ function E(_) {
255
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), v());
256
+ }
257
+ function V(_) {
258
+ const o = _;
259
+ o.style.height = "0px", o.style.opacity = "0", o.style.overflow = "hidden";
260
+ }
261
+ function w(_, o) {
262
+ const y = _;
263
+ y.style.transition = g, requestAnimationFrame(() => {
264
+ y.style.height = `${b(y)}px`, y.style.opacity = "1";
265
+ }), window.setTimeout(o, U.normal);
266
+ }
267
+ function I(_) {
268
+ const o = _;
269
+ o.style.height = "", o.style.opacity = "", o.style.overflow = "", o.style.transition = "";
270
+ }
271
+ function S(_) {
272
+ const o = _;
273
+ o.style.height = `${b(o)}px`, o.style.opacity = "1", o.style.overflow = "hidden";
274
+ }
275
+ function z(_, o) {
276
+ const y = _;
277
+ y.style.transition = g, y.offsetHeight, y.style.height = "0px", y.style.opacity = "0", window.setTimeout(o, U.normal);
278
+ }
279
+ function d(_) {
280
+ const o = _;
281
+ o.style.height = "", o.style.opacity = "", o.style.overflow = "", o.style.transition = "";
282
+ }
283
+ return (_, o) => (c(), m("section", Ye, [
284
+ T("button", {
285
+ id: h(l),
286
+ "aria-controls": h(r),
287
+ "aria-expanded": h(p),
288
+ disabled: t.disabled,
247
289
  class: "vf-accordion__trigger",
248
290
  type: "button",
249
- onClick: _,
250
- onKeydown: b
291
+ onClick: v,
292
+ onKeydown: E
251
293
  }, [
252
- $(u.$slots, "trigger", { open: c(f) }, () => [
253
- C("span", null, R(o.title), 1)
294
+ B(_.$slots, "trigger", { open: h(p) }, () => [
295
+ T("span", null, F(t.title), 1)
254
296
  ]),
255
- C("span", {
297
+ T("span", {
256
298
  "aria-hidden": "true",
257
- class: M(["vf-accordion__icon", c(f) && "vf-accordion__icon--open"])
299
+ class: P(["vf-accordion__icon", h(p) && "vf-accordion__icon--open"])
258
300
  }, [
259
- ee(c(te), {
260
- icon: c(H).chevronDown,
301
+ j(h(te), {
302
+ icon: h(X).chevronDown,
261
303
  size: "0.875rem"
262
304
  }, null, 8, ["icon"])
263
305
  ], 2)
264
- ], 40, Re),
265
- c(f) ? (m(), h("div", {
266
- key: 0,
267
- id: c(l),
268
- "aria-labelledby": c(n),
269
- class: "vf-accordion__content",
270
- role: "region"
271
- }, [
272
- $(u.$slots, "default", { open: c(f) })
273
- ], 8, Me)) : I("", !0)
306
+ ], 40, Xe),
307
+ j(ne, {
308
+ css: !1,
309
+ onBeforeEnter: V,
310
+ onEnter: w,
311
+ onAfterEnter: I,
312
+ onBeforeLeave: S,
313
+ onLeave: z,
314
+ onAfterLeave: d
315
+ }, {
316
+ default: Q(() => [
317
+ h(p) ? (c(), m("div", {
318
+ key: 0,
319
+ id: h(r),
320
+ "aria-labelledby": h(l),
321
+ class: "vf-accordion__content",
322
+ role: "region"
323
+ }, [
324
+ T("div", Qe, [
325
+ B(_.$slots, "default", { open: h(p) })
326
+ ])
327
+ ], 8, Ge)) : O("", !0)
328
+ ]),
329
+ _: 3
330
+ })
274
331
  ]));
275
332
  }
276
333
  });
277
- function S(...o) {
278
- return o.filter(Boolean).join(" ");
334
+ function N(...t) {
335
+ return t.filter(Boolean).join(" ");
279
336
  }
280
- const Ne = {
337
+ const Je = {
281
338
  class: "vf-alert__icon",
282
339
  "aria-hidden": "true"
283
- }, We = { class: "vf-alert__content" }, Ue = {
340
+ }, Ze = { class: "vf-alert__content" }, et = {
284
341
  key: 0,
285
342
  class: "vf-alert__title"
286
- }, Ye = { class: "vf-alert__body" }, St = /* @__PURE__ */ D({
343
+ }, tt = { class: "vf-alert__body" }, bn = /* @__PURE__ */ L({
287
344
  inheritAttrs: !1,
288
345
  __name: "VfAlert",
289
346
  props: {
290
347
  tone: { default: "primary" },
291
348
  title: { default: void 0 }
292
349
  },
293
- setup(o) {
294
- const t = o, e = P(), s = r(
295
- () => S("vf-alert", t.tone !== "primary" && `vf-alert--${t.tone}`)
296
- ), n = r(() => t.tone === "success" ? H.checkCircle : t.tone === "danger" ? H.warning : H.info);
297
- return (l, d) => (m(), h("section", F({
298
- class: s.value,
350
+ setup(t) {
351
+ const n = t, e = R(), i = s(
352
+ () => N("vf-alert", n.tone !== "primary" && `vf-alert--${n.tone}`)
353
+ ), l = s(() => n.tone === "success" ? X.checkCircle : n.tone === "info" ? X.info : n.tone === "warn" ? X.warning : n.tone === "help" ? X.questionCircle : n.tone === "danger" ? X.warning : n.tone === "contrast" ? X.info : X.info);
354
+ return (r, u) => (c(), m("section", H({
355
+ class: i.value,
299
356
  role: "alert"
300
- }, c(e)), [
301
- C("div", Ne, [
302
- ee(c(te), {
303
- icon: n.value,
357
+ }, h(e)), [
358
+ T("div", Je, [
359
+ j(h(te), {
360
+ icon: l.value,
304
361
  size: "2rem"
305
362
  }, null, 8, ["icon"])
306
363
  ]),
307
- C("div", We, [
308
- t.title || l.$slots.title ? (m(), h("p", Ue, [
309
- $(l.$slots, "title", {}, () => [
310
- ve(R(t.title), 1)
364
+ T("div", Ze, [
365
+ n.title || r.$slots.title ? (c(), m("p", et, [
366
+ B(r.$slots, "title", {}, () => [
367
+ oe(F(n.title), 1)
311
368
  ])
312
- ])) : I("", !0),
313
- C("div", Ye, [
314
- $(l.$slots, "default")
369
+ ])) : O("", !0),
370
+ T("div", tt, [
371
+ B(r.$slots, "default")
315
372
  ])
316
373
  ])
317
374
  ], 16));
318
375
  }
319
- }), zt = /* @__PURE__ */ D({
376
+ }), kn = /* @__PURE__ */ L({
320
377
  inheritAttrs: !1,
321
378
  __name: "VfBadge",
322
379
  props: {
323
380
  tone: { default: "neutral" }
324
381
  },
325
- setup(o) {
326
- const t = o, e = P(), s = r(
327
- () => S("vf-badge", t.tone !== "neutral" && `vf-badge--${t.tone}`)
382
+ setup(t) {
383
+ const n = t, e = R(), i = s(
384
+ () => N("vf-badge", n.tone !== "neutral" && `vf-badge--${n.tone}`)
328
385
  );
329
- return (n, l) => (m(), h("span", F({ class: s.value }, c(e)), [
330
- $(n.$slots, "default")
386
+ return (l, r) => (c(), m("span", H({ class: i.value }, h(e)), [
387
+ B(l.$slots, "default")
331
388
  ], 16));
332
389
  }
333
- }), He = ["type"], Pt = /* @__PURE__ */ D({
390
+ }), nt = ["type"], $n = /* @__PURE__ */ L({
334
391
  inheritAttrs: !1,
335
392
  __name: "VfButton",
336
393
  props: {
@@ -339,49 +396,102 @@ const Ne = {
339
396
  block: { type: Boolean, default: !1 },
340
397
  type: { default: "button" }
341
398
  },
342
- setup(o) {
343
- const t = o, e = P(), s = r(
344
- () => S(
399
+ setup(t) {
400
+ const n = t, e = R(), i = s(
401
+ () => N(
345
402
  "vf-button",
346
- t.variant !== "primary" && `vf-button--${t.variant}`,
347
- t.size !== "md" && `vf-button--${t.size}`,
348
- t.block && "vf-button--block"
403
+ `vf-button--${n.variant}`,
404
+ n.size !== "md" && `vf-button--${n.size}`,
405
+ n.block && "vf-button--block"
349
406
  )
350
407
  );
351
- return (n, l) => (m(), h("button", F({
352
- class: s.value,
353
- type: t.type
354
- }, c(e)), [
355
- $(n.$slots, "default")
356
- ], 16, He));
408
+ return (l, r) => (c(), m("button", H({
409
+ class: i.value,
410
+ type: n.type
411
+ }, h(e)), [
412
+ B(l.$slots, "default")
413
+ ], 16, nt));
357
414
  }
358
- }), Xe = { key: 0 }, qe = { class: "vf-card__title" }, je = {
415
+ }), at = { key: 0 }, ot = { class: "vf-card__title" }, lt = {
359
416
  key: 1,
360
417
  class: "vf-card__body"
361
- }, Qe = { key: 2 }, Ft = /* @__PURE__ */ D({
418
+ }, st = { key: 2 }, wn = /* @__PURE__ */ L({
362
419
  inheritAttrs: !1,
363
420
  __name: "VfCard",
364
421
  props: {
365
422
  title: { default: void 0 },
366
423
  compact: { type: Boolean, default: !1 }
367
424
  },
368
- setup(o) {
369
- const t = o, e = P(), s = r(() => S("vf-card", t.compact && "vf-card--compact"));
370
- return (n, l) => (m(), h("section", F({ class: s.value }, c(e)), [
371
- t.title || n.$slots.header ? (m(), h("header", Xe, [
372
- $(n.$slots, "header", {}, () => [
373
- C("h3", qe, R(t.title), 1)
425
+ setup(t) {
426
+ const n = t, e = R(), i = s(() => N("vf-card", n.compact && "vf-card--compact"));
427
+ return (l, r) => (c(), m("section", H({ class: i.value }, h(e)), [
428
+ n.title || l.$slots.header ? (c(), m("header", at, [
429
+ B(l.$slots, "header", {}, () => [
430
+ T("h3", ot, F(n.title), 1)
374
431
  ])
375
- ])) : I("", !0),
376
- n.$slots.default ? (m(), h("div", je, [
377
- $(n.$slots, "default")
378
- ])) : I("", !0),
379
- n.$slots.footer ? (m(), h("footer", Qe, [
380
- $(n.$slots, "footer")
381
- ])) : I("", !0)
432
+ ])) : O("", !0),
433
+ l.$slots.default ? (c(), m("div", lt, [
434
+ B(l.$slots, "default")
435
+ ])) : O("", !0),
436
+ l.$slots.footer ? (c(), m("footer", st, [
437
+ B(l.$slots, "footer")
438
+ ])) : O("", !0)
382
439
  ], 16));
383
440
  }
384
- }), Ge = ["type"], Je = /* @__PURE__ */ D({
441
+ }), it = ["checked", "disabled", "aria-invalid"], rt = {
442
+ key: 0,
443
+ class: "vf-checkbox__content"
444
+ }, Tn = /* @__PURE__ */ L({
445
+ inheritAttrs: !1,
446
+ __name: "VfCheckbox",
447
+ props: {
448
+ modelValue: { type: Boolean, default: !1 },
449
+ size: { default: "md" },
450
+ invalid: { type: Boolean, default: !1 },
451
+ disabled: { type: Boolean, default: !1 },
452
+ label: { default: void 0 }
453
+ },
454
+ emits: ["update:modelValue", "change"],
455
+ setup(t, { emit: n }) {
456
+ const e = t, i = n, l = R(), r = s(
457
+ () => N(
458
+ "vf-checkbox",
459
+ `vf-checkbox--${e.size}`,
460
+ e.modelValue && "vf-checkbox--checked",
461
+ e.invalid && "vf-checkbox--invalid",
462
+ e.disabled && "vf-checkbox--disabled",
463
+ l.class
464
+ )
465
+ ), u = s(() => l.style), p = s(() => Object.fromEntries(Object.entries(l).filter(([b]) => b !== "class" && b !== "style")));
466
+ function g(b) {
467
+ const v = b.target.checked;
468
+ i("update:modelValue", v), i("change", v);
469
+ }
470
+ return (b, v) => (c(), m("label", {
471
+ class: P(r.value),
472
+ style: W(u.value)
473
+ }, [
474
+ T("input", H({
475
+ class: "vf-checkbox__input",
476
+ type: "checkbox",
477
+ checked: e.modelValue,
478
+ disabled: e.disabled,
479
+ "aria-invalid": e.invalid || void 0
480
+ }, p.value, { onChange: g }), null, 16, it),
481
+ v[0] || (v[0] = T("span", {
482
+ class: "vf-checkbox__control",
483
+ "aria-hidden": "true"
484
+ }, [
485
+ T("span", { class: "vf-checkbox__mark" })
486
+ ], -1)),
487
+ t.label || b.$slots.default ? (c(), m("span", rt, [
488
+ B(b.$slots, "default", {}, () => [
489
+ oe(F(t.label), 1)
490
+ ])
491
+ ])) : O("", !0)
492
+ ], 6));
493
+ }
494
+ }), ut = ["type"], Ae = /* @__PURE__ */ L({
385
495
  inheritAttrs: !1,
386
496
  __name: "VfIconButton",
387
497
  props: {
@@ -390,38 +500,197 @@ const Ne = {
390
500
  size: { default: "md" },
391
501
  type: { default: "button" }
392
502
  },
393
- setup(o) {
394
- const t = o, e = P(), s = r(
395
- () => S(
503
+ setup(t) {
504
+ const n = t, e = R(), i = s(
505
+ () => N(
396
506
  "vf-icon-button",
397
- t.variant !== "ghost" && `vf-icon-button--${t.variant}`,
398
- t.size !== "md" && `vf-icon-button--${t.size}`
507
+ n.variant !== "ghost" && `vf-icon-button--${n.variant}`,
508
+ n.size !== "md" && `vf-icon-button--${n.size}`
399
509
  )
400
- ), n = r(() => t.size === "sm" ? "0.875rem" : t.size === "lg" ? "1.125rem" : "1rem");
401
- return (l, d) => (m(), h("button", F({
402
- class: s.value,
403
- type: t.type
404
- }, c(e)), [
405
- ee(c(te), {
406
- icon: t.icon,
407
- size: n.value,
510
+ ), l = s(() => n.size === "sm" ? "0.875rem" : n.size === "lg" ? "1.125rem" : "1rem");
511
+ return (r, u) => (c(), m("button", H({
512
+ class: i.value,
513
+ type: n.type
514
+ }, h(e)), [
515
+ j(h(te), {
516
+ icon: n.icon,
517
+ size: l.value,
408
518
  "aria-hidden": "true"
409
519
  }, null, 8, ["icon", "size"])
410
- ], 16, Ge));
520
+ ], 16, ut));
411
521
  }
412
- }), Ze = {
522
+ }), ct = ["aria-labelledby"], dt = {
523
+ key: 0,
524
+ class: "vf-drawer__header"
525
+ }, ft = ["id"], vt = { class: "vf-drawer__actions" }, pt = {
526
+ key: 1,
527
+ class: "vf-drawer__body"
528
+ }, mt = {
529
+ key: 2,
530
+ class: "vf-drawer__footer"
531
+ }, Vn = /* @__PURE__ */ L({
532
+ inheritAttrs: !1,
533
+ __name: "VfDrawer",
534
+ props: {
535
+ open: { type: Boolean, default: void 0 },
536
+ defaultOpen: { type: Boolean, default: !1 },
537
+ title: { default: void 0 },
538
+ size: { default: "md" },
539
+ placement: { default: "right" },
540
+ offsetTop: { default: void 0 },
541
+ bodyPadding: { default: void 0 },
542
+ teleportTo: { type: [String, null, Boolean], default: void 0 },
543
+ disableTeleport: { type: Boolean, default: !1 },
544
+ scrollLockTarget: { type: [null, Boolean], default: void 0 },
545
+ closeOnOverlayClick: { type: Boolean, default: !0 },
546
+ closeOnEscape: { type: Boolean, default: !0 },
547
+ closable: { type: Boolean, default: !0 }
548
+ },
549
+ emits: ["update:open", "openChange"],
550
+ setup(t, { emit: n }) {
551
+ const e = t, i = n, l = R(), r = A(null), u = A(null), p = Te(), g = G({ prefix: "vf-drawer-title" }), b = se({
552
+ defaultOpen: e.defaultOpen,
553
+ open: s(() => e.open),
554
+ onOpenChange: (x) => {
555
+ i("update:open", x), i("openChange", x);
556
+ }
557
+ }), v = b.isOpen, E = {
558
+ enter: U.normal,
559
+ leave: U.normal
560
+ };
561
+ function V(x) {
562
+ return typeof x == "number" ? `${x}px` : x;
563
+ }
564
+ const w = s(() => {
565
+ const x = {}, $ = V(e.offsetTop), J = V(e.bodyPadding);
566
+ return $ != null && (x["--vf-drawer-offset-top"] = $), J != null && (x["--vf-drawer-body-padding"] = J), x;
567
+ }), I = s(
568
+ () => N("vf-drawer", `vf-drawer--${e.placement}`, e.offsetTop != null && "vf-drawer--offset-top")
569
+ ), S = s(() => [w.value, l.style]), z = s(() => Object.fromEntries(Object.entries(l).filter(([x]) => x !== "class" && x !== "style"))), d = s(() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null), _ = s(() => e.scrollLockTarget === !1 ? null : e.scrollLockTarget), o = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), y = s(
570
+ () => N("vf-drawer__content", `vf-drawer__content--${e.placement}`, `vf-drawer__content--${e.size}`)
571
+ ), f = s(() => !!p.header), a = s(
572
+ () => e.title || f.value ? g.value : void 0
573
+ );
574
+ function C() {
575
+ b.close();
576
+ }
577
+ function D() {
578
+ e.closeOnOverlayClick && C();
579
+ }
580
+ function M() {
581
+ const x = r.value;
582
+ if (!x)
583
+ return;
584
+ const $ = x.querySelector("[autofocus], [data-autofocus]");
585
+ if ($) {
586
+ $.focus();
587
+ return;
588
+ }
589
+ x.focus();
590
+ }
591
+ return fe(
592
+ (x) => {
593
+ !e.closeOnEscape || !v.value || (x.preventDefault(), C());
594
+ },
595
+ {
596
+ enabled: v
597
+ }
598
+ ), De(r, {
599
+ enabled: v
600
+ }), Ce(v, {
601
+ target: _
602
+ }), Z(
603
+ v,
604
+ async (x) => {
605
+ var $;
606
+ if (!(typeof document > "u")) {
607
+ if (x) {
608
+ u.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await ae(), M();
609
+ return;
610
+ }
611
+ ($ = u.value) == null || $.focus();
612
+ }
613
+ },
614
+ { immediate: !0 }
615
+ ), ee(() => {
616
+ var x;
617
+ v.value && ((x = u.value) == null || x.focus());
618
+ }), (x, $) => (c(), q(le, {
619
+ to: o.value,
620
+ disabled: d.value
621
+ }, [
622
+ j(ne, {
623
+ name: "vf-drawer-transition",
624
+ appear: "",
625
+ duration: E
626
+ }, {
627
+ default: Q(() => [
628
+ h(v) ? (c(), m("div", H({
629
+ key: 0,
630
+ class: [I.value, h(l).class],
631
+ style: S.value
632
+ }, z.value), [
633
+ T("div", {
634
+ class: "vf-drawer__overlay",
635
+ "aria-hidden": "true",
636
+ onClick: D
637
+ }),
638
+ T("section", {
639
+ ref_key: "contentRef",
640
+ ref: r,
641
+ class: P(y.value),
642
+ "aria-labelledby": a.value,
643
+ "aria-modal": "true",
644
+ role: "dialog",
645
+ tabindex: "-1"
646
+ }, [
647
+ t.title || x.$slots.header ? (c(), m("header", dt, [
648
+ T("div", null, [
649
+ B(x.$slots, "header", {}, () => [
650
+ t.title ? (c(), m("h2", {
651
+ key: 0,
652
+ id: h(g),
653
+ class: "vf-drawer__title"
654
+ }, F(t.title), 9, ft)) : O("", !0)
655
+ ])
656
+ ]),
657
+ T("div", vt, [
658
+ B(x.$slots, "actions", { close: C }),
659
+ e.closable ? (c(), q(Ae, {
660
+ key: 0,
661
+ icon: h(X).xmark,
662
+ "aria-label": "Close drawer",
663
+ size: "sm",
664
+ onClick: C
665
+ }, null, 8, ["icon"])) : O("", !0)
666
+ ])
667
+ ])) : O("", !0),
668
+ x.$slots.default ? (c(), m("div", pt, [
669
+ B(x.$slots, "default", { close: C })
670
+ ])) : O("", !0),
671
+ x.$slots.footer ? (c(), m("footer", mt, [
672
+ B(x.$slots, "footer", { close: C })
673
+ ])) : O("", !0)
674
+ ], 10, ct)
675
+ ], 16)) : O("", !0)
676
+ ]),
677
+ _: 3
678
+ })
679
+ ], 8, ["to", "disabled"]));
680
+ }
681
+ }), ht = {
413
682
  key: 0,
414
683
  class: "vf-dialog"
415
- }, et = ["aria-describedby", "aria-labelledby"], tt = {
684
+ }, yt = ["aria-describedby", "aria-labelledby"], _t = {
416
685
  key: 0,
417
686
  class: "vf-dialog__header"
418
- }, ot = ["id"], nt = ["id"], at = { class: "vf-dialog__actions" }, st = {
687
+ }, gt = ["id"], bt = ["id"], kt = { class: "vf-dialog__actions" }, $t = {
419
688
  key: 1,
420
689
  class: "vf-dialog__body"
421
- }, lt = {
690
+ }, wt = {
422
691
  key: 2,
423
692
  class: "vf-dialog__footer"
424
- }, Kt = /* @__PURE__ */ D({
693
+ }, xn = /* @__PURE__ */ L({
425
694
  __name: "VfDialog",
426
695
  props: {
427
696
  open: { type: Boolean, default: void 0 },
@@ -429,287 +698,321 @@ const Ne = {
429
698
  title: { default: void 0 },
430
699
  description: { default: void 0 },
431
700
  size: { default: "md" },
701
+ teleportTo: { type: [String, null, Boolean], default: void 0 },
702
+ disableTeleport: { type: Boolean, default: !1 },
432
703
  closeOnOverlayClick: { type: Boolean, default: !0 },
433
704
  closeOnEscape: { type: Boolean, default: !0 },
434
705
  closable: { type: Boolean, default: !0 }
435
706
  },
436
707
  emits: ["update:open", "openChange"],
437
- setup(o, { emit: t }) {
438
- const e = o, s = t, n = w(null), l = w(null), d = xe(), f = K({ prefix: "vf-dialog-title" }), _ = K({ prefix: "vf-dialog-description" }), b = Z({
708
+ setup(t, { emit: n }) {
709
+ const e = t, i = n, l = A(null), r = A(null), u = Te(), p = G({ prefix: "vf-dialog-title" }), g = G({ prefix: "vf-dialog-description" }), b = se({
439
710
  defaultOpen: e.defaultOpen,
440
- open: r(() => e.open),
711
+ open: s(() => e.open),
441
712
  onOpenChange: (a) => {
442
- s("update:open", a), s("openChange", a);
713
+ i("update:open", a), i("openChange", a);
443
714
  }
444
- }), u = b.isOpen, V = r(
445
- () => S("vf-dialog__content", e.size !== "md" && `vf-dialog__content--${e.size}`)
446
- ), k = r(() => !!d.header), O = r(() => !!d.description), y = r(
447
- () => e.title || k.value ? f.value : void 0
448
- ), B = r(
449
- () => e.description || O.value ? _.value : void 0
715
+ }), v = b.isOpen, E = {
716
+ enter: U.fast,
717
+ leave: U.fast
718
+ }, V = s(() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null), w = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), I = s(
719
+ () => N("vf-dialog__content", e.size !== "md" && `vf-dialog__content--${e.size}`)
720
+ ), S = s(() => !!u.header), z = s(() => !!u.description), d = s(
721
+ () => e.title || S.value ? p.value : void 0
722
+ ), _ = s(
723
+ () => e.description || z.value ? g.value : void 0
450
724
  );
451
- function x() {
725
+ function o() {
452
726
  b.close();
453
727
  }
454
- function p() {
455
- e.closeOnOverlayClick && x();
728
+ function y() {
729
+ e.closeOnOverlayClick && o();
456
730
  }
457
- function E() {
458
- const a = n.value;
731
+ function f() {
732
+ const a = l.value;
459
733
  if (!a)
460
734
  return;
461
- const T = a.querySelector("[autofocus], [data-autofocus]");
462
- if (T) {
463
- T.focus();
735
+ const C = a.querySelector("[autofocus], [data-autofocus]");
736
+ if (C) {
737
+ C.focus();
464
738
  return;
465
739
  }
466
740
  a.focus();
467
741
  }
468
- return le(
742
+ return fe(
469
743
  (a) => {
470
- !e.closeOnEscape || !u.value || (a.preventDefault(), x());
744
+ !e.closeOnEscape || !v.value || (a.preventDefault(), o());
471
745
  },
472
746
  {
473
- enabled: u
747
+ enabled: v
474
748
  }
475
- ), Fe(n, {
476
- enabled: u
477
- }), Ee(u), W(
478
- u,
749
+ ), De(l, {
750
+ enabled: v
751
+ }), Ce(v), Z(
752
+ v,
479
753
  async (a) => {
480
- var T;
754
+ var C;
481
755
  if (!(typeof document > "u")) {
482
756
  if (a) {
483
- l.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await G(), E();
757
+ r.value = document.activeElement instanceof HTMLElement ? document.activeElement : null, await ae(), f();
484
758
  return;
485
759
  }
486
- (T = l.value) == null || T.focus();
760
+ (C = r.value) == null || C.focus();
487
761
  }
488
762
  },
489
763
  { immediate: !0 }
490
- ), N(() => {
764
+ ), ee(() => {
491
765
  var a;
492
- u.value && ((a = l.value) == null || a.focus());
493
- }), (a, T) => (m(), X(J, { to: "body" }, [
494
- c(u) ? (m(), h("div", Ze, [
495
- C("div", {
496
- class: "vf-dialog__overlay",
497
- "aria-hidden": "true",
498
- onClick: p
499
- }),
500
- C("section", {
501
- ref_key: "contentRef",
502
- ref: n,
503
- class: M(V.value),
504
- "aria-describedby": B.value,
505
- "aria-labelledby": y.value,
506
- "aria-modal": "true",
507
- role: "dialog",
508
- tabindex: "-1"
509
- }, [
510
- o.title || o.description || a.$slots.header || a.$slots.description ? (m(), h("header", tt, [
511
- C("div", null, [
512
- $(a.$slots, "header", {}, () => [
513
- o.title ? (m(), h("h2", {
514
- key: 0,
515
- id: c(f),
516
- class: "vf-dialog__title"
517
- }, R(o.title), 9, ot)) : I("", !0)
518
- ]),
519
- $(a.$slots, "description", {}, () => [
520
- o.description ? (m(), h("p", {
521
- key: 0,
522
- id: c(_),
523
- class: "vf-dialog__description"
524
- }, R(o.description), 9, nt)) : I("", !0)
525
- ])
526
- ]),
527
- C("div", at, [
528
- $(a.$slots, "actions", { close: x }),
529
- e.closable ? (m(), X(Je, {
530
- key: 0,
531
- icon: c(H).xmark,
532
- "aria-label": "Close dialog",
533
- size: "sm",
534
- onClick: x
535
- }, null, 8, ["icon"])) : I("", !0)
536
- ])
537
- ])) : I("", !0),
538
- a.$slots.default ? (m(), h("div", st, [
539
- $(a.$slots, "default", { close: x })
540
- ])) : I("", !0),
541
- a.$slots.footer ? (m(), h("footer", lt, [
542
- $(a.$slots, "footer", { close: x })
543
- ])) : I("", !0)
544
- ], 10, et)
545
- ])) : I("", !0)
546
- ]));
766
+ v.value && ((a = r.value) == null || a.focus());
767
+ }), (a, C) => (c(), q(le, {
768
+ to: w.value,
769
+ disabled: V.value
770
+ }, [
771
+ j(ne, {
772
+ name: "vf-dialog-transition",
773
+ appear: "",
774
+ duration: E
775
+ }, {
776
+ default: Q(() => [
777
+ h(v) ? (c(), m("div", ht, [
778
+ T("div", {
779
+ class: "vf-dialog__overlay",
780
+ "aria-hidden": "true",
781
+ onClick: y
782
+ }),
783
+ T("section", {
784
+ ref_key: "contentRef",
785
+ ref: l,
786
+ class: P(I.value),
787
+ "aria-describedby": _.value,
788
+ "aria-labelledby": d.value,
789
+ "aria-modal": "true",
790
+ role: "dialog",
791
+ tabindex: "-1"
792
+ }, [
793
+ t.title || t.description || a.$slots.header || a.$slots.description ? (c(), m("header", _t, [
794
+ T("div", null, [
795
+ B(a.$slots, "header", {}, () => [
796
+ t.title ? (c(), m("h2", {
797
+ key: 0,
798
+ id: h(p),
799
+ class: "vf-dialog__title"
800
+ }, F(t.title), 9, gt)) : O("", !0)
801
+ ]),
802
+ B(a.$slots, "description", {}, () => [
803
+ t.description ? (c(), m("p", {
804
+ key: 0,
805
+ id: h(g),
806
+ class: "vf-dialog__description"
807
+ }, F(t.description), 9, bt)) : O("", !0)
808
+ ])
809
+ ]),
810
+ T("div", kt, [
811
+ B(a.$slots, "actions", { close: o }),
812
+ e.closable ? (c(), q(Ae, {
813
+ key: 0,
814
+ icon: h(X).xmark,
815
+ "aria-label": "Close dialog",
816
+ size: "sm",
817
+ onClick: o
818
+ }, null, 8, ["icon"])) : O("", !0)
819
+ ])
820
+ ])) : O("", !0),
821
+ a.$slots.default ? (c(), m("div", $t, [
822
+ B(a.$slots, "default", { close: o })
823
+ ])) : O("", !0),
824
+ a.$slots.footer ? (c(), m("footer", wt, [
825
+ B(a.$slots, "footer", { close: o })
826
+ ])) : O("", !0)
827
+ ], 10, yt)
828
+ ])) : O("", !0)
829
+ ]),
830
+ _: 3
831
+ })
832
+ ], 8, ["to", "disabled"]));
547
833
  }
548
- }), rt = ["aria-orientation", "role"], Lt = /* @__PURE__ */ D({
834
+ }), Tt = ["aria-orientation", "role"], Cn = /* @__PURE__ */ L({
549
835
  inheritAttrs: !1,
550
836
  __name: "VfDivider",
551
837
  props: {
552
838
  orientation: { default: "horizontal" }
553
839
  },
554
- setup(o) {
555
- const t = o, e = P(), s = r(() => t.orientation === "vertical"), n = r(() => S("vf-divider", `vf-divider--${t.orientation}`));
556
- return (l, d) => (m(), h("div", F({
557
- class: n.value,
558
- "aria-orientation": t.orientation,
559
- role: s.value ? "separator" : void 0
560
- }, c(e)), null, 16, rt));
840
+ setup(t) {
841
+ const n = t, e = R(), i = s(() => n.orientation === "vertical"), l = s(() => N("vf-divider", `vf-divider--${n.orientation}`));
842
+ return (r, u) => (c(), m("div", H({
843
+ class: l.value,
844
+ "aria-orientation": n.orientation,
845
+ role: i.value ? "separator" : void 0
846
+ }, h(e)), null, 16, Tt));
561
847
  }
562
- }), it = { class: "vf-dropdown" }, ut = ["id", "aria-controls", "aria-expanded"], ct = ["id", "aria-labelledby"], Rt = /* @__PURE__ */ D({
848
+ }), Vt = { class: "vf-dropdown" }, xt = ["id", "aria-controls", "aria-expanded"], Ct = ["id", "aria-labelledby"], Bn = /* @__PURE__ */ L({
563
849
  __name: "VfDropdown",
564
850
  props: {
565
851
  open: { type: Boolean, default: void 0 },
566
852
  defaultOpen: { type: Boolean, default: !1 },
567
853
  placement: { default: "bottom-start" },
854
+ teleportTo: { type: [String, null, Boolean], default: void 0 },
855
+ disableTeleport: { type: Boolean, default: !1 },
568
856
  closeOnSelect: { type: Boolean, default: !0 }
569
857
  },
570
858
  emits: ["update:open", "openChange"],
571
- setup(o, { emit: t }) {
572
- const e = o, s = t, n = w(null), l = w(null), d = w(null), f = K({ prefix: "vf-dropdown-menu" }), _ = K({ prefix: "vf-dropdown-trigger" }), b = Z({
859
+ setup(t, { emit: n }) {
860
+ const e = t, i = n, l = A(null), r = A(null), u = A(null), p = G({ prefix: "vf-dropdown-menu" }), g = G({ prefix: "vf-dropdown-trigger" }), b = {
861
+ enter: U.fast,
862
+ leave: U.fast
863
+ }, v = s(() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null), E = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), V = se({
573
864
  defaultOpen: e.defaultOpen,
574
- open: r(() => e.open),
575
- onOpenChange: (i) => {
576
- s("update:open", i), s("openChange", i);
865
+ open: s(() => e.open),
866
+ onOpenChange: (k) => {
867
+ i("update:open", k), i("openChange", k);
577
868
  }
578
- }), u = b.isOpen, V = r(() => [
869
+ }), w = V.isOpen, I = s(() => [
579
870
  "vf-dropdown__menu",
580
- x.value.startsWith("top") && "vf-dropdown__menu--top"
581
- ]), k = r(() => {
582
- const i = p.value.arrow;
871
+ o.value.startsWith("top") && "vf-dropdown__menu--top"
872
+ ]), S = s(() => {
873
+ const k = y.value.arrow;
583
874
  return {
584
- x: (i == null ? void 0 : i.x) !== void 0 && (i == null ? void 0 : i.baseX) !== void 0 ? i.x - i.baseX : 0,
585
- y: (i == null ? void 0 : i.y) !== void 0 && (i == null ? void 0 : i.baseY) !== void 0 ? i.y - i.baseY : 0
875
+ x: (k == null ? void 0 : k.x) !== void 0 && (k == null ? void 0 : k.baseX) !== void 0 ? k.x - k.baseX : 0,
876
+ y: (k == null ? void 0 : k.y) !== void 0 && (k == null ? void 0 : k.baseY) !== void 0 ? k.y - k.baseY : 0
586
877
  };
587
- }), O = r(() => ({
588
- left: `${k.value.x}px`,
589
- top: `${k.value.y}px`
590
- })), y = r(() => [
878
+ }), z = s(() => ({
879
+ left: `${S.value.x}px`,
880
+ top: `${S.value.y}px`
881
+ })), d = s(() => [
591
882
  "vf-dropdown__arrow",
592
- x.value.startsWith("top") ? "vf-dropdown__arrow--top" : "vf-dropdown__arrow--bottom"
593
- ]), B = r(
883
+ o.value.startsWith("top") ? "vf-dropdown__arrow--top" : "vf-dropdown__arrow--bottom"
884
+ ]), _ = s(
594
885
  () => e.placement === "bottom-end" ? ["bottom-end", "top-end"] : ["bottom-start", "top-start"]
595
- ), { placement: x, middlewareData: p, styles: E } = re(n, l, {
596
- enabled: u,
597
- placement: r(() => e.placement),
598
- middleware: r(
599
- () => [oe(10), ne({ placements: B.value }), ae(), d.value ? se(d.value) : void 0].filter(
600
- (i) => i !== void 0
886
+ ), { placement: o, middlewareData: y, styles: f } = ye(l, r, {
887
+ enabled: w,
888
+ placement: s(() => e.placement),
889
+ middleware: s(
890
+ () => [ve(10), pe({ placements: _.value }), me(), u.value ? he(u.value) : void 0].filter(
891
+ (k) => k !== void 0
601
892
  )
602
893
  ),
603
894
  strategy: "fixed"
604
895
  });
605
896
  function a() {
606
- var i;
607
- return Array.from(((i = l.value) == null ? void 0 : i.querySelectorAll('[role="menuitem"]')) ?? []);
897
+ var k;
898
+ return Array.from(((k = r.value) == null ? void 0 : k.querySelectorAll('[role="menuitem"]')) ?? []);
608
899
  }
609
- async function T() {
610
- var i;
611
- await G(), (i = a()[0]) == null || i.focus();
900
+ async function C() {
901
+ var k;
902
+ await ae(), (k = a()[0]) == null || k.focus();
612
903
  }
613
- function g(i = {}) {
614
- b.open(), i.focusFirstItem && T();
904
+ function D(k = {}) {
905
+ V.open(), k.focusFirstItem && C();
615
906
  }
616
- function L() {
617
- var i;
618
- b.close(), (i = n.value) == null || i.focus();
907
+ function M() {
908
+ var k;
909
+ V.close(), (k = l.value) == null || k.focus();
619
910
  }
620
- function q() {
621
- if (u.value) {
622
- L();
911
+ function x() {
912
+ if (w.value) {
913
+ M();
623
914
  return;
624
915
  }
625
- g();
916
+ D();
626
917
  }
627
- function v(i) {
628
- (i.key === "ArrowDown" || i.key === "Enter" || i.key === " ") && (i.preventDefault(), g({ focusFirstItem: !0 }));
918
+ function $(k) {
919
+ (k.key === "ArrowDown" || k.key === "Enter" || k.key === " ") && (k.preventDefault(), D({ focusFirstItem: !0 }));
629
920
  }
630
- function Y(i) {
631
- var ue, ce, de, fe;
632
- const z = a(), ie = z.findIndex((ye) => ye === document.activeElement);
633
- if (i.key === "ArrowDown") {
634
- i.preventDefault(), (ue = z[(ie + 1 + z.length) % z.length]) == null || ue.focus();
921
+ function J(k) {
922
+ var ge, be, ke, $e;
923
+ const Y = a(), _e = Y.findIndex((Ie) => Ie === document.activeElement);
924
+ if (k.key === "ArrowDown") {
925
+ k.preventDefault(), (ge = Y[(_e + 1 + Y.length) % Y.length]) == null || ge.focus();
635
926
  return;
636
927
  }
637
- if (i.key === "ArrowUp") {
638
- i.preventDefault(), (ce = z[(ie - 1 + z.length) % z.length]) == null || ce.focus();
928
+ if (k.key === "ArrowUp") {
929
+ k.preventDefault(), (be = Y[(_e - 1 + Y.length) % Y.length]) == null || be.focus();
639
930
  return;
640
931
  }
641
- if (i.key === "Home") {
642
- i.preventDefault(), (de = z[0]) == null || de.focus();
932
+ if (k.key === "Home") {
933
+ k.preventDefault(), (ke = Y[0]) == null || ke.focus();
643
934
  return;
644
935
  }
645
- i.key === "End" && (i.preventDefault(), (fe = z[z.length - 1]) == null || fe.focus());
936
+ k.key === "End" && (k.preventDefault(), ($e = Y[Y.length - 1]) == null || $e.focus());
646
937
  }
647
- function j() {
648
- e.closeOnSelect && L();
938
+ function ie() {
939
+ e.closeOnSelect && M();
649
940
  }
650
- return he(
651
- [n, l],
941
+ return Oe(
942
+ [l, r],
652
943
  () => {
653
- u.value && L();
944
+ w.value && M();
654
945
  },
655
946
  {
656
- enabled: u,
947
+ enabled: w,
657
948
  event: "click"
658
949
  }
659
- ), le(
660
- (i) => {
661
- u.value && (i.preventDefault(), L());
950
+ ), fe(
951
+ (k) => {
952
+ w.value && (k.preventDefault(), M());
662
953
  },
663
954
  {
664
- enabled: u
955
+ enabled: w
665
956
  }
666
- ), (i, z) => (m(), h("div", it, [
667
- C("div", {
668
- id: c(_),
957
+ ), (k, Y) => (c(), m("div", Vt, [
958
+ T("div", {
959
+ id: h(g),
669
960
  ref_key: "triggerRef",
670
- ref: n,
961
+ ref: l,
671
962
  class: "vf-dropdown__trigger",
672
- "aria-controls": c(f),
673
- "aria-expanded": c(u),
963
+ "aria-controls": h(p),
964
+ "aria-expanded": h(w),
674
965
  "aria-haspopup": "menu",
675
966
  tabindex: "0",
676
- onClick: q,
677
- onKeydown: v
967
+ onClick: x,
968
+ onKeydown: $
678
969
  }, [
679
- $(i.$slots, "trigger", {
680
- open: c(u),
681
- toggle: q
970
+ B(k.$slots, "trigger", {
971
+ open: h(w),
972
+ toggle: x
682
973
  })
683
- ], 40, ut),
684
- (m(), X(J, { to: "body" }, [
685
- c(u) ? (m(), h("div", {
686
- key: 0,
687
- id: c(f),
688
- ref_key: "menuRef",
689
- ref: l,
690
- class: M(V.value),
691
- style: U(c(E)),
692
- "aria-labelledby": c(_),
693
- role: "menu",
694
- onClick: j,
695
- onKeydown: Y
696
- }, [
697
- C("span", {
698
- ref_key: "arrowRef",
699
- ref: d,
700
- class: M(y.value),
701
- style: U(O.value),
702
- "aria-hidden": "true"
703
- }, null, 6),
704
- $(i.$slots, "default", {
705
- close: L,
706
- open: c(u)
707
- })
708
- ], 46, ct)) : I("", !0)
709
- ]))
974
+ ], 40, xt),
975
+ (c(), q(le, {
976
+ to: E.value,
977
+ disabled: v.value
978
+ }, [
979
+ j(ne, {
980
+ name: "vf-floating-transition",
981
+ appear: "",
982
+ duration: b
983
+ }, {
984
+ default: Q(() => [
985
+ h(w) ? (c(), m("div", {
986
+ key: 0,
987
+ id: h(p),
988
+ ref_key: "menuRef",
989
+ ref: r,
990
+ class: P(I.value),
991
+ style: W(h(f)),
992
+ "aria-labelledby": h(g),
993
+ role: "menu",
994
+ onClick: ie,
995
+ onKeydown: J
996
+ }, [
997
+ T("span", {
998
+ ref_key: "arrowRef",
999
+ ref: u,
1000
+ class: P(d.value),
1001
+ style: W(z.value),
1002
+ "aria-hidden": "true"
1003
+ }, null, 6),
1004
+ B(k.$slots, "default", {
1005
+ close: M,
1006
+ open: h(w)
1007
+ })
1008
+ ], 46, Ct)) : O("", !0)
1009
+ ]),
1010
+ _: 3
1011
+ })
1012
+ ], 8, ["to", "disabled"]))
710
1013
  ]));
711
1014
  }
712
- }), dt = ["value", "aria-invalid"], Mt = /* @__PURE__ */ D({
1015
+ }), Bt = ["value", "aria-invalid"], En = /* @__PURE__ */ L({
713
1016
  inheritAttrs: !1,
714
1017
  __name: "VfInput",
715
1018
  props: {
@@ -718,219 +1021,654 @@ const Ne = {
718
1021
  invalid: { type: Boolean, default: !1 }
719
1022
  },
720
1023
  emits: ["update:modelValue"],
721
- setup(o, { emit: t }) {
722
- const e = o, s = t, n = P(), l = r(
723
- () => S(
1024
+ setup(t, { emit: n }) {
1025
+ const e = t, i = n, l = R(), r = s(
1026
+ () => N(
724
1027
  "vf-input",
725
1028
  e.size !== "md" && `vf-input--${e.size}`,
726
1029
  e.invalid && "vf-input--invalid"
727
1030
  )
728
1031
  );
729
- function d(f) {
730
- s("update:modelValue", f.target.value);
1032
+ function u(p) {
1033
+ i("update:modelValue", p.target.value);
731
1034
  }
732
- return (f, _) => (m(), h("input", F({
733
- class: l.value,
1035
+ return (p, g) => (c(), m("input", H({
1036
+ class: r.value,
734
1037
  value: e.modelValue,
735
1038
  "aria-invalid": e.invalid || void 0
736
- }, c(n), { onInput: d }), null, 16, dt));
1039
+ }, h(l), { onInput: u }), null, 16, Bt));
737
1040
  }
738
- }), ft = ["href", "target", "rel"], Nt = /* @__PURE__ */ D({
1041
+ }), On = /* @__PURE__ */ L({
739
1042
  inheritAttrs: !1,
740
1043
  __name: "VfLink",
741
1044
  props: {
742
1045
  href: { default: void 0 },
1046
+ to: { default: void 0 },
743
1047
  target: { default: void 0 },
744
1048
  rel: { default: void 0 },
745
1049
  underline: { type: Boolean, default: !1 },
746
- tone: { default: "default" }
1050
+ tone: { default: "default" },
1051
+ component: { default: void 0 }
747
1052
  },
748
- setup(o) {
749
- const t = o, e = P(), s = r(() => t.rel ? t.rel : t.target === "_blank" ? "noopener noreferrer" : void 0), n = r(
750
- () => S(
1053
+ setup(t) {
1054
+ const n = t, e = R(), i = s(() => n.to !== void 0), l = s(() => i.value ? n.component ?? re("RouterLink") : "a"), r = s(() => n.rel ? n.rel : n.target === "_blank" ? "noopener noreferrer" : void 0), u = s(
1055
+ () => N(
751
1056
  "vf-link",
752
- t.underline && "vf-link--underline",
753
- t.tone === "muted" && "vf-link--muted"
1057
+ n.underline && "vf-link--underline",
1058
+ n.tone === "muted" && "vf-link--muted"
754
1059
  )
755
- );
756
- return (l, d) => (m(), h("a", F({
757
- class: n.value,
758
- href: t.href,
759
- target: t.target,
760
- rel: s.value
761
- }, c(e)), [
762
- $(l.$slots, "default")
763
- ], 16, ft));
1060
+ ), p = s(() => i.value ? {
1061
+ to: n.to,
1062
+ target: n.target,
1063
+ rel: r.value
1064
+ } : {
1065
+ href: n.href,
1066
+ target: n.target,
1067
+ rel: r.value
1068
+ }), g = s(() => ({
1069
+ ...e,
1070
+ ...p.value,
1071
+ class: u.value
1072
+ }));
1073
+ return (b, v) => (c(), q(re(l.value), Ve(xe(g.value)), {
1074
+ default: Q(() => [
1075
+ B(b.$slots, "default")
1076
+ ]),
1077
+ _: 3
1078
+ }, 16));
764
1079
  }
765
- }), pt = { key: 0 }, vt = { class: "vf-panel__title" }, Wt = /* @__PURE__ */ D({
1080
+ }), Et = { class: "vf-nav-menu__node" }, Ot = { class: "vf-nav-menu__item-content" }, Dt = { class: "vf-nav-menu__group-label" }, At = ["aria-expanded", "disabled"], It = { class: "vf-nav-menu__item-content" }, Lt = {
1081
+ key: 0,
1082
+ class: "vf-nav-menu__leading-icon",
1083
+ "aria-hidden": "true"
1084
+ }, St = { class: "vf-nav-menu__label" }, zt = { class: "vf-nav-menu__item-content" }, Mt = {
1085
+ key: 0,
1086
+ class: "vf-nav-menu__leading-icon",
1087
+ "aria-hidden": "true"
1088
+ }, Pt = { class: "vf-nav-menu__label" }, Nt = ["aria-current", "disabled"], Ft = { class: "vf-nav-menu__item-content" }, Rt = {
1089
+ key: 0,
1090
+ class: "vf-nav-menu__leading-icon",
1091
+ "aria-hidden": "true"
1092
+ }, Ht = { class: "vf-nav-menu__label" }, Kt = {
1093
+ key: 4,
1094
+ class: "vf-nav-menu__list vf-nav-menu__list--nested"
1095
+ }, jt = { class: "vf-nav-menu__list vf-nav-menu__list--nested" }, qt = /* @__PURE__ */ L({
1096
+ name: "VfNavMenuItemNode",
1097
+ __name: "VfNavMenuItemNode",
1098
+ props: {
1099
+ item: {},
1100
+ level: {},
1101
+ parentPath: {},
1102
+ activeValue: {},
1103
+ expandedValues: {}
1104
+ },
1105
+ emits: ["toggle", "select"],
1106
+ setup(t, { emit: n }) {
1107
+ const e = t, i = n, l = s(() => {
1108
+ var f;
1109
+ return !!((f = e.item.children) != null && f.length);
1110
+ }), r = s(() => e.item.kind === "group"), u = s(() => e.expandedValues.includes(e.item.value)), p = s(() => e.activeValue === e.item.value), g = s(() => e.item.href !== void 0 || e.item.to !== void 0), b = s(() => e.item.to !== void 0 ? re("RouterLink") : "a"), v = s(() => e.item.rel ? e.item.rel : e.item.target === "_blank" ? "noopener noreferrer" : void 0), E = s(() => e.item.to !== void 0 ? {
1111
+ to: e.item.to,
1112
+ target: e.item.target,
1113
+ rel: v.value
1114
+ } : {
1115
+ href: e.item.href,
1116
+ target: e.item.target,
1117
+ rel: v.value
1118
+ });
1119
+ function V() {
1120
+ e.item.disabled || i("toggle", {
1121
+ value: e.item.value,
1122
+ parentPath: e.parentPath
1123
+ });
1124
+ }
1125
+ function w(f) {
1126
+ if (e.item.disabled) {
1127
+ f == null || f.preventDefault();
1128
+ return;
1129
+ }
1130
+ i("select", e.item);
1131
+ }
1132
+ function I(f) {
1133
+ const a = f;
1134
+ return a.style.transition = "height var(--vf-motion-duration-normal) var(--vf-motion-ease-standard), opacity var(--vf-motion-duration-normal) var(--vf-motion-ease-standard)", a;
1135
+ }
1136
+ function S(f) {
1137
+ const a = I(f);
1138
+ a.style.overflow = "hidden", a.style.height = "0", a.style.opacity = "0";
1139
+ }
1140
+ function z(f) {
1141
+ const a = I(f);
1142
+ requestAnimationFrame(() => {
1143
+ a.style.height = `${a.scrollHeight}px`, a.style.opacity = "1";
1144
+ });
1145
+ }
1146
+ function d(f) {
1147
+ const a = f;
1148
+ a.style.transition = "", a.style.overflow = "", a.style.height = "", a.style.opacity = "";
1149
+ }
1150
+ function _(f) {
1151
+ const a = I(f);
1152
+ a.style.overflow = "hidden", a.style.height = `${a.scrollHeight}px`, a.style.opacity = "1";
1153
+ }
1154
+ function o(f) {
1155
+ const a = f;
1156
+ a.offsetHeight, requestAnimationFrame(() => {
1157
+ a.style.height = "0", a.style.opacity = "0";
1158
+ });
1159
+ }
1160
+ function y(f) {
1161
+ const a = f;
1162
+ a.style.transition = "", a.style.overflow = "", a.style.height = "", a.style.opacity = "";
1163
+ }
1164
+ return (f, a) => {
1165
+ const C = Re("VfNavMenuItemNode", !0);
1166
+ return c(), m("li", Et, [
1167
+ r.value ? (c(), m("div", {
1168
+ key: 0,
1169
+ class: P(["vf-nav-menu__group", `vf-nav-menu__group--level-${t.level}`]),
1170
+ style: W({ "--vf-nav-menu-level": String(t.level) })
1171
+ }, [
1172
+ T("span", Ot, [
1173
+ T("span", Dt, F(t.item.label), 1)
1174
+ ])
1175
+ ], 6)) : l.value ? (c(), m("button", {
1176
+ key: 1,
1177
+ class: P(["vf-nav-menu__item", "vf-nav-menu__item--branch", u.value && "vf-nav-menu__item--expanded"]),
1178
+ style: W({ "--vf-nav-menu-level": String(t.level) }),
1179
+ "aria-expanded": u.value,
1180
+ disabled: t.item.disabled,
1181
+ type: "button",
1182
+ onClick: V
1183
+ }, [
1184
+ T("span", It, [
1185
+ t.item.leadingIcon ? (c(), m("span", Lt, [
1186
+ j(h(te), {
1187
+ icon: t.item.leadingIcon,
1188
+ size: "1rem"
1189
+ }, null, 8, ["icon"])
1190
+ ])) : O("", !0),
1191
+ T("span", St, F(t.item.label), 1)
1192
+ ]),
1193
+ T("span", {
1194
+ class: P(["vf-nav-menu__icon", u.value && "vf-nav-menu__icon--open"]),
1195
+ "aria-hidden": "true"
1196
+ }, [
1197
+ j(h(te), {
1198
+ icon: h(X).chevronDown,
1199
+ size: "0.875rem"
1200
+ }, null, 8, ["icon"])
1201
+ ], 2)
1202
+ ], 14, At)) : g.value ? (c(), q(re(b.value), H({ key: 2 }, E.value, {
1203
+ class: ["vf-nav-menu__item", p.value && "vf-nav-menu__item--active", t.item.disabled && "vf-nav-menu__item--disabled"],
1204
+ style: { "--vf-nav-menu-level": String(t.level) },
1205
+ "aria-current": p.value ? "page" : void 0,
1206
+ onClick: w
1207
+ }), {
1208
+ default: Q(() => [
1209
+ T("span", zt, [
1210
+ t.item.leadingIcon ? (c(), m("span", Mt, [
1211
+ j(h(te), {
1212
+ icon: t.item.leadingIcon,
1213
+ size: "1rem"
1214
+ }, null, 8, ["icon"])
1215
+ ])) : O("", !0),
1216
+ T("span", Pt, F(t.item.label), 1)
1217
+ ])
1218
+ ]),
1219
+ _: 1
1220
+ }, 16, ["class", "style", "aria-current"])) : (c(), m("button", {
1221
+ key: 3,
1222
+ class: P(["vf-nav-menu__item", p.value && "vf-nav-menu__item--active", t.item.disabled && "vf-nav-menu__item--disabled"]),
1223
+ style: W({ "--vf-nav-menu-level": String(t.level) }),
1224
+ "aria-current": p.value ? "page" : void 0,
1225
+ disabled: t.item.disabled,
1226
+ type: "button",
1227
+ onClick: a[0] || (a[0] = (D) => w())
1228
+ }, [
1229
+ T("span", Ft, [
1230
+ t.item.leadingIcon ? (c(), m("span", Rt, [
1231
+ j(h(te), {
1232
+ icon: t.item.leadingIcon,
1233
+ size: "1rem"
1234
+ }, null, 8, ["icon"])
1235
+ ])) : O("", !0),
1236
+ T("span", Ht, F(t.item.label), 1)
1237
+ ])
1238
+ ], 14, Nt)),
1239
+ l.value && r.value ? (c(), m("ul", Kt, [
1240
+ (c(!0), m(ue, null, ce(t.item.children, (D) => (c(), q(C, {
1241
+ key: D.value,
1242
+ item: D,
1243
+ level: t.level + 1,
1244
+ "parent-path": [...t.parentPath, t.item.value],
1245
+ "active-value": t.activeValue,
1246
+ "expanded-values": t.expandedValues,
1247
+ onToggle: a[1] || (a[1] = (M) => i("toggle", M)),
1248
+ onSelect: a[2] || (a[2] = (M) => i("select", M))
1249
+ }, null, 8, ["item", "level", "parent-path", "active-value", "expanded-values"]))), 128))
1250
+ ])) : l.value ? (c(), q(ne, {
1251
+ key: 5,
1252
+ onBeforeEnter: S,
1253
+ onEnter: z,
1254
+ onAfterEnter: d,
1255
+ onBeforeLeave: _,
1256
+ onLeave: o,
1257
+ onAfterLeave: y
1258
+ }, {
1259
+ default: Q(() => [
1260
+ u.value ? (c(), m("div", {
1261
+ key: 0,
1262
+ class: P(["vf-nav-menu__collapse", `vf-nav-menu__collapse--level-${t.level}`])
1263
+ }, [
1264
+ T("ul", jt, [
1265
+ (c(!0), m(ue, null, ce(t.item.children, (D) => (c(), q(C, {
1266
+ key: D.value,
1267
+ item: D,
1268
+ level: t.level + 1,
1269
+ "parent-path": [...t.parentPath, t.item.value],
1270
+ "active-value": t.activeValue,
1271
+ "expanded-values": t.expandedValues,
1272
+ onToggle: a[3] || (a[3] = (M) => i("toggle", M)),
1273
+ onSelect: a[4] || (a[4] = (M) => i("select", M))
1274
+ }, null, 8, ["item", "level", "parent-path", "active-value", "expanded-values"]))), 128))
1275
+ ])
1276
+ ], 2)) : O("", !0)
1277
+ ]),
1278
+ _: 1
1279
+ })) : O("", !0)
1280
+ ]);
1281
+ };
1282
+ }
1283
+ }), Wt = ["aria-label"], Ut = { class: "vf-nav-menu__list" }, Dn = /* @__PURE__ */ L({
1284
+ __name: "VfNavMenu",
1285
+ props: {
1286
+ items: {},
1287
+ modelValue: { default: void 0 },
1288
+ defaultValue: { default: void 0 },
1289
+ ariaLabel: { default: "Navigation" },
1290
+ expandMode: { default: "multiple" }
1291
+ },
1292
+ emits: ["update:modelValue", "change", "select"],
1293
+ setup(t, { emit: n }) {
1294
+ const e = t, i = n, l = A(e.defaultValue), r = s(() => e.modelValue ?? l.value), u = A([]);
1295
+ function p(o, y) {
1296
+ return o.some((f) => {
1297
+ var a;
1298
+ return y(f) || ((a = f.children) != null && a.length ? p(f.children, y) : !1);
1299
+ });
1300
+ }
1301
+ const g = s(() => p(e.items, (o) => o.kind === "group")), b = s(() => p(e.items, (o) => !!o.leadingIcon)), v = s(() => !g.value && !b.value);
1302
+ function E(o) {
1303
+ var y;
1304
+ return o.kind !== "group" && !!((y = o.children) != null && y.length);
1305
+ }
1306
+ function V(o, y, f = []) {
1307
+ var a;
1308
+ if (!y)
1309
+ return [];
1310
+ for (const C of o) {
1311
+ if (C.value === y)
1312
+ return f;
1313
+ if ((a = C.children) != null && a.length) {
1314
+ const D = V(C.children, y, [...f, C.value]);
1315
+ if (D.length)
1316
+ return D;
1317
+ }
1318
+ }
1319
+ return [];
1320
+ }
1321
+ function w() {
1322
+ const o = V(e.items, r.value);
1323
+ u.value = Array.from(/* @__PURE__ */ new Set([...u.value, ...o]));
1324
+ }
1325
+ function I(o, y) {
1326
+ var D;
1327
+ if (!y.length)
1328
+ return o;
1329
+ const [f, ...a] = y, C = o.find((M) => M.value === f);
1330
+ return (D = C == null ? void 0 : C.children) != null && D.length ? I(C.children, a) : [];
1331
+ }
1332
+ function S(o) {
1333
+ return o.flatMap((y) => {
1334
+ var a;
1335
+ const f = (a = y.children) != null && a.length ? S(y.children) : [];
1336
+ return E(y) ? [y.value, ...f] : f;
1337
+ });
1338
+ }
1339
+ function z(o) {
1340
+ e.modelValue === void 0 && (l.value = o), i("update:modelValue", o), i("change", o);
1341
+ }
1342
+ function d(o) {
1343
+ z(o.value), u.value = Array.from(/* @__PURE__ */ new Set([...u.value, ...V(e.items, o.value)])), i("select", o);
1344
+ }
1345
+ function _(o) {
1346
+ const { value: y, parentPath: f } = o;
1347
+ if (u.value.includes(y)) {
1348
+ u.value = u.value.filter((a) => a !== y);
1349
+ return;
1350
+ }
1351
+ if (e.expandMode === "single") {
1352
+ const C = I(e.items, f).filter((D) => D.value !== y && E(D)).flatMap((D) => S([D]));
1353
+ u.value = u.value.filter((D) => !C.includes(D));
1354
+ }
1355
+ u.value = [...u.value, y];
1356
+ }
1357
+ return Z(
1358
+ () => [e.items, r.value],
1359
+ () => {
1360
+ w();
1361
+ },
1362
+ { immediate: !0, deep: !0 }
1363
+ ), (o, y) => (c(), m("nav", {
1364
+ class: P(["vf-nav-menu", v.value && "vf-nav-menu--simple"]),
1365
+ "aria-label": t.ariaLabel
1366
+ }, [
1367
+ T("ul", Ut, [
1368
+ (c(!0), m(ue, null, ce(t.items, (f) => (c(), q(qt, {
1369
+ key: f.value,
1370
+ item: f,
1371
+ level: 0,
1372
+ "parent-path": [],
1373
+ "active-value": r.value,
1374
+ "expanded-values": u.value,
1375
+ onToggle: _,
1376
+ onSelect: d
1377
+ }, null, 8, ["item", "active-value", "expanded-values"]))), 128))
1378
+ ])
1379
+ ], 10, Wt));
1380
+ }
1381
+ }), Yt = { key: 0 }, Xt = { class: "vf-panel__title" }, An = /* @__PURE__ */ L({
766
1382
  inheritAttrs: !1,
767
1383
  __name: "VfPanel",
768
1384
  props: {
769
1385
  title: { default: void 0 },
770
1386
  subtle: { type: Boolean, default: !1 }
771
1387
  },
772
- setup(o) {
773
- const t = o, e = P(), s = r(() => S("vf-panel", t.subtle && "vf-panel--subtle"));
774
- return (n, l) => (m(), h("section", F({ class: s.value }, c(e)), [
775
- t.title || n.$slots.header ? (m(), h("header", pt, [
776
- $(n.$slots, "header", {}, () => [
777
- C("h3", vt, R(t.title), 1)
1388
+ setup(t) {
1389
+ const n = t, e = R(), i = s(() => N("vf-panel", n.subtle && "vf-panel--subtle"));
1390
+ return (l, r) => (c(), m("section", H({ class: i.value }, h(e)), [
1391
+ n.title || l.$slots.header ? (c(), m("header", Yt, [
1392
+ B(l.$slots, "header", {}, () => [
1393
+ T("h3", Xt, F(n.title), 1)
778
1394
  ])
779
- ])) : I("", !0),
780
- $(n.$slots, "default")
1395
+ ])) : O("", !0),
1396
+ B(l.$slots, "default")
781
1397
  ], 16));
782
1398
  }
783
- }), mt = { class: "vf-popover" }, _t = ["id", "aria-controls", "aria-expanded"], ht = ["id", "aria-labelledby"], Ut = /* @__PURE__ */ D({
1399
+ }), Gt = { class: "vf-popover" }, Qt = ["id", "aria-controls", "aria-expanded"], Jt = ["id", "aria-labelledby"], In = /* @__PURE__ */ L({
784
1400
  __name: "VfPopover",
785
1401
  props: {
786
1402
  open: { type: Boolean, default: void 0 },
787
1403
  defaultOpen: { type: Boolean, default: !1 },
788
1404
  placement: { default: "bottom-start" },
1405
+ teleportTo: { type: [String, null, Boolean], default: void 0 },
1406
+ disableTeleport: { type: Boolean, default: !1 },
789
1407
  closeOnOutsideClick: { type: Boolean, default: !0 },
790
1408
  closeOnEscape: { type: Boolean, default: !0 }
791
1409
  },
792
1410
  emits: ["update:open", "openChange"],
793
- setup(o, { emit: t }) {
794
- const e = o, s = t, n = w(null), l = w(null), d = w(null), f = K({ prefix: "vf-popover-content" }), _ = K({ prefix: "vf-popover-trigger" }), b = Z({
1411
+ setup(t, { emit: n }) {
1412
+ const e = t, i = n, l = A(null), r = A(null), u = A(null), p = G({ prefix: "vf-popover-content" }), g = G({ prefix: "vf-popover-trigger" }), b = {
1413
+ enter: U.fast,
1414
+ leave: U.fast
1415
+ }, v = s(() => e.disableTeleport || e.teleportTo === !1 || e.teleportTo === null), E = s(() => typeof e.teleportTo == "string" || typeof HTMLElement < "u" && e.teleportTo instanceof HTMLElement ? e.teleportTo : "body"), V = se({
795
1416
  defaultOpen: e.defaultOpen,
796
- open: r(() => e.open),
797
- onOpenChange: (v) => {
798
- s("update:open", v), s("openChange", v);
1417
+ open: s(() => e.open),
1418
+ onOpenChange: ($) => {
1419
+ i("update:open", $), i("openChange", $);
799
1420
  }
800
- }), u = b.isOpen, V = r(
1421
+ }), w = V.isOpen, I = s(
801
1422
  () => e.placement === "bottom-end" ? ["bottom-end", "top-end"] : ["bottom-start", "top-start"]
802
- ), { placement: k, middlewareData: O, styles: y } = re(n, l, {
803
- enabled: u,
804
- placement: r(() => e.placement),
805
- middleware: r(
806
- () => [oe(10), ne({ placements: V.value }), ae(), d.value ? se(d.value) : void 0].filter(
807
- (v) => v !== void 0
1423
+ ), { placement: S, middlewareData: z, styles: d } = ye(l, r, {
1424
+ enabled: w,
1425
+ placement: s(() => e.placement),
1426
+ middleware: s(
1427
+ () => [ve(10), pe({ placements: I.value }), me(), u.value ? he(u.value) : void 0].filter(
1428
+ ($) => $ !== void 0
808
1429
  )
809
1430
  ),
810
1431
  strategy: "fixed"
811
- }), B = r(() => [
1432
+ }), _ = s(() => [
812
1433
  "vf-popover__content",
813
- k.value.startsWith("top") && "vf-popover__content--top"
814
- ]), x = r(() => {
815
- const v = O.value.arrow;
1434
+ S.value.startsWith("top") && "vf-popover__content--top"
1435
+ ]), o = s(() => {
1436
+ const $ = z.value.arrow;
816
1437
  return {
817
- x: (v == null ? void 0 : v.x) !== void 0 && (v == null ? void 0 : v.baseX) !== void 0 ? v.x - v.baseX : 0,
818
- y: (v == null ? void 0 : v.y) !== void 0 && (v == null ? void 0 : v.baseY) !== void 0 ? v.y - v.baseY : 0
1438
+ x: ($ == null ? void 0 : $.x) !== void 0 && ($ == null ? void 0 : $.baseX) !== void 0 ? $.x - $.baseX : 0,
1439
+ y: ($ == null ? void 0 : $.y) !== void 0 && ($ == null ? void 0 : $.baseY) !== void 0 ? $.y - $.baseY : 0
819
1440
  };
820
- }), p = r(() => ({
821
- left: `${x.value.x}px`,
822
- top: `${x.value.y}px`
823
- })), E = r(() => [
1441
+ }), y = s(() => ({
1442
+ left: `${o.value.x}px`,
1443
+ top: `${o.value.y}px`
1444
+ })), f = s(() => [
824
1445
  "vf-popover__arrow",
825
- k.value.startsWith("top") ? "vf-popover__arrow--top" : "vf-popover__arrow--bottom"
1446
+ S.value.startsWith("top") ? "vf-popover__arrow--top" : "vf-popover__arrow--bottom"
826
1447
  ]);
827
1448
  async function a() {
828
- var Y, j;
829
- await G();
830
- const v = (Y = l.value) == null ? void 0 : Y.querySelector("[autofocus], [data-autofocus]");
831
- if (v) {
832
- v.focus();
1449
+ var J, ie;
1450
+ await ae();
1451
+ const $ = (J = r.value) == null ? void 0 : J.querySelector("[autofocus], [data-autofocus]");
1452
+ if ($) {
1453
+ $.focus();
833
1454
  return;
834
1455
  }
835
- (j = l.value) == null || j.focus();
1456
+ (ie = r.value) == null || ie.focus();
836
1457
  }
837
- function T() {
838
- b.open(), a();
1458
+ function C() {
1459
+ V.open(), a();
839
1460
  }
840
- function g() {
841
- var v;
842
- b.close(), (v = n.value) == null || v.focus();
1461
+ function D() {
1462
+ var $;
1463
+ V.close(), ($ = l.value) == null || $.focus();
843
1464
  }
844
- function L() {
845
- if (u.value) {
846
- g();
1465
+ function M() {
1466
+ if (w.value) {
1467
+ D();
847
1468
  return;
848
1469
  }
849
- T();
1470
+ C();
850
1471
  }
851
- function q(v) {
852
- (v.key === "Enter" || v.key === " ") && (v.preventDefault(), L()), v.key === "ArrowDown" && (v.preventDefault(), T());
1472
+ function x($) {
1473
+ ($.key === "Enter" || $.key === " ") && ($.preventDefault(), M()), $.key === "ArrowDown" && ($.preventDefault(), C());
853
1474
  }
854
- return he(
855
- [n, l],
1475
+ return Oe(
1476
+ [l, r],
856
1477
  () => {
857
- u.value && e.closeOnOutsideClick && g();
1478
+ w.value && e.closeOnOutsideClick && D();
858
1479
  },
859
1480
  {
860
- enabled: u,
1481
+ enabled: w,
861
1482
  event: "click"
862
1483
  }
863
- ), le(
864
- (v) => {
865
- !u.value || !e.closeOnEscape || (v.preventDefault(), g());
1484
+ ), fe(
1485
+ ($) => {
1486
+ !w.value || !e.closeOnEscape || ($.preventDefault(), D());
866
1487
  },
867
1488
  {
868
- enabled: u
1489
+ enabled: w
869
1490
  }
870
- ), (v, Y) => (m(), h("div", mt, [
871
- C("div", {
872
- id: c(_),
1491
+ ), ($, J) => (c(), m("div", Gt, [
1492
+ T("div", {
1493
+ id: h(g),
873
1494
  ref_key: "triggerRef",
874
- ref: n,
1495
+ ref: l,
875
1496
  class: "vf-popover__trigger",
876
- "aria-controls": c(f),
877
- "aria-expanded": c(u),
1497
+ "aria-controls": h(p),
1498
+ "aria-expanded": h(w),
878
1499
  "aria-haspopup": "dialog",
879
1500
  tabindex: "0",
880
- onClick: L,
881
- onKeydown: q
1501
+ onClick: M,
1502
+ onKeydown: x
882
1503
  }, [
883
- $(v.$slots, "trigger", {
884
- open: c(u),
885
- toggle: L
1504
+ B($.$slots, "trigger", {
1505
+ open: h(w),
1506
+ toggle: M
886
1507
  })
887
- ], 40, _t),
888
- (m(), X(J, { to: "body" }, [
889
- c(u) ? (m(), h("section", {
890
- key: 0,
891
- id: c(f),
892
- ref_key: "contentRef",
893
- ref: l,
894
- class: M(B.value),
895
- style: U(c(y)),
896
- "aria-labelledby": c(_),
897
- role: "dialog",
898
- tabindex: "-1"
899
- }, [
900
- C("span", {
901
- ref_key: "arrowRef",
902
- ref: d,
903
- class: M(E.value),
904
- style: U(p.value),
905
- "aria-hidden": "true"
906
- }, null, 6),
907
- $(v.$slots, "default", {
908
- open: c(u),
909
- close: g
910
- })
911
- ], 14, ht)) : I("", !0)
912
- ]))
1508
+ ], 40, Qt),
1509
+ (c(), q(le, {
1510
+ to: E.value,
1511
+ disabled: v.value
1512
+ }, [
1513
+ j(ne, {
1514
+ name: "vf-floating-transition",
1515
+ appear: "",
1516
+ duration: b
1517
+ }, {
1518
+ default: Q(() => [
1519
+ h(w) ? (c(), m("section", {
1520
+ key: 0,
1521
+ id: h(p),
1522
+ ref_key: "contentRef",
1523
+ ref: r,
1524
+ class: P(_.value),
1525
+ style: W(h(d)),
1526
+ "aria-labelledby": h(g),
1527
+ role: "dialog",
1528
+ tabindex: "-1"
1529
+ }, [
1530
+ T("span", {
1531
+ ref_key: "arrowRef",
1532
+ ref: u,
1533
+ class: P(f.value),
1534
+ style: W(y.value),
1535
+ "aria-hidden": "true"
1536
+ }, null, 6),
1537
+ B($.$slots, "default", {
1538
+ open: h(w),
1539
+ close: D
1540
+ })
1541
+ ], 14, Jt)) : O("", !0)
1542
+ ]),
1543
+ _: 3
1544
+ })
1545
+ ], 8, ["to", "disabled"]))
913
1546
  ]));
914
1547
  }
915
- }), Yt = /* @__PURE__ */ D({
1548
+ }), Zt = ["checked", "disabled", "value", "aria-invalid"], en = {
1549
+ key: 0,
1550
+ class: "vf-radio__content"
1551
+ }, Ln = /* @__PURE__ */ L({
1552
+ inheritAttrs: !1,
1553
+ __name: "VfRadio",
1554
+ props: {
1555
+ modelValue: { type: [String, Number, Boolean], default: void 0 },
1556
+ value: { type: [String, Number, Boolean] },
1557
+ size: { default: "md" },
1558
+ invalid: { type: Boolean, default: !1 },
1559
+ disabled: { type: Boolean, default: !1 },
1560
+ label: { default: void 0 }
1561
+ },
1562
+ emits: ["update:modelValue", "change"],
1563
+ setup(t, { emit: n }) {
1564
+ const e = t, i = n, l = R(), r = s(() => e.modelValue === e.value), u = s(
1565
+ () => N(
1566
+ "vf-radio",
1567
+ `vf-radio--${e.size}`,
1568
+ r.value && "vf-radio--checked",
1569
+ e.invalid && "vf-radio--invalid",
1570
+ e.disabled && "vf-radio--disabled",
1571
+ l.class
1572
+ )
1573
+ ), p = s(() => l.style), g = s(() => Object.fromEntries(Object.entries(l).filter(([v]) => v !== "class" && v !== "style")));
1574
+ function b(v) {
1575
+ v.target.checked && (i("update:modelValue", e.value), i("change", e.value));
1576
+ }
1577
+ return (v, E) => (c(), m("label", {
1578
+ class: P(u.value),
1579
+ style: W(p.value)
1580
+ }, [
1581
+ T("input", H({
1582
+ class: "vf-radio__input",
1583
+ type: "radio",
1584
+ checked: r.value,
1585
+ disabled: e.disabled,
1586
+ value: e.value,
1587
+ "aria-invalid": e.invalid || void 0
1588
+ }, g.value, { onChange: b }), null, 16, Zt),
1589
+ E[0] || (E[0] = T("span", {
1590
+ class: "vf-radio__control",
1591
+ "aria-hidden": "true"
1592
+ }, [
1593
+ T("span", { class: "vf-radio__dot" })
1594
+ ], -1)),
1595
+ t.label || v.$slots.default ? (c(), m("span", en, [
1596
+ B(v.$slots, "default", {}, () => [
1597
+ oe(F(t.label), 1)
1598
+ ])
1599
+ ])) : O("", !0)
1600
+ ], 6));
1601
+ }
1602
+ }), tn = ["checked", "disabled"], nn = {
1603
+ key: 0,
1604
+ class: "vf-switch__content"
1605
+ }, Sn = /* @__PURE__ */ L({
1606
+ inheritAttrs: !1,
1607
+ __name: "VfSwitch",
1608
+ props: {
1609
+ modelValue: { type: Boolean, default: !1 },
1610
+ size: { default: "md" },
1611
+ disabled: { type: Boolean, default: !1 },
1612
+ label: { default: void 0 }
1613
+ },
1614
+ emits: ["update:modelValue", "change"],
1615
+ setup(t, { emit: n }) {
1616
+ const e = t, i = n, l = R(), r = s(
1617
+ () => N(
1618
+ "vf-switch",
1619
+ `vf-switch--${e.size}`,
1620
+ e.modelValue && "vf-switch--checked",
1621
+ e.disabled && "vf-switch--disabled",
1622
+ l.class
1623
+ )
1624
+ ), u = s(() => l.style), p = s(() => Object.fromEntries(Object.entries(l).filter(([b]) => b !== "class" && b !== "style")));
1625
+ function g(b) {
1626
+ const v = b.target.checked;
1627
+ i("update:modelValue", v), i("change", v);
1628
+ }
1629
+ return (b, v) => (c(), m("label", {
1630
+ class: P(r.value),
1631
+ style: W(u.value)
1632
+ }, [
1633
+ T("input", H({
1634
+ class: "vf-switch__input",
1635
+ type: "checkbox",
1636
+ role: "switch",
1637
+ checked: e.modelValue,
1638
+ disabled: e.disabled
1639
+ }, p.value, { onChange: g }), null, 16, tn),
1640
+ v[0] || (v[0] = T("span", {
1641
+ class: "vf-switch__control",
1642
+ "aria-hidden": "true"
1643
+ }, [
1644
+ T("span", { class: "vf-switch__thumb" })
1645
+ ], -1)),
1646
+ t.label || b.$slots.default ? (c(), m("span", nn, [
1647
+ B(b.$slots, "default", {}, () => [
1648
+ oe(F(t.label), 1)
1649
+ ])
1650
+ ])) : O("", !0)
1651
+ ], 6));
1652
+ }
1653
+ }), zn = /* @__PURE__ */ L({
916
1654
  inheritAttrs: !1,
917
1655
  __name: "VfTag",
918
1656
  props: {
919
1657
  tone: { default: "neutral" }
920
1658
  },
921
- setup(o) {
922
- const t = o, e = P(), s = r(
923
- () => S("vf-tag", t.tone !== "neutral" && `vf-tag--${t.tone}`)
1659
+ setup(t) {
1660
+ const n = t, e = R(), i = s(
1661
+ () => N("vf-tag", n.tone !== "neutral" && `vf-tag--${n.tone}`)
924
1662
  );
925
- return (n, l) => (m(), h("span", F({ class: s.value }, c(e)), [
926
- $(n.$slots, "default")
1663
+ return (l, r) => (c(), m("span", H({ class: i.value }, h(e)), [
1664
+ B(l.$slots, "default")
927
1665
  ], 16));
928
1666
  }
929
- }), yt = { class: "vf-tabs" }, bt = {
1667
+ }), an = { class: "vf-tabs" }, on = {
930
1668
  class: "vf-tabs__list",
931
1669
  role: "tablist",
932
1670
  "aria-orientation": "horizontal"
933
- }, gt = ["id", "aria-controls", "aria-selected", "disabled", "tabindex", "onClick", "onKeydown"], $t = ["id", "aria-labelledby"], Ht = /* @__PURE__ */ D({
1671
+ }, ln = ["id", "aria-controls", "aria-selected", "disabled", "tabindex", "onClick", "onKeydown"], sn = ["id", "aria-labelledby"], Mn = /* @__PURE__ */ L({
934
1672
  __name: "VfTabs",
935
1673
  props: {
936
1674
  items: {},
@@ -938,99 +1676,99 @@ const Ne = {
938
1676
  defaultValue: { default: void 0 }
939
1677
  },
940
1678
  emits: ["update:modelValue", "change"],
941
- setup(o, { emit: t }) {
942
- const e = o, s = t, n = K({ prefix: "vf-tabs" }), l = w([]), d = r(() => {
943
- var p;
944
- return (p = e.items.find((E) => !E.disabled)) == null ? void 0 : p.value;
945
- }), f = w(e.defaultValue ?? d.value), _ = r(() => e.modelValue !== void 0), b = r(() => e.modelValue ?? f.value ?? d.value);
946
- W(
1679
+ setup(t, { emit: n }) {
1680
+ const e = t, i = n, l = G({ prefix: "vf-tabs" }), r = A([]), u = s(() => {
1681
+ var d;
1682
+ return (d = e.items.find((_) => !_.disabled)) == null ? void 0 : d.value;
1683
+ }), p = A(e.defaultValue ?? u.value), g = s(() => e.modelValue !== void 0), b = s(() => e.modelValue ?? p.value ?? u.value);
1684
+ Z(
947
1685
  () => e.items,
948
- (p) => {
949
- !p.some((a) => a.value === b.value && !a.disabled) && d.value && u(d.value);
1686
+ (d) => {
1687
+ !d.some((o) => o.value === b.value && !o.disabled) && u.value && v(u.value);
950
1688
  },
951
1689
  { deep: !0 }
952
1690
  );
953
- function u(p) {
954
- _.value || (f.value = p), s("update:modelValue", p), s("change", p);
1691
+ function v(d) {
1692
+ g.value || (p.value = d), i("update:modelValue", d), i("change", d);
955
1693
  }
956
- function V(p) {
957
- p.disabled || u(p.value);
1694
+ function E(d) {
1695
+ d.disabled || v(d.value);
958
1696
  }
959
- function k() {
960
- return e.items.filter((p) => !p.disabled);
1697
+ function V() {
1698
+ return e.items.filter((d) => !d.disabled);
961
1699
  }
962
- function O(p) {
963
- var a;
964
- const E = e.items.findIndex((T) => T.value === p);
965
- (a = l.value[E]) == null || a.focus();
966
- }
967
- function y(p, E) {
968
- const a = k(), T = a.findIndex((g) => g.value === E.value);
969
- if (T !== -1) {
970
- if (p.key === "ArrowRight" || p.key === "ArrowDown") {
971
- p.preventDefault();
972
- const g = a[(T + 1) % a.length];
973
- V(g), O(g.value);
1700
+ function w(d) {
1701
+ var o;
1702
+ const _ = e.items.findIndex((y) => y.value === d);
1703
+ (o = r.value[_]) == null || o.focus();
1704
+ }
1705
+ function I(d, _) {
1706
+ const o = V(), y = o.findIndex((f) => f.value === _.value);
1707
+ if (y !== -1) {
1708
+ if (d.key === "ArrowRight" || d.key === "ArrowDown") {
1709
+ d.preventDefault();
1710
+ const f = o[(y + 1) % o.length];
1711
+ E(f), w(f.value);
974
1712
  return;
975
1713
  }
976
- if (p.key === "ArrowLeft" || p.key === "ArrowUp") {
977
- p.preventDefault();
978
- const g = a[(T - 1 + a.length) % a.length];
979
- V(g), O(g.value);
1714
+ if (d.key === "ArrowLeft" || d.key === "ArrowUp") {
1715
+ d.preventDefault();
1716
+ const f = o[(y - 1 + o.length) % o.length];
1717
+ E(f), w(f.value);
980
1718
  return;
981
1719
  }
982
- if (p.key === "Home") {
983
- p.preventDefault();
984
- const g = a[0];
985
- V(g), O(g.value);
1720
+ if (d.key === "Home") {
1721
+ d.preventDefault();
1722
+ const f = o[0];
1723
+ E(f), w(f.value);
986
1724
  return;
987
1725
  }
988
- if (p.key === "End") {
989
- p.preventDefault();
990
- const g = a[a.length - 1];
991
- V(g), O(g.value);
1726
+ if (d.key === "End") {
1727
+ d.preventDefault();
1728
+ const f = o[o.length - 1];
1729
+ E(f), w(f.value);
992
1730
  }
993
1731
  }
994
1732
  }
995
- function B(p) {
996
- return `${n.value}-tab-${p}`;
1733
+ function S(d) {
1734
+ return `${l.value}-tab-${d}`;
997
1735
  }
998
- function x(p) {
999
- return `${n.value}-panel-${p}`;
1736
+ function z(d) {
1737
+ return `${l.value}-panel-${d}`;
1000
1738
  }
1001
- return (p, E) => (m(), h("div", yt, [
1002
- C("div", bt, [
1003
- (m(!0), h(Ce, null, Oe(o.items, (a, T) => (m(), h("button", {
1004
- id: B(a.value),
1005
- key: a.value,
1739
+ return (d, _) => (c(), m("div", an, [
1740
+ T("div", on, [
1741
+ (c(!0), m(ue, null, ce(t.items, (o, y) => (c(), m("button", {
1742
+ id: S(o.value),
1743
+ key: o.value,
1006
1744
  ref_for: !0,
1007
- ref: (g) => {
1008
- l.value[T] = g;
1745
+ ref: (f) => {
1746
+ r.value[y] = f;
1009
1747
  },
1010
- "aria-controls": x(a.value),
1011
- "aria-selected": b.value === a.value,
1012
- disabled: a.disabled,
1013
- tabindex: b.value === a.value ? 0 : -1,
1748
+ "aria-controls": z(o.value),
1749
+ "aria-selected": b.value === o.value,
1750
+ disabled: o.disabled,
1751
+ tabindex: b.value === o.value ? 0 : -1,
1014
1752
  class: "vf-tabs__tab",
1015
1753
  role: "tab",
1016
1754
  type: "button",
1017
- onClick: (g) => V(a),
1018
- onKeydown: (g) => y(g, a)
1019
- }, R(a.label), 41, gt))), 128))
1755
+ onClick: (f) => E(o),
1756
+ onKeydown: (f) => I(f, o)
1757
+ }, F(o.label), 41, ln))), 128))
1020
1758
  ]),
1021
- b.value ? (m(), h("div", {
1759
+ b.value ? (c(), m("div", {
1022
1760
  key: 0,
1023
- id: x(b.value),
1024
- "aria-labelledby": B(b.value),
1761
+ id: z(b.value),
1762
+ "aria-labelledby": S(b.value),
1025
1763
  class: "vf-tabs__panel",
1026
1764
  role: "tabpanel",
1027
1765
  tabindex: "0"
1028
1766
  }, [
1029
- $(p.$slots, "panel", De(Ie({ activeValue: b.value })))
1030
- ], 8, $t)) : I("", !0)
1767
+ B(d.$slots, "panel", Ve(xe({ activeValue: b.value })))
1768
+ ], 8, sn)) : O("", !0)
1031
1769
  ]));
1032
1770
  }
1033
- }), wt = ["value", "aria-invalid"], Xt = /* @__PURE__ */ D({
1771
+ }), rn = ["value", "aria-invalid"], Pn = /* @__PURE__ */ L({
1034
1772
  inheritAttrs: !1,
1035
1773
  __name: "VfTextarea",
1036
1774
  props: {
@@ -1039,149 +1777,171 @@ const Ne = {
1039
1777
  invalid: { type: Boolean, default: !1 }
1040
1778
  },
1041
1779
  emits: ["update:modelValue"],
1042
- setup(o, { emit: t }) {
1043
- const e = o, s = t, n = P(), l = r(
1044
- () => S(
1780
+ setup(t, { emit: n }) {
1781
+ const e = t, i = n, l = R(), r = s(
1782
+ () => N(
1045
1783
  "vf-textarea",
1046
1784
  e.size !== "md" && `vf-textarea--${e.size}`,
1047
1785
  e.invalid && "vf-textarea--invalid"
1048
1786
  )
1049
1787
  );
1050
- function d(f) {
1051
- s("update:modelValue", f.target.value);
1788
+ function u(p) {
1789
+ i("update:modelValue", p.target.value);
1052
1790
  }
1053
- return (f, _) => (m(), h("textarea", F({
1054
- class: l.value,
1791
+ return (p, g) => (c(), m("textarea", H({
1792
+ class: r.value,
1055
1793
  value: e.modelValue,
1056
1794
  "aria-invalid": e.invalid || void 0
1057
- }, c(n), { onInput: d }), null, 16, wt));
1795
+ }, h(l), { onInput: u }), null, 16, rn));
1058
1796
  }
1059
- }), kt = ["aria-describedby"], Vt = ["id"], qt = /* @__PURE__ */ D({
1797
+ }), un = ["aria-describedby"], cn = ["id"], Nn = /* @__PURE__ */ L({
1060
1798
  __name: "VfTooltip",
1061
1799
  props: {
1062
1800
  text: { default: void 0 },
1063
1801
  placement: { default: "top" },
1064
- openDelay: { default: 80 }
1802
+ openDelay: { default: 80 },
1803
+ teleportTo: { type: [String, null, Boolean], default: void 0 },
1804
+ disableTeleport: { type: Boolean, default: !1 }
1065
1805
  },
1066
- setup(o) {
1067
- const t = o, e = w(!1), s = K({ prefix: "vf-tooltip" }), n = w(null), l = w(null), d = w(null), f = w(null), { placement: _, middlewareData: b, styles: u, cleanup: V } = re(
1068
- l,
1069
- d,
1806
+ setup(t) {
1807
+ const n = t, e = A(!1), i = G({ prefix: "vf-tooltip" }), l = A(null), r = A(null), u = A(null), p = A(null), g = {
1808
+ enter: U.fast,
1809
+ leave: U.fast
1810
+ }, b = s(() => n.disableTeleport || n.teleportTo === !1 || n.teleportTo === null), v = s(() => typeof n.teleportTo == "string" || typeof HTMLElement < "u" && n.teleportTo instanceof HTMLElement ? n.teleportTo : "body"), { placement: E, middlewareData: V, styles: w, cleanup: I } = ye(
1811
+ r,
1812
+ u,
1070
1813
  {
1071
1814
  enabled: e,
1072
- placement: r(() => t.placement),
1073
- middleware: r(
1074
- () => [oe(10), ne({ placements: ["top", "bottom"] }), ae(), f.value ? se(f.value) : void 0].filter(
1815
+ placement: s(() => n.placement),
1816
+ middleware: s(
1817
+ () => [ve(10), pe({ placements: ["top", "bottom"] }), me(), p.value ? he(p.value) : void 0].filter(
1075
1818
  (a) => a !== void 0
1076
1819
  )
1077
1820
  ),
1078
1821
  strategy: "fixed"
1079
1822
  }
1080
- ), k = r(
1823
+ ), S = s(
1081
1824
  () => [
1082
1825
  "vf-tooltip__content",
1083
- _.value.startsWith("bottom") && "vf-tooltip__content--bottom",
1084
- _.value.startsWith("top") && "vf-tooltip__content--top"
1826
+ E.value.startsWith("bottom") && "vf-tooltip__content--bottom",
1827
+ E.value.startsWith("top") && "vf-tooltip__content--top"
1085
1828
  ]
1086
- ), O = r(() => {
1087
- const a = b.value.arrow;
1829
+ ), z = s(() => {
1830
+ const a = V.value.arrow;
1088
1831
  return {
1089
1832
  x: (a == null ? void 0 : a.x) !== void 0 && (a == null ? void 0 : a.baseX) !== void 0 ? a.x - a.baseX : 0,
1090
1833
  y: (a == null ? void 0 : a.y) !== void 0 && (a == null ? void 0 : a.baseY) !== void 0 ? a.y - a.baseY : 0
1091
1834
  };
1092
- }), y = r(() => ["vf-tooltip__arrow"]), B = r(() => ({
1093
- left: `${O.value.x}px`,
1094
- top: `${O.value.y}px`
1835
+ }), d = s(() => ["vf-tooltip__arrow"]), _ = s(() => ({
1836
+ left: `${z.value.x}px`,
1837
+ top: `${z.value.y}px`
1095
1838
  }));
1096
- function x() {
1097
- n.value !== null && (window.clearTimeout(n.value), n.value = null);
1839
+ function o() {
1840
+ l.value !== null && (window.clearTimeout(l.value), l.value = null);
1098
1841
  }
1099
- function p() {
1100
- x(), n.value = window.setTimeout(() => {
1842
+ function y() {
1843
+ o(), l.value = window.setTimeout(() => {
1101
1844
  e.value = !0;
1102
- }, t.openDelay);
1845
+ }, n.openDelay);
1103
1846
  }
1104
- function E() {
1105
- x(), e.value = !1;
1847
+ function f() {
1848
+ o(), e.value = !1;
1106
1849
  }
1107
- return N(() => {
1108
- x(), V();
1109
- }), (a, T) => (m(), h("span", {
1850
+ return ee(() => {
1851
+ o(), I();
1852
+ }), (a, C) => (c(), m("span", {
1110
1853
  class: "vf-tooltip",
1111
- onMouseenter: p,
1112
- onMouseleave: E,
1113
- onFocusin: p,
1114
- onFocusout: E
1854
+ onMouseenter: y,
1855
+ onMouseleave: f,
1856
+ onFocusin: y,
1857
+ onFocusout: f
1115
1858
  }, [
1116
- C("span", {
1859
+ T("span", {
1117
1860
  ref_key: "triggerRef",
1118
- ref: l,
1861
+ ref: r,
1119
1862
  class: "vf-tooltip__trigger",
1120
- "aria-describedby": e.value ? c(s) : void 0
1863
+ "aria-describedby": e.value ? h(i) : void 0
1121
1864
  }, [
1122
- $(a.$slots, "default")
1123
- ], 8, kt),
1124
- (m(), X(J, { to: "body" }, [
1125
- e.value && (o.text || a.$slots.content) ? (m(), h("span", {
1126
- key: 0,
1127
- id: c(s),
1128
- ref_key: "contentRef",
1129
- ref: d,
1130
- class: M(k.value),
1131
- style: U(c(u)),
1132
- role: "tooltip"
1133
- }, [
1134
- $(a.$slots, "content", {}, () => [
1135
- ve(R(o.text), 1)
1865
+ B(a.$slots, "default")
1866
+ ], 8, un),
1867
+ (c(), q(le, {
1868
+ to: v.value,
1869
+ disabled: b.value
1870
+ }, [
1871
+ j(ne, {
1872
+ name: "vf-floating-transition",
1873
+ appear: "",
1874
+ duration: g
1875
+ }, {
1876
+ default: Q(() => [
1877
+ e.value && (t.text || a.$slots.content) ? (c(), m("span", {
1878
+ key: 0,
1879
+ id: h(i),
1880
+ ref_key: "contentRef",
1881
+ ref: u,
1882
+ class: P(S.value),
1883
+ style: W(h(w)),
1884
+ role: "tooltip"
1885
+ }, [
1886
+ B(a.$slots, "content", {}, () => [
1887
+ oe(F(t.text), 1)
1888
+ ]),
1889
+ T("span", {
1890
+ ref_key: "arrowRef",
1891
+ ref: p,
1892
+ class: P(d.value),
1893
+ style: W(_.value),
1894
+ "aria-hidden": "true"
1895
+ }, null, 6)
1896
+ ], 14, cn)) : O("", !0)
1136
1897
  ]),
1137
- C("span", {
1138
- ref_key: "arrowRef",
1139
- ref: f,
1140
- class: M(y.value),
1141
- style: U(B.value),
1142
- "aria-hidden": "true"
1143
- }, null, 6)
1144
- ], 14, Vt)) : I("", !0)
1145
- ]))
1898
+ _: 3
1899
+ })
1900
+ ], 8, ["to", "disabled"]))
1146
1901
  ], 32));
1147
1902
  }
1148
1903
  });
1149
1904
  export {
1150
- At as VfAccordion,
1151
- St as VfAlert,
1152
- zt as VfBadge,
1153
- Pt as VfButton,
1154
- Ft as VfCard,
1155
- Kt as VfDialog,
1156
- Lt as VfDivider,
1157
- Rt as VfDropdown,
1158
- Je as VfIconButton,
1159
- Mt as VfInput,
1160
- Nt as VfLink,
1161
- Wt as VfPanel,
1162
- Ut as VfPopover,
1163
- Ht as VfTabs,
1164
- Yt as VfTag,
1165
- Xt as VfTextarea,
1166
- Et as VfThemeProvider,
1167
- qt as VfTooltip,
1168
- It as VueForge,
1169
- Gt as createThemePreset,
1170
- Se as createVueForge,
1171
- It as default,
1172
- Jt as defaultThemePreset,
1173
- eo as toMaxWidthQuery,
1174
- to as toMinWidthQuery,
1175
- oo as useBreakpoint,
1176
- no as useBreakpointValue,
1177
- ao as useBreakpoints,
1178
- he as useClickOutside,
1179
- Z as useDisclosure,
1180
- le as useEscapeKey,
1181
- re as useFloating,
1182
- Fe as useFocusTrap,
1183
- K as useId,
1184
- Ee as useScrollLock,
1185
- Bt as useTheme,
1186
- so as vfBreakpoints
1905
+ gn as VfAccordion,
1906
+ bn as VfAlert,
1907
+ kn as VfBadge,
1908
+ $n as VfButton,
1909
+ wn as VfCard,
1910
+ Tn as VfCheckbox,
1911
+ xn as VfDialog,
1912
+ Cn as VfDivider,
1913
+ Vn as VfDrawer,
1914
+ Bn as VfDropdown,
1915
+ Ae as VfIconButton,
1916
+ En as VfInput,
1917
+ On as VfLink,
1918
+ Dn as VfNavMenu,
1919
+ An as VfPanel,
1920
+ In as VfPopover,
1921
+ Ln as VfRadio,
1922
+ Sn as VfSwitch,
1923
+ Mn as VfTabs,
1924
+ zn as VfTag,
1925
+ Pn as VfTextarea,
1926
+ yn as VfThemeProvider,
1927
+ Nn as VfTooltip,
1928
+ hn as VueForge,
1929
+ Hn as createThemePreset,
1930
+ je as createVueForge,
1931
+ hn as default,
1932
+ Kn as defaultThemePreset,
1933
+ qn as toMaxWidthQuery,
1934
+ Wn as toMinWidthQuery,
1935
+ Un as useBreakpoint,
1936
+ Yn as useBreakpointValue,
1937
+ Xn as useBreakpoints,
1938
+ Oe as useClickOutside,
1939
+ se as useDisclosure,
1940
+ fe as useEscapeKey,
1941
+ ye as useFloating,
1942
+ De as useFocusTrap,
1943
+ G as useId,
1944
+ Ce as useScrollLock,
1945
+ _n as useTheme,
1946
+ Gn as vfBreakpoints
1187
1947
  };