@yamada-ui/card 1.0.29-next-20240609204504 → 2.0.0-next-20240605074529
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/card.js +0 -11
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +1 -1
- package/dist/{chunk-F3TZ4KBM.mjs → chunk-4IQN4645.mjs} +1 -12
- package/dist/chunk-4IQN4645.mjs.map +1 -0
- package/dist/index.js +0 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-F3TZ4KBM.mjs.map +0 -1
package/dist/card.js
CHANGED
@@ -44,11 +44,9 @@ var Card = (0, import_core.forwardRef)((props, ref) => {
|
|
44
44
|
...rest
|
45
45
|
} = (0, import_core.omitThemeProps)(mergedProps);
|
46
46
|
const css = {
|
47
|
-
display: "flex",
|
48
47
|
flexDirection,
|
49
48
|
justifyContent,
|
50
49
|
alignItems,
|
51
|
-
wordWrap: "break-word",
|
52
50
|
...styles.container
|
53
51
|
};
|
54
52
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -65,9 +63,6 @@ var CardHeader = (0, import_core.forwardRef)(
|
|
65
63
|
({ className, ...rest }, ref) => {
|
66
64
|
const styles = useCard();
|
67
65
|
const css = {
|
68
|
-
display: "flex",
|
69
|
-
justifyContent: "flex-start",
|
70
|
-
alignItems: "center",
|
71
66
|
...styles.header
|
72
67
|
};
|
73
68
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -85,9 +80,6 @@ var CardBody = (0, import_core.forwardRef)(
|
|
85
80
|
({ className, ...rest }, ref) => {
|
86
81
|
const styles = useCard();
|
87
82
|
const css = {
|
88
|
-
display: "flex",
|
89
|
-
flexDirection: "column",
|
90
|
-
alignItems: "flex-start",
|
91
83
|
...styles.body
|
92
84
|
};
|
93
85
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -105,9 +97,6 @@ var CardFooter = (0, import_core.forwardRef)(
|
|
105
97
|
({ className, ...rest }, ref) => {
|
106
98
|
const styles = useCard();
|
107
99
|
const css = {
|
108
|
-
display: "flex",
|
109
|
-
justifyContent: "flex-start",
|
110
|
-
alignItems: "center",
|
111
100
|
...styles.footer
|
112
101
|
};
|
113
102
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
package/dist/card.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/card.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\n\nconst [CardProvider, useCard] = createContext<Record<string, CSSUIObject>>({\n name: `CardContext`,\n errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in \"<Card />\" `,\n})\n\ntype CardOptions = {\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSUIObject[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSUIObject[\"justifyContent\"]\n /**\n * The CSS `align-items` property.\n */\n align?: CSSUIObject[\"alignItems\"]\n}\n\nexport type CardProps = Omit<HTMLUIProps<\"article\">, \"direction\"> &\n ThemeProps<\"Card\"> &\n CardOptions\n\n/**\n * `Card` is a component that groups and displays related information. By default, it renders a `article` element.\n *\n * @see Docs https://yamada-ui.com/components/data-display/card\n */\nexport const Card = forwardRef<CardProps, \"article\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"Card\", props)\n const {\n className,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n align: alignItems,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n
|
1
|
+
{"version":3,"sources":["../src/card.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\n\nconst [CardProvider, useCard] = createContext<Record<string, CSSUIObject>>({\n name: `CardContext`,\n errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in \"<Card />\" `,\n})\n\ntype CardOptions = {\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSUIObject[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSUIObject[\"justifyContent\"]\n /**\n * The CSS `align-items` property.\n */\n align?: CSSUIObject[\"alignItems\"]\n}\n\nexport type CardProps = Omit<HTMLUIProps<\"article\">, \"direction\"> &\n ThemeProps<\"Card\"> &\n CardOptions\n\n/**\n * `Card` is a component that groups and displays related information. By default, it renders a `article` element.\n *\n * @see Docs https://yamada-ui.com/components/data-display/card\n */\nexport const Card = forwardRef<CardProps, \"article\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"Card\", props)\n const {\n className,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n align: alignItems,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n flexDirection,\n justifyContent,\n alignItems,\n ...styles.container,\n }\n\n return (\n <CardProvider value={styles}>\n <ui.article\n ref={ref}\n className={cx(\"ui-card\", className)}\n __css={css}\n {...rest}\n />\n </CardProvider>\n )\n})\n\nexport type CardHeaderProps = HTMLUIProps<\"header\">\n\nexport const CardHeader = forwardRef<CardHeaderProps, \"header\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.header,\n }\n\n return (\n <ui.header\n ref={ref}\n className={cx(\"ui-card__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardBodyProps = HTMLUIProps<\"main\">\n\nexport const CardBody = forwardRef<CardBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.body,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-card__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardFooterProps = HTMLUIProps<\"footer\">\n\nexport const CardFooter = forwardRef<CardFooterProps, \"footer\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.footer,\n }\n\n return (\n <ui.footer\n ref={ref}\n className={cx(\"ui-card__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAKO;AACP,mBAAkC;AAkD5B;AAhDN,IAAM,CAAC,cAAc,OAAO,QAAI,4BAA2C;AAAA,EACzE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA0BM,IAAM,WAAO,wBAAiC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,QAAI,oCAAuB,QAAQ,KAAK;AAClE,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,SAAS;AAAA,IACT,OAAO;AAAA,IACP,GAAG;AAAA,EACL,QAAI,4BAAe,WAAW;AAE9B,QAAM,MAAmB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,OAAO;AAAA,EACZ;AAEA,SACE,4CAAC,gBAAa,OAAO,QACnB;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,WAAW,SAAS;AAAA,MAClC,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN,GACF;AAEJ,CAAC;AAIM,IAAM,iBAAa;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,iBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAIO,IAAM,eAAW;AAAA,EACtB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,iBAAG,iBAAiB,SAAS;AAAA,QACxC,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAIO,IAAM,iBAAa;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,iBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
|
package/dist/card.mjs
CHANGED
@@ -23,11 +23,9 @@ var Card = forwardRef((props, ref) => {
|
|
23
23
|
...rest
|
24
24
|
} = omitThemeProps(mergedProps);
|
25
25
|
const css = {
|
26
|
-
display: "flex",
|
27
26
|
flexDirection,
|
28
27
|
justifyContent,
|
29
28
|
alignItems,
|
30
|
-
wordWrap: "break-word",
|
31
29
|
...styles.container
|
32
30
|
};
|
33
31
|
return /* @__PURE__ */ jsx(CardProvider, { value: styles, children: /* @__PURE__ */ jsx(
|
@@ -44,9 +42,6 @@ var CardHeader = forwardRef(
|
|
44
42
|
({ className, ...rest }, ref) => {
|
45
43
|
const styles = useCard();
|
46
44
|
const css = {
|
47
|
-
display: "flex",
|
48
|
-
justifyContent: "flex-start",
|
49
|
-
alignItems: "center",
|
50
45
|
...styles.header
|
51
46
|
};
|
52
47
|
return /* @__PURE__ */ jsx(
|
@@ -64,9 +59,6 @@ var CardBody = forwardRef(
|
|
64
59
|
({ className, ...rest }, ref) => {
|
65
60
|
const styles = useCard();
|
66
61
|
const css = {
|
67
|
-
display: "flex",
|
68
|
-
flexDirection: "column",
|
69
|
-
alignItems: "flex-start",
|
70
62
|
...styles.body
|
71
63
|
};
|
72
64
|
return /* @__PURE__ */ jsx(
|
@@ -84,9 +76,6 @@ var CardFooter = forwardRef(
|
|
84
76
|
({ className, ...rest }, ref) => {
|
85
77
|
const styles = useCard();
|
86
78
|
const css = {
|
87
|
-
display: "flex",
|
88
|
-
justifyContent: "flex-start",
|
89
|
-
alignItems: "center",
|
90
79
|
...styles.footer
|
91
80
|
};
|
92
81
|
return /* @__PURE__ */ jsx(
|
@@ -107,4 +96,4 @@ export {
|
|
107
96
|
CardBody,
|
108
97
|
CardFooter
|
109
98
|
};
|
110
|
-
//# sourceMappingURL=chunk-
|
99
|
+
//# sourceMappingURL=chunk-4IQN4645.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/card.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\n\nconst [CardProvider, useCard] = createContext<Record<string, CSSUIObject>>({\n name: `CardContext`,\n errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in \"<Card />\" `,\n})\n\ntype CardOptions = {\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSUIObject[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSUIObject[\"justifyContent\"]\n /**\n * The CSS `align-items` property.\n */\n align?: CSSUIObject[\"alignItems\"]\n}\n\nexport type CardProps = Omit<HTMLUIProps<\"article\">, \"direction\"> &\n ThemeProps<\"Card\"> &\n CardOptions\n\n/**\n * `Card` is a component that groups and displays related information. By default, it renders a `article` element.\n *\n * @see Docs https://yamada-ui.com/components/data-display/card\n */\nexport const Card = forwardRef<CardProps, \"article\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"Card\", props)\n const {\n className,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n align: alignItems,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n flexDirection,\n justifyContent,\n alignItems,\n ...styles.container,\n }\n\n return (\n <CardProvider value={styles}>\n <ui.article\n ref={ref}\n className={cx(\"ui-card\", className)}\n __css={css}\n {...rest}\n />\n </CardProvider>\n )\n})\n\nexport type CardHeaderProps = HTMLUIProps<\"header\">\n\nexport const CardHeader = forwardRef<CardHeaderProps, \"header\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.header,\n }\n\n return (\n <ui.header\n ref={ref}\n className={cx(\"ui-card__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardBodyProps = HTMLUIProps<\"main\">\n\nexport const CardBody = forwardRef<CardBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.body,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-card__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardFooterProps = HTMLUIProps<\"footer\">\n\nexport const CardFooter = forwardRef<CardFooterProps, \"footer\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.footer,\n }\n\n return (\n <ui.footer\n ref={ref}\n className={cx(\"ui-card__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe,UAAU;AAkD5B;AAhDN,IAAM,CAA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AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,GAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,WAAW,GAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
|
package/dist/index.js
CHANGED
@@ -46,11 +46,9 @@ var Card = (0, import_core.forwardRef)((props, ref) => {
|
|
46
46
|
...rest
|
47
47
|
} = (0, import_core.omitThemeProps)(mergedProps);
|
48
48
|
const css = {
|
49
|
-
display: "flex",
|
50
49
|
flexDirection,
|
51
50
|
justifyContent,
|
52
51
|
alignItems,
|
53
|
-
wordWrap: "break-word",
|
54
52
|
...styles.container
|
55
53
|
};
|
56
54
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardProvider, { value: styles, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -67,9 +65,6 @@ var CardHeader = (0, import_core.forwardRef)(
|
|
67
65
|
({ className, ...rest }, ref) => {
|
68
66
|
const styles = useCard();
|
69
67
|
const css = {
|
70
|
-
display: "flex",
|
71
|
-
justifyContent: "flex-start",
|
72
|
-
alignItems: "center",
|
73
68
|
...styles.header
|
74
69
|
};
|
75
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -87,9 +82,6 @@ var CardBody = (0, import_core.forwardRef)(
|
|
87
82
|
({ className, ...rest }, ref) => {
|
88
83
|
const styles = useCard();
|
89
84
|
const css = {
|
90
|
-
display: "flex",
|
91
|
-
flexDirection: "column",
|
92
|
-
alignItems: "flex-start",
|
93
85
|
...styles.body
|
94
86
|
};
|
95
87
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
@@ -107,9 +99,6 @@ var CardFooter = (0, import_core.forwardRef)(
|
|
107
99
|
({ className, ...rest }, ref) => {
|
108
100
|
const styles = useCard();
|
109
101
|
const css = {
|
110
|
-
display: "flex",
|
111
|
-
justifyContent: "flex-start",
|
112
|
-
alignItems: "center",
|
113
102
|
...styles.footer
|
114
103
|
};
|
115
104
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/card.tsx"],"sourcesContent":["export { Card, CardHeader, CardBody, CardFooter } from \"./card\"\nexport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from \"./card\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\n\nconst [CardProvider, useCard] = createContext<Record<string, CSSUIObject>>({\n name: `CardContext`,\n errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in \"<Card />\" `,\n})\n\ntype CardOptions = {\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSUIObject[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSUIObject[\"justifyContent\"]\n /**\n * The CSS `align-items` property.\n */\n align?: CSSUIObject[\"alignItems\"]\n}\n\nexport type CardProps = Omit<HTMLUIProps<\"article\">, \"direction\"> &\n ThemeProps<\"Card\"> &\n CardOptions\n\n/**\n * `Card` is a component that groups and displays related information. By default, it renders a `article` element.\n *\n * @see Docs https://yamada-ui.com/components/data-display/card\n */\nexport const Card = forwardRef<CardProps, \"article\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"Card\", props)\n const {\n className,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n align: alignItems,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/card.tsx"],"sourcesContent":["export { Card, CardHeader, CardBody, CardFooter } from \"./card\"\nexport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from \"./card\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\n\nconst [CardProvider, useCard] = createContext<Record<string, CSSUIObject>>({\n name: `CardContext`,\n errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in \"<Card />\" `,\n})\n\ntype CardOptions = {\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSUIObject[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSUIObject[\"justifyContent\"]\n /**\n * The CSS `align-items` property.\n */\n align?: CSSUIObject[\"alignItems\"]\n}\n\nexport type CardProps = Omit<HTMLUIProps<\"article\">, \"direction\"> &\n ThemeProps<\"Card\"> &\n CardOptions\n\n/**\n * `Card` is a component that groups and displays related information. By default, it renders a `article` element.\n *\n * @see Docs https://yamada-ui.com/components/data-display/card\n */\nexport const Card = forwardRef<CardProps, \"article\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"Card\", props)\n const {\n className,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n align: alignItems,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n flexDirection,\n justifyContent,\n alignItems,\n ...styles.container,\n }\n\n return (\n <CardProvider value={styles}>\n <ui.article\n ref={ref}\n className={cx(\"ui-card\", className)}\n __css={css}\n {...rest}\n />\n </CardProvider>\n )\n})\n\nexport type CardHeaderProps = HTMLUIProps<\"header\">\n\nexport const CardHeader = forwardRef<CardHeaderProps, \"header\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.header,\n }\n\n return (\n <ui.header\n ref={ref}\n className={cx(\"ui-card__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardBodyProps = HTMLUIProps<\"main\">\n\nexport const CardBody = forwardRef<CardBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.body,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-card__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardFooterProps = HTMLUIProps<\"footer\">\n\nexport const CardFooter = forwardRef<CardFooterProps, \"footer\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n ...styles.footer,\n }\n\n return (\n <ui.footer\n ref={ref}\n className={cx(\"ui-card__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,kBAKO;AACP,mBAAkC;AAkD5B;AAhDN,IAAM,CAAC,cAAc,OAAO,QAAI,4BAA2C;AAAA,EACzE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA0BM,IAAM,WAAO,wBAAiC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,QAAI,oCAAuB,QAAQ,KAAK;AAClE,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,SAAS;AAAA,IACT,OAAO;AAAA,IACP,GAAG;AAAA,EACL,QAAI,4BAAe,WAAW;AAE9B,QAAM,MAAmB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,OAAO;AAAA,EACZ;AAEA,SACE,4CAAC,gBAAa,OAAO,QACnB;AAAA,IAAC,eAAG;AAAA,IAAH;AAAA,MACC;AAAA,MACA,eAAW,iBAAG,WAAW,SAAS;AAAA,MAClC,OAAO;AAAA,MACN,GAAG;AAAA;AAAA,EACN,GACF;AAEJ,CAAC;AAIM,IAAM,iBAAa;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,iBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAIO,IAAM,eAAW;AAAA,EACtB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,iBAAG,iBAAiB,SAAS;AAAA,QACxC,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAIO,IAAM,iBAAa;AAAA,EACxB,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,QAAQ;AAC/B,UAAM,SAAS,QAAQ;AAEvB,UAAM,MAAmB;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AAEA,WACE;AAAA,MAAC,eAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,iBAAG,mBAAmB,SAAS;AAAA,QAC1C,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;","names":[]}
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yamada-ui/card",
|
3
|
-
"version": "
|
3
|
+
"version": "2.0.0-next-20240605074529",
|
4
4
|
"description": "Yamada UI card component",
|
5
5
|
"keywords": [
|
6
6
|
"yamada",
|
@@ -36,8 +36,8 @@
|
|
36
36
|
"url": "https://github.com/yamada-ui/yamada-ui/issues"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@yamada-ui/core": "1.7.1-next-
|
40
|
-
"@yamada-ui/utils": "1.2.1-next-
|
39
|
+
"@yamada-ui/core": "1.7.1-next-20240605074529",
|
40
|
+
"@yamada-ui/utils": "1.2.1-next-20240605074529"
|
41
41
|
},
|
42
42
|
"devDependencies": {
|
43
43
|
"react": "^18.0.0",
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/card.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport {\n ui,\n forwardRef,\n omitThemeProps,\n useMultiComponentStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\n\nconst [CardProvider, useCard] = createContext<Record<string, CSSUIObject>>({\n name: `CardContext`,\n errorMessage: `useCard returned is 'undefined'. Seems you forgot to wrap the components in \"<Card />\" `,\n})\n\ntype CardOptions = {\n /**\n * The CSS `flex-direction` property.\n */\n direction?: CSSUIObject[\"flexDirection\"]\n /**\n * The CSS `justify-content` property.\n */\n justify?: CSSUIObject[\"justifyContent\"]\n /**\n * The CSS `align-items` property.\n */\n align?: CSSUIObject[\"alignItems\"]\n}\n\nexport type CardProps = Omit<HTMLUIProps<\"article\">, \"direction\"> &\n ThemeProps<\"Card\"> &\n CardOptions\n\n/**\n * `Card` is a component that groups and displays related information. By default, it renders a `article` element.\n *\n * @see Docs https://yamada-ui.com/components/data-display/card\n */\nexport const Card = forwardRef<CardProps, \"article\">((props, ref) => {\n const [styles, mergedProps] = useMultiComponentStyle(\"Card\", props)\n const {\n className,\n direction: flexDirection = \"column\",\n justify: justifyContent,\n align: alignItems,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection,\n justifyContent,\n alignItems,\n wordWrap: \"break-word\",\n ...styles.container,\n }\n\n return (\n <CardProvider value={styles}>\n <ui.article\n ref={ref}\n className={cx(\"ui-card\", className)}\n __css={css}\n {...rest}\n />\n </CardProvider>\n )\n})\n\nexport type CardHeaderProps = HTMLUIProps<\"header\">\n\nexport const CardHeader = forwardRef<CardHeaderProps, \"header\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n ...styles.header,\n }\n\n return (\n <ui.header\n ref={ref}\n className={cx(\"ui-card__header\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardBodyProps = HTMLUIProps<\"main\">\n\nexport const CardBody = forwardRef<CardBodyProps, \"main\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n ...styles.body,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-card__body\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nexport type CardFooterProps = HTMLUIProps<\"footer\">\n\nexport const CardFooter = forwardRef<CardFooterProps, \"footer\">(\n ({ className, ...rest }, ref) => {\n const styles = useCard()\n\n const css: CSSUIObject = {\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n ...styles.footer,\n }\n\n return (\n <ui.footer\n ref={ref}\n className={cx(\"ui-card__footer\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n"],"mappings":";;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe,UAAU;AAoD5B;AAlDN,IAAM,CAAC,cAAc,OAAO,IAAI,cAA2C;AAAA,EACzE,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AA0BM,IAAM,OAAO,WAAiC,CAAC,OAAO,QAAQ;AACnE,QAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,QAAQ,KAAK;AAClE,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,SAAS;AAAA,I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