"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_chunk = require("../chunk-BN4qSVkS.cjs");
const require_styles_tokens_spacing = require("../styles/tokens/spacing.cjs");
const require_components_typography_Label = require("./typography/Label.cjs");
let _emotion_styled = require("@emotion/styled");
_emotion_styled = require_chunk.__toESM(_emotion_styled);
let react = require("react");
react = require_chunk.__toESM(react);
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
//#region src/components/Radio.tsx
function Radio({ radioOptions, onChange, defaultOption }) {
	const [selectedOption, setSelectedOption] = (0, react.useState)(defaultOption);
	const handleRadioClick = (e) => {
		onChange(e.target.value);
		setSelectedOption(e.target.value);
	};
	return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(RadioContainer, { children: radioOptions.map((option) => /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(RadioRow, {
		htmlFor: option.label,
		children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(RadioInput, {
			id: option.label,
			type: "radio",
			value: option.label,
			checked: selectedOption === option.label,
			onChange: handleRadioClick
		}), /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_components_typography_Label.Label, { children: option.label })]
	}, option.label)) });
}
const RadioContainer = _emotion_styled.default.div`
  label: flex;
  flex-direction: column;
`;
const RadioRow = _emotion_styled.default.label`
  display: flex;
  align-items: center;
  gap: ${require_styles_tokens_spacing.Spacing.px.sm};
`;
const RadioInput = _emotion_styled.default.input``;
//#endregion
exports.Radio = Radio;
