@adam-milo/ui 1.0.32 → 1.0.34

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 (152) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +58 -22
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +94 -56
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +199 -40
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +305 -105
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +260 -74
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +135 -27
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +52 -469
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +57 -111
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +101 -20
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +76 -21
  21. package/dist/index19.cjs +1 -1
  22. package/dist/index19.js +25 -29
  23. package/dist/index2.cjs +1 -1
  24. package/dist/index2.js +6 -4
  25. package/dist/index20.cjs +1 -1
  26. package/dist/index20.js +468 -31
  27. package/dist/index21.cjs +1 -1
  28. package/dist/index21.js +155 -41
  29. package/dist/index22.cjs +1 -1
  30. package/dist/index22.js +42 -12
  31. package/dist/index23.cjs +1 -0
  32. package/dist/index23.js +38 -0
  33. package/dist/index24.cjs +1 -1
  34. package/dist/index24.js +32 -287
  35. package/dist/index25.cjs +1 -1
  36. package/dist/index25.js +115 -13
  37. package/dist/index26.cjs +1 -0
  38. package/dist/index26.js +55 -0
  39. package/dist/index27.cjs +1 -0
  40. package/dist/index27.js +45 -0
  41. package/dist/index28.cjs +1 -0
  42. package/dist/index28.js +53 -0
  43. package/dist/index29.cjs +1 -0
  44. package/dist/index29.js +55 -0
  45. package/dist/index3.cjs +1 -1
  46. package/dist/index3.js +33 -33
  47. package/dist/index30.cjs +1 -0
  48. package/dist/index30.js +72 -0
  49. package/dist/index31.cjs +1 -0
  50. package/dist/index31.js +14 -0
  51. package/dist/index32.cjs +1 -0
  52. package/dist/index32.js +332 -0
  53. package/dist/index36.cjs +1 -0
  54. package/dist/index36.js +386 -0
  55. package/dist/index37.cjs +1 -0
  56. package/dist/index37.js +16 -0
  57. package/dist/index4.cjs +1 -1
  58. package/dist/index4.js +59 -11
  59. package/dist/index5.cjs +1 -1
  60. package/dist/index5.js +19 -35
  61. package/dist/index6.cjs +1 -1
  62. package/dist/index6.js +11 -101
  63. package/dist/index62.cjs +1 -0
  64. package/dist/index62.js +502 -0
  65. package/dist/index64.cjs +1 -0
  66. package/dist/index64.js +11 -0
  67. package/dist/index65.cjs +1 -0
  68. package/dist/index65.js +39 -0
  69. package/dist/index66.cjs +1 -0
  70. package/dist/index66.js +64 -0
  71. package/dist/index67.cjs +1 -0
  72. package/dist/index67.js +212 -0
  73. package/dist/index68.cjs +1 -0
  74. package/dist/index68.js +14 -0
  75. package/dist/index69.cjs +1 -0
  76. package/dist/index69.js +293 -0
  77. package/dist/index7.cjs +1 -1
  78. package/dist/index7.js +46 -97
  79. package/dist/index70.cjs +1 -0
  80. package/dist/index70.js +18 -0
  81. package/dist/index71.cjs +1 -0
  82. package/dist/index71.js +129 -0
  83. package/dist/index72.cjs +1 -0
  84. package/dist/index72.js +43 -0
  85. package/dist/index73.cjs +1 -0
  86. package/dist/index73.js +99 -0
  87. package/dist/index74.cjs +1 -0
  88. package/dist/index74.js +71 -0
  89. package/dist/index75.cjs +1 -0
  90. package/dist/index75.js +36 -0
  91. package/dist/index76.cjs +1 -0
  92. package/dist/index76.js +14 -0
  93. package/dist/index77.cjs +1 -0
  94. package/dist/index77.js +17 -0
  95. package/dist/index78.cjs +1 -0
  96. package/dist/index78.js +6 -0
  97. package/dist/index79.cjs +1 -0
  98. package/dist/index79.js +297 -0
  99. package/dist/index8.cjs +1 -1
  100. package/dist/index8.js +97 -88
  101. package/dist/index80.cjs +1 -0
  102. package/dist/index80.js +25 -0
  103. package/dist/index81.cjs +1 -0
  104. package/dist/index81.js +39 -0
  105. package/dist/index82.cjs +1 -0
  106. package/dist/index82.js +625 -0
  107. package/dist/index83.cjs +1 -0
  108. package/dist/index83.js +721 -0
  109. package/dist/index84.cjs +1 -0
  110. package/dist/index84.js +154 -0
  111. package/dist/index85.cjs +1 -0
  112. package/dist/index85.js +173 -0
  113. package/dist/index9.cjs +1 -1
  114. package/dist/index9.js +55 -197
  115. package/dist/src/components/core/button/Button.component.d.ts +13 -7
  116. package/dist/src/components/core/button/Button.component.d.ts.map +1 -1
  117. package/dist/src/components/core/icon/Icon.component.d.ts +1 -1
  118. package/dist/src/components/core/icon/Icon.component.d.ts.map +1 -1
  119. package/dist/src/components/core/icon-button/IconButton.component.d.ts +36 -0
  120. package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -0
  121. package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts +79 -0
  122. package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts.map +1 -0
  123. package/dist/src/components/feedback/spinner/Spinner.component.d.ts +62 -0
  124. package/dist/src/components/feedback/spinner/Spinner.component.d.ts.map +1 -0
  125. package/dist/src/components/forms/input/Input.component.d.ts +5 -0
  126. package/dist/src/components/forms/input/Input.component.d.ts.map +1 -1
  127. package/dist/src/components/forms/otp-input/OTPInput.component.d.ts +82 -0
  128. package/dist/src/components/forms/otp-input/OTPInput.component.d.ts.map +1 -0
  129. package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts +96 -0
  130. package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -0
  131. package/dist/src/components/forms/phone-input/countries.d.ts +93 -0
  132. package/dist/src/components/forms/phone-input/countries.d.ts.map +1 -0
  133. package/dist/src/components/forms/select/Select.component.d.ts +5 -1
  134. package/dist/src/components/forms/select/Select.component.d.ts.map +1 -1
  135. package/dist/src/components/forms/toggle/Toggle.component.d.ts +80 -0
  136. package/dist/src/components/forms/toggle/Toggle.component.d.ts.map +1 -0
  137. package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts +86 -0
  138. package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts.map +1 -0
  139. package/dist/src/components/overlays/dialog/Dialog.component.d.ts +36 -2
  140. package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
  141. package/dist/src/components/typography/heading/Heading.component.d.ts +92 -0
  142. package/dist/src/components/typography/heading/Heading.component.d.ts.map +1 -0
  143. package/dist/src/components/typography/link/Link.component.d.ts +80 -0
  144. package/dist/src/components/typography/link/Link.component.d.ts.map +1 -0
  145. package/dist/src/index.d.ts +24 -5
  146. package/dist/src/index.d.ts.map +1 -1
  147. package/dist/style.css +1 -1
  148. package/package.json +2 -1
  149. /package/dist/{index35.cjs → index50.cjs} +0 -0
  150. /package/dist/{index35.js → index50.js} +0 -0
  151. /package/dist/{index42.cjs → index61.cjs} +0 -0
  152. /package/dist/{index42.js → index61.js} +0 -0
