@filipgutica/ui 1.11.1 → 1.12.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 +44 -6
- package/dist/index.js +54 -45
- package/dist/site/CaptureScreen.vue.d.ts +1 -1
- package/dist/site.js +113 -108
- package/package.json +7 -3
- package/src/components.css +54 -26
- package/src/fonts/OFL-IBM-Plex-Mono.txt +93 -0
- package/src/fonts/OFL-IBM-Plex-Sans.txt +93 -0
- package/src/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/src/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/src/fonts.css +55 -0
- package/src/site.css +134 -50
- package/src/theme.css +118 -89
- package/src/themes/graphite-indigo.css +62 -44
package/dist/site.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { a as e, i as t, n, o as r, r as i, t as a } from "./use-active-section-DCS_wyYq.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, mergeModels as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, ref as C, renderList as w, renderSlot as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, useModel as
|
|
3
|
-
import { tryOnMounted as
|
|
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, mergeModels as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, ref as C, renderList as w, renderSlot as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, useModel as A, useSlots as j, useTemplateRef as M, watch as N, withCtx as P } from "vue";
|
|
3
|
+
import { tryOnMounted as F, usePreferredDark as I, useStorage as L } from "@vueuse/core";
|
|
4
4
|
//#region src/site/appearance.ts
|
|
5
|
-
var
|
|
5
|
+
var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "dark", ee = `(function () {
|
|
6
6
|
var root = document.documentElement, choice;
|
|
7
|
-
try { choice = localStorage.getItem('${
|
|
7
|
+
try { choice = localStorage.getItem('${R}'); } catch (error) {}
|
|
8
8
|
var dark = choice === 'dark';
|
|
9
9
|
if (choice !== 'light' && choice !== 'dark') {
|
|
10
10
|
try { dark = matchMedia('(prefers-color-scheme: dark)').matches; } catch (error) {}
|
|
11
11
|
}
|
|
12
12
|
root.classList.toggle('dark', dark);
|
|
13
13
|
if (choice === 'light' || choice === 'dark') root.dataset.theme = choice;
|
|
14
|
-
})();`,
|
|
14
|
+
})();`, B = ({ root: e, choice: t, appearance: n }) => {
|
|
15
15
|
e.classList.toggle("dark", n === "dark"), t === "system" ? delete e.dataset.theme : e.dataset.theme = t;
|
|
16
|
-
},
|
|
17
|
-
let t =
|
|
16
|
+
}, V = ({ applyToRoot: e = !0 } = {}) => {
|
|
17
|
+
let t = L(R, "system", void 0, {
|
|
18
18
|
initOnMounted: !0,
|
|
19
19
|
writeDefaults: !1,
|
|
20
20
|
onError: () => {},
|
|
21
21
|
serializer: {
|
|
22
|
-
read: (e) =>
|
|
22
|
+
read: (e) => z(e) ? e : "system",
|
|
23
23
|
write: (e) => e
|
|
24
24
|
}
|
|
25
|
-
}), n =
|
|
26
|
-
return e &&
|
|
27
|
-
|
|
25
|
+
}), n = I(), r = s(() => t.value), i = s(() => t.value === "system" ? n.value ? "dark" : "light" : t.value);
|
|
26
|
+
return e && F(() => {
|
|
27
|
+
N([r, i], () => B({
|
|
28
28
|
root: document.documentElement,
|
|
29
29
|
choice: r.value,
|
|
30
30
|
appearance: i.value
|
|
@@ -33,10 +33,10 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
33
33
|
choice: r,
|
|
34
34
|
appearance: i,
|
|
35
35
|
chooseAppearance: (e) => {
|
|
36
|
-
|
|
36
|
+
z(e) && (t.value = e);
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
},
|
|
39
|
+
}, H = [
|
|
40
40
|
{
|
|
41
41
|
id: "annoterm",
|
|
42
42
|
label: "annoterm",
|
|
@@ -73,24 +73,24 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
73
73
|
href: "https://filipgutica.github.io/ui/",
|
|
74
74
|
repository: "https://github.com/filipgutica/ui"
|
|
75
75
|
}
|
|
76
|
-
],
|
|
76
|
+
], te = { class: "fg-site-header" }, ne = { class: "fg-site-header__inner" }, re = ["aria-label"], ie = {
|
|
77
77
|
class: "fg-site-projects__menu fg-site-nav",
|
|
78
78
|
"aria-label": "Projects"
|
|
79
|
-
},
|
|
79
|
+
}, U = ["href", "aria-current"], W = { class: "fg-site-header__end" }, G = {
|
|
80
80
|
key: 0,
|
|
81
81
|
class: "fg-site-header__links",
|
|
82
82
|
"aria-label": "Site links"
|
|
83
|
-
},
|
|
83
|
+
}, K = ["href"], q = {
|
|
84
84
|
key: 0,
|
|
85
85
|
class: "fg-site-appearance",
|
|
86
86
|
role: "group",
|
|
87
87
|
"aria-label": "Color theme"
|
|
88
|
-
},
|
|
88
|
+
}, J = [
|
|
89
89
|
"aria-label",
|
|
90
90
|
"title",
|
|
91
91
|
"aria-pressed",
|
|
92
92
|
"onClick"
|
|
93
|
-
],
|
|
93
|
+
], Y = {
|
|
94
94
|
viewBox: "0 0 24 24",
|
|
95
95
|
width: "18",
|
|
96
96
|
height: "18",
|
|
@@ -98,10 +98,10 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
98
98
|
stroke: "currentColor",
|
|
99
99
|
"stroke-width": "1.5",
|
|
100
100
|
"aria-hidden": "true"
|
|
101
|
-
},
|
|
101
|
+
}, ae = {
|
|
102
102
|
key: 2,
|
|
103
103
|
d: "M20.5 13.5A9 9 0 0 1 10.5 3a9 9 0 1 0 10 10.5Z"
|
|
104
|
-
},
|
|
104
|
+
}, oe = /* @__PURE__ */ m({
|
|
105
105
|
__name: "UiSiteHeader",
|
|
106
106
|
props: {
|
|
107
107
|
project: {},
|
|
@@ -121,7 +121,7 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
121
121
|
value: "dark",
|
|
122
122
|
label: "Dark"
|
|
123
123
|
}
|
|
124
|
-
], n = s(() =>
|
|
124
|
+
], n = s(() => H.find(({ id: t }) => t === e.project)?.label ?? e.project), r = j().default ? void 0 : V(), i = C(!1), a = C(), c = C(), f = () => {
|
|
125
125
|
a.value && (a.value.open = !1);
|
|
126
126
|
}, p = (e) => {
|
|
127
127
|
e.key !== "Escape" || !a.value?.open || (f(), c.value?.focus());
|
|
@@ -132,7 +132,7 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
132
132
|
};
|
|
133
133
|
return b(() => {
|
|
134
134
|
i.value = !0, document.addEventListener("pointerdown", h);
|
|
135
|
-
}), y(() => document.removeEventListener("pointerdown", h)), (s, f) => (S(), u("header",
|
|
135
|
+
}), y(() => document.removeEventListener("pointerdown", h)), (s, f) => (S(), u("header", te, [d("div", ne, [d("details", {
|
|
136
136
|
ref_key: "menu",
|
|
137
137
|
ref: a,
|
|
138
138
|
class: "fg-site-projects",
|
|
@@ -152,14 +152,14 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
152
152
|
stroke: "currentColor",
|
|
153
153
|
"stroke-width": "1.5",
|
|
154
154
|
"aria-hidden": "true"
|
|
155
|
-
}, [d("path", { d: "m4 6 4 4 4-4" })], -1)], 8,
|
|
155
|
+
}, [d("path", { d: "m4 6 4 4 4-4" })], -1)], 8, re), d("nav", ie, [(S(!0), u(o, null, w(O(H), (t) => (S(), u("a", {
|
|
156
156
|
key: t.id,
|
|
157
157
|
href: t.href,
|
|
158
158
|
"aria-current": t.id === e.project ? "page" : void 0
|
|
159
|
-
}, D(t.label), 9,
|
|
159
|
+
}, D(t.label), 9, U))), 128))])], 544), d("div", W, [e.links.length > 0 ? (S(), u("nav", G, [(S(!0), u(o, null, w(e.links, (e) => (S(), u("a", {
|
|
160
160
|
key: e.href,
|
|
161
161
|
href: e.href
|
|
162
|
-
}, D(e.label), 9,
|
|
162
|
+
}, D(e.label), 9, K))), 128))])) : l("", !0), T(s.$slots, "default", {}, () => [i.value && O(r) ? (S(), u("div", q, [(S(), u(o, null, w(t, (e) => d("button", {
|
|
163
163
|
key: e.value,
|
|
164
164
|
type: "button",
|
|
165
165
|
class: "fg-site-appearance__choice",
|
|
@@ -167,7 +167,7 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
167
167
|
title: `${e.label} theme`,
|
|
168
168
|
"aria-pressed": O(r).choice.value === e.value,
|
|
169
169
|
onClick: (t) => O(r).chooseAppearance(e.value)
|
|
170
|
-
}, [(S(), u("svg",
|
|
170
|
+
}, [(S(), u("svg", Y, [e.value === "system" ? (S(), u(o, { key: 0 }, [f[1] ||= d("rect", {
|
|
171
171
|
x: "3",
|
|
172
172
|
y: "4",
|
|
173
173
|
width: "18",
|
|
@@ -177,13 +177,13 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
177
177
|
cx: "12",
|
|
178
178
|
cy: "12",
|
|
179
179
|
r: "4"
|
|
180
|
-
}, null, -1), f[4] ||= d("path", { d: "M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5" }, null, -1)], 64)) : (S(), u("path",
|
|
180
|
+
}, null, -1), f[4] ||= d("path", { d: "M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5" }, null, -1)], 64)) : (S(), u("path", ae))]))], 8, J)), 64))])) : l("", !0)])])])]));
|
|
181
181
|
}
|
|
182
|
-
}),
|
|
182
|
+
}), se = ["id"], ce = ["role", "aria-labelledby"], le = ["id"], ue = [
|
|
183
183
|
"href",
|
|
184
184
|
"aria-current",
|
|
185
185
|
"onClick"
|
|
186
|
-
],
|
|
186
|
+
], de = { key: 0 }, X = /* @__PURE__ */ m({
|
|
187
187
|
__name: "SiteNavLinks",
|
|
188
188
|
props: {
|
|
189
189
|
contentId: {},
|
|
@@ -212,75 +212,78 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
212
212
|
key: 0,
|
|
213
213
|
id: i(t),
|
|
214
214
|
class: "fg-site-rail__group-label"
|
|
215
|
-
}, D(e.label), 9,
|
|
215
|
+
}, D(e.label), 9, le)) : l("", !0), (S(!0), u(o, null, w(e.items, (e) => (S(), u("a", {
|
|
216
216
|
key: e.href,
|
|
217
217
|
href: e.href,
|
|
218
218
|
"aria-current": a(e),
|
|
219
219
|
onClick: (t) => n("navigate", e.href, t)
|
|
220
|
-
}, [e.code ? (S(), u("code",
|
|
220
|
+
}, [e.code ? (S(), u("code", de, D(e.label), 1)) : (S(), u(o, { key: 1 }, [f(D(e.label), 1)], 64))], 8, ue))), 128))], 8, ce))), 128))])], 8, se));
|
|
221
221
|
}
|
|
222
|
-
}),
|
|
222
|
+
}), fe = ["data-enhanced"], pe = ["open"], me = ["aria-controls"], he = "(max-width: 800px)", ge = /* @__PURE__ */ m({
|
|
223
223
|
__name: "UiSiteNav",
|
|
224
224
|
props: {
|
|
225
225
|
label: {},
|
|
226
226
|
groups: {}
|
|
227
227
|
},
|
|
228
228
|
setup(e) {
|
|
229
|
-
let t = k(), n = C(), o = C(!1),
|
|
229
|
+
let t = k(), n = C(), o = C(!1), l = C(!1), m = C(!1), h = a({ targetIds: e.groups.flatMap((e) => e.items).flatMap(({ href: e }) => e.startsWith("#") && e.length > 1 ? [e.slice(1)] : []) }), _ = s(() => e.groups.flatMap((e) => e.items).find((e) => e.current)?.label), v = s(() => e.groups.flatMap((e) => e.items).find((e) => e.href === `#${h.value}`)?.label), y = s(() => {
|
|
230
|
+
let t = _.value ?? v.value;
|
|
231
|
+
return t ? `${e.label}: ${t}` : e.label;
|
|
232
|
+
}), w, T = null, E = () => n.value?.querySelector("button.fg-site-rail__toggle"), A = () => {
|
|
230
233
|
g(() => n.value?.querySelector(".fg-site-nav a")?.focus({ preventScroll: !0 }));
|
|
231
|
-
},
|
|
232
|
-
let e =
|
|
233
|
-
|
|
234
|
-
},
|
|
235
|
-
!
|
|
236
|
-
},
|
|
237
|
-
|
|
234
|
+
}, j = () => {
|
|
235
|
+
let e = w?.matches && !l.value && n.value?.contains(document.activeElement), t = w?.matches === !1 && l.value && !m.value && E() === document.activeElement;
|
|
236
|
+
l.value = w?.matches === !0, l.value || (m.value = !1), e ? g(() => E()?.focus({ preventScroll: !0 })) : t && A();
|
|
237
|
+
}, M = (e, t) => {
|
|
238
|
+
!m.value || t.button !== 0 || t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || (T = e.startsWith("#") ? document.getElementById(e.slice(1)) : null, m.value = !1);
|
|
239
|
+
}, N = (e) => {
|
|
240
|
+
T ? (e.preventDefault(), T.tabIndex = -1, T.focus({ preventScroll: !0 }), T = null) : l.value || (e.preventDefault(), A());
|
|
238
241
|
};
|
|
239
242
|
return b(() => {
|
|
240
|
-
|
|
241
|
-
}), x(() =>
|
|
243
|
+
w = matchMedia(he), j(), o.value = !0, w.addEventListener("change", j);
|
|
244
|
+
}), x(() => w?.removeEventListener("change", j)), (a, s) => (S(), u("div", {
|
|
242
245
|
ref_key: "root",
|
|
243
246
|
ref: n,
|
|
244
247
|
class: "fg-site-rail",
|
|
245
248
|
"data-enhanced": o.value
|
|
246
|
-
}, [!o.value || !
|
|
249
|
+
}, [!o.value || !l.value ? (S(), u("details", {
|
|
247
250
|
key: 0,
|
|
248
251
|
class: "fg-site-rail__menu",
|
|
249
|
-
open: o.value && !
|
|
252
|
+
open: o.value && !l.value
|
|
250
253
|
}, [d("summary", {
|
|
251
254
|
class: "fg-site-rail__summary",
|
|
252
255
|
"aria-controls": O(t)
|
|
253
|
-
}, D(
|
|
256
|
+
}, D(y.value), 9, me), p(X, {
|
|
254
257
|
"content-id": O(t),
|
|
255
258
|
label: e.label,
|
|
256
259
|
groups: e.groups,
|
|
257
|
-
"active-id": O(
|
|
260
|
+
"active-id": O(h)
|
|
258
261
|
}, null, 8, [
|
|
259
262
|
"content-id",
|
|
260
263
|
"label",
|
|
261
264
|
"groups",
|
|
262
265
|
"active-id"
|
|
263
|
-
])], 8,
|
|
266
|
+
])], 8, pe)) : (S(), c(i, {
|
|
264
267
|
key: 1,
|
|
265
|
-
open:
|
|
266
|
-
"onUpdate:open":
|
|
268
|
+
open: m.value,
|
|
269
|
+
"onUpdate:open": s[0] ||= (e) => m.value = e,
|
|
267
270
|
title: e.label,
|
|
268
|
-
onCloseAutoFocus:
|
|
271
|
+
onCloseAutoFocus: N
|
|
269
272
|
}, {
|
|
270
|
-
trigger:
|
|
273
|
+
trigger: P(() => [p(r, {
|
|
271
274
|
variant: "ghost",
|
|
272
275
|
size: "lg",
|
|
273
276
|
class: "fg-site-rail__toggle"
|
|
274
277
|
}, {
|
|
275
|
-
default:
|
|
278
|
+
default: P(() => [f(D(y.value), 1)]),
|
|
276
279
|
_: 1
|
|
277
280
|
})]),
|
|
278
|
-
default:
|
|
281
|
+
default: P(() => [p(X, {
|
|
279
282
|
"content-id": O(t),
|
|
280
283
|
label: e.label,
|
|
281
284
|
groups: e.groups,
|
|
282
|
-
"active-id": O(
|
|
283
|
-
onNavigate:
|
|
285
|
+
"active-id": O(h),
|
|
286
|
+
onNavigate: M
|
|
284
287
|
}, null, 8, [
|
|
285
288
|
"content-id",
|
|
286
289
|
"label",
|
|
@@ -288,14 +291,14 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
288
291
|
"active-id"
|
|
289
292
|
])]),
|
|
290
293
|
_: 1
|
|
291
|
-
}, 8, ["open", "title"]))], 8,
|
|
294
|
+
}, 8, ["open", "title"]))], 8, fe));
|
|
292
295
|
}
|
|
293
|
-
}),
|
|
296
|
+
}), _e = [
|
|
294
297
|
"aria-label",
|
|
295
298
|
"tabindex",
|
|
296
299
|
"data-fit",
|
|
297
300
|
"innerHTML"
|
|
298
|
-
], Q = /* @__PURE__ */ m({
|
|
301
|
+
], Z = .7, Q = /* @__PURE__ */ m({
|
|
299
302
|
__name: "CaptureScreen",
|
|
300
303
|
props: {
|
|
301
304
|
html: {},
|
|
@@ -303,35 +306,37 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
303
306
|
fit: { type: Boolean }
|
|
304
307
|
},
|
|
305
308
|
setup(e) {
|
|
306
|
-
let t = C(), n = C(1), r = C(), i, a = () => {
|
|
309
|
+
let t = C(), n = C(1), r = C(), i = s(() => r.value !== void 0), a, o = () => {
|
|
307
310
|
if (!e.fit) {
|
|
308
311
|
r.value = void 0, n.value = 1;
|
|
309
312
|
return;
|
|
310
313
|
}
|
|
311
314
|
let i = t.value, a = i?.firstElementChild;
|
|
312
|
-
!i?.clientWidth || !(a instanceof HTMLElement) || !a.offsetWidth
|
|
315
|
+
if (!i?.clientWidth || !(a instanceof HTMLElement) || !a.offsetWidth) return;
|
|
316
|
+
let o = Math.min(1, i.clientWidth / a.offsetWidth);
|
|
317
|
+
o >= Z && (i.scrollLeft = 0), n.value = o >= Z ? o : 1, r.value = o >= Z ? Math.ceil(a.offsetHeight * n.value) + i.offsetHeight - i.clientHeight : void 0;
|
|
313
318
|
};
|
|
314
|
-
return
|
|
315
|
-
typeof ResizeObserver < "u" && (
|
|
316
|
-
}), x(() =>
|
|
319
|
+
return N(() => [e.fit, e.html], o, { flush: "post" }), b(() => {
|
|
320
|
+
typeof ResizeObserver < "u" && (a = new ResizeObserver(o), t.value && a.observe(t.value)), o();
|
|
321
|
+
}), x(() => a?.disconnect()), (a, o) => (S(), u("div", {
|
|
317
322
|
ref_key: "container",
|
|
318
323
|
ref: t,
|
|
319
324
|
class: "fg-capture__screen",
|
|
320
325
|
role: "region",
|
|
321
326
|
"aria-label": e.label,
|
|
322
|
-
tabindex:
|
|
323
|
-
"data-fit":
|
|
327
|
+
tabindex: i.value ? void 0 : 0,
|
|
328
|
+
"data-fit": i.value || void 0,
|
|
324
329
|
style: v({
|
|
325
330
|
height: r.value === void 0 ? void 0 : `${r.value}px`,
|
|
326
331
|
"--capture-scale": n.value
|
|
327
332
|
}),
|
|
328
333
|
innerHTML: e.html
|
|
329
|
-
}, null, 12,
|
|
334
|
+
}, null, 12, _e));
|
|
330
335
|
}
|
|
331
|
-
}),
|
|
336
|
+
}), ve = ["data-enhanced"], ye = ["aria-label"], be = ["id"], xe = { class: "fg-capture__preview" }, Se = ["title", "onClick"], Ce = {
|
|
332
337
|
key: 0,
|
|
333
338
|
class: "fg-capture__caption"
|
|
334
|
-
},
|
|
339
|
+
}, we = { key: 0 }, Te = /* @__PURE__ */ m({
|
|
335
340
|
__name: "UiCapture",
|
|
336
341
|
props: /*@__PURE__*/ h({
|
|
337
342
|
items: {},
|
|
@@ -343,38 +348,38 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
343
348
|
}),
|
|
344
349
|
emits: ["update:modelValue"],
|
|
345
350
|
setup(e) {
|
|
346
|
-
let i =
|
|
351
|
+
let i = A(e, "modelValue"), a = C(!1), m = s(() => e.items.map(({ id: e, label: t }) => ({
|
|
347
352
|
value: e,
|
|
348
353
|
label: t
|
|
349
|
-
}))), h = s(() => i.value ?? e.items[0]?.id ?? ""), _ = s(() => e.items.find(({ id: e }) => e === h.value)), v = C(!1), y = E(), O = 0, k = 0,
|
|
354
|
+
}))), h = s(() => i.value ?? e.items[0]?.id ?? ""), _ = s(() => e.items.find(({ id: e }) => e === h.value)), v = C(!1), y = E(), O = 0, k = 0, j = M("fullSizeButton"), N = (e) => {
|
|
350
355
|
y.value = e, v.value = !0;
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
},
|
|
356
|
+
}, F = (e) => {
|
|
357
|
+
j.value?.isConnected && (e.preventDefault(), j.value.focus({ preventScroll: !0 }));
|
|
358
|
+
}, I = () => {
|
|
354
359
|
try {
|
|
355
360
|
return document.getElementById(decodeURIComponent(location.hash.slice(1)));
|
|
356
361
|
} catch {
|
|
357
362
|
return null;
|
|
358
363
|
}
|
|
359
|
-
},
|
|
364
|
+
}, L = async () => {
|
|
360
365
|
await g(), cancelAnimationFrame(O), cancelAnimationFrame(k), O = requestAnimationFrame(() => {
|
|
361
|
-
k = requestAnimationFrame(() =>
|
|
366
|
+
k = requestAnimationFrame(() => I()?.scrollIntoView({
|
|
362
367
|
behavior: "instant",
|
|
363
368
|
block: "start"
|
|
364
369
|
}));
|
|
365
370
|
});
|
|
366
|
-
},
|
|
367
|
-
let t =
|
|
371
|
+
}, R = () => {
|
|
372
|
+
let t = I();
|
|
368
373
|
if (!t) return !1;
|
|
369
374
|
let n = e.items.find(({ id: n }) => document.getElementById(`${e.idPrefix}${n}`)?.contains(t));
|
|
370
375
|
return !n || h.value === n.id ? !1 : (i.value = n.id, !0);
|
|
371
|
-
},
|
|
372
|
-
|
|
376
|
+
}, z = () => {
|
|
377
|
+
R() && L();
|
|
373
378
|
};
|
|
374
379
|
return b(() => {
|
|
375
|
-
a.value = !0,
|
|
380
|
+
a.value = !0, R(), location.hash && L(), window.addEventListener("hashchange", z), window.addEventListener("popstate", z);
|
|
376
381
|
}), x(() => {
|
|
377
|
-
cancelAnimationFrame(O), cancelAnimationFrame(k), window.removeEventListener("hashchange",
|
|
382
|
+
cancelAnimationFrame(O), cancelAnimationFrame(k), window.removeEventListener("hashchange", z), window.removeEventListener("popstate", z);
|
|
378
383
|
}), (s, g) => (S(), u("div", {
|
|
379
384
|
class: "fg-capture",
|
|
380
385
|
"data-enhanced": a.value
|
|
@@ -382,30 +387,30 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
382
387
|
a.value && _.value ? (S(), u("button", {
|
|
383
388
|
key: 0,
|
|
384
389
|
ref_key: "fullSizeButton",
|
|
385
|
-
ref:
|
|
390
|
+
ref: j,
|
|
386
391
|
type: "button",
|
|
387
392
|
class: "fg-capture__full",
|
|
388
393
|
"aria-label": `Expand ${_.value.label} capture at full size`,
|
|
389
394
|
"aria-haspopup": "dialog",
|
|
390
|
-
onClick: g[0] ||= (e) =>
|
|
395
|
+
onClick: g[0] ||= (e) => N(_.value)
|
|
391
396
|
}, [...g[4] ||= [d("svg", {
|
|
392
397
|
viewBox: "0 0 24 24",
|
|
393
398
|
fill: "none",
|
|
394
399
|
stroke: "currentColor",
|
|
395
400
|
"stroke-width": "1.5",
|
|
396
401
|
"aria-hidden": "true"
|
|
397
|
-
}, [d("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" })], -1), d("span", { class: "fg-capture__full-label" }, "Full size", -1)]], 8,
|
|
402
|
+
}, [d("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" })], -1), d("span", { class: "fg-capture__full-label" }, "Full size", -1)]], 8, ye)) : l("", !0),
|
|
398
403
|
p(n, {
|
|
399
404
|
"model-value": h.value,
|
|
400
405
|
items: m.value,
|
|
401
406
|
label: e.label,
|
|
402
407
|
"onUpdate:modelValue": g[1] ||= (e) => i.value = e
|
|
403
408
|
}, {
|
|
404
|
-
panel:
|
|
409
|
+
panel: P(({ value: t }) => [(S(!0), u(o, null, w(e.items, (n) => (S(), u(o, { key: n.id }, [n.id === t ? (S(), u("figure", {
|
|
405
410
|
key: 0,
|
|
406
411
|
id: `${e.idPrefix}${n.id}`,
|
|
407
412
|
class: "fg-capture__figure"
|
|
408
|
-
}, [d("div",
|
|
413
|
+
}, [d("div", xe, [p(Q, {
|
|
409
414
|
html: n.html,
|
|
410
415
|
label: `Terminal capture: ${n.label}`,
|
|
411
416
|
fit: a.value
|
|
@@ -420,8 +425,8 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
420
425
|
tabindex: "-1",
|
|
421
426
|
"aria-hidden": "true",
|
|
422
427
|
title: `Open ${n.label} capture at full size`,
|
|
423
|
-
onClick: (e) =>
|
|
424
|
-
}, null, 8,
|
|
428
|
+
onClick: (e) => N(n)
|
|
429
|
+
}, null, 8, Se)) : l("", !0)]), n.command || s.$slots.caption ? (S(), u("figcaption", Ce, [n.command ? (S(), u("code", we, D(n.command), 1)) : l("", !0), T(s.$slots, "caption", { item: n })])) : l("", !0)], 8, be)) : l("", !0)], 64))), 128))]),
|
|
425
430
|
_: 3
|
|
426
431
|
}, 8, [
|
|
427
432
|
"model-value",
|
|
@@ -434,17 +439,17 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
434
439
|
title: `${y.value?.label ?? ""} capture`,
|
|
435
440
|
description: "Scroll to read the full capture.",
|
|
436
441
|
class: "fg-capture-viewer",
|
|
437
|
-
onCloseAutoFocus:
|
|
442
|
+
onCloseAutoFocus: F
|
|
438
443
|
}, {
|
|
439
|
-
footer:
|
|
444
|
+
footer: P(() => [p(r, {
|
|
440
445
|
variant: "secondary",
|
|
441
446
|
size: "lg",
|
|
442
447
|
onClick: g[2] ||= (e) => v.value = !1
|
|
443
448
|
}, {
|
|
444
|
-
default:
|
|
449
|
+
default: P(() => [...g[5] ||= [f(" Close capture ", -1)]]),
|
|
445
450
|
_: 1
|
|
446
451
|
})]),
|
|
447
|
-
default:
|
|
452
|
+
default: P(() => [y.value ? (S(), c(Q, {
|
|
448
453
|
key: 0,
|
|
449
454
|
html: y.value.html,
|
|
450
455
|
label: `${y.value.label} capture at full size`,
|
|
@@ -452,26 +457,26 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
452
457
|
}, null, 8, ["html", "label"])) : l("", !0)]),
|
|
453
458
|
_: 1
|
|
454
459
|
}, 8, ["open", "title"])
|
|
455
|
-
], 8,
|
|
460
|
+
], 8, ve));
|
|
456
461
|
}
|
|
457
|
-
}),
|
|
462
|
+
}), Ee = { class: "fg-command-list" }, De = { class: "fg-command-list__table" }, $ = { scope: "col" }, Oe = { scope: "col" }, ke = { key: 0 }, Ae = { class: "fg-command-list__command" }, je = { class: "fg-command-list__description" }, Me = {
|
|
458
463
|
key: 0,
|
|
459
464
|
class: "fg-command-list__action"
|
|
460
|
-
},
|
|
465
|
+
}, Ne = [
|
|
461
466
|
"disabled",
|
|
462
467
|
"aria-label",
|
|
463
468
|
"title",
|
|
464
469
|
"onClick"
|
|
465
|
-
],
|
|
470
|
+
], Pe = {
|
|
466
471
|
viewBox: "0 0 24 24",
|
|
467
472
|
fill: "none",
|
|
468
473
|
stroke: "currentColor",
|
|
469
474
|
"stroke-width": "1.5",
|
|
470
475
|
"aria-hidden": "true"
|
|
471
|
-
},
|
|
476
|
+
}, Fe = {
|
|
472
477
|
key: 0,
|
|
473
478
|
d: "m5 12 4 4L19 6"
|
|
474
|
-
},
|
|
479
|
+
}, Ie = /* @__PURE__ */ m({
|
|
475
480
|
__name: "UiCommandList",
|
|
476
481
|
props: {
|
|
477
482
|
items: {},
|
|
@@ -491,14 +496,14 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
491
496
|
unavailableMessage: "Clipboard unavailable. Select the command to copy it.",
|
|
492
497
|
failureMessage: "Could not copy. Select the command to copy it."
|
|
493
498
|
}), p = C(""), m = s(() => a.value || (r.value ? `${p.value} copied to clipboard.` : "")), h = (e) => (p.value = e, c(e));
|
|
494
|
-
return (e, s) => (S(), u("div",
|
|
495
|
-
d("th",
|
|
496
|
-
d("th",
|
|
497
|
-
t.copyable ? (S(), u("td",
|
|
499
|
+
return (e, s) => (S(), u("div", Ee, [d("table", De, [d("thead", null, [d("tr", null, [
|
|
500
|
+
d("th", $, D(t.commandHeader), 1),
|
|
501
|
+
d("th", Oe, D(t.descriptionHeader), 1),
|
|
502
|
+
t.copyable ? (S(), u("td", ke)) : l("", !0)
|
|
498
503
|
])]), d("tbody", null, [(S(!0), u(o, null, w(t.items, (c) => (S(), u("tr", { key: c.command }, [
|
|
499
|
-
d("td",
|
|
500
|
-
d("td",
|
|
501
|
-
t.copyable ? (S(), u("td",
|
|
504
|
+
d("td", Ae, [T(e.$slots, "command", { item: c }, () => [d("code", null, D(c.command), 1)])]),
|
|
505
|
+
d("td", je, [T(e.$slots, "description", { item: c }, () => [f(D(c.description), 1)])]),
|
|
506
|
+
t.copyable ? (S(), u("td", Me, [n.value ? (S(), u("button", {
|
|
502
507
|
key: 0,
|
|
503
508
|
type: "button",
|
|
504
509
|
class: "fg-command-list__copy",
|
|
@@ -506,13 +511,13 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
506
511
|
"aria-label": `Copy ${c.command}`,
|
|
507
512
|
title: `Copy ${c.command}`,
|
|
508
513
|
onClick: (e) => h(c.command)
|
|
509
|
-
}, [(S(), u("svg",
|
|
514
|
+
}, [(S(), u("svg", Pe, [O(r) && !O(a) && p.value === c.command ? (S(), u("path", Fe)) : (S(), u(o, { key: 1 }, [s[0] ||= d("rect", {
|
|
510
515
|
x: "8",
|
|
511
516
|
y: "8",
|
|
512
517
|
width: "12",
|
|
513
518
|
height: "13",
|
|
514
519
|
rx: "2"
|
|
515
|
-
}, null, -1), s[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))]))], 8,
|
|
520
|
+
}, null, -1), s[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))]))], 8, Ne)) : l("", !0)])) : l("", !0)
|
|
516
521
|
]))), 128))])]), d("span", {
|
|
517
522
|
class: _(["fg-command-list__status", { "fg-site-sr-only": !O(a) }]),
|
|
518
523
|
role: "status"
|
|
@@ -520,4 +525,4 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
|
|
|
520
525
|
}
|
|
521
526
|
});
|
|
522
527
|
//#endregion
|
|
523
|
-
export {
|
|
528
|
+
export { R as SITE_APPEARANCE_KEY, H as SITE_PROJECTS, Te as UiCapture, Ie as UiCommandList, oe as UiSiteHeader, ge as UiSiteNav, B as applySiteAppearance, ee as siteThemeBootScript, V as useSiteAppearance };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@filipgutica/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "A compact Vue design system with Tailwind CSS and VS Code theme support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"src/site.css",
|
|
15
15
|
"src/themes/*.css",
|
|
16
16
|
"README.md",
|
|
17
|
-
"LICENSE"
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"src/fonts.css",
|
|
19
|
+
"src/fonts/*"
|
|
18
20
|
],
|
|
19
21
|
"exports": {
|
|
20
22
|
".": {
|
|
@@ -36,7 +38,9 @@
|
|
|
36
38
|
"./theme.css": "./src/theme.css",
|
|
37
39
|
"./components.css": "./src/components.css",
|
|
38
40
|
"./site.css": "./src/site.css",
|
|
39
|
-
"./themes/graphite-indigo.css": "./src/themes/graphite-indigo.css"
|
|
41
|
+
"./themes/graphite-indigo.css": "./src/themes/graphite-indigo.css",
|
|
42
|
+
"./fonts.css": "./src/fonts.css",
|
|
43
|
+
"./fonts/*": "./src/fonts/*"
|
|
40
44
|
},
|
|
41
45
|
"scripts": {
|
|
42
46
|
"build": "vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly",
|