@@ -2,7 +2,6 @@ import ModemIcon from "@/app/conf/_design-system/pixelarticons/modem.svg?svgr"
22import clsx from "clsx"
33
44const INNER_BOX_SIZE = 16
5- const GAP_X = 32
65
76interface ComponentTreeProps extends React . HTMLAttributes < HTMLDivElement > {
87 names : [ string , string , string , string ]
@@ -14,86 +13,86 @@ export function ComponentTree({
1413 ...rest
1514} : ComponentTreeProps ) {
1615 return (
17- < div className = { clsx ( "mx-auto flex gap-x-20" , className ) } { ...rest } >
16+ < div
17+ className = { clsx (
18+ "mx-auto flex max-w-[500px] justify-between [--gap-x:20px] md:gap-x-10 md:[--gap-x:32px] 3xl:gap-x-20" ,
19+ className ,
20+ ) }
21+ { ...rest }
22+ >
1823 < div className = "flex flex-col" >
1924 < div className = "flex h-12 items-center" >
20- < ComponentLabel bgColor = " bg-neu-0" borderColor = " border-neu-300 ">
25+ < ComponentLabel className = "border-neu-300 bg-neu-0 dark: border-neu-200 ">
2126 { names [ 0 ] }
2227 </ ComponentLabel >
2328 </ div >
2429
2530 < div className = "h-4" />
2631
2732 < div className = "flex h-12 items-center" >
28- < ComponentLabel bgColor = " bg-neu-400" borderColor = " border-neu-600 ">
33+ < ComponentLabel className = "border-neu-600 bg-neu-400 dark: border-neu-200 dark:bg-neu-50 ">
2934 { names [ 1 ] }
3035 </ ComponentLabel >
3136 </ div >
3237
3338 < div className = "h-4" />
3439
3540 < div className = "flex h-12 items-center" >
36- < ComponentLabel
37- bgColor = "bg-sec-lighter"
38- borderColor = "border-sec-base"
39- >
41+ < ComponentLabel className = "border-sec-base bg-sec-lighter dark:border-sec-dark dark:bg-sec-darker/50" >
4042 { names [ 2 ] }
4143 </ ComponentLabel >
4244 </ div >
4345
4446 < div className = "h-4" />
4547
4648 < div className = "flex h-12 items-center" >
47- < ComponentLabel
48- bgColor = "bg-pri-lighter/40"
49- borderColor = "border-pri-base"
50- >
49+ < ComponentLabel className = "border-pri-base bg-pri-lighter/40 dark:border-pri-dark dark:bg-pri-darker/50" >
5150 { names [ 3 ] }
5251 </ ComponentLabel >
5352 </ div >
5453 </ div >
5554
5655 < div className = "flex flex-col items-center" >
57- < div className = "flex size-12 items-center justify-center bg-neu-100" >
58- < ModemIcon className = "size-8 text-neu-600" />
56+ < div className = "flex size-12 items-center justify-center bg-neu-100 dark:bg-neu-50 " >
57+ < ModemIcon className = "size-6 text-neu-600" />
5958 </ div >
6059
61- < div className = "h-4 w-px bg-neu-300" />
60+ < div className = "h-4 w-px bg-neu-300 dark:bg-neu-100 " />
6261
6362 < NestedBox
64- bgColor = "bg-neu-600"
63+ bgColor = "bg-neu-600 dark:bg-neu-200 "
6564 middleColor = "bg-sec-base"
6665 innerColor = "bg-pri-base"
6766 />
6867
6968 < Fork
70- className = "text-neu-300"
69+ className = "text-neu-300 dark:text-neu-100 "
7170 style = { {
72- width : `calc(100% - ${ GAP_X + INNER_BOX_SIZE * 5.75 } px)` ,
71+ width : `calc(100% - var(--gap-x) - ${ INNER_BOX_SIZE * 5.75 } px)` ,
7372 } }
7473 />
7574
76- < div className = "flex" style = { { gap : GAP_X } } >
75+ < div className = "flex gap-[--gap-x]" >
7776 < div className = "flex flex-col items-center" >
7877 < NestedBox
79- bgColor = "bg-neu-100"
78+ bgColor = "bg-neu-100 dark:bg-neu-50 "
8079 middleColor = "bg-sec-base"
8180 innerColor = "bg-pri-base"
8281 />
83- < Fork className = "text-neu-300" />
84- < div className = "flex" style = { { gap : GAP_X } } >
82+ < Fork className = "text-neu-300 dark:text-neu-100 " />
83+ < div className = "flex gap-[--gap-x]" >
8584 < LeafBox />
8685 < LeafBox />
8786 </ div >
8887 </ div >
8988 < div className = "flex flex-col items-center" >
9089 < NestedBox
91- bgColor = "bg-neu-100"
90+ bgColor = "bg-neu-100 dark:bg-neu-50 "
9291 middleColor = "bg-sec-base"
9392 innerColor = "bg-pri-base"
9493 />
95- < Fork className = "text-neu-300" />
96- < div className = "flex" style = { { gap : GAP_X } } >
94+ < Fork className = "text-neu-300 dark:text-neu-100 " />
95+ < div className = "flex gap-[--gap-x]" >
9796 < LeafBox />
9897 < LeafBox />
9998 </ div >
@@ -124,26 +123,26 @@ function NestedBox({ bgColor, middleColor, innerColor }: NestedBoxProps) {
124123
125124interface ComponentLabelProps {
126125 children : React . ReactNode
127- bgColor : string
128- borderColor : string
126+ className : string
129127}
130128
131- function ComponentLabel ( {
132- children,
133- bgColor,
134- borderColor,
135- } : ComponentLabelProps ) {
129+ function ComponentLabel ( { children, className } : ComponentLabelProps ) {
136130 return (
137131 < div
138- className = { `rounded border ${ borderColor } ${ bgColor } px-1 py-0.5 font-mono text-[10px] text-neu-800` }
132+ className = { clsx (
133+ "rounded border px-1 py-0.5 font-mono text-[10px] text-neu-800 dark:font-medium" ,
134+ className ,
135+ ) }
139136 >
140137 { children }
141138 </ div >
142139 )
143140}
144141
145142function LeafBox ( ) {
146- return < NestedBox bgColor = "bg-neu-100" innerColor = "bg-pri-base" />
143+ return (
144+ < NestedBox bgColor = "bg-neu-100 dark:bg-neu-50" innerColor = "bg-pri-base" />
145+ )
147146}
148147
149148function Fork ( props : React . SVGProps < SVGSVGElement > ) {
0 commit comments