L i[0ddlmZddlmZmZddlmZddlmZ ddl m Z ddl m Z ddlmZmZerddlmZdd lmZdd lmZGd d Zy )) annotations) TYPE_CHECKINGcast)validate_width)Alert) WidthConfig)gather_metrics) clean_textvalidate_icon_or_emoji)DeltaGenerator)WidthWithoutContent) SupportsStrceZdZedddd d dZedddd d dZedddd d d Zed ddd d d Zedd Z y) AlertMixinerrorNstretch)iconwidthcVt}t||_t||_tj |_t|t}t|tr||_ nd|_ |jj||jj!d|S)uDisplay error message. Parameters ---------- body : str The text to display as GitHub-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm. See the ``body`` parameter of |st.markdown|_ for additional, supported Markdown directives. .. |st.markdown| replace:: ``st.markdown`` .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown icon : str, None An optional emoji or icon to display next to the alert. If ``icon`` is ``None`` (default), no icon is displayed. If ``icon`` is a string, the following options are valid: - A single-character emoji. For example, you can set ``icon="🚨"`` or ``icon="🔥"``. Emoji short codes are not supported. - An icon from the Material Symbols library (rounded style) in the format ``":material/icon_name:"`` where "icon_name" is the name of the icon in snake case. For example, ``icon=":material/thumb_up:"`` will display the Thumb Up icon. Find additional icons in the `Material Symbols `_ font library. width : "stretch" or int The width of the alert element. This can be one of the following: - ``"stretch"`` (default): The width of the element matches the width of the parent container. - An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. Example ------- >>> import streamlit as st >>> >>> st.error('This is an error', icon="🚨") Talert) AlertProtor rr bodyERRORformatrr isinstanceint pixel_width use_stretch width_configCopyFromdg_enqueueselfrrr alert_protors ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/elements/alert.pyrzAlertMixin.error sl!l 1$7 %d+ '-- u"} eS !',L $'+L $  )),7ww55warningcVt}t||_t||_tj |_t|t}t|tr||_ nd|_ |jj||jj!d|S)uDisplay warning message. Parameters ---------- body : str The text to display as GitHub-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm. See the ``body`` parameter of |st.markdown|_ for additional, supported Markdown directives. .. |st.markdown| replace:: ``st.markdown`` .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown icon : str, None An optional emoji or icon to display next to the alert. If ``icon`` is ``None`` (default), no icon is displayed. If ``icon`` is a string, the following options are valid: - A single-character emoji. For example, you can set ``icon="🚨"`` or ``icon="🔥"``. Emoji short codes are not supported. - An icon from the Material Symbols library (rounded style) in the format ``":material/icon_name:"`` where "icon_name" is the name of the icon in snake case. For example, ``icon=":material/thumb_up:"`` will display the Thumb Up icon. Find additional icons in the `Material Symbols `_ font library. width : "stretch" or int The width of the warning element. This can be one of the following: - ``"stretch"`` (default): The width of the element matches the width of the parent container. - An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. Example ------- >>> import streamlit as st >>> >>> st.warning('This is a warning', icon="⚠️") Tr)rr rr rWARNINGrrrrrrrrr r!r"r#s r&r(zAlertMixin.warningil!l %d+ 1$7 '// u"} eS !',L $'+L $  )),7ww55r'infocVt}t||_t||_tj |_t|t}t|tr||_ nd|_ |jj||jj!d|S)uDisplay an informational message. Parameters ---------- body : str The text to display as GitHub-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm. See the ``body`` parameter of |st.markdown|_ for additional, supported Markdown directives. .. |st.markdown| replace:: ``st.markdown`` .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown icon : str, None An optional emoji or icon to display next to the alert. If ``icon`` is ``None`` (default), no icon is displayed. If ``icon`` is a string, the following options are valid: - A single-character emoji. For example, you can set ``icon="🚨"`` or ``icon="🔥"``. Emoji short codes are not supported. - An icon from the Material Symbols library (rounded style) in the format ``":material/icon_name:"`` where "icon_name" is the name of the icon in snake case. For example, ``icon=":material/thumb_up:"`` will display the Thumb Up icon. Find additional icons in the `Material Symbols `_ font library. width : "stretch" or int The width of the info element. This can be one of the following: - ``"stretch"`` (default): The width of the element matches the width of the parent container. - An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. Example ------- >>> import streamlit as st >>> >>> st.info('This is a purely informational message', icon="ℹ️") Tr)rr rr rINFOrrrrrrrrr r!r"r#s r&r,zAlertMixin.infosn!l %d+ 1$7 '__ u"} eS !',L $'+L $  )),7ww55r'successcVt}t||_t||_tj |_t|t}t|tr||_ nd|_ |jj||jj!d|S)uDisplay a success message. Parameters ---------- body : str The text to display as GitHub-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm. See the ``body`` parameter of |st.markdown|_ for additional, supported Markdown directives. .. |st.markdown| replace:: ``st.markdown`` .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown icon : str, None An optional emoji or icon to display next to the alert. If ``icon`` is ``None`` (default), no icon is displayed. If ``icon`` is a string, the following options are valid: - A single-character emoji. For example, you can set ``icon="🚨"`` or ``icon="🔥"``. Emoji short codes are not supported. - An icon from the Material Symbols library (rounded style) in the format ``":material/icon_name:"`` where "icon_name" is the name of the icon in snake case. For example, ``icon=":material/thumb_up:"`` will display the Thumb Up icon. Find additional icons in the `Material Symbols `_ font library. width : "stretch" or int The width of the success element. This can be one of the following: - ``"stretch"`` (default): The width of the element matches the width of the parent container. - An integer specifying the width in pixels: The element has a fixed width. If the specified width is greater than the width of the parent container, the width of the element matches the width of the parent container. Example ------- >>> import streamlit as st >>> >>> st.success('This is a success message!', icon="✅") Tr)rr rr rSUCCESSrrrrrrrrr r!r"r#s r&r/zAlertMixin.successr+r'ctd|S)zGet our DeltaGenerator.r )r)r$s r&r!z AlertMixin.dgBs$d++r')rrrz str | Nonerr returnr )r3r ) __name__ __module__ __qualname__r rr(r,r/propertyr!r'r&rrsLG  %. F6F6 F6 # F6  F6F6PI  %. E6E6 E6 # E6  E6E6NF  %. F6F6 F6 # F6  F6F6PI  %. E6E6 E6 # E6  E6E6N,,r'rN) __future__rtypingrr#streamlit.elements.lib.layout_utilsrstreamlit.proto.Alert_pb2rrstreamlit.proto.WidthConfig_pb2rstreamlit.runtime.metrics_utilr streamlit.string_utilr r streamlit.delta_generatorr r streamlit.type_utilrrr8r'r&rBs4#&>979D8G/f,f,r'