package/dist/index16.js CHANGED
@@ -1,125 +1,71 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import * as DialogPrimitive from "@radix-ui/react-dialog";
4
- import { cn } from "./index22.js";
3
+ import { cn } from "./index31.js";
5
4
  /* empty css */
6
- const Dialog = DialogPrimitive.Root;
7
- const DialogTrigger = DialogPrimitive.Trigger;
8
- const DialogPortal = DialogPrimitive.Portal;
9
- const DialogClose = DialogPrimitive.Close;
10
- const DialogOverlay = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
11
- const finalDataCy = dataCy || "dialog-overlay";
12
- const finalTestId = dataTestId || "dialog-overlay";
13
- return /* @__PURE__ */ jsx(
14
- DialogPrimitive.Overlay,
15
- {
16
- ref,
17
- className: cn("dialog-overlay", className),
18
- "data-cy": finalDataCy,
19
- "data-testid": finalTestId,
20
- ...props
21
- }
22
- );
23
- });
24
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
25
- const DialogContent = forwardRef(({ className, children, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
26
- const finalDataCy = dataCy || "dialog-content";
27
- const finalTestId = dataTestId || "dialog-content";
28
- return /* @__PURE__ */ jsxs(DialogPortal, { children: [
29
- /* @__PURE__ */ jsx(DialogOverlay, {}),
30
- /* @__PURE__ */ jsx(
31
- DialogPrimitive.Content,
5
+ const Alert = forwardRef(
6
+ ({
7
+ variant = "info",
8
+ title,
9
+ icon,
10
+ className,
11
+ children,
12
+ "data-cy": dataCy,
13
+ "data-testid": dataTestId,
14
+ ...props
15
+ }, ref) => {
16
+ const roleMap = {
17
+ info: "status",
18
+ success: "status",
19
+ warning: "alert",
20
+ error: "alert"
21
+ };
22
+ const finalDataCy = dataCy || `alert-${variant}`;
23
+ const finalTestId = dataTestId || `alert-${variant}`;
24
+ return /* @__PURE__ */ jsxs(
25
+ "div",
32
26
  {
33
27
  ref,
34
- className: cn("dialog-content", className),
28
+ role: roleMap[variant],
29
+ className: cn("alert", `alert--${variant}`, className),
35
30
  "data-cy": finalDataCy,
36
31
  "data-testid": finalTestId,
37
32
  ...props,
38
- children
39
- }
40
- )
41
- ] });
42
- });
43
- DialogContent.displayName = DialogPrimitive.Content.displayName;
44
- const DialogHeader = ({
45
- className,
46
- "data-cy": dataCy,
47
- "data-testid": dataTestId,
48
- ...props
49
- }) => {
50
- const finalDataCy = dataCy || "dialog-header";
51
- const finalTestId = dataTestId || "dialog-header";
52
- return /* @__PURE__ */ jsx(
53
- "div",
54
- {
55
- className: cn("dialog-header", className),
56
- "data-cy": finalDataCy,
57
- "data-testid": finalTestId,
58
- ...props
59
- }
60
- );
61
- };
62
- DialogHeader.displayName = "DialogHeader";
63
- const DialogFooter = ({
64
- className,
65
- "data-cy": dataCy,
66
- "data-testid": dataTestId,
67
- ...props
68
- }) => {
69
- const finalDataCy = dataCy || "dialog-footer";
70
- const finalTestId = dataTestId || "dialog-footer";
71
- return /* @__PURE__ */ jsx(
72
- "div",
73
- {
74
- className: cn("dialog-footer", className),
75
- "data-cy": finalDataCy,
76
- "data-testid": finalTestId,
77
- ...props
78
- }
79
- );
80
- };
81
- DialogFooter.displayName = "DialogFooter";
82
- const DialogTitle = forwardRef(
83
- ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
84
- const finalDataCy = dataCy || "dialog-title";
85
- const finalTestId = dataTestId || "dialog-title";
86
- return /* @__PURE__ */ jsx(
87
- DialogPrimitive.Title,
88
- {
89
- ref,
90
- className: cn("dialog-title", className),
91
- "data-cy": finalDataCy,
92
- "data-testid": finalTestId,
93
- ...props
33
+ children: [
34
+ icon && /* @__PURE__ */ jsx(
35
+ "div",
36
+ {
37
+ className: "alert__icon",
38
+ "data-cy": `${finalDataCy}-icon`,
39
+ "data-testid": `${finalTestId}-icon`,
40
+ children: icon
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsxs(
44
+ "div",
45
+ {
46
+ className: "alert__content",
47
+ "data-cy": `${finalDataCy}-content`,
48
+ "data-testid": `${finalTestId}-content`,
49
+ children: [
50
+ title && /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ className: "alert__title",
54
+ "data-cy": `${finalDataCy}-title`,
55
+ "data-testid": `${finalTestId}-title`,
56
+ children: title
57
+ }
58
+ ),
59
+ /* @__PURE__ */ jsx("div", { "data-cy": `${finalDataCy}-message`, "data-testid": `${finalTestId}-message`, children })
60
+ ]
61
+ }
62
+ )
63
+ ]
94
64
  }
95
65
  );
96
66
  }
97
67
  );
98
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
99
- const DialogDescription = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
100
- const finalDataCy = dataCy || "dialog-description";
101
- const finalTestId = dataTestId || "dialog-description";
102
- return /* @__PURE__ */ jsx(
103
- DialogPrimitive.Description,
104
- {
105
- ref,
106
- className: cn("dialog-description", className),
107
- "data-cy": finalDataCy,
108
- "data-testid": finalTestId,
109
- ...props
110
- }
111
- );
112
- });
113
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
68
+ Alert.displayName = "Alert";
114
69
  export {
115
- Dialog,
116
- DialogClose,
117
- DialogContent,
118
- DialogDescription,
119
- DialogFooter,
120
- DialogHeader,
121
- DialogOverlay,
122
- DialogPortal,
123
- DialogTitle,
124
- DialogTrigger
70
+ Alert
125
71
  };
package/dist/index17.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),e=require("./index22.cjs");;/* empty css */const s=a.forwardRef(({direction:a="vertical",spacing:s="4",align:c="stretch",justify:r="start",wrap:i=!1,className:n,children:d,"data-cy":l,"data-testid":o,...u},k)=>{const p=l||`stack-${a}`,j=o||`stack-${a}`;return t.jsx("div",{ref:k,className:e.cn("stack",`stack--${a}`,`stack--spacing-${s}`,`stack--align-${c}`,`stack--justify-${r}`,i&&"stack--wrap",n),"data-cy":p,"data-testid":j,...u,children:d})});s.displayName="Stack",exports.Stack=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),e=require("./index31.cjs");;/* empty css */const r=t.forwardRef(({variant:t="default",className:r,children:d,"data-cy":c,"data-testid":s,...i},o)=>{const n=c||`card-${t}`,l=s||`card-${t}`;return a.jsx("div",{ref:o,className:e.cn("card",`card--${t}`,r),"data-cy":n,"data-testid":l,...i,children:d})});r.displayName="Card";const d=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-header",o=d||"card-header";return a.jsx("div",{ref:s,className:e.cn("card-header",t),"data-cy":i,"data-testid":o,...c})});d.displayName="CardHeader";const c=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-title",o=d||"card-title";return a.jsx("h3",{ref:s,className:e.cn("card-title",t),"data-cy":i,"data-testid":o,...c})});c.displayName="CardTitle";const s=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-description",o=d||"card-description";return a.jsx("p",{ref:s,className:e.cn("card-description",t),"data-cy":i,"data-testid":o,...c})});s.displayName="CardDescription";const i=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-content",o=d||"card-content";return a.jsx("div",{ref:s,className:e.cn("card-content",t),"data-cy":i,"data-testid":o,...c})});i.displayName="CardContent";const o=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-footer",o=d||"card-footer";return a.jsx("div",{ref:s,className:e.cn("card-footer",t),"data-cy":i,"data-testid":o,...c})});o.displayName="CardFooter",exports.Card=r,exports.CardContent=i,exports.CardDescription=s,exports.CardFooter=o,exports.CardHeader=d,exports.CardTitle=c;
package/dist/index17.js CHANGED
@@ -1,35 +1,23 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "./index22.js";
3
+ import { cn } from "./index31.js";
4
4
  /* empty css */
