@scalar/components 0.13.25 → 0.13.26
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/variants.d.ts.map +1 -1
- package/dist/components/ScalarButton/variants.js +2 -8
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.d.ts +1 -1
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.d.ts.map +1 -1
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.js +2 -2
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue2.js +14 -11
- package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
- package/dist/components/ScalarFileUpload/ScalarFileUpload.stories.d.ts.map +1 -1
- package/dist/components/ScalarFileUpload/types.d.ts.map +1 -1
- package/dist/components/ScalarFloating/useResizeWithTarget.d.ts.map +1 -1
- package/dist/components/ScalarFloating/useResizeWithTarget.js +2 -6
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +1 -1
- package/dist/components/ScalarIcon/icons/Markdown.svg.js +19 -0
- package/dist/components/ScalarIcon/icons/NotAllowed.svg.js +21 -0
- package/dist/components/ScalarIcon/icons/index.d.ts +1 -1
- package/dist/components/ScalarIcon/icons/index.d.ts.map +1 -1
- package/dist/components/ScalarIcon/utils/index.js +188 -184
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +6 -6
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts +10 -12
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +3 -5
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.js +4 -4
- package/dist/components/ScalarModal/ScalarModal.vue2.js +42 -47
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +2 -2
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue2.js +34 -31
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +5 -8
- 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 +29 -30
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +23 -6
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +37 -19
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts +20 -0
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +7 -0
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +37 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +8 -8
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +3 -3
- package/dist/components/ScalarSidebar/types.d.ts +2 -0
- package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/useSidebarGroups.d.ts.map +1 -1
- package/dist/components/ScalarVirtualText/ScalarVirtualText.stories.d.ts.map +1 -1
- package/dist/helpers/add-scalar-classes.d.ts.map +1 -1
- package/dist/helpers/add-scalar-classes.js +1 -3
- package/dist/helpers/oas-utils.d.ts.map +1 -1
- package/dist/hooks/useBindCx.stories.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import o from "./ScalarModal.vue2.js";
|
|
2
|
-
import { useModal as
|
|
2
|
+
import { useModal as e } from "./ScalarModal.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-12dc7570"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
p as default,
|
|
8
|
+
e as useModal
|
|
9
9
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as p, openBlock as l, createBlock as r, unref as a, withCtx as o, createElementVNode as x, normalizeClass as t, createVNode as i, normalizeStyle as w, createTextVNode as b, toDisplayString as y, createCommentVNode as m, createElementBlock as n, renderSlot as d, reactive as g } from "vue";
|
|
2
2
|
import { Dialog as z, DialogPanel as k, DialogTitle as C, DialogDescription as D } from "@headlessui/vue";
|
|
3
|
-
import { cva as
|
|
3
|
+
import { cva as f, cx as c } from "../../cva.js";
|
|
4
4
|
import S from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
5
5
|
const $ = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "close-button z-10 fixed right-2 top-2"
|
|
8
8
|
};
|
|
9
9
|
function E() {
|
|
10
|
-
return
|
|
10
|
+
return g({
|
|
11
11
|
open: !1,
|
|
12
12
|
show() {
|
|
13
13
|
this.open = !0;
|
|
@@ -17,7 +17,7 @@ function E() {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
const M = /* @__PURE__ */
|
|
20
|
+
const M = /* @__PURE__ */ p({
|
|
21
21
|
__name: "ScalarModal",
|
|
22
22
|
props: {
|
|
23
23
|
state: {},
|
|
@@ -28,48 +28,43 @@ const M = /* @__PURE__ */ v({
|
|
|
28
28
|
variant: {}
|
|
29
29
|
},
|
|
30
30
|
setup(N) {
|
|
31
|
-
const
|
|
31
|
+
const u = f({
|
|
32
32
|
base: [
|
|
33
33
|
"scalar-modal",
|
|
34
|
-
"col relative mx-auto mb-0 rounded-lg bg-b-1 p-0 text-left leading-snug text-c-1 opacity-0 md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]"
|
|
34
|
+
"flex flex-col relative mx-auto mb-0 rounded-lg bg-b-1 p-0 text-left leading-snug text-c-1 opacity-0 w-[calc(100vw-12px)] md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]"
|
|
35
35
|
].join(" "),
|
|
36
36
|
variants: {
|
|
37
37
|
size: {
|
|
38
|
-
xxs: "mt-
|
|
39
|
-
xs: "mt-
|
|
40
|
-
sm: "mt-
|
|
41
|
-
md: "mt-
|
|
42
|
-
lg: "m-auto max-w-screen-lg",
|
|
43
|
-
xl: "m-auto max-w-screen-xl",
|
|
44
|
-
full: "full-size-styles mt-0 lg:w-full"
|
|
38
|
+
xxs: "mt-[20svh] max-h-[60svh] max-w-screen-xxs",
|
|
39
|
+
xs: "mt-[20svh] max-h-[60svh] max-w-screen-xs",
|
|
40
|
+
sm: "mt-[20svh] max-h-[60svh] max-w-screen-sm",
|
|
41
|
+
md: "mt-[20svh] max-h-[60svh] max-w-screen-md",
|
|
42
|
+
lg: "m-auto max-h-[80svh] max-w-screen-lg",
|
|
43
|
+
xl: "m-auto max-h-[90svh] max-w-screen-xl",
|
|
44
|
+
full: "full-size-styles max-h-dvh mt-0 lg:w-full"
|
|
45
45
|
},
|
|
46
46
|
variant: {
|
|
47
47
|
form: "scalar-modal-form",
|
|
48
|
-
|
|
49
|
-
search: "scalar-modal-search",
|
|
48
|
+
search: "scalar-modal-search mt-[15svh] max-h-[60svh] max-w-[540px]",
|
|
50
49
|
error: "scalar-modal-error"
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
|
-
}),
|
|
54
|
-
base: [
|
|
55
|
-
"scalar-modal-body",
|
|
56
|
-
"relative max-h-[calc(100dvh-240px)] rounded-lg rounded-t-none border-t-1/2 bg-b-1 p-3"
|
|
57
|
-
].join(" "),
|
|
52
|
+
}), v = f({
|
|
53
|
+
base: ["scalar-modal-body", "relative flex-1 min-h-0 p-3"].join(" "),
|
|
58
54
|
variants: {
|
|
59
55
|
variant: {
|
|
60
56
|
form: "overflow-visible",
|
|
61
|
-
|
|
62
|
-
search: "col !m-0 max-h-[440px] overflow-hidden p-0",
|
|
57
|
+
search: "col !m-0 overflow-hidden p-0",
|
|
63
58
|
error: "overflow-y-scroll"
|
|
64
59
|
},
|
|
65
60
|
size: {
|
|
66
|
-
xxs: "
|
|
67
|
-
xs: "
|
|
68
|
-
sm: "
|
|
69
|
-
md: "
|
|
70
|
-
lg: "
|
|
71
|
-
xl: "m-0
|
|
72
|
-
full: "
|
|
61
|
+
xxs: "",
|
|
62
|
+
xs: "",
|
|
63
|
+
sm: "",
|
|
64
|
+
md: "",
|
|
65
|
+
lg: "",
|
|
66
|
+
xl: "m-0 p-0",
|
|
67
|
+
full: " rounded-none"
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
70
|
});
|
|
@@ -77,10 +72,10 @@ const M = /* @__PURE__ */ v({
|
|
|
77
72
|
open: e.state.open,
|
|
78
73
|
onClose: s[1] || (s[1] = (h) => e.state.hide())
|
|
79
74
|
}, {
|
|
80
|
-
default:
|
|
75
|
+
default: o(() => [
|
|
81
76
|
x("div", {
|
|
82
|
-
class:
|
|
83
|
-
a(
|
|
77
|
+
class: t(
|
|
78
|
+
a(c)(
|
|
84
79
|
e.size === "full" ? "scalar-modal-layout-full" : "scalar-modal-layout",
|
|
85
80
|
"fixed left-0 top-0 flex items-start justify-center",
|
|
86
81
|
"z-[1001] h-[100dvh] w-[100dvw]",
|
|
@@ -90,44 +85,44 @@ const M = /* @__PURE__ */ v({
|
|
|
90
85
|
)
|
|
91
86
|
}, [
|
|
92
87
|
i(a(k), {
|
|
93
|
-
class:
|
|
94
|
-
style:
|
|
88
|
+
class: t(a(u)({ size: e.size, variant: e.variant })),
|
|
89
|
+
style: w({ maxWidth: e.maxWidth })
|
|
95
90
|
}, {
|
|
96
|
-
default:
|
|
91
|
+
default: o(() => [
|
|
97
92
|
e.title ? (l(), r(a(C), {
|
|
98
93
|
key: 0,
|
|
99
|
-
class:
|
|
94
|
+
class: "scalar-modal-header m-0 -mb-1 rounded-lg pt-3 px-3 text-left text-sm font-medium text-c-1"
|
|
100
95
|
}, {
|
|
101
|
-
default:
|
|
102
|
-
y(
|
|
96
|
+
default: o(() => [
|
|
97
|
+
b(y(e.title), 1)
|
|
103
98
|
]),
|
|
104
99
|
_: 1
|
|
105
|
-
}
|
|
106
|
-
e.size === "full" ? (l(),
|
|
100
|
+
})) : m("", !0),
|
|
101
|
+
e.size === "full" ? (l(), n("div", {
|
|
107
102
|
key: 1,
|
|
108
|
-
class:
|
|
103
|
+
class: t(e.bodyClass)
|
|
109
104
|
}, [
|
|
110
|
-
|
|
105
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
111
106
|
], 2)) : (l(), r(a(D), {
|
|
112
107
|
key: 2,
|
|
113
|
-
class:
|
|
108
|
+
class: t(a(c)(a(v)({ size: e.size, variant: e.variant }), e.bodyClass))
|
|
114
109
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
|
|
110
|
+
default: o(() => [
|
|
111
|
+
d(e.$slots, "default", {}, void 0, !0)
|
|
117
112
|
]),
|
|
118
113
|
_: 3
|
|
119
114
|
}, 8, ["class"]))
|
|
120
115
|
]),
|
|
121
116
|
_: 3
|
|
122
117
|
}, 8, ["class", "style"]),
|
|
123
|
-
e.size === "full" ? (l(),
|
|
118
|
+
e.size === "full" ? (l(), n("div", $, [
|
|
124
119
|
i(a(S), {
|
|
125
120
|
class: "hover:bg-b-3 focus:outline-none",
|
|
126
121
|
icon: "Close",
|
|
127
122
|
label: "Clear Search",
|
|
128
123
|
onClose: s[0] || (s[0] = (h) => e.state.hide())
|
|
129
124
|
})
|
|
130
|
-
])) :
|
|
125
|
+
])) : m("", !0)
|
|
131
126
|
], 2)
|
|
132
127
|
]),
|
|
133
128
|
_: 3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchInput/ScalarSearchInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchInput/ScalarSearchInput.vue"],"names":[],"mappings":"AAgHA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAInE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;AA4KF,wBAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ScalarSearchInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-080483f0"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cva as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as h, ref as v, computed as g, useAttrs as k, openBlock as s, createElementBlock as S, normalizeClass as i, unref as a, createBlock as o, createCommentVNode as c, createElementVNode as V, mergeProps as y, withModifiers as C } from "vue";
|
|
2
|
+
import { cva as z, cx as u } from "../../cva.js";
|
|
3
|
+
import B from "../ScalarIcon/ScalarIcon.vue.js";
|
|
4
|
+
import I from "../ScalarLoading/ScalarLoading.vue.js";
|
|
5
|
+
import w from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
6
|
+
const E = ["aria-label", "value"], M = /* @__PURE__ */ h({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarSearchInput",
|
|
9
9
|
props: {
|
|
@@ -13,15 +13,18 @@ const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
|
|
|
13
13
|
label: {}
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:modelValue"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
|
|
16
|
+
setup(N, { expose: d, emit: p }) {
|
|
17
|
+
const r = p, l = v(null);
|
|
18
|
+
function m(e) {
|
|
19
|
+
r("update:modelValue", e.target.value);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function f() {
|
|
22
|
+
r("update:modelValue", ""), l.value && l.value.focus();
|
|
23
|
+
}
|
|
24
|
+
const t = g(() => {
|
|
25
|
+
const { class: e, ...n } = k();
|
|
26
|
+
return { class: e || "", rest: n };
|
|
27
|
+
}), b = z({
|
|
25
28
|
base: "search-background flex items-center rounded border text-sm font-medium has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline",
|
|
26
29
|
variants: {
|
|
27
30
|
sidebar: {
|
|
@@ -33,26 +36,26 @@ const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
|
|
|
33
36
|
return d({
|
|
34
37
|
focus: () => {
|
|
35
38
|
var e;
|
|
36
|
-
(e =
|
|
39
|
+
(e = l.value) == null || e.focus();
|
|
37
40
|
},
|
|
38
41
|
blur: () => {
|
|
39
42
|
var e;
|
|
40
|
-
(e =
|
|
43
|
+
(e = l.value) == null || e.blur();
|
|
41
44
|
}
|
|
42
|
-
}), (e,
|
|
43
|
-
class: i(a(
|
|
45
|
+
}), (e, n) => (s(), S("label", {
|
|
46
|
+
class: i(a(u)(a(b)({ sidebar: e.sidebar }), t.value.class))
|
|
44
47
|
}, [
|
|
45
|
-
e.sidebar ? (s(), o(a(
|
|
48
|
+
e.sidebar ? (s(), o(a(B), {
|
|
46
49
|
key: 0,
|
|
47
50
|
class: "text-c-2",
|
|
48
51
|
icon: "Search",
|
|
49
52
|
size: "xs",
|
|
50
53
|
thickness: "2.5"
|
|
51
|
-
})) :
|
|
52
|
-
|
|
54
|
+
})) : c("", !0),
|
|
55
|
+
V("input", y({
|
|
53
56
|
ref_key: "inputRef",
|
|
54
|
-
ref:
|
|
55
|
-
},
|
|
57
|
+
ref: l
|
|
58
|
+
}, t.value.rest, {
|
|
56
59
|
"aria-label": e.label ?? "Enter search query",
|
|
57
60
|
autocapitalize: "off",
|
|
58
61
|
autocomplete: "off",
|
|
@@ -62,24 +65,24 @@ const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
|
|
|
62
65
|
spellcheck: "false",
|
|
63
66
|
type: "search",
|
|
64
67
|
value: e.modelValue,
|
|
65
|
-
onInput:
|
|
66
|
-
}), null, 16,
|
|
67
|
-
e.loading && e.loading.isLoading ? (s(), o(a(
|
|
68
|
+
onInput: m
|
|
69
|
+
}), null, 16, E),
|
|
70
|
+
e.loading && e.loading.isLoading ? (s(), o(a(I), {
|
|
68
71
|
key: 1,
|
|
69
72
|
class: "mr-3 self-center",
|
|
70
73
|
loadingState: e.loading,
|
|
71
74
|
size: "md"
|
|
72
|
-
}, null, 8, ["loadingState"])) : e.modelValue ? (s(), o(a(
|
|
75
|
+
}, null, 8, ["loadingState"])) : e.modelValue ? (s(), o(a(w), {
|
|
73
76
|
key: 2,
|
|
74
|
-
class: i(a(
|
|
77
|
+
class: i(a(u)("p-0", e.sidebar ? "h-4 w-4" : "h-5 w-5")),
|
|
75
78
|
icon: "Close",
|
|
76
79
|
label: "Clear Search",
|
|
77
80
|
thickness: e.sidebar ? "1.75" : "1.5",
|
|
78
|
-
onClick:
|
|
79
|
-
}, null, 8, ["class", "thickness"])) :
|
|
81
|
+
onClick: C(f, ["stop", "prevent"])
|
|
82
|
+
}, null, 8, ["class", "thickness"])) : c("", !0)
|
|
80
83
|
], 2));
|
|
81
84
|
}
|
|
82
85
|
});
|
|
83
86
|
export {
|
|
84
|
-
|
|
87
|
+
M as default
|
|
85
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSearchResultItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSearchResultItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultItem.vue"],"names":[],"mappings":"AA2DA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,eAAe,CAAA;AAIrD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAWF,iBAAS,cAAc;WAiGT,OAAO,IAA6B;;sBAXxB,GAAG;yBACA,GAAG;uBACL,GAAG;6BACG,GAAG;;;;EAanC;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,10 +1,7 @@
|
|
|
1
|
-
import { defineComponent as a, openBlock as t, createElementBlock as s, createElementVNode as o, normalizeProps as d, guardReactiveProps as m, unref as
|
|
1
|
+
import { defineComponent as a, openBlock as t, createElementBlock as s, createElementVNode as o, normalizeProps as d, guardReactiveProps as m, unref as c, renderSlot as n, createBlock as p, createCommentVNode as r } from "vue";
|
|
2
2
|
import { useBindCx as u } from "../../hooks/useBindCx.js";
|
|
3
3
|
import f from "../ScalarIcon/ScalarIcon.vue.js";
|
|
4
|
-
const h = {
|
|
5
|
-
class: "contents",
|
|
6
|
-
role: "option"
|
|
7
|
-
}, v = {
|
|
4
|
+
const h = { class: "contents" }, v = {
|
|
8
5
|
key: 0,
|
|
9
6
|
class: "flex h-fit items-center text-sm font-medium text-c-3 group-hover:text-c-1"
|
|
10
7
|
}, x = { class: "flex min-w-0 flex-1 flex-col gap-0.75" }, _ = { class: "flex items-center gap-1" }, g = { class: "flex-1 truncate text-sm font-medium" }, k = {
|
|
@@ -21,10 +18,10 @@ const h = {
|
|
|
21
18
|
active: { type: Boolean }
|
|
22
19
|
},
|
|
23
20
|
setup($) {
|
|
24
|
-
const { cx:
|
|
21
|
+
const { cx: l } = u();
|
|
25
22
|
return (e, i) => (t(), s("li", h, [
|
|
26
23
|
o("a", d(m(
|
|
27
|
-
l
|
|
24
|
+
c(l)(
|
|
28
25
|
"group flex cursor-pointer gap-2.5 rounded px-3 py-1.5 no-underline hover:bg-b-2",
|
|
29
26
|
{
|
|
30
27
|
"bg-b-2": e.active
|
|
@@ -33,7 +30,7 @@ const h = {
|
|
|
33
30
|
)), [
|
|
34
31
|
e.icon ? (t(), s("div", v, [
|
|
35
32
|
n(e.$slots, "icon", {}, () => [
|
|
36
|
-
e.icon ? (t(), p(
|
|
33
|
+
e.icon ? (t(), p(c(f), {
|
|
37
34
|
key: 0,
|
|
38
35
|
icon: e.icon,
|
|
39
36
|
size: "sm"
|
|
@@ -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;AAUrD,QAAA,MAAM,IAAI,EAAE,
|
|
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;AAUrD,QAAA,MAAM,IAAI,EAAE,IAsBX,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,YAAY,EAAE,KAqC1B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAqF9B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAkBxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;;;;;GAqBG;;AACH,wBA4HC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as r, openBlock as s, createBlock as c, resolveDynamicComponent as u, mergeProps as f, unref as o, withCtx as m, renderSlot as t, createVNode as n, createElementVNode as p, createElementBlock as a, createCommentVNode as l } from "vue";
|
|
2
2
|
import { cva as b } from "../../cva.js";
|
|
3
3
|
import { useBindCx as v } from "../../hooks/useBindCx.js";
|
|
4
|
+
import y from "./ScalarSidebarIndent.vue.js";
|
|
4
5
|
import h from "../ScalarIcon/ScalarIcon.vue.js";
|
|
5
|
-
const
|
|
6
|
+
const B = { class: "flex items-center gap-1 flex-1 py-2 leading-5" }, g = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "size-3.5"
|
|
8
|
-
},
|
|
9
|
-
|
|
9
|
+
}, S = { key: 0 }, $ = {}, w = /* @__PURE__ */ r({
|
|
10
|
+
...$,
|
|
10
11
|
inheritAttrs: !1,
|
|
11
12
|
__name: "ScalarSidebarButton",
|
|
12
13
|
props: {
|
|
@@ -16,48 +17,46 @@ const y = { class: "flex items-center gap-1 flex-1" }, B = {
|
|
|
16
17
|
disabled: { type: Boolean },
|
|
17
18
|
indent: { default: 0 }
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
base: ["rounded
|
|
20
|
+
setup(k) {
|
|
21
|
+
const d = b({
|
|
22
|
+
base: ["group/button flex rounded px-1.5 font-medium text-c-2 no-underline"],
|
|
22
23
|
variants: {
|
|
23
24
|
selected: { true: "cursor-auto bg-b-2 text-c-1" },
|
|
24
|
-
disabled: { true: "cursor-auto" }
|
|
25
|
-
indent: {
|
|
26
|
-
0: "pl-[6px]",
|
|
27
|
-
1: "pl-[24px]",
|
|
28
|
-
2: "pl-[42px]",
|
|
29
|
-
3: "pl-[60px]",
|
|
30
|
-
4: "pl-[78px]",
|
|
31
|
-
5: "pl-[96px]",
|
|
32
|
-
6: "pl-[114px]"
|
|
33
|
-
}
|
|
25
|
+
disabled: { true: "cursor-auto" }
|
|
34
26
|
},
|
|
35
27
|
compoundVariants: [
|
|
36
28
|
{ selected: !1, disabled: !1, class: "hover:bg-b-2" }
|
|
37
29
|
],
|
|
38
|
-
defaultVariants: { selected: !1, disabled: !1
|
|
30
|
+
defaultVariants: { selected: !1, disabled: !1 }
|
|
39
31
|
}), { cx: i } = v();
|
|
40
|
-
return (e,
|
|
32
|
+
return (e, C) => (s(), c(u(e.is), f({
|
|
41
33
|
"aria-level": e.indent,
|
|
34
|
+
"aria-selected": e.selected,
|
|
42
35
|
type: e.is === "button" ? "button" : void 0
|
|
43
|
-
}, o(i)(o(
|
|
44
|
-
default:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
}, o(i)(o(d)({ selected: e.selected, disabled: e.disabled }))), {
|
|
37
|
+
default: m(() => [
|
|
38
|
+
t(e.$slots, "indent", {}, () => [
|
|
39
|
+
n(y, {
|
|
40
|
+
indent: e.indent,
|
|
41
|
+
selected: e.selected
|
|
42
|
+
}, null, 8, ["indent", "selected"])
|
|
43
|
+
]),
|
|
44
|
+
p("div", B, [
|
|
45
|
+
e.icon || e.$slots.icon ? (s(), a("div", g, [
|
|
46
|
+
t(e.$slots, "icon", {}, () => [
|
|
47
|
+
n(o(h), { icon: e.icon }, null, 8, ["icon"])
|
|
49
48
|
])
|
|
50
49
|
])) : l("", !0),
|
|
51
|
-
|
|
50
|
+
t(e.$slots, "default")
|
|
52
51
|
]),
|
|
53
|
-
e.$slots.aside ? (
|
|
54
|
-
|
|
52
|
+
e.$slots.aside ? (s(), a("div", S, [
|
|
53
|
+
t(e.$slots, "aside")
|
|
55
54
|
])) : l("", !0)
|
|
56
55
|
]),
|
|
57
56
|
_: 3
|
|
58
|
-
}, 16, ["aria-level", "type"]));
|
|
57
|
+
}, 16, ["aria-level", "aria-selected", "type"]));
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
60
|
export {
|
|
62
|
-
|
|
61
|
+
w as default
|
|
63
62
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
+
import { type SidebarGroupLevel } from './useSidebarGroups.js';
|
|
2
3
|
/**
|
|
3
4
|
* Scalar Sidebar Group component
|
|
4
5
|
*
|
|
@@ -17,29 +18,45 @@ import type { Component } from 'vue';
|
|
|
17
18
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
18
19
|
modelValue?: boolean;
|
|
19
20
|
} & {
|
|
21
|
+
/** Override the element tag */
|
|
20
22
|
is?: Component | string;
|
|
21
23
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
24
|
"update:modelValue": (value: boolean) => any;
|
|
23
25
|
}, string, import("vue").PublicProps, Readonly<{
|
|
24
26
|
modelValue?: boolean;
|
|
25
27
|
} & {
|
|
28
|
+
/** Override the element tag */
|
|
26
29
|
is?: Component | string;
|
|
27
30
|
}> & Readonly<{
|
|
28
31
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
29
32
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
30
33
|
/** The text content of the toggle */
|
|
31
|
-
default?: (
|
|
34
|
+
default?: (props: {
|
|
35
|
+
open: boolean;
|
|
36
|
+
}) => any;
|
|
32
37
|
/** Override the entire toggle button */
|
|
33
|
-
button?: (
|
|
38
|
+
button?: (props: {
|
|
39
|
+
open: boolean;
|
|
40
|
+
level: SidebarGroupLevel;
|
|
41
|
+
}) => any;
|
|
34
42
|
/** The list of sidebar subitems */
|
|
35
|
-
items?: (
|
|
43
|
+
items?: (props: {
|
|
44
|
+
open: boolean;
|
|
45
|
+
}) => any;
|
|
36
46
|
}> & {
|
|
37
47
|
/** The text content of the toggle */
|
|
38
|
-
default?: (
|
|
48
|
+
default?: (props: {
|
|
49
|
+
open: boolean;
|
|
50
|
+
}) => any;
|
|
39
51
|
/** Override the entire toggle button */
|
|
40
|
-
button?: (
|
|
52
|
+
button?: (props: {
|
|
53
|
+
open: boolean;
|
|
54
|
+
level: SidebarGroupLevel;
|
|
55
|
+
}) => any;
|
|
41
56
|
/** The list of sidebar subitems */
|
|
42
|
-
items?: (
|
|
57
|
+
items?: (props: {
|
|
58
|
+
open: boolean;
|
|
59
|
+
}) => any;
|
|
43
60
|
}>;
|
|
44
61
|
export default _default;
|
|
45
62
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -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":"AAqFA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAMpC,OAAO,EAAE,KAAK,iBAAiB,EAAoB,MAAM,oBAAoB,CAAA;AAI7E;;;;;;;;;;;;;;GAcG;;iBAkCU,OAAO;;IA9BlB,+BAA+B;SAC1B,SAAS,GAAG,MAAM;;;;iBA6BZ,OAAO;;IA9BlB,+BAA+B;SAC1B,SAAS,GAAG,MAAM;;;;IAQvB,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;;AAjB3C,wBAkKC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as d, mergeModels as p, useModel as c, openBlock as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as d, mergeModels as p, useModel as c, openBlock as i, createElementBlock as f, renderSlot as a, unref as t, createVNode as r, withCtx as n, createBlock as v, resolveDynamicComponent as _, normalizeProps as x, mergeProps as b, createCommentVNode as C } from "vue";
|
|
2
|
+
import { useBindCx as S } from "../../hooks/useBindCx.js";
|
|
3
|
+
import $ from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import g from "./ScalarSidebarGroupToggle.vue.js";
|
|
5
|
+
import k from "./ScalarSidebarIndent.vue.js";
|
|
6
|
+
import { useSidebarGroups as B } from "./useSidebarGroups.js";
|
|
7
|
+
const V = { class: "group/item contents" }, y = {}, A = /* @__PURE__ */ d({
|
|
7
8
|
...y,
|
|
8
9
|
inheritAttrs: !1,
|
|
9
10
|
__name: "ScalarSidebarGroup",
|
|
@@ -14,34 +15,51 @@ const S = { class: "contents" }, y = {}, w = /* @__PURE__ */ d({
|
|
|
14
15
|
modelModifiers: {}
|
|
15
16
|
}),
|
|
16
17
|
emits: ["update:modelValue"],
|
|
17
|
-
setup(
|
|
18
|
-
const e = c(
|
|
19
|
-
return (o,
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
setup(u) {
|
|
19
|
+
const e = c(u, "modelValue"), { level: l } = B({ increment: !0 }), { cx: m } = S();
|
|
20
|
+
return (o, s) => (i(), f("li", V, [
|
|
21
|
+
a(o.$slots, "button", {
|
|
22
|
+
level: t(l),
|
|
23
|
+
open: !!e.value
|
|
24
|
+
}, () => [
|
|
25
|
+
r($, {
|
|
22
26
|
is: "button",
|
|
23
27
|
"aria-expanded": e.value,
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
class: "text-c-1 bg-b-1",
|
|
29
|
+
indent: t(l),
|
|
30
|
+
onClick: s[0] || (s[0] = (M) => e.value = !e.value)
|
|
26
31
|
}, {
|
|
32
|
+
indent: n(() => [
|
|
33
|
+
r(k, {
|
|
34
|
+
class: "mr-0",
|
|
35
|
+
indent: t(l)
|
|
36
|
+
}, null, 8, ["indent"])
|
|
37
|
+
]),
|
|
27
38
|
icon: n(() => [
|
|
28
|
-
|
|
39
|
+
r(g, {
|
|
40
|
+
class: "text-c-3",
|
|
41
|
+
open: e.value
|
|
42
|
+
}, null, 8, ["open"])
|
|
29
43
|
]),
|
|
30
44
|
default: n(() => [
|
|
31
|
-
|
|
45
|
+
a(o.$slots, "default", {
|
|
46
|
+
open: !!e.value
|
|
47
|
+
})
|
|
32
48
|
]),
|
|
33
49
|
_: 3
|
|
34
50
|
}, 8, ["aria-expanded", "indent"])
|
|
35
51
|
]),
|
|
36
|
-
e.value ? (
|
|
52
|
+
e.value ? (i(), v(_(o.is), x(b({ key: 0 }, t(m)("flex flex-col gap-px"))), {
|
|
37
53
|
default: n(() => [
|
|
38
|
-
|
|
54
|
+
a(o.$slots, "items", {
|
|
55
|
+
open: !!e.value
|
|
56
|
+
})
|
|
39
57
|
]),
|
|
40
58
|
_: 3
|
|
41
|
-
}, 16)) :
|
|
59
|
+
}, 16)) : C("", !0)
|
|
42
60
|
]));
|
|
43
61
|
}
|
|
44
62
|
});
|
|
45
63
|
export {
|
|
46
|
-
|
|
64
|
+
A as default
|
|
47
65
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SidebarGroupLevel } from './useSidebarGroups.js';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Indent component
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <ScalarSidebarIndent :indent="1" />
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import("vue").DefineComponent<{
|
|
9
|
+
/** The number of indents to render @default 0 */
|
|
10
|
+
indent?: SidebarGroupLevel;
|
|
11
|
+
/** Whether the indent is selected @default false */
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
14
|
+
/** The number of indents to render @default 0 */
|
|
15
|
+
indent?: SidebarGroupLevel;
|
|
16
|
+
/** Whether the indent is selected @default false */
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=ScalarSidebarIndent.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarIndent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarIndent.vue"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;GAKG;;IAID,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;;IAHlB,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;;AANpB,wBAkHC"}
|