<?php
/**
 * WeCodeArt Framework
 *
 * WARNING: This file is part of the core WeCodeArt Framework. DO NOT edit this file under any circumstances.
 * Please do all modifications in the form of a child theme.
 *
 * @package 	WeCodeArt Framework 
 * @subpackage 	Markup\Inputs
 * @copyright   Copyright (c) 2025, WeCodeArt Framework
 * @since		6.0.0
 * @version		6.4.1
 */

namespace WeCodeArt\Support\DOM\Inputs;

defined( 'ABSPATH' ) || exit;

use WeCodeArt\Support\DOM\Inputs\Basic;
use function WeCodeArt\Functions\get_prop;

/**
 * Standard Inputs Markup
 */
class File extends Basic {
    /**
     * Input's Style Deps.
     *
     * @since   6.4.1
     * @var     array
     */
    static $style_deps = [ 'basic' ];
    
    /**
	 * Constructor 
	 */
	public function __construct( string $type = 'file', array $args = [] ) {
        parent::__construct( $type, $args );
    }

    /**
	 * Input styles.
	 *
	 * @return 	string
	 */
	public static function styles(): string {
		return '
            ::file-selector-button {
				font: inherit;
			}
			::-webkit-file-upload-button {
				font: inherit;
				-webkit-appearance: button;
			}
            .form-control[type="file"] {
                overflow: hidden;
            }
            .form-control[type="file"]:not(:disabled):not([readonly]) {
                cursor: pointer;
            }
            .form-control::file-selector-button {
                padding: var(--wp--input--padding);
                margin: calc(-1 * var(--wp--input--padding-y)) calc(-1 * var(--wp--input--padding-x));
                margin-inline-end: var(--wp--input--padding-x);
                background-color: var(--wp--gray-200);
                color: var(--wp--preset--color--dark);
                pointer-events: none;
                border-style: solid;
                border-color: inherit;
                border-radius: 0;
                border-width: 0;
                border-inline-end-width: 1px;
                transition: color .15s ease-in-out, background-color .15s ease-in-out, box-shadow .15s ease-in-out;
            }
            .form-control:hover:not(:disabled):not([readonly])::file-selector-button {
                background-color: var(--wp--gray-300);
            }
        ';
	}
}