5
- const Stack = forwardRef(
5
+ const Card = forwardRef(
6
6
  ({
7
- direction = "vertical",
8
- spacing = "4",
9
- align = "stretch",
10
- justify = "start",
11
- wrap = false,
7
+ variant = "default",
12
8
  className,
13
9
  children,
14
10
  "data-cy": dataCy,
15
11
  "data-testid": dataTestId,
16
12
  ...props
17
13
  }, ref) => {
18
- const finalDataCy = dataCy || `stack-${direction}`;
19
- const finalTestId = dataTestId || `stack-${direction}`;
14
+ const finalDataCy = dataCy || `card-${variant}`;
15
+ const finalTestId = dataTestId || `card-${variant}`;
20
16
  return /* @__PURE__ */ jsx(
21
17
  "div",
22
18
  {
23
19
  ref,
24
- className: cn(
25
- "stack",
26
- `stack--${direction}`,
27
- `stack--spacing-${spacing}`,
28
- `stack--align-${align}`,
29
- `stack--justify-${justify}`,
30
- wrap && "stack--wrap",
31
- className
32
- ),
20
+ className: cn("card", `card--${variant}`, className),
33
21
  "data-cy": finalDataCy,
34
22
  "data-testid": finalTestId,
35
23
  ...props,
@@ -38,7 +26,100 @@ const Stack = forwardRef(
38
26
  );
39
27
  }
40
28
  );
41
- Stack.displayName = "Stack";
29
+ Card.displayName = "Card";
30
+ const CardHeader = forwardRef(
31
+ ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
32
+ const finalDataCy = dataCy || "card-header";
33
+ const finalTestId = dataTestId || "card-header";
34
+ return /* @__PURE__ */ jsx(
35
+ "div",
36
+ {
37
+ ref,
38
+ className: cn("card-header", className),
39
+ "data-cy": finalDataCy,
40
+ "data-testid": finalTestId,
41
+ ...props
42
+ }
43
+ );
44
+ }
45
+ );
46
+ CardHeader.displayName = "CardHeader";
47
+ const CardTitle = forwardRef(
48
+ ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
49
+ const finalDataCy = dataCy || "card-title";
50
+ const finalTestId = dataTestId || "card-title";
51
+ return (
52
+ // eslint-disable-next-line jsx-a11y/heading-has-content
53
+ /* @__PURE__ */ jsx(
54
+ "h3",
55
+ {
56
+ ref,
57
+ className: cn("card-title", className),
58
+ "data-cy": finalDataCy,
59
+ "data-testid": finalTestId,
60
+ ...props
61
+ }
62
+ )
63
+ );
64
+ }
65
+ );
66
+ CardTitle.displayName = "CardTitle";
67
+ const CardDescription = forwardRef(
68
+ ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
69
+ const finalDataCy = dataCy || "card-description";
70
+ const finalTestId = dataTestId || "card-description";
71
+ return /* @__PURE__ */ jsx(
72
+ "p",
73
+ {
74
+ ref,
75
+ className: cn("card-description", className),
76
+ "data-cy": finalDataCy,
77
+ "data-testid": finalTestId,
78
+ ...props
79
+ }
80
+ );
81
+ }
82
+ );
83
+ CardDescription.displayName = "CardDescription";
84
+ const CardContent = forwardRef(
85
+ ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
86
+ const finalDataCy = dataCy || "card-content";
87
+ const finalTestId = dataTestId || "card-content";
88
+ return /* @__PURE__ */ jsx(
89
+ "div",
90
+ {
91
+ ref,
92
+ className: cn("card-content", className),
93
+ "data-cy": finalDataCy,
94
+ "data-testid": finalTestId,
95
+ ...props
96
+ }
97
+ );
98
+ }
99
+ );
100
+ CardContent.displayName = "CardContent";
101
+ const CardFooter = forwardRef(
102
+ ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
103
+ const finalDataCy = dataCy || "card-footer";
104
+ const finalTestId = dataTestId || "card-footer";
105
+ return /* @__PURE__ */ jsx(
106
+ "div",
107
+ {
108
+ ref,
109
+ className: cn("card-footer", className),
110
+ "data-cy": finalDataCy,
111
+ "data-testid": finalTestId,
112
+ ...props
113
+ }
114
+ );
115
+ }
116
+ );
117
+ CardFooter.displayName = "CardFooter";
42
118
  export {
43
- Stack
119
+ Card,
120
+ CardContent,
121
+ CardDescription,
122
+ CardFooter,
123
+ CardHeader,
124
+ CardTitle
44
125
  };
