@scalar/api-client
Version:
the open source API testing client
53 lines (52 loc) • 1.81 kB
JavaScript
import { defineComponent as n, useModel as a, createElementBlock as l, openBlock as s, createElementVNode as e, toDisplayString as i, normalizeClass as d } from "vue";
const u = ["aria-pressed"], p = { class: "sr-only" }, c = {
class: "size-4",
fill: "none",
viewBox: "0 0 24 24",
xmlns: "http://www.w3.org/2000/svg"
}, m = { "clip-path": "url(#mask)" }, f = /* @__PURE__ */ n({
__name: "SidebarToggle",
props: {
modelValue: { type: Boolean, required: !0 },
modelModifiers: {}
},
emits: ["update:modelValue"],
setup(r) {
const o = a(r, "modelValue");
return (v, t) => (s(), l("button", {
"aria-pressed": o.value,
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] = (g) => o.value = !o.value)
}, [
e("span", p, i(o.value ? "Hide" : "Show") + " sidebar", 1),
(s(), l("svg", c, [
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", m, [
e("path", {
class: d(["transition-transform duration-300", o.value ? "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 {
f as default
};