@mijn-ui/react-card 0.0.6 → 0.0.7
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.
- package/README.md +0 -1
- package/dist/index.js +27 -76
- package/dist/metafile-esm.json +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,96 +1,47 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
// src/card.tsx
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "@mijn-ui/react-utilities/shared";
|
|
4
|
+
import { createContext } from "@mijn-ui/react-utilities/context";
|
|
5
|
+
import { cn } from "@mijn-ui/react-utilities/shared";
|
|
6
|
+
import { cardStyles } from "@mijn-ui/react-theme";
|
|
7
|
+
import { useTVUnstyled } from "@mijn-ui/react-hooks";
|
|
9
8
|
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
var [CardProvider, useCardContext] = createContext({
|
|
10
|
+
name: "CardContext",
|
|
11
|
+
strict: true,
|
|
12
|
+
errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
|
|
13
|
+
});
|
|
14
|
+
var useCardStyles = (unstyledOverride) => {
|
|
15
|
+
const context = useCardContext();
|
|
16
|
+
return useTVUnstyled(context, unstyledOverride);
|
|
17
|
+
};
|
|
18
|
+
var Card = ({ className, unstyled = false, ...props }) => {
|
|
19
|
+
const styles = cardStyles();
|
|
20
|
+
return /* @__PURE__ */ jsx(CardProvider, { value: { unstyled, styles }, children: /* @__PURE__ */ jsx("div", { className: cn(styles.base({ className })), ...props }) });
|
|
21
|
+
};
|
|
20
22
|
var CardHeader = ({ className, unstyled, ...props }) => {
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
"div",
|
|
25
|
-
{
|
|
26
|
-
className: applyUnstyled(
|
|
27
|
-
isUnstyled,
|
|
28
|
-
"flex flex-col space-y-1.5 p-4",
|
|
29
|
-
className
|
|
30
|
-
),
|
|
31
|
-
...props
|
|
32
|
-
}
|
|
33
|
-
);
|
|
23
|
+
const { header } = useCardStyles(unstyled);
|
|
24
|
+
return /* @__PURE__ */ jsx("div", { className: header({ className }), ...props });
|
|
34
25
|
};
|
|
35
26
|
var CardTitle = ({ className, unstyled, ...props }) => {
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
39
|
-
"div",
|
|
40
|
-
{
|
|
41
|
-
className: applyUnstyled(
|
|
42
|
-
isUnstyled,
|
|
43
|
-
"text-2xl font-semibold leading-none tracking-tight",
|
|
44
|
-
className
|
|
45
|
-
),
|
|
46
|
-
...props
|
|
47
|
-
}
|
|
48
|
-
);
|
|
27
|
+
const { title } = useCardStyles(unstyled);
|
|
28
|
+
return /* @__PURE__ */ jsx("div", { className: title({ className }), ...props });
|
|
49
29
|
};
|
|
50
30
|
var CardDescription = ({
|
|
51
31
|
className,
|
|
52
32
|
unstyled,
|
|
53
33
|
...props
|
|
54
34
|
}) => {
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
className: applyUnstyled(
|
|
61
|
-
isUnstyled,
|
|
62
|
-
"text-sm text-muted-text",
|
|
63
|
-
className
|
|
64
|
-
),
|
|
65
|
-
...props
|
|
66
|
-
}
|
|
67
|
-
);
|
|
35
|
+
const { description } = useCardStyles(unstyled);
|
|
36
|
+
return /* @__PURE__ */ jsx("div", { className: description({ className }), ...props });
|
|
68
37
|
};
|
|
69
38
|
var CardContent = ({ className, unstyled, ...props }) => {
|
|
70
|
-
const {
|
|
71
|
-
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
-
"div",
|
|
74
|
-
{
|
|
75
|
-
className: applyUnstyled(isUnstyled, "p-4 pt-0", className),
|
|
76
|
-
...props
|
|
77
|
-
}
|
|
78
|
-
);
|
|
39
|
+
const { content } = useCardStyles(unstyled);
|
|
40
|
+
return /* @__PURE__ */ jsx("div", { className: content({ className }), ...props });
|
|
79
41
|
};
|
|
80
42
|
var CardFooter = ({ className, unstyled, ...props }) => {
|
|
81
|
-
const {
|
|
82
|
-
|
|
83
|
-
return /* @__PURE__ */ jsx(
|
|
84
|
-
"div",
|
|
85
|
-
{
|
|
86
|
-
className: applyUnstyled(
|
|
87
|
-
isUnstyled,
|
|
88
|
-
"flex items-center p-4 pt-0",
|
|
89
|
-
className
|
|
90
|
-
),
|
|
91
|
-
...props
|
|
92
|
-
}
|
|
93
|
-
);
|
|
43
|
+
const { footer } = useCardStyles(unstyled);
|
|
44
|
+
return /* @__PURE__ */ jsx("div", { className: footer({ className }), ...props });
|
|
94
45
|
};
|
|
95
46
|
export {
|
|
96
47
|
Card,
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/card.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/card.tsx":{"bytes":4438,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/context","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":23,"imports":[{"path":"src/card.tsx","kind":"import-statement","original":"./card"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-utilities/context","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"@mijn-ui/react-hooks","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Card","CardContent","CardDescription","CardFooter","CardHeader","CardTitle"],"entryPoint":"src/index.ts","inputs":{"src/card.tsx":{"bytesInOutput":1852},"src/index.ts":{"bytesInOutput":0}},"bytes":1962}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-card",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -30,8 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react": "19.0.0-rc-b01722d5-20241114",
|
|
32
32
|
"react-dom": "19.0.0-rc-b01722d5-20241114",
|
|
33
|
-
"
|
|
34
|
-
"@mijn-ui/react-
|
|
33
|
+
"@mijn-ui/react-utilities": "0.0.7",
|
|
34
|
+
"@mijn-ui/react-hooks": "0.0.8",
|
|
35
|
+
"@mijn-ui/react-theme": "0.0.6"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"react": "^19.0",
|