package/dist/index18.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index22.cjs");;/* empty css */const a=t.forwardRef(({className:t,maxWidth:a="lg",padding:n="md","data-cy":i,"data-testid":d,children:c,...s},o)=>{const l=i||"container",u=d||"container";return e.jsx("div",{ref:o,className:r.cn("container",`container--max-width-${a}`,`container--padding-${n}`,t),"data-cy":l,"data-testid":u,...s,children:c})});a.displayName="Container",exports.Container=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("react"),t=require("./index31.cjs");;/* empty css */const d=e.forwardRef(({columns:e,data:d,striped:r=!1,hoverable:l=!1,className:s,"data-cy":c,"data-testid":i,...y},o)=>{const b=c||"datatable",n=i||"datatable";return a.jsx("div",{className:"datatable-wrapper","data-cy":`${b}-wrapper`,"data-testid":`${n}-wrapper`,children:a.jsxs("table",{ref:o,className:t.cn("datatable",s),"data-cy":b,"data-testid":n,...y,children:[a.jsx("thead",{className:"datatable__head","data-cy":`${b}-head`,"data-testid":`${n}-head`,children:a.jsx("tr",{children:e.map(e=>a.jsx("th",{className:"datatable__header-cell","data-cy":`${b}-header-${e.key}`,"data-testid":`${n}-header-${e.key}`,children:e.header},e.key))})}),a.jsx("tbody",{"data-cy":`${b}-body`,"data-testid":`${n}-body`,children:0===d.length?a.jsx("tr",{children:a.jsx("td",{colSpan:e.length,className:"datatable__empty","data-cy":`${b}-empty`,"data-testid":`${n}-empty`,children:"No data available"})}):d.map((d,s)=>a.jsx("tr",{className:t.cn("datatable__body-row",l&&"datatable__body-row--hoverable",r&&"datatable__body-row--striped"),"data-cy":`${b}-row-${s}`,"data-testid":`${n}-row-${s}`,children:e.map(e=>a.jsx("td",{className:"datatable__body-cell","data-cy":`${b}-cell-${s}-${e.key}`,"data-testid":`${n}-cell-${s}-${e.key}`,children:String(d[e.key]??"")},e.key))},s))})]})})});d.displayName="DataTable",exports.DataTable=d;
package/dist/index18.js CHANGED
@@ -1,38 +1,93 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "./index22.js";
3
+ import { cn } from "./index31.js";
4
4
  /* empty css */
