11/* @jsx jsx */
22import { jsx } from '@emotion/core' ;
3- import { Box , Flex , Icon , IconLibrary , Textarea } from '@stoplight/ui-kit' ;
3+ import { Box , Flex , Icon , IconLibrary } from '@stoplight/ui-kit' ;
44import has = require( 'lodash/has' ) ;
55import isEmpty = require( 'lodash/isEmpty' ) ;
66import isString = require( 'lodash/isString' ) ;
@@ -11,6 +11,7 @@ import { faCaretRight } from '@fortawesome/free-solid-svg-icons/faCaretRight';
1111import { ErrorMessage } from '../common/ErrorMessage' ;
1212import { MutedText } from '../common/MutedText' ;
1313import { Row } from '../common/Row' ;
14+ import { RowType } from '../common/RowType' ;
1415import { PropValidations } from '../PropValidations' ;
1516import { useTheme } from '../theme' ;
1617import { ICommonProps } from '../types' ;
@@ -116,9 +117,9 @@ export const renderProp = ({
116117 if ( ! isEmpty ( types ) ) {
117118 typeElems = types . reduce ( ( acc : ReactNode [ ] , type : string , i ) => {
118119 acc . push (
119- < span key = { i } >
120+ < RowType as = " span" type = { type } key = { i } >
120121 { type === 'array' && childPropType && childPropType !== 'array' ? `array[${ childPropType } ]` : type }
121- </ span >
122+ </ RowType >
122123 ) ;
123124
124125 if ( types [ i + 1 ] ) {
@@ -132,7 +133,7 @@ export const renderProp = ({
132133 return acc ;
133134 } , [ ] ) ;
134135 } else if ( prop . $ref ) {
135- typeElems . push ( < span key = "prop-ref" > { `{${ prop . $ref } }` } </ span > ) ;
136+ typeElems . push ( < RowType as = " span" type = "$ref" key = "prop-ref" > { `{${ prop . $ref } }` } </ RowType > ) ;
136137 } else if ( prop . __error || isBasic ) {
137138 typeElems . push (
138139 < Box as = "span" key = "no-types" color = { theme . canvas . error } >
@@ -166,6 +167,7 @@ export const renderProp = ({
166167 rowElems . push (
167168 < Row
168169 as = { Flex }
170+ alignItems = "center"
169171 position = "relative"
170172 py = { 2 }
171173 key = { position }
@@ -178,7 +180,7 @@ export const renderProp = ({
178180 } }
179181 >
180182 { expandable ? (
181- < Flex justifyContent = "center" mt = { 1 } pl = "0.5rem" mr = "0.5rem" ml = "-1.5rem" width = "1rem" >
183+ < Flex justifyContent = "center" pl = "0.5rem" mr = "0.5rem" ml = "-1.5rem" width = "1rem" >
182184 < Icon size = "1x" icon = { expanded ? faCaretDown : faCaretRight } />
183185 </ Flex >
184186 ) : null }
@@ -190,7 +192,7 @@ export const renderProp = ({
190192 { ! isEmpty ( typeElems ) && < div > { typeElems } </ div > }
191193 </ Flex >
192194
193- { ! isEmpty ( prop . description ) ? < MutedText as = { Textarea } fontSize = ".875rem" value = { prop . description } / > : null }
195+ { ! isEmpty ( prop . description ) ? < MutedText fontSize = ".875rem" > { prop . description } </ MutedText > : null }
194196 </ Box >
195197
196198 { requiredElem || showInheritedFrom || expanded ? (
0 commit comments