@heroui/card 2.2.10 → 2.2.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/LICENSE +1 -1
- package/README.md +2 -2
- package/package.json +13 -13
- package/dist/card-body.d.ts +0 -6
- package/dist/card-body.js +0 -53
- package/dist/card-body.mjs +0 -8
- package/dist/card-context.d.ts +0 -13
- package/dist/card-context.js +0 -38
- package/dist/card-context.mjs +0 -9
- package/dist/card-footer.d.ts +0 -8
- package/dist/card-footer.js +0 -53
- package/dist/card-footer.mjs +0 -8
- package/dist/card-header.d.ts +0 -6
- package/dist/card-header.js +0 -53
- package/dist/card-header.mjs +0 -8
- package/dist/card.d.ts +0 -14
- package/dist/card.js +0 -206
- package/dist/card.mjs +0 -9
- package/dist/chunk-5PILOUBS.mjs +0 -34
- package/dist/chunk-D5XJWRAV.mjs +0 -25
- package/dist/chunk-LGSBTEIA.mjs +0 -25
- package/dist/chunk-LYDQFOTE.mjs +0 -152
- package/dist/chunk-TE6SZS6W.mjs +0 -25
- package/dist/chunk-XHGGCEVJ.mjs +0 -14
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -271
- package/dist/index.mjs +0 -29
- package/dist/use-card.d.ts +0 -80
- package/dist/use-card.js +0 -175
- package/dist/use-card.mjs +0 -7
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -15,10 +15,10 @@ npm i @heroui/card
|
|
|
15
15
|
## Contribution
|
|
16
16
|
|
|
17
17
|
Yes please! See the
|
|
18
|
-
[contributing guidelines](https://github.com/
|
|
18
|
+
[contributing guidelines](https://github.com/heroui-inc/heroui/blob/master/CONTRIBUTING.md)
|
|
19
19
|
for details.
|
|
20
20
|
|
|
21
21
|
## License
|
|
22
22
|
|
|
23
23
|
This project is licensed under the terms of the
|
|
24
|
-
[MIT license](https://github.com/
|
|
24
|
+
[MIT license](https://github.com/heroui-inc/heroui/blob/master/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroui/card",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.11",
|
|
4
4
|
"description": "Card is a container for text, photos, and actions in the context of a single subject.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"card"
|
|
7
7
|
],
|
|
8
|
-
"author": "
|
|
8
|
+
"author": "HeroUI <support@heroui.com>",
|
|
9
9
|
"homepage": "https://heroui.com",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"main": "dist/index.js",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"react": ">=18 || >=19.0.0-rc.0",
|
|
29
29
|
"react-dom": ">=18 || >=19.0.0-rc.0",
|
|
30
30
|
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
|
|
31
|
-
"@heroui/theme": ">=2.4.
|
|
32
|
-
"@heroui/system": ">=2.4.
|
|
31
|
+
"@heroui/theme": ">=2.4.6",
|
|
32
|
+
"@heroui/system": ">=2.4.7"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@react-aria/focus": "3.19.
|
|
36
|
-
"@react-aria/utils": "3.
|
|
37
|
-
"@react-aria/interactions": "3.
|
|
38
|
-
"@react-aria/button": "3.11.
|
|
39
|
-
"@react-types/shared": "3.
|
|
40
|
-
"@heroui/shared-utils": "2.1.
|
|
41
|
-
"@heroui/react-utils": "2.1.
|
|
42
|
-
"@heroui/use-aria-button": "2.2.
|
|
43
|
-
"@heroui/ripple": "2.2.
|
|
35
|
+
"@react-aria/focus": "3.19.1",
|
|
36
|
+
"@react-aria/utils": "3.27.0",
|
|
37
|
+
"@react-aria/interactions": "3.23.0",
|
|
38
|
+
"@react-aria/button": "3.11.1",
|
|
39
|
+
"@react-types/shared": "3.27.0",
|
|
40
|
+
"@heroui/shared-utils": "2.1.4",
|
|
41
|
+
"@heroui/react-utils": "2.1.5",
|
|
42
|
+
"@heroui/use-aria-button": "2.2.6",
|
|
43
|
+
"@heroui/ripple": "2.2.9"
|
|
44
44
|
},
|
|
45
45
|
"clean-package": "../../../clean-package.config.json",
|
|
46
46
|
"module": "dist/index.mjs",
|
package/dist/card-body.d.ts
DELETED
package/dist/card-body.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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;
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {});
|
package/dist/card-body.mjs
DELETED
package/dist/card-context.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
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 };
|
package/dist/card-context.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
});
|
package/dist/card-context.mjs
DELETED
package/dist/card-footer.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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 { CardFooterProps, CardFooter as default };
|
package/dist/card-footer.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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;
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {});
|
package/dist/card-footer.mjs
DELETED
package/dist/card-header.d.ts
DELETED
package/dist/card-header.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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;
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {});
|
package/dist/card-header.mjs
DELETED
package/dist/card.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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 { CardProps, Card as default };
|
package/dist/card.js
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
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)
|
|
76
|
-
return;
|
|
77
|
-
domRef.current && onRipplePressHandler(e);
|
|
78
|
-
},
|
|
79
|
-
[disableRipple, disableAnimation, domRef, onRipplePressHandler]
|
|
80
|
-
);
|
|
81
|
-
const { buttonProps, isPressed } = (0, import_use_aria_button.useAriaButton)(
|
|
82
|
-
{
|
|
83
|
-
onPress: (0, import_utils.chain)(onPress, handlePress),
|
|
84
|
-
elementType: as,
|
|
85
|
-
isDisabled: !originalProps.isPressable,
|
|
86
|
-
onClick,
|
|
87
|
-
allowTextSelectionOnPress,
|
|
88
|
-
...otherProps
|
|
89
|
-
},
|
|
90
|
-
domRef
|
|
91
|
-
);
|
|
92
|
-
const { hoverProps, isHovered } = (0, import_interactions.useHover)({
|
|
93
|
-
isDisabled: !originalProps.isHoverable,
|
|
94
|
-
...otherProps
|
|
95
|
-
});
|
|
96
|
-
const { isFocusVisible, isFocused, focusProps } = (0, import_focus.useFocusRing)({
|
|
97
|
-
autoFocus
|
|
98
|
-
});
|
|
99
|
-
const slots = (0, import_react.useMemo)(
|
|
100
|
-
() => (0, import_theme.card)({
|
|
101
|
-
...variantProps,
|
|
102
|
-
disableAnimation
|
|
103
|
-
}),
|
|
104
|
-
[(0, import_shared_utils.objectToDeps)(variantProps), disableAnimation]
|
|
105
|
-
);
|
|
106
|
-
const context = (0, import_react.useMemo)(
|
|
107
|
-
() => ({
|
|
108
|
-
slots,
|
|
109
|
-
classNames,
|
|
110
|
-
disableAnimation,
|
|
111
|
-
isDisabled: originalProps.isDisabled,
|
|
112
|
-
isFooterBlurred: originalProps.isFooterBlurred,
|
|
113
|
-
fullWidth: originalProps.fullWidth
|
|
114
|
-
}),
|
|
115
|
-
[
|
|
116
|
-
slots,
|
|
117
|
-
classNames,
|
|
118
|
-
originalProps.isDisabled,
|
|
119
|
-
originalProps.isFooterBlurred,
|
|
120
|
-
disableAnimation,
|
|
121
|
-
originalProps.fullWidth
|
|
122
|
-
]
|
|
123
|
-
);
|
|
124
|
-
const getCardProps = (0, import_react.useCallback)(
|
|
125
|
-
(props2 = {}) => {
|
|
126
|
-
return {
|
|
127
|
-
ref: domRef,
|
|
128
|
-
className: slots.base({ class: baseStyles }),
|
|
129
|
-
tabIndex: originalProps.isPressable ? 0 : -1,
|
|
130
|
-
"data-hover": (0, import_shared_utils.dataAttr)(isHovered),
|
|
131
|
-
"data-pressed": (0, import_shared_utils.dataAttr)(isPressed),
|
|
132
|
-
"data-focus": (0, import_shared_utils.dataAttr)(isFocused),
|
|
133
|
-
"data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
|
|
134
|
-
"data-disabled": (0, import_shared_utils.dataAttr)(originalProps.isDisabled),
|
|
135
|
-
...(0, import_utils.mergeProps)(
|
|
136
|
-
originalProps.isPressable ? { ...buttonProps, ...focusProps, role: "button" } : {},
|
|
137
|
-
originalProps.isHoverable ? hoverProps : {},
|
|
138
|
-
(0, import_react_utils2.filterDOMProps)(otherProps, {
|
|
139
|
-
enabled: shouldFilterDOMProps
|
|
140
|
-
}),
|
|
141
|
-
(0, import_react_utils2.filterDOMProps)(props2)
|
|
142
|
-
)
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
[
|
|
146
|
-
domRef,
|
|
147
|
-
slots,
|
|
148
|
-
baseStyles,
|
|
149
|
-
shouldFilterDOMProps,
|
|
150
|
-
originalProps.isPressable,
|
|
151
|
-
originalProps.isHoverable,
|
|
152
|
-
originalProps.isDisabled,
|
|
153
|
-
isHovered,
|
|
154
|
-
isPressed,
|
|
155
|
-
isFocusVisible,
|
|
156
|
-
buttonProps,
|
|
157
|
-
focusProps,
|
|
158
|
-
hoverProps,
|
|
159
|
-
otherProps
|
|
160
|
-
]
|
|
161
|
-
);
|
|
162
|
-
const getRippleProps = (0, import_react.useCallback)(
|
|
163
|
-
() => ({ ripples, onClear: onClearRipple }),
|
|
164
|
-
[ripples, onClearRipple]
|
|
165
|
-
);
|
|
166
|
-
return {
|
|
167
|
-
context,
|
|
168
|
-
domRef,
|
|
169
|
-
Component,
|
|
170
|
-
classNames,
|
|
171
|
-
children,
|
|
172
|
-
isHovered,
|
|
173
|
-
isPressed,
|
|
174
|
-
disableAnimation,
|
|
175
|
-
isPressable: originalProps.isPressable,
|
|
176
|
-
isHoverable: originalProps.isHoverable,
|
|
177
|
-
disableRipple,
|
|
178
|
-
handlePress,
|
|
179
|
-
isFocusVisible,
|
|
180
|
-
getCardProps,
|
|
181
|
-
getRippleProps
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// src/card.tsx
|
|
186
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
187
|
-
var Card = (0, import_system2.forwardRef)((props, ref) => {
|
|
188
|
-
const {
|
|
189
|
-
children,
|
|
190
|
-
context,
|
|
191
|
-
Component,
|
|
192
|
-
isPressable,
|
|
193
|
-
disableAnimation,
|
|
194
|
-
disableRipple,
|
|
195
|
-
getCardProps,
|
|
196
|
-
getRippleProps
|
|
197
|
-
} = useCard({ ...props, ref });
|
|
198
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Component, { ...getCardProps(), children: [
|
|
199
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardProvider, { value: context, children }),
|
|
200
|
-
isPressable && !disableAnimation && !disableRipple && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ripple2.Ripple, { ...getRippleProps() })
|
|
201
|
-
] });
|
|
202
|
-
});
|
|
203
|
-
Card.displayName = "HeroUI.Card";
|
|
204
|
-
var card_default = Card;
|
|
205
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
206
|
-
0 && (module.exports = {});
|
package/dist/card.mjs
DELETED
package/dist/chunk-5PILOUBS.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
CardProvider
|
|
4
|
-
} from "./chunk-XHGGCEVJ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
useCard
|
|
7
|
-
} from "./chunk-LYDQFOTE.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
|
-
};
|
package/dist/chunk-D5XJWRAV.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/chunk-LGSBTEIA.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
};
|