@filipgutica/ui 1.2.0 → 1.4.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 +47 -0
- package/dist/components/UiCodeBlock.vue.d.ts +1 -0
- package/dist/index.js +125 -108
- package/dist/site/UiSiteHeader.vue.d.ts +24 -0
- package/dist/site/appearance.d.ts +35 -0
- package/dist/site/index.d.ts +6 -0
- package/dist/site/projects.d.ts +36 -0
- package/dist/site.js +177 -0
- package/package.json +13 -3
- package/src/components.css +52 -7
- package/src/site.css +169 -0
- package/src/themes/graphite-indigo.css +111 -0
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, inject as l, mergeModels as u, mergeProps as d, normalizeStyle as f, onMounted as p, onUnmounted as m, openBlock as h, provide as g, readonly as _, ref as v, renderList as y, renderSlot as b, resolveDynamicComponent as x, shallowRef as
|
|
2
|
-
import { CheckboxIndicator as O, CheckboxRoot as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, inject as l, mergeModels as u, mergeProps as d, normalizeStyle as f, onMounted as p, onUnmounted as m, openBlock as h, provide as g, readonly as _, ref as v, renderList as y, renderSlot as b, resolveDynamicComponent as x, shallowRef as S, toDisplayString as C, unref as w, useId as T, useModel as E, useSlots as ee, watch as te, withCtx as D } from "vue";
|
|
2
|
+
import { CheckboxIndicator as O, CheckboxRoot as k, DialogClose as A, DialogContent as j, DialogDescription as ne, DialogOverlay as M, DialogPortal as N, DialogRoot as P, DialogTitle as F, DialogTrigger as I, Primitive as L, ProgressIndicator as R, ProgressRoot as z, RadioGroupItem as B, RadioGroupRoot as V, SliderRange as H, SliderRoot as U, SliderThumb as W, SliderTrack as G } from "reka-ui";
|
|
3
3
|
import { useTimeoutFn as K } from "@vueuse/core";
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/components/UiButton.vue
|
|
@@ -19,7 +19,7 @@ var q = /* @__PURE__ */ c({
|
|
|
19
19
|
variant: { default: "primary" }
|
|
20
20
|
},
|
|
21
21
|
setup(e) {
|
|
22
|
-
return (t, r) => (h(), n(
|
|
22
|
+
return (t, r) => (h(), n(w(L), {
|
|
23
23
|
as: "button",
|
|
24
24
|
class: "fg-button",
|
|
25
25
|
"data-size": e.size,
|
|
@@ -57,30 +57,46 @@ var q = /* @__PURE__ */ c({
|
|
|
57
57
|
titleTag: { default: "h3" }
|
|
58
58
|
},
|
|
59
59
|
setup(e) {
|
|
60
|
-
let t =
|
|
60
|
+
let t = ee();
|
|
61
61
|
return (a, s) => (h(), i("div", J, [
|
|
62
62
|
e.title || t.title || t.actions ? (h(), i("header", Y, [e.title || t.title ? (h(), n(x(e.titleTag), {
|
|
63
63
|
key: 0,
|
|
64
64
|
class: "fg-card__title"
|
|
65
65
|
}, {
|
|
66
|
-
default: D(() => [b(a.$slots, "title", {}, () => [o(
|
|
66
|
+
default: D(() => [b(a.$slots, "title", {}, () => [o(C(e.title), 1)])]),
|
|
67
67
|
_: 3
|
|
68
68
|
})) : r("", !0), t.actions ? (h(), i("div", X, [b(a.$slots, "actions")])) : r("", !0)])) : r("", !0),
|
|
69
69
|
t.default ? (h(), i("div", Z, [b(a.$slots, "default")])) : r("", !0),
|
|
70
70
|
t.footer ? (h(), i("footer", re, [b(a.$slots, "footer")])) : r("", !0)
|
|
71
71
|
]));
|
|
72
72
|
}
|
|
73
|
-
}), ae = [
|
|
73
|
+
}), ae = [
|
|
74
|
+
"data-wrap",
|
|
75
|
+
"data-line-numbers",
|
|
76
|
+
"data-variant"
|
|
77
|
+
], oe = {
|
|
74
78
|
key: 0,
|
|
79
|
+
class: "fg-code-block__header"
|
|
80
|
+
}, se = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "fg-code-block__title"
|
|
83
|
+
}, ce = {
|
|
84
|
+
key: 1,
|
|
75
85
|
class: "fg-code-block__language"
|
|
76
|
-
}, le = { class: "fg-code-block__actions" }, ue = ["disabled"
|
|
86
|
+
}, le = { class: "fg-code-block__actions" }, ue = ["disabled", "title"], de = {
|
|
87
|
+
viewBox: "0 0 24 24",
|
|
88
|
+
fill: "none",
|
|
89
|
+
stroke: "currentColor",
|
|
90
|
+
"stroke-width": "1.5",
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
}, fe = {
|
|
93
|
+
key: 0,
|
|
94
|
+
d: "m5 12 4 4L19 6"
|
|
95
|
+
}, pe = { key: 0 }, me = ["aria-label"], he = {
|
|
77
96
|
key: 0,
|
|
78
97
|
class: "fg-code-block__number",
|
|
79
98
|
"aria-hidden": "true"
|
|
80
|
-
},
|
|
81
|
-
class: "fg-code-block__status",
|
|
82
|
-
role: "status"
|
|
83
|
-
}, he = /* @__PURE__ */ c({
|
|
99
|
+
}, ge = { class: "fg-code-block__text" }, _e = ["data-state"], ve = /* @__PURE__ */ c({
|
|
84
100
|
__name: "UiCodeBlock",
|
|
85
101
|
props: {
|
|
86
102
|
code: {},
|
|
@@ -97,10 +113,11 @@ var q = /* @__PURE__ */ c({
|
|
|
97
113
|
wrap: {
|
|
98
114
|
type: Boolean,
|
|
99
115
|
default: !1
|
|
100
|
-
}
|
|
116
|
+
},
|
|
117
|
+
variant: { default: "default" }
|
|
101
118
|
},
|
|
102
119
|
setup(n) {
|
|
103
|
-
let s =
|
|
120
|
+
let s = S(), c = v(""), l = t(() => s.value ?? n.code.split("\n").map((e) => [{ content: e }])), u = {
|
|
104
121
|
vue: "vue",
|
|
105
122
|
ts: "typescript",
|
|
106
123
|
typescript: "typescript",
|
|
@@ -113,7 +130,7 @@ var q = /* @__PURE__ */ c({
|
|
|
113
130
|
sh: "bash",
|
|
114
131
|
shell: "bash"
|
|
115
132
|
};
|
|
116
|
-
|
|
133
|
+
te(() => [n.code, n.language], async ([e, t], n, r) => {
|
|
117
134
|
let i = !1;
|
|
118
135
|
r(() => {
|
|
119
136
|
i = !0;
|
|
@@ -138,7 +155,7 @@ var q = /* @__PURE__ */ c({
|
|
|
138
155
|
}, { immediate: !0 });
|
|
139
156
|
let d = v(!1), { start: p } = K(() => {
|
|
140
157
|
d.value = !1;
|
|
141
|
-
}, 1500, { immediate: !1 }), m = v(!1), g = v(""), _ = async () => {
|
|
158
|
+
}, 1500, { immediate: !1 }), m = v(!1), g = v(""), _ = t(() => d.value && !g.value), x = t(() => n.variant === "compact" && _.value && !c.value), w = t(() => g.value ? g.value : n.variant === "compact" && c.value ? d.value ? `Code copied to clipboard. ${c.value}` : c.value : d.value ? "Code copied to clipboard." : c.value), T = async () => {
|
|
142
159
|
if (g.value = "", d.value = !1, typeof navigator > "u" || !navigator.clipboard?.writeText) {
|
|
143
160
|
g.value = "Clipboard unavailable. Select the code to copy it.";
|
|
144
161
|
return;
|
|
@@ -155,32 +172,28 @@ var q = /* @__PURE__ */ c({
|
|
|
155
172
|
return (t, s) => (h(), i("div", {
|
|
156
173
|
class: "fg-code-block",
|
|
157
174
|
"data-wrap": n.wrap,
|
|
158
|
-
"data-line-numbers": n.lineNumbers
|
|
175
|
+
"data-line-numbers": n.lineNumbers,
|
|
176
|
+
"data-variant": n.variant
|
|
159
177
|
}, [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
n.title ? (h(), i("span", ce,
|
|
178
|
+
n.variant === "default" || n.copyable || t.$slots.actions ? (h(), i("div", oe, [
|
|
179
|
+
n.variant === "default" ? (h(), i("span", se, C(n.title || n.language), 1)) : r("", !0),
|
|
180
|
+
n.title && n.variant === "default" ? (h(), i("span", ce, C(n.language), 1)) : r("", !0),
|
|
163
181
|
a("div", le, [b(t.$slots, "actions"), n.copyable ? (h(), i("button", {
|
|
164
182
|
key: 0,
|
|
165
183
|
type: "button",
|
|
166
184
|
class: "fg-code-block__copy",
|
|
167
185
|
disabled: m.value,
|
|
168
186
|
"aria-label": "Copy code",
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
fill: "none",
|
|
173
|
-
stroke: "currentColor",
|
|
174
|
-
"stroke-width": "1.5",
|
|
175
|
-
"aria-hidden": "true"
|
|
176
|
-
}, [a("rect", {
|
|
187
|
+
title: n.variant === "compact" ? _.value ? "Copied" : "Copy code" : void 0,
|
|
188
|
+
onClick: T
|
|
189
|
+
}, [(h(), i("svg", de, [n.variant === "compact" && _.value ? (h(), i("path", fe)) : (h(), i(e, { key: 1 }, [s[0] ||= a("rect", {
|
|
177
190
|
x: "8",
|
|
178
191
|
y: "8",
|
|
179
192
|
width: "12",
|
|
180
193
|
height: "13",
|
|
181
194
|
rx: "2"
|
|
182
|
-
}), a("path", { d: "M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3" }
|
|
183
|
-
]),
|
|
195
|
+
}, null, -1), s[1] ||= a("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))])), n.variant === "default" ? (h(), i("span", pe, C(_.value ? "Copied" : "Copy"), 1)) : r("", !0)], 8, ue)) : r("", !0)])
|
|
196
|
+
])) : r("", !0),
|
|
184
197
|
a("pre", {
|
|
185
198
|
class: "fg-code-block__pre",
|
|
186
199
|
tabindex: "0",
|
|
@@ -188,18 +201,22 @@ var q = /* @__PURE__ */ c({
|
|
|
188
201
|
}, [a("code", null, [(h(!0), i(e, null, y(l.value, (t, s) => (h(), i("span", {
|
|
189
202
|
key: s,
|
|
190
203
|
class: "fg-code-block__line"
|
|
191
|
-
}, [n.lineNumbers ? (h(), i("span",
|
|
204
|
+
}, [n.lineNumbers ? (h(), i("span", he, C(s + 1), 1)) : r("", !0), a("span", ge, [(h(!0), i(e, null, y(t, (e, t) => (h(), i("span", {
|
|
192
205
|
key: t,
|
|
193
206
|
style: f({ color: e.color })
|
|
194
|
-
},
|
|
195
|
-
a("span",
|
|
207
|
+
}, C(e.content), 5))), 128)), o(C(s < l.value.length - 1 ? "\n" : ""), 1)])]))), 128))])], 8, me),
|
|
208
|
+
a("span", {
|
|
209
|
+
class: "fg-code-block__status",
|
|
210
|
+
role: "status",
|
|
211
|
+
"data-state": x.value ? "success" : void 0
|
|
212
|
+
}, C(w.value), 9, _e)
|
|
196
213
|
], 8, ae));
|
|
197
214
|
}
|
|
198
|
-
}),
|
|
215
|
+
}), ye = /* @__PURE__ */ c({
|
|
199
216
|
__name: "UiAlert",
|
|
200
217
|
props: { tone: { default: "neutral" } },
|
|
201
218
|
setup(e) {
|
|
202
|
-
return (t, r) => (h(), n(
|
|
219
|
+
return (t, r) => (h(), n(w(L), {
|
|
203
220
|
as: "div",
|
|
204
221
|
class: "fg-alert",
|
|
205
222
|
"data-tone": e.tone,
|
|
@@ -209,11 +226,11 @@ var q = /* @__PURE__ */ c({
|
|
|
209
226
|
_: 3
|
|
210
227
|
}, 8, ["data-tone", "role"]));
|
|
211
228
|
}
|
|
212
|
-
}),
|
|
229
|
+
}), be = /* @__PURE__ */ c({
|
|
213
230
|
__name: "UiBadge",
|
|
214
231
|
props: { tone: { default: "neutral" } },
|
|
215
232
|
setup(e) {
|
|
216
|
-
return (t, r) => (h(), n(
|
|
233
|
+
return (t, r) => (h(), n(w(L), {
|
|
217
234
|
as: "span",
|
|
218
235
|
class: "fg-badge",
|
|
219
236
|
"data-tone": e.tone
|
|
@@ -222,7 +239,7 @@ var q = /* @__PURE__ */ c({
|
|
|
222
239
|
_: 3
|
|
223
240
|
}, 8, ["data-tone"]));
|
|
224
241
|
}
|
|
225
|
-
}),
|
|
242
|
+
}), xe = ["data-size", "data-disabled"], Se = { class: "fg-checkbox__label" }, Ce = /* @__PURE__ */ c({
|
|
226
243
|
__name: "UiCheckbox",
|
|
227
244
|
props: {
|
|
228
245
|
disabled: {
|
|
@@ -244,23 +261,23 @@ var q = /* @__PURE__ */ c({
|
|
|
244
261
|
class: "fg-checkbox",
|
|
245
262
|
"data-size": e.size,
|
|
246
263
|
"data-disabled": e.disabled ? "true" : void 0
|
|
247
|
-
}, [s(
|
|
264
|
+
}, [s(w(k), {
|
|
248
265
|
class: "fg-checkbox__control",
|
|
249
266
|
disabled: e.disabled,
|
|
250
267
|
"model-value": e.modelValue,
|
|
251
268
|
"onUpdate:modelValue": r
|
|
252
269
|
}, {
|
|
253
|
-
default: D(() => [s(
|
|
270
|
+
default: D(() => [s(w(O), { class: "fg-checkbox__indicator" }, {
|
|
254
271
|
default: D(() => [...n[0] ||= [o("✓", -1)]]),
|
|
255
272
|
_: 1
|
|
256
273
|
})]),
|
|
257
274
|
_: 1
|
|
258
|
-
}, 8, ["disabled", "model-value"]), a("span",
|
|
275
|
+
}, 8, ["disabled", "model-value"]), a("span", Se, [b(t.$slots, "default")])], 8, xe));
|
|
259
276
|
}
|
|
260
|
-
}),
|
|
277
|
+
}), we = { class: "fg-dialog__header" }, Te = { class: "fg-dialog__body" }, Ee = {
|
|
261
278
|
key: 0,
|
|
262
279
|
class: "fg-dialog__footer"
|
|
263
|
-
},
|
|
280
|
+
}, De = /* @__PURE__ */ c({
|
|
264
281
|
inheritAttrs: !1,
|
|
265
282
|
__name: "UiDialog",
|
|
266
283
|
props: {
|
|
@@ -271,34 +288,34 @@ var q = /* @__PURE__ */ c({
|
|
|
271
288
|
emits: ["update:open"],
|
|
272
289
|
setup(e, { emit: t }) {
|
|
273
290
|
let c = t;
|
|
274
|
-
return (t, l) => (h(), n(
|
|
291
|
+
return (t, l) => (h(), n(w(P), {
|
|
275
292
|
open: e.open,
|
|
276
293
|
"onUpdate:open": l[0] ||= (e) => c("update:open", e)
|
|
277
294
|
}, {
|
|
278
|
-
default: D(() => [s(
|
|
279
|
-
default: D(() => [s(
|
|
295
|
+
default: D(() => [s(w(N), null, {
|
|
296
|
+
default: D(() => [s(w(M), { class: "fg-dialog__overlay" }), s(w(j), d({
|
|
280
297
|
class: "fg-dialog__content",
|
|
281
298
|
"aria-modal": "true"
|
|
282
299
|
}, t.$attrs), {
|
|
283
300
|
default: D(() => [
|
|
284
|
-
a("div",
|
|
285
|
-
default: D(() => [o(
|
|
301
|
+
a("div", we, [a("div", null, [s(w(F), { class: "fg-dialog__title" }, {
|
|
302
|
+
default: D(() => [o(C(e.title), 1)]),
|
|
286
303
|
_: 1
|
|
287
|
-
}), e.description ? (h(), n(
|
|
304
|
+
}), e.description ? (h(), n(w(ne), {
|
|
288
305
|
key: 0,
|
|
289
306
|
class: "fg-dialog__description"
|
|
290
307
|
}, {
|
|
291
|
-
default: D(() => [o(
|
|
308
|
+
default: D(() => [o(C(e.description), 1)]),
|
|
292
309
|
_: 1
|
|
293
|
-
})) : r("", !0)]), s(
|
|
310
|
+
})) : r("", !0)]), s(w(A), {
|
|
294
311
|
class: "fg-dialog__close",
|
|
295
312
|
"aria-label": "Close dialog"
|
|
296
313
|
}, {
|
|
297
314
|
default: D(() => [...l[1] ||= [o(" × ", -1)]]),
|
|
298
315
|
_: 1
|
|
299
316
|
})]),
|
|
300
|
-
a("div",
|
|
301
|
-
t.$slots.footer ? (h(), i("div",
|
|
317
|
+
a("div", Te, [b(t.$slots, "default")]),
|
|
318
|
+
t.$slots.footer ? (h(), i("div", Ee, [b(t.$slots, "footer")])) : r("", !0)
|
|
302
319
|
]),
|
|
303
320
|
_: 3
|
|
304
321
|
}, 16)]),
|
|
@@ -307,7 +324,7 @@ var q = /* @__PURE__ */ c({
|
|
|
307
324
|
_: 3
|
|
308
325
|
}, 8, ["open"]));
|
|
309
326
|
}
|
|
310
|
-
}),
|
|
327
|
+
}), Oe = { class: "fg-drawer__header" }, ke = { class: "fg-drawer__body" }, Ae = /* @__PURE__ */ c({
|
|
311
328
|
inheritAttrs: !1,
|
|
312
329
|
__name: "UiDrawer",
|
|
313
330
|
props: {
|
|
@@ -317,32 +334,32 @@ var q = /* @__PURE__ */ c({
|
|
|
317
334
|
emits: ["update:open", "closeAutoFocus"],
|
|
318
335
|
setup(e, { emit: t }) {
|
|
319
336
|
let i = t;
|
|
320
|
-
return (t, c) => (h(), n(
|
|
337
|
+
return (t, c) => (h(), n(w(P), {
|
|
321
338
|
open: e.open,
|
|
322
339
|
"onUpdate:open": c[1] ||= (e) => i("update:open", e)
|
|
323
340
|
}, {
|
|
324
|
-
default: D(() => [t.$slots.trigger ? (h(), n(
|
|
341
|
+
default: D(() => [t.$slots.trigger ? (h(), n(w(I), {
|
|
325
342
|
key: 0,
|
|
326
343
|
"as-child": ""
|
|
327
344
|
}, {
|
|
328
345
|
default: D(() => [b(t.$slots, "trigger")]),
|
|
329
346
|
_: 3
|
|
330
|
-
})) : r("", !0), s(
|
|
331
|
-
default: D(() => [s(
|
|
347
|
+
})) : r("", !0), s(w(N), null, {
|
|
348
|
+
default: D(() => [s(w(M), { class: "fg-drawer__overlay" }), s(w(j), d({
|
|
332
349
|
class: "fg-drawer__content",
|
|
333
350
|
"aria-modal": "true",
|
|
334
351
|
"aria-describedby": void 0
|
|
335
352
|
}, t.$attrs, { onCloseAutoFocus: c[0] ||= (e) => i("closeAutoFocus", e) }), {
|
|
336
|
-
default: D(() => [a("div",
|
|
337
|
-
default: D(() => [o(
|
|
353
|
+
default: D(() => [a("div", Oe, [s(w(F), { class: "fg-drawer__title" }, {
|
|
354
|
+
default: D(() => [o(C(e.title), 1)]),
|
|
338
355
|
_: 1
|
|
339
|
-
}), s(
|
|
356
|
+
}), s(w(A), {
|
|
340
357
|
class: "fg-drawer__close",
|
|
341
358
|
"aria-label": "Close drawer"
|
|
342
359
|
}, {
|
|
343
360
|
default: D(() => [...c[2] ||= [o(" × ", -1)]]),
|
|
344
361
|
_: 1
|
|
345
|
-
})]), a("div",
|
|
362
|
+
})]), a("div", ke, [b(t.$slots, "default")])]),
|
|
346
363
|
_: 3
|
|
347
364
|
}, 16)]),
|
|
348
365
|
_: 3
|
|
@@ -350,7 +367,7 @@ var q = /* @__PURE__ */ c({
|
|
|
350
367
|
_: 3
|
|
351
368
|
}, 8, ["open"]));
|
|
352
369
|
}
|
|
353
|
-
}), Q = Symbol("UiFieldContext"),
|
|
370
|
+
}), Q = Symbol("UiFieldContext"), je = ["data-invalid"], Me = ["for"], Ne = ["id"], Pe = ["id"], Fe = /* @__PURE__ */ c({
|
|
354
371
|
__name: "UiField",
|
|
355
372
|
props: {
|
|
356
373
|
controlId: {},
|
|
@@ -372,7 +389,7 @@ var q = /* @__PURE__ */ c({
|
|
|
372
389
|
a("label", {
|
|
373
390
|
class: "fg-field__label",
|
|
374
391
|
for: e.controlId
|
|
375
|
-
},
|
|
392
|
+
}, C(e.label), 9, Me),
|
|
376
393
|
b(t.$slots, "default", {
|
|
377
394
|
descriptionId: n.value,
|
|
378
395
|
errorId: o.value
|
|
@@ -382,16 +399,16 @@ var q = /* @__PURE__ */ c({
|
|
|
382
399
|
id: n.value,
|
|
383
400
|
class: "fg-field__description",
|
|
384
401
|
"data-field-description": ""
|
|
385
|
-
},
|
|
402
|
+
}, C(e.description), 9, Ne)) : r("", !0),
|
|
386
403
|
e.error ? (h(), i("p", {
|
|
387
404
|
key: 1,
|
|
388
405
|
id: o.value,
|
|
389
406
|
class: "fg-field__error",
|
|
390
407
|
"data-field-error": ""
|
|
391
|
-
},
|
|
392
|
-
], 8,
|
|
408
|
+
}, C(e.error), 9, Pe)) : r("", !0)
|
|
409
|
+
], 8, je));
|
|
393
410
|
}
|
|
394
|
-
}),
|
|
411
|
+
}), Ie = /* @__PURE__ */ c({
|
|
395
412
|
__name: "UiInput",
|
|
396
413
|
props: {
|
|
397
414
|
disabled: {
|
|
@@ -412,13 +429,13 @@ var q = /* @__PURE__ */ c({
|
|
|
412
429
|
let r = l(Q, void 0), i = t, a = (e) => {
|
|
413
430
|
e.currentTarget instanceof HTMLInputElement && i("update:modelValue", e.currentTarget.value);
|
|
414
431
|
};
|
|
415
|
-
return (t, i) => (h(), n(
|
|
416
|
-
id:
|
|
432
|
+
return (t, i) => (h(), n(w(L), {
|
|
433
|
+
id: w(r)?.controlId.value ?? e.id,
|
|
417
434
|
as: "input",
|
|
418
435
|
class: "fg-input",
|
|
419
|
-
"aria-describedby":
|
|
420
|
-
"aria-errormessage":
|
|
421
|
-
"aria-invalid": e.invalid ||
|
|
436
|
+
"aria-describedby": w(r)?.descriptionId.value,
|
|
437
|
+
"aria-errormessage": w(r)?.errorId.value,
|
|
438
|
+
"aria-invalid": e.invalid || w(r)?.invalid.value ? "true" : void 0,
|
|
422
439
|
"data-size": e.size,
|
|
423
440
|
disabled: e.disabled,
|
|
424
441
|
type: e.type,
|
|
@@ -435,7 +452,7 @@ var q = /* @__PURE__ */ c({
|
|
|
435
452
|
"value"
|
|
436
453
|
]));
|
|
437
454
|
}
|
|
438
|
-
}),
|
|
455
|
+
}), Le = 100, Re = /* @__PURE__ */ c({
|
|
439
456
|
__name: "UiProgress",
|
|
440
457
|
props: {
|
|
441
458
|
label: {},
|
|
@@ -444,19 +461,19 @@ var q = /* @__PURE__ */ c({
|
|
|
444
461
|
},
|
|
445
462
|
setup(e) {
|
|
446
463
|
let r = t(() => {
|
|
447
|
-
let t = Number.isFinite(e.max) && e.max > 0 ? e.max :
|
|
464
|
+
let t = Number.isFinite(e.max) && e.max > 0 ? e.max : Le;
|
|
448
465
|
return {
|
|
449
466
|
max: t,
|
|
450
467
|
value: e.value === null || !Number.isFinite(e.value) ? null : Math.min(t, Math.max(0, e.value))
|
|
451
468
|
};
|
|
452
469
|
}), i = t(() => r.value.value === null ? 0 : r.value.value / r.value.max * 100);
|
|
453
|
-
return (t, a) => (h(), n(
|
|
470
|
+
return (t, a) => (h(), n(w(z), {
|
|
454
471
|
class: "fg-progress",
|
|
455
472
|
"aria-label": e.label,
|
|
456
473
|
max: r.value.max,
|
|
457
474
|
"model-value": r.value.value
|
|
458
475
|
}, {
|
|
459
|
-
default: D(() => [s(
|
|
476
|
+
default: D(() => [s(w(R), {
|
|
460
477
|
class: "fg-progress__indicator",
|
|
461
478
|
style: f({ transform: `translateX(-${100 - i.value}%)` })
|
|
462
479
|
}, null, 8, ["style"])]),
|
|
@@ -467,7 +484,7 @@ var q = /* @__PURE__ */ c({
|
|
|
467
484
|
"model-value"
|
|
468
485
|
]));
|
|
469
486
|
}
|
|
470
|
-
}),
|
|
487
|
+
}), ze = { class: "fg-radio-card__content" }, Be = /* @__PURE__ */ c({
|
|
471
488
|
__name: "UiRadioCard",
|
|
472
489
|
props: {
|
|
473
490
|
disabled: {
|
|
@@ -477,7 +494,7 @@ var q = /* @__PURE__ */ c({
|
|
|
477
494
|
value: {}
|
|
478
495
|
},
|
|
479
496
|
setup(e) {
|
|
480
|
-
return (t, r) => (h(), n(
|
|
497
|
+
return (t, r) => (h(), n(w(B), {
|
|
481
498
|
class: "fg-radio-card",
|
|
482
499
|
disabled: e.disabled,
|
|
483
500
|
value: e.value
|
|
@@ -485,11 +502,11 @@ var q = /* @__PURE__ */ c({
|
|
|
485
502
|
default: D(() => [r[0] ||= a("span", {
|
|
486
503
|
class: "fg-radio-card__indicator",
|
|
487
504
|
"aria-hidden": "true"
|
|
488
|
-
}, null, -1), a("span",
|
|
505
|
+
}, null, -1), a("span", ze, [b(t.$slots, "default")])]),
|
|
489
506
|
_: 3
|
|
490
507
|
}, 8, ["disabled", "value"]));
|
|
491
508
|
}
|
|
492
|
-
}),
|
|
509
|
+
}), Ve = /* @__PURE__ */ c({
|
|
493
510
|
__name: "UiRadioCardGroup",
|
|
494
511
|
props: /*@__PURE__*/ u({
|
|
495
512
|
disabled: {
|
|
@@ -507,7 +524,7 @@ var q = /* @__PURE__ */ c({
|
|
|
507
524
|
}),
|
|
508
525
|
emits: ["update:modelValue"],
|
|
509
526
|
setup(e) {
|
|
510
|
-
let t =
|
|
527
|
+
let t = E(e, "modelValue"), r = (t) => {
|
|
511
528
|
if (t.altKey || t.ctrlKey || t.metaKey || t.shiftKey) return;
|
|
512
529
|
let n = t.currentTarget, r = t.target;
|
|
513
530
|
if (!(n instanceof HTMLElement) || !(r instanceof HTMLElement)) return;
|
|
@@ -523,7 +540,7 @@ var q = /* @__PURE__ */ c({
|
|
|
523
540
|
let d = o[u];
|
|
524
541
|
!d || d === r || (t.preventDefault(), d.focus(), d.click());
|
|
525
542
|
};
|
|
526
|
-
return (i, a) => (h(), n(
|
|
543
|
+
return (i, a) => (h(), n(w(V), d({
|
|
527
544
|
modelValue: t.value,
|
|
528
545
|
"onUpdate:modelValue": a[0] ||= (e) => t.value = e,
|
|
529
546
|
class: "fg-radio-card-group",
|
|
@@ -538,7 +555,7 @@ var q = /* @__PURE__ */ c({
|
|
|
538
555
|
"loop"
|
|
539
556
|
]));
|
|
540
557
|
}
|
|
541
|
-
}),
|
|
558
|
+
}), $ = /* @__PURE__ */ c({
|
|
542
559
|
__name: "UiSelect",
|
|
543
560
|
props: {
|
|
544
561
|
disabled: {
|
|
@@ -558,13 +575,13 @@ var q = /* @__PURE__ */ c({
|
|
|
558
575
|
let r = l(Q, void 0), i = t, a = (e) => {
|
|
559
576
|
e.currentTarget instanceof HTMLSelectElement && i("update:modelValue", e.currentTarget.value);
|
|
560
577
|
};
|
|
561
|
-
return (t, i) => (h(), n(
|
|
562
|
-
id:
|
|
578
|
+
return (t, i) => (h(), n(w(L), {
|
|
579
|
+
id: w(r)?.controlId.value ?? e.id,
|
|
563
580
|
as: "select",
|
|
564
581
|
class: "fg-select",
|
|
565
|
-
"aria-describedby":
|
|
566
|
-
"aria-errormessage":
|
|
567
|
-
"aria-invalid": e.invalid ||
|
|
582
|
+
"aria-describedby": w(r)?.descriptionId.value,
|
|
583
|
+
"aria-errormessage": w(r)?.errorId.value,
|
|
584
|
+
"aria-invalid": e.invalid || w(r)?.invalid.value ? "true" : void 0,
|
|
568
585
|
"data-size": e.size,
|
|
569
586
|
disabled: e.disabled,
|
|
570
587
|
value: e.modelValue,
|
|
@@ -582,7 +599,7 @@ var q = /* @__PURE__ */ c({
|
|
|
582
599
|
"value"
|
|
583
600
|
]));
|
|
584
601
|
}
|
|
585
|
-
}),
|
|
602
|
+
}), He = /* @__PURE__ */ c({
|
|
586
603
|
__name: "UiSlider",
|
|
587
604
|
props: {
|
|
588
605
|
disabled: {
|
|
@@ -615,7 +632,7 @@ var q = /* @__PURE__ */ c({
|
|
|
615
632
|
e !== void 0 && o("update:modelValue", e);
|
|
616
633
|
}
|
|
617
634
|
});
|
|
618
|
-
return (t, r) => (h(), n(
|
|
635
|
+
return (t, r) => (h(), n(w(U), {
|
|
619
636
|
modelValue: c.value,
|
|
620
637
|
"onUpdate:modelValue": r[0] ||= (e) => c.value = e,
|
|
621
638
|
class: "fg-slider",
|
|
@@ -625,15 +642,15 @@ var q = /* @__PURE__ */ c({
|
|
|
625
642
|
min: a.value.min,
|
|
626
643
|
step: a.value.step
|
|
627
644
|
}, {
|
|
628
|
-
default: D(() => [s(
|
|
629
|
-
default: D(() => [s(
|
|
645
|
+
default: D(() => [s(w(G), { class: "fg-slider__track" }, {
|
|
646
|
+
default: D(() => [s(w(H), { class: "fg-slider__range" })]),
|
|
630
647
|
_: 1
|
|
631
|
-
}), s(
|
|
632
|
-
id:
|
|
648
|
+
}), s(w(W), {
|
|
649
|
+
id: w(i)?.controlId.value ?? e.id,
|
|
633
650
|
class: "fg-slider__thumb",
|
|
634
|
-
"aria-describedby":
|
|
635
|
-
"aria-errormessage":
|
|
636
|
-
"aria-invalid":
|
|
651
|
+
"aria-describedby": w(i)?.descriptionId.value,
|
|
652
|
+
"aria-errormessage": w(i)?.errorId.value,
|
|
653
|
+
"aria-invalid": w(i)?.invalid.value ? "true" : void 0,
|
|
637
654
|
"aria-label": e.label
|
|
638
655
|
}, null, 8, [
|
|
639
656
|
"id",
|
|
@@ -652,20 +669,20 @@ var q = /* @__PURE__ */ c({
|
|
|
652
669
|
"step"
|
|
653
670
|
]));
|
|
654
671
|
}
|
|
655
|
-
}),
|
|
672
|
+
}), Ue = { class: "fg-tabs" }, We = ["aria-label"], Ge = [
|
|
656
673
|
"id",
|
|
657
674
|
"aria-controls",
|
|
658
675
|
"aria-selected",
|
|
659
676
|
"tabindex",
|
|
660
677
|
"onClick",
|
|
661
678
|
"onFocus"
|
|
662
|
-
],
|
|
679
|
+
], Ke = [
|
|
663
680
|
"id",
|
|
664
681
|
"role",
|
|
665
682
|
"aria-labelledby",
|
|
666
683
|
"hidden",
|
|
667
684
|
"tabindex"
|
|
668
|
-
],
|
|
685
|
+
], qe = ["id", "hidden"], Je = /* @__PURE__ */ c({
|
|
669
686
|
__name: "UiTabs",
|
|
670
687
|
props: {
|
|
671
688
|
items: {},
|
|
@@ -674,7 +691,7 @@ var q = /* @__PURE__ */ c({
|
|
|
674
691
|
},
|
|
675
692
|
emits: ["update:modelValue"],
|
|
676
693
|
setup(n, { emit: o }) {
|
|
677
|
-
let s = o, c =
|
|
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)}`;
|
|
678
695
|
p(() => {
|
|
679
696
|
l.value = !0;
|
|
680
697
|
});
|
|
@@ -694,7 +711,7 @@ var q = /* @__PURE__ */ c({
|
|
|
694
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];
|
|
695
712
|
s && (e.preventDefault(), s.focus());
|
|
696
713
|
};
|
|
697
|
-
return (t, o) => (h(), i("div",
|
|
714
|
+
return (t, o) => (h(), i("div", Ue, [l.value ? (h(), i("div", {
|
|
698
715
|
key: 0,
|
|
699
716
|
class: "fg-tabs__list",
|
|
700
717
|
role: "tablist",
|
|
@@ -711,7 +728,7 @@ var q = /* @__PURE__ */ c({
|
|
|
711
728
|
tabindex: e.value === u.value ? 0 : -1,
|
|
712
729
|
onClick: (t) => g(e.value),
|
|
713
730
|
onFocus: (t) => g(e.value)
|
|
714
|
-
},
|
|
731
|
+
}, C(e.label), 41, Ge))), 128))], 40, We)) : r("", !0), (h(!0), i(e, null, y(n.items, (e) => (h(), i("section", {
|
|
715
732
|
id: f(e.value),
|
|
716
733
|
key: e.value,
|
|
717
734
|
class: "fg-tabs__panel",
|
|
@@ -723,16 +740,16 @@ var q = /* @__PURE__ */ c({
|
|
|
723
740
|
id: m(e.value),
|
|
724
741
|
class: "fg-tabs__heading",
|
|
725
742
|
hidden: l.value
|
|
726
|
-
},
|
|
743
|
+
}, C(e.label), 9, qe), b(t.$slots, "panel", { value: e.value })], 8, Ke))), 128))]));
|
|
727
744
|
}
|
|
728
|
-
}),
|
|
745
|
+
}), Ye = /* @__PURE__ */ c({
|
|
729
746
|
__name: "UiSurface",
|
|
730
747
|
props: {
|
|
731
748
|
as: { default: "section" },
|
|
732
749
|
padding: { default: "default" }
|
|
733
750
|
},
|
|
734
751
|
setup(e) {
|
|
735
|
-
return (t, r) => (h(), n(
|
|
752
|
+
return (t, r) => (h(), n(w(L), {
|
|
736
753
|
as: e.as,
|
|
737
754
|
class: "fg-surface",
|
|
738
755
|
"data-padding": e.padding
|
|
@@ -741,7 +758,7 @@ var q = /* @__PURE__ */ c({
|
|
|
741
758
|
_: 3
|
|
742
759
|
}, 8, ["as", "data-padding"]));
|
|
743
760
|
}
|
|
744
|
-
}),
|
|
761
|
+
}), Xe = ({ targetIds: e }) => {
|
|
745
762
|
let t = v(e[0]), n, r, i;
|
|
746
763
|
return p(() => {
|
|
747
764
|
let a = e.flatMap((e) => {
|
|
@@ -766,4 +783,4 @@ var q = /* @__PURE__ */ c({
|
|
|
766
783
|
}), _(t);
|
|
767
784
|
};
|
|
768
785
|
//#endregion
|
|
769
|
-
export {
|
|
786
|
+
export { ye as UiAlert, be as UiBadge, q as UiButton, ie as UiCard, Ce as UiCheckbox, ve as UiCodeBlock, De as UiDialog, Ae as UiDrawer, Fe as UiField, Ie as UiInput, Re as UiProgress, Be as UiRadioCard, Ve as UiRadioCardGroup, $ as UiSelect, He as UiSlider, Ye as UiSurface, Je as UiTabs, Xe as useActiveSection };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SiteProjectId } from './projects.js';
|
|
2
|
+
export interface UiSiteLink {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UiSiteHeaderProps {
|
|
7
|
+
/** The site this header belongs to. It is marked as current in the project menu. */
|
|
8
|
+
project: SiteProjectId;
|
|
9
|
+
/** Page links shown beside the appearance control, such as a user guide or releases. */
|
|
10
|
+
links?: readonly UiSiteLink[];
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Slots = {
|
|
13
|
+
/** Replaces the System, Light, and Dark picker with a page-specific appearance control. */
|
|
14
|
+
default?(): unknown;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<UiSiteHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<UiSiteHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
export type SiteAppearanceChoice = 'system' | 'light' | 'dark';
|
|
3
|
+
export type SiteAppearance = 'light' | 'dark';
|
|
4
|
+
/** The choice is shared by every site in the family, so it must not change. */
|
|
5
|
+
export declare const SITE_APPEARANCE_KEY = "tool-site-theme";
|
|
6
|
+
/**
|
|
7
|
+
* Inline this in the document head, before the stylesheet paints, to avoid a flash
|
|
8
|
+
* of the wrong appearance. It applies the stored choice exactly as
|
|
9
|
+
* `applySiteAppearance` does and never throws.
|
|
10
|
+
*/
|
|
11
|
+
export declare const siteThemeBootScript = "(function () {\n var root = document.documentElement, choice;\n try { choice = localStorage.getItem('tool-site-theme'); } catch (error) {}\n var dark = choice === 'dark';\n if (choice !== 'light' && choice !== 'dark') {\n try { dark = matchMedia('(prefers-color-scheme: dark)').matches; } catch (error) {}\n }\n root.classList.toggle('dark', dark);\n if (choice === 'light' || choice === 'dark') root.dataset.theme = choice;\n})();";
|
|
12
|
+
/** System removes the explicit override. Light and dark set it. */
|
|
13
|
+
export declare const applySiteAppearance: ({ root, choice, appearance }: {
|
|
14
|
+
root: HTMLElement;
|
|
15
|
+
choice: SiteAppearanceChoice;
|
|
16
|
+
appearance: SiteAppearance;
|
|
17
|
+
}) => void;
|
|
18
|
+
/**
|
|
19
|
+
* The shared System, Light, or Dark choice with the appearance it resolves to.
|
|
20
|
+
* Every call shares the stored choice, and other tabs and the operating system
|
|
21
|
+
* update it. Nothing reads storage or the browser until the component mounts, so
|
|
22
|
+
* server rendering and hydration see `system`. Storage failures leave the choice
|
|
23
|
+
* working for the current visit.
|
|
24
|
+
*
|
|
25
|
+
* By default the composable applies the appearance to `<html>`. Pass
|
|
26
|
+
* `applyToRoot: false` when the page owns the root, for example while an imported
|
|
27
|
+
* theme is active, and call `applySiteAppearance` yourself.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useSiteAppearance: ({ applyToRoot }?: {
|
|
30
|
+
applyToRoot?: boolean;
|
|
31
|
+
}) => {
|
|
32
|
+
choice: ComputedRef<SiteAppearanceChoice>;
|
|
33
|
+
appearance: ComputedRef<SiteAppearance>;
|
|
34
|
+
chooseAppearance: (value: SiteAppearanceChoice) => void;
|
|
35
|
+
};
|