mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-20 04:14:12 +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
@@ -3,13 +3,43 @@
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
|
||||
.control {
|
||||
width: 1.25em;
|
||||
height: 1.25em;
|
||||
.Root {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
box-sizing: border-box;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
accent-color: var(--accent-9);
|
||||
border: none;
|
||||
border-radius: var(--space-2);
|
||||
background-color: var(--gray-a3);
|
||||
outline: var(--space-1) solid var(--gray-a5);
|
||||
color: var(--white-a12);
|
||||
|
||||
&[data-state="checked"] {
|
||||
background-color: var(--accent-8);
|
||||
outline-color: var(--accent-8);
|
||||
}
|
||||
|
||||
&:focus-visible {
|
||||
outline: var(--outline-focus);
|
||||
}
|
||||
|
||||
.Indicator {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&,
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import { CheckIcon } from "@radix-ui/react-icons";
|
||||
import { Checkbox as _Checkbox } from "radix-ui";
|
||||
import { useId, type ReactNode } from "react";
|
||||
import { Text } from "../Text";
|
||||
import { composeRadixComponents } from "../../ui/compose";
|
||||
import styles from "./index.module.css";
|
||||
|
||||
const _ = composeRadixComponents(_Checkbox, styles);
|
||||
|
||||
export interface CheckboxProps {
|
||||
checked: boolean;
|
||||
onCheckedChange(checked: boolean): void;
|
||||
@@ -17,13 +22,15 @@ export function Checkbox({
|
||||
|
||||
return (
|
||||
<div className={styles.checkbox}>
|
||||
<input
|
||||
className={styles.control}
|
||||
type="checkbox"
|
||||
<_.Root
|
||||
id={id}
|
||||
checked={checked}
|
||||
onChange={(event) => onCheckedChange(event.target.checked)}
|
||||
/>
|
||||
onCheckedChange={(value) => onCheckedChange(value === true)}
|
||||
>
|
||||
<_.Indicator>
|
||||
<CheckIcon />
|
||||
</_.Indicator>
|
||||
</_.Root>
|
||||
|
||||
{children && (
|
||||
<label htmlFor={id}>
|
||||
|
||||
Reference in new issue
Block a user