instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
integrations/light/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0",
),
class_name=ui.cn(
"z-100 flex justify-center items-center size-12 bg-white-1/88 dark:bg-black/20 backdrop-blur-[6px] border border-slate-6 dark:border-[#1C2024] shadow-large",
class_name,
),
)
def integration_card_light_dark(icon: str, class_name: str = ""):
return rx.el.div(
rx.image(
src=f"/landing/integrations/light/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 dark:hidden",
),
rx.image(
src=f"/landing/integrations/dark/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 hidden dark:block",
),
class_name=ui.cn(
"z-100 flex justify-center items-center size-12 bg-white-1/88 dark:bg-black/20 backdrop-blur-[6px] border border-slate-6 dark:border-[#1C2024] shadow-large",
class_name,
),
)
|
def databricks_card():
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
)
def user_profile():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/app_build/user.webp",
class_name="object-cover pointer-events-none",
),
class_name="size-10 bg-violet-5 dark:bg-[#E1D9FF] rounded-full border border-violet-7 overflow-hidden",
),
rx.el.span(
"Amelia Wong",
class_name="text-slate-12 text-sm font-semibold",
),
get_icon("arrow-fill-down", class_name="size-4 text-slate-9 -ml-2"),
class_name=f"flex flex-row items-center gap-4 animate-slide-in-left animate-duration-{DURATION_USER_PROFILE} animate-ease-out animate-delay-{DELA | def okta_card():
return integration_card_light_dark(
"okta",
class_name=f"rounded-t-[14px] rounded-bl-[14px] rounded-br-[4px] absolute top-2 left-2 animate-scale-rotate-in animate-duration-{DURATION_OKTA} animate-ease-out animate-delay-{DELAY_OKTA}",
) |
C2024] shadow-large",
class_name,
),
)
def integration_card_light_dark(icon: str, class_name: str = ""):
return rx.el.div(
rx.image(
src=f"/landing/integrations/light/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 dark:hidden",
),
rx.image(
src=f"/landing/integrations/dark/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 hidden dark:block",
),
class_name=ui.cn(
"z-100 flex justify-center items-center size-12 bg-white-1/88 dark:bg-black/20 backdrop-blur-[6px] border border-slate-6 dark:border-[#1C2024] shadow-large",
class_name,
),
)
def okta_card():
return integration_card_light_dark(
"okta",
class_name=f"rounded-t-[14px] rounded-bl-[14px] rounded-br-[4px] absolute top-2 left-2 animate-scale-rotate-in animate-duration-{DURATION_OKTA} animate-ease-out animate-delay-{DELAY_OKTA}",
)
|
def user_profile():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/app_build/user.webp",
class_name="object-cover pointer-events-none",
),
class_name="size-10 bg-violet-5 dark:bg-[#E1D9FF] rounded-full border border-violet-7 overflow-hidden",
),
rx.el.span(
"Amelia Wong",
class_name="text-slate-12 text-sm font-semibold",
),
get_icon("arrow-fill-down", class_name="size-4 text-slate-9 -ml-2"),
class_name=f"flex flex-row items-center gap-4 animate-slide-in-left animate-duration-{DURATION_USER_PROFILE} animate-ease-out animate-delay-{DELAY_USER_PROFILE}",
)
def slack_alert():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/integrations/light/slack.svg",
class_name="size-full pointer-events-none shrink-0 object-cover",
),
class_name="size-9 bg-white-1 | def databricks_card():
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
) |
),
rx.image(
src=f"/landing/integrations/dark/{icon}.svg",
class_name="size-7 pointer-events-none shrink-0 hidden dark:block",
),
class_name=ui.cn(
"z-100 flex justify-center items-center size-12 bg-white-1/88 dark:bg-black/20 backdrop-blur-[6px] border border-slate-6 dark:border-[#1C2024] shadow-large",
class_name,
),
)
def okta_card():
return integration_card_light_dark(
"okta",
class_name=f"rounded-t-[14px] rounded-bl-[14px] rounded-br-[4px] absolute top-2 left-2 animate-scale-rotate-in animate-duration-{DURATION_OKTA} animate-ease-out animate-delay-{DELAY_OKTA}",
)
def databricks_card():
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
)
|
def slack_alert():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/integrations/light/slack.svg",
class_name="size-full pointer-events-none shrink-0 object-cover",
),
class_name="size-9 bg-white-1 dark:bg-white rounded-[8px] border-[0.5px] border-slate-6 dark:border-[#1C2024] overflow-hidden flex justify-center items-center p-1 shadow-small shrink-0",
),
rx.el.div(
rx.el.p(
"New message from Reflex",
class_name="text-slate-12 text-sm font-semibold",
),
rx.el.p(
"Metrics reached critical level of 93%",
rx.el.br(),
"Please, check it.",
class_name="text-slate-11 text-xs font-medium word-wrap",
),
class_name="flex flex-col",
),
rx.el.span(
"now",
class_name="absolute top-3 right-2 text-xs text-s | def user_profile():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/app_build/user.webp",
class_name="object-cover pointer-events-none",
),
class_name="size-10 bg-violet-5 dark:bg-[#E1D9FF] rounded-full border border-violet-7 overflow-hidden",
),
rx.el.span(
"Amelia Wong",
class_name="text-slate-12 text-sm font-semibold",
),
get_icon("arrow-fill-down", class_name="size-4 text-slate-9 -ml-2"),
class_name=f"flex flex-row items-center gap-4 animate-slide-in-left animate-duration-{DURATION_USER_PROFILE} animate-ease-out animate-delay-{DELAY_USER_PROFILE}",
) |
return integration_card(
"databricks",
class_name=f"rounded-t-[14px] rounded-br-[14px] rounded-bl-[4px] absolute top-[5.25rem] right-[11rem] animate-scale-rotate-in animate-duration-{DURATION_DATABRICKS} animate-ease-out animate-delay-{DELAY_DATABRICKS}",
)
def user_profile():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/app_build/user.webp",
class_name="object-cover pointer-events-none",
),
class_name="size-10 bg-violet-5 dark:bg-[#E1D9FF] rounded-full border border-violet-7 overflow-hidden",
),
rx.el.span(
"Amelia Wong",
class_name="text-slate-12 text-sm font-semibold",
),
get_icon("arrow-fill-down", class_name="size-4 text-slate-9 -ml-2"),
class_name=f"flex flex-row items-center gap-4 animate-slide-in-left animate-duration-{DURATION_USER_PROFILE} animate-ease-out animate-delay-{DELAY_USER_PROFILE}",
)
|
def metrics_tabs():
return rx.el.div(
rx.el.div(
rx.el.span(
"All",
class_name="text-slate-10 text-xs font-medium size-full text-center bg-slate-2 overflow-hidden flex items-center justify-center",
),
rx.el.span(
"Critical",
class_name="text-slate-10 text-xs font-medium size-full text-center overflow-hidden flex items-center justify-center",
),
rx.el.span(
"Normal",
class_name="text-slate-10 text-xs font-medium size-full text-center overflow-hidden flex items-center justify-center",
),
class_name="flex flex-row items-center w-[246px] h-[32px] rounded-[8px] bg-white-1 dark:bg-[#151618] border border-slate-4 dark:border-[#1C2024] divide-x divide-slate-4 dark:divide-[#1C2024] overflow-hidden",
),
class_name=f"w-full h-[32px] animate-slide-in-right animate-duration-{DURATION_METRICS | def slack_alert():
return rx.el.div(
rx.el.div(
rx.image(
src="/landing/integrations/light/slack.svg",
class_name="size-full pointer-events-none shrink-0 object-cover",
),
class_name="size-9 bg-white-1 dark:bg-white rounded-[8px] border-[0.5px] border-slate-6 dark:border-[#1C2024] overflow-hidden flex justify-center items-center p-1 shadow-small shrink-0",
),
rx.el.div(
rx.el.p(
"New message from Reflex",
class_name="text-slate-12 text-sm font-semibold",
),
rx.el.p(
"Metrics reached critical level of 93%",
rx.el.br(),
"Please, check it.",
class_name="text-slate-11 text-xs font-medium word-wrap",
),
class_name="flex flex-col",
),
rx.el.span(
"now",
class_name="absolute top-3 right-2 text-xs text-slate-7 dark:text-slate-9 font-medium",
),
style={
"box-shadow": "0 25px 7px 0 rgba(0, 0, 0, 0.00), 0 16px 6px 0 rgba(0, 0, 0, 0.01), 0 9px 5px 0 rgba(0, 0, 0, 0.03), 0 4px 4px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"
},
class_name=f"flex flex-row items-center gap-3.5 border border-slate-6 dark:border-[#1C2024] h-[4.5rem] w-[20.375rem] rounded-[0.875rem] px-3 absolute top-2 right-2 z-[10] bg-white/88 dark:bg-black/20 backdrop-blur-[6px] animate-scale-in-top-right animate-duration-{DURATION_SLACK} animate-ease-out animate-delay-{DELAY_SLACK}",
) |
,
rx.el.p(
"Metrics reached critical level of 93%",
rx.el.br(),
"Please, check it.",
class_name="text-slate-11 text-xs font-medium word-wrap",
),
class_name="flex flex-col",
),
rx.el.span(
"now",
class_name="absolute top-3 right-2 text-xs text-slate-7 dark:text-slate-9 font-medium",
),
style={
"box-shadow": "0 25px 7px 0 rgba(0, 0, 0, 0.00), 0 16px 6px 0 rgba(0, 0, 0, 0.01), 0 9px 5px 0 rgba(0, 0, 0, 0.03), 0 4px 4px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.05)"
},
class_name=f"flex flex-row items-center gap-3.5 border border-slate-6 dark:border-[#1C2024] h-[4.5rem] w-[20.375rem] rounded-[0.875rem] px-3 absolute top-2 right-2 z-[10] bg-white/88 dark:bg-black/20 backdrop-blur-[6px] animate-scale-in-top-right animate-duration-{DURATION_SLACK} animate-ease-out animate-delay-{DELAY_SLACK}",
)
|
def metrics_header():
return rx.el.div(
rx.el.div(
rx.html(
"""<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M64 32C64 49.6731 49.6731 64 32 64C14.3269 64 0 49.6731 0 32C0 14.3269 14.3269 0 32 0C49.6731 0 64 14.3269 64 32ZM5.36 32C5.36 46.7129 17.2871 58.64 32 58.64C46.7129 58.64 58.64 46.7129 58.64 32C58.64 17.2871 46.7129 5.36 32 5.36C17.2871 5.36 5.36 17.2871 5.36 32Z" fill="#E8E8EC"/>
<g clip-path="url(#paint0_angular_17892_9711_clip_path)" data-figma-skip-parse="true"><g transform="matrix(0 -0.032 -0.032 0 32 32)"><foreignObject x="-1031.25" y="-1031.25" width="2062.5" height="2062.5"><div xmlns="http://www.w3.org/1999/xhtml" style="background:conic-gradient(from 90deg,rgba(220, 62, 66, 1) 0deg,rgba(229, 72, 77, 1) 90deg,rgba(170, 153, 236, 1) 180deg,rgba(170, 153, 236, 1) 360deg);height:100%;width:100%;opacity:1"></div></foreignObject></g></g><path d="M32 2.68C32 1.19988 33.2021 | def metrics_tabs():
return rx.el.div(
rx.el.div(
rx.el.span(
"All",
class_name="text-slate-10 text-xs font-medium size-full text-center bg-slate-2 overflow-hidden flex items-center justify-center",
),
rx.el.span(
"Critical",
class_name="text-slate-10 text-xs font-medium size-full text-center overflow-hidden flex items-center justify-center",
),
rx.el.span(
"Normal",
class_name="text-slate-10 text-xs font-medium size-full text-center overflow-hidden flex items-center justify-center",
),
class_name="flex flex-row items-center w-[246px] h-[32px] rounded-[8px] bg-white-1 dark:bg-[#151618] border border-slate-4 dark:border-[#1C2024] divide-x divide-slate-4 dark:divide-[#1C2024] overflow-hidden",
),
class_name=f"w-full h-[32px] animate-slide-in-right animate-duration-{DURATION_METRICS_TABS} animate-ease-out animate-delay-{DELAY_METRICS_TABS} pl-6",
) |
center text-red-10 text-base font-[565] leading-[21px] font-mono z-10",
),
class_name="relative size-16 flex-none",
),
rx.el.div(
rx.el.span(
"Metrics",
class_name="text-slate-12 text-lg font-semibold",
),
rx.el.div(
get_icon("alert"),
"Critical Level",
class_name=f"text-red-10 dark:text-white bg-red-2 dark:bg-[#641723] border-red-6 dark:border-[#641723] border flex flex-row items-center gap-1.5 text-xs font-medium rounded-md px-1.5 h-[24px] animate-delay-{DELAY_METRICS_BADGE} animate-duration-{DURATION_METRICS_BADGE} animate-slide-in-right animate-ease-out",
),
class_name="flex flex-col gap-2",
),
class_name=f"flex flex-row gap-6 w-full justify-start relative animate-slide-in-right animate-duration-{DURATION_METRICS_HEADER} animate-ease-out animate-delay-{DELAY_METRICS_HEADER} pl-6",
)
|
def metrics_card():
return rx.el.div(
rx.el.div(
progressive_blur(
steps=16,
strength=6,
side="right",
fall_of_percentage=100,
class_name="w-[1.45rem] inset-y-0 absolute right-0 z-50 pointer-events-none",
),
metrics_header(),
metrics_tabs(),
class_name="flex flex-col gap-6 relative items-center w-full justify-start",
),
metrics_content(),
class_name="flex flex-col gap-6 justify-start items-center min-w-[18.375rem] pt-6 overflow-hidden",
)
def graph_y_axis():
return rx.el.div(
*[
rx.el.div(
rx.el.span(
f"{i}",
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute left-10 top-1/2 -translate-y-1/2",
),
| def metrics_content():
def metrics_row(name: str, value: str, time: str):
return rx.el.div(
rx.el.span(name, class_name="text-slate-9 text-sm font-medium w-[72px]"),
rx.el.span(value, class_name="text-slate-9 text-sm font-medium w-[46px]"),
rx.el.span(
time, class_name="text-slate-9 text-sm font-medium text-end ml-auto"
),
class_name="flex flex-row items-center h-[48px] px-6 py-4 gap-4",
)
return rx.el.div(
metrics_row("Critical", "93%", "Now"),
metrics_row("Normal", "32%", "12:42"),
metrics_row("Critical", "89%", "09:41"),
metrics_row("Normal", "34%", "08:14"),
metrics_row("Normal", "12%", "05:36"),
class_name=f"flex flex-col w-[294px] divide-y divide-slate-4 border-t border-slate-3 animate-slide-in-up animate-delay-{DELAY_METRICS_CONTENT} animate-ease-out animate-duration-{DURATION_METRICS_CONTENT}",
) |
e font-[565] leading-[21px] font-mono z-10",
),
class_name="relative size-16 flex-none",
),
rx.el.div(
rx.el.span(
"Metrics",
class_name="text-slate-12 text-lg font-semibold",
),
rx.el.div(
get_icon("alert"),
"Critical Level",
class_name=f"text-red-10 dark:text-white bg-red-2 dark:bg-[#641723] border-red-6 dark:border-[#641723] border flex flex-row items-center gap-1.5 text-xs font-medium rounded-md px-1.5 h-[24px] animate-delay-{DELAY_METRICS_BADGE} animate-duration-{DURATION_METRICS_BADGE} animate-slide-in-right animate-ease-out",
),
class_name="flex flex-col gap-2",
),
class_name=f"flex flex-row gap-6 w-full justify-start relative animate-slide-in-right animate-duration-{DURATION_METRICS_HEADER} animate-ease-out animate-delay-{DELAY_METRICS_HEADER} pl-6",
)
def metrics_content():
|
return rx.el.div(
metrics_row("Critical", "93%", "Now"),
metrics_row("Normal", "32%", "12:42"),
metrics_row("Critical", "89%", "09:41"),
metrics_row("Normal", "34%", "08:14"),
metrics_row("Normal", "12%", "05:36"),
class_name=f"flex flex-col w-[294px] divide-y divide-slate-4 border-t border-slate-3 animate-slide-in-up animate-delay-{DELAY_METRICS_CONTENT} animate-ease-out animate-duration-{DURATION_METRICS_CONTENT}",
)
def metrics_card():
return rx.el.div(
rx.el.div(
progressive_blur(
steps=16,
strength=6,
side="right",
fall_of_percentage=100,
class_name="w-[1.45rem] inset-y-0 absolute right-0 z-50 pointer-events-none",
),
metrics_header(),
metrics_tabs(),
class_name="flex flex-col gap-6 relative items-center w-full justify-start",
),
metrics_content(),
| def metrics_row(name: str, value: str, time: str):
return rx.el.div(
rx.el.span(name, class_name="text-slate-9 text-sm font-medium w-[72px]"),
rx.el.span(value, class_name="text-slate-9 text-sm font-medium w-[46px]"),
rx.el.span(
time, class_name="text-slate-9 text-sm font-medium text-end ml-auto"
),
class_name="flex flex-row items-center h-[48px] px-6 py-4 gap-4",
) |
TRICS_HEADER} pl-6",
)
def metrics_content():
def metrics_row(name: str, value: str, time: str):
return rx.el.div(
rx.el.span(name, class_name="text-slate-9 text-sm font-medium w-[72px]"),
rx.el.span(value, class_name="text-slate-9 text-sm font-medium w-[46px]"),
rx.el.span(
time, class_name="text-slate-9 text-sm font-medium text-end ml-auto"
),
class_name="flex flex-row items-center h-[48px] px-6 py-4 gap-4",
)
return rx.el.div(
metrics_row("Critical", "93%", "Now"),
metrics_row("Normal", "32%", "12:42"),
metrics_row("Critical", "89%", "09:41"),
metrics_row("Normal", "34%", "08:14"),
metrics_row("Normal", "12%", "05:36"),
class_name=f"flex flex-col w-[294px] divide-y divide-slate-4 border-t border-slate-3 animate-slide-in-up animate-delay-{DELAY_METRICS_CONTENT} animate-ease-out animate-duration-{DURATION_METRICS_CONTENT}",
)
|
def graph_y_axis():
return rx.el.div(
*[
rx.el.div(
rx.el.span(
f"{i}",
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute left-10 top-1/2 -translate-y-1/2",
),
class_name="relative",
)
for i in [64, 48, 32, 24, 16, 8, 4]
],
class_name=f"flex flex-col items-end gap-7 w-4 pt-9 animate-slide-in-up animate-duration-{DURATION_GRAPH_Y_AXIS} animate-ease-out animate-delay-{DELAY_GRAPH_Y_AXIS}",
)
def stacked_bar_chart(primary_height: int = 8, secondary_height: int = 16):
return rx.el.div(
rx.el.div(
height=f"{primary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-8 absolute bottom-0 left-0 z-20",
),
rx.el.div(
height=f"{secondary_height}rem",
| def metrics_card():
return rx.el.div(
rx.el.div(
progressive_blur(
steps=16,
strength=6,
side="right",
fall_of_percentage=100,
class_name="w-[1.45rem] inset-y-0 absolute right-0 z-50 pointer-events-none",
),
metrics_header(),
metrics_tabs(),
class_name="flex flex-col gap-6 relative items-center w-full justify-start",
),
metrics_content(),
class_name="flex flex-col gap-6 justify-start items-center min-w-[18.375rem] pt-6 overflow-hidden",
) |
"12:42"),
metrics_row("Critical", "89%", "09:41"),
metrics_row("Normal", "34%", "08:14"),
metrics_row("Normal", "12%", "05:36"),
class_name=f"flex flex-col w-[294px] divide-y divide-slate-4 border-t border-slate-3 animate-slide-in-up animate-delay-{DELAY_METRICS_CONTENT} animate-ease-out animate-duration-{DURATION_METRICS_CONTENT}",
)
def metrics_card():
return rx.el.div(
rx.el.div(
progressive_blur(
steps=16,
strength=6,
side="right",
fall_of_percentage=100,
class_name="w-[1.45rem] inset-y-0 absolute right-0 z-50 pointer-events-none",
),
metrics_header(),
metrics_tabs(),
class_name="flex flex-col gap-6 relative items-center w-full justify-start",
),
metrics_content(),
class_name="flex flex-col gap-6 justify-start items-center min-w-[18.375rem] pt-6 overflow-hidden",
)
|
def stacked_bar_chart(primary_height: int = 8, secondary_height: int = 16):
return rx.el.div(
rx.el.div(
height=f"{primary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-8 absolute bottom-0 left-0 z-20",
),
rx.el.div(
height=f"{secondary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-3 dark:bg-[#151618] absolute bottom-0 left-0 z-10",
),
class_name="relative h-full w-4",
)
def graph_chart():
return rx.el.div(
graph_y_axis(),
rx.el.div(
stacked_bar_chart(primary_height=8.4375, secondary_height=16),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=14.75, secondary_height=16),
stacked_bar_chart(primary_height=11.25, secondary_height=15.0625),
stacked_bar_chart(primary_height=12.9375, secondary_height=16),
stacked_bar_chart(primary_height=14.375 | def graph_y_axis():
return rx.el.div(
*[
rx.el.div(
rx.el.span(
f"{i}",
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute left-10 top-1/2 -translate-y-1/2",
),
class_name="relative",
)
for i in [64, 48, 32, 24, 16, 8, 4]
],
class_name=f"flex flex-col items-end gap-7 w-4 pt-9 animate-slide-in-up animate-duration-{DURATION_GRAPH_Y_AXIS} animate-ease-out animate-delay-{DELAY_GRAPH_Y_AXIS}",
) |
ter-events-none",
),
metrics_header(),
metrics_tabs(),
class_name="flex flex-col gap-6 relative items-center w-full justify-start",
),
metrics_content(),
class_name="flex flex-col gap-6 justify-start items-center min-w-[18.375rem] pt-6 overflow-hidden",
)
def graph_y_axis():
return rx.el.div(
*[
rx.el.div(
rx.el.span(
f"{i}",
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute left-10 top-1/2 -translate-y-1/2",
),
class_name="relative",
)
for i in [64, 48, 32, 24, 16, 8, 4]
],
class_name=f"flex flex-col items-end gap-7 w-4 pt-9 animate-slide-in-up animate-duration-{DURATION_GRAPH_Y_AXIS} animate-ease-out animate-delay-{DELAY_GRAPH_Y_AXIS}",
)
|
def graph_chart():
return rx.el.div(
graph_y_axis(),
rx.el.div(
stacked_bar_chart(primary_height=8.4375, secondary_height=16),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=14.75, secondary_height=16),
stacked_bar_chart(primary_height=11.25, secondary_height=15.0625),
stacked_bar_chart(primary_height=12.9375, secondary_height=16),
stacked_bar_chart(primary_height=14.375, secondary_height=16),
stacked_bar_chart(primary_height=8.625, secondary_height=12.3125),
stacked_bar_chart(primary_height=10.75, secondary_height=13.3125),
stacked_bar_chart(primary_height=7.3125, secondary_height=12.3125),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=9.875, secondary_height=15.0625),
stacked_bar_chart(primary_height=6.75, secondary_height=1 | def stacked_bar_chart(primary_height: int = 8, secondary_height: int = 16):
return rx.el.div(
rx.el.div(
height=f"{primary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-8 absolute bottom-0 left-0 z-20",
),
rx.el.div(
height=f"{secondary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-3 dark:bg-[#151618] absolute bottom-0 left-0 z-10",
),
class_name="relative h-full w-4",
) |
class_name="text-slate-9 text-xs font-medium",
),
rx.el.div(
class_name="h-[0.5px] bg-slate-3 w-[524px] absolute left-10 top-1/2 -translate-y-1/2",
),
class_name="relative",
)
for i in [64, 48, 32, 24, 16, 8, 4]
],
class_name=f"flex flex-col items-end gap-7 w-4 pt-9 animate-slide-in-up animate-duration-{DURATION_GRAPH_Y_AXIS} animate-ease-out animate-delay-{DELAY_GRAPH_Y_AXIS}",
)
def stacked_bar_chart(primary_height: int = 8, secondary_height: int = 16):
return rx.el.div(
rx.el.div(
height=f"{primary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-8 absolute bottom-0 left-0 z-20",
),
rx.el.div(
height=f"{secondary_height}rem",
class_name="w-4 rounded-t-sm bg-violet-3 dark:bg-[#151618] absolute bottom-0 left-0 z-10",
),
class_name="relative h-full w-4",
)
|
def graph_overview():
return rx.el.div(
databricks_card(),
rx.el.div(
rx.el.div(
rx.el.span(
"Overview",
class_name="text-slate-12 text-2xl font-semibold",
),
rx.el.div(
rx.el.div(
rx.el.span(class_name="size-4 rounded-sm bg-violet-8"),
"Peak Performance",
class_name="flex flex-row items-center gap-2 text-xs font-medium text-slate-10",
),
rx.el.div(
rx.el.span(
class_name="size-4 rounded-sm bg-violet-4 dark:bg-[#151618]"
),
"Capacity Per Day",
class_name="flex flex-row items-center gap-2 text-xs font-medium text-slate-10",
),
class_name="flex flex-row items-center gap-4",
| def graph_chart():
return rx.el.div(
graph_y_axis(),
rx.el.div(
stacked_bar_chart(primary_height=8.4375, secondary_height=16),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=14.75, secondary_height=16),
stacked_bar_chart(primary_height=11.25, secondary_height=15.0625),
stacked_bar_chart(primary_height=12.9375, secondary_height=16),
stacked_bar_chart(primary_height=14.375, secondary_height=16),
stacked_bar_chart(primary_height=8.625, secondary_height=12.3125),
stacked_bar_chart(primary_height=10.75, secondary_height=13.3125),
stacked_bar_chart(primary_height=7.3125, secondary_height=12.3125),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=9.875, secondary_height=15.0625),
stacked_bar_chart(primary_height=6.75, secondary_height=16),
class_name=f"flex flex-row justify-between w-full animate-slide-in-up animate-duration-{DURATION_GRAPH_BARS} animate-ease-out animate-delay-{DELAY_GRAPH_BARS}",
),
class_name="flex flex-row gap-6 w-full px-8 pt-8 border border-slate-4 dark:border-[#1C2024] rounded-t-lg overflow-hidden h-[408px]",
) |
t(primary_height=11.25, secondary_height=15.0625),
stacked_bar_chart(primary_height=12.9375, secondary_height=16),
stacked_bar_chart(primary_height=14.375, secondary_height=16),
stacked_bar_chart(primary_height=8.625, secondary_height=12.3125),
stacked_bar_chart(primary_height=10.75, secondary_height=13.3125),
stacked_bar_chart(primary_height=7.3125, secondary_height=12.3125),
stacked_bar_chart(primary_height=13.25, secondary_height=16),
stacked_bar_chart(primary_height=9.875, secondary_height=15.0625),
stacked_bar_chart(primary_height=6.75, secondary_height=16),
class_name=f"flex flex-row justify-between w-full animate-slide-in-up animate-duration-{DURATION_GRAPH_BARS} animate-ease-out animate-delay-{DELAY_GRAPH_BARS}",
),
class_name="flex flex-row gap-6 w-full px-8 pt-8 border border-slate-4 dark:border-[#1C2024] rounded-t-lg overflow-hidden h-[408px]",
)
|
def app_build():
return rx.el.section(
slack_alert(),
okta_card(),
rx.el.div(
rx.el.div(
rx.el.div(
rx.el.div(
class_name="w-[0.95rem] inset-y-0 absolute left-0 z-50 pointer-events-none backdrop-blur-[1px]",
),
user_profile(),
class_name="h-[4.5rem] shrink-0 w-full",
),
class_name="w-full h-[4.5rem] shrink-0 relative p-4 overflow-hidden rounded-t-[32px]",
),
rx.el.div(
height="0.5px",
class_name=f"w-full bg-slate-4 dark:bg-[#1C2024] animate-fade animate-duration-{DURATION_DIVIDER} animate-ease-out animate-delay-{DELAY_DIVIDER} shrink-0",
),
rx.el.div(
graph_overview(),
metrics_card(),
class_name="flex flex-row size-full",
),
progressive_blur(
| def graph_overview():
return rx.el.div(
databricks_card(),
rx.el.div(
rx.el.div(
rx.el.span(
"Overview",
class_name="text-slate-12 text-2xl font-semibold",
),
rx.el.div(
rx.el.div(
rx.el.span(class_name="size-4 rounded-sm bg-violet-8"),
"Peak Performance",
class_name="flex flex-row items-center gap-2 text-xs font-medium text-slate-10",
),
rx.el.div(
rx.el.span(
class_name="size-4 rounded-sm bg-violet-4 dark:bg-[#151618]"
),
"Capacity Per Day",
class_name="flex flex-row items-center gap-2 text-xs font-medium text-slate-10",
),
class_name="flex flex-row items-center gap-4",
),
class_name="flex flex-col gap-6",
),
rx.el.div(
"24 June ",
rx.el.span(" - ", class_name="text-slate-8 ml-0.5"),
" Today",
class_name="text-slate-10 dark:text-slate-9 text-sm font-medium rounded-lg px-3.5 h-8 border border-slate-4 dark:border-[#1C2024] bg-white-1 flex items-center",
),
class_name="flex flex-row justify-between items-baseline w-full",
),
graph_chart(),
class_name=f"flex flex-col gap-6 size-full border-r border-slate-4 dark:border-[#1C2024] px-6 pt-6 animate-slide-in-up animate-duration-{DURATION_GRAPH_OVERVIEW} animate-ease-out animate-delay-{DELAY_GRAPH_OVERVIEW} h-[408px] relative",
) |
apacity Per Day",
class_name="flex flex-row items-center gap-2 text-xs font-medium text-slate-10",
),
class_name="flex flex-row items-center gap-4",
),
class_name="flex flex-col gap-6",
),
rx.el.div(
"24 June ",
rx.el.span(" - ", class_name="text-slate-8 ml-0.5"),
" Today",
class_name="text-slate-10 dark:text-slate-9 text-sm font-medium rounded-lg px-3.5 h-8 border border-slate-4 dark:border-[#1C2024] bg-white-1 flex items-center",
),
class_name="flex flex-row justify-between items-baseline w-full",
),
graph_chart(),
class_name=f"flex flex-col gap-6 size-full border-r border-slate-4 dark:border-[#1C2024] px-6 pt-6 animate-slide-in-up animate-duration-{DURATION_GRAPH_OVERVIEW} animate-ease-out animate-delay-{DELAY_GRAPH_OVERVIEW} h-[408px] relative",
)
| def app_build():
return rx.el.section(
slack_alert(),
okta_card(),
rx.el.div(
rx.el.div(
rx.el.div(
rx.el.div(
class_name="w-[0.95rem] inset-y-0 absolute left-0 z-50 pointer-events-none backdrop-blur-[1px]",
),
user_profile(),
class_name="h-[4.5rem] shrink-0 w-full",
),
class_name="w-full h-[4.5rem] shrink-0 relative p-4 overflow-hidden rounded-t-[32px]",
),
rx.el.div(
height="0.5px",
class_name=f"w-full bg-slate-4 dark:bg-[#1C2024] animate-fade animate-duration-{DURATION_DIVIDER} animate-ease-out animate-delay-{DELAY_DIVIDER} shrink-0",
),
rx.el.div(
graph_overview(),
metrics_card(),
class_name="flex flex-row size-full",
),
progressive_blur(
steps=16,
strength=6,
side="bottom",
fall_of_percentage=100,
class_name="h-[9rem] inset-x-0 absolute bottom-0 z-50 pointer-events-none -mb-1",
),
class_name="border-t border-x border-slate-4 dark:border-[#1C2024] rounded-t-[32px] bg-white-1 relative size-full shadow-[0px_2px_16px_0px_rgba(28,32,36,0.04)] flex flex-col",
),
class_name="flex flex-col justify-center items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 relative overflow-hidden border-t px-6 pt-6 h-[504px] max-lg:hidden",
) | |
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us buil | import reflex as rx | |
import reflex as rx
|
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient i | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
" | from reflex.experimental import ClientStateVar |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
|
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
"picture": "/favicon.ico",
"role": "Principa | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
|
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
"picture": "/favicon.ico",
"role": "Principal Engineer",
},
"autodesk": {
"company_name": "Autodesk",
"quote": "One person can do the job of two with | company_cs = ClientStateVar.create("company", "") |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
|
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
"picture": "/favicon.ico",
"role": "Principal Engineer",
},
"autodesk": {
"company_name": "Autodesk",
"quote": "One person can do the job of two with Reflex, so it cut our cost in half. I am able to wear all the caps at | area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0) |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
|
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
"picture": "/favicon.ico",
"role": "Principal Engineer",
},
"autodesk": {
"company_name": "Autodesk",
"quote": "One person can do the job of two with Reflex, so it cut our cost in half. I am able to wear all the caps at once: Solution Architecture, UI/UX, front-end and back-end.",
| area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0) |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
|
companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
]
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
"picture": "/favicon.ico",
"role": "Principal Engineer",
},
"autodesk": {
"company_name": "Autodesk",
"quote": "One person can do the job of two with Reflex, so it cut our cost in half. I am able to wear all the caps at once: Solution Architecture, UI/UX, front-end and back-end.",
"person": "Paolo",
"picture": "/favicon.ico",
"role": " | area_opacity = ClientStateVar.create(var_name="area_opacity", default=0) |
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.icons.icons import get_icon
from pcweb.pages.framework.views.companies import companies as index_companies
company_cs = ClientStateVar.create("company", "")
area_x_pos = ClientStateVar.create(var_name="area_x_pos", default=0)
area_y_pos = ClientStateVar.create(var_name="area_y_pos", default=0)
area_opacity = ClientStateVar.create(var_name="area_opacity", default=0)
|
companies_case_studies = {
"dell": {
"company_name": "Dell",
"quote": """Reflex has been a game changer.
In just a week, I had a demo up and running with excellent performance.
It made the project feasible for my support team, helping us build a smooth, efficient interface.""",
"person": "JL",
"picture": "/favicon.ico",
"role": "Principal Engineer",
},
"autodesk": {
"company_name": "Autodesk",
"quote": "One person can do the job of two with Reflex, so it cut our cost in half. I am able to wear all the caps at once: Solution Architecture, UI/UX, front-end and back-end.",
"person": "Paolo",
"picture": "/favicon.ico",
"role": "Principal Consultant",
"url": "/customers/autodesk",
},
"fastly": {
"company_name": "Fastly",
"quote": "Migrating our cybersecurity app from Streamlit to Reflex has been excellent. We quickly built a unified interface connecti | companies_list = [
"apple",
"microsoft",
"amazon",
"fastly",
"accenture",
"ibm",
"unicef",
"autodesk",
"STATS",
"sellerx",
"ford",
"paloalto",
"bosch",
"dell",
"twilio",
"rappi",
"nike",
] |
"unicef": {
# "company_name": "Unicef",
# "quote": """Reflex made it easy to focus on building my app with pure Python and integrate the components I needed without the hassle of learning new front-end frameworks.
# It integrates seamlessly with Microsoft Azure, making deployment and scaling smooth and efficient.""",
# "person": "Lakshmi",
# "picture": "/favicon.ico",
# "role": "Data Science Specialist",
# },
"sellerx": {
"company_name": "SellerX",
"quote": """With Reflex, we're able to ingest 100 GB of data and over 500,000 data points daily, all while developing ten times faster than with React and FastAPI.
The built-in AG Grid functionality seamlessly integrates, making it the perfect solution for handling and visualizing large-scale data efficiently.""",
"person": "Mike",
"picture": "/favicon.ico",
"role": "Head of AI & Automation",
"url": "/customers/sellerx",
},
}
|
def stat(stat: str, text: str) -> rx.Component:
return rx.el.section(
get_icon("feather_unstyled", class_name="text-primary-9"),
rx.box(
rx.text(
stat,
class_name="text-3xl inline-block text-slate-12 font-semibold w-full text-balance text-center",
),
rx.text(text, class_name="text-sm text-slate-9 font-medium"),
class_name="flex flex-col justify-center items-center text-center text-nowrap",
),
get_icon("feather_unstyled", class_name="scale-x-[-1] text-primary-9"),
class_name="flex flex-row items-center gap-4 justify-center",
)
def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
),
rx.b | companies_case_studies_var = rx.Var.create(companies_case_studies) |
"Reflex made it easy to focus on building my app with pure Python and integrate the components I needed without the hassle of learning new front-end frameworks.
# It integrates seamlessly with Microsoft Azure, making deployment and scaling smooth and efficient.""",
# "person": "Lakshmi",
# "picture": "/favicon.ico",
# "role": "Data Science Specialist",
# },
"sellerx": {
"company_name": "SellerX",
"quote": """With Reflex, we're able to ingest 100 GB of data and over 500,000 data points daily, all while developing ten times faster than with React and FastAPI.
The built-in AG Grid functionality seamlessly integrates, making it the perfect solution for handling and visualizing large-scale data efficiently.""",
"person": "Mike",
"picture": "/favicon.ico",
"role": "Head of AI & Automation",
"url": "/customers/sellerx",
},
}
companies_case_studies_var = rx.Var.create(companies_case_studies)
|
def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
),
rx.box(
ui.gradient_profile(
seed=case_study["person"],
class_name="size-6 rounded-full",
),
rx.box(
rx.text(
f"{case_study['person']}",
class_name="text-xs text-slate-10 font-medium",
),
rx.text(
case_study["role"],
class_name="text-xs text-slate-9 font-medium",
),
),
class_name="flex flex-row items-center gap-2 w-full animate-fade animate-duration-[550ms] animate-ease-out animate-fill-both",
),
)
def case_study | def stat(stat: str, text: str) -> rx.Component:
return rx.el.section(
get_icon("feather_unstyled", class_name="text-primary-9"),
rx.box(
rx.text(
stat,
class_name="text-3xl inline-block text-slate-12 font-semibold w-full text-balance text-center",
),
rx.text(text, class_name="text-sm text-slate-9 font-medium"),
class_name="flex flex-col justify-center items-center text-center text-nowrap",
),
get_icon("feather_unstyled", class_name="scale-x-[-1] text-primary-9"),
class_name="flex flex-row items-center gap-4 justify-center",
) |
seamlessly integrates, making it the perfect solution for handling and visualizing large-scale data efficiently.""",
"person": "Mike",
"picture": "/favicon.ico",
"role": "Head of AI & Automation",
"url": "/customers/sellerx",
},
}
companies_case_studies_var = rx.Var.create(companies_case_studies)
def stat(stat: str, text: str) -> rx.Component:
return rx.el.section(
get_icon("feather_unstyled", class_name="text-primary-9"),
rx.box(
rx.text(
stat,
class_name="text-3xl inline-block text-slate-12 font-semibold w-full text-balance text-center",
),
rx.text(text, class_name="text-sm text-slate-9 font-medium"),
class_name="flex flex-col justify-center items-center text-center text-nowrap",
),
get_icon("feather_unstyled", class_name="scale-x-[-1] text-primary-9"),
class_name="flex flex-row items-center gap-4 justify-center",
)
|
def case_study_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
@rx.memo
def company_card(name: str, id: str) -> rx.C | def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
),
rx.box(
ui.gradient_profile(
seed=case_study["person"],
class_name="size-6 rounded-full",
),
rx.box(
rx.text(
f"{case_study['person']}",
class_name="text-xs text-slate-10 font-medium",
),
rx.text(
case_study["role"],
class_name="text-xs text-slate-9 font-medium",
),
),
class_name="flex flex-row items-center gap-2 w-full animate-fade animate-duration-[550ms] animate-ease-out animate-fill-both",
),
) |
ution for handling and visualizing large-scale data efficiently.""",
"person": "Mike",
"picture": "/favicon.ico",
"role": "Head of AI & Automation",
"url": "/customers/sellerx",
},
}
companies_case_studies_var = rx.Var.create(companies_case_studies)
def stat(stat: str, text: str) -> rx.Component:
return rx.el.section(
get_icon("feather_unstyled", class_name="text-primary-9"),
rx.box(
rx.text(
stat,
class_name="text-3xl inline-block text-slate-12 font-semibold w-full text-balance text-center",
),
rx.text(text, class_name="text-sm text-slate-9 font-medium"),
class_name="flex flex-col justify-center items-center text-center text-nowrap",
),
get_icon("feather_unstyled", class_name="scale-x-[-1] text-primary-9"),
class_name="flex flex-row items-center gap-4 justify-center",
)
def quote_box(company: str) -> rx.Component:
|
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
),
rx.box(
ui.gradient_profile(
seed=case_study["person"],
class_name="size-6 rounded-full",
),
rx.box(
rx.text(
f"{case_study['person']}",
class_name="text-xs text-slate-10 font-medium",
),
rx.text(
case_study["role"],
class_name="text-xs text-slate-9 font-medium",
),
),
class_name="flex flex-row items-center gap-2 w-full animate-fade animate-duration-[550ms] animate-ease-out animate-fill-both",
),
)
def case_study_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text- | case_study = companies_case_studies_var[company] |
center",
)
def quote_box(company: str) -> rx.Component:
case_study = companies_case_studies_var[company]
return rx.fragment(
rx.text(
f"“{case_study['quote']}”",
class_name="text-xs text-slate-12 font-medium animate-fade animate-duration-[505ms] animate-ease-out animate-fill-both",
),
rx.box(
ui.gradient_profile(
seed=case_study["person"],
class_name="size-6 rounded-full",
),
rx.box(
rx.text(
f"{case_study['person']}",
class_name="text-xs text-slate-10 font-medium",
),
rx.text(
case_study["role"],
class_name="text-xs text-slate-9 font-medium",
),
),
class_name="flex flex-row items-center gap-2 w-full animate-fade animate-duration-[550ms] animate-ease-out animate-fill-both",
),
)
|
def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
@rx.memo
def company_card(name: str, id: str) -> rx.Component:
area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
)
area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
)
area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
)
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains | def case_study_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
) |
),
rx.box(
rx.text(
f"{case_study['person']}",
class_name="text-xs text-slate-10 font-medium",
),
rx.text(
case_study["role"],
class_name="text-xs text-slate-9 font-medium",
),
),
class_name="flex flex-row items-center gap-2 w-full animate-fade animate-duration-[550ms] animate-ease-out animate-fill-both",
),
)
def case_study_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
|
@rx.memo
def company_card(name: str, id: str) -> rx.Component:
area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
)
area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
)
area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
)
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains(company_cs.value),
quote_box(company_cs.value),
rx.box(
stat(stat="1 Million+", text="Apps built with Reflex"),
class_name="animate-fade flex justify-center items-center size-full animate-duration-[550ms] animate-ease-out animate-fill-both",
),
),
class_name="flex flex-col gap-2.5 w-full h-[10.75rem] justify | def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
) |
udy_badge() -> rx.Component:
return rx.box(
rx.text("Case Study", class_name="text-xs text-violet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
@rx.memo
def company_card(name: str, id: str) -> rx.Component:
|
area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
)
area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
)
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains(company_cs.value),
quote_box(company_cs.value),
rx.box(
stat(stat="1 Million+", text="Apps built with Reflex"),
class_name="animate-fade flex justify-center items-center size-full animate-duration-[550ms] animate-ease-out animate-fill-both",
),
),
class_name="flex flex-col gap-2.5 w-full h-[10.75rem] justify-between bg-slate-1 border-box p-4 overflow-hidden",
),
rx.box(
# Light
rx.image(
src=f"/landi | area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
) |
olet-9 font-semibold"),
get_icon(
"chevron_right",
class_name="size-3",
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
@rx.memo
def company_card(name: str, id: str) -> rx.Component:
area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
)
|
area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
)
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains(company_cs.value),
quote_box(company_cs.value),
rx.box(
stat(stat="1 Million+", text="Apps built with Reflex"),
class_name="animate-fade flex justify-center items-center size-full animate-duration-[550ms] animate-ease-out animate-fill-both",
),
),
class_name="flex flex-col gap-2.5 w-full h-[10.75rem] justify-between bg-slate-1 border-box p-4 overflow-hidden",
),
rx.box(
# Light
rx.image(
src=f"/landing/companies/light/{name}.svg",
class_name="w-[4.75rem] h-auto pointer-events-none gr | area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
) |
),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
def quote_badge() -> rx.Component:
return rx.box(
rx.text("Quote", class_name="text-xs text-violet-9 font-semibold"),
# ui.icon("QuoteDownIcon", class_name="size-3"),
class_name="absolute bottom-4 right-4 bg-violet-3 text-violet-9 group-hover:bg-violet-4 group-hover:border-violet-7 text-xs font-semibold px-2 py-1 rounded-full transition-colors flex flex-row items-center gap-1 scale-[0.85] pointer-events-none",
)
@rx.memo
def company_card(name: str, id: str) -> rx.Component:
area_x_pos = ClientStateVar.create(
var_name="area_x_pos", default=0, global_ref=False
)
area_y_pos = ClientStateVar.create(
var_name="area_y_pos", default=0, global_ref=False
)
|
return rx.box(
rx.cond(
name == "STATS",
rx.box(
rx.cond(
companies_case_studies_var.contains(company_cs.value),
quote_box(company_cs.value),
rx.box(
stat(stat="1 Million+", text="Apps built with Reflex"),
class_name="animate-fade flex justify-center items-center size-full animate-duration-[550ms] animate-ease-out animate-fill-both",
),
),
class_name="flex flex-col gap-2.5 w-full h-[10.75rem] justify-between bg-slate-1 border-box p-4 overflow-hidden",
),
rx.box(
# Light
rx.image(
src=f"/landing/companies/light/{name}.svg",
class_name="w-[4.75rem] h-auto pointer-events-none group-hover:grayscale-0 grayscale-[1] opacity-50 group-hover:opacity-100 transition-all dark:hidden",
| area_opacity = ClientStateVar.create(
var_name="area_opacity", default=0, global_ref=False
) |
.call_function(
area_x_pos.set_value(
rx.Var(
f"event.clientX - document.getElementById({id}).getBoundingClientRect().left"
)
)
),
rx.call_function(
area_y_pos.set_value(
rx.Var(
f"event.clientY - document.getElementById({id}).getBoundingClientRect().top"
)
)
),
],
id=id,
class_name=(
"relative w-full group border-b border-r border-slate-3",
rx.cond(
name == "STATS",
"col-span-2",
"",
),
),
on_click=rx.cond(
companies_case_studies_var.contains(name)
& companies_case_studies_var[name].get("url", None),
rx.redirect(companies_case_studies_var[name].get("url", "#")),
rx.noop(),
),
)
| def companies() -> rx.Component:
return rx.el.section(
rx.box(
*[
company_card(
name=company,
id=f"landing-company-card-{company}",
)
for company in companies_list
],
class_name="lg:grid grid-cols-6 w-full hidden relative",
),
rx.el.div(
index_companies(),
class_name="lg:hidden flex border-t border-slate-3 lg:border-t-0",
),
class_name="z-0 flex flex-col justify-center items-center mx-auto w-full max-w-[64.19rem] border-slate-3 relative overflow-hidden isolate lg:border-l",
) | |
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Connect to Any Data Source",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Build powerful data-driven apps with seamless integrations to APIs, databases, Python libraries, and file formats.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-f | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Connect to Any Data Source",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Build powerful data-driven apps with seamless integrations to APIs, databases, Python libraries, and file formats.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-h | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Connect to Any Data Source",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Build powerful data-driven apps with seamless integrations to APIs, databases, Python libraries, and file formats.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def connect_card(icon: str, title: | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
|
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("DatabaseAddIcon", class_name="shrink-0"),
rx.el.span("Data", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Connect to Any Data Source",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Build powerful data-driven apps with seamless integrations to APIs, databases, Python libraries, and file formats.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def connect_card(icon: str, title: str, description: str) -> rx.Component:
return rx.el.div( | from pcweb.components.numbers_pattern import numbers_pattern |
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your | import reflex as rx | |
import reflex as rx
|
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
cla | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-cent | from pcweb.components.icons.icons import get_icon |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
|
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
| from pcweb.components.numbers_pattern import numbers_pattern |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
|
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap | from pcweb.constants import REFLEX_CLOUD_URL |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
|
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
| from pcweb.pages.databricks.databricks import databricks_page |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
|
from pcweb.pages.security.security import security_page
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def deploy_card() -> rx.Component:
return rx.el.div(
| from pcweb.pages.hosting.views.deploy_animation import animated_box |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
|
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def deploy_card() -> rx.Component:
return rx.el.div(
rx.el.div(
rx.html(
"""<svg | from pcweb.pages.security.security import security_page |
import reflex as rx
import reflex_ui as ui
from pcweb.components.icons.icons import get_icon
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_CLOUD_URL
from pcweb.pages.databricks.databricks import databricks_page
from pcweb.pages.hosting.views.deploy_animation import animated_box
from pcweb.pages.security.security import security_page
|
def deploy_card() -> rx.Component:
return rx.el.div(
rx.el.div(
rx.html(
"""<svg xmlns="http://www.w3.org/2000/svg" width="342" height="322" viewBox="0 0 342 322" fill="none">
<g filter="url(#filter0_f_10857_12767)">
<path d="M229.949 96.5486C278.245 98.9569 202.581 123.44 198.154 159.563C193.726 195.686 216.25 229 176.018 229C135.785 229 165.151 137.087 98.7436 118.222C32.3361 99.3581 181.652 94.1404 229.949 96.5486Z" fill="#261958"/>
</g>
<defs>
<filter id="filter0_f_10857_12767" x="-14" y="0" width="356" height="325" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="48" result="effect1_foregroundBlur_10857_12767"/>
</filter>
</defs>
</svg>""",
class_name="absolute top-1/2 left-1/2 transform -translate-x-1 | def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("CloudServerIcon", class_name="shrink-0"),
rx.el.span(
"Hosting",
class_name="text-sm font-semibold",
),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Deploy, manage, and scale.",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"A complete infrastructure for your apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
) |
xl font-semibold",
),
rx.el.div(
rx.image(
src="/hosting_graphing.svg",
class_name="w-auto h-[1.95rem]",
),
ui.link(
render_=ui.button(
"Start deploying",
variant="primary",
size="lg",
class_name="font-semibold h-10 w-fit",
),
to=REFLEX_CLOUD_URL,
target="_blank",
),
class_name="flex flex-col lg:flex-row lg:gap-8 gap-6 items-center mt-8 max-lg:w-full max-lg:justify-start max-lg:items-start",
),
class_name="flex flex-col items-end",
),
class_name="max-w-[71.125rem] w-full rounded-[1.125rem] border border-slate-3 bg-white-1 pt-[5rem] pb-[5.5rem] px-10 h-[20.5625rem] flex flex-row items-center gap-[10.5rem] z-10 shadow-small",
)
|
def badge_card(component: rx.Component, link: str) -> rx.Component:
return rx.el.a(
rx.el.div(
component,
class_name="size-18 rounded-lg border border-slate-5 dark:border-[#1C2024] shadow-large bg-white-1 group-hover:bg-slate-2 transition-colors flex items-center justify-center z-[2]",
),
href=link,
target="_blank",
class_name="size-21 rounded-xl border border-slate-3 dark:border-[#1C2024] shadow-large bg-white/76 dark:bg-slate-1 z-[2] group relative cursor-pointer flex items-center justify-center",
)
def security_badges() -> rx.Component:
return rx.box(
rx.box(
badge_card(
rx.el.div(
rx.el.span(
"AICPA",
class_name="text-violet-9 text-base font-semibold",
),
rx.el.span("SOC 2", class_name="text-slate-9 text-sm font-medium"),
class_name="flex fl | def feature_card(icon: str, title: str, description: str) -> rx.Component:
return rx.box(
rx.box(
get_icon(icon, class_name="!text-slate-9 !size-5"),
rx.text(title, class_name="text-slate-12 text-base font-semibold"),
class_name="flex flex-row gap-2 items-center",
),
rx.text(description, class_name="text-slate-9 font-medium text-sm text-start"),
class_name="flex flex-col gap-2 w-full lg:w-[22.05rem] h-[8rem] px-8 py-5",
) |
_CLOUD_URL,
target="_blank",
),
class_name="flex flex-col lg:flex-row lg:gap-8 gap-6 items-center mt-8 max-lg:w-full max-lg:justify-start max-lg:items-start",
),
class_name="flex flex-col items-end",
),
class_name="max-w-[71.125rem] w-full rounded-[1.125rem] border border-slate-3 bg-white-1 pt-[5rem] pb-[5.5rem] px-10 h-[20.5625rem] flex flex-row items-center gap-[10.5rem] z-10 shadow-small",
)
def feature_card(icon: str, title: str, description: str) -> rx.Component:
return rx.box(
rx.box(
get_icon(icon, class_name="!text-slate-9 !size-5"),
rx.text(title, class_name="text-slate-12 text-base font-semibold"),
class_name="flex flex-row gap-2 items-center",
),
rx.text(description, class_name="text-slate-9 font-medium text-sm text-start"),
class_name="flex flex-col gap-2 w-full lg:w-[22.05rem] h-[8rem] px-8 py-5",
)
|
def security_badges() -> rx.Component:
return rx.box(
rx.box(
badge_card(
rx.el.div(
rx.el.span(
"AICPA",
class_name="text-violet-9 text-base font-semibold",
),
rx.el.span("SOC 2", class_name="text-slate-9 text-sm font-medium"),
class_name="flex flex-col items-center justify-center",
),
security_page.path,
),
badge_card(
rx.el.div(
rx.image(
src="/landing/integrations/light/databricks.svg",
class_name="h-[24px] w-auto pb-0.5",
),
rx.el.span(
"Partner", class_name="text-slate-9 text-sm font-medium"
),
class_name="flex flex-col items-center justify-center",
),
| def badge_card(component: rx.Component, link: str) -> rx.Component:
return rx.el.a(
rx.el.div(
component,
class_name="size-18 rounded-lg border border-slate-5 dark:border-[#1C2024] shadow-large bg-white-1 group-hover:bg-slate-2 transition-colors flex items-center justify-center z-[2]",
),
href=link,
target="_blank",
class_name="size-21 rounded-xl border border-slate-3 dark:border-[#1C2024] shadow-large bg-white/76 dark:bg-slate-1 z-[2] group relative cursor-pointer flex items-center justify-center",
) |
class_name="text-violet-9 text-base font-semibold",
),
rx.el.span("SOC 2", class_name="text-slate-9 text-sm font-medium"),
class_name="flex flex-col items-center justify-center",
),
security_page.path,
),
badge_card(
rx.el.div(
rx.image(
src="/landing/integrations/light/databricks.svg",
class_name="h-[24px] w-auto pb-0.5",
),
rx.el.span(
"Partner", class_name="text-slate-9 text-sm font-medium"
),
class_name="flex flex-col items-center justify-center",
),
databricks_page.path,
),
class_name="flex flex-row gap-4 items-center justify-center",
),
class_name="p-6 flex items-center justify-center",
)
|
def deploy_content() -> rx.Component:
return rx.box(
rx.box(
feature_card(
"backend_db",
"Build and deploy",
"Deploy and scale your Reflex app with a single command.",
),
feature_card(
"backend_auth",
"Add team members",
"Invite team members to your Reflex app and manage their permissions.",
),
feature_card(
"infinity",
"Integrate with CI/CD",
"Deploy via GitHub Actions, GitLab CI, or your own custom pipeline.",
),
feature_card(
"globe",
"Scale to multiple regions",
"Deploy your app to multiple regions for high availability and low latency.",
),
feature_card(
"analytics",
"Get alerts and metrics",
"Get alerts and metrics for your | def security() -> rx.Component:
return rx.el.div(
rx.box(
rx.box(
rx.el.h2(
"Secure by default",
class_name="text-slate-12 text-xl lg:text-2xl font-semibold lg:text-start text-center",
),
rx.el.h3(
"SOC 2 compliant with enterprise-grade security and flexible deployment options.",
class_name="text-slate-9 text-lg lg:text-2xl font-semibold lg:text-start text-center text-balance",
),
class_name="flex flex-col lg:col-span-2 p-10 max-lg:border-b border-slate-3",
),
security_badges(),
class_name="grid grid-cols-1 lg:grid-cols-3 lg:divide-x divide-slate-4 w-full",
),
class_name="flex flex-col gap-4 mx-auto w-full max-w-[64.19rem] lg:border-x justify-center items-center relative overflow-hidden border-slate-3 border-b",
) |
card(
"analytics",
"Get alerts and metrics",
"Get alerts and metrics for your Reflex app to help you monitor and optimize your app.",
),
class_name="flex flex-col max-w-full lg:max-w-full divide-y divide-slate-3",
),
rx.box(
rx.image(
src="/landing/hosting_features/light/card.webp",
class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none dark:hidden",
),
rx.image(
src="/landing/hosting_features/dark/card.webp",
class_name="absolute top-0 left-0 w-full h-full object-cover pointer-events-none dark:block hidden",
),
class_name="justify-center items-center relative overflow-hidden w-full lg:flex hidden",
),
class_name="flex flex-col lg:flex-row mx-auto w-full border-x-0 divide-x-0 lg:divide-x divide-slate-3 border-t border-slate-3",
)
| def deploy_section() -> rx.Component:
return rx.el.section(
rx.el.div(
rx.el.div(
numbers_pattern(side="left", class_name="left-0 top-0"),
numbers_pattern(side="right", class_name="right-0 top-0"),
header(),
rx.el.div(
animated_box(),
class_name="flex justify-center items-center pt-[3.75rem] w-full",
),
class_name="flex flex-col items-center mx-auto w-full max-w-[64.19rem] relative overflow-hidden pt-20 border-t border-slate-3",
),
deploy_content(),
class_name="flex flex-col items-center mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3",
),
deploy_card(),
security(),
class_name="flex flex-col items-center mx-auto w-full",
) | |
import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Hear from the teams that use Reflex",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Companies of all sizes trust Reflex to build internal tools and customer-facing apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def enterprise_card(image: str, | import reflex as rx | |
import reflex as rx
|
from pcweb.components.numbers_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Hear from the teams that use Reflex",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Companies of all sizes trust Reflex to build internal tools and customer-facing apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def enterprise_card(image: str, name: str, stat: str, t | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Hear from the teams that use Reflex",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Companies of all sizes trust Reflex to build internal tools and customer-facing apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def enterprise_card(image: str, name: str, stat: str, text: str) -> rx.Component:
first_word = text.split(" ")[0] | from pcweb.components.numbers_pattern import numbers_pattern |
_pattern import numbers_pattern
def header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Hear from the teams that use Reflex",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Companies of all sizes trust Reflex to build internal tools and customer-facing apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def enterprise_card(image: str, name: str, stat: str, text: str) -> rx.Component:
|
rest_of_text = " ".join(text.split(" ")[1:])
return rx.el.a(
rx.el.div(
rx.image(
src=f"/customers/{rx.color_mode_cond('light', 'dark')}{image}",
class_name="w-auto h-[1.875rem]",
),
rx.el.span(
name,
class_name="text-slate-12 text-3xl font-bold",
),
class_name="flex flex-row gap-3 items-center justify-start mr-auto",
),
rx.el.div(
rx.el.h3(
stat,
class_name="text-4xl font-semibold text-slate-12",
),
rx.el.div(
rx.el.span(
first_word, class_name="text-slate-12 text-base font-semibold"
),
rx.el.span(
f" {rest_of_text}",
class_name="text-slate-10 text-base font-medium",
),
class_name="inline-block",
),
cla | first_word = text.split(" ")[0] |
f header() -> rx.Component:
return rx.el.div(
rx.el.div(
ui.icon("UserGroupIcon", class_name="shrink-0"),
rx.el.span("Teams", class_name="text-sm font-semibold"),
class_name="flex flex-row gap-2 items-center text-primary-9",
),
rx.el.h2(
"Hear from the teams that use Reflex",
class_name="max-w-full w-full lg:text-3xl text-2xl text-center text-slate-12 font-semibold text-balance word-wrap break-words md:whitespace-pre",
),
rx.el.p(
"Companies of all sizes trust Reflex to build internal tools and customer-facing apps.",
class_name="text-slate-9 text-sm font-medium text-center text-balance word-wrap break-words md:whitespace-pre",
),
class_name="flex flex-col gap-4 items-center mx-auto w-full relative overflow-hidden",
)
def enterprise_card(image: str, name: str, stat: str, text: str) -> rx.Component:
first_word = text.split(" ")[0]
|
return rx.el.a(
rx.el.div(
rx.image(
src=f"/customers/{rx.color_mode_cond('light', 'dark')}{image}",
class_name="w-auto h-[1.875rem]",
),
rx.el.span(
name,
class_name="text-slate-12 text-3xl font-bold",
),
class_name="flex flex-row gap-3 items-center justify-start mr-auto",
),
rx.el.div(
rx.el.h3(
stat,
class_name="text-4xl font-semibold text-slate-12",
),
rx.el.div(
rx.el.span(
first_word, class_name="text-slate-12 text-base font-semibold"
),
rx.el.span(
f" {rest_of_text}",
class_name="text-slate-10 text-base font-medium",
),
class_name="inline-block",
),
class_name="flex flex-col gap-2",
),
| rest_of_text = " ".join(text.split(" ")[1:]) |
import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_BUILD_URL
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
),
rx.el.h3(
"All in one platform in Python",
class_name="text-slate-9 lg:text-4xl text-3xl font-semibold text-center",
),
ui.link(
render_=ui.button(
"Get Started with Reflex",
size="lg",
class_name="font-semibold mt-8 h-10",
),
to=REFLEX_BUILD_URL,
target="_blank",
),
class_name="flex flex-col items-center mx-auto w-full justify-center",
)
def final_cta() -> rx.Component:
return rx.el.section(
numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"),
nu | import reflex as rx | |
import reflex as rx
|
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import REFLEX_BUILD_URL
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
),
rx.el.h3(
"All in one platform in Python",
class_name="text-slate-9 lg:text-4xl text-3xl font-semibold text-center",
),
ui.link(
render_=ui.button(
"Get Started with Reflex",
size="lg",
class_name="font-semibold mt-8 h-10",
),
to=REFLEX_BUILD_URL,
target="_blank",
),
class_name="flex flex-col items-center mx-auto w-full justify-center",
)
def final_cta() -> rx.Component:
return rx.el.section(
numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"),
numbers_pattern(side="rig | import reflex_ui as ui |
import reflex as rx
import reflex_ui as ui
|
from pcweb.constants import REFLEX_BUILD_URL
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
),
rx.el.h3(
"All in one platform in Python",
class_name="text-slate-9 lg:text-4xl text-3xl font-semibold text-center",
),
ui.link(
render_=ui.button(
"Get Started with Reflex",
size="lg",
class_name="font-semibold mt-8 h-10",
),
to=REFLEX_BUILD_URL,
target="_blank",
),
class_name="flex flex-col items-center mx-auto w-full justify-center",
)
def final_cta() -> rx.Component:
return rx.el.section(
numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"),
numbers_pattern(side="right", reverse=True, class_name="right-0 top-0"),
conten | from pcweb.components.numbers_pattern import numbers_pattern |
import reflex as rx
import reflex_ui as ui
from pcweb.components.numbers_pattern import numbers_pattern
|
def content() -> rx.Component:
return rx.el.div(
rx.el.h2(
"Start building with Reflex.",
class_name="text-slate-12 lg:text-4xl text-3xl font-semibold text-center",
),
rx.el.h3(
"All in one platform in Python",
class_name="text-slate-9 lg:text-4xl text-3xl font-semibold text-center",
),
ui.link(
render_=ui.button(
"Get Started with Reflex",
size="lg",
class_name="font-semibold mt-8 h-10",
),
to=REFLEX_BUILD_URL,
target="_blank",
),
class_name="flex flex-col items-center mx-auto w-full justify-center",
)
def final_cta() -> rx.Component:
return rx.el.section(
numbers_pattern(side="left", reverse=True, class_name="left-0 top-0"),
numbers_pattern(side="right", reverse=True, class_name="right-0 top-0"),
content(),
class_name="flex flex-col items- | from pcweb.constants import REFLEX_BUILD_URL |
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is | import base64 | |
import base64
|
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: | import uuid |
import base64
import uuid
|
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(Fal | from typing import TypedDict |
import base64
import uuid
from typing import TypedDict
|
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_pro | import httpx |
import base64
import uuid
from typing import TypedDict
import httpx
|
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bo | import reflex as rx |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
|
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
| import reflex_ui as ui |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
|
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
| from reflex.experimental import ClientStateVar |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
|
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
| from pcweb.components.numbers_pattern import numbers_pattern |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
|
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at le | from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
|
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as | def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/") |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
|
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
| textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
|
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"to | textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
|
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
| show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
) |
import base64
import uuid
from typing import TypedDict
import httpx
import reflex as rx
import reflex_ui as ui
from reflex.experimental import ClientStateVar
from pcweb.components.numbers_pattern import numbers_pattern
from pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
|
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
| class ImageData(TypedDict):
data: bytes
mime_type: str |
pcweb.constants import (
MAX_FILE_SIZE_BYTES,
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
|
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
| if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
) |
MAX_FILE_SIZE_MB,
MAX_IMAGES_COUNT,
PROMPT_MAP,
REFLEX_BUILD_URL,
RX_BUILD_BACKEND,
)
def is_content_type_valid(content_type: str) -> bool:
"""Check if the content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
|
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected | if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
) |
e content type is valid."""
return content_type.startswith("image/")
textarea_x_pos = ClientStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
|
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload(" | random_uuid = uuid.uuid4() |
tStateVar.create(var_name="textarea_x_pos", default=0)
textarea_y_pos = ClientStateVar.create(var_name="textarea_y_pos", default=0)
textarea_opacity = ClientStateVar.create(var_name="textarea_opacity", default=0)
show_default_prompt = ClientStateVar.create(
var_name="show_default_prompt", default=True
)
class ImageData(TypedDict):
data: bytes
mime_type: str
class SubmitPromptState(rx.State):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
|
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
| response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
) |
e):
_images: list[ImageData] | None = None
is_uploading: rx.Field[bool] = rx.field(False)
is_processing: rx.Field[bool] = rx.field(False)
@rx.event(background=True, temporal=True)
async def redirect_to_ai_builder(self, form_data: dict):
if prompt := form_data.get("prompt"):
if len(prompt) < 5:
return rx.toast.warning(
"Your prompt needs at least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
|
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No conten | self.is_processing = True |
least 5 characters. Please add more details.",
)
random_uuid = uuid.uuid4()
async with httpx.AsyncClient() as client:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
|
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read() | if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return |
ient:
response = await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
|
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) | self.is_uploading = True |
await client.post(
RX_BUILD_BACKEND.rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
|
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yie | self._images = self._images or [] |
rstrip("/") + "/prompt",
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
|
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_na | for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False |
json={
"prompt": PROMPT_MAP.get(prompt, prompt),
"token": str(random_uuid),
"images": self.image_data_uris,
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
|
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._im | if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return |
},
)
async with self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
|
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
retu | self.is_uploading = False |
th self:
self.reset()
self.is_processing = True
return (
rx.redirect("/")
if not response.is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
|
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
| if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return |
is_success
else rx.redirect(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
|
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
| self.is_uploading = False |
t(
REFLEX_BUILD_URL.strip("/") + f"/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
|
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload( | self._images = None |
/prompt?token={random_uuid!s}"
)
)
@rx.event(temporal=True)
async def handle_upload(self, files: list[rx.UploadFile]):
"""Handle the upload of an image."""
if not files:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
|
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_ | if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return |
es:
yield rx.toast.error("No files selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
|
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
| self.is_uploading = False |
iles selected")
yield rx.cancel_upload("upload-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
|
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
| self._images = None |
oad-image-button")
return
self.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
|
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return th | upload_data = await first_file.read() |
.is_uploading = True
self._images = self._images or []
yield
for first_file in files:
if len(self._images) >= MAX_IMAGES_COUNT:
yield rx.toast.error("Maximum of 5 images allowed")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
|
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
| if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return |
rx.cancel_upload("upload-image-button")
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
|
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> r | self.is_uploading = False |
self.is_uploading = False
return
if not first_file.content_type:
yield rx.toast.error("No content type")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
|
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
| self._images = None |
self.is_uploading = False
self._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
|
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_na | self.is_uploading = False |
elf._images = None
return
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
|
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold",
),
class_name="inline-flex items-center gap-2 align-bottom mx-1",
)
def integration_text_light_dark(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
cla | def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index) |
if not first_file.content_type.startswith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
|
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold",
),
class_name="inline-flex items-center gap-2 align-bottom mx-1",
)
def integration_text_light_dark(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
cla | if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index) |
ith("image/"):
yield rx.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
|
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold",
),
class_name="inline-flex items-center gap-2 align-bottom mx- | self.is_uploading = False |
x.toast.error(f"Invalid content type {first_file.content_type}")
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
|
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
if index < len(self._images):
self._images.pop(index)
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold",
),
class_name="inline-flex items-center gap-2 align-bottom mx-1",
)
def integration_text | self._images = None |
rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
|
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold",
),
class_name="inline-flex items-center gap-2 align-bottom mx-1",
)
def integration_text_light_dark(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
cla | elif self._images is not None:
if index < len(self._images):
self._images.pop(index) |
self.is_uploading = False
self._images = None
return
upload_data = await first_file.read()
if len(upload_data) > MAX_FILE_SIZE_BYTES:
yield rx.toast.error(
f"File too large, maximum size is {MAX_FILE_SIZE_MB}MB"
)
yield rx.cancel_upload("upload-image-button")
self.is_uploading = False
self._images = None
return
self._images.append(
ImageData(
data=upload_data,
mime_type=first_file.content_type,
)
)
self.is_uploading = False
@rx.event
def cancel_upload(self, index: int):
if self.is_uploading or index < 0:
self.is_uploading = False
self._images = None
return rx.cancel_upload("upload-image-button")
elif self._images is not None:
|
@rx.var
def image_data_uris(self) -> list[str]:
"""Return the image data."""
if self._images is None:
return []
return [
f"data:{image['mime_type']};base64,{base64.b64encode(image['data']).decode('ascii')}"
for image in self._images
]
def integration_text(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
class_name="size-7 pointer-events-none shrink-0 inline-block align-text-bottom",
),
rx.el.span(
text,
class_name="text-slate-12 text-xl leading-[2.5rem] font-semibold",
),
class_name="inline-flex items-center gap-2 align-bottom mx-1",
)
def integration_text_light_dark(text: str, integration: str) -> rx.Component:
return rx.el.span(
rx.image(
src=f"/landing/integrations/light/{integration}.svg",
cla | if index < len(self._images):
self._images.pop(index) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.