@arcadeai/design-system 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/{check-CxcShTlQ.js → check-B5h1DvDs.js} +2 -2
  3. package/dist/{chevron-down-D_a-ccxi.js → chevron-down-DmZMdOiC.js} +2 -2
  4. package/dist/{chevron-right-DriXIqe5.js → chevron-right-BYYHEJjK.js} +2 -2
  5. package/dist/components/ui/atoms/accordion.js +70 -74
  6. package/dist/components/ui/atoms/alert.js +2 -2
  7. package/dist/components/ui/atoms/avatar.js +5 -5
  8. package/dist/components/ui/atoms/badge.js +3 -3
  9. package/dist/components/ui/atoms/breadcrumb.js +5 -5
  10. package/dist/components/ui/atoms/button.js +3 -3
  11. package/dist/components/ui/atoms/card.js +1 -1
  12. package/dist/components/ui/atoms/chart.js +3247 -3228
  13. package/dist/components/ui/atoms/collapsible.js +1 -1
  14. package/dist/components/ui/atoms/command.js +15 -15
  15. package/dist/components/ui/atoms/dialog.js +2 -2
  16. package/dist/components/ui/atoms/dropdown-menu.js +367 -384
  17. package/dist/components/ui/atoms/form.d.ts +1 -1
  18. package/dist/components/ui/atoms/form.js +182 -199
  19. package/dist/components/ui/atoms/hover-card.js +40 -41
  20. package/dist/components/ui/atoms/input.js +1 -1
  21. package/dist/components/ui/atoms/label.js +18 -19
  22. package/dist/components/ui/atoms/popover.js +107 -110
  23. package/dist/components/ui/atoms/progress.js +3 -3
  24. package/dist/components/ui/atoms/resizable.js +8 -8
  25. package/dist/components/ui/atoms/scroll-area.js +82 -84
  26. package/dist/components/ui/atoms/select.js +393 -407
  27. package/dist/components/ui/atoms/separator.js +2 -2
  28. package/dist/components/ui/atoms/sheet.js +2 -2
  29. package/dist/components/ui/atoms/sidebar.js +17 -17
  30. package/dist/components/ui/atoms/skeleton.js +1 -1
  31. package/dist/components/ui/atoms/slider.js +213 -214
  32. package/dist/components/ui/atoms/sonner.js +28 -28
  33. package/dist/components/ui/atoms/switch.js +7 -7
  34. package/dist/components/ui/atoms/table.js +1 -1
  35. package/dist/components/ui/atoms/tabs.js +8 -8
  36. package/dist/components/ui/atoms/textarea.js +1 -1
  37. package/dist/components/ui/atoms/toggle.js +5 -5
  38. package/dist/components/ui/atoms/tooltip.js +103 -104
  39. package/dist/{createLucideIcon-B6fy1GTR.js → createLucideIcon-XRdN60yz.js} +4 -4
  40. package/dist/index-0ioNhtNM.js +10 -0
  41. package/dist/index-437EL2iq.js +52 -0
  42. package/dist/{index-CB1Wkg0G.js → index-5Bhkapwi.js} +2 -3
  43. package/dist/index-B695uy69.js +9 -0
  44. package/dist/{index-CHDs-SiB.js → index-BGQepRFJ.js} +1 -1
  45. package/dist/{index-BAhNQL1u.js → index-BvWMjxZ5.js} +22 -23
  46. package/dist/index-C8_QusYl.js +70 -0
  47. package/dist/index-CCKe-Mpx.js +6 -0
  48. package/dist/{index-DdnpnyX2.js → index-CQhYMnjT.js} +4 -4
  49. package/dist/{index-C9KW2H79.js → index-CpDnqHCm.js} +1 -1
  50. package/dist/{index-CxK6rt_N.js → index-CtSXVDca.js} +8 -8
  51. package/dist/{index-umR1UobZ.js → index-Cv867SGx.js} +1 -1
  52. package/dist/{index-CuMpq4Un.js → index-CxO14pcK.js} +2 -2
  53. package/dist/index-DFZozV_h.js +68 -0
  54. package/dist/index-DLfXSskr.js +255 -0
  55. package/dist/{index-D2uXV4lz.js → index-DMCYNwtg.js} +8 -8
  56. package/dist/index-DYHsXnnS.js +144 -0
  57. package/dist/{index-nluJZSbA.js → index-DfNPZZ8M.js} +1 -1
  58. package/dist/{index-Dy7YuPrV.js → index-f0YS5Ufh.js} +319 -321
  59. package/dist/lib/utils.js +1 -1
  60. package/dist/{utils-Dy2WjYNJ.js → utils-CRiPKpXj.js} +41 -42
  61. package/package.json +33 -26
  62. package/dist/index-CL4N9wMT.js +0 -259
  63. package/dist/index-DLeNytVF.js +0 -9
  64. package/dist/index-DYfkNB0n.js +0 -54
  65. package/dist/index-DuekHEmj.js +0 -6
  66. package/dist/index-DwYXX2sM.js +0 -13
  67. package/dist/index-QMp1pYFl.js +0 -145
  68. package/dist/index-UFb2E87s.js +0 -70
  69. package/dist/index-p7nYL7BU.js +0 -71
