Skip to content

Commit f537d6a

Browse files
committed
update to base ui 1.2.0
1 parent ec13bec commit f537d6a

File tree

11 files changed

+95
-3
lines changed

11 files changed

+95
-3
lines changed

reflex_ui/components/base/checkbox.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ class CheckboxIndicator(CheckboxBaseComponent):
8585

8686
tag = "Checkbox.Indicator"
8787

88+
# Whether to keep the HTML element in the DOM when the checkbox is unchecked.
89+
# When False, allows exit animations on the indicator. Defaults to True.
90+
keep_mounted: Var[bool]
91+
8892
@classmethod
8993
def create(cls, *children, **props) -> BaseUIComponent:
9094
"""Create the checkbox indicator component."""

reflex_ui/components/base/checkbox.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class CheckboxIndicator(CheckboxBaseComponent):
128128
def create(
129129
cls,
130130
*children,
131+
keep_mounted: Var[bool] | bool | None = None,
131132
unstyled: Var[bool] | bool | None = None,
132133
style: Sequence[Mapping[str, Any]]
133134
| Mapping[str, Any]

reflex_ui/components/base/menu.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,34 @@ def create(cls, *children, **props) -> BaseUIComponent:
270270
return super().create(*children, **props)
271271

272272

273+
class MenuLinkItem(MenuBaseComponent):
274+
"""A menu item that renders as a link. Renders an <a> element."""
275+
276+
tag = "Menu.LinkItem"
277+
278+
# Overrides the text label to use when the item is matched during keyboard text navigation.
279+
label: Var[str]
280+
281+
# The URL the link points to.
282+
href: Var[str]
283+
284+
# Whether to close the menu when the item is clicked. Defaults to True.
285+
close_on_click: Var[bool]
286+
287+
# Whether the component should ignore user interaction. Defaults to False.
288+
disabled: Var[bool]
289+
290+
# The render prop.
291+
render_: Var[Component]
292+
293+
@classmethod
294+
def create(cls, *children, **props) -> BaseUIComponent:
295+
"""Create the menu link item component."""
296+
props["data-slot"] = "menu-link-item"
297+
cls.set_class_name(ClassNames.ITEM, props)
298+
return super().create(*children, **props)
299+
300+
273301
class MenuSubMenuRoot(MenuBaseComponent):
274302
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
275303

@@ -664,6 +692,7 @@ class Menu(ComponentNamespace):
664692
popup = staticmethod(MenuPopup.create)
665693
arrow = staticmethod(MenuArrow.create)
666694
item = staticmethod(MenuItem.create)
695+
link_item = staticmethod(MenuLinkItem.create)
667696
separator = staticmethod(MenuSeparator.create)
668697
group = staticmethod(MenuGroup.create)
669698
group_label = staticmethod(MenuGroupLabel.create)

reflex_ui/components/base/menu.pyi

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,47 @@ class MenuItem(MenuBaseComponent):
407407
) -> MenuItem:
408408
"""Create the menu item component."""
409409

