@filipgutica/ui 1.5.0 → 1.6.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/README.md +64 -0
- package/dist/index.js +167 -404
- package/dist/site/CaptureScreen.vue.d.ts +9 -0
- package/dist/site/SiteNavLinks.vue.d.ts +14 -0
- package/dist/site/UiCapture.vue.d.ts +40 -0
- package/dist/site/UiCommandList.vue.d.ts +26 -0
- package/dist/site/UiSiteNav.vue.d.ts +21 -0
- package/dist/site/index.d.ts +6 -0
- package/dist/site.js +384 -59
- package/dist/use-active-section-CiflgGBI.js +255 -0
- package/dist/use-clipboard-copy.d.ts +17 -0
- package/package.json +1 -1
- package/src/site.css +284 -2
package/dist/index.js
CHANGED
|
@@ -1,102 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
//#
|
|
5
|
-
|
|
6
|
-
var q = /* @__PURE__ */ c({
|
|
7
|
-
__name: "UiButton",
|
|
8
|
-
props: {
|
|
9
|
-
disabled: {
|
|
10
|
-
type: Boolean,
|
|
11
|
-
default: !1
|
|
12
|
-
},
|
|
13
|
-
loading: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: !1
|
|
16
|
-
},
|
|
17
|
-
size: { default: "md" },
|
|
18
|
-
type: { default: "button" },
|
|
19
|
-
variant: { default: "primary" }
|
|
20
|
-
},
|
|
21
|
-
setup(e) {
|
|
22
|
-
return (t, r) => (h(), n(w(L), {
|
|
23
|
-
as: "button",
|
|
24
|
-
class: "fg-button",
|
|
25
|
-
"data-size": e.size,
|
|
26
|
-
"data-variant": e.variant,
|
|
27
|
-
"aria-busy": e.loading ? "true" : void 0,
|
|
28
|
-
disabled: e.disabled || e.loading,
|
|
29
|
-
type: e.type
|
|
30
|
-
}, {
|
|
31
|
-
default: D(() => [b(t.$slots, "default")]),
|
|
32
|
-
_: 3
|
|
33
|
-
}, 8, [
|
|
34
|
-
"data-size",
|
|
35
|
-
"data-variant",
|
|
36
|
-
"aria-busy",
|
|
37
|
-
"disabled",
|
|
38
|
-
"type"
|
|
39
|
-
]));
|
|
40
|
-
}
|
|
41
|
-
}), J = { class: "fg-card" }, Y = {
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./use-active-section-CiflgGBI.js";
|
|
2
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, inject as h, mergeModels as g, mergeProps as _, normalizeStyle as v, openBlock as y, provide as b, ref as x, renderList as S, renderSlot as C, resolveDynamicComponent as w, shallowRef as T, toDisplayString as E, unref as D, useModel as ee, useSlots as te, watch as O, withCtx as k } from "vue";
|
|
3
|
+
import { CheckboxIndicator as A, CheckboxRoot as j, Primitive as M, ProgressIndicator as N, ProgressRoot as P, RadioGroupItem as F, RadioGroupRoot as I, SliderRange as L, SliderRoot as R, SliderThumb as z, SliderTrack as B } from "reka-ui";
|
|
4
|
+
//#region src/components/UiCard.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var V = { class: "fg-card" }, H = {
|
|
42
6
|
key: 0,
|
|
43
7
|
class: "fg-card__header"
|
|
44
|
-
},
|
|
8
|
+
}, U = {
|
|
45
9
|
key: 1,
|
|
46
10
|
class: "fg-card__actions"
|
|
47
|
-
},
|
|
11
|
+
}, W = {
|
|
48
12
|
key: 1,
|
|
49
13
|
class: "fg-card__body"
|
|
50
|
-
},
|
|
14
|
+
}, G = {
|
|
51
15
|
key: 2,
|
|
52
16
|
class: "fg-card__footer"
|
|
53
|
-
},
|
|
17
|
+
}, K = /* @__PURE__ */ m({
|
|
54
18
|
__name: "UiCard",
|
|
55
19
|
props: {
|
|
56
20
|
title: { default: () => void 0 },
|
|
57
21
|
titleTag: { default: "h3" }
|
|
58
22
|
},
|
|
59
23
|
setup(e) {
|
|
60
|
-
let t =
|
|
61
|
-
return (
|
|
62
|
-
e.title || t.title || t.actions ? (
|
|
24
|
+
let t = te();
|
|
25
|
+
return (n, r) => (y(), u("div", V, [
|
|
26
|
+
e.title || t.title || t.actions ? (y(), u("header", H, [e.title || t.title ? (y(), c(w(e.titleTag), {
|
|
63
27
|
key: 0,
|
|
64
28
|
class: "fg-card__title"
|
|
65
29
|
}, {
|
|
66
|
-
default:
|
|
30
|
+
default: k(() => [C(n.$slots, "title", {}, () => [f(E(e.title), 1)])]),
|
|
67
31
|
_: 3
|
|
68
|
-
})) :
|
|
69
|
-
t.default ? (
|
|
70
|
-
t.footer ? (
|
|
32
|
+
})) : l("", !0), t.actions ? (y(), u("div", U, [C(n.$slots, "actions")])) : l("", !0)])) : l("", !0),
|
|
33
|
+
t.default ? (y(), u("div", W, [C(n.$slots, "default")])) : l("", !0),
|
|
34
|
+
t.footer ? (y(), u("footer", G, [C(n.$slots, "footer")])) : l("", !0)
|
|
71
35
|
]));
|
|
72
36
|
}
|
|
73
|
-
}),
|
|
37
|
+
}), q = [
|
|
74
38
|
"data-wrap",
|
|
75
39
|
"data-line-numbers",
|
|
76
40
|
"data-variant"
|
|
77
|
-
],
|
|
41
|
+
], J = {
|
|
78
42
|
key: 0,
|
|
79
43
|
class: "fg-code-block__header"
|
|
80
|
-
},
|
|
44
|
+
}, Y = {
|
|
81
45
|
key: 0,
|
|
82
46
|
class: "fg-code-block__title"
|
|
83
|
-
},
|
|
47
|
+
}, X = {
|
|
84
48
|
key: 1,
|
|
85
49
|
class: "fg-code-block__language"
|
|
86
|
-
},
|
|
50
|
+
}, Z = { class: "fg-code-block__actions" }, ne = ["disabled", "title"], re = {
|
|
87
51
|
viewBox: "0 0 24 24",
|
|
88
52
|
fill: "none",
|
|
89
53
|
stroke: "currentColor",
|
|
90
54
|
"stroke-width": "1.5",
|
|
91
55
|
"aria-hidden": "true"
|
|
92
|
-
},
|
|
56
|
+
}, ie = {
|
|
93
57
|
key: 0,
|
|
94
58
|
d: "m5 12 4 4L19 6"
|
|
95
|
-
},
|
|
59
|
+
}, ae = { key: 0 }, oe = ["aria-label"], se = {
|
|
96
60
|
key: 0,
|
|
97
61
|
class: "fg-code-block__number",
|
|
98
62
|
"aria-hidden": "true"
|
|
99
|
-
},
|
|
63
|
+
}, ce = { class: "fg-code-block__text" }, le = ["data-state"], ue = /* @__PURE__ */ m({
|
|
100
64
|
__name: "UiCodeBlock",
|
|
101
65
|
props: {
|
|
102
66
|
code: {},
|
|
@@ -116,8 +80,8 @@ var q = /* @__PURE__ */ c({
|
|
|
116
80
|
},
|
|
117
81
|
variant: { default: "default" }
|
|
118
82
|
},
|
|
119
|
-
setup(
|
|
120
|
-
let
|
|
83
|
+
setup(t) {
|
|
84
|
+
let n = T(), r = x(""), i = s(() => n.value ?? t.code.split("\n").map((e) => [{ content: e }])), a = {
|
|
121
85
|
vue: "vue",
|
|
122
86
|
ts: "typescript",
|
|
123
87
|
typescript: "typescript",
|
|
@@ -130,116 +94,104 @@ var q = /* @__PURE__ */ c({
|
|
|
130
94
|
sh: "bash",
|
|
131
95
|
shell: "bash"
|
|
132
96
|
};
|
|
133
|
-
|
|
134
|
-
let
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}),
|
|
138
|
-
let
|
|
139
|
-
if (
|
|
97
|
+
O(() => [t.code, t.language], async ([e, t], i, o) => {
|
|
98
|
+
let s = !1;
|
|
99
|
+
o(() => {
|
|
100
|
+
s = !0;
|
|
101
|
+
}), n.value = void 0, r.value = "";
|
|
102
|
+
let c = t.trim().toLowerCase(), l = Object.hasOwn(a, c) ? a[c] : void 0;
|
|
103
|
+
if (l) try {
|
|
140
104
|
let { highlightCode: t } = await import("./code-highlight-BuTmXL3w.js");
|
|
141
|
-
if (
|
|
142
|
-
let
|
|
105
|
+
if (s) return;
|
|
106
|
+
let r = await t({
|
|
143
107
|
code: e,
|
|
144
|
-
language:
|
|
108
|
+
language: l
|
|
145
109
|
});
|
|
146
|
-
if (
|
|
147
|
-
let
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
return e.endsWith("\r") ? [...
|
|
110
|
+
if (s) return;
|
|
111
|
+
let i = e.split("\n");
|
|
112
|
+
n.value = i.map((e, t) => {
|
|
113
|
+
let n = r[t] ?? [];
|
|
114
|
+
return e.endsWith("\r") ? [...n, { content: "\r" }] : n;
|
|
151
115
|
});
|
|
152
116
|
} catch {
|
|
153
|
-
|
|
117
|
+
s || (r.value = "Syntax highlighting unavailable. Showing plain text.");
|
|
154
118
|
}
|
|
155
119
|
}, { immediate: !0 });
|
|
156
|
-
let
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
m.value = !0;
|
|
164
|
-
try {
|
|
165
|
-
await navigator.clipboard.writeText(n.code), d.value = !0, p();
|
|
166
|
-
} catch {
|
|
167
|
-
g.value = "Could not copy. Select the code to copy it.";
|
|
168
|
-
} finally {
|
|
169
|
-
m.value = !1;
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
return (t, s) => (h(), i("div", {
|
|
120
|
+
let { copied: c, pending: p, error: m, copy: h } = e({
|
|
121
|
+
unavailableMessage: "Clipboard unavailable. Select the code to copy it.",
|
|
122
|
+
failureMessage: "Could not copy. Select the code to copy it."
|
|
123
|
+
}), g = s(() => c.value && !m.value), _ = s(() => t.variant === "compact" && g.value && !r.value), b = s(() => m.value ? m.value : t.variant === "compact" && r.value ? c.value ? `Code copied to clipboard. ${r.value}` : r.value : c.value ? "Code copied to clipboard." : r.value), w = () => h(t.code);
|
|
124
|
+
return (e, n) => (y(), u("div", {
|
|
173
125
|
class: "fg-code-block",
|
|
174
|
-
"data-wrap":
|
|
175
|
-
"data-line-numbers":
|
|
176
|
-
"data-variant":
|
|
126
|
+
"data-wrap": t.wrap,
|
|
127
|
+
"data-line-numbers": t.lineNumbers,
|
|
128
|
+
"data-variant": t.variant
|
|
177
129
|
}, [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
130
|
+
t.variant === "default" || t.copyable || e.$slots.actions ? (y(), u("div", J, [
|
|
131
|
+
t.variant === "default" ? (y(), u("span", Y, E(t.title || t.language), 1)) : l("", !0),
|
|
132
|
+
t.title && t.variant === "default" ? (y(), u("span", X, E(t.language), 1)) : l("", !0),
|
|
133
|
+
d("div", Z, [C(e.$slots, "actions"), t.copyable ? (y(), u("button", {
|
|
182
134
|
key: 0,
|
|
183
135
|
type: "button",
|
|
184
136
|
class: "fg-code-block__copy",
|
|
185
|
-
disabled:
|
|
137
|
+
disabled: D(p),
|
|
186
138
|
"aria-label": "Copy code",
|
|
187
|
-
title:
|
|
188
|
-
onClick:
|
|
189
|
-
}, [(
|
|
139
|
+
title: t.variant === "compact" ? g.value ? "Copied" : "Copy code" : void 0,
|
|
140
|
+
onClick: w
|
|
141
|
+
}, [(y(), u("svg", re, [t.variant === "compact" && g.value ? (y(), u("path", ie)) : (y(), u(o, { key: 1 }, [n[0] ||= d("rect", {
|
|
190
142
|
x: "8",
|
|
191
143
|
y: "8",
|
|
192
144
|
width: "12",
|
|
193
145
|
height: "13",
|
|
194
146
|
rx: "2"
|
|
195
|
-
}, null, -1),
|
|
196
|
-
])) :
|
|
197
|
-
|
|
147
|
+
}, null, -1), n[1] ||= d("path", { d: "M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3" }, null, -1)], 64))])), t.variant === "default" ? (y(), u("span", ae, E(g.value ? "Copied" : "Copy"), 1)) : l("", !0)], 8, ne)) : l("", !0)])
|
|
148
|
+
])) : l("", !0),
|
|
149
|
+
d("pre", {
|
|
198
150
|
class: "fg-code-block__pre",
|
|
199
151
|
tabindex: "0",
|
|
200
|
-
"aria-label":
|
|
201
|
-
}, [
|
|
202
|
-
key:
|
|
152
|
+
"aria-label": t.title || `${t.language} code`
|
|
153
|
+
}, [d("code", null, [(y(!0), u(o, null, S(i.value, (e, n) => (y(), u("span", {
|
|
154
|
+
key: n,
|
|
203
155
|
class: "fg-code-block__line"
|
|
204
|
-
}, [
|
|
156
|
+
}, [t.lineNumbers ? (y(), u("span", se, E(n + 1), 1)) : l("", !0), d("span", ce, [(y(!0), u(o, null, S(e, (e, t) => (y(), u("span", {
|
|
205
157
|
key: t,
|
|
206
|
-
style:
|
|
207
|
-
},
|
|
208
|
-
|
|
158
|
+
style: v({ color: e.color })
|
|
159
|
+
}, E(e.content), 5))), 128)), f(E(n < i.value.length - 1 ? "\n" : ""), 1)])]))), 128))])], 8, oe),
|
|
160
|
+
d("span", {
|
|
209
161
|
class: "fg-code-block__status",
|
|
210
162
|
role: "status",
|
|
211
|
-
"data-state":
|
|
212
|
-
},
|
|
213
|
-
], 8,
|
|
163
|
+
"data-state": _.value ? "success" : void 0
|
|
164
|
+
}, E(b.value), 9, le)
|
|
165
|
+
], 8, q));
|
|
214
166
|
}
|
|
215
|
-
}),
|
|
167
|
+
}), de = /* @__PURE__ */ m({
|
|
216
168
|
__name: "UiAlert",
|
|
217
169
|
props: { tone: { default: "neutral" } },
|
|
218
170
|
setup(e) {
|
|
219
|
-
return (t,
|
|
171
|
+
return (t, n) => (y(), c(D(M), {
|
|
220
172
|
as: "div",
|
|
221
173
|
class: "fg-alert",
|
|
222
174
|
"data-tone": e.tone,
|
|
223
175
|
role: e.tone === "danger" || e.tone === "error" ? "alert" : "status"
|
|
224
176
|
}, {
|
|
225
|
-
default:
|
|
177
|
+
default: k(() => [C(t.$slots, "default")]),
|
|
226
178
|
_: 3
|
|
227
179
|
}, 8, ["data-tone", "role"]));
|
|
228
180
|
}
|
|
229
|
-
}),
|
|
181
|
+
}), fe = /* @__PURE__ */ m({
|
|
230
182
|
__name: "UiBadge",
|
|
231
183
|
props: { tone: { default: "neutral" } },
|
|
232
184
|
setup(e) {
|
|
233
|
-
return (t,
|
|
185
|
+
return (t, n) => (y(), c(D(M), {
|
|
234
186
|
as: "span",
|
|
235
187
|
class: "fg-badge",
|
|
236
188
|
"data-tone": e.tone
|
|
237
189
|
}, {
|
|
238
|
-
default:
|
|
190
|
+
default: k(() => [C(t.$slots, "default")]),
|
|
239
191
|
_: 3
|
|
240
192
|
}, 8, ["data-tone"]));
|
|
241
193
|
}
|
|
242
|
-
}),
|
|
194
|
+
}), pe = ["data-size", "data-disabled"], me = { class: "fg-checkbox__label" }, he = /* @__PURE__ */ m({
|
|
243
195
|
__name: "UiCheckbox",
|
|
244
196
|
props: {
|
|
245
197
|
disabled: {
|
|
@@ -257,117 +209,24 @@ var q = /* @__PURE__ */ c({
|
|
|
257
209
|
let n = t, r = (e) => {
|
|
258
210
|
n("update:modelValue", e === !0);
|
|
259
211
|
};
|
|
260
|
-
return (t, n) => (
|
|
212
|
+
return (t, n) => (y(), u("label", {
|
|
261
213
|
class: "fg-checkbox",
|
|
262
214
|
"data-size": e.size,
|
|
263
215
|
"data-disabled": e.disabled ? "true" : void 0
|
|
264
|
-
}, [
|
|
216
|
+
}, [p(D(j), {
|
|
265
217
|
class: "fg-checkbox__control",
|
|
266
218
|
disabled: e.disabled,
|
|
267
219
|
"model-value": e.modelValue,
|
|
268
220
|
"onUpdate:modelValue": r
|
|
269
221
|
}, {
|
|
270
|
-
default:
|
|
271
|
-
default:
|
|
222
|
+
default: k(() => [p(D(A), { class: "fg-checkbox__indicator" }, {
|
|
223
|
+
default: k(() => [...n[0] ||= [f("✓", -1)]]),
|
|
272
224
|
_: 1
|
|
273
225
|
})]),
|
|
274
226
|
_: 1
|
|
275
|
-
}, 8, ["disabled", "model-value"]),
|
|
276
|
-
}
|
|
277
|
-
}), we = { class: "fg-dialog__header" }, Te = { class: "fg-dialog__body" }, Ee = {
|
|
278
|
-
key: 0,
|
|
279
|
-
class: "fg-dialog__footer"
|
|
280
|
-
}, De = /* @__PURE__ */ c({
|
|
281
|
-
inheritAttrs: !1,
|
|
282
|
-
__name: "UiDialog",
|
|
283
|
-
props: {
|
|
284
|
-
description: { default: () => void 0 },
|
|
285
|
-
open: { type: Boolean },
|
|
286
|
-
title: {}
|
|
287
|
-
},
|
|
288
|
-
emits: ["update:open"],
|
|
289
|
-
setup(e, { emit: t }) {
|
|
290
|
-
let c = t;
|
|
291
|
-
return (t, l) => (h(), n(w(P), {
|
|
292
|
-
open: e.open,
|
|
293
|
-
"onUpdate:open": l[0] ||= (e) => c("update:open", e)
|
|
294
|
-
}, {
|
|
295
|
-
default: D(() => [s(w(N), null, {
|
|
296
|
-
default: D(() => [s(w(M), { class: "fg-dialog__overlay" }), s(w(j), d({
|
|
297
|
-
class: "fg-dialog__content",
|
|
298
|
-
"aria-modal": "true"
|
|
299
|
-
}, t.$attrs), {
|
|
300
|
-
default: D(() => [
|
|
301
|
-
a("div", we, [a("div", null, [s(w(F), { class: "fg-dialog__title" }, {
|
|
302
|
-
default: D(() => [o(C(e.title), 1)]),
|
|
303
|
-
_: 1
|
|
304
|
-
}), e.description ? (h(), n(w(ne), {
|
|
305
|
-
key: 0,
|
|
306
|
-
class: "fg-dialog__description"
|
|
307
|
-
}, {
|
|
308
|
-
default: D(() => [o(C(e.description), 1)]),
|
|
309
|
-
_: 1
|
|
310
|
-
})) : r("", !0)]), s(w(A), {
|
|
311
|
-
class: "fg-dialog__close",
|
|
312
|
-
"aria-label": "Close dialog"
|
|
313
|
-
}, {
|
|
314
|
-
default: D(() => [...l[1] ||= [o(" × ", -1)]]),
|
|
315
|
-
_: 1
|
|
316
|
-
})]),
|
|
317
|
-
a("div", Te, [b(t.$slots, "default")]),
|
|
318
|
-
t.$slots.footer ? (h(), i("div", Ee, [b(t.$slots, "footer")])) : r("", !0)
|
|
319
|
-
]),
|
|
320
|
-
_: 3
|
|
321
|
-
}, 16)]),
|
|
322
|
-
_: 3
|
|
323
|
-
})]),
|
|
324
|
-
_: 3
|
|
325
|
-
}, 8, ["open"]));
|
|
326
|
-
}
|
|
327
|
-
}), Oe = { class: "fg-drawer__header" }, ke = { class: "fg-drawer__body" }, Ae = /* @__PURE__ */ c({
|
|
328
|
-
inheritAttrs: !1,
|
|
329
|
-
__name: "UiDrawer",
|
|
330
|
-
props: {
|
|
331
|
-
open: { type: Boolean },
|
|
332
|
-
title: {}
|
|
333
|
-
},
|
|
334
|
-
emits: ["update:open", "closeAutoFocus"],
|
|
335
|
-
setup(e, { emit: t }) {
|
|
336
|
-
let i = t;
|
|
337
|
-
return (t, c) => (h(), n(w(P), {
|
|
338
|
-
open: e.open,
|
|
339
|
-
"onUpdate:open": c[1] ||= (e) => i("update:open", e)
|
|
340
|
-
}, {
|
|
341
|
-
default: D(() => [t.$slots.trigger ? (h(), n(w(I), {
|
|
342
|
-
key: 0,
|
|
343
|
-
"as-child": ""
|
|
344
|
-
}, {
|
|
345
|
-
default: D(() => [b(t.$slots, "trigger")]),
|
|
346
|
-
_: 3
|
|
347
|
-
})) : r("", !0), s(w(N), null, {
|
|
348
|
-
default: D(() => [s(w(M), { class: "fg-drawer__overlay" }), s(w(j), d({
|
|
349
|
-
class: "fg-drawer__content",
|
|
350
|
-
"aria-modal": "true",
|
|
351
|
-
"aria-describedby": void 0
|
|
352
|
-
}, t.$attrs, { onCloseAutoFocus: c[0] ||= (e) => i("closeAutoFocus", e) }), {
|
|
353
|
-
default: D(() => [a("div", Oe, [s(w(F), { class: "fg-drawer__title" }, {
|
|
354
|
-
default: D(() => [o(C(e.title), 1)]),
|
|
355
|
-
_: 1
|
|
356
|
-
}), s(w(A), {
|
|
357
|
-
class: "fg-drawer__close",
|
|
358
|
-
"aria-label": "Close drawer"
|
|
359
|
-
}, {
|
|
360
|
-
default: D(() => [...c[2] ||= [o(" × ", -1)]]),
|
|
361
|
-
_: 1
|
|
362
|
-
})]), a("div", ke, [b(t.$slots, "default")])]),
|
|
363
|
-
_: 3
|
|
364
|
-
}, 16)]),
|
|
365
|
-
_: 3
|
|
366
|
-
})]),
|
|
367
|
-
_: 3
|
|
368
|
-
}, 8, ["open"]));
|
|
227
|
+
}, 8, ["disabled", "model-value"]), d("span", me, [C(t.$slots, "default")])], 8, pe));
|
|
369
228
|
}
|
|
370
|
-
}), Q = Symbol("UiFieldContext"),
|
|
229
|
+
}), Q = Symbol("UiFieldContext"), ge = ["data-invalid"], _e = ["for"], ve = ["id"], ye = ["id"], be = /* @__PURE__ */ m({
|
|
371
230
|
__name: "UiField",
|
|
372
231
|
props: {
|
|
373
232
|
controlId: {},
|
|
@@ -376,39 +235,39 @@ var q = /* @__PURE__ */ c({
|
|
|
376
235
|
label: {}
|
|
377
236
|
},
|
|
378
237
|
setup(e) {
|
|
379
|
-
let
|
|
380
|
-
return
|
|
381
|
-
controlId:
|
|
382
|
-
descriptionId:
|
|
383
|
-
errorId:
|
|
384
|
-
invalid:
|
|
385
|
-
}), (
|
|
238
|
+
let t = s(() => e.description && !e.error ? `${e.controlId}-description` : void 0), n = s(() => e.error ? `${e.controlId}-error` : void 0), r = s(() => !!e.error);
|
|
239
|
+
return b(Q, {
|
|
240
|
+
controlId: s(() => e.controlId),
|
|
241
|
+
descriptionId: t,
|
|
242
|
+
errorId: n,
|
|
243
|
+
invalid: r
|
|
244
|
+
}), (r, i) => (y(), u("div", {
|
|
386
245
|
class: "fg-field",
|
|
387
246
|
"data-invalid": e.error ? "true" : void 0
|
|
388
247
|
}, [
|
|
389
|
-
|
|
248
|
+
d("label", {
|
|
390
249
|
class: "fg-field__label",
|
|
391
250
|
for: e.controlId
|
|
392
|
-
},
|
|
393
|
-
|
|
394
|
-
descriptionId:
|
|
395
|
-
errorId:
|
|
251
|
+
}, E(e.label), 9, _e),
|
|
252
|
+
C(r.$slots, "default", {
|
|
253
|
+
descriptionId: t.value,
|
|
254
|
+
errorId: n.value
|
|
396
255
|
}),
|
|
397
|
-
e.description && !e.error ? (
|
|
256
|
+
e.description && !e.error ? (y(), u("p", {
|
|
398
257
|
key: 0,
|
|
399
|
-
id:
|
|
258
|
+
id: t.value,
|
|
400
259
|
class: "fg-field__description",
|
|
401
260
|
"data-field-description": ""
|
|
402
|
-
},
|
|
403
|
-
e.error ? (
|
|
261
|
+
}, E(e.description), 9, ve)) : l("", !0),
|
|
262
|
+
e.error ? (y(), u("p", {
|
|
404
263
|
key: 1,
|
|
405
|
-
id:
|
|
264
|
+
id: n.value,
|
|
406
265
|
class: "fg-field__error",
|
|
407
266
|
"data-field-error": ""
|
|
408
|
-
},
|
|
409
|
-
], 8,
|
|
267
|
+
}, E(e.error), 9, ye)) : l("", !0)
|
|
268
|
+
], 8, ge));
|
|
410
269
|
}
|
|
411
|
-
}),
|
|
270
|
+
}), $ = /* @__PURE__ */ m({
|
|
412
271
|
__name: "UiInput",
|
|
413
272
|
props: {
|
|
414
273
|
disabled: {
|
|
@@ -426,21 +285,21 @@ var q = /* @__PURE__ */ c({
|
|
|
426
285
|
},
|
|
427
286
|
emits: ["update:modelValue"],
|
|
428
287
|
setup(e, { emit: t }) {
|
|
429
|
-
let
|
|
430
|
-
e.currentTarget instanceof HTMLInputElement &&
|
|
288
|
+
let n = h(Q, void 0), r = t, i = (e) => {
|
|
289
|
+
e.currentTarget instanceof HTMLInputElement && r("update:modelValue", e.currentTarget.value);
|
|
431
290
|
};
|
|
432
|
-
return (t,
|
|
433
|
-
id:
|
|
291
|
+
return (t, r) => (y(), c(D(M), {
|
|
292
|
+
id: D(n)?.controlId.value ?? e.id,
|
|
434
293
|
as: "input",
|
|
435
294
|
class: "fg-input",
|
|
436
|
-
"aria-describedby":
|
|
437
|
-
"aria-errormessage":
|
|
438
|
-
"aria-invalid": e.invalid ||
|
|
295
|
+
"aria-describedby": D(n)?.descriptionId.value,
|
|
296
|
+
"aria-errormessage": D(n)?.errorId.value,
|
|
297
|
+
"aria-invalid": e.invalid || D(n)?.invalid.value ? "true" : void 0,
|
|
439
298
|
"data-size": e.size,
|
|
440
299
|
disabled: e.disabled,
|
|
441
300
|
type: e.type,
|
|
442
301
|
value: e.modelValue,
|
|
443
|
-
onInput:
|
|
302
|
+
onInput: i
|
|
444
303
|
}, null, 8, [
|
|
445
304
|
"id",
|
|
446
305
|
"aria-describedby",
|
|
@@ -452,7 +311,7 @@ var q = /* @__PURE__ */ c({
|
|
|
452
311
|
"value"
|
|
453
312
|
]));
|
|
454
313
|
}
|
|
455
|
-
}),
|
|
314
|
+
}), xe = 100, Se = /* @__PURE__ */ m({
|
|
456
315
|
__name: "UiProgress",
|
|
457
316
|
props: {
|
|
458
317
|
label: {},
|
|
@@ -460,22 +319,22 @@ var q = /* @__PURE__ */ c({
|
|
|
460
319
|
value: {}
|
|
461
320
|
},
|
|
462
321
|
setup(e) {
|
|
463
|
-
let
|
|
464
|
-
let t = Number.isFinite(e.max) && e.max > 0 ? e.max :
|
|
322
|
+
let t = s(() => {
|
|
323
|
+
let t = Number.isFinite(e.max) && e.max > 0 ? e.max : xe;
|
|
465
324
|
return {
|
|
466
325
|
max: t,
|
|
467
326
|
value: e.value === null || !Number.isFinite(e.value) ? null : Math.min(t, Math.max(0, e.value))
|
|
468
327
|
};
|
|
469
|
-
}),
|
|
470
|
-
return (
|
|
328
|
+
}), n = s(() => t.value.value === null ? 0 : t.value.value / t.value.max * 100);
|
|
329
|
+
return (r, i) => (y(), c(D(P), {
|
|
471
330
|
class: "fg-progress",
|
|
472
331
|
"aria-label": e.label,
|
|
473
|
-
max:
|
|
474
|
-
"model-value":
|
|
332
|
+
max: t.value.max,
|
|
333
|
+
"model-value": t.value.value
|
|
475
334
|
}, {
|
|
476
|
-
default:
|
|
335
|
+
default: k(() => [p(D(N), {
|
|
477
336
|
class: "fg-progress__indicator",
|
|
478
|
-
style:
|
|
337
|
+
style: v({ transform: `translateX(-${100 - n.value}%)` })
|
|
479
338
|
}, null, 8, ["style"])]),
|
|
480
339
|
_: 1
|
|
481
340
|
}, 8, [
|
|
@@ -484,7 +343,7 @@ var q = /* @__PURE__ */ c({
|
|
|
484
343
|
"model-value"
|
|
485
344
|
]));
|
|
486
345
|
}
|
|
487
|
-
}),
|
|
346
|
+
}), Ce = { class: "fg-radio-card__content" }, we = /* @__PURE__ */ m({
|
|
488
347
|
__name: "UiRadioCard",
|
|
489
348
|
props: {
|
|
490
349
|
disabled: {
|
|
@@ -494,21 +353,21 @@ var q = /* @__PURE__ */ c({
|
|
|
494
353
|
value: {}
|
|
495
354
|
},
|
|
496
355
|
setup(e) {
|
|
497
|
-
return (t,
|
|
356
|
+
return (t, n) => (y(), c(D(F), {
|
|
498
357
|
class: "fg-radio-card",
|
|
499
358
|
disabled: e.disabled,
|
|
500
359
|
value: e.value
|
|
501
360
|
}, {
|
|
502
|
-
default:
|
|
361
|
+
default: k(() => [n[0] ||= d("span", {
|
|
503
362
|
class: "fg-radio-card__indicator",
|
|
504
363
|
"aria-hidden": "true"
|
|
505
|
-
}, null, -1),
|
|
364
|
+
}, null, -1), d("span", Ce, [C(t.$slots, "default")])]),
|
|
506
365
|
_: 3
|
|
507
366
|
}, 8, ["disabled", "value"]));
|
|
508
367
|
}
|
|
509
|
-
}),
|
|
368
|
+
}), Te = /* @__PURE__ */ m({
|
|
510
369
|
__name: "UiRadioCardGroup",
|
|
511
|
-
props: /*@__PURE__*/
|
|
370
|
+
props: /*@__PURE__*/ g({
|
|
512
371
|
disabled: {
|
|
513
372
|
type: Boolean,
|
|
514
373
|
default: !1
|
|
@@ -524,7 +383,7 @@ var q = /* @__PURE__ */ c({
|
|
|
524
383
|
}),
|
|
525
384
|
emits: ["update:modelValue"],
|
|
526
385
|
setup(e) {
|
|
527
|
-
let t =
|
|
386
|
+
let t = ee(e, "modelValue"), n = (t) => {
|
|
528
387
|
if (t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
529
388
|
let n = t.currentTarget, r = t.target;
|
|
530
389
|
if (!(n instanceof HTMLElement) || !(r instanceof HTMLElement)) return;
|
|
@@ -540,14 +399,14 @@ var q = /* @__PURE__ */ c({
|
|
|
540
399
|
let d = o[u];
|
|
541
400
|
!d || d === r || (t.preventDefault(), d.focus(), d.click());
|
|
542
401
|
};
|
|
543
|
-
return (
|
|
402
|
+
return (r, i) => (y(), c(D(I), _({
|
|
544
403
|
modelValue: t.value,
|
|
545
|
-
"onUpdate:modelValue":
|
|
404
|
+
"onUpdate:modelValue": i[0] ||= (e) => t.value = e,
|
|
546
405
|
class: "fg-radio-card-group",
|
|
547
406
|
disabled: e.disabled,
|
|
548
407
|
loop: e.loop
|
|
549
|
-
}, e.orientation === void 0 ? {} : { orientation: e.orientation }, { onKeydown:
|
|
550
|
-
default:
|
|
408
|
+
}, e.orientation === void 0 ? {} : { orientation: e.orientation }, { onKeydown: n }), {
|
|
409
|
+
default: k(() => [C(r.$slots, "default")]),
|
|
551
410
|
_: 3
|
|
552
411
|
}, 16, [
|
|
553
412
|
"modelValue",
|
|
@@ -555,7 +414,7 @@ var q = /* @__PURE__ */ c({
|
|
|
555
414
|
"loop"
|
|
556
415
|
]));
|
|
557
416
|
}
|
|
558
|
-
}),
|
|
417
|
+
}), Ee = /* @__PURE__ */ m({
|
|
559
418
|
__name: "UiSelect",
|
|
560
419
|
props: {
|
|
561
420
|
disabled: {
|
|
@@ -572,22 +431,22 @@ var q = /* @__PURE__ */ c({
|
|
|
572
431
|
},
|
|
573
432
|
emits: ["update:modelValue"],
|
|
574
433
|
setup(e, { emit: t }) {
|
|
575
|
-
let
|
|
576
|
-
e.currentTarget instanceof HTMLSelectElement &&
|
|
434
|
+
let n = h(Q, void 0), r = t, i = (e) => {
|
|
435
|
+
e.currentTarget instanceof HTMLSelectElement && r("update:modelValue", e.currentTarget.value);
|
|
577
436
|
};
|
|
578
|
-
return (t,
|
|
579
|
-
id:
|
|
437
|
+
return (t, r) => (y(), c(D(M), {
|
|
438
|
+
id: D(n)?.controlId.value ?? e.id,
|
|
580
439
|
as: "select",
|
|
581
440
|
class: "fg-select",
|
|
582
|
-
"aria-describedby":
|
|
583
|
-
"aria-errormessage":
|
|
584
|
-
"aria-invalid": e.invalid ||
|
|
441
|
+
"aria-describedby": D(n)?.descriptionId.value,
|
|
442
|
+
"aria-errormessage": D(n)?.errorId.value,
|
|
443
|
+
"aria-invalid": e.invalid || D(n)?.invalid.value ? "true" : void 0,
|
|
585
444
|
"data-size": e.size,
|
|
586
445
|
disabled: e.disabled,
|
|
587
446
|
value: e.modelValue,
|
|
588
|
-
onChange:
|
|
447
|
+
onChange: i
|
|
589
448
|
}, {
|
|
590
|
-
default:
|
|
449
|
+
default: k(() => [C(t.$slots, "default")]),
|
|
591
450
|
_: 3
|
|
592
451
|
}, 8, [
|
|
593
452
|
"id",
|
|
@@ -599,7 +458,7 @@ var q = /* @__PURE__ */ c({
|
|
|
599
458
|
"value"
|
|
600
459
|
]));
|
|
601
460
|
}
|
|
602
|
-
}),
|
|
461
|
+
}), De = /* @__PURE__ */ m({
|
|
603
462
|
__name: "UiSlider",
|
|
604
463
|
props: {
|
|
605
464
|
disabled: {
|
|
@@ -615,42 +474,42 @@ var q = /* @__PURE__ */ c({
|
|
|
615
474
|
step: { default: 1 }
|
|
616
475
|
},
|
|
617
476
|
emits: ["update:modelValue"],
|
|
618
|
-
setup(e, { emit:
|
|
619
|
-
let
|
|
477
|
+
setup(e, { emit: t }) {
|
|
478
|
+
let n = h(Q, void 0), r = s(() => {
|
|
620
479
|
let t = Number.isFinite(e.min) ? e.min : 0;
|
|
621
480
|
return {
|
|
622
481
|
max: Number.isFinite(e.max) && e.max > t ? e.max : t + 100,
|
|
623
482
|
min: t,
|
|
624
483
|
step: Number.isFinite(e.step) && e.step > 0 ? e.step : 1
|
|
625
484
|
};
|
|
626
|
-
}),
|
|
485
|
+
}), i = t, a = s({
|
|
627
486
|
get: () => {
|
|
628
|
-
let t = e.modelValue !== void 0 && Number.isFinite(e.modelValue) ? e.modelValue :
|
|
629
|
-
return [Math.min(
|
|
487
|
+
let t = e.modelValue !== void 0 && Number.isFinite(e.modelValue) ? e.modelValue : r.value.min;
|
|
488
|
+
return [Math.min(r.value.max, Math.max(r.value.min, t))];
|
|
630
489
|
},
|
|
631
490
|
set: ([e]) => {
|
|
632
|
-
e !== void 0 &&
|
|
491
|
+
e !== void 0 && i("update:modelValue", e);
|
|
633
492
|
}
|
|
634
493
|
});
|
|
635
|
-
return (t,
|
|
636
|
-
modelValue:
|
|
637
|
-
"onUpdate:modelValue":
|
|
494
|
+
return (t, i) => (y(), c(D(R), {
|
|
495
|
+
modelValue: a.value,
|
|
496
|
+
"onUpdate:modelValue": i[0] ||= (e) => a.value = e,
|
|
638
497
|
class: "fg-slider",
|
|
639
498
|
"data-size": e.size,
|
|
640
499
|
disabled: e.disabled,
|
|
641
|
-
max:
|
|
642
|
-
min:
|
|
643
|
-
step:
|
|
500
|
+
max: r.value.max,
|
|
501
|
+
min: r.value.min,
|
|
502
|
+
step: r.value.step
|
|
644
503
|
}, {
|
|
645
|
-
default:
|
|
646
|
-
default:
|
|
504
|
+
default: k(() => [p(D(B), { class: "fg-slider__track" }, {
|
|
505
|
+
default: k(() => [p(D(L), { class: "fg-slider__range" })]),
|
|
647
506
|
_: 1
|
|
648
|
-
}),
|
|
649
|
-
id:
|
|
507
|
+
}), p(D(z), {
|
|
508
|
+
id: D(n)?.controlId.value ?? e.id,
|
|
650
509
|
class: "fg-slider__thumb",
|
|
651
|
-
"aria-describedby":
|
|
652
|
-
"aria-errormessage":
|
|
653
|
-
"aria-invalid":
|
|
510
|
+
"aria-describedby": D(n)?.descriptionId.value,
|
|
511
|
+
"aria-errormessage": D(n)?.errorId.value,
|
|
512
|
+
"aria-invalid": D(n)?.invalid.value ? "true" : void 0,
|
|
654
513
|
"aria-label": e.label
|
|
655
514
|
}, null, 8, [
|
|
656
515
|
"id",
|
|
@@ -669,118 +528,22 @@ var q = /* @__PURE__ */ c({
|
|
|
669
528
|
"step"
|
|
670
529
|
]));
|
|
671
530
|
}
|
|
672
|
-
}),
|
|
673
|
-
"id",
|
|
674
|
-
"aria-controls",
|
|
675
|
-
"aria-selected",
|
|
676
|
-
"tabindex",
|
|
677
|
-
"onClick",
|
|
678
|
-
"onFocus"
|
|
679
|
-
], Ke = [
|
|
680
|
-
"id",
|
|
681
|
-
"role",
|
|
682
|
-
"aria-labelledby",
|
|
683
|
-
"hidden",
|
|
684
|
-
"tabindex"
|
|
685
|
-
], qe = ["id", "hidden"], Je = /* @__PURE__ */ c({
|
|
686
|
-
__name: "UiTabs",
|
|
687
|
-
props: {
|
|
688
|
-
items: {},
|
|
689
|
-
label: {},
|
|
690
|
-
modelValue: {}
|
|
691
|
-
},
|
|
692
|
-
emits: ["update:modelValue"],
|
|
693
|
-
setup(n, { emit: o }) {
|
|
694
|
-
let s = o, c = T(), l = v(!1), u = t(() => n.items.some((e) => e.value === n.modelValue) ? n.modelValue : n.items[0]?.value), d = (e) => `${c}-tab-${encodeURIComponent(e)}`, f = (e) => `${c}-panel-${encodeURIComponent(e)}`, m = (e) => `${c}-heading-${encodeURIComponent(e)}`;
|
|
695
|
-
p(() => {
|
|
696
|
-
l.value = !0;
|
|
697
|
-
});
|
|
698
|
-
let g = (e) => {
|
|
699
|
-
e !== u.value && s("update:modelValue", e);
|
|
700
|
-
}, _ = (e) => {
|
|
701
|
-
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || ![
|
|
702
|
-
"ArrowLeft",
|
|
703
|
-
"ArrowRight",
|
|
704
|
-
"Home",
|
|
705
|
-
"End"
|
|
706
|
-
].includes(e.key)) return;
|
|
707
|
-
let t = e.currentTarget, n = e.target;
|
|
708
|
-
if (!(t instanceof HTMLElement) || !(n instanceof HTMLButtonElement)) return;
|
|
709
|
-
let r = [...t.querySelectorAll("[role=\"tab\"]")], i = r.indexOf(n);
|
|
710
|
-
if (i < 0 || r.length === 0) return;
|
|
711
|
-
let a = getComputedStyle(t).direction === "rtl", o = e.key === (a ? "ArrowRight" : "ArrowLeft"), s = r[e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : (i + (o ? -1 : 1) + r.length) % r.length];
|
|
712
|
-
s && (e.preventDefault(), s.focus());
|
|
713
|
-
};
|
|
714
|
-
return (t, o) => (h(), i("div", Ue, [l.value ? (h(), i("div", {
|
|
715
|
-
key: 0,
|
|
716
|
-
class: "fg-tabs__list",
|
|
717
|
-
role: "tablist",
|
|
718
|
-
"aria-label": n.label,
|
|
719
|
-
onKeydown: _
|
|
720
|
-
}, [(h(!0), i(e, null, y(n.items, (e) => (h(), i("button", {
|
|
721
|
-
id: d(e.value),
|
|
722
|
-
key: e.value,
|
|
723
|
-
type: "button",
|
|
724
|
-
class: "fg-tabs__tab",
|
|
725
|
-
role: "tab",
|
|
726
|
-
"aria-controls": f(e.value),
|
|
727
|
-
"aria-selected": e.value === u.value,
|
|
728
|
-
tabindex: e.value === u.value ? 0 : -1,
|
|
729
|
-
onClick: (t) => g(e.value),
|
|
730
|
-
onFocus: (t) => g(e.value)
|
|
731
|
-
}, C(e.label), 41, Ge))), 128))], 40, We)) : r("", !0), (h(!0), i(e, null, y(n.items, (e) => (h(), i("section", {
|
|
732
|
-
id: f(e.value),
|
|
733
|
-
key: e.value,
|
|
734
|
-
class: "fg-tabs__panel",
|
|
735
|
-
role: l.value ? "tabpanel" : void 0,
|
|
736
|
-
"aria-labelledby": l.value ? d(e.value) : m(e.value),
|
|
737
|
-
hidden: l.value && e.value !== u.value,
|
|
738
|
-
tabindex: l.value ? 0 : void 0
|
|
739
|
-
}, [a("h3", {
|
|
740
|
-
id: m(e.value),
|
|
741
|
-
class: "fg-tabs__heading",
|
|
742
|
-
hidden: l.value
|
|
743
|
-
}, C(e.label), 9, qe), b(t.$slots, "panel", { value: e.value })], 8, Ke))), 128))]));
|
|
744
|
-
}
|
|
745
|
-
}), Ye = /* @__PURE__ */ c({
|
|
531
|
+
}), Oe = /* @__PURE__ */ m({
|
|
746
532
|
__name: "UiSurface",
|
|
747
533
|
props: {
|
|
748
534
|
as: { default: "section" },
|
|
749
535
|
padding: { default: "default" }
|
|
750
536
|
},
|
|
751
537
|
setup(e) {
|
|
752
|
-
return (t,
|
|
538
|
+
return (t, n) => (y(), c(D(M), {
|
|
753
539
|
as: e.as,
|
|
754
540
|
class: "fg-surface",
|
|
755
541
|
"data-padding": e.padding
|
|
756
542
|
}, {
|
|
757
|
-
default:
|
|
543
|
+
default: k(() => [C(t.$slots, "default")]),
|
|
758
544
|
_: 3
|
|
759
545
|
}, 8, ["as", "data-padding"]));
|
|
760
546
|
}
|
|
761
|
-
})
|
|
762
|
-
let t = v(e[0]), n, r, i;
|
|
763
|
-
return p(() => {
|
|
764
|
-
let a = e.flatMap((e) => {
|
|
765
|
-
let t = document.getElementById(e);
|
|
766
|
-
return t ? [{
|
|
767
|
-
id: e,
|
|
768
|
-
element: t
|
|
769
|
-
}] : [];
|
|
770
|
-
}), o = () => {
|
|
771
|
-
n = void 0;
|
|
772
|
-
let e = document.documentElement, r = Number.parseFloat(getComputedStyle(e).scrollPaddingTop) || 0, i = a[0]?.id;
|
|
773
|
-
for (let e of a) e.element.getBoundingClientRect().top <= r + 1 && (i = e.id);
|
|
774
|
-
window.scrollY > 0 && window.scrollY + window.innerHeight >= e.scrollHeight - 2 && (i = a.at(-1)?.id), t.value = i;
|
|
775
|
-
}, s = () => {
|
|
776
|
-
n === void 0 && (n = requestAnimationFrame(o));
|
|
777
|
-
};
|
|
778
|
-
window.addEventListener("scroll", s, { passive: !0 }), window.addEventListener("resize", s), window.addEventListener("pageshow", s), document.body.addEventListener("transitionend", s), typeof ResizeObserver < "u" && (r = new ResizeObserver(s), r.observe(document.body)), i = () => {
|
|
779
|
-
window.removeEventListener("scroll", s), window.removeEventListener("resize", s), window.removeEventListener("pageshow", s), document.body.removeEventListener("transitionend", s);
|
|
780
|
-
}, o();
|
|
781
|
-
}), m(() => {
|
|
782
|
-
i?.(), r?.disconnect(), n !== void 0 && cancelAnimationFrame(n);
|
|
783
|
-
}), _(t);
|
|
784
|
-
};
|
|
547
|
+
});
|
|
785
548
|
//#endregion
|
|
786
|
-
export {
|
|
549
|
+
export { de as UiAlert, fe as UiBadge, r as UiButton, K as UiCard, he as UiCheckbox, ue as UiCodeBlock, t as UiDialog, i as UiDrawer, be as UiField, $ as UiInput, Se as UiProgress, we as UiRadioCard, Te as UiRadioCardGroup, Ee as UiSelect, De as UiSlider, Oe as UiSurface, n as UiTabs, a as useActiveSection };
|