@yamada-ui/card 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Hirotomo Yamada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # @yamada-ui/card
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ $ pnpm add @yamada-ui/card
7
+ ```
8
+
9
+ or
10
+
11
+ ```sh
12
+ $ yarn add @yamada-ui/card
13
+ ```
14
+
15
+ or
16
+
17
+ ```sh
18
+ $ npm install @yamada-ui/card
19
+ ```
20
+
21
+ ## Contribution
22
+
23
+ Wouldn't you like to contribute? That's amazing! We have prepared a [contribution guide](https://github.com/hirotomoyamada/yamada-ui/blob/main/CONTRIBUTING.md) to assist you.
24
+
25
+ ## Licence
26
+
27
+ This package is licensed under the terms of the
28
+ [MIT license](https://github.com/hirotomoyamada/yamada-ui/blob/main/LICENSE).
package/dist/card.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps, ThemeProps, CSSUIProps } from '@yamada-ui/core';
3
+
4
+ type CardOptions = {
5
+ direction?: CSSUIProps['flexDirection'];
6
+ justify?: CSSUIProps['justifyContent'];
7
+ align?: CSSUIProps['alignItems'];
8
+ };
9
+ type CardProps = HTMLUIProps<'article'> & ThemeProps<'Card'> & CardOptions;
10
+ declare const Card: _yamada_ui_core.Component<"article", CardProps>;
11
+ type CardHeaderProps = HTMLUIProps<'header'>;
12
+ declare const CardHeader: _yamada_ui_core.Component<"header", CardHeaderProps>;
13
+ type CardBodyProps = HTMLUIProps<'main'>;
14
+ declare const CardBody: _yamada_ui_core.Component<"main", CardBodyProps>;
15
+ type CardFooterProps = HTMLUIProps<'footer'>;
16
+ declare const CardFooter: _yamada_ui_core.Component<"footer", CardFooterProps>;
17
+
18
+ export { Card, CardBody, CardBodyProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps };
package/dist/card.js ADDED
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/card.tsx
21
+ var card_exports = {};
22
+ __export(card_exports, {
23
+ Card: () => Card,
24
+ CardBody: () => CardBody,
25
+ CardFooter: () => CardFooter,
26
+ CardHeader: () => CardHeader
27
+ });
28
+ module.exports = __toCommonJS(card_exports);
29
+ var import_core = require("@yamada-ui/core");
30
+ var import_utils = require("@yamada-ui/utils");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ var [CardProvider, useCard] = (0, import_utils.createContext)({
33
+ name: `CardContext`,
34
+ errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in "<Card />" `
35
+ });
36
+ var Card = (0, import_core.forwardRef)((props, ref) => {
37
+ const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Card", props);
38
+ const {
39
+ className,
40
+ direction: flexDirection = "column",
41
+ justify: justifyContent,
42
+ align: alignItems,
43
+ ...rest
44
+ } = (0, import_core.omitThemeProps)(mergedProps);
45
+ const css = {
46
+ display: "flex",
47
+ flexDirection,
48
+ justifyContent,
49
+ alignItems,
50
+ wordWrap: "break-word",
51
+ ...styles.container
52
+ };
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.article, { ref, className: (0, import_utils.cx)("ui-card", className), __css: css, ...rest }) });
54
+ });
55
+ var CardHeader = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
56
+ const styles = useCard();
57
+ const css = {
58
+ display: "flex",
59
+ justifyContent: "flex-start",
60
+ alignItems: "center",
61
+ ...styles.header
62
+ };
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.header, { ref, className: (0, import_utils.cx)("ui-card-header", className), __css: css, ...rest });
64
+ });
65
+ var CardBody = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
66
+ const styles = useCard();
67
+ const css = {
68
+ display: "flex",
69
+ flexDirection: "column",
70
+ alignItems: "flex-start",
71
+ ...styles.body
72
+ };
73
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.main, { ref, className: (0, import_utils.cx)("ui-card-body", className), __css: css, ...rest });
74
+ });
75
+ var CardFooter = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
76
+ const styles = useCard();
77
+ const css = {
78
+ display: "flex",
79
+ justifyContent: "flex-start",
80
+ alignItems: "center",
81
+ ...styles.footer
82
+ };
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.footer, { ref, className: (0, import_utils.cx)("ui-card-footer", className), __css: css, ...rest });
84
+ });
85
+ // Annotate the CommonJS export names for ESM import in node:
86
+ 0 && (module.exports = {
87
+ Card,
88
+ CardBody,
89
+ CardFooter,
90
+ CardHeader
91
+ });
package/dist/card.mjs ADDED
@@ -0,0 +1,12 @@
1
+ import {
2
+ Card,
3
+ CardBody,
4
+ CardFooter,
5
+ CardHeader
6
+ } from "./chunk-JG6OERSN.mjs";
7
+ export {
8
+ Card,
9
+ CardBody,
10
+ CardFooter,
11
+ CardHeader
12
+ };
@@ -0,0 +1,69 @@
1
+ // src/card.tsx
2
+ import {
3
+ ui,
4
+ forwardRef,
5
+ omitThemeProps,
6
+ useMultiComponentStyle
7
+ } from "@yamada-ui/core";
8
+ import { createContext, cx } from "@yamada-ui/utils";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var [CardProvider, useCard] = createContext({
11
+ name: `CardContext`,
12
+ errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in "<Card />" `
13
+ });
14
+ var Card = forwardRef((props, ref) => {
15
+ const [styles, mergedProps] = useMultiComponentStyle("Card", props);
16
+ const {
17
+ className,
18
+ direction: flexDirection = "column",
19
+ justify: justifyContent,
20
+ align: alignItems,
21
+ ...rest
22
+ } = omitThemeProps(mergedProps);
23
+ const css = {
24
+ display: "flex",
25
+ flexDirection,
26
+ justifyContent,
27
+ alignItems,
28
+ wordWrap: "break-word",
29
+ ...styles.container
30
+ };
31
+ return /* @__PURE__ */ jsx(CardProvider, { value: styles, children: /* @__PURE__ */ jsx(ui.article, { ref, className: cx("ui-card", className), __css: css, ...rest }) });
32
+ });
33
+ var CardHeader = forwardRef(({ className, ...rest }, ref) => {
34
+ const styles = useCard();
35
+ const css = {
36
+ display: "flex",
37
+ justifyContent: "flex-start",
38
+ alignItems: "center",
39
+ ...styles.header
40
+ };
41
+ return /* @__PURE__ */ jsx(ui.header, { ref, className: cx("ui-card-header", className), __css: css, ...rest });
42
+ });
43
+ var CardBody = forwardRef(({ className, ...rest }, ref) => {
44
+ const styles = useCard();
45
+ const css = {
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ alignItems: "flex-start",
49
+ ...styles.body
50
+ };
51
+ return /* @__PURE__ */ jsx(ui.main, { ref, className: cx("ui-card-body", className), __css: css, ...rest });
52
+ });
53
+ var CardFooter = forwardRef(({ className, ...rest }, ref) => {
54
+ const styles = useCard();
55
+ const css = {
56
+ display: "flex",
57
+ justifyContent: "flex-start",
58
+ alignItems: "center",
59
+ ...styles.footer
60
+ };
61
+ return /* @__PURE__ */ jsx(ui.footer, { ref, className: cx("ui-card-footer", className), __css: css, ...rest });
62
+ });
63
+
64
+ export {
65
+ Card,
66
+ CardHeader,
67
+ CardBody,
68
+ CardFooter
69
+ };
@@ -0,0 +1,2 @@
1
+ export { Card, CardBody, CardBodyProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps } from './card.js';
2
+ import '@yamada-ui/core';
package/dist/index.js ADDED
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ Card: () => Card,
24
+ CardBody: () => CardBody,
25
+ CardFooter: () => CardFooter,
26
+ CardHeader: () => CardHeader
27
+ });
28
+ module.exports = __toCommonJS(src_exports);
29
+
30
+ // src/card.tsx
31
+ var import_core = require("@yamada-ui/core");
32
+ var import_utils = require("@yamada-ui/utils");
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var [CardProvider, useCard] = (0, import_utils.createContext)({
35
+ name: `CardContext`,
36
+ errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in "<Card />" `
37
+ });
38
+ var Card = (0, import_core.forwardRef)((props, ref) => {
39
+ const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Card", props);
40
+ const {
41
+ className,
42
+ direction: flexDirection = "column",
43
+ justify: justifyContent,
44
+ align: alignItems,
45
+ ...rest
46
+ } = (0, import_core.omitThemeProps)(mergedProps);
47
+ const css = {
48
+ display: "flex",
49
+ flexDirection,
50
+ justifyContent,
51
+ alignItems,
52
+ wordWrap: "break-word",
53
+ ...styles.container
54
+ };
55
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.article, { ref, className: (0, import_utils.cx)("ui-card", className), __css: css, ...rest }) });
56
+ });
57
+ var CardHeader = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
58
+ const styles = useCard();
59
+ const css = {
60
+ display: "flex",
61
+ justifyContent: "flex-start",
62
+ alignItems: "center",
63
+ ...styles.header
64
+ };
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.header, { ref, className: (0, import_utils.cx)("ui-card-header", className), __css: css, ...rest });
66
+ });
67
+ var CardBody = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
68
+ const styles = useCard();
69
+ const css = {
70
+ display: "flex",
71
+ flexDirection: "column",
72
+ alignItems: "flex-start",
73
+ ...styles.body
74
+ };
75
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.main, { ref, className: (0, import_utils.cx)("ui-card-body", className), __css: css, ...rest });
76
+ });
77
+ var CardFooter = (0, import_core.forwardRef)(({ className, ...rest }, ref) => {
78
+ const styles = useCard();
79
+ const css = {
80
+ display: "flex",
81
+ justifyContent: "flex-start",
82
+ alignItems: "center",
83
+ ...styles.footer
84
+ };
85
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.ui.footer, { ref, className: (0, import_utils.cx)("ui-card-footer", className), __css: css, ...rest });
86
+ });
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ Card,
90
+ CardBody,
91
+ CardFooter,
92
+ CardHeader
93
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,12 @@
1
+ import {
2
+ Card,
3
+ CardBody,
4
+ CardFooter,
5
+ CardHeader
6
+ } from "./chunk-JG6OERSN.mjs";
7
+ export {
8
+ Card,
9
+ CardBody,
10
+ CardFooter,
11
+ CardHeader
12
+ };
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@yamada-ui/card",
3
+ "version": "0.1.0",
4
+ "description": "Yamada UI card component",
5
+ "keywords": [
6
+ "yamada",
7
+ "yamada ui",
8
+ "react",
9
+ "emotion",
10
+ "component",
11
+ "card",
12
+ "ui",
13
+ "uikit",
14
+ "styled",
15
+ "style-props",
16
+ "styled-component",
17
+ "css-in-js"
18
+ ],
19
+ "author": "Hirotomo Yamada <hirotomo.yamada@avap.co.jp>",
20
+ "license": "MIT",
21
+ "main": "dist/index.js",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "sideEffects": false,
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/hirotomoyamada/yamada-ui",
32
+ "directory": "packages/components/card"
33
+ },
34
+ "bugs": {
35
+ "url": "https://github.com/hirotomoyamada/yamada-ui/issues"
36
+ },
37
+ "dependencies": {
38
+ "@yamada-ui/core": "0.1.0",
39
+ "@yamada-ui/utils": "0.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "react": "^18.0.0",
43
+ "clean-package": "2.2.0"
44
+ },
45
+ "peerDependencies": {
46
+ "react": ">=18"
47
+ },
48
+ "clean-package": "../../../clean-package.config.json",
49
+ "tsup": {
50
+ "clean": true,
51
+ "target": "es2019",
52
+ "format": [
53
+ "cjs",
54
+ "esm"
55
+ ]
56
+ },
57
+ "module": "dist/index.mjs",
58
+ "types": "dist/index.d.ts",
59
+ "exports": {
60
+ ".": {
61
+ "types": "./dist/index.d.ts",
62
+ "import": "./dist/index.mjs",
63
+ "require": "./dist/index.js"
64
+ },
65
+ "./package.json": "./package.json"
66
+ },
67
+ "scripts": {
68
+ "dev": "pnpm build:fast -- --watch",
69
+ "build": "tsup src --dts",
70
+ "build:fast": "tsup src",
71
+ "clean": "rimraf dist .turbo",
72
+ "typecheck": "tsc --noEmit",
73
+ "gen:docs": "tsx ../../../scripts/generate-docs"
74
+ }
75
+ }