@adam-milo/ui 1.0.17 → 1.0.19

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 (43) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +43 -39
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +59 -109
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +109 -82
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +81 -31
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +33 -106
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +333 -33
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +113 -9
  15. package/dist/index16.cjs +1 -0
  16. package/dist/index16.js +43 -0
  17. package/dist/index17.cjs +1 -0
  18. package/dist/index17.js +11 -0
  19. package/dist/index2.cjs +1 -1
  20. package/dist/index2.js +1 -1
  21. package/dist/index3.cjs +1 -1
  22. package/dist/index3.js +1 -1
  23. package/dist/index4.cjs +1 -1
  24. package/dist/index4.js +1 -1
  25. package/dist/index5.cjs +1 -1
  26. package/dist/index5.js +1 -1
  27. package/dist/index6.cjs +1 -1
  28. package/dist/index6.js +1 -1
  29. package/dist/index7.cjs +1 -1
  30. package/dist/index7.js +43 -38
  31. package/dist/index8.cjs +1 -1
  32. package/dist/index8.js +81 -53
  33. package/dist/index9.cjs +1 -1
  34. package/dist/index9.js +52 -60
  35. package/dist/src/components/data-display/chip-group/ChipGroup.component.d.ts +72 -0
  36. package/dist/src/components/data-display/chip-group/ChipGroup.component.d.ts.map +1 -0
  37. package/dist/src/components/forms/checkbox/Checkbox.component.d.ts.map +1 -1
  38. package/dist/src/components/forms/radio/Radio.component.d.ts +100 -0
  39. package/dist/src/components/forms/radio/Radio.component.d.ts.map +1 -0
  40. package/dist/src/index.d.ts +4 -0
  41. package/dist/src/index.d.ts.map +1 -1
  42. package/dist/style.css +1 -1
  43. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index2.cjs"),i=require("./index3.cjs"),c=require("./index4.cjs"),l=require("./index5.cjs"),s=require("./index6.cjs"),u=require("./index7.cjs"),t=require("./index8.cjs"),p=require("./index9.cjs"),o=require("./index10.cjs"),g=require("./index11.cjs"),D=require("./index12.cjs"),e=require("./index13.cjs"),d=require("./index14.cjs"),r=require("./index15.cjs"),n=require("@adam-milo/icons");exports.Button=a.Button;exports.EmailInput=i.EmailInput;exports.PasswordInput=c.PasswordInput;exports.NumericInput=l.NumericInput;exports.AlphanumericInput=s.AlphanumericInput;exports.Checkbox=u.Checkbox;exports.Tabs=t.Tabs;exports.TabsContent=t.TabsContent;exports.TabsList=t.TabsList;exports.TabsTrigger=t.TabsTrigger;exports.Alert=p.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.Chip=D.Chip;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=d.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});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index2.cjs"),i=require("./index3.cjs"),c=require("./index4.cjs"),l=require("./index5.cjs"),u=require("./index6.cjs"),p=require("./index7.cjs"),s=require("./index8.cjs"),t=require("./index9.cjs"),g=require("./index10.cjs"),o=require("./index11.cjs"),d=require("./index12.cjs"),C=require("./index13.cjs"),D=require("./index14.cjs"),e=require("./index15.cjs"),m=require("./index16.cjs"),r=require("./index17.cjs"),n=require("@adam-milo/icons");exports.Button=a.Button;exports.EmailInput=i.EmailInput;exports.PasswordInput=c.PasswordInput;exports.NumericInput=l.NumericInput;exports.AlphanumericInput=u.AlphanumericInput;exports.Checkbox=p.Checkbox;exports.Radio=s.Radio;exports.Tabs=t.Tabs;exports.TabsContent=t.TabsContent;exports.TabsList=t.TabsList;exports.TabsTrigger=t.TabsTrigger;exports.Alert=g.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=d.DataTable;exports.Chip=C.Chip;exports.ChipGroup=D.ChipGroup;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=m.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,51 +1,55 @@
1
1
  import { Button as e } from "./index2.js";
2
2
  import { EmailInput as a } from "./index3.js";