5
- const Container = forwardRef(
5
+ const DataTable = forwardRef(
6
6
  ({
7
+ columns,
8
+ data,
9
+ striped = false,
10
+ hoverable = false,
7
11
  className,
8
- maxWidth = "lg",
9
- padding = "md",
10
12
  "data-cy": dataCy,
11
13
  "data-testid": dataTestId,
12
- children,
13
14
  ...props
14
15
  }, ref) => {
15
- const finalDataCy = dataCy || "container";
16
- const finalTestId = dataTestId || "container";
16
+ const finalDataCy = dataCy || "datatable";
17
+ const finalTestId = dataTestId || "datatable";
17
18
  return /* @__PURE__ */ jsx(
18
19
  "div",
19
20
  {
20
- ref,
21
- className: cn(
22
- "container",
23
- `container--max-width-${maxWidth}`,
24
- `container--padding-${padding}`,
25
- className
26
- ),
27
- "data-cy": finalDataCy,
28
- "data-testid": finalTestId,
29
- ...props,
30
- children
21
+ className: "datatable-wrapper",
22
+ "data-cy": `${finalDataCy}-wrapper`,
23
+ "data-testid": `${finalTestId}-wrapper`,
24
+ children: /* @__PURE__ */ jsxs(
25
+ "table",
26
+ {
27
+ ref,
28
+ className: cn("datatable", className),
29
+ "data-cy": finalDataCy,
30
+ "data-testid": finalTestId,
31
+ ...props,
32
+ children: [
33
+ /* @__PURE__ */ jsx(
34
+ "thead",
35
+ {
36
+ className: "datatable__head",
37
+ "data-cy": `${finalDataCy}-head`,
38
+ "data-testid": `${finalTestId}-head`,
39
+ children: /* @__PURE__ */ jsx("tr", { children: columns.map((column) => /* @__PURE__ */ jsx(
40
+ "th",
41
+ {
42
+ className: "datatable__header-cell",
43
+ "data-cy": `${finalDataCy}-header-${column.key}`,
44
+ "data-testid": `${finalTestId}-header-${column.key}`,
45
+ children: column.header
46
+ },
47
+ column.key
48
+ )) })
49
+ }
50
+ ),
51
+ /* @__PURE__ */ jsx("tbody", { "data-cy": `${finalDataCy}-body`, "data-testid": `${finalTestId}-body`, children: data.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
52
+ "td",
53
+ {
54
+ colSpan: columns.length,
55
+ className: "datatable__empty",
56
+ "data-cy": `${finalDataCy}-empty`,
57
+ "data-testid": `${finalTestId}-empty`,
58
+ children: "No data available"
59
+ }
60
+ ) }) : data.map((row, rowIndex) => /* @__PURE__ */ jsx(
61
+ "tr",
62
+ {
63
+ className: cn(
64
+ "datatable__body-row",
65
+ hoverable && "datatable__body-row--hoverable",
66
+ striped && "datatable__body-row--striped"
67
+ ),
68
+ "data-cy": `${finalDataCy}-row-${rowIndex}`,
69
+ "data-testid": `${finalTestId}-row-${rowIndex}`,
70
+ children: columns.map((column) => /* @__PURE__ */ jsx(
71
+ "td",
72
+ {
73
+ className: "datatable__body-cell",
74
+ "data-cy": `${finalDataCy}-cell-${rowIndex}-${column.key}`,
75
+ "data-testid": `${finalTestId}-cell-${rowIndex}-${column.key}`,
76
+ children: String(row[column.key] ?? "")
77
+ },
78
+ column.key
79
+ ))
80
+ },
81
+ rowIndex
82
+ )) })
83
+ ]
84
+ }
85
+ )
31
86
  }
32
87
  );
