instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
from typing import Any, Dict, Literal, Optional
import reflex as rx
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
|
DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrink-0 font-sans disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 disabled:!text-slate-8 transition-bg"
def get_variant_bg_cn(variant: str) -> str:
"""Get the background color class name for a button variant.
Args:
variant (str): The variant of the button.
Returns:
str: The background color class name.
"""
return f"enabled:bg-gradient-to-b from-(--{variant}-9) to-(--{variant}-10) dark:to-(--{variant}-9) hover:to-(--{variant}-9) dark:hover:to-(--{variant}-10) disabled:hover:bg-(--{variant}-9)"
BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = {
"size": {
"xs": "px-1.5 h-7 rounded-md gap-1.5",
"sm": "px-2 h-8 rounded-lg gap-2",
"md": "px-2.5 h-9 rounded-[10px] gap-2.5",
"lg": "px-3 h-10 rounded-xl gap-3",
"xl": "px-3.5 h-12 rounded-[14px] gap-3 !tex | LiteralButtonSize = Literal[
"sm", "md", "lg", "xl", "icon-sm", "icon-md", "icon-lg", "icon-xl"
] |
from typing import Any, Dict, Literal, Optional
import reflex as rx
from pcweb.components.utils.twmerge import cn
LiteralButtonVariant = Literal[
"primary", "secondary", "transparent", "destructive", "outline"
]
LiteralButtonSize = Literal[
"sm", "md", "lg", "xl", "icon-sm", "icon-md", "icon-lg", "icon-xl"
]
|
def get_variant_bg_cn(variant: str) -> str:
"""Get the background color class name for a button variant.
Args:
variant (str): The variant of the button.
Returns:
str: The background color class name.
"""
return f"enabled:bg-gradient-to-b from-(--{variant}-9) to-(--{variant}-10) dark:to-(--{variant}-9) hover:to-(--{variant}-9) dark:hover:to-(--{variant}-10) disabled:hover:bg-(--{variant}-9)"
BUTTON_STYLES: Dict[str, Dict[str, Dict[str, str]]] = {
"size": {
"xs": "px-1.5 h-7 rounded-md gap-1.5",
"sm": "px-2 h-8 rounded-lg gap-2",
"md": "px-2.5 h-9 rounded-[10px] gap-2.5",
"lg": "px-3 h-10 rounded-xl gap-3",
"xl": "px-3.5 h-12 rounded-[14px] gap-3 !text-base text-nowrap",
"icon-xs": "size-7 rounded-md",
"icon-sm": "size-8 rounded-lg",
"icon-md": "size-9 rounded-[10px]",
"icon-lg": "size-10 rounded-md",
"icon-xl": "size-12 rounded-[14px]",
},
"variant": {
| DEFAULT_CLASS_NAME = "text-sm cursor-pointer inline-flex items-center justify-center relative transition-bg shrink-0 font-sans disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 disabled:!text-slate-8 transition-bg" |
riant: LiteralButtonVariant = "primary",
size: LiteralButtonSize = "sm",
style: Dict[str, Any] | None = None,
class_name: str = "",
icon: Optional[rx.Component] = None,
**props,
) -> rx.Component:
"""Create a button component.
Args:
text (str): The text to display on the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional): The button size. Defaults to "sm".
style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}.
class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "".
icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None.
**props: Additional props to pass to the button element.
Returns:
rx.Component: A button component with the specified properties.
"""
if style is None:
|
variant_class = BUTTON_STYLES["variant"][variant]
variant_class = variant_class() if callable(variant_class) else variant_class
classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
class_name,
]
content = [icon, text] if icon else [text]
return rx.el.button(
*content,
style=style,
class_name=cn(*classes),
**props,
)
| style = {} |
uttonVariant = "primary",
size: LiteralButtonSize = "sm",
style: Dict[str, Any] | None = None,
class_name: str = "",
icon: Optional[rx.Component] = None,
**props,
) -> rx.Component:
"""Create a button component.
Args:
text (str): The text to display on the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional): The button size. Defaults to "sm".
style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}.
class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "".
icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None.
**props: Additional props to pass to the button element.
Returns:
rx.Component: A button component with the specified properties.
"""
if style is None:
style = {}
|
variant_class = variant_class() if callable(variant_class) else variant_class
classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
class_name,
]
content = [icon, text] if icon else [text]
return rx.el.button(
*content,
style=style,
class_name=cn(*classes),
**props,
)
| variant_class = BUTTON_STYLES["variant"][variant] |
= "sm",
style: Dict[str, Any] | None = None,
class_name: str = "",
icon: Optional[rx.Component] = None,
**props,
) -> rx.Component:
"""Create a button component.
Args:
text (str): The text to display on the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional): The button size. Defaults to "sm".
style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}.
class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "".
icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None.
**props: Additional props to pass to the button element.
Returns:
rx.Component: A button component with the specified properties.
"""
if style is None:
style = {}
variant_class = BUTTON_STYLES["variant"][variant]
|
classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
class_name,
]
content = [icon, text] if icon else [text]
return rx.el.button(
*content,
style=style,
class_name=cn(*classes),
**props,
)
| variant_class = variant_class() if callable(variant_class) else variant_class |
: Optional[rx.Component] = None,
**props,
) -> rx.Component:
"""Create a button component.
Args:
text (str): The text to display on the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional): The button size. Defaults to "sm".
style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}.
class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "".
icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None.
**props: Additional props to pass to the button element.
Returns:
rx.Component: A button component with the specified properties.
"""
if style is None:
style = {}
variant_class = BUTTON_STYLES["variant"][variant]
variant_class = variant_class() if callable(variant_class) else variant_class
|
content = [icon, text] if icon else [text]
return rx.el.button(
*content,
style=style,
class_name=cn(*classes),
**props,
)
| classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
class_name,
] |
he text to display on the button.
variant (LiteralButtonVariant, optional): The button variant. Defaults to "primary".
size (LiteralButtonSize, optional): The button size. Defaults to "sm".
style (Dict[str, Any], optional): Additional styles to apply to the button. Defaults to {}.
class_name (str, optional): Additional CSS classes to apply to the button. Defaults to "".
icon (Optional[rx.Component], optional): An optional icon component to display before the text. Defaults to None.
**props: Additional props to pass to the button element.
Returns:
rx.Component: A button component with the specified properties.
"""
if style is None:
style = {}
variant_class = BUTTON_STYLES["variant"][variant]
variant_class = variant_class() if callable(variant_class) else variant_class
classes = [
DEFAULT_CLASS_NAME,
BUTTON_STYLES["size"][size],
variant_class,
class_name,
]
|
return rx.el.button(
*content,
style=style,
class_name=cn(*classes),
**props,
)
| content = [icon, text] if icon else [text] |
import reflex_ui as ui
def _ellipses(side: str, reverse_animation: bool = False) -> rx.Component:
"""Create animated ellipses for the pattern effect."""
direction = "right" if side == "right" else "left"
animation_class = "[animation-direction:reverse]" if reverse_animation else ""
common_class = (
f"absolute bg-violet-11 dark:bg-[#534a87] blur-[10px] {animation_class}"
)
return rx.el.div(
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", rev | import reflex as rx | |
import reflex as rx
|
def _ellipses(side: str, reverse_animation: bool = False) -> rx.Component:
"""Create animated ellipses for the pattern effect."""
direction = "right" if side == "right" else "left"
animation_class = "[animation-direction:reverse]" if reverse_animation else ""
common_class = (
f"absolute bg-violet-11 dark:bg-[#534a87] blur-[10px] {animation_class}"
)
return rx.el.div(
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, cla | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
def _ellipses(side: str, reverse_animation: bool = False) -> rx.Component:
"""Create animated ellipses for the pattern effect."""
|
animation_class = "[animation-direction:reverse]" if reverse_animation else ""
common_class = (
f"absolute bg-violet-11 dark:bg-[#534a87] blur-[10px] {animation_class}"
)
return rx.el.div(
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
| direction = "right" if side == "right" else "left" |
import reflex as rx
import reflex_ui as ui
def _ellipses(side: str, reverse_animation: bool = False) -> rx.Component:
"""Create animated ellipses for the pattern effect."""
direction = "right" if side == "right" else "left"
|
common_class = (
f"absolute bg-violet-11 dark:bg-[#534a87] blur-[10px] {animation_class}"
)
return rx.el.div(
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse anima | animation_class = "[animation-direction:reverse]" if reverse_animation else "" |
import reflex as rx
import reflex_ui as ui
def _ellipses(side: str, reverse_animation: bool = False) -> rx.Component:
"""Create animated ellipses for the pattern effect."""
direction = "right" if side == "right" else "left"
animation_class = "[animation-direction:reverse]" if reverse_animation else ""
|
return rx.el.div(
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == " | common_class = (
f"absolute bg-violet-11 dark:bg-[#534a87] blur-[10px] {animation_class}"
) |
] blur-[10px] {animation_class}"
)
return rx.el.div(
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
|
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient} | position_class = "left-0" if side == "left" else "right-0" |
rx.el.div(
class_name=f"w-[32px] h-[88px] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
|
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vert | light_dark_path = rx.color_mode_cond("light", "dark") |
] {direction}-[0.5rem] {common_class} animate-ellipse-1"
),
rx.el.div(
class_name=f"w-[32px] h-[178px] {direction}-[9.5rem] {common_class} animate-ellipse-2"
),
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
|
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webki | src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp" |
rx.el.div(
class_name=f"w-[16px] h-[42px] {direction}-[4.19rem] {common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
|
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_sty | is_flipped = (side == "right") != reverse |
{common_class} animate-ellipse-3"
),
rx.el.div(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
|
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repe | image_style = {"opacity": rx.color_mode_cond("1", "0.3")} |
(
class_name=f"w-[32px] h-[48px] {direction}-[0.44rem] {common_class} animate-ellipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
|
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_m | if is_flipped:
image_style |= {"transform": "scaleX(-1)"} |
lipse-4"
),
)
def numbers_pattern(
side: str = "left", reverse: bool = False, class_name: str = ""
) -> rx.Component:
"""Numbers pattern with static background and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
|
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "ce | vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)" |
ground and masked animated ellipses.
Matches Figma design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
|
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)"
return rx.el.div( | gradient_angle = "105deg" if reverse else "280deg" |
design structure with layered gradients.
Args:
side: Position side ("left" or "right")
reverse: Reverse the ellipse animation direction
class_name: Additional CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
|
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)"
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h- | angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)" |
onal CSS classes
"""
position_class = "left-0" if side == "left" else "right-0"
light_dark_path = rx.color_mode_cond("light", "dark")
src = f"landing/patterns/{light_dark_path}/numbers-pattern.webp"
# Determine if we need to flip: right side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
|
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)"
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h-full absolute inset-0 object-cover",
style=image_style,
),
# Layer 2: Masked animated ellipses
rx.el.div(
_ellipses(side=side, reverse_animation=reverse),
class_name="absolute inset-0 w-full h-full",
style=ellipses_mask_style,
| container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
} |
t side XOR reverse
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
|
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)"
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h-full absolute inset-0 object-cover",
style=image_style,
),
# Layer 2: Masked animated ellipses
rx.el.div(
_ellipses(side=side, reverse_animation=reverse),
class_name="absolute inset-0 w-full h-full",
style=ellipses_mask_style,
),
class_name=ui.cn(
f"absolute {position_class} poin | if is_flipped:
container_mask_style["transform"] = "scaleX(-1)" |
# - right side normally flips
# - reverse inverts the flip behavior
is_flipped = (side == "right") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
|
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)"
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h-full absolute inset-0 object-cover",
style=image_style,
),
# Layer 2: Masked animated ellipses
rx.el.div(
_ellipses(side=side, reverse_animation=reverse),
class_name="absolute inset-0 w-full h-full",
style=ellipses_mask_style,
),
class_name=ui.cn(
f"absolute {position_class} poin | container_mask_style["transform"] = "scaleX(-1)" |
ight") != reverse
# Background image style
image_style = {"opacity": rx.color_mode_cond("1", "0.3")}
if is_flipped:
image_style |= {"transform": "scaleX(-1)"}
# Gradient masks
vertical_gradient = "linear-gradient(360deg, rgba(0, 0, 0, 0) 0%, #000000 12%, #000000 88%, rgba(0, 0, 0, 0) 100%)"
# Angled gradient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
|
if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)"
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h-full absolute inset-0 object-cover",
style=image_style,
),
# Layer 2: Masked animated ellipses
rx.el.div(
_ellipses(side=side, reverse_animation=reverse),
class_name="absolute inset-0 w-full h-full",
style=ellipses_mask_style,
),
class_name=ui.cn(
f"absolute {position_class} pointer-events-none z-[-1] lg:w-[234px] w-[180px] h-full bottom-0",
class_name,
),
style=container_mask_style,
)
| ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
} |
dient - angle changes based on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
|
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h-full absolute inset-0 object-cover",
style=image_style,
),
# Layer 2: Masked animated ellipses
rx.el.div(
_ellipses(side=side, reverse_animation=reverse),
class_name="absolute inset-0 w-full h-full",
style=ellipses_mask_style,
),
class_name=ui.cn(
f"absolute {position_class} pointer-events-none z-[-1] lg:w-[234px] w-[180px] h-full bottom-0",
class_name,
),
style=container_mask_style,
)
| if is_flipped:
ellipses_mask_style["transform"] = "scaleX(-1)" |
ased on reverse
gradient_angle = "105deg" if reverse else "280deg"
angled_gradient = f"linear-gradient({gradient_angle}, rgba(0, 0, 0, 0) 18.13%, rgba(0, 0, 0, 0.88) 66.72%, rgba(0, 0, 0, 0) 85.62%)"
# Container mask combining both gradients
container_mask_style = {
"mask_image": f"{angled_gradient}, {vertical_gradient}",
"webkit_mask_image": f"{angled_gradient}, {vertical_gradient}",
"mask_composite": "intersect",
"webkit_mask_composite": "intersect",
}
if is_flipped:
container_mask_style["transform"] = "scaleX(-1)"
# Image mask style for the ellipses layer
ellipses_mask_style = {
"mask_image": f"url({src})",
"mask_size": "cover",
"mask_repeat": "no-repeat",
"mask_position": "center",
"webkit_mask_image": f"url({src})",
"webkit_mask_size": "cover",
"webkit_mask_repeat": "no-repeat",
"webkit_mask_position": "center",
}
if is_flipped:
|
return rx.el.div(
# Layer 1: Background pattern image
rx.image(
src=src,
class_name="pointer-events-none w-full h-full absolute inset-0 object-cover",
style=image_style,
),
# Layer 2: Masked animated ellipses
rx.el.div(
_ellipses(side=side, reverse_animation=reverse),
class_name="absolute inset-0 w-full h-full",
style=ellipses_mask_style,
),
class_name=ui.cn(
f"absolute {position_class} pointer-events-none z-[-1] lg:w-[234px] w-[180px] h-full bottom-0",
class_name,
),
style=container_mask_style,
)
| ellipses_mask_style["transform"] = "scaleX(-1)" |
class NumberFlow(rx.Component):
library = "@number-flow/react"
tag = "NumberFlow"
is_default = True
# The numeric value to display and animate
# NumberFlow will automatically transition when this prop changes
value: rx.Var[int | str | float]
# The locale(s) for number formatting (e.g., "en-US", "de-DE")
# Accepts Intl.LocalesArgument format
# Default: "en-US"
locales: rx.Var[str] = rx.Var.create("en-US")
# Custom prefix string to display before the number
# Example: "$" for currency display
prefix: rx.Var[str]
# Custom suffix string to display after the number
# Example: "/mo" for monthly pricing, "%" for percentages
suffix: rx.Var[str]
# If true, NumberFlow's transitions are isolated from other layout changes
# that may occur in the same update. Has no effect when inside NumberFlowGroup.
# Default: false
isolate: rx.Var[bool]
# Controls whether animations are enabled
# Can be set to fals | import reflex as rx | |
import reflex as rx
class NumberFlow(rx.Component):
|
tag = "NumberFlow"
is_default = True
# The numeric value to display and animate
# NumberFlow will automatically transition when this prop changes
value: rx.Var[int | str | float]
# The locale(s) for number formatting (e.g., "en-US", "de-DE")
# Accepts Intl.LocalesArgument format
# Default: "en-US"
locales: rx.Var[str] = rx.Var.create("en-US")
# Custom prefix string to display before the number
# Example: "$" for currency display
prefix: rx.Var[str]
# Custom suffix string to display after the number
# Example: "/mo" for monthly pricing, "%" for percentages
suffix: rx.Var[str]
# If true, NumberFlow's transitions are isolated from other layout changes
# that may occur in the same update. Has no effect when inside NumberFlowGroup.
# Default: false
isolate: rx.Var[bool]
# Controls whether animations are enabled
# Can be set to false to disable all animations and finish current ones
# Useful for | library = "@number-flow/react" |
import reflex as rx
class NumberFlow(rx.Component):
library = "@number-flow/react"
|
is_default = True
# The numeric value to display and animate
# NumberFlow will automatically transition when this prop changes
value: rx.Var[int | str | float]
# The locale(s) for number formatting (e.g., "en-US", "de-DE")
# Accepts Intl.LocalesArgument format
# Default: "en-US"
locales: rx.Var[str] = rx.Var.create("en-US")
# Custom prefix string to display before the number
# Example: "$" for currency display
prefix: rx.Var[str]
# Custom suffix string to display after the number
# Example: "/mo" for monthly pricing, "%" for percentages
suffix: rx.Var[str]
# If true, NumberFlow's transitions are isolated from other layout changes
# that may occur in the same update. Has no effect when inside NumberFlowGroup.
# Default: false
isolate: rx.Var[bool]
# Controls whether animations are enabled
# Can be set to false to disable all animations and finish current ones
# Useful for scenarios like input fie | tag = "NumberFlow" |
import reflex as rx
class NumberFlow(rx.Component):
library = "@number-flow/react"
tag = "NumberFlow"
|
# The numeric value to display and animate
# NumberFlow will automatically transition when this prop changes
value: rx.Var[int | str | float]
# The locale(s) for number formatting (e.g., "en-US", "de-DE")
# Accepts Intl.LocalesArgument format
# Default: "en-US"
locales: rx.Var[str] = rx.Var.create("en-US")
# Custom prefix string to display before the number
# Example: "$" for currency display
prefix: rx.Var[str]
# Custom suffix string to display after the number
# Example: "/mo" for monthly pricing, "%" for percentages
suffix: rx.Var[str]
# If true, NumberFlow's transitions are isolated from other layout changes
# that may occur in the same update. Has no effect when inside NumberFlowGroup.
# Default: false
isolate: rx.Var[bool]
# Controls whether animations are enabled
# Can be set to false to disable all animations and finish current ones
# Useful for scenarios like input fields where you want inst | is_default = True |
as no effect when inside NumberFlowGroup.
# Default: false
isolate: rx.Var[bool]
# Controls whether animations are enabled
# Can be set to false to disable all animations and finish current ones
# Useful for scenarios like input fields where you want instant updates
# Default: true
animated: rx.Var[bool]
# If true, applies CSS will-change properties to relevant elements
# Useful if your number changes frequently or you experience unwanted repositioning
# Note: Excessive use can result in excessive memory usage
# Default: false
will_change: rx.Var[bool]
# Controls the direction of digit animations
# "+1": digits always go up
# "0": each digit goes up if increasing, down if decreasing (no overall trend)
# "-1": digits always go down
# Can also be a function: (oldValue: number, value: number) => number
# Default: "+1" (which corresponds to Math.sign(value - oldValue))
trend: rx.Var[str] = rx.Var.create("+1")
| number_flow = NumberFlow.create | |
import reflex as rx
class ProgressiveBlur(rx.Component):
"""ProgressiveBlur component."""
library = "progressive-blur"
tag = "LinearBlur"
steps: rx.Var[int] = rx.Var.create(8)
strength: rx.Var[int] = rx.Var.create(64)
falloff_percentage: rx.Var[int] = rx.Var.create(100)
tint: rx.Var[str] = rx.Var.create("")
side: rx.Var[Literal["top", "bottom", "left", "right"]] = rx.Var.create("bottom")
progressive_blur = ProgressiveBlur.create
| from typing import Literal | |
from typing import Literal
|
class ProgressiveBlur(rx.Component):
"""ProgressiveBlur component."""
library = "progressive-blur"
tag = "LinearBlur"
steps: rx.Var[int] = rx.Var.create(8)
strength: rx.Var[int] = rx.Var.create(64)
falloff_percentage: rx.Var[int] = rx.Var.create(100)
tint: rx.Var[str] = rx.Var.create("")
side: rx.Var[Literal["top", "bottom", "left", "right"]] = rx.Var.create("bottom")
progressive_blur = ProgressiveBlur.create
| import reflex as rx |
from typing import Literal
import reflex as rx
class ProgressiveBlur(rx.Component):
"""ProgressiveBlur component."""
|
tag = "LinearBlur"
steps: rx.Var[int] = rx.Var.create(8)
strength: rx.Var[int] = rx.Var.create(64)
falloff_percentage: rx.Var[int] = rx.Var.create(100)
tint: rx.Var[str] = rx.Var.create("")
side: rx.Var[Literal["top", "bottom", "left", "right"]] = rx.Var.create("bottom")
progressive_blur = ProgressiveBlur.create
| library = "progressive-blur" |
from typing import Literal
import reflex as rx
class ProgressiveBlur(rx.Component):
"""ProgressiveBlur component."""
library = "progressive-blur"
|
steps: rx.Var[int] = rx.Var.create(8)
strength: rx.Var[int] = rx.Var.create(64)
falloff_percentage: rx.Var[int] = rx.Var.create(100)
tint: rx.Var[str] = rx.Var.create("")
side: rx.Var[Literal["top", "bottom", "left", "right"]] = rx.Var.create("bottom")
progressive_blur = ProgressiveBlur.create
| tag = "LinearBlur" |
from typing import Literal
import reflex as rx
class ProgressiveBlur(rx.Component):
"""ProgressiveBlur component."""
library = "progressive-blur"
tag = "LinearBlur"
steps: rx.Var[int] = rx.Var.create(8)
strength: rx.Var[int] = rx.Var.create(64)
falloff_percentage: rx.Var[int] = rx.Var.create(100)
tint: rx.Var[str] = rx.Var.create("")
side: rx.Var[Literal["top", "bottom", "left", "right"]] = rx.Var.create("bottom")
| progressive_blur = ProgressiveBlur.create | |
loading_style = {
"rect": {
"opacity": "0",
"animation": "fadeInStayOut 6s linear infinite",
},
"@keyframes fadeInStayOut": {
"0%": {"opacity": "0"},
"5%": {"opacity": "1"},
"50%": {"opacity": "1"},
"55%": {"opacity": "0"},
"100%": {"opacity": "0"},
},
}
for i in range(1, 14):
loading_style[f"rect:nth-child({i})"] = {"animation_delay": f"{(i - 1) * 0.2}s"}
def svg_loading():
return rx.box(
rx.html(
"""<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="32" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="38" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="47" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x= | import reflex as rx | |
import reflex as rx
|
for i in range(1, 14):
loading_style[f"rect:nth-child({i})"] = {"animation_delay": f"{(i - 1) * 0.2}s"}
def svg_loading():
return rx.box(
rx.html(
"""<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="32" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="38" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="47" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="35" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="47" width="6" height="6" | loading_style = {
"rect": {
"opacity": "0",
"animation": "fadeInStayOut 6s linear infinite",
},
"@keyframes fadeInStayOut": {
"0%": {"opacity": "0"},
"5%": {"opacity": "1"},
"50%": {"opacity": "1"},
"55%": {"opacity": "0"},
"100%": {"opacity": "0"},
},
} |
import reflex as rx
loading_style = {
"rect": {
"opacity": "0",
"animation": "fadeInStayOut 6s linear infinite",
},
"@keyframes fadeInStayOut": {
"0%": {"opacity": "0"},
"5%": {"opacity": "1"},
"50%": {"opacity": "1"},
"55%": {"opacity": "0"},
"100%": {"opacity": "0"},
},
}
|
def svg_loading():
return rx.box(
rx.html(
"""<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="32" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="38" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="47" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="35" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="47" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="29" width="6" height="6" fill="#6E56CF"/>
< | for i in range(1, 14):
loading_style[f"rect:nth-child({i})"] = {"animation_delay": f"{(i - 1) * 0.2}s"} |
import reflex as rx
loading_style = {
"rect": {
"opacity": "0",
"animation": "fadeInStayOut 6s linear infinite",
},
"@keyframes fadeInStayOut": {
"0%": {"opacity": "0"},
"5%": {"opacity": "1"},
"50%": {"opacity": "1"},
"55%": {"opacity": "0"},
"100%": {"opacity": "0"},
},
}
for i in range(1, 14):
|
def svg_loading():
return rx.box(
rx.html(
"""<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="32" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="38" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="47" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="41" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="35" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="53" width="6" height="6" fill="#6E56CF"/>
<rect x="44" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="29" width="6" height="6" fill="#6E56CF"/>
<rect x="32" y="47" width="6" height="6" fill="#6E56CF"/>
<rect x="50" y="29" width="6" height="6" fill="#6E56CF"/>
< | loading_style[f"rect:nth-child({i})"] = {"animation_delay": f"{(i - 1) * 0.2}s"} |
ht": "0", "transform": "translateY(0)"},
"100%": {"height": "0", "transform": "translateY(0)"},
},
}
def spinner_svg(mask_name: str):
return rx.box(
rx.html(
f"""<svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="{mask_name}" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="20" y="20" width="48" height="48">
<rect x="21" y="21" width="46" height="46" rx="7" stroke="black" stroke-width="2"/>
</mask>
<g mask="url(#{mask_name})">
<rect x="20" y="20" width="0" height="8" fill="#6E56CF"/>
<rect x="60" y="20" width="8" height="0" fill="#6E56CF"/>
<rect x="27" y="60" width="0" height="8" fill="#6E56CF"/>
<rect x="20" y="28" width="8" height="0" fill="#6E56CF"/>
</g>
</svg>"""
),
style=spinner_style,
)
| def r_svg_loader():
return rx.fragment(
spinner_svg(mask_name="mask"),
svg_loading(),
) | |
from reflex.vars import Var
from pcweb.constants import SPLINE_RUNTIME_VERSION, SPLINE_SCENE_URL
class Spline(rx.Component):
"""Spline component."""
library = "@splinetool/react-spline"
tag = "Spline"
scene: Var[str] = SPLINE_SCENE_URL
is_default = True
lib_dependencies: list[str] = [f"@splinetool/runtime@{SPLINE_RUNTIME_VERSION}"]
spline = Spline.create
| import reflex as rx | |
import reflex as rx
|
from pcweb.constants import SPLINE_RUNTIME_VERSION, SPLINE_SCENE_URL
class Spline(rx.Component):
"""Spline component."""
library = "@splinetool/react-spline"
tag = "Spline"
scene: Var[str] = SPLINE_SCENE_URL
is_default = True
lib_dependencies: list[str] = [f"@splinetool/runtime@{SPLINE_RUNTIME_VERSION}"]
spline = Spline.create
| from reflex.vars import Var |
import reflex as rx
from reflex.vars import Var
from pcweb.constants import SPLINE_RUNTIME_VERSION, SPLINE_SCENE_URL
class Spline(rx.Component):
"""Spline component."""
|
tag = "Spline"
scene: Var[str] = SPLINE_SCENE_URL
is_default = True
lib_dependencies: list[str] = [f"@splinetool/runtime@{SPLINE_RUNTIME_VERSION}"]
spline = Spline.create
| library = "@splinetool/react-spline" |
import reflex as rx
from reflex.vars import Var
from pcweb.constants import SPLINE_RUNTIME_VERSION, SPLINE_SCENE_URL
class Spline(rx.Component):
"""Spline component."""
library = "@splinetool/react-spline"
|
scene: Var[str] = SPLINE_SCENE_URL
is_default = True
lib_dependencies: list[str] = [f"@splinetool/runtime@{SPLINE_RUNTIME_VERSION}"]
spline = Spline.create
| tag = "Spline" |
import reflex as rx
from reflex.vars import Var
from pcweb.constants import SPLINE_RUNTIME_VERSION, SPLINE_SCENE_URL
class Spline(rx.Component):
"""Spline component."""
library = "@splinetool/react-spline"
tag = "Spline"
scene: Var[str] = SPLINE_SCENE_URL
|
lib_dependencies: list[str] = [f"@splinetool/runtime@{SPLINE_RUNTIME_VERSION}"]
spline = Spline.create
| is_default = True |
import reflex as rx
from reflex.vars import Var
from pcweb.constants import SPLINE_RUNTIME_VERSION, SPLINE_SCENE_URL
class Spline(rx.Component):
"""Spline component."""
library = "@splinetool/react-spline"
tag = "Spline"
scene: Var[str] = SPLINE_SCENE_URL
is_default = True
lib_dependencies: list[str] = [f"@splinetool/runtime@{SPLINE_RUNTIME_VERSION}"]
| spline = Spline.create | |
"""Interactive tab components for Base UI."""
|
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--activ | from __future__ import annotations |
"""Interactive tab components for Base UI."""
from __future__ import annotations
|
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate- | from typing import Any, Literal |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
|
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all | from reflex import Component |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
|
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseU | from reflex.components.component import ComponentNamespace |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
|
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
| from reflex.event import EventHandler, passthrough_event_spec |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
| from reflex.utils.imports import ImportVar |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
|
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
| from reflex.vars import Var |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
|
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
| from pcweb.components.utils.twmerge import cn |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
|
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the ta | class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"] |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
|
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[ | TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0" |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
|
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal | TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12" |
"""Interactive tab components for Base UI."""
from __future__ import annotations
from typing import Any, Literal
from reflex import Component
from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
|
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on | TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out" |
onent import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
|
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
""" | class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
) |
t import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
|
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
| library = "@base-ui-components/react/tabs" |
s.imports import ImportVar
from reflex.vars import Var
from pcweb.components.utils.twmerge import cn
class BaseUIComponent(Component):
"""Set of content sections to be displayed one at a time."""
lib_dependencies: list[str] = ["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
|
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
""" | def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
) |
["@base-ui-components/react@^1.0.0-alpha.8"]
# Default class names for each component
TABS_LIST_CLASS_NAME = "bg-slate-3 inline-flex gap-1 p-1 items-center justify-start rounded-[10px] relative z-0"
TABS_TAB_CLASS_NAME = "h-7 px-1.5 rounded-md justify-center items-center gap-1.5 inline-flex text-sm font-medium text-slate-9 cursor-pointer z-[1] hover:text-slate-12 transition-color text-nowrap data-[selected]:text-slate-12"
TABS_INDICATOR_CLASS_NAME = "absolute top-1/2 left-0 -z-1 h-7 w-[var(--active-tab-width)] -translate-y-1/2 translate-x-[var(--active-tab-left)] rounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
|
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CL | tag = "Tabs.Root" |
ounded-md bg-slate-1 shadow-small transition-all duration-200 ease-in-out"
class TabsBaseUIComponent(BaseUIComponent):
library = "@base-ui-components/react/tabs"
@property
def import_var(self):
return ImportVar(
tag="Tabs",
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
|
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props: | tag = "Tabs.List" |
package_path="",
install=False,
)
class TabsRoot(TabsBaseUIComponent):
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
|
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classme | def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props) |
"""Groups the tabs and the corresponding panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
|
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | st | if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"]) |
ing panels."""
tag = "Tabs.Root"
# The value of the tab that should be active when initially rendered
default_value: Var[Any] = 0
# The controlled value of the tab that should be active
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
|
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | st | props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"]) |
value: Var[Any]
# Event handler called when the value changes
on_value_change: EventHandler[passthrough_event_spec(str)]
# The orientation of the component
orientation: Var[Literal["horizontal", "vertical"]] = "horizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
|
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."" | tag = "Tabs.Tab" |
orizontal"
# Class name
class_name: Var[str] | str | None
class TabsList(TabsBaseUIComponent):
"""Groups the individual tab buttons."""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
|
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root | def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props) |
""
tag = "Tabs.List"
# Whether to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
|
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
| if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"]) |
er to activate tabs on focus
activate_on_focus: Var[bool] = True
# Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
|
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
| props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"]) |
Whether to loop through tabs
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
|
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace): | if icon is not None:
children = (icon, *children) |
loop: Var[bool] = True
# Class name
class_name: Var[str] | str | None = TABS_LIST_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
|
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace): | children = (icon, *children) |
"""Create the tabs list component."""
if "class_name" in props:
props["class_name"] = cn(TABS_LIST_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
|
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.cre | tag = "Tabs.Indicator" |
TabsTab(TabsBaseUIComponent):
"""An individual interactive tab button."""
tag = "Tabs.Tab"
# The value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
|
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props) |
e value of the tab
value: Var[Any]
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
|
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"]) |
# Optional icon component
icon: Component | None = None
# Class name
class_name: Var[str] | str | None = TABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
|
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"]) |
ABS_TAB_CLASS_NAME
@classmethod
def create(cls, *children, icon: Component | None = None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
|
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None |
= None, **props) -> Component:
"""Create the tab component with optional icon."""
if "class_name" in props:
props["class_name"] = cn(TABS_TAB_CLASS_NAME, props["class_name"])
if icon is not None:
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
|
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| tag = "Tabs.Panel" |
children = (icon, *children)
return super().create(*children, **props)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
|
tabs = Tabs()
| class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create) |
ops)
class TabsIndicator(TabsBaseUIComponent):
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
|
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| root = __call__ = staticmethod(TabsRoot.create) |
"""Visual indicator for the active tab."""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
|
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| list = staticmethod(TabsList.create) |
""
tag = "Tabs.Indicator"
# Whether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
|
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| tab = staticmethod(TabsTab.create) |
hether to render before hydration
render_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
|
indicator = staticmethod(TabsIndicator.create)
tabs = Tabs()
| panel = staticmethod(TabsPanel.create) |
r_before_hydration: Var[bool] = False
# Class name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
|
tabs = Tabs()
| indicator = staticmethod(TabsIndicator.create) |
s name
class_name: Var[str] | str | None = TABS_INDICATOR_CLASS_NAME
@classmethod
def create(cls, *children, **props) -> Component:
"""Create the tabs indicator component."""
if "class_name" in props:
props["class_name"] = cn(TABS_INDICATOR_CLASS_NAME, props["class_name"])
return super().create(*children, **props)
class TabsPanel(TabsBaseUIComponent):
"""Content panel associated with a tab."""
tag = "Tabs.Panel"
# The value that associates the panel with a tab
value: Var[Any]
# Whether to keep the panel mounted when inactive
keep_mounted: Var[bool] = False
# Class name
class_name: Var[str] | str | None
class Tabs(ComponentNamespace):
"""Namespace for Tab components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
| tabs = Tabs() | |
import reflex as rx
from reflex.event import EventHandler, EventSpec
from reflex.vars.base import get_unique_variable_name
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input | from typing import List, Optional, Union | |
from typing import List, Optional, Union
|
from reflex.event import EventHandler, EventSpec
from reflex.vars.base import get_unique_variable_name
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns | import reflex as rx |
from typing import List, Optional, Union
import reflex as rx
|
from reflex.vars.base import get_unique_variable_name
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
| from reflex.event import EventHandler, EventSpec |
from typing import List, Optional, Union
import reflex as rx
from reflex.event import EventHandler, EventSpec
|
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
"""
if not input_id:
input_id = get_u | from reflex.vars.base import get_unique_variable_name |
from typing import List, Optional, Union
import reflex as rx
from reflex.event import EventHandler, EventSpec
from reflex.vars.base import get_unique_variable_name
|
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
"""
if not input_id:
input_id = get_unique_variable_name()
return rx.box(
| from pcweb.components.icons import get_icon |
from typing import List, Optional, Union
import reflex as rx
from reflex.event import EventHandler, EventSpec
from reflex.vars.base import get_unique_variable_name
from pcweb.components.icons import get_icon
|
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
"""
if not input_id:
input_id = get_unique_variable_name()
return rx.box(
rx.el.input(
placeholder=placeho | from pcweb.components.icons.hugeicons import hi |
from typing import List, Optional, Union
import reflex as rx
from reflex.event import EventHandler, EventSpec
from reflex.vars.base import get_unique_variable_name
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
|
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
"""
if not input_id:
input_id = get_unique_variable_name()
return rx.box(
rx.el.input(
placeholder=placeholder,
name=name,
id=in | from pcweb.components.utils.twmerge import cn |
vars.base import get_unique_variable_name
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
"""
|
return rx.box(
rx.el.input(
placeholder=placeholder,
name=name,
id=input_id,
class_name=cn(
"box-border flex flex-row flex-1 gap-2 border-slate-5 bg-slate-1 focus:shadow-[0px_0px_0px_2px_var(--c-violet-4)] px-6 pr-8 border rounded-[0.625rem] h-[2.25rem] font-medium text-slate-12 text-sm placeholder:text-slate-9 outline-none focus:outline-none caret-slate-12 peer pl-2.5 disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 disabled:text-slate-8 disabled:placeholder:text-slate-8",
input_cn,
),
type=type_,
custom_attrs={
"autoComplete": "off",
"autoCorrect": "off",
"data-vaul-no-drag": "",
},
**props,
),
rx.el.button(
get_icon("cancel-circle"),
class_name="right-0 z-10 absolute inset-y-0 flex items-center opacity-100 | if not input_id:
input_id = get_unique_variable_name() |
ue_variable_name
from pcweb.components.icons import get_icon
from pcweb.components.icons.hugeicons import hi
from pcweb.components.utils.twmerge import cn
def user_input(
placeholder: str = "",
name: str = "",
input_id: str = "",
input_cn: str = "",
type_: str = "text",
clear_button_event: list[EventHandler | EventSpec] | None = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create a basic input component.
Args:
placeholder: Placeholder text for the input.
name: Name of the input.
input_id: ID of the input.
input_cn: Additional Tailwind CSS class for input.
type_: Type of the input.
clear_button_event: Event to trigger when clear button is clicked.
class_name: Additional CSS classes to apply to the input component.
**props: Additional props to pass to the input element.
Returns:
rx.Component: A basic input component.
"""
if not input_id:
|
return rx.box(
rx.el.input(
placeholder=placeholder,
name=name,
id=input_id,
class_name=cn(
"box-border flex flex-row flex-1 gap-2 border-slate-5 bg-slate-1 focus:shadow-[0px_0px_0px_2px_var(--c-violet-4)] px-6 pr-8 border rounded-[0.625rem] h-[2.25rem] font-medium text-slate-12 text-sm placeholder:text-slate-9 outline-none focus:outline-none caret-slate-12 peer pl-2.5 disabled:cursor-not-allowed disabled:border disabled:border-slate-5 disabled:!bg-slate-3 disabled:text-slate-8 disabled:placeholder:text-slate-8",
input_cn,
),
type=type_,
custom_attrs={
"autoComplete": "off",
"autoCorrect": "off",
"data-vaul-no-drag": "",
},
**props,
),
rx.el.button(
get_icon("cancel-circle"),
class_name="right-0 z-10 absolute inset-y-0 flex items-center opacity-100 | input_id = get_unique_variable_name() |
Spec]]] = None,
class_name: str = "",
**props,
) -> rx.Component:
"""Create an input component with clear functionality.
Args:
placeholder (str): Placeholder text for the input. Defaults to "".
name (str): Name of the input. Defaults to "".
id (str): ID of the input. Defaults to "".
input_cn (str): Additional Tailwind CSS class for input. Defaults to "".
form_cn (str): Additional Tailwind CSS class for form. Defaults to "".
icon (str): Icon to display in the input. Defaults to "".
type_ (str): Type of the input. Defaults to "text".
clear_button_event (Optional[EventType[[]]]): Event to trigger when clear button is clicked. Defaults to None.
class_name (str): Additional CSS classes to apply to the form component. Defaults to "".
**props: Additional properties to pass to the form element.
Returns:
rx.Component: A form component containing the input and clear button.
"""
|
icon_component = (
rx.box(
hi(
icon,
class_name="!text-slate-9 pointer-events-none",
),
class_name="left-0 z-10 absolute inset-y-0 flex items-center pl-2.5",
)
if icon
else rx.fragment()
)
id = get_unique_variable_name()
return rx.box(
icon_component,
rx.el.input(
placeholder=placeholder,
name=name,
id=id,
class_name=f"box-border flex flex-row flex-1 gap-2 border-slate-5 bg-slate-1 focus:shadow-[0px_0px_0px_2px_var(--c-violet-4)] px-6 pr-8 border rounded-[0.625rem] h-[2.25rem] font-medium text-slate-12 text-sm placeholder:text-slate-9 outline-none focus:outline-none caret-slate-12 peer {padding_left_cn} {input_cn}",
type=type_,
custom_attrs={"autoComplete": "off", "autoCorrect": "off"},
**props,
),
rx.el.button(
get_icon("cancel-circle"),
| padding_left_cn = "pl-8" if icon else "pl-2.5" |
ps,
) -> rx.Component:
"""Create an input component with clear functionality.
Args:
placeholder (str): Placeholder text for the input. Defaults to "".
name (str): Name of the input. Defaults to "".
id (str): ID of the input. Defaults to "".
input_cn (str): Additional Tailwind CSS class for input. Defaults to "".
form_cn (str): Additional Tailwind CSS class for form. Defaults to "".
icon (str): Icon to display in the input. Defaults to "".
type_ (str): Type of the input. Defaults to "text".
clear_button_event (Optional[EventType[[]]]): Event to trigger when clear button is clicked. Defaults to None.
class_name (str): Additional CSS classes to apply to the form component. Defaults to "".
**props: Additional properties to pass to the form element.
Returns:
rx.Component: A form component containing the input and clear button.
"""
padding_left_cn = "pl-8" if icon else "pl-2.5"
|
id = get_unique_variable_name()
return rx.box(
icon_component,
rx.el.input(
placeholder=placeholder,
name=name,
id=id,
class_name=f"box-border flex flex-row flex-1 gap-2 border-slate-5 bg-slate-1 focus:shadow-[0px_0px_0px_2px_var(--c-violet-4)] px-6 pr-8 border rounded-[0.625rem] h-[2.25rem] font-medium text-slate-12 text-sm placeholder:text-slate-9 outline-none focus:outline-none caret-slate-12 peer {padding_left_cn} {input_cn}",
type=type_,
custom_attrs={"autoComplete": "off", "autoCorrect": "off"},
**props,
),
rx.el.button(
get_icon("cancel-circle"),
class_name="right-0 z-10 absolute inset-y-0 flex items-center opacity-100 peer-placeholder-shown:opacity-0 pr-2.5 text-slate-9 hover:text-slate-12 transition-bg peer-placeholder-shown:pointer-events-none",
content_editable=False,
on_click=[
rx.set_val | icon_component = (
rx.box(
hi(
icon,
class_name="!text-slate-9 pointer-events-none",
),
class_name="left-0 z-10 absolute inset-y-0 flex items-center pl-2.5",
)
if icon
else rx.fragment()
) |
Additional Tailwind CSS class for input. Defaults to "".
form_cn (str): Additional Tailwind CSS class for form. Defaults to "".
icon (str): Icon to display in the input. Defaults to "".
type_ (str): Type of the input. Defaults to "text".
clear_button_event (Optional[EventType[[]]]): Event to trigger when clear button is clicked. Defaults to None.
class_name (str): Additional CSS classes to apply to the form component. Defaults to "".
**props: Additional properties to pass to the form element.
Returns:
rx.Component: A form component containing the input and clear button.
"""
padding_left_cn = "pl-8" if icon else "pl-2.5"
icon_component = (
rx.box(
hi(
icon,
class_name="!text-slate-9 pointer-events-none",
),
class_name="left-0 z-10 absolute inset-y-0 flex items-center pl-2.5",
)
if icon
else rx.fragment()
)
|
return rx.box(
icon_component,
rx.el.input(
placeholder=placeholder,
name=name,
id=id,
class_name=f"box-border flex flex-row flex-1 gap-2 border-slate-5 bg-slate-1 focus:shadow-[0px_0px_0px_2px_var(--c-violet-4)] px-6 pr-8 border rounded-[0.625rem] h-[2.25rem] font-medium text-slate-12 text-sm placeholder:text-slate-9 outline-none focus:outline-none caret-slate-12 peer {padding_left_cn} {input_cn}",
type=type_,
custom_attrs={"autoComplete": "off", "autoCorrect": "off"},
**props,
),
rx.el.button(
get_icon("cancel-circle"),
class_name="right-0 z-10 absolute inset-y-0 flex items-center opacity-100 peer-placeholder-shown:opacity-0 pr-2.5 text-slate-9 hover:text-slate-12 transition-bg peer-placeholder-shown:pointer-events-none",
content_editable=False,
on_click=[
rx.set_value(id, ""),
*([clear | id = get_unique_variable_name() |
"""UI and logic inkeep chat component."""
|
from reflex.utils.imports import ImportVar
from reflex.vars import Var
class InkeepSearchBar(rx.NoSSRComponent):
tag = "InkeepSearchBar"
library = "@inkeep/cxkit-react@0.5.55"
class Search(rx.el.Div):
def add_imports(self):
"""Add the imports for the component."""
return {
"react": {ImportVar(tag="useContext")},
"$/utils/context": {ImportVar(tag="ColorModeContext")},
}
def add_hooks(self):
"""Add the hooks for the component."""
return [
"const { resolvedColorMode } = useContext(ColorModeContext)",
"""
const escalationParams = {
type: "object",
properties: {
explanation: {
type: "string",
description: "A brief few word justification of why a specific confidence level was chosen.",
},
answerConfidence: {
anyOf: [
{
type: "string",
const: "very_confident",
description: `\n The AI Assistant provided a comple | import reflex as rx |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.