Skip to content

Commit 774bcb9

Browse files
committed
bump components
1 parent e5792b4 commit 774bcb9

File tree

11 files changed

+112
-50
lines changed

11 files changed

+112
-50
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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.14.11
5+
rev: v0.14.13
66
hooks:
77
- id: ruff-check
88
files: ^reflex_ui/

demo/demo/demo.py

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import reflex as rx
44

55
import reflex_ui as ui
6-
from reflex_ui.blocks.demo_form import demo_form_dialog
7-
from reflex_ui.blocks.telemetry.default import get_default_telemetry_script
86

97

108
class State(rx.State):
@@ -17,7 +15,46 @@ def set_seed(self, seed: int):
1715

1816
def index() -> rx.Component:
1917
return rx.el.div(
20-
demo_form_dialog(ui.button("Test")),
18+
rx.el.div(
19+
ui.tooltip(
20+
ui.button(
21+
ui.icon("SmileIcon"),
22+
"Click me",
23+
on_click=rx.toast.success(
24+
"You are cool :)",
25+
position="top-center",
26+
),
27+
),
28+
content="Seriously, click me",
29+
),
30+
ui.checkbox(
31+
label="Click me",
32+
on_checked_change=lambda value: rx.toast.success(f"Value: {value}"),
33+
),
34+
ui.slider(
35+
value=State.seed,
36+
on_value_change=State.set_seed,
37+
on_value_committed=lambda value: rx.toast.success(f"Value: {value}"),
38+
class_name="max-w-xs",
39+
),
40+
ui.gradient_profile(
41+
seed=State.seed,
42+
class_name="size-10",
43+
),
44+
ui.switch(
45+
on_checked_change=lambda value: rx.toast.success(f"Value: {value}"),
46+
),
47+
ui.select(
48+
items=[f"Item {i}" for i in range(1, 11)],
49+
name="select",
50+
placeholder="Hello",
51+
on_value_change=lambda value: rx.toast.success(f"Value: {value}"),
52+
on_open_change=lambda value: rx.toast.success(f"Open: {value}"),
53+
),
54+
class_name="flex flex-col gap-y-6 justify-center items-center",
55+
),
56+
ui.theme_switcher(class_name="absolute top-4 right-4"),
57+
class_name="flex flex-row gap-16 justify-center items-center h-screen bg-secondary-1 relative font-sans",
2158
)
2259

2360

@@ -41,7 +78,6 @@ def index() -> rx.Component:
4178
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400..700&display=swap",
4279
rel="stylesheet",
4380
),
44-
get_default_telemetry_script(),
4581
],
4682
)
4783
app.add_page(index)

demo/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
reflex==0.8.25
1+
reflex==0.8.26

reflex_ui/components/base/select.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ class SelectValue(SelectBaseComponent):
160160

161161
tag = "Select.Value"
162162

163+
# Placeholder text to display when no item is selected.
164+
placeholder: Var[str]
165+
163166
# The render prop
164167
render_: Var[Component]
165168

@@ -467,7 +470,8 @@ class HighLevelSelect(SelectRoot):
467470
size: Var[LiteralSelectSize]
468471