33
88
  }
34
89
  );
35
- Container.displayName = "Container";
90
+ DataTable.displayName = "DataTable";
36
91
  export {
37
- Container
92
+ DataTable
38
93
  };
package/dist/index19.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("@radix-ui/react-separator"),i=require("./index22.cjs");function a(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)};/* empty css */const o=a(t),d=r.forwardRef(({orientation:r="horizontal",decorative:t=!0,spacing:a="0",color:d,className:c,style:n,"data-cy":s,"data-testid":u,...l},f)=>{const v=s||`divider-${r}`,g=u||`divider-${r}`;return e.jsx(o.Root,{ref:f,decorative:t,orientation:r,className:i.cn("divider",`divider--${r}`,`divider--spacing-${a}`,c),style:{...d&&{backgroundColor:d},...n},"data-cy":v,"data-testid":g,...l})});d.displayName="Divider",exports.Divider=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),i=require("./index31.cjs");;/* empty css */const r=a.forwardRef(({variant:a="primary",selected:r=!1,disabled:s=!1,className:t,children:c,"data-testid":d,"data-cy":l,...n},p)=>{const h=i.cn("chip",`chip--${a}`,r&&"chip--selected",s&&"chip--disabled",t);return e.jsx("div",{ref:p,className:h,"data-testid":d||`chip-${a}`,"data-cy":l||`chip-${a}`,"aria-selected":r,"aria-disabled":s,"aria-label":"string"==typeof c?c:void 0,...n,children:e.jsx("span",{className:"chip__label",children:c})})});r.displayName="Chip",exports.Chip=r;
package/dist/index19.js CHANGED
@@ -1,46 +1,42 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
4
- import { cn } from "./index22.js";
3
+ import { cn } from "./index31.js";
5
4
  /* empty css */
6
- const Divider = forwardRef(
5
+ const Chip = forwardRef(
7
6
  ({
8
- orientation = "horizontal",
9
- decorative = true,
10
- spacing = "0",
11
- color,
7
+ variant = "primary",
8
+ selected = false,
9
+ disabled = false,
12
10
  className,
13
- style,
14
- "data-cy": dataCy,
11
+ children,
15
12
  "data-testid": dataTestId,
13
+ "data-cy": dataCy,
16
14
  ...props
17
15
  }, ref) => {
18
- const finalDataCy = dataCy || `divider-${orientation}`;
19
- const finalTestId = dataTestId || `divider-${orientation}`;
16
+ const classes = cn(
17
+ "chip",
18
+ `chip--${variant}`,
19
+ selected && "chip--selected",
20
+ disabled && "chip--disabled",
21
+ className
22
+ );
20
23
  return /* @__PURE__ */ jsx(
21
- SeparatorPrimitive.Root,
24
+ "div",
22
25
  {
23
26
  ref,
24
- decorative,
25
- orientation,
26
- className: cn(
27
- "divider",
28
- `divider--${orientation}`,
29
- `divider--spacing-${spacing}`,
30
- className
31
- ),
32
- style: {
33
- ...color && { backgroundColor: color },
34
- ...style
35
- },
36
- "data-cy": finalDataCy,
37
- "data-testid": finalTestId,
38
- ...props
27
+ className: classes,
28
+ "data-testid": dataTestId || `chip-${variant}`,
29
+ "data-cy": dataCy || `chip-${variant}`,
30
+ "aria-selected": selected,
31
+ "aria-disabled": disabled,
32
+ "aria-label": typeof children === "string" ? children : void 0,
33
+ ...props,
34
+ children: /* @__PURE__ */ jsx("span", { className: "chip__label", children })
39
35
  }
40
36
  );
41
37
  }
42
38
  );
43
- Divider.displayName = "Divider";
39
+ Chip.displayName = "Chip";
44
40
  export {
45
- Divider
41
+ Chip
46
42
  };
package/dist/index2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),r=require("./index22.cjs");;/* empty css */const a=e.forwardRef(({variant:e="primary-workspace",fullWidth:a=!1,icon:n,className:s,children:i,disabled:c,"data-testid":d,"data-cy":o,...l},u)=>{const b=r.cn("btn",`btn--${e}`,a&&"btn--full-width",s);return t.jsxs("button",{ref:u,disabled:c,className:b,"data-testid":d||`button-${e}`,"data-cy":o||`button-${e}`,...l,children:[n&&t.jsx("span",{className:"btn__icon",children:n}),i]})});a.displayName="Button",exports.Button=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),n=require("./index31.cjs");;/* empty css */const a=e.forwardRef(({variant:e="main-orange",fullWidth:a=!1,icon:i,iconPosition:s="left",className:r,children:c,disabled:d,"data-testid":o,"data-cy":l,...u},b)=>{const f=n.cn("btn",`btn--${e}`,a&&"btn--full-width",r);return t.jsxs("button",{ref:b,disabled:d,className:f,"data-testid":o||`button-${e}`,"data-cy":l||`button-${e}`,...u,children:[i&&"left"===s&&t.jsx("span",{className:"btn__icon",children:i}),c,i&&"right"===s&&t.jsx("span",{className:"btn__icon",children:i})]})});a.displayName="Button",exports.Button=a;
package/dist/index2.js CHANGED
@@ -1,12 +1,13 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { cn } from "./index22.js";
3
+ import { cn } from "./index31.js";
4
4
  /* empty css */
