@scalar/components 0.13.19 → 0.13.21
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/ScalarCombobox/ScalarCombobox.stories.d.ts +5 -4
- package/dist/components/ScalarCombobox/ScalarCombobox.stories.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts +4 -4
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +14 -13
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +2 -5
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +37 -26
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts +2 -13
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +34 -30
- package/dist/components/ScalarCombobox/types.d.ts +9 -0
- package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.js +9 -9
- 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 +31 -0
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +63 -0
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue2.js +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.test.d.ts +2 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.test.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +50 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +47 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue2.js +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.d.ts +50 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js +39 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue2.js +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts +27 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +34 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue2.js +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.d.ts +28 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +22 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue2.js +4 -0
- package/dist/components/ScalarSidebar/index.d.ts +5 -0
- package/dist/components/ScalarSidebar/index.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/types.d.ts +25 -0
- package/dist/components/ScalarSidebar/types.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/useSidebarGroups.d.ts +25 -0
- package/dist/components/ScalarSidebar/useSidebarGroups.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/useSidebarGroups.js +11 -0
- package/dist/components/ScalarSidebar/useSidebarGroups.test.d.ts +2 -0
- package/dist/components/ScalarSidebar/useSidebarGroups.test.d.ts.map +1 -0
- package/dist/index.js +95 -85
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Group component
|
|
4
|
+
*
|
|
5
|
+
* A collapsible ScalarSidebarItem that can contain subitems
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <ScalarSidebarGroup v-model="open">
|
|
9
|
+
* <!-- Group toggle text -->
|
|
10
|
+
* <template #items>
|
|
11
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
12
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
13
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
14
|
+
* </template>
|
|
15
|
+
* </ScalarSidebarGroup>
|
|
16
|
+
*/
|
|
17
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
18
|
+
modelValue?: boolean;
|
|
19
|
+
} & {
|
|
20
|
+
is?: Component | string;
|
|
21
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: boolean) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
24
|
+
modelValue?: boolean;
|
|
25
|
+
} & {
|
|
26
|
+
is?: Component | string;
|
|
27
|
+
}> & Readonly<{
|
|
28
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
30
|
+
/** The text content of the toggle */
|
|
31
|
+
default?: () => any;
|
|
32
|
+
/** Override the entire toggle button */
|
|
33
|
+
button?: () => any;
|
|
34
|
+
/** The list of sidebar subitems */
|
|
35
|
+
items?: () => any;
|
|
36
|
+
}> & {
|
|
37
|
+
/** The text content of the toggle */
|
|
38
|
+
default?: () => any;
|
|
39
|
+
/** Override the entire toggle button */
|
|
40
|
+
button?: () => any;
|
|
41
|
+
/** The list of sidebar subitems */
|
|
42
|
+
items?: () => any;
|
|
43
|
+
}>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=ScalarSidebarGroup.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AASpC;;;;;;;;;;;;;;GAcG;;iBAiCU,OAAO;;SA7Bb,SAAS,GAAG,MAAM;;;;iBA6BZ,OAAO;;SA7Bb,SAAS,GAAG,MAAM;;;;IAQvB,qCAAqC;cAC3B,MAAM,GAAG;IACnB,wCAAwC;aAC/B,MAAM,GAAG;IAClB,mCAAmC;YAC3B,MAAM,GAAG;;IALjB,qCAAqC;cAC3B,MAAM,GAAG;IACnB,wCAAwC;aAC/B,MAAM,GAAG;IAClB,mCAAmC;YAC3B,MAAM,GAAG;;AAhBnB,wBAiJC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineComponent as d, mergeModels as p, useModel as c, openBlock as r, createElementBlock as f, renderSlot as t, createVNode as a, unref as s, withCtx as n, createBlock as _, resolveDynamicComponent as v, normalizeProps as C, mergeProps as $, createCommentVNode as k } from "vue";
|
|
2
|
+
import { useBindCx as x } from "../../hooks/useBindCx.js";
|
|
3
|
+
import B from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import V from "./ScalarSidebarGroupToggle.vue.js";
|
|
5
|
+
import { useSidebarGroups as b } from "./useSidebarGroups.js";
|
|
6
|
+
const S = { class: "contents" }, y = {}, w = /* @__PURE__ */ d({
|
|
7
|
+
...y,
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
__name: "ScalarSidebarGroup",
|
|
10
|
+
props: /* @__PURE__ */ p({
|
|
11
|
+
is: { default: "ul" }
|
|
12
|
+
}, {
|
|
13
|
+
modelValue: { type: Boolean },
|
|
14
|
+
modelModifiers: {}
|
|
15
|
+
}),
|
|
16
|
+
emits: ["update:modelValue"],
|
|
17
|
+
setup(i) {
|
|
18
|
+
const e = c(i, "modelValue"), { level: u } = b({ increment: !0 }), { cx: m } = x();
|
|
19
|
+
return (o, l) => (r(), f("li", S, [
|
|
20
|
+
t(o.$slots, "button", { open: e.value }, () => [
|
|
21
|
+
a(B, {
|
|
22
|
+
is: "button",
|
|
23
|
+
"aria-expanded": e.value,
|
|
24
|
+
indent: s(u),
|
|
25
|
+
onClick: l[0] || (l[0] = (M) => e.value = !e.value)
|
|
26
|
+
}, {
|
|
27
|
+
icon: n(() => [
|
|
28
|
+
a(V, { open: e.value }, null, 8, ["open"])
|
|
29
|
+
]),
|
|
30
|
+
default: n(() => [
|
|
31
|
+
t(o.$slots, "default", { open: e.value })
|
|
32
|
+
]),
|
|
33
|
+
_: 3
|
|
34
|
+
}, 8, ["aria-expanded", "indent"])
|
|
35
|
+
]),
|
|
36
|
+
e.value ? (r(), _(v(o.is), C($({ key: 0 }, s(m)("flex flex-col"))), {
|
|
37
|
+
default: n(() => [
|
|
38
|
+
t(o.$slots, "items", { open: e.value })
|
|
39
|
+
]),
|
|
40
|
+
_: 3
|
|
41
|
+
}, 16)) : k("", !0)
|
|
42
|
+
]));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
w as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import { type Icon } from '../ScalarIcon';
|
|
3
|
+
/**
|
|
4
|
+
* Scalar Sidebar Group toggle component
|
|
5
|
+
*
|
|
6
|
+
* Provides the toggle icon for a ScalarSidebarGroup
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ScalarSidebarGroupToggle :open="..." />
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
12
|
+
/** Override the element tag */
|
|
13
|
+
is?: Component | string;
|
|
14
|
+
/** Whether or not the toggle is open */
|
|
15
|
+
open?: boolean;
|
|
16
|
+
/** Overrides the icon */
|
|
17
|
+
icon?: Icon;
|
|
18
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
19
|
+
/** Override the element tag */
|
|
20
|
+
is?: Component | string;
|
|
21
|
+
/** Whether or not the toggle is open */
|
|
22
|
+
open?: boolean;
|
|
23
|
+
/** Overrides the icon */
|
|
24
|
+
icon?: Icon;
|
|
25
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
26
|
+
/** Override the toggle icon */
|
|
27
|
+
default?: (props: {
|
|
28
|
+
open: boolean;
|
|
29
|
+
}) => any;
|
|
30
|
+
/** Override the screen reader label */
|
|
31
|
+
label?: (props: {
|
|
32
|
+
open: boolean;
|
|
33
|
+
}) => any;
|
|
34
|
+
}> & {
|
|
35
|
+
/** Override the toggle icon */
|
|
36
|
+
default?: (props: {
|
|
37
|
+
open: boolean;
|
|
38
|
+
}) => any;
|
|
39
|
+
/** Override the screen reader label */
|
|
40
|
+
label?: (props: {
|
|
41
|
+
open: boolean;
|
|
42
|
+
}) => any;
|
|
43
|
+
}>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=ScalarSidebarGroupToggle.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroupToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroupToggle.vue"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,eAAe,CAAA;AAIrD;;;;;;;GAOG;;IAID,+BAA+B;SAC1B,SAAS,GAAG,MAAM;IACvB,wCAAwC;WACjC,OAAO;IACd,yBAAyB;WAClB,IAAI;;IALX,+BAA+B;SAC1B,SAAS,GAAG,MAAM;IACvB,wCAAwC;WACjC,OAAO;IACd,yBAAyB;WAClB,IAAI;;IAUX,+BAA+B;cACrB,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;IAC3C,uCAAuC;YAC/B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;;IAHzC,+BAA+B;cACrB,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;IAC3C,uCAAuC;YAC/B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;;AArB3C,wBAgHC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as a, openBlock as s, createBlock as p, resolveDynamicComponent as i, mergeProps as l, unref as o, withCtx as u, renderSlot as n, createVNode as d, createElementVNode as f, createTextVNode as c, toDisplayString as m } from "vue";
|
|
2
|
+
import { cva as v } from "../../cva.js";
|
|
3
|
+
import { useBindCx as h } from "../../hooks/useBindCx.js";
|
|
4
|
+
import y from "../ScalarIcon/ScalarIcon.vue.js";
|
|
5
|
+
const C = { class: "sr-only" }, _ = {}, k = /* @__PURE__ */ a({
|
|
6
|
+
..._,
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "ScalarSidebarGroupToggle",
|
|
9
|
+
props: {
|
|
10
|
+
is: { default: "div" },
|
|
11
|
+
open: { type: Boolean, default: !1 },
|
|
12
|
+
icon: { default: "ChevronRight" }
|
|
13
|
+
},
|
|
14
|
+
setup(b) {
|
|
15
|
+
const t = v({
|
|
16
|
+
base: "size-4 -m-px transition-transform duration-100",
|
|
17
|
+
variants: { open: { true: "rotate-90" } },
|
|
18
|
+
defaultVariants: { open: !1 }
|
|
19
|
+
}), { cx: r } = h();
|
|
20
|
+
return (e, g) => (s(), p(i(e.is), l({
|
|
21
|
+
type: e.is === "button" ? "button" : void 0
|
|
22
|
+
}, o(r)(o(t)({ open: e.open }))), {
|
|
23
|
+
default: u(() => [
|
|
24
|
+
n(e.$slots, "default", { open: e.open }, () => [
|
|
25
|
+
d(o(y), { icon: e.icon }, null, 8, ["icon"])
|
|
26
|
+
]),
|
|
27
|
+
f("span", C, [
|
|
28
|
+
n(e.$slots, "label", { open: e.open }, () => [
|
|
29
|
+
c(m(e.open ? "Close" : "Open") + " Group ", 1)
|
|
30
|
+
])
|
|
31
|
+
])
|
|
32
|
+
]),
|
|
33
|
+
_: 3
|
|
34
|
+
}, 16, ["type"]));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
k as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ScalarSidebarItemProps, ScalarSidebarItemSlots } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Item component
|
|
4
|
+
*
|
|
5
|
+
* Provides a ScalarSidebarButton wrapped in an `<li>` to
|
|
6
|
+
* meet accessibility requirements and automatically indents
|
|
7
|
+
* the button based on the level of the sidebar group
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <ScalarSidebarItem>
|
|
11
|
+
* <template #icon>
|
|
12
|
+
* <!-- Overrides the icon slot -->
|
|
13
|
+
* </template>
|
|
14
|
+
* <!-- Button text -->
|
|
15
|
+
* <template #aside>
|
|
16
|
+
* <!-- After the button text -->
|
|
17
|
+
* </template>
|
|
18
|
+
* </ScalarSidebarItem>
|
|
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<ScalarSidebarItemSlots> & ScalarSidebarItemSlots>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=ScalarSidebarItem.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarItem.vue"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;GAiBG;;AACH,wBAuFC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineComponent as r, useSlots as s, openBlock as i, createElementBlock as l, createVNode as a, mergeProps as d, unref as p, createSlots as c, renderList as _, withCtx as f, renderSlot as m } from "vue";
|
|
2
|
+
import { useSidebarGroups as u } from "./useSidebarGroups.js";
|
|
3
|
+
import S from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
const h = { class: "contents" }, B = {}, g = /* @__PURE__ */ r({
|
|
5
|
+
...B,
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "ScalarSidebarItem",
|
|
8
|
+
props: {
|
|
9
|
+
is: {},
|
|
10
|
+
icon: {},
|
|
11
|
+
selected: { type: Boolean },
|
|
12
|
+
disabled: { type: Boolean },
|
|
13
|
+
indent: { default: () => {
|
|
14
|
+
} }
|
|
15
|
+
},
|
|
16
|
+
setup($) {
|
|
17
|
+
const o = s(), { level: n } = u();
|
|
18
|
+
return (e, b) => (i(), l("li", h, [
|
|
19
|
+
a(S, d({ ...e.$attrs, ...e.$props }, {
|
|
20
|
+
indent: e.indent ?? p(n)
|
|
21
|
+
}), c({ _: 2 }, [
|
|
22
|
+
_(o, (k, t) => ({
|
|
23
|
+
name: t,
|
|
24
|
+
fn: f(() => [
|
|
25
|
+
m(e.$slots, t)
|
|
26
|
+
])
|
|
27
|
+
}))
|
|
28
|
+
]), 1040, ["indent"])
|
|
29
|
+
]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
g as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Items component
|
|
4
|
+
*
|
|
5
|
+
* A base container for ScalarSidebarItem(s), renders as
|
|
6
|
+
* a `<ul>` by default to meet accessibility requirements
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ScalarSidebarItems>
|
|
10
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
11
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
12
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
13
|
+
* </ScalarSidebarItems>
|
|
14
|
+
*/
|
|
15
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
16
|
+
is?: Component | string;
|
|
17
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
18
|
+
is?: Component | string;
|
|
19
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
+
default?(_: {}): any;
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=ScalarSidebarItems.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarItems.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAMpC;;;;;;;;;;;;GAYG;;SAII,SAAS,GAAG,MAAM;;SAAlB,SAAS,GAAG,MAAM;;qBA4CI,GAAG;;AA/ChC,wBA+EC;AAWD,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
|
+
import { defineComponent as o, openBlock as r, createBlock as n, resolveDynamicComponent as s, normalizeProps as a, guardReactiveProps as l, unref as i, withCtx as p, renderSlot as c } from "vue";
|
|
2
|
+
import { useBindCx as f } from "../../hooks/useBindCx.js";
|
|
3
|
+
const u = {}, C = /* @__PURE__ */ o({
|
|
4
|
+
...u,
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "ScalarSidebarItems",
|
|
7
|
+
props: {
|
|
8
|
+
is: { default: "ul" }
|
|
9
|
+
},
|
|
10
|
+
setup(m) {
|
|
11
|
+
const { cx: t } = f();
|
|
12
|
+
return (e, _) => (r(), n(s(e.is), a(l(i(t)("flex flex-col p-3"))), {
|
|
13
|
+
default: p(() => [
|
|
14
|
+
c(e.$slots, "default")
|
|
15
|
+
]),
|
|
16
|
+
_: 3
|
|
17
|
+
}, 16));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
C as default
|
|
22
|
+
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
export { default as ScalarSidebar } from './ScalarSidebar.vue.js';
|
|
2
2
|
export { default as ScalarSidebarFooter } from './ScalarSidebarFooter.vue.js';
|
|
3
|
+
export { default as ScalarSidebarButton } from './ScalarSidebarButton.vue.js';
|
|
4
|
+
export { default as ScalarSidebarGroup } from './ScalarSidebarGroup.vue.js';
|
|
5
|
+
export { default as ScalarSidebarGroupToggle } from './ScalarSidebarGroupToggle.vue.js';
|
|
6
|
+
export { default as ScalarSidebarItem } from './ScalarSidebarItem.vue.js';
|
|
7
|
+
export { default as ScalarSidebarItems } from './ScalarSidebarItems.vue.js';
|
|
3
8
|
//# 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"}
|
|
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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { Icon } from '../ScalarIcon';
|
|
3
|
+
import type { SidebarGroupLevel } from './useSidebarGroups.js';
|
|
4
|
+
/** Scalar Sidebar Item Props */
|
|
5
|
+
export type ScalarSidebarItemProps = {
|
|
6
|
+
/** Overrides the rendered element */
|
|
7
|
+
is?: Component | string;
|
|
8
|
+
/** Sets the icon for the item */
|
|
9
|
+
icon?: Icon;
|
|
10
|
+
/** Wether or not the item is selected */
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** The level of the sidebar group */
|
|
14
|
+
indent?: SidebarGroupLevel;
|
|
15
|
+
};
|
|
16
|
+
/** Scalar Sidebar Item Slots */
|
|
17
|
+
export type ScalarSidebarItemSlots = {
|
|
18
|
+
/** The main text content of the button */
|
|
19
|
+
default?: () => any;
|
|
20
|
+
/** Override the icon */
|
|
21
|
+
icon?: () => any;
|
|
22
|
+
/** The content to display to the right of the text content */
|
|
23
|
+
aside?: () => any;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,gCAAgC;AAChC,MAAM,MAAM,sBAAsB,GAAG;IACnC,qCAAqC;IACrC,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACvB,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B,CAAA;AAED,gCAAgC;AAChC,MAAM,MAAM,sBAAsB,GAAG;IACnC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,GAAG,CAAA;IACnB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,CAAA;IAChB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,GAAG,CAAA;CAClB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* The level of the sidebar groups
|
|
4
|
+
*
|
|
5
|
+
* We shouldn't go deeper than 6 levels
|
|
6
|
+
*/
|
|
7
|
+
export type SidebarGroupLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
+
/**
|
|
9
|
+
* Tracks the level of the sidebar groups
|
|
10
|
+
*
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
export declare const SIDEBAR_GROUPS_SYMBOL: InjectionKey<SidebarGroupLevel>;
|
|
14
|
+
/**
|
|
15
|
+
* Get the current level of the sidebar groups
|
|
16
|
+
*
|
|
17
|
+
* Optionally increments the level of the sidebar groups
|
|
18
|
+
*/
|
|
19
|
+
export declare const useSidebarGroups: ({ increment, }?: {
|
|
20
|
+
/** Whether to increment the level of the sidebar groups */
|
|
21
|
+
increment?: boolean;
|
|
22
|
+
}) => {
|
|
23
|
+
level: SidebarGroupLevel;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=useSidebarGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSidebarGroups.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/useSidebarGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,KAAK,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAe,YAAY,CAAC,iBAAiB,CAAC,CAAA;AAEhF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,oBAE1B;IACD,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;;CAQA,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { inject as t, provide as r } from "vue";
|
|
2
|
+
const o = Symbol(), l = ({
|
|
3
|
+
increment: s = !1
|
|
4
|
+
} = {}) => {
|
|
5
|
+
const e = t(o, 0);
|
|
6
|
+
return s && e < 6 ? r(o, e + 1) : r(o, e), { level: e };
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
o as SIDEBAR_GROUPS_SYMBOL,
|
|
10
|
+
l as useSidebarGroups
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSidebarGroups.test.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/useSidebarGroups.test.ts"],"names":[],"mappings":""}
|