Skip to content

Commit

Permalink
Deprecate the BodyLarge component
Browse files Browse the repository at this point in the history
  • Loading branch information
connor-baer committed Aug 14, 2024
1 parent 6dc957a commit 4d82123
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/circuit-ui/components/BodyLarge/BodyLarge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import * as Stories from './BodyLarge.stories';

# BodyLarge

<Status variant="stable" />
<Status variant="deprecated">
Use the Body component in size `l` instead.
</Status>

The BodyLarge component is used to render content with large typography. Typically, large typography is intended for landing pages. In most cases, the [Body](Typography/Body) should be used instead.

Expand Down
11 changes: 9 additions & 2 deletions packages/circuit-ui/components/BodyLarge/BodyLarge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { forwardRef, type HTMLAttributes, type Ref } from 'react';

import type { AsPropType } from '../../types/prop-types.js';
import { clsx } from '../../styles/clsx.js';
import { deprecate } from '../../util/logger.js';

import classes from './BodyLarge.module.css';

Expand Down Expand Up @@ -48,11 +49,17 @@ function getHTMLElement(variant?: Variant): AsPropType {
}

/**
* The BodyLarge component is used to present the core textual content
* to our users.
* @deprecated Use the Body component in size `l` instead.
*/
export const BodyLarge = forwardRef<HTMLParagraphElement, BodyLargeProps>(
({ className, as, variant, ...props }, ref) => {
if (process.env.NODE_ENV !== 'production') {
deprecate(
'BodyLarge',
'The BodyLarge component has been deprecated. Use the Body component in size `l` instead.',
);
}

const Element = as || getHTMLElement(variant);
return (
<Element
Expand Down

0 comments on commit 4d82123

Please sign in to comment.