5
5
  const Button = forwardRef(
6
6
  ({
7
- variant = "primary-workspace",
7
+ variant = "main-orange",
8
8
  fullWidth = false,
9
9
  icon,
10
+ iconPosition = "left",
10
11
  className,
11
12
  children,
12
13
  disabled,
@@ -25,8 +26,9 @@ const Button = forwardRef(
25
26
  "data-cy": dataCy || `button-${variant}`,
26
27
  ...props,
27
28
  children: [
28
- icon && /* @__PURE__ */ jsx("span", { className: "btn__icon", children: icon }),
29
- children
29
+ icon && iconPosition === "left" && /* @__PURE__ */ jsx("span", { className: "btn__icon", children: icon }),
30
+ children,
31
+ icon && iconPosition === "right" && /* @__PURE__ */ jsx("span", { className: "btn__icon", children: icon })
30
32
  ]
31
33
  }
32
34
  );
package/dist/index20.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react");;/* empty css */const r=e.forwardRef(({size:e="md",weight:r="regular",as:a="p",color:i="text",align:s="start",truncate:c=!1,className:o="","data-cy":n,"data-testid":x,children:l,...d},u)=>{const $=n||`text-${e}-${r}`,g=x||`text-${e}-${r}`,m=["text",`text--size-${e}`,`text--weight-${r}`,`text--color-${i}`,`text--align-${s}`,c&&"text--truncate",o].filter(Boolean).join(" ");return t.jsx(a,{ref:u,className:m,"data-cy":$,"data-testid":g,...d,children:l})});r.displayName="Text",exports.Text=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index31.cjs"),a=require("./index19.cjs");;/* empty css */const i=require("./index50.cjs"),n=require("@adam-milo/icons"),l=(e,r,a,i,n)=>{const[l,o]=t.useState(e.length),u=t.useCallback(()=>{if(void 0!==n)return void o(Math.min(n,e.length));const t=r.current;if(!t)return;const l=t.clientWidth,u=parseFloat(getComputedStyle(document.documentElement).fontSize)||16,s=window.getComputedStyle(t),c=((e,t,r)=>{if(!e)return.5*t;const a=e.match(/^([\d.]+)(px|rem|em)?/);if(!a)return.5*t;const i=parseFloat(a[1]);switch(a[2]||"px"){case"px":return i;case"rem":return i*t;case"em":return i*r;default:return.5*t}})(s.gap,u,parseFloat(s.fontSize)||16),d=3.75*u;for(let r=0;r<e.length;r++){const t=e[r],n=a.current[r];n&&i.current.set(t.value,n.offsetWidth)}const p=((e,t,r,a,i)=>{let n=0,l=0;for(let o=0;o<e.length;o++){const u=e[o],s=t.get(u.value)||0;if(0===s){l++;break}const c=n+(o>0?a:0)+s;if(o<e.length-1){if(c+a+i>r&&l>0)break}else if(c>r&&l>0)break;n=c,l++}return Math.max(1,l)})(e,i.current,l,c,d);o(p)},[e,n,r,a,i]),s=((e,r)=>{const a=t.useRef();return t.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),t.useCallback((...t)=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>e(...t),r)},[e,r])})(u,100);t.useEffect(()=>{a.current.length>e.length&&(a.current=a.current.slice(0,e.length));const t=new Set(e.map(e=>e.value));if(i.current.forEach((e,r)=>{t.has(r)||i.current.delete(r)}),void 0===n){e.some(e=>!i.current.has(e.value))?o(e.length):setTimeout(u,0)}},[e,n,u,a,i]),t.useEffect(()=>{const e=r.current;if(!e)return;const t=new ResizeObserver(()=>{s()});return t.observe(e),setTimeout(u,0),()=>{t.disconnect()}},[u,s,r]);const c=e.slice(0,l),d=e.slice(l);return{visibleCount:l,visibleItems:c,hiddenItems:d,hasOverflow:d.length>0}},o=t.forwardRef(({items:o,selectedValue:u,onSelectionChange:s,removable:c=!1,onRemove:d,variant:p="primary",disabled:h=!1,maxVisible:v,className:m,"data-testid":f,"data-cy":g,...b},y)=>{const w=(o&&Array.isArray(o)?o:[]).filter(e=>null!=e&&"object"==typeof e),x=t.useRef(null),k=t.useRef([]),_=t.useRef(new Map),C=t.useRef(null),[E,j]=t.useState(!1),[N,$]=t.useState(!1),D=t.useRef([]),{visibleItems:S,hiddenItems:R,hasOverflow:I}=l(w,x,k,_,v),q=t.useCallback((e,t,r)=>{if(!h&&!t&&s){s(u===e?null:e,r)}},[h,u,s]),A=t.useCallback((e,t)=>{e.stopPropagation(),h||d&&d(t,e)},[h,d]),M=t.useCallback((e,t,r)=>{h||r||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),q(t,r,e))},[h,q]),P=t.useCallback(e=>{e.stopPropagation(),$(e=>!e),j(!1)},[]),T=t.useCallback((e,t)=>{var r,a,i,n;switch(e.key){case"ArrowDown":e.preventDefault(),t<R.length-1&&(null==(r=D.current[t+1])||r.focus());break;case"ArrowUp":e.preventDefault(),t>0&&(null==(a=D.current[t-1])||a.focus());break;case"Home":e.preventDefault(),null==(i=D.current[0])||i.focus();break;case"End":e.preventDefault(),null==(n=D.current[R.length-1])||n.focus()}},[R.length]),z=t.useRef(),L=t.useRef();return t.useEffect(()=>{z.current=e=>{C.current&&!C.current.contains(e.target)&&$(!1)},L.current=e=>{"Escape"===e.key&&$(!1)}}),t.useEffect(()=>{if(!N)return;const e=e=>{var t;return null==(t=z.current)?void 0:t.call(z,e)},t=e=>{var t;return null==(t=L.current)?void 0:t.call(L,e)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[N]),t.useEffect(()=>{if("development"===process.env.NODE_ENV&&w.length>0){const e=w.map(e=>e.value),t=new Set(e);e.length!==t.size&&i.devWarn("[ChipGroup] Duplicate values detected in items array. Each item should have a unique value.")}},[w]),t.useEffect(()=>{D.current.length>R.length&&(D.current=D.current.slice(0,R.length))},[R]),o&&Array.isArray(o)?e.jsxs("div",{ref:y,className:r.cn("chip-group",h&&"chip-group--disabled",m),role:"group","aria-label":"Chip group","data-testid":f||"chip-group","data-cy":g||"chip-group",...b,children:[I&&e.jsxs("div",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":"chip-group-live-region","data-cy":"chip-group-live-region",children:[R.length," additional ",1===R.length?"chip":"chips"," hidden"]}),e.jsxs("div",{ref:x,className:"chip-group__container",children:[S.map(t=>{const r=u===t.value,i=t.variant||p,l=h||t.disabled||!1,o=w.findIndex(e=>e.value===t.value);return e.jsx("div",{ref:e=>{k.current[o]=e||null},className:"chip-group__item-wrapper","data-cy":`chip-group-item-wrapper-${t.value}`,"data-testid":`chip-group-item-wrapper-${t.value}`,children:e.jsxs("div",{className:"chip-group__item",onClick:e=>q(t.value,l,e),onKeyDown:e=>M(e,t.value,l),tabIndex:l?-1:0,role:"button","aria-pressed":r?"true":"false","aria-disabled":l?"true":"false","data-cy":`chip-group-item-${t.value}`,"data-testid":`chip-group-item-${t.value}`,children:[e.jsx(a.Chip,{variant:i,selected:r,disabled:l,"data-cy":`chip-${t.value}`,"data-testid":`chip-${t.value}`,children:t.label}),c&&!h&&!l&&e.jsx("button",{className:"chip-group__remove",onClick:e=>A(e,t.value),"aria-label":`Remove ${t.label}`,"data-cy":`chip-remove-${t.value}`,"data-testid":`chip-remove-${t.value}`,type:"button",children:e.jsx(n.Icon,{name:"Cross2Icon",size:"sm",decorative:!0})})]})},t.value)}),I&&e.jsxs("div",{ref:C,className:"chip-group__overflow",role:"button",tabIndex:0,"aria-expanded":N?"true":"false","aria-haspopup":"menu","aria-label":`Show ${R.length} more ${1===R.length?"chip":"chips"}`,onMouseEnter:()=>!N&&j(!0),onMouseLeave:()=>j(!1),onClick:P,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),$(!N),j(!1))},"data-cy":"chip-group-overflow","data-testid":"chip-group-overflow",children:[e.jsxs(a.Chip,{variant:p,"data-cy":"chip-overflow","data-testid":"chip-overflow",children:["+",R.length]}),E&&!N&&e.jsx("div",{className:"chip-group__tooltip chip-group__tooltip--hover",role:"tooltip","data-cy":"chip-group-tooltip","data-testid":"chip-group-tooltip",children:R.map(t=>e.jsx("div",{className:"chip-group__tooltip-item","data-cy":`chip-group-tooltip-item-${t.value}`,"data-testid":`chip-group-tooltip-item-${t.value}`,children:t.label},t.value))}),N&&e.jsx("div",{className:"chip-group__dropdown",role:"menu","data-cy":"chip-group-dropdown","data-testid":"chip-group-dropdown",children:R.map((t,a)=>e.jsx("div",{ref:e=>{D.current[a]=e||null},className:r.cn("chip-group__dropdown-item",t.disabled&&"chip-group__dropdown-item--disabled"),role:"menuitem",tabIndex:t.disabled?-1:0,"aria-disabled":t.disabled?"true":"false",onClick:e=>{e.stopPropagation(),t.disabled||(q(t.value,!1,e),$(!1))},onKeyDown:e=>{T(e,a),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),t.disabled||(q(t.value,!1,e),$(!1)))},"data-cy":`chip-group-dropdown-item-${t.value}`,"data-testid":`chip-group-dropdown-item-${t.value}`,children:t.label},t.value))})]})]})]}):null});o.displayName="ChipGroup",exports.ChipGroup=o;