import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{switchPropAlignDefault,switchPropSizeDefault,switchPropViewDefault}from"./types";export var cnSwitch=cn("Switch");export var COMPONENT_NAME="Switch";export var Switch=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=d.name,g=d.size,h=void 0===g?switchPropSizeDefault:g,i=d.view,j=void 0===i?switchPropViewDefault:i,k=d.align,l=void 0===k?switchPropAlignDefault:k,m=d.disabled,n=d.className,o=d.label,p=d.onChange,q=d.onFocus,r=d.onBlur,s=d.readOnly,t=d.required,u=d.step,v=d.tabIndex,w=d.inputRef,x=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},x,{className:cnSwitch({size:h,view:j,disabled:m,align:l},[n]),ref:useForkRef([c,b])}),React.createElement("input",{type:"checkbox",name:f,className:cnSwitch("Input",[cnMixFocus()]),checked:void 0!==e&&e,disabled:m,onChange:p,onFocus:q,onBlur:r,readOnly:s,required:t,step:u,tabIndex:v,ref:w}),o&&React.createElement("span",{className:cnSwitch("Label")},o))});
//# sourceMappingURL=Switch.js.map