docs: update and fix UI props docs (#10754)
This commit is contained in:
@@ -66,7 +66,10 @@ const ComponentReference = ({
|
||||
<PropTable props={componentSpec.props!} />
|
||||
</Suspense>
|
||||
</Container>
|
||||
<Feedback title={`props of ${component}`} />
|
||||
<Feedback
|
||||
title={`props of ${component}`}
|
||||
question="Was this helpful?"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -45,7 +45,10 @@ const Row = ({
|
||||
propData: { tsType: tsType, defaultValue, description },
|
||||
}: RowProps) => {
|
||||
const normalizeRaw = (str: string): string => {
|
||||
return str.replace("\\|", "|")
|
||||
return str
|
||||
.replace("\\|", "|")
|
||||
.replaceAll("<", "<")
|
||||
.replaceAll(">", ">")
|
||||
}
|
||||
const getTypeRaw = useCallback((type: PropSpecType): string => {
|
||||
let raw = "raw" in type ? type.raw || type.name : type.name
|
||||
@@ -74,9 +77,11 @@ const Row = ({
|
||||
}, [])
|
||||
const getTypeTooltipContent = useCallback(
|
||||
(type: PropSpecType): string | undefined => {
|
||||
if (type?.name === "signature" && "type" in type) {
|
||||
return getTypeRaw(type)
|
||||
} else if (type?.name === "Array" && type.raw) {
|
||||
if (
|
||||
(type?.name === "signature" && "type" in type) ||
|
||||
(type?.name === "Array" && type.raw) ||
|
||||
("raw" in type && type.raw)
|
||||
) {
|
||||
return getTypeRaw(type)
|
||||
}
|
||||
|
||||
@@ -107,6 +112,11 @@ const Row = ({
|
||||
text: element.value,
|
||||
canBeCopied: true,
|
||||
})
|
||||
} else if ("raw" in element) {
|
||||
typeNodes.push({
|
||||
text: getTypeText(element),
|
||||
tooltipContent: getTypeTooltipContent(element),
|
||||
})
|
||||
} else {
|
||||
typeNodes.push({
|
||||
text: element.name,
|
||||
|
||||
Reference in New Issue
Block a user