From deffc69e93aafe7e6a30a03b105dfece7a36ad24 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 26 Jan 2024 16:42:46 -0700 Subject: [PATCH] Add docs component for API members that are marked as alpha/beta (#11529) --- docs/shared/ApiDoc/DocBlock.js | 29 ++++++++++++++++++++ docs/shared/ApiDoc/Function.js | 7 ++++- docs/shared/ApiDoc/PropertySignatureTable.js | 2 +- docs/shared/ApiDoc/index.js | 9 +++++- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/docs/shared/ApiDoc/DocBlock.js b/docs/shared/ApiDoc/DocBlock.js index 18e29d26d19..28ee46b305a 100644 --- a/docs/shared/ApiDoc/DocBlock.js +++ b/docs/shared/ApiDoc/DocBlock.js @@ -11,10 +11,12 @@ export function DocBlock({ example = false, remarksCollapsible = false, deprecated = false, + releaseTag = false, }) { return ( {deprecated && } + {releaseTag && } {summary && } {remarks && ( + This is in{" "} + + {item.releaseTag.toLowerCase()} stage + {" "} + and is subject to breaking changes. + + ); +} + +ReleaseTag.propTypes = { + canonicalReference: PropTypes.string.isRequired, +}; diff --git a/docs/shared/ApiDoc/Function.js b/docs/shared/ApiDoc/Function.js index 7cf0e8cbc3d..aad711fe8f7 100644 --- a/docs/shared/ApiDoc/Function.js +++ b/docs/shared/ApiDoc/Function.js @@ -109,7 +109,12 @@ export function FunctionDetails({ headingLevel={headingLevel} since /> - + {item.comment?.examples.length == 0 ? null : ( <> diff --git a/docs/shared/ApiDoc/index.js b/docs/shared/ApiDoc/index.js index 4173bdebe62..06728b10116 100644 --- a/docs/shared/ApiDoc/index.js +++ b/docs/shared/ApiDoc/index.js @@ -1,5 +1,12 @@ export { useApiDocContext } from "./Context"; -export { DocBlock, Deprecated, Example, Remarks, Summary } from "./DocBlock"; +export { + DocBlock, + Deprecated, + Example, + Remarks, + ReleaseTag, + Summary, +} from "./DocBlock"; export { PropertySignatureTable } from "./PropertySignatureTable"; export { ApiDocHeading, SubHeading, SectionHeading } from "./Heading"; export { InterfaceDetails } from "./InterfaceDetails";