@helpwave/hightide
Version:
helpwave's component and theming library
197 lines (193 loc) • 9.18 kB
JavaScript
;
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/components/Profile.tsx
var Profile_exports = {};
__export(Profile_exports, {
Profile: () => Profile
});
module.exports = __toCommonJS(Profile_exports);
var import_clsx3 = __toESM(require("clsx"));
var import_image = __toESM(require("next/image"));
var import_link = __toESM(require("next/link"));
var import_lucide_react = require("lucide-react");
// src/components/icons/Helpwave.tsx
var import_clsx = require("clsx");
var import_jsx_runtime = require("react/jsx-runtime");
var Helpwave = ({
color = "currentColor",
animate = "none",
size = 64,
...props
}) => {
const isLoadingAnimation = animate === "loading";
let svgAnimationKey = "";
if (animate === "pulse") {
svgAnimationKey = "animate-pulse";
} else if (animate === "bounce") {
svgAnimationKey = "animate-bounce";
}
if (size < 0) {
console.error("size cannot be less than 0");
size = 64;
}
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
"svg",
{
width: size,
height: size,
viewBox: "0 0 888 888",
fill: "none",
strokeLinecap: "round",
strokeWidth: 48,
...props,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { className: (0, import_clsx.clsx)(svgAnimationKey), children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { className: (0, import_clsx.clsx)({ "animate-wave-big-left-up": isLoadingAnimation }), d: "M144 543.235C144 423.259 232.164 326 340.92 326", stroke: color, strokeDasharray: "1000" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { className: (0, import_clsx.clsx)({ "animate-wave-big-right-down": isLoadingAnimation }), d: "M537.84 544.104C429.084 544.104 340.92 446.844 340.92 326.869", stroke: color, strokeDasharray: "1000" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { className: (0, import_clsx.clsx)({ "animate-wave-small-left-up": isLoadingAnimation }), d: "M462.223 518.035C462.223 432.133 525.348 362.495 603.217 362.495", stroke: color, strokeDasharray: "1000" }),
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { className: (0, import_clsx.clsx)({ "animate-wave-small-right-down": isLoadingAnimation }), d: "M745.001 519.773C666.696 519.773 603.218 450.136 603.218 364.233", stroke: color, strokeDasharray: "1000" })
] })
}
);
};
// src/components/ChipList.tsx
var import_clsx2 = __toESM(require("clsx"));
var import_jsx_runtime2 = require("react/jsx-runtime");
var Chip = ({
children,
trailingIcon,
color = "default",
variant = "normal",
className = "",
...restProps
}) => {
const colorMapping = {
default: "text-tag-default-text bg-tag-default-background",
dark: "text-tag-dark-text bg-tag-dark-background",
red: "text-tag-red-text bg-tag-red-background",
yellow: "text-tag-yellow-text bg-tag-yellow-background",
green: "text-tag-green-text bg-tag-green-background",
blue: "text-tag-blue-text bg-tag-blue-background",
pink: "text-tag-pink-text bg-tag-pink-background"
}[color];
const colorMappingIcon = {
default: "text-tag-default-icon",
dark: "text-tag-dark-icon",
red: "text-tag-red-icon",
yellow: "text-tag-yellow-icon",
green: "text-tag-green-icon",
blue: "text-tag-blue-icon",
pink: "text-tag-pink-icon"
}[color];
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
"div",
{
...restProps,
className: (0, import_clsx2.default)(
`row w-fit px-2 py-1`,
colorMapping,
{
"rounded-md": variant === "normal",
"rounded-full": variant === "fullyRounded"
},
className
),
children: [
children,
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
]
}
);
};
// src/components/Profile.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
var SocialIcon = ({ type, url, size = 24 }) => {
let icon;
switch (type) {
case "mail":
icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Mail, { size });
break;
case "linkedin":
icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Linkedin, { size });
break;
case "github":
icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Github, { size });
break;
case "website":
icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Globe, { size });
break;
case "medium":
icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Globe, { size });
break;
default:
icon = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Helpwave, { size: 24 });
}
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link.default, { href: url, target: "_blank", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Chip, { color: "dark", className: "!p-2", children: icon }) });
};
var Profile = ({
name,
imageUrl,
badge,
prefix,
suffix,
roleBadge,
role,
tags,
info,
socials,
className,
imageClassName,
...divProps
}) => {
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
"div",
{
...divProps,
className: (0, import_clsx3.default)(`col items-center text-center rounded-3xl p-3 pb-4 bg-white text-gray-900 w-min shadow-around-lg`, className),
children: [
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative mb-6", children: [
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_clsx3.default)("relative rounded-xl row items-center justify-center overflow-hidden", imageClassName), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_image.default, { src: imageUrl, alt: "", className: (0, import_clsx3.default)("z-[2] object-cover", imageClassName), width: 0, height: 0, style: { width: "auto", height: "auto" } }) }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute top-[6px] left-[6px] z-[3]", children: badge }),
roleBadge && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-2/3 z-[4] rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Chip, { color: "dark", className: "font-bold px-3", children: roleBadge }) })
] }),
prefix && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "font-semibold", children: prefix }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { id: name, className: "textstyle-title-md", children: name }),
suffix && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm mb-1", children: suffix }),
role && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "font-space font-bold text-sm", children: role }),
tags && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-wrap mx-4 mt-2 gap-x-2 justify-center", children: tags.map((tag, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "textstyle-description text-sm", children: `#${tag}` }, index)) }),
info && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "mt-2 text-sm", children: info }),
socials && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-wrap grow items-end justify-center gap-x-4 gap-y-2 mt-4", children: socials.map((socialIconProps, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SocialIcon, { ...socialIconProps, size: socialIconProps.size ?? 20 }, index)) })
]
}
);
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Profile
});
//# sourceMappingURL=Profile.js.map