instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
return super().create(*children, **props)
class DrawerHandle(DrawerBaseComponent):
"""An optional handle to drag the drawer."""
tag = "Drawer.Handle"
alias = "Vaul" + tag
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the drawer handle component."""
props["data-slot"] = "drawer-handle"
cls.set_class_name(ClassNames.HANDLE, props)
return super().create(*children, **props)
class HighLevelDrawer(DrawerRoot):
"""High level wrapper for the Drawer component."""
# Drawer props
trigger: Var[Component | None]
content: Var[str | Component | None]
title: Var[str | Component | None]
description: Var[str | Component | None]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the high level drawer component."""
trigger = props.pop("trigger", None)
content = props.pop("content", None)
title = props.pop("title", None)
|
return super().create(
DrawerTrigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create) | description = props.pop("description", None) |
Component | None]
description: Var[str | Component | None]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the high level drawer component."""
trigger = props.pop("trigger", None)
content = props.pop("content", None)
title = props.pop("title", None)
description = props.pop("description", None)
return super().create(
DrawerTrigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
|
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
] |
ger = props.pop("trigger", None)
content = props.pop("content", None)
title = props.pop("title", None)
description = props.pop("description", None)
return super().create(
DrawerTrigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
|
drawer = Drawer()
| class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create) |
title = props.pop("title", None)
description = props.pop("description", None)
return super().create(
DrawerTrigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
|
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| root = staticmethod(DrawerRoot.create) |
description = props.pop("description", None)
return super().create(
DrawerTrigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
|
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| trigger = staticmethod(DrawerTrigger.create) |
return super().create(
DrawerTrigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
|
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| portal = staticmethod(DrawerPortal.create) |
rigger.create(render_=trigger) if trigger is not None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
|
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| content = staticmethod(DrawerContent.create) |
None else None,
DrawerPortal.create(
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
|
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| overlay = staticmethod(DrawerOverlay.create) |
DrawerOverlay.create(),
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
|
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| close = staticmethod(DrawerClose.create) |
DrawerContent.create(
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
|
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| title = staticmethod(DrawerTitle.create) |
DrawerTitle.create(title) if title is not None else None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
|
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| description = staticmethod(DrawerDescription.create) |
se None,
(
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
|
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| handle = staticmethod(DrawerHandle.create) |
DrawerDescription.create(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
|
__call__ = staticmethod(HighLevelDrawer.create)
drawer = Drawer()
| class_names = ClassNames |
ate(description)
if description is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
|
drawer = Drawer()
| __call__ = staticmethod(HighLevelDrawer.create) |
ption is not None
else None
),
content,
*children,
),
),
**props,
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"trigger",
"content",
"title",
"description",
]
class Drawer(ComponentNamespace):
"""A namespace for Drawer components."""
root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create)
portal = staticmethod(DrawerPortal.create)
content = staticmethod(DrawerContent.create)
overlay = staticmethod(DrawerOverlay.create)
close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelDrawer.create)
| drawer = Drawer() | |
"""Gradient profile component."""
|
from reflex.vars.base import Var
from reflex_ui.components.component import CoreComponent
DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full"
class GradientProfile(CoreComponent):
"""Gradient profile component."""
library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile"
tag = "GradientProfile"
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
gradient_profile = GradientProfile.create
| from reflex.components.component import Component |
"""Gradient profile component."""
from reflex.components.component import Component
|
from reflex_ui.components.component import CoreComponent
DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full"
class GradientProfile(CoreComponent):
"""Gradient profile component."""
library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile"
tag = "GradientProfile"
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
gradient_profile = GradientProfile.create
| from reflex.vars.base import Var |
"""Gradient profile component."""
from reflex.components.component import Component
from reflex.vars.base import Var
|
DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full"
class GradientProfile(CoreComponent):
"""Gradient profile component."""
library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile"
tag = "GradientProfile"
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
gradient_profile = GradientProfile.create
| from reflex_ui.components.component import CoreComponent |
"""Gradient profile component."""
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.components.component import CoreComponent
|
class GradientProfile(CoreComponent):
"""Gradient profile component."""
library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile"
tag = "GradientProfile"
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
gradient_profile = GradientProfile.create
| DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full" |
"""Gradient profile component."""
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.components.component import CoreComponent
DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full"
class GradientProfile(CoreComponent):
"""Gradient profile component."""
|
tag = "GradientProfile"
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
gradient_profile = GradientProfile.create
| library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile" |
"""Gradient profile component."""
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.components.component import CoreComponent
DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full"
class GradientProfile(CoreComponent):
"""Gradient profile component."""
library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile"
|
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
gradient_profile = GradientProfile.create
| tag = "GradientProfile" |
"""Gradient profile component."""
from reflex.components.component import Component
from reflex.vars.base import Var
from reflex_ui.components.component import CoreComponent
DEFAULT_CLASS_NAME = "size-4 pointer-events-none rounded-full"
class GradientProfile(CoreComponent):
"""Gradient profile component."""
library = "@carlosabadia/gradient-profile@github:carlosabadia/gradient-profile"
tag = "GradientProfile"
# Seed to generate gradient for
seed: Var[str | int]
# Available colors
available_colors: Var[list[str]]
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the gradient profile component."""
cls.set_class_name(DEFAULT_CLASS_NAME, props)
return super().create(*children, **props)
| gradient_profile = GradientProfile.create | |
"""Custom input component."""
|
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class | from typing import Literal |
"""Custom input component."""
from typing import Literal
|
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
INPUT = "outline-none bg-transpare | from reflex.components.component import Component, ComponentNamespace |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
|
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
INPUT = "outline-none bg-transparent text-secondary-12 placeholder:text-secondary-9 t | from reflex.components.el import Button, Div, Span |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
|
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
INPUT = "outline-none bg-transparent text-secondary-12 placeholder:text-secondary-9 text-sm leading-normal peer disabled:text-secondary-8 d | from reflex.components.el import Input as ReflexInput |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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 | from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
|
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
DIV = "flex flex-row items-cen | from reflex.utils.imports import ImportVar |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
|
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
DIV = "flex flex-row items-center focus-within:shadow-[0px_0px_0px_2px_var(--primary-4)] | from reflex.vars.base import Var, get_unique_variable_name |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
|
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
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:bor | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
|
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
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 borde | from reflex_ui.components.icons.hugeicon import hi |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
|
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
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-a | from reflex_ui.utils.twmerge import cn |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
|
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
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-dat | INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
} |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
|
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
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"
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-w | LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"] |
"""Custom input component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
|
class ClassNames:
"""Class names for input components."""
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"
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:borde | DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
} |
port Component, ComponentNamespace
from reflex.components.el import Button, Div, Span
from reflex.components.el import Input as ReflexInput
from reflex.event import EventHandler, passthrough_event_spec, set_focus, set_value
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var, get_unique_variable_name
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
INPUT_SIZE_VARIANTS = {
"xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
"sm": "px-2 h-8 rounded-ui-sm gap-2",
"md": "px-2.5 h-9 rounded-ui-md gap-2",
"lg": "px-3 h-10 rounded-lg gap-2.5",
"xl": "px-3.5 h-12 rounded-ui-xl gap-3",
}
LiteralControlSize = Literal["xs", "sm", "md", "lg", "xl"]
DEFAULT_INPUT_ATTRS = {
"autoComplete": "off",
"autoCapitalize": "none",
"autoCorrect": "off",
"spellCheck": "false",
}
class ClassNames:
"""Class names for input components."""
|
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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path=" | 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" |
"""Class names for input components."""
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"
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"
|
class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
tag = "Input"
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
props["data-slot"] = "input"
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props)
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button.
show_clear_button: Var[bool]
# Events to fire when the clear button is clicked.
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_val | class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False) |
ext-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"
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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
|
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False)
class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
tag = "Input"
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
props["data-slot"] = "input"
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props)
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button. | library = f"{PACKAGE_NAME}/input" |
leading-normal peer disabled:text-secondary-8 disabled:placeholder:text-secondary-8 w-full data-[disabled]:pointer-events-none font-medium"
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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
|
class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
tag = "Input"
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
props["data-slot"] = "input"
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props)
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button.
show_clear_button: Var[bool]
# Events to fire when the clear button is clicked.
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_val | def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False) |
x-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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False)
|
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button.
show_clear_button: Var[bool]
# Events to fire when the clear button is clicked.
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_value",
"on_value_change",
"accept",
"alt",
"auto_complete",
"auto_focus",
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
" | class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
tag = "Input"
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
props["data-slot"] = "input"
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props) |
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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False)
class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
|
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
props["data-slot"] = "input"
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props)
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button.
show_clear_button: Var[bool]
# Events to fire when the clear button is clicked.
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_value",
"on_value_change",
"accept",
"alt",
"auto_complete",
"auto_focus" | tag = "Input" |
condary-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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False)
class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
tag = "Input"
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
|
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button.
show_clear_button: Var[bool]
# Events to fire when the clear button is clicked.
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_value",
"on_value_change",
"accept",
"alt",
"auto_complete",
"auto_focus",
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
" | def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
props["data-slot"] = "input"
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props) |
ondary-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"
class InputBaseComponent(BaseUIComponent):
"""Base component for an input."""
library = f"{PACKAGE_NAME}/input"
@property
def import_var(self):
"""Return the import variable for the input component."""
return ImportVar(tag="Input", package_path="", install=False)
class InputRoot(InputBaseComponent, ReflexInput):
"""Root component for an input."""
tag = "Input"
on_value_change: EventHandler[passthrough_event_spec(str, dict)]
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent: # pyright: ignore[reportIncompatibleMethodOverride]
"""Create a high level input component with simplified API."""
|
cls.set_class_name(ClassNames.INPUT, props)
return super().create(*children, **props)
class HighLevelInput(InputBaseComponent):
"""High level wrapper for the Input component with simplified API."""
# Size of the input.
size: Var[LiteralControlSize]
# Icon to display in the input.
icon: Var[str]
# Whether to show the clear button.
show_clear_button: Var[bool]
# Events to fire when the clear button is clicked.
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_value",
"on_value_change",
"accept",
"alt",
"auto_complete",
"auto_focus",
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
| props["data-slot"] = "input" |
clear_events: Var[list[EventHandler]]
_el_input_props = {
"default_value",
"on_value_change",
"accept",
"alt",
"auto_complete",
"auto_focus",
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
|
# Extract component props
icon = props.pop("icon", "")
size = props.pop("size", "md")
id = props.pop("id", get_unique_variable_name())
class_name = props.pop("class_name", "")
show_clear_button = props.pop("show_clear_button", True)
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
| input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()} |
"accept",
"alt",
"auto_complete",
"auto_focus",
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()}
# Extract component props
|
size = props.pop("size", "md")
id = props.pop("id", get_unique_variable_name())
class_name = props.pop("class_name", "")
show_clear_button = props.pop("show_clear_button", True)
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button | icon = props.pop("icon", "") |
"auto_complete",
"auto_focus",
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()}
# Extract component props
icon = props.pop("icon", "")
|
id = props.pop("id", get_unique_variable_name())
class_name = props.pop("class_name", "")
show_clear_button = props.pop("show_clear_button", True)
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
| size = props.pop("size", "md") |
"capture",
"checked",
"default_checked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()}
# Extract component props
icon = props.pop("icon", "")
size = props.pop("size", "md")
|
class_name = props.pop("class_name", "")
show_clear_button = props.pop("show_clear_button", True)
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
on_click=set_focus(id),
class_name=c | id = props.pop("id", get_unique_variable_name()) |
ecked",
"form",
"form_action",
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()}
# Extract component props
icon = props.pop("icon", "")
size = props.pop("size", "md")
id = props.pop("id", get_unique_variable_name())
|
show_clear_button = props.pop("show_clear_button", True)
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
on_click=set_focus(id),
class_name=cn(f"{ClassNames.DIV} {INPUT_SIZE_VARIANTS[size]}" | class_name = props.pop("class_name", "") |
"form_enc_type",
"form_method",
"form_no_validate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()}
# Extract component props
icon = props.pop("icon", "")
size = props.pop("size", "md")
id = props.pop("id", get_unique_variable_name())
class_name = props.pop("class_name", "")
|
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
on_click=set_focus(id),
class_name=cn(f"{ClassNames.DIV} {INPUT_SIZE_VARIANTS[size]}", class_name),
**props,
)
@staticmethod
| show_clear_button = props.pop("show_clear_button", True) |
lidate",
"form_target",
"list",
"max",
"max_length",
"min_length",
"min",
"multiple",
"pattern",
"placeholder",
"read_only",
"required",
"src",
"step",
"type",
"value",
"on_key_down",
"on_key_up",
"on_change",
"on_focus",
"on_blur",
"disabled",
"name",
}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a high level input component with simplified API."""
# Extract and prepare input props
input_props = {k: props.pop(k) for k in cls._el_input_props & props.keys()}
# Extract component props
icon = props.pop("icon", "")
size = props.pop("size", "md")
id = props.pop("id", get_unique_variable_name())
class_name = props.pop("class_name", "")
show_clear_button = props.pop("show_clear_button", True)
|
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
on_click=set_focus(id),
class_name=cn(f"{ClassNames.DIV} {INPUT_SIZE_VARIANTS[size]}", class_name),
**props,
)
@staticmethod
def _create_clear_button(id: str, clear_events: l | clear_events = props.pop("clear_events", []) |
clear_events = props.pop("clear_events", [])
# Configure input with merged attributes
input_props.update(
{
"id": id,
"custom_attrs": {
**DEFAULT_INPUT_ATTRS,
**input_props.get("custom_attrs", {}),
},
}
)
return Div.create( # pyright: ignore[reportReturnType]
(
Span.create(
hi(icon, class_name="text-secondary-9 size-4 pointer-events-none"),
aria_hidden="true",
)
if icon
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
on_click=set_focus(id),
class_name=cn(f"{ClassNames.DIV} {INPUT_SIZE_VARIANTS[size]}", class_name),
**props,
)
@staticmethod
|
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
]
class Input(ComponentNamespace):
"""Namespace for Input components."""
root = staticmethod(InputRoot.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelInput.create)
input = Input()
| def _create_clear_button(id: str, clear_events: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
) |
else None
),
InputRoot.create(**input_props),
(cls._create_clear_button(id, clear_events) if show_clear_button else None),
*children,
on_click=set_focus(id),
class_name=cn(f"{ClassNames.DIV} {INPUT_SIZE_VARIANTS[size]}", class_name),
**props,
)
@staticmethod
def _create_clear_button(id: str, clear_events: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
)
|
class Input(ComponentNamespace):
"""Namespace for Input components."""
root = staticmethod(InputRoot.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelInput.create)
input = Input()
| def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
] |
set_focus(id),
class_name=cn(f"{ClassNames.DIV} {INPUT_SIZE_VARIANTS[size]}", class_name),
**props,
)
@staticmethod
def _create_clear_button(id: str, clear_events: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
]
|
input = Input()
| class Input(ComponentNamespace):
"""Namespace for Input components."""
root = staticmethod(InputRoot.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelInput.create) |
[size]}", class_name),
**props,
)
@staticmethod
def _create_clear_button(id: str, clear_events: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
]
class Input(ComponentNamespace):
"""Namespace for Input components."""
|
class_names = ClassNames
__call__ = staticmethod(HighLevelInput.create)
input = Input()
| root = staticmethod(InputRoot.create) |
,
)
@staticmethod
def _create_clear_button(id: str, clear_events: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
]
class Input(ComponentNamespace):
"""Namespace for Input components."""
root = staticmethod(InputRoot.create)
|
__call__ = staticmethod(HighLevelInput.create)
input = Input()
| class_names = ClassNames |
d
def _create_clear_button(id: str, clear_events: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
]
class Input(ComponentNamespace):
"""Namespace for Input components."""
root = staticmethod(InputRoot.create)
class_names = ClassNames
|
input = Input()
| __call__ = staticmethod(HighLevelInput.create) |
nts: list[EventHandler]) -> Button:
"""Create the clear button component."""
return Button.create(
hi("CancelCircleIcon"),
type="button",
on_click=[
set_value(id, ""),
set_focus(id).stop_propagation,
*clear_events,
],
tab_index=-1,
class_name="opacity-100 peer-placeholder-shown:opacity-0 hover:text-secondary-12 transition-colors peer-placeholder-shown:pointer-events-none peer-disabled:pointer-events-none peer-disabled:opacity-0 h-full",
)
def _exclude_props(self) -> list[str]:
return [
*super()._exclude_props(),
"size",
"icon",
"show_clear_button",
"clear_events",
]
class Input(ComponentNamespace):
"""Namespace for Input components."""
root = staticmethod(InputRoot.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelInput.create)
| input = Input() | |
"""Custom link component."""
|
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[Literal | from typing import Literal |
"""Custom link component."""
from typing import Literal
|
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
| from reflex.components.react_router.dom import ReactRouterLink, To |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
|
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVarian | from reflex.vars.base import Var |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
|
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to Fals | from reflex_ui.components.icons.hugeicon import hi |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
|
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The | from reflex_ui.utils.twmerge import cn |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
|
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmeth | LiteralLinkVariant = Literal["primary", "secondary"] |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
|
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRoute | LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"] |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
|
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
sh | class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0" |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
|
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("varia | ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative" |
"""Custom link component."""
from typing import Literal
from reflex.components.react_router.dom import ReactRouterLink, To
from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
LiteralLinkVariant = Literal["primary", "secondary"]
LiteralLinkSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for the link component."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
|
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
sh | ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0" |
ponent."""
ROOT = "font-medium underline-offset-2 hover:underline w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
|
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = cla | size = props.pop("size", "sm") |
w-fit group/link relative"
ICON = "absolute top-1/2 -translate-y-1/2 right-[-1.25rem] group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
|
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def | variant = props.pop("variant", "secondary") |
group-hover/link:opacity-100 text-secondary-9 opacity-0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
|
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
| render_component = props.pop("render_", None) |
0"
LINK_VARIANTS: dict[str, dict[str, str]] = {
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
|
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
| show_icon = props.pop("show_icon", False) |
"size": {
"xs": "text-xs",
"sm": "text-sm",
"md": "text-md",
"lg": "text-lg",
"xl": "text-xl",
},
"variant": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
|
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANT | link_class_name = props.get("class_name", "") |
nt": {
"primary": "text-primary-11",
"secondary": "text-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
|
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise Valu | children = list(getattr(render_component, "children", [])) |
-secondary-11",
},
}
class Link(ReactRouterLink):
"""Link component."""
# The size of the link. Defaults to "sm".
size: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
|
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
| class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
) |
ize: Var[LiteralLinkSize]
# The variant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
|
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
| children = list(children) |
ariant of the link. Defaults to "secondary".
variant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
|
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size" | size_class = LINK_VARIANTS["size"][size] |
ant: Var[LiteralLinkVariant]
# Whether to show the icon. Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
|
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Availa | variant_class = LINK_VARIANTS["variant"][variant] |
Defaults to False.
show_icon: Var[bool]
# The page to link to.
to: Var[str | To]
@classmethod
def create(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
|
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return | class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
) |
ate(cls, *children, **props) -> ReactRouterLink:
"""Create the link component."""
size = props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
|
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON)) |
= props.pop("size", "sm")
cls.validate_size(size)
variant = props.pop("variant", "secondary")
cls.validate_variant(variant)
render_component = props.pop("render_", None)
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
|
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| props["class_name"] = class_name |
show_icon = props.pop("show_icon", False)
link_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
|
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message) |
nk_class_name = props.get("class_name", "")
# Get the class name and children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
|
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| available_variants = ", ".join(LINK_VARIANTS["variant"].keys()) |
d children from the render component
if render_component:
children = list(getattr(render_component, "children", []))
class_name = cn(
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
|
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
) |
getattr(render_component, "class_name", ""), link_class_name
)
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
|
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message) |
else:
children = list(children)
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
|
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message) |
size_class = LINK_VARIANTS["size"][size]
variant_class = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
|
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| available_sizes = ", ".join(LINK_VARIANTS["size"].keys()) |
lass = LINK_VARIANTS["variant"][variant]
class_name = cn(
f"{ClassNames.ROOT} {size_class} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
|
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
link = Link.create
| message = f"Invalid size: {size}. Available sizes: {available_sizes}" |
lass} {variant_class}", link_class_name
)
if show_icon:
children.append(hi("LinkSquare02Icon", class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
|
link = Link.create
| def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"] |
class_name=ClassNames.ICON))
props["class_name"] = class_name
return super().create(*children, **props)
@staticmethod
def validate_variant(variant: LiteralLinkVariant):
"""Validate the link variant."""
if variant not in LINK_VARIANTS["variant"]:
available_variants = ", ".join(LINK_VARIANTS["variant"].keys())
message = (
f"Invalid variant: {variant}. Available variants: {available_variants}"
)
raise ValueError(message)
@staticmethod
def validate_size(size: LiteralLinkSize):
"""Validate the link size."""
if size not in LINK_VARIANTS["size"]:
available_sizes = ", ".join(LINK_VARIANTS["size"].keys())
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
raise ValueError(message)
def _exclude_props(self) -> list[str]:
return [*super()._exclude_props(), "size", "variant", "show_icon", "render_"]
| link = Link.create | |
"""Custom menu component."""
|
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNam | from typing import Literal |
"""Custom menu component."""
from typing import Literal
|
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min | from reflex.components.component import Component, ComponentNamespace |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
|
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-non | from reflex.components.core.foreach import foreach |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-n | from reflex.event import EventHandler, passthrough_event_spec |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring | from reflex.utils.imports import ImportVar |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
|
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
POR | from reflex.vars.base import Var |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
|
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-seconda | from reflex_ui.components.base.button import button |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
|
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/po | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
|
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-or | from reflex_ui.components.icons.others import select_arrow |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
|
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg | from reflex_ui.utils.twmerge import cn |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
|
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting | LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.