@arcadeai/design-system 0.0.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/README.md +128 -0
- package/dist/check-CxcShTlQ.js +11 -0
- package/dist/chevron-down-D_a-ccxi.js +11 -0
- package/dist/chevron-right-DriXIqe5.js +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +195 -0
- package/dist/components/ui/atoms/accordion.d.ts +7 -0
- package/dist/components/ui/atoms/accordion.js +289 -0
- package/dist/components/ui/atoms/alert.d.ts +9 -0
- package/dist/components/ui/atoms/alert.js +66 -0
- package/dist/components/ui/atoms/avatar.d.ts +6 -0
- package/dist/components/ui/atoms/avatar.js +130 -0
- package/dist/components/ui/atoms/badge.d.ts +9 -0
- package/dist/components/ui/atoms/badge.js +41 -0
- package/dist/components/ui/atoms/breadcrumb.d.ts +11 -0
- package/dist/components/ui/atoms/breadcrumb.js +115 -0
- package/dist/components/ui/atoms/button.d.ts +10 -0
- package/dist/components/ui/atoms/button.js +51 -0
- package/dist/components/ui/atoms/card.d.ts +9 -0
- package/dist/components/ui/atoms/card.js +90 -0
- package/dist/components/ui/atoms/chart.d.ts +68 -0
- package/dist/components/ui/atoms/chart.js +10477 -0
- package/dist/components/ui/atoms/collapsible.d.ts +5 -0
- package/dist/components/ui/atoms/collapsible.js +34 -0
- package/dist/components/ui/atoms/command.d.ts +18 -0
- package/dist/components/ui/atoms/command.js +490 -0
- package/dist/components/ui/atoms/dialog.d.ts +15 -0
- package/dist/components/ui/atoms/dialog.js +135 -0
- package/dist/components/ui/atoms/dropdown-menu.d.ts +25 -0
- package/dist/components/ui/atoms/dropdown-menu.js +1035 -0
- package/dist/components/ui/atoms/form.d.ts +24 -0
- package/dist/components/ui/atoms/form.js +297 -0
- package/dist/components/ui/atoms/hover-card.d.ts +6 -0
- package/dist/components/ui/atoms/hover-card.js +211 -0
- package/dist/components/ui/atoms/index.d.ts +33 -0
- package/dist/components/ui/atoms/index.js +195 -0
- package/dist/components/ui/atoms/input.d.ts +3 -0
- package/dist/components/ui/atoms/input.js +21 -0
- package/dist/components/ui/atoms/label.d.ts +4 -0
- package/dist/components/ui/atoms/label.js +36 -0
- package/dist/components/ui/atoms/popover.d.ts +7 -0
- package/dist/components/ui/atoms/popover.js +266 -0
- package/dist/components/ui/atoms/progress.d.ts +4 -0
- package/dist/components/ui/atoms/progress.js +107 -0
- package/dist/components/ui/atoms/resizable.d.ts +8 -0
- package/dist/components/ui/atoms/resizable.js +1564 -0
- package/dist/components/ui/atoms/scroll-area.d.ts +5 -0
- package/dist/components/ui/atoms/scroll-area.js +580 -0
- package/dist/components/ui/atoms/select.d.ts +15 -0
- package/dist/components/ui/atoms/select.js +1000 -0
- package/dist/components/ui/atoms/separator.d.ts +4 -0
- package/dist/components/ui/atoms/separator.js +44 -0
- package/dist/components/ui/atoms/sheet.d.ts +14 -0
- package/dist/components/ui/atoms/sheet.js +127 -0
- package/dist/components/ui/atoms/sidebar.d.ts +69 -0
- package/dist/components/ui/atoms/sidebar.js +602 -0
- package/dist/components/ui/atoms/skeleton.d.ts +2 -0
- package/dist/components/ui/atoms/skeleton.js +15 -0
- package/dist/components/ui/atoms/slider.d.ts +4 -0
- package/dist/components/ui/atoms/slider.js +484 -0
- package/dist/components/ui/atoms/sonner.d.ts +3 -0
- package/dist/components/ui/atoms/sonner.js +788 -0
- package/dist/components/ui/atoms/switch.d.ts +4 -0
- package/dist/components/ui/atoms/switch.js +155 -0
- package/dist/components/ui/atoms/table.d.ts +10 -0
- package/dist/components/ui/atoms/table.js +114 -0
- package/dist/components/ui/atoms/tabs.d.ts +7 -0
- package/dist/components/ui/atoms/tabs.js +218 -0
- package/dist/components/ui/atoms/textarea.d.ts +3 -0
- package/dist/components/ui/atoms/textarea.js +18 -0
- package/dist/components/ui/atoms/toggle.d.ts +9 -0
- package/dist/components/ui/atoms/toggle.js +70 -0
- package/dist/components/ui/atoms/tooltip.d.ts +7 -0
- package/dist/components/ui/atoms/tooltip.js +376 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +195 -0
- package/dist/createLucideIcon-B6fy1GTR.js +94 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/index-BAhNQL1u.js +675 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-C9KW2H79.js +36 -0
- package/dist/index-CB1Wkg0G.js +83 -0
- package/dist/index-CHDs-SiB.js +27 -0
- package/dist/index-CJFGOBPb.js +122 -0
- package/dist/index-CL4N9wMT.js +259 -0
- package/dist/index-CuMpq4Un.js +47 -0
- package/dist/index-CxK6rt_N.js +119 -0
- package/dist/index-D2uXV4lz.js +181 -0
- package/dist/index-DLeNytVF.js +9 -0
- package/dist/index-DYfkNB0n.js +54 -0
- package/dist/index-DdnpnyX2.js +34 -0
- package/dist/index-DuekHEmj.js +6 -0
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/index-Dy7YuPrV.js +1532 -0
- package/dist/index-QMp1pYFl.js +145 -0
- package/dist/index-UFb2E87s.js +70 -0
- package/dist/index-nluJZSbA.js +31 -0
- package/dist/index-p7nYL7BU.js +71 -0
- package/dist/index-rKs9bXHr.js +6 -0
- package/dist/index-umR1UobZ.js +13 -0
- package/dist/index.css +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +4 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +195 -0
- package/dist/utils-Dy2WjYNJ.js +2744 -0
- package/package.json +100 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
+
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const useFormField: () => {
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
isDirty: boolean;
|
|
10
|
+
isTouched: boolean;
|
|
11
|
+
isValidating: boolean;
|
|
12
|
+
error?: import('react-hook-form').FieldError;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
formItemId: string;
|
|
16
|
+
formDescriptionId: string;
|
|
17
|
+
formMessageId: string;
|
|
18
|
+
};
|
|
19
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { S as W } from "../../../index-CB1Wkg0G.js";
|
|
3
|
+
import * as y from "react";
|
|
4
|
+
import i from "react";
|
|
5
|
+
import { Label as G } from "./label.js";
|
|
6
|
+
import { c as p } from "../../../utils-Dy2WjYNJ.js";
|
|
7
|
+
var j = (e) => e.type === "checkbox", K = (e) => e instanceof Date, O = (e) => e == null;
|
|
8
|
+
const q = (e) => typeof e == "object";
|
|
9
|
+
var b = (e) => !O(e) && !Array.isArray(e) && q(e) && !K(e), z = (e) => b(e) && e.target ? j(e.target) ? e.target.checked : e.target.value : e, J = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Q = (e, o) => e.has(J(o)), X = (e) => {
|
|
10
|
+
const o = e.constructor && e.constructor.prototype;
|
|
11
|
+
return b(o) && o.hasOwnProperty("isPrototypeOf");
|
|
12
|
+
}, Y = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
13
|
+
function L(e) {
|
|
14
|
+
let o;
|
|
15
|
+
const t = Array.isArray(e), s = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
16
|
+
if (e instanceof Date)
|
|
17
|
+
o = new Date(e);
|
|
18
|
+
else if (e instanceof Set)
|
|
19
|
+
o = new Set(e);
|
|
20
|
+
else if (!(Y && (e instanceof Blob || s)) && (t || b(e)))
|
|
21
|
+
if (o = t ? [] : {}, !t && !X(e))
|
|
22
|
+
o = e;
|
|
23
|
+
else
|
|
24
|
+
for (const r in e)
|
|
25
|
+
e.hasOwnProperty(r) && (o[r] = L(e[r]));
|
|
26
|
+
else
|
|
27
|
+
return e;
|
|
28
|
+
return o;
|
|
29
|
+
}
|
|
30
|
+
var M = (e) => /^\w*$/.test(e), V = (e) => e === void 0, Z = (e) => Array.isArray(e) ? e.filter(Boolean) : [], B = (e) => Z(e.replace(/["|']|\]/g, "").split(/\.|\[/)), c = (e, o, t) => {
|
|
31
|
+
if (!o || !b(e))
|
|
32
|
+
return t;
|
|
33
|
+
const s = (M(o) ? [o] : B(o)).reduce((r, n) => O(r) ? r : r[n], e);
|
|
34
|
+
return V(s) || s === e ? V(e[o]) ? t : e[o] : s;
|
|
35
|
+
}, C = (e) => typeof e == "boolean", P = (e, o, t) => {
|
|
36
|
+
let s = -1;
|
|
37
|
+
const r = M(o) ? [o] : B(o), n = r.length, l = n - 1;
|
|
38
|
+
for (; ++s < n; ) {
|
|
39
|
+
const u = r[s];
|
|
40
|
+
let a = t;
|
|
41
|
+
if (s !== l) {
|
|
42
|
+
const f = e[u];
|
|
43
|
+
a = b(f) || Array.isArray(f) ? f : isNaN(+r[s + 1]) ? {} : [];
|
|
44
|
+
}
|
|
45
|
+
if (u === "__proto__" || u === "constructor" || u === "prototype")
|
|
46
|
+
return;
|
|
47
|
+
e[u] = a, e = e[u];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const k = {
|
|
51
|
+
BLUR: "blur",
|
|
52
|
+
CHANGE: "change"
|
|
53
|
+
}, D = {
|
|
54
|
+
all: "all"
|
|
55
|
+
}, S = i.createContext(null);
|
|
56
|
+
S.displayName = "HookFormContext";
|
|
57
|
+
const v = () => i.useContext(S), ee = (e) => {
|
|
58
|
+
const { children: o, ...t } = e;
|
|
59
|
+
return i.createElement(S.Provider, { value: t }, o);
|
|
60
|
+
};
|
|
61
|
+
var te = (e, o, t, s = !0) => {
|
|
62
|
+
const r = {
|
|
63
|
+
defaultValues: o._defaultValues
|
|
64
|
+
};
|
|
65
|
+
for (const n in e)
|
|
66
|
+
Object.defineProperty(r, n, {
|
|
67
|
+
get: () => {
|
|
68
|
+
const l = n;
|
|
69
|
+
return o._proxyFormState[l] !== D.all && (o._proxyFormState[l] = !s || D.all), t && (t[l] = !0), e[l];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return r;
|
|
73
|
+
};
|
|
74
|
+
const R = typeof window < "u" ? y.useLayoutEffect : y.useEffect;
|
|
75
|
+
function U(e) {
|
|
76
|
+
const o = v(), { control: t = o.control, disabled: s, name: r, exact: n } = e || {}, [l, u] = i.useState(t._formState), a = i.useRef({
|
|
77
|
+
isDirty: !1,
|
|
78
|
+
isLoading: !1,
|
|
79
|
+
dirtyFields: !1,
|
|
80
|
+
touchedFields: !1,
|
|
81
|
+
validatingFields: !1,
|
|
82
|
+
isValidating: !1,
|
|
83
|
+
isValid: !1,
|
|
84
|
+
errors: !1
|
|
85
|
+
});
|
|
86
|
+
return R(() => t._subscribe({
|
|
87
|
+
name: r,
|
|
88
|
+
formState: a.current,
|
|
89
|
+
exact: n,
|
|
90
|
+
callback: (f) => {
|
|
91
|
+
!s && u({
|
|
92
|
+
...t._formState,
|
|
93
|
+
...f
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}), [r, s, n]), i.useEffect(() => {
|
|
97
|
+
a.current.isValid && t._setValid(!0);
|
|
98
|
+
}, [t]), i.useMemo(() => te(l, t, a.current, !1), [l, t]);
|
|
99
|
+
}
|
|
100
|
+
var re = (e) => typeof e == "string", oe = (e, o, t, s, r) => re(e) ? c(t, e, r) : Array.isArray(e) ? e.map((n) => c(t, n)) : t;
|
|
101
|
+
function se(e) {
|
|
102
|
+
const o = v(), { control: t = o.control, name: s, defaultValue: r, disabled: n, exact: l } = e || {}, u = i.useRef(r), [a, f] = i.useState(t._getWatch(s, u.current));
|
|
103
|
+
return R(() => t._subscribe({
|
|
104
|
+
name: s,
|
|
105
|
+
formState: {
|
|
106
|
+
values: !0
|
|
107
|
+
},
|
|
108
|
+
exact: l,
|
|
109
|
+
callback: (F) => !n && f(oe(s, t._names, F.values || t._formValues, !1, u.current))
|
|
110
|
+
}), [s, t, n, l]), i.useEffect(() => t._removeUnmounted()), a;
|
|
111
|
+
}
|
|
112
|
+
function ne(e) {
|
|
113
|
+
const o = v(), { name: t, disabled: s, control: r = o.control, shouldUnregister: n } = e, l = Q(r._names.array, t), u = se({
|
|
114
|
+
control: r,
|
|
115
|
+
name: t,
|
|
116
|
+
defaultValue: c(r._formValues, t, c(r._defaultValues, t, e.defaultValue)),
|
|
117
|
+
exact: !0
|
|
118
|
+
}), a = U({
|
|
119
|
+
control: r,
|
|
120
|
+
name: t,
|
|
121
|
+
exact: !0
|
|
122
|
+
}), f = i.useRef(e), F = i.useRef(r.register(t, {
|
|
123
|
+
...e.rules,
|
|
124
|
+
value: u,
|
|
125
|
+
...C(e.disabled) ? { disabled: e.disabled } : {}
|
|
126
|
+
})), I = i.useMemo(() => Object.defineProperties({}, {
|
|
127
|
+
invalid: {
|
|
128
|
+
enumerable: !0,
|
|
129
|
+
get: () => !!c(a.errors, t)
|
|
130
|
+
},
|
|
131
|
+
isDirty: {
|
|
132
|
+
enumerable: !0,
|
|
133
|
+
get: () => !!c(a.dirtyFields, t)
|
|
134
|
+
},
|
|
135
|
+
isTouched: {
|
|
136
|
+
enumerable: !0,
|
|
137
|
+
get: () => !!c(a.touchedFields, t)
|
|
138
|
+
},
|
|
139
|
+
isValidating: {
|
|
140
|
+
enumerable: !0,
|
|
141
|
+
get: () => !!c(a.validatingFields, t)
|
|
142
|
+
},
|
|
143
|
+
error: {
|
|
144
|
+
enumerable: !0,
|
|
145
|
+
get: () => c(a.errors, t)
|
|
146
|
+
}
|
|
147
|
+
}), [a, t]), A = i.useCallback((d) => F.current.onChange({
|
|
148
|
+
target: {
|
|
149
|
+
value: z(d),
|
|
150
|
+
name: t
|
|
151
|
+
},
|
|
152
|
+
type: k.CHANGE
|
|
153
|
+
}), [t]), w = i.useCallback(() => F.current.onBlur({
|
|
154
|
+
target: {
|
|
155
|
+
value: c(r._formValues, t),
|
|
156
|
+
name: t
|
|
157
|
+
},
|
|
158
|
+
type: k.BLUR
|
|
159
|
+
}), [t, r._formValues]), E = i.useCallback((d) => {
|
|
160
|
+
const _ = c(r._fields, t);
|
|
161
|
+
_ && d && (_._f.ref = {
|
|
162
|
+
focus: () => d.focus && d.focus(),
|
|
163
|
+
select: () => d.select && d.select(),
|
|
164
|
+
setCustomValidity: (g) => d.setCustomValidity(g),
|
|
165
|
+
reportValidity: () => d.reportValidity()
|
|
166
|
+
});
|
|
167
|
+
}, [r._fields, t]), N = i.useMemo(() => ({
|
|
168
|
+
name: t,
|
|
169
|
+
value: u,
|
|
170
|
+
...C(s) || a.disabled ? { disabled: a.disabled || s } : {},
|
|
171
|
+
onChange: A,
|
|
172
|
+
onBlur: w,
|
|
173
|
+
ref: E
|
|
174
|
+
}), [t, s, a.disabled, A, w, E, u]);
|
|
175
|
+
return i.useEffect(() => {
|
|
176
|
+
const d = r._options.shouldUnregister || n;
|
|
177
|
+
r.register(t, {
|
|
178
|
+
...f.current.rules,
|
|
179
|
+
...C(f.current.disabled) ? { disabled: f.current.disabled } : {}
|
|
180
|
+
});
|
|
181
|
+
const _ = (g, H) => {
|
|
182
|
+
const h = c(r._fields, g);
|
|
183
|
+
h && h._f && (h._f.mount = H);
|
|
184
|
+
};
|
|
185
|
+
if (_(t, !0), d) {
|
|
186
|
+
const g = L(c(r._options.defaultValues, t));
|
|
187
|
+
P(r._defaultValues, t, g), V(c(r._formValues, t)) && P(r._formValues, t, g);
|
|
188
|
+
}
|
|
189
|
+
return !l && r.register(t), () => {
|
|
190
|
+
(l ? d && !r._state.action : d) ? r.unregister(t) : _(t, !1);
|
|
191
|
+
};
|
|
192
|
+
}, [t, r, l, n]), i.useEffect(() => {
|
|
193
|
+
r._setDisabledField({
|
|
194
|
+
disabled: s,
|
|
195
|
+
name: t
|
|
196
|
+
});
|
|
197
|
+
}, [s, t, r]), i.useMemo(() => ({
|
|
198
|
+
field: N,
|
|
199
|
+
formState: a,
|
|
200
|
+
fieldState: I
|
|
201
|
+
}), [N, a, I]);
|
|
202
|
+
}
|
|
203
|
+
const ae = (e) => e.render(ne(e)), fe = ee, $ = y.createContext(
|
|
204
|
+
{}
|
|
205
|
+
), me = ({
|
|
206
|
+
...e
|
|
207
|
+
}) => /* @__PURE__ */ m($.Provider, { value: { name: e.name }, children: /* @__PURE__ */ m(ae, { ...e }) }), x = () => {
|
|
208
|
+
const e = y.useContext($), o = y.useContext(T), { getFieldState: t } = v(), s = U({ name: e.name }), r = t(e.name, s);
|
|
209
|
+
if (!e)
|
|
210
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
211
|
+
const { id: n } = o;
|
|
212
|
+
return {
|
|
213
|
+
id: n,
|
|
214
|
+
name: e.name,
|
|
215
|
+
formItemId: `${n}-form-item`,
|
|
216
|
+
formDescriptionId: `${n}-form-item-description`,
|
|
217
|
+
formMessageId: `${n}-form-item-message`,
|
|
218
|
+
...r
|
|
219
|
+
};
|
|
220
|
+
}, T = y.createContext(
|
|
221
|
+
{}
|
|
222
|
+
);
|
|
223
|
+
function ye({ className: e, ...o }) {
|
|
224
|
+
const t = y.useId();
|
|
225
|
+
return /* @__PURE__ */ m(T.Provider, { value: { id: t }, children: /* @__PURE__ */ m(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
className: p("grid gap-2", e),
|
|
229
|
+
"data-slot": "form-item",
|
|
230
|
+
...o
|
|
231
|
+
}
|
|
232
|
+
) });
|
|
233
|
+
}
|
|
234
|
+
function ge({
|
|
235
|
+
className: e,
|
|
236
|
+
...o
|
|
237
|
+
}) {
|
|
238
|
+
const { error: t, formItemId: s } = x();
|
|
239
|
+
return /* @__PURE__ */ m(
|
|
240
|
+
G,
|
|
241
|
+
{
|
|
242
|
+
className: p("data-[error=true]:text-destructive", e),
|
|
243
|
+
"data-error": !!t,
|
|
244
|
+
"data-slot": "form-label",
|
|
245
|
+
htmlFor: s,
|
|
246
|
+
...o
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
function _e({ ...e }) {
|
|
251
|
+
const { error: o, formItemId: t, formDescriptionId: s, formMessageId: r } = x();
|
|
252
|
+
return /* @__PURE__ */ m(
|
|
253
|
+
W,
|
|
254
|
+
{
|
|
255
|
+
"aria-describedby": o ? `${s} ${r}` : `${s}`,
|
|
256
|
+
"aria-invalid": !!o,
|
|
257
|
+
"data-slot": "form-control",
|
|
258
|
+
id: t,
|
|
259
|
+
...e
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
function be({ className: e, ...o }) {
|
|
264
|
+
const { formDescriptionId: t } = x();
|
|
265
|
+
return /* @__PURE__ */ m(
|
|
266
|
+
"p",
|
|
267
|
+
{
|
|
268
|
+
className: p("text-muted-foreground text-sm", e),
|
|
269
|
+
"data-slot": "form-description",
|
|
270
|
+
id: t,
|
|
271
|
+
...o
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
function Fe({ className: e, ...o }) {
|
|
276
|
+
const { error: t, formMessageId: s } = x(), r = t ? String((t == null ? void 0 : t.message) ?? "") : o.children;
|
|
277
|
+
return r ? /* @__PURE__ */ m(
|
|
278
|
+
"p",
|
|
279
|
+
{
|
|
280
|
+
className: p("text-destructive text-sm", e),
|
|
281
|
+
"data-slot": "form-message",
|
|
282
|
+
id: s,
|
|
283
|
+
...o,
|
|
284
|
+
children: r
|
|
285
|
+
}
|
|
286
|
+
) : null;
|
|
287
|
+
}
|
|
288
|
+
export {
|
|
289
|
+
fe as Form,
|
|
290
|
+
_e as FormControl,
|
|
291
|
+
be as FormDescription,
|
|
292
|
+
me as FormField,
|
|
293
|
+
ye as FormItem,
|
|
294
|
+
ge as FormLabel,
|
|
295
|
+
Fe as FormMessage,
|
|
296
|
+
x as useFormField
|
|
297
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { c as l } from "../../../index-DLeNytVF.js";
|
|
4
|
+
import { c as k } from "../../../index-UFb2E87s.js";
|
|
5
|
+
import { u as F } from "../../../index-DYfkNB0n.js";
|
|
6
|
+
import { u as I } from "../../../index-CB1Wkg0G.js";
|
|
7
|
+
import { c as T, R as U, A as $, C as W, a as z } from "../../../index-Dy7YuPrV.js";
|
|
8
|
+
import { P as B, D as G } from "../../../index-QMp1pYFl.js";
|
|
9
|
+
import { P as O } from "../../../index-p7nYL7BU.js";
|
|
10
|
+
import { P as K } from "../../../index-C9KW2H79.js";
|
|
11
|
+
import { c as j } from "../../../utils-Dy2WjYNJ.js";
|
|
12
|
+
var E, b = "HoverCard", [_, ve] = k(b, [
|
|
13
|
+
T
|
|
14
|
+
]), w = T(), [V, x] = _(b), y = (e) => {
|
|
15
|
+
const {
|
|
16
|
+
__scopeHoverCard: o,
|
|
17
|
+
children: t,
|
|
18
|
+
open: s,
|
|
19
|
+
defaultOpen: i,
|
|
20
|
+
onOpenChange: c,
|
|
21
|
+
openDelay: f = 700,
|
|
22
|
+
closeDelay: v = 300
|
|
23
|
+
} = e, d = w(o), m = n.useRef(0), u = n.useRef(0), C = n.useRef(!1), p = n.useRef(!1), [h, r] = F({
|
|
24
|
+
prop: s,
|
|
25
|
+
defaultProp: i ?? !1,
|
|
26
|
+
onChange: c,
|
|
27
|
+
caller: b
|
|
28
|
+
}), P = n.useCallback(() => {
|
|
29
|
+
clearTimeout(u.current), m.current = window.setTimeout(() => r(!0), f);
|
|
30
|
+
}, [f, r]), g = n.useCallback(() => {
|
|
31
|
+
clearTimeout(m.current), !C.current && !p.current && (u.current = window.setTimeout(() => r(!1), v));
|
|
32
|
+
}, [v, r]), M = n.useCallback(() => r(!1), [r]);
|
|
33
|
+
return n.useEffect(() => () => {
|
|
34
|
+
clearTimeout(m.current), clearTimeout(u.current);
|
|
35
|
+
}, []), /* @__PURE__ */ a(
|
|
36
|
+
V,
|
|
37
|
+
{
|
|
38
|
+
scope: o,
|
|
39
|
+
open: h,
|
|
40
|
+
onOpenChange: r,
|
|
41
|
+
onOpen: P,
|
|
42
|
+
onClose: g,
|
|
43
|
+
onDismiss: M,
|
|
44
|
+
hasSelectionRef: C,
|
|
45
|
+
isPointerDownOnContentRef: p,
|
|
46
|
+
children: /* @__PURE__ */ a(U, { ...d, children: t })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
y.displayName = b;
|
|
51
|
+
var N = "HoverCardTrigger", D = n.forwardRef(
|
|
52
|
+
(e, o) => {
|
|
53
|
+
const { __scopeHoverCard: t, ...s } = e, i = x(N, t), c = w(t);
|
|
54
|
+
return /* @__PURE__ */ a($, { asChild: !0, ...c, children: /* @__PURE__ */ a(
|
|
55
|
+
K.a,
|
|
56
|
+
{
|
|
57
|
+
"data-state": i.open ? "open" : "closed",
|
|
58
|
+
...s,
|
|
59
|
+
ref: o,
|
|
60
|
+
onPointerEnter: l(e.onPointerEnter, S(i.onOpen)),
|
|
61
|
+
onPointerLeave: l(e.onPointerLeave, S(i.onClose)),
|
|
62
|
+
onFocus: l(e.onFocus, i.onOpen),
|
|
63
|
+
onBlur: l(e.onBlur, i.onClose),
|
|
64
|
+
onTouchStart: l(e.onTouchStart, (f) => f.preventDefault())
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
D.displayName = N;
|
|
70
|
+
var H = "HoverCardPortal", [q, J] = _(H, {
|
|
71
|
+
forceMount: void 0
|
|
72
|
+
}), A = (e) => {
|
|
73
|
+
const { __scopeHoverCard: o, forceMount: t, children: s, container: i } = e, c = x(H, o);
|
|
74
|
+
return /* @__PURE__ */ a(q, { scope: o, forceMount: t, children: /* @__PURE__ */ a(O, { present: t || c.open, children: /* @__PURE__ */ a(B, { asChild: !0, container: i, children: s }) }) });
|
|
75
|
+
};
|
|
76
|
+
A.displayName = H;
|
|
77
|
+
var R = "HoverCardContent", L = n.forwardRef(
|
|
78
|
+
(e, o) => {
|
|
79
|
+
const t = J(R, e.__scopeHoverCard), { forceMount: s = t.forceMount, ...i } = e, c = x(R, e.__scopeHoverCard);
|
|
80
|
+
return /* @__PURE__ */ a(O, { present: s || c.open, children: /* @__PURE__ */ a(
|
|
81
|
+
Q,
|
|
82
|
+
{
|
|
83
|
+
"data-state": c.open ? "open" : "closed",
|
|
84
|
+
...i,
|
|
85
|
+
onPointerEnter: l(e.onPointerEnter, S(c.onOpen)),
|
|
86
|
+
onPointerLeave: l(e.onPointerLeave, S(c.onClose)),
|
|
87
|
+
ref: o
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
L.displayName = R;
|
|
93
|
+
var Q = n.forwardRef((e, o) => {
|
|
94
|
+
const {
|
|
95
|
+
__scopeHoverCard: t,
|
|
96
|
+
onEscapeKeyDown: s,
|
|
97
|
+
onPointerDownOutside: i,
|
|
98
|
+
onFocusOutside: c,
|
|
99
|
+
onInteractOutside: f,
|
|
100
|
+
...v
|
|
101
|
+
} = e, d = x(R, t), m = w(t), u = n.useRef(null), C = I(o, u), [p, h] = n.useState(!1);
|
|
102
|
+
return n.useEffect(() => {
|
|
103
|
+
if (p) {
|
|
104
|
+
const r = document.body;
|
|
105
|
+
return E = r.style.userSelect || r.style.webkitUserSelect, r.style.userSelect = "none", r.style.webkitUserSelect = "none", () => {
|
|
106
|
+
r.style.userSelect = E, r.style.webkitUserSelect = E;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}, [p]), n.useEffect(() => {
|
|
110
|
+
if (u.current) {
|
|
111
|
+
const r = () => {
|
|
112
|
+
h(!1), d.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
113
|
+
var g;
|
|
114
|
+
((g = document.getSelection()) == null ? void 0 : g.toString()) !== "" && (d.hasSelectionRef.current = !0);
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
return document.addEventListener("pointerup", r), () => {
|
|
118
|
+
document.removeEventListener("pointerup", r), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !1;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}, [d.isPointerDownOnContentRef, d.hasSelectionRef]), n.useEffect(() => {
|
|
122
|
+
u.current && Z(u.current).forEach((P) => P.setAttribute("tabindex", "-1"));
|
|
123
|
+
}), /* @__PURE__ */ a(
|
|
124
|
+
G,
|
|
125
|
+
{
|
|
126
|
+
asChild: !0,
|
|
127
|
+
disableOutsidePointerEvents: !1,
|
|
128
|
+
onInteractOutside: f,
|
|
129
|
+
onEscapeKeyDown: s,
|
|
130
|
+
onPointerDownOutside: i,
|
|
131
|
+
onFocusOutside: l(c, (r) => {
|
|
132
|
+
r.preventDefault();
|
|
133
|
+
}),
|
|
134
|
+
onDismiss: d.onDismiss,
|
|
135
|
+
children: /* @__PURE__ */ a(
|
|
136
|
+
W,
|
|
137
|
+
{
|
|
138
|
+
...m,
|
|
139
|
+
...v,
|
|
140
|
+
onPointerDown: l(v.onPointerDown, (r) => {
|
|
141
|
+
r.currentTarget.contains(r.target) && h(!0), d.hasSelectionRef.current = !1, d.isPointerDownOnContentRef.current = !0;
|
|
142
|
+
}),
|
|
143
|
+
ref: C,
|
|
144
|
+
style: {
|
|
145
|
+
...v.style,
|
|
146
|
+
userSelect: p ? "text" : void 0,
|
|
147
|
+
// Safari requires prefix
|
|
148
|
+
WebkitUserSelect: p ? "text" : void 0,
|
|
149
|
+
"--radix-hover-card-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
150
|
+
"--radix-hover-card-content-available-width": "var(--radix-popper-available-width)",
|
|
151
|
+
"--radix-hover-card-content-available-height": "var(--radix-popper-available-height)",
|
|
152
|
+
"--radix-hover-card-trigger-width": "var(--radix-popper-anchor-width)",
|
|
153
|
+
"--radix-hover-card-trigger-height": "var(--radix-popper-anchor-height)"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}), X = "HoverCardArrow", Y = n.forwardRef(
|
|
160
|
+
(e, o) => {
|
|
161
|
+
const { __scopeHoverCard: t, ...s } = e, i = w(t);
|
|
162
|
+
return /* @__PURE__ */ a(z, { ...i, ...s, ref: o });
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
Y.displayName = X;
|
|
166
|
+
function S(e) {
|
|
167
|
+
return (o) => o.pointerType === "touch" ? void 0 : e();
|
|
168
|
+
}
|
|
169
|
+
function Z(e) {
|
|
170
|
+
const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
171
|
+
acceptNode: (s) => s.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
172
|
+
});
|
|
173
|
+
for (; t.nextNode(); ) o.push(t.currentNode);
|
|
174
|
+
return o;
|
|
175
|
+
}
|
|
176
|
+
var ee = y, re = D, oe = A, te = L;
|
|
177
|
+
function me({
|
|
178
|
+
...e
|
|
179
|
+
}) {
|
|
180
|
+
return /* @__PURE__ */ a(ee, { "data-slot": "hover-card", ...e });
|
|
181
|
+
}
|
|
182
|
+
function Ce({
|
|
183
|
+
...e
|
|
184
|
+
}) {
|
|
185
|
+
return /* @__PURE__ */ a(re, { "data-slot": "hover-card-trigger", ...e });
|
|
186
|
+
}
|
|
187
|
+
function he({
|
|
188
|
+
className: e,
|
|
189
|
+
align: o = "center",
|
|
190
|
+
sideOffset: t = 4,
|
|
191
|
+
...s
|
|
192
|
+
}) {
|
|
193
|
+
return /* @__PURE__ */ a(oe, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ a(
|
|
194
|
+
te,
|
|
195
|
+
{
|
|
196
|
+
align: o,
|
|
197
|
+
className: j(
|
|
198
|
+
"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 bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
199
|
+
e
|
|
200
|
+
),
|
|
201
|
+
"data-slot": "hover-card-content",
|
|
202
|
+
sideOffset: t,
|
|
203
|
+
...s
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
206
|
+
}
|
|
207
|
+
export {
|
|
208
|
+
me as HoverCard,
|
|
209
|
+
he as HoverCardContent,
|
|
210
|
+
Ce as HoverCardTrigger
|
|
211
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export * from './accordion';
|
|
2
|
+
export * from './alert';
|
|
3
|
+
export * from './avatar';
|
|
4
|
+
export * from './badge';
|
|
5
|
+
export * from './breadcrumb';
|
|
6
|
+
export * from './button';
|
|
7
|
+
export * from './card';
|
|
8
|
+
export * from './chart';
|
|
9
|
+
export * from './collapsible';
|
|
10
|
+
export * from './command';
|
|
11
|
+
export * from './dialog';
|
|
12
|
+
export * from './dropdown-menu';
|
|
13
|
+
export * from './form';
|
|
14
|
+
export * from './hover-card';
|
|
15
|
+
export * from './input';
|
|
16
|
+
export * from './label';
|
|
17
|
+
export * from './popover';
|
|
18
|
+
export * from './progress';
|
|
19
|
+
export * from './resizable';
|
|
20
|
+
export * from './scroll-area';
|
|
21
|
+
export * from './select';
|
|
22
|
+
export * from './separator';
|
|
23
|
+
export * from './sheet';
|
|
24
|
+
export * from './sidebar';
|
|
25
|
+
export * from './skeleton';
|
|
26
|
+
export * from './slider';
|
|
27
|
+
export * from './sonner';
|
|
28
|
+
export * from './switch';
|
|
29
|
+
export * from './table';
|
|
30
|
+
export * from './tabs';
|
|
31
|
+
export * from './textarea';
|
|
32
|
+
export * from './toggle';
|
|
33
|
+
export * from './tooltip';
|