@adam-milo/ui 1.0.8 → 1.0.10

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 (40) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +43 -37
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +90 -9
  5. package/dist/index11.cjs +1 -0
  6. package/dist/index11.js +115 -0
  7. package/dist/index12.cjs +1 -0
  8. package/dist/index12.js +43 -0
  9. package/dist/index13.cjs +1 -0
  10. package/dist/index13.js +11 -0
  11. package/dist/index2.cjs +1 -1
  12. package/dist/index2.js +1 -1
  13. package/dist/index3.cjs +1 -1
  14. package/dist/index3.js +69 -48
  15. package/dist/index4.cjs +1 -1
  16. package/dist/index4.js +173 -56
  17. package/dist/index5.cjs +1 -1
  18. package/dist/index5.js +147 -51
  19. package/dist/index6.cjs +1 -1
  20. package/dist/index6.js +155 -105
  21. package/dist/index7.cjs +1 -1
  22. package/dist/index7.js +53 -84
  23. package/dist/index8.cjs +1 -1
  24. package/dist/index8.js +61 -107
  25. package/dist/index9.cjs +1 -1
  26. package/dist/index9.js +108 -32
  27. package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts +62 -0
  28. package/dist/src/components/forms/alphanumeric-input/AlphanumericInput.component.d.ts.map +1 -0
  29. package/dist/src/components/forms/email-input/EmailInput.component.d.ts +34 -0
  30. package/dist/src/components/forms/email-input/EmailInput.component.d.ts.map +1 -0
  31. package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts +62 -0
  32. package/dist/src/components/forms/numeric-input/NumericInput.component.d.ts.map +1 -0
  33. package/dist/src/components/forms/password-input/PasswordInput.component.d.ts +25 -0
  34. package/dist/src/components/forms/password-input/PasswordInput.component.d.ts.map +1 -0
  35. package/dist/src/index.d.ts +8 -2
  36. package/dist/src/index.d.ts.map +1 -1
  37. package/dist/style.css +1 -1
  38. package/package.json +1 -1
  39. package/dist/src/components/forms/input/Input.component.d.ts +0 -20
  40. package/dist/src/components/forms/input/Input.component.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index2.cjs"),i=require("./index3.cjs"),t=require("./index4.cjs"),l=require("./index5.cjs"),o=require("./index6.cjs"),c=require("./index7.cjs"),e=require("./index8.cjs"),g=require("./index9.cjs"),a=require("./index10.cjs"),r=require("@adam-milo/icons");exports.Button=n.Button;exports.Input=i.Input;exports.Tabs=t.Tabs;exports.TabsContent=t.TabsContent;exports.TabsList=t.TabsList;exports.TabsTrigger=t.TabsTrigger;exports.Alert=l.Alert;exports.Card=o.Card;exports.CardContent=o.CardContent;exports.CardDescription=o.CardDescription;exports.CardFooter=o.CardFooter;exports.CardHeader=o.CardHeader;exports.CardTitle=o.CardTitle;exports.DataTable=c.DataTable;exports.Dialog=e.Dialog;exports.DialogClose=e.DialogClose;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogOverlay=e.DialogOverlay;exports.DialogPortal=e.DialogPortal;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.Stack=g.Stack;exports.cn=a.cn;exports.generateId=a.generateId;Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>r.Icon});Object.defineProperty(exports,"availableIcons",{enumerable:!0,get:()=>r.availableIcons});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index2.cjs"),i=require("./index3.cjs"),l=require("./index4.cjs"),c=require("./index5.cjs"),s=require("./index6.cjs"),t=require("./index7.cjs"),u=require("./index8.cjs"),o=require("./index9.cjs"),g=require("./index10.cjs"),e=require("./index11.cjs"),p=require("./index12.cjs"),r=require("./index13.cjs"),n=require("@adam-milo/icons");exports.Button=a.Button;exports.EmailInput=i.EmailInput;exports.PasswordInput=l.PasswordInput;exports.NumericInput=c.NumericInput;exports.AlphanumericInput=s.AlphanumericInput;exports.Tabs=t.Tabs;exports.TabsContent=t.TabsContent;exports.TabsList=t.TabsList;exports.TabsTrigger=t.TabsTrigger;exports.Alert=u.Alert;exports.Card=o.Card;exports.CardContent=o.CardContent;exports.CardDescription=o.CardDescription;exports.CardFooter=o.CardFooter;exports.CardHeader=o.CardHeader;exports.CardTitle=o.CardTitle;exports.DataTable=g.DataTable;exports.Dialog=e.Dialog;exports.DialogClose=e.DialogClose;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogOverlay=e.DialogOverlay;exports.DialogPortal=e.DialogPortal;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.Stack=p.Stack;exports.cn=r.cn;exports.generateId=r.generateId;Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>n.Icon});Object.defineProperty(exports,"availableIcons",{enumerable:!0,get:()=>n.availableIcons});
