@scalar/components 0.16.20 → 0.16.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ScalarButton/ScalarButton.vue.js +28 -28
- package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.js +7 -7
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.js +15 -15
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.js +10 -10
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.js +15 -15
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.js +6 -6
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue2.js +20 -20
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggle.vue.js +7 -7
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue2.js +13 -13
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +20 -20
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +25 -25
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.js +9 -9
- package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.js +9 -9
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +51 -51
- package/dist/components/ScalarContextMenu/ScalarContextMenu.vue.js +8 -8
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +36 -36
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +11 -11
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +14 -14
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +12 -12
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +47 -47
- package/dist/components/ScalarFileUpload/ScalarFileUploadInput.vue.js +23 -23
- package/dist/components/ScalarFileUpload/ScalarFileUploadInputCompact.vue.js +17 -17
- package/dist/components/ScalarFileUpload/ScalarFileUploadLoading.vue.js +9 -9
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +30 -30
- package/dist/components/ScalarForm/ScalarFormError.vue.js +8 -8
- package/dist/components/ScalarForm/ScalarFormField.vue.js +14 -14
- package/dist/components/ScalarForm/ScalarFormInput.vue.js +9 -9
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue.js +8 -8
- package/dist/components/ScalarHeader/ScalarHeaderButton.vue.js +12 -12
- package/dist/components/ScalarIcon/ScalarIcon.vue2.js +8 -8
- package/dist/components/ScalarIcon/ScalarIconLegacyAdapter.vue.js +10 -10
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.js +18 -18
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +28 -28
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js +9 -9
- package/dist/components/ScalarListbox/ScalarListboxInput.vue.js +11 -11
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.js +10 -10
- package/dist/components/ScalarLoading/ScalarLoading.vue2.js +13 -13
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +13 -13
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js +16 -16
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.js +16 -16
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +17 -17
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.js +11 -11
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +24 -24
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +17 -17
- package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.js +14 -14
- package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.js +8 -8
- package/dist/components/ScalarModal/ScalarModal.vue2.js +34 -34
- package/dist/components/ScalarPopover/ScalarPopover.vue.js +25 -25
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +26 -26
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +30 -30
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.js +8 -8
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +24 -24
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +51 -51
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js +18 -18
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +14 -14
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +7 -7
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +12 -12
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js +46 -46
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +30 -30
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.js +18 -18
- package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.js +8 -8
- package/dist/components/ScalarTeleport/ScalarTeleport.vue.js +12 -12
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +34 -34
- package/dist/components/ScalarToggle/ScalarToggle.vue.js +20 -20
- package/dist/components/ScalarToggle/ScalarToggleGroup.vue.js +14 -14
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.js +25 -25
- package/package.json +8 -8
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cva as
|
|
3
|
-
import { BUTTON_VARIANT_STYLES as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as f, createBlock as r, openBlock as t, resolveDynamicComponent as d, mergeProps as z, unref as a, withCtx as g, createElementBlock as s, createCommentVNode as c, renderSlot as n, normalizeClass as o, createVNode as x } from "vue";
|
|
2
|
+
import { cva as l, useBindCx as y } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import { BUTTON_VARIANT_STYLES as h } from "./constants.js";
|
|
4
|
+
import k from "../ScalarLoading/ScalarLoading.vue.js";
|
|
5
|
+
const A = {
|
|
6
6
|
key: 3,
|
|
7
7
|
class: "centered"
|
|
8
|
-
},
|
|
9
|
-
...
|
|
8
|
+
}, B = {}, T = /* @__PURE__ */ f({
|
|
9
|
+
...B,
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "ScalarButton",
|
|
12
12
|
props: {
|
|
@@ -17,8 +17,8 @@ const k = {
|
|
|
17
17
|
icon: { type: [Object, Function] },
|
|
18
18
|
loader: {}
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const m =
|
|
20
|
+
setup(e) {
|
|
21
|
+
const m = l({
|
|
22
22
|
base: "scalar-button flex cursor-pointer items-center justify-center rounded font-medium -outline-offset-1",
|
|
23
23
|
variants: {
|
|
24
24
|
disabled: { true: "bg-b-2 text-color-3 shadow-none" },
|
|
@@ -27,7 +27,7 @@ const k = {
|
|
|
27
27
|
sm: "px-3.5 py-2 text-sm leading-5",
|
|
28
28
|
md: "px-5 py-3 text-sm leading-5"
|
|
29
29
|
},
|
|
30
|
-
variant:
|
|
30
|
+
variant: h
|
|
31
31
|
},
|
|
32
32
|
compoundVariants: [
|
|
33
33
|
{
|
|
@@ -41,7 +41,7 @@ const k = {
|
|
|
41
41
|
class: "to-b-1.5 bg-linear-to-b hover:bg-linear-to-b dark:hover:bg-linear-to-t"
|
|
42
42
|
}
|
|
43
43
|
]
|
|
44
|
-
}),
|
|
44
|
+
}), u = l({
|
|
45
45
|
base: "shrink-0",
|
|
46
46
|
variants: {
|
|
47
47
|
size: {
|
|
@@ -50,7 +50,7 @@ const k = {
|
|
|
50
50
|
md: "size-3.5 -ml-0.5 mr-1.5"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), b = l({
|
|
54
54
|
variants: {
|
|
55
55
|
size: {
|
|
56
56
|
xs: "size-4",
|
|
@@ -58,37 +58,37 @@ const k = {
|
|
|
58
58
|
md: "size-6"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
}), { cx:
|
|
62
|
-
return (
|
|
61
|
+
}), { cx: v } = y();
|
|
62
|
+
return (i, V) => (t(), r(d(e.is), z(
|
|
63
63
|
{
|
|
64
64
|
"aria-disabled": e.disabled || void 0,
|
|
65
65
|
type: e.is === "button" ? "button" : void 0
|
|
66
66
|
},
|
|
67
|
-
a(
|
|
67
|
+
a(v)(a(m)({ disabled: e.disabled, size: e.size, variant: e.variant }), {
|
|
68
68
|
relative: e.loader?.isActive
|
|
69
69
|
})
|
|
70
70
|
), {
|
|
71
|
-
default:
|
|
72
|
-
|
|
71
|
+
default: g(() => [
|
|
72
|
+
i.$slots.icon || e.icon ? (t(), s("div", {
|
|
73
73
|
key: 0,
|
|
74
|
-
class: o([a(
|
|
74
|
+
class: o([a(u)({ size: e.size }), { invisible: e.loader?.isActive }])
|
|
75
75
|
}, [
|
|
76
|
-
|
|
77
|
-
(
|
|
76
|
+
n(i.$slots, "icon", {}, () => [
|
|
77
|
+
(t(), r(d(e.icon), { class: "size-full" }))
|
|
78
78
|
])
|
|
79
|
-
], 2)) :
|
|
80
|
-
e.loader ? (
|
|
79
|
+
], 2)) : c("", !0),
|
|
80
|
+
e.loader ? (t(), s("span", {
|
|
81
81
|
key: 1,
|
|
82
82
|
class: o({ invisible: e.loader?.isActive })
|
|
83
83
|
}, [
|
|
84
|
-
|
|
85
|
-
], 2)) :
|
|
86
|
-
e.loader?.isActive ? (
|
|
87
|
-
|
|
88
|
-
class: o(a(
|
|
84
|
+
n(i.$slots, "default")
|
|
85
|
+
], 2)) : n(i.$slots, "default", { key: 2 }),
|
|
86
|
+
e.loader?.isActive ? (t(), s("div", A, [
|
|
87
|
+
x(a(k), {
|
|
88
|
+
class: o(a(b)({ size: e.size })),
|
|
89
89
|
loader: e.loader
|
|
90
90
|
}, null, 8, ["class", "loader"])
|
|
91
|
-
])) :
|
|
91
|
+
])) : c("", !0)
|
|
92
92
|
]),
|
|
93
93
|
_: 3
|
|
94
94
|
}, 16, ["aria-disabled", "type"]));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconCheck as
|
|
3
|
-
const d = {},
|
|
1
|
+
import { defineComponent as c, createElementBlock as o, openBlock as t, normalizeClass as r, createBlock as a, createCommentVNode as n, unref as l } from "vue";
|
|
2
|
+
import { ScalarIconCheck as s } from "@scalar/icons";
|
|
3
|
+
const d = {}, p = /* @__PURE__ */ c({
|
|
4
4
|
...d,
|
|
5
5
|
__name: "ScalarCheckbox",
|
|
6
6
|
props: {
|
|
7
7
|
selected: { type: Boolean },
|
|
8
8
|
type: { default: "checkbox" }
|
|
9
9
|
},
|
|
10
|
-
setup(
|
|
11
|
-
return (
|
|
10
|
+
setup(e) {
|
|
11
|
+
return (m, u) => (t(), o("div", {
|
|
12
12
|
class: r(["flex size-4 items-center justify-center p-0.75", [
|
|
13
13
|
e.selected ? "bg-c-accent text-b-1" : "text-transparent shadow-border",
|
|
14
14
|
e.type === "checkbox" ? "rounded" : "rounded-full"
|
|
15
15
|
]])
|
|
16
16
|
}, [
|
|
17
|
-
e.selected ? (t(), a(s
|
|
17
|
+
e.selected ? (t(), a(l(s), {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "size-3",
|
|
20
20
|
weight: "bold"
|
|
@@ -23,5 +23,5 @@ const d = {}, i = /* @__PURE__ */ o({
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
export {
|
|
26
|
-
|
|
26
|
+
p as default
|
|
27
27
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
...
|
|
1
|
+
import { defineComponent as s, mergeModels as c, useModel as f, useId as _, createBlock as o, openBlock as u, unref as m, withCtx as r, createElementBlock as i, Fragment as v, renderList as p, createTextVNode as V, toDisplayString as k } from "vue";
|
|
2
|
+
import x from "./ScalarCheckboxInput.vue.js";
|
|
3
|
+
import g from "../ScalarForm/ScalarFormInputGroup.vue.js";
|
|
4
|
+
const h = {}, S = /* @__PURE__ */ s({
|
|
5
|
+
...h,
|
|
6
6
|
__name: "ScalarCheckboxGroup",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ c({
|
|
8
8
|
options: { default: () => [] }
|
|
9
9
|
}, {
|
|
10
10
|
modelValue: { default: [] },
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const l =
|
|
16
|
-
return (
|
|
17
|
-
default:
|
|
18
|
-
(u(!0),
|
|
14
|
+
setup(t) {
|
|
15
|
+
const l = f(t, "modelValue"), d = _();
|
|
16
|
+
return (B, C) => (u(), o(m(g), null, {
|
|
17
|
+
default: r(() => [
|
|
18
|
+
(u(!0), i(v, null, p(t.options, (e) => (u(), o(x, {
|
|
19
19
|
key: e.value,
|
|
20
20
|
modelValue: l.value?.some(({ value: a }) => a === e.value),
|
|
21
|
-
name:
|
|
21
|
+
name: m(d),
|
|
22
22
|
value: e.value,
|
|
23
|
-
"onUpdate:modelValue": (a) => l.value = a ? [...l.value, e] : l.value.filter(({ value:
|
|
23
|
+
"onUpdate:modelValue": (a) => l.value = a ? [...l.value, e] : l.value.filter(({ value: n }) => n !== e.value)
|
|
24
24
|
}, {
|
|
25
|
-
default:
|
|
26
|
-
k(
|
|
25
|
+
default: r(() => [
|
|
26
|
+
V(k(e.label), 1)
|
|
27
27
|
]),
|
|
28
28
|
_: 2
|
|
29
29
|
}, 1032, ["modelValue", "name", "value", "onUpdate:modelValue"]))), 128))
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as c, mergeModels as u, useModel as m, createBlock as p, openBlock as f, unref as o, mergeProps as s, withCtx as _, createVNode as y, createElementVNode as r, withDirectives as h, renderSlot as x, vModelDynamic as v } from "vue";
|
|
2
2
|
import { useBindCx as V } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import b from "./ScalarCheckbox.vue.js";
|
|
4
4
|
import g from "../ScalarForm/ScalarFormInput.vue.js";
|
|
5
|
-
const k = { class: "flex-1 text-left min-w-0 truncate" }, C = ["type"], B = {}, D = /* @__PURE__ */
|
|
5
|
+
const k = { class: "flex-1 text-left min-w-0 truncate" }, C = ["type"], B = {}, D = /* @__PURE__ */ c({
|
|
6
6
|
...B,
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarCheckboxInput",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ u({
|
|
10
10
|
type: { default: "checkbox" }
|
|
11
11
|
}, {
|
|
12
12
|
modelValue: { type: Boolean },
|
|
13
13
|
modelModifiers: {}
|
|
14
14
|
}),
|
|
15
15
|
emits: ["update:modelValue"],
|
|
16
|
-
setup(
|
|
17
|
-
const e =
|
|
18
|
-
return (
|
|
16
|
+
setup(t) {
|
|
17
|
+
const e = m(t, "modelValue"), { stylingAttrsCx: n, otherAttrs: a } = V();
|
|
18
|
+
return (i, l) => (f(), p(o(g), s(
|
|
19
19
|
{ is: "label" },
|
|
20
|
-
o(
|
|
20
|
+
o(n)("cursor-pointer gap-2 hover:bg-b-2", { "text-c-1": e.value })
|
|
21
21
|
), {
|
|
22
22
|
default: _(() => [
|
|
23
23
|
y(b, {
|
|
@@ -26,14 +26,14 @@ const k = { class: "flex-1 text-left min-w-0 truncate" }, C = ["type"], B = {},
|
|
|
26
26
|
type: t.type
|
|
27
27
|
}, null, 8, ["selected", "type"]),
|
|
28
28
|
r("div", k, [
|
|
29
|
-
|
|
29
|
+
x(i.$slots, "default")
|
|
30
30
|
]),
|
|
31
31
|
h(r("input", s({
|
|
32
32
|
"onUpdate:modelValue": l[0] || (l[0] = (d) => e.value = d),
|
|
33
33
|
class: "sr-only",
|
|
34
34
|
type: t.type
|
|
35
|
-
}, o(
|
|
36
|
-
[
|
|
35
|
+
}, o(a)), null, 16, C), [
|
|
36
|
+
[v, e.value]
|
|
37
37
|
])
|
|
38
38
|
]),
|
|
39
39
|
_: 3
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
...
|
|
1
|
+
import { defineComponent as n, mergeModels as c, useModel as s, useId as i, createBlock as t, openBlock as l, unref as u, withCtx as d, createElementBlock as f, Fragment as _, renderList as p, createTextVNode as v, toDisplayString as V } from "vue";
|
|
2
|
+
import k from "./ScalarCheckboxInput.vue.js";
|
|
3
|
+
import x from "../ScalarForm/ScalarFormInputGroup.vue.js";
|
|
4
|
+
const g = {}, b = /* @__PURE__ */ n({
|
|
5
|
+
...g,
|
|
6
6
|
__name: "ScalarCheckboxRadioGroup",
|
|
7
7
|
props: /* @__PURE__ */ c({
|
|
8
8
|
options: { default: () => [] }
|
|
@@ -11,20 +11,20 @@ const h = {}, b = /* @__PURE__ */ s({
|
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
return (
|
|
17
|
-
default:
|
|
18
|
-
(l(!0), f(
|
|
14
|
+
setup(a) {
|
|
15
|
+
const o = s(a, "modelValue"), m = i();
|
|
16
|
+
return (h, y) => (l(), t(u(x), null, {
|
|
17
|
+
default: d(() => [
|
|
18
|
+
(l(!0), f(_, null, p(a.options, (e) => (l(), t(k, {
|
|
19
19
|
key: e.value,
|
|
20
|
-
modelValue:
|
|
21
|
-
name:
|
|
20
|
+
modelValue: o.value?.value === e.value,
|
|
21
|
+
name: u(m),
|
|
22
22
|
type: "radio",
|
|
23
23
|
value: e.value,
|
|
24
|
-
"onUpdate:modelValue": (
|
|
24
|
+
"onUpdate:modelValue": (r) => o.value = r ? e : void 0
|
|
25
25
|
}, {
|
|
26
|
-
default:
|
|
27
|
-
V(
|
|
26
|
+
default: d(() => [
|
|
27
|
+
v(V(e.label), 1)
|
|
28
28
|
]),
|
|
29
29
|
_: 2
|
|
30
30
|
}, 1032, ["modelValue", "name", "value", "onUpdate:modelValue"]))), 128))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as s, useId as u, computed as n, createElementBlock as d, openBlock as
|
|
1
|
+
import { defineComponent as s, useId as u, computed as n, createElementBlock as d, openBlock as a, createBlock as m, createCommentVNode as p, createElementVNode as f, unref as o } from "vue";
|
|
2
2
|
import { syntaxHighlight as h, standardLanguages as C } from "@scalar/code-highlight";
|
|
3
3
|
import { prettyPrintJson as g } from "@scalar/oas-utils/helpers";
|
|
4
4
|
import y from "./ScalarCodeBlockCopy.vue.js";
|
|
@@ -18,14 +18,14 @@ const k = {
|
|
|
18
18
|
setup(e) {
|
|
19
19
|
const l = u(), t = n(
|
|
20
20
|
() => e.prettyPrintedContent || g(e.content ?? "")
|
|
21
|
-
),
|
|
21
|
+
), r = n(() => h(t.value, {
|
|
22
22
|
lang: e.lang.trim(),
|
|
23
23
|
languages: C,
|
|
24
24
|
lineNumbers: e.lineNumbers,
|
|
25
25
|
maskCredentials: e.hideCredentials
|
|
26
|
-
}).slice(5, -6)),
|
|
27
|
-
return (
|
|
28
|
-
|
|
26
|
+
}).slice(5, -6)), c = n(() => t.value !== null && t.value !== "null" && t.value !== "404 Not Found");
|
|
27
|
+
return (i, b) => (a(), d("div", k, [
|
|
28
|
+
e.copy && c.value ? (a(), m(o(y), {
|
|
29
29
|
key: 0,
|
|
30
30
|
content: t.value,
|
|
31
31
|
controls: o(l)
|
|
@@ -33,7 +33,7 @@ const k = {
|
|
|
33
33
|
f("pre", {
|
|
34
34
|
id: o(l),
|
|
35
35
|
class: "scalar-codeblock-pre",
|
|
36
|
-
innerHTML:
|
|
36
|
+
innerHTML: r.value
|
|
37
37
|
}, null, 8, v)
|
|
38
38
|
]));
|
|
39
39
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, ref as d, createElementBlock as n, openBlock as l, normalizeClass as c, unref as t, createVNode as s, createCommentVNode as m, withCtx as y } from "vue";
|
|
2
2
|
import { ScalarIconCopy as C, ScalarIconCheck as h } from "@scalar/icons";
|
|
3
3
|
import { cva as v, cx as i } from "@scalar/use-hooks/useBindCx";
|
|
4
4
|
import { useClipboard as b } from "@scalar/use-hooks/useClipboard";
|
|
5
5
|
import k from "../ScalarButton/ScalarButton.vue.js";
|
|
6
|
-
const
|
|
6
|
+
const x = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "sr-only",
|
|
9
9
|
role: "alert"
|
|
10
|
-
},
|
|
10
|
+
}, T = /* @__PURE__ */ p({
|
|
11
11
|
__name: "ScalarCodeBlockCopy",
|
|
12
12
|
props: {
|
|
13
13
|
content: {},
|
|
14
14
|
controls: {},
|
|
15
15
|
class: {}
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
17
|
+
setup(o) {
|
|
18
18
|
const { copyToClipboard: r } = b(), e = d(!1), u = async () => {
|
|
19
19
|
if (e.value)
|
|
20
20
|
return;
|
|
21
|
-
const
|
|
22
|
-
await r(
|
|
21
|
+
const a = typeof o.content == "string" ? o.content : JSON.stringify(o.content, null, 2);
|
|
22
|
+
await r(a), e.value = !0, setTimeout(() => {
|
|
23
23
|
e.value = !1;
|
|
24
24
|
}, 1200);
|
|
25
|
-
},
|
|
25
|
+
}, f = v({
|
|
26
26
|
base: "absolute top-0 right-0 h-8 w-8 p-0 flex items-center justify-center brightness-lifted bg-inherit rounded focus-visible:opacity-100 -outline-offset-1",
|
|
27
27
|
variants: {
|
|
28
28
|
showCopied: {
|
|
@@ -31,36 +31,36 @@ const g = {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
return (
|
|
35
|
-
class:
|
|
36
|
-
|
|
34
|
+
return (a, g) => (l(), n("div", {
|
|
35
|
+
class: c(
|
|
36
|
+
t(i)(
|
|
37
37
|
"scalar-code-copy opacity-0 group-hover/code-block:opacity-100 sticky flex inset-0 justify-end items-start bg-inherit",
|
|
38
|
-
|
|
38
|
+
o.class
|
|
39
39
|
)
|
|
40
40
|
)
|
|
41
41
|
}, [
|
|
42
|
-
|
|
43
|
-
"aria-controls":
|
|
42
|
+
s(t(k), {
|
|
43
|
+
"aria-controls": o.controls,
|
|
44
44
|
"aria-label": "Copy",
|
|
45
|
-
class:
|
|
45
|
+
class: c(t(i)(t(f)({ showCopied: e.value }))),
|
|
46
46
|
type: "button",
|
|
47
47
|
variant: "ghost",
|
|
48
48
|
onClick: u
|
|
49
49
|
}, {
|
|
50
50
|
default: y(() => [
|
|
51
|
-
|
|
52
|
-
class:
|
|
51
|
+
s(t(C), {
|
|
52
|
+
class: c(["copy-icon size-4", { copied: e.value }])
|
|
53
53
|
}, null, 8, ["class"]),
|
|
54
|
-
|
|
55
|
-
class:
|
|
54
|
+
s(t(h), {
|
|
55
|
+
class: c(["check-icon size-4", { visible: e.value }])
|
|
56
56
|
}, null, 8, ["class"])
|
|
57
57
|
]),
|
|
58
58
|
_: 1
|
|
59
59
|
}, 8, ["aria-controls", "class"]),
|
|
60
|
-
e.value ? (l(), n("div",
|
|
60
|
+
e.value ? (l(), n("div", x, " Copied ")) : m("", !0)
|
|
61
61
|
], 2));
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
T as default
|
|
66
66
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as u, computed as c, createBlock as r, openBlock as t, unref as o, isRef as s } from "vue";
|
|
2
|
-
import { useColorMode as
|
|
3
|
-
import
|
|
2
|
+
import { useColorMode as f } from "@scalar/use-hooks/useColorMode";
|
|
3
|
+
import p from "./ScalarColorModeToggleButton.vue.js";
|
|
4
4
|
import _ from "./ScalarColorModeToggleIcon.vue.js";
|
|
5
5
|
const k = {}, S = /* @__PURE__ */ u({
|
|
6
6
|
...k,
|
|
@@ -8,11 +8,11 @@ const k = {}, S = /* @__PURE__ */ u({
|
|
|
8
8
|
props: {
|
|
9
9
|
variant: { default: "switch" }
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const { isDarkMode: e, toggleColorMode:
|
|
11
|
+
setup(n) {
|
|
12
|
+
const { isDarkMode: e, toggleColorMode: i, darkLightMode: d } = f(), l = c(
|
|
13
13
|
() => e.value ? "Set light mode" : "Set dark mode"
|
|
14
14
|
);
|
|
15
|
-
return (
|
|
15
|
+
return (g, a) => n.variant === "switch" ? (t(), r(p, {
|
|
16
16
|
key: 0,
|
|
17
17
|
modelValue: o(e),
|
|
18
18
|
"onUpdate:modelValue": a[0] || (a[0] = (m) => s(e) ? e.value = m : null),
|
|
@@ -20,8 +20,8 @@ const k = {}, S = /* @__PURE__ */ u({
|
|
|
20
20
|
}, null, 8, ["modelValue", "aria-label"])) : (t(), r(_, {
|
|
21
21
|
key: 1,
|
|
22
22
|
"aria-label": l.value,
|
|
23
|
-
mode: o(
|
|
24
|
-
onClick: o(
|
|
23
|
+
mode: o(d),
|
|
24
|
+
onClick: o(i)
|
|
25
25
|
}, null, 8, ["aria-label", "mode", "onClick"]));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as a, computed as
|
|
1
|
+
import { defineComponent as a, computed as s, createBlock as c, openBlock as i, resolveDynamicComponent as r, mergeProps as u, unref as m, withCtx as g, createElementVNode as e } from "vue";
|
|
2
2
|
import { useBindCx as d } from "@scalar/use-hooks/useBindCx";
|
|
3
|
-
const
|
|
4
|
-
...
|
|
3
|
+
const p = {}, b = /* @__PURE__ */ a({
|
|
4
|
+
...p,
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ScalarColorModeToggleIcon",
|
|
7
7
|
props: {
|
|
8
8
|
is: { default: "button" },
|
|
9
9
|
mode: { default: "light" }
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const { cx:
|
|
13
|
-
() =>
|
|
11
|
+
setup(t) {
|
|
12
|
+
const { cx: l } = d(), n = s(
|
|
13
|
+
() => t.mode === "dark" ? "Set light mode" : "Set dark mode"
|
|
14
14
|
);
|
|
15
|
-
return (
|
|
16
|
-
"aria-label":
|
|
17
|
-
class: `toggle-icon-${
|
|
18
|
-
type:
|
|
19
|
-
},
|
|
20
|
-
default: g(() => [...
|
|
15
|
+
return (f, o) => (i(), c(r(t.is), u({
|
|
16
|
+
"aria-label": n.value,
|
|
17
|
+
class: `toggle-icon-${t.mode}`,
|
|
18
|
+
type: t.is === "button" ? "button" : void 0
|
|
19
|
+
}, m(l)("size-3 flex items-center justify-center text-c-1")), {
|
|
20
|
+
default: g(() => [...o[0] || (o[0] = [
|
|
21
21
|
e("span", { class: "toggle-icon-sun-ray" }, null, -1),
|
|
22
22
|
e("span", { class: "toggle-icon-sun-ray" }, null, -1),
|
|
23
23
|
e("span", { class: "toggle-icon-sun-ray" }, null, -1),
|
|
@@ -31,5 +31,5 @@ const f = {}, _ = /* @__PURE__ */ a({
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
b as default
|
|
35
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as f, mergeModels as s, useModel as c, createBlock as g, openBlock as $, withCtx as
|
|
1
|
+
import { defineComponent as f, mergeModels as s, useModel as c, createBlock as g, openBlock as $, withCtx as l, createVNode as v, createSlots as V, renderSlot as a, normalizeProps as n, guardReactiveProps as m } from "vue";
|
|
2
2
|
import h from "./ScalarComboboxOptions.vue.js";
|
|
3
3
|
import y from "./ScalarComboboxPopover.vue.js";
|
|
4
4
|
const B = /* @__PURE__ */ f({
|
|
@@ -17,9 +17,9 @@ const B = /* @__PURE__ */ f({
|
|
|
17
17
|
modelModifiers: {}
|
|
18
18
|
}),
|
|
19
19
|
emits: /* @__PURE__ */ s(["add"], ["update:modelValue"]),
|
|
20
|
-
setup(
|
|
21
|
-
const u =
|
|
22
|
-
return (
|
|
20
|
+
setup(e, { emit: p }) {
|
|
21
|
+
const u = p, d = c(e, "modelValue");
|
|
22
|
+
return (o, b) => ($(), g(y, {
|
|
23
23
|
middleware: e.middleware,
|
|
24
24
|
offset: e.offset,
|
|
25
25
|
placement: e.placement ?? "bottom-start",
|
|
@@ -27,36 +27,36 @@ const B = /* @__PURE__ */ f({
|
|
|
27
27
|
target: e.target,
|
|
28
28
|
teleport: e.teleport
|
|
29
29
|
}, {
|
|
30
|
-
default:
|
|
31
|
-
|
|
30
|
+
default: l(({ open: r }) => [
|
|
31
|
+
a(o.$slots, "default", { open: r })
|
|
32
32
|
]),
|
|
33
|
-
popover:
|
|
33
|
+
popover: l(({ open: r, close: i }) => [
|
|
34
34
|
v(h, {
|
|
35
|
-
modelValue:
|
|
36
|
-
open:
|
|
35
|
+
modelValue: d.value ? [d.value] : [],
|
|
36
|
+
open: r,
|
|
37
37
|
options: e.options,
|
|
38
38
|
placeholder: e.placeholder,
|
|
39
|
-
onAdd: () => (
|
|
40
|
-
"onUpdate:modelValue": (
|
|
39
|
+
onAdd: () => (i(), u("add")),
|
|
40
|
+
"onUpdate:modelValue": (t) => (i(), d.value = t[0])
|
|
41
41
|
}, V({ _: 2 }, [
|
|
42
|
-
|
|
42
|
+
o.$slots.option ? {
|
|
43
43
|
name: "option",
|
|
44
|
-
fn:
|
|
45
|
-
|
|
44
|
+
fn: l((t) => [
|
|
45
|
+
a(o.$slots, "option", n(m(t)))
|
|
46
46
|
]),
|
|
47
47
|
key: "0"
|
|
48
48
|
} : void 0,
|
|
49
|
-
|
|
49
|
+
o.$slots.group ? {
|
|
50
50
|
name: "group",
|
|
51
|
-
fn:
|
|
52
|
-
|
|
51
|
+
fn: l((t) => [
|
|
52
|
+
a(o.$slots, "group", n(m(t)))
|
|
53
53
|
]),
|
|
54
54
|
key: "1"
|
|
55
55
|
} : void 0,
|
|
56
|
-
|
|
56
|
+
o.$slots.add ? {
|
|
57
57
|
name: "add",
|
|
58
|
-
fn:
|
|
59
|
-
|
|
58
|
+
fn: l((t) => [
|
|
59
|
+
a(o.$slots, "add", n(m(t)))
|
|
60
60
|
]),
|
|
61
61
|
key: "2"
|
|
62
62
|
} : void 0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as $, mergeModels as f, useModel as b, ref as y, createBlock as p, openBlock as u, withCtx as l, createCommentVNode as k, createSlots as V, renderSlot as d, normalizeProps as n, guardReactiveProps as m } from "vue";
|
|
2
2
|
import w from "./ScalarComboboxOptions.vue.js";
|
|
3
3
|
import z from "./ScalarComboboxPopover.vue.js";
|
|
4
|
-
const P = /* @__PURE__ */
|
|
4
|
+
const P = /* @__PURE__ */ $({
|
|
5
5
|
__name: "ScalarComboboxMultiselect",
|
|
6
|
-
props: /* @__PURE__ */
|
|
6
|
+
props: /* @__PURE__ */ f({
|
|
7
7
|
options: {},
|
|
8
8
|
placeholder: {},
|
|
9
9
|
placement: {},
|
|
@@ -16,12 +16,12 @@ const P = /* @__PURE__ */ b({
|
|
|
16
16
|
modelValue: { default: [] },
|
|
17
17
|
modelModifiers: {}
|
|
18
18
|
}),
|
|
19
|
-
emits: /* @__PURE__ */
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
return
|
|
19
|
+
emits: /* @__PURE__ */ f(["add"], ["update:modelValue"]),
|
|
20
|
+
setup(e, { expose: c, emit: g }) {
|
|
21
|
+
const v = g, s = b(e, "modelValue"), i = y(null);
|
|
22
|
+
return c({ comboboxPopoverRef: i }), (t, a) => (u(), p(z, {
|
|
23
23
|
ref_key: "comboboxPopoverRef",
|
|
24
|
-
ref:
|
|
24
|
+
ref: i,
|
|
25
25
|
middleware: e.middleware,
|
|
26
26
|
offset: e.offset,
|
|
27
27
|
placement: e.placement ?? "bottom-start",
|
|
@@ -29,38 +29,38 @@ const P = /* @__PURE__ */ b({
|
|
|
29
29
|
target: e.target,
|
|
30
30
|
teleport: e.teleport
|
|
31
31
|
}, {
|
|
32
|
-
default:
|
|
33
|
-
|
|
32
|
+
default: l(({ open: r }) => [
|
|
33
|
+
d(t.$slots, "default", { open: r })
|
|
34
34
|
]),
|
|
35
|
-
popover:
|
|
36
|
-
e.options?.length ? (
|
|
35
|
+
popover: l(({ open: r }) => [
|
|
36
|
+
e.options?.length ? (u(), p(w, {
|
|
37
37
|
key: 0,
|
|
38
|
-
modelValue:
|
|
39
|
-
"onUpdate:modelValue":
|
|
38
|
+
modelValue: s.value,
|
|
39
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => s.value = o),
|
|
40
40
|
multiselect: "",
|
|
41
|
-
open:
|
|
41
|
+
open: r,
|
|
42
42
|
options: e.options,
|
|
43
43
|
placeholder: e.placeholder,
|
|
44
|
-
onAdd:
|
|
44
|
+
onAdd: a[1] || (a[1] = (o) => v("add"))
|
|
45
45
|
}, V({ _: 2 }, [
|
|
46
|
-
|
|
46
|
+
t.$slots.option ? {
|
|
47
47
|
name: "option",
|
|
48
|
-
fn:
|
|
49
|
-
|
|
48
|
+
fn: l((o) => [
|
|
49
|
+
d(t.$slots, "option", n(m(o)))
|
|
50
50
|
]),
|
|
51
51
|
key: "0"
|
|
52
52
|
} : void 0,
|
|
53
|
-
|
|
53
|
+
t.$slots.group ? {
|
|
54
54
|
name: "group",
|
|
55
|
-
fn:
|
|
56
|
-
|
|
55
|
+
fn: l((o) => [
|
|
56
|
+
d(t.$slots, "group", n(m(o)))
|
|
57
57
|
]),
|
|
58
58
|
key: "1"
|
|
59
59
|
} : void 0,
|
|
60
|
-
|
|
60
|
+
t.$slots.add ? {
|
|
61
61
|
name: "add",
|
|
62
|
-
fn:
|
|
63
|
-
|
|
62
|
+
fn: l((o) => [
|
|
63
|
+
d(t.$slots, "add", n(m(o)))
|
|
64
64
|
]),
|
|
65
65
|
key: "2"
|
|
66
66
|
} : void 0
|