Skip to content

Commit e1f21f4

Browse files
committed
wip
1 parent 3c2374f commit e1f21f4

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/components/checkbox-tree/checkbox-tree.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ReactNode } from "react"
22
import { useMemo } from "react"
3+
import { CheckboxIcon } from "@/app/conf/_design-system/pixelarticons/checkbox-icon"
34

45
export interface CheckboxTreeItem {
56
id: string
@@ -97,6 +98,9 @@ export function CheckboxTree({
9798
const renderTree = (nodes: PreparedTree[]): ReactNode => {
9899
return nodes.map(node => {
99100
const isSelectable = Boolean(node.value)
101+
const isChecked = isSelectable
102+
? selectedValues.includes(node.value!)
103+
: false
100104
const checkboxId = `checkbox-tree-${node.id}`
101105

102106
return (
@@ -110,13 +114,20 @@ export function CheckboxTree({
110114
htmlFor={checkboxId}
111115
className="flex grow cursor-pointer items-center gap-2"
112116
>
113-
<input
114-
id={checkboxId}
115-
type="checkbox"
116-
checked={selectedValues.includes(node.value!)}
117-
onChange={() => toggleValue(node.value!)}
118-
className="size-4 border border-neu-400 bg-transparent [accent-color:hsl(var(--color-pri-base))]"
119-
/>
117+
<span className="flex shrink-0 items-center">
118+
<input
119+
id={checkboxId}
120+
type="checkbox"
121+
checked={isChecked}
122+
onChange={() => toggleValue(node.value!)}
123+
className="peer sr-only"
124+
/>
125+
<CheckboxIcon
126+
checked={isChecked}
127+
className="pointer-events-none size-5 transition-colors peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-1 peer-focus-visible:outline-neu-900"
128+
aria-hidden
129+
/>
130+
</span>
120131
<span className="min-w-0 grow truncate text-left text-neu-800">
121132
{node.label}
122133
</span>

src/components/tools-and-libraries.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,11 @@ export function CodePage({ allTags, data }: CodePageProps) {
390390
</article>
391391

392392
{compiledSource && (
393-
<details className="bg-neu-100">
393+
<details className="bg-neu-100 dark:bg-neu-50/50 dark:[&:open]:bg-neu-0">
394394
<summary
395395
className={clsx(
396396
"flex justify-between px-8 py-5 text-primary lg:px-12 dark:[[open]>&]:shadow-[-5px_10px_30px_20px_#1b1b1b4d]",
397-
"[[open]>&]:bg-neu-200",
397+
"[[open]>&]:bg-neu-200 dark:[[open]>&]:bg-neu-50/50",
398398
"cursor-pointer",
399399
)}
400400
>

0 commit comments

Comments
 (0)