from typing import Iterable import gradio as gr # gr.themes.builder() from gradio.themes.base import Base from gradio.themes.utils import colors, fonts, sizes import time # Applio Theme class Applio(Base): def __init__( self, *, primary_hue: colors.Color | str = colors.neutral, secondary_hue: colors.Color | str = colors.neutral, neutral_hue: colors.Color | str = colors.neutral, spacing_size: sizes.Size | str = sizes.spacing_md, radius_size: sizes.Size | str = sizes.radius_md, text_size: sizes.Size | str = sizes.text_lg, font: fonts.Font | str | Iterable[fonts.Font | str] = ( "Syne V", fonts.GoogleFont("Syne"), "ui-sans-serif", "system-ui", ), font_mono: fonts.Font | str | Iterable[fonts.Font | str] = ( "ui-monospace", fonts.GoogleFont("Nunito Sans"), ), ): super().__init__( primary_hue=primary_hue, secondary_hue=secondary_hue, neutral_hue=neutral_hue, spacing_size=spacing_size, radius_size=radius_size, text_size=text_size, font=font, font_mono=font_mono, ) self.name = ("Applio",) self.secondary_100 = ("#dbeafe",) self.secondary_200 = ("#bfdbfe",) self.secondary_300 = ("#93c5fd",) self.secondary_400 = ("#60a5fa",) self.secondary_50 = ("#eff6ff",) self.secondary_500 = ("#3b82f6",) self.secondary_600 = ("#2563eb",) self.secondary_700 = ("#1d4ed8",) self.secondary_800 = ("#1e40af",) self.secondary_900 = ("#1e3a8a",) self.secondary_950 = ("#1d3660",) super().set( # Blaise background_fill_primary="#ffffff", background_fill_primary_dark="#ffffff", background_fill_secondary="#ffffff", background_fill_secondary_dark="#ffffff", block_background_fill="#ffffff", block_background_fill_dark="#ffffff", block_border_color="#3b82f6", block_border_color_dark="#3b82f6", block_border_width="1px", block_border_width_dark="1px", block_info_text_color="#3b82f6", block_info_text_color_dark="#3b82f6", block_info_text_size="*text_sm", block_info_text_weight="400", block_label_background_fill="#ffffff", block_label_background_fill_dark="#ffffff", block_label_border_color="#3b82f6", block_label_border_color_dark="#3b82f6", block_label_border_width="1px", block_label_border_width_dark="1px", block_label_margin="0", block_label_padding="*spacing_sm *spacing_lg", block_label_radius="calc(*radius_lg - 1px) 0 calc(*radius_lg - 1px) 0", block_label_right_radius="0 calc(*radius_lg - 1px) 0 calc(*radius_lg - 1px)", block_label_shadow="*block_shadow", block_label_text_color="#3b82f6", block_label_text_color_dark="#3b82f6", block_label_text_weight="400", block_padding="*spacing_xl", block_radius="*radius_md", block_shadow="none", block_shadow_dark="none", block_title_background_fill="#eff6ff", block_title_background_fill_dark="#eff6ff", block_title_border_color="none", block_title_border_color_dark="none", block_title_border_width="0px", block_title_padding="*block_label_padding", block_title_radius="*block_label_radius", block_title_text_color="#3b82f6", block_title_text_color_dark="#3b82f6", block_title_text_size="*text_md", block_title_text_weight="600", body_background_fill="#ffffff", body_background_fill_dark="#ffffff", body_text_color="#3b82f6", body_text_color_dark="#3b82f6", body_text_color_subdued="#93c5fd", body_text_color_subdued_dark="#93c5fd", body_text_size="*text_md", body_text_weight="400", border_color_accent="#2563eb", border_color_accent_dark="#2563eb", border_color_primary="#3b82f6", border_color_primary_dark="#3b82f6", button_border_width="*input_border_width", button_border_width_dark="*input_border_width", button_cancel_background_fill="#93c5fd", button_cancel_background_fill_dark="#93c5fd", button_cancel_background_fill_hover="#bfdbfe", button_cancel_background_fill_hover_dark="#bfdbfe", button_cancel_border_color="#2563eb", button_cancel_border_color_dark="#2563eb", button_cancel_border_color_hover="#1d4ed8", button_cancel_border_color_hover_dark="#1d4ed8", button_cancel_text_color="#3b82f6", button_cancel_text_color_dark="#3b82f6", button_cancel_text_color_hover="#1d4ed8", button_cancel_text_color_hover_dark="#1d4ed8", button_large_padding="*spacing_lg calc(2 * *spacing_lg)", button_large_radius="*radius_lg", button_large_text_size="*text_lg", button_large_text_weight="600", button_primary_background_fill="#1e40af", button_primary_background_fill_dark="#1e40af", button_primary_background_fill_hover="#1e3a8a", button_primary_background_fill_hover_dark="#1e3a8a", button_primary_border_color="#1e3a8a", button_primary_border_color_dark="#1e3a8a", button_primary_border_color_hover="#1d4ed8", button_primary_border_color_hover_dark="#1d4ed8", button_primary_text_color="#ffffff", button_primary_text_color_dark="#ffffff", button_primary_text_color_hover="#eff6ff", button_primary_text_color_hover_dark="#eff6ff", button_secondary_background_fill="transparent", button_secondary_background_fill_dark="transparent", button_secondary_background_fill_hover="#3b82f6", button_secondary_background_fill_hover_dark="#3b82f6", button_secondary_border_color="#2563eb", button_secondary_border_color_dark="#2563eb", button_secondary_border_color_hover="#1d4ed8", button_secondary_border_color_hover_dark="#1d4ed8", button_secondary_text_color="#3b82f6", button_secondary_text_color_dark="#3b82f6", button_secondary_text_color_hover="#2563eb", button_secondary_text_color_hover_dark="#2563eb", button_shadow="none", button_shadow_active="*shadow_inset", button_shadow_hover="none", button_small_padding="*spacing_sm calc(2 * *spacing_sm)", button_small_radius="*radius_lg", button_small_text_size="*text_md", button_small_text_weight="400", button_transition="0.3s ease all", checkbox_background_color="#2563eb", checkbox_background_color_dark="#2563eb", checkbox_background_color_focus="#3b82f6", checkbox_background_color_focus_dark="#3b82f6", checkbox_background_color_hover="#2563eb", checkbox_background_color_hover_dark="#2563eb", checkbox_background_color_selected="#1d4ed8", checkbox_background_color_selected_dark="#1d4ed8", checkbox_border_color="#3b82f6", checkbox_border_color_dark="#3b82f6", checkbox_border_color_focus="#2563eb", checkbox_border_color_focus_dark="#2563eb", checkbox_border_color_hover="#1d4ed8", checkbox_border_color_hover_dark="#1d4ed8", checkbox_border_color_selected="#1e40af", checkbox_border_color_selected_dark="#1e40af", checkbox_border_radius="*radius_sm", checkbox_border_width="*input_border_width", checkbox_border_width_dark="*input_border_width", checkbox_check="url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e\")", checkbox_label_background_fill="transparent", checkbox_label_background_fill_dark="transparent", checkbox_label_background_fill_hover="transparent", checkbox_label_background_fill_hover_dark="transparent", checkbox_label_background_fill_selected="transparent", checkbox_label_background_fill_selected_dark="transparent", checkbox_label_border_color="transparent", checkbox_label_border_color_dark="transparent", checkbox_label_border_color_hover="transparent", checkbox_label_border_color_hover_dark="transparent", checkbox_label_border_width="transparent", checkbox_label_border_width_dark="transparent", checkbox_label_gap="*spacing_lg", checkbox_label_padding="*spacing_md calc(2 * *spacing_md)", checkbox_label_shadow="none", checkbox_label_text_color="#3b82f6", checkbox_label_text_color_dark="#3b82f6", checkbox_label_text_color_selected="#2563eb", checkbox_label_text_color_selected_dark="#2563eb", checkbox_label_text_size="*text_md", checkbox_label_text_weight="400", checkbox_shadow="*input_shadow", color_accent="#3b82f6", color_accent_soft="#eff6ff", color_accent_soft_dark="#2563eb", container_radius="*radius_xl", embed_radius="*radius_lg", error_background_fill="#2563eb", error_background_fill_dark="#2563eb", error_border_color="#3b82f6", error_border_color_dark="#3b82f6", error_border_width="1px", error_border_width_dark="1px", error_text_color="#ef4444", error_text_color_dark="#ef4444", form_gap_width="0px", input_background_fill="#1e40af", input_background_fill_dark="#1e40af", input_background_fill_focus="#2563eb", input_background_fill_focus_dark="#2563eb", input_background_fill_hover="#1e40af", input_background_fill_hover_dark="#1e40af", input_border_color="#3b82f6", input_border_color_dark="#3b82f6", input_border_color_focus="#2563eb", input_border_color_focus_dark="#2563eb", input_border_color_hover="#1d4ed8", input_border_color_hover_dark="#1d4ed8", input_border_width="1px", input_border_width_dark="1px", input_padding="*spacing_xl", input_placeholder_color="#2563eb", input_placeholder_color_dark="#2563eb", input_radius="*radius_lg", input_shadow="none", input_shadow_dark="none", input_shadow_focus="*input_shadow", input_shadow_focus_dark="*input_shadow", input_text_size="*text_md", input_text_weight="400", layout_gap="*spacing_xxl", link_text_color="#2563eb", link_text_color_active="#2563eb", link_text_color_active_dark="#2563eb", link_text_color_dark="#2563eb", link_text_color_hover="#1d4ed8", link_text_color_hover_dark="#1d4ed8", link_text_color_visited="#1e40af", link_text_color_visited_dark="#1e40af", loader_color="#3b82f6", loader_color_dark="#3b82f6", panel_background_fill="#ffffff", panel_background_fill_dark="#ffffff", panel_border_color="#3b82f6", panel_border_color_dark="#3b82f6", panel_border_width="1px", panel_border_width_dark="1px", prose_header_text_weight="600", prose_text_size="*text_md", prose_text_weight="400", radio_circle="url(\"data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e\")", section_header_text_size="*text_md", section_header_text_weight="400", shadow_drop="rgba(0,0,0,0.05) 0px 1px 2px 0px", shadow_drop_lg="0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", shadow_inset="rgba(0,0,0,0.05) 0px 2px 4px 0px inset", shadow_spread="3px", shadow_spread_dark="1px", slider_color="#9E9E9E", slider_color_dark="#9E9E9E", stat_background_fill="#3b82f6", stat_background_fill_dark="#3b82f6", table_border_color="#3b82f6", table_border_color_dark="#3b82f6", table_even_background_fill="#eff6ff", table_even_background_fill_dark="#eff6ff", table_odd_background_fill="#bfdbfe", table_odd_background_fill_dark="#bfdbfe", table_radius="*radius_lg", table_row_focus="#eff6ff", table_row_focus_dark="#eff6ff", ) applio = Applio()