@@ -2,7 +2,6 @@ import ModemIcon from "@/app/conf/_design-system/pixelarticons/modem.svg?svgr"
2
2
import clsx from "clsx"
3
3
4
4
const INNER_BOX_SIZE = 16
5
- const GAP_X = 32
6
5
7
6
interface ComponentTreeProps extends React . HTMLAttributes < HTMLDivElement > {
8
7
names : [ string , string , string , string ]
@@ -14,86 +13,86 @@ export function ComponentTree({
14
13
...rest
15
14
} : ComponentTreeProps ) {
16
15
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
+ >
18
23
< div className = "flex flex-col" >
19
24
< 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 ">
21
26
{ names [ 0 ] }
22
27
</ ComponentLabel >
23
28
</ div >
24
29
25
30
< div className = "h-4" />
26
31
27
32
< 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 ">
29
34
{ names [ 1 ] }
30
35
</ ComponentLabel >
31
36
</ div >
32
37
33
38
< div className = "h-4" />
34
39
35
40
< 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" >
40
42
{ names [ 2 ] }
41
43
</ ComponentLabel >
42
44
</ div >
43
45
44
46
< div className = "h-4" />
45
47
46
48
< 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" >
51
50
{ names [ 3 ] }
52
51
</ ComponentLabel >
53
52
</ div >
54
53
</ div >
55
54
56
55
< 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" />
59
58
</ div >
60
59
61
- < div className = "h-4 w-px bg-neu-300" />
60
+ < div className = "h-4 w-px bg-neu-300 dark:bg-neu-100 " />
62
61
63
62
< NestedBox
64
- bgColor = "bg-neu-600"
63
+ bgColor = "bg-neu-600 dark:bg-neu-200 "
65
64
middleColor = "bg-sec-base"
66
65
innerColor = "bg-pri-base"
67
66
/>
68
67
69
68
< Fork
70
- className = "text-neu-300"
69
+ className = "text-neu-300 dark:text-neu-100 "
71
70
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)` ,
73
72
} }
74
73
/>
75
74
76
- < div className = "flex" style = { { gap : GAP_X } } >
75
+ < div className = "flex gap-[--gap-x]" >
77
76
< div className = "flex flex-col items-center" >
78
77
< NestedBox
79
- bgColor = "bg-neu-100"
78
+ bgColor = "bg-neu-100 dark:bg-neu-50 "
80
79
middleColor = "bg-sec-base"
81
80
innerColor = "bg-pri-base"
82
81
/>
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]" >
85
84
< LeafBox />
86
85
< LeafBox />
87
86
</ div >
88
87
</ div >
89
88
< div className = "flex flex-col items-center" >
90
89
< NestedBox
91
- bgColor = "bg-neu-100"
90
+ bgColor = "bg-neu-100 dark:bg-neu-50 "
92
91
middleColor = "bg-sec-base"
93
92
innerColor = "bg-pri-base"
94
93
/>
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]" >
97
96
< LeafBox />
98
97
< LeafBox />
99
98
</ div >
@@ -124,26 +123,26 @@ function NestedBox({ bgColor, middleColor, innerColor }: NestedBoxProps) {
124
123
125
124
interface ComponentLabelProps {
126
125
children : React . ReactNode
127
- bgColor : string
128
- borderColor : string
126
+ className : string
129
127
}
130
128
131
- function ComponentLabel ( {
132
- children,
133
- bgColor,
134
- borderColor,
135
- } : ComponentLabelProps ) {
129
+ function ComponentLabel ( { children, className } : ComponentLabelProps ) {
136
130
return (
137
131
< 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
+ ) }
139
136
>
140
137
{ children }
141
138
</ div >
142
139
)
143
140
}
144
141
145
142
function 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
+ )
147
146
}
148
147
149
148
function Fork ( props : React . SVGProps < SVGSVGElement > ) {
0 commit comments