mcr-design-systems 1.0.45 → 1.0.46

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.
@@ -74,4 +74,4 @@ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, Variant
74
74
  * </Card>
75
75
  * ```
76
76
  */
77
- export default function Card({ variant, title, titleIcon, actionButton, actionIcon, children, className, showHeader, headerGap, contentPadding, contentGap, width, maxHeaderHeight, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
77
+ export default function Card({ variant, title, titleIcon, actionButton, actionIcon, children, className, showHeader, headerGap, contentPadding, contentGap, width, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,44 +1,42 @@
1
- import { jsxs as l, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cardHeaderTitleVariants as N, cardHeaderActionVariants as g, cardHeaderVariants as V, cardContentVariants as b, cardVariants as k } from "./helper/variants.js";
3
+ import { cardHeaderTitleVariants as v, cardHeaderActionVariants as u, cardHeaderVariants as N, cardContentVariants as y, cardVariants as V } from "./helper/variants.js";
4
4
  import { cn as n } from "../../shared/utils/cn.js";
5
- import { dataTestId as j } from "../../shared/utils/dataTestId.js";
6
- import { Typography as C } from "../Typography/index.js";
7
- function A({
8
- variant: p = "default",
5
+ import { dataTestId as k } from "../../shared/utils/dataTestId.js";
6
+ import { Typography as b } from "../Typography/index.js";
7
+ function z({
8
+ variant: f = "default",
9
9
  title: a,
10
10
  titleIcon: e,
11
- actionButton: i,
11
+ actionButton: m,
12
12
  actionIcon: s,
13
- children: t,
14
- className: c,
15
- showHeader: f = !0,
16
- headerGap: x = "xs",
17
- contentPadding: o = "md",
18
- contentGap: u = "md",
13
+ children: l,
14
+ className: t,
15
+ showHeader: p = !0,
16
+ headerGap: c = "xs",
17
+ contentPadding: x = "md",
18
+ contentGap: o = "md",
19
19
  width: d,
20
- maxHeaderHeight: m,
21
- ...v
20
+ ...g
22
21
  }) {
23
- const y = d ? { width: typeof d == "number" ? `${d}px` : d } : {}, h = m ? { maxHeight: typeof m == "number" ? `${m}px` : m } : {};
24
- return /* @__PURE__ */ l(
22
+ const h = d ? { width: typeof d == "number" ? `${d}px` : d } : {};
23
+ return /* @__PURE__ */ i(
25
24
  "div",
26
25
  {
27
- className: n(k({ variant: p }), c),
28
- style: y,
29
- ...j("Card"),
30
- ...v,
26
+ className: n(V({ variant: f }), t),
27
+ style: h,
28
+ ...k("Card"),
29
+ ...g,
31
30
  children: [
32
- f && (a || e || i || s) && /* @__PURE__ */ l(
31
+ p && (a || e || m || s) && /* @__PURE__ */ i(
33
32
  "div",
34
33
  {
35
- className: n(V({ gap: x })),
36
- style: h,
34
+ className: n(N({ gap: c }), t),
37
35
  children: [
38
- (a || e) && /* @__PURE__ */ r("div", { className: N(), children: /* @__PURE__ */ l("div", { className: "flex items-center gap-xs", children: [
36
+ (a || e) && /* @__PURE__ */ r("div", { className: v(), children: /* @__PURE__ */ i("div", { className: "flex items-center gap-xs", children: [
39
37
  e && /* @__PURE__ */ r("div", { className: "flex-shrink-0 text-fg-neutral-main", children: e }),
40
38
  a && /* @__PURE__ */ r(
41
- C,
39
+ b,
42
40
  {
43
41
  variants: "heading-xs",
44
42
  size: "xs",
@@ -47,22 +45,22 @@ function A({
47
45
  }
48
46
  )
49
47
  ] }) }),
50
- (i || s) && /* @__PURE__ */ l("div", { className: g({ gap: "xs" }), children: [
51
- i,
48
+ (m || s) && /* @__PURE__ */ i("div", { className: u({ gap: "xs" }), children: [
49
+ m,
52
50
  s && /* @__PURE__ */ r("div", { className: "flex-shrink-0 text-fg-neutral-main", children: s })
53
51
  ] })
54
52
  ]
55
53
  }
56
54
  ),
57
- t && /* @__PURE__ */ r(
55
+ l && /* @__PURE__ */ r(
58
56
  "div",
59
57
  {
60
- className: b({
61
- padding: o,
62
- gap: u
58
+ className: y({
59
+ padding: x,
60
+ gap: o
63
61
  }),
64
62
  style: { wordWrap: "break-word", overflowWrap: "break-word" },
65
- children: t
63
+ children: l
66
64
  }
67
65
  )
68
66
  ]
@@ -70,5 +68,5 @@ function A({
70
68
  );
71
69
  }
72
70
  export {
73
- A as default
71
+ z as default
74
72
  };
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
2
  import { useRef as s, useEffect as m } from "react";
3
3
  import { modal as F } from "./helper/variants.js";
4
4
  import { cn as n } from "../../shared/utils/cn.js";
@@ -26,40 +26,40 @@ function _({
26
26
  footer: v,
27
27
  ...R
28
28
  }) {
29
- const y = s(null), j = s(null), c = s(null), {
29
+ const p = s(null), j = s(null), c = s(null), {
30
30
  overlay: L,
31
- content: T,
32
- header: z,
33
- titleContainer: D,
34
- title: P,
31
+ content: P,
32
+ header: T,
33
+ titleContainer: z,
34
+ title: D,
35
35
  closeButton: S,
36
36
  body: I,
37
- footer: p,
37
+ footer: y,
38
38
  actionsContainer: M,
39
39
  loadingContainer: V
40
40
  } = F();
41
41
  m(() => {
42
42
  if (!i || !u) return;
43
- const r = (A) => {
43
+ const e = (A) => {
44
44
  A.key === "Escape" && o();
45
45
  };
46
- return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
46
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
47
47
  }, [i, u, o]), m(() => {
48
48
  if (!i) return;
49
- const r = window.getComputedStyle(document.body).overflow;
49
+ const e = window.getComputedStyle(document.body).overflow;
50
50
  return document.body.style.overflow = "hidden", () => {
51
- document.body.style.overflow = r;
51
+ document.body.style.overflow = e;
52
52
  };
53
53
  }, [i]), m(() => {
54
54
  t && i && c.current?.scrollTo({ top: 0, behavior: "instant" });
55
55
  }, [t, i, c]);
56
- const q = (r) => {
57
- w && r.target === y.current && !a && o();
56
+ const q = (e) => {
57
+ w && e.target === p.current && !a && o();
58
58
  };
59
- return i ? /* @__PURE__ */ e(
59
+ return i ? /* @__PURE__ */ r(
60
60
  "div",
61
61
  {
62
- ref: y,
62
+ ref: p,
63
63
  className: n(L(), B),
64
64
  onClick: q,
65
65
  ...G("modal"),
@@ -68,24 +68,24 @@ function _({
68
68
  "div",
69
69
  {
70
70
  ref: j,
71
- className: n(T({ size: x }), g),
71
+ className: n(P({ size: x }), g),
72
72
  role: "dialog",
73
73
  "aria-modal": "true",
74
74
  "aria-labelledby": "modal-title",
75
75
  "aria-describedby": k ? "modal-subtitle" : void 0,
76
76
  children: [
77
- /* @__PURE__ */ d("div", { className: z(), children: [
78
- /* @__PURE__ */ e("div", { className: D(), children: /* @__PURE__ */ e(
77
+ /* @__PURE__ */ d("div", { className: T(), children: [
78
+ /* @__PURE__ */ r("div", { className: z(), children: /* @__PURE__ */ r(
79
79
  J,
80
80
  {
81
81
  id: "modal-title",
82
82
  variants: "heading-xs",
83
83
  size: "xs",
84
- className: P(),
84
+ className: D(),
85
85
  children: b
86
86
  }
87
87
  ) }),
88
- N && /* @__PURE__ */ e(
88
+ N && /* @__PURE__ */ r(
89
89
  f,
90
90
  {
91
91
  variant: "outline",
@@ -93,7 +93,9 @@ function _({
93
93
  iconOnly: !0,
94
94
  icon: "x-close",
95
95
  type: "button",
96
- onClick: o,
96
+ onClick: (e) => {
97
+ e.stopPropagation(), o();
98
+ },
97
99
  disabled: a,
98
100
  className: S(),
99
101
  "aria-label": "Close modal"
@@ -108,37 +110,37 @@ function _({
108
110
  "overflow-hidden": t
109
111
  }),
110
112
  children: [
111
- t && /* @__PURE__ */ e("div", { className: V(), children: /* @__PURE__ */ e("div", { className: "w-[44px] h-[44px] p-sm-2 bg-neutral-700 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ e(H, { width: 20, thickness: 3 }) }) }),
113
+ t && /* @__PURE__ */ r("div", { className: V(), children: /* @__PURE__ */ r("div", { className: "w-[44px] h-[44px] p-sm-2 bg-neutral-700 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ r(H, { width: 20, thickness: 3 }) }) }),
112
114
  C
113
115
  ]
114
116
  }
115
117
  ),
116
- l && /* @__PURE__ */ e("div", { className: n(p(), h), children: /* @__PURE__ */ e("div", { className: M(), children: /* @__PURE__ */ d("div", { className: "flex gap-3", children: [
117
- /* @__PURE__ */ e(
118
+ l && /* @__PURE__ */ r("div", { className: n(y(), h), children: /* @__PURE__ */ r("div", { className: M(), children: /* @__PURE__ */ d("div", { className: "flex gap-3", children: [
119
+ /* @__PURE__ */ r(
118
120
  f,
119
121
  {
120
122
  disabled: l.cancelBtn?.isDisabled || a,
121
123
  variant: "outline",
122
- onClick: (r) => {
123
- r.stopPropagation(), l.cancelBtn?.onClick?.();
124
+ onClick: (e) => {
125
+ e.stopPropagation(), l.cancelBtn?.onClick?.();
124
126
  },
125
127
  children: l.cancelBtn?.label || "Cancel"
126
128
  }
127
129
  ),
128
- /* @__PURE__ */ e(
130
+ /* @__PURE__ */ r(
129
131
  f,
130
132
  {
131
133
  loading: a,
132
134
  disabled: l.confirmBtn?.isDisabled || t || a,
133
135
  variant: l?.confirmBtn?.isConfirm ? "danger" : "primary",
134
- onClick: (r) => {
135
- r.stopPropagation(), l.confirmBtn?.onClick?.();
136
+ onClick: (e) => {
137
+ e.stopPropagation(), l.confirmBtn?.onClick?.();
136
138
  },
137
139
  children: l.confirmBtn?.label || "Confirm"
138
140
  }
139
141
  )
140
142
  ] }) }) }),
141
- v && /* @__PURE__ */ e("div", { className: n(p(), h), children: v })
143
+ v && /* @__PURE__ */ r("div", { className: n(y(), h), children: v })
142
144
  ]
143
145
  }
144
146
  )
@@ -47,7 +47,7 @@ const t = e({
47
47
  true: [
48
48
  "bg-bg-selected-rest text-fg-selected-rest",
49
49
  "before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2",
50
- "before:w-[2px] before:h-[16px] before:bg-fg-selected-rest",
50
+ "before:w-[2px] before:h-[16px] before:bg-fg-brand-rest",
51
51
  "before:rounded-tr-xs before:rounded-br-xs"
52
52
  ],
53
53
  false: "text-fg-neutral-subtle hover:bg-bg-neutral-subtle"
@@ -1,45 +1,45 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import "react";
3
- import { Typography as c } from "../Typography/index.js";
4
- import n from "../Icon/Icon.js";
5
- import u from "clsx";
6
- const j = ({
7
- text: f,
3
+ import { Typography as n } from "../Typography/index.js";
4
+ import f from "../Icon/Icon.js";
5
+ import g from "clsx";
6
+ const T = ({
7
+ text: m,
8
8
  error: l = !1,
9
- haveIcon: d = !0,
10
- iconsCustom: m,
9
+ haveIcon: h = !0,
10
+ iconsCustom: o,
11
11
  className: r,
12
12
  iconsSize: t = 16,
13
- customContent: o,
13
+ customContent: d,
14
14
  requirementsList: a
15
15
  }) => {
16
- if (o)
16
+ if (d)
17
17
  return /* @__PURE__ */ e(
18
18
  "div",
19
19
  {
20
20
  className: `self-stretch inline-flex flex-col justify-start items-start ${r || ""}`,
21
- children: o
21
+ children: d
22
22
  }
23
23
  );
24
24
  if (a) {
25
- const { items: x } = a, h = a.showTitle !== !1, p = a.title || "Requirements:";
25
+ const { items: x } = a, u = a.showTitle !== !1, p = a.title || "Requirements:", c = x.every((s) => s.isValid);
26
26
  return /* @__PURE__ */ i("div", { className: `mt-1 space-y-1 ${r || ""}`, children: [
27
- h && /* @__PURE__ */ i("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
27
+ u && /* @__PURE__ */ i("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
28
28
  /* @__PURE__ */ e(
29
- n,
29
+ f,
30
30
  {
31
- name: "alert-octagon",
32
- className: "text-fg-accent-error",
31
+ name: c ? "check-circle" : "alert-octagon",
32
+ className: c ? "text-fg-accent-success" : "text-fg-accent-error",
33
33
  variant: "solid",
34
34
  size: typeof t == "number" ? t : 16
35
35
  }
36
36
  ),
37
37
  /* @__PURE__ */ e(
38
- c,
38
+ n,
39
39
  {
40
40
  variants: "body",
41
41
  size: "sm",
42
- color: "fg-accent-error",
42
+ color: c ? "fg-accent-success" : "fg-accent-error",
43
43
  className: "font-medium",
44
44
  children: p
45
45
  }
@@ -48,23 +48,23 @@ const j = ({
48
48
  /* @__PURE__ */ e("ul", { className: "list-disc ml-9", children: x.map((s) => /* @__PURE__ */ e(
49
49
  "li",
50
50
  {
51
- className: u("", {
51
+ className: g("", {
52
52
  "marker:text-fg-accent-success text-fg-accent-success": s.isValid,
53
53
  "marker:text-fg-accent-error text-fg-accent-error": !s.isValid
54
54
  }),
55
- children: /* @__PURE__ */ e(c, { variants: "body", size: "sm", className: "text-inherit", children: s.text })
55
+ children: /* @__PURE__ */ e(n, { variants: "body", size: "sm", className: "text-inherit", children: s.text })
56
56
  },
57
57
  s.id
58
58
  )) })
59
59
  ] });
60
60
  }
61
- return f ? /* @__PURE__ */ e(
61
+ return m ? /* @__PURE__ */ e(
62
62
  "div",
63
63
  {
64
64
  className: `self-stretch inline-flex flex-col justify-start items-start ${r || ""}`,
65
65
  children: /* @__PURE__ */ i("div", { className: "self-stretch inline-flex justify-start items-start gap-1", children: [
66
- l && (m || /* @__PURE__ */ e(
67
- n,
66
+ l && (o || /* @__PURE__ */ e(
67
+ f,
68
68
  {
69
69
  name: "alert-octagon",
70
70
  className: "text-fg-accent-error",
@@ -72,8 +72,8 @@ const j = ({
72
72
  size: typeof t == "number" ? t : 16
73
73
  }
74
74
  )),
75
- d && !l && /* @__PURE__ */ e(
76
- n,
75
+ h && !l && /* @__PURE__ */ e(
76
+ f,
77
77
  {
78
78
  name: "help-circle",
79
79
  variant: "line",
@@ -82,13 +82,13 @@ const j = ({
82
82
  }
83
83
  ),
84
84
  /* @__PURE__ */ e("div", { className: "flex-1 justify-start text-left flex flex-wrap items-center gap-0", children: /* @__PURE__ */ e(
85
- c,
85
+ n,
86
86
  {
87
87
  variants: "body",
88
88
  size: "sm",
89
89
  color: l ? "fg-accent-error" : "fg-neutral-subtle",
90
90
  className: "inline",
91
- children: f
91
+ children: m
92
92
  }
93
93
  ) })
94
94
  ] })
@@ -96,5 +96,5 @@ const j = ({
96
96
  ) : null;
97
97
  };
98
98
  export {
99
- j as default
99
+ T as default
100
100
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcr-design-systems",
3
3
  "private": false,
4
- "version": "1.0.45",
4
+ "version": "1.0.46",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",