@danhachuel/thunderbolt 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/app/main.py +4 -26
  2. package/package.json +1 -1
package/app/main.py CHANGED
@@ -216,10 +216,8 @@ st.markdown("""
216
216
  [data-testid="stSidebar"] [data-testid="stBaseButton-secondary"] { background:transparent; color:inherit; }
217
217
  [data-testid="stSidebar"] [data-testid="stBaseButton-secondary"]:hover { background:rgba(128,128,128,.08); border-color:rgba(128,128,128,.25); color:inherit; }
218
218
  [data-testid="stSidebar"] [data-testid="stBaseButton-secondary"]:hover { background:color-mix(in srgb, currentColor 8%, transparent); border-color:color-mix(in srgb, currentColor 18%, transparent); color:inherit; }
219
- [data-testid="stSidebar"] [data-testid="stBaseButton-primary"] { background:rgba(128,128,128,.14); color:inherit; border-color:rgba(128,128,128,.30); }
220
- [data-testid="stSidebar"] [data-testid="stBaseButton-primary"] { background:color-mix(in srgb, currentColor 12%, transparent); color:inherit; border-color:color-mix(in srgb, currentColor 22%, transparent); }
221
- [data-testid="stSidebar"] [data-testid="stBaseButton-primary"]:hover { background:rgba(128,128,128,.20); color:inherit; }
222
- [data-testid="stSidebar"] [data-testid="stBaseButton-primary"]:hover { background:color-mix(in srgb, currentColor 18%, transparent); color:inherit; }
219
+ [data-testid="stSidebar"] [data-testid="stBaseButton-primary"] { background:#7c3aed !important; color:#ffffff !important; border-color:#8b5cf6 !important; }
220
+ [data-testid="stSidebar"] [data-testid="stBaseButton-primary"]:hover { background:#6d28d9 !important; color:#ffffff !important; border-color:#a78bfa !important; }
223
221
  [data-testid="stSidebar"] [data-testid="stBaseButton-primary"] span,
224
222
  [data-testid="stSidebar"] [data-testid="stBaseButton-secondary"] span { color:inherit; }
225
223
  [data-testid="stSidebar"] [data-testid="stExpander"] { border:0 !important; background:transparent !important; margin:0.02rem 0 !important; }
@@ -7136,29 +7134,12 @@ def main():
7136
7134
  st.session_state["page"] = target
7137
7135
  st.rerun()
7138
7136
 
7139
- def is_nav_target_active(target: str) -> bool:
7140
- """Return whether a menu target or one of its children is the current page."""
7141
- if current_page == target:
7142
- return True
7143
- return any(child[0] == current_page for child in groups.get(target, []))
7144
-
7145
7137
  def render_nav_button(target: str, icon: str, label: str, scope: str):
7146
7138
  display_label = ui_text(label, ui_language)
7147
- if st.button(display_label, key=f"nav_{scope}_{target}", icon=icon, use_container_width=True, type="primary" if is_nav_target_active(target) else "secondary"):
7139
+ if st.button(display_label, key=f"nav_{scope}_{target}", icon=icon, use_container_width=True, type="primary" if current_page == target else "secondary"):
7148
7140
  navigate(target)
7149
7141
 
7150
7142
  with st.sidebar:
7151
- st.markdown(
7152
- """
7153
- <style>
7154
- section[data-testid="stSidebar"] [data-testid="stExpander"] summary strong {
7155
- color: #c4b5fd;
7156
- font-weight: 750;
7157
- }
7158
- </style>
7159
- """,
7160
- unsafe_allow_html=True,
7161
- )
7162
7143
  version_markup = f'<span class="tb-brand-version">{APP_VERSION_LABEL}</span>' if APP_VERSION_LABEL else ""
7163
7144
  st.markdown(f'<div class="tb-brand"><span class="tb-brand-name">Thunderbolt</span>{version_markup}</div>', unsafe_allow_html=True)
7164
7145
  for target, icon, label in top_pages:
@@ -7167,10 +7148,7 @@ def main():
7167
7148
  render_nav_button(target, icon, label, "top")
7168
7149
  continue
7169
7150
  child_targets = {item[0] for item in children}
7170
- group_active = is_nav_target_active(target)
7171
- group_label = f"**{ui_text(label, ui_language)}**" if group_active else ui_text(label, ui_language)
7172
- group_icon = ":material/radio_button_checked:" if group_active else icon
7173
- with st.expander(group_label, expanded=current_page in child_targets, icon=group_icon):
7151
+ with st.expander(ui_text(label, ui_language), expanded=current_page in child_targets, icon=icon):
7174
7152
  for child_target, child_icon, child_label in children:
7175
7153
  render_nav_button(child_target, child_icon, child_label, target)
7176
7154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",