410+
class MenuLinkItem(MenuBaseComponent):
411+
@classmethod
412+
def create(
413+
cls,
414+
*children,
415+
label: Var[str] | str | None = None,
416+
href: Var[str] | str | None = None,
417+
close_on_click: Var[bool] | bool | None = None,
418+
disabled: Var[bool] | bool | None = None,
419+
render_: Component | Var[Component] | None = None,
420+
unstyled: Var[bool] | bool | None = None,
421+
style: Sequence[Mapping[str, Any]]
422+
| Mapping[str, Any]
423+
| Var[Mapping[str, Any]]
424+
| Breakpoints
425+
| None = None,
426+
key: Any | None = None,
427+
id: Any | None = None,
428+
ref: Var | None = None,
429+
class_name: Any | None = None,
430+
custom_attrs: dict[str, Var | Any] | None = None,
431+
on_blur: EventType[()] | None = None,
432+
on_click: EventType[()] | EventType[PointerEventInfo] | None = None,
433+
on_context_menu: EventType[()] | EventType[PointerEventInfo] | None = None,
434+
on_double_click: EventType[()] | EventType[PointerEventInfo] | None = None,
435+
on_focus: EventType[()] | None = None,
436+
on_mount: EventType[()] | None = None,
437+
on_mouse_down: EventType[()] | None = None,
438+
on_mouse_enter: EventType[()] | None = None,
439+
on_mouse_leave: EventType[()] | None = None,
440+
on_mouse_move: EventType[()] | None = None,
441+
on_mouse_out: EventType[()] | None = None,
442+
on_mouse_over: EventType[()] | None = None,
443+
on_mouse_up: EventType[()] | None = None,
444+
on_scroll: EventType[()] | None = None,
445+
on_scroll_end: EventType[()] | None = None,
446+
on_unmount: EventType[()] | None = None,
447+
**props,
448+
) -> MenuLinkItem:
449+
"""Create the menu link item component."""
450+
410451
class MenuSubMenuRoot(MenuBaseComponent):
411452
@classmethod
412453
def create(
@@ -918,6 +959,7 @@ class Menu(ComponentNamespace):
918959
popup = staticmethod(MenuPopup.create)
919960
arrow = staticmethod(MenuArrow.create)
920961
item = staticmethod(MenuItem.create)
962+
link_item = staticmethod(MenuLinkItem.create)
921963
separator = staticmethod(MenuSeparator.create)
922964
group = staticmethod(MenuGroup.create)
923965
group_label = staticmethod(MenuGroupLabel.create)

reflex_ui/components/base/navigation_menu.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ class NavigationMenuContent(NavigationMenuBaseComponent):
140140

141141
tag = "NavigationMenu.Content"
142142

143+
# Whether to keep the HTML element in the DOM while the content is hidden. Defaults to False.
144+
keep_mounted: Var[bool]
145+
143146
# The render prop.
144147
render_: Var[Component]
145148

reflex_ui/components/base/navigation_menu.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ class NavigationMenuContent(NavigationMenuBaseComponent):
254254
def create(
255255
cls,
256256
*children,
257+
keep_mounted: Var[bool] | bool | None = None,
257258
render_: Component | Var[Component] | None = None,
258259
unstyled: Var[bool] | bool | None = None,
259260
style: Sequence[Mapping[str, Any]]

reflex_ui/components/base/select.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ class SelectRoot(SelectBaseComponent):
125125
# A ref to access the hidden input element.
126126
input_ref: Var[Any]
127127

128+
# Enables explicit browser autofill support. Useful for select components that are part of a form.
129+
auto_complete: Var[str]
130+
128131
@classmethod
129132
def create(cls, *children, **props) -> BaseUIComponent:
130133
"""Create the select root component."""
@@ -250,6 +253,9 @@ class SelectPopup(SelectBaseComponent):
250253

251254
tag = "Select.Popup"
252255

256+
# Determines the element to focus when the select popup is closed. By default, focus returns to the trigger.
257+
final_focus: Var[str]
258+
253259
# The render prop
254260
render_: Var[Component]
255261

reflex_ui/components/base/select.pyi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class SelectRoot(SelectBaseComponent):
109109
read_only: Var[bool] | bool | None = None,
110110
required: Var[bool] | bool | None = None,
111111
input_ref: Any | Var[Any] | None = None,
112+
auto_complete: Var[str] | str | None = None,
112113
unstyled: Var[bool] | bool | None = None,
113114
style: Sequence[Mapping[str, Any]]
114115
| Mapping[str, Any]
@@ -385,6 +386,7 @@ class SelectPopup(SelectBaseComponent):
385386
def create(
386387
cls,
387388
*children,
389+
final_focus: Var[str] | str | None = None,
388390
render_: Component | Var[Component] | None = None,
389391
unstyled: Var[bool] | bool | None = None,
390392
style: Sequence[Mapping[str, Any]]
@@ -858,6 +860,7 @@ class HighLevelSelect(SelectRoot):
858860
read_only: Var[bool] | bool | None = None,
859861
required: Var[bool] | bool | None = None,
860862
input_ref: Any | Var[Any] | None = None,
863+
auto_complete: Var[str] | str | None = None,
861864
unstyled: Var[bool] | bool | None = None,
862865
style: Sequence[Mapping[str, Any]]
863866
| Mapping[str, Any]
@@ -915,6 +918,7 @@ class HighLevelSelect(SelectRoot):
915918
read_only: Whether the user should be unable to choose a different option from the select popup. Defaults to False.
916919
required: Whether the user must choose a value before submitting a form. Defaults to False.
917920
input_ref: A ref to access the hidden input element.
921+
auto_complete: Enables explicit browser autofill support. Useful for select components that are part of a form.
918922
unstyled: Whether the component should be unstyled
919923
style: The style of the component.
920924
key: A unique key for the component.
@@ -972,6 +976,7 @@ class Select(ComponentNamespace):
972976
read_only: Var[bool] | bool | None = None,
973977
required: Var[bool] | bool | None = None,
974978
input_ref: Any | Var[Any] | None = None,
979+
auto_complete: Var[str] | str | None = None,
975980
unstyled: Var[bool] | bool | None = None,
976981
style: Sequence[Mapping[str, Any]]
977982
| Mapping[str, Any]
@@ -1029,6 +1034,7 @@ class Select(ComponentNamespace):
10291034
read_only: Whether the user should be unable to choose a different option from the select popup. Defaults to False.
10301035
required: Whether the user must choose a value before submitting a form. Defaults to False.
10311036
input_ref: A ref to access the hidden input element.
1037+
auto_complete: Enables explicit browser autofill support. Useful for select components that are part of a form.
10321038
unstyled: Whether the component should be unstyled
10331039
style: The style of the component.
10341040
key: A unique key for the component.

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.1.0"
8+
PACKAGE_VERSION = "1.2.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.1.0"
16+
PACKAGE_VERSION = "1.2.0"
1717

1818
class BaseUIComponent(CoreComponent):
1919
@classmethod

0 commit comments

Comments
 (0)