diff --git a/.changeset/two-ties-count.md b/.changeset/two-ties-count.md new file mode 100644 index 0000000000..d35b209955 --- /dev/null +++ b/.changeset/two-ties-count.md @@ -0,0 +1,9 @@ +--- +'@toptal/picasso-image': major +'@toptal/picasso': patch +--- + +### Image + +- migrated to Tailwind CSS +- added `@toptal/picasso-tailwind` as a peer dependency to `@toptal/picasso-image` diff --git a/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap b/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap index 67859da0c1..340e193f48 100644 --- a/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap +++ b/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap @@ -194,7 +194,7 @@ exports[`AccountSelect renders 1`] = ` > Phil Leif 3 diff --git a/packages/base/Image/package.json b/packages/base/Image/package.json index 9112c4ad77..aeeb4cc638 100644 --- a/packages/base/Image/package.json +++ b/packages/base/Image/package.json @@ -28,12 +28,10 @@ "devDependencies": { "@testing-library/react": "^14.1.2" }, - "sideEffects": [ - "**/styles.ts", - "**/styles.js" - ], + "sideEffects": false, "peerDependencies": { - "@material-ui/core": "4.12.4", + "@toptal/picasso-tailwind-merge": "^1.0.1", + "@toptal/picasso-tailwind": ">=2.7", "react": ">=16.12.0 < 19.0.0" }, "exports": { diff --git a/packages/base/Image/src/Image/Image.tsx b/packages/base/Image/src/Image/Image.tsx index 7534182c13..49b4a46c53 100644 --- a/packages/base/Image/src/Image/Image.tsx +++ b/packages/base/Image/src/Image/Image.tsx @@ -1,11 +1,7 @@ import type { ImgHTMLAttributes } from 'react' import React, { forwardRef } from 'react' -import cx from 'classnames' -import type { Theme } from '@material-ui/core/styles' -import { makeStyles } from '@material-ui/core/styles' import type { BaseProps } from '@toptal/picasso-shared' - -import styles from './styles' +import { twMerge } from '@toptal/picasso-tailwind-merge' type VariantType = 'rectangle' | 'circular' @@ -20,8 +16,6 @@ export interface Props extends BaseProps, ImgHTMLAttributes { variant?: VariantType } -const useStyles = makeStyles(styles, { name: 'PicassoImage' }) - export const Image = forwardRef(function Image( props, ref @@ -35,7 +29,6 @@ export const Image = forwardRef(function Image( style, ...rest } = props - const classes = useStyles() return ( (function Image( src={src} srcSet={srcSet} alt={alt} - className={cx( - { - [classes.circular]: variant === 'circular', - }, - classes.root, + className={twMerge( + variant === 'circular' && 'rounded-full', + 'block', className )} style={style} diff --git a/packages/base/Image/src/Image/__snapshots__/test.tsx.snap b/packages/base/Image/src/Image/__snapshots__/test.tsx.snap index bdd6a467ed..27c7bb1534 100644 --- a/packages/base/Image/src/Image/__snapshots__/test.tsx.snap +++ b/packages/base/Image/src/Image/__snapshots__/test.tsx.snap @@ -4,7 +4,7 @@ exports[`Image circular variant render 1`] = `
Circular image
@@ -14,7 +14,7 @@ exports[`Image renders 1`] = `
Default image
diff --git a/packages/base/Image/src/Image/styles.ts b/packages/base/Image/src/Image/styles.ts deleted file mode 100644 index da58e23363..0000000000 --- a/packages/base/Image/src/Image/styles.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { createStyles } from '@material-ui/core/styles' - -export default () => - createStyles({ - root: { - display: 'block', - }, - circular: { - borderRadius: '50%', - }, - }) diff --git a/packages/base/Image/tsconfig.json b/packages/base/Image/tsconfig.json index 49c9d99a4b..c2fd72732c 100644 --- a/packages/base/Image/tsconfig.json +++ b/packages/base/Image/tsconfig.json @@ -2,5 +2,9 @@ "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "dist-package" }, "include": ["src"], - "references": [{ "path": "../Utils" }] + "references": [ + { "path": "../../picasso-tailwind" }, + { "path": "../../picasso-tailwind-merge" }, + { "path": "../Utils" } + ] } diff --git a/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap b/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap index f2079ada89..5ef6753dee 100644 --- a/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap +++ b/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap @@ -22,7 +22,7 @@ exports[`PageTopBarMenu renders 1`] = ` > Jacqueline Roque