UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

55 lines (54 loc) 2.36 kB
import { defineComponent, createBlock, openBlock, unref, withCtx, createVNode, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, normalizeClass } from "vue"; import { ScalarPopover, ScalarFloatingBackdrop } from "@scalar/components"; import { ScalarIconInfo, ScalarIconCaretDown } from "@scalar/icons"; const _hoisted_1 = { class: "text-c-2 hover:text-c-1 hover:bg-b-2 flex items-center gap-1 rounded px-2 py-2.25 text-base leading-none", type: "button" }; const _hoisted_2 = { class: "custom-scroll bg-b-1 flex flex-col gap-7 rounded-lg p-7 pb-6" }; const _hoisted_3 = { class: "text-c-2 flex items-center justify-center gap-1 p-2 text-sm" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "ApiReferenceToolbarPopover", setup(__props) { return (_ctx, _cache) => { return openBlock(), createBlock(unref(ScalarPopover), { class: "max-h-[inherit] max-w-[inherit] p-0 text-base", placement: "bottom-end", teleport: "" }, { default: withCtx(({ open }) => [ renderSlot(_ctx.$slots, "button", { open }, () => [ createElementVNode("button", _hoisted_1, [ renderSlot(_ctx.$slots, "label"), createVNode(unref(ScalarIconCaretDown), { class: normalizeClass(["transition-transform", { "rotate-180": open }]) }, null, 8, ["class"]) ]) ]) ]), popover: withCtx((props) => [ createElementVNode("div", _hoisted_2, [ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(props))) ]), createElementVNode("div", _hoisted_3, [ createVNode(unref(ScalarIconInfo), { class: "size-3.5 shrink-0" }), createElementVNode("div", null, [ renderSlot(_ctx.$slots, "info", {}, () => [ _cache[0] || (_cache[0] = createTextVNode(' "', -1)), renderSlot(_ctx.$slots, "label"), _cache[1] || (_cache[1] = createTextVNode('" will only appear when running on localhost. ', -1)) ]) ]) ]) ]), backdrop: withCtx(() => [ createVNode(unref(ScalarFloatingBackdrop), { class: "bg-b-2 rounded-lg" }) ]), _: 3 }); }; } }); export { _sfc_main as default };