@heroui/card 2.2.11 → 2.2.14

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.
@@ -0,0 +1,6 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { HTMLHeroUIProps } from '@heroui/system';
3
+
4
+ declare const CardBody: _heroui_system.InternalForwardRefRenderFunction<"div", HTMLHeroUIProps<"div">, never>;
5
+
6
+ export { CardBody as default };
@@ -0,0 +1,6 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { HTMLHeroUIProps } from '@heroui/system';
3
+
4
+ declare const CardBody: _heroui_system.InternalForwardRefRenderFunction<"div", HTMLHeroUIProps<"div">, never>;
5
+
6
+ export { CardBody as default };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/card-body.tsx
22
+ var card_body_exports = {};
23
+ __export(card_body_exports, {
24
+ default: () => card_body_default
25
+ });
26
+ module.exports = __toCommonJS(card_body_exports);
27
+ var import_system = require("@heroui/system");
28
+ var import_react_utils2 = require("@heroui/react-utils");
29
+ var import_shared_utils = require("@heroui/shared-utils");
30
+
31
+ // src/card-context.ts
32
+ var import_react_utils = require("@heroui/react-utils");
33
+ var [CardProvider, useCardContext] = (0, import_react_utils.createContext)({
34
+ name: "CardContext",
35
+ strict: true,
36
+ errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
37
+ });
38
+
39
+ // src/card-body.tsx
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var CardBody = (0, import_system.forwardRef)((props, ref) => {
42
+ var _a;
43
+ const { as, className, children, ...otherProps } = props;
44
+ const Component = as || "div";
45
+ const domRef = (0, import_react_utils2.useDOMRef)(ref);
46
+ const { slots, classNames } = useCardContext();
47
+ const bodyStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.body, className);
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref: domRef, className: (_a = slots.body) == null ? void 0 : _a.call(slots, { class: bodyStyles }), ...otherProps, children });
49
+ });
50
+ CardBody.displayName = "HeroUI.CardBody";
51
+ var card_body_default = CardBody;
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ card_body_default
4
+ } from "./chunk-LGSBTEIA.mjs";
5
+ import "./chunk-XHGGCEVJ.mjs";
6
+ export {
7
+ card_body_default as default
8
+ };
@@ -0,0 +1,13 @@
1
+ import * as react from 'react';
2
+ import { ContextType } from './use-card.mjs';
3
+ import '@heroui/system';
4
+ import '@react-types/shared';
5
+ import '@heroui/theme';
6
+ import '@heroui/ripple';
7
+ import '@react-aria/interactions';
8
+ import '@heroui/react-utils';
9
+
10
+ declare const CardProvider: react.Provider<ContextType>;
11
+ declare const useCardContext: () => ContextType;
12
+
13
+ export { CardProvider, useCardContext };
@@ -0,0 +1,13 @@
1
+ import * as react from 'react';
2
+ import { ContextType } from './use-card.js';
3
+ import '@heroui/system';
4
+ import '@react-types/shared';
5
+ import '@heroui/theme';
6
+ import '@heroui/ripple';
7
+ import '@react-aria/interactions';
8
+ import '@heroui/react-utils';
9
+
10
+ declare const CardProvider: react.Provider<ContextType>;
11
+ declare const useCardContext: () => ContextType;
12
+
13
+ export { CardProvider, useCardContext };
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/card-context.ts
22
+ var card_context_exports = {};
23
+ __export(card_context_exports, {
24
+ CardProvider: () => CardProvider,
25
+ useCardContext: () => useCardContext
26
+ });
27
+ module.exports = __toCommonJS(card_context_exports);
28
+ var import_react_utils = require("@heroui/react-utils");
29
+ var [CardProvider, useCardContext] = (0, import_react_utils.createContext)({
30
+ name: "CardContext",
31
+ strict: true,
32
+ errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
33
+ });
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ CardProvider,
37
+ useCardContext
38
+ });
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ CardProvider,
4
+ useCardContext
5
+ } from "./chunk-XHGGCEVJ.mjs";
6
+ export {
7
+ CardProvider,
8
+ useCardContext
9
+ };
@@ -0,0 +1,8 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { HTMLHeroUIProps } from '@heroui/system';
3
+
4
+ interface CardFooterProps extends HTMLHeroUIProps<"div"> {
5
+ }
6
+ declare const CardFooter: _heroui_system.InternalForwardRefRenderFunction<"div", CardFooterProps, never>;
7
+
8
+ export { type CardFooterProps, CardFooter as default };
@@ -0,0 +1,8 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { HTMLHeroUIProps } from '@heroui/system';
3
+
4
+ interface CardFooterProps extends HTMLHeroUIProps<"div"> {
5
+ }
6
+ declare const CardFooter: _heroui_system.InternalForwardRefRenderFunction<"div", CardFooterProps, never>;
7
+
8
+ export { type CardFooterProps, CardFooter as default };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/card-footer.tsx
22
+ var card_footer_exports = {};
23
+ __export(card_footer_exports, {
24
+ default: () => card_footer_default
25
+ });
26
+ module.exports = __toCommonJS(card_footer_exports);
27
+ var import_system = require("@heroui/system");
28
+ var import_react_utils2 = require("@heroui/react-utils");
29
+ var import_shared_utils = require("@heroui/shared-utils");
30
+
31
+ // src/card-context.ts
32
+ var import_react_utils = require("@heroui/react-utils");
33
+ var [CardProvider, useCardContext] = (0, import_react_utils.createContext)({
34
+ name: "CardContext",
35
+ strict: true,
36
+ errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
37
+ });
38
+
39
+ // src/card-footer.tsx
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var CardFooter = (0, import_system.forwardRef)((props, ref) => {
42
+ var _a;
43
+ const { as, className, children, ...otherProps } = props;
44
+ const Component = as || "div";
45
+ const domRef = (0, import_react_utils2.useDOMRef)(ref);
46
+ const { slots, classNames } = useCardContext();
47
+ const footerStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.footer, className);
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref: domRef, className: (_a = slots.footer) == null ? void 0 : _a.call(slots, { class: footerStyles }), ...otherProps, children });
49
+ });
50
+ CardFooter.displayName = "HeroUI.CardFooter";
51
+ var card_footer_default = CardFooter;
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ card_footer_default
4
+ } from "./chunk-TE6SZS6W.mjs";
5
+ import "./chunk-XHGGCEVJ.mjs";
6
+ export {
7
+ card_footer_default as default
8
+ };
@@ -0,0 +1,6 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { HTMLHeroUIProps } from '@heroui/system';
3
+
4
+ declare const CardHeader: _heroui_system.InternalForwardRefRenderFunction<"div", HTMLHeroUIProps<"div">, never>;
5
+
6
+ export { CardHeader as default };
@@ -0,0 +1,6 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { HTMLHeroUIProps } from '@heroui/system';
3
+
4
+ declare const CardHeader: _heroui_system.InternalForwardRefRenderFunction<"div", HTMLHeroUIProps<"div">, never>;
5
+
6
+ export { CardHeader as default };
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/card-header.tsx
22
+ var card_header_exports = {};
23
+ __export(card_header_exports, {
24
+ default: () => card_header_default
25
+ });
26
+ module.exports = __toCommonJS(card_header_exports);
27
+ var import_system = require("@heroui/system");
28
+ var import_react_utils2 = require("@heroui/react-utils");
29
+ var import_shared_utils = require("@heroui/shared-utils");
30
+
31
+ // src/card-context.ts
32
+ var import_react_utils = require("@heroui/react-utils");
33
+ var [CardProvider, useCardContext] = (0, import_react_utils.createContext)({
34
+ name: "CardContext",
35
+ strict: true,
36
+ errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
37
+ });
38
+
39
+ // src/card-header.tsx
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var CardHeader = (0, import_system.forwardRef)((props, ref) => {
42
+ var _a;
43
+ const { as, className, children, ...otherProps } = props;
44
+ const Component = as || "div";
45
+ const domRef = (0, import_react_utils2.useDOMRef)(ref);
46
+ const { slots, classNames } = useCardContext();
47
+ const headerStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.header, className);
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref: domRef, className: (_a = slots.header) == null ? void 0 : _a.call(slots, { class: headerStyles }), ...otherProps, children });
49
+ });
50
+ CardHeader.displayName = "HeroUI.CardHeader";
51
+ var card_header_default = CardHeader;
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ card_header_default
4
+ } from "./chunk-D5XJWRAV.mjs";
5
+ import "./chunk-XHGGCEVJ.mjs";
6
+ export {
7
+ card_header_default as default
8
+ };
@@ -0,0 +1,14 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { UseCardProps } from './use-card.mjs';
3
+ import 'react';
4
+ import '@react-types/shared';
5
+ import '@heroui/theme';
6
+ import '@heroui/ripple';
7
+ import '@react-aria/interactions';
8
+ import '@heroui/react-utils';
9
+
10
+ interface CardProps extends UseCardProps {
11
+ }
12
+ declare const Card: _heroui_system.InternalForwardRefRenderFunction<"div", CardProps, never>;
13
+
14
+ export { type CardProps, Card as default };
package/dist/card.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import * as _heroui_system from '@heroui/system';
2
+ import { UseCardProps } from './use-card.js';
3
+ import 'react';
4
+ import '@react-types/shared';
5
+ import '@heroui/theme';
6
+ import '@heroui/ripple';
7
+ import '@react-aria/interactions';
8
+ import '@heroui/react-utils';
9
+
10
+ interface CardProps extends UseCardProps {
11
+ }
12
+ declare const Card: _heroui_system.InternalForwardRefRenderFunction<"div", CardProps, never>;
13
+
14
+ export { type CardProps, Card as default };
package/dist/card.js ADDED
@@ -0,0 +1,203 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/card.tsx
22
+ var card_exports = {};
23
+ __export(card_exports, {
24
+ default: () => card_default
25
+ });
26
+ module.exports = __toCommonJS(card_exports);
27
+ var import_system2 = require("@heroui/system");
28
+ var import_ripple2 = require("@heroui/ripple");
29
+
30
+ // src/card-context.ts
31
+ var import_react_utils = require("@heroui/react-utils");
32
+ var [CardProvider, useCardContext] = (0, import_react_utils.createContext)({
33
+ name: "CardContext",
34
+ strict: true,
35
+ errorMessage: "useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"
36
+ });
37
+
38
+ // src/use-card.ts
39
+ var import_theme = require("@heroui/theme");
40
+ var import_react = require("react");
41
+ var import_utils = require("@react-aria/utils");
42
+ var import_focus = require("@react-aria/focus");
43
+ var import_interactions = require("@react-aria/interactions");
44
+ var import_use_aria_button = require("@heroui/use-aria-button");
45
+ var import_system = require("@heroui/system");
46
+ var import_shared_utils = require("@heroui/shared-utils");
47
+ var import_react_utils2 = require("@heroui/react-utils");
48
+ var import_react_utils3 = require("@heroui/react-utils");
49
+ var import_ripple = require("@heroui/ripple");
50
+ function useCard(originalProps) {
51
+ var _a, _b, _c, _d;
52
+ const globalContext = (0, import_system.useProviderContext)();
53
+ const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.card.variantKeys);
54
+ const {
55
+ ref,
56
+ as,
57
+ children,
58
+ onClick,
59
+ onPress,
60
+ autoFocus,
61
+ className,
62
+ classNames,
63
+ allowTextSelectionOnPress = true,
64
+ ...otherProps
65
+ } = props;
66
+ const domRef = (0, import_react_utils3.useDOMRef)(ref);
67
+ const Component = as || (originalProps.isPressable ? "button" : "div");
68
+ const shouldFilterDOMProps = typeof Component === "string";
69
+ const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
70
+ const disableRipple = (_d = (_c = originalProps.disableRipple) != null ? _c : globalContext == null ? void 0 : globalContext.disableRipple) != null ? _d : false;
71
+ const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
72
+ const { onClear: onClearRipple, onPress: onRipplePressHandler, ripples } = (0, import_ripple.useRipple)();
73
+ const handlePress = (0, import_react.useCallback)(
74
+ (e) => {
75
+ if (disableRipple || disableAnimation) return;
76
+ domRef.current && onRipplePressHandler(e);
77
+ },
78
+ [disableRipple, disableAnimation, domRef, onRipplePressHandler]
79
+ );
80
+ const { buttonProps, isPressed } = (0, import_use_aria_button.useAriaButton)(
81
+ {
82
+ onPress: (0, import_utils.chain)(onPress, handlePress),
83
+ elementType: as,
84
+ isDisabled: !originalProps.isPressable,
85
+ onClick,
86
+ allowTextSelectionOnPress,
87
+ ...otherProps
88
+ },
89
+ domRef
90
+ );
91
+ const { hoverProps, isHovered } = (0, import_interactions.useHover)({
92
+ isDisabled: !originalProps.isHoverable,
93
+ ...otherProps
94
+ });
95
+ const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)({
96
+ autoFocus
97
+ });
98
+ const slots = (0, import_react.useMemo)(
99
+ () => (0, import_theme.card)({
100
+ ...variantProps,
101
+ disableAnimation
102
+ }),
103
+ [(0, import_shared_utils.objectToDeps)(variantProps), disableAnimation]
104
+ );
105
+ const context = (0, import_react.useMemo)(
106
+ () => ({
107
+ slots,
108
+ classNames,
109
+ disableAnimation,
110
+ isDisabled: originalProps.isDisabled,
111
+ isFooterBlurred: originalProps.isFooterBlurred,
112
+ fullWidth: originalProps.fullWidth
113
+ }),
114
+ [
115
+ slots,
116
+ classNames,
117
+ originalProps.isDisabled,
118
+ originalProps.isFooterBlurred,
119
+ disableAnimation,
120
+ originalProps.fullWidth
121
+ ]
122
+ );
123
+ const getCardProps = (0, import_react.useCallback)(
124
+ (props2 = {}) => {
125
+ return {
126
+ ref: domRef,
127
+ className: slots.base({ class: baseStyles }),
128
+ tabIndex: originalProps.isPressable ? 0 : -1,
129
+ "data-hover": (0, import_shared_utils.dataAttr)(isHovered),
130
+ "data-pressed": (0, import_shared_utils.dataAttr)(isPressed),
131
+ "data-focus": (0, import_shared_utils.dataAttr)(isFocused),
132
+ "data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
133
+ "data-disabled": (0, import_shared_utils.dataAttr)(originalProps.isDisabled),
134
+ ...(0, import_utils.mergeProps)(
135
+ originalProps.isPressable ? { ...buttonProps, ...focusProps, role: "button" } : {},
136
+ originalProps.isHoverable ? hoverProps : {},
137
+ (0, import_react_utils2.filterDOMProps)(otherProps, {
138
+ enabled: shouldFilterDOMProps
139
+ }),
140
+ (0, import_react_utils2.filterDOMProps)(props2)
141
+ )
142
+ };
143
+ },
144
+ [
145
+ domRef,
146
+ slots,
147
+ baseStyles,
148
+ shouldFilterDOMProps,
149
+ originalProps.isPressable,
150
+ originalProps.isHoverable,
151
+ originalProps.isDisabled,
152
+ isHovered,
153
+ isPressed,
154
+ isFocusVisible,
155
+ buttonProps,
156
+ focusProps,
157
+ hoverProps,
158
+ otherProps
159
+ ]
160
+ );
161
+ const getRippleProps = (0, import_react.useCallback)(
162
+ () => ({ ripples, onClear: onClearRipple }),
163
+ [ripples, onClearRipple]
164
+ );
165
+ return {
166
+ context,
167
+ domRef,
168
+ Component,
169
+ classNames,
170
+ children,
171
+ isHovered,
172
+ isPressed,
173
+ disableAnimation,
174
+ isPressable: originalProps.isPressable,
175
+ isHoverable: originalProps.isHoverable,
176
+ disableRipple,
177
+ handlePress,
178
+ isFocusVisible,
179
+ getCardProps,
180
+ getRippleProps
181
+ };
182
+ }
183
+
184
+ // src/card.tsx
185
+ var import_jsx_runtime = require("react/jsx-runtime");
186
+ var Card = (0, import_system2.forwardRef)((props, ref) => {
187
+ const {
188
+ children,
189
+ context,
190
+ Component,
191
+ isPressable,
192
+ disableAnimation,
193
+ disableRipple,
194
+ getCardProps,
195
+ getRippleProps
196
+ } = useCard({ ...props, ref });
197
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Component, { ...getCardProps(), children: [
198
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardProvider, { value: context, children }),
199
+ isPressable && !disableAnimation && !disableRipple && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ripple2.Ripple, { ...getRippleProps() })
200
+ ] });
201
+ });
202
+ Card.displayName = "HeroUI.Card";
203
+ var card_default = Card;
package/dist/card.mjs ADDED
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ card_default
4
+ } from "./chunk-MW56SEHC.mjs";
5
+ import "./chunk-XHGGCEVJ.mjs";
6
+ import "./chunk-NVHFBF4D.mjs";
7
+ export {
8
+ card_default as default
9
+ };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import {
3
+ useCardContext
4
+ } from "./chunk-XHGGCEVJ.mjs";
5
+
6
+ // src/card-header.tsx
7
+ import { forwardRef } from "@heroui/system";
8
+ import { useDOMRef } from "@heroui/react-utils";
9
+ import { clsx } from "@heroui/shared-utils";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var CardHeader = forwardRef((props, ref) => {
12
+ var _a;
13
+ const { as, className, children, ...otherProps } = props;
14
+ const Component = as || "div";
15
+ const domRef = useDOMRef(ref);
16
+ const { slots, classNames } = useCardContext();
17
+ const headerStyles = clsx(classNames == null ? void 0 : classNames.header, className);
18
+ return /* @__PURE__ */ jsx(Component, { ref: domRef, className: (_a = slots.header) == null ? void 0 : _a.call(slots, { class: headerStyles }), ...otherProps, children });
19
+ });
20
+ CardHeader.displayName = "HeroUI.CardHeader";
21
+ var card_header_default = CardHeader;
22
+
23
+ export {
24
+ card_header_default
25
+ };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import {
3
+ useCardContext
4
+ } from "./chunk-XHGGCEVJ.mjs";
5
+
6
+ // src/card-body.tsx
7
+ import { forwardRef } from "@heroui/system";
8
+ import { useDOMRef } from "@heroui/react-utils";
9
+ import { clsx } from "@heroui/shared-utils";
10
+ import { jsx } from "react/jsx-runtime";
11
+ var CardBody = forwardRef((props, ref) => {
12
+ var _a;
13
+ const { as, className, children, ...otherProps } = props;
14
+ const Component = as || "div";
15
+ const domRef = useDOMRef(ref);
16
+ const { slots, classNames } = useCardContext();
17
+ const bodyStyles = clsx(classNames == null ? void 0 : classNames.body, className);
18
+ return /* @__PURE__ */ jsx(Component, { ref: domRef, className: (_a = slots.body) == null ? void 0 : _a.call(slots, { class: bodyStyles }), ...otherProps, children });
19
+ });
20
+ CardBody.displayName = "HeroUI.CardBody";
21
+ var card_body_default = CardBody;
22
+
23
+ export {
24
+ card_body_default
25
+ };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import {
3
+ CardProvider
4
+ } from "./chunk-XHGGCEVJ.mjs";
5
+ import {
6
+ useCard
7
+ } from "./chunk-NVHFBF4D.mjs";
8
+
9
+ // src/card.tsx
10
+ import { forwardRef } from "@heroui/system";
11
+ import { Ripple } from "@heroui/ripple";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var Card = forwardRef((props, ref) => {
14
+ const {
15
+ children,
16
+ context,
17
+ Component,
18
+ isPressable,
19
+ disableAnimation,
20
+ disableRipple,
21
+ getCardProps,
22
+ getRippleProps
23
+ } = useCard({ ...props, ref });
24
+ return /* @__PURE__ */ jsxs(Component, { ...getCardProps(), children: [
25
+ /* @__PURE__ */ jsx(CardProvider, { value: context, children }),
26
+ isPressable && !disableAnimation && !disableRipple && /* @__PURE__ */ jsx(Ripple, { ...getRippleProps() })
27
+ ] });
28
+ });
29
+ Card.displayName = "HeroUI.Card";
30
+ var card_default = Card;
31
+
32
+ export {
33
+ card_default
34
+ };