lightswind
Version:
A collection of beautifully crafted React Components, Blocks & Templates for Modern Developers. Create stunning web applications effortlessly by using our 160+ professional and animated react components.
101 lines • 4.78 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CardContent = exports.CardDescription = exports.CardTitle = exports.CardFooter = exports.CardHeader = exports.Card = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const React = __importStar(require("react"));
const utils_1 = require("@/components/lib/utils");
const Card = React.forwardRef(({ className, hoverable = false, bordered = false, compact = false, ...props }, ref) => ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("rounded-lg bg-background/70 text-card-foreground shadow-sm", bordered ? "border" : "border-none", hoverable ? "transition-shadow duration-200 hover:shadow-md" : "", compact ? "p-3" : "p-0", className), ...props })));
exports.Card = Card;
Card.displayName = "Card";
const CardHeader = React.forwardRef(({ className, spacing = "default", ...props }, ref) => {
const spacingClasses = {
compact: "flex flex-col space-y-1 p-4",
default: "flex flex-col space-y-1.5 p-6",
relaxed: "flex flex-col space-y-2 p-8",
};
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)(spacingClasses[spacing], className), ...props }));
});
exports.CardHeader = CardHeader;
CardHeader.displayName = "CardHeader";
const CardTitle = React.forwardRef(({ className, as = "h3", size = "default", ...props }, ref) => {
const Component = as;
const sizeClasses = {
sm: "text-lg",
default: "text-2xl",
lg: "text-3xl"
};
return ((0, jsx_runtime_1.jsx)(Component, { ref: ref, className: (0, utils_1.cn)("font-semibold leading-none tracking-tight", sizeClasses[size], className), ...props }));
});
exports.CardTitle = CardTitle;
CardTitle.displayName = "CardTitle";
const CardDescription = React.forwardRef(({ className, size = "default", ...props }, ref) => {
const sizeClasses = {
xs: "text-xs",
sm: "text-sm",
default: "text-sm"
};
return ((0, jsx_runtime_1.jsx)("p", { ref: ref, className: (0, utils_1.cn)("text-muted-foreground", sizeClasses[size], className), ...props }));
});
exports.CardDescription = CardDescription;
CardDescription.displayName = "CardDescription";
const CardContent = React.forwardRef(({ className, removeTopPadding = true, padding = "default", ...props }, ref) => {
const paddingClasses = {
none: "p-0",
sm: "px-4 py-3",
default: "p-6",
lg: "p-8"
};
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)(paddingClasses[padding], removeTopPadding && padding !== "none" ? "pt-0" : "", className), ...props }));
});
exports.CardContent = CardContent;
CardContent.displayName = "CardContent";
const CardFooter = React.forwardRef(({ className, align = "center", direction = "row", ...props }, ref) => {
const alignClasses = {
start: "justify-start",
center: "justify-center",
end: "justify-end",
between: "justify-between",
around: "justify-around"
};
const directionClasses = {
row: "flex-row",
column: "flex-col"
};
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: (0, utils_1.cn)("flex items-center p-6 pt-0", alignClasses[align], directionClasses[direction], className), ...props }));
});
exports.CardFooter = CardFooter;
CardFooter.displayName = "CardFooter";
//# sourceMappingURL=card.js.map