From 8702ec29a856bce6c1d94ba6177779d84090176e Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 16 Oct 2022 00:49:49 +0200 Subject: [PATCH] Drop dependency to @emotion/react --- package.json | 5 +- renovate.json | 4 +- src/lib/components/IdpReviewUserProfile.tsx | 16 ++-- src/lib/components/Login.tsx | 36 ++++----- src/lib/components/LoginConfigTotp.tsx | 36 ++++----- src/lib/components/LoginIdpLinkConfirm.tsx | 10 +-- src/lib/components/LoginOtp.tsx | 38 +++++---- src/lib/components/LoginPassword.tsx | 18 ++--- src/lib/components/LoginResetPassword.tsx | 26 +++--- src/lib/components/LoginUpdatePassword.tsx | 42 +++++----- src/lib/components/LoginUpdateProfile.tsx | 60 +++++++------- src/lib/components/LoginUsername.tsx | 28 +++---- src/lib/components/LogoutConfirm.tsx | 12 ++- src/lib/components/Register.tsx | 80 +++++++++---------- src/lib/components/RegisterUserProfile.tsx | 30 +++---- src/lib/components/Template.tsx | 54 ++++++------- src/lib/components/Terms.tsx | 8 +- src/lib/components/UpdateUserProfile.tsx | 20 +++-- src/lib/components/WebauthnAuthenticate.tsx | 34 ++++---- .../components/shared/UserProfileCommons.tsx | 57 ++++++------- src/lib/tools/clsx.ts | 7 ++ src/lib/tools/useCssAndCx.ts | 17 ++-- yarn.lock | 45 ++++++----- 23 files changed, 328 insertions(+), 355 deletions(-) create mode 100644 src/lib/tools/clsx.ts diff --git a/package.json b/package.json index 88574a0c..8e5536cc 100755 --- a/package.json +++ b/package.json @@ -55,12 +55,10 @@ ], "homepage": "https://github.com/garronej/keycloakify", "peerDependencies": { - "@emotion/react": "^11.4.1", "react": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "devDependencies": { "@babel/core": "^7.0.0", - "@emotion/react": "^11.4.1", "@types/memoizee": "^0.4.7", "@types/minimist": "^1.2.2", "@types/node": "^17.0.25", @@ -72,6 +70,7 @@ "properties-parser": "^0.3.1", "react": "18.1.0", "rimraf": "^3.0.2", + "@emotion/react": "^11.10.4", "typescript": "^4.2.3" }, "dependencies": { @@ -88,7 +87,7 @@ "rfc4648": "^1.5.2", "scripting-tools": "^0.19.13", "tsafe": "^1.1.3", - "tss-react": "^4.3.4", + "tss-react": "4.4.1-rc.0", "zod": "^3.17.10" } } diff --git a/renovate.json b/renovate.json index 5d491bee..236da808 100644 --- a/renovate.json +++ b/renovate.json @@ -13,11 +13,11 @@ "packageRules": [ { "packagePatterns": ["*"], - "excludePackagePatterns": ["tss-react", "powerhooks", "tsafe", "evt"], + "excludePackagePatterns": ["powerhooks", "tsafe", "evt"], "enabled": false }, { - "packagePatterns": ["tss-react", "powerhooks", "tsafe", "evt"], + "packagePatterns": ["powerhooks", "tsafe", "evt"], "matchUpdateTypes": ["minor", "patch"], "automerge": true, "automergeType": "branch", diff --git a/src/lib/components/IdpReviewUserProfile.tsx b/src/lib/components/IdpReviewUserProfile.tsx index 6fc5e757..a14cf4b2 100644 --- a/src/lib/components/IdpReviewUserProfile.tsx +++ b/src/lib/components/IdpReviewUserProfile.tsx @@ -3,7 +3,7 @@ import DefaultTemplate from "./Template"; import type { TemplateProps } from "./Template"; import type { KcProps } from "./KcProps"; import type { KcContextBase } from "../getKcContext/KcContextBase"; -import { useCssAndCx } from "../tools/useCssAndCx"; +import { clsx } from "../tools/clsx"; import type { I18n } from "../i18n"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; @@ -17,8 +17,6 @@ export type IdpReviewUserProfileProps = KcProps & { const IdpReviewUserProfile = memo((props: IdpReviewUserProfileProps) => { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template = DefaultTemplate, ...kcProps } = props; - const { cx } = useCssAndCx(); - const { msg, msgStr } = i18n; const { url } = kcContext; @@ -30,16 +28,16 @@ const IdpReviewUserProfile = memo((props: IdpReviewUserProfileProps) => { {...{ kcContext, i18n, doFetchDefaultThemeResources, ...kcProps }} headerNode={msg("loginIdpReviewProfileTitle")} formNode={ -
+ -
-
-
+
+
+
-
+
{ const { msg, msgStr } = i18n; - const { cx } = useCssAndCx(); - const [isLoginButtonDisabled, setIsLoginButtonDisabled] = useState(false); const onSubmit = useConstCallback>(e => { @@ -47,16 +45,16 @@ const Login = memo((props: LoginProps) => { displayWide={realm.password && social.providers !== undefined} headerNode={msg("doLogIn")} formNode={ -
+
{realm.password && ( -
+
{(() => { const label = !realm.loginWithEmailAllowed ? "username" @@ -68,13 +66,13 @@ const Login = memo((props: LoginProps) => { return ( <> -
-
-