3
- import { PasswordInput as p } from "./index4.js";
3
+ import { PasswordInput as i } from "./index4.js";
4
4
  import { NumericInput as m } from "./index5.js";
5
5
  import { AlphanumericInput as x } from "./index6.js";
6
6
  import { Checkbox as g } from "./index7.js";
7
- import { Tabs as C, TabsContent as s, TabsList as d, TabsTrigger as c } from "./index8.js";
8
- import { Alert as b } from "./index9.js";
9
- import { Card as I, CardContent as h, CardDescription as k, CardFooter as v, CardHeader as A, CardTitle as F } from "./index10.js";
10
- import { DataTable as P } from "./index11.js";
11
- import { Chip as y } from "./index12.js";
12
- import { Dialog as E, DialogClose as L, DialogContent as N, DialogDescription as O, DialogFooter as S, DialogHeader as j, DialogOverlay as q, DialogPortal as z, DialogTitle as G, DialogTrigger as J } from "./index13.js";
13
- import { Stack as M } from "./index14.js";
14
- import { cn as R, generateId as U } from "./index15.js";
15
- import { Icon as W, availableIcons as X } from "@adam-milo/icons";
7
+ import { Radio as D } from "./index8.js";
8
+ import { Tabs as s, TabsContent as c, TabsList as T, TabsTrigger as u } from "./index9.js";
9
+ import { Alert as I } from "./index10.js";
10
+ import { Card as k, CardContent as v, CardDescription as A, CardFooter as F, CardHeader as H, CardTitle as P } from "./index11.js";
11
+ import { DataTable as y } from "./index12.js";
12
+ import { Chip as E } from "./index13.js";
13
+ import { ChipGroup as L } from "./index14.js";
14
+ import { Dialog as O, DialogClose as R, DialogContent as S, DialogDescription as j, DialogFooter as q, DialogHeader as z, DialogOverlay as J, DialogPortal as K, DialogTitle as M, DialogTrigger as Q } from "./index15.js";
15
+ import { Stack as V } from "./index16.js";
16
+ import { cn as X, generateId as Y } from "./index17.js";
17
+ import { Icon as _, availableIcons as $ } from "@adam-milo/icons";
16
18
  export {
17
- b as Alert,
19
+ I as Alert,
18
20
  x as AlphanumericInput,
19
21
  e as Button,
20
- I as Card,
21
- h as CardContent,
22
- k as CardDescription,
23
- v as CardFooter,
24
- A as CardHeader,
25
- F as CardTitle,
22
+ k as Card,
23
+ v as CardContent,
24
+ A as CardDescription,
25
+ F as CardFooter,
26
+ H as CardHeader,
27
+ P as CardTitle,
26
28
  g as Checkbox,
27
- y as Chip,
28
- P as DataTable,
29
- E as Dialog,
30
- L as DialogClose,
31
- N as DialogContent,
32
- O as DialogDescription,
33
- S as DialogFooter,
34
- j as DialogHeader,
35
- q as DialogOverlay,
36
- z as DialogPortal,
37
- G as DialogTitle,
38
- J as DialogTrigger,
29
+ E as Chip,
30
+ L as ChipGroup,
31
+ y as DataTable,
32
+ O as Dialog,
33
+ R as DialogClose,
34
+ S as DialogContent,
35
+ j as DialogDescription,
36
+ q as DialogFooter,
37
+ z as DialogHeader,
38
+ J as DialogOverlay,
39
+ K as DialogPortal,
40
+ M as DialogTitle,
41
+ Q as DialogTrigger,
39
42
  a as EmailInput,
40
- W as Icon,
43
+ _ as Icon,
41
44
  m as NumericInput,
42
- p as PasswordInput,
43
- M as Stack,
44
- C as Tabs,
45
- s as TabsContent,
46
- d as TabsList,
47
- c as TabsTrigger,
48
- X as availableIcons,
49
- R as cn,
50
- U as generateId
45
+ i as PasswordInput,
46
+ D as Radio,
47
+ V as Stack,
48
+ s as Tabs,
49
+ c as TabsContent,
50
+ T as TabsList,
51
+ u as TabsTrigger,
52
+ $ as availableIcons,
53
+ X as cn,
54
+ Y as generateId
51
55
  };
