@scalar/components 0.16.19 → 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/ScalarCard/useCardHeading.js +1 -1
- 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/ScalarDropdown/useDropdown.js +1 -1
- 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/ScalarForm/useFormGroups.js +1 -1
- 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/ScalarSidebar/useSidebarGroups.js +1 -1
- package/dist/components/ScalarSidebar/useSidebarNestedItems.js +1 -1
- package/dist/components/ScalarTeleport/ScalarTeleport.vue.js +12 -12
- package/dist/components/ScalarTeleport/useTeleport.js +1 -1
- 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/dist/style.css +1 -1
- package/package.json +11 -11
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const z = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as c, createBlock as i, openBlock as u, unref as e, withCtx as o, createVNode as r, normalizeProps as d, guardReactiveProps as _, renderSlot as l, mergeProps as P } from "vue";
|
|
2
|
+
import { Popover as v, PopoverButton as B, PopoverPanel as y } from "@headlessui/vue";
|
|
3
|
+
import { useBindCx as $ } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import g from "../ScalarFloating/ScalarFloating.vue.js";
|
|
5
|
+
import b from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
|
|
6
|
+
const z = /* @__PURE__ */ c({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarPopover",
|
|
9
9
|
props: {
|
|
@@ -15,32 +15,32 @@ const z = /* @__PURE__ */ m({
|
|
|
15
15
|
middleware: {},
|
|
16
16
|
teleport: { type: [Boolean, String] }
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const { cx:
|
|
20
|
-
return (
|
|
21
|
-
default:
|
|
22
|
-
r(e(
|
|
23
|
-
floating:
|
|
24
|
-
r(e(
|
|
25
|
-
focus:
|
|
26
|
-
style: { width:
|
|
27
|
-
}, e(
|
|
28
|
-
default:
|
|
29
|
-
|
|
30
|
-
close: () =>
|
|
18
|
+
setup(s) {
|
|
19
|
+
const { cx: p } = $();
|
|
20
|
+
return (t, h) => (u(), i(e(v), { as: "template" }, {
|
|
21
|
+
default: o(({ open: a }) => [
|
|
22
|
+
r(e(g), d(_(t.$props)), {
|
|
23
|
+
floating: o(({ width: f, height: n }) => [
|
|
24
|
+
r(e(y), P({
|
|
25
|
+
focus: s.focus,
|
|
26
|
+
style: { width: f, height: n }
|
|
27
|
+
}, e(p)("relative flex flex-col p-0.75")), {
|
|
28
|
+
default: o(({ close: m }) => [
|
|
29
|
+
l(t.$slots, "popover", {
|
|
30
|
+
close: () => m(),
|
|
31
31
|
open: a
|
|
32
32
|
}),
|
|
33
|
-
|
|
34
|
-
r(e(
|
|
33
|
+
l(t.$slots, "backdrop", { open: a }, () => [
|
|
34
|
+
r(e(b))
|
|
35
35
|
])
|
|
36
36
|
]),
|
|
37
37
|
_: 2
|
|
38
38
|
}, 1040, ["focus", "style"])
|
|
39
39
|
]),
|
|
40
|
-
default:
|
|
41
|
-
r(e(
|
|
42
|
-
default:
|
|
43
|
-
|
|
40
|
+
default: o(() => [
|
|
41
|
+
r(e(B), { as: "template" }, {
|
|
42
|
+
default: o(() => [
|
|
43
|
+
l(t.$slots, "default", { open: a })
|
|
44
44
|
]),
|
|
45
45
|
_: 2
|
|
46
46
|
}, 1024)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconMagnifyingGlass as
|
|
1
|
+
import { defineComponent as u, mergeModels as f, useModel as m, ref as p, createElementBlock as h, openBlock as o, normalizeProps as v, guardReactiveProps as g, unref as l, createVNode as b, withDirectives as k, createBlock as n, createCommentVNode as x, createElementVNode as y, mergeProps as C, vModelText as V, withModifiers as M } from "vue";
|
|
2
|
+
import { ScalarIconMagnifyingGlass as S } from "@scalar/icons";
|
|
3
3
|
import { useBindCx as z } from "@scalar/use-hooks/useBindCx";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
...
|
|
4
|
+
import _ from "../ScalarLoading/ScalarLoading.vue.js";
|
|
5
|
+
import A from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
6
|
+
const B = ["aria-label"], E = {}, D = /* @__PURE__ */ u({
|
|
7
|
+
...E,
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "ScalarSearchInput",
|
|
10
10
|
props: /* @__PURE__ */ f({
|
|
@@ -15,24 +15,24 @@ const E = ["aria-label"], N = {}, D = /* @__PURE__ */ p({
|
|
|
15
15
|
modelModifiers: {}
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:modelValue"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
|
|
18
|
+
setup(e) {
|
|
19
|
+
const a = m(e, "modelValue"), t = p(null);
|
|
20
|
+
function s() {
|
|
21
|
+
a.value = "", t.value && t.value.focus();
|
|
22
22
|
}
|
|
23
|
-
const { stylingAttrsCx: c, otherAttrs:
|
|
24
|
-
return (
|
|
25
|
-
|
|
23
|
+
const { stylingAttrsCx: c, otherAttrs: i } = z();
|
|
24
|
+
return (N, r) => (o(), h("label", v(g(
|
|
25
|
+
l(c)(
|
|
26
26
|
"flex items-center text-lg font-medium h-10 pl-3 pr-1 py-2 gap-2.25"
|
|
27
27
|
)
|
|
28
28
|
)), [
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
b(l(S), { class: "text-sidebar-c-search size-4" }),
|
|
30
|
+
k(y("input", C({
|
|
31
31
|
ref_key: "inputRef",
|
|
32
|
-
ref:
|
|
33
|
-
},
|
|
34
|
-
"onUpdate:modelValue":
|
|
35
|
-
"aria-label":
|
|
32
|
+
ref: t
|
|
33
|
+
}, l(i), {
|
|
34
|
+
"onUpdate:modelValue": r[0] || (r[0] = (d) => a.value = d),
|
|
35
|
+
"aria-label": e.label ?? "Enter search query",
|
|
36
36
|
autocapitalize: "off",
|
|
37
37
|
autocomplete: "off",
|
|
38
38
|
autocorrect: "off",
|
|
@@ -40,22 +40,22 @@ const E = ["aria-label"], N = {}, D = /* @__PURE__ */ p({
|
|
|
40
40
|
placeholder: "Search...",
|
|
41
41
|
spellcheck: "false",
|
|
42
42
|
type: "search"
|
|
43
|
-
}), null, 16,
|
|
44
|
-
[
|
|
43
|
+
}), null, 16, B), [
|
|
44
|
+
[V, a.value]
|
|
45
45
|
]),
|
|
46
|
-
|
|
46
|
+
e.loader && e.loader.isActive ? (o(), n(l(_), {
|
|
47
47
|
key: 0,
|
|
48
48
|
class: "self-center",
|
|
49
|
-
loader:
|
|
49
|
+
loader: e.loader,
|
|
50
50
|
size: "md"
|
|
51
|
-
}, null, 8, ["loader"])) :
|
|
51
|
+
}, null, 8, ["loader"])) : a.value ? (o(), n(l(A), {
|
|
52
52
|
key: 1,
|
|
53
53
|
class: "p-0 size-5",
|
|
54
54
|
icon: "Close",
|
|
55
55
|
label: "Clear Search",
|
|
56
56
|
thickness: "1.5",
|
|
57
|
-
onClick:
|
|
58
|
-
})) :
|
|
57
|
+
onClick: M(s, ["stop", "prevent"])
|
|
58
|
+
})) : x("", !0)
|
|
59
59
|
], 16));
|
|
60
60
|
}
|
|
61
61
|
});
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as d, createElementBlock as s, openBlock as o, mergeProps as m, unref as l, createCommentVNode as n, createElementVNode as c, renderSlot as i, createBlock as u } from "vue";
|
|
2
|
+
import { useBindCx as f } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import p from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
4
|
+
const x = ["aria-selected"], h = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex h-fit items-center text-sm font-medium text-c-3 group-hover:text-c-1"
|
|
7
|
-
}, b = { class: "flex min-w-0 flex-1 flex-col gap-0.75" },
|
|
7
|
+
}, b = { class: "flex min-w-0 flex-1 flex-col gap-0.75" }, k = { class: "flex items-center gap-1" }, g = { class: "flex-1 truncate zoomed:!whitespace-normal break-words text-base font-medium" }, v = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "text-base text-c-2"
|
|
10
|
-
},
|
|
10
|
+
}, y = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "truncate zoomed:!whitespace-normal break-words text-base text-c-2"
|
|
13
|
-
}, B = /* @__PURE__ */
|
|
13
|
+
}, B = /* @__PURE__ */ d({
|
|
14
14
|
inheritAttrs: !1,
|
|
15
15
|
__name: "ScalarSearchResultItem",
|
|
16
16
|
props: {
|
|
17
17
|
icon: { type: [Object, Function] },
|
|
18
18
|
selected: { type: Boolean }
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const { cx: a } =
|
|
22
|
-
return (e,
|
|
20
|
+
setup(t) {
|
|
21
|
+
const { cx: a } = f();
|
|
22
|
+
return (e, r) => (o(), s("a", m(
|
|
23
23
|
{
|
|
24
|
-
"aria-selected":
|
|
24
|
+
"aria-selected": t.selected,
|
|
25
25
|
role: "option",
|
|
26
26
|
tabindex: "-1"
|
|
27
27
|
},
|
|
28
28
|
l(a)(
|
|
29
29
|
"group flex cursor-pointer gap-2 rounded px-2 py-1.5 no-underline hover:bg-b-2",
|
|
30
|
-
{ "bg-b-2":
|
|
30
|
+
{ "bg-b-2": t.selected }
|
|
31
31
|
)
|
|
32
32
|
), [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
t.icon ? (o(), s("div", h, [
|
|
34
|
+
i(e.$slots, "icon", {}, () => [
|
|
35
|
+
t.icon ? (o(), u(l(p), {
|
|
36
36
|
key: 0,
|
|
37
37
|
class: "size-4",
|
|
38
|
-
icon:
|
|
39
|
-
}, null, 8, ["icon"])) :
|
|
38
|
+
icon: t.icon
|
|
39
|
+
}, null, 8, ["icon"])) : n("", !0)
|
|
40
40
|
]),
|
|
41
|
-
|
|
42
|
-
])) :
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
r[0] || (r[0] = c("span", null, " ", -1))
|
|
42
|
+
])) : n("", !0),
|
|
43
|
+
c("div", b, [
|
|
44
|
+
c("div", k, [
|
|
45
|
+
c("div", g, [
|
|
46
|
+
i(e.$slots, "default")
|
|
47
47
|
]),
|
|
48
|
-
e.$slots.addon ? (
|
|
49
|
-
|
|
50
|
-
])) :
|
|
48
|
+
e.$slots.addon ? (o(), s("div", v, [
|
|
49
|
+
i(e.$slots, "addon")
|
|
50
|
+
])) : n("", !0)
|
|
51
51
|
]),
|
|
52
|
-
e.$slots.description ? (
|
|
53
|
-
|
|
54
|
-
])) :
|
|
52
|
+
e.$slots.description ? (o(), s("div", y, [
|
|
53
|
+
i(e.$slots, "description")
|
|
54
|
+
])) : n("", !0)
|
|
55
55
|
])
|
|
56
|
-
], 16,
|
|
56
|
+
], 16, x));
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
export {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
const x = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as n, createElementBlock as a, openBlock as m, mergeProps as u, unref as c, renderSlot as o, createCommentVNode as f, createElementVNode as s } from "vue";
|
|
2
|
+
import { useBindCx as i } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
const x = /* @__PURE__ */ n({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "ScalarSearchResultList",
|
|
6
6
|
props: {
|
|
7
7
|
noResults: { type: Boolean }
|
|
8
8
|
},
|
|
9
|
-
setup(
|
|
10
|
-
const { cx:
|
|
11
|
-
return (e, t) => (
|
|
12
|
-
|
|
9
|
+
setup(l) {
|
|
10
|
+
const { cx: r } = i();
|
|
11
|
+
return (e, t) => (m(), a("div", u({ role: "listbox" }, c(r)("flex flex-col")), [
|
|
12
|
+
l.noResults ? o(e.$slots, "noResults", { key: 0 }, () => [
|
|
13
13
|
t[0] || (t[0] = s("div", { class: "flex flex-col items-center gap-2 px-3 py-4" }, [
|
|
14
14
|
s("div", {
|
|
15
15
|
class: "text-base font-medium text-c-2",
|
|
16
16
|
role: "alert"
|
|
17
17
|
}, " No results found ")
|
|
18
18
|
], -1))
|
|
19
|
-
]) :
|
|
19
|
+
]) : f("", !0),
|
|
20
20
|
o(e.$slots, "default")
|
|
21
21
|
], 16));
|
|
22
22
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cva as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as c, createBlock as d, openBlock as s, resolveDynamicComponent as r, mergeProps as b, unref as i, withCtx as u, renderSlot as a, createElementBlock as f, createCommentVNode as l, createElementVNode as v, createVNode as m } from "vue";
|
|
2
|
+
import { cva as h, useBindCx as y } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import B from "./ScalarSidebarIndent.vue.js";
|
|
4
|
+
import x from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
5
|
+
const g = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "h-[1lh] *:size-4 mr-1"
|
|
8
|
-
},
|
|
9
|
-
|
|
8
|
+
}, k = { class: "group/button-label flex-1 min-w-0" }, $ = {}, p = /* @__PURE__ */ c({
|
|
9
|
+
...$,
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "ScalarSidebarButton",
|
|
12
12
|
props: {
|
|
@@ -17,8 +17,8 @@ const B = {
|
|
|
17
17
|
disabled: { type: Boolean },
|
|
18
18
|
indent: { default: 0 }
|
|
19
19
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
20
|
+
setup(e) {
|
|
21
|
+
const n = h({
|
|
22
22
|
base: [
|
|
23
23
|
"group/button peer/button flex items-stretch rounded p-2",
|
|
24
24
|
"font-sidebar text-base/5 text-sidebar-c-2 no-underline wrap-break-word"
|
|
@@ -45,37 +45,37 @@ const B = {
|
|
|
45
45
|
}
|
|
46
46
|
],
|
|
47
47
|
defaultVariants: { selected: !1, disabled: !1, active: !1 }
|
|
48
|
-
}), { cx:
|
|
49
|
-
return (
|
|
48
|
+
}), { cx: o } = y();
|
|
49
|
+
return (t, C) => (s(), d(r(e.is), b({
|
|
50
50
|
"aria-selected": e.selected,
|
|
51
51
|
type: e.is === "button" ? "button" : void 0
|
|
52
|
-
},
|
|
53
|
-
default:
|
|
54
|
-
t
|
|
55
|
-
|
|
52
|
+
}, i(o)(i(n)({ selected: e.selected, disabled: e.disabled, active: e.active }))), {
|
|
53
|
+
default: u(() => [
|
|
54
|
+
a(t.$slots, "indent", {}, () => [
|
|
55
|
+
m(B, {
|
|
56
56
|
class: "-my-2",
|
|
57
57
|
disabled: e.disabled,
|
|
58
58
|
indent: e.indent,
|
|
59
59
|
selected: e.selected
|
|
60
60
|
}, null, 8, ["disabled", "indent", "selected"])
|
|
61
61
|
]),
|
|
62
|
-
e.icon ||
|
|
63
|
-
t
|
|
64
|
-
e.icon ? (
|
|
62
|
+
e.icon || t.$slots.icon ? (s(), f("div", g, [
|
|
63
|
+
a(t.$slots, "icon", {}, () => [
|
|
64
|
+
e.icon ? (s(), d(i(x), {
|
|
65
65
|
key: 0,
|
|
66
66
|
icon: e.icon
|
|
67
|
-
}, null, 8, ["icon"])) :
|
|
67
|
+
}, null, 8, ["icon"])) : l("", !0)
|
|
68
68
|
])
|
|
69
|
-
])) :
|
|
70
|
-
|
|
71
|
-
t
|
|
69
|
+
])) : l("", !0),
|
|
70
|
+
v("div", k, [
|
|
71
|
+
a(t.$slots, "default")
|
|
72
72
|
]),
|
|
73
|
-
t
|
|
73
|
+
a(t.$slots, "aside")
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
76
76
|
}, 16, ["aria-selected", "type"]));
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
p as default
|
|
81
81
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as g, mergeModels as u, useModel as h, createBlock as
|
|
1
|
+
import { defineComponent as g, mergeModels as u, useModel as h, createBlock as x, openBlock as s, resolveDynamicComponent as k, normalizeProps as $, guardReactiveProps as B, unref as n, withCtx as a, createElementVNode as C, createElementBlock as c, createCommentVNode as v, renderSlot as o, createVNode as d, normalizeStyle as S, normalizeClass as z, createTextVNode as N, toDisplayString as V, createSlots as M } from "vue";
|
|
2
2
|
import { useBindCx as D } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import E from "./ScalarSidebarButton.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import m from "./ScalarSidebarGroupToggle.vue.js";
|
|
5
5
|
import G from "./ScalarSidebarIndent.vue.js";
|
|
6
6
|
import { useSidebarGroups as O } from "./useSidebarGroups.js";
|
|
7
7
|
const P = { class: "group/group-button relative flex flex-col leading-5" }, T = ["aria-expanded"], j = {
|
|
@@ -28,91 +28,91 @@ const P = { class: "group/group-button relative flex flex-col leading-5" }, T =
|
|
|
28
28
|
openModifiers: {}
|
|
29
29
|
}),
|
|
30
30
|
emits: /* @__PURE__ */ u(["click", "toggle"], ["update:open"]),
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
}, y = (
|
|
35
|
-
|
|
31
|
+
setup(t, { emit: f }) {
|
|
32
|
+
const r = f, e = h(t, "open"), { level: i } = O({ increment: !0 }), { cx: p } = D(), b = (l) => {
|
|
33
|
+
r("click", l), !t.controlled && !t.discrete && (e.value = !e.value);
|
|
34
|
+
}, y = (l) => {
|
|
35
|
+
r("toggle", l), !t.controlled && t.discrete && (e.value = !e.value);
|
|
36
36
|
};
|
|
37
|
-
return (
|
|
38
|
-
default:
|
|
39
|
-
|
|
40
|
-
l
|
|
41
|
-
l
|
|
42
|
-
level: n(
|
|
43
|
-
open:
|
|
37
|
+
return (l, F) => (s(), x(k(t.is), $(B(n(p)("group/item flex flex-col gap-px"))), {
|
|
38
|
+
default: a(() => [
|
|
39
|
+
C("div", P, [
|
|
40
|
+
o(l.$slots, "before", { open: e.value }),
|
|
41
|
+
o(l.$slots, "button", {
|
|
42
|
+
level: n(i),
|
|
43
|
+
open: e.value
|
|
44
44
|
}, () => [
|
|
45
|
-
|
|
45
|
+
t.discrete ? (s(), c("button", {
|
|
46
46
|
key: 0,
|
|
47
47
|
type: "button",
|
|
48
|
-
"aria-expanded":
|
|
48
|
+
"aria-expanded": e.value,
|
|
49
49
|
class: z([
|
|
50
50
|
"absolute top-[1lh] -translate-y-1/2 p-0.75 rounded left-[calc(4px+var(--scalar-sidebar-indent)*var(--scalar-sidebar-level))]",
|
|
51
|
-
|
|
51
|
+
t.selected ? "text-sidebar-c-1 hover:bg-sidebar-b-1 hover:text-sidebar-c-1" : "text-c-3 hover:bg-sidebar-b-hover hover:text-sidebar-c-hover"
|
|
52
52
|
]),
|
|
53
|
-
style:
|
|
53
|
+
style: S({ "--scalar-sidebar-level": n(i) }),
|
|
54
54
|
onClick: y
|
|
55
55
|
}, [
|
|
56
|
-
l
|
|
57
|
-
|
|
58
|
-
icon:
|
|
59
|
-
open:
|
|
56
|
+
o(l.$slots, "icon", { open: e.value }, () => [
|
|
57
|
+
d(m, {
|
|
58
|
+
icon: t.icon,
|
|
59
|
+
open: e.value
|
|
60
60
|
}, {
|
|
61
|
-
label:
|
|
62
|
-
N(V(
|
|
63
|
-
l
|
|
61
|
+
label: a(() => [
|
|
62
|
+
N(V(e.value ? "Close" : "Open") + " ", 1),
|
|
63
|
+
o(l.$slots, "default", { open: e.value })
|
|
64
64
|
]),
|
|
65
65
|
_: 3
|
|
66
66
|
}, 8, ["icon", "open"])
|
|
67
67
|
])
|
|
68
|
-
], 14, T)) :
|
|
69
|
-
|
|
68
|
+
], 14, T)) : v("", !0),
|
|
69
|
+
d(E, {
|
|
70
70
|
is: "button",
|
|
71
|
-
active:
|
|
72
|
-
"aria-expanded":
|
|
73
|
-
disabled:
|
|
74
|
-
indent: n(
|
|
75
|
-
selected:
|
|
71
|
+
active: t.active,
|
|
72
|
+
"aria-expanded": e.value,
|
|
73
|
+
disabled: t.disabled,
|
|
74
|
+
indent: n(i),
|
|
75
|
+
selected: t.selected,
|
|
76
76
|
onClick: b
|
|
77
77
|
}, M({
|
|
78
|
-
indent:
|
|
79
|
-
|
|
78
|
+
indent: a(() => [
|
|
79
|
+
d(G, {
|
|
80
80
|
class: "mr-0 -my-2",
|
|
81
|
-
indent: n(
|
|
82
|
-
selected:
|
|
81
|
+
indent: n(i),
|
|
82
|
+
selected: t.selected
|
|
83
83
|
}, null, 8, ["indent", "selected"])
|
|
84
84
|
]),
|
|
85
|
-
icon:
|
|
86
|
-
|
|
85
|
+
icon: a(() => [
|
|
86
|
+
t.discrete ? (s(), c("div", j)) : o(l.$slots, "icon", {
|
|
87
87
|
key: 1,
|
|
88
|
-
open:
|
|
88
|
+
open: e.value
|
|
89
89
|
}, () => [
|
|
90
|
-
|
|
90
|
+
d(m, {
|
|
91
91
|
class: "text-c-3",
|
|
92
|
-
icon:
|
|
93
|
-
open:
|
|
92
|
+
icon: t.icon,
|
|
93
|
+
open: e.value
|
|
94
94
|
}, null, 8, ["icon", "open"])
|
|
95
95
|
])
|
|
96
96
|
]),
|
|
97
|
-
default:
|
|
98
|
-
l
|
|
97
|
+
default: a(() => [
|
|
98
|
+
o(l.$slots, "default", { open: e.value })
|
|
99
99
|
]),
|
|
100
100
|
_: 2
|
|
101
101
|
}, [
|
|
102
|
-
|
|
102
|
+
l.$slots.aside ? {
|
|
103
103
|
name: "aside",
|
|
104
|
-
fn:
|
|
105
|
-
l
|
|
104
|
+
fn: a(() => [
|
|
105
|
+
o(l.$slots, "aside", { open: e.value })
|
|
106
106
|
]),
|
|
107
107
|
key: "0"
|
|
108
108
|
} : void 0
|
|
109
109
|
]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"])
|
|
110
110
|
]),
|
|
111
|
-
l
|
|
111
|
+
o(l.$slots, "after", { open: e.value })
|
|
112
112
|
]),
|
|
113
|
-
|
|
114
|
-
l
|
|
115
|
-
])) :
|
|
113
|
+
e.value ? (s(), c("ul", w, [
|
|
114
|
+
o(l.$slots, "items", { open: e.value })
|
|
115
|
+
])) : v("", !0)
|
|
116
116
|
]),
|
|
117
117
|
_: 3
|
|
118
118
|
}, 16));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconCaretRight as
|
|
3
|
-
import { cva as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
...
|
|
1
|
+
import { defineComponent as l, createBlock as n, openBlock as o, resolveDynamicComponent as c, mergeProps as f, unref as t, withCtx as u, renderSlot as i, createElementVNode as d, createTextVNode as m, toDisplayString as p } from "vue";
|
|
2
|
+
import { ScalarIconCaretRight as y } from "@scalar/icons";
|
|
3
|
+
import { cva as b, useBindCx as g } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import h from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
5
|
+
const v = { class: "sr-only" }, C = {}, $ = /* @__PURE__ */ l({
|
|
6
|
+
...C,
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarSidebarGroupToggle",
|
|
9
9
|
props: {
|
|
@@ -11,29 +11,29 @@ const g = { class: "sr-only" }, h = {}, $ = /* @__PURE__ */ i({
|
|
|
11
11
|
open: { type: Boolean, default: !1 },
|
|
12
12
|
icon: { type: [Object, Function] }
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
14
|
+
setup(e) {
|
|
15
|
+
const r = b({
|
|
16
16
|
base: "size-4 flex items-center justify-center transition-transform duration-100",
|
|
17
17
|
variants: { open: { true: "rotate-90" } },
|
|
18
18
|
defaultVariants: { open: !1 }
|
|
19
|
-
}), { cx:
|
|
20
|
-
return (
|
|
19
|
+
}), { cx: s } = g();
|
|
20
|
+
return (a, x) => (o(), n(c(e.is), f({
|
|
21
21
|
type: e.is === "button" ? "button" : void 0
|
|
22
|
-
},
|
|
23
|
-
default:
|
|
24
|
-
|
|
25
|
-
e.icon ? (
|
|
22
|
+
}, t(s)(t(r)({ open: e.open }))), {
|
|
23
|
+
default: u(() => [
|
|
24
|
+
i(a.$slots, "default", { open: e.open }, () => [
|
|
25
|
+
e.icon ? (o(), n(t(h), {
|
|
26
26
|
key: 0,
|
|
27
27
|
icon: e.icon
|
|
28
|
-
}, null, 8, ["icon"])) : (
|
|
28
|
+
}, null, 8, ["icon"])) : (o(), n(t(y), {
|
|
29
29
|
key: 1,
|
|
30
30
|
class: "size-3",
|
|
31
31
|
weight: "bold"
|
|
32
32
|
}))
|
|
33
33
|
]),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
d("span", v, [
|
|
35
|
+
i(a.$slots, "label", { open: e.open }, () => [
|
|
36
|
+
m(p(e.open ? "Close" : "Open") + " Group ", 1)
|
|
37
37
|
])
|
|
38
38
|
])
|
|
39
39
|
]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as o, computed as c, createElementBlock as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
const
|
|
4
|
-
...
|
|
1
|
+
import { defineComponent as o, computed as c, createElementBlock as r, openBlock as n, normalizeProps as u, guardReactiveProps as b, unref as m, Fragment as f, renderList as v, createElementVNode as g, createCommentVNode as y, normalizeClass as p } from "vue";
|
|
2
|
+
import { useBindCx as x } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
const B = {}, C = /* @__PURE__ */ o({
|
|
4
|
+
...B,
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ScalarSidebarIndent",
|
|
7
7
|
props: {
|
|
@@ -9,26 +9,26 @@ const _ = {}, C = /* @__PURE__ */ o({
|
|
|
9
9
|
selected: { type: Boolean, default: !1 },
|
|
10
10
|
disabled: { type: Boolean }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const a = c(() => Array.from({ length:
|
|
14
|
-
return (
|
|
15
|
-
m(
|
|
12
|
+
setup(e) {
|
|
13
|
+
const a = c(() => Array.from({ length: e.indent }, (l, t) => t)), { cx: d } = x();
|
|
14
|
+
return (l, t) => (n(), r("div", u(b(
|
|
15
|
+
m(d)("scalar-sidebar-indent flex justify-center", {
|
|
16
16
|
"mr-[calc(20px-var(--scalar-sidebar-indent))]": e.indent > 0,
|
|
17
17
|
"scalar-sidebar-indent-selected": e.selected
|
|
18
18
|
})
|
|
19
19
|
)), [
|
|
20
|
-
(n(!0),
|
|
21
|
-
key:
|
|
20
|
+
(n(!0), r(f, null, v(a.value, (s, i) => (n(), r("div", {
|
|
21
|
+
key: s,
|
|
22
22
|
class: "relative w-[var(--scalar-sidebar-indent)]"
|
|
23
23
|
}, [
|
|
24
|
-
|
|
25
|
-
i === a.value.length - 1 ? (n(),
|
|
24
|
+
t[0] || (t[0] = g("div", { class: "scalar-sidebar-indent-border absolute left-2 inset-y-0 w-border bg-sidebar-indent-border" }, null, -1)),
|
|
25
|
+
i === a.value.length - 1 ? (n(), r("div", {
|
|
26
26
|
key: 0,
|
|
27
|
-
class:
|
|
27
|
+
class: p([
|
|
28
28
|
"absolute left-2 inset-y-0 w-border",
|
|
29
29
|
e.disabled ? "" : e.selected ? "bg-sidebar-indent-border-active" : "group-hover/button:bg-sidebar-indent-border-hover"
|
|
30
30
|
])
|
|
31
|
-
}, null, 2)) :
|
|
31
|
+
}, null, 2)) : y("", !0)
|
|
32
32
|
]))), 128))
|
|
33
33
|
], 16));
|
|
34
34
|
}
|