package/dist/index.js CHANGED
@@ -1,41 +1,47 @@
1
1
  import { Button as e } from "./index2.js";
2
- import { Input as t } from "./index3.js";
3
- import { Tabs as l, TabsContent as g, TabsList as n, TabsTrigger as p } from "./index4.js";
4
- import { Alert as f } from "./index5.js";
5
- import { Card as x, CardContent as C, CardDescription as d, CardFooter as s, CardHeader as T, CardTitle as b } from "./index6.js";
6
- import { DataTable as I } from "./index7.js";
7
- import { Dialog as v, DialogClose as F, DialogContent as H, DialogDescription as k, DialogFooter as y, DialogHeader as A, DialogOverlay as B, DialogPortal as L, DialogTitle as O, DialogTrigger as P } from "./index8.js";
8
- import { Stack as h } from "./index9.js";
9
- import { cn as q, generateId as w } from "./index10.js";
10
- import { Icon as E, availableIcons as G } from "@adam-milo/icons";
2
+ import { EmailInput as a } from "./index3.js";
3
+ import { PasswordInput as l } from "./index4.js";
4
+ import { NumericInput as n } from "./index5.js";
5
+ import { AlphanumericInput as g } from "./index6.js";
6
+ import { Tabs as x, TabsContent as D, TabsList as s, TabsTrigger as d } from "./index7.js";
7
+ import { Alert as T } from "./index8.js";
8
+ import { Card as u, CardContent as I, CardDescription as b, CardFooter as v, CardHeader as A, CardTitle as F } from "./index9.js";
9
+ import { DataTable as P } from "./index10.js";
10
+ import { Dialog as k, DialogClose as w, DialogContent as y, DialogDescription as B, DialogFooter as E, DialogHeader as L, DialogOverlay as N, DialogPortal as O, DialogTitle as S, DialogTrigger as j } from "./index11.js";
11
+ import { Stack as z } from "./index12.js";
12
+ import { cn as J, generateId as K } from "./index13.js";
13
+ import { Icon as Q, availableIcons as R } from "@adam-milo/icons";
11
14
  export {
12
- f as Alert,
15
+ T as Alert,
16
+ g as AlphanumericInput,
13
17
  e as Button,
14
- x as Card,
15
- C as CardContent,
16
- d as CardDescription,
17
- s as CardFooter,
18
- T as CardHeader,
19
- b as CardTitle,
20
- I as DataTable,
21
- v as Dialog,
22
- F as DialogClose,
23
- H as DialogContent,
24
- k as DialogDescription,
25
- y as DialogFooter,
26
- A as DialogHeader,
27
- B as DialogOverlay,
28
- L as DialogPortal,
29
- O as DialogTitle,
30
- P as DialogTrigger,
31
- E as Icon,
32
- t as Input,
33
- h as Stack,
34
- l as Tabs,
35
- g as TabsContent,
36
- n as TabsList,
37
- p as TabsTrigger,
38
- G as availableIcons,
39
- q as cn,
40
- w as generateId
18
+ u as Card,
19
+ I as CardContent,
20
+ b as CardDescription,
21
+ v as CardFooter,
22
+ A as CardHeader,
23
+ F as CardTitle,
24
+ P as DataTable,
25
+ k as Dialog,
26
+ w as DialogClose,
27
+ y as DialogContent,
28
+ B as DialogDescription,
29
+ E as DialogFooter,
30
+ L as DialogHeader,
31
+ N as DialogOverlay,
32
+ O as DialogPortal,
33
+ S as DialogTitle,
34
+ j as DialogTrigger,
35
+ a as EmailInput,
36
+ Q as Icon,
37
+ n as NumericInput,
38
+ l as PasswordInput,
39
+ z as Stack,
40
+ x as Tabs,
41
+ D as TabsContent,
42
+ s as TabsList,
43
+ d as TabsTrigger,
44
+ R as availableIcons,
45
+ J as cn,
46
+ K as generateId
41
47
  };
