import React from 'react';
import { classNames } from '../types';
export const PHXRadio = ({ className, error, errorType, label, register, title, description, disabled, defaultChecked, ...rest }) => (React.createElement("div", { className: className },
    React.createElement("label", { className: classNames(label ? 'mb-1 block text-xs font-normal text-gray-700' : 'hidden') }, label),
    React.createElement("div", { className: 'flex items-center' },
        React.createElement("label", { className: classNames('flex items-center text-xs font-normal leading-5 text-gray-700', disabled ? 'cursor-not-allowed' : 'hover:cursor-pointer') },
            React.createElement("input", { ...register, ...rest, disabled: disabled, defaultChecked: defaultChecked, className: classNames(error ? 'border-red-800 bg-red-50 hover:bg-red-50 focus:border-red-800 focus:bg-red-50' : '', disabled ? 'hover:cursor-not-allowed border-none bg-gray-200' : 'hover:cursor-pointer border-gray-300', 'h-4 w-4  p-0 text-indigo-900 focus:ring-transparent'), type: 'radio' }),
            React.createElement("span", { className: classNames('ml-2 text-gray-800', disabled && !defaultChecked && 'opacity-80 !text-gray-400 cursor-not-allowed') }, title))),
    React.createElement("p", { className: classNames('text-xs font-normal text-gray-500 ml-6', disabled && !defaultChecked && 'opacity-80') }, description),
    error && errorType ? (React.createElement("div", { className: 'ml-1 mt-1 flex items-center' },
        React.createElement("svg", { className: 'mr-2 h-4 w-4 text-red-500', fill: 'none', stroke: 'currentColor', strokeWidth: '2', viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg' },
            React.createElement("path", { d: 'M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z', strokeLinecap: 'round', strokeLinejoin: 'round' })),
        React.createElement("p", { className: 'text-xs text-red-800' }, errorType === 'required-field' ? 'Vui lòng chọn thông tin' : 'Thông tin đã tồn tại'))) : null));
//# sourceMappingURL=Radio.js.map