@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
47 lines (46 loc) • 1.84 kB
JavaScript
import { defineComponent as c, createBlock as p, openBlock as d, unref as l, withCtx as a, createVNode as n, createElementVNode as s, renderSlot as o, normalizeProps as m, guardReactiveProps as f, createTextVNode as i, normalizeClass as u } from "vue";
import { ScalarPopover as b, ScalarFloatingBackdrop as g } from "@scalar/components";
import { ScalarIconInfo as x, ScalarIconCaretDown as h } from "@scalar/icons";
const v = { 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" }, _ = { class: "custom-scroll bg-b-1 flex flex-col gap-7 rounded-lg p-7 pb-6" }, k = { class: "text-c-2 flex items-center justify-center gap-1 p-2 text-sm" }, P = /* @__PURE__ */ c({
__name: "ApiReferenceToolbarPopover",
setup(w) {
return (e, t) => (d(), p(l(b), {
class: "max-h-[inherit] max-w-[inherit] p-0 text-base",
placement: "bottom-end",
teleport: ""
}, {
default: a(({ open: r }) => [
o(e.$slots, "button", { open: r }, () => [
s("button", v, [
o(e.$slots, "label"),
n(l(h), {
class: u(["transition-transform", { "rotate-180": r }])
}, null, 8, ["class"])
])
])
]),
popover: a((r) => [
s("div", _, [
o(e.$slots, "default", m(f(r)))
]),
s("div", k, [
n(l(x), { class: "size-3.5 shrink-0" }),
s("div", null, [
o(e.$slots, "info", {}, () => [
t[0] || (t[0] = i(' "')),
o(e.$slots, "label"),
t[1] || (t[1] = i('" will only appear when running on localhost. '))
])
])
])
]),
backdrop: a(() => [
n(l(g), { class: "bg-b-2 rounded-lg" })
]),
_: 3
}));
}
});
export {
P as default
};