UNPKG

@scalar/api-client

Version:

the open source API testing client

50 lines (49 loc) 1.79 kB
import { defineComponent as a, createElementBlock as n, openBlock as l, unref as o, createElementVNode as e, toDisplayString as d, normalizeClass as p } from "vue"; import { useSidebar as c } from "../../hooks/useSidebar.js"; const u = ["aria-pressed"], m = { class: "sr-only" }, g = { class: "size-4", fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h = { "clip-path": "url(#mask)" }, k = /* @__PURE__ */ a({ __name: "SidebarToggle", setup(b) { const { isSidebarOpen: s, toggleSidebarOpen: r } = c(); return (f, t) => (l(), n("button", { "aria-pressed": o(s), class: "scalar-sidebar-toggle text-c-3 hover:bg-b-2 active:text-c-1 rounded-lg p-2", type: "button", onClick: t[0] || (t[0] = //@ts-ignore (...i) => o(r) && o(r)(...i)) }, [ e("span", m, d(o(s) ? "Hide" : "Show") + " sidebar", 1), (l(), n("svg", g, [ t[1] || (t[1] = e("defs", null, [ e("clipPath", { id: "mask" }, [ e("path", { "clip-rule": "evenodd", d: "M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z" }) ]) ], -1)), e("g", h, [ e("path", { class: p(["transition-transform duration-300", o(s) ? "translate-x-0" : "-translate-x-1/2"]), d: "M1 3.2h8v17.5H1z", fill: "currentColor" }, null, 2) ]), t[2] || (t[2] = e("path", { d: "M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5", stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2" }, null, -1)) ])) ], 8, u)); } }); export { k as default };