From 4eca1ecbb72c2ea266f9dcc3e2fc382413c8c0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 7 Jan 2025 15:58:06 +0800 Subject: [PATCH] fix: deprecation comments (#32617) Using `//` deprecations are not properly recognized as JSDoc doesn't work like that. --- apps/docs/lib/docs.ts | 2 +- packages/ui-patterns/Dialogs/ConfirmDialog.tsx | 2 +- packages/ui/src/components/Button/Button.tsx | 2 +- packages/ui/src/components/Modal/Modal.tsx | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/docs/lib/docs.ts b/apps/docs/lib/docs.ts index 4be5a7dfb01..ca21bd2102f 100644 --- a/apps/docs/lib/docs.ts +++ b/apps/docs/lib/docs.ts @@ -26,7 +26,7 @@ export type GuideFrontmatter = { description?: string canonical?: string hideToc?: boolean - // @deprecated + /** @deprecated */ hide_table_of_contents?: boolean tocVideo?: string } diff --git a/packages/ui-patterns/Dialogs/ConfirmDialog.tsx b/packages/ui-patterns/Dialogs/ConfirmDialog.tsx index 3f6aace4a28..24a6d10f8b3 100644 --- a/packages/ui-patterns/Dialogs/ConfirmDialog.tsx +++ b/packages/ui-patterns/Dialogs/ConfirmDialog.tsx @@ -17,7 +17,7 @@ interface ConfirmModalProps { onSelectConfirm: () => void } -// @deprecated use ConfirmationModal instead +/** @deprecated use ConfirmationModal instead */ const ConfirmModal = ({ visible = false, danger = false, diff --git a/packages/ui/src/components/Button/Button.tsx b/packages/ui/src/components/Button/Button.tsx index 4e0bd5ff69a..20513b69d48 100644 --- a/packages/ui/src/components/Button/Button.tsx +++ b/packages/ui/src/components/Button/Button.tsx @@ -59,7 +59,7 @@ const buttonVariants = cva( data-[state=open]:border-foreground-lighter data-[state=open]:outline-border-strong `, - // @deprecated use 'primary' instead + /** @deprecated use 'primary' instead */ alternative: ` text-foreground bg-brand-400 hover:bg-brand-500 diff --git a/packages/ui/src/components/Modal/Modal.tsx b/packages/ui/src/components/Modal/Modal.tsx index d6c61ba6a5b..ebdf78b5e22 100644 --- a/packages/ui/src/components/Modal/Modal.tsx +++ b/packages/ui/src/components/Modal/Modal.tsx @@ -21,14 +21,14 @@ export interface ModalProps extends React.ComponentProps { Separator?: React.ComponentType Content?: React.ComponentType visible?: boolean - // @deprecated please add the footer directly in component children. This is to prepare for using component + /** @deprecated please add the footer directly in component children. This is to prepare for using component */ customFooter?: React.ReactNode description?: string - // @deprecated please add the footer directly in component children. This is to prepare for using component + /** @deprecated please add the footer directly in component children. This is to prepare for using component */ hideFooter?: boolean - // @deprecated please add the footer directly in component children. This is to prepare for using component + /** @deprecated please add the footer directly in component children. This is to prepare for using component */ alignFooter?: 'right' | 'left' - // @deprecated please add the footer directly in component children. This is to prepare for using component + /** @deprecated please add the footer directly in component children. This is to prepare for using component */ layout?: 'horizontal' | 'vertical' loading?: boolean onCancel?: any @@ -37,14 +37,14 @@ export interface ModalProps extends React.ComponentProps { confirmText?: string showCloseButton?: boolean footerBackground?: boolean - // @deprecated please add the footer directly in component children. This is to prepare for using component + /** @deprecated please add the footer directly in component children. This is to prepare for using component */ variant?: ButtonVariantProps['type'] overlayStyle?: React.CSSProperties contentStyle?: React.CSSProperties dialogOverlayProps?: React.ComponentProps['dialogOverlayProps'] - // @deprecated please consider using and components + /** @deprecated please consider using and components */ triggerElement?: React.ReactNode - // @deprecated please consider using and components + /** @deprecated please consider using and components */ header?: React.ReactNode modal?: React.ComponentProps['modal'] defaultOpen?: React.ComponentProps['defaultOpen'] @@ -62,7 +62,7 @@ interface ModalType Separator: React.ComponentType } -// @deprecated use instead +/** @deprecated use instead */ const Modal = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & ModalProps