migrate compare and tankopedia loadout to new data-driven components, splitting the old monolithic loadout and compare UI into smaller pieces and adding shared Table, Dialog and Scroller primitives

This commit is contained in:
tresabhi committed 2026-11-14 01:17:38 -06:00
1 parent 287aba853f
commit c311a6ab8b
111 files changed
+4009 -3917

No files matched your search

@@ -0,0 +1,61 @@
.Overlay {
position: fixed;
inset: 0;
z-index: 1;
background-color: var(--black-a9);
}
.Content {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
display: flex;
flex-direction: column;
box-sizing: border-box;
width: calc(100dvw - 2 * var(--space-4));
max-width: 40rem;
max-height: calc(100dvh - 2 * var(--space-4));
overflow: hidden;
background-color: var(--gray-2);
box-shadow: var(--shadow-subtle);
border-radius: var(--space-4);
outline: var(--outline-interactive) !important;
}
.Title {
margin: 0;
font-size: var(--font-size-heading-4);
color: var(--gray-12);
text-align: left;
}
.Description {
margin: 0;
color: var(--gray-11);
text-align: left;
}
.header {
display: flex;
flex-direction: column;
gap: var(--space-2);
padding: var(--space-4);
padding-bottom: 0;
}
.body {
--scroller-curtain-color: var(--gray-2);
flex: 1;
.content {
padding: var(--space-4);
}
}
@@ -0,0 +1,30 @@
import { Dialog as _ } from "radix-ui";
import type { ComponentProps } from "react";
import { classNames } from "../../ui/classNames";
import { composeRadixComponents } from "../../ui/compose";
import { Scroller, ScrollerOrientation } from "../Scroller";
import styles from "./index.module.css";
// Groups a title and description
function Header({ className, ...props }: ComponentProps<"div">) {
return <div className={classNames(styles.header, className)} {...props} />;
}
// Scrolls the content that follows the header
function Body({
className,
children,
...props
}: ComponentProps<typeof Scroller>) {
return (
<Scroller
orientation={ScrollerOrientation.Vertical}
className={classNames(styles.body, className)}
{...props}
>
<div className={styles.content}>{children}</div>
</Scroller>
);
}
export const Dialog = { ...composeRadixComponents(_, styles), Header, Body };