@scalar/components 0.12.61 → 0.12.63
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/ScalarCodeBlock/ScalarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +28 -21
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +39 -31
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +16 -8
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts.map +1 -1
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts +8 -3
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts.map +1 -1
- package/dist/components/ScalarIcon/ScalarIcon.vue.js +3 -3
- package/dist/components/ScalarIcon/ScalarIcon.vue2.js +18 -14
- package/dist/components/ScalarIcon/icons/index.d.ts +1 -8
- package/dist/components/ScalarIcon/icons/index.d.ts.map +1 -1
- package/dist/components/ScalarIcon/index.d.ts +1 -1
- package/dist/components/ScalarIcon/logos/Adonisjs.svg.js +21 -0
- package/dist/components/ScalarIcon/logos/Docusaurus.svg.js +16 -0
- package/dist/components/ScalarIcon/logos/Dotnet.svg.js +23 -0
- package/dist/components/ScalarIcon/logos/Elysiajs.svg.js +16 -0
- package/dist/components/ScalarIcon/logos/Express.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Fastapi.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Fastify.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Go.svg.js +23 -0
- package/dist/components/ScalarIcon/logos/Hono.svg.js +24 -0
- package/dist/components/ScalarIcon/logos/Laravel.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Litestar.svg.js +16 -0
- package/dist/components/ScalarIcon/logos/Nestjs.svg.js +21 -0
- package/dist/components/ScalarIcon/logos/Nextjs.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Nitro.svg.js +16 -0
- package/dist/components/ScalarIcon/logos/Nuxt.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Openapi.svg.js +16 -0
- package/dist/components/ScalarIcon/logos/Platformatic.svg.js +28 -0
- package/dist/components/ScalarIcon/logos/React.svg.js +34 -0
- package/dist/components/ScalarIcon/logos/Rust.svg.js +19 -0
- package/dist/components/ScalarIcon/logos/Vue.svg.js +23 -0
- package/dist/components/ScalarIcon/logos/index.d.ts +2 -0
- package/dist/components/ScalarIcon/logos/index.d.ts.map +1 -0
- package/dist/components/ScalarIcon/utils/index.d.ts +17 -0
- package/dist/components/ScalarIcon/utils/index.d.ts.map +1 -0
- package/dist/components/ScalarIcon/utils/index.js +283 -0
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +56 -50
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts +3 -3
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +2 -2
- 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 +28 -25
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +5 -83
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue2.js +83 -2
- package/dist/components/ScalarTooltip/ScalarTooltip.stories.d.ts +24 -0
- package/dist/components/ScalarTooltip/ScalarTooltip.stories.d.ts.map +1 -1
- package/dist/components/ScalarTooltip/ScalarTooltip.vue.d.ts +3 -0
- package/dist/components/ScalarTooltip/ScalarTooltip.vue.d.ts.map +1 -1
- package/dist/components/ScalarTooltip/ScalarTooltip.vue.js +19 -17
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/components/ScalarIcon/icons/icons.d.ts +0 -2
- package/dist/components/ScalarIcon/icons/icons.d.ts.map +0 -1
- package/dist/components/ScalarIcon/icons/index.js +0 -238
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, openBlock as r, createBlock as u, unref as t, normalizeClass as i, withCtx as s, createTextVNode as x, toDisplayString as m, createCommentVNode as g, createVNode as n, createElementVNode as a, mergeProps as y, createElementBlock as h, Fragment as V, renderList as k, renderSlot as B } from "vue";
|
|
2
2
|
import { Listbox as z, ListboxLabel as L, ListboxOptions as w, ListboxOption as O, ListboxButton as C } from "@headlessui/vue";
|
|
3
3
|
import { cva as S, cx as N } from "../../cva.js";
|
|
4
4
|
import $ from "../ScalarFloating/ScalarFloating.vue.js";
|
|
5
5
|
import j from "../ScalarIcon/ScalarIcon.vue.js";
|
|
6
|
-
const
|
|
6
|
+
const E = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ v({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarListbox",
|
|
9
9
|
props: {
|
|
@@ -19,7 +19,7 @@ const P = /* @__PURE__ */ y({
|
|
|
19
19
|
teleport: { type: [Boolean, String] }
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue"],
|
|
22
|
-
setup(
|
|
22
|
+
setup(W) {
|
|
23
23
|
const c = S({
|
|
24
24
|
base: [
|
|
25
25
|
// Layout
|
|
@@ -37,79 +37,85 @@ const P = /* @__PURE__ */ y({
|
|
|
37
37
|
disabled: { true: "pointer-events-none opacity-50" }
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
return (e,
|
|
40
|
+
return (e, o) => (r(), u(t(z), {
|
|
41
41
|
as: "div",
|
|
42
|
-
class:
|
|
42
|
+
class: i([{ "w-full": e.fullWidth }, "text-sm"]),
|
|
43
43
|
modelValue: e.modelValue,
|
|
44
44
|
multiple: e.multiple,
|
|
45
|
-
"onUpdate:modelValue":
|
|
45
|
+
"onUpdate:modelValue": o[0] || (o[0] = (d) => e.$emit("update:modelValue", d))
|
|
46
46
|
}, {
|
|
47
47
|
default: s(({ open: d }) => [
|
|
48
|
-
e.label ? (
|
|
48
|
+
e.label ? (r(), u(t(L), {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "sr-only"
|
|
51
51
|
}, {
|
|
52
52
|
default: s(() => [
|
|
53
|
-
|
|
53
|
+
x(m(e.label), 1)
|
|
54
54
|
]),
|
|
55
55
|
_: 1
|
|
56
|
-
})) :
|
|
57
|
-
|
|
56
|
+
})) : g("", !0),
|
|
57
|
+
n(t($), {
|
|
58
58
|
isOpen: d ?? e.isOpen,
|
|
59
59
|
placement: e.placement ?? "bottom-start",
|
|
60
60
|
resize: e.resize,
|
|
61
61
|
teleport: e.teleport
|
|
62
62
|
}, {
|
|
63
63
|
floating: s(({ width: f }) => [
|
|
64
|
-
|
|
65
|
-
class: "relative flex w-40
|
|
64
|
+
a("div", y(e.$attrs, {
|
|
65
|
+
class: "relative flex max-h-[inherit] w-40 rounded border",
|
|
66
66
|
style: { width: f }
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
67
|
+
}), [
|
|
68
|
+
a("div", E, [
|
|
69
|
+
n(t(w), { class: "flex flex-col p-0.75" }, {
|
|
70
|
+
default: s(() => [
|
|
71
|
+
(r(!0), h(V, null, k(e.options, (l) => (r(), u(t(O), {
|
|
72
|
+
key: l.id,
|
|
73
|
+
as: "template",
|
|
74
|
+
disabled: l.disabled,
|
|
75
|
+
value: l
|
|
76
|
+
}, {
|
|
77
|
+
default: s(({ active: b, selected: p }) => [
|
|
78
|
+
a("li", {
|
|
79
|
+
class: i(
|
|
80
|
+
t(N)(
|
|
81
|
+
t(c)({ active: b, selected: p, disabled: l.disabled })
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
}, [
|
|
85
|
+
a("div", {
|
|
86
|
+
class: i([
|
|
87
|
+
"flex size-4 items-center justify-center rounded-full p-[3px]",
|
|
88
|
+
p ? "bg-c-accent text-b-1" : "text-transparent group-hover/listbox:shadow-border"
|
|
89
|
+
])
|
|
90
|
+
}, [
|
|
91
|
+
n(t(j), {
|
|
92
|
+
class: "relative top-[0.5px] size-2.5",
|
|
93
|
+
icon: "Checkmark",
|
|
94
|
+
thickness: "2.5"
|
|
95
|
+
})
|
|
96
|
+
], 2),
|
|
97
|
+
a("span", {
|
|
98
|
+
class: i(["inline-block min-w-0 flex-1 truncate", l.color ? l.color : "text-c-1"])
|
|
99
|
+
}, m(l.label), 3)
|
|
100
|
+
], 2)
|
|
101
|
+
]),
|
|
102
|
+
_: 2
|
|
103
|
+
}, 1032, ["disabled", "value"]))), 128))
|
|
97
104
|
]),
|
|
98
|
-
_:
|
|
99
|
-
}
|
|
100
|
-
a[1] || (a[1] = n("div", { class: "absolute inset-0 -z-1 rounded bg-b-1 shadow-md brightness-lifted" }, null, -1))
|
|
105
|
+
_: 1
|
|
106
|
+
})
|
|
101
107
|
]),
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
o[1] || (o[1] = a("div", { class: "absolute inset-0 -z-1 rounded bg-b-1 shadow-md brightness-lifted" }, null, -1))
|
|
109
|
+
], 16)
|
|
104
110
|
]),
|
|
105
111
|
default: s(() => [
|
|
106
|
-
|
|
112
|
+
n(t(C), {
|
|
107
113
|
id: e.id,
|
|
108
114
|
as: "template",
|
|
109
115
|
class: "justify-start focus:outline-none focus-visible:ring-1 focus-visible:ring-c-accent"
|
|
110
116
|
}, {
|
|
111
117
|
default: s(() => [
|
|
112
|
-
|
|
118
|
+
B(e.$slots, "default")
|
|
113
119
|
]),
|
|
114
120
|
_: 3
|
|
115
121
|
}, 8, ["id"])
|
|
@@ -122,5 +128,5 @@ const P = /* @__PURE__ */ y({
|
|
|
122
128
|
}
|
|
123
129
|
});
|
|
124
130
|
export {
|
|
125
|
-
|
|
131
|
+
T as default
|
|
126
132
|
};
|
|
@@ -11,7 +11,7 @@ declare const meta: {
|
|
|
11
11
|
bodyClass?: string;
|
|
12
12
|
maxWidth?: string;
|
|
13
13
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs" | undefined;
|
|
14
|
-
variant?: "form" | "search" | "history" | undefined;
|
|
14
|
+
variant?: "form" | "search" | "error" | "history" | undefined;
|
|
15
15
|
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
16
16
|
size: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs";
|
|
17
17
|
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -27,7 +27,7 @@ declare const meta: {
|
|
|
27
27
|
bodyClass?: string;
|
|
28
28
|
maxWidth?: string;
|
|
29
29
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs" | undefined;
|
|
30
|
-
variant?: "form" | "search" | "history" | undefined;
|
|
30
|
+
variant?: "form" | "search" | "error" | "history" | undefined;
|
|
31
31
|
}> & Readonly<{}>, {}, {}, {}, {}, {
|
|
32
32
|
size: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs";
|
|
33
33
|
}>;
|
|
@@ -40,7 +40,7 @@ declare const meta: {
|
|
|
40
40
|
bodyClass?: string;
|
|
41
41
|
maxWidth?: string;
|
|
42
42
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs" | undefined;
|
|
43
|
-
variant?: "form" | "search" | "history" | undefined;
|
|
43
|
+
variant?: "form" | "search" | "error" | "history" | undefined;
|
|
44
44
|
}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
45
45
|
size: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs";
|
|
46
46
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
@@ -10,14 +10,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
10
10
|
bodyClass?: string;
|
|
11
11
|
maxWidth?: string;
|
|
12
12
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs" | undefined;
|
|
13
|
-
variant?: "form" | "search" | "history" | undefined;
|
|
13
|
+
variant?: "form" | "search" | "error" | "history" | undefined;
|
|
14
14
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
15
|
state: ReturnType<typeof useModal>;
|
|
16
16
|
title?: string;
|
|
17
17
|
bodyClass?: string;
|
|
18
18
|
maxWidth?: string;
|
|
19
19
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs" | undefined;
|
|
20
|
-
variant?: "form" | "search" | "history" | undefined;
|
|
20
|
+
variant?: "form" | "search" | "error" | "history" | undefined;
|
|
21
21
|
}> & Readonly<{}>, {
|
|
22
22
|
size: "xs" | "sm" | "md" | "lg" | "xl" | "full" | "xxs";
|
|
23
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarModal/ScalarModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarModal/ScalarModal.vue"],"names":[],"mappings":"AA6OA,+CAA+C;AAC/C,wBAAgB,QAAQ;;;;EAUvB;;WAMU,UAAU,CAAC,OAAO,QAAQ,CAAC;YAC1B,MAAM;gBACF,MAAM;eACP,MAAM;;;;WAHV,UAAU,CAAC,OAAO,QAAQ,CAAC;YAC1B,MAAM;gBACF,MAAM;eACP,MAAM;;;;;;qBAqQS,GAAG;qBACH,GAAG;;AA9QjC,wBA+SK;AAcL,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import o from "./ScalarModal.vue2.js";
|
|
2
|
-
import { useModal as
|
|
2
|
+
import { useModal as s } from "./ScalarModal.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f7e672e8"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
f as default,
|
|
8
|
+
s as useModal
|
|
9
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as v, openBlock as l, createBlock as r, unref as a, withCtx as
|
|
1
|
+
import { defineComponent as v, openBlock as l, createBlock as r, unref as a, withCtx as t, createElementVNode as x, normalizeClass as s, createVNode as i, normalizeStyle as b, createTextVNode as y, toDisplayString as g, createCommentVNode as d, createElementBlock as m, renderSlot as n, reactive as w } from "vue";
|
|
2
2
|
import { Dialog as z, DialogPanel as k, DialogTitle as C, DialogDescription as D } from "@headlessui/vue";
|
|
3
|
-
import { cva as c, cx as
|
|
3
|
+
import { cva as c, cx as f } from "../../cva.js";
|
|
4
4
|
import S from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
5
5
|
const $ = {
|
|
6
6
|
key: 0,
|
|
@@ -28,10 +28,10 @@ const M = /* @__PURE__ */ v({
|
|
|
28
28
|
variant: {}
|
|
29
29
|
},
|
|
30
30
|
setup(N) {
|
|
31
|
-
const
|
|
31
|
+
const p = c({
|
|
32
32
|
base: [
|
|
33
33
|
"scalar-modal",
|
|
34
|
-
"col relative mx-auto mb-0
|
|
34
|
+
"col relative mx-auto mb-0 rounded-lg bg-b-2 p-0 text-left leading-snug text-c-1 opacity-0 md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]"
|
|
35
35
|
].join(" "),
|
|
36
36
|
variants: {
|
|
37
37
|
size: {
|
|
@@ -41,12 +41,13 @@ const M = /* @__PURE__ */ v({
|
|
|
41
41
|
md: "mt-20 max-w-screen-md",
|
|
42
42
|
lg: "m-auto max-w-screen-lg",
|
|
43
43
|
xl: "m-auto max-w-screen-xl",
|
|
44
|
-
full: "full-size-styles mt-0
|
|
44
|
+
full: "full-size-styles mt-0 lg:w-full"
|
|
45
45
|
},
|
|
46
46
|
variant: {
|
|
47
47
|
form: "scalar-modal-form",
|
|
48
48
|
history: "scalar-modal-history bg-b-1",
|
|
49
|
-
search: "scalar-modal-search"
|
|
49
|
+
search: "scalar-modal-search",
|
|
50
|
+
error: "scalar-modal-error"
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}), u = c({
|
|
@@ -58,7 +59,8 @@ const M = /* @__PURE__ */ v({
|
|
|
58
59
|
variant: {
|
|
59
60
|
form: "overflow-visible",
|
|
60
61
|
history: "pt-3",
|
|
61
|
-
search: "col !m-0 max-h-[440px] overflow-hidden p-0"
|
|
62
|
+
search: "col !m-0 max-h-[440px] overflow-hidden p-0",
|
|
63
|
+
error: "overflow-y-scroll"
|
|
62
64
|
},
|
|
63
65
|
size: {
|
|
64
66
|
xxs: "max-h-[calc(100dvh-240px)]",
|
|
@@ -67,19 +69,20 @@ const M = /* @__PURE__ */ v({
|
|
|
67
69
|
md: "max-h-[calc(100dvh-240px)]",
|
|
68
70
|
lg: "max-h-[calc(100dvh-180px)]",
|
|
69
71
|
xl: "m-0 max-h-[calc(100dvh-120px)] p-0",
|
|
70
|
-
full: "max-h-dvh rounded-none
|
|
72
|
+
full: "max-h-dvh rounded-none"
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
});
|
|
74
|
-
return (e,
|
|
76
|
+
return (e, o) => (l(), r(a(z), {
|
|
75
77
|
open: e.state.open,
|
|
76
|
-
onClose:
|
|
78
|
+
onClose: o[1] || (o[1] = (h) => e.state.hide())
|
|
77
79
|
}, {
|
|
78
|
-
default:
|
|
80
|
+
default: t(() => [
|
|
79
81
|
x("div", {
|
|
80
82
|
class: s(
|
|
81
|
-
a(
|
|
82
|
-
"scalar-modal-layout
|
|
83
|
+
a(f)(
|
|
84
|
+
e.size === "full" ? "scalar-modal-layout-full" : "scalar-modal-layout",
|
|
85
|
+
"fixed left-0 top-0 flex items-start justify-center",
|
|
83
86
|
"z-[1001] h-[100dvh] w-[100dvw]",
|
|
84
87
|
"bg-backdrop opacity-0 dark:bg-backdropdark",
|
|
85
88
|
e.size === "full" && "flex"
|
|
@@ -87,42 +90,42 @@ const M = /* @__PURE__ */ v({
|
|
|
87
90
|
)
|
|
88
91
|
}, [
|
|
89
92
|
i(a(k), {
|
|
90
|
-
class: s(a(
|
|
93
|
+
class: s(a(p)({ size: e.size, variant: e.variant })),
|
|
91
94
|
style: b({ maxWidth: e.maxWidth })
|
|
92
95
|
}, {
|
|
93
|
-
default:
|
|
96
|
+
default: t(() => [
|
|
94
97
|
e.title ? (l(), r(a(C), {
|
|
95
98
|
key: 0,
|
|
96
99
|
class: s(["scalar-modal-header m-0 -mb-1 rounded-lg p-3 text-left text-sm font-medium text-c-1", { "pb-0 pt-6": e.variant === "history" }])
|
|
97
100
|
}, {
|
|
98
|
-
default:
|
|
99
|
-
g(
|
|
101
|
+
default: t(() => [
|
|
102
|
+
y(g(e.title), 1)
|
|
100
103
|
]),
|
|
101
104
|
_: 1
|
|
102
105
|
}, 8, ["class"])) : d("", !0),
|
|
103
|
-
e.size === "full" ? (l(),
|
|
106
|
+
e.size === "full" ? (l(), m("div", {
|
|
104
107
|
key: 1,
|
|
105
108
|
class: s(e.bodyClass)
|
|
106
109
|
}, [
|
|
107
|
-
|
|
110
|
+
n(e.$slots, "default", {}, void 0, !0)
|
|
108
111
|
], 2)) : (l(), r(a(D), {
|
|
109
112
|
key: 2,
|
|
110
|
-
class: s(a(
|
|
113
|
+
class: s(a(f)(e.bodyClass, a(u)({ size: e.size, variant: e.variant })))
|
|
111
114
|
}, {
|
|
112
|
-
default:
|
|
113
|
-
|
|
115
|
+
default: t(() => [
|
|
116
|
+
n(e.$slots, "default", {}, void 0, !0)
|
|
114
117
|
]),
|
|
115
118
|
_: 3
|
|
116
119
|
}, 8, ["class"]))
|
|
117
120
|
]),
|
|
118
121
|
_: 3
|
|
119
122
|
}, 8, ["class", "style"]),
|
|
120
|
-
e.size === "full" ? (l(),
|
|
123
|
+
e.size === "full" ? (l(), m("div", $, [
|
|
121
124
|
i(a(S), {
|
|
122
|
-
class: "hover:bg-b-
|
|
125
|
+
class: "hover:bg-b-3 focus:outline-none",
|
|
123
126
|
icon: "Close",
|
|
124
127
|
label: "Clear Search",
|
|
125
|
-
onClose:
|
|
128
|
+
onClose: o[0] || (o[0] = (h) => e.state.hide())
|
|
126
129
|
})
|
|
127
130
|
])) : d("", !0)
|
|
128
131
|
], 2)
|
|
@@ -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":"AA0GA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;;cAKvD,YAAY;iBACT,MAAM;cACT,OAAO;YACT,MAAM;;;;;;;cAHJ,YAAY;iBACT,MAAM;cACT,OAAO;YACT,MAAM;;;;AAwLhB,wBAUG"}
|
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import z from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
6
|
-
const B = ["aria-label", "value"], q = /* @__PURE__ */ b({
|
|
7
|
-
inheritAttrs: !1,
|
|
8
|
-
__name: "ScalarSearchInput",
|
|
9
|
-
props: {
|
|
10
|
-
loading: {},
|
|
11
|
-
modelValue: {},
|
|
12
|
-
sidebar: { type: Boolean },
|
|
13
|
-
label: {}
|
|
14
|
-
},
|
|
15
|
-
emits: ["update:modelValue"],
|
|
16
|
-
setup(I, { expose: d, emit: m }) {
|
|
17
|
-
const t = m, o = h(null);
|
|
18
|
-
function p(e) {
|
|
19
|
-
t("update:modelValue", e.target.value);
|
|
20
|
-
}
|
|
21
|
-
const n = g(() => {
|
|
22
|
-
const { class: e, ...l } = v();
|
|
23
|
-
return { className: e || "", rest: l };
|
|
24
|
-
}), f = y({
|
|
25
|
-
base: "flex items-center rounded border bg-b-1/2 text-sm font-medium has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline",
|
|
26
|
-
variants: {
|
|
27
|
-
sidebar: {
|
|
28
|
-
true: "h-8 gap-1.5 px-1.5",
|
|
29
|
-
false: "h-10 p-3"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return d({
|
|
34
|
-
focus: () => {
|
|
35
|
-
var e;
|
|
36
|
-
(e = o.value) == null || e.focus();
|
|
37
|
-
},
|
|
38
|
-
blur: () => {
|
|
39
|
-
var e;
|
|
40
|
-
(e = o.value) == null || e.blur();
|
|
41
|
-
}
|
|
42
|
-
}), (e, l) => (s(), k("label", {
|
|
43
|
-
class: i(a(c)(a(f)({ sidebar: e.sidebar }), n.value.className))
|
|
44
|
-
}, [
|
|
45
|
-
e.sidebar ? (s(), r(a(C), {
|
|
46
|
-
key: 0,
|
|
47
|
-
class: "text-c-2",
|
|
48
|
-
icon: "Search",
|
|
49
|
-
size: "xs",
|
|
50
|
-
thickness: "2.5"
|
|
51
|
-
})) : u("", !0),
|
|
52
|
-
S("input", V({
|
|
53
|
-
ref_key: "inputRef",
|
|
54
|
-
ref: o
|
|
55
|
-
}, n.value.rest, {
|
|
56
|
-
"aria-label": e.label ?? "Enter search query",
|
|
57
|
-
autocapitalize: "off",
|
|
58
|
-
autocomplete: "off",
|
|
59
|
-
autocorrect: "off",
|
|
60
|
-
class: "flex-1 appearance-none rounded border-none bg-transparent outline-none",
|
|
61
|
-
placeholder: "Search...",
|
|
62
|
-
spellcheck: "false",
|
|
63
|
-
type: "search",
|
|
64
|
-
value: e.modelValue,
|
|
65
|
-
onInput: p
|
|
66
|
-
}), null, 16, B),
|
|
67
|
-
e.loading && e.loading.isLoading ? (s(), r(a(N), {
|
|
68
|
-
key: 1,
|
|
69
|
-
class: "mr-3 self-center",
|
|
70
|
-
loadingState: e.loading,
|
|
71
|
-
size: "md"
|
|
72
|
-
}, null, 8, ["loadingState"])) : e.modelValue ? (s(), r(a(z), {
|
|
73
|
-
key: 2,
|
|
74
|
-
class: i(a(c)("p-0", e.sidebar ? "h-4 w-4" : "h-5 w-5")),
|
|
75
|
-
icon: "Close",
|
|
76
|
-
label: "Clear Search",
|
|
77
|
-
thickness: e.sidebar ? "1.75" : "1.5",
|
|
78
|
-
onClick: l[0] || (l[0] = (E) => t("update:modelValue", ""))
|
|
79
|
-
}, null, 8, ["class", "thickness"])) : u("", !0)
|
|
80
|
-
], 2));
|
|
81
|
-
}
|
|
82
|
-
});
|
|
1
|
+
import a from "./ScalarSearchInput.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const c = /* @__PURE__ */ o(a, [["__scopeId", "data-v-52e35a1d"]]);
|
|
83
5
|
export {
|
|
84
|
-
|
|
6
|
+
c as default
|
|
85
7
|
};
|
|
@@ -1,4 +1,85 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as b, ref as h, computed as g, useAttrs as k, openBlock as s, createElementBlock as v, normalizeClass as i, unref as a, createBlock as o, createCommentVNode as u, createElementVNode as S, mergeProps as V } from "vue";
|
|
2
|
+
import { cva as y, cx as c } from "../../cva.js";
|
|
3
|
+
import C from "../ScalarIcon/ScalarIcon.vue.js";
|
|
4
|
+
import N from "../ScalarLoading/ScalarLoading.vue.js";
|
|
5
|
+
import z from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
6
|
+
const B = ["aria-label", "value"], q = /* @__PURE__ */ b({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "ScalarSearchInput",
|
|
9
|
+
props: {
|
|
10
|
+
loading: {},
|
|
11
|
+
modelValue: {},
|
|
12
|
+
sidebar: { type: Boolean },
|
|
13
|
+
label: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:modelValue"],
|
|
16
|
+
setup(I, { expose: d, emit: m }) {
|
|
17
|
+
const t = m, r = h(null);
|
|
18
|
+
function p(e) {
|
|
19
|
+
t("update:modelValue", e.target.value);
|
|
20
|
+
}
|
|
21
|
+
const n = g(() => {
|
|
22
|
+
const { class: e, ...l } = k();
|
|
23
|
+
return { className: e || "", rest: l };
|
|
24
|
+
}), f = y({
|
|
25
|
+
base: "search-background flex items-center rounded border text-sm font-medium has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline",
|
|
26
|
+
variants: {
|
|
27
|
+
sidebar: {
|
|
28
|
+
true: "h-8 gap-1.5 px-1.5",
|
|
29
|
+
false: "h-10 p-3"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return d({
|
|
34
|
+
focus: () => {
|
|
35
|
+
var e;
|
|
36
|
+
(e = r.value) == null || e.focus();
|
|
37
|
+
},
|
|
38
|
+
blur: () => {
|
|
39
|
+
var e;
|
|
40
|
+
(e = r.value) == null || e.blur();
|
|
41
|
+
}
|
|
42
|
+
}), (e, l) => (s(), v("label", {
|
|
43
|
+
class: i(a(c)(a(f)({ sidebar: e.sidebar }), n.value.className))
|
|
44
|
+
}, [
|
|
45
|
+
e.sidebar ? (s(), o(a(C), {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "text-c-2",
|
|
48
|
+
icon: "Search",
|
|
49
|
+
size: "xs",
|
|
50
|
+
thickness: "2.5"
|
|
51
|
+
})) : u("", !0),
|
|
52
|
+
S("input", V({
|
|
53
|
+
ref_key: "inputRef",
|
|
54
|
+
ref: r
|
|
55
|
+
}, n.value.rest, {
|
|
56
|
+
"aria-label": e.label ?? "Enter search query",
|
|
57
|
+
autocapitalize: "off",
|
|
58
|
+
autocomplete: "off",
|
|
59
|
+
autocorrect: "off",
|
|
60
|
+
class: "flex-1 appearance-none rounded border-none bg-transparent outline-none",
|
|
61
|
+
placeholder: "Search...",
|
|
62
|
+
spellcheck: "false",
|
|
63
|
+
type: "search",
|
|
64
|
+
value: e.modelValue,
|
|
65
|
+
onInput: p
|
|
66
|
+
}), null, 16, B),
|
|
67
|
+
e.loading && e.loading.isLoading ? (s(), o(a(N), {
|
|
68
|
+
key: 1,
|
|
69
|
+
class: "mr-3 self-center",
|
|
70
|
+
loadingState: e.loading,
|
|
71
|
+
size: "md"
|
|
72
|
+
}, null, 8, ["loadingState"])) : e.modelValue ? (s(), o(a(z), {
|
|
73
|
+
key: 2,
|
|
74
|
+
class: i(a(c)("p-0", e.sidebar ? "h-4 w-4" : "h-5 w-5")),
|
|
75
|
+
icon: "Close",
|
|
76
|
+
label: "Clear Search",
|
|
77
|
+
thickness: e.sidebar ? "1.75" : "1.5",
|
|
78
|
+
onClick: l[0] || (l[0] = (E) => t("update:modelValue", ""))
|
|
79
|
+
}, null, 8, ["class", "thickness"])) : u("", !0)
|
|
80
|
+
], 2));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
2
83
|
export {
|
|
3
|
-
|
|
84
|
+
q as default
|
|
4
85
|
};
|