@versini/ui-card 4.0.12 → 5.0.0

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.
@@ -1,12 +1,17 @@
1
1
  import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
- import { useUniqueId as v } from "@versini/ui-hooks";
2
+ import { useId as v } from "react";
3
3
  import u from "clsx";
4
- const f = "av-card", A = ({
4
+ const f = "av-card";
5
+ function A(d) {
6
+ const r = v();
7
+ return `${d}${r}`;
8
+ }
9
+ const C = ({
5
10
  className: d,
6
- headerClassName: e,
11
+ headerClassName: r,
7
12
  bodyClassName: c,
8
13
  footerClassName: t,
9
- mode: r,
14
+ mode: e,
10
15
  compact: l,
11
16
  noBorder: i
12
17
  }) => {
@@ -18,19 +23,19 @@ const f = "av-card", A = ({
18
23
  "border-2": !i,
19
24
  "p-4": !l,
20
25
  "p-1 sm:p-2": l,
21
- "border-border-accent bg-surface-darker text-copy-light": r === "darker",
22
- "border-border-accent bg-surface-dark text-copy-light": r === "dark",
23
- "border-border-dark bg-surface-lighter text-copy-dark": r === "light",
24
- "border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": r === "system",
25
- "border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": r === "alt-system"
26
+ "border-border-accent bg-surface-darker text-copy-light": e === "darker",
27
+ "border-border-accent bg-surface-dark text-copy-light": e === "dark",
28
+ "border-border-dark bg-surface-lighter text-copy-dark": e === "light",
29
+ "border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": e === "system",
30
+ "border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": e === "alt-system"
26
31
  },
27
32
  d
28
- ), k = e || u(`${f}__header mt-0 border-b-2`, {
29
- "text-copy-light border-border-accent": r === "darker",
30
- "border-border-accent": r === "dark",
31
- "border-border-medium": r === "light",
32
- "border-border-medium dark:border-border-accent": r === "system",
33
- "border-border-accent dark:border-border-medium": r === "alt-system",
33
+ ), k = r || u(`${f}__header mt-0 border-b-2`, {
34
+ "text-copy-light border-border-accent": e === "darker",
35
+ "border-border-accent": e === "dark",
36
+ "border-border-medium": e === "light",
37
+ "border-border-medium dark:border-border-accent": e === "system",
38
+ "border-border-accent dark:border-border-medium": e === "alt-system",
34
39
  "mb-4": !l,
35
40
  "mb-2": l
36
41
  }), g = u(c), p = t || u(`${f}__footer pt-2`);
@@ -41,20 +46,20 @@ const f = "av-card", A = ({
41
46
  footer: p
42
47
  };
43
48
  };
44
- function C({
49
+ function _({
45
50
  id: d,
46
- content: e,
51
+ content: r,
47
52
  userAriaLabelledby: c,
48
53
  className: t
49
54
  }) {
50
- return typeof e == "string" ? /* @__PURE__ */ a("h2", { id: d, className: t, children: e }) : c ? /* @__PURE__ */ a("div", { className: t, children: e }) : e ? /* @__PURE__ */ a("div", { className: t, id: d, children: e }) : null;
55
+ return typeof r == "string" ? /* @__PURE__ */ a("h2", { id: d, className: t, children: r }) : c ? /* @__PURE__ */ a("div", { className: t, children: r }) : r ? /* @__PURE__ */ a("div", { className: t, id: d, children: r }) : null;
51
56
  }
52
57
  const S = ({
53
58
  header: d,
54
- headerClassName: e,
59
+ headerClassName: r,
55
60
  footer: c,
56
61
  footerClassName: t,
57
- children: r,
62
+ children: e,
58
63
  className: l,
59
64
  bodyClassName: i,
60
65
  "aria-labelledby": s,
@@ -63,36 +68,36 @@ const S = ({
63
68
  noBorder: p = !1,
64
69
  ...x
65
70
  }) => {
66
- let o = null, b = null;
67
- const h = typeof d == "string", y = v(f), n = A({
71
+ let o = null, n = null;
72
+ const h = typeof d == "string", y = A(f), b = C({
68
73
  className: l,
69
- headerClassName: e,
74
+ headerClassName: r,
70
75
  bodyClassName: i,
71
76
  footerClassName: t,
72
77
  mode: k,
73
78
  compact: g,
74
79
  noBorder: p
75
80
  });
76
- return h ? (o = y, b = o) : !h && d && s ? (o = null, b = s) : !h && d && !s ? (o = y, b = o) : (o = null, b = s || null), /* @__PURE__ */ a("div", { className: n.wrapper, children: /* @__PURE__ */ m(
81
+ return h ? (o = y, n = o) : !h && d && s ? (o = null, n = s) : !h && d && !s ? (o = y, n = o) : (o = null, n = s || null), /* @__PURE__ */ a("div", { className: b.wrapper, children: /* @__PURE__ */ m(
77
82
  "section",
78
83
  {
79
- ...b && {
80
- "aria-labelledby": b
84
+ ...n && {
85
+ "aria-labelledby": n
81
86
  },
82
- className: n.body,
87
+ className: b.body,
83
88
  ...x,
84
89
  children: [
85
90
  /* @__PURE__ */ a(
86
- C,
91
+ _,
87
92
  {
88
93
  ...o && { id: o },
89
94
  content: d,
90
- className: n.header,
95
+ className: b.header,
91
96
  userAriaLabelledby: s
92
97
  }
93
98
  ),
94
- /* @__PURE__ */ a("div", { children: r }),
95
- c ? /* @__PURE__ */ a("div", { className: n.footer, children: c }) : null
99
+ /* @__PURE__ */ a("div", { children: e }),
100
+ c ? /* @__PURE__ */ a("div", { className: b.footer, children: c }) : null
96
101
  ]
97
102
  }
98
103
  ) });
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { CARD_CLASSNAME as o, Card as r } from "./components/Card/Card.js";
2
2
  /*!
3
- @versini/ui-card v4.0.12
3
+ @versini/ui-card v5.0.0
4
4
  © 2025 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_UI_CARD__ || (window.__VERSINI_UI_CARD__ = {
8
- version: "4.0.12",
9
- buildTime: "09/01/2025 02:19 PM EDT",
8
+ version: "5.0.0",
9
+ buildTime: "09/01/2025 03:18 PM EDT",
10
10
  homepage: "https://github.com/aversini/ui-components",
11
11
  license: "MIT"
12
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-card",
3
- "version": "4.0.12",
3
+ "version": "5.0.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -37,21 +37,21 @@
37
37
  "test": "vitest run"
38
38
  },
39
39
  "peerDependencies": {
40
- "react": "^18.3.1 || ^19.0.0",
41
- "react-dom": "^18.3.1 || ^19.0.0"
40
+ "react": "^19.0.0",
41
+ "react-dom": "^19.0.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@testing-library/jest-dom": "6.8.0",
45
- "@versini/ui-types": "5.0.7"
45
+ "@versini/ui-types": "6.0.0"
46
46
  },
47
47
  "dependencies": {
48
48
  "@tailwindcss/typography": "0.5.16",
49
- "@versini/ui-hooks": "4.7.8",
49
+ "@versini/ui-hooks": "5.0.0",
50
50
  "clsx": "2.1.1",
51
51
  "tailwindcss": "4.1.12"
52
52
  },
53
53
  "sideEffects": [
54
54
  "**/*.css"
55
55
  ],
56
- "gitHead": "c577149643ec36cad454587166e62410a77aed38"
56
+ "gitHead": "70a47e9e30172dbb7b36306773fe9511e437fba6"
57
57
  }