@scalar/components 0.14.10 → 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/ScalarIconButton/ScalarIconButton.stories.d.ts +2 -2
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts +2 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +25 -26
- package/dist/components/ScalarSearchInput/ScalarSearchInput.stories.d.ts +28 -40
- package/dist/components/ScalarSearchInput/ScalarSearchInput.stories.d.ts.map +1 -1
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts +23 -10
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +60 -5
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue2.js +2 -86
- package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts +3 -2
- 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 +22 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.js +42 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue2.js +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.test.d.ts +2 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.test.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.d.ts +16 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +69 -0
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue2.js +4 -0
- 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/components/ScalarSidebar/index.d.ts +2 -0
- package/dist/components/ScalarSidebar/index.d.ts.map +1 -1
- package/dist/index.js +141 -136
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue2.js +0 -4
|
@@ -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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
hotKey?: string;
|
|
3
|
+
};
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
attrs: Partial<{}>;
|
|
6
|
+
slots: {
|
|
7
|
+
default?(_: {}): any;
|
|
8
|
+
shortcut?(_: {}): any;
|
|
9
|
+
};
|
|
10
|
+
refs: {};
|
|
11
|
+
rootEl: any;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=ScalarSidebarSearchButton.vue.d.ts.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
import { ScalarIconMagnifyingGlass as b } from "@scalar/icons";
|
|
3
|
+
import { useBindCx as m } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
const f = { class: "flex-1 text-left leading-none" }, h = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "uppercase text-sidebar-c-2 bg-b-2 leading-none py-1 px-1.25 rounded"
|
|
7
|
+
}, _ = /* @__PURE__ */ d({
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "ScalarSidebarSearchButton",
|
|
10
|
+
props: {
|
|
11
|
+
hotKey: {}
|
|
12
|
+
},
|
|
13
|
+
setup(x) {
|
|
14
|
+
const { cx: l } = m();
|
|
15
|
+
return (r, e) => (o(), s("button", c(
|
|
16
|
+
{
|
|
17
|
+
type: "button",
|
|
18
|
+
role: "search"
|
|
19
|
+
},
|
|
20
|
+
n(l)(
|
|
21
|
+
"flex items-center rounded border text-base h-8 gap-1 pl-2 pr-1",
|
|
22
|
+
"bg-sidebar-b-search border-sidebar-border-search text-sidebar-c-search"
|
|
23
|
+
)
|
|
24
|
+
), [
|
|
25
|
+
p(n(b), { class: "size-4" }),
|
|
26
|
+
t("span", f, [
|
|
27
|
+
a(r.$slots, "default", {}, () => [
|
|
28
|
+
e[0] || (e[0] = u("Search..."))
|
|
29
|
+
])
|
|
30
|
+
]),
|
|
31
|
+
r.$slots.shortcut ? (o(), s("span", h, [
|
|
32
|
+
e[1] || (e[1] = t("span", { class: "sr-only" }, "Keyboard Shortcut:", -1)),
|
|
33
|
+
t("kbd", null, [
|
|
34
|
+
a(r.$slots, "shortcut")
|
|
35
|
+
])
|
|
36
|
+
])) : i("", !0)
|
|
37
|
+
], 16));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
_ as default
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchInput.test.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type LoadingState } from '../ScalarLoading';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
autofocus?: boolean;
|
|
4
|
+
loading?: LoadingState;
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = {
|
|
8
|
+
modelValue?: string;
|
|
9
|
+
} & __VLS_Props;
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: string) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=ScalarSidebarSearchInput.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"names":[],"mappings":"AA0EA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAInE,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AA4BF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;;;;;;AAwHhB,wBAOG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent as f, mergeModels as p, ref as m, useModel as b, onMounted as h, createElementBlock as g, openBlock as r, normalizeProps as v, guardReactiveProps as S, unref as a, createVNode as k, withDirectives as x, createBlock as s, createCommentVNode as y, createElementVNode as C, mergeProps as M, vModelText as V, withModifiers as z } from "vue";
|
|
2
|
+
import { ScalarIconMagnifyingGlass as B, ScalarIconX as w } from "@scalar/icons";
|
|
3
|
+
import { useBindCx as E } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import I from "../ScalarLoading/ScalarLoading.vue.js";
|
|
5
|
+
import N from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
6
|
+
const P = ["aria-label"], D = /* @__PURE__ */ f({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "ScalarSidebarSearchInput",
|
|
9
|
+
props: /* @__PURE__ */ p({
|
|
10
|
+
autofocus: { type: Boolean },
|
|
11
|
+
loading: {},
|
|
12
|
+
label: {}
|
|
13
|
+
}, {
|
|
14
|
+
modelValue: {},
|
|
15
|
+
modelModifiers: {}
|
|
16
|
+
}),
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(t) {
|
|
19
|
+
const l = m(null), o = b(t, "modelValue");
|
|
20
|
+
function i() {
|
|
21
|
+
o.value = "", l.value && l.value.focus();
|
|
22
|
+
}
|
|
23
|
+
const { classCx: c, otherAttrs: u } = E();
|
|
24
|
+
return h(() => {
|
|
25
|
+
var e;
|
|
26
|
+
return t.autofocus && ((e = l.value) == null ? void 0 : e.focus());
|
|
27
|
+
}), (e, n) => (r(), g("label", v(S(
|
|
28
|
+
a(c)(
|
|
29
|
+
"flex items-center rounded border text-base has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5",
|
|
30
|
+
"bg-sidebar-b-search border-sidebar-border-search",
|
|
31
|
+
o.value ? "text-c-1" : "text-sidebar-c-search"
|
|
32
|
+
)
|
|
33
|
+
)), [
|
|
34
|
+
k(a(B), { class: "text-sidebar-c-search size-4" }),
|
|
35
|
+
x(C("input", M({
|
|
36
|
+
ref_key: "inputRef",
|
|
37
|
+
ref: l,
|
|
38
|
+
"aria-label": e.label ?? "Enter search query",
|
|
39
|
+
autocapitalize: "off",
|
|
40
|
+
autocomplete: "off",
|
|
41
|
+
autocorrect: "off",
|
|
42
|
+
class: "flex-1 appearance-none rounded border-none bg-transparent outline-none",
|
|
43
|
+
placeholder: "Search...",
|
|
44
|
+
spellcheck: "false",
|
|
45
|
+
type: "search"
|
|
46
|
+
}, a(u), {
|
|
47
|
+
"onUpdate:modelValue": n[0] || (n[0] = (d) => o.value = d)
|
|
48
|
+
}), null, 16, P), [
|
|
49
|
+
[V, o.value]
|
|
50
|
+
]),
|
|
51
|
+
e.loading && e.loading.isLoading ? (r(), s(a(I), {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "mr-3 self-center",
|
|
54
|
+
loadingState: e.loading,
|
|
55
|
+
size: "md"
|
|
56
|
+
}, null, 8, ["loadingState"])) : o.value ? (r(), s(a(N), {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: "p-0.25 size-4",
|
|
59
|
+
icon: a(w),
|
|
60
|
+
weight: "bold",
|
|
61
|
+
label: "Clear Search",
|
|
62
|
+
onClick: z(i, ["stop", "prevent"])
|
|
63
|
+
}, null, 8, ["icon"])) : y("", !0)
|
|
64
|
+
], 16));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
D as default
|
|
69
|
+
};
|
|
@@ -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"}
|
|
@@ -5,4 +5,6 @@ export { default as ScalarSidebarGroup } from './ScalarSidebarGroup.vue.js';
|
|
|
5
5
|
export { default as ScalarSidebarGroupToggle } from './ScalarSidebarGroupToggle.vue.js';
|
|
6
6
|
export { default as ScalarSidebarItem } from './ScalarSidebarItem.vue.js';
|
|
7
7
|
export { default as ScalarSidebarItems } from './ScalarSidebarItems.vue.js';
|
|
8
|
+
export { default as ScalarSidebarSearchButton } from './ScalarSidebarSearchButton.vue.js';
|
|
9
|
+
export { default as ScalarSidebarSearchInput } from './ScalarSidebarSearchInput.vue.js';
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACpF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACpF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,iCAAiC,CAAA;AACtF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAA"}
|