@filipgutica/ui 1.14.1 → 1.15.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 +7 -5
- package/dist/components/UiSegmentedControl.vue.d.ts +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +177 -177
- package/dist/site.js +179 -185
- package/dist/{use-active-section-DCS_wyYq.js → use-active-section-DMbpGE2f.js} +60 -8
- package/package.json +1 -1
- package/src/components.css +50 -2
- package/src/site.css +2 -35
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i,
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { CheckboxIndicator as
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./use-active-section-DMbpGE2f.js";
|
|
2
|
+
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, inject as g, mergeModels as _, mergeProps as v, normalizeStyle as y, openBlock as b, provide as x, ref as S, renderList as C, renderSlot as w, resolveDynamicComponent as T, shallowRef as ee, toDisplayString as E, unref as D, useAttrs as te, useId as O, useModel as ne, useSlots as k, watch as re, withCtx as A } from "vue";
|
|
3
|
+
import { CheckboxIndicator as j, CheckboxRoot as M, Primitive as N, ProgressIndicator as P, ProgressRoot as F, RadioGroupItem as I, RadioGroupRoot as L, SliderRange as R, SliderRoot as z, SliderThumb as B, SliderTrack as V, Toggle as H } from "reka-ui";
|
|
4
4
|
//#region src/components/UiCard.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var U = { class: "fg-card" }, W = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "fg-card__header"
|
|
8
|
-
},
|
|
8
|
+
}, G = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "fg-card__actions"
|
|
11
|
-
},
|
|
11
|
+
}, K = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "fg-card__body"
|
|
14
|
-
},
|
|
14
|
+
}, q = {
|
|
15
15
|
key: 2,
|
|
16
16
|
class: "fg-card__footer"
|
|
17
|
-
},
|
|
17
|
+
}, J = /* @__PURE__ */ h({
|
|
18
18
|
__name: "UiCard",
|
|
19
19
|
props: {
|
|
20
20
|
title: { default: () => void 0 },
|
|
@@ -22,46 +22,46 @@ var H = { class: "fg-card" }, U = {
|
|
|
22
22
|
},
|
|
23
23
|
setup(e) {
|
|
24
24
|
let t = k();
|
|
25
|
-
return (n, r) => (
|
|
26
|
-
e.title || t.title || t.actions ? (
|
|
25
|
+
return (n, r) => (b(), d("div", U, [
|
|
26
|
+
e.title || t.title || t.actions ? (b(), d("header", W, [e.title || t.title ? (b(), l(T(e.titleTag), {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "fg-card__title"
|
|
29
29
|
}, {
|
|
30
|
-
default: A(() => [
|
|
30
|
+
default: A(() => [w(n.$slots, "title", {}, () => [p(E(e.title), 1)])]),
|
|
31
31
|
_: 3
|
|
32
|
-
})) :
|
|
33
|
-
t.default ? (
|
|
34
|
-
t.footer ? (
|
|
32
|
+
})) : u("", !0), t.actions ? (b(), d("div", G, [w(n.$slots, "actions")])) : u("", !0)])) : u("", !0),
|
|
33
|
+
t.default ? (b(), d("div", K, [w(n.$slots, "default")])) : u("", !0),
|
|
34
|
+
t.footer ? (b(), d("footer", q, [w(n.$slots, "footer")])) : u("", !0)
|
|
35
35
|
]));
|
|
36
36
|
}
|
|
37
|
-
}),
|
|
37
|
+
}), Y = [
|
|
38
38
|
"data-command",
|
|
39
39
|
"data-wrap",
|
|
40
40
|
"data-line-numbers",
|
|
41
41
|
"data-variant"
|
|
42
|
-
],
|
|
42
|
+
], X = {
|
|
43
43
|
key: 0,
|
|
44
44
|
class: "fg-code-block__header"
|
|
45
|
-
},
|
|
45
|
+
}, ie = {
|
|
46
46
|
key: 0,
|
|
47
47
|
class: "fg-code-block__title"
|
|
48
|
-
},
|
|
48
|
+
}, ae = {
|
|
49
49
|
key: 1,
|
|
50
50
|
class: "fg-code-block__language"
|
|
51
|
-
},
|
|
51
|
+
}, oe = { class: "fg-code-block__actions" }, se = ["disabled", "title"], ce = {
|
|
52
52
|
viewBox: "0 0 24 24",
|
|
53
53
|
fill: "none",
|
|
54
54
|
stroke: "currentColor",
|
|
55
55
|
"stroke-width": "1.5",
|
|
56
56
|
"aria-hidden": "true"
|
|
57
|
-
},
|
|
57
|
+
}, le = {
|
|
58
58
|
key: 0,
|
|
59
59
|
d: "m5 12 4 4L19 6"
|
|
60
|
-
},
|
|
60
|
+
}, ue = { key: 0 }, de = ["aria-label"], fe = {
|
|
61
61
|
key: 0,
|
|
62
62
|
class: "fg-code-block__number",
|
|
63
63
|
"aria-hidden": "true"
|
|
64
|
-
},
|
|
64
|
+
}, pe = { class: "fg-code-block__text" }, me = ["data-state"], he = /* @__PURE__ */ h({
|
|
65
65
|
__name: "UiCodeBlock",
|
|
66
66
|
props: {
|
|
67
67
|
code: {},
|
|
@@ -81,15 +81,15 @@ var H = { class: "fg-card" }, U = {
|
|
|
81
81
|
},
|
|
82
82
|
variant: { default: "default" }
|
|
83
83
|
},
|
|
84
|
-
setup(
|
|
85
|
-
let
|
|
86
|
-
let
|
|
84
|
+
setup(e) {
|
|
85
|
+
let t = c(() => {
|
|
86
|
+
let t = e.language.trim().toLowerCase(), n = [
|
|
87
87
|
"bash",
|
|
88
88
|
"sh",
|
|
89
89
|
"shell"
|
|
90
|
-
].includes(
|
|
91
|
-
return
|
|
92
|
-
}),
|
|
90
|
+
].includes(t);
|
|
91
|
+
return e.variant === "compact" ? n || t === "text" : n && !e.title;
|
|
92
|
+
}), n = ee(), i = S(""), a = c(() => n.value ?? e.code.split("\n").map((e) => [{ content: e }])), o = {
|
|
93
93
|
vue: "vue",
|
|
94
94
|
ts: "typescript",
|
|
95
95
|
typescript: "typescript",
|
|
@@ -102,105 +102,105 @@ var H = { class: "fg-card" }, U = {
|
|
|
102
102
|
sh: "bash",
|
|
103
103
|
shell: "bash"
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
let
|
|
105
|
+
re(() => [e.code, e.language], async ([e, t], r, a) => {
|
|
106
|
+
let s = !1;
|
|
107
107
|
a(() => {
|
|
108
|
-
|
|
109
|
-
}),
|
|
110
|
-
let
|
|
108
|
+
s = !0;
|
|
109
|
+
}), n.value = void 0, i.value = "";
|
|
110
|
+
let c = t.trim().toLowerCase(), l = Object.hasOwn(o, c) ? o[c] : void 0;
|
|
111
111
|
if (l) try {
|
|
112
112
|
let { highlightCode: t } = await import("./code-highlight-BuTmXL3w.js");
|
|
113
|
-
if (
|
|
114
|
-
let
|
|
113
|
+
if (s) return;
|
|
114
|
+
let r = await t({
|
|
115
115
|
code: e,
|
|
116
116
|
language: l
|
|
117
117
|
});
|
|
118
|
-
if (
|
|
118
|
+
if (s) return;
|
|
119
119
|
let i = e.split("\n");
|
|
120
|
-
|
|
121
|
-
let
|
|
122
|
-
return e.endsWith("\r") ? [...
|
|
120
|
+
n.value = i.map((e, t) => {
|
|
121
|
+
let n = r[t] ?? [];
|
|
122
|
+
return e.endsWith("\r") ? [...n, { content: "\r" }] : n;
|
|
123
123
|
});
|
|
124
124
|
} catch {
|
|
125
|
-
|
|
125
|
+
s || (i.value = "Syntax highlighting unavailable. Showing plain text.");
|
|
126
126
|
}
|
|
127
127
|
}, { immediate: !0 });
|
|
128
|
-
let { copied:
|
|
128
|
+
let { copied: l, pending: m, error: h, copy: g } = r({
|
|
129
129
|
unavailableMessage: "Clipboard unavailable. Select the code to copy it.",
|
|
130
130
|
failureMessage: "Could not copy. Select the code to copy it."
|
|
131
|
-
}), _ =
|
|
132
|
-
return (
|
|
131
|
+
}), _ = c(() => l.value && !h.value), v = c(() => e.variant === "compact" && _.value && !i.value), x = c(() => h.value ? h.value : e.variant === "compact" && i.value ? l.value ? `Code copied to clipboard. ${i.value}` : i.value : l.value ? "Code copied to clipboard." : i.value), T = () => g(e.code);
|
|
132
|
+
return (n, r) => (b(), d("div", {
|
|
133
133
|
class: "fg-code-block",
|
|
134
|
-
"data-command":
|
|
135
|
-
"data-wrap":
|
|
136
|
-
"data-line-numbers":
|
|
137
|
-
"data-variant":
|
|
134
|
+
"data-command": t.value || void 0,
|
|
135
|
+
"data-wrap": e.wrap,
|
|
136
|
+
"data-line-numbers": e.lineNumbers,
|
|
137
|
+
"data-variant": e.variant
|
|
138
138
|
}, [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
e.variant === "default" || e.copyable || n.$slots.actions ? (b(), d("div", X, [
|
|
140
|
+
e.variant === "default" ? (b(), d("span", ie, E(e.title || e.language), 1)) : u("", !0),
|
|
141
|
+
e.title && e.variant === "default" ? (b(), d("span", ae, E(e.language), 1)) : u("", !0),
|
|
142
|
+
f("div", oe, [w(n.$slots, "actions"), e.copyable ? (b(), d("button", {
|
|
143
143
|
key: 0,
|
|
144
144
|
type: "button",
|
|
145
145
|
class: "fg-code-block__copy",
|
|
146
|
-
disabled:
|
|
146
|
+
disabled: D(m),
|
|
147
147
|
"aria-label": "Copy code",
|
|
148
|
-
title:
|
|
149
|
-
onClick:
|
|
150
|
-
}, [(
|
|
148
|
+
title: e.variant === "compact" ? _.value ? "Copied" : "Copy code" : void 0,
|
|
149
|
+
onClick: T
|
|
150
|
+
}, [(b(), d("svg", ce, [e.variant === "compact" && _.value ? (b(), d("path", le)) : (b(), d(s, { key: 1 }, [r[0] ||= f("rect", {
|
|
151
151
|
x: "8",
|
|
152
152
|
y: "8",
|
|
153
153
|
width: "12",
|
|
154
154
|
height: "13",
|
|
155
155
|
rx: "2"
|
|
156
|
-
}, null, -1), r[1] ||=
|
|
157
|
-
])) :
|
|
158
|
-
|
|
156
|
+
}, null, -1), r[1] ||= f("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))])), e.variant === "default" ? (b(), d("span", ue, E(_.value ? "Copied" : "Copy"), 1)) : u("", !0)], 8, se)) : u("", !0)])
|
|
157
|
+
])) : u("", !0),
|
|
158
|
+
f("pre", {
|
|
159
159
|
class: "fg-code-block__pre",
|
|
160
160
|
tabindex: "0",
|
|
161
|
-
"aria-label":
|
|
162
|
-
}, [
|
|
161
|
+
"aria-label": e.title || `${e.language} code`
|
|
162
|
+
}, [f("code", null, [(b(!0), d(s, null, C(a.value, (t, n) => (b(), d("span", {
|
|
163
163
|
key: n,
|
|
164
164
|
class: "fg-code-block__line"
|
|
165
|
-
}, [
|
|
165
|
+
}, [e.lineNumbers ? (b(), d("span", fe, E(n + 1), 1)) : u("", !0), f("span", pe, [(b(!0), d(s, null, C(t, (e, t) => (b(), d("span", {
|
|
166
166
|
key: t,
|
|
167
|
-
style:
|
|
168
|
-
},
|
|
169
|
-
|
|
167
|
+
style: y({ color: e.color })
|
|
168
|
+
}, E(e.content), 5))), 128)), p(E(n < a.value.length - 1 ? "\n" : ""), 1)])]))), 128))])], 8, de),
|
|
169
|
+
f("span", {
|
|
170
170
|
class: "fg-code-block__status",
|
|
171
171
|
role: "status",
|
|
172
|
-
"data-state":
|
|
173
|
-
},
|
|
174
|
-
], 8,
|
|
172
|
+
"data-state": v.value ? "success" : void 0
|
|
173
|
+
}, E(x.value), 9, me)
|
|
174
|
+
], 8, Y));
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
176
|
+
}), ge = /* @__PURE__ */ h({
|
|
177
177
|
__name: "UiAlert",
|
|
178
178
|
props: { tone: { default: "neutral" } },
|
|
179
179
|
setup(e) {
|
|
180
|
-
return (t, n) => (
|
|
180
|
+
return (t, n) => (b(), l(D(N), {
|
|
181
181
|
as: "div",
|
|
182
182
|
class: "fg-alert",
|
|
183
183
|
"data-tone": e.tone,
|
|
184
184
|
role: e.tone === "danger" || e.tone === "error" ? "alert" : "status"
|
|
185
185
|
}, {
|
|
186
|
-
default: A(() => [
|
|
186
|
+
default: A(() => [w(t.$slots, "default")]),
|
|
187
187
|
_: 3
|
|
188
188
|
}, 8, ["data-tone", "role"]));
|
|
189
189
|
}
|
|
190
|
-
}),
|
|
190
|
+
}), _e = /* @__PURE__ */ h({
|
|
191
191
|
__name: "UiBadge",
|
|
192
192
|
props: { tone: { default: "neutral" } },
|
|
193
193
|
setup(e) {
|
|
194
|
-
return (t, n) => (
|
|
194
|
+
return (t, n) => (b(), l(D(N), {
|
|
195
195
|
as: "span",
|
|
196
196
|
class: "fg-badge",
|
|
197
197
|
"data-tone": e.tone
|
|
198
198
|
}, {
|
|
199
|
-
default: A(() => [
|
|
199
|
+
default: A(() => [w(t.$slots, "default")]),
|
|
200
200
|
_: 3
|
|
201
201
|
}, 8, ["data-tone"]));
|
|
202
202
|
}
|
|
203
|
-
}),
|
|
203
|
+
}), ve = ["data-size", "data-disabled"], ye = { class: "fg-checkbox__label" }, be = /* @__PURE__ */ h({
|
|
204
204
|
__name: "UiCheckbox",
|
|
205
205
|
props: {
|
|
206
206
|
disabled: {
|
|
@@ -218,24 +218,24 @@ var H = { class: "fg-card" }, U = {
|
|
|
218
218
|
let n = t, r = (e) => {
|
|
219
219
|
n("update:modelValue", e === !0);
|
|
220
220
|
};
|
|
221
|
-
return (t, n) => (
|
|
221
|
+
return (t, n) => (b(), d("label", {
|
|
222
222
|
class: "fg-checkbox",
|
|
223
223
|
"data-size": e.size,
|
|
224
224
|
"data-disabled": e.disabled ? "true" : void 0
|
|
225
|
-
}, [
|
|
225
|
+
}, [m(D(M), {
|
|
226
226
|
class: "fg-checkbox__control",
|
|
227
227
|
disabled: e.disabled,
|
|
228
228
|
"model-value": e.modelValue,
|
|
229
229
|
"onUpdate:modelValue": r
|
|
230
230
|
}, {
|
|
231
|
-
default: A(() => [
|
|
232
|
-
default: A(() => [...n[0] ||= [
|
|
231
|
+
default: A(() => [m(D(j), { class: "fg-checkbox__indicator" }, {
|
|
232
|
+
default: A(() => [...n[0] ||= [p("✓", -1)]]),
|
|
233
233
|
_: 1
|
|
234
234
|
})]),
|
|
235
235
|
_: 1
|
|
236
|
-
}, 8, ["disabled", "model-value"]),
|
|
236
|
+
}, 8, ["disabled", "model-value"]), f("span", ye, [w(t.$slots, "default")])], 8, ve));
|
|
237
237
|
}
|
|
238
|
-
}), Z = Symbol("UiFieldContext"),
|
|
238
|
+
}), Z = Symbol("UiFieldContext"), xe = ["data-invalid"], Se = ["for"], Ce = ["id"], we = ["id"], Te = /* @__PURE__ */ h({
|
|
239
239
|
__name: "UiField",
|
|
240
240
|
props: {
|
|
241
241
|
controlId: {},
|
|
@@ -244,63 +244,63 @@ var H = { class: "fg-card" }, U = {
|
|
|
244
244
|
label: {}
|
|
245
245
|
},
|
|
246
246
|
setup(e) {
|
|
247
|
-
let t =
|
|
248
|
-
return
|
|
249
|
-
controlId:
|
|
247
|
+
let t = c(() => e.description && !e.error ? `${e.controlId}-description` : void 0), n = c(() => e.error ? `${e.controlId}-error` : void 0), r = c(() => !!e.error);
|
|
248
|
+
return x(Z, {
|
|
249
|
+
controlId: c(() => e.controlId),
|
|
250
250
|
descriptionId: t,
|
|
251
251
|
errorId: n,
|
|
252
252
|
invalid: r
|
|
253
|
-
}), (r, i) => (
|
|
253
|
+
}), (r, i) => (b(), d("div", {
|
|
254
254
|
class: "fg-field",
|
|
255
255
|
"data-invalid": e.error ? "true" : void 0
|
|
256
256
|
}, [
|
|
257
|
-
|
|
257
|
+
f("label", {
|
|
258
258
|
class: "fg-field__label",
|
|
259
259
|
for: e.controlId
|
|
260
|
-
},
|
|
261
|
-
|
|
260
|
+
}, E(e.label), 9, Se),
|
|
261
|
+
w(r.$slots, "default", {
|
|
262
262
|
descriptionId: t.value,
|
|
263
263
|
errorId: n.value
|
|
264
264
|
}),
|
|
265
|
-
e.description && !e.error ? (
|
|
265
|
+
e.description && !e.error ? (b(), d("p", {
|
|
266
266
|
key: 0,
|
|
267
267
|
id: t.value,
|
|
268
268
|
class: "fg-field__description",
|
|
269
269
|
"data-field-description": ""
|
|
270
|
-
},
|
|
271
|
-
e.error ? (
|
|
270
|
+
}, E(e.description), 9, Ce)) : u("", !0),
|
|
271
|
+
e.error ? (b(), d("p", {
|
|
272
272
|
key: 1,
|
|
273
273
|
id: n.value,
|
|
274
274
|
class: "fg-field__error",
|
|
275
275
|
"data-field-error": ""
|
|
276
|
-
},
|
|
277
|
-
], 8,
|
|
276
|
+
}, E(e.error), 9, we)) : u("", !0)
|
|
277
|
+
], 8, xe));
|
|
278
278
|
}
|
|
279
|
-
}),
|
|
279
|
+
}), Ee = { class: "fg-figure" }, De = ["aria-labelledby", "aria-label"], Oe = ["id"], ke = {
|
|
280
280
|
key: 0,
|
|
281
281
|
class: "fg-figure__number"
|
|
282
|
-
},
|
|
282
|
+
}, Ae = /* @__PURE__ */ h({
|
|
283
283
|
__name: "UiFigure",
|
|
284
284
|
props: { number: { default: () => void 0 } },
|
|
285
285
|
setup(e) {
|
|
286
|
-
let t = k(), n =
|
|
287
|
-
return (t, i) => (
|
|
286
|
+
let t = k(), n = O(), r = () => e.number !== void 0 || !!t.caption;
|
|
287
|
+
return (t, i) => (b(), d("figure", Ee, [f("div", {
|
|
288
288
|
class: "fg-figure__plate",
|
|
289
289
|
role: "region",
|
|
290
290
|
tabindex: "0",
|
|
291
|
-
"aria-labelledby": r() ?
|
|
291
|
+
"aria-labelledby": r() ? D(n) : void 0,
|
|
292
292
|
"aria-label": r() ? void 0 : "Figure"
|
|
293
|
-
}, [
|
|
293
|
+
}, [w(t.$slots, "default")], 8, De), r() ? (b(), d("figcaption", {
|
|
294
294
|
key: 0,
|
|
295
|
-
id:
|
|
295
|
+
id: D(n),
|
|
296
296
|
class: "fg-figure__caption"
|
|
297
297
|
}, [
|
|
298
|
-
e.number === void 0 ?
|
|
299
|
-
i[0] ||=
|
|
300
|
-
|
|
301
|
-
], 8,
|
|
298
|
+
e.number === void 0 ? u("", !0) : (b(), d("span", ke, "Figure " + E(e.number) + ".", 1)),
|
|
299
|
+
i[0] ||= p(),
|
|
300
|
+
w(t.$slots, "caption")
|
|
301
|
+
], 8, Oe)) : u("", !0)]));
|
|
302
302
|
}
|
|
303
|
-
}),
|
|
303
|
+
}), je = /* @__PURE__ */ h({
|
|
304
304
|
__name: "UiInput",
|
|
305
305
|
props: {
|
|
306
306
|
disabled: {
|
|
@@ -318,16 +318,16 @@ var H = { class: "fg-card" }, U = {
|
|
|
318
318
|
},
|
|
319
319
|
emits: ["update:modelValue"],
|
|
320
320
|
setup(e, { emit: t }) {
|
|
321
|
-
let n =
|
|
321
|
+
let n = g(Z, void 0), r = t, i = (e) => {
|
|
322
322
|
e.currentTarget instanceof HTMLInputElement && r("update:modelValue", e.currentTarget.value);
|
|
323
323
|
};
|
|
324
|
-
return (t, r) => (
|
|
325
|
-
id:
|
|
324
|
+
return (t, r) => (b(), l(D(N), {
|
|
325
|
+
id: D(n)?.controlId.value ?? e.id,
|
|
326
326
|
as: "input",
|
|
327
327
|
class: "fg-input",
|
|
328
|
-
"aria-describedby":
|
|
329
|
-
"aria-errormessage":
|
|
330
|
-
"aria-invalid": e.invalid ||
|
|
328
|
+
"aria-describedby": D(n)?.descriptionId.value,
|
|
329
|
+
"aria-errormessage": D(n)?.errorId.value,
|
|
330
|
+
"aria-invalid": e.invalid || D(n)?.invalid.value ? "true" : void 0,
|
|
331
331
|
"data-size": e.size,
|
|
332
332
|
disabled: e.disabled,
|
|
333
333
|
type: e.type,
|
|
@@ -344,7 +344,7 @@ var H = { class: "fg-card" }, U = {
|
|
|
344
344
|
"value"
|
|
345
345
|
]));
|
|
346
346
|
}
|
|
347
|
-
}),
|
|
347
|
+
}), Me = 100, Ne = /* @__PURE__ */ h({
|
|
348
348
|
__name: "UiProgress",
|
|
349
349
|
props: {
|
|
350
350
|
label: {},
|
|
@@ -352,22 +352,22 @@ var H = { class: "fg-card" }, U = {
|
|
|
352
352
|
value: {}
|
|
353
353
|
},
|
|
354
354
|
setup(e) {
|
|
355
|
-
let t =
|
|
356
|
-
let t = Number.isFinite(e.max) && e.max > 0 ? e.max :
|
|
355
|
+
let t = c(() => {
|
|
356
|
+
let t = Number.isFinite(e.max) && e.max > 0 ? e.max : Me;
|
|
357
357
|
return {
|
|
358
358
|
max: t,
|
|
359
359
|
value: e.value === null || !Number.isFinite(e.value) ? null : Math.min(t, Math.max(0, e.value))
|
|
360
360
|
};
|
|
361
|
-
}), n =
|
|
362
|
-
return (r, i) => (
|
|
361
|
+
}), n = c(() => t.value.value === null ? 0 : t.value.value / t.value.max * 100);
|
|
362
|
+
return (r, i) => (b(), l(D(F), {
|
|
363
363
|
class: "fg-progress",
|
|
364
364
|
"aria-label": e.label,
|
|
365
365
|
max: t.value.max,
|
|
366
366
|
"model-value": t.value.value
|
|
367
367
|
}, {
|
|
368
|
-
default: A(() => [
|
|
368
|
+
default: A(() => [m(D(P), {
|
|
369
369
|
class: "fg-progress__indicator",
|
|
370
|
-
style:
|
|
370
|
+
style: y({ transform: `translateX(-${100 - n.value}%)` })
|
|
371
371
|
}, null, 8, ["style"])]),
|
|
372
372
|
_: 1
|
|
373
373
|
}, 8, [
|
|
@@ -376,7 +376,7 @@ var H = { class: "fg-card" }, U = {
|
|
|
376
376
|
"model-value"
|
|
377
377
|
]));
|
|
378
378
|
}
|
|
379
|
-
}),
|
|
379
|
+
}), Pe = { class: "fg-radio-card__content" }, Fe = /* @__PURE__ */ h({
|
|
380
380
|
__name: "UiRadioCard",
|
|
381
381
|
props: {
|
|
382
382
|
disabled: {
|
|
@@ -386,21 +386,21 @@ var H = { class: "fg-card" }, U = {
|
|
|
386
386
|
value: {}
|
|
387
387
|
},
|
|
388
388
|
setup(e) {
|
|
389
|
-
return (t, n) => (
|
|
389
|
+
return (t, n) => (b(), l(D(I), {
|
|
390
390
|
class: "fg-radio-card",
|
|
391
391
|
disabled: e.disabled,
|
|
392
392
|
value: e.value
|
|
393
393
|
}, {
|
|
394
|
-
default: A(() => [n[0] ||=
|
|
394
|
+
default: A(() => [n[0] ||= f("span", {
|
|
395
395
|
class: "fg-radio-card__indicator",
|
|
396
396
|
"aria-hidden": "true"
|
|
397
|
-
}, null, -1),
|
|
397
|
+
}, null, -1), f("span", Pe, [w(t.$slots, "default")])]),
|
|
398
398
|
_: 3
|
|
399
399
|
}, 8, ["disabled", "value"]));
|
|
400
400
|
}
|
|
401
|
-
}),
|
|
401
|
+
}), Ie = /* @__PURE__ */ h({
|
|
402
402
|
__name: "UiRadioCardGroup",
|
|
403
|
-
props: /*@__PURE__*/
|
|
403
|
+
props: /*@__PURE__*/ _({
|
|
404
404
|
disabled: {
|
|
405
405
|
type: Boolean,
|
|
406
406
|
default: !1
|
|
@@ -416,7 +416,7 @@ var H = { class: "fg-card" }, U = {
|
|
|
416
416
|
}),
|
|
417
417
|
emits: ["update:modelValue"],
|
|
418
418
|
setup(e) {
|
|
419
|
-
let t =
|
|
419
|
+
let t = ne(e, "modelValue"), n = (t) => {
|
|
420
420
|
if (t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
421
421
|
let n = t.currentTarget, r = t.target;
|
|
422
422
|
if (!(n instanceof HTMLElement) || !(r instanceof HTMLElement)) return;
|
|
@@ -432,14 +432,14 @@ var H = { class: "fg-card" }, U = {
|
|
|
432
432
|
let d = o[u];
|
|
433
433
|
!d || d === r || (t.preventDefault(), d.focus(), d.click());
|
|
434
434
|
};
|
|
435
|
-
return (r, i) => (
|
|
435
|
+
return (r, i) => (b(), l(D(L), v({
|
|
436
436
|
modelValue: t.value,
|
|
437
437
|
"onUpdate:modelValue": i[0] ||= (e) => t.value = e,
|
|
438
438
|
class: "fg-radio-card-group",
|
|
439
439
|
disabled: e.disabled,
|
|
440
440
|
loop: e.loop
|
|
441
441
|
}, e.orientation === void 0 ? {} : { orientation: e.orientation }, { onKeydown: n }), {
|
|
442
|
-
default: A(() => [
|
|
442
|
+
default: A(() => [w(r.$slots, "default")]),
|
|
443
443
|
_: 3
|
|
444
444
|
}, 16, [
|
|
445
445
|
"modelValue",
|
|
@@ -447,30 +447,30 @@ var H = { class: "fg-card" }, U = {
|
|
|
447
447
|
"loop"
|
|
448
448
|
]));
|
|
449
449
|
}
|
|
450
|
-
}),
|
|
450
|
+
}), Le = { class: "fg-score" }, Re = {
|
|
451
451
|
class: "fg-score__pips",
|
|
452
452
|
"aria-hidden": "true"
|
|
453
|
-
},
|
|
453
|
+
}, ze = ["data-filled"], Be = { class: "fg-score__value" }, Ve = { class: "fg-score__max" }, Q = 3, $ = /* @__PURE__ */ h({
|
|
454
454
|
__name: "UiScore",
|
|
455
455
|
props: {
|
|
456
456
|
max: { default: () => Q },
|
|
457
457
|
score: {}
|
|
458
458
|
},
|
|
459
459
|
setup(e) {
|
|
460
|
-
let t =
|
|
460
|
+
let t = c(() => {
|
|
461
461
|
let t = Number.isInteger(e.max) && e.max > 0 ? e.max : Q;
|
|
462
462
|
return {
|
|
463
463
|
max: t,
|
|
464
464
|
score: Number.isFinite(e.score) ? Math.min(t, Math.max(0, e.score)) : 0
|
|
465
465
|
};
|
|
466
466
|
});
|
|
467
|
-
return (e, n) => (
|
|
467
|
+
return (e, n) => (b(), d("span", Le, [f("span", Re, [(b(!0), d(s, null, C(t.value.max, (e) => (b(), d("span", {
|
|
468
468
|
key: e,
|
|
469
469
|
class: "fg-score__pip",
|
|
470
470
|
"data-filled": e <= t.value.score ? "true" : void 0
|
|
471
|
-
}, null, 8,
|
|
471
|
+
}, null, 8, ze))), 128))]), f("span", Be, [p(E(t.value.score), 1), f("span", Ve, "/" + E(t.value.max), 1)])]));
|
|
472
472
|
}
|
|
473
|
-
}),
|
|
473
|
+
}), He = /* @__PURE__ */ h({
|
|
474
474
|
__name: "UiSelect",
|
|
475
475
|
props: {
|
|
476
476
|
disabled: {
|
|
@@ -487,22 +487,22 @@ var H = { class: "fg-card" }, U = {
|
|
|
487
487
|
},
|
|
488
488
|
emits: ["update:modelValue"],
|
|
489
489
|
setup(e, { emit: t }) {
|
|
490
|
-
let n =
|
|
490
|
+
let n = g(Z, void 0), r = t, i = (e) => {
|
|
491
491
|
e.currentTarget instanceof HTMLSelectElement && r("update:modelValue", e.currentTarget.value);
|
|
492
492
|
};
|
|
493
|
-
return (t, r) => (
|
|
494
|
-
id:
|
|
493
|
+
return (t, r) => (b(), l(D(N), {
|
|
494
|
+
id: D(n)?.controlId.value ?? e.id,
|
|
495
495
|
as: "select",
|
|
496
496
|
class: "fg-select",
|
|
497
|
-
"aria-describedby":
|
|
498
|
-
"aria-errormessage":
|
|
499
|
-
"aria-invalid": e.invalid ||
|
|
497
|
+
"aria-describedby": D(n)?.descriptionId.value,
|
|
498
|
+
"aria-errormessage": D(n)?.errorId.value,
|
|
499
|
+
"aria-invalid": e.invalid || D(n)?.invalid.value ? "true" : void 0,
|
|
500
500
|
"data-size": e.size,
|
|
501
501
|
disabled: e.disabled,
|
|
502
502
|
value: e.modelValue,
|
|
503
503
|
onChange: i
|
|
504
504
|
}, {
|
|
505
|
-
default: A(() => [
|
|
505
|
+
default: A(() => [w(t.$slots, "default")]),
|
|
506
506
|
_: 3
|
|
507
507
|
}, 8, [
|
|
508
508
|
"id",
|
|
@@ -514,7 +514,7 @@ var H = { class: "fg-card" }, U = {
|
|
|
514
514
|
"value"
|
|
515
515
|
]));
|
|
516
516
|
}
|
|
517
|
-
}),
|
|
517
|
+
}), Ue = /* @__PURE__ */ h({
|
|
518
518
|
__name: "UiSlider",
|
|
519
519
|
props: {
|
|
520
520
|
disabled: {
|
|
@@ -531,14 +531,14 @@ var H = { class: "fg-card" }, U = {
|
|
|
531
531
|
},
|
|
532
532
|
emits: ["update:modelValue"],
|
|
533
533
|
setup(e, { emit: t }) {
|
|
534
|
-
let n =
|
|
534
|
+
let n = g(Z, void 0), r = c(() => {
|
|
535
535
|
let t = Number.isFinite(e.min) ? e.min : 0;
|
|
536
536
|
return {
|
|
537
537
|
max: Number.isFinite(e.max) && e.max > t ? e.max : t + 100,
|
|
538
538
|
min: t,
|
|
539
539
|
step: Number.isFinite(e.step) && e.step > 0 ? e.step : 1
|
|
540
540
|
};
|
|
541
|
-
}), i = t, a =
|
|
541
|
+
}), i = t, a = c({
|
|
542
542
|
get: () => {
|
|
543
543
|
let t = e.modelValue !== void 0 && Number.isFinite(e.modelValue) ? e.modelValue : r.value.min;
|
|
544
544
|
return [Math.min(r.value.max, Math.max(r.value.min, t))];
|
|
@@ -547,7 +547,7 @@ var H = { class: "fg-card" }, U = {
|
|
|
547
547
|
e !== void 0 && i("update:modelValue", e);
|
|
548
548
|
}
|
|
549
549
|
});
|
|
550
|
-
return (t, i) => (
|
|
550
|
+
return (t, i) => (b(), l(D(z), {
|
|
551
551
|
modelValue: a.value,
|
|
552
552
|
"onUpdate:modelValue": i[0] ||= (e) => a.value = e,
|
|
553
553
|
class: "fg-slider",
|
|
@@ -557,15 +557,15 @@ var H = { class: "fg-card" }, U = {
|
|
|
557
557
|
min: r.value.min,
|
|
558
558
|
step: r.value.step
|
|
559
559
|
}, {
|
|
560
|
-
default: A(() => [
|
|
561
|
-
default: A(() => [
|
|
560
|
+
default: A(() => [m(D(V), { class: "fg-slider__track" }, {
|
|
561
|
+
default: A(() => [m(D(R), { class: "fg-slider__range" })]),
|
|
562
562
|
_: 1
|
|
563
|
-
}),
|
|
564
|
-
id:
|
|
563
|
+
}), m(D(B), {
|
|
564
|
+
id: D(n)?.controlId.value ?? e.id,
|
|
565
565
|
class: "fg-slider__thumb",
|
|
566
|
-
"aria-describedby":
|
|
567
|
-
"aria-errormessage":
|
|
568
|
-
"aria-invalid":
|
|
566
|
+
"aria-describedby": D(n)?.descriptionId.value,
|
|
567
|
+
"aria-errormessage": D(n)?.errorId.value,
|
|
568
|
+
"aria-invalid": D(n)?.invalid.value ? "true" : void 0,
|
|
569
569
|
"aria-label": e.label
|
|
570
570
|
}, null, 8, [
|
|
571
571
|
"id",
|
|
@@ -584,17 +584,17 @@ var H = { class: "fg-card" }, U = {
|
|
|
584
584
|
"step"
|
|
585
585
|
]));
|
|
586
586
|
}
|
|
587
|
-
}),
|
|
587
|
+
}), We = ["data-size", "data-disabled"], Ge = [
|
|
588
588
|
"id",
|
|
589
589
|
"aria-checked",
|
|
590
590
|
"aria-describedby",
|
|
591
591
|
"aria-errormessage",
|
|
592
592
|
"aria-invalid",
|
|
593
593
|
"disabled"
|
|
594
|
-
],
|
|
594
|
+
], Ke = {
|
|
595
595
|
key: 0,
|
|
596
596
|
class: "fg-switch__text"
|
|
597
|
-
},
|
|
597
|
+
}, qe = ["for"], Je = ["id"], Ye = /* @__PURE__ */ h({
|
|
598
598
|
inheritAttrs: !1,
|
|
599
599
|
__name: "UiSwitch",
|
|
600
600
|
props: {
|
|
@@ -613,44 +613,44 @@ var H = { class: "fg-card" }, U = {
|
|
|
613
613
|
},
|
|
614
614
|
emits: ["update:modelValue"],
|
|
615
615
|
setup(e, { emit: t }) {
|
|
616
|
-
let n = t, r = k(), i =
|
|
616
|
+
let n = t, r = k(), i = te(), a = g(Z, void 0), o = O(), s = c(() => a?.controlId.value ?? e.id ?? o), l = c(() => `${s.value}-switch-description`), m = () => [
|
|
617
617
|
i["aria-describedby"],
|
|
618
618
|
a?.descriptionId.value,
|
|
619
|
-
e.description ?
|
|
620
|
-
].filter(Boolean).join(" ") || void 0,
|
|
619
|
+
e.description ? l.value : void 0
|
|
620
|
+
].filter(Boolean).join(" ") || void 0, h = () => {
|
|
621
621
|
e.disabled || n("update:modelValue", !e.modelValue);
|
|
622
622
|
};
|
|
623
|
-
return (t, n) => (
|
|
623
|
+
return (t, n) => (b(), d("div", {
|
|
624
624
|
class: "fg-switch",
|
|
625
625
|
"data-size": e.size,
|
|
626
626
|
"data-disabled": e.disabled ? "true" : void 0
|
|
627
|
-
}, [
|
|
628
|
-
id:
|
|
627
|
+
}, [f("button", v(D(i), {
|
|
628
|
+
id: s.value,
|
|
629
629
|
class: "fg-switch__control",
|
|
630
630
|
type: "button",
|
|
631
631
|
role: "switch",
|
|
632
632
|
"aria-checked": e.modelValue,
|
|
633
633
|
"aria-describedby": m(),
|
|
634
|
-
"aria-errormessage":
|
|
635
|
-
"aria-invalid":
|
|
634
|
+
"aria-errormessage": D(a)?.errorId.value,
|
|
635
|
+
"aria-invalid": D(a)?.invalid.value ? "true" : void 0,
|
|
636
636
|
disabled: e.disabled,
|
|
637
|
-
onClick:
|
|
638
|
-
}), [...n[0] ||= [
|
|
637
|
+
onClick: h
|
|
638
|
+
}), [...n[0] ||= [f("span", {
|
|
639
639
|
class: "fg-switch__track",
|
|
640
640
|
"aria-hidden": "true"
|
|
641
|
-
}, null, -1)]], 16,
|
|
641
|
+
}, null, -1)]], 16, Ge), r.default || e.label || e.description ? (b(), d("span", Ke, [r.default || e.label ? (b(), d("label", {
|
|
642
642
|
key: 0,
|
|
643
|
-
for:
|
|
644
|
-
}, [
|
|
643
|
+
for: s.value
|
|
644
|
+
}, [w(t.$slots, "default", {}, () => [p(E(e.label), 1)])], 8, qe)) : u("", !0), e.description ? (b(), d("span", {
|
|
645
645
|
key: 1,
|
|
646
|
-
id:
|
|
646
|
+
id: l.value,
|
|
647
647
|
class: "fg-switch__description"
|
|
648
|
-
},
|
|
648
|
+
}, E(e.description), 9, Je)) : u("", !0)])) : u("", !0)], 8, We));
|
|
649
649
|
}
|
|
650
|
-
}),
|
|
650
|
+
}), Xe = { class: "fg-toggle-button__text" }, Ze = { class: "fg-toggle-button__label" }, Qe = {
|
|
651
651
|
key: 0,
|
|
652
652
|
class: "fg-toggle-button__description"
|
|
653
|
-
},
|
|
653
|
+
}, $e = /* @__PURE__ */ h({
|
|
654
654
|
__name: "UiToggleButton",
|
|
655
655
|
props: {
|
|
656
656
|
disabled: {
|
|
@@ -668,17 +668,17 @@ var H = { class: "fg-card" }, U = {
|
|
|
668
668
|
let n = t, r = k(), i = (e) => {
|
|
669
669
|
n("update:pressed", e);
|
|
670
670
|
};
|
|
671
|
-
return (t, n) => (
|
|
671
|
+
return (t, n) => (b(), l(D(H), {
|
|
672
672
|
class: "fg-toggle-button",
|
|
673
673
|
"data-size": e.size,
|
|
674
674
|
disabled: e.disabled,
|
|
675
675
|
"model-value": e.pressed,
|
|
676
676
|
"onUpdate:modelValue": i
|
|
677
677
|
}, {
|
|
678
|
-
default: A(() => [n[0] ||=
|
|
678
|
+
default: A(() => [n[0] ||= f("span", {
|
|
679
679
|
class: "fg-toggle-button__switch",
|
|
680
680
|
"aria-hidden": "true"
|
|
681
|
-
}, null, -1),
|
|
681
|
+
}, null, -1), f("span", Xe, [f("span", Ze, [w(t.$slots, "default")]), r.description ? (b(), d("span", Qe, [w(t.$slots, "description")])) : u("", !0)])]),
|
|
682
682
|
_: 3
|
|
683
683
|
}, 8, [
|
|
684
684
|
"data-size",
|
|
@@ -686,22 +686,22 @@ var H = { class: "fg-card" }, U = {
|
|
|
686
686
|
"model-value"
|
|
687
687
|
]));
|
|
688
688
|
}
|
|
689
|
-
}),
|
|
689
|
+
}), et = /* @__PURE__ */ h({
|
|
690
690
|
__name: "UiSurface",
|
|
691
691
|
props: {
|
|
692
692
|
as: { default: "section" },
|
|
693
693
|
padding: { default: "default" }
|
|
694
694
|
},
|
|
695
695
|
setup(e) {
|
|
696
|
-
return (t, n) => (
|
|
696
|
+
return (t, n) => (b(), l(D(N), {
|
|
697
697
|
as: e.as,
|
|
698
698
|
class: "fg-surface",
|
|
699
699
|
"data-padding": e.padding
|
|
700
700
|
}, {
|
|
701
|
-
default: A(() => [
|
|
701
|
+
default: A(() => [w(t.$slots, "default")]),
|
|
702
702
|
_: 3
|
|
703
703
|
}, 8, ["as", "data-padding"]));
|
|
704
704
|
}
|
|
705
705
|
});
|
|
706
706
|
//#endregion
|
|
707
|
-
export {
|
|
707
|
+
export { ge as UiAlert, _e as UiBadge, a as UiButton, J as UiCard, be as UiCheckbox, he as UiCodeBlock, e as UiDialog, t as UiDrawer, Te as UiField, Ae as UiFigure, je as UiInput, Ne as UiProgress, Fe as UiRadioCard, Ie as UiRadioCardGroup, $ as UiScore, i as UiSegmentedControl, He as UiSelect, Ue as UiSlider, et as UiSurface, Ye as UiSwitch, n as UiTabs, $e as UiToggleButton, o as useActiveSection };
|