Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update TailwindCSS to v3 and React to v18 #31

Merged
merged 8 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import isPropValid from '@emotion/is-prop-valid';
import type { Preview } from '@storybook/react';
import React from 'react';
import { StyleSheetManager } from 'styled-components';
import '../index.css';

const preview: Preview = {
Expand All @@ -14,9 +16,15 @@ const preview: Preview = {
},
decorators: [
(Story) => (
<div className="flex">
<Story />
</div>
<StyleSheetManager
shouldForwardProp={(propName, elementToBeRendered) =>
typeof elementToBeRendered === 'string' ? isPropValid(propName) : true
}
>
<div className="flex">
<Story />
</div>
</StyleSheetManager>
),
],
};
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Update `TailwindCSS` dependencies to v3
- Update `React` dependencies to v18

## [0.2.19] - 2023-10-09

### Added
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
"@tiptap/react": "^2.0.3",
"@tiptap/starter-kit": "^2.0.3",
"classnames": "^2.3.2",
"react": "^17.0.0",
"react": ">=18",
"react-blockies": "^1.4.1",
"react-dom": "^17.0.0",
"react-dom": ">=18",
"react-dropzone": "^11.5.1",
"styled-components": "^5.0.0",
"tailwindcss": "^2.0.0",
"tailwindcss-fluid-type": "^1.0.0"
"styled-components": ">=6",
"tailwindcss": ">=3",
"tailwindcss-fluid-type": ">=2"
},
"devDependencies": {
"@babel/core": "^7.0.0",
Expand All @@ -74,8 +74,9 @@
"@storybook/react-webpack5": "^7.0.26",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/testing-library": "^0.2.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^12.0.0",
"@testing-library/jest-dom": "^6.1.0",
"@testing-library/react": "^14.0.0",
"@types/jest": "^29.5.5",
"@types/react-blockies": "^1.4.1",
"@types/styled-components": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^5.61.0",
Expand All @@ -88,8 +89,8 @@
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-tailwindcss": "^2.0.0",
"eslint-plugin-testing-library": "^5.11.0",
"eslint-plugin-tailwindcss": "^3.13.0",
"eslint-plugin-testing-library": "^6.0.2",
"husky": "^8.0.3",
"jest": "^29.6.0",
"jest-environment-jsdom": "^29.6.0",
Expand Down
65 changes: 0 additions & 65 deletions src/components/actionItems/actionItemAddress.stories.tsx

This file was deleted.

176 changes: 0 additions & 176 deletions src/components/actionItems/actionItemAddress.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/actionItems/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/alerts/alertBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components';
import { styled } from 'styled-components';

export type AlertBannerProps = {
/** type and severity of alert */
Expand Down Expand Up @@ -28,6 +28,6 @@ type ContainerProps = {
mode: NonNullable<AlertBannerProps['mode']>;
};

const Container = styled.div.attrs(({ mode }: ContainerProps) => ({
const Container = styled.div.attrs<ContainerProps>(({ mode }) => ({
Fabricevladimir marked this conversation as resolved.
Show resolved Hide resolved
className: `ft-text-xs py-0.5 px-2 text-center font-bold ${styles[mode]}`,
}))<ContainerProps>``;
6 changes: 3 additions & 3 deletions src/components/alerts/alertCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components';
import { styled } from 'styled-components';

import { IconInfo, IconSuccess, IconWarning } from '../icons';

Expand Down Expand Up @@ -54,15 +54,15 @@ export const AlertCard: React.FC<AlertCardProps> = ({ mode = 'info', title, help
type ContainerProps = {
mode: NonNullable<AlertCardProps['mode']>;
};
const Container = styled.div.attrs(({ mode }: ContainerProps) => ({
const Container = styled.div.attrs<ContainerProps>(({ mode }) => ({
className: `flex gap-1.5 box-border px-2 py-1.5 border-2 rounded-xl ${styles[mode].bgColor} ${styles[mode].borderColor}`,
}))<ContainerProps>``;

const TextContainer = styled.div.attrs(() => ({
className: 'flex flex-col gap-0.25 ',
}))``;

const Title = styled.div.attrs(({ mode }: ContainerProps) => ({
const Title = styled.div.attrs<ContainerProps>(({ mode }) => ({
className: `flex flex-col font-bold ft-text-base ${styles[mode].color}`,
}))<ContainerProps>``;

Expand Down
8 changes: 4 additions & 4 deletions src/components/alerts/alertChip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { type ReactComponentElement } from 'react';
import styled, { css } from 'styled-components';
import { css, styled } from 'styled-components';

import { IconCheckmark, type IconType } from '../icons';

Expand Down Expand Up @@ -37,8 +37,8 @@ export const AlertChip: React.FC<AlertChipProps> = ({

type ContainerProps = Pick<AlertChipProps, 'isShown'>;

const WrapperAnimationCSS = css`
animation: ${({ isShown }: ContainerProps) => (isShown ? 'fadein 0.3s' : 'fadeout 0.3s')};
const WrapperAnimationCSS = css<ContainerProps>`
animation: ${({ isShown }) => (isShown ? 'fadein 0.3s' : 'fadeout 0.3s')};

@-webkit-keyframes fadein {
from {
Expand Down Expand Up @@ -93,7 +93,7 @@ const WrapperAnimationCSS = css`
}
`;

const Wrapper = styled.div.attrs(({ isShown }: ContainerProps) => ({
const Wrapper = styled.div.attrs<ContainerProps>(({ isShown }) => ({
className: `fixed w-full flex items-center justify-center top-3 ${
isShown ? 'opacity-100 fixed' : 'opacity-0 none'
}`,
Expand Down
Loading