Skip to content

Commit

Permalink
[FX-5185] Use twMerge in Typography
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslan-sed committed May 24, 2024
1 parent 0dd90e9 commit e3fdddf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/base/Tag/src/Tag/__snapshots__/test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ exports[`Tag renders with adornment 1`] = `
foobar
</span>
<span
class="m-0 text-xxs text-inherit font-regular inline-flex items-center gap-[5px] text-gray group-aria-disabled:text-gray"
class="m-0 text-xxs font-regular inline-flex items-center gap-[5px] text-gray group-aria-disabled:text-gray"
>
<svg
class="PicassoSvgLink16-root"
Expand Down Expand Up @@ -150,7 +150,7 @@ exports[`Tag renders with connection and icon 1`] = `
foobar
</span>
<span
class="m-0 text-xxs text-inherit font-regular inline-flex items-center gap-[5px] text-gray group-aria-disabled:text-gray"
class="m-0 text-xxs font-regular inline-flex items-center gap-[5px] text-gray group-aria-disabled:text-gray"
>
<svg
class="PicassoSvgLink16-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`TagRectangular renders rectangular Tag 1`] = `
class="text-lg transition-none rounded-sm font-semibold h-4 inline-flex content-center justify-center align-middle bg-gray"
>
<p
class="m-0 text-2xs text-graphite font-semibold whitespace-nowrap overflow-ellipsis overflow-hidden mx-1 w-max text-graphite"
class="m-0 text-2xs font-semibold whitespace-nowrap overflow-ellipsis overflow-hidden mx-1 w-max text-graphite"
>
Reactangular Tag
</p>
Expand Down
1 change: 1 addition & 0 deletions packages/base/Typography/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"peerDependencies": {
"@material-ui/core": "4.12.4",
"@toptal/picasso-provider": "*",
"@toptal/picasso-tailwind-merge": "^1.0.0",
"tailwindcss": ">=3",
"react": ">=16.12.0 < 19.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/base/Typography/src/Typography/Typography.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { ReactNode, HTMLAttributes, ElementType } from 'react'
import React, { forwardRef } from 'react'
import cx from 'classnames'
import type {
StandardProps,
ColorType,
TextLabelProps,
SizeType,
} from '@toptal/picasso-shared'
import { toTitleCase } from '@toptal/picasso-utils'
import { twMerge } from '@toptal/picasso-tailwind-merge'

import variantToElement from './utils/variant-to-element'

Expand Down Expand Up @@ -191,7 +191,7 @@ export const Typography = forwardRef<HTMLElement, Props>(function Typography(
return (
<Component
ref={ref}
className={cx(
className={twMerge(
'm-0',
VARIANT_SIZE[variant][size],
getColor(),
Expand Down
6 changes: 5 additions & 1 deletion packages/base/Typography/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"extends": "../../../tsconfig.base.json",
"compilerOptions": { "outDir": "dist-package" },
"include": ["src"],
"references": [{ "path": "../../picasso-provider" }, { "path": "../Utils" }]
"references": [
{ "path": "../../picasso-provider" },
{ "path": "../../picasso-tailwind-merge" },
{ "path": "../Utils" }
]
}

0 comments on commit e3fdddf

Please sign in to comment.