mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-29 04:44:23 +01:00
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:
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 };
|
||||
Reference in new issue
Block a user