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
@@ -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