@gv-tech/ui-web 2.9.1 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.cjs.js +1 -0
- package/dist/accordion.d.ts +18 -0
- package/dist/accordion.es.js +259 -0
- package/dist/alert-dialog.cjs.js +7 -0
- package/dist/alert-dialog.d.ts +43 -0
- package/dist/alert-dialog.es.js +171 -0
- package/dist/alert.cjs.js +1 -0
- package/dist/alert.d.ts +18 -0
- package/dist/alert.es.js +32 -0
- package/dist/aspect-ratio.cjs.js +1 -0
- package/dist/aspect-ratio.d.ts +10 -0
- package/dist/aspect-ratio.es.js +43 -0
- package/dist/avatar.cjs.js +1 -0
- package/dist/avatar.d.ts +15 -0
- package/dist/avatar.es.js +205 -0
- package/dist/badge.cjs.js +1 -0
- package/dist/badge.d.ts +16 -0
- package/dist/badge.es.js +26 -0
- package/dist/breadcrumb.cjs.js +1 -0
- package/dist/breadcrumb.d.ts +35 -0
- package/dist/breadcrumb.es.js +69 -0
- package/dist/button.cjs.js +1 -0
- package/dist/button.d.ts +17 -0
- package/dist/button.es.js +40 -0
- package/dist/calendar.cjs.js +1 -0
- package/dist/calendar.d.ts +29 -0
- package/dist/calendar.es.js +2976 -0
- package/dist/card.cjs.js +1 -0
- package/dist/card.d.ts +19 -0
- package/dist/card.es.js +33 -0
- package/dist/carousel.cjs.js +1 -0
- package/dist/carousel.d.ts +50 -0
- package/dist/carousel.es.js +1403 -0
- package/dist/chart.cjs.js +16 -0
- package/dist/chart.d.ts +60 -0
- package/dist/chart.es.js +4402 -0
- package/dist/checkbox.cjs.js +1 -0
- package/dist/checkbox.d.ts +10 -0
- package/dist/checkbox.es.js +258 -0
- package/dist/collapsible.cjs.js +1 -0
- package/dist/collapsible.d.ts +20 -0
- package/dist/collapsible.es.js +7 -0
- package/dist/command.cjs.js +1 -0
- package/dist/command.d.ts +115 -0
- package/dist/command.es.js +396 -0
- package/dist/context-menu.cjs.js +1 -0
- package/dist/context-menu.d.ts +80 -0
- package/dist/context-menu.es.js +328 -0
- package/dist/dialog.cjs.js +1 -0
- package/dist/dialog.d.ts +31 -0
- package/dist/dialog.es.js +66 -0
- package/dist/drawer.cjs.js +3 -0
- package/dist/drawer.d.ts +65 -0
- package/dist/drawer.es.js +1085 -0
- package/dist/dropdown-menu.cjs.js +1 -0
- package/dist/dropdown-menu.d.ts +80 -0
- package/dist/dropdown-menu.es.js +316 -0
- package/dist/form.cjs.js +1 -0
- package/dist/form.d.ts +53 -0
- package/dist/form.es.js +355 -0
- package/dist/hover-card.cjs.js +1 -0
- package/dist/hover-card.d.ts +19 -0
- package/dist/hover-card.es.js +188 -0
- package/dist/index-0ioNhtNM.mjs +10 -0
- package/dist/index-3j-XAIXT.mjs +55 -0
- package/dist/index-B2XtpfGY.js +1 -0
- package/dist/index-B39Lzq0v.js +1 -0
- package/dist/index-B7n6fy75.js +1 -0
- package/dist/index-B8dxbSWX.js +41 -0
- package/dist/index-BGIK9FQF.js +1 -0
- package/dist/index-BZPx6jYI.mjs +8 -0
- package/dist/index-BoNjHhm4.js +1 -0
- package/dist/index-BtZvtDmp.js +1 -0
- package/dist/index-Bv7qrYW6.mjs +180 -0
- package/dist/index-ByiPJW53.js +5 -0
- package/dist/index-C0dlIQIi.js +1 -0
- package/dist/index-C1qb0595.mjs +27 -0
- package/dist/index-C7HEunrh.mjs +15 -0
- package/dist/index-C8ni3LLa.js +1 -0
- package/dist/index-CCKe-Mpx.mjs +6 -0
- package/dist/index-CD6_IrA-.mjs +10 -0
- package/dist/index-CRyCZJLa.mjs +677 -0
- package/dist/index-CVx1AgNG.mjs +615 -0
- package/dist/index-Ce5TOFAK.js +1 -0
- package/dist/index-CeSLNJ60.mjs +32 -0
- package/dist/index-CefEQe_4.js +1 -0
- package/dist/index-Cj5hzyBi.js +1 -0
- package/dist/index-Cjj_rUPu.js +1 -0
- package/dist/index-Cl3G0jzM.js +1 -0
- package/dist/index-CsjrqSSN.js +1 -0
- package/dist/index-CwfE56Ep.mjs +1545 -0
- package/dist/index-CwyAfCwY.js +1 -0
- package/dist/index-CzY-WZXL.js +1 -0
- package/dist/index-D2HnlO3y.js +1 -0
- package/dist/index-DAWHN3cH.mjs +85 -0
- package/dist/index-DFdF7K7v.mjs +50 -0
- package/dist/index-DIsg7zU7.js +1 -0
- package/dist/index-DKN_vhyX.mjs +32 -0
- package/dist/index-DLcqcWxM.mjs +29 -0
- package/dist/index-DSxf1gN6.mjs +118 -0
- package/dist/index-DYxWvftI.js +1 -0
- package/dist/index-DaILh3TV.mjs +32 -0
- package/dist/index-Dfzl8TxY.mjs +136 -0
- package/dist/index-Dko2XdTk.js +1 -0
- package/dist/index-DlY82G31.mjs +245 -0
- package/dist/index-DnFcfnA9.mjs +13 -0
- package/dist/index-IZ2gq03c.mjs +68 -0
- package/dist/index-K9FzbxYw.mjs +93 -0
- package/dist/index-Le8p9oP4.mjs +60 -0
- package/dist/index-MQ0c3ZX_.js +1 -0
- package/dist/index-_XxjJPRD.js +1 -0
- package/dist/index-_wdrnYim.js +1 -0
- package/dist/index-jv3B4mTd.js +1 -0
- package/dist/index-kaM0u2Q1.js +1 -0
- package/dist/index-p6xVFRb4.mjs +52 -0
- package/dist/index-rKs9bXHr.mjs +6 -0
- package/dist/index-vuPgkS0V.mjs +70 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +1288 -0
- package/dist/index.es.js +289 -0
- package/dist/input.cjs.js +1 -0
- package/dist/input.d.ts +9 -0
- package/dist/input.es.js +19 -0
- package/dist/jsx-runtime-nZSsnGb7.js +6 -0
- package/dist/jsx-runtime-tc70JA_2.mjs +264 -0
- package/dist/label.cjs.js +1 -0
- package/dist/label.d.ts +11 -0
- package/dist/label.es.js +22 -0
- package/dist/menubar.cjs.js +1 -0
- package/dist/menubar.d.ts +79 -0
- package/dist/menubar.es.js +473 -0
- package/dist/navigation-menu.cjs.js +1 -0
- package/dist/navigation-menu.d.ts +47 -0
- package/dist/navigation-menu.es.js +673 -0
- package/dist/pagination.cjs.js +1 -0
- package/dist/pagination.d.ts +68 -0
- package/dist/pagination.es.js +68 -0
- package/dist/popover.cjs.js +1 -0
- package/dist/popover.d.ts +24 -0
- package/dist/popover.es.js +242 -0
- package/dist/progress.cjs.js +6 -0
- package/dist/progress.d.ts +9 -0
- package/dist/progress.es.js +99 -0
- package/dist/radio-group.cjs.js +1 -0
- package/dist/radio-group.d.ts +16 -0
- package/dist/radio-group.es.js +253 -0
- package/dist/resizable.cjs.js +1 -0
- package/dist/resizable.d.ts +22 -0
- package/dist/resizable.es.js +1990 -0
- package/dist/scroll-area.cjs.js +1 -0
- package/dist/scroll-area.d.ts +14 -0
- package/dist/scroll-area.es.js +546 -0
- package/dist/search.cjs.js +1 -0
- package/dist/search.d.ts +15 -0
- package/dist/search.es.js +51 -0
- package/dist/select.cjs.js +1 -0
- package/dist/select.d.ts +54 -0
- package/dist/select.es.js +908 -0
- package/dist/separator.cjs.js +1 -0
- package/dist/separator.d.ts +9 -0
- package/dist/separator.es.js +35 -0
- package/dist/sheet.cjs.js +1 -0
- package/dist/sheet.d.ts +68 -0
- package/dist/sheet.es.js +66 -0
- package/dist/skeleton.cjs.js +1 -0
- package/dist/skeleton.d.ts +9 -0
- package/dist/skeleton.es.js +8 -0
- package/dist/slider.cjs.js +1 -0
- package/dist/slider.d.ts +9 -0
- package/dist/slider.es.js +442 -0
- package/dist/sonner.cjs.js +1 -0
- package/dist/sonner.d.ts +10 -0
- package/dist/sonner.es.js +764 -0
- package/dist/switch.cjs.js +1 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.es.js +149 -0
- package/dist/table.cjs.js +1 -0
- package/dist/table.d.ts +43 -0
- package/dist/table.es.js +57 -0
- package/dist/tabs.cjs.js +1 -0
- package/dist/tabs.d.ts +24 -0
- package/dist/tabs.es.js +195 -0
- package/dist/text.cjs.js +1 -0
- package/dist/text.d.ts +17 -0
- package/dist/text.es.js +42 -0
- package/dist/textarea.cjs.js +1 -0
- package/dist/textarea.d.ts +9 -0
- package/dist/textarea.es.js +18 -0
- package/dist/theme-provider.cjs.js +1 -0
- package/dist/theme-provider.d.ts +9 -0
- package/dist/theme-provider.es.js +8 -0
- package/dist/theme-toggle.cjs.js +1 -0
- package/dist/theme-toggle.d.ts +8 -0
- package/dist/theme-toggle.es.js +78 -0
- package/dist/toast.cjs.js +1 -0
- package/dist/toast.d.ts +26 -0
- package/dist/toast.es.js +494 -0
- package/dist/toaster-CIpfms4W.js +1 -0
- package/dist/toaster-jBYXAPRk.mjs +118 -0
- package/dist/toaster.cjs.js +1 -0
- package/dist/toaster.d.ts +6 -0
- package/dist/toaster.es.js +6 -0
- package/dist/toggle-group.cjs.js +1 -0
- package/dist/toggle-group.d.ts +18 -0
- package/dist/toggle-group.es.js +170 -0
- package/dist/toggle.cjs.js +1 -0
- package/dist/toggle.d.ts +14 -0
- package/dist/toggle.es.js +14 -0
- package/dist/tooltip.cjs.js +1 -0
- package/dist/tooltip.d.ts +25 -0
- package/dist/tooltip.es.js +342 -0
- package/dist/utils-B6yFEsav.mjs +8 -0
- package/dist/utils-IjLH3w2e.js +1 -0
- package/package.json +1 -1
package/dist/form.es.js
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { j as v } from "./jsx-runtime-tc70JA_2.mjs";
|
|
2
|
+
import { S as ee } from "./index-Le8p9oP4.mjs";
|
|
3
|
+
import * as p from "react";
|
|
4
|
+
import a from "react";
|
|
5
|
+
import { Label as te } from "./label.es.js";
|
|
6
|
+
import { c as R } from "./utils-B6yFEsav.mjs";
|
|
7
|
+
var re = (e) => e.type === "checkbox", S = (e) => e instanceof Date, L = (e) => e == null;
|
|
8
|
+
const q = (e) => typeof e == "object";
|
|
9
|
+
var I = (e) => !L(e) && !Array.isArray(e) && q(e) && !S(e), se = (e) => I(e) && e.target ? re(e.target) ? e.target.checked : e.target.value : e, oe = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, ne = (e, o) => e.has(oe(o)), ae = (e) => {
|
|
10
|
+
const o = e.constructor && e.constructor.prototype;
|
|
11
|
+
return I(o) && o.hasOwnProperty("isPrototypeOf");
|
|
12
|
+
}, ue = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
13
|
+
function K(e) {
|
|
14
|
+
if (e instanceof Date)
|
|
15
|
+
return new Date(e);
|
|
16
|
+
const o = typeof FileList < "u" && e instanceof FileList;
|
|
17
|
+
if (ue && (e instanceof Blob || o))
|
|
18
|
+
return e;
|
|
19
|
+
const t = Array.isArray(e);
|
|
20
|
+
if (!t && !(I(e) && ae(e)))
|
|
21
|
+
return e;
|
|
22
|
+
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
23
|
+
for (const r in e)
|
|
24
|
+
Object.prototype.hasOwnProperty.call(e, r) && (s[r] = K(e[r]));
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
var z = (e) => /^\w*$/.test(e), D = (e) => e === void 0, ie = (e) => Array.isArray(e) ? e.filter(Boolean) : [], J = (e) => ie(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, o, t) => {
|
|
28
|
+
if (!o || !I(e))
|
|
29
|
+
return t;
|
|
30
|
+
const s = (z(o) ? [o] : J(o)).reduce((r, n) => L(r) ? r : r[n], e);
|
|
31
|
+
return D(s) || s === e ? D(e[o]) ? t : e[o] : s;
|
|
32
|
+
}, M = (e) => typeof e == "boolean", O = (e) => typeof e == "function", $ = (e, o, t) => {
|
|
33
|
+
let s = -1;
|
|
34
|
+
const r = z(o) ? [o] : J(o), n = r.length, u = n - 1;
|
|
35
|
+
for (; ++s < n; ) {
|
|
36
|
+
const l = r[s];
|
|
37
|
+
let c = t;
|
|
38
|
+
if (s !== u) {
|
|
39
|
+
const f = e[l];
|
|
40
|
+
c = I(f) || Array.isArray(f) ? f : isNaN(+r[s + 1]) ? {} : [];
|
|
41
|
+
}
|
|
42
|
+
if (l === "__proto__" || l === "constructor" || l === "prototype")
|
|
43
|
+
return;
|
|
44
|
+
e[l] = c, e = e[l];
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const H = {
|
|
48
|
+
BLUR: "blur",
|
|
49
|
+
CHANGE: "change"
|
|
50
|
+
}, j = {
|
|
51
|
+
all: "all"
|
|
52
|
+
}, B = a.createContext(null);
|
|
53
|
+
B.displayName = "HookFormControlContext";
|
|
54
|
+
const T = () => a.useContext(B);
|
|
55
|
+
var le = (e, o, t, s = !0) => {
|
|
56
|
+
const r = {
|
|
57
|
+
defaultValues: o._defaultValues
|
|
58
|
+
};
|
|
59
|
+
for (const n in e)
|
|
60
|
+
Object.defineProperty(r, n, {
|
|
61
|
+
get: () => {
|
|
62
|
+
const u = n;
|
|
63
|
+
return o._proxyFormState[u] !== j.all && (o._proxyFormState[u] = !s || j.all), t && (t[u] = !0), e[u];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return r;
|
|
67
|
+
};
|
|
68
|
+
const Q = typeof window < "u" ? a.useLayoutEffect : a.useEffect;
|
|
69
|
+
function ce(e) {
|
|
70
|
+
const o = T(), { control: t = o, disabled: s, name: r, exact: n } = e || {}, [u, l] = a.useState(t._formState), c = a.useRef({
|
|
71
|
+
isDirty: !1,
|
|
72
|
+
isLoading: !1,
|
|
73
|
+
dirtyFields: !1,
|
|
74
|
+
touchedFields: !1,
|
|
75
|
+
validatingFields: !1,
|
|
76
|
+
isValidating: !1,
|
|
77
|
+
isValid: !1,
|
|
78
|
+
errors: !1
|
|
79
|
+
});
|
|
80
|
+
return Q(() => t._subscribe({
|
|
81
|
+
name: r,
|
|
82
|
+
formState: c.current,
|
|
83
|
+
exact: n,
|
|
84
|
+
callback: (f) => {
|
|
85
|
+
!s && l({
|
|
86
|
+
...t._formState,
|
|
87
|
+
...f
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}), [r, s, n]), a.useEffect(() => {
|
|
91
|
+
c.current.isValid && t._setValid(!0);
|
|
92
|
+
}, [t]), a.useMemo(() => le(u, t, c.current, !1), [u, t]);
|
|
93
|
+
}
|
|
94
|
+
var fe = (e) => typeof e == "string", W = (e, o, t, s, r) => fe(e) ? y(t, e, r) : Array.isArray(e) ? e.map((n) => y(t, n)) : t, G = (e) => L(e) || !q(e);
|
|
95
|
+
function E(e, o, t = /* @__PURE__ */ new WeakSet()) {
|
|
96
|
+
if (G(e) || G(o))
|
|
97
|
+
return Object.is(e, o);
|
|
98
|
+
if (S(e) && S(o))
|
|
99
|
+
return Object.is(e.getTime(), o.getTime());
|
|
100
|
+
const s = Object.keys(e), r = Object.keys(o);
|
|
101
|
+
if (s.length !== r.length)
|
|
102
|
+
return !1;
|
|
103
|
+
if (t.has(e) || t.has(o))
|
|
104
|
+
return !0;
|
|
105
|
+
t.add(e), t.add(o);
|
|
106
|
+
for (const n of s) {
|
|
107
|
+
const u = e[n];
|
|
108
|
+
if (!r.includes(n))
|
|
109
|
+
return !1;
|
|
110
|
+
if (n !== "ref") {
|
|
111
|
+
const l = o[n];
|
|
112
|
+
if (S(u) && S(l) || I(u) && I(l) || Array.isArray(u) && Array.isArray(l) ? !E(u, l, t) : !Object.is(u, l))
|
|
113
|
+
return !1;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return !0;
|
|
117
|
+
}
|
|
118
|
+
function de(e) {
|
|
119
|
+
const o = T(), { control: t = o, name: s, defaultValue: r, disabled: n, exact: u, compute: l } = e || {}, c = a.useRef(r), f = a.useRef(l), F = a.useRef(void 0), d = a.useRef(t), g = a.useRef(s);
|
|
120
|
+
f.current = l;
|
|
121
|
+
const [h, _] = a.useState(() => {
|
|
122
|
+
const i = t._getWatch(s, c.current);
|
|
123
|
+
return f.current ? f.current(i) : i;
|
|
124
|
+
}), b = a.useCallback((i) => {
|
|
125
|
+
const m = W(s, t._names, i || t._formValues, !1, c.current);
|
|
126
|
+
return f.current ? f.current(m) : m;
|
|
127
|
+
}, [t._formValues, t._names, s]), C = a.useCallback((i) => {
|
|
128
|
+
if (!n) {
|
|
129
|
+
const m = W(s, t._names, i || t._formValues, !1, c.current);
|
|
130
|
+
if (f.current) {
|
|
131
|
+
const V = f.current(m);
|
|
132
|
+
E(V, F.current) || (_(V), F.current = V);
|
|
133
|
+
} else
|
|
134
|
+
_(m);
|
|
135
|
+
}
|
|
136
|
+
}, [t._formValues, t._names, n, s]);
|
|
137
|
+
Q(() => ((d.current !== t || !E(g.current, s)) && (d.current = t, g.current = s, C()), t._subscribe({
|
|
138
|
+
name: s,
|
|
139
|
+
formState: {
|
|
140
|
+
values: !0
|
|
141
|
+
},
|
|
142
|
+
exact: u,
|
|
143
|
+
callback: (i) => {
|
|
144
|
+
C(i.values);
|
|
145
|
+
}
|
|
146
|
+
})), [t, u, s, C]), a.useEffect(() => t._removeUnmounted());
|
|
147
|
+
const x = d.current !== t, w = g.current, N = a.useMemo(() => {
|
|
148
|
+
if (n)
|
|
149
|
+
return null;
|
|
150
|
+
const i = !x && !E(w, s);
|
|
151
|
+
return x || i ? b() : null;
|
|
152
|
+
}, [n, x, s, w, b]);
|
|
153
|
+
return N !== null ? N : h;
|
|
154
|
+
}
|
|
155
|
+
function me(e) {
|
|
156
|
+
const o = T(), { name: t, disabled: s, control: r = o, shouldUnregister: n, defaultValue: u, exact: l = !0 } = e, c = ne(r._names.array, t), f = a.useMemo(() => y(r._formValues, t, y(r._defaultValues, t, u)), [r, t, u]), F = de({
|
|
157
|
+
control: r,
|
|
158
|
+
name: t,
|
|
159
|
+
defaultValue: f,
|
|
160
|
+
exact: l
|
|
161
|
+
}), d = ce({
|
|
162
|
+
control: r,
|
|
163
|
+
name: t,
|
|
164
|
+
exact: l
|
|
165
|
+
}), g = a.useRef(e), h = a.useRef(void 0), _ = a.useRef(r.register(t, {
|
|
166
|
+
...e.rules,
|
|
167
|
+
value: F,
|
|
168
|
+
...M(e.disabled) ? { disabled: e.disabled } : {}
|
|
169
|
+
}));
|
|
170
|
+
g.current = e;
|
|
171
|
+
const b = a.useMemo(() => Object.defineProperties({}, {
|
|
172
|
+
invalid: {
|
|
173
|
+
enumerable: !0,
|
|
174
|
+
get: () => !!y(d.errors, t)
|
|
175
|
+
},
|
|
176
|
+
isDirty: {
|
|
177
|
+
enumerable: !0,
|
|
178
|
+
get: () => !!y(d.dirtyFields, t)
|
|
179
|
+
},
|
|
180
|
+
isTouched: {
|
|
181
|
+
enumerable: !0,
|
|
182
|
+
get: () => !!y(d.touchedFields, t)
|
|
183
|
+
},
|
|
184
|
+
isValidating: {
|
|
185
|
+
enumerable: !0,
|
|
186
|
+
get: () => !!y(d.validatingFields, t)
|
|
187
|
+
},
|
|
188
|
+
error: {
|
|
189
|
+
enumerable: !0,
|
|
190
|
+
get: () => y(d.errors, t)
|
|
191
|
+
}
|
|
192
|
+
}), [d, t]), C = a.useCallback((i) => _.current.onChange({
|
|
193
|
+
target: {
|
|
194
|
+
value: se(i),
|
|
195
|
+
name: t
|
|
196
|
+
},
|
|
197
|
+
type: H.CHANGE
|
|
198
|
+
}), [t]), x = a.useCallback(() => _.current.onBlur({
|
|
199
|
+
target: {
|
|
200
|
+
value: y(r._formValues, t),
|
|
201
|
+
name: t
|
|
202
|
+
},
|
|
203
|
+
type: H.BLUR
|
|
204
|
+
}), [t, r._formValues]), w = a.useCallback((i) => {
|
|
205
|
+
const m = y(r._fields, t);
|
|
206
|
+
m && m._f && i && (m._f.ref = {
|
|
207
|
+
focus: () => O(i.focus) && i.focus(),
|
|
208
|
+
select: () => O(i.select) && i.select(),
|
|
209
|
+
setCustomValidity: (V) => O(i.setCustomValidity) && i.setCustomValidity(V),
|
|
210
|
+
reportValidity: () => O(i.reportValidity) && i.reportValidity()
|
|
211
|
+
});
|
|
212
|
+
}, [r._fields, t]), N = a.useMemo(() => ({
|
|
213
|
+
name: t,
|
|
214
|
+
value: F,
|
|
215
|
+
...M(s) || d.disabled ? { disabled: d.disabled || s } : {},
|
|
216
|
+
onChange: C,
|
|
217
|
+
onBlur: x,
|
|
218
|
+
ref: w
|
|
219
|
+
}), [t, s, d.disabled, C, x, w, F]);
|
|
220
|
+
return a.useEffect(() => {
|
|
221
|
+
const i = r._options.shouldUnregister || n, m = h.current;
|
|
222
|
+
m && m !== t && !c && r.unregister(m), r.register(t, {
|
|
223
|
+
...g.current.rules,
|
|
224
|
+
...M(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
225
|
+
});
|
|
226
|
+
const V = (k, Z) => {
|
|
227
|
+
const P = y(r._fields, k);
|
|
228
|
+
P && P._f && (P._f.mount = Z);
|
|
229
|
+
};
|
|
230
|
+
if (V(t, !0), i) {
|
|
231
|
+
const k = K(y(r._options.defaultValues, t, g.current.defaultValue));
|
|
232
|
+
$(r._defaultValues, t, k), D(y(r._formValues, t)) && $(r._formValues, t, k);
|
|
233
|
+
}
|
|
234
|
+
return !c && r.register(t), h.current = t, () => {
|
|
235
|
+
(c ? i && !r._state.action : i) ? r.unregister(t) : V(t, !1);
|
|
236
|
+
};
|
|
237
|
+
}, [t, r, c, n]), a.useEffect(() => {
|
|
238
|
+
r._setDisabledField({
|
|
239
|
+
disabled: s,
|
|
240
|
+
name: t
|
|
241
|
+
});
|
|
242
|
+
}, [s, t, r]), a.useMemo(() => ({
|
|
243
|
+
field: N,
|
|
244
|
+
formState: d,
|
|
245
|
+
fieldState: b
|
|
246
|
+
}), [N, d, b]);
|
|
247
|
+
}
|
|
248
|
+
const ye = (e) => e.render(me(e)), U = a.createContext(null);
|
|
249
|
+
U.displayName = "HookFormContext";
|
|
250
|
+
const ge = () => a.useContext(U), pe = (e) => {
|
|
251
|
+
const { children: o, watch: t, getValues: s, getFieldState: r, setError: n, clearErrors: u, setValue: l, trigger: c, formState: f, resetField: F, reset: d, handleSubmit: g, unregister: h, control: _, register: b, setFocus: C, subscribe: x } = e;
|
|
252
|
+
return a.createElement(
|
|
253
|
+
U.Provider,
|
|
254
|
+
{ value: a.useMemo(() => ({
|
|
255
|
+
watch: t,
|
|
256
|
+
getValues: s,
|
|
257
|
+
getFieldState: r,
|
|
258
|
+
setError: n,
|
|
259
|
+
clearErrors: u,
|
|
260
|
+
setValue: l,
|
|
261
|
+
trigger: c,
|
|
262
|
+
formState: f,
|
|
263
|
+
resetField: F,
|
|
264
|
+
reset: d,
|
|
265
|
+
handleSubmit: g,
|
|
266
|
+
unregister: h,
|
|
267
|
+
control: _,
|
|
268
|
+
register: b,
|
|
269
|
+
setFocus: C,
|
|
270
|
+
subscribe: x
|
|
271
|
+
}), [
|
|
272
|
+
u,
|
|
273
|
+
_,
|
|
274
|
+
f,
|
|
275
|
+
r,
|
|
276
|
+
s,
|
|
277
|
+
g,
|
|
278
|
+
b,
|
|
279
|
+
d,
|
|
280
|
+
F,
|
|
281
|
+
n,
|
|
282
|
+
C,
|
|
283
|
+
l,
|
|
284
|
+
x,
|
|
285
|
+
c,
|
|
286
|
+
h,
|
|
287
|
+
t
|
|
288
|
+
]) },
|
|
289
|
+
a.createElement(B.Provider, { value: _ }, o)
|
|
290
|
+
);
|
|
291
|
+
}, Ne = pe, X = p.createContext(null), Se = ({
|
|
292
|
+
...e
|
|
293
|
+
}) => /* @__PURE__ */ v.jsx(X.Provider, { value: { name: e.name }, children: /* @__PURE__ */ v.jsx(ye, { ...e }) }), A = () => {
|
|
294
|
+
const e = p.useContext(X), o = p.useContext(Y), { getFieldState: t, formState: s } = ge();
|
|
295
|
+
if (!e)
|
|
296
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
297
|
+
if (!o)
|
|
298
|
+
throw new Error("useFormField should be used within <FormItem>");
|
|
299
|
+
const r = t(e.name, s), { id: n } = o;
|
|
300
|
+
return {
|
|
301
|
+
id: n,
|
|
302
|
+
name: e.name,
|
|
303
|
+
formItemId: `${n}-form-item`,
|
|
304
|
+
formDescriptionId: `${n}-form-item-description`,
|
|
305
|
+
formMessageId: `${n}-form-item-message`,
|
|
306
|
+
...r
|
|
307
|
+
};
|
|
308
|
+
}, Y = p.createContext(null), Fe = p.forwardRef(
|
|
309
|
+
({ className: e, ...o }, t) => {
|
|
310
|
+
const s = p.useId();
|
|
311
|
+
return /* @__PURE__ */ v.jsx(Y.Provider, { value: { id: s }, children: /* @__PURE__ */ v.jsx("div", { ref: t, className: R("space-y-2", e), ...o }) });
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
Fe.displayName = "FormItem";
|
|
315
|
+
const _e = p.forwardRef(({ className: e, ...o }, t) => {
|
|
316
|
+
const { error: s, formItemId: r } = A();
|
|
317
|
+
return /* @__PURE__ */ v.jsx(te, { ref: t, className: R(s && "text-destructive", e), htmlFor: r, ...o });
|
|
318
|
+
});
|
|
319
|
+
_e.displayName = "FormLabel";
|
|
320
|
+
const Ce = p.forwardRef(
|
|
321
|
+
({ ...e }, o) => {
|
|
322
|
+
const { error: t, formItemId: s, formDescriptionId: r, formMessageId: n } = A();
|
|
323
|
+
return /* @__PURE__ */ v.jsx(
|
|
324
|
+
ee,
|
|
325
|
+
{
|
|
326
|
+
ref: o,
|
|
327
|
+
id: s,
|
|
328
|
+
"aria-describedby": t ? `${r} ${n}` : `${r}`,
|
|
329
|
+
"aria-invalid": !!t,
|
|
330
|
+
...e
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
Ce.displayName = "FormControl";
|
|
336
|
+
const xe = p.forwardRef(({ className: e, ...o }, t) => {
|
|
337
|
+
const { formDescriptionId: s } = A();
|
|
338
|
+
return /* @__PURE__ */ v.jsx("p", { ref: t, id: s, className: R("text-muted-foreground text-[0.8rem]", e), ...o });
|
|
339
|
+
});
|
|
340
|
+
xe.displayName = "FormDescription";
|
|
341
|
+
const be = p.forwardRef(({ className: e, children: o, ...t }, s) => {
|
|
342
|
+
const { error: r, formMessageId: n } = A(), u = r ? String(r?.message ?? "") : o;
|
|
343
|
+
return u ? /* @__PURE__ */ v.jsx("p", { ref: s, id: n, className: R("text-destructive text-[0.8rem] font-medium", e), ...t, children: u }) : null;
|
|
344
|
+
});
|
|
345
|
+
be.displayName = "FormMessage";
|
|
346
|
+
export {
|
|
347
|
+
Ne as Form,
|
|
348
|
+
Ce as FormControl,
|
|
349
|
+
xe as FormDescription,
|
|
350
|
+
Se as FormField,
|
|
351
|
+
Fe as FormItem,
|
|
352
|
+
_e as FormLabel,
|
|
353
|
+
be as FormMessage,
|
|
354
|
+
A as useFormField
|
|
355
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./jsx-runtime-nZSsnGb7.js"),L=require("react"),d=require("./index-BtZvtDmp.js"),M=require("./index-D2HnlO3y.js"),k=require("./index-Ce5TOFAK.js"),q=require("./index-_XxjJPRD.js"),m=require("./index-jv3B4mTd.js"),F=require("./index-B2XtpfGY.js"),$=require("./index-BoNjHhm4.js"),I=require("./utils-IjLH3w2e.js");function U(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const n=U(L);var S,b="HoverCard",[w]=M.createContextScope(b,[m.createPopperScope]),P=m.createPopperScope(),[z,H]=w(b),T=e=>{const{__scopeHoverCard:o,children:r,open:a,defaultOpen:s,onOpenChange:c,openDelay:f=700,closeDelay:v=300}=e,i=P(o),x=n.useRef(0),u=n.useRef(0),C=n.useRef(!1),p=n.useRef(!1),[h,t]=k.useControllableState({prop:a,defaultProp:s??!1,onChange:c,caller:b}),R=n.useCallback(()=>{clearTimeout(u.current),x.current=window.setTimeout(()=>t(!0),f)},[f,t]),D=n.useCallback(()=>{clearTimeout(x.current),!C.current&&!p.current&&(u.current=window.setTimeout(()=>t(!1),v))},[v,t]),A=n.useCallback(()=>t(!1),[t]);return n.useEffect(()=>()=>{clearTimeout(x.current),clearTimeout(u.current)},[]),l.jsxRuntimeExports.jsx(z,{scope:o,open:h,onOpenChange:t,onOpen:R,onClose:D,onDismiss:A,hasSelectionRef:C,isPointerDownOnContentRef:p,children:l.jsxRuntimeExports.jsx(m.Root2,{...i,children:r})})};T.displayName=b;var O="HoverCardTrigger",y=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...a}=e,s=H(O,r),c=P(r);return l.jsxRuntimeExports.jsx(m.Anchor,{asChild:!0,...c,children:l.jsxRuntimeExports.jsx(d.Primitive.a,{"data-state":s.open?"open":"closed",...a,ref:o,onPointerEnter:d.composeEventHandlers(e.onPointerEnter,g(s.onOpen)),onPointerLeave:d.composeEventHandlers(e.onPointerLeave,g(s.onClose)),onFocus:d.composeEventHandlers(e.onFocus,s.onOpen),onBlur:d.composeEventHandlers(e.onBlur,s.onClose),onTouchStart:d.composeEventHandlers(e.onTouchStart,f=>f.preventDefault())})})});y.displayName=O;var W="HoverCardPortal",[ee,B]=w(W,{forceMount:void 0}),E="HoverCardContent",j=n.forwardRef((e,o)=>{const r=B(E,e.__scopeHoverCard),{forceMount:a=r.forceMount,...s}=e,c=H(E,e.__scopeHoverCard);return l.jsxRuntimeExports.jsx(F.Presence,{present:a||c.open,children:l.jsxRuntimeExports.jsx(G,{"data-state":c.open?"open":"closed",...s,onPointerEnter:d.composeEventHandlers(e.onPointerEnter,g(c.onOpen)),onPointerLeave:d.composeEventHandlers(e.onPointerLeave,g(c.onClose)),ref:o})})});j.displayName=E;var G=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:f,...v}=e,i=H(E,r),x=P(r),u=n.useRef(null),C=q.useComposedRefs(o,u),[p,h]=n.useState(!1);return n.useEffect(()=>{if(p){const t=document.body;return S=t.style.userSelect||t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none",()=>{t.style.userSelect=S,t.style.webkitUserSelect=S}}},[p]),n.useEffect(()=>{if(u.current){const t=()=>{h(!1),i.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(i.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",t),()=>{document.removeEventListener("pointerup",t),i.hasSelectionRef.current=!1,i.isPointerDownOnContentRef.current=!1}}},[i.isPointerDownOnContentRef,i.hasSelectionRef]),n.useEffect(()=>{u.current&&J(u.current).forEach(R=>R.setAttribute("tabindex","-1"))}),l.jsxRuntimeExports.jsx($.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:d.composeEventHandlers(c,t=>{t.preventDefault()}),onDismiss:i.onDismiss,children:l.jsxRuntimeExports.jsx(m.Content,{...x,...v,onPointerDown:d.composeEventHandlers(v.onPointerDown,t=>{t.currentTarget.contains(t.target)&&h(!0),i.hasSelectionRef.current=!1,i.isPointerDownOnContentRef.current=!0}),ref:C,style:{...v.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),K="HoverCardArrow",V=n.forwardRef((e,o)=>{const{__scopeHoverCard:r,...a}=e,s=P(r);return l.jsxRuntimeExports.jsx(m.Arrow,{...s,...a,ref:o})});V.displayName=K;function g(e){return o=>o.pointerType==="touch"?void 0:e()}function J(e){const o=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)o.push(r.currentNode);return o}var Q=T,X=y,N=j;const Y=Q,Z=X,_=n.forwardRef(({className:e,align:o="center",sideOffset:r=4,...a},s)=>l.jsxRuntimeExports.jsx(N,{ref:s,align:o,sideOffset:r,className:I.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[--radix-hover-card-content-transform-origin] rounded-md border p-4 shadow-md outline-none",e),...a}));_.displayName=N.displayName;exports.HoverCard=Y;exports.HoverCardContent=_;exports.HoverCardTrigger=Z;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HoverCardContentBaseProps as HoverCardContentProps } from '../../ui-core/src';
|
|
2
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
3
|
+
import { HoverCardBaseProps as HoverCardProps } from '../../ui-core/src';
|
|
4
|
+
import { HoverCardTriggerBaseProps as HoverCardTriggerProps } from '../../ui-core/src';
|
|
5
|
+
import * as React_2 from 'react';
|
|
6
|
+
|
|
7
|
+
export declare const HoverCard: React_2.FC<HoverCardPrimitive.HoverCardProps>;
|
|
8
|
+
|
|
9
|
+
export declare const HoverCardContent: React_2.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & HoverCardContentProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
|
|
11
|
+
export { HoverCardContentProps }
|
|
12
|
+
|
|
13
|
+
export { HoverCardProps }
|
|
14
|
+
|
|
15
|
+
export declare const HoverCardTrigger: React_2.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React_2.RefAttributes<HTMLAnchorElement>>;
|
|
16
|
+
|
|
17
|
+
export { HoverCardTriggerProps }
|
|
18
|
+
|
|
19
|
+
export { }
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { j as d } from "./jsx-runtime-tc70JA_2.mjs";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { c as l, P as j } from "./index-K9FzbxYw.mjs";
|
|
4
|
+
import { c as L } from "./index-IZ2gq03c.mjs";
|
|
5
|
+
import { u as k } from "./index-p6xVFRb4.mjs";
|
|
6
|
+
import { u as F } from "./index-DLcqcWxM.mjs";
|
|
7
|
+
import { C as M, c as E, R as I, A as U, a as W } from "./index-CwfE56Ep.mjs";
|
|
8
|
+
import { P as $ } from "./index-vuPgkS0V.mjs";
|
|
9
|
+
import { D as z } from "./index-Dfzl8TxY.mjs";
|
|
10
|
+
import { c as B } from "./utils-B6yFEsav.mjs";
|
|
11
|
+
var S, g = "HoverCard", [T] = L(g, [
|
|
12
|
+
E
|
|
13
|
+
]), w = E(), [G, b] = T(g), H = (e) => {
|
|
14
|
+
const {
|
|
15
|
+
__scopeHoverCard: r,
|
|
16
|
+
children: n,
|
|
17
|
+
open: s,
|
|
18
|
+
defaultOpen: a,
|
|
19
|
+
onOpenChange: c,
|
|
20
|
+
openDelay: f = 700,
|
|
21
|
+
closeDelay: v = 300
|
|
22
|
+
} = e, i = w(r), m = t.useRef(0), u = t.useRef(0), C = t.useRef(!1), p = t.useRef(!1), [h, o] = k({
|
|
23
|
+
prop: s,
|
|
24
|
+
defaultProp: a ?? !1,
|
|
25
|
+
onChange: c,
|
|
26
|
+
caller: g
|
|
27
|
+
}), x = t.useCallback(() => {
|
|
28
|
+
clearTimeout(u.current), m.current = window.setTimeout(() => o(!0), f);
|
|
29
|
+
}, [f, o]), _ = t.useCallback(() => {
|
|
30
|
+
clearTimeout(m.current), !C.current && !p.current && (u.current = window.setTimeout(() => o(!1), v));
|
|
31
|
+
}, [v, o]), A = t.useCallback(() => o(!1), [o]);
|
|
32
|
+
return t.useEffect(() => () => {
|
|
33
|
+
clearTimeout(m.current), clearTimeout(u.current);
|
|
34
|
+
}, []), /* @__PURE__ */ d.jsx(
|
|
35
|
+
G,
|
|
36
|
+
{
|
|
37
|
+
scope: r,
|
|
38
|
+
open: h,
|
|
39
|
+
onOpenChange: o,
|
|
40
|
+
onOpen: x,
|
|
41
|
+
onClose: _,
|
|
42
|
+
onDismiss: A,
|
|
43
|
+
hasSelectionRef: C,
|
|
44
|
+
isPointerDownOnContentRef: p,
|
|
45
|
+
children: /* @__PURE__ */ d.jsx(I, { ...i, children: n })
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
H.displayName = g;
|
|
50
|
+
var O = "HoverCardTrigger", y = t.forwardRef(
|
|
51
|
+
(e, r) => {
|
|
52
|
+
const { __scopeHoverCard: n, ...s } = e, a = b(O, n), c = w(n);
|
|
53
|
+
return /* @__PURE__ */ d.jsx(U, { asChild: !0, ...c, children: /* @__PURE__ */ d.jsx(
|
|
54
|
+
j.a,
|
|
55
|
+
{
|
|
56
|
+
"data-state": a.open ? "open" : "closed",
|
|
57
|
+
...s,
|
|
58
|
+
ref: r,
|
|
59
|
+
onPointerEnter: l(e.onPointerEnter, R(a.onOpen)),
|
|
60
|
+
onPointerLeave: l(e.onPointerLeave, R(a.onClose)),
|
|
61
|
+
onFocus: l(e.onFocus, a.onOpen),
|
|
62
|
+
onBlur: l(e.onBlur, a.onClose),
|
|
63
|
+
onTouchStart: l(e.onTouchStart, (f) => f.preventDefault())
|
|
64
|
+
}
|
|
65
|
+
) });
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
y.displayName = O;
|
|
69
|
+
var K = "HoverCardPortal", [le, V] = T(K, {
|
|
70
|
+
forceMount: void 0
|
|
71
|
+
}), P = "HoverCardContent", N = t.forwardRef(
|
|
72
|
+
(e, r) => {
|
|
73
|
+
const n = V(P, e.__scopeHoverCard), { forceMount: s = n.forceMount, ...a } = e, c = b(P, e.__scopeHoverCard);
|
|
74
|
+
return /* @__PURE__ */ d.jsx($, { present: s || c.open, children: /* @__PURE__ */ d.jsx(
|
|
75
|
+
q,
|
|
76
|
+
{
|
|
77
|
+
"data-state": c.open ? "open" : "closed",
|
|
78
|
+
...a,
|
|
79
|
+
onPointerEnter: l(e.onPointerEnter, R(c.onOpen)),
|
|
80
|
+
onPointerLeave: l(e.onPointerLeave, R(c.onClose)),
|
|
81
|
+
ref: r
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
N.displayName = P;
|
|
87
|
+
var q = t.forwardRef((e, r) => {
|
|
88
|
+
const {
|
|
89
|
+
__scopeHoverCard: n,
|
|
90
|
+
onEscapeKeyDown: s,
|
|
91
|
+
onPointerDownOutside: a,
|
|
92
|
+
onFocusOutside: c,
|
|
93
|
+
onInteractOutside: f,
|
|
94
|
+
...v
|
|
95
|
+
} = e, i = b(P, n), m = w(n), u = t.useRef(null), C = F(r, u), [p, h] = t.useState(!1);
|
|
96
|
+
return t.useEffect(() => {
|
|
97
|
+
if (p) {
|
|
98
|
+
const o = document.body;
|
|
99
|
+
return S = o.style.userSelect || o.style.webkitUserSelect, o.style.userSelect = "none", o.style.webkitUserSelect = "none", () => {
|
|
100
|
+
o.style.userSelect = S, o.style.webkitUserSelect = S;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}, [p]), t.useEffect(() => {
|
|
104
|
+
if (u.current) {
|
|
105
|
+
const o = () => {
|
|
106
|
+
h(!1), i.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
107
|
+
document.getSelection()?.toString() !== "" && (i.hasSelectionRef.current = !0);
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
return document.addEventListener("pointerup", o), () => {
|
|
111
|
+
document.removeEventListener("pointerup", o), i.hasSelectionRef.current = !1, i.isPointerDownOnContentRef.current = !1;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}, [i.isPointerDownOnContentRef, i.hasSelectionRef]), t.useEffect(() => {
|
|
115
|
+
u.current && X(u.current).forEach((x) => x.setAttribute("tabindex", "-1"));
|
|
116
|
+
}), /* @__PURE__ */ d.jsx(
|
|
117
|
+
z,
|
|
118
|
+
{
|
|
119
|
+
asChild: !0,
|
|
120
|
+
disableOutsidePointerEvents: !1,
|
|
121
|
+
onInteractOutside: f,
|
|
122
|
+
onEscapeKeyDown: s,
|
|
123
|
+
onPointerDownOutside: a,
|
|
124
|
+
onFocusOutside: l(c, (o) => {
|
|
125
|
+
o.preventDefault();
|
|
126
|
+
}),
|
|
127
|
+
onDismiss: i.onDismiss,
|
|
128
|
+
children: /* @__PURE__ */ d.jsx(
|
|
129
|
+
M,
|
|
130
|
+
{
|
|
131
|
+
...m,
|
|
132
|
+
...v,
|
|
133
|
+
onPointerDown: l(v.onPointerDown, (o) => {
|
|
134
|
+
o.currentTarget.contains(o.target) && h(!0), i.hasSelectionRef.current = !1, i.isPointerDownOnContentRef.current = !0;
|
|
135
|
+
}),
|
|
136
|
+
ref: C,
|
|
137
|
+
style: {
|
|
138
|
+
...v.style,
|
|
139
|
+
userSelect: p ? "text" : void 0,
|
|
140
|
+
// Safari requires prefix
|
|
141
|
+
WebkitUserSelect: p ? "text" : void 0,
|
|
142
|
+
"--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
143
|
+
"--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
|
|
144
|
+
"--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
|
|
145
|
+
"--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
|
|
146
|
+
"--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}), J = "HoverCardArrow", Q = t.forwardRef(
|
|
153
|
+
(e, r) => {
|
|
154
|
+
const { __scopeHoverCard: n, ...s } = e, a = w(n);
|
|
155
|
+
return /* @__PURE__ */ d.jsx(W, { ...a, ...s, ref: r });
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
Q.displayName = J;
|
|
159
|
+
function R(e) {
|
|
160
|
+
return (r) => r.pointerType === "touch" ? void 0 : e();
|
|
161
|
+
}
|
|
162
|
+
function X(e) {
|
|
163
|
+
const r = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
164
|
+
acceptNode: (s) => s.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
165
|
+
});
|
|
166
|
+
for (; n.nextNode(); ) r.push(n.currentNode);
|
|
167
|
+
return r;
|
|
168
|
+
}
|
|
169
|
+
var Y = H, Z = y, D = N;
|
|
170
|
+
const ue = Y, pe = Z, ee = t.forwardRef(({ className: e, align: r = "center", sideOffset: n = 4, ...s }, a) => /* @__PURE__ */ d.jsx(
|
|
171
|
+
D,
|
|
172
|
+
{
|
|
173
|
+
ref: a,
|
|
174
|
+
align: r,
|
|
175
|
+
sideOffset: n,
|
|
176
|
+
className: B(
|
|
177
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[--radix-hover-card-content-transform-origin] rounded-md border p-4 shadow-md outline-none",
|
|
178
|
+
e
|
|
179
|
+
),
|
|
180
|
+
...s
|
|
181
|
+
}
|
|
182
|
+
));
|
|
183
|
+
ee.displayName = D.displayName;
|
|
184
|
+
export {
|
|
185
|
+
ue as HoverCard,
|
|
186
|
+
ee as HoverCardContent,
|
|
187
|
+
pe as HoverCardTrigger
|
|
188
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { j as v } from "./jsx-runtime-tc70JA_2.mjs";
|
|
3
|
+
function P(e, p = []) {
|
|
4
|
+
let n = [];
|
|
5
|
+
function m(c, t) {
|
|
6
|
+
const o = u.createContext(t);
|
|
7
|
+
o.displayName = c + "Context";
|
|
8
|
+
const s = n.length;
|
|
9
|
+
n = [...n, t];
|
|
10
|
+
const a = (i) => {
|
|
11
|
+
const { scope: d, children: f, ...x } = i, S = d?.[e]?.[s] || o, l = u.useMemo(() => x, Object.values(x));
|
|
12
|
+
return /* @__PURE__ */ v.jsx(S.Provider, { value: l, children: f });
|
|
13
|
+
};
|
|
14
|
+
a.displayName = c + "Provider";
|
|
15
|
+
function C(i, d) {
|
|
16
|
+
const f = d?.[e]?.[s] || o, x = u.useContext(f);
|
|
17
|
+
if (x) return x;
|
|
18
|
+
if (t !== void 0) return t;
|
|
19
|
+
throw new Error(`\`${i}\` must be used within \`${c}\``);
|
|
20
|
+
}
|
|
21
|
+
return [a, C];
|
|
22
|
+
}
|
|
23
|
+
const r = () => {
|
|
24
|
+
const c = n.map((t) => u.createContext(t));
|
|
25
|
+
return function(o) {
|
|
26
|
+
const s = o?.[e] || c;
|
|
27
|
+
return u.useMemo(
|
|
28
|
+
() => ({ [`__scope${e}`]: { ...o, [e]: s } }),
|
|
29
|
+
[o, s]
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
return r.scopeName = e, [m, _(r, ...p)];
|
|
34
|
+
}
|
|
35
|
+
function _(...e) {
|
|
36
|
+
const p = e[0];
|
|
37
|
+
if (e.length === 1) return p;
|
|
38
|
+
const n = () => {
|
|
39
|
+
const m = e.map((r) => ({
|
|
40
|
+
useScope: r(),
|
|
41
|
+
scopeName: r.scopeName
|
|
42
|
+
}));
|
|
43
|
+
return function(c) {
|
|
44
|
+
const t = m.reduce((o, { useScope: s, scopeName: a }) => {
|
|
45
|
+
const i = s(c)[`__scope${a}`];
|
|
46
|
+
return { ...o, ...i };
|
|
47
|
+
}, {});
|
|
48
|
+
return u.useMemo(() => ({ [`__scope${p.scopeName}`]: t }), [t]);
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
return n.scopeName = p.scopeName, n;
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
P as c
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const T=require("react"),E=require("./index-_XxjJPRD.js"),g=require("./index-MQ0c3ZX_.js");function P(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const o=P(T);function R(n,e){return o.useReducer((t,r)=>e[t][r]??t,n)}var A=n=>{const{present:e,children:t}=n,r=S(e),a=typeof t=="function"?t({present:r.isPresent}):o.Children.only(t),u=E.useComposedRefs(r.ref,v(a));return typeof t=="function"||r.isPresent?o.cloneElement(a,{ref:u}):null};A.displayName="Presence";function S(n){const[e,t]=o.useState(),r=o.useRef(null),a=o.useRef(n),u=o.useRef("none"),p=n?"mounted":"unmounted",[N,s]=R(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{const i=l(r.current);u.current=N==="mounted"?i:"none"},[N]),g.useLayoutEffect2(()=>{const i=r.current,d=a.current;if(d!==n){const f=u.current,c=l(i);n?s("MOUNT"):c==="none"||i?.display==="none"?s("UNMOUNT"):s(d&&f!==c?"ANIMATION_OUT":"UNMOUNT"),a.current=n}},[n,s]),g.useLayoutEffect2(()=>{if(e){let i;const d=e.ownerDocument.defaultView??window,m=c=>{const y=l(r.current).includes(CSS.escape(c.animationName));if(c.target===e&&y&&(s("ANIMATION_END"),!a.current)){const M=e.style.animationFillMode;e.style.animationFillMode="forwards",i=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=M)})}},f=c=>{c.target===e&&(u.current=l(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{d.clearTimeout(i),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else s("ANIMATION_END")},[e,s]),{isPresent:["mounted","unmountSuspended"].includes(N),ref:o.useCallback(i=>{r.current=i?getComputedStyle(i):null,t(i)},[])}}function l(n){return n?.animationName||"none"}function v(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}exports.Presence=A;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("react");require("react-dom");const l=require("./index-Cj5hzyBi.js"),f=require("./jsx-runtime-nZSsnGb7.js");function m(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const p=m(a);var d=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],v=d.reduce((t,e)=>{const r=l.createSlot(`Primitive.${e}`),i=p.forwardRef((n,o)=>{const{asChild:c,...s}=n,u=c?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsxRuntimeExports.jsx(u,{...s,ref:o})});return i.displayName=`Primitive.${e}`,{...t,[e]:i}},{});exports.Primitive=v;
|