Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ lint.pydocstyle.convention = "google"
"*.pyi" = ["D301", "D415", "D417", "D418", "E742", "N", "PGH"]
"**/alembic/*.py" = ["D", "ERA"]
"__init__.py" = ["ERA"]
"shared/**" = ["D100", "D101", "D102", "D103", "D104", "T201"]
"shared/reflex_ui_shared/**" = ["D100", "D101", "D102", "D103", "D104", "T201"]

[tool.pyright]
reportIncompatibleMethodOverride = false
Expand Down
5 changes: 0 additions & 5 deletions shared/components/hosting_banner.py

This file was deleted.

17 changes: 17 additions & 0 deletions shared/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[project]
name = "reflex-ui-shared"
version = "0.0.1"
description = "Shared components and utilities for Reflex web projects"
requires-python = ">=3.11"
dependencies = [
"reflex (>=0.8.0)",
"httpx",
"email-validator",
"flexdown",
"mistletoe",
"ruff-format",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import httpx
import reflex as rx

from shared.constants import RECENT_BLOGS_API_URL
from reflex_ui_shared.constants import RECENT_BLOGS_API_URL


class BlogPostDict(TypedDict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import reflex as rx
from email_validator import EmailNotValidError, ValidatedEmail, validate_email

from shared.constants import (
from reflex_ui_shared.constants import (
API_BASE_URL_LOOPS,
REFLEX_DEV_WEB_NEWSLETTER_FORM_WEBHOOK_URL,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import reflex as rx

import shared.styles.fonts as fonts
from shared import styles
import reflex_ui_shared.styles.fonts as fonts
from reflex_ui_shared import styles


@rx.memo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
from reflex_base.constants.colors import ColorType

import reflex_ui as ui
from shared.components.blocks.code import code_block_markdown, code_block_markdown_dark
from shared.components.blocks.collapsible import collapsible_box
from shared.components.blocks.demo import docdemo, docdemobox, docgraphing
from shared.components.blocks.headings import (
from reflex_ui_shared.components.blocks.code import (
code_block_markdown,
code_block_markdown_dark,
)
from reflex_ui_shared.components.blocks.collapsible import collapsible_box
from reflex_ui_shared.components.blocks.demo import docdemo, docdemobox, docgraphing
from reflex_ui_shared.components.blocks.headings import (
h1_comp_xd,
h2_comp_xd,
h3_comp_xd,
h4_comp_xd,
img_comp_xd,
)
from shared.components.blocks.typography import (
from reflex_ui_shared.components.blocks.typography import (
code_comp,
definition,
doclink2,
Expand All @@ -23,9 +26,9 @@
text_comp,
unordered_list_comp,
)
from shared.constants import REFLEX_ASSETS_CDN
from shared.styles.colors import c_color
from shared.styles.fonts import base, code
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN
from reflex_ui_shared.styles.colors import c_color
from reflex_ui_shared.styles.fonts import base, code


def get_code_style(color: ColorType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import reflex as rx

from shared.views.hosting_banner import HostingBannerState
from reflex_ui_shared.views.hosting_banner import HostingBannerState

icon_margins = {
"h1": "10px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import reflex as rx

from shared.styles import fonts
from reflex_ui_shared.styles import fonts


def definition(title: str, *children) -> rx.Component:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from reflex.experimental.client_state import ClientStateVar

import reflex_ui as ui
from shared.components.icons import get_icon
from reflex_ui_shared.components.icons import get_icon


@rx.memo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ def get_headings(comp: Any):


def get_toc(source: Any, href: str, component_list: list | None = None):
from shared.flexdown import xd
from reflex_ui_shared.flexdown import xd

component_list = component_list or []
component_list = component_list[1:]

# Generate the TOC
# The environment used for execing and evaling code.
from shared.constants import REFLEX_ASSETS_CDN
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN

env = source.metadata
env["__xd"] = xd
Expand Down
5 changes: 5 additions & 0 deletions shared/reflex_ui_shared/components/hosting_banner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Re-export hosting banner from reflex_ui_shared.views.hosting_banner."""

from reflex_ui_shared.views.hosting_banner import HostingBannerState, hosting_banner

__all__ = ["HostingBannerState", "hosting_banner"]
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import reflex as rx

from shared.components.icons import get_icon
from shared.constants import REFLEX_ASSETS_CDN
from shared.views.hosting_banner import HostingBannerState
from reflex_ui_shared.components.icons import get_icon
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN
from reflex_ui_shared.views.hosting_banner import HostingBannerState


def create_pattern(
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import reflex_ui as ui
from reflex_ui.blocks.demo_form import demo_form_dialog
from shared.components.blocks.flexdown import xd
from shared.components.code_card import gallery_app_card
from shared.components.icons import get_icon
from shared.constants import REFLEX_ASSETS_CDN, SCREENSHOT_BUCKET
from shared.gallery.gallery import integrations_stack
from shared.templates.gallery_app_page import gallery_app_page
from reflex_ui_shared.components.blocks.flexdown import xd
from reflex_ui_shared.components.code_card import gallery_app_card
from reflex_ui_shared.components.icons import get_icon
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN, SCREENSHOT_BUCKET
from reflex_ui_shared.gallery.gallery import integrations_stack
from reflex_ui_shared.templates.gallery_app_page import gallery_app_page

GALLERY_APP_SOURCES = [
("templates/", "docs/getting-started/open-source-templates/"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import reflex as rx

import reflex_ui as ui
from shared.constants import INTEGRATIONS_IMAGES_URL, REFLEX_ASSETS_CDN
from shared.gallery.r_svg_loader import r_svg_loader
from reflex_ui_shared.constants import INTEGRATIONS_IMAGES_URL, REFLEX_ASSETS_CDN
from reflex_ui_shared.gallery.r_svg_loader import r_svg_loader

REFLEX_BUILD_TEMPLATES_PATH = "reflex_build_templates/"
REFLEX_BUILD_TEMPLATES_IMAGES = "reflex_build_template_images/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import reflex as rx

import reflex_ui as ui
from shared.constants import INTEGRATIONS_IMAGES_URL, REFLEX_ASSETS_CDN
from shared.gallery.r_svg_loader import r_svg_loader
from shared.templates.webpage import webpage
from reflex_ui_shared.constants import INTEGRATIONS_IMAGES_URL, REFLEX_ASSETS_CDN
from reflex_ui_shared.gallery.r_svg_loader import r_svg_loader
from reflex_ui_shared.templates.webpage import webpage

REFLEX_BUILD_TEMPLATES_PATH = "reflex_build_templates/"
REFLEX_BUILD_TEMPLATES_IMAGES = "reflex_build_template_images/"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import reflex as rx

import reflex_ui as ui
from shared.gallery.apps import gallery_apps_data
from reflex_ui_shared.gallery.apps import gallery_apps_data

TAGS = {
"Category": [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import reflex as rx

from shared.constants import (
from reflex_ui_shared.constants import (
DISCORD_URL,
FORUM_URL,
GITHUB_URL,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import reflex as rx

from shared.constants import (
from reflex_ui_shared.constants import (
DISCORD_URL,
FORUM_URL,
GITHUB_URL,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import reflex as rx

from shared.components.blocks.flexdown import markdown_with_shiki
from shared.templates.webpage import webpage
from reflex_ui_shared.components.blocks.flexdown import markdown_with_shiki
from reflex_ui_shared.templates.webpage import webpage

contents = f"""
# Page Not Found
Expand Down
5 changes: 5 additions & 0 deletions shared/reflex_ui_shared/route.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Re-export route utilities from reflex_ui_shared.lib.route."""

from reflex_ui_shared.lib.route import Route, get_path

__all__ = ["Route", "get_path"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import reflex as rx

import shared.styles.fonts as fonts
from shared.styles.colors import c_color
import reflex_ui_shared.styles.fonts as fonts
from reflex_ui_shared.styles.colors import c_color

font_weights = {
"bold": "800",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import reflex as rx

from shared.route import Route
from reflex_ui_shared.route import Route


def gallery_app_page(
Expand Down Expand Up @@ -57,8 +57,8 @@ def wrapper(*children, **props) -> rx.Component:
The component with the template applied.
"""
# Import here to avoid circular imports.
from shared.views.footer import footer_index
from shared.views.marketing_navbar import marketing_navbar
from reflex_ui_shared.views.footer import footer_index
from reflex_ui_shared.views.marketing_navbar import marketing_navbar

# Wrap the component in the template.
return rx.box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import reflex as rx

import reflex_ui as ui
from shared.components.hosting_banner import HostingBannerState
from shared.route import Route
from reflex_ui_shared.components.hosting_banner import HostingBannerState
from reflex_ui_shared.route import Route

DEFAULT_TITLE = "The platform to build and scale enterprise apps"
DEFAULT_DESCRIPTION = "Build secure internal apps with AI. Deploy on prem or cloud with governance. Technical and nontechnical teams ship together."
Expand Down Expand Up @@ -60,9 +60,9 @@ def wrapper(*children, **props) -> rx.Component:
The component with the template applied.
"""
# Import here to avoid circular imports.
from shared.views.cta_card import cta_card
from shared.views.footer import footer_index
from shared.views.marketing_navbar import marketing_navbar
from reflex_ui_shared.views.cta_card import cta_card
from reflex_ui_shared.views.footer import footer_index
from reflex_ui_shared.views.marketing_navbar import marketing_navbar

# Wrap the component in the template.
return rx.el.div(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import reflex as rx

from shared.route import Route
from reflex_ui_shared.route import Route

DEFAULT_TITLE = "The platform to build and scale enterprise apps"
DEFAULT_DESCRIPTION = "Build secure internal apps with AI. Deploy on prem or cloud with governance. Technical and nontechnical teams ship together."
Expand Down Expand Up @@ -58,10 +58,10 @@ def wrapper(*children, **props) -> rx.Component:
The component with the template applied.
"""
# Import here to avoid circular imports.
from shared.components.patterns import default_patterns
from shared.views.cta_card import cta_card
from shared.views.footer import footer_index
from shared.views.marketing_navbar import marketing_navbar
from reflex_ui_shared.components.patterns import default_patterns
from reflex_ui_shared.views.cta_card import cta_card
from reflex_ui_shared.views.footer import footer_index
from reflex_ui_shared.views.marketing_navbar import marketing_navbar

# Wrap the component in the template.
return rx.box(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def get_headings(comp: mistletoe.block_token.BlockToken):


def get_toc(source: flexdown.Document, href: str, component_list: list | None = None):
from shared.components.blocks.flexdown import xd
from shared.constants import REFLEX_ASSETS_CDN
from reflex_ui_shared.components.blocks.flexdown import xd
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN

component_list = component_list or []
component_list = component_list[1:]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import reflex_ui as ui
from reflex_ui.blocks.demo_form import demo_form_dialog
from shared.components.marketing_button import button as marketing_button
from shared.constants import REFLEX_ASSETS_CDN, REFLEX_BUILD_URL
from reflex_ui_shared.components.marketing_button import button as marketing_button
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN, REFLEX_BUILD_URL


@rx.memo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import reflex_ui as ui
from reflex_ui import button as marketing_button
from shared.backend.signup import IndexState
from shared.components.icons import get_icon
from shared.constants import (
from reflex_ui_shared.backend.signup import IndexState
from reflex_ui_shared.components.icons import get_icon
from reflex_ui_shared.constants import (
CHANGELOG_URL,
DISCORD_URL,
FORUM_URL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import reflex as rx

import reflex_ui as ui
from shared.constants import REFLEX_ASSETS_CDN
from reflex_ui_shared.constants import REFLEX_ASSETS_CDN


def glow() -> rx.Component:
Expand Down
Loading
Loading