package/dist/index10.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("react"),o=require("./index15.cjs");;/* empty css */const l=i.forwardRef(({variant:a="default",className:t,children:d,"data-cy":e,"data-testid":r,...c},s)=>{const p=e||`card-${a}`,N=r||`card-${a}`;return n.jsx("div",{ref:s,className:o.cn("card",`card--${a}`,t),"data-cy":p,"data-testid":N,...c,children:d})});l.displayName="Card";const f=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-header",s=d||"card-header";return n.jsx("div",{ref:r,className:o.cn("card-header",a),"data-cy":c,"data-testid":s,...e})});f.displayName="CardHeader";const C=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-title",s=d||"card-title";return n.jsx("h3",{ref:r,className:o.cn("card-title",a),"data-cy":c,"data-testid":s,...e})});C.displayName="CardTitle";const y=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-description",s=d||"card-description";return n.jsx("p",{ref:r,className:o.cn("card-description",a),"data-cy":c,"data-testid":s,...e})});y.displayName="CardDescription";const u=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-content",s=d||"card-content";return n.jsx("div",{ref:r,className:o.cn("card-content",a),"data-cy":c,"data-testid":s,...e})});u.displayName="CardContent";const m=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-footer",s=d||"card-footer";return n.jsx("div",{ref:r,className:o.cn("card-footer",a),"data-cy":c,"data-testid":s,...e})});m.displayName="CardFooter";exports.Card=l;exports.CardContent=u;exports.CardDescription=y;exports.CardFooter=m;exports.CardHeader=f;exports.CardTitle=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),f=require("./index17.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;
package/dist/index10.js CHANGED
@@ -1,119 +1,69 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as n } from "react";
3
- import { cn as o } from "./index15.js";
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 "./index17.js";
4
4
  /* empty css */
