@adam-milo/ui 1.0.17 → 1.0.18

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/index7.js CHANGED
@@ -1,84 +1,89 @@
1
- import { jsxs as b, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as I, useId as R, useRef as C, useEffect as j } from "react";
3
- import { cn as f } from "./index15.js";
1
+ import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as C, useId as R, useRef as j, useCallback as g, useEffect as D } from "react";
3
+ import { cn as k } from "./index16.js";
4
4
  /* empty css */
5
- const g = I(
5
+ const E = C(
6
6
  ({
7
7
  label: c,
8
- error: e,
9
- helperText: i,
8
+ error: a,
9
+ helperText: s,
10
10
  indeterminate: o = !1,
11
11
  className: m,
12
12
  id: x,
13
13
  required: n,
14
- disabled: l,
15
- checked: k,
16
- "data-cy": u,
17
- "data-testid": _,
18
- ...y
19
- }, $) => {
20
- const N = R(), d = x || N, p = `${d}-error`, h = `${d}-helper`, t = u || "checkbox", r = _ || "checkbox", v = C(null), a = $ || v;
21
- j(() => {
22
- a && "current" in a && a.current && (a.current.indeterminate = o);
23
- }, [o, a]);
24
- const w = c && n && !c.includes("*") ? `${c} *` : c;
25
- return /* @__PURE__ */ b(
14
+ disabled: h,
15
+ checked: y,
16
+ "data-cy": _,
17
+ "data-testid": $,
18
+ ...N
19
+ }, e) => {
20
+ const v = R(), d = x || v, u = `${d}-error`, b = `${d}-helper`, t = _ || "checkbox", r = $ || "checkbox", l = j(null), w = g(
21
+ (p) => {
22
+ l.current = p, e && (typeof e == "function" ? e(p) : "current" in e && (e.current = p));
23
+ },
24
+ [e]
25
+ );
26
+ D(() => {
27
+ l.current && (l.current.indeterminate = o);
28
+ }, [o]);
29
+ const I = c && n && !c.includes("*") ? `${c} *` : c;
30
+ return /* @__PURE__ */ f(
26
31
  "div",
27
32
  {
28
- className: f("checkbox-wrapper", l && "checkbox-wrapper--disabled"),
33
+ className: k("checkbox-wrapper", h && "checkbox-wrapper--disabled"),
29
34
  "data-cy": `${t}-wrapper`,
30
35
  "data-testid": `${r}-wrapper`,
31
36
  children: [
32
- /* @__PURE__ */ b("div", { className: "checkbox__container", children: [
33
- /* @__PURE__ */ s(
37
+ /* @__PURE__ */ f("div", { className: "checkbox__container", children: [
38
+ /* @__PURE__ */ i(
34
39
  "input",
35
40
  {
36
- ref: a,
41
+ ref: w,
37
42
  id: d,
38
43
  type: "checkbox",
39
- checked: k,
40
- className: f("checkbox__input", e && "checkbox__input--error", m),
41
- "aria-invalid": e ? "true" : "false",
44
+ checked: y,
45
+ className: k("checkbox__input", a && "checkbox__input--error", m),
46
+ "aria-invalid": a ? "true" : "false",
42
47
  "aria-required": n ? "true" : void 0,
43
- "aria-describedby": e ? p : i ? h : void 0,
48
+ "aria-describedby": a ? u : s ? b : void 0,
44
49
  "data-cy": t,
45
50
  "data-testid": r,
46
51
  "data-indeterminate": o ? "true" : void 0,
47
- disabled: l,
52
+ disabled: h,
48
53
  required: n,
49
- ...y
54
+ ...N
50
55
  }
51
56
  ),
52
- c && /* @__PURE__ */ s(
57
+ c && /* @__PURE__ */ i(
53
58
  "label",
54
59
  {
55
60
  htmlFor: d,
56
61
  className: "checkbox__label",
57
62
  "data-cy": `${t}-label`,
58
63
  "data-testid": `${r}-label`,
59
- children: w
64
+ children: I
60
65
  }
61
66
  )
62
67
  ] }),
63
- e && /* @__PURE__ */ s(
68
+ a && /* @__PURE__ */ i(
64
69
  "span",
65
70
  {
66
- id: p,
71
+ id: u,
67
72
  className: "checkbox__error",
68
73
  role: "alert",
69
74
  "data-cy": `${t}-error`,
70
75
  "data-testid": `${r}-error`,
71
- children: e
76
+ children: a
72
77
  }
73
78
  ),
74
- i && !e && /* @__PURE__ */ s(
79
+ s && !a && /* @__PURE__ */ i(
75
80
  "span",
76
81
  {
77
- id: h,
82
+ id: b,
78
83
  className: "checkbox__helper",
79
84
  "data-cy": `${t}-helper`,
80
85
  "data-testid": `${r}-helper`,
81
- children: i
86
+ children: s
82
87
  }
83
88
  )
84
89
  ]
@@ -86,7 +91,7 @@ const g = I(
86
91
  );
87
92
  }
88
93
  );
89
- g.displayName = "Checkbox";
94
+ E.displayName = "Checkbox";
90
95
  export {
91
- g as Checkbox
96
+ E as Checkbox
92
97
  };
package/dist/index8.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),b=require("react"),T=require("@radix-ui/react-tabs"),g=require("./index15.cjs");;/* empty css */function m(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const n=m(T),u=n.Root,f=b.forwardRef(({className:a,"data-cy":t,"data-testid":e,...s},r)=>{const i=t||"tabs-list",c=e||"tabs-list";return d.jsx(n.List,{ref:r,className:g.cn("tabs-list",a),"data-cy":i,"data-testid":c,...s})});f.displayName=n.List.displayName;const l=b.forwardRef(({className:a,value:t,"data-cy":e,"data-testid":s,...r},i)=>{const c=e||(t?`tabs-trigger-${t}`:"tabs-trigger"),o=s||(t?`tabs-trigger-${t}`:"tabs-trigger");return d.jsx(n.Trigger,{ref:i,className:g.cn("tabs-trigger",a),value:t,"data-cy":c,"data-testid":o,...r})});l.displayName=n.Trigger.displayName;const y=b.forwardRef(({className:a,value:t,"data-cy":e,"data-testid":s,...r},i)=>{const c=e||(t?`tabs-content-${t}`:"tabs-content"),o=s||(t?`tabs-content-${t}`:"tabs-content");return d.jsx(n.Content,{ref:i,className:g.cn("tabs-content",a),value:t,"data-cy":c,"data-testid":o,...r})});y.displayName=n.Content.displayName;exports.Tabs=u;exports.TabsContent=y;exports.TabsList=f;exports.TabsTrigger=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),_=require("./index16.cjs");;/* empty css */const $=n.forwardRef(({label:r,error:d,helperText:c,className:f,id:h,required:l,disabled:p,checked:m,"data-cy":j,"data-testid":R,...b},a)=>{const N=n.useId(),s=h||N,u=`${s}-error`,y=`${s}-helper`,t=j||"radio",i=R||"radio",x=n.useRef(null),w=n.useCallback(o=>{x.current=o,a&&(typeof a=="function"?a(o):"current"in a&&(a.current=o))},[a]),I=r&&l&&!r.includes("*")?`${r} *`:r;return e.jsxs("div",{className:_.cn("radio-wrapper",p&&"radio-wrapper--disabled"),"data-cy":`${t}-wrapper`,"data-testid":`${i}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:w,id:s,type:"radio",checked:m,className:_.cn("radio__input",d&&"radio__input--error",f),"aria-describedby":d?u:c?y:void 0,"data-cy":t,"data-testid":i,disabled:p,required:l,...b}),r&&e.jsx("label",{htmlFor:s,className:"radio__label","data-cy":`${t}-label`,"data-testid":`${i}-label`,children:I})]}),d&&e.jsx("span",{id:u,className:"radio__error",role:"alert","data-cy":`${t}-error`,"data-testid":`${i}-error`,children:d}),c&&!d&&e.jsx("span",{id:y,className:"radio__helper","data-cy":`${t}-helper`,"data-testid":`${i}-helper`,children:c})]})});$.displayName="Radio";exports.Radio=$;
package/dist/index8.js CHANGED
@@ -1,61 +1,89 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import * as a from "@radix-ui/react-tabs";
4
- import { cn as b } from "./index15.js";
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as j, useId as C, useRef as g, useCallback as k } from "react";
3
+ import { cn as y } from "./index16.js";
5
4
  /* empty css */
6
- const C = a.Root, g = m(
7
- ({ className: s, "data-cy": t, "data-testid": i, ...n }, r) => {
8
- const e = t || "tabs-list", o = i || "tabs-list";
9
- return /* @__PURE__ */ c(
10
- a.List,
5
+ const x = j(
6
+ ({
7
+ label: d,
8
+ error: r,
9
+ helperText: o,
10
+ className: _,
11
+ id: f,
12
+ required: n,
13
+ disabled: l,
14
+ checked: $,
15
+ "data-cy": h,
16
+ "data-testid": N,
17
+ ...R
18
+ }, a) => {
19
+ const b = C(), e = f || b, p = `${e}-error`, m = `${e}-helper`, t = h || "radio", i = N || "radio", w = g(null), I = k(
20
+ (c) => {
21
+ w.current = c, a && (typeof a == "function" ? a(c) : "current" in a && (a.current = c));
22
+ },
23
+ [a]
24
+ ), v = d && n && !d.includes("*") ? `${d} *` : d;
25
+ return /* @__PURE__ */ u(
26
+ "div",
11
27
  {
12
- ref: r,
13
- className: b("tabs-list", s),
14
- "data-cy": e,
15
- "data-testid": o,
16
- ...n
28
+ className: y("radio-wrapper", l && "radio-wrapper--disabled"),
29
+ "data-cy": `${t}-wrapper`,
30
+ "data-testid": `${i}-wrapper`,
31
+ children: [
32
+ /* @__PURE__ */ u("div", { className: "radio__container", children: [
33
+ /* @__PURE__ */ s(
34
+ "input",
35
+ {
36
+ ref: I,
37
+ id: e,
38
+ type: "radio",
39
+ checked: $,
40
+ className: y("radio__input", r && "radio__input--error", _),
41
+ "aria-describedby": r ? p : o ? m : void 0,
42
+ "data-cy": t,
43
+ "data-testid": i,
44
+ disabled: l,
45
+ required: n,
46
+ ...R
47
+ }
48
+ ),
49
+ d && /* @__PURE__ */ s(
50
+ "label",
51
+ {
52
+ htmlFor: e,
53
+ className: "radio__label",
54
+ "data-cy": `${t}-label`,
55
+ "data-testid": `${i}-label`,
56
+ children: v
57
+ }
58
+ )
59
+ ] }),
60
+ r && /* @__PURE__ */ s(
61
+ "span",
62
+ {
63
+ id: p,
64
+ className: "radio__error",
65
+ role: "alert",
66
+ "data-cy": `${t}-error`,
67
+ "data-testid": `${i}-error`,
68
+ children: r
69
+ }
70
+ ),
71
+ o && !r && /* @__PURE__ */ s(
72
+ "span",
73
+ {
74
+ id: m,
75
+ className: "radio__helper",
76
+ "data-cy": `${t}-helper`,
77
+ "data-testid": `${i}-helper`,
78
+ children: o
79
+ }
80
+ )
81
+ ]
17
82
  }
18
83
  );
19
84
  }
20
85
  );
21
- g.displayName = a.List.displayName;
22
- const y = m(
23
- ({ className: s, value: t, "data-cy": i, "data-testid": n, ...r }, e) => {
24
- const o = i || (t ? `tabs-trigger-${t}` : "tabs-trigger"), d = n || (t ? `tabs-trigger-${t}` : "tabs-trigger");
25
- return /* @__PURE__ */ c(
26
- a.Trigger,
27
- {
28
- ref: e,
29
- className: b("tabs-trigger", s),
30
- value: t,
31
- "data-cy": o,
32
- "data-testid": d,
33
- ...r
34
- }
35
- );
36
- }
37
- );
38
- y.displayName = a.Trigger.displayName;
39
- const f = m(
40
- ({ className: s, value: t, "data-cy": i, "data-testid": n, ...r }, e) => {
41
- const o = i || (t ? `tabs-content-${t}` : "tabs-content"), d = n || (t ? `tabs-content-${t}` : "tabs-content");
42
- return /* @__PURE__ */ c(
43
- a.Content,
44
- {
45
- ref: e,
46
- className: b("tabs-content", s),
47
- value: t,
48
- "data-cy": o,
49
- "data-testid": d,
50
- ...r
51
- }
52
- );
53
- }
54
- );
55
- f.displayName = a.Content.displayName;
86
+ x.displayName = "Radio";
56
87
  export {
57
- C as Tabs,
58
- f as TabsContent,
59
- g as TabsList,
60
- y as TabsTrigger
88
+ x as Radio
61
89
  };
package/dist/index9.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),f=require("./index15.cjs");;/* empty css */const c=m.forwardRef(({variant:s="info",title:r,icon:d,className:i,children:l,"data-cy":n,"data-testid":o,...u},$)=>{const y={info:"status",success:"status",warning:"alert",error:"alert"},t=n||`alert-${s}`,e=o||`alert-${s}`;return a.jsxs("div",{ref:$,role:y[s],className:f.cn("alert",`alert--${s}`,i),"data-cy":t,"data-testid":e,...u,children:[d&&a.jsx("div",{className:"alert__icon","data-cy":`${t}-icon`,"data-testid":`${e}-icon`,children:d}),a.jsxs("div",{className:"alert__content","data-cy":`${t}-content`,"data-testid":`${e}-content`,children:[r&&a.jsx("div",{className:"alert__title","data-cy":`${t}-title`,"data-testid":`${e}-title`,children:r}),a.jsx("div",{"data-cy":`${t}-message`,"data-testid":`${e}-message`,children:l})]})]})});c.displayName="Alert";exports.Alert=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),b=require("react"),T=require("@radix-ui/react-tabs"),g=require("./index16.cjs");;/* empty css */function m(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const n=m(T),u=n.Root,f=b.forwardRef(({className:a,"data-cy":t,"data-testid":e,...s},r)=>{const i=t||"tabs-list",c=e||"tabs-list";return d.jsx(n.List,{ref:r,className:g.cn("tabs-list",a),"data-cy":i,"data-testid":c,...s})});f.displayName=n.List.displayName;const l=b.forwardRef(({className:a,value:t,"data-cy":e,"data-testid":s,...r},i)=>{const c=e||(t?`tabs-trigger-${t}`:"tabs-trigger"),o=s||(t?`tabs-trigger-${t}`:"tabs-trigger");return d.jsx(n.Trigger,{ref:i,className:g.cn("tabs-trigger",a),value:t,"data-cy":c,"data-testid":o,...r})});l.displayName=n.Trigger.displayName;const y=b.forwardRef(({className:a,value:t,"data-cy":e,"data-testid":s,...r},i)=>{const c=e||(t?`tabs-content-${t}`:"tabs-content"),o=s||(t?`tabs-content-${t}`:"tabs-content");return d.jsx(n.Content,{ref:i,className:g.cn("tabs-content",a),value:t,"data-cy":c,"data-testid":o,...r})});y.displayName=n.Content.displayName;exports.Tabs=u;exports.TabsContent=y;exports.TabsList=f;exports.TabsTrigger=l;
package/dist/index9.js CHANGED
@@ -1,69 +1,61 @@
1
- import { jsxs as c, jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as y } from "react";
3
- import { cn as p } from "./index15.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { forwardRef as m } from "react";
3
+ import * as a from "@radix-ui/react-tabs";
4
+ import { cn as b } from "./index16.js";
4
5
  /* empty css */
5
- const _ = y(
6
- ({
7
- variant: e = "info",
8
- title: d,
9
- icon: r,
10
- className: i,
11
- children: l,
12
- "data-cy": o,
13
- "data-testid": n,
14
- ...m
15
- }, $) => {
16
- const f = {
17
- info: "status",
18
- success: "status",
19
- warning: "alert",
20
- error: "alert"
21
- }, t = o || `alert-${e}`, a = n || `alert-${e}`;
6
+ const C = a.Root, g = m(
7
+ ({ className: s, "data-cy": t, "data-testid": i, ...n }, r) => {
8
+ const e = t || "tabs-list", o = i || "tabs-list";
22
9
  return /* @__PURE__ */ c(
23
- "div",
10
+ a.List,
24
11
  {
25
- ref: $,
26
- role: f[e],
27
- className: p("alert", `alert--${e}`, i),
28
- "data-cy": t,
29
- "data-testid": a,
30
- ...m,
31
- children: [
32
- r && /* @__PURE__ */ s(
33
- "div",
34
- {
35
- className: "alert__icon",
36
- "data-cy": `${t}-icon`,
37
- "data-testid": `${a}-icon`,
38
- children: r
39
- }
40
- ),
41
- /* @__PURE__ */ c(
42
- "div",
43
- {
44
- className: "alert__content",
45
- "data-cy": `${t}-content`,
46
- "data-testid": `${a}-content`,
47
- children: [
48
- d && /* @__PURE__ */ s(
49
- "div",
50
- {
51
- className: "alert__title",
52
- "data-cy": `${t}-title`,
53
- "data-testid": `${a}-title`,
54
- children: d
55
- }
56
- ),
57
- /* @__PURE__ */ s("div", { "data-cy": `${t}-message`, "data-testid": `${a}-message`, children: l })
58
- ]
59
- }
60
- )
61
- ]
12
+ ref: r,
13
+ className: b("tabs-list", s),
14
+ "data-cy": e,
15
+ "data-testid": o,
16
+ ...n
62
17
  }
63
18
  );
64
19
  }
65
20
  );
66
- _.displayName = "Alert";
21
+ g.displayName = a.List.displayName;
22
+ const y = m(
23
+ ({ className: s, value: t, "data-cy": i, "data-testid": n, ...r }, e) => {
24
+ const o = i || (t ? `tabs-trigger-${t}` : "tabs-trigger"), d = n || (t ? `tabs-trigger-${t}` : "tabs-trigger");
25
+ return /* @__PURE__ */ c(
26
+ a.Trigger,
27
+ {
28
+ ref: e,
29
+ className: b("tabs-trigger", s),
30
+ value: t,
31
+ "data-cy": o,
32
+ "data-testid": d,
33
+ ...r
34
+ }
35
+ );
36
+ }
37
+ );
38
+ y.displayName = a.Trigger.displayName;
39
+ const f = m(
40
+ ({ className: s, value: t, "data-cy": i, "data-testid": n, ...r }, e) => {
41
+ const o = i || (t ? `tabs-content-${t}` : "tabs-content"), d = n || (t ? `tabs-content-${t}` : "tabs-content");
42
+ return /* @__PURE__ */ c(
43
+ a.Content,
44
+ {
45
+ ref: e,
46
+ className: b("tabs-content", s),
47
+ value: t,
48
+ "data-cy": o,
49
+ "data-testid": d,
50
+ ...r
51
+ }
52
+ );
53
+ }
54
+ );
55
+ f.displayName = a.Content.displayName;
67
56
  export {
68
- _ as Alert
57
+ C as Tabs,
58
+ f as TabsContent,
59
+ g as TabsList,
60
+ y as TabsTrigger
69
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/checkbox/Checkbox.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAA4B,MAAM,OAAO,CAAC;AAElF,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACxF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEhE;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEjE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,QAAQ,4GAwGpB,CAAC"}
1
+ {"version":3,"file":"Checkbox.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/checkbox/Checkbox.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAyC,MAAM,OAAO,CAAC;AAE/F,OAAO,gBAAgB,CAAC;AAExB,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACxF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEhE;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEjE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,QAAQ,4GAuHpB,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
4
+ /**
5
+ * Label text for the radio button
6
+ */
7
+ label?: string;
8
+ /**
9
+ * Error message to display below the radio button
10
+ */
11
+ error?: string;
12
+ /**
13
+ * Helper text to display below the radio button (only shown when no error)
14
+ */
15
+ helperText?: string;
16
+ /**
17
+ * Callback fired when the radio button state changes
18
+ * @param event - The change event from the input element
19
+ */
20
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
21
+ /**
22
+ * Callback fired when the radio button loses focus
23
+ * @param event - The blur event from the input element
24
+ */
25
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
26
+ /**
27
+ * Callback fired when the radio button gains focus
28
+ * @param event - The focus event from the input element
29
+ */
30
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
31
+ /**
32
+ * Callback fired when the radio button is clicked
33
+ * @param event - The mouse event from the input element
34
+ */
35
+ onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
36
+ /**
37
+ * Callback fired when a key is pressed on the radio button
38
+ * @param event - The keyboard event from the input element
39
+ */
40
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
41
+ /**
42
+ * Callback fired when a key is released on the radio button
43
+ * @param event - The keyboard event from the input element
44
+ */
45
+ onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
46
+ /**
47
+ * Custom data-cy attribute for Cypress testing
48
+ * Auto-generates as "radio" if not provided
49
+ */
50
+ 'data-cy'?: string;
51
+ /**
52
+ * Custom data-testid attribute for unit testing
53
+ * Auto-generates as "radio" if not provided
54
+ */
55
+ 'data-testid'?: string;
56
+ }
57
+ /**
58
+ * Radio - Accessible radio button component for the Adam Milo Design System
59
+ *
60
+ * A fully accessible radio button component that supports:
61
+ * - Standard checked/unchecked states
62
+ * - Hover and focus states
63
+ * - Disabled state
64
+ * - Error states with messages
65
+ * - Helper text
66
+ * - Required field indicator (asterisk)
67
+ * - Full keyboard accessibility
68
+ * - RTL support
69
+ *
70
+ * @example
71
+ * ```tsx
72
+ * // Simple radio button
73
+ * <Radio label="Option A" name="choice" value="a" />
74
+ *
75
+ * // Required radio button (asterisk added automatically)
76
+ * <Radio
77
+ * label="Option B"
78
+ * name="choice"
79
+ * value="b"
80
+ * required
81
+ * />
82
+ *
83
+ * // With error
84
+ * <Radio
85
+ * label="Option C"
86
+ * name="choice"
87
+ * value="c"
88
+ * error="Please select an option"
89
+ * />
90
+ *
91
+ * // Radio group
92
+ * <div>
93
+ * <Radio label="Small" name="size" value="small" />
94
+ * <Radio label="Medium" name="size" value="medium" defaultChecked />
95
+ * <Radio label="Large" name="size" value="large" />
96
+ * </div>
97
+ * ```
98
+ */
99
+ export declare const Radio: import('react').ForwardRefExoticComponent<RadioProps & import('react').RefAttributes<HTMLInputElement>>;
100
+ //# sourceMappingURL=Radio.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.component.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/radio/Radio.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAA8B,MAAM,OAAO,CAAC;AAEpF,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACrF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEhE;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE9D;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAEjE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,KAAK,yGA4GjB,CAAC"}
@@ -12,6 +12,8 @@ export { AlphanumericInput } from './components/forms/alphanumeric-input/Alphanu
12
12
  export type { AlphanumericInputProps } from './components/forms/alphanumeric-input/AlphanumericInput.component';
13
13
  export { Checkbox } from './components/forms/checkbox/Checkbox.component';
14
14
  export type { CheckboxProps } from './components/forms/checkbox/Checkbox.component';
15
+ export { Radio } from './components/forms/radio/Radio.component';
16
+ export type { RadioProps } from './components/forms/radio/Radio.component';
15
17
  export { Tabs, TabsList, TabsTrigger, TabsContent, } from './components/navigation/tabs/Tabs.component';
16
18
  export { Alert } from './components/feedback/alert/Alert.component';
17
19
  export type { AlertProps } from './components/feedback/alert/Alert.component';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC7E,YAAY,EACV,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AAE3F,OAAO,EAAE,aAAa,EAAE,MAAM,2DAA2D,CAAC;AAC1F,YAAY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