@mijn-ui/react-card 0.0.6 → 0.0.8
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.d.ts +1 -1
- package/dist/index.js +26 -76
- package/dist/metafile-esm.json +1 -1
- package/package.json +11 -9
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { UnstyledProps } from '@mijn-ui/react-
|
|
3
|
+
import { UnstyledProps } from '@mijn-ui/react-core';
|
|
4
4
|
|
|
5
5
|
type CardProps = React.ComponentProps<"div"> & UnstyledProps;
|
|
6
6
|
declare const Card: ({ className, unstyled, ...props }: CardProps) => react_jsx_runtime.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -1,96 +1,46 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
// src/card.tsx
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
cn
|
|
8
|
-
} from "@mijn-ui/react-utilities/shared";
|
|
4
|
+
import { createContext, cn } from "@mijn-ui/react-utilities";
|
|
5
|
+
import { cardStyles } from "@mijn-ui/react-theme";
|
|
6
|
+
import { useTVUnstyled } from "@mijn-ui/react-hooks";
|
|
9
7
|
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
var [CardProvider, useCardContext] = createContext({
|
|
9
|
+
name: "CardContext",
|
|
10
|
+
strict: true,
|
|
11
|
+
errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
|
|
12
|
+
});
|
|
13
|
+
var useCardStyles = (unstyledOverride) => {
|
|
14
|
+
const context = useCardContext();
|
|
15
|
+
return useTVUnstyled(context, unstyledOverride);
|
|
16
|
+
};
|
|
17
|
+
var Card = ({ className, unstyled = false, ...props }) => {
|
|
18
|
+
const styles = cardStyles();
|
|
19
|
+
return /* @__PURE__ */ jsx(CardProvider, { value: { unstyled, styles }, children: /* @__PURE__ */ jsx("div", { className: cn(styles.base({ className })), ...props }) });
|
|
20
|
+
};
|
|
20
21
|
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
|
-
);
|
|
22
|
+
const { header } = useCardStyles(unstyled);
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { className: header({ className }), ...props });
|
|
34
24
|
};
|
|
35
25
|
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
|
-
);
|
|
26
|
+
const { title } = useCardStyles(unstyled);
|
|
27
|
+
return /* @__PURE__ */ jsx("div", { className: title({ className }), ...props });
|
|
49
28
|
};
|
|
50
29
|
var CardDescription = ({
|
|
51
30
|
className,
|
|
52
31
|
unstyled,
|
|
53
32
|
...props
|
|
54
33
|
}) => {
|
|
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
|
-
);
|
|
34
|
+
const { description } = useCardStyles(unstyled);
|
|
35
|
+
return /* @__PURE__ */ jsx("div", { className: description({ className }), ...props });
|
|
68
36
|
};
|
|
69
37
|
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
|
-
);
|
|
38
|
+
const { content } = useCardStyles(unstyled);
|
|
39
|
+
return /* @__PURE__ */ jsx("div", { className: content({ className }), ...props });
|
|
79
40
|
};
|
|
80
41
|
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
|
-
);
|
|
42
|
+
const { footer } = useCardStyles(unstyled);
|
|
43
|
+
return /* @__PURE__ */ jsx("div", { className: footer({ className }), ...props });
|
|
94
44
|
};
|
|
95
45
|
export {
|
|
96
46
|
Card,
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/card.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/card.tsx":{"bytes":4418,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","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","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":1794},"src/index.ts":{"bytesInOutput":0}},"bytes":1904}}}
|
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.8",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -20,22 +20,24 @@
|
|
|
20
20
|
"exports": "./dist/index.js",
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"react": "19.0.0",
|
|
24
|
+
"react-dom": "19.0.0",
|
|
25
|
+
"@types/react": "^19.0.0",
|
|
26
|
+
"@types/react-dom": "^19.0.0",
|
|
23
27
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
24
|
-
"@types/react": "^18.3.12",
|
|
25
|
-
"@types/react-dom": "^18.3.1",
|
|
26
28
|
"eslint-config-custom": "0.0.1",
|
|
27
29
|
"tsconfig": "0.0.0",
|
|
28
30
|
"tsup-config": "0.0.0"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"react": "
|
|
32
|
-
"react-
|
|
33
|
-
"
|
|
34
|
-
"@mijn-ui/react-utilities": "0.0.6"
|
|
33
|
+
"@mijn-ui/react-core": "0.0.2",
|
|
34
|
+
"@mijn-ui/react-hooks": "0.0.9",
|
|
35
|
+
"@mijn-ui/react-utilities": "0.0.8"
|
|
35
36
|
},
|
|
36
37
|
"peerDependencies": {
|
|
37
38
|
"react": "^19.0",
|
|
38
|
-
"react-dom": "^19.0"
|
|
39
|
+
"react-dom": "^19.0",
|
|
40
|
+
"@mijn-ui/react-theme": "0.0.7"
|
|
39
41
|
},
|
|
40
42
|
"publishConfig": {
|
|
41
43
|
"access": "public"
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"nextjs"
|
|
47
49
|
],
|
|
48
50
|
"scripts": {
|
|
49
|
-
"clean": "rimraf dist",
|
|
51
|
+
"clean": "rimraf dist .turbo",
|
|
50
52
|
"build": "tsup",
|
|
51
53
|
"lint": "eslint .",
|
|
52
54
|
"lint:fix": "eslint . --fix",
|