a
    d
                     @  s   d Z ddlmZ ddlmZmZ ddlmZmZ ddl	m
Z
 ddlmZmZmZ ddlmZmZ ddlmZ ed	 e G d
d deee
ZdS )zgr.Button() component.    )annotations)CallableLiteral)documentset_documentation_group)StringSerializable)	ComponentIOComponent	_Keywords)warn_deprecationwarn_style_method_deprecation)	Clickable	componentc                   @  s   e Zd ZdZdddddddddddd
ddd	d
d
ddd
ddddddZdd Zeejddddddddf	ddd	d
d
ddddd	ddZ	ddddd	dddZ
dS )Buttona  
    Used to create a button, that can be assigned arbitrary click() events. The label (value) of the button can be used as an input or set via the output of a function.

    Preprocessing: passes the button value as a {str} into the function
    Postprocessing: expects a {str} to be returned from a function, which is set as the label of the button
    Demos: blocks_inputs, blocks_kinematics
    Run	secondaryNT)
variantsizeiconlinkvisibleinteractiveelem_idelem_classesscale	min_widthzstr | Callablez'Literal['primary', 'secondary', 'stop']zLiteral['sm', 'lg'] | Nonez
str | Noneboolzlist[str] | str | Nonez
int | None)valuer   r   r   r   r   r   r   r   r   r   c       
      
   K  sR   t j| f|||	|||
|d| |dkr6td d}|| _|| _|| _|| _dS )a  
        Parameters:
            value: Default text for the button to display. If callable, the function will be called whenever the app loads to set the initial value of the component.
            variant: 'primary' for main call-to-action, 'secondary' for a more subdued style, 'stop' for a stop button.
            size: Size of the button. Can be "sm" or "lg".
            icon: URL or path to the icon file to display within the button. If None, no icon will be displayed. Must be within the working directory of the Gradio app or an external URL.
            link: URL to open when the button is clicked. If None, no link will be used.
            visible: If False, component will be hidden.
            interactive: If False, the Button will be in a disabled state.
            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
            elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
            scale: relative width compared to adjacent Components in a Row. For example, if Component A has scale=2, and Component B has scale=1, A will be twice as wide as B. Should be an integer.
            min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
        )r   r   r   r   r   r   r   plainz6'plain' variant deprecated, using 'secondary' instead.r   N)r	   __init__r   r   r   r   r   )selfr   r   r   r   r   r   r   r   r   r   r   kwargs r"   a/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/gradio/components/button.pyr      s(    	zButton.__init__c              	   C  s0   | j | j| j| j| j| j| j| jdt	| S )N)r   r   r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   
get_config)r    r"   r"   r#   r$   L   s    	zButton.get_configz(str | Literal[_Keywords.NO_VALUE] | Nonez.Literal['primary', 'secondary', 'stop'] | Nonezbool | None	r   r   r   r   r   r   r   r   r   c	           	      C  s   |||| |||||dd
S )Nupdate)
r   r   r   r   r   r   r   r   r   Z__type__r"   r%   r"   r"   r#   r&   Y   s    zButton.update)
full_widthr   c                K  s6   t   |dur$td |rdnd| _|dur2|| _| S )zc
        This method is deprecated. Please set these arguments in the constructor instead.
        NzoUse `scale` in place of full_width in the constructor. scale=1 will make the button expand, whereas 0 will not.   )r   r   r   r   )r    r'   r   r!   r"   r"   r#   styler   s    
zButton.style)r   )__name__
__module____qualname____doc__r   r$   staticmethodr
   ZNO_VALUEr&   r)   r"   r"   r"   r#   r      s:   
 &1"r   N)r-   
__future__r   typingr   r   Zgradio_client.documentationr   r   Zgradio_client.serializingr   Zgradio.components.baser   r	   r
   Zgradio.deprecationr   r   Zgradio.eventsr   r   r"   r"   r"   r#   <module>   s   