@mijn-ui/react-card 0.0.9 → 0.0.11

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