boreui
Version:
A modern, reusable React component library built with TypeScript.
131 lines (126 loc) • 3.58 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
Button: () => Button,
Card: () => Card,
CardBody: () => CardBody,
CardFooter: () => CardFooter,
CardHeader: () => CardHeader
});
module.exports = __toCommonJS(index_exports);
// node_modules/clsx/dist/clsx.mjs
function r(e) {
var t, f, n = "";
if ("string" == typeof e || "number" == typeof e) n += e;
else if ("object" == typeof e) if (Array.isArray(e)) {
var o = e.length;
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
} else for (f in e) e[f] && (n && (n += " "), n += f);
return n;
}
function clsx() {
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
return n;
}
var clsx_default = clsx;
// src/components/Button.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var buttonVariants = {
variant: {
default: "bg-blue-600 text-white hover:bg-blue-700",
outline: "border border-blue-600 text-blue-600 hover:bg-blue-50",
ghost: "text-blue-600 hover:bg-blue-100"
},
size: {
sm: "text-sm px-3 py-1.5",
md: "text-base px-4 py-2",
lg: "text-lg px-5 py-3"
}
};
var Button = ({
variant = "default",
size = "md",
className,
children,
...props
}) => {
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"button",
{
className: clsx_default(
"rounded font-medium transition duration-200",
buttonVariants.variant[variant],
buttonVariants.size[size],
className
),
...props,
children
}
);
};
// src/components/Card.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var Card = ({
children,
className,
...props
}) => {
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
"div",
{
className: clsx_default(
"rounded-xl border bg-white text-black shadow-sm p-4",
className
),
...props,
children
}
);
};
var CardHeader = ({
children,
className,
...props
}) => {
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: clsx_default("mb-2 text-lg font-semibold", className), ...props, children });
};
var CardBody = ({
children,
className,
...props
}) => {
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: clsx_default("text-sm text-gray-700", className), ...props, children });
};
var CardFooter = ({
children,
className,
...props
}) => {
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: clsx_default("mt-4 pt-2 border-t", className), ...props, children });
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Button,
Card,
CardBody,
CardFooter,
CardHeader
});