{"version":3,"file":"RadioButton.cjs","sources":["../../../../../src/components/forms/radio-btn/RadioButton.tsx"],"sourcesContent":["import React from \"react\";\n\n/**\n * Props for the RadioButton component\n * @interface RadioButtonProps\n */\ninterface RadioButtonProps {\n  /** Unique identifier for the radio button */\n  id: string;\n  /** Name attribute for the radio input (for grouping) */\n  name: string;\n  /** Value of the radio button */\n  value: string;\n  /** Label text to display */\n  label: string;\n  /** Whether the radio button is checked */\n  checked?: boolean;\n  /** Whether the radio button is disabled */\n  disabled?: boolean;\n  /** Callback function when the radio button changes */\n  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n  /** Whether the input is required */\n  required?: boolean;\n  /** Additional CSS classes */\n  className?: string;\n  /** Error message to display */\n  error?: string;\n  /** Help text to provide additional context */\n  helpText?: string;\n  /** Font size of the radio button */\n  fontSize?: string;\n}\n\n/**\n * A customizable, accessible radio button component\n * @example\n * ```tsx\n * <RadioButton\n *  id=\"radio-button-1\"\n *  name=\"radio-button-group\"\n *  value=\"radio-button-1\"\n *  label=\"Radio Button 1\"\n * />\n * ```\n * @param id Unique identifier for the radio button\n * @param name Name attribute for the radio input (for grouping)\n * @param value Value of the radio button\n * @param label Label text to display\n * @param checked Whether the radio button is checked\n * @param disabled Whether the radio button is disabled\n * @param onChange Callback function when the radio button changes\n * @param required Whether the radio button is required\n * @param className Additional CSS classes\n * @param error Error message to display\n * @param helpText Help text to provide additional context\n * @param fontSize Font size of the radio button\n */\nconst RadioButton: React.FC<RadioButtonProps> = ({\n  id,\n  name,\n  value,\n  label,\n  checked = false,\n  disabled = false,\n  onChange,\n  required = false,\n  className = \"\",\n  error,\n  helpText,\n  fontSize = \"ihub-fs-sm\",\n}) => {\n  return (\n    <div\n      className={`ihub-radio-wrapper ${className} ${\n        disabled ? \"ihub-radio-disabled\" : \"\"\n      } ${error ? \"ihub-radio-error\" : \"\"}`}\n    >\n      <div className=\"ihub-radio-container\">\n        <input\n          type=\"radio\"\n          id={id}\n          name={name}\n          value={value}\n          checked={checked}\n          disabled={disabled}\n          onChange={onChange}\n          required={required}\n          aria-invalid={!!error}\n          aria-describedby={`${id}-${error ? \"error\" : helpText ? \"help\" : \"\"}`}\n          className=\"ihub-radio-input\"\n        />\n        <label className=\"ihub-radio-label\" htmlFor={id}>\n          <span className=\"ihub-radio-custom\" aria-hidden=\"true\"></span>\n          <span className={`ihub-radio-text ${fontSize}`}>{label}</span>\n          {required && (\n            <span className=\"ihub-required-mark\" aria-hidden=\"true\">\n              *\n            </span>\n          )}\n        </label>\n      </div>\n\n      {helpText && !error && (\n        <div id={`${id}-help`} className=\"ihub-radio-help-text\">\n          {helpText}\n        </div>\n      )}\n\n      {error && (\n        <div\n          id={`${id}-error`}\n          className=\"ihub-radio-error-message\"\n          role=\"alert\"\n        >\n          {error}\n        </div>\n      )}\n    </div>\n  );\n};\n\nexport default RadioButton;\n"],"names":["_ref","id","name","value","label","_ref$checked","checked","_ref$disabled","disabled","onChange","_ref$required","required","_ref$className","className","error","helpText","_ref$fontSize","fontSize","_jsxs","concat","children","jsxs","_jsx","jsx","type","htmlFor","role"],"mappings":"uHAyDgD,SAA/BA,GAaZ,IAZHC,EAAED,EAAFC,GACAC,EAAIF,EAAJE,KACAC,EAAKH,EAALG,MACAC,EAAKJ,EAALI,MAAKC,EAAAL,EACLM,QAAAA,OAAU,IAAHD,GAAQA,EAAAE,EAAAP,EACfQ,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAAQT,EAARS,SAAQC,EAAAV,EACRW,SAAAA,OAAW,IAAHD,GAAQA,EAAAE,EAAAZ,EAChBa,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EACdE,EAAKd,EAALc,MACAC,EAAQf,EAARe,SAAQC,EAAAhB,EACRiB,SAAAA,OAAW,IAAHD,EAAG,aAAYA,EAEvB,OACEE,EAAAA,KACE,MAAA,CAAAL,UAAS,sBAAAM,OAAwBN,OAASM,OACxCX,EAAW,sBAAwB,GACrC,KAAAW,OAAIL,EAAQ,mBAAqB,IA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