diff --git a/design-system/README.md b/design-system/README.md index 7f8ee7c5..e3cc26f4 100644 --- a/design-system/README.md +++ b/design-system/README.md @@ -47,4 +47,4 @@ That's the "default with per-app customization" model: the base is canonical; an ## Status & next step -This kit is managed from `Workflows/templates/consumer-repo/design-system/` and distributed by the Maint 68 Sync Consumer Repos GitHub Actions workflow through `.github/sync-manifest.yml`. Update it here first, then let the sync workflow replace consumer copies. +This kit is managed from `stranske/Workflows/templates/consumer-repo/design-system/` and distributed by the Maint 68 Sync Consumer Repos GitHub Actions workflow through `.github/sync-manifest.yml`. Update the Workflows template first, then let the sync workflow replace consumer copies. diff --git a/design-system/ds_streamlit.py b/design-system/ds_streamlit.py index 6d3e9bd2..ac5d1466 100644 --- a/design-system/ds_streamlit.py +++ b/design-system/ds_streamlit.py @@ -25,9 +25,11 @@ from __future__ import annotations import logging +import re from collections.abc import Callable, Mapping from contextlib import contextmanager from html import escape +from importlib import import_module from typing import Any logger = logging.getLogger("ds") @@ -52,11 +54,18 @@ "ok": (_POS, _POS_WEAK, "✓"), } +_HEX_CHARS = frozenset("0123456789abcdef") +_UUID_RE = re.compile(r"(?i)^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$") + + +def _streamlit() -> Any: + return import_module("streamlit") + def inject_theme() -> None: """P1 — apply the light/understated theme. Pair with .streamlit/config.toml ([theme] base=\"light\"); this nudges spacing/headings to match the system.""" - import streamlit as st + st = _streamlit() st.markdown( f"""