@reformer/ui-kit 7.0.0 → 9.0.0-beta.1

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.
@@ -1,34 +1,44 @@
1
- import { jsx as i, jsxs as x, Fragment as w } from "react/jsx-runtime";
2
- import * as B from "react";
3
- import { forwardRef as f, Children as L, isValidElement as A, cloneElement as V, useId as W, useMemo as $, createContext as E, useContext as M } from "react";
1
+ import { jsx as d, jsxs as w, Fragment as $ } from "react/jsx-runtime";
2
+ import * as L from "react";
3
+ import { useContext as x, createContext as R, forwardRef as F, Children as T, isValidElement as V, cloneElement as W, useId as M, useMemo as k } from "react";
4
4
  import { useFormControl as O } from "@reformer/core";
5
- import { Checkbox as T } from "./checkbox.js";
6
- function z(e, n) {
7
- const l = { ...e };
8
- for (const r of Object.keys(n)) {
9
- const o = e[r], t = n[r];
10
- r.startsWith("on") && typeof o == "function" && typeof t == "function" ? l[r] = (...d) => {
11
- t(...d), o(...d);
12
- } : r === "className" && typeof o == "string" && typeof t == "string" ? l[r] = [t, o].filter(Boolean).join(" ") : r === "style" && typeof o == "object" && typeof t == "object" ? l[r] = { ...t, ...o } : r === "disabled" ? l[r] = !!o || !!t : t !== void 0 && (l[r] = t);
5
+ import { Checkbox as z } from "./checkbox.js";
6
+ const G = (e) => e.message || e.code, H = R(G);
7
+ function j() {
8
+ return x(H);
9
+ }
10
+ function J(...e) {
11
+ return (l) => {
12
+ for (const o of e)
13
+ typeof o == "function" ? o(l) : o != null && (o.current = l);
14
+ };
15
+ }
16
+ function K(e, l) {
17
+ const o = { ...e };
18
+ for (const r of Object.keys(l)) {
19
+ const t = e[r], n = l[r];
20
+ r.startsWith("on") && typeof t == "function" && typeof n == "function" ? o[r] = (...i) => {
21
+ n(...i), t(...i);
22
+ } : r === "className" && typeof t == "string" && typeof n == "string" ? o[r] = [n, t].filter(Boolean).join(" ") : r === "style" && typeof t == "object" && typeof n == "object" ? o[r] = { ...n, ...t } : r === "disabled" ? o[r] = !!t || !!n : n !== void 0 && (o[r] = n);
13
23
  }
14
- return l;
24
+ return o;
15
25
  }
16
- const b = f(
17
- ({ children: e, ...n }, l) => {
18
- const r = L.only(e);
19
- if (!A(r))
26
+ const I = F(
27
+ ({ children: e, ...l }, o) => {
28
+ const r = T.only(e);
29
+ if (!V(r))
20
30
  return null;
21
- const o = r.props, t = z(n, o), d = r.ref;
22
- return V(r, {
23
- ...t,
24
- ref: l || d
31
+ const t = r.props, n = K(l, t), i = r.ref, s = J(o, i);
32
+ return W(r, {
33
+ ...n,
34
+ ref: s
25
35
  });
26
36
  }
27
37
  );
28
- b.displayName = "Slot";
29
- const k = E(null);
30
- function F() {
31
- const e = M(k);
38
+ I.displayName = "Slot";
39
+ const q = R(null);
40
+ function v() {
41
+ const e = x(q);
32
42
  if (!e)
33
43
  throw new Error(
34
44
  "FormField.* components must be used within <FormField.Root>. Wrap your field with <FormField.Root control={control}>."
@@ -37,183 +47,198 @@ function F() {
37
47
  }
38
48
  function N({
39
49
  control: e,
40
- children: n,
41
- id: l,
50
+ children: l,
51
+ id: o,
42
52
  hasDescription: r = !1
43
53
  }) {
44
- const o = W(), t = l ?? o, d = $(
54
+ const t = M(), n = o ?? t, i = k(
45
55
  () => ({
46
- controlId: `control-${t}`,
47
- labelId: `label-${t}`,
48
- descriptionId: `desc-${t}`,
49
- errorId: `error-${t}`
56
+ controlId: `control-${n}`,
57
+ labelId: `label-${n}`,
58
+ descriptionId: `desc-${n}`,
59
+ errorId: `error-${n}`
50
60
  }),
51
- [t]
52
- ), s = O(e), c = $(() => {
61
+ [n]
62
+ ), s = O(e), a = j(), p = k(() => {
53
63
  const {
54
- value: h,
55
- errors: a,
56
- pending: m,
57
- disabled: v,
64
+ value: u,
65
+ errors: m,
66
+ pending: c,
67
+ disabled: b,
58
68
  valid: y,
59
- invalid: I,
60
- touched: C,
61
- shouldShowError: g,
62
- componentProps: p
69
+ invalid: g,
70
+ touched: E,
71
+ shouldShowError: C,
72
+ componentProps: f
63
73
  } = s;
64
74
  return {
65
- value: h,
66
- errors: a,
67
- pending: m,
68
- disabled: v,
75
+ value: u,
76
+ errors: m,
77
+ pending: c,
78
+ disabled: b,
69
79
  valid: y,
70
- invalid: I,
71
- touched: C,
72
- shouldShowError: g,
73
- error: g ? a[0]?.message : void 0,
74
- label: p.label,
75
- required: !!p.required,
76
- componentProps: p,
80
+ invalid: g,
81
+ touched: E,
82
+ shouldShowError: C,
83
+ error: C && m[0] ? a(m[0]) : void 0,
84
+ label: f.label,
85
+ required: !!f.required,
86
+ componentProps: f,
77
87
  control: e,
78
- ids: d,
88
+ ids: i,
79
89
  hasDescription: r
80
90
  };
81
- }, [s, e, d, r]);
82
- return /* @__PURE__ */ i(k.Provider, { value: c, children: n });
91
+ }, [s, e, i, r, a]);
92
+ return /* @__PURE__ */ d(q.Provider, { value: p, children: l });
83
93
  }
84
94
  N.displayName = "FormField.Root";
85
- const j = f(
86
- ({ asChild: e = !1, children: n, forceRender: l = !1, ...r }, o) => {
87
- const { label: t, required: d, ids: s } = F(), c = n ?? t;
88
- return !c && !l ? null : /* @__PURE__ */ x(e ? b : "label", { ref: o, id: s.labelId, htmlFor: e ? void 0 : s.controlId, ...r, children: [
89
- c,
90
- d && /* @__PURE__ */ i("span", { "aria-hidden": "true", children: " *" })
95
+ const D = F(
96
+ ({ asChild: e = !1, children: l, forceRender: o = !1, ...r }, t) => {
97
+ const { label: n, required: i, ids: s } = v(), a = l ?? n;
98
+ return !a && !o ? null : /* @__PURE__ */ w(e ? I : "label", { ref: t, id: s.labelId, htmlFor: e ? void 0 : s.controlId, ...r, children: [
99
+ a,
100
+ i && /* @__PURE__ */ d("span", { "aria-hidden": "true", children: " *" })
91
101
  ] });
92
102
  }
93
103
  );
94
- j.displayName = "FormField.Label";
95
- const R = f(
96
- ({ asChild: e = !1, children: n, ...l }, r) => {
104
+ D.displayName = "FormField.Label";
105
+ const S = F(
106
+ ({ asChild: e = !1, children: l, ...o }, r) => {
97
107
  const {
98
- control: o,
99
- value: t,
100
- disabled: d,
108
+ control: t,
109
+ value: n,
110
+ disabled: i,
101
111
  shouldShowError: s,
102
- errors: c,
103
- required: h,
104
- ids: a,
112
+ errors: a,
113
+ required: p,
114
+ ids: u,
105
115
  hasDescription: m,
106
- componentProps: v
107
- } = F(), y = [
108
- m ? a.descriptionId : null,
109
- s && c.length > 0 ? a.errorId : null
110
- ].filter(Boolean).join(" ") || void 0, I = {
111
- id: a.controlId,
112
- "aria-labelledby": a.labelId,
116
+ componentProps: c
117
+ } = v(), b = [
118
+ m ? u.descriptionId : null,
119
+ s && a.length > 0 ? u.errorId : null
120
+ ].filter(Boolean).join(" ") || void 0, y = {
121
+ id: u.controlId,
122
+ "aria-labelledby": u.labelId,
113
123
  "aria-invalid": s ? !0 : void 0,
114
- "aria-describedby": y,
115
- "aria-errormessage": s && c.length > 0 ? a.errorId : void 0,
116
- "aria-required": h ? !0 : void 0
124
+ "aria-describedby": b,
125
+ "aria-errormessage": s && a.length > 0 ? u.errorId : void 0,
126
+ "aria-required": p ? !0 : void 0
117
127
  };
118
- if (n || e)
119
- return /* @__PURE__ */ i(b, { ref: r, ...I, ...l, children: n });
120
- const C = o.component, { testId: g, ...p } = v ?? {};
121
- return /* @__PURE__ */ i(
122
- C,
128
+ if (l || e)
129
+ return /* @__PURE__ */ d(
130
+ I,
131
+ {
132
+ ref: r,
133
+ ...y,
134
+ ...o,
135
+ value: n,
136
+ disabled: i,
137
+ onChange: (f) => t.setValue(f),
138
+ onBlur: () => t.markAsTouched(),
139
+ children: l
140
+ }
141
+ );
142
+ const g = t.component, { testId: E, ...C } = c ?? {};
143
+ return /* @__PURE__ */ d(
144
+ g,
123
145
  {
124
146
  ref: r,
125
- ...p,
126
- ...I,
127
- ...l,
128
- value: t,
129
- disabled: d,
130
- onChange: (D) => o.setValue(D),
131
- onBlur: () => o.markAsTouched()
147
+ ...C,
148
+ ...y,
149
+ ...o,
150
+ value: n,
151
+ disabled: i,
152
+ onChange: (f) => t.setValue(f),
153
+ onBlur: () => t.markAsTouched()
132
154
  }
133
155
  );
134
156
  }
135
157
  );
136
- R.displayName = "FormField.Control";
137
- const S = f(
138
- ({ asChild: e = !1, multi: n = !1, render: l, children: r, ...o }, t) => {
139
- const { shouldShowError: d, errors: s, ids: c } = F();
140
- if (!d || s.length === 0) return null;
141
- const h = e ? b : "p";
142
- return l ? /* @__PURE__ */ i(w, { children: s.map((a, m) => /* @__PURE__ */ i(
143
- h,
158
+ S.displayName = "FormField.Control";
159
+ const B = F(
160
+ ({ asChild: e = !1, multi: l = !1, render: o, children: r, ...t }, n) => {
161
+ const { shouldShowError: i, errors: s, ids: a } = v(), p = j();
162
+ if (!i || s.length === 0) return null;
163
+ const u = e ? I : "p";
164
+ return o ? /* @__PURE__ */ d($, { children: s.map((m, c) => /* @__PURE__ */ d(
165
+ u,
144
166
  {
145
- id: m === 0 ? c.errorId : void 0,
167
+ ref: c === 0 ? n : void 0,
168
+ id: c === 0 ? a.errorId : void 0,
146
169
  role: "alert",
147
- ...o,
148
- children: l(a, m)
149
- },
150
- a.code ?? m
151
- )) }) : n ? /* @__PURE__ */ i(w, { children: s.map((a, m) => /* @__PURE__ */ i(
152
- h,
153
- {
154
- id: m === 0 ? c.errorId : void 0,
155
- role: "alert",
156
- ...o,
157
- children: a.message
170
+ ...t,
171
+ children: o(m, c)
158
172
  },
159
- a.code ?? m
160
- )) }) : /* @__PURE__ */ i(h, { ref: t, id: c.errorId, role: "alert", ...o, children: r ?? s[0].message });
173
+ m.code ?? c
174
+ )) }) : l ? /* @__PURE__ */ d($, { children: s.map((m, c) => {
175
+ const b = p(m);
176
+ return /* @__PURE__ */ d(
177
+ u,
178
+ {
179
+ ref: c === 0 ? n : void 0,
180
+ id: c === 0 ? a.errorId : void 0,
181
+ role: "alert",
182
+ ...t,
183
+ children: e ? /* @__PURE__ */ d("span", { children: b }) : b
184
+ },
185
+ m.code ?? c
186
+ );
187
+ }) }) : /* @__PURE__ */ d(u, { ref: n, id: a.errorId, role: "alert", ...t, children: r ?? p(s[0]) });
161
188
  }
162
189
  );
163
- S.displayName = "FormField.Error";
164
- const q = f(
165
- ({ asChild: e = !1, children: n, ...l }, r) => {
166
- const { ids: o } = F();
167
- return /* @__PURE__ */ i(e ? b : "p", { ref: r, id: o.descriptionId, ...l, children: n });
190
+ B.displayName = "FormField.Error";
191
+ const A = F(
192
+ ({ asChild: e = !1, children: l, ...o }, r) => {
193
+ const { ids: t } = v();
194
+ return /* @__PURE__ */ d(e ? I : "p", { ref: r, id: t.descriptionId, ...o, children: l });
168
195
  }
169
196
  );
170
- q.displayName = "FormField.Description";
171
- const u = N;
172
- u.Root = N;
173
- u.Label = j;
174
- u.Control = R;
175
- u.Error = S;
176
- u.Description = q;
177
- const G = (e) => e.message || e.code;
178
- E(G);
179
- function H({
197
+ A.displayName = "FormField.Description";
198
+ const h = N;
199
+ h.Root = N;
200
+ h.Label = D;
201
+ h.Control = S;
202
+ h.Error = B;
203
+ h.Description = A;
204
+ function P({
180
205
  className: e,
181
- testIdProp: n,
182
- isCheckbox: l,
206
+ testIdProp: l,
207
+ isCheckbox: o,
183
208
  customChildren: r
184
209
  }) {
185
- const { componentProps: o, pending: t } = F(), d = n ?? o?.testId ?? "unknown";
186
- return /* @__PURE__ */ x("div", { className: e, "data-testid": `field-${d}`, children: [
187
- !l && /* @__PURE__ */ i(
188
- u.Label,
210
+ const { componentProps: t, pending: n } = v(), i = l ?? t?.testId ?? "unknown";
211
+ return /* @__PURE__ */ w("div", { className: e, "data-testid": `field-${i}`, children: [
212
+ !o && /* @__PURE__ */ d(
213
+ h.Label,
189
214
  {
190
215
  className: "block mb-1 text-sm font-medium",
191
- "data-testid": `label-${d}`
216
+ "data-testid": `label-${i}`
192
217
  }
193
218
  ),
194
- r ? /* @__PURE__ */ i(u.Control, { asChild: !0, children: r }) : /* @__PURE__ */ i(u.Control, { "data-testid": `input-${d}` }),
195
- /* @__PURE__ */ i(
196
- u.Error,
219
+ r ? /* @__PURE__ */ d(h.Control, { asChild: !0, children: r }) : /* @__PURE__ */ d(h.Control, { "data-testid": `input-${i}` }),
220
+ /* @__PURE__ */ d(
221
+ h.Error,
197
222
  {
198
223
  className: "text-destructive text-sm mt-1 block",
199
- "data-testid": `error-${d}`
224
+ "data-testid": `error-${i}`
200
225
  }
201
226
  ),
202
- t && /* @__PURE__ */ i("span", { className: "text-gray-500 text-sm mt-1 block", children: "Проверка..." })
227
+ n && /* @__PURE__ */ d("span", { role: "status", "aria-live": "polite", className: "text-gray-500 text-sm mt-1 block", children: "Проверка..." })
203
228
  ] });
204
229
  }
205
- const J = ({ control: e, className: n, testId: l, children: r }) => {
206
- const o = e.component === T;
207
- return /* @__PURE__ */ i(u.Root, { control: e, children: /* @__PURE__ */ i(
208
- H,
230
+ const Q = ({ control: e, className: l, testId: o, children: r }) => {
231
+ const t = e.component === z;
232
+ return /* @__PURE__ */ d(h.Root, { control: e, children: /* @__PURE__ */ d(
233
+ P,
209
234
  {
210
- className: n,
211
- testIdProp: l,
212
- isCheckbox: o,
235
+ className: l,
236
+ testIdProp: o,
237
+ isCheckbox: t,
213
238
  customChildren: r
214
239
  }
215
240
  ) });
216
- }, X = B.memo(J, (e, n) => e.control === n.control && e.className === n.className && e.testId === n.testId && e.children === n.children);
241
+ }, _ = L.memo(Q, (e, l) => e.control === l.control && e.className === l.className && e.testId === l.testId && e.children === l.children);
217
242
  export {
218
- X as FormField
243
+ _ as FormField
219
244
  };
package/dist/ui/input.js CHANGED
@@ -1,48 +1,77 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
- import * as u from "react";
3
- import { c as v } from "../utils-DtaLkIY8.js";
4
- const x = u.forwardRef(
5
- ({ className: l, value: i, onChange: r, onBlur: a, type: e = "text", placeholder: d, disabled: m, ...n }, c) => {
6
- const f = (p) => {
7
- const t = p.target.value;
8
- if (e === "number")
9
- if (t === "")
10
- r?.(null);
11
- else {
12
- const o = Number(t);
13
- if (!isNaN(o)) {
14
- const s = n.min !== void 0 ? Number(n.min) : void 0;
15
- s !== void 0 && s >= 0 && o < 0 ? r?.(0) : r?.(o);
16
- }
17
- }
18
- else
19
- r?.(t || null);
20
- }, b = u.useMemo(() => i == null ? "" : e === "number" && typeof i == "number" ? isNaN(i) ? "" : i.toString() : String(i), [i, e]);
21
- return /* @__PURE__ */ g(
22
- "input",
23
- {
24
- ref: c,
25
- type: e,
26
- value: b,
27
- disabled: m,
28
- placeholder: d,
29
- "data-slot": "input",
30
- className: v(
31
- "h-9 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-colors",
32
- "placeholder:text-muted-foreground",
33
- "focus-visible:outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
34
- "disabled:cursor-not-allowed disabled:opacity-50",
35
- "aria-invalid:border-destructive aria-invalid:ring-destructive/20",
36
- l
37
- ),
38
- onChange: f,
39
- onBlur: a,
40
- ...n
41
- }
42
- );
43
- }
44
- );
45
- x.displayName = "Input";
2
+ import * as a from "react";
3
+ import { c as y } from "../utils-DtaLkIY8.js";
4
+ function o(e) {
5
+ if (e === "") return { kind: "empty" };
6
+ const n = Number(e);
7
+ return Number.isNaN(n) ? { kind: "partial" } : { kind: "number", value: n };
8
+ }
9
+ function h(e, n) {
10
+ const t = o(e);
11
+ if (t.kind === "empty") return { emit: !0, value: null };
12
+ if (t.kind === "partial") return { emit: !1 };
13
+ let i = t.value;
14
+ return n !== void 0 && n >= 0 && i < 0 && (i = 0), { emit: !0, value: i };
15
+ }
16
+ function x(e, n) {
17
+ if (e !== null)
18
+ if (e === "") {
19
+ if (n == null) return "";
20
+ } else {
21
+ const t = o(e);
22
+ if (t.kind === "partial" || t.kind === "number" && typeof n == "number" && !Number.isNaN(n) && t.value === n)
23
+ return e;
24
+ }
25
+ return n == null || typeof n == "number" && Number.isNaN(n) ? "" : n.toString();
26
+ }
27
+ const k = a.forwardRef((e, n) => {
28
+ const t = e.type ?? "text", [i, s] = a.useState(null), d = (r) => {
29
+ const u = r.target.value;
30
+ if (e.type === "number") {
31
+ s(u);
32
+ const p = e.min !== void 0 ? Number(e.min) : void 0, l = h(u, p);
33
+ l.emit && e.onChange?.(l.value);
34
+ } else
35
+ e.onChange?.(u || null);
36
+ }, m = a.useMemo(() => {
37
+ if (e.type === "number")
38
+ return x(i, e.value);
39
+ const r = e.value;
40
+ return r == null ? "" : String(r);
41
+ }, [e.value, e.type, i]), {
42
+ className: c,
43
+ onBlur: b,
44
+ placeholder: f,
45
+ disabled: v,
46
+ value: C,
47
+ onChange: I,
48
+ type: R,
49
+ ...N
50
+ } = e;
51
+ return /* @__PURE__ */ g(
52
+ "input",
53
+ {
54
+ ref: n,
55
+ type: t,
56
+ value: m,
57
+ disabled: v,
58
+ placeholder: f,
59
+ "data-slot": "input",
60
+ className: y(
61
+ "h-9 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-colors",
62
+ "placeholder:text-muted-foreground",
63
+ "focus-visible:outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
64
+ "disabled:cursor-not-allowed disabled:opacity-50",
65
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20",
66
+ c
67
+ ),
68
+ onChange: d,
69
+ onBlur: b,
70
+ ...N
71
+ }
72
+ );
73
+ });
74
+ k.displayName = "Input";
46
75
  export {
47
- x as Input
76
+ k as Input
48
77
  };
@@ -1,53 +1,73 @@
1
- import { jsx as r, jsxs as f } from "react/jsx-runtime";
2
- import * as v from "react";
3
- import { c as i } from "../utils-DtaLkIY8.js";
4
- const g = v.forwardRef(
5
- ({ className: d, value: s, onChange: o, onBlur: c, options: t, disabled: u, "data-testid": a, ...m }, n) => {
6
- const p = (e) => {
7
- o?.(e.target.value);
1
+ import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { c as s } from "../utils-DtaLkIY8.js";
4
+ const y = i.forwardRef(
5
+ ({
6
+ className: d,
7
+ value: c,
8
+ onChange: t,
9
+ onBlur: n,
10
+ options: u,
11
+ disabled: m,
12
+ name: p,
13
+ id: l,
14
+ "data-testid": a,
15
+ ...g
16
+ }, f) => {
17
+ const v = i.useId(), h = p ?? l ?? a ?? v, x = (e) => {
18
+ t?.(e.target.value);
8
19
  };
9
- return /* @__PURE__ */ r(
10
- "div",
11
- {
12
- ref: n,
13
- className: i("flex flex-col gap-2", d),
14
- "data-testid": a,
15
- ...m,
16
- children: t.map((e) => {
17
- const l = a ? `${a}-${e.value}` : `radio-${e.value}`;
18
- return /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
19
- /* @__PURE__ */ r(
20
- "input",
21
- {
22
- type: "radio",
23
- id: l,
24
- value: e.value,
25
- checked: s === e.value,
26
- disabled: u,
27
- className: i(
28
- "h-4 w-4 border-gray-300 text-primary focus:ring-2 focus:ring-primary",
29
- "disabled:cursor-not-allowed disabled:opacity-50"
30
- ),
31
- onChange: p,
32
- onBlur: c,
33
- "data-testid": a ? `${a}-${e.value}` : void 0
34
- }
35
- ),
36
- /* @__PURE__ */ r(
37
- "label",
38
- {
39
- htmlFor: l,
40
- className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
41
- children: e.label
42
- }
43
- )
44
- ] }, e.value);
45
- })
46
- }
20
+ return (
21
+ // role="radiogroup" + прокинутые aria-* (aria-labelledby/aria-invalid/
22
+ // aria-describedby из FormField) делают контейнер настоящей группой для AT:
23
+ // метка ассоциируется, состояние невалидности экспонируется, навигация
24
+ // стрелками работает как по группе.
25
+ /* @__PURE__ */ r(
26
+ "div",
27
+ {
28
+ ref: f,
29
+ role: "radiogroup",
30
+ id: l,
31
+ className: s("flex flex-col gap-2", d),
32
+ "data-testid": a,
33
+ ...g,
34
+ children: u.map((e) => {
35
+ const o = a ? `${a}-${e.value}` : `radio-${e.value}`;
36
+ return /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
37
+ /* @__PURE__ */ r(
38
+ "input",
39
+ {
40
+ type: "radio",
41
+ id: o,
42
+ name: h,
43
+ value: e.value,
44
+ checked: c === e.value,
45
+ disabled: m,
46
+ className: s(
47
+ "h-4 w-4 border-gray-300 text-primary focus:ring-2 focus:ring-primary",
48
+ "disabled:cursor-not-allowed disabled:opacity-50"
49
+ ),
50
+ onChange: x,
51
+ onBlur: n,
52
+ "data-testid": a ? `${a}-${e.value}` : void 0
53
+ }
54
+ ),
55
+ /* @__PURE__ */ r(
56
+ "label",
57
+ {
58
+ htmlFor: o,
59
+ className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",
60
+ children: e.label
61
+ }
62
+ )
63
+ ] }, e.value);
64
+ })
65
+ }
66
+ )
47
67
  );
48
68
  }
49
69
  );
50
- g.displayName = "RadioGroup";
70
+ y.displayName = "RadioGroup";
51
71
  export {
52
- g as RadioGroup
72
+ y as RadioGroup
53
73
  };