@fiscozen/composables 0.1.38 → 0.1.39-next.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.
@@ -0,0 +1,1451 @@
1
+ import { ref as g, reactive as se, onUnmounted as ue, nextTick as U, onMounted as W, computed as R, watch as z, onBeforeUnmount as P, getCurrentInstance as pe, defineComponent as ve, useSlots as ce, toRef as V, toRefs as fe, createElementBlock as ee, openBlock as A, renderSlot as $, createElementVNode as te, withDirectives as oe, createCommentVNode as ae, createBlock as de, unref as D, normalizeClass as le, vShow as ie, Teleport as ye } from "vue";
2
+ const re = (e) => (t) => {
3
+ if (t === null)
4
+ return "";
5
+ const o = {
6
+ maximumFractionDigits: e.maximumFractionDigits || 2,
7
+ minimumFractionDigits: e.minimumFractionDigits,
8
+ useGrouping: e.useGrouping || !1
9
+ };
10
+ return t.toLocaleString("it-IT", o);
11
+ }, B = (e) => {
12
+ if (!e || typeof e != "string")
13
+ return NaN;
14
+ let t = e.trim();
15
+ return t.includes(",") && (t = t.replace(/\./g, ""), t = t.replace(",", ".")), parseFloat(t);
16
+ }, me = (e, t) => {
17
+ let o = t;
18
+ const a = t % e, n = t >= 0 ? e : -e;
19
+ return a !== 0 && (o = Math.abs(a) >= e / 2 ? t + n - a : t - a), o;
20
+ }, M = new DOMRect(0, 0, window.innerWidth, window.innerHeight), C = (e, t, o, a, n) => {
21
+ let i = n ? "bottom" : "right", x = n ? "bottom-start" : "right-start";
22
+ M.width = window.innerWidth, M.height = window.innerHeight, M.x = 0, M.y = 0;
23
+ const s = e ? e.getBoundingClientRect() : M, l = t.getBoundingClientRect(), d = o.getBoundingClientRect(), p = (d.left - s.left - l.width) / s.width, v = (s.right - d.right - l.width) / s.width, u = (d.top - s.top - l.height) / s.height, m = (s.bottom - d.bottom - l.height) / s.height;
24
+ let h = [
25
+ {
26
+ key: "right",
27
+ space: v
28
+ },
29
+ {
30
+ key: "top",
31
+ space: u
32
+ },
33
+ {
34
+ key: "bottom",
35
+ space: m
36
+ },
37
+ {
38
+ key: "left",
39
+ space: p
40
+ }
41
+ ].sort((r, c) => c.space - r.space);
42
+ if (n && (h = h.filter((r) => r.key === "top" || r.key === "bottom")), i = h[0].key, !a) {
43
+ const r = (l.height - d.height) / 2;
44
+ switch (i) {
45
+ case "right":
46
+ case "left":
47
+ s.top > d.top - r && (a = "end"), s.bottom < d.top - r && (a = "start");
48
+ break;
49
+ }
50
+ }
51
+ return x = a ? `${i}-${a}` : i, x;
52
+ }, he = (e, t, o, a) => ({
53
+ x: t.x + e.width * o / 100,
54
+ y: t.y + e.height * a / 100
55
+ }), ge = (e) => {
56
+ const t = g(null), o = g(null), a = g(null), n = g(), i = g(), x = g("auto"), s = g(), l = se({
57
+ position: { x: 0, y: 0 }
58
+ }), d = {
59
+ root: null,
60
+ rootMargin: "0px",
61
+ threshold: 1,
62
+ ...e.element.value.intersectionOptions
63
+ }, p = (h, r) => {
64
+ }, v = g(new IntersectionObserver(p, d)), u = g(), m = (h = !1) => U(() => {
65
+ var I, f, b, w, O, S, F, q, G, _, j, K, Q, X, Y;
66
+ if (u.value = e.position ? e.position.value : "auto", t.value = typeof e.element.value.domRef.value == "string" ? document.querySelector(e.element.value.domRef.value) : e.element.value.domRef.value, (I = e.container) != null && I.value ? (o.value = typeof ((f = e.container.value) == null ? void 0 : f.domRef.value) == "string" ? document.querySelector(e.container.value.domRef.value) : (b = e.container.value) == null ? void 0 : b.domRef.value, o.value ?? (o.value = document.body)) : o.value = document.body, !t.value)
67
+ throw new Error("missing reference element for floating behavior");
68
+ (w = e.opener) != null && w.value && (a.value = typeof ((O = e.opener.value) == null ? void 0 : O.domRef.value) == "string" ? document.querySelector(e.opener.value.domRef.value) : (S = e.opener.value) == null ? void 0 : S.domRef.value), s.value = t.value.getBoundingClientRect(), n.value = (F = a.value) == null ? void 0 : F.getBoundingClientRect(), i.value = o.value.getBoundingClientRect();
69
+ const r = window.getComputedStyle(t.value);
70
+ v.value.observe(t.value), v.value.observe(o.value);
71
+ let c = 0, y = 0;
72
+ if ((q = e.opener) != null && q.value && a.value && (n != null && n.value)) {
73
+ const k = n.value.left - parseFloat(r.marginLeft) - parseFloat(r.marginRight), J = n.value.left - parseFloat(r.marginLeft), L = n.value.top - parseFloat(r.marginTop) - parseFloat(r.marginBottom), Z = n.value.top - parseFloat(r.marginTop);
74
+ switch (u.value) {
75
+ case "auto":
76
+ u.value = C(
77
+ (G = e.useViewport) != null && G.value ? null : o.value,
78
+ t.value,
79
+ a.value
80
+ );
81
+ break;
82
+ case "auto-vertical":
83
+ u.value = C(
84
+ (_ = e.useViewport) != null && _.value ? null : o.value,
85
+ t.value,
86
+ a.value,
87
+ void 0,
88
+ !0
89
+ );
90
+ break;
91
+ case "auto-start":
92
+ u.value = C(
93
+ (j = e.useViewport) != null && j.value ? null : o.value,
94
+ t.value,
95
+ a.value,
96
+ "start"
97
+ );
98
+ break;
99
+ case "auto-vertical-start":
100
+ u.value = C(
101
+ (K = e.useViewport) != null && K.value ? null : o.value,
102
+ t.value,
103
+ a.value,
104
+ "start",
105
+ !0
106
+ );
107
+ break;
108
+ case "auto-end":
109
+ u.value = C(
110
+ (Q = e.useViewport) != null && Q.value ? null : o.value,
111
+ t.value,
112
+ a.value,
113
+ "end"
114
+ );
115
+ break;
116
+ case "auto-vertical-end":
117
+ u.value = C(
118
+ (X = e.useViewport) != null && X.value ? null : o.value,
119
+ t.value,
120
+ a.value,
121
+ "end",
122
+ !0
123
+ );
124
+ break;
125
+ }
126
+ switch (u.value) {
127
+ case "bottom":
128
+ l.position.y = n.value.bottom, l.position.x = J + n.value.width / 2, y = -50, c = 0;
129
+ break;
130
+ case "bottom-start":
131
+ l.position.y = n.value.bottom, l.position.x = k, y = 0, c = 0;
132
+ break;
133
+ case "bottom-end":
134
+ l.position.y = n.value.bottom, l.position.x = n.value.right, y = -100, c = 0;
135
+ break;
136
+ case "left-start":
137
+ l.position.y = L, l.position.x = k, y = -100, c = 0;
138
+ break;
139
+ case "left":
140
+ l.position.y = Z + n.value.height / 2, l.position.x = k, c = -50, y = -100;
141
+ break;
142
+ case "left-end":
143
+ l.position.y = n.value.bottom, l.position.x = k, c = -100, y = -100;
144
+ break;
145
+ case "top-start":
146
+ l.position.y = L, l.position.x = k, c = -100, y = 0;
147
+ break;
148
+ case "top":
149
+ l.position.y = L, l.position.x = J + n.value.width / 2, y = -50, c = -100;
150
+ break;
151
+ case "top-end":
152
+ l.position.y = L, l.position.x = n.value.right, y = -100, c = -100;
153
+ break;
154
+ case "right-start":
155
+ l.position.y = L, l.position.x = n.value.right, y = 0, c = 0;
156
+ break;
157
+ case "right":
158
+ l.position.y = Z + n.value.height / 2, l.position.x = n.value.right, c = -50, y = 0;
159
+ break;
160
+ case "right-end":
161
+ l.position.y = n.value.bottom, l.position.x = n.value.right, c = -100, y = 0;
162
+ break;
163
+ }
164
+ } else
165
+ switch (u.value) {
166
+ case "bottom":
167
+ l.position.y = i.value.bottom - s.value.height, l.position.x = i.value.left + i.value.width / 2, y = -50;
168
+ break;
169
+ case "left-end":
170
+ case "bottom-start":
171
+ l.position.y = i.value.bottom - s.value.height, l.position.x = i.value.left;
172
+ break;
173
+ case "right-end":
174
+ case "bottom-end":
175
+ l.position.y = i.value.bottom - s.value.height, l.position.x = i.value.right - s.value.width;
176
+ break;
177
+ case "left":
178
+ l.position.y = i.value.top + (i.value.height - s.value.height) / 2, l.position.x = i.value.left;
179
+ break;
180
+ case "top-start":
181
+ case "left-start":
182
+ l.position.y = i.value.top, l.position.x = i.value.left;
183
+ break;
184
+ case "top":
185
+ l.position.y = i.value.top, l.position.x = i.value.left + (i.value.width - s.value.width) / 2;
186
+ break;
187
+ case "top-end":
188
+ case "right-start":
189
+ l.position.y = i.value.top, l.position.x = i.value.right - s.value.width;
190
+ case "right":
191
+ l.position.y = i.value.top + (i.value.height - s.value.height) / 2, l.position.x = i.value.right - s.value.width;
192
+ break;
193
+ }
194
+ const E = he(s.value, l.position, y, c);
195
+ if (l.position.x = E.x, l.position.y = E.y, E.x < i.value.left && (l.position.x = i.value.left, y = 0), E.x + s.value.width > i.value.right) {
196
+ const k = i.value.right - s.value.width;
197
+ k > 0 && (l.position.x = k), y = 0;
198
+ }
199
+ if (E.y < i.value.top && (l.position.y = i.value.top, c = 0), E.y + s.value.height > i.value.bottom) {
200
+ const k = i.value.bottom - s.value.height;
201
+ k > 0 && (l.position.y = k), c = 0;
202
+ }
203
+ t.value.style.top = `${l.position.y}px`, t.value.style.left = `${l.position.x}px`, t.value.style.position = "fixed", t.value.style.display = "flex", s.value = t.value.getBoundingClientRect(), (Y = e.callback) != null && Y.value && !h && e.callback.value(s, n, i, x, u);
204
+ });
205
+ return ue(() => {
206
+ v.value.disconnect();
207
+ }), {
208
+ float: l,
209
+ rect: s,
210
+ setPosition: m,
211
+ position: x,
212
+ actualPosition: u,
213
+ openerRect: n,
214
+ containerRect: i
215
+ };
216
+ };
217
+ function H(e) {
218
+ const t = window.matchMedia(e), o = g(t.matches);
219
+ function a(n) {
220
+ o.value = n.matches;
221
+ }
222
+ return W(() => {
223
+ t.addEventListener("change", a);
224
+ }), ue(() => {
225
+ t.removeEventListener("change", a);
226
+ }), R(() => o.value);
227
+ }
228
+ function Oe(e) {
229
+ return {
230
+ isGreater(t) {
231
+ return H(`(min-width: ${e[t]})`);
232
+ },
233
+ isSmaller(t) {
234
+ return H(`(max-width: ${e[t]})`);
235
+ },
236
+ isInBetween(t, o) {
237
+ return H(`(min-width: ${e[t]}) and (max-width: ${e[o]})`);
238
+ }
239
+ };
240
+ }
241
+ function Fe(e, t, o) {
242
+ if (!e)
243
+ throw new Error("A target component has to be provided.");
244
+ if (!t)
245
+ throw new Error("A callback has to be provided.");
246
+ const a = (n) => {
247
+ !e.value || n.target === e.value || n.composedPath().includes(e.value) || typeof t == "function" && t();
248
+ };
249
+ o && z(o, (n, i) => {
250
+ i && i.removeEventListener("click", a), n == null || n.addEventListener("click", a);
251
+ }), W(() => {
252
+ o || document.addEventListener("click", a);
253
+ }), P(() => {
254
+ var n;
255
+ if (o) {
256
+ (n = o.value) == null || n.removeEventListener("click", a);
257
+ return;
258
+ }
259
+ document.removeEventListener("click", a);
260
+ });
261
+ }
262
+ function Le(e, t) {
263
+ if (!e)
264
+ throw new Error("A target component has to be provided.");
265
+ if (!t || typeof t != "function")
266
+ throw new Error("A callback has to be provided.");
267
+ const o = (a) => {
268
+ t(a);
269
+ };
270
+ W(() => {
271
+ e.value.addEventListener("keydown", o);
272
+ }), P(() => {
273
+ e.value.removeEventListener("keydown", o);
274
+ });
275
+ }
276
+ function $e(e, t) {
277
+ if (!e || typeof e != "function")
278
+ throw new Error("A callback has to be provided.");
279
+ const o = (a) => {
280
+ e(a);
281
+ };
282
+ W(() => {
283
+ if (!t) {
284
+ document.addEventListener("keyup", o);
285
+ return;
286
+ }
287
+ t.value.addEventListener("keyup", o);
288
+ }), P(() => {
289
+ if (!t) {
290
+ document.removeEventListener("keyup", o);
291
+ return;
292
+ }
293
+ t.value.removeEventListener("keyup", o);
294
+ });
295
+ }
296
+ const Me = (e) => {
297
+ const t = g(null), o = pe(), a = R(() => o == null ? void 0 : o.props.amount), n = g(), i = re(e), x = (p) => {
298
+ if (!Number.isNaN(p) && o) {
299
+ if (n.value = p, o.props.nullOnEmpty && !p) {
300
+ o.emit("update:amount", null);
301
+ return;
302
+ }
303
+ o.emit("update:amount", p);
304
+ }
305
+ }, s = (p) => {
306
+ setTimeout(() => {
307
+ t.value && (t.value.value = p);
308
+ }, 0);
309
+ }, l = (p) => (v) => {
310
+ if (!t.value || !v.target)
311
+ return;
312
+ let { value: u } = p;
313
+ u = u.replace(/[^0-9,.-]/g, "");
314
+ const m = B(u);
315
+ s(u);
316
+ const h = o != null && o.props.nullOnEmpty && u === "" ? null : m;
317
+ x(Number.isNaN(h) ? 0 : h);
318
+ }, d = (p) => {
319
+ if (!t.value || !p.target)
320
+ return;
321
+ const v = p.target.value.replace(/,/g, ".");
322
+ let u;
323
+ v === "" && (o != null && o.props.nullOnEmpty) ? u = null : (u = B(v), Number.isNaN(u) && (u = 0), e.step && (o != null && o.props.forceStep) && (u = me(e.step, u)), e.min && e.min > u && (u = e.min), e.max && e.max < u && (u = e.max));
324
+ const m = i(u);
325
+ s(m), x(B(m));
326
+ };
327
+ return z(t, (p, v) => {
328
+ p && (v && (v == null || v.removeEventListener("input", l(p)), v == null || v.removeEventListener("blur", d)), p.addEventListener("input", l(p)), p.addEventListener("blur", d), o != null && o.props.amount && (p.value = i(a.value)));
329
+ }), z(a, (p) => {
330
+ U(() => {
331
+ if (!(!t.value || p === null || p === void 0) && n.value !== p) {
332
+ const v = i(p);
333
+ t.value.value = v, n.value = p;
334
+ }
335
+ });
336
+ }), {
337
+ inputRef: t,
338
+ parse: B,
339
+ format: i,
340
+ emitAmount: x,
341
+ setValue: s
342
+ };
343
+ };
344
+ function xe(e, t) {
345
+ if (!(e == null || e === "")) {
346
+ if (typeof e == "number")
347
+ return e;
348
+ if (typeof e == "string") {
349
+ console.warn(
350
+ `[useCurrencyModel] String values in v-model are deprecated and will be removed in a future version. Please use number | undefined instead. Received: "${e}". The string format is deprecated and will be replaced by "number | undefined". Parsing as number for retrocompatibility.`
351
+ );
352
+ const o = t(e);
353
+ return isNaN(o) || !isFinite(o) ? void 0 : o;
354
+ }
355
+ }
356
+ }
357
+ function Be(e) {
358
+ const {
359
+ model: t,
360
+ displayModel: o,
361
+ inputRef: a,
362
+ nullOnEmpty: n = !1,
363
+ onModelUpdate: i,
364
+ ...x
365
+ } = e, s = re(x), l = B, d = g(!1), p = g(!1), v = g(!1);
366
+ let u = !1;
367
+ const m = () => {
368
+ u || (u = !0, U(() => {
369
+ v.value = !1, u = !1;
370
+ }));
371
+ }, h = (f) => xe(f, l), r = (f) => {
372
+ const b = !f || f.trim() === "";
373
+ if (d.value && !p.value && t.value === void 0 && !b)
374
+ return s(0);
375
+ }, c = (f, b) => {
376
+ if (f === void 0) {
377
+ if (p.value) {
378
+ o.value = void 0, a != null && a.value && (a.value.value = "");
379
+ return;
380
+ }
381
+ const w = r(b);
382
+ o.value = w, a != null && a.value && (a.value.value = w || "");
383
+ } else {
384
+ const w = s(f);
385
+ o.value = w, a != null && a.value && (a.value.value = w);
386
+ }
387
+ }, y = (f) => {
388
+ if (p.value = !0, !(f != null && f.trim())) {
389
+ o.value = void 0, a != null && a.value && (a.value.value = "");
390
+ const S = n ? void 0 : 0;
391
+ v.value = !0, i ? i(S) : t.value = S, m();
392
+ return;
393
+ }
394
+ o.value = f;
395
+ const b = l(f), w = isNaN(b) || !isFinite(b) ? void 0 : b;
396
+ if (h(t.value) !== w) {
397
+ v.value = !0;
398
+ const S = w !== void 0 ? w : 0;
399
+ i ? i(S) : t.value = S, m();
400
+ }
401
+ }, E = () => {
402
+ p.value = !0;
403
+ };
404
+ return z(
405
+ () => t.value,
406
+ (f, b) => {
407
+ var F;
408
+ if (v.value) {
409
+ m();
410
+ return;
411
+ }
412
+ const w = h(f), O = h(b);
413
+ if (w === O)
414
+ return;
415
+ f === void 0 && (d.value = !0);
416
+ const S = ((F = a == null ? void 0 : a.value) == null ? void 0 : F.value) || o.value || "";
417
+ c(w, S), f !== void 0 && typeof f == "number" && (p.value = !0);
418
+ }
419
+ ), {
420
+ format: s,
421
+ parse: l,
422
+ normalize: h,
423
+ handleInputUpdate: y,
424
+ markUserModified: E,
425
+ initialize: () => {
426
+ var f;
427
+ if (d.value = t.value === void 0, (f = a == null ? void 0 : a.value) != null && f.value)
428
+ o.value = a.value.value, p.value = !0;
429
+ else if (t.value !== void 0 && t.value !== null && t.value !== "") {
430
+ const b = h(t.value);
431
+ b === void 0 ? o.value = void 0 : (o.value = s(b), p.value = !0);
432
+ } else
433
+ t.value === void 0 ? o.value = s(0) : o.value = void 0;
434
+ },
435
+ resetInternalUpdateFlag: m,
436
+ isInternalUpdate: R(() => v.value),
437
+ userHasModified: R(() => p.value),
438
+ initialValueWasUndefined: R(() => d.value)
439
+ };
440
+ }
441
+ const be = {
442
+ blue: {
443
+ 50: {
444
+ value: "#eff1ff",
445
+ type: "color"
446
+ },
447
+ 100: {
448
+ value: "#dee2ff",
449
+ type: "color"
450
+ },
451
+ 200: {
452
+ value: "#bdc5ff",
453
+ type: "color"
454
+ },
455
+ 300: {
456
+ value: "#9ca8ff",
457
+ type: "color"
458
+ },
459
+ 400: {
460
+ value: "#7b8bff",
461
+ type: "color"
462
+ },
463
+ 500: {
464
+ value: "#5a6eff",
465
+ type: "color"
466
+ },
467
+ 600: {
468
+ value: "#4858cc",
469
+ type: "color"
470
+ },
471
+ 700: {
472
+ value: "#364299",
473
+ type: "color"
474
+ },
475
+ 800: {
476
+ value: "#242c66",
477
+ type: "color"
478
+ },
479
+ 900: {
480
+ value: "#1b214c",
481
+ type: "color"
482
+ }
483
+ },
484
+ purple: {
485
+ 50: {
486
+ value: "#f8f4ff",
487
+ type: "color"
488
+ },
489
+ 100: {
490
+ value: "#f0e9ff",
491
+ type: "color"
492
+ },
493
+ 200: {
494
+ value: "#e1d3ff",
495
+ type: "color"
496
+ },
497
+ 300: {
498
+ value: "#d2bdff",
499
+ type: "color"
500
+ },
501
+ 400: {
502
+ value: "#c3a7ff",
503
+ type: "color"
504
+ },
505
+ 500: {
506
+ value: "#b491ff",
507
+ type: "color"
508
+ },
509
+ 600: {
510
+ value: "#9074cc",
511
+ type: "color"
512
+ },
513
+ 700: {
514
+ value: "#6c5799",
515
+ type: "color"
516
+ },
517
+ 800: {
518
+ value: "#483a66",
519
+ type: "color"
520
+ },
521
+ 900: {
522
+ value: "#241d33",
523
+ type: "color"
524
+ }
525
+ },
526
+ orange: {
527
+ 50: {
528
+ value: "#fff2ef",
529
+ type: "color"
530
+ },
531
+ 100: {
532
+ value: "#ffe4de",
533
+ type: "color"
534
+ },
535
+ 200: {
536
+ value: "#ffc9bd",
537
+ type: "color"
538
+ },
539
+ 300: {
540
+ value: "#ffae9c",
541
+ type: "color"
542
+ },
543
+ 400: {
544
+ value: "#ff937b",
545
+ type: "color"
546
+ },
547
+ 500: {
548
+ value: "#ff785a",
549
+ type: "color"
550
+ },
551
+ 600: {
552
+ value: "#cc6048",
553
+ type: "color"
554
+ },
555
+ 700: {
556
+ value: "#994836",
557
+ type: "color"
558
+ },
559
+ 800: {
560
+ value: "#663024",
561
+ type: "color"
562
+ },
563
+ 900: {
564
+ value: "#331812",
565
+ type: "color"
566
+ }
567
+ },
568
+ pink: {
569
+ 50: {
570
+ value: "#fff5f5",
571
+ type: "color"
572
+ },
573
+ 100: {
574
+ value: "#ffe0e0",
575
+ type: "color"
576
+ },
577
+ 200: {
578
+ value: "#ffcbcb",
579
+ type: "color"
580
+ },
581
+ 300: {
582
+ value: "#ffc0c0",
583
+ type: "color"
584
+ },
585
+ 400: {
586
+ value: "#ffabab",
587
+ type: "color"
588
+ },
589
+ 500: {
590
+ value: "#ff9696",
591
+ type: "color"
592
+ },
593
+ 600: {
594
+ value: "#cc7878",
595
+ type: "color"
596
+ },
597
+ 700: {
598
+ value: "#995a5a",
599
+ type: "color"
600
+ },
601
+ 800: {
602
+ value: "#663c3c",
603
+ type: "color"
604
+ },
605
+ 900: {
606
+ value: "#331e1e",
607
+ type: "color"
608
+ }
609
+ },
610
+ yellow: {
611
+ 50: {
612
+ value: "#fffbf4",
613
+ type: "color"
614
+ },
615
+ 100: {
616
+ value: "#fff3de",
617
+ type: "color"
618
+ },
619
+ 200: {
620
+ value: "#ffebc8",
621
+ type: "color"
622
+ },
623
+ 300: {
624
+ value: "#ffe7bd",
625
+ type: "color"
626
+ },
627
+ 400: {
628
+ value: "#ffdfa7",
629
+ type: "color"
630
+ },
631
+ 500: {
632
+ value: "#ffd791",
633
+ type: "color"
634
+ },
635
+ 600: {
636
+ value: "#ccac74",
637
+ type: "color"
638
+ },
639
+ 700: {
640
+ value: "#998157",
641
+ type: "color"
642
+ },
643
+ 800: {
644
+ value: "#806c49",
645
+ type: "color"
646
+ },
647
+ 900: {
648
+ value: "#4c402b",
649
+ type: "color"
650
+ }
651
+ },
652
+ semantic: {
653
+ error: {
654
+ 50: {
655
+ value: "#fef3f3",
656
+ type: "color"
657
+ },
658
+ 100: {
659
+ value: "#f8baba",
660
+ type: "color"
661
+ },
662
+ 200: {
663
+ value: "#f04242",
664
+ type: "color"
665
+ },
666
+ 300: {
667
+ value: "#aa2f2f",
668
+ type: "color"
669
+ }
670
+ },
671
+ warning: {
672
+ 50: {
673
+ value: "#fff8f3",
674
+ type: "color"
675
+ },
676
+ 100: {
677
+ value: "#ffdabd",
678
+ type: "color"
679
+ },
680
+ 200: {
681
+ value: "#ffae4f",
682
+ type: "color"
683
+ },
684
+ 300: {
685
+ value: "#b47b38",
686
+ type: "color"
687
+ }
688
+ },
689
+ success: {
690
+ 50: {
691
+ value: "#f2f8f6",
692
+ type: "color"
693
+ },
694
+ 100: {
695
+ value: "#b5d8ce",
696
+ type: "color"
697
+ },
698
+ 200: {
699
+ value: "#0fa88c",
700
+ type: "color"
701
+ },
702
+ 300: {
703
+ value: "#0b7763",
704
+ type: "color"
705
+ }
706
+ },
707
+ info: {
708
+ 50: {
709
+ value: "#f3f7ff",
710
+ type: "color"
711
+ },
712
+ 100: {
713
+ value: "#b4c8e1",
714
+ type: "color"
715
+ },
716
+ 200: {
717
+ value: "#4e9fff",
718
+ type: "color"
719
+ },
720
+ 300: {
721
+ value: "#3770b4",
722
+ type: "color"
723
+ }
724
+ }
725
+ },
726
+ background: {
727
+ "white-smoke": {
728
+ value: "#f7f6f3",
729
+ type: "color"
730
+ },
731
+ seashell: {
732
+ value: "#f8ece7",
733
+ type: "color"
734
+ },
735
+ "pale-purple": {
736
+ value: "#f2e6ff",
737
+ type: "color"
738
+ },
739
+ "alice-blue": {
740
+ value: "#ecf2fc",
741
+ type: "color"
742
+ }
743
+ },
744
+ grey: {
745
+ 100: {
746
+ value: "#e9edf0",
747
+ type: "color"
748
+ },
749
+ 200: {
750
+ value: "#d1dde6",
751
+ type: "color"
752
+ },
753
+ 300: {
754
+ value: "#9da9b2",
755
+ type: "color"
756
+ },
757
+ 400: {
758
+ value: "#6e777e",
759
+ type: "color"
760
+ },
761
+ 500: {
762
+ value: "#596167",
763
+ type: "color"
764
+ }
765
+ },
766
+ core: {
767
+ white: {
768
+ value: "#ffffff",
769
+ type: "color"
770
+ },
771
+ black: {
772
+ value: "#2c282f",
773
+ type: "color"
774
+ }
775
+ },
776
+ "font-sans": {
777
+ "sharp-grotesk": {
778
+ value: '"Sharp Grotesk", sans-serif',
779
+ type: "fontFamilies"
780
+ },
781
+ inter: {
782
+ value: '"Inter", sans-serif',
783
+ type: "fontFamilies"
784
+ }
785
+ },
786
+ font: {
787
+ light: {
788
+ value: "300",
789
+ type: "fontWeights"
790
+ },
791
+ normal: {
792
+ value: "400",
793
+ type: "fontWeights"
794
+ },
795
+ medium: {
796
+ value: "500",
797
+ type: "fontWeights"
798
+ }
799
+ },
800
+ spacing: {
801
+ 0: {
802
+ value: "0px",
803
+ type: "spacing"
804
+ },
805
+ 1: {
806
+ value: "1px",
807
+ type: "spacing"
808
+ },
809
+ 2: {
810
+ value: "2px",
811
+ type: "spacing"
812
+ },
813
+ 4: {
814
+ value: "4px",
815
+ type: "spacing"
816
+ },
817
+ 6: {
818
+ value: "6px",
819
+ type: "spacing"
820
+ },
821
+ 8: {
822
+ value: "8px",
823
+ type: "spacing"
824
+ },
825
+ 10: {
826
+ value: "10px",
827
+ type: "spacing"
828
+ },
829
+ 12: {
830
+ value: "12px",
831
+ type: "spacing"
832
+ },
833
+ 14: {
834
+ value: "14px",
835
+ type: "spacing"
836
+ },
837
+ 16: {
838
+ value: "16px",
839
+ type: "spacing"
840
+ },
841
+ 20: {
842
+ value: "20px",
843
+ type: "spacing"
844
+ },
845
+ 24: {
846
+ value: "24px",
847
+ type: "spacing"
848
+ },
849
+ 28: {
850
+ value: "28px",
851
+ type: "spacing"
852
+ },
853
+ 32: {
854
+ value: "32px",
855
+ type: "spacing"
856
+ },
857
+ 36: {
858
+ value: "36px",
859
+ type: "spacing"
860
+ },
861
+ 40: {
862
+ value: "40px",
863
+ type: "spacing"
864
+ },
865
+ 44: {
866
+ value: "44px",
867
+ type: "spacing"
868
+ },
869
+ 48: {
870
+ value: "48px",
871
+ type: "spacing"
872
+ },
873
+ 56: {
874
+ value: "56px",
875
+ type: "spacing"
876
+ },
877
+ 64: {
878
+ value: "64px",
879
+ type: "spacing"
880
+ },
881
+ 80: {
882
+ value: "80px",
883
+ type: "spacing"
884
+ },
885
+ 96: {
886
+ value: "96px",
887
+ type: "spacing"
888
+ },
889
+ 112: {
890
+ value: "112px",
891
+ type: "spacing"
892
+ },
893
+ 128: {
894
+ value: "128px",
895
+ type: "spacing"
896
+ },
897
+ 144: {
898
+ value: "144px",
899
+ type: "spacing"
900
+ },
901
+ 160: {
902
+ value: "160px",
903
+ type: "spacing"
904
+ },
905
+ 176: {
906
+ value: "176px",
907
+ type: "spacing"
908
+ },
909
+ 192: {
910
+ value: "192px",
911
+ type: "spacing"
912
+ },
913
+ 208: {
914
+ value: "208px",
915
+ type: "spacing"
916
+ },
917
+ 224: {
918
+ value: "224px",
919
+ type: "spacing"
920
+ },
921
+ 240: {
922
+ value: "240px",
923
+ type: "spacing"
924
+ },
925
+ 256: {
926
+ value: "256px",
927
+ type: "spacing"
928
+ },
929
+ 288: {
930
+ value: "288px",
931
+ type: "spacing"
932
+ },
933
+ 320: {
934
+ value: "320px",
935
+ type: "spacing"
936
+ },
937
+ 384: {
938
+ value: "384px",
939
+ type: "spacing"
940
+ }
941
+ },
942
+ border: {
943
+ 0: {
944
+ value: "0px",
945
+ type: "borderWidth"
946
+ },
947
+ 1: {
948
+ value: "1px",
949
+ type: "borderWidth"
950
+ },
951
+ 2: {
952
+ value: "2px",
953
+ type: "borderWidth"
954
+ },
955
+ 4: {
956
+ value: "4px",
957
+ type: "borderWidth"
958
+ },
959
+ 8: {
960
+ value: "8px",
961
+ type: "borderWidth"
962
+ }
963
+ },
964
+ rounded: {
965
+ none: {
966
+ value: "0px",
967
+ type: "borderRadius"
968
+ },
969
+ sm: {
970
+ value: "2px",
971
+ type: "borderRadius"
972
+ },
973
+ base: {
974
+ value: "4px",
975
+ type: "borderRadius"
976
+ },
977
+ md: {
978
+ value: "6px",
979
+ type: "borderRadius"
980
+ },
981
+ lg: {
982
+ value: "8px",
983
+ type: "borderRadius"
984
+ },
985
+ xl: {
986
+ value: "12px",
987
+ type: "borderRadius"
988
+ },
989
+ "2xl": {
990
+ value: "16px",
991
+ type: "borderRadius"
992
+ },
993
+ "3xl": {
994
+ value: "24px",
995
+ type: "borderRadius"
996
+ },
997
+ full: {
998
+ value: "9999px",
999
+ type: "borderRadius"
1000
+ }
1001
+ },
1002
+ breakpoint: {
1003
+ xs: {
1004
+ value: "376px",
1005
+ type: "sizing"
1006
+ },
1007
+ sm: {
1008
+ value: "640px",
1009
+ type: "sizing"
1010
+ },
1011
+ md: {
1012
+ value: "768px",
1013
+ type: "sizing"
1014
+ },
1015
+ lg: {
1016
+ value: "1024px",
1017
+ type: "sizing"
1018
+ },
1019
+ xl: {
1020
+ value: "1280px",
1021
+ type: "sizing"
1022
+ },
1023
+ "2xl": {
1024
+ value: "1440px",
1025
+ type: "sizing"
1026
+ },
1027
+ "3xl": {
1028
+ value: "1536px",
1029
+ type: "sizing"
1030
+ }
1031
+ },
1032
+ shadow: {
1033
+ none: {
1034
+ value: {
1035
+ color: "#000000",
1036
+ type: "dropShadow",
1037
+ x: "0",
1038
+ y: "0",
1039
+ blur: "0",
1040
+ spread: "0"
1041
+ },
1042
+ type: "boxShadow"
1043
+ },
1044
+ sm: {
1045
+ value: {
1046
+ color: "#0000000d",
1047
+ type: "dropShadow",
1048
+ x: "0",
1049
+ y: "1",
1050
+ blur: "2",
1051
+ spread: "0"
1052
+ },
1053
+ type: "boxShadow"
1054
+ },
1055
+ base: {
1056
+ value: [
1057
+ {
1058
+ color: "#0000000f",
1059
+ type: "dropShadow",
1060
+ x: "0",
1061
+ y: "1",
1062
+ blur: "2",
1063
+ spread: "0"
1064
+ },
1065
+ {
1066
+ color: "#0000001a",
1067
+ type: "dropShadow",
1068
+ x: "0",
1069
+ y: "1",
1070
+ blur: "3",
1071
+ spread: "0"
1072
+ }
1073
+ ],
1074
+ type: "boxShadow"
1075
+ },
1076
+ md: {
1077
+ value: [
1078
+ {
1079
+ color: "#0000000f",
1080
+ type: "dropShadow",
1081
+ x: "0",
1082
+ y: "2",
1083
+ blur: "4",
1084
+ spread: "-1"
1085
+ },
1086
+ {
1087
+ color: "#0000001a",
1088
+ type: "dropShadow",
1089
+ x: "0",
1090
+ y: "4",
1091
+ blur: "6",
1092
+ spread: "-1"
1093
+ }
1094
+ ],
1095
+ type: "boxShadow"
1096
+ },
1097
+ lg: {
1098
+ value: [
1099
+ {
1100
+ color: "#0000000d",
1101
+ type: "dropShadow",
1102
+ x: "0",
1103
+ y: "4",
1104
+ blur: "6",
1105
+ spread: "-2"
1106
+ },
1107
+ {
1108
+ color: "#0000001a",
1109
+ type: "dropShadow",
1110
+ x: "0",
1111
+ y: "10",
1112
+ blur: "15",
1113
+ spread: "-3"
1114
+ }
1115
+ ],
1116
+ type: "boxShadow"
1117
+ },
1118
+ xl: {
1119
+ value: [
1120
+ {
1121
+ color: "#0000000a",
1122
+ type: "dropShadow",
1123
+ x: "0",
1124
+ y: "10",
1125
+ blur: "10",
1126
+ spread: "-5"
1127
+ },
1128
+ {
1129
+ color: "#0000001a",
1130
+ type: "dropShadow",
1131
+ x: "0",
1132
+ y: "20",
1133
+ blur: "25",
1134
+ spread: "-5"
1135
+ }
1136
+ ],
1137
+ type: "boxShadow"
1138
+ },
1139
+ "2xl": {
1140
+ value: {
1141
+ color: "#00000040",
1142
+ type: "dropShadow",
1143
+ x: "0",
1144
+ y: "25",
1145
+ blur: "50",
1146
+ spread: "-12"
1147
+ },
1148
+ type: "boxShadow"
1149
+ },
1150
+ inner: {
1151
+ value: {
1152
+ color: "#0000000f",
1153
+ type: "innerShadow",
1154
+ x: "0",
1155
+ y: "2",
1156
+ blur: "4",
1157
+ spread: "0"
1158
+ },
1159
+ type: "boxShadow"
1160
+ }
1161
+ },
1162
+ underline: {
1163
+ value: "underline",
1164
+ type: "textDecoration"
1165
+ },
1166
+ text: {
1167
+ xs: {
1168
+ value: "12px",
1169
+ type: "fontSizes"
1170
+ },
1171
+ sm: {
1172
+ value: "14px",
1173
+ type: "fontSizes"
1174
+ },
1175
+ base: {
1176
+ value: "16px",
1177
+ type: "fontSizes"
1178
+ },
1179
+ lg: {
1180
+ value: "18px",
1181
+ type: "fontSizes"
1182
+ },
1183
+ xl: {
1184
+ value: "20px",
1185
+ type: "fontSizes"
1186
+ },
1187
+ "2xl": {
1188
+ value: "24px",
1189
+ type: "fontSizes"
1190
+ },
1191
+ "3xl": {
1192
+ value: "30px",
1193
+ type: "fontSizes"
1194
+ },
1195
+ "4xl": {
1196
+ value: "36px",
1197
+ type: "fontSizes"
1198
+ },
1199
+ "5xl": {
1200
+ value: "48px",
1201
+ type: "fontSizes"
1202
+ },
1203
+ "6xl": {
1204
+ value: "60px",
1205
+ type: "fontSizes"
1206
+ },
1207
+ "7xl": {
1208
+ value: "72px",
1209
+ type: "fontSizes"
1210
+ },
1211
+ "8xl": {
1212
+ value: "96px",
1213
+ type: "fontSizes"
1214
+ },
1215
+ "9xl": {
1216
+ value: "128px",
1217
+ type: "fontSizes"
1218
+ }
1219
+ },
1220
+ leading: {
1221
+ xs: {
1222
+ value: "16px",
1223
+ type: "lineHeights"
1224
+ },
1225
+ sm: {
1226
+ value: "18px",
1227
+ type: "lineHeights"
1228
+ },
1229
+ base: {
1230
+ value: "20px",
1231
+ type: "lineHeights"
1232
+ },
1233
+ lg: {
1234
+ value: "24px",
1235
+ type: "lineHeights"
1236
+ },
1237
+ xl: {
1238
+ value: "28px",
1239
+ type: "lineHeights"
1240
+ },
1241
+ "2xl": {
1242
+ value: "32px",
1243
+ type: "lineHeights"
1244
+ },
1245
+ "3xl": {
1246
+ value: "36px",
1247
+ type: "lineHeights"
1248
+ },
1249
+ "4xl": {
1250
+ value: "40px",
1251
+ type: "lineHeights"
1252
+ },
1253
+ "5xl": {
1254
+ value: "48px",
1255
+ type: "lineHeights"
1256
+ },
1257
+ "6xl": {
1258
+ value: "60px",
1259
+ type: "lineHeights"
1260
+ },
1261
+ "7xl": {
1262
+ value: "72px",
1263
+ type: "lineHeights"
1264
+ },
1265
+ "8xl": {
1266
+ value: "96px",
1267
+ type: "lineHeights"
1268
+ },
1269
+ "9xl": {
1270
+ value: "128px",
1271
+ type: "lineHeights"
1272
+ }
1273
+ }
1274
+ }, T = {
1275
+ global: be
1276
+ }, we = [
1277
+ "blue",
1278
+ "purple",
1279
+ "orange",
1280
+ "pink",
1281
+ "yellow",
1282
+ "grey",
1283
+ "core"
1284
+ ], ke = {
1285
+ safeColorNames: we
1286
+ }, Se = [
1287
+ "error",
1288
+ "warning",
1289
+ "success",
1290
+ "info"
1291
+ ], Ee = {
1292
+ semanticColorNames: Se
1293
+ }, ze = ke.safeColorNames, Ce = Ee.semanticColorNames, N = {};
1294
+ ze.forEach((e) => {
1295
+ const t = T.global[e];
1296
+ t && Object.keys(t).forEach((o) => {
1297
+ var n;
1298
+ const a = (n = t[o]) == null ? void 0 : n.value;
1299
+ a && (N[e] || (N[e] = {}), N[e][o] = a);
1300
+ });
1301
+ });
1302
+ const ne = T.global.semantic;
1303
+ ne && Ce.forEach((e) => {
1304
+ const t = ne[e];
1305
+ t && typeof t == "object" && Object.keys(t).forEach((o) => {
1306
+ var n;
1307
+ const a = (n = t[o]) == null ? void 0 : n.value;
1308
+ if (a) {
1309
+ const i = `semantic-${e}`;
1310
+ N[i] || (N[i] = {}), N[i][o] = a;
1311
+ }
1312
+ });
1313
+ });
1314
+ const Re = Object.entries(T.global.breakpoint).reduce(
1315
+ (e, [t, o]) => (e[t] = o.value, e),
1316
+ {}
1317
+ ), He = /* @__PURE__ */ ve({
1318
+ __name: "FzFloating",
1319
+ props: {
1320
+ isOpen: { type: Boolean, default: !1 },
1321
+ position: { default: "auto" },
1322
+ container: {},
1323
+ contentClass: {},
1324
+ openerClass: {},
1325
+ overrideContentClass: { type: Boolean },
1326
+ overrideOpener: {},
1327
+ teleport: { type: Boolean, default: !1 },
1328
+ useViewport: { type: Boolean }
1329
+ },
1330
+ emits: ["fzfloating:setPosition"],
1331
+ setup(e, { expose: t, emit: o }) {
1332
+ const a = e, n = o, i = g(null), x = g(null), s = ce(), l = H(`(max-width: ${Re.xs})`);
1333
+ let d = !1;
1334
+ const p = {
1335
+ position: a.position,
1336
+ element: {
1337
+ // @ts-ignore
1338
+ domRef: i
1339
+ },
1340
+ container: {
1341
+ // @ts-ignore
1342
+ domRef: V(a.container || document.body)
1343
+ },
1344
+ opener: {
1345
+ domRef: V(null)
1346
+ },
1347
+ useViewport: a.useViewport,
1348
+ callback(...r) {
1349
+ n("fzfloating:setPosition", ...r);
1350
+ }
1351
+ }, v = fe(p);
1352
+ s.opener && (p.opener = {
1353
+ // @ts-ignore
1354
+ domRef: x
1355
+ });
1356
+ const u = ge(v), m = () => {
1357
+ d || (d = !0, requestAnimationFrame(() => {
1358
+ a.isOpen && u.setPosition(), d = !1;
1359
+ }));
1360
+ };
1361
+ z(
1362
+ () => a.position,
1363
+ () => m()
1364
+ ), z(
1365
+ () => a.isOpen,
1366
+ (r) => {
1367
+ var y;
1368
+ if (!r || !i.value) {
1369
+ window.removeEventListener("scroll", m);
1370
+ return;
1371
+ }
1372
+ window.addEventListener("scroll", m);
1373
+ const c = (y = x.value) == null ? void 0 : y.getBoundingClientRect();
1374
+ i.value.style.top = "0px", i.value.style.left = "0px", i.value.style.transform = "none", i.value.style.width = l.value ? (c == null ? void 0 : c.width) + "px" : "auto", u.setPosition();
1375
+ }
1376
+ ), z(
1377
+ () => a.overrideOpener,
1378
+ (r) => {
1379
+ r && v.opener && v.opener.value && (v.opener.value = {
1380
+ domRef: r
1381
+ });
1382
+ }
1383
+ ), P(() => {
1384
+ window.removeEventListener("scroll", m);
1385
+ });
1386
+ const h = R(() => a.overrideContentClass ? a.contentClass : ["bg-core-white fixed p-4", a.contentClass]);
1387
+ return t({
1388
+ setPosition: u.setPosition
1389
+ }), (r, c) => (A(), ee("div", null, [
1390
+ $(r.$slots, "opener-start"),
1391
+ te("div", {
1392
+ ref_key: "opener",
1393
+ ref: x,
1394
+ class: "inline-flex w-full sm:w-auto"
1395
+ }, [
1396
+ $(r.$slots, "opener", {
1397
+ isOpen: r.isOpen,
1398
+ floating: D(u)
1399
+ })
1400
+ ], 512),
1401
+ $(r.$slots, "opener-end"),
1402
+ r.teleport ? ae("", !0) : oe((A(), ee("div", {
1403
+ key: 0,
1404
+ ref_key: "content",
1405
+ ref: i,
1406
+ class: le(["fz__floating__content w-full sm:w-auto", h.value])
1407
+ }, [
1408
+ $(r.$slots, "default", {
1409
+ isOpen: r.isOpen,
1410
+ floating: D(u)
1411
+ })
1412
+ ], 2)), [
1413
+ [ie, r.$slots.default && (!r.$slots.opener || r.$slots.opener && r.isOpen)]
1414
+ ]),
1415
+ r.teleport ? (A(), de(ye, {
1416
+ key: 1,
1417
+ to: "body"
1418
+ }, [
1419
+ oe(te("div", {
1420
+ ref_key: "content",
1421
+ ref: i,
1422
+ class: le(["fz__floating__content", h.value])
1423
+ }, [
1424
+ $(r.$slots, "default", {
1425
+ isOpen: r.isOpen,
1426
+ floating: D(u)
1427
+ })
1428
+ ], 2), [
1429
+ [ie, r.$slots.default && (!r.$slots.opener || r.$slots.opener && r.isOpen)]
1430
+ ])
1431
+ ])) : ae("", !0)
1432
+ ]));
1433
+ }
1434
+ });
1435
+ export {
1436
+ He as FzFloating,
1437
+ he as calcRealPos,
1438
+ re as format,
1439
+ C as getHighestAvailableSpacePos,
1440
+ xe as normalizeModelValue,
1441
+ B as parse,
1442
+ me as roundTo,
1443
+ Oe as useBreakpoints,
1444
+ Fe as useClickOutside,
1445
+ Me as useCurrency,
1446
+ Be as useCurrencyModel,
1447
+ ge as useFloating,
1448
+ Le as useKeyDown,
1449
+ $e as useKeyUp,
1450
+ H as useMediaQuery
1451
+ };