From 593ec2342fafded2a17afdb298d8618d3be2d0b1 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Tue, 12 Nov 2024 12:44:59 -0800 Subject: [PATCH] Temporarily downpin @radix-ui/themes <3.1.5 (#4370) * Temporarily downpin @radix-ui/themes <3.1.5 A visual/style regression was introduced in @radix-ui/themes 3.1.5 as described in radix-ui/themes#627 which reflex needs to avoid. * Get expected radix library version from component --- reflex/components/radix/themes/base.py | 3 +++ tests/units/components/core/test_banner.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 7a0fc809f2..65a9ae8357 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -112,6 +112,9 @@ class RadixThemesComponent(Component): library = "@radix-ui/themes@^3.0.0" + # Temporary pin < 3.1.5 until radix-ui/themes#627 is resolved. + library = library + " && <3.1.5" + # "Fake" prop color_scheme is used to avoid shadowing CSS prop "color". _rename_props: Dict[str, str] = {"colorScheme": "color"} diff --git a/tests/units/components/core/test_banner.py b/tests/units/components/core/test_banner.py index 7add913eab..fe6de5eae1 100644 --- a/tests/units/components/core/test_banner.py +++ b/tests/units/components/core/test_banner.py @@ -4,6 +4,7 @@ ConnectionPulser, WebsocketTargetURL, ) +from reflex.components.radix.themes.base import RadixThemesComponent from reflex.components.radix.themes.typography.text import Text @@ -24,7 +25,7 @@ def test_connection_banner(): "react", "$/utils/context", "$/utils/state", - "@radix-ui/themes@^3.0.0", + RadixThemesComponent().library or "", "$/env.json", ) ) @@ -42,7 +43,7 @@ def test_connection_modal(): "react", "$/utils/context", "$/utils/state", - "@radix-ui/themes@^3.0.0", + RadixThemesComponent().library or "", "$/env.json", ) )