exlab_wizard.ui.components.mode_badge#

Mode badge component (Frontend Spec §5.3, §6).

Shows the active wizard mode (experimental vs test). Experimental uses --color-navy; test uses --color-warning per Frontend §2.1.4.

Functions

mode_badge(run_kind, *[, label])

Build a NiceGUI badge element for the given run kind.

mode_badge_props(run_kind, *[, label])

Compute the badge styling props for a run kind.

exlab_wizard.ui.components.mode_badge.mode_badge(run_kind, *, label=None)[source]#

Build a NiceGUI badge element for the given run kind.

Lazy NiceGUI import keeps this module unit-testable; the returned object is a NiceGUI ui.badge instance when an app context is active, else a plain dict (useful for tests).

Parameters:
Return type:

Any

exlab_wizard.ui.components.mode_badge.mode_badge_props(run_kind, *, label=None)[source]#

Compute the badge styling props for a run kind.

Returns a dict that wizards can spread onto a NiceGUI badge factory:

  • label – displayed text, defaulting to a sensible label per kind.

  • color_var – CSS variable token (--color-navy or --color-warning).

  • run_kind – echoed back for tests.

Test runs use the warning-tier hue; experimental runs use the navy primary. None (no run kind selected) defaults to experimental styling but with the label “– mode –” so the wizard’s title bar has something to display before the operator picks a mode.

Parameters:
Return type:

dict[str, Any]