From 53218f8b90f2860b0c3b02829accbcd5a398bd04 Mon Sep 17 00:00:00 2001 From: Mayank <9084735+mayank99@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:59:57 -0500 Subject: [PATCH] fix CJS dynamic import issues --- packages/itwinui-react/package.json | 4 ++-- .../utils/components/WithCSSTransition.tsx | 13 ++++++------- packages/itwinui-react/tsconfig.json | 2 +- yarn.lock | 19 +++++++++++++++---- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/itwinui-react/package.json b/packages/itwinui-react/package.json index 0d91ca9eac6..fca7acdf820 100644 --- a/packages/itwinui-react/package.json +++ b/packages/itwinui-react/package.json @@ -1,6 +1,6 @@ { "name": "@itwin/itwinui-react", - "version": "3.1.3-dev.0", + "version": "3.1.3-dev.1", "author": "Bentley Systems", "license": "MIT", "type": "module", @@ -95,7 +95,7 @@ "@types/node": "^18.0.0", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", - "@types/react-transition-group": "^4.4.6", + "@types/react-transition-group": "^4.4.10", "@typescript-eslint/eslint-plugin": "^5.60.0", "@typescript-eslint/parser": "^5.60.0", "concurrently": "^5.3.0", diff --git a/packages/itwinui-react/src/core/utils/components/WithCSSTransition.tsx b/packages/itwinui-react/src/core/utils/components/WithCSSTransition.tsx index fd54a743a0f..a8de8b0da87 100644 --- a/packages/itwinui-react/src/core/utils/components/WithCSSTransition.tsx +++ b/packages/itwinui-react/src/core/utils/components/WithCSSTransition.tsx @@ -4,11 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import * as React from 'react'; import { CSSTransition } from 'react-transition-group'; -import type { CSSTransitionProps } from 'react-transition-group/CSSTransition'; import styles from '../../../styles.js'; export const WithCSSTransition = ( - props: Partial & { + props: Partial> & { children: JSX.Element; dimension?: 'height' | 'width'; }, @@ -24,21 +23,21 @@ export const WithCSSTransition = ( in={visible} timeout={200} unmountOnExit={true} - onEnter={(node) => { + onEnter={(node: HTMLElement) => { node.style[`min${dimensionCamelCase}`] = 'initial'; node.style[dimension] = '0px'; }} - onEntering={(node) => { + onEntering={(node: HTMLElement) => { node.style[dimension] = `${expandedSize.current}px`; }} - onEntered={(node) => { + onEntered={(node: HTMLElement) => { node.style[`min${dimensionCamelCase}`] = ''; node.style[dimension] = ''; }} - onExit={(node) => { + onExit={(node: HTMLElement) => { node.style[dimension] = `${expandedSize.current}px`; }} - onExiting={(node) => { + onExiting={(node: HTMLElement) => { node.style[`min${dimensionCamelCase}`] = 'initial'; node.style[dimension] = '0px'; }} diff --git a/packages/itwinui-react/tsconfig.json b/packages/itwinui-react/tsconfig.json index 7ce01b151ca..fe1357d106e 100644 --- a/packages/itwinui-react/tsconfig.json +++ b/packages/itwinui-react/tsconfig.json @@ -9,7 +9,7 @@ "sourceMap": false, "allowJs": false, "jsx": "react", - "moduleResolution": "node", + "moduleResolution": "NodeNext", "traceResolution": false, "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, diff --git a/yarn.lock b/yarn.lock index e5bdf63c8f7..c3453712ee4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1613,6 +1613,17 @@ resolved "https://registry.yarnpkg.com/@itwin/itwinui-illustrations-react/-/itwinui-illustrations-react-2.1.0.tgz#44ddff71dcd84317cd2cbc52f413a0efe873ce79" integrity sha512-5JR2A3mZy0d0qwwHpveSG3fsXLheJkO6a0GoWb8NQWw5edNZMRynJg0l3hVw3CHMgaaCGbUoKC77MuG0jWDzuA== +"@itwin/itwinui-react@*": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@itwin/itwinui-react/-/itwinui-react-3.1.2.tgz#02b13d740eb6a60b5103bd982b2a77d9437be9ba" + integrity sha512-MGS+IemlfLudbVkN19tMBnhql9auIZ4VpfY0ffLcK6gt523yFJDWztSUYadqQkypwOW5mVanyvmULWzPzVGCbg== + dependencies: + "@floating-ui/react" "^0.26.3" + classnames "^2.3.2" + react-table "^7.8.0" + react-transition-group "^4.4.5" + tslib "^2.6.0" + "@jest/console@^29.5.0": version "29.5.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.5.0.tgz#593a6c5c0d3f75689835f1b3b4688c4f8544cb57" @@ -2914,10 +2925,10 @@ dependencies: "@types/react" "*" -"@types/react-transition-group@^4.4.6": - version "4.4.6" - resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.6.tgz#18187bcda5281f8e10dfc48f0943e2fdf4f75e2e" - integrity sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew== +"@types/react-transition-group@^4.4.10": + version "4.4.10" + resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.10.tgz#6ee71127bdab1f18f11ad8fb3322c6da27c327ac" + integrity sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q== dependencies: "@types/react" "*"