469472
# Props for different component parts
470-
_trigger_props = {"placeholder", "size"}
473+
_trigger_props = {"size"}
474+
_value_props = {"placeholder"}
471475
_items_props = {"items"}
472476
_positioner_props = {
473477
"align",
@@ -497,6 +501,7 @@ def create(cls, *children, **props) -> BaseUIComponent:
497501
"""
498502
# Extract props for different parts
499503
trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()}
504+
value_props = {k: props.pop(k) for k in cls._value_props & props.keys()}
500505
items_props = {k: props.pop(k) for k in cls._items_props & props.keys()}
501506
positioner_props = {
502507
k: props.pop(k) for k in cls._positioner_props & props.keys()
@@ -555,7 +560,7 @@ def create(cls, *children, **props) -> BaseUIComponent:
555560
return SelectRoot.create(
556561
SelectTrigger.create(
557562
render_=button(
558-
SelectValue.create(),
563+
SelectValue.create(**value_props),
559564
SelectIcon.create(
560565
select_arrow(class_name="size-4 text-secondary-9")
561566
),

reflex_ui/components/base/select.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class SelectValue(SelectBaseComponent):
187187
def create(
188188
cls,
189189
*children,
190+
placeholder: Var[str] | str | None = None,
190191
render_: Component | Var[Component] | None = None,
191192
unstyled: Var[bool] | bool | None = None,
192193
style: Sequence[Mapping[str, Any]]

reflex_ui/components/base/switch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class SwitchRoot(SwitchBaseComponent):
3434
# Identifies the field when a form is submitted.
3535
name: Var[str]
3636

37+
# The value of the switch when it is checked. Used for form submission. Defaults to 'on'.
38+
value: Var[str]
39+
3740
# Whether the switch is initially active. To render a controlled switch, use the checked prop instead. Defaults to False.
3841
default_checked: Var[bool]
3942

reflex_ui/components/base/switch.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class SwitchRoot(SwitchBaseComponent):
7676
cls,
7777
*children,
7878
name: Var[str] | str | None = None,
79+
value: Var[str] | str | None = None,
7980
default_checked: Var[bool] | bool | None = None,
8081
checked: Var[bool] | bool | None = None,
8182
native_button: Var[bool] | bool | None = None,
@@ -160,6 +161,7 @@ class HighLevelSwitch(SwitchRoot):
160161
cls,
161162
*children,
162163
name: Var[str] | str | None = None,
164+
value: Var[str] | str | None = None,
163165
default_checked: Var[bool] | bool | None = None,
164166
checked: Var[bool] | bool | None = None,
165167
native_button: Var[bool] | bool | None = None,
@@ -204,6 +206,7 @@ class HighLevelSwitch(SwitchRoot):
204206
Args:
205207
*children: Additional children to include in the switch.
206208
name: Identifies the field when a form is submitted.
209+
value: The value of the switch when it is checked. Used for form submission. Defaults to 'on'.
207210
default_checked: Whether the switch is initially active. To render a controlled switch, use the checked prop instead. Defaults to False.
208211
checked: Whether the switch is currently active. To render an uncontrolled switch, use the default_checked prop instead.
209212
on_checked_change: Event handler called when the switch is activated or deactivated.
@@ -236,6 +239,7 @@ class Switch(ComponentNamespace):
236239
def __call__(
237240
*children,
238241
name: Var[str] | str | None = None,
242+
value: Var[str] | str | None = None,
239243
default_checked: Var[bool] | bool | None = None,
240244
checked: Var[bool] | bool | None = None,
241245
native_button: Var[bool] | bool | None = None,
@@ -280,6 +284,7 @@ class Switch(ComponentNamespace):
280284
Args:
281285
*children: Additional children to include in the switch.
282286
name: Identifies the field when a form is submitted.
287+
value: The value of the switch when it is checked. Used for form submission. Defaults to 'on'.
283288
default_checked: Whether the switch is initially active. To render a controlled switch, use the checked prop instead. Defaults to False.
284289
checked: Whether the switch is currently active. To render an uncontrolled switch, use the default_checked prop instead.
285290
on_checked_change: Event handler called when the switch is activated or deactivated.

reflex_ui/components/base_ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from reflex_ui.components.component import CoreComponent
66

77
PACKAGE_NAME = "@base-ui/react"
8-
PACKAGE_VERSION = "1.0.0"
8+
PACKAGE_VERSION = "1.1.0"
99

1010

1111
class BaseUIComponent(CoreComponent):

reflex_ui/components/base_ui.pyi

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

1515
PACKAGE_NAME = "@base-ui/react"
16-
PACKAGE_VERSION = "1.0.0"
16+
PACKAGE_VERSION = "1.1.0"
1717

1818
class BaseUIComponent(CoreComponent):
1919
@classmethod

reflex_ui/components/icons/hugeicon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class HugeIcon(CoreComponent):
1111
"""A HugeIcon component."""
1212

13-
library = "@hugeicons/react@1.1.3"
13+
library = "@hugeicons/react@1.1.4"
1414

1515
tag = "HugeiconsIcon"
1616

@@ -51,7 +51,7 @@ def create(cls, *children, **props) -> Component:
5151
icon_name,
5252
_var_data=VarData(
5353
imports={
54-
"@hugeicons/core-free-icons@3.1.0": ImportVar(tag=icon_name)
54+
"@hugeicons/core-free-icons@3.1.1": ImportVar(tag=icon_name)
5555
}
5656
),
5757
)

0 commit comments

Comments
 (0)