Skip to content

Commit 08d9b13

Browse files
committed
update transition for textarea and input
1 parent a3790dd commit 08d9b13

File tree

9 files changed

+17
-62
lines changed

9 files changed

+17
-62
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fail_fast: true
22

33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.12.11
5+
rev: v0.14.0
66
hooks:
77
- id: ruff-check
88
files: ^reflex_ui/
@@ -28,7 +28,7 @@ repos:
2828
# entry: python3 scripts/make_pyi.py
2929

3030
- repo: https://github.com/RobertCraigie/pyright-python
31-
rev: v1.1.405
31+
rev: v1.1.406
3232
hooks:
3333
- id: pyright
3434
files: ^reflex_ui/

demo/demo/demo.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
import reflex as rx
44

55
import reflex_ui as ui
6-
from .simple_icon import simple_icon_demo
6+
77

88
class State(rx.State):
99
seed: int = 0
1010

11+
@rx.event
12+
def set_seed(self, seed: int):
13+
self.seed = seed
14+
1115

1216
def index() -> rx.Component:
1317
return rx.el.div(
14-
# Left: Column of UI components
1518
rx.el.div(
1619
ui.tooltip(
1720
ui.button(
@@ -41,6 +44,9 @@ def index() -> rx.Component:
4144
ui.switch(
4245
on_checked_change=lambda value: rx.toast.success(f"Value: {value}"),
4346
),
47+
ui.textarea(
48+
value="Hello, world!",
49+
),
4450
ui.select(
4551
items=[f"Item {i}" for i in range(1, 11)],
4652
name="select",
@@ -50,17 +56,7 @@ def index() -> rx.Component:
5056
),
5157
class_name="flex flex-col gap-y-6 justify-center items-center",
5258
),
53-
54-
# Right: Icon demo
55-
rx.el.div(
56-
simple_icon_demo(),
57-
class_name="flex justify-center items-center",
58-
),
59-
60-
# Theme switcher (floating top-right)
6159
ui.theme_switcher(class_name="absolute top-4 right-4"),
62-
63-
# Parent container: center everything horizontally & vertically
6460
class_name="flex flex-row gap-16 justify-center items-center h-screen bg-secondary-1 relative",
6561
)
6662

@@ -75,7 +71,7 @@ def index() -> rx.Component:
7571
rx.el.link(
7672
rel="preconnect",
7773
href="https://fonts.gstatic.com",
78-
crossorigin="",
74+
cros_sorigin="",
7975
),
8076
rx.el.link(
8177
href="https://fonts.googleapis.com/css2?family=Instrument+Sans:[email protected]&display=swap",

demo/demo/simple_icon.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bump = true
2020
metadata = false
2121

2222
[dependency-groups]
23-
dev = ["pyright==1.1.405", "pre-commit"]
23+
dev = ["pyright", "pre-commit"]
2424

2525
[tool.codespell]
2626
skip = "*.pyi, uv.lock"

reflex_ui/components/base/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ClassNames:
3535
"""Class names for input components."""
3636

3737
INPUT = "outline-none bg-transparent text-secondary-12 placeholder:text-secondary-9 text-sm leading-normal peer disabled:text-secondary-8 disabled:placeholder:text-secondary-8 w-full data-[disabled]:pointer-events-none font-medium"
38-
DIV = "flex flex-row items-center focus-within:shadow-[0px_0px_0px_2px_var(--primary-4)] focus-within:border-primary-a6 not-data-[invalid]:focus-within:hover:border-primary-a6 bg-secondary-1 shrink-0 border border-secondary-a4 hover:border-secondary-a6 transition-all text-secondary-9 [&_svg]:pointer-events-none has-data-[disabled]:border-secondary-4 has-data-[disabled]:bg-secondary-3 has-data-[disabled]:text-secondary-8 has-data-[disabled]:cursor-not-allowed cursor-text has-data-[invalid]:border-destructive-10 has-data-[invalid]:focus-within:border-destructive-a11 has-data-[invalid]:focus-within:shadow-[0px_0px_0px_2px_var(--destructive-4)] has-data-[invalid]:hover:border-destructive-a11"
38+
DIV = "flex flex-row items-center focus-within:shadow-[0px_0px_0px_2px_var(--primary-4)] focus-within:border-primary-a6 not-data-[invalid]:focus-within:hover:border-primary-a6 bg-secondary-1 shrink-0 border border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] text-secondary-9 [&_svg]:pointer-events-none has-data-[disabled]:border-secondary-4 has-data-[disabled]:bg-secondary-3 has-data-[disabled]:text-secondary-8 has-data-[disabled]:cursor-not-allowed cursor-text has-data-[invalid]:border-destructive-10 has-data-[invalid]:focus-within:border-destructive-a11 has-data-[invalid]:focus-within:shadow-[0px_0px_0px_2px_var(--destructive-4)] has-data-[invalid]:hover:border-destructive-a11"
3939

4040

4141
class InputBaseComponent(BaseUIComponent):

reflex_ui/components/base/input.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ DEFAULT_INPUT_ATTRS = {
3131

3232
class ClassNames:
3333
INPUT = "outline-none bg-transparent text-secondary-12 placeholder:text-secondary-9 text-sm leading-normal peer disabled:text-secondary-8 disabled:placeholder:text-secondary-8 w-full data-[disabled]:pointer-events-none font-medium"
34-
DIV = "flex flex-row items-center focus-within:shadow-[0px_0px_0px_2px_var(--primary-4)] focus-within:border-primary-a6 not-data-[invalid]:focus-within:hover:border-primary-a6 bg-secondary-1 shrink-0 border border-secondary-a4 hover:border-secondary-a6 transition-all text-secondary-9 [&_svg]:pointer-events-none has-data-[disabled]:border-secondary-4 has-data-[disabled]:bg-secondary-3 has-data-[disabled]:text-secondary-8 has-data-[disabled]:cursor-not-allowed cursor-text has-data-[invalid]:border-destructive-10 has-data-[invalid]:focus-within:border-destructive-a11 has-data-[invalid]:focus-within:shadow-[0px_0px_0px_2px_var(--destructive-4)] has-data-[invalid]:hover:border-destructive-a11"
34+
DIV = "flex flex-row items-center focus-within:shadow-[0px_0px_0px_2px_var(--primary-4)] focus-within:border-primary-a6 not-data-[invalid]:focus-within:hover:border-primary-a6 bg-secondary-1 shrink-0 border border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] text-secondary-9 [&_svg]:pointer-events-none has-data-[disabled]:border-secondary-4 has-data-[disabled]:bg-secondary-3 has-data-[disabled]:text-secondary-8 has-data-[disabled]:cursor-not-allowed cursor-text has-data-[invalid]:border-destructive-10 has-data-[invalid]:focus-within:border-destructive-a11 has-data-[invalid]:focus-within:shadow-[0px_0px_0px_2px_var(--destructive-4)] has-data-[invalid]:hover:border-destructive-a11"
3535

3636
class InputBaseComponent(BaseUIComponent):
3737
@property

reflex_ui/components/base/textarea.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class ClassNames:
1010
"""Class names for textarea components."""
1111

12-
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-all disabled:border-secondary-4 disabled:bg-secondary-3 disabled:text-secondary-8 disabled:cursor-not-allowed cursor-text min-h-24 rounded-ui-md text-secondary-12 placeholder:text-secondary-9 text-sm disabled:placeholder:text-secondary-8 w-full outline-none max-h-[15rem] resize-none overflow-y-auto px-3 py-2.5 font-medium"
12+
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] disabled:border-secondary-4 disabled:bg-secondary-3 disabled:text-secondary-8 disabled:cursor-not-allowed cursor-text min-h-24 rounded-ui-md text-secondary-12 placeholder:text-secondary-9 text-sm disabled:placeholder:text-secondary-8 w-full outline-none max-h-[15rem] resize-none overflow-y-auto px-3 py-2.5 font-medium"
1313

1414

1515
class Textarea(TextareaComponent, CoreComponent):

reflex_ui/components/base/textarea.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ from reflex.vars.base import Var
1414
from reflex_ui.components.component import CoreComponent
1515

1616
class ClassNames:
17-
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-all disabled:border-secondary-4 disabled:bg-secondary-3 disabled:text-secondary-8 disabled:cursor-not-allowed cursor-text min-h-24 rounded-ui-md text-secondary-12 placeholder:text-secondary-9 text-sm disabled:placeholder:text-secondary-8 w-full outline-none max-h-[15rem] resize-none overflow-y-auto px-3 py-2.5 font-medium"
17+
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] disabled:border-secondary-4 disabled:bg-secondary-3 disabled:text-secondary-8 disabled:cursor-not-allowed cursor-text min-h-24 rounded-ui-md text-secondary-12 placeholder:text-secondary-9 text-sm disabled:placeholder:text-secondary-8 w-full outline-none max-h-[15rem] resize-none overflow-y-auto px-3 py-2.5 font-medium"
1818

1919
class Textarea(TextareaComponent, CoreComponent):
2020
@classmethod

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)