|
1 | 1 | """Custom input component.""" |
2 | 2 |
|
3 | | -from typing import Literal |
| 3 | +from typing import ClassVar, Literal |
4 | 4 |
|
5 | 5 | from reflex_components_core.el.elements.forms import Button |
6 | 6 | from reflex_components_core.el.elements.forms import Input as ReflexInput |
|
19 | 19 | "xs": "px-1.5 h-7 rounded-ui-xs gap-1.5", |
20 | 20 | "sm": "px-2 h-8 rounded-ui-sm gap-2", |
21 | 21 | "md": "px-2.5 h-9 rounded-ui-md gap-2", |
22 | | - "lg": "px-3 h-10 rounded-lg gap-2.5", |
| 22 | + "lg": "px-3 h-10 rounded-ui-lg gap-2.5", |
23 | 23 | "xl": "px-3.5 h-12 rounded-ui-xl gap-3", |
24 | 24 | } |
25 | 25 |
|
@@ -80,7 +80,7 @@ class HighLevelInput(InputBaseComponent): |
80 | 80 | icon: Var[str] |
81 | 81 |
|
82 | 82 | # Whether to show the clear button. |
83 | | - show_clear_button: Var[bool] |
| 83 | + show_clear_button: ClassVar[bool] |
84 | 84 |
|
85 | 85 | # Events to fire when the clear button is clicked. |
86 | 86 | clear_events: Var[list[EventHandler]] |
@@ -142,11 +142,12 @@ def create(cls, *children, **props) -> BaseUIComponent: |
142 | 142 | show_clear_button = props.pop("show_clear_button", True) |
143 | 143 | clear_events = props.pop("clear_events", []) |
144 | 144 | # Configure input with merged attributes |
| 145 | + custom_attrs_override = props.pop("custom_attrs", {}) |
145 | 146 | input_props.update({ |
146 | 147 | "id": id, |
147 | 148 | "custom_attrs": { |
148 | 149 | **DEFAULT_INPUT_ATTRS, |
149 | | - **input_props.get("custom_attrs", {}), |
| 150 | + **custom_attrs_override, |
150 | 151 | }, |
151 | 152 | }) |
152 | 153 |
|
|
0 commit comments