package/dist/index10.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(...e){return e.filter(Boolean).join(" ")}let n=0;function r(e="id"){return n+=1,`${e}-${n}`}exports.cn=t;exports.generateId=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),j=require("react"),c=require("./index13.cjs");;/* empty css */const y=j.forwardRef(({columns:r,data:i,striped:b=!1,hoverable:h=!1,className:$,"data-cy":n,"data-testid":p,...o},_)=>{const e=n||"datatable",t=p||"datatable";return a.jsx("div",{className:"datatable-wrapper","data-cy":`${e}-wrapper`,"data-testid":`${t}-wrapper`,children:a.jsxs("table",{ref:_,className:c.cn("datatable",$),"data-cy":e,"data-testid":t,...o,children:[a.jsx("thead",{className:"datatable__head","data-cy":`${e}-head`,"data-testid":`${t}-head`,children:a.jsx("tr",{children:r.map(d=>a.jsx("th",{className:"datatable__header-cell","data-cy":`${e}-header-${d.key}`,"data-testid":`${t}-header-${d.key}`,children:d.header},d.key))})}),a.jsx("tbody",{"data-cy":`${e}-body`,"data-testid":`${t}-body`,children:i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:r.length,className:"datatable__empty","data-cy":`${e}-empty`,"data-testid":`${t}-empty`,children:"No data available"})}):i.map((d,l)=>a.jsx("tr",{className:c.cn("datatable__body-row",h&&"datatable__body-row--hoverable",b&&"datatable__body-row--striped"),"data-cy":`${e}-row-${l}`,"data-testid":`${t}-row-${l}`,children:r.map(s=>a.jsx("td",{className:"datatable__body-cell","data-cy":`${e}-cell-${l}-${s.key}`,"data-testid":`${t}-cell-${l}-${s.key}`,children:String(d[s.key]??"")},s.key))},l))})]})})});y.displayName="DataTable";exports.DataTable=y;
package/dist/index10.js CHANGED
@@ -1,11 +1,92 @@
1
- function t(...n) {
2
- return n.filter(Boolean).join(" ");
3
- }
4
- let e = 0;
5
- function r(n = "id") {
6
- return e += 1, `${n}-${e}`;
7
- }
1
+ import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
+ import { forwardRef as f } from "react";
3
+ import { cn as y } from "./index13.js";
4
+ /* empty css */
5
+ const n = f(
6
+ ({
7
+ columns: s,
8
+ data: i,
9
+ striped: c = !1,
10
+ hoverable: b = !1,
11
+ className: h,
12
+ "data-cy": $,
13
+ "data-testid": p,
14
+ ...o
15
+ }, _) => {
16
+ const t = $ || "datatable", e = p || "datatable";
17
+ return /* @__PURE__ */ a(
18
+ "div",
19
+ {
20
+ className: "datatable-wrapper",
21
+ "data-cy": `${t}-wrapper`,
22
+ "data-testid": `${e}-wrapper`,
23
+ children: /* @__PURE__ */ m(
24
+ "table",
25
+ {
26
+ ref: _,
27
+ className: y("datatable", h),
28
+ "data-cy": t,
29
+ "data-testid": e,
30
+ ...o,
31
+ children: [
32
+ /* @__PURE__ */ a(
33
+ "thead",
34
+ {
35
+ className: "datatable__head",
36
+ "data-cy": `${t}-head`,
37
+ "data-testid": `${e}-head`,
38
+ children: /* @__PURE__ */ a("tr", { children: s.map((d) => /* @__PURE__ */ a(
39
+ "th",
40
+ {
41
+ className: "datatable__header-cell",
42
+ "data-cy": `${t}-header-${d.key}`,
43
+ "data-testid": `${e}-header-${d.key}`,
44
+ children: d.header
45
+ },
46
+ d.key
47
+ )) })
48
+ }
49
+ ),
50
+ /* @__PURE__ */ a("tbody", { "data-cy": `${t}-body`, "data-testid": `${e}-body`, children: i.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
51
+ "td",
52
+ {
53
+ colSpan: s.length,
54
+ className: "datatable__empty",
55
+ "data-cy": `${t}-empty`,
56
+ "data-testid": `${e}-empty`,
57
+ children: "No data available"
58
+ }
59
+ ) }) : i.map((d, l) => /* @__PURE__ */ a(
60
+ "tr",
61
+ {
62
+ className: y(
63
+ "datatable__body-row",
64
+ b && "datatable__body-row--hoverable",
65
+ c && "datatable__body-row--striped"
66
+ ),
67
+ "data-cy": `${t}-row-${l}`,
68
+ "data-testid": `${e}-row-${l}`,
69
+ children: s.map((r) => /* @__PURE__ */ a(
70
+ "td",
71
+ {
72
+ className: "datatable__body-cell",
73
+ "data-cy": `${t}-cell-${l}-${r.key}`,
74
+ "data-testid": `${e}-cell-${l}-${r.key}`,
75
+ children: String(d[r.key] ?? "")
76
+ },
77
+ r.key
78
+ ))
79
+ },
80
+ l
81
+ )) })
82
+ ]
83
+ }
84
+ )
85
+ }
86
+ );
87
+ }
88
+ );
89
+ n.displayName = "DataTable";
8
90
  export {
9
- t as cn,
10
- r as generateId
91
+ n as DataTable
11
92
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),c=require("react"),T=require("@radix-ui/react-dialog"),r=require("./index13.cjs");;/* empty css */function j(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const o=j(T),v=o.Root,C=o.Trigger,y=o.Portal,x=o.Close,g=c.forwardRef(({className:a,"data-cy":e,"data-testid":t,...i},l)=>{const s=e||"dialog-overlay",n=t||"dialog-overlay";return d.jsx(o.Overlay,{ref:l,className:r.cn("dialog-overlay",a),"data-cy":s,"data-testid":n,...i})});g.displayName=o.Overlay.displayName;const D=c.forwardRef(({className:a,children:e,"data-cy":t,"data-testid":i,...l},s)=>{const n=t||"dialog-content",N=i||"dialog-content";return d.jsxs(y,{children:[d.jsx(g,{}),d.jsx(o.Content,{ref:s,className:r.cn("dialog-content",a),"data-cy":n,"data-testid":N,...l,children:e})]})});D.displayName=o.Content.displayName;const f=({className:a,"data-cy":e,"data-testid":t,...i})=>{const l=e||"dialog-header",s=t||"dialog-header";return d.jsx("div",{className:r.cn("dialog-header",a),"data-cy":l,"data-testid":s,...i})};f.displayName="DialogHeader";const u=({className:a,"data-cy":e,"data-testid":t,...i})=>{const l=e||"dialog-footer",s=t||"dialog-footer";return d.jsx("div",{className:r.cn("dialog-footer",a),"data-cy":l,"data-testid":s,...i})};u.displayName="DialogFooter";const m=c.forwardRef(({className:a,"data-cy":e,"data-testid":t,...i},l)=>{const s=e||"dialog-title",n=t||"dialog-title";return d.jsx(o.Title,{ref:l,className:r.cn("dialog-title",a),"data-cy":s,"data-testid":n,...i})});m.displayName=o.Title.displayName;const p=c.forwardRef(({className:a,"data-cy":e,"data-testid":t,...i},l)=>{const s=e||"dialog-description",n=t||"dialog-description";return d.jsx(o.Description,{ref:l,className:r.cn("dialog-description",a),"data-cy":s,"data-testid":n,...i})});p.displayName=o.Description.displayName;exports.Dialog=v;exports.DialogClose=x;exports.DialogContent=D;exports.DialogDescription=p;exports.DialogFooter=u;exports.DialogHeader=f;exports.DialogOverlay=g;exports.DialogPortal=y;exports.DialogTitle=m;exports.DialogTrigger=C;
@@ -0,0 +1,115 @@
1
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as c } from "react";
3
+ import * as a from "@radix-ui/react-dialog";
4
+ import { cn as r } from "./index13.js";
5
+ /* empty css */
6
+ const x = a.Root, O = a.Trigger, p = a.Portal, P = a.Close, g = c(({ className: t, "data-cy": i, "data-testid": o, ...e }, d) => {
7
+ const l = i || "dialog-overlay", s = o || "dialog-overlay";
8
+ return /* @__PURE__ */ n(
9
+ a.Overlay,
10
+ {
11
+ ref: d,
12
+ className: r("dialog-overlay", t),
13
+ "data-cy": l,
14
+ "data-testid": s,
15
+ ...e
16
+ }
17
+ );
18
+ });
19
+ g.displayName = a.Overlay.displayName;
20
+ const D = c(({ className: t, children: i, "data-cy": o, "data-testid": e, ...d }, l) => {
21
+ const s = o || "dialog-content", y = e || "dialog-content";
22
+ return /* @__PURE__ */ m(p, { children: [
23
+ /* @__PURE__ */ n(g, {}),
24
+ /* @__PURE__ */ n(
25
+ a.Content,
26
+ {
27
+ ref: l,
28
+ className: r("dialog-content", t),
29
+ "data-cy": s,
30
+ "data-testid": y,
31
+ ...d,
32
+ children: i
33
+ }
34
+ )
35
+ ] });
36
+ });
37
+ D.displayName = a.Content.displayName;
38
+ const f = ({
39
+ className: t,
40
+ "data-cy": i,
41
+ "data-testid": o,
42
+ ...e
43
+ }) => {
44
+ const d = i || "dialog-header", l = o || "dialog-header";
45
+ return /* @__PURE__ */ n(
46
+ "div",
47
+ {
48
+ className: r("dialog-header", t),
49
+ "data-cy": d,
50
+ "data-testid": l,
51
+ ...e
52
+ }
53
+ );
54
+ };
55
+ f.displayName = "DialogHeader";
56
+ const N = ({
57
+ className: t,
58
+ "data-cy": i,
59
+ "data-testid": o,
60
+ ...e
61
+ }) => {
62
+ const d = i || "dialog-footer", l = o || "dialog-footer";
63
+ return /* @__PURE__ */ n(
64
+ "div",
65
+ {
66
+ className: r("dialog-footer", t),
67
+ "data-cy": d,
68
+ "data-testid": l,
69
+ ...e
70
+ }
71
+ );
72
+ };
73
+ N.displayName = "DialogFooter";
74
+ const C = c(
75
+ ({ className: t, "data-cy": i, "data-testid": o, ...e }, d) => {
76
+ const l = i || "dialog-title", s = o || "dialog-title";
77
+ return /* @__PURE__ */ n(
78
+ a.Title,
79
+ {
80
+ ref: d,
81
+ className: r("dialog-title", t),
82
+ "data-cy": l,
83
+ "data-testid": s,
84
+ ...e
85
+ }
86
+ );
87
+ }
88
+ );
89
+ C.displayName = a.Title.displayName;
90
+ const T = c(({ className: t, "data-cy": i, "data-testid": o, ...e }, d) => {
91
+ const l = i || "dialog-description", s = o || "dialog-description";
92
+ return /* @__PURE__ */ n(
93
+ a.Description,
94
+ {
95
+ ref: d,
96
+ className: r("dialog-description", t),
97
+ "data-cy": l,
98
+ "data-testid": s,
99
+ ...e
100
+ }
101
+ );
102
+ });
103
+ T.displayName = a.Description.displayName;
104
+ export {
105
+ x as Dialog,
106
+ P as DialogClose,
107
+ D as DialogContent,
108
+ T as DialogDescription,
109
+ N as DialogFooter,
110
+ f as DialogHeader,
111
+ g as DialogOverlay,
112
+ p as DialogPortal,
113
+ C as DialogTitle,
114
+ O as DialogTrigger
115
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),$=require("react"),S=require("./index13.cjs");;/* empty css */const a=$.forwardRef(({direction:t="vertical",spacing:s="4",align:e="stretch",justify:c="start",wrap:r=!1,className:i,children:n,"data-cy":d,"data-testid":k,...l},u)=>{const o=d||`stack-${t}`,f=k||`stack-${t}`;return y.jsx("div",{ref:u,className:S.cn("stack",`stack--${t}`,`stack--spacing-${s}`,`stack--align-${e}`,`stack--justify-${c}`,r&&"stack--wrap",i),"data-cy":o,"data-testid":f,...l,children:n})});a.displayName="Stack";exports.Stack=a;
@@ -0,0 +1,43 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import { cn as $ } from "./index13.js";
4
+ /* empty css */
5
+ const y = n(
6
+ ({
7
+ direction: a = "vertical",
8
+ spacing: t = "4",
9
+ align: s = "stretch",
10
+ justify: c = "start",
11
+ wrap: r = !1,
12
+ className: i,
13
+ children: k,
14
+ "data-cy": o,
15
+ "data-testid": e,
16
+ ...f
17
+ }, m) => {
18
+ const d = o || `stack-${a}`, p = e || `stack-${a}`;
19
+ return /* @__PURE__ */ l(
20
+ "div",
21
+ {
22
+ ref: m,
23
+ className: $(
24
+ "stack",
25
+ `stack--${a}`,
26
+ `stack--spacing-${t}`,
27
+ `stack--align-${s}`,
28
+ `stack--justify-${c}`,
29
+ r && "stack--wrap",
30
+ i
31
+ ),
32
+ "data-cy": d,
33
+ "data-testid": p,
34
+ ...f,
35
+ children: k
36
+ }
37
+ );
38
+ }
39
+ );
40
+ y.displayName = "Stack";
41
+ export {
42
+ y as Stack
43
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(...e){return e.filter(Boolean).join(" ")}let n=0;function r(e="id"){return n+=1,`${e}-${n}`}exports.cn=t;exports.generateId=r;
@@ -0,0 +1,11 @@
1
+ function t(...n) {
2
+ return n.filter(Boolean).join(" ");
3
+ }
4
+ let e = 0;
5
+ function r(n = "id") {
6
+ return e += 1, `${n}-${e}`;
7
+ }
8
+ export {
9
+ t as cn,
10
+ r as generateId
11
+ };
package/dist/index2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),m=require("react"),y=require("./index10.cjs");;/* empty css */const n=m.forwardRef(({variant:t="primary-workspace",fullWidth:r=!1,icon:e,className:a,children:c,disabled:o,"data-testid":u,"data-cy":d,...i},l)=>{const b=y.cn("btn",`btn--${t}`,r&&"btn--full-width",a);return s.jsxs("button",{ref:l,disabled:o,className:b,"data-testid":u||`button-${t}`,"data-cy":d||`button-${t}`,...i,children:[e&&s.jsx("span",{className:"btn__icon",children:e}),c]})});n.displayName="Button";exports.Button=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),m=require("react"),y=require("./index13.cjs");;/* empty css */const n=m.forwardRef(({variant:t="primary-workspace",fullWidth:r=!1,icon:e,className:a,children:c,disabled:o,"data-testid":u,"data-cy":d,...i},l)=>{const b=y.cn("btn",`btn--${t}`,r&&"btn--full-width",a);return s.jsxs("button",{ref:l,disabled:o,className:b,"data-testid":u||`button-${t}`,"data-cy":d||`button-${t}`,...i,children:[e&&s.jsx("span",{className:"btn__icon",children:e}),c]})});n.displayName="Button";exports.Button=n;
package/dist/index2.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs as l, jsx as p } from "react/jsx-runtime";
2
2
  import { forwardRef as b } from "react";
