import { defineComponent, computed, provide, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
import '../../../tokens/index.mjs';
import '../../../hooks/index.mjs';
import { formProps } from './form.mjs';
import { useFormLabelWidth } from './utils.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useSize } from '../../../hooks/use-common-props/index.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
import { formContextKey } from '../../../tokens/form.mjs';

const __default__ = {
  name: "PsForm"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: formProps,
  setup(__props) {
    const props = __props;
    const COMPONENT_NAME = "PsForm";
    const formSize = useSize();
    const ns = useNamespace("form");
    const formClasses = computed(() => {
      const { labelPosition, inline } = props;
      return [
        ns.b(),
        ns.m(formSize.value || "default"),
        {
          [ns.m(`label-${labelPosition}`)]: labelPosition,
          [ns.m("inline")]: inline
        }
      ];
    });
    provide(formContextKey, reactive({
      ...toRefs(props),
      ...useFormLabelWidth()
    }));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("form", {
        class: normalizeClass(unref(formClasses))
      }, [
        renderSlot(_ctx.$slots, "default")
      ], 2);
    };
  }
});
var Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/form/src/form.vue"]]);

export { Form as default };
//# sourceMappingURL=form2.mjs.map
