SUI-Components / sui-components

SUI Components
https://sui-components.vercel.app/
MIT License
140 stars 59 forks source link

fix(components/primitive/typography): allow for use of className prop #2741

Closed jordevo closed 4 months ago

jordevo commented 4 months ago

Primitive/Typography

🔍 Show

TASK: N/A

Description, Motivation and Context

Currently, passing className to <PrimitiveTypography/> as a prop doesn't do anything, although it is documented as a legit prop.

This fixes the issue and allows for the extension of styles via classes when using this component.

Types of changes

Code example

Given this piece of React code:

<PrimitiveTypography as="h1" design="body-1" fontWeight="semi-bold" className="mt-TypographyBasic">
      lorem ipsum
</PrimitiveTypography>

The current output would be:

<h1 class="sui-PrimitiveTypography sui-PrimitiveTypography-design-body-1 sui-PrimitiveTypography-variant-default sui-PrimitiveTypography-fontSize-m sui-PrimitiveTypography-fontWeight-semi-bold sui-PrimitiveTypography-lineHeight-xl">lorem ipsum</h1>

The fix will make the output to be:

<h1 class="sui-PrimitiveTypography sui-PrimitiveTypography-design-body-1 sui-PrimitiveTypography-variant-default sui-PrimitiveTypography-fontSize-m sui-PrimitiveTypography-fontWeight-semi-bold sui-PrimitiveTypography-lineHeight-xl mt-TypographyBasic">lorem ipsum</h1>
github-actions[bot] commented 4 months ago
STATEMENTS BRANCHES FUNCTIONS LINES
≍ 0= ≍ 0= ≍ 0= ≍ 0=
% 75.96 64.37 65.95 77.73
ABS 3337 / 4393 2044 / 3175 653 / 990 3159 / 4064