import { n as __exportAll } from "./chunk-B-1-B7_t.js";
import { t as Checkbox_default } from "./checkbox-CyVKkarV.js";
import { n as Label_default } from "./label-C5K3zowH.js";
import { t as FieldFrame_default } from "./field-frame-DhCOWcMP.js";
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, toDisplayString, unref, useModel, withCtx } from "vue";
//#region src/components/compositions/elements/boolean/CheckboxBoolean.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "flex items-start gap-2" };
var _hoisted_2 = {
	key: 1,
	class: "sr-only",
	"data-testid": "field-frame-label-sr"
};
var CheckboxBoolean_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "CheckboxBoolean",
	props: /* @__PURE__ */ mergeModels({
		modelValue: { type: Boolean },
		id: {},
		name: {},
		label: {},
		hideLabel: { type: Boolean },
		required: { type: Boolean },
		readonly: { type: Boolean },
		disabled: { type: Boolean },
		helpText: {},
		errors: { default: () => [] }
	}, {
		"modelValue": {
			type: Boolean,
			default: false
		},
		"modelModifiers": {}
	}),
	emits: ["update:modelValue"],
	setup(__props) {
		/**
		* Props-driven checkbox composition. Wraps the shadcn-vue Checkbox
		* primitive with `FieldFrame` chrome (label + helpText + errors).
		*
		*   <CheckboxBoolean v-model="agreed" label="I agree" required />
		*/
		const model = useModel(__props, "modelValue");
		function onUpdate(checked) {
			model.value = checked === true;
		}
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(FieldFrame_default), {
				"hide-label": true,
				for: __props.id,
				"help-text": __props.helpText,
				errors: __props.errors
			}, {
				default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(unref(Checkbox_default), {
					id: __props.id,
					name: __props.name,
					disabled: __props.disabled || __props.readonly,
					required: __props.required,
					"model-value": model.value,
					"data-element-name": __props.name ?? void 0,
					"onUpdate:modelValue": onUpdate
				}, null, 8, [
					"id",
					"name",
					"disabled",
					"required",
					"model-value",
					"data-element-name"
				]), !__props.hideLabel && __props.label ? (openBlock(), createBlock(unref(Label_default), {
					key: 0,
					for: __props.id,
					required: __props.required,
					class: "cursor-pointer leading-tight",
					"data-testid": "field-frame-label"
				}, {
					default: withCtx(() => [createTextVNode(toDisplayString(__props.label), 1)]),
					_: 1
				}, 8, ["for", "required"])) : __props.label ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.label), 1)) : createCommentVNode("", true)])]),
				_: 1
			}, 8, [
				"for",
				"help-text",
				"errors"
			]);
		};
	}
});
//#endregion
//#region src/components/compositions/elements/boolean/CheckboxBoolean.vue
var CheckboxBoolean_exports = /* @__PURE__ */ __exportAll({ default: () => CheckboxBoolean_default });
var CheckboxBoolean_default = CheckboxBoolean_vue_vue_type_script_setup_true_lang_default;
//#endregion
export { CheckboxBoolean_exports as n, CheckboxBoolean_default as t };

//# sourceMappingURL=CheckboxBoolean-BmMcolTy.js.map