@scalar/api-client
Version:
the open source API testing client
89 lines (88 loc) • 3.09 kB
JavaScript
import { defineComponent as M, createElementBlock as v, openBlock as s, createVNode as n, unref as t, normalizeClass as r, withCtx as d, createElementVNode as c, createTextVNode as i, createBlock as u, createCommentVNode as p } from "vue";
import { cva as g, ScalarButton as m, cx as f, ScalarIcon as k } from "@scalar/components";
const x = { class: "flex flex-col gap-2" }, j = /* @__PURE__ */ M({
__name: "Appearance",
props: {
colorMode: {}
},
emits: ["update:colorMode"],
setup(C, { emit: y }) {
const l = y, a = g({
base: "w-full shadow-none text-c-1 justify-start pl-2 gap-2 border",
variants: {
active: {
true: "bg-primary text-c-1 hover:bg-inherit",
false: "bg-b-1 hover:bg-b-2"
}
}
});
return (o, e) => (s(), v("div", x, [
n(t(m), {
class: r(t(f)(t(a)({ active: o.colorMode === "system" }))),
onClick: e[0] || (e[0] = (b) => l("update:colorMode", "system"))
}, {
default: d(() => [
c("div", {
class: r(["flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1", {
"bg-c-accent text-b-1 border-transparent": o.colorMode === "system"
}])
}, [
o.colorMode === "system" ? (s(), u(t(k), {
key: 0,
icon: "Checkmark",
size: "xs",
thickness: "3.5"
})) : p("", !0)
], 2),
e[3] || (e[3] = i(" System Preference (default) ", -1))
]),
_: 1
}, 8, ["class"]),
n(t(m), {
class: r(t(f)(t(a)({ active: o.colorMode === "light" }))),
onClick: e[1] || (e[1] = (b) => l("update:colorMode", "light"))
}, {
default: d(() => [
c("div", {
class: r(["flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1", {
"bg-c-accent text-b-1 border-transparent": o.colorMode === "light"
}])
}, [
o.colorMode === "light" ? (s(), u(t(k), {
key: 0,
icon: "Checkmark",
size: "xs",
thickness: "3.5"
})) : p("", !0)
], 2),
e[4] || (e[4] = i(" Light Mode Always ", -1))
]),
_: 1
}, 8, ["class"]),
n(t(m), {
class: r(t(f)(t(a)({ active: o.colorMode === "dark" }))),
onClick: e[2] || (e[2] = (b) => l("update:colorMode", "dark"))
}, {
default: d(() => [
c("div", {
class: r(["flex h-5 w-5 items-center justify-center rounded-full border-[1.5px] p-1", {
"bg-c-accent text-b-1 border-transparent": o.colorMode === "dark"
}])
}, [
o.colorMode === "dark" ? (s(), u(t(k), {
key: 0,
icon: "Checkmark",
size: "xs",
thickness: "3.5"
})) : p("", !0)
], 2),
e[5] || (e[5] = i(" Dark Mode Always ", -1))
]),
_: 1
}, 8, ["class"])
]));
}
});
export {
j as default
};