diff --git a/pyi_hashes.json b/pyi_hashes.json index 01909ad7234..47f3f100ddd 100644 --- a/pyi_hashes.json +++ b/pyi_hashes.json @@ -47,7 +47,7 @@ "reflex/components/radix/primitives/__init__.pyi": "68fcf93acb9a40d94561d375a3a5fdb1", "reflex/components/radix/primitives/accordion.pyi": "9192299dac04a5172edd7b2f6b125f53", "reflex/components/radix/primitives/base.pyi": "336f5e26669a809454bb343e698ab563", - "reflex/components/radix/primitives/drawer.pyi": "5c04c3598100aa4d562c242fabf7e404", + "reflex/components/radix/primitives/drawer.pyi": "c6ad2f60217fe25952f3a1ba88fbd72a", "reflex/components/radix/primitives/form.pyi": "8a5ec180a50acdc35dfe53e4e65c20e0", "reflex/components/radix/primitives/progress.pyi": "b26c99c1d827c0f599fff344746aeec3", "reflex/components/radix/primitives/slider.pyi": "c03b716ffbbc3e1a0c766951de04e83b", diff --git a/reflex/components/radix/primitives/drawer.py b/reflex/components/radix/primitives/drawer.py index d72649e79b0..0087686aa47 100644 --- a/reflex/components/radix/primitives/drawer.py +++ b/reflex/components/radix/primitives/drawer.py @@ -124,13 +124,13 @@ class DrawerContent(DrawerComponent): alias = "Vaul" + tag # Style set partially based on the source code at https://ui.shadcn.com/docs/components/drawer - def _get_style(self) -> dict: + def add_style(self) -> dict: """Get the style for the component. Returns: The dictionary of the component style as value and the style notation as key. """ - base_style = { + return { "left": "0", "right": "0", "bottom": "0", @@ -139,9 +139,6 @@ def _get_style(self) -> dict: "z_index": 50, "display": "flex", } - style = self.style or {} - base_style.update(style) - return {"css": base_style} # Fired when the drawer content is opened. on_open_auto_focus: EventHandler[no_args_event_spec] @@ -186,13 +183,13 @@ class DrawerOverlay(DrawerComponent): alias = "Vaul" + tag # Style set based on the source code at https://ui.shadcn.com/docs/components/drawer - def _get_style(self) -> dict: + def add_style(self) -> dict: """Get the style for the component. Returns: The dictionary of the component style as value and the style notation as key. """ - base_style = { + return { "position": "fixed", "left": "0", "right": "0", @@ -201,9 +198,6 @@ def _get_style(self) -> dict: "z_index": 50, "background": "rgba(0, 0, 0, 0.5)", } - style = self.style or {} - base_style.update(style) - return {"css": base_style} class DrawerClose(DrawerTrigger): @@ -222,21 +216,18 @@ class DrawerTitle(DrawerComponent): alias = "Vaul" + tag # Style set based on the source code at https://ui.shadcn.com/docs/components/drawer - def _get_style(self) -> dict: + def add_style(self) -> dict: """Get the style for the component. Returns: The dictionary of the component style as value and the style notation as key. """ - base_style = { + return { "font-size": "1.125rem", "font-weight": "600", - "line-weight": "1", + "line-height": "1", "letter-spacing": "-0.05em", } - style = self.style or {} - base_style.update(style) - return {"css": base_style} class DrawerDescription(DrawerComponent): @@ -247,18 +238,15 @@ class DrawerDescription(DrawerComponent): alias = "Vaul" + tag # Style set based on the source code at https://ui.shadcn.com/docs/components/drawer - def _get_style(self) -> dict: + def add_style(self) -> dict: """Get the style for the component. Returns: The dictionary of the component style as value and the style notation as key. """ - base_style = { + return { "font-size": "0.875rem", } - style = self.style or {} - base_style.update(style) - return {"css": base_style} class DrawerHandle(DrawerComponent):