neogestify-ui-components 1.2.19 → 1.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,10 +22,11 @@ export const Input: FC<InputProps> = ({
22
22
  const errorClasses = error ? 'border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400 focus:border-red-500' : 'border-gray-300 dark:border-gray-600';
23
23
  const classes = `${baseClasses} ${errorClasses} ${className}`;
24
24
 
25
- // ── Checkbox ──────────────────────────────────────────────────────────────
26
- const checkboxBaseClasses = 'h-4 w-4 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-indigo-600 dark:text-indigo-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-gray-900 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 cursor-pointer';
27
- const checkboxErrorClasses = error ? 'border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400' : '';
28
- const checkboxClasses = `${checkboxBaseClasses} ${checkboxErrorClasses}`.trim();
25
+ // ── Checkbox / Radio ──────────────────────────────────────────────────────
26
+ const toggleShape = type === 'radio' ? 'rounded-full' : 'rounded';
27
+ const toggleBaseClasses = `h-4 w-4 ${toggleShape} border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-indigo-600 dark:text-indigo-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-gray-900 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 cursor-pointer`;
28
+ const toggleErrorClasses = error ? 'border-red-300 dark:border-red-600 focus:ring-red-500 dark:focus:ring-red-400' : '';
29
+ const toggleClasses = `${toggleBaseClasses} ${toggleErrorClasses}`.trim();
29
30
 
30
31
  // ── File input ────────────────────────────────────────────────────────────
31
32
  const fileBaseClasses = 'block w-full sm:text-sm text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 border rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500 dark:focus:ring-indigo-400 focus:border-indigo-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200 file:mr-4 file:py-2 file:px-4 file:rounded-l-md file:border-0 file:text-sm file:font-medium file:bg-indigo-50 file:text-indigo-700 dark:file:bg-indigo-900/50 dark:file:text-indigo-300 hover:file:bg-indigo-100 dark:hover:file:bg-indigo-800/50 file:transition-colors file:duration-200 file:cursor-pointer';
@@ -36,14 +37,14 @@ export const Input: FC<InputProps> = ({
36
37
  const wrapperBase = 'space-y-1 w-full';
37
38
  const wrapperClasses = hasHidden ? `${wrapperBase} hidden` : wrapperBase;
38
39
 
39
- if (type === 'checkbox') {
40
+ if (type === 'checkbox' || type === 'radio') {
40
41
  return (
41
42
  <div className={wrapperClasses}>
42
43
  <div className="flex items-center space-x-2">
43
44
  <input
44
45
  id={inputId}
45
- type="checkbox"
46
- className={checkboxClasses}
46
+ type={type}
47
+ className={toggleClasses}
47
48
  {...props}
48
49
  />
49
50
  {label && typeof label === 'string' ? (
@@ -56,7 +56,7 @@ export const Select: FC<SelectProps> = ({
56
56
  )}
57
57
  <select id={selectId} className={combinedClassName} {...props}>
58
58
  {placeholder && placeholder.trim() && (
59
- <option value="" disabled className="bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 py-2">
59
+ <option value="" disabled selected className="bg-white dark:bg-gray-800 text-gray-500 dark:text-gray-400 py-2">
60
60
  {placeholder}
61
61
  </option>
62
62
  )}