{"version":3,"sources":["../src/components/Radio/Radio.tsx"],"sourcesContent":["import {\n  InputHTMLAttributes,\n  HTMLAttributes,\n  ReactNode,\n  forwardRef,\n  useState,\n  useId,\n  ChangeEvent,\n  useEffect,\n  useRef,\n  Children,\n  cloneElement,\n  isValidElement,\n  ReactElement,\n} from 'react';\nimport { create, StoreApi, useStore } from 'zustand';\nimport Text from '../Text/Text';\nimport { cn } from '../../utils/utils';\n\n/**\n * Radio size variants\n */\ntype RadioSize = 'small' | 'medium' | 'large' | 'extraLarge';\n\n/**\n * Radio visual state\n */\ntype RadioState = 'default' | 'hovered' | 'focused' | 'invalid' | 'disabled';\n\n/**\n * Size configurations using Tailwind classes\n */\nconst SIZE_CLASSES = {\n  small: {\n    radio: 'w-5 h-5',\n    textSize: 'sm' as const,\n    spacing: 'gap-1.5',\n    borderWidth: 'border-2',\n    dotSize: 'w-2.5 h-2.5',\n    labelHeight: 'h-5',\n  },\n  medium: {\n    radio: 'w-6 h-6',\n    textSize: 'md' as const,\n    spacing: 'gap-2',\n    borderWidth: 'border-2',\n    dotSize: 'w-3 h-3',\n    labelHeight: 'h-6',\n  },\n  large: {\n    radio: 'w-7 h-7',\n    textSize: 'lg' as const,\n    spacing: 'gap-2',\n    borderWidth: 'border-2',\n    dotSize: 'w-3.5 h-3.5',\n    labelHeight: 'h-7',\n  },\n  extraLarge: {\n    radio: 'w-8 h-8',\n    textSize: 'xl' as const,\n    spacing: 'gap-3',\n    borderWidth: 'border-2',\n    dotSize: 'w-4 h-4',\n    labelHeight: 'h-8',\n  },\n} as const;\n\n/**\n * Focused state maintains the same sizes as default state\n * Only adds wrapper styling, does not change radio/dot sizes\n */\n\n/**\n * Base radio styling classes using design system colors\n */\nconst BASE_RADIO_CLASSES =\n  'rounded-full border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none';\n\n/**\n * State-based styling classes using design system colors from styles.css\n */\nconst STATE_CLASSES = {\n  default: {\n    unchecked: 'border-border-400 bg-background hover:border-border-500',\n    checked: 'border-primary-950 bg-background hover:border-primary-800',\n  },\n  hovered: {\n    unchecked: 'border-border-500 bg-background',\n    checked: 'border-info-700 bg-background',\n  },\n  focused: {\n    unchecked: 'border-border-400 bg-background',\n    checked: 'border-primary-950 bg-background',\n  },\n  invalid: {\n    unchecked: 'border-border-400 bg-background',\n    checked: 'border-primary-950 bg-background',\n  },\n  disabled: {\n    unchecked: 'border-border-400 bg-background cursor-not-allowed',\n    checked: 'border-primary-950 bg-background cursor-not-allowed',\n  },\n} as const;\n\n/**\n * Dot styling classes for the inner dot when checked\n */\nconst DOT_CLASSES = {\n  default: 'bg-primary-950',\n  hovered: 'bg-info-700',\n  focused: 'bg-primary-950',\n  invalid: 'bg-primary-950',\n  disabled: 'bg-primary-950',\n} as const;\n\n/**\n * Radio component props interface\n */\nexport type RadioProps = {\n  /** Label text to display next to the radio */\n  label?: ReactNode;\n  /** Size variant of the radio */\n  size?: RadioSize;\n  /** Visual state of the radio */\n  state?: RadioState;\n  /** Error message to display */\n  errorMessage?: string;\n  /** Helper text to display */\n  helperText?: string;\n  /** Additional CSS classes */\n  className?: string;\n  /** Label CSS classes */\n  labelClassName?: string;\n  /** Radio group name */\n  name?: string;\n  /** Radio value */\n  value?: string;\n  /** Default checked state for uncontrolled radios */\n  defaultChecked?: boolean;\n} & Omit<\n  InputHTMLAttributes<HTMLInputElement>,\n  'size' | 'type' | 'defaultChecked'\n>;\n\n/**\n * Radio component for Analytica Ensino platforms\n *\n * A radio button component with essential states, sizes and themes.\n * Uses the Analytica Ensino Design System colors from styles.css with automatic\n * light/dark mode support. Includes Text component integration for consistent typography.\n *\n * @example\n * ```tsx\n * // Basic radio\n * <Radio name=\"option\" value=\"1\" label=\"Option 1\" />\n *\n * // Small size\n * <Radio size=\"small\" name=\"option\" value=\"2\" label=\"Small option\" />\n *\n * // Invalid state\n * <Radio state=\"invalid\" name=\"option\" value=\"3\" label=\"Required field\" />\n *\n * // Disabled state\n * <Radio disabled name=\"option\" value=\"4\" label=\"Disabled option\" />\n *\n * // Default checked (uncontrolled)\n * <Radio defaultChecked name=\"option\" value=\"5\" label=\"Initially checked\" />\n * ```\n */\nconst Radio = forwardRef<HTMLInputElement, RadioProps>(\n  (\n    {\n      label,\n      size = 'medium',\n      state = 'default',\n      errorMessage,\n      helperText,\n      className = '',\n      labelClassName = '',\n      checked: checkedProp,\n      defaultChecked = false,\n      disabled,\n      id,\n      name,\n      value,\n      onChange,\n      ...props\n    },\n    ref\n  ) => {\n    // Generate unique ID if not provided\n    const generatedId = useId();\n    const inputId = id ?? `radio-${generatedId}`;\n    const inputRef = useRef<HTMLInputElement>(null);\n\n    // Handle controlled vs uncontrolled behavior\n    const [internalChecked, setInternalChecked] = useState(defaultChecked);\n    const isControlled = checkedProp !== undefined;\n    const checked = isControlled ? checkedProp : internalChecked;\n\n    // Handle change events\n    const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n      const newChecked = event.target.checked;\n\n      if (!isControlled) {\n        setInternalChecked(newChecked);\n      }\n\n      // Prevent automatic scroll when input changes\n      if (event.target) {\n        event.target.blur();\n      }\n\n      onChange?.(event);\n    };\n\n    // Determine current state based on props\n    const currentState = disabled ? 'disabled' : state;\n\n    // Get size classes\n    const sizeClasses = SIZE_CLASSES[size];\n\n    // Focused state maintains original sizes, only adds wrapper\n    const actualRadioSize = sizeClasses.radio;\n    const actualDotSize = sizeClasses.dotSize;\n\n    // Determine radio visual variant\n    const radioVariant = checked ? 'checked' : 'unchecked';\n\n    // Get styling classes\n    const stylingClasses = STATE_CLASSES[currentState][radioVariant];\n\n    // Border width logic - consistent across all states and sizes\n    const getBorderWidth = () => {\n      if (currentState === 'focused') {\n        return 'border-2';\n      }\n      return sizeClasses.borderWidth;\n    };\n\n    const borderWidthClass = getBorderWidth();\n\n    // Get final radio classes\n    const radioClasses = cn(\n      BASE_RADIO_CLASSES,\n      actualRadioSize,\n      borderWidthClass,\n      stylingClasses,\n      className\n    );\n\n    // Get dot classes\n    const dotClasses = cn(\n      actualDotSize,\n      'rounded-full',\n      DOT_CLASSES[currentState],\n      'transition-all duration-200'\n    );\n\n    // Determine if wrapper is needed only for focused or invalid states\n    const isWrapperNeeded =\n      currentState === 'focused' || currentState === 'invalid';\n    const wrapperBorderColor =\n      currentState === 'focused'\n        ? 'border-indicator-info'\n        : 'border-indicator-error';\n\n    // Determine text color based on state and checked status\n    const getTextColor = () => {\n      if (currentState === 'disabled') {\n        return checked ? 'text-text-900' : 'text-text-600';\n      }\n\n      if (currentState === 'focused') {\n        return 'text-text-900';\n      }\n\n      return checked ? 'text-text-900' : 'text-text-600';\n    };\n\n    // Determine cursor class based on disabled state\n    const getCursorClass = () => {\n      return currentState === 'disabled'\n        ? 'cursor-not-allowed'\n        : 'cursor-pointer';\n    };\n\n    return (\n      <div className=\"flex flex-col\">\n        <div\n          className={cn(\n            'flex flex-row items-center',\n            isWrapperNeeded\n              ? cn('p-1 border-2', wrapperBorderColor, 'rounded-lg gap-1.5')\n              : sizeClasses.spacing,\n            disabled ? 'opacity-40' : ''\n          )}\n        >\n          {/* Hidden native input for accessibility and form submission */}\n          <input\n            ref={(node) => {\n              inputRef.current = node;\n              if (typeof ref === 'function') ref(node);\n              else if (ref) ref.current = node;\n            }}\n            type=\"radio\"\n            id={inputId}\n            checked={checked}\n            disabled={disabled}\n            name={name}\n            value={value}\n            onChange={handleChange}\n            className=\"sr-only\"\n            style={{\n              position: 'absolute',\n              left: '-9999px',\n              visibility: 'hidden',\n            }}\n            {...props}\n          />\n\n          {/* Custom styled radio */}\n          <button\n            type=\"button\"\n            className={radioClasses}\n            disabled={disabled}\n            aria-pressed={checked}\n            onClick={(e) => {\n              // Prevent scroll when radio is clicked\n              e.preventDefault();\n              if (!disabled) {\n                // Simulate click on hidden input\n                if (inputRef.current) {\n                  inputRef.current.click();\n                  // Remove focus to prevent scroll behavior\n                  inputRef.current.blur();\n                }\n              }\n            }}\n            onKeyDown={(e) => {\n              // Handle keyboard activation (Enter or Space)\n              if ((e.key === 'Enter' || e.key === ' ') && !disabled) {\n                e.preventDefault();\n                if (inputRef.current) {\n                  inputRef.current.click();\n                  inputRef.current.blur();\n                }\n              }\n            }}\n          >\n            {/* Show dot when checked */}\n            {checked && <div className={dotClasses} />}\n          </button>\n\n          {/* Label text */}\n          {label && (\n            <div\n              className={cn(\n                'flex flex-row items-center',\n                sizeClasses.labelHeight,\n                'flex-1 min-w-0'\n              )}\n            >\n              <Text\n                as=\"label\"\n                htmlFor={inputId}\n                size={sizeClasses.textSize}\n                weight=\"normal\"\n                className={cn(\n                  getCursorClass(),\n                  'select-none leading-normal flex items-center font-roboto truncate',\n                  labelClassName\n                )}\n                color={getTextColor()}\n              >\n                {label}\n              </Text>\n            </div>\n          )}\n        </div>\n\n        {/* Error message */}\n        {errorMessage && (\n          <Text\n            size=\"sm\"\n            weight=\"normal\"\n            className=\"mt-1.5 truncate\"\n            color=\"text-error-600\"\n          >\n            {errorMessage}\n          </Text>\n        )}\n\n        {/* Helper text */}\n        {helperText && !errorMessage && (\n          <Text\n            size=\"sm\"\n            weight=\"normal\"\n            className=\"mt-1.5 truncate\"\n            color=\"text-text-500\"\n          >\n            {helperText}\n          </Text>\n        )}\n      </div>\n    );\n  }\n);\n\nRadio.displayName = 'Radio';\n\n/**\n * RadioGroup store interface\n */\ninterface RadioGroupStore {\n  value: string;\n  setValue: (value: string) => void;\n  onValueChange?: (value: string) => void;\n  disabled: boolean;\n  name: string;\n}\n\ntype RadioGroupStoreApi = StoreApi<RadioGroupStore>;\n\n/**\n * Create a new RadioGroup store\n */\nconst createRadioGroupStore = (\n  name: string,\n  defaultValue: string,\n  disabled: boolean,\n  onValueChange?: (value: string) => void\n): RadioGroupStoreApi =>\n  create<RadioGroupStore>((set, get) => ({\n    value: defaultValue,\n    setValue: (value) => {\n      if (!get().disabled) {\n        set({ value });\n        get().onValueChange?.(value);\n      }\n    },\n    onValueChange,\n    disabled,\n    name,\n  }));\n\n/**\n * Hook to access RadioGroup store\n */\nexport const useRadioGroupStore = (externalStore?: RadioGroupStoreApi) => {\n  if (!externalStore) {\n    throw new Error('RadioGroupItem must be used within a RadioGroup');\n  }\n  return externalStore;\n};\n\n/**\n * Inject store into RadioGroupItem children\n */\nconst injectStore = (\n  children: ReactNode,\n  store: RadioGroupStoreApi\n): ReactNode =>\n  Children.map(children, (child) => {\n    if (!isValidElement(child)) return child;\n    /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n    const typedChild = child as ReactElement<any>;\n    const shouldInject = typedChild.type === RadioGroupItem;\n    return cloneElement(typedChild, {\n      ...(shouldInject ? { store } : {}),\n      ...(typedChild.props.children\n        ? { children: injectStore(typedChild.props.children, store) }\n        : {}),\n    });\n  });\n\n/**\n * RadioGroup component props interface\n */\nexport type RadioGroupProps = {\n  /** Current selected value */\n  value?: string;\n  /** Default selected value for uncontrolled usage */\n  defaultValue?: string;\n  /** Callback when selection changes */\n  onValueChange?: (value: string) => void;\n  /** Group name for all radios */\n  name?: string;\n  /** Disabled state for the entire group */\n  disabled?: boolean;\n  /** Additional CSS classes */\n  className?: string;\n  /** Children components */\n  children: ReactNode;\n} & Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>;\n\n/**\n * RadioGroup component for flexible radio group composition\n *\n * Uses Zustand for state management with automatic store injection.\n * Allows complete control over layout and styling by composing with RadioGroupItem.\n *\n * @example\n * ```tsx\n * <RadioGroup defaultValue=\"option1\" onValueChange={setValue}>\n *   <div className=\"flex items-center gap-3\">\n *     <RadioGroupItem value=\"option1\" id=\"r1\" />\n *     <label htmlFor=\"r1\">Option 1</label>\n *   </div>\n *   <div className=\"flex items-center gap-3\">\n *     <RadioGroupItem value=\"option2\" id=\"r2\" />\n *     <label htmlFor=\"r2\">Option 2</label>\n *   </div>\n * </RadioGroup>\n * ```\n */\nconst RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n  (\n    {\n      value: propValue,\n      defaultValue = '',\n      onValueChange,\n      name: propName,\n      disabled = false,\n      className = '',\n      children,\n      ...props\n    },\n    ref\n  ) => {\n    // Generate unique name if not provided\n    const generatedId = useId();\n    const name = propName || `radio-group-${generatedId}`;\n\n    // Create store reference\n    const storeRef = useRef<RadioGroupStoreApi>(null);\n    storeRef.current ??= createRadioGroupStore(\n      name,\n      defaultValue,\n      disabled,\n      onValueChange\n    );\n    const store = storeRef.current;\n\n    // Get store actions\n    const { setValue } = useStore(store, (s) => s);\n\n    // Call onValueChange with initial value\n    useEffect(() => {\n      const currentValue = store.getState().value;\n      if (currentValue && onValueChange) {\n        onValueChange(currentValue);\n      }\n    }, []); // Empty dependency array for mount only\n\n    // Handle controlled value changes\n    useEffect(() => {\n      if (propValue !== undefined) {\n        setValue(propValue);\n      }\n    }, [propValue, setValue]);\n\n    // Update disabled state\n    useEffect(() => {\n      store.setState({ disabled });\n    }, [disabled, store]);\n\n    return (\n      <div\n        ref={ref}\n        className={className}\n        role=\"radiogroup\"\n        aria-label={name}\n        {...props}\n      >\n        {injectStore(children, store)}\n      </div>\n    );\n  }\n);\n\nRadioGroup.displayName = 'RadioGroup';\n\n/**\n * RadioGroupItem component props interface\n */\nexport type RadioGroupItemProps = {\n  /** Value for this radio item */\n  value: string;\n  /** Optional label rendered next to the radio (parity with CheckBox/Radio APIs) */\n  label?: ReactNode;\n  /** CSS classes applied to the label */\n  labelClassName?: string;\n  /** Store reference (automatically injected by RadioGroup) */\n  store?: RadioGroupStoreApi;\n  /** Disabled state for this specific item */\n  disabled?: boolean;\n  /** Size variant */\n  size?: RadioSize;\n  /** Visual state */\n  state?: RadioState;\n  /** Additional CSS classes */\n  className?: string;\n} & Omit<\n  InputHTMLAttributes<HTMLInputElement>,\n  'type' | 'name' | 'value' | 'checked' | 'onChange' | 'size'\n>;\n\n/**\n * RadioGroupItem component for use within RadioGroup\n *\n * A radio button that works within RadioGroup context.\n * Accepts a `label` prop for the common case (parity with CheckBox/Radio).\n * When `label` is omitted, renders just the input for custom composition.\n *\n * @example\n * ```tsx\n * // With label (recommended)\n * <RadioGroup defaultValue=\"option1\">\n *   <RadioGroupItem value=\"option1\" label=\"Option 1\" />\n *   <RadioGroupItem value=\"option2\" label=\"Option 2\" />\n * </RadioGroup>\n *\n * // Without label - manual composition\n * <RadioGroup defaultValue=\"option1\">\n *   <div className=\"flex items-center gap-3\">\n *     <RadioGroupItem value=\"option1\" id=\"r1\" />\n *     <label htmlFor=\"r1\">Custom layout</label>\n *   </div>\n * </RadioGroup>\n * ```\n */\nconst RadioGroupItem = forwardRef<HTMLInputElement, RadioGroupItemProps>(\n  (\n    {\n      value,\n      label,\n      labelClassName,\n      store: externalStore,\n      disabled: itemDisabled,\n      size = 'medium',\n      state = 'default',\n      className = '',\n      id,\n      ...props\n    },\n    ref\n  ) => {\n    // Get store and state\n    const store = useRadioGroupStore(externalStore);\n    const {\n      value: groupValue,\n      setValue,\n      disabled: groupDisabled,\n      name,\n    } = useStore(store);\n\n    // Generate unique ID if not provided\n    const generatedId = useId();\n    const inputId = id ?? `radio-item-${generatedId}`;\n\n    // Determine states\n    const isChecked = groupValue === value;\n    const isDisabled = groupDisabled || itemDisabled;\n    const currentState = isDisabled ? 'disabled' : state;\n\n    // Use standard Radio component for consistency and simplicity\n    return (\n      <Radio\n        ref={ref}\n        id={inputId}\n        name={name}\n        value={value}\n        checked={isChecked}\n        disabled={isDisabled}\n        size={size}\n        state={currentState}\n        className={className}\n        label={label}\n        labelClassName={labelClassName}\n        onChange={(e) => {\n          if (e.target.checked && !isDisabled) {\n            setValue(value);\n          }\n        }}\n        {...props}\n      />\n    );\n  }\n);\n\nRadioGroupItem.displayName = 'RadioGroupItem';\n\nexport default Radio;\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;;;AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,QAAkB,gBAAgB;AAkRnC,SAUE,KAVF;AAjQR,IAAM,eAAe;AAAA,EACnB,OAAO;AAAA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