3
- import { cn as f } from "./index10.js";
3
+ import { cn as f } from "./index13.js";
4
4
  /* empty css */
5
5
  const u = b(
6
6
  ({
package/dist/index3.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),p=require("react"),u=require("./index10.cjs");;/* empty css */const o=p.forwardRef(({label:s,error:a,helperText:r,fullWidth:n=!1,className:y,id:$,"data-cy":h,"data-testid":m,...f},I)=>{const b=p.useId(),d=$||b,l=`${d}-error`,c=`${d}-helper`,t=h||"input",e=m||"input";return i.jsxs("div",{className:u.cn("input-wrapper",n&&"input-wrapper--full-width"),"data-cy":`${t}-wrapper`,"data-testid":`${e}-wrapper`,children:[s&&i.jsx("label",{htmlFor:d,className:"input__label","data-cy":`${t}-label`,"data-testid":`${e}-label`,children:s}),i.jsx("input",{ref:I,id:d,className:u.cn("input",a&&"input--error",n&&"input--full-width",y),"aria-invalid":a?"true":"false","aria-describedby":a?l:r?c:void 0,"data-cy":t,"data-testid":e,...f}),a&&i.jsx("span",{id:l,className:"input__error",role:"alert","data-cy":`${t}-error`,"data-testid":`${e}-error`,children:a}),r&&!a&&i.jsx("span",{id:c,className:"input__helper","data-cy":`${t}-helper`,"data-testid":`${e}-helper`,children:r})]})});o.displayName="Input";exports.Input=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),n=require("react"),j=require("./index13.cjs");;/* empty css */const L=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,w=n.forwardRef(({validateEmail:m=!0,invalidEmailMessage:y="Not a valid email address",onValidationChange:r,error:N,onChange:p,label:f,helperText:o,fullWidth:$=!1,className:_,id:x,"data-cy":q,"data-testid":S,...i},B)=>{const[R,I]=n.useState(),[h,F]=n.useState(!1),A=n.useId(),l=x||A,v=`${l}-error`,E=`${l}-helper`,s=q||"email-input",a=S||"email-input",b=t=>t?L.test(t):!0,D=t=>{const u=t.target.value;if(m&&h){const d=b(u);I(d?void 0:y),r==null||r(d)}p==null||p(t)},G=t=>{var u;if(F(!0),m){const d=b(t.target.value);I(d?void 0:y),r==null||r(d)}(u=i.onBlur)==null||u.call(i,t)},e=N||R;return c.jsxs("div",{className:j.cn("input-wrapper",$&&"input-wrapper--full-width"),"data-cy":`${s}-wrapper`,"data-testid":`${a}-wrapper`,children:[f&&c.jsx("label",{htmlFor:l,className:"input__label","data-cy":`${s}-label`,"data-testid":`${a}-label`,children:f}),c.jsx("input",{ref:B,id:l,type:"email",className:j.cn("input",e&&"input--error",$&&"input--full-width",_),"aria-invalid":e?"true":"false","aria-describedby":e?v:o?E:void 0,"data-cy":s,"data-testid":a,onChange:D,onBlur:G,...i}),e&&c.jsx("span",{id:v,className:"input__error",role:"alert","data-cy":`${s}-error`,"data-testid":`${a}-error`,children:e}),o&&!e&&c.jsx("span",{id:E,className:"input__helper","data-cy":`${s}-helper`,"data-testid":`${a}-helper`,children:o})]})});w.displayName="EmailInput";exports.EmailInput=w;
package/dist/index3.js CHANGED
@@ -1,74 +1,95 @@
1
- import { jsxs as w, jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as I, useId as N } from "react";
3
- import { cn as c } from "./index10.js";
1
+ import { jsxs as S, jsx as u } from "react/jsx-runtime";
2
+ import { forwardRef as X, useState as E, useId as k } from "react";
3
+ import { cn as N } from "./index13.js";
4
4
  /* empty css */
5
- const _ = I(
5
+ const q = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, z = X(
6
6
  ({
7
- label: s,
8
- error: a,
9
- helperText: r,
10
- fullWidth: n = !1,
11
- className: o,
12
- id: u,
13
- "data-cy": m,
14
- "data-testid": f,
15
- ...$
16
- }, h) => {
17
- const y = N(), d = u || y, p = `${d}-error`, l = `${d}-helper`, t = m || "input", e = f || "input";
18
- return /* @__PURE__ */ w(
7
+ validateEmail: m = !0,
8
+ invalidEmailMessage: n = "Not a valid email address",
9
+ onValidationChange: r,
10
+ error: _,
11
+ onChange: p,
12
+ label: f,
13
+ helperText: o,
14
+ fullWidth: y = !1,
15
+ className: b,
16
+ id: B,
17
+ "data-cy": h,
18
+ "data-testid": j,
19
+ ...l
20
+ }, F) => {
21
+ const [R, $] = E(), [x, A] = E(!1), D = k(), i = B || D, I = `${i}-error`, v = `${i}-helper`, a = h || "email-input", s = j || "email-input", w = (t) => t ? q.test(t) : !0, G = (t) => {
22
+ const c = t.target.value;
23
+ if (m && x) {
24
+ const d = w(c);
25
+ $(d ? void 0 : n), r == null || r(d);
26
+ }
27
+ p == null || p(t);
28
+ }, L = (t) => {
29
+ var c;
30
+ if (A(!0), m) {
31
+ const d = w(t.target.value);
32
+ $(d ? void 0 : n), r == null || r(d);
33
+ }
34
+ (c = l.onBlur) == null || c.call(l, t);
35
+ }, e = _ || R;
36
+ return /* @__PURE__ */ S(
19
37
  "div",
20
38
  {
21
- className: c("input-wrapper", n && "input-wrapper--full-width"),
22
- "data-cy": `${t}-wrapper`,
23
- "data-testid": `${e}-wrapper`,
39
+ className: N("input-wrapper", y && "input-wrapper--full-width"),
40
+ "data-cy": `${a}-wrapper`,
41
+ "data-testid": `${s}-wrapper`,
24
42
  children: [
25
- s && /* @__PURE__ */ i(
43
+ f && /* @__PURE__ */ u(
26
44
  "label",
27
45
  {
28
- htmlFor: d,
46
+ htmlFor: i,
29
47
  className: "input__label",
30
- "data-cy": `${t}-label`,
31
- "data-testid": `${e}-label`,
32
- children: s
48
+ "data-cy": `${a}-label`,
49
+ "data-testid": `${s}-label`,
50
+ children: f
33
51
  }
34
52
  ),
35
- /* @__PURE__ */ i(
53
+ /* @__PURE__ */ u(
36
54
  "input",
37
55
  {
38
- ref: h,
39
- id: d,
40
- className: c(
56
+ ref: F,
57
+ id: i,
58
+ type: "email",
59
+ className: N(
41
60
  "input",
42
- a && "input--error",
43
- n && "input--full-width",
44
- o
61
+ e && "input--error",
62
+ y && "input--full-width",
63
+ b
45
64
  ),
46
- "aria-invalid": a ? "true" : "false",
47
- "aria-describedby": a ? p : r ? l : void 0,
48
- "data-cy": t,
49
- "data-testid": e,
50
- ...$
65
+ "aria-invalid": e ? "true" : "false",
66
+ "aria-describedby": e ? I : o ? v : void 0,
67
+ "data-cy": a,
68
+ "data-testid": s,
69
+ onChange: G,
70
+ onBlur: L,
71
+ ...l
51
72
  }
52
73
  ),
53
- a && /* @__PURE__ */ i(
74
+ e && /* @__PURE__ */ u(
54
75
  "span",
55
76
  {
56
- id: p,
77
+ id: I,
57
78
  className: "input__error",
58
79
  role: "alert",
59
- "data-cy": `${t}-error`,
60
- "data-testid": `${e}-error`,
61
- children: a
80
+ "data-cy": `${a}-error`,
81
+ "data-testid": `${s}-error`,
82
+ children: e
62
83
  }
63
84
  ),
64
- r && !a && /* @__PURE__ */ i(
85
+ o && !e && /* @__PURE__ */ u(
65
86
  "span",
66
87
  {
67
- id: l,
88
+ id: v,
68
89
  className: "input__helper",
69
- "data-cy": `${t}-helper`,
70
- "data-testid": `${e}-helper`,
71
- children: r
90
+ "data-cy": `${a}-helper`,
91
+ "data-testid": `${s}-helper`,
92
+ children: o
72
93
  }
73
94
  )
74
95
  ]
@@ -76,7 +97,7 @@ const _ = I(
76
97
  );
77
98
  }
78
99
  );
79
- _.displayName = "Input";
100
+ z.displayName = "EmailInput";
80
101
  export {
81
- _ as Input
102
+ z as EmailInput
82
103
  };
package/dist/index4.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("./index10.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 t=require("react/jsx-runtime"),d=require("react"),u=require("./index13.cjs");;/* empty css */const w=d.forwardRef(({showToggle:h=!0,label:o,error:e,helperText:i,fullWidth:l=!1,className:x,id:g,"data-cy":j,"data-testid":y,...k},f)=>{const[n,b]=d.useState(!1),m=d.useId(),a=g||m,c=`${a}-error`,p=`${a}-helper`,s=j||"password-input",r=y||"password-input",$=()=>{b(v=>!v)};return t.jsxs("div",{className:"password-input-wrapper",children:[t.jsxs("div",{className:u.cn("input-wrapper",l&&"input-wrapper--full-width"),"data-cy":`${s}-wrapper`,"data-testid":`${r}-wrapper`,children:[o&&t.jsx("label",{htmlFor:a,className:"input__label","data-cy":`${s}-label`,"data-testid":`${r}-label`,children:o}),t.jsx("input",{ref:f,id:a,type:n?"text":"password",className:u.cn("input","password-input",e&&"input--error",l&&"input--full-width",x),"aria-invalid":e?"true":"false","aria-describedby":e?c:i?p:void 0,"data-cy":s,"data-testid":r,...k}),e&&t.jsx("span",{id:c,className:"input__error",role:"alert","data-cy":`${s}-error`,"data-testid":`${r}-error`,children:e}),i&&!e&&t.jsx("span",{id:p,className:"input__helper","data-cy":`${s}-helper`,"data-testid":`${r}-helper`,children:i})]}),h&&t.jsx("button",{type:"button",className:"password-input__toggle",onClick:$,"aria-label":n?"Hide password":"Show password","data-cy":`${s}-toggle`,"data-testid":`${r}-toggle`,children:n?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("path",{d:"M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),t.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]}):t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[t.jsx("path",{d:"M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),t.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),t.jsx("path",{d:"M3 3l14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]})});w.displayName="PasswordInput";exports.PasswordInput=w;