5
- const f = n(
5
+ const _ = y(
6
6
  ({
7
- variant: a = "default",
8
- className: t,
9
- children: d,
10
- "data-cy": e,
11
- "data-testid": r,
12
- ...c
13
- }, s) => {
14
- const l = e || `card-${a}`, y = r || `card-${a}`;
15
- return /* @__PURE__ */ i(
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}`;
22
+ return /* @__PURE__ */ c(
16
23
  "div",
17
24
  {
18
- ref: s,
19
- className: o("card", `card--${a}`, t),
20
- "data-cy": l,
21
- "data-testid": y,
22
- ...c,
23
- children: d
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
+ ]
24
62
  }
25
63
  );
26
64
  }
27
65
  );
28
- f.displayName = "Card";
29
- const C = n(
30
- ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
31
- const c = t || "card-header", s = d || "card-header";
32
- return /* @__PURE__ */ i(
33
- "div",
34
- {
35
- ref: r,
36
- className: o("card-header", a),
37
- "data-cy": c,
38
- "data-testid": s,
39
- ...e
40
- }
41
- );
42
- }
43
- );
44
- C.displayName = "CardHeader";
45
- const m = n(
46
- ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
47
- const c = t || "card-title", s = d || "card-title";
48
- return (
49
- // eslint-disable-next-line jsx-a11y/heading-has-content
50
- /* @__PURE__ */ i(
51
- "h3",
52
- {
53
- ref: r,
54
- className: o("card-title", a),
55
- "data-cy": c,
56
- "data-testid": s,
57
- ...e
58
- }
59
- )
60
- );
61
- }
62
- );
63
- m.displayName = "CardTitle";
64
- const p = n(
65
- ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
66
- const c = t || "card-description", s = d || "card-description";
67
- return /* @__PURE__ */ i(
68
- "p",
69
- {
70
- ref: r,
71
- className: o("card-description", a),
72
- "data-cy": c,
73
- "data-testid": s,
74
- ...e
75
- }
76
- );
77
- }
78
- );
79
- p.displayName = "CardDescription";
80
- const N = n(
81
- ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
82
- const c = t || "card-content", s = d || "card-content";
83
- return /* @__PURE__ */ i(
84
- "div",
85
- {
86
- ref: r,
87
- className: o("card-content", a),
88
- "data-cy": c,
89
- "data-testid": s,
90
- ...e
91
- }
92
- );
93
- }
94
- );
95
- N.displayName = "CardContent";
96
- const D = n(
97
- ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
98
- const c = t || "card-footer", s = d || "card-footer";
99
- return /* @__PURE__ */ i(
100
- "div",
101
- {
102
- ref: r,
103
- className: o("card-footer", a),
104
- "data-cy": c,
105
- "data-testid": s,
106
- ...e
107
- }
108
- );
109
- }
110
- );
111
- D.displayName = "CardFooter";
66
+ _.displayName = "Alert";
112
67
  export {
113
- f as Card,
114
- N as CardContent,
115
- p as CardDescription,
116
- D as CardFooter,
117
- C as CardHeader,
118
- m as CardTitle
68
+ _ as Alert
119
69
  };
package/dist/index11.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),j=require("react"),c=require("./index15.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("react"),o=require("./index17.cjs");;/* empty css */const l=i.forwardRef(({variant:a="default",className:t,children:d,"data-cy":e,"data-testid":r,...c},s)=>{const p=e||`card-${a}`,N=r||`card-${a}`;return n.jsx("div",{ref:s,className:o.cn("card",`card--${a}`,t),"data-cy":p,"data-testid":N,...c,children:d})});l.displayName="Card";const f=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-header",s=d||"card-header";return n.jsx("div",{ref:r,className:o.cn("card-header",a),"data-cy":c,"data-testid":s,...e})});f.displayName="CardHeader";const C=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-title",s=d||"card-title";return n.jsx("h3",{ref:r,className:o.cn("card-title",a),"data-cy":c,"data-testid":s,...e})});C.displayName="CardTitle";const y=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-description",s=d||"card-description";return n.jsx("p",{ref:r,className:o.cn("card-description",a),"data-cy":c,"data-testid":s,...e})});y.displayName="CardDescription";const u=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-content",s=d||"card-content";return n.jsx("div",{ref:r,className:o.cn("card-content",a),"data-cy":c,"data-testid":s,...e})});u.displayName="CardContent";const m=i.forwardRef(({className:a,"data-cy":t,"data-testid":d,...e},r)=>{const c=t||"card-footer",s=d||"card-footer";return n.jsx("div",{ref:r,className:o.cn("card-footer",a),"data-cy":c,"data-testid":s,...e})});m.displayName="CardFooter";exports.Card=l;exports.CardContent=u;exports.CardDescription=y;exports.CardFooter=m;exports.CardHeader=f;exports.CardTitle=C;
package/dist/index11.js CHANGED
@@ -1,92 +1,119 @@
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 "./index15.js";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as n } from "react";
3
+ import { cn as o } from "./index17.js";
4
4
  /* empty css */
5
- const n = f(
5
+ const f = n(
6
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(
7
+ variant: a = "default",
8
+ className: t,
9
+ children: d,
10
+ "data-cy": e,
11
+ "data-testid": r,
12
+ ...c
13
+ }, s) => {
14
+ const l = e || `card-${a}`, y = r || `card-${a}`;
15
+ return /* @__PURE__ */ i(
18
16
  "div",
19
17
  {
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
- )
18
+ ref: s,
19
+ className: o("card", `card--${a}`, t),
20
+ "data-cy": l,
21
+ "data-testid": y,
22
+ ...c,
23
+ children: d
85
24
  }
86
25
  );
87
26
  }
88
27
  );
89
- n.displayName = "DataTable";
28
+ f.displayName = "Card";
29
+ const C = n(
30
+ ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
31
+ const c = t || "card-header", s = d || "card-header";
32
+ return /* @__PURE__ */ i(
33
+ "div",
34
+ {
35
+ ref: r,
36
+ className: o("card-header", a),
37
+ "data-cy": c,
38
+ "data-testid": s,
39
+ ...e
40
+ }
41
+ );
42
+ }
43
+ );
44
+ C.displayName = "CardHeader";
45
+ const m = n(
46
+ ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
47
+ const c = t || "card-title", s = d || "card-title";
48
+ return (
49
+ // eslint-disable-next-line jsx-a11y/heading-has-content
50
+ /* @__PURE__ */ i(
51
+ "h3",
52
+ {
53
+ ref: r,
54
+ className: o("card-title", a),
55
+ "data-cy": c,
56
+ "data-testid": s,
57
+ ...e
58
+ }
59
+ )
60
+ );
61
+ }
62
+ );
63
+ m.displayName = "CardTitle";
64
+ const p = n(
65
+ ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
66
+ const c = t || "card-description", s = d || "card-description";
67
+ return /* @__PURE__ */ i(
68
+ "p",
69
+ {
70
+ ref: r,
71
+ className: o("card-description", a),
72
+ "data-cy": c,
73
+ "data-testid": s,
74
+ ...e
75
+ }
76
+ );
77
+ }
78
+ );
79
+ p.displayName = "CardDescription";
80
+ const N = n(
81
+ ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
82
+ const c = t || "card-content", s = d || "card-content";
83
+ return /* @__PURE__ */ i(
84
+ "div",
85
+ {
86
+ ref: r,
87
+ className: o("card-content", a),
88
+ "data-cy": c,
89
+ "data-testid": s,
90
+ ...e
91
+ }
92
+ );
93
+ }
94
+ );
95
+ N.displayName = "CardContent";
96
+ const D = n(
97
+ ({ className: a, "data-cy": t, "data-testid": d, ...e }, r) => {
98
+ const c = t || "card-footer", s = d || "card-footer";
99
+ return /* @__PURE__ */ i(
100
+ "div",
101
+ {
102
+ ref: r,
103
+ className: o("card-footer", a),
104
+ "data-cy": c,
105
+ "data-testid": s,
106
+ ...e
107
+ }
108
+ );
109
+ }
110
+ );
111
+ D.displayName = "CardFooter";
90
112
  export {
91
- n as DataTable
113
+ f as Card,
114
+ N as CardContent,
115
+ p as CardDescription,
116
+ D as CardFooter,
117
+ C as CardHeader,
118
+ m as CardTitle
92
119
  };
package/dist/index12.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("react"),u=require("./index15.cjs");;/* empty css */const c=h.forwardRef(({variant:e="primary",selected:i=!1,disabled:s=!1,className:r,children:a,"data-testid":d,"data-cy":p,...l},o)=>{const n=u.cn("chip",`chip--${e}`,i&&"chip--selected",s&&"chip--disabled",r);return t.jsx("div",{ref:o,className:n,"data-testid":d||`chip-${e}`,"data-cy":p||`chip-${e}`,"aria-selected":i,"aria-disabled":s,"aria-label":typeof a=="string"?a:void 0,...l,children:t.jsx("span",{className:"chip__label",children:a})})});c.displayName="Chip";exports.Chip=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),j=require("react"),c=require("./index17.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/index12.js CHANGED
@@ -1,42 +1,92 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { cn as f } from "./index15.js";
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 "./index17.js";
4
4
  /* empty css */
5
- const h = m(
5
+ const n = f(
6
6
  ({
7
- variant: a = "primary",
8
- selected: s = !1,
9
- disabled: p = !1,
10
- className: t,
11
- children: i,
12
- "data-testid": c,
13
- "data-cy": r,
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
14
  ...o
15
- }, d) => {
16
- const l = f(
17
- "chip",
18
- `chip--${a}`,
19
- s && "chip--selected",
20
- p && "chip--disabled",
21
- t
22
- );
23
- return /* @__PURE__ */ e(
15
+ }, _) => {
16
+ const t = $ || "datatable", e = p || "datatable";
17
+ return /* @__PURE__ */ a(
24
18
  "div",
25
19
  {
26
- ref: d,
27
- className: l,
28
- "data-testid": c || `chip-${a}`,
29
- "data-cy": r || `chip-${a}`,
30
- "aria-selected": s,
31
- "aria-disabled": p,
32
- "aria-label": typeof i == "string" ? i : void 0,
33
- ...o,
34
- children: /* @__PURE__ */ e("span", { className: "chip__label", children: i })
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
+ )
35
85
  }
36
86
  );
37
87
  }
38
88
  );
39
- h.displayName = "Chip";
89
+ n.displayName = "DataTable";
40
90
  export {
41
- h as Chip
91
+ n as DataTable
42
92
  };