File tree 1 file changed +28
-8
lines changed
packages/docusaurus-theme/src/components/prop_table
1 file changed +28
-8
lines changed Original file line number Diff line number Diff line change 9
9
EuiTitle ,
10
10
useEuiMemoizedStyles ,
11
11
EuiLink ,
12
+ EuiPanel ,
12
13
} from '@elastic/eui' ;
13
14
import {
14
15
ProcessedComponent ,
@@ -51,6 +52,10 @@ const getPropTableStyles = ({ euiTheme }: UseEuiTheme) => ({
51
52
font-weight : ${ euiTheme . font . weight . semiBold } ;
52
53
` ,
53
54
description : css `
55
+ p {
56
+ font-size : var (--eui-font-size-s );
57
+ }
58
+
54
59
p : first-child {
55
60
margin-block-start : 0 ;
56
61
}
@@ -73,6 +78,9 @@ const getPropTableStyles = ({ euiTheme }: UseEuiTheme) => ({
73
78
display : inline-block;
74
79
}
75
80
` ,
81
+ tableCell : css `
82
+ vertical-align : text-top;
83
+ ` ,
76
84
} ) ;
77
85
78
86
export const PropTable = ( {
@@ -173,6 +181,14 @@ export const PropTable = ({
173
181
[ definition . displayName ]
174
182
) ;
175
183
184
+ const cellProps = useCallback (
185
+ ( item : ProcessedComponentProp ) => ( {
186
+ id : getPropId ( item , definition . displayName ) ,
187
+ css : styles . tableCell ,
188
+ } ) ,
189
+ [ definition . displayName ]
190
+ ) ;
191
+
176
192
return (
177
193
< EuiFlexGroup
178
194
aria-label = { `Component properties table for ${ definition . displayName } ` }
@@ -182,19 +198,23 @@ export const PropTable = ({
182
198
>
183
199
< header css = { styles . header } >
184
200
{ showTitle && (
185
- < EuiTitle size = "m " >
201
+ < EuiTitle size = "s " >
186
202
< HeadingLevel > { definition . displayName } </ HeadingLevel >
187
203
</ EuiTitle >
188
204
) }
189
205
< PropTableExtendedTypes definition = { definition } />
190
206
</ header >
191
- < EuiBasicTable
192
- css = { styles . table }
193
- width = "100%"
194
- items = { tableItems }
195
- columns = { columns }
196
- rowProps = { rowProps }
197
- />
207
+ < EuiPanel color = "plain" hasBorder >
208
+ < EuiBasicTable
209
+ css = { styles . table }
210
+ width = "100%"
211
+ items = { tableItems }
212
+ columns = { columns }
213
+ rowProps = { rowProps }
214
+ cellProps = { cellProps }
215
+ compressed
216
+ />
217
+ </ EuiPanel >
198
218
</ EuiFlexGroup >
199
219
) ;
200
220
} ;
You can’t perform that action at this time.
0 commit comments