Track HiveGrid Cloud planning reference

This commit is contained in:
david committed 2026-06-26 20:48:01 +02:00
1 parent b3d5ea6764
commit e341c5938a
5784 files changed
+1104929 -3

No files matched your search

@@ -0,0 +1,25 @@
import clsx from "clsx";
import { Colors } from "~/application/enums/shared/Colors";
import { getBadgeColor } from "~/utils/shared/ColorUtils";
interface Props {
color?: Colors | null;
size?: "sm" | "md";
}
export default function ColorBadge({ color, size = "md" }: Props) {
return (
<span
className={clsx(
" inline-flex shrink-0 items-center rounded-full text-xs font-medium",
getBadgeColor(color),
size === "md" && "p-1",
size === "sm" && "p-0.5"
)}
>
<svg className={clsx(size === "md" && "h-2 w-2", size === "sm" && "h-1.5 w-1.5")} fill="currentColor" viewBox="0 0 8 8">
<circle cx={4} cy={4} r={3} />
</svg>
</span>
);
}
@@ -0,0 +1,53 @@
import clsx from "clsx";
interface Props {
color?: string | null;
size?: "xs" | "sm" | "md";
children?: React.ReactNode;
className?: string;
}
export default function ColorBadgeString({ color, size = "md", children, className }: Props) {
function getColors() {
switch (color) {
case "primary":
return { bgColor: "bg-brand-brand-surface-solid-default", textColor: "text-brand-brand-surface-solid-default" };
case "sky":
return { bgColor: "bg-sky-400", textColor: "text-sky-800" };
case "amber":
return { bgColor: "bg-amber-400", textColor: "text-amber-800" };
case "violet":
return { bgColor: "bg-violet-400", textColor: "text-violet-800" };
case "rose":
return { bgColor: "bg-rose-400", textColor: "text-rose-800" };
case "emerald":
return { bgColor: "bg-emerald-400", textColor: "text-emerald-800" };
case "orange":
return { bgColor: "bg-orange-400", textColor: "text-orange-800" };
case "blue":
return { bgColor: "bg-blue-400", textColor: "text-blue-800" };
case "gray":
return { bgColor: "bg-gray-400", textColor: "text-gray-800" };
case "green":
return { bgColor: "bg-green-400", textColor: "text-green-800" };
case "yellow":
return { bgColor: "bg-yellow-400", textColor: "text-yellow-800" };
case "red":
return { bgColor: "bg-red-400", textColor: "text-red-800" };
case "pink":
return { bgColor: "bg-pink-400", textColor: "text-pink-800" };
case "purple":
return { bgColor: "bg-purple-400", textColor: "text-purple-800" };
case "indigo":
return { bgColor: "bg-indigo-400", textColor: "text-indigo-800" };
case "teal":
return { bgColor: "bg-teal-400", textColor: "text-teal-800" };
case "cyan":
return { bgColor: "bg-cyan-400", textColor: "text-cyan-800" };
default:
return { bgColor: "bg-gray-400", textColor: "text-gray-800" };
}
}
const { bgColor, textColor } = getColors();
return <div className={clsx("inline-flex shrink-0 items-center rounded-full text-xs font-medium", bgColor, textColor, "size-2", className)}>{children}</div>;
}
@@ -0,0 +1,37 @@
import { Colors } from "~/application/enums/shared/Colors";
import ColorBadge from "./ColorBadge";
export default function PreviewBadges() {
return (
<div id="badges">
<div className="border-border bg-background border border-dashed p-6">
<div id="badges" className="w-full space-y-2">
<div className="mx-auto flex max-w-3xl flex-col items-center justify-center space-y-4 sm:flex-row sm:items-end sm:justify-center sm:space-x-4 sm:space-y-0">
<ColorBadge color={Colors.UNDEFINED} />
<ColorBadge color={Colors.SLATE} />
<ColorBadge color={Colors.GRAY} />
<ColorBadge color={Colors.NEUTRAL} />
<ColorBadge color={Colors.STONE} />
<ColorBadge color={Colors.RED} />
<ColorBadge color={Colors.ORANGE} />
<ColorBadge color={Colors.AMBER} />
<ColorBadge color={Colors.YELLOW} />
<ColorBadge color={Colors.LIME} />
<ColorBadge color={Colors.GREEN} />
<ColorBadge color={Colors.EMERALD} />
<ColorBadge color={Colors.TEAL} />
<ColorBadge color={Colors.CYAN} />
<ColorBadge color={Colors.SKY} />
<ColorBadge color={Colors.BLUE} />
<ColorBadge color={Colors.INDIGO} />
<ColorBadge color={Colors.VIOLET} />
<ColorBadge color={Colors.PURPLE} />
<ColorBadge color={Colors.FUCHSIA} />
<ColorBadge color={Colors.PINK} />
<ColorBadge color={Colors.ROSE} />
</div>
</div>
</div>
</div>
);
}
@@ -0,0 +1,25 @@
import { Colors } from "~/application/enums/shared/Colors";
import SimpleBadge from "./SimpleBadge";
export default function PreviewBadges() {
return (
<div id="badges-simple">
<div className="border-border bg-background border border-dashed p-6">
<div id="badges" className="w-full space-y-2">
<div className="mx-auto flex max-w-3xl flex-col items-center justify-center space-y-4 sm:flex-row sm:items-end sm:justify-center sm:space-x-4 sm:space-y-0">
<SimpleBadge title={"GRAY"} color={Colors.GRAY} />
<SimpleBadge title={"RED"} color={Colors.RED} />
<SimpleBadge title={"ORANGE"} color={Colors.ORANGE} />
<SimpleBadge title={"YELLOW"} color={Colors.YELLOW} />
<SimpleBadge title={"GREEN"} color={Colors.GREEN} />
<SimpleBadge title={"BLUE"} color={Colors.BLUE} />
<SimpleBadge title={"INDIGO"} color={Colors.INDIGO} />
<SimpleBadge title={"PURPLE"} color={Colors.PURPLE} />
<SimpleBadge title={"PINK"} color={Colors.PINK} />
<SimpleBadge title={"ROSE"} color={Colors.ROSE} />
</div>
</div>
</div>
</div>
);
}
@@ -0,0 +1,31 @@
import clsx from "~/utils/shared/ClassesUtils";
import { StarIcon } from "~/components/ui/icons/vendor";
export default function RatingBadge({ value, size = 4, starsCount = 5 }: { value: number; size?: number; starsCount?: number }) {
return (
<div>
<div className="flex items-center">
{Array.from({ length: starsCount }).map((_, index) => (
<Star key={index} size={size} color={index < value ? "yellow" : "gray"} />
))}
</div>
</div>
);
}
function Star({ color, size = 5 }: { color: "gray" | "yellow"; size?: number }) {
return (
<StarIcon
aria-hidden="true"
className={clsx(
size === 2 && "h-2 w-2",
size === 3 && "h-3 w-3",
size === 4 && "h-4 w-4",
size === 5 && "h-5 w-5",
size === 6 && "h-6 w-6",
size === 7 && "h-7 w-7",
color === "gray" ? "text-gray-300" : "text-yellow-400"
)}
/>
);
}
@@ -0,0 +1,29 @@
import clsx from "clsx";
import { Colors } from "~/application/enums/shared/Colors";
import { cn } from "~/lib/utils";
import { getBadgeColor, getBadgeColorDark } from "~/utils/shared/ColorUtils";
interface Props {
title?: string;
color: Colors;
className?: string;
children?: React.ReactNode;
underline?: boolean;
darkMode?: boolean;
}
export default function SimpleBadge({ title, color, className, children, underline, darkMode }: Props) {
return (
<div
className={cn(
className,
!underline && "inline-flex",
"items-center rounded-md px-1 py-0 text-xs font-bold",
getBadgeColor(color),
getBadgeColorDark(color)
)}
>
{title ?? children}
</div>
);
}
@@ -0,0 +1,14 @@
import clsx from "clsx";
import { Colors } from "~/application/enums/shared/Colors";
import { getTextColor } from "~/utils/shared/ColorUtils";
interface Props {
title?: string;
color: Colors;
className?: string;
children?: React.ReactNode;
}
export default function TextColor({ title, color, className, children }: Props) {
return <div className={clsx(className, getTextColor(color))}>{title ?? children}</div>;
}