@mijn-ui/react-card 0.0.9 → 0.0.10
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/dist/index.d.ts +5 -3
- package/dist/index.js +71 -13
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
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-core';
|
|
3
|
+
import { UnstyledProps, UnstyledComponentWithSlots } from '@mijn-ui/react-core';
|
|
4
|
+
import { CardSlots } from '@mijn-ui/react-theme';
|
|
4
5
|
|
|
5
|
-
type
|
|
6
|
-
|
|
6
|
+
type CardBaseProps = UnstyledComponentWithSlots<CardSlots>;
|
|
7
|
+
type CardProps = React.ComponentProps<"div"> & CardBaseProps;
|
|
8
|
+
declare const Card: ({ className, classNames, unstyled, ...props }: CardProps) => react_jsx_runtime.JSX.Element;
|
|
7
9
|
type CardHeaderProps = React.ComponentPropsWithRef<"div"> & UnstyledProps;
|
|
8
10
|
declare const CardHeader: ({ className, unstyled, ...props }: CardHeaderProps) => react_jsx_runtime.JSX.Element;
|
|
9
11
|
type CardTitleProps = React.ComponentPropsWithRef<"div"> & UnstyledProps;
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/card.tsx
|
|
4
4
|
import { createContext, cn } from "@mijn-ui/react-utilities";
|
|
5
|
+
import {
|
|
6
|
+
createTVUnstyledSlots
|
|
7
|
+
} from "@mijn-ui/react-core";
|
|
5
8
|
import { cardStyles } from "@mijn-ui/react-theme";
|
|
6
9
|
import { useTVUnstyled } from "@mijn-ui/react-hooks";
|
|
7
10
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -12,35 +15,90 @@ var [CardProvider, useCardContext] = createContext({
|
|
|
12
15
|
});
|
|
13
16
|
var useCardStyles = (unstyledOverride) => {
|
|
14
17
|
const context = useCardContext();
|
|
15
|
-
|
|
18
|
+
const unstyledSlots = useTVUnstyled(context, unstyledOverride);
|
|
19
|
+
return { ...unstyledSlots, classNames: context.classNames };
|
|
16
20
|
};
|
|
17
|
-
var Card = ({
|
|
21
|
+
var Card = ({
|
|
22
|
+
className,
|
|
23
|
+
classNames,
|
|
24
|
+
unstyled = false,
|
|
25
|
+
...props
|
|
26
|
+
}) => {
|
|
18
27
|
const styles = cardStyles();
|
|
19
|
-
|
|
28
|
+
const { base } = createTVUnstyledSlots({ base: styles.base }, unstyled);
|
|
29
|
+
return /* @__PURE__ */ jsx(CardProvider, { value: { unstyled, styles, classNames }, children: /* @__PURE__ */ jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: base({
|
|
33
|
+
className: cn(classNames?.base, className)
|
|
34
|
+
}),
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
20
38
|
};
|
|
21
39
|
var CardHeader = ({ className, unstyled, ...props }) => {
|
|
22
|
-
const { header } = useCardStyles(unstyled);
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
+
const { header, classNames } = useCardStyles(unstyled);
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: header({
|
|
45
|
+
className: cn(classNames?.header, className)
|
|
46
|
+
}),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
);
|
|
24
50
|
};
|
|
25
51
|
var CardTitle = ({ className, unstyled, ...props }) => {
|
|
26
|
-
const { title } = useCardStyles(unstyled);
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
52
|
+
const { title, classNames } = useCardStyles(unstyled);
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: title({
|
|
57
|
+
className: cn(classNames?.title, className)
|
|
58
|
+
}),
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
);
|
|
28
62
|
};
|
|
29
63
|
var CardDescription = ({
|
|
30
64
|
className,
|
|
31
65
|
unstyled,
|
|
32
66
|
...props
|
|
33
67
|
}) => {
|
|
34
|
-
const { description } = useCardStyles(unstyled);
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
+
const { description, classNames } = useCardStyles(unstyled);
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: description({
|
|
73
|
+
className: cn(classNames?.description, className)
|
|
74
|
+
}),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
);
|
|
36
78
|
};
|
|
37
79
|
var CardContent = ({ className, unstyled, ...props }) => {
|
|
38
|
-
const { content } = useCardStyles(unstyled);
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
+
const { content, classNames } = useCardStyles(unstyled);
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: content({
|
|
85
|
+
className: cn(classNames?.content, className)
|
|
86
|
+
}),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
40
90
|
};
|
|
41
91
|
var CardFooter = ({ className, unstyled, ...props }) => {
|
|
42
|
-
const { footer } = useCardStyles(unstyled);
|
|
43
|
-
return /* @__PURE__ */ jsx(
|
|
92
|
+
const { footer, classNames } = useCardStyles(unstyled);
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
className: footer({
|
|
97
|
+
className: cn(classNames?.footer, className)
|
|
98
|
+
}),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
);
|
|
44
102
|
};
|
|
45
103
|
export {
|
|
46
104
|
Card,
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/card.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/card.tsx":{"bytes":5238,"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-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}],"exports":["Card","CardContent","CardDescription","CardFooter","CardHeader","CardTitle"],"entryPoint":"src/index.ts","inputs":{"src/card.tsx":{"bytesInOutput":2556},"src/index.ts":{"bytesInOutput":0}},"bytes":2666}}}
|
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.10",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@types/react-dom": "^19.0.0",
|
|
27
27
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
28
28
|
"@mijn-ui/react-core": "0.0.3",
|
|
29
|
+
"@mijn-ui/react-theme": "0.0.8",
|
|
29
30
|
"eslint-config-custom": "0.0.1",
|
|
30
31
|
"tsconfig": "0.0.0",
|
|
31
32
|
"tsup-config": "0.0.0"
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": "^19.0",
|
|
39
40
|
"react-dom": "^19.0",
|
|
40
|
-
"@mijn-ui/react-theme": "^0.0.
|
|
41
|
+
"@mijn-ui/react-theme": "^0.0.8",
|
|
41
42
|
"@mijn-ui/react-core": "^0.0.3"
|
|
42
43
|
},
|
|
43
44
|
"publishConfig": {
|