@scalar/components 0.14.12 → 0.14.13
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/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +25 -26
- package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts +2 -3
- package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +22 -22
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +3 -9
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +33 -26
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue3.js +5 -0
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +2 -2
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +12 -11
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +2 -2
- package/dist/components/ScalarSidebar/ScalarSidebarPlayground.vue.d.ts +30 -0
- package/dist/components/ScalarSidebar/ScalarSidebarPlayground.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.js +6 -6
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts +37 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.d.ts +18 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.d.ts.map +1 -0
- package/dist/index.js +148 -147
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue2.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarListbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListbox.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarListbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarListbox/ScalarListbox.vue"],"names":[],"mappings":"AAwGA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIrC,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,IAAI,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAClC,CAAA;AAkCD,iBAAS,cAAc;WA0HT,OAAO,IAA6B;;QA1IhD,4CAA4C;uBAC7B;YACb,yCAAyC;YACzC,IAAI,EAAE,OAAO,CAAA;SACd,GAAG,GAAG;;QAJP,4CAA4C;uBAC7B;YACb,yCAAyC;YACzC,IAAI,EAAE,OAAO,CAAA;SACd,GAAG,GAAG;;;;EA2IR;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;aAhLR,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;aAFL,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;;;aAFL,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;aAFL,MAAM,EAAE;SACZ,MAAM;YACH,MAAM;;;kFAqLhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as c, createBlock as
|
|
1
|
+
import { defineComponent as c, createBlock as i, openBlock as o, unref as t, withCtx as l, createCommentVNode as n, createVNode as r, createTextVNode as y, toDisplayString as b, mergeProps as p, renderSlot as V, createElementBlock as d, createElementVNode as B, Fragment as _, renderList as g, normalizeStyle as k } from "vue";
|
|
2
2
|
import { Listbox as x, ListboxLabel as L, ListboxButton as h, ListboxOptions as $ } from "@headlessui/vue";
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const w = { class: "custom-scroll min-h-0 flex-1" },
|
|
3
|
+
import { useBindCx as S } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import C from "./ScalarListboxItem.vue.js";
|
|
5
|
+
import N from "../ScalarFloating/ScalarFloating.vue.js";
|
|
6
|
+
import v from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
|
|
7
|
+
const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "ScalarListbox",
|
|
10
10
|
props: {
|
|
@@ -22,50 +22,49 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, P = /* @__PURE__ */ c({
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["update:modelValue"],
|
|
24
24
|
setup(z) {
|
|
25
|
-
const { cx:
|
|
26
|
-
return (e,
|
|
25
|
+
const { cx: u } = S();
|
|
26
|
+
return (e, m) => (o(), i(t(x), {
|
|
27
27
|
modelValue: e.modelValue,
|
|
28
28
|
multiple: e.multiple,
|
|
29
|
-
"onUpdate:modelValue":
|
|
29
|
+
"onUpdate:modelValue": m[0] || (m[0] = (a) => e.$emit("update:modelValue", a))
|
|
30
30
|
}, {
|
|
31
31
|
default: l(({ open: a }) => [
|
|
32
|
-
e.label ? (o(),
|
|
32
|
+
e.label ? (o(), i(t(L), {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "sr-only"
|
|
35
35
|
}, {
|
|
36
36
|
default: l(() => [
|
|
37
|
-
b(
|
|
37
|
+
y(b(e.label), 1)
|
|
38
38
|
]),
|
|
39
39
|
_: 1
|
|
40
|
-
})) :
|
|
41
|
-
|
|
40
|
+
})) : n("", !0),
|
|
41
|
+
r(t(N), p(e.$props, {
|
|
42
42
|
placement: e.placement ?? "bottom-start"
|
|
43
43
|
}), {
|
|
44
44
|
floating: l(({ width: f }) => [
|
|
45
|
-
a ? (o(),
|
|
45
|
+
a ? (o(), d("div", p({
|
|
46
46
|
key: 0,
|
|
47
47
|
style: { width: f }
|
|
48
|
-
}, t(
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
}, t(u)("relative flex max-h-[inherit] w-40 rounded text-sm")), [
|
|
49
|
+
B("div", w, [
|
|
50
|
+
r(t($), { class: "flex flex-col gap-0.75 p-0.75 -outline-offset-1" }, {
|
|
51
51
|
default: l(() => [
|
|
52
|
-
(o(!0),
|
|
53
|
-
key:
|
|
54
|
-
option:
|
|
52
|
+
(o(!0), d(_, null, g(e.options, (s) => (o(), i(C, {
|
|
53
|
+
key: s.id,
|
|
54
|
+
option: s,
|
|
55
55
|
style: k(e.multiple ? "checkbox" : "radio")
|
|
56
56
|
}, null, 8, ["option", "style"]))), 128))
|
|
57
57
|
]),
|
|
58
58
|
_: 1
|
|
59
59
|
})
|
|
60
60
|
]),
|
|
61
|
-
|
|
62
|
-
], 16)) :
|
|
61
|
+
r(t(v))
|
|
62
|
+
], 16)) : n("", !0)
|
|
63
63
|
]),
|
|
64
64
|
default: l(() => [
|
|
65
|
-
|
|
65
|
+
r(t(h), {
|
|
66
66
|
id: e.id,
|
|
67
|
-
as: "template"
|
|
68
|
-
class: "justify-start focus:outline-none focus-visible:ring-1 focus-visible:ring-c-accent"
|
|
67
|
+
as: "template"
|
|
69
68
|
}, {
|
|
70
69
|
default: l(() => [
|
|
71
70
|
V(e.$slots, "default", { open: a })
|
|
@@ -81,5 +80,5 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, P = /* @__PURE__ */ c({
|
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
82
|
export {
|
|
84
|
-
|
|
83
|
+
T as default
|
|
85
84
|
};
|
|
@@ -3,9 +3,8 @@ declare const meta: Meta;
|
|
|
3
3
|
export default meta;
|
|
4
4
|
type Story = StoryObj<typeof meta>;
|
|
5
5
|
export declare const Base: Story;
|
|
6
|
-
export declare const WithNavItems: Story;
|
|
7
6
|
export declare const WithNestedGroups: Story;
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
7
|
+
export declare const WithSections: Story;
|
|
8
|
+
export declare const WithFooterContent: Story;
|
|
10
9
|
export declare const WithSearchButton: Story;
|
|
11
10
|
//# sourceMappingURL=ScalarSidebar.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"ScalarSidebar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAYrD,QAAA,MAAM,IAAI,EAAE,IA0BX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA;AAE7B,eAAO,MAAM,gBAAgB,EAAE,KAkE9B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAqD1B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAoB9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"AAwFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;;;;;GAqBG;;AACH,
|
|
1
|
+
{"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"AAwFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;;;;;GAqBG;;AACH,wBA+HC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as r, createBlock as
|
|
2
|
-
import { cva as
|
|
1
|
+
import { defineComponent as r, createBlock as n, openBlock as t, resolveDynamicComponent as c, mergeProps as u, unref as a, withCtx as f, renderSlot as s, createElementVNode as p, createElementBlock as d, createCommentVNode as o, createVNode as b } from "vue";
|
|
2
|
+
import { cva as m, useBindCx as v } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import y from "./ScalarSidebarIndent.vue.js";
|
|
4
4
|
import h from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
5
|
-
const
|
|
5
|
+
const B = { class: "flex items-center gap-1 flex-1 py-2 leading-5" }, $ = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "size-3.5"
|
|
8
|
-
},
|
|
8
|
+
}, g = { key: 0 }, k = {}, w = /* @__PURE__ */ r({
|
|
9
9
|
...k,
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "ScalarSidebarButton",
|
|
@@ -17,10 +17,10 @@ const g = { class: "flex items-center gap-1 flex-1 py-2 leading-5" }, B = {
|
|
|
17
17
|
indent: { default: 0 }
|
|
18
18
|
},
|
|
19
19
|
setup(C) {
|
|
20
|
-
const
|
|
21
|
-
base: ["group/button flex rounded px-
|
|
20
|
+
const l = m({
|
|
21
|
+
base: ["group/button flex rounded px-2 font-sidebar text-c-2 no-underline"],
|
|
22
22
|
variants: {
|
|
23
|
-
selected: { true: "cursor-auto bg-b-2 text-c-1" },
|
|
23
|
+
selected: { true: "cursor-auto bg-b-2 text-c-1 font-sidebar-active" },
|
|
24
24
|
disabled: { true: "cursor-auto" }
|
|
25
25
|
},
|
|
26
26
|
compoundVariants: [
|
|
@@ -28,38 +28,38 @@ const g = { class: "flex items-center gap-1 flex-1 py-2 leading-5" }, B = {
|
|
|
28
28
|
],
|
|
29
29
|
defaultVariants: { selected: !1, disabled: !1 }
|
|
30
30
|
}), { cx: i } = v();
|
|
31
|
-
return (e, S) => (t(),
|
|
31
|
+
return (e, S) => (t(), n(c(e.is), u({
|
|
32
32
|
"aria-level": e.indent,
|
|
33
33
|
"aria-selected": e.selected,
|
|
34
34
|
type: e.is === "button" ? "button" : void 0
|
|
35
|
-
},
|
|
35
|
+
}, a(i)(a(l)({ selected: e.selected, disabled: e.disabled }))), {
|
|
36
36
|
default: f(() => [
|
|
37
37
|
s(e.$slots, "indent", {}, () => [
|
|
38
|
-
|
|
38
|
+
b(y, {
|
|
39
39
|
indent: e.indent,
|
|
40
|
-
selected: e.selected
|
|
41
|
-
|
|
40
|
+
selected: e.selected,
|
|
41
|
+
disabled: e.disabled
|
|
42
|
+
}, null, 8, ["indent", "selected", "disabled"])
|
|
42
43
|
]),
|
|
43
|
-
|
|
44
|
-
e.icon || e.$slots.icon ? (t(),
|
|
44
|
+
p("div", B, [
|
|
45
|
+
e.icon || e.$slots.icon ? (t(), d("div", $, [
|
|
45
46
|
s(e.$slots, "icon", {}, () => [
|
|
46
|
-
e.icon ? (t(), a(
|
|
47
|
+
e.icon ? (t(), n(a(h), {
|
|
47
48
|
key: 0,
|
|
48
|
-
icon: e.icon
|
|
49
|
-
|
|
50
|
-
}, null, 8, ["icon"])) : n("", !0)
|
|
49
|
+
icon: e.icon
|
|
50
|
+
}, null, 8, ["icon"])) : o("", !0)
|
|
51
51
|
])
|
|
52
|
-
])) :
|
|
52
|
+
])) : o("", !0),
|
|
53
53
|
s(e.$slots, "default")
|
|
54
54
|
]),
|
|
55
|
-
e.$slots.aside ? (t(),
|
|
55
|
+
e.$slots.aside ? (t(), d("div", g, [
|
|
56
56
|
s(e.$slots, "aside")
|
|
57
|
-
])) :
|
|
57
|
+
])) : o("", !0)
|
|
58
58
|
]),
|
|
59
59
|
_: 3
|
|
60
60
|
}, 16, ["aria-level", "aria-selected", "type"]));
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
w as default
|
|
65
65
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ScalarSidebarItemProps } from '../../components/ScalarSidebar/types';
|
|
2
2
|
import { type SidebarGroupLevel } from './useSidebarGroups.js';
|
|
3
3
|
/**
|
|
4
4
|
* Scalar Sidebar Group component
|
|
@@ -17,17 +17,11 @@ import { type SidebarGroupLevel } from './useSidebarGroups.js';
|
|
|
17
17
|
*/
|
|
18
18
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
19
19
|
modelValue?: boolean;
|
|
20
|
-
} & {
|
|
21
|
-
/** Override the element tag */
|
|
22
|
-
is?: Component | string;
|
|
23
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
} & ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
21
|
"update:modelValue": (value: boolean) => any;
|
|
25
22
|
}, string, import("vue").PublicProps, Readonly<{
|
|
26
23
|
modelValue?: boolean;
|
|
27
|
-
} & {
|
|
28
|
-
/** Override the element tag */
|
|
29
|
-
is?: Component | string;
|
|
30
|
-
}> & Readonly<{
|
|
24
|
+
} & ScalarSidebarItemProps> & Readonly<{
|
|
31
25
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
32
26
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
33
27
|
/** The text content of the toggle */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AA8FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAO9E,OAAO,EAAE,KAAK,iBAAiB,EAAoB,MAAM,oBAAoB,CAAA;AAI7E;;;;;;;;;;;;;;GAcG;;iBA+BU,OAAO;;;;iBAAP,OAAO;;;;IArBlB,qCAAqC;cAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;IAC3C,wCAAwC;aAC/B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,KAAK,GAAG;IACpE,mCAAmC;YAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;;IALzC,qCAAqC;cAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;IAC3C,wCAAwC;aAC/B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,KAAK,GAAG;IACpE,mCAAmC;YAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;;AAd3C,wBAgKC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,62 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as m, mergeModels as p, useModel as c, createElementBlock as f, openBlock as i, renderSlot as a, createBlock as v, createCommentVNode as b, unref as n, createVNode as s, withCtx as t, resolveDynamicComponent as _, normalizeProps as B, mergeProps as g } from "vue";
|
|
2
|
+
import { useBindCx as C } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import S from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import $ from "./ScalarSidebarGroupToggle.vue.js";
|
|
5
5
|
import k from "./ScalarSidebarIndent.vue.js";
|
|
6
|
-
import { useSidebarGroups as
|
|
7
|
-
const V = { class: "group/item contents" },
|
|
8
|
-
...
|
|
6
|
+
import { useSidebarGroups as y } from "./useSidebarGroups.js";
|
|
7
|
+
const V = { class: "group/item contents" }, x = {}, A = /* @__PURE__ */ m({
|
|
8
|
+
...x,
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "ScalarSidebarGroup",
|
|
11
11
|
props: /* @__PURE__ */ p({
|
|
12
|
-
is: { default: "ul" }
|
|
12
|
+
is: { default: "ul" },
|
|
13
|
+
icon: {},
|
|
14
|
+
selected: { type: Boolean },
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
indent: {}
|
|
13
17
|
}, {
|
|
14
18
|
modelValue: { type: Boolean },
|
|
15
19
|
modelModifiers: {}
|
|
16
20
|
}),
|
|
17
21
|
emits: ["update:modelValue"],
|
|
18
|
-
setup(
|
|
19
|
-
const e = c(
|
|
20
|
-
return (o,
|
|
22
|
+
setup(d) {
|
|
23
|
+
const e = c(d, "modelValue"), { level: l } = y({ increment: !0 }), { cx: u } = C();
|
|
24
|
+
return (o, r) => (i(), f("li", V, [
|
|
21
25
|
a(o.$slots, "button", {
|
|
22
|
-
level:
|
|
26
|
+
level: n(l),
|
|
23
27
|
open: !!e.value
|
|
24
28
|
}, () => [
|
|
25
|
-
|
|
29
|
+
s(S, {
|
|
26
30
|
is: "button",
|
|
31
|
+
class: "group/group-button",
|
|
27
32
|
"aria-expanded": e.value,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
indent: n(l),
|
|
34
|
+
selected: o.selected,
|
|
35
|
+
disabled: o.disabled,
|
|
36
|
+
icon: o.icon,
|
|
37
|
+
onClick: r[0] || (r[0] = (M) => e.value = !e.value)
|
|
31
38
|
}, {
|
|
32
|
-
indent:
|
|
33
|
-
|
|
39
|
+
indent: t(() => [
|
|
40
|
+
s(k, {
|
|
34
41
|
class: "mr-0",
|
|
35
|
-
indent:
|
|
42
|
+
indent: n(l)
|
|
36
43
|
}, null, 8, ["indent"])
|
|
37
44
|
]),
|
|
38
|
-
icon:
|
|
39
|
-
|
|
45
|
+
icon: t(() => [
|
|
46
|
+
s($, {
|
|
40
47
|
class: "text-c-3",
|
|
41
48
|
open: e.value
|
|
42
49
|
}, null, 8, ["open"])
|
|
43
50
|
]),
|
|
44
|
-
default:
|
|
51
|
+
default: t(() => [
|
|
45
52
|
a(o.$slots, "default", {
|
|
46
53
|
open: !!e.value
|
|
47
54
|
})
|
|
48
55
|
]),
|
|
49
56
|
_: 3
|
|
50
|
-
}, 8, ["aria-expanded", "indent"])
|
|
57
|
+
}, 8, ["aria-expanded", "indent", "selected", "disabled", "icon"])
|
|
51
58
|
]),
|
|
52
|
-
e.value ? (i(), v(
|
|
53
|
-
default:
|
|
59
|
+
e.value ? (i(), v(_(o.is), B(g({ key: 0 }, n(u)("flex flex-col gap-px"))), {
|
|
60
|
+
default: t(() => [
|
|
54
61
|
a(o.$slots, "items", {
|
|
55
62
|
open: !!e.value
|
|
56
63
|
})
|
|
57
64
|
]),
|
|
58
65
|
_: 3
|
|
59
|
-
}, 16)) :
|
|
66
|
+
}, 16)) : b("", !0)
|
|
60
67
|
]));
|
|
61
68
|
}
|
|
62
69
|
});
|
|
@@ -10,11 +10,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
indent?: SidebarGroupLevel;
|
|
11
11
|
/** Whether the indent is selected @default false */
|
|
12
12
|
selected?: boolean;
|
|
13
|
+
/** Whether the indent hover is disabled @default false */
|
|
14
|
+
disabled?: boolean;
|
|
13
15
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
14
16
|
/** The number of indents to render @default 0 */
|
|
15
17
|
indent?: SidebarGroupLevel;
|
|
16
18
|
/** Whether the indent is selected @default false */
|
|
17
19
|
selected?: boolean;
|
|
20
|
+
/** Whether the indent hover is disabled @default false */
|
|
21
|
+
disabled?: boolean;
|
|
18
22
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
23
|
export default _default;
|
|
20
24
|
//# sourceMappingURL=ScalarSidebarIndent.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarIndent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarIndent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarIndent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarIndent.vue"],"names":[],"mappings":"AAuFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;GAKG;;IAID,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;IAClB,0DAA0D;eAC/C,OAAO;;IALlB,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;IAClB,0DAA0D;eAC/C,OAAO;;AARpB,wBAsHC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import a from "./ScalarSidebarIndent.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ o(a, [["__scopeId", "data-v-0ac3341b"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { defineComponent as o, computed as c, createElementBlock as t, openBlock as n, normalizeProps as u, guardReactiveProps as b, unref as m, Fragment as f, renderList as p, createElementVNode as v, createCommentVNode as g, normalizeClass as y } from "vue";
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
const
|
|
4
|
-
...
|
|
2
|
+
import { useBindCx as B } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
const _ = {}, C = /* @__PURE__ */ o({
|
|
4
|
+
..._,
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ScalarSidebarIndent",
|
|
7
7
|
props: {
|
|
8
8
|
indent: { default: 0 },
|
|
9
|
-
selected: { type: Boolean, default: !1 }
|
|
9
|
+
selected: { type: Boolean, default: !1 },
|
|
10
|
+
disabled: { type: Boolean }
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const a = c(() => Array.from({ length:
|
|
12
|
+
setup(d) {
|
|
13
|
+
const a = c(() => Array.from({ length: d.indent }, (e, r) => r)), { cx: s } = B();
|
|
13
14
|
return (e, r) => (n(), t("div", u(b(
|
|
14
|
-
m(
|
|
15
|
-
"mr-[calc(
|
|
15
|
+
m(s)("scalar-sidebar-indent flex justify-center", {
|
|
16
|
+
"mr-[calc(20px-var(--scalar-sidebar-indent))]": e.indent > 0,
|
|
16
17
|
"scalar-sidebar-indent-selected": e.selected
|
|
17
18
|
})
|
|
18
19
|
)), [
|
|
@@ -20,12 +21,12 @@ const h = {}, C = /* @__PURE__ */ o({
|
|
|
20
21
|
key: l,
|
|
21
22
|
class: "relative w-[var(--scalar-sidebar-indent)]"
|
|
22
23
|
}, [
|
|
23
|
-
r[0] || (r[0] = v("div", { class: "scalar-sidebar-indent-border absolute left-1.
|
|
24
|
+
r[0] || (r[0] = v("div", { class: "scalar-sidebar-indent-border absolute left-1.5 inset-y-0 w-border bg-sidebar-indent-border" }, null, -1)),
|
|
24
25
|
i === a.value.length - 1 ? (n(), t("div", {
|
|
25
26
|
key: 0,
|
|
26
27
|
class: y([
|
|
27
|
-
"absolute left-1.
|
|
28
|
-
e.selected ? "bg-sidebar-indent-active" : "group-hover/button:bg-sidebar-indent-hover"
|
|
28
|
+
"absolute left-1.5 inset-y-0 w-border",
|
|
29
|
+
e.disabled ? "" : e.selected ? "bg-sidebar-indent-border-active" : "group-hover/button:bg-sidebar-indent-border-hover"
|
|
29
30
|
])
|
|
30
31
|
}, null, 2)) : g("", !0)
|
|
31
32
|
]))), 128))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as o, createBlock as r, openBlock as a, resolveDynamicComponent as
|
|
1
|
+
import { defineComponent as o, createBlock as r, openBlock as a, resolveDynamicComponent as s, normalizeProps as n, guardReactiveProps as l, unref as p, withCtx as i, renderSlot as c } from "vue";
|
|
2
2
|
import { useBindCx as f } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
const u = {}, C = /* @__PURE__ */ o({
|
|
4
4
|
...u,
|
|
@@ -9,7 +9,7 @@ const u = {}, C = /* @__PURE__ */ o({
|
|
|
9
9
|
},
|
|
10
10
|
setup(m) {
|
|
11
11
|
const { cx: t } = f();
|
|
12
|
-
return (e, _) => (a(), r(
|
|
12
|
+
return (e, _) => (a(), r(s(e.is), n(l(p(t)("flex flex-col text-base p-3 gap-px"))), {
|
|
13
13
|
default: i(() => [
|
|
14
14
|
c(e.$slots, "default")
|
|
15
15
|
]),
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
indent: number;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
'selected'?: string;
|
|
6
|
+
} & __VLS_Props;
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
search?(_: {}): any;
|
|
11
|
+
default?(_: {}): any;
|
|
12
|
+
footer?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: HTMLDivElement;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:selected": (value: string) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
+
"onUpdate:selected"?: ((value: string) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
23
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ScalarSidebarPlayground.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarPlayground.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarPlayground.vue"],"names":[],"mappings":"AAkDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;AAaF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAwGT,OAAO,IAA6B;;wBAVtB,GAAG;yBACD,GAAG;wBACJ,GAAG;;;;EAa/B;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;6FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"names":[],"mappings":"AA0CA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC;AAYF,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"names":[],"mappings":"AA0CA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC;AAYF,iBAAS,cAAc;WAkET,OAAO,IAA6B;;yBATrB,GAAG;0BACF,GAAG;;;;EAahC;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as d, createElementBlock as s, openBlock as o, mergeProps as c, unref as
|
|
1
|
+
import { defineComponent as d, createElementBlock as s, openBlock as o, mergeProps as c, unref as n, createVNode as p, createElementVNode as t, createCommentVNode as i, renderSlot as a, createTextVNode as u } from "vue";
|
|
2
2
|
import { ScalarIconMagnifyingGlass as b } from "@scalar/icons";
|
|
3
3
|
import { useBindCx as m } from "@scalar/use-hooks/useBindCx";
|
|
4
4
|
const f = { class: "flex-1 text-left leading-none" }, h = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "uppercase text-sidebar-c-2 bg-b-2 py-
|
|
6
|
+
class: "uppercase text-sidebar-c-2 bg-b-2 leading-none py-1 px-1.25 rounded"
|
|
7
7
|
}, _ = /* @__PURE__ */ d({
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "ScalarSidebarSearchButton",
|
|
@@ -17,21 +17,21 @@ const f = { class: "flex-1 text-left leading-none" }, h = {
|
|
|
17
17
|
type: "button",
|
|
18
18
|
role: "search"
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
n(l)(
|
|
21
21
|
"flex items-center rounded border text-base h-8 gap-1 pl-2 pr-1",
|
|
22
22
|
"bg-sidebar-b-search border-sidebar-border-search text-sidebar-c-search"
|
|
23
23
|
)
|
|
24
24
|
), [
|
|
25
|
-
p(
|
|
25
|
+
p(n(b), { class: "size-4" }),
|
|
26
26
|
t("span", f, [
|
|
27
|
-
|
|
27
|
+
a(r.$slots, "default", {}, () => [
|
|
28
28
|
e[0] || (e[0] = u("Search..."))
|
|
29
29
|
])
|
|
30
30
|
]),
|
|
31
31
|
r.$slots.shortcut ? (o(), s("span", h, [
|
|
32
32
|
e[1] || (e[1] = t("span", { class: "sr-only" }, "Keyboard Shortcut:", -1)),
|
|
33
33
|
t("kbd", null, [
|
|
34
|
-
|
|
34
|
+
a(r.$slots, "shortcut")
|
|
35
35
|
])
|
|
36
36
|
])) : i("", !0)
|
|
37
37
|
], 16));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ScalarSidebarItemProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Section component
|
|
4
|
+
*
|
|
5
|
+
* A section of the sidebar that can contain subitems
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <ScalarSidebarSection>
|
|
9
|
+
* <!-- Section title -->
|
|
10
|
+
* <template #title>
|
|
11
|
+
* My Section
|
|
12
|
+
* </template>
|
|
13
|
+
* <!-- Section items -->
|
|
14
|
+
* <template #items>
|
|
15
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
16
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
17
|
+
* </template>
|
|
18
|
+
* </ScalarSidebarSection>
|
|
19
|
+
*/
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
21
|
+
/** The text content of the toggle */
|
|
22
|
+
default?: () => any;
|
|
23
|
+
/** The list of sidebar subitems */
|
|
24
|
+
items?: () => any;
|
|
25
|
+
}> & {
|
|
26
|
+
/** The text content of the toggle */
|
|
27
|
+
default?: () => any;
|
|
28
|
+
/** The list of sidebar subitems */
|
|
29
|
+
items?: () => any;
|
|
30
|
+
}>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=ScalarSidebarSection.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAKrD;;;;;;;;;;;;;;;;;GAiBG;;IAQD,qCAAqC;cAC3B,MAAM,GAAG;IACnB,mCAAmC;YAC3B,MAAM,GAAG;;IAHjB,qCAAqC;cAC3B,MAAM,GAAG;IACnB,mCAAmC;YAC3B,MAAM,GAAG;;AAVnB,wBAsHC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SidebarGroupLevel } from './useSidebarGroups.js';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Spacer component
|
|
4
|
+
*
|
|
5
|
+
* Provide a styled spacer for the ScalarSidebar, handles the indent lines for nested groups
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <ScalarSidebarSpacer />
|
|
11
|
+
*/
|
|
12
|
+
declare const _default: import("vue").DefineComponent<{
|
|
13
|
+
indent: SidebarGroupLevel;
|
|
14
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
+
indent: SidebarGroupLevel;
|
|
16
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=ScalarSidebarSpacer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSpacer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSpacer.vue"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;;;;;GASG;;YAG0B,iBAAiB;;YAAjB,iBAAiB;;AAF9C,wBA2EC"}
|