@@ -2,7 +2,7 @@ import { Slot } from '@radix-ui/react-slot';
2
2
  import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
3
3
  import type * as LabelPrimitive from '@radix-ui/react-label';
4
4
  import * as React from 'react';
5
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
5
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
6
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
7
  declare const useFormField: () => {
8
8
  invalid: boolean;
@@ -1,92 +1,77 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { S as N } from "../../../index-CB1Wkg0G.js";
3
- import * as p from "react";
4
- import a from "react";
5
- import { Label as U } from "./label.js";
6
- import { c as h } from "../../../utils-Dy2WjYNJ.js";
7
- var $ = (e) => e.type === "checkbox", T = (e) => e instanceof Date, E = (e) => e == null;
8
- const W = (e) => typeof e == "object";
9
- var _ = (e) => !E(e) && !Array.isArray(e) && W(e) && !T(e), H = (e) => _(e) && e.target ? $(e.target) ? e.target.checked : e.target.value : e, G = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, K = (e, r) => e.has(G(r)), q = (e) => {
10
- const r = e.constructor && e.constructor.prototype;
11
- return _(r) && r.hasOwnProperty("isPrototypeOf");
12
- }, z = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
13
- function I(e) {
14
- let r;
15
- const t = Array.isArray(e), o = typeof FileList < "u" ? e instanceof FileList : !1;
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { S as W } from "../../../index-5Bhkapwi.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-CRiPKpXj.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
16
  if (e instanceof Date)
17
- r = new Date(e);
18
- else if (e instanceof Set)
19
- r = new Set(e);
20
- else if (!(z && (e instanceof Blob || o)) && (t || _(e)))
21
- if (r = t ? [] : {}, !t && !q(e))
22
- r = e;
17
+ o = new Date(e);
18
+ else if (!(Y && (e instanceof Blob || s)) && (t || b(e)))
19
+ if (o = t ? [] : {}, !t && !X(e))
20
+ o = e;
23
21
  else
24
- for (const s in e)
25
- e.hasOwnProperty(s) && (r[s] = I(e[s]));
22
+ for (const r in e)
23
+ e.hasOwnProperty(r) && (o[r] = L(e[r]));
26
24
  else
27
25
  return e;
28
- return r;
26
+ return o;
29
27
  }
30
- var w = (e) => Array.isArray(e) ? e.filter(Boolean) : [], S = (e) => e === void 0, c = (e, r, t) => {
31
- if (!r || !_(e))
28
+ 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) => {
29
+ if (!o || !b(e))
32
30
  return t;
33
- const o = w(r.split(/[,[\].]+?/)).reduce((s, n) => E(s) ? s : s[n], e);
34
- return S(o) || o === e ? S(e[r]) ? t : e[r] : o;
35
- }, C = (e) => typeof e == "boolean", J = (e) => /^\w*$/.test(e), Q = (e) => w(e.replace(/["|']|\]/g, "").split(/\.|\[/)), A = (e, r, t) => {
36
- let o = -1;
37
- const s = J(r) ? [r] : Q(r), n = s.length, u = n - 1;
38
- for (; ++o < n; ) {
39
- const l = s[o];
40
- let i = t;
41
- if (o !== u) {
42
- const d = e[l];
43
- i = _(d) || Array.isArray(d) ? d : isNaN(+s[o + 1]) ? {} : [];
31
+ const s = (M(o) ? [o] : B(o)).reduce((r, n) => O(r) ? r : r[n], e);
32
+ return V(s) || s === e ? V(e[o]) ? t : e[o] : s;
33
+ }, C = (e) => typeof e == "boolean", P = (e, o, t) => {
34
+ let s = -1;
35
+ const r = M(o) ? [o] : B(o), n = r.length, l = n - 1;
36
+ for (; ++s < n; ) {
37
+ const u = r[s];
38
+ let a = t;
39
+ if (s !== l) {
40
+ const f = e[u];
41
+ a = b(f) || Array.isArray(f) ? f : isNaN(+r[s + 1]) ? {} : [];
44
42
  }
45
- if (l === "__proto__" || l === "constructor" || l === "prototype")
43
+ if (u === "__proto__" || u === "constructor" || u === "prototype")
46
44
  return;
47
- e[l] = i, e = e[l];
45
+ e[u] = a, e = e[u];
48
46
  }
49
- return e;
50
47
  };
51
- const O = {
48
+ const k = {
52
49
  BLUR: "blur",
53
50
  CHANGE: "change"
54
- }, P = {
51
+ }, D = {
55
52
  all: "all"
56
- }, j = a.createContext(null), v = () => a.useContext(j), X = (e) => {
57
- const { children: r, ...t } = e;
58
- return a.createElement(j.Provider, { value: t }, r);
53
+ }, I = i.createContext(null);
54
+ I.displayName = "HookFormContext";
55
+ const v = () => i.useContext(I), ee = (e) => {
56
+ const { children: o, ...t } = e;
57
+ return i.createElement(I.Provider, { value: t }, o);
59
58
  };
60
- var Y = (e, r, t, o = !0) => {
61
- const s = {
62
- defaultValues: r._defaultValues
59
+ var te = (e, o, t, s = !0) => {
60
+ const r = {
61
+ defaultValues: o._defaultValues
63
62
  };
64
63
  for (const n in e)
65
- Object.defineProperty(s, n, {
64
+ Object.defineProperty(r, n, {
66
65
  get: () => {
67
- const u = n;
68
- return r._proxyFormState[u] !== P.all && (r._proxyFormState[u] = !o || P.all), t && (t[u] = !0), e[u];
66
+ const l = n;
67
+ return o._proxyFormState[l] !== D.all && (o._proxyFormState[l] = !s || D.all), t && (t[l] = !0), e[l];
69
68
  }
70
69
  });
71
- return s;
72
- }, Z = (e) => _(e) && !Object.keys(e).length, ee = (e, r, t, o) => {
73
- t(e);
74
- const { name: s, ...n } = e;
75
- return Z(n) || Object.keys(n).length >= Object.keys(r).length || Object.keys(n).find((u) => r[u] === !0);
76
- }, te = (e) => Array.isArray(e) ? e : [e], k = (e, r, t) => !e || !r || e === r || te(e).some((o) => o && (t ? o === r : o.startsWith(r) || r.startsWith(o)));
77
- function D(e) {
78
- const r = a.useRef(e);
79
- r.current = e, a.useEffect(() => {
80
- const t = !e.disabled && r.current.subject && r.current.subject.subscribe({
81
- next: r.current.next
82
- });
83
- return () => {
84
- t && t.unsubscribe();
85
- };
86
- }, [e.disabled]);
87
- }
88
- function R(e) {
89
- const r = v(), { control: t = r.control, disabled: o, name: s, exact: n } = e || {}, [u, l] = a.useState(t._formState), i = a.useRef(!0), d = a.useRef({
70
+ return r;
71
+ };
72
+ const R = typeof window < "u" ? y.useLayoutEffect : y.useEffect;
73
+ function U(e) {
74
+ const o = v(), { control: t = o.control, disabled: s, name: r, exact: n } = e || {}, [l, u] = i.useState(t._formState), a = i.useRef({
90
75
  isDirty: !1,
91
76
  isLoading: !1,
92
77
  dirtyFields: !1,
@@ -95,218 +80,216 @@ function R(e) {
95
80
  isValidating: !1,
96
81
  isValid: !1,
97
82
  errors: !1
98
- }), m = a.useRef(s);
99
- return m.current = s, D({
100
- disabled: o,
101
- next: (b) => i.current && k(m.current, b.name, n) && ee(b, d.current, t._updateFormState) && l({
102
- ...t._formState,
103
- ...b
104
- }),
105
- subject: t._subjects.state
106
- }), a.useEffect(() => (i.current = !0, d.current.isValid && t._updateValid(!0), () => {
107
- i.current = !1;
108
- }), [t]), a.useMemo(() => Y(u, t, d.current, !1), [u, t]);
109
- }
110
- var re = (e) => typeof e == "string", se = (e, r, t, o, s) => re(e) ? c(t, e, s) : Array.isArray(e) ? e.map((n) => c(t, n)) : t;
111
- function oe(e) {
112
- const r = v(), { control: t = r.control, name: o, defaultValue: s, disabled: n, exact: u } = e || {}, l = a.useRef(o);
113
- l.current = o, D({
114
- disabled: n,
115
- subject: t._subjects.values,
116
- next: (m) => {
117
- k(l.current, m.name, u) && d(I(se(l.current, t._names, m.values || t._formValues, !1, s)));
118
- }
119
83
  });
120
- const [i, d] = a.useState(t._getWatch(o, s));
121
- return a.useEffect(() => t._removeUnmounted()), i;
84
+ return R(() => t._subscribe({
85
+ name: r,
86
+ formState: a.current,
87
+ exact: n,
88
+ callback: (f) => {
89
+ !s && u({
90
+ ...t._formState,
91
+ ...f
92
+ });
93
+ }
94
+ }), [r, s, n]), i.useEffect(() => {
95
+ a.current.isValid && t._setValid(!0);
96
+ }, [t]), i.useMemo(() => te(l, t, a.current, !1), [l, t]);
97
+ }
98
+ 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;
99
+ function se(e) {
100
+ 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));
101
+ return R(() => t._subscribe({
102
+ name: s,
103
+ formState: {
104
+ values: !0
105
+ },
106
+ exact: l,
107
+ callback: (F) => !n && f(oe(s, t._names, F.values || t._formValues, !1, u.current))
108
+ }), [s, t, n, l]), i.useEffect(() => t._removeUnmounted()), a;
122
109
  }
123
110
  function ne(e) {
124
- const r = v(), { name: t, disabled: o, control: s = r.control, shouldUnregister: n } = e, u = K(s._names.array, t), l = oe({
125
- control: s,
111
+ const o = v(), { name: t, disabled: s, control: r = o.control, shouldUnregister: n } = e, l = Q(r._names.array, t), u = se({
112
+ control: r,
126
113
  name: t,
127
- defaultValue: c(s._formValues, t, c(s._defaultValues, t, e.defaultValue)),
114
+ defaultValue: c(r._formValues, t, c(r._defaultValues, t, e.defaultValue)),
128
115
  exact: !0
129
- }), i = R({
130
- control: s,
116
+ }), a = U({
117
+ control: r,
131
118
  name: t,
132
119
  exact: !0
133
- }), d = a.useRef(s.register(t, {
120
+ }), f = i.useRef(e), F = i.useRef(r.register(t, {
134
121
  ...e.rules,
135
- value: l,
122
+ value: u,
136
123
  ...C(e.disabled) ? { disabled: e.disabled } : {}
137
- })), m = a.useMemo(() => Object.defineProperties({}, {
124
+ })), S = i.useMemo(() => Object.defineProperties({}, {
138
125
  invalid: {
139
126
  enumerable: !0,
140
- get: () => !!c(i.errors, t)
127
+ get: () => !!c(a.errors, t)
141
128
  },
142
129
  isDirty: {
143
130
  enumerable: !0,
144
- get: () => !!c(i.dirtyFields, t)
131
+ get: () => !!c(a.dirtyFields, t)
145
132
  },
146
133
  isTouched: {
147
134
  enumerable: !0,
148
- get: () => !!c(i.touchedFields, t)
135
+ get: () => !!c(a.touchedFields, t)
149
136
  },
150
137
  isValidating: {
151
138
  enumerable: !0,
152
- get: () => !!c(i.validatingFields, t)
139
+ get: () => !!c(a.validatingFields, t)
153
140
  },
154
141
  error: {
155
142
  enumerable: !0,
156
- get: () => c(i.errors, t)
143
+ get: () => c(a.errors, t)
157
144
  }
158
- }), [i, t]), b = a.useMemo(() => ({
145
+ }), [a, t]), A = i.useCallback((d) => F.current.onChange({
146
+ target: {
147
+ value: z(d),
148
+ name: t
149
+ },
150
+ type: k.CHANGE
151
+ }), [t]), E = i.useCallback(() => F.current.onBlur({
152
+ target: {
153
+ value: c(r._formValues, t),
154
+ name: t
155
+ },
156
+ type: k.BLUR
157
+ }), [t, r._formValues]), w = i.useCallback((d) => {
158
+ const _ = c(r._fields, t);
159
+ _ && d && (_._f.ref = {
160
+ focus: () => d.focus && d.focus(),
161
+ select: () => d.select && d.select(),
162
+ setCustomValidity: (g) => d.setCustomValidity(g),
163
+ reportValidity: () => d.reportValidity()
164
+ });
165
+ }, [r._fields, t]), N = i.useMemo(() => ({
159
166
  name: t,
160
- value: l,
161
- ...C(o) || i.disabled ? { disabled: i.disabled || o } : {},
162
- onChange: (f) => d.current.onChange({
163
- target: {
164
- value: H(f),
165
- name: t
166
- },
167
- type: O.CHANGE
168
- }),
169
- onBlur: () => d.current.onBlur({
170
- target: {
171
- value: c(s._formValues, t),
172
- name: t
173
- },
174
- type: O.BLUR
175
- }),
176
- ref: (f) => {
177
- const F = c(s._fields, t);
178
- F && f && (F._f.ref = {
179
- focus: () => f.focus(),
180
- select: () => f.select(),
181
- setCustomValidity: (g) => f.setCustomValidity(g),
182
- reportValidity: () => f.reportValidity()
183
- });
184
- }
185
- }), [
186
- t,
187
- s._formValues,
188
- o,
189
- i.disabled,
190
- l,
191
- s._fields
192
- ]);
193
- return a.useEffect(() => {
194
- const f = s._options.shouldUnregister || n, F = (g, B) => {
195
- const V = c(s._fields, g);
196
- V && V._f && (V._f.mount = B);
167
+ value: u,
168
+ ...C(s) || a.disabled ? { disabled: a.disabled || s } : {},
169
+ onChange: A,
170
+ onBlur: E,
171
+ ref: w
172
+ }), [t, s, a.disabled, A, E, w, u]);
173
+ return i.useEffect(() => {
174
+ const d = r._options.shouldUnregister || n;
175
+ r.register(t, {
176
+ ...f.current.rules,
177
+ ...C(f.current.disabled) ? { disabled: f.current.disabled } : {}
178
+ });
179
+ const _ = (g, H) => {
180
+ const h = c(r._fields, g);
181
+ h && h._f && (h._f.mount = H);
197
182
  };
198
- if (F(t, !0), f) {
199
- const g = I(c(s._options.defaultValues, t));
200
- A(s._defaultValues, t, g), S(c(s._formValues, t)) && A(s._formValues, t, g);
183
+ if (_(t, !0), d) {
184
+ const g = L(c(r._options.defaultValues, t));
185
+ P(r._defaultValues, t, g), V(c(r._formValues, t)) && P(r._formValues, t, g);
201
186
  }
202
- return () => {
203
- (u ? f && !s._state.action : f) ? s.unregister(t) : F(t, !1);
187
+ return !l && r.register(t), () => {
188
+ (l ? d && !r._state.action : d) ? r.unregister(t) : _(t, !1);
204
189
  };
205
- }, [t, s, u, n]), a.useEffect(() => {
206
- C(o) && c(s._fields, t) && s._updateDisabledField({
207
- disabled: o,
208
- fields: s._fields,
209
- name: t,
210
- value: c(s._fields, t)._f.value
190
+ }, [t, r, l, n]), i.useEffect(() => {
191
+ r._setDisabledField({
192
+ disabled: s,
193
+ name: t
211
194
  });
212
- }, [o, t, s]), a.useMemo(() => ({
213
- field: b,
214
- formState: i,
215
- fieldState: m
216
- }), [b, i, m]);
195
+ }, [s, t, r]), i.useMemo(() => ({
196
+ field: N,
197
+ formState: a,
198
+ fieldState: S
199
+ }), [N, a, S]);
217
200
  }
218
- const ie = (e) => e.render(ne(e)), fe = X, M = p.createContext(
201
+ const ae = (e) => e.render(ne(e)), fe = ee, $ = y.createContext(
219
202
  {}
220
203
  ), me = ({
221
204
  ...e
222
- }) => /* @__PURE__ */ y(M.Provider, { value: { name: e.name }, children: /* @__PURE__ */ y(ie, { ...e }) }), x = () => {
223
- const e = p.useContext(M), r = p.useContext(L), { getFieldState: t } = v(), o = R({ name: e.name }), s = t(e.name, o);
205
+ }) => /* @__PURE__ */ m($.Provider, { value: { name: e.name }, children: /* @__PURE__ */ m(ae, { ...e }) }), x = () => {
206
+ const e = y.useContext($), o = y.useContext(T), { getFieldState: t } = v(), s = U({ name: e.name }), r = t(e.name, s);
224
207
  if (!e)
225
208
  throw new Error("useFormField should be used within <FormField>");
226
- const { id: n } = r;
209
+ const { id: n } = o;
227
210
  return {
228
211
  id: n,
229
212
  name: e.name,
230
213
  formItemId: `${n}-form-item`,
231
214
  formDescriptionId: `${n}-form-item-description`,
232
215
  formMessageId: `${n}-form-item-message`,
233
- ...s
216
+ ...r
234
217
  };
235
- }, L = p.createContext(
218
+ }, T = y.createContext(
236
219
  {}
237
220
  );
238
- function ye({ className: e, ...r }) {
239
- const t = p.useId();
240
- return /* @__PURE__ */ y(L.Provider, { value: { id: t }, children: /* @__PURE__ */ y(
221
+ function ye({ className: e, ...o }) {
222
+ const t = y.useId();
223
+ return /* @__PURE__ */ m(T.Provider, { value: { id: t }, children: /* @__PURE__ */ m(
241
224
  "div",
242
225
  {
243
- className: h("grid gap-2", e),
226
+ className: p("grid gap-2", e),
244
227
  "data-slot": "form-item",
245
- ...r
228
+ ...o
246
229
  }
247
230
  ) });
248
231
  }
249
- function be({
232
+ function ge({
250
233
  className: e,
251
- ...r
234
+ ...o
252
235
  }) {
253
- const { error: t, formItemId: o } = x();
254
- return /* @__PURE__ */ y(
255
- U,
236
+ const { error: t, formItemId: s } = x();
237
+ return /* @__PURE__ */ m(
238
+ G,
256
239
  {
257
- className: h("data-[error=true]:text-destructive", e),
240
+ className: p("data-[error=true]:text-destructive", e),
258
241
  "data-error": !!t,
259
242
  "data-slot": "form-label",
260
- htmlFor: o,
261
- ...r
243
+ htmlFor: s,
244
+ ...o
262
245
  }
263
246
  );
264
247
  }
265
- function ge({ ...e }) {
266
- const { error: r, formItemId: t, formDescriptionId: o, formMessageId: s } = x();
267
- return /* @__PURE__ */ y(
268
- N,
248
+ function _e({ ...e }) {
249
+ const { error: o, formItemId: t, formDescriptionId: s, formMessageId: r } = x();
250
+ return /* @__PURE__ */ m(
251
+ W,
269
252
  {
270
- "aria-describedby": r ? `${o} ${s}` : `${o}`,
271
- "aria-invalid": !!r,
253
+ "aria-describedby": o ? `${s} ${r}` : `${s}`,
254
+ "aria-invalid": !!o,
272
255
  "data-slot": "form-control",
273
256
  id: t,
274
257
  ...e
275
258
  }
276
259
  );
277
260
  }
278
- function _e({ className: e, ...r }) {
261
+ function be({ className: e, ...o }) {
279
262
  const { formDescriptionId: t } = x();
280
- return /* @__PURE__ */ y(
263
+ return /* @__PURE__ */ m(
281
264
  "p",
282
265
  {
283
- className: h("text-muted-foreground text-sm", e),
266
+ className: p("text-muted-foreground text-sm", e),
284
267
  "data-slot": "form-description",
285
268
  id: t,
286
- ...r
269
+ ...o
287
270
  }
288
271
  );
289
272
  }
290
- function Fe({ className: e, ...r }) {
291
- const { error: t, formMessageId: o } = x(), s = t ? String((t == null ? void 0 : t.message) ?? "") : r.children;
292
- return s ? /* @__PURE__ */ y(
273
+ function Fe({ className: e, ...o }) {
274
+ const { error: t, formMessageId: s } = x(), r = t ? String(t?.message ?? "") : o.children;
275
+ return r ? /* @__PURE__ */ m(
293
276
  "p",
294
277
  {
295
- className: h("text-destructive text-sm", e),
278
+ className: p("text-destructive text-sm", e),
296
279
  "data-slot": "form-message",
297
- id: o,
298
- ...r,
299
- children: s
280
+ id: s,
281
+ ...o,
282
+ children: r
300
283
  }
301
284
  ) : null;
302
285
  }
303
286
  export {
304
287
  fe as Form,
305
- ge as FormControl,
306
- _e as FormDescription,
288
+ _e as FormControl,
289
+ be as FormDescription,
307
290
  me as FormField,
308
291
  ye as FormItem,
309
- be as FormLabel,
292
+ ge as FormLabel,
310
293
  Fe as FormMessage,
311
294
  v as useFormContext,
312
295
  x as useFormField