@@ -62,12 +62,32 @@ export const FunctionParameters: FC<FunctionParametersProps> = ({
6262 < HtmlContent html = { param . details } />
6363 </ div >
6464
65+ { param . default && (
66+ < p class = "mt-3 text-sm" >
67+ < span class = "font-medium" >
68+ < Translation translationKey = "defaultValue" />
69+ </ span > { " " }
70+ < span class = "text-gray-700" >
71+ < HtmlContent html = { param . default } />
72+ </ span >
73+ </ p >
74+ ) }
75+
76+ { /* Put all collapsible blocks after non-collapsible blocks. */ }
77+
6578 { param . strings . length > 0 && (
66- < div class = "mt-3" >
67- < h5 class = "text-sm font-medium text-gray-700 mb-2" >
79+ < details
80+ class = "my-4 folding-example group"
81+ // The list of strings can be very long. For example, `page.paper` has 100+ possibilities.
82+ open = { param . strings . length <= 5 }
83+ >
84+ < summary class = "flex items-center gap-1 text-sm font-medium text-blue-600 cursor-pointer hover:text-blue-800" >
85+ < div class = "w-4 h-4 text-gray-400 transform transition-transform duration-200 group-open:rotate-90" >
86+ < ChevronRightIcon />
87+ </ div >
6888 < Translation translationKey = "stringValues" />
69- </ h5 >
70- < ul class = "type-args space-y-2 pl-4 " >
89+ </ summary >
90+ < ul class = "type-args space-y-2" >
7191 { param . strings . map ( ( string ) => (
7292 < li key = { string . string } >
7393 < div class = "break-box" >
@@ -81,22 +101,11 @@ export const FunctionParameters: FC<FunctionParametersProps> = ({
81101 </ li >
82102 ) ) }
83103 </ ul >
84- </ div >
85- ) }
86-
87- { param . default && (
88- < p class = "mt-3 text-sm" >
89- < span class = "font-medium" >
90- < Translation translationKey = "defaultValue" />
91- </ span > { " " }
92- < span class = "text-gray-700" >
93- < HtmlContent html = { param . default } />
94- </ span >
95- </ p >
104+ </ details >
96105 ) }
97106
98107 { param . example && (
99- < details class = "mt -4 folding-example group" >
108+ < details class = "my -4 folding-example group" >
100109 < summary class = "flex items-center gap-1 text-sm font-medium text-blue-600 cursor-pointer hover:text-blue-800" >
101110 < div class = "w-4 h-4 text-gray-400 transform transition-transform duration-200 group-open:rotate-90" >
102111 < ChevronRightIcon />
0 commit comments