@scalar/components 0.0.5 → 0.1.0
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/index.cjs +55 -17
- package/dist/index.d.ts +526 -14
- package/dist/index.js +290 -241
- package/dist/index.umd.cjs +40 -2
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/components/ScalarButton/ScalarButton.spec.d.ts +0 -2
- package/dist/components/ScalarButton/ScalarButton.spec.d.ts.map +0 -1
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts +0 -889
- package/dist/components/ScalarButton/ScalarButton.stories.d.ts.map +0 -1
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts +0 -55
- package/dist/components/ScalarButton/ScalarButton.vue.d.ts.map +0 -1
- package/dist/components/ScalarButton/index.d.ts +0 -2
- package/dist/components/ScalarButton/index.d.ts.map +0 -1
- package/dist/components/ScalarIcon/ScalarIcon.spec.d.ts +0 -2
- package/dist/components/ScalarIcon/ScalarIcon.spec.d.ts.map +0 -1
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +0 -71
- package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts.map +0 -1
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts +0 -17
- package/dist/components/ScalarIcon/ScalarIcon.vue.d.ts.map +0 -1
- package/dist/components/ScalarIcon/SvgRenderer.d.ts +0 -7
- package/dist/components/ScalarIcon/SvgRenderer.d.ts.map +0 -1
- package/dist/components/ScalarIcon/icons/iconNames.d.ts +0 -2
- package/dist/components/ScalarIcon/icons/iconNames.d.ts.map +0 -1
- package/dist/components/ScalarIcon/icons/index.d.ts +0 -4
- package/dist/components/ScalarIcon/icons/index.d.ts.map +0 -1
- package/dist/components/ScalarIcon/index.d.ts +0 -3
- package/dist/components/ScalarIcon/index.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.spec.d.ts +0 -2
- package/dist/components/ScalarIconButton/ScalarIconButton.spec.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +0 -57
- package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts +0 -35
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.d.ts.map +0 -1
- package/dist/components/ScalarIconButton/index.d.ts +0 -2
- package/dist/components/ScalarIconButton/index.d.ts.map +0 -1
- package/dist/components/ScalarLoading/ScalarLoading.spec.d.ts +0 -2
- package/dist/components/ScalarLoading/ScalarLoading.spec.d.ts.map +0 -1
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts +0 -326
- package/dist/components/ScalarLoading/ScalarLoading.stories.d.ts.map +0 -1
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts +0 -48
- package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts.map +0 -1
- package/dist/components/ScalarLoading/index.d.ts +0 -2
- package/dist/components/ScalarLoading/index.d.ts.map +0 -1
- package/dist/components/ScalarModal/ScalarModal.spec.d.ts +0 -2
- package/dist/components/ScalarModal/ScalarModal.spec.d.ts.map +0 -1
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts +0 -202
- package/dist/components/ScalarModal/ScalarModal.stories.d.ts.map +0 -1
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +0 -52
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +0 -1
- package/dist/components/ScalarModal/index.d.ts +0 -2
- package/dist/components/ScalarModal/index.d.ts.map +0 -1
- package/dist/components/ScalarTextField/ScalarTextField.spec.d.ts +0 -2
- package/dist/components/ScalarTextField/ScalarTextField.spec.d.ts.map +0 -1
- package/dist/components/ScalarTextField/ScalarTextField.stories.d.ts +0 -992
- package/dist/components/ScalarTextField/ScalarTextField.stories.d.ts.map +0 -1
- package/dist/components/ScalarTextField/ScalarTextField.vue.d.ts +0 -73
- package/dist/components/ScalarTextField/ScalarTextField.vue.d.ts.map +0 -1
- package/dist/components/ScalarTextField/index.d.ts +0 -2
- package/dist/components/ScalarTextField/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/tailwind/index.d.ts +0 -2
- package/dist/tailwind/index.d.ts.map +0 -1
- package/dist/tailwind/tailwind.theme.d.ts +0 -59
- package/dist/tailwind/tailwind.theme.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { defineConfig as
|
|
3
|
-
import { extendTailwindMerge as
|
|
4
|
-
import { Dialog as
|
|
5
|
-
import { useTextareaAutosize as
|
|
6
|
-
import { nanoid as
|
|
7
|
-
const oe =
|
|
1
|
+
import { defineComponent as g, useCssVars as P, openBlock as l, createElementBlock as d, normalizeClass as i, createElementVNode as h, createCommentVNode as u, createStaticVNode as O, reactive as A, computed as $, useAttrs as V, mergeProps as T, unref as a, renderSlot as x, createVNode as k, defineAsyncComponent as E, h as N, createBlock as C, toDisplayString as y, withCtx as _, normalizeStyle as Z, createTextVNode as W, ref as z, onMounted as R, resolveDynamicComponent as K, withKeys as U } from "vue";
|
|
2
|
+
import { defineConfig as q } from "cva";
|
|
3
|
+
import { extendTailwindMerge as G } from "tailwind-merge";
|
|
4
|
+
import { Dialog as J, DialogPanel as Q, DialogTitle as X, DialogDescription as Y } from "@headlessui/vue";
|
|
5
|
+
import { useTextareaAutosize as ee } from "@vueuse/core";
|
|
6
|
+
import { nanoid as te } from "nanoid";
|
|
7
|
+
const oe = G({}), { cva: m, cx: v, compose: tt } = q({
|
|
8
8
|
hooks: {
|
|
9
|
-
onComplete: (
|
|
9
|
+
onComplete: (o) => `${oe(o)} scalar-reset`
|
|
10
10
|
}
|
|
11
11
|
}), re = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "loader-wrapper"
|
|
14
|
-
},
|
|
14
|
+
}, ae = /* @__PURE__ */ O('<path class="svg-path svg-check-mark" d="m 0 60 l 30 30 l 70 -80" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 -40" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 40" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 -40" data-v-9483a281></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 40" data-v-9483a281></path>', 5), ne = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "circular-loader"
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function ot() {
|
|
19
|
+
return A({
|
|
20
20
|
isValid: !1,
|
|
21
21
|
isInvalid: !1,
|
|
22
22
|
isLoading: !1,
|
|
@@ -26,53 +26,53 @@ function qe() {
|
|
|
26
26
|
stopLoading() {
|
|
27
27
|
this.isLoading = !1;
|
|
28
28
|
},
|
|
29
|
-
validate(
|
|
29
|
+
validate(o = 800) {
|
|
30
30
|
this.isValid = !0;
|
|
31
|
-
const
|
|
31
|
+
const t = o - 300;
|
|
32
32
|
return new Promise(
|
|
33
|
-
(
|
|
33
|
+
(e) => setTimeout(() => this.clear().then(() => e(!0)), t)
|
|
34
34
|
);
|
|
35
35
|
},
|
|
36
|
-
invalidate(
|
|
36
|
+
invalidate(o = 1100) {
|
|
37
37
|
this.isInvalid = !0;
|
|
38
|
-
const
|
|
38
|
+
const t = o - 300;
|
|
39
39
|
return new Promise(
|
|
40
|
-
(
|
|
40
|
+
(e) => setTimeout(() => this.clear().then(() => e(!0)), t)
|
|
41
41
|
);
|
|
42
42
|
},
|
|
43
|
-
clear(
|
|
44
|
-
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((
|
|
43
|
+
clear(o = 300) {
|
|
44
|
+
return this.isValid = !1, this.isInvalid = !1, this.isLoading = !1, new Promise((t) => {
|
|
45
45
|
setTimeout(() => {
|
|
46
|
-
|
|
47
|
-
},
|
|
46
|
+
t(!0);
|
|
47
|
+
}, o);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const le = /* @__PURE__ */ g({
|
|
53
53
|
__name: "ScalarLoading",
|
|
54
54
|
props: {
|
|
55
55
|
loadingState: {},
|
|
56
56
|
size: { default: "24px" }
|
|
57
57
|
},
|
|
58
|
-
setup(
|
|
59
|
-
return
|
|
60
|
-
"68e6c412":
|
|
61
|
-
})), (
|
|
62
|
-
(
|
|
58
|
+
setup(o) {
|
|
59
|
+
return P((t) => ({
|
|
60
|
+
"68e6c412": t.size
|
|
61
|
+
})), (t, e) => t.loadingState ? (l(), d("div", re, [
|
|
62
|
+
(l(), d("svg", {
|
|
63
63
|
class: i(["svg-loader", {
|
|
64
|
-
"icon-is-valid":
|
|
65
|
-
"icon-is-invalid":
|
|
64
|
+
"icon-is-valid": t.loadingState.isValid,
|
|
65
|
+
"icon-is-invalid": t.loadingState.isInvalid
|
|
66
66
|
}]),
|
|
67
67
|
viewBox: "0 0 100 100",
|
|
68
68
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
69
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
70
70
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
ae,
|
|
72
|
+
t.loadingState.isLoading ? (l(), d("g", ne, [
|
|
73
|
+
h("circle", {
|
|
74
74
|
class: i(["loader-path", {
|
|
75
|
-
"loader-path-off":
|
|
75
|
+
"loader-path-off": t.loadingState.isValid || t.loadingState.isInvalid
|
|
76
76
|
}]),
|
|
77
77
|
cx: "50",
|
|
78
78
|
cy: "50",
|
|
@@ -80,143 +80,141 @@ const se = /* @__PURE__ */ p({
|
|
|
80
80
|
r: "20",
|
|
81
81
|
"stroke-width": "2"
|
|
82
82
|
}, null, 2)
|
|
83
|
-
])) :
|
|
83
|
+
])) : u("", !0)
|
|
84
84
|
], 2))
|
|
85
|
-
])) :
|
|
85
|
+
])) : u("", !0);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
for (const [n,
|
|
91
|
-
|
|
92
|
-
return
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
const L = (o, t) => {
|
|
89
|
+
const e = o.__vccOpts || o;
|
|
90
|
+
for (const [n, s] of t)
|
|
91
|
+
e[n] = s;
|
|
92
|
+
return e;
|
|
93
|
+
}, D = /* @__PURE__ */ L(le, [["__scopeId", "data-v-9483a281"]]), F = {
|
|
94
|
+
solid: [
|
|
95
|
+
"scalar-button-solid",
|
|
96
|
+
"bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"
|
|
97
|
+
],
|
|
98
|
+
outlined: [
|
|
99
|
+
"scalar-button-outlined",
|
|
100
|
+
"active:bg-btn-1 border border-solid border-border bg-transparent text-fore-1 hocus:bg-back-2"
|
|
101
|
+
],
|
|
102
|
+
ghost: [
|
|
103
|
+
"scalar-button-ghost",
|
|
104
|
+
"bg-transparent text-fore-3 active:text-fore-2 hocus:text-fore-2"
|
|
105
|
+
],
|
|
106
|
+
danger: [
|
|
107
|
+
"scalar-button-danger",
|
|
108
|
+
"bg-error text-white active:brightness-90 hocus:brightness-90"
|
|
109
|
+
]
|
|
110
|
+
}, se = m({
|
|
111
|
+
base: "scalar-button row cursor-pointer items-center justify-center rounded font-medium",
|
|
98
112
|
variants: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
disabled: {
|
|
114
|
+
true: "bg-background-2 text-color-3 cursor-not-allowed shadow-none"
|
|
115
|
+
},
|
|
116
|
+
fullWidth: { true: "w-full" },
|
|
102
117
|
size: { md: "h-10 px-6 text-sm" },
|
|
103
|
-
variant:
|
|
104
|
-
solid: [
|
|
105
|
-
"scalar-button-solid",
|
|
106
|
-
"bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"
|
|
107
|
-
].join(" "),
|
|
108
|
-
outlined: [
|
|
109
|
-
"scalar-button-outlined",
|
|
110
|
-
"active:bg-btn-1 border border-border bg-transparent text-fore-1 hocus:bg-back-2"
|
|
111
|
-
].join(" "),
|
|
112
|
-
ghost: [
|
|
113
|
-
"scalar-button-ghost",
|
|
114
|
-
"bg-transparent text-fore-3 active:text-fore-2 hocus:text-fore-2"
|
|
115
|
-
].join(" "),
|
|
116
|
-
danger: [
|
|
117
|
-
"scalar-button-danger",
|
|
118
|
-
"bg-error text-white active:brightness-90 hocus:brightness-90"
|
|
119
|
-
].join(" ")
|
|
120
|
-
}
|
|
118
|
+
variant: F
|
|
121
119
|
},
|
|
122
120
|
compoundVariants: [
|
|
123
121
|
{
|
|
124
|
-
|
|
122
|
+
disabled: !0,
|
|
125
123
|
variant: "ghost",
|
|
126
124
|
class: "bg-transparent text-ghost"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
isIconOnly: !0,
|
|
130
|
-
size: "md",
|
|
131
|
-
class: "h-10 w-10 p-2"
|
|
132
125
|
}
|
|
133
126
|
]
|
|
134
|
-
}),
|
|
127
|
+
}), ie = ["ariaDisabled"], de = {
|
|
128
|
+
key: 0,
|
|
129
|
+
class: "mr-2 h-4 w-4"
|
|
130
|
+
}, ce = {
|
|
131
|
+
key: 1,
|
|
132
|
+
class: "ml-2"
|
|
133
|
+
}, ve = /* @__PURE__ */ g({
|
|
134
|
+
inheritAttrs: !1,
|
|
135
135
|
__name: "ScalarButton",
|
|
136
136
|
props: {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
disabled: { type: Boolean },
|
|
138
|
+
fullWidth: { type: Boolean, default: !1 },
|
|
139
|
+
loading: {},
|
|
140
140
|
size: { default: "md" },
|
|
141
|
-
variant: { default: "solid" }
|
|
142
|
-
title: {}
|
|
141
|
+
variant: { default: "solid" }
|
|
143
142
|
},
|
|
144
|
-
setup(
|
|
145
|
-
const
|
|
146
|
-
()
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
l(g)(
|
|
156
|
-
l(ce)({
|
|
157
|
-
isFullWidth: o.isFullWidth,
|
|
158
|
-
isIconOnly: n.value,
|
|
159
|
-
isDisabled: o.isDisabled,
|
|
160
|
-
size: o.size,
|
|
161
|
-
variant: o.variant
|
|
162
|
-
}),
|
|
163
|
-
{ "pl-9 pr-3": o.loadingState }
|
|
164
|
-
)
|
|
143
|
+
setup(o) {
|
|
144
|
+
const t = $(() => {
|
|
145
|
+
const { class: e, ...n } = V();
|
|
146
|
+
return { className: e || "", rest: n };
|
|
147
|
+
});
|
|
148
|
+
return (e, n) => (l(), d("button", T(t.value.rest, {
|
|
149
|
+
ariaDisabled: e.disabled || void 0,
|
|
150
|
+
class: a(v)(
|
|
151
|
+
a(se)({ fullWidth: e.fullWidth, disabled: e.disabled, size: e.size, variant: e.variant }),
|
|
152
|
+
{ "pl-9 pr-3": e.loading },
|
|
153
|
+
`${t.value.className}`
|
|
165
154
|
),
|
|
166
|
-
title: o.title || t.value,
|
|
167
155
|
type: "button"
|
|
168
|
-
}, [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
o.loadingState ? (s(), u("div", de, [
|
|
177
|
-
y(l($), {
|
|
178
|
-
loadingState: o.loadingState,
|
|
156
|
+
}), [
|
|
157
|
+
e.$slots.icon ? (l(), d("div", de, [
|
|
158
|
+
x(e.$slots, "icon")
|
|
159
|
+
])) : u("", !0),
|
|
160
|
+
x(e.$slots, "default"),
|
|
161
|
+
e.loading ? (l(), d("div", ce, [
|
|
162
|
+
k(a(D), {
|
|
163
|
+
loadingState: e.loading,
|
|
179
164
|
size: "20px"
|
|
180
165
|
}, null, 8, ["loadingState"])
|
|
181
|
-
])) :
|
|
182
|
-
],
|
|
166
|
+
])) : u("", !0)
|
|
167
|
+
], 16, ie));
|
|
183
168
|
}
|
|
184
|
-
}), ue = (
|
|
185
|
-
const n = new
|
|
169
|
+
}), ue = (o) => Object.fromEntries(Array.from(o).map((t) => [t.name, t.value])), he = (o) => ({ raw: t }) => {
|
|
170
|
+
const n = new o().parseFromString(t, "image/svg+xml");
|
|
186
171
|
if (n.getElementsByTagName("parsererror").length)
|
|
187
172
|
return;
|
|
188
|
-
const
|
|
189
|
-
return
|
|
190
|
-
},
|
|
191
|
-
const
|
|
192
|
-
return
|
|
173
|
+
const s = n.documentElement, p = ue(s.attributes), { width: f, height: w, ...b } = p;
|
|
174
|
+
return N("svg", { ...b, innerHTML: s.innerHTML });
|
|
175
|
+
}, ge = E(async () => {
|
|
176
|
+
const o = typeof DOMParser > "u" ? (await import("@xmldom/xmldom")).DOMParser : DOMParser, t = he(o);
|
|
177
|
+
return t.props = {
|
|
193
178
|
raw: {
|
|
194
179
|
type: String,
|
|
195
180
|
required: !0
|
|
196
181
|
}
|
|
197
|
-
},
|
|
198
|
-
}),
|
|
182
|
+
}, t;
|
|
183
|
+
}), pe = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
|
199
184
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.429"
|
|
200
185
|
d="M24 1.714v44.572M1.714 24h44.572" />
|
|
201
|
-
</svg>`,
|
|
186
|
+
</svg>`, me = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.5 23.5" fill="currentColor">
|
|
202
187
|
<path d="M11.2 23.5 0 12.3l2.15-2.15 9.05 9.05L30.4 0l2.15 2.15z" />
|
|
203
|
-
</svg>`, pe = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
204
|
-
<path d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
|
205
188
|
</svg>`, fe = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
189
|
+
<path d="m19.5 8.25-7.5 7.5-7.5-7.5" />
|
|
190
|
+
</svg>`, we = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
206
191
|
<path d="M15.75 19.5 8.25 12l7.5-7.5" />
|
|
207
192
|
</svg>`, be = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
208
193
|
<path d="m8.25 4.5 7.5 7.5-7.5 7.5" />
|
|
209
|
-
</svg>`,
|
|
194
|
+
</svg>`, _e = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
210
195
|
<path d="m4.5 15.75 7.5-7.5 7.5 7.5" />
|
|
211
|
-
</svg>`,
|
|
196
|
+
</svg>`, xe = `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 16">
|
|
197
|
+
<path d="M6,5h4c1.7,0,2-1.3,2-3c1.1,0,2,0.9,2,2v10c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V4c0-1.1,0.9-2,2-2C4,3.7,4.3,5,6,5z M6,2V1
|
|
198
|
+
c0-0.6,0.5-1,1-1h2c0.5,0,1,0.4,1,1v1.3C10,2.9,9.6,3,9,3H7C6.4,3,6,2.6,6,2z" />
|
|
199
|
+
</svg>`, ke = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
212
200
|
<path stroke="currentColor" d="m12.5 1.5-11 11m0-11 11 11" />
|
|
213
|
-
</svg>`,
|
|
201
|
+
</svg>`, Ce = `<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
202
|
+
<path
|
|
203
|
+
d="M9.557,7.243A.456.456,0,0,0,9.1,6.991C9.023,7,8.951,7,8.877,7A4,4,0,0,1,5.546.781.5.5,0,0,0,5.564.256.476.476,0,0,0,5.1,0,5,5,0,1,0,9.539,7.767.5.5,0,0,0,9.557,7.243Z"
|
|
204
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
205
|
+
</svg>`, ye = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
214
206
|
<path
|
|
215
207
|
d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
|
|
216
|
-
</svg>`,
|
|
208
|
+
</svg>`, Me = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9">
|
|
209
|
+
<g fill="none" fill-rule="evenodd" transform="translate(.67 .67)">
|
|
210
|
+
<rect transform="rotate(180 4 4)" />
|
|
211
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width=".5"
|
|
212
|
+
d="M2.85 1.73h3.4v3.4m0-3.4L1.74 6.24" />
|
|
213
|
+
</g>
|
|
214
|
+
</svg>`, Le = `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 1024 1024">
|
|
217
215
|
<path
|
|
218
216
|
d="M512 0a512 512 0 0 0-162 998c26 4 35-11 35-25l-1-95c-128 23-161-32-172-60-6-15-31-61-52-73-18-10-44-33-1-33 40-1 69 37 78 52 46 78 120 56 149 43 5-33 18-56 33-69-114-13-234-56-234-253 0-56 20-101 53-137-5-13-23-65 5-136 0 0 43-13 141 53a487 487 0 0 1 256 0c98-66 141-53 141-53 28 71 10 123 5 136 33 36 53 81 53 137 0 197-120 240-234 253 18 16 35 47 35 95l-1 140c0 14 9 30 35 25A512 512 0 0 0 512 0z" />
|
|
219
|
-
</svg>`,
|
|
217
|
+
</svg>`, Se = `<svg
|
|
220
218
|
height="24"
|
|
221
219
|
viewBox="0 0 24 24"
|
|
222
220
|
width="24"
|
|
@@ -225,63 +223,114 @@ const z = (a, e) => {
|
|
|
225
223
|
d="M24 12a1 1 0 0 0 -1 -1h-3.91a0.51 0.51 0 0 1 -0.49 -0.4 6.83 6.83 0 0 0 -0.94 -2.28 0.5 0.5 0 0 1 0.06 -0.63l2.77 -2.76a1 1 0 1 0 -1.42 -1.42l-2.76 2.77a0.5 0.5 0 0 1 -0.63 0.06 6.83 6.83 0 0 0 -2.28 -0.94 0.5 0.5 0 0 1 -0.4 -0.49V1a1 1 0 0 0 -2 0v3.91a0.51 0.51 0 0 1 -0.4 0.49 6.83 6.83 0 0 0 -2.28 0.94 0.5 0.5 0 0 1 -0.63 -0.06L4.93 3.51a1 1 0 0 0 -1.42 1.42l2.77 2.76a0.5 0.5 0 0 1 0.06 0.63 6.83 6.83 0 0 0 -0.94 2.28 0.5 0.5 0 0 1 -0.49 0.4H1a1 1 0 0 0 0 2h3.91a0.51 0.51 0 0 1 0.49 0.4 6.83 6.83 0 0 0 0.94 2.28 0.5 0.5 0 0 1 -0.06 0.63l-2.77 2.76a1 1 0 1 0 1.42 1.42l2.76 -2.77a0.5 0.5 0 0 1 0.63 -0.06 6.83 6.83 0 0 0 2.28 0.94 0.5 0.5 0 0 1 0.4 0.49V23a1 1 0 0 0 2 0v-3.91a0.51 0.51 0 0 1 0.4 -0.49 6.83 6.83 0 0 0 2.28 -0.94 0.5 0.5 0 0 1 0.63 0.06l2.76 2.77a1 1 0 1 0 1.42 -1.42l-2.77 -2.76a0.5 0.5 0 0 1 -0.06 -0.63 6.83 6.83 0 0 0 0.94 -2.28 0.5 0.5 0 0 1 0.49 -0.4H23a1 1 0 0 0 1 -1Zm-8.74 2.5A5.76 5.76 0 0 1 9.5 8.74a5.66 5.66 0 0 1 0.16 -1.31 0.49 0.49 0 0 1 0.34 -0.36 5.36 5.36 0 0 1 1.8 -0.31 5.47 5.47 0 0 1 5.46 5.46 5.36 5.36 0 0 1 -0.31 1.8 0.49 0.49 0 0 1 -0.35 0.32 5.53 5.53 0 0 1 -1.34 0.16Z"
|
|
226
224
|
fill="currentColor"
|
|
227
225
|
stroke-width="1"></path>
|
|
228
|
-
</svg>`,
|
|
226
|
+
</svg>`, ze = `<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
227
|
+
<path d="M3.500 5.000 A1.500 1.500 0 1 0 6.500 5.000 A1.500 1.500 0 1 0 3.500 5.000 Z" fill="currentColor"
|
|
228
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
229
|
+
<path d="M5,2.25a.625.625,0,0,1-.625-.625v-1a.625.625,0,0,1,1.25,0v1A.625.625,0,0,1,5,2.25Z" fill="currentColor"
|
|
230
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
231
|
+
<path d="M6.945,3.055a.623.623,0,0,1,0-.883l.707-.708a.625.625,0,0,1,.884.884l-.708.707A.623.623,0,0,1,6.945,3.055Z"
|
|
232
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
233
|
+
<path d="M7.75,5a.625.625,0,0,1,.625-.625h1a.625.625,0,0,1,0,1.25h-1A.625.625,0,0,1,7.75,5Z" fill="currentColor"
|
|
234
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
235
|
+
<path d="M6.945,6.945a.623.623,0,0,1,.883,0l.708.707a.625.625,0,0,1-.884.884l-.707-.708A.623.623,0,0,1,6.945,6.945Z"
|
|
236
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
237
|
+
<path d="M5,7.75a.625.625,0,0,1,.625.625v1a.625.625,0,0,1-1.25,0v-1A.625.625,0,0,1,5,7.75Z" fill="currentColor"
|
|
238
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
239
|
+
<path
|
|
240
|
+
d="M3.055,6.945a.623.623,0,0,1,0,.883l-.707.708a.625.625,0,0,1-.884-.884l.708-.707A.623.623,0,0,1,3.055,6.945Z"
|
|
241
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
242
|
+
<path d="M2.25,5a.625.625,0,0,1-.625.625h-1a.625.625,0,0,1,0-1.25h1A.625.625,0,0,1,2.25,5Z" fill="currentColor"
|
|
243
|
+
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
244
|
+
<path
|
|
245
|
+
d="M3.055,3.055a.623.623,0,0,1-.883,0l-.708-.707a.625.625,0,0,1,.884-.884l.707.708A.623.623,0,0,1,3.055,3.055Z"
|
|
246
|
+
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
247
|
+
</svg>`, Be = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 593 593">
|
|
229
248
|
<path fill="currentColor" fill-rule="evenodd"
|
|
230
249
|
d="M347 0c6 0 12 5 12 12v134l94-95c5-5 13-5 17 0l72 72c4 4 5 12 0 16v1l-95 94h134c7 0 12 5 12 12v101c0 7-5 12-12 12H447l95 94c4 5 5 13 0 17l-72 72c-4 4-12 5-16 0h-1l-94-95v134c0 7-5 12-12 12H246c-7 0-12-5-12-12v-70c0-22 9-43 24-59l130-130c14-14 14-37 0-51L259 142a84 84 0 0 1-25-59V12c0-7 5-12 12-12h101ZM138 52h1l219 219c14 14 14 37 0 51L139 542c-4 5-12 5-17 0l-71-70c-4-5-5-12 0-17l95-96H12c-7 0-12-5-12-12V246c0-7 5-12 12-12h134l-95-94c-4-5-4-12 0-17l71-71c4-5 12-5 16 0Z" />
|
|
231
|
-
</svg>`,
|
|
250
|
+
</svg>`, Ae = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 662 662">
|
|
232
251
|
<path fill-rule="evenodd" fill="currentColor"
|
|
233
252
|
d="M331 0a331 331 0 1 1 0 662 331 331 0 0 1 0-662Zm148.5 109 .6.9a187 187 0 1 1-297.6-.9 267 267 0 1 0 297 0Z" />
|
|
234
|
-
</svg>`,
|
|
253
|
+
</svg>`, $e = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 620">
|
|
235
254
|
<path fill="currentColor"
|
|
236
255
|
d="M-.653 309.29c-.078 82.272 31.848 159.735 89.739 218.178l.283.283c122.379 121.247 319.824 121.184 440.16-.283 119.967-121.1 119.409-316.933-.998-437.339l-.99-.99C468.681 30.845 390.716-1.017 307.893-.67c-82.83.354-160.443 32.994-218.814 91.79C31.209 149.555-.724 227.025-.653 309.29Zm469.271-160.789.778.778c87.9 87.9 88.325 231.005.707 319.33-77.753 78.46-199.786 87.412-288.959 26.862l198.513-198.513-.007 166.361 83.68-.07v-306.22H157.11l-.008 83.6h160.584L121.994 436.323c-59.347-87.689-50.536-208.59 26.51-286.343C236.34 61.294 379.94 60.67 468.61 148.494Z" />
|
|
237
|
-
</svg>`,
|
|
256
|
+
</svg>`, Ve = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 642 642" fill="currentColor">
|
|
238
257
|
<path
|
|
239
258
|
d="M321 0a321 321 0 1 1 0 642 321 321 0 0 1 0-642Zm51.3 63L321 189.5 269.7 63l1 136.5-95.8-97.2L228 228l-125.7-53.1 97.2 95.8-136.5-1L189.5 321 63 372.3l136.5-1-97.2 95.8 125.7-53-53.1 125.6 95.8-97.2-1 136.5L321 452.5 372.3 579l-1-136.5 95.8 97.2-53-125.7 125.6 53.1-97.2-95.8 136.5 1L452.5 321 579 269.7l-136.5 1 97.2-95.8L414 228l53.1-125.7-95.8 97.2 1-136.5Z" />
|
|
240
|
-
</svg>`,
|
|
259
|
+
</svg>`, Te = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 620" fill="currentColor">
|
|
241
260
|
<path
|
|
242
261
|
d="M529.2 90.8A310 310 0 1 0 90.8 529.2 310 310 0 0 0 529.2 90.8M122.4 498.2c-54.9-55-15.4-183.5 88.2-287 103.6-103.7 232.1-143.2 287-88.3 54.9 54.8 15.4 183.4-88.3 287-103.5 103.6-232 143.1-286.9 88.3m261.8-262.7A104.7 104.7 0 1 1 236 383.7a104.7 104.7 0 0 1 148.2-148.2" />
|
|
243
|
-
</svg>`,
|
|
262
|
+
</svg>`, Ze = `<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 14 14">
|
|
244
263
|
<path fill="none" stroke="currentColor" d="M14 3.4H0m14 7.2H0" />
|
|
264
|
+
</svg>`, De = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
265
|
+
<path fill="currentColor" fill-rule="evenodd"
|
|
266
|
+
d="M11.8214 0.0977942C12.1097 -0.00745677 12.4219 -0.0286524 12.7219 0.0367783C13.0248 0.102864 13.3024 0.254542 13.5216 0.47378C13.7408 0.693018 13.8925 0.970598 13.9586 1.27352C14.024 1.57344 14.0028 1.88572 13.8976 2.17395L10.3236 12.8859L10.3234 12.8866C10.2363 13.1501 10.083 13.3868 9.8781 13.574C9.6738 13.7606 9.42509 13.8918 9.15572 13.9549C8.8863 14.0206 8.60441 14.0151 8.33774 13.9389C8.07131 13.8628 7.82926 13.7187 7.63529 13.5209L5.71795 11.6124L3.70389 12.6538C3.54684 12.7351 3.35857 12.7273 3.20874 12.6334C3.05892 12.5395 2.96981 12.3735 2.9744 12.1967L3.05697 9.013L10.1019 3.8956C10.3812 3.69273 10.4432 3.30188 10.2403 3.02261C10.0374 2.74333 9.64659 2.68139 9.36731 2.88425L2.20283 8.08846L0.473125 6.35875L0.473067 6.3587L0.472941 6.35857C0.285618 6.17138 0.147716 5.9406 0.0716193 5.68694C-0.00393616 5.43509 -0.0162115 5.16853 0.0358379 4.91085C0.0879545 4.62934 0.213796 4.36664 0.400577 4.14957C0.588637 3.93101 0.83165 3.76664 1.1045 3.67345L1.10787 3.6723L1.10787 3.67231L11.8214 0.0977942Z"
|
|
267
|
+
clip-rule="evenodd"></path>
|
|
245
268
|
</svg>`, Fe = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
|
246
269
|
<path fill-rule="evenodd"
|
|
247
270
|
d="M12.6 11.2h.1l3 3a1 1 0 1 1-1.4 1.5l-3-3a1 1 0 0 1-.1-.1 7 7 0 1 1 1.4-1.4zM7 12A5 5 0 1 0 7 2a5 5 0 0 0 0 10z" />
|
|
248
|
-
</svg>`,
|
|
249
|
-
const
|
|
250
|
-
return
|
|
251
|
-
},
|
|
271
|
+
</svg>`, B = /* @__PURE__ */ Object.assign({ "./Add.svg": pe, "./CheckMark.svg": me, "./ChevronDown.svg": fe, "./ChevronLeft.svg": we, "./ChevronRight.svg": be, "./ChevronUp.svg": _e, "./Clipboard.svg": xe, "./Close.svg": ke, "./DarkMode.svg": Ce, "./Ellipses.svg": ye, "./ExternalLink.svg": Me, "./GitHub.svg": Le, "./LightDarkModeToggle.svg": Se, "./LightMode.svg": ze, "./Logo.svg": Be, "./LogoAPI.svg": Ae, "./LogoClient.svg": $e, "./LogoMarket.svg": Ve, "./LogoSwagger.svg": Te, "./Menu.svg": Ze, "./PaperAirplane.svg": De, "./Search.svg": Fe }), je = (o) => {
|
|
272
|
+
const t = `./${o}.svg`;
|
|
273
|
+
return B[t] === void 0 ? (console.warn(`Could not find icon: ${o}`), "") : B[t];
|
|
274
|
+
}, j = /* @__PURE__ */ g({
|
|
252
275
|
__name: "ScalarIcon",
|
|
253
276
|
props: {
|
|
254
|
-
|
|
277
|
+
icon: {},
|
|
278
|
+
size: {}
|
|
255
279
|
},
|
|
256
|
-
setup(
|
|
257
|
-
const
|
|
258
|
-
|
|
280
|
+
setup(o) {
|
|
281
|
+
const t = o, e = m({
|
|
282
|
+
variants: {
|
|
283
|
+
size: {
|
|
284
|
+
xs: "h-3 w-3",
|
|
285
|
+
sm: "h-3.5 w-3.5",
|
|
286
|
+
md: "h-4 w-4",
|
|
287
|
+
lg: "h-5 w-5",
|
|
288
|
+
xl: "h-6 w-6"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}), n = $(() => je(t.icon));
|
|
292
|
+
return (s, p) => n.value ? (l(), C(a(ge), {
|
|
259
293
|
key: 0,
|
|
260
|
-
class: "
|
|
294
|
+
class: i(a(v)("scalar-icon", a(e)({ size: s.size }))),
|
|
261
295
|
height: "100%",
|
|
262
|
-
raw:
|
|
296
|
+
raw: n.value,
|
|
263
297
|
width: "100%"
|
|
264
|
-
}, null, 8, ["raw"])) :
|
|
298
|
+
}, null, 8, ["class", "raw"])) : u("", !0);
|
|
265
299
|
}
|
|
266
|
-
}),
|
|
300
|
+
}), Ie = ["ariaDisabled"], He = { class: "sr-only" }, Pe = /* @__PURE__ */ g({
|
|
267
301
|
__name: "ScalarIconButton",
|
|
268
302
|
props: {
|
|
269
303
|
label: {},
|
|
270
304
|
icon: {},
|
|
271
|
-
|
|
305
|
+
disabled: { type: Boolean },
|
|
306
|
+
variant: { default: "ghost" },
|
|
307
|
+
size: { default: "md" }
|
|
272
308
|
},
|
|
273
|
-
setup(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
309
|
+
setup(o) {
|
|
310
|
+
const t = m({
|
|
311
|
+
base: "scalar-icon-button grid aspect-square cursor-pointer rounded",
|
|
312
|
+
variants: {
|
|
313
|
+
size: {
|
|
314
|
+
xs: "h-3.5 w-3.5 p-0.5",
|
|
315
|
+
sm: "h-5 w-5 p-1",
|
|
316
|
+
md: "h-10 w-10 p-3"
|
|
317
|
+
},
|
|
318
|
+
disabled: {
|
|
319
|
+
true: "cursor-not-allowed shadow-none"
|
|
320
|
+
},
|
|
321
|
+
variant: F
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
return (e, n) => (l(), d("button", {
|
|
325
|
+
ariaDisabled: e.disabled || void 0,
|
|
326
|
+
class: i(a(v)(a(t)({ size: e.size, variant: e.variant, disabled: e.disabled }))),
|
|
327
|
+
type: "button"
|
|
328
|
+
}, [
|
|
329
|
+
k(a(j), { icon: e.icon }, null, 8, ["icon"]),
|
|
330
|
+
h("span", He, y(e.label), 1)
|
|
331
|
+
], 10, Ie));
|
|
283
332
|
}
|
|
284
|
-
}),
|
|
333
|
+
}), Oe = { class: "scalar-modal-layout fixed left-0 top-0 z-[1001] h-[100dvh] w-[100dvw] bg-backdrop p-5 opacity-0" }, rt = () => A({
|
|
285
334
|
open: !1,
|
|
286
335
|
show() {
|
|
287
336
|
this.open = !0;
|
|
@@ -289,7 +338,7 @@ const z = (a, e) => {
|
|
|
289
338
|
hide() {
|
|
290
339
|
this.open = !1;
|
|
291
340
|
}
|
|
292
|
-
}),
|
|
341
|
+
}), Ee = /* @__PURE__ */ g({
|
|
293
342
|
__name: "ScalarModal",
|
|
294
343
|
props: {
|
|
295
344
|
state: {},
|
|
@@ -299,8 +348,8 @@ const z = (a, e) => {
|
|
|
299
348
|
size: { default: "md" },
|
|
300
349
|
variant: {}
|
|
301
350
|
},
|
|
302
|
-
setup(
|
|
303
|
-
const
|
|
351
|
+
setup(o) {
|
|
352
|
+
const t = m({
|
|
304
353
|
base: [
|
|
305
354
|
"scalar-modal",
|
|
306
355
|
"col relative mx-auto mb-0 mt-20 w-full rounded-lg bg-back-2 text-left leading-snug text-fore-1 opacity-0"
|
|
@@ -318,38 +367,38 @@ const z = (a, e) => {
|
|
|
318
367
|
}
|
|
319
368
|
}
|
|
320
369
|
});
|
|
321
|
-
return (
|
|
322
|
-
open:
|
|
323
|
-
onClose: n[0] || (n[0] = (
|
|
370
|
+
return (e, n) => (l(), C(a(J), {
|
|
371
|
+
open: e.state.open,
|
|
372
|
+
onClose: n[0] || (n[0] = (s) => e.state.hide())
|
|
324
373
|
}, {
|
|
325
|
-
default:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
class: i(
|
|
329
|
-
style:
|
|
374
|
+
default: _(() => [
|
|
375
|
+
h("div", Oe, [
|
|
376
|
+
k(a(Q), {
|
|
377
|
+
class: i(a(t)({ size: e.size, variant: e.variant })),
|
|
378
|
+
style: Z({ maxWidth: e.maxWidth })
|
|
330
379
|
}, {
|
|
331
|
-
default:
|
|
332
|
-
|
|
380
|
+
default: _(() => [
|
|
381
|
+
e.title ? (l(), C(a(X), {
|
|
333
382
|
key: 0,
|
|
334
|
-
class: i(["scalar-modal-header font-semiBold m-0 rounded-lg px-6 py-3 text-left text-xs text-fore-1", { "pb-0 pt-6":
|
|
383
|
+
class: i(["scalar-modal-header font-semiBold m-0 rounded-lg px-6 py-3 text-left text-xs text-fore-1", { "pb-0 pt-6": e.variant === "history" }])
|
|
335
384
|
}, {
|
|
336
|
-
default:
|
|
337
|
-
|
|
385
|
+
default: _(() => [
|
|
386
|
+
W(y(e.title), 1)
|
|
338
387
|
]),
|
|
339
388
|
_: 1
|
|
340
|
-
}, 8, ["class"])) :
|
|
341
|
-
|
|
389
|
+
}, 8, ["class"])) : u("", !0),
|
|
390
|
+
k(a(Y), {
|
|
342
391
|
class: i([
|
|
343
|
-
"scalar-modal-body relative max-h-[calc(100dvh-240px)] overflow-y-auto rounded-lg bg-back-1
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
392
|
+
"scalar-modal-body relative max-h-[calc(100dvh-240px)] overflow-y-auto rounded-lg bg-back-1 px-6 pb-4 pt-6",
|
|
393
|
+
a(v)(
|
|
394
|
+
e.bodyClass,
|
|
395
|
+
e.variant === "history" && "pt-3",
|
|
396
|
+
e.variant === "search" && "col max-h-[440px] overflow-hidden p-0"
|
|
348
397
|
)
|
|
349
398
|
])
|
|
350
399
|
}, {
|
|
351
|
-
default:
|
|
352
|
-
x(
|
|
400
|
+
default: _(() => [
|
|
401
|
+
x(e.$slots, "default", {}, void 0, !0)
|
|
353
402
|
]),
|
|
354
403
|
_: 3
|
|
355
404
|
}, 8, ["class"])
|
|
@@ -362,7 +411,7 @@ const z = (a, e) => {
|
|
|
362
411
|
}, 8, ["open"]));
|
|
363
412
|
}
|
|
364
413
|
});
|
|
365
|
-
const
|
|
414
|
+
const Ne = /* @__PURE__ */ L(Ee, [["__scopeId", "data-v-eaa2e0c9"]]), We = { class: "scalar-input-container relative" }, Re = ["for"], Ke = { class: "icon-slot cursor-pointer text-ghost hover:text-fore-1 !empty:flex !empty:w-7 !empty:items-center !empty:pr-3" }, Ue = /* @__PURE__ */ g({
|
|
366
415
|
__name: "ScalarTextField",
|
|
367
416
|
props: {
|
|
368
417
|
modelValue: {},
|
|
@@ -378,48 +427,48 @@ const De = /* @__PURE__ */ z(Ie, [["__scopeId", "data-v-4ee157b1"]]), Oe = { cla
|
|
|
378
427
|
disableTrim: { type: Boolean, default: !1 }
|
|
379
428
|
},
|
|
380
429
|
emits: ["submit", "update:modelValue"],
|
|
381
|
-
setup(
|
|
382
|
-
const
|
|
383
|
-
base: "scalar-input-wrapper relative flex items-center rounded border border-border",
|
|
430
|
+
setup(o, { emit: t }) {
|
|
431
|
+
const e = o, n = m({
|
|
432
|
+
base: "scalar-input-wrapper relative flex items-center rounded border border-solid border-border",
|
|
384
433
|
variants: {
|
|
385
434
|
focus: {
|
|
386
435
|
true: "scalar-input-wrapper-focus border-fore-3 has-actv-btn:border has-actv-btn:border-border"
|
|
387
436
|
},
|
|
388
437
|
error: { true: "scalar-input-wrapper-error border-error" }
|
|
389
438
|
}
|
|
390
|
-
}),
|
|
391
|
-
let
|
|
392
|
-
if (
|
|
393
|
-
const { triggerResize: r } =
|
|
394
|
-
element:
|
|
395
|
-
input:
|
|
439
|
+
}), s = V(), p = s.id || `id-${te()}`, f = z(), w = z(!1);
|
|
440
|
+
let b;
|
|
441
|
+
if (e.isMultiline) {
|
|
442
|
+
const { triggerResize: r } = ee({
|
|
443
|
+
element: f,
|
|
444
|
+
input: e.modelValue
|
|
396
445
|
});
|
|
397
|
-
|
|
446
|
+
b = r;
|
|
398
447
|
}
|
|
399
|
-
function
|
|
448
|
+
function I(r) {
|
|
400
449
|
const c = r.target.value;
|
|
401
|
-
|
|
450
|
+
e.isMultiline && b(), e.handleFieldChange ? e.handleFieldChange(c) : t("update:modelValue", c);
|
|
402
451
|
}
|
|
403
|
-
function
|
|
404
|
-
const c = r.target,
|
|
405
|
-
|
|
452
|
+
function S(r) {
|
|
453
|
+
const c = r.target, M = e.disableTrim || e.isMultiline ? c.value : c.value.trim();
|
|
454
|
+
e.handleFieldSubmit ? e.handleFieldSubmit(M) : t("submit", M);
|
|
406
455
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
456
|
+
function H(r) {
|
|
457
|
+
w.value = !1, e.emitOnBlur && e.modelValue && S(r);
|
|
409
458
|
}
|
|
410
|
-
return
|
|
459
|
+
return R(() => {
|
|
411
460
|
var r;
|
|
412
|
-
Object.prototype.hasOwnProperty.call(
|
|
413
|
-
}), (r, c) => (
|
|
414
|
-
|
|
415
|
-
class: i(
|
|
461
|
+
Object.prototype.hasOwnProperty.call(s, "autofocus") && ((r = f.value) == null || r.focus());
|
|
462
|
+
}), (r, c) => (l(), d("div", We, [
|
|
463
|
+
h("div", {
|
|
464
|
+
class: i(a(n)({ error: r.error, focus: w.value }))
|
|
416
465
|
}, [
|
|
417
|
-
(
|
|
466
|
+
(l(), C(K(r.isMultiline ? "textarea" : "input"), T({ id: a(p) }, r.$attrs, {
|
|
418
467
|
ref_key: "input",
|
|
419
|
-
ref:
|
|
468
|
+
ref: f,
|
|
420
469
|
class: [
|
|
421
470
|
"scalar-input",
|
|
422
|
-
|
|
471
|
+
a(v)(
|
|
423
472
|
{ "min-h-[77px]": r.isMultiline },
|
|
424
473
|
"z-10 w-full resize-none appearance-none border-0 bg-transparent p-3 text-sm text-fore-1",
|
|
425
474
|
"outline-none transition-opacity"
|
|
@@ -427,43 +476,43 @@ const De = /* @__PURE__ */ z(Ie, [["__scopeId", "data-v-4ee157b1"]]), Oe = { cla
|
|
|
427
476
|
],
|
|
428
477
|
placeholder: r.placeholder,
|
|
429
478
|
value: r.modelValue,
|
|
430
|
-
onBlur:
|
|
431
|
-
onFocus: c[0] || (c[0] = (
|
|
432
|
-
onInput:
|
|
433
|
-
onKeyup:
|
|
479
|
+
onBlur: H,
|
|
480
|
+
onFocus: c[0] || (c[0] = (M) => w.value = !0),
|
|
481
|
+
onInput: I,
|
|
482
|
+
onKeyup: U(S, ["enter"])
|
|
434
483
|
}), null, 16, ["id", "class", "placeholder", "value", "onKeyup"])),
|
|
435
|
-
r.label ? (
|
|
484
|
+
r.label ? (l(), d("label", {
|
|
436
485
|
key: 0,
|
|
437
486
|
class: i(
|
|
438
|
-
|
|
487
|
+
a(v)(
|
|
439
488
|
"scalar-input-label pointer-events-none absolute left-0 top-0 mx-2 my-3 px-1 text-xs",
|
|
440
489
|
"shadow-current z-10 origin-top-left rounded text-fore-3 transition-transform"
|
|
441
490
|
)
|
|
442
491
|
),
|
|
443
|
-
for:
|
|
444
|
-
style:
|
|
492
|
+
for: a(p),
|
|
493
|
+
style: Z({
|
|
445
494
|
"box-shadow": `0 0 4px 4px ${r.labelShadowColor}`,
|
|
446
495
|
"background-color": r.labelShadowColor
|
|
447
496
|
})
|
|
448
|
-
},
|
|
449
|
-
|
|
497
|
+
}, y(r.label), 15, Re)) : u("", !0),
|
|
498
|
+
h("div", Ke, [
|
|
450
499
|
x(r.$slots, "default", {}, void 0, !0)
|
|
451
500
|
])
|
|
452
501
|
], 2),
|
|
453
|
-
|
|
502
|
+
h("span", {
|
|
454
503
|
class: i(
|
|
455
|
-
|
|
504
|
+
a(v)(
|
|
456
505
|
"helper-text mt-1.5 flex items-center text-xs text-error before:rounded-full before:font-black",
|
|
457
506
|
"before:mr-1.5 before:block before:h-4 before:w-4 before:text-center before:text-xxs before:leading-4",
|
|
458
507
|
"before:bg-error before:text-white before:content-['!'] empty:hidden"
|
|
459
508
|
)
|
|
460
509
|
)
|
|
461
|
-
},
|
|
510
|
+
}, y(r.helperText), 3)
|
|
462
511
|
]));
|
|
463
512
|
}
|
|
464
513
|
});
|
|
465
|
-
const
|
|
466
|
-
const
|
|
514
|
+
const qe = /* @__PURE__ */ L(Ue, [["__scopeId", "data-v-c047336e"]]);
|
|
515
|
+
const at = {
|
|
467
516
|
boxShadow: {
|
|
468
517
|
DEFAULT: "var(--theme-shadow-1, var(--default-theme-shadow-1))",
|
|
469
518
|
md: "var(--theme-shadow-2, var(--default-theme-shadow-2))",
|
|
@@ -495,7 +544,7 @@ const Je = {
|
|
|
495
544
|
ghost: "var(--theme-color-ghost, var(--default-theme-color-ghost))",
|
|
496
545
|
transparent: "transparent"
|
|
497
546
|
}
|
|
498
|
-
},
|
|
547
|
+
}, nt = {
|
|
499
548
|
borderRadius: {
|
|
500
549
|
DEFAULT: "var(--theme-radius, var(--default-theme-radius))",
|
|
501
550
|
md: "var(--theme-radius, var(--default-theme-radius))",
|
|
@@ -519,21 +568,21 @@ const Je = {
|
|
|
519
568
|
"screen-md": "640px",
|
|
520
569
|
"screen-lg": "800px"
|
|
521
570
|
}
|
|
522
|
-
},
|
|
523
|
-
install: (
|
|
524
|
-
|
|
571
|
+
}, lt = {
|
|
572
|
+
install: (o) => {
|
|
573
|
+
o.component("ScalarButton", ve), o.component("ScalarIcon", j), o.component("ScalarIconButton", Pe), o.component("ScalarLoading", D), o.component("ScalarModal", Ne), o.component("ScalarTextField", qe);
|
|
525
574
|
}
|
|
526
575
|
};
|
|
527
576
|
export {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
577
|
+
ve as ScalarButton,
|
|
578
|
+
j as ScalarIcon,
|
|
579
|
+
Pe as ScalarIconButton,
|
|
580
|
+
D as ScalarLoading,
|
|
581
|
+
Ne as ScalarModal,
|
|
582
|
+
qe as ScalarTextField,
|
|
583
|
+
lt as default,
|
|
584
|
+
nt as extend,
|
|
585
|
+
at as theme,
|
|
586
|
+
ot as useLoadingState,
|
|
587
|
+
rt as useModal
|
|
539
588
|
};
|