reflex/pynecone/__init__.py
Masen Furer aa2a1df201
Add vars and components for working with color_mode (#1132)
* `pc.color_mode`: a BaseVar that accesses colorMode on the frontend
* `pc.color_mode_cond`: a `pc.cond` wrapper that conditionally renders
  components or props based on the value of `color_mode`
* `pc.color_mode_icon`: by default "sun" if light mode, "moon" if dark mode
* `pc.color_mode_switch`: a Switch component where is_checked depends on the
  color_mode and changing the value calls toggle_color_mode
* `pc.color_mode_button`: a Button component that calls toggle_color_mode on click

The default template has been updated to include a color_mode_button with
color_mode_icon for toggling light/dark mode. The inline hover style has also
been updated to use color_mode_cond to show a different highlight color based
on the color_mode.
2023-06-11 23:28:33 -07:00

39 lines
1.5 KiB
Python

"""Import all classes and functions the end user will need to make an app.
Anything imported here will be available in the default Pynecone import as `pc.*`.
To signal to typecheckers that something should be reexported,
we use the Flask "import name as name" syntax.
"""
from . import el as el
from .admin import AdminDash as AdminDash
from .app import App as App
from .app import UploadFile as UploadFile
from .base import Base as Base
from .compiler.utils import get_asset_path
from .components import *
from .components.component import custom_component as memo
from .components.graphing.victory import data as data
from .config import Config as Config
from .config import DBConfig as DBConfig
from .constants import Env as Env
from .constants import Transports as Transports
from .event import EVENT_ARG as EVENT_ARG
from .event import EventChain as EventChain
from .event import FileUpload as upload_files
from .event import console_log as console_log
from .event import redirect as redirect
from .event import set_focus as set_focus
from .event import set_value as set_value
from .event import window_alert as window_alert
from .middleware import Middleware as Middleware
from .model import Model as Model
from .model import session as session
from .route import route as route
from .state import ComputedVar as var
from .state import State as State
from .style import color_mode as color_mode
from .style import toggle_color_mode as toggle_color_mode
from .vars import Var as Var
from .vars import cached_var as cached_var