UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

55 lines (54 loc) 2.1 kB
import { defineComponent, createElementBlock, openBlock, createVNode, unref, withCtx, createBlock, createCommentVNode, createElementVNode, normalizeClass, renderSlot } from "vue"; import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue"; import { ScalarIconCaretRight } from "@scalar/icons"; const _hoisted_1 = { class: "section-accordion-wrapper" }; const _hoisted_2 = { class: "section-accordion-title" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "SectionContainerAccordion", props: { modelValue: { type: Boolean } }, emits: ["update:modelValue"], setup(__props, { emit: __emit }) { const emit = __emit; return (_ctx, _cache) => { return openBlock(), createElementBlock("section", _hoisted_1, [ createVNode(unref(Disclosure), { as: "div", class: "section-accordion" }, { default: withCtx(() => [ createVNode(unref(DisclosureButton), { class: "section-accordion-button", onClick: _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", !__props.modelValue)) }, { default: withCtx(() => [ createVNode(unref(ScalarIconCaretRight), { class: normalizeClass(["section-accordion-chevron size-5 transition-transform", { "rotate-90": __props.modelValue }]) }, null, 8, ["class"]), createElementVNode("div", _hoisted_2, [ renderSlot(_ctx.$slots, "title", {}, void 0, true) ]) ]), _: 3 }), __props.modelValue ? (openBlock(), createBlock(unref(DisclosurePanel), { key: 0, class: "section-accordion-content", static: "" }, { default: withCtx(() => [ renderSlot(_ctx.$slots, "default", {}, void 0, true) ]), _: 3 })) : createCommentVNode("", true) ]), _: 3 }) ]); }; } }); export { _sfc_main as default };