@filipgutica/ui 1.14.1 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/site.js CHANGED
@@ -1,30 +1,30 @@
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 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";
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, mergeModels as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, onUnmounted as S, openBlock as C, ref as w, renderList as T, renderSlot as E, shallowRef as D, toDisplayString as O, unref as k, useId as A, useModel as j, useSlots as M, useTemplateRef as N, watch as P, withCtx as F } from "vue";
3
+ import { tryOnMounted as I, usePreferredDark as L, useStorage as R } from "@vueuse/core";
4
4
  //#region src/site/appearance.ts
5
- var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "dark", ee = `(function () {
5
+ var z = "tool-site-theme", B = (e) => e === "system" || e === "light" || e === "dark", ee = `(function () {
6
6
  var root = document.documentElement, choice;
7
- try { choice = localStorage.getItem('${R}'); } catch (error) {}
7
+ try { choice = localStorage.getItem('${z}'); } 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
- })();`, B = ({ root: e, choice: t, appearance: n }) => {
14
+ })();`, V = ({ 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
- }, V = ({ applyToRoot: e = !0 } = {}) => {
17
- let t = L(R, "system", void 0, {
16
+ }, H = ({ applyToRoot: e = !0 } = {}) => {
17
+ let t = R(z, "system", void 0, {
18
18
  initOnMounted: !0,
19
19
  writeDefaults: !1,
20
20
  onError: () => {},
21
21
  serializer: {
22
- read: (e) => z(e) ? e : "system",
22
+ read: (e) => B(e) ? e : "system",
23
23
  write: (e) => e
24
24
  }
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({
25
+ }), n = L(), r = c(() => t.value), i = c(() => t.value === "system" ? n.value ? "dark" : "light" : t.value);
26
+ return e && I(() => {
27
+ P([r, i], () => V({
28
28
  root: document.documentElement,
29
29
  choice: r.value,
30
30
  appearance: i.value
@@ -33,10 +33,10 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
33
33
  choice: r,
34
34
  appearance: i,
35
35
  chooseAppearance: (e) => {
36
- z(e) && (t.value = e);
36
+ B(e) && (t.value = e);
37
37
  }
38
38
  };
39
- }, H = [
39
+ }, U = [
40
40
  {
41
41
  id: "annoterm",
42
42
  label: "annoterm",
@@ -73,24 +73,7 @@ var R = "tool-site-theme", z = (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
- ], te = { class: "fg-site-header" }, ne = { class: "fg-site-header__inner" }, re = ["aria-label"], ie = {
77
- class: "fg-site-projects__menu fg-site-nav",
78
- "aria-label": "Projects"
79
- }, U = ["href", "aria-current"], W = { class: "fg-site-header__end" }, G = {
80
- key: 0,
81
- class: "fg-site-header__links",
82
- "aria-label": "Site links"
83
- }, K = ["href"], q = {
84
- key: 0,
85
- class: "fg-site-appearance",
86
- role: "group",
87
- "aria-label": "Color theme"
88
- }, J = [
89
- "aria-label",
90
- "title",
91
- "aria-pressed",
92
- "onClick"
93
- ], Y = {
76
+ ], te = {
94
77
  viewBox: "0 0 24 24",
95
78
  width: "18",
96
79
  height: "18",
@@ -98,52 +81,88 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
98
81
  stroke: "currentColor",
99
82
  "stroke-width": "1.5",
100
83
  "aria-hidden": "true"
101
- }, ae = {
84
+ }, ne = {
102
85
  key: 2,
103
86
  d: "M20.5 13.5A9 9 0 0 1 10.5 3a9 9 0 1 0 10 10.5Z"
104
- }, oe = /* @__PURE__ */ m({
105
- __name: "UiSiteHeader",
106
- props: {
107
- project: {},
108
- links: { default: () => [] }
109
- },
110
- setup(e) {
111
- let t = [
87
+ }, W = /* @__PURE__ */ h({
88
+ __name: "UiSiteAppearancePicker",
89
+ props: { modelValue: { default: () => void 0 } },
90
+ emits: ["update:modelValue"],
91
+ setup(e, { emit: t }) {
92
+ let n = t, r = [
112
93
  {
113
94
  value: "system",
114
- label: "System"
95
+ label: "System theme"
115
96
  },
116
97
  {
117
98
  value: "light",
118
- label: "Light"
99
+ label: "Light theme"
119
100
  },
120
101
  {
121
102
  value: "dark",
122
- label: "Dark"
103
+ label: "Dark theme"
123
104
  }
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
- a.value && (a.value.open = !1);
105
+ ];
106
+ return (t, a) => (C(), l(i, {
107
+ class: "fg-site-appearance",
108
+ label: "Color theme",
109
+ size: "lg",
110
+ "icon-only": "",
111
+ items: r,
112
+ "model-value": e.modelValue,
113
+ "onUpdate:modelValue": a[0] ||= (e) => n("update:modelValue", e)
114
+ }, {
115
+ icon: F(({ item: e }) => [(C(), d("svg", te, [e.value === "system" ? (C(), d(s, { key: 0 }, [a[1] ||= f("rect", {
116
+ x: "3",
117
+ y: "4",
118
+ width: "18",
119
+ height: "13",
120
+ rx: "2"
121
+ }, null, -1), a[2] ||= f("path", { d: "M8 21h8m-4-4v4" }, null, -1)], 64)) : e.value === "light" ? (C(), d(s, { key: 1 }, [a[3] ||= f("circle", {
122
+ cx: "12",
123
+ cy: "12",
124
+ r: "4"
125
+ }, null, -1), a[4] ||= f("path", { d: "M12 2v2m0 16v2M2 12h2m16 0h2M5 5l1.5 1.5m11 11L19 19M5 19l1.5-1.5m11-11L19 5" }, null, -1)], 64)) : (C(), d("path", ne))]))]),
126
+ _: 1
127
+ }, 8, ["model-value"]));
128
+ }
129
+ }), re = { class: "fg-site-header" }, ie = { class: "fg-site-header__inner" }, G = ["aria-label"], K = {
130
+ class: "fg-site-projects__menu fg-site-nav",
131
+ "aria-label": "Projects"
132
+ }, q = ["href", "aria-current"], J = { class: "fg-site-header__end" }, Y = {
133
+ key: 0,
134
+ class: "fg-site-header__links",
135
+ "aria-label": "Site links"
136
+ }, ae = ["href"], oe = /* @__PURE__ */ h({
137
+ __name: "UiSiteHeader",
138
+ props: {
139
+ project: {},
140
+ links: { default: () => [] }
141
+ },
142
+ setup(e) {
143
+ let t = c(() => U.find(({ id: t }) => t === e.project)?.label ?? e.project), n = M().default ? void 0 : H(), r = w(!1), i = w(), a = w(), o = () => {
144
+ i.value && (i.value.open = !1);
126
145
  }, p = (e) => {
127
- e.key !== "Escape" || !a.value?.open || (f(), c.value?.focus());
146
+ e.key !== "Escape" || !i.value?.open || (o(), a.value?.focus());
128
147
  }, m = (e) => {
129
- e.relatedTarget instanceof Node && !a.value?.contains(e.relatedTarget) && f();
148
+ e.relatedTarget instanceof Node && !i.value?.contains(e.relatedTarget) && o();
130
149
  }, h = (e) => {
131
- e.target instanceof Node && !a.value?.contains(e.target) && f();
150
+ e.target instanceof Node && !i.value?.contains(e.target) && o();
132
151
  };
133
- return b(() => {
134
- i.value = !0, document.addEventListener("pointerdown", h);
135
- }), y(() => document.removeEventListener("pointerdown", h)), (s, f) => (S(), u("header", te, [d("div", ne, [d("details", {
152
+ return x(() => {
153
+ r.value = !0, document.addEventListener("pointerdown", h);
154
+ }), b(() => document.removeEventListener("pointerdown", h)), (o, c) => (C(), d("header", re, [f("div", ie, [f("details", {
136
155
  ref_key: "menu",
137
- ref: a,
156
+ ref: i,
138
157
  class: "fg-site-projects",
139
158
  onKeydown: p,
140
159
  onFocusout: m
141
- }, [d("summary", {
160
+ }, [f("summary", {
142
161
  ref_key: "trigger",
143
- ref: c,
162
+ ref: a,
144
163
  class: "fg-site-projects__trigger",
145
- "aria-label": `Project: ${n.value}`
146
- }, [d("span", null, D(n.value), 1), f[0] ||= d("svg", {
164
+ "aria-label": `Project: ${t.value}`
165
+ }, [f("span", null, O(t.value), 1), c[0] ||= f("svg", {
147
166
  class: "fg-site-projects__chevron",
148
167
  viewBox: "0 0 16 16",
149
168
  width: "16",
@@ -152,38 +171,24 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
152
171
  stroke: "currentColor",
153
172
  "stroke-width": "1.5",
154
173
  "aria-hidden": "true"
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", {
174
+ }, [f("path", { d: "m4 6 4 4 4-4" })], -1)], 8, G), f("nav", K, [(C(!0), d(s, null, T(k(U), (t) => (C(), d("a", {
156
175
  key: t.id,
157
176
  href: t.href,
158
177
  "aria-current": t.id === e.project ? "page" : void 0
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", {
178
+ }, O(t.label), 9, q))), 128))])], 544), f("div", J, [e.links.length > 0 ? (C(), d("nav", Y, [(C(!0), d(s, null, T(e.links, (e) => (C(), d("a", {
160
179
  key: e.href,
161
180
  href: e.href
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
- key: e.value,
164
- type: "button",
165
- class: "fg-site-appearance__choice",
166
- "aria-label": `${e.label} theme`,
167
- title: `${e.label} theme`,
168
- "aria-pressed": O(r).choice.value === e.value,
169
- onClick: (t) => O(r).chooseAppearance(e.value)
170
- }, [(S(), u("svg", Y, [e.value === "system" ? (S(), u(o, { key: 0 }, [f[1] ||= d("rect", {
171
- x: "3",
172
- y: "4",
173
- width: "18",
174
- height: "13",
175
- rx: "2"
176
- }, null, -1), f[2] ||= d("path", { d: "M8 21h8m-4-4v4" }, null, -1)], 64)) : e.value === "light" ? (S(), u(o, { key: 1 }, [f[3] ||= d("circle", {
177
- cx: "12",
178
- cy: "12",
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", ae))]))], 8, J)), 64))])) : l("", !0)])])])]));
181
+ }, O(e.label), 9, ae))), 128))])) : u("", !0), E(o.$slots, "default", {}, () => [r.value && k(n) ? (C(), l(W, {
182
+ key: 0,
183
+ "model-value": k(n).choice.value,
184
+ "onUpdate:modelValue": k(n).chooseAppearance
185
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : u("", !0)])])])]));
181
186
  }
182
187
  }), se = ["id"], ce = ["role", "aria-labelledby"], le = ["id"], ue = [
183
188
  "href",
184
189
  "aria-current",
185
190
  "onClick"
186
- ], de = { key: 0 }, X = /* @__PURE__ */ m({
191
+ ], de = { key: 0 }, X = /* @__PURE__ */ h({
187
192
  __name: "SiteNavLinks",
188
193
  props: {
189
194
  contentId: {},
@@ -194,95 +199,95 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
194
199
  emits: ["navigate"],
195
200
  setup(e, { emit: t }) {
196
201
  let n = t, r = `${e.contentId}-label`, i = (t) => `${e.contentId}-group-${t}`, a = (t) => t.current ? "page" : e.activeId !== void 0 && t.href === `#${e.activeId}` ? "location" : void 0;
197
- return (t, s) => (S(), u("div", {
202
+ return (t, o) => (C(), d("div", {
198
203
  id: e.contentId,
199
204
  class: "fg-site-rail__content"
200
- }, [d("nav", {
205
+ }, [f("nav", {
201
206
  class: "fg-site-rail__nav fg-site-nav",
202
207
  "aria-labelledby": r
203
- }, [d("h2", {
208
+ }, [f("h2", {
204
209
  id: r,
205
210
  class: "fg-site-rail__label"
206
- }, D(e.label), 1), (S(!0), u(o, null, w(e.groups, (e, t) => (S(), u("div", {
211
+ }, O(e.label), 1), (C(!0), d(s, null, T(e.groups, (e, t) => (C(), d("div", {
207
212
  key: e.label ?? t,
208
213
  class: "fg-site-rail__group",
209
214
  role: e.label ? "group" : void 0,
210
215
  "aria-labelledby": e.label ? i(t) : void 0
211
- }, [e.label ? (S(), u("span", {
216
+ }, [e.label ? (C(), d("span", {
212
217
  key: 0,
213
218
  id: i(t),
214
219
  class: "fg-site-rail__group-label"
215
- }, D(e.label), 9, le)) : l("", !0), (S(!0), u(o, null, w(e.items, (e) => (S(), u("a", {
220
+ }, O(e.label), 9, le)) : u("", !0), (C(!0), d(s, null, T(e.items, (e) => (C(), d("a", {
216
221
  key: e.href,
217
222
  href: e.href,
218
223
  "aria-current": a(e),
219
224
  onClick: (t) => n("navigate", e.href, t)
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));
225
+ }, [e.code ? (C(), d("code", de, O(e.label), 1)) : (C(), d(s, { key: 1 }, [p(O(e.label), 1)], 64))], 8, ue))), 128))], 8, ce))), 128))])], 8, se));
221
226
  }
222
- }), fe = ["data-enhanced"], pe = ["open"], me = ["aria-controls"], he = "(max-width: 800px)", ge = /* @__PURE__ */ m({
227
+ }), fe = ["data-enhanced"], pe = ["open"], me = ["aria-controls"], he = "(max-width: 800px)", ge = /* @__PURE__ */ h({
223
228
  __name: "UiSiteNav",
224
229
  props: {
225
230
  label: {},
226
231
  groups: {}
227
232
  },
228
233
  setup(e) {
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;
234
+ let n = A(), r = w(), i = w(!1), s = w(!1), u = w(!1), h = o({ targetIds: e.groups.flatMap((e) => e.items).flatMap(({ href: e }) => e.startsWith("#") && e.length > 1 ? [e.slice(1)] : []) }), g = c(() => e.groups.flatMap((e) => e.items).find((e) => e.current)?.label), v = c(() => e.groups.flatMap((e) => e.items).find((e) => e.href === `#${h.value}`)?.label), y = c(() => {
235
+ let t = g.value ?? v.value;
231
236
  return t ? `${e.label}: ${t}` : e.label;
232
- }), w, T = null, E = () => n.value?.querySelector("button.fg-site-rail__toggle"), A = () => {
233
- g(() => n.value?.querySelector(".fg-site-nav a")?.focus({ preventScroll: !0 }));
237
+ }), b, T = null, E = () => r.value?.querySelector("button.fg-site-rail__toggle"), D = () => {
238
+ _(() => r.value?.querySelector(".fg-site-nav a")?.focus({ preventScroll: !0 }));
234
239
  }, 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();
240
+ let e = b?.matches && !s.value && r.value?.contains(document.activeElement), t = b?.matches === !1 && s.value && !u.value && E() === document.activeElement;
241
+ s.value = b?.matches === !0, s.value || (u.value = !1), e ? _(() => E()?.focus({ preventScroll: !0 })) : t && D();
237
242
  }, 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);
243
+ !u.value || t.button !== 0 || t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || (T = e.startsWith("#") ? document.getElementById(e.slice(1)) : null, u.value = !1);
239
244
  }, N = (e) => {
240
- T ? (e.preventDefault(), T.tabIndex = -1, T.focus({ preventScroll: !0 }), T = null) : l.value || (e.preventDefault(), A());
245
+ T ? (e.preventDefault(), T.tabIndex = -1, T.focus({ preventScroll: !0 }), T = null) : s.value || (e.preventDefault(), D());
241
246
  };
242
- return b(() => {
243
- w = matchMedia(he), j(), o.value = !0, w.addEventListener("change", j);
244
- }), x(() => w?.removeEventListener("change", j)), (a, s) => (S(), u("div", {
247
+ return x(() => {
248
+ b = matchMedia(he), j(), i.value = !0, b.addEventListener("change", j);
249
+ }), S(() => b?.removeEventListener("change", j)), (o, c) => (C(), d("div", {
245
250
  ref_key: "root",
246
- ref: n,
251
+ ref: r,
247
252
  class: "fg-site-rail",
248
- "data-enhanced": o.value
249
- }, [!o.value || !l.value ? (S(), u("details", {
253
+ "data-enhanced": i.value
254
+ }, [!i.value || !s.value ? (C(), d("details", {
250
255
  key: 0,
251
256
  class: "fg-site-rail__menu",
252
- open: o.value && !l.value
253
- }, [d("summary", {
257
+ open: i.value && !s.value
258
+ }, [f("summary", {
254
259
  class: "fg-site-rail__summary",
255
- "aria-controls": O(t)
256
- }, D(y.value), 9, me), p(X, {
257
- "content-id": O(t),
260
+ "aria-controls": k(n)
261
+ }, O(y.value), 9, me), m(X, {
262
+ "content-id": k(n),
258
263
  label: e.label,
259
264
  groups: e.groups,
260
- "active-id": O(h)
265
+ "active-id": k(h)
261
266
  }, null, 8, [
262
267
  "content-id",
263
268
  "label",
264
269
  "groups",
265
270
  "active-id"
266
- ])], 8, pe)) : (S(), c(i, {
271
+ ])], 8, pe)) : (C(), l(t, {
267
272
  key: 1,
268
- open: m.value,
269
- "onUpdate:open": s[0] ||= (e) => m.value = e,
273
+ open: u.value,
274
+ "onUpdate:open": c[0] ||= (e) => u.value = e,
270
275
  title: e.label,
271
276
  onCloseAutoFocus: N
272
277
  }, {
273
- trigger: P(() => [p(r, {
278
+ trigger: F(() => [m(a, {
274
279
  variant: "ghost",
275
280
  size: "lg",
276
281
  class: "fg-site-rail__toggle"
277
282
  }, {
278
- default: P(() => [f(D(y.value), 1)]),
283
+ default: F(() => [p(O(y.value), 1)]),
279
284
  _: 1
280
285
  })]),
281
- default: P(() => [p(X, {
282
- "content-id": O(t),
286
+ default: F(() => [m(X, {
287
+ "content-id": k(n),
283
288
  label: e.label,
284
289
  groups: e.groups,
285
- "active-id": O(h),
290
+ "active-id": k(h),
286
291
  onNavigate: M
287
292
  }, null, 8, [
288
293
  "content-id",
@@ -298,7 +303,7 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
298
303
  "tabindex",
299
304
  "data-fit",
300
305
  "innerHTML"
301
- ], Z = .7, Q = /* @__PURE__ */ m({
306
+ ], Z = .7, Q = /* @__PURE__ */ h({
302
307
  __name: "CaptureScreen",
303
308
  props: {
304
309
  html: {},
@@ -306,7 +311,7 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
306
311
  fit: { type: Boolean }
307
312
  },
308
313
  setup(e) {
309
- let t = C(), n = C(1), r = C(), i = s(() => r.value !== void 0), a, o = () => {
314
+ let t = w(), n = w(1), r = w(), i = c(() => r.value !== void 0), a, o = () => {
310
315
  if (!e.fit) {
311
316
  r.value = void 0, n.value = 1;
312
317
  return;
@@ -316,9 +321,9 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
316
321
  let o = Math.min(1, i.clientWidth / a.offsetWidth);
317
322
  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;
318
323
  };
319
- return N(() => [e.fit, e.html], o, { flush: "post" }), b(() => {
324
+ return P(() => [e.fit, e.html], o, { flush: "post" }), x(() => {
320
325
  typeof ResizeObserver < "u" && (a = new ResizeObserver(o), t.value && a.observe(t.value)), o();
321
- }), x(() => a?.disconnect()), (a, o) => (S(), u("div", {
326
+ }), S(() => a?.disconnect()), (a, o) => (C(), d("div", {
322
327
  ref_key: "container",
323
328
  ref: t,
324
329
  class: "fg-capture__screen",
@@ -326,7 +331,7 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
326
331
  "aria-label": e.label,
327
332
  tabindex: i.value ? void 0 : 0,
328
333
  "data-fit": i.value || void 0,
329
- style: v({
334
+ style: y({
330
335
  height: r.value === void 0 ? void 0 : `${r.value}px`,
331
336
  "--capture-scale": n.value
332
337
  }),
@@ -336,9 +341,9 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
336
341
  }), ve = ["data-enhanced"], ye = ["aria-label"], be = ["id"], xe = { class: "fg-capture__preview" }, Se = ["title", "onClick"], Ce = {
337
342
  key: 0,
338
343
  class: "fg-capture__caption"
339
- }, we = { key: 0 }, Te = /* @__PURE__ */ m({
344
+ }, we = { key: 0 }, Te = /* @__PURE__ */ h({
340
345
  __name: "UiCapture",
341
- props: /*@__PURE__*/ h({
346
+ props: /*@__PURE__*/ g({
342
347
  items: {},
343
348
  label: {},
344
349
  idPrefix: { default: "frame-" }
@@ -347,14 +352,14 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
347
352
  modelModifiers: {}
348
353
  }),
349
354
  emits: ["update:modelValue"],
350
- setup(e) {
351
- let i = A(e, "modelValue"), a = C(!1), m = s(() => e.items.map(({ id: e, label: t }) => ({
355
+ setup(t) {
356
+ let r = j(t, "modelValue"), i = w(!1), o = c(() => t.items.map(({ id: e, label: t }) => ({
352
357
  value: e,
353
358
  label: t
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) => {
359
+ }))), h = c(() => r.value ?? t.items[0]?.id ?? ""), g = c(() => t.items.find(({ id: e }) => e === h.value)), v = w(!1), y = D(), b = 0, k = 0, A = N("fullSizeButton"), M = (e) => {
355
360
  y.value = e, v.value = !0;
356
- }, F = (e) => {
357
- j.value?.isConnected && (e.preventDefault(), j.value.focus({ preventScroll: !0 }));
361
+ }, P = (e) => {
362
+ A.value?.isConnected && (e.preventDefault(), A.value.focus({ preventScroll: !0 }));
358
363
  }, I = () => {
359
364
  try {
360
365
  return document.getElementById(decodeURIComponent(location.hash.slice(1)));
@@ -362,99 +367,99 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
362
367
  return null;
363
368
  }
364
369
  }, L = async () => {
365
- await g(), cancelAnimationFrame(O), cancelAnimationFrame(k), O = requestAnimationFrame(() => {
370
+ await _(), cancelAnimationFrame(b), cancelAnimationFrame(k), b = requestAnimationFrame(() => {
366
371
  k = requestAnimationFrame(() => I()?.scrollIntoView({
367
372
  behavior: "instant",
368
373
  block: "start"
369
374
  }));
370
375
  });
371
376
  }, R = () => {
372
- let t = I();
373
- if (!t) return !1;
374
- let n = e.items.find(({ id: n }) => document.getElementById(`${e.idPrefix}${n}`)?.contains(t));
375
- return !n || h.value === n.id ? !1 : (i.value = n.id, !0);
377
+ let e = I();
378
+ if (!e) return !1;
379
+ let n = t.items.find(({ id: n }) => document.getElementById(`${t.idPrefix}${n}`)?.contains(e));
380
+ return !n || h.value === n.id ? !1 : (r.value = n.id, !0);
376
381
  }, z = () => {
377
382
  R() && L();
378
383
  };
379
- return b(() => {
380
- a.value = !0, R(), location.hash && L(), window.addEventListener("hashchange", z), window.addEventListener("popstate", z);
381
- }), x(() => {
382
- cancelAnimationFrame(O), cancelAnimationFrame(k), window.removeEventListener("hashchange", z), window.removeEventListener("popstate", z);
383
- }), (s, g) => (S(), u("div", {
384
+ return x(() => {
385
+ i.value = !0, R(), location.hash && L(), window.addEventListener("hashchange", z), window.addEventListener("popstate", z);
386
+ }), S(() => {
387
+ cancelAnimationFrame(b), cancelAnimationFrame(k), window.removeEventListener("hashchange", z), window.removeEventListener("popstate", z);
388
+ }), (c, _) => (C(), d("div", {
384
389
  class: "fg-capture",
385
- "data-enhanced": a.value
390
+ "data-enhanced": i.value
386
391
  }, [
387
- a.value && _.value ? (S(), u("button", {
392
+ i.value && g.value ? (C(), d("button", {
388
393
  key: 0,
389
394
  ref_key: "fullSizeButton",
390
- ref: j,
395
+ ref: A,
391
396
  type: "button",
392
397
  class: "fg-capture__full",
393
- "aria-label": `Expand ${_.value.label} capture at full size`,
398
+ "aria-label": `Expand ${g.value.label} capture at full size`,
394
399
  "aria-haspopup": "dialog",
395
- onClick: g[0] ||= (e) => N(_.value)
396
- }, [...g[4] ||= [d("svg", {
400
+ onClick: _[0] ||= (e) => M(g.value)
401
+ }, [..._[4] ||= [f("svg", {
397
402
  viewBox: "0 0 24 24",
398
403
  fill: "none",
399
404
  stroke: "currentColor",
400
405
  "stroke-width": "1.5",
401
406
  "aria-hidden": "true"
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),
403
- p(n, {
407
+ }, [f("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" })], -1), f("span", { class: "fg-capture__full-label" }, "Full size", -1)]], 8, ye)) : u("", !0),
408
+ m(n, {
404
409
  "model-value": h.value,
405
- items: m.value,
406
- label: e.label,
407
- "onUpdate:modelValue": g[1] ||= (e) => i.value = e
410
+ items: o.value,
411
+ label: t.label,
412
+ "onUpdate:modelValue": _[1] ||= (e) => r.value = e
408
413
  }, {
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", {
414
+ panel: F(({ value: e }) => [(C(!0), d(s, null, T(t.items, (n) => (C(), d(s, { key: n.id }, [n.id === e ? (C(), d("figure", {
410
415
  key: 0,
411
- id: `${e.idPrefix}${n.id}`,
416
+ id: `${t.idPrefix}${n.id}`,
412
417
  class: "fg-capture__figure"
413
- }, [d("div", xe, [p(Q, {
418
+ }, [f("div", xe, [m(Q, {
414
419
  html: n.html,
415
420
  label: `Terminal capture: ${n.label}`,
416
- fit: a.value
421
+ fit: i.value
417
422
  }, null, 8, [
418
423
  "html",
419
424
  "label",
420
425
  "fit"
421
- ]), a.value ? (S(), u("button", {
426
+ ]), i.value ? (C(), d("button", {
422
427
  key: 0,
423
428
  type: "button",
424
429
  class: "fg-capture__expand",
425
430
  tabindex: "-1",
426
431
  "aria-hidden": "true",
427
432
  title: `Open ${n.label} capture at full size`,
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))]),
433
+ onClick: (e) => M(n)
434
+ }, null, 8, Se)) : u("", !0)]), n.command || c.$slots.caption ? (C(), d("figcaption", Ce, [n.command ? (C(), d("code", we, O(n.command), 1)) : u("", !0), E(c.$slots, "caption", { item: n })])) : u("", !0)], 8, be)) : u("", !0)], 64))), 128))]),
430
435
  _: 3
431
436
  }, 8, [
432
437
  "model-value",
433
438
  "items",
434
439
  "label"
435
440
  ]),
436
- p(t, {
441
+ m(e, {
437
442
  open: v.value,
438
- "onUpdate:open": g[3] ||= (e) => v.value = e,
443
+ "onUpdate:open": _[3] ||= (e) => v.value = e,
439
444
  title: `${y.value?.label ?? ""} capture`,
440
445
  description: "Scroll to read the full capture.",
441
446
  class: "fg-capture-viewer",
442
- onCloseAutoFocus: F
447
+ onCloseAutoFocus: P
443
448
  }, {
444
- footer: P(() => [p(r, {
449
+ footer: F(() => [m(a, {
445
450
  variant: "secondary",
446
451
  size: "lg",
447
- onClick: g[2] ||= (e) => v.value = !1
452
+ onClick: _[2] ||= (e) => v.value = !1
448
453
  }, {
449
- default: P(() => [...g[5] ||= [f(" Close capture ", -1)]]),
454
+ default: F(() => [..._[5] ||= [p(" Close capture ", -1)]]),
450
455
  _: 1
451
456
  })]),
452
- default: P(() => [y.value ? (S(), c(Q, {
457
+ default: F(() => [y.value ? (C(), l(Q, {
453
458
  key: 0,
454
459
  html: y.value.html,
455
460
  label: `${y.value.label} capture at full size`,
456
461
  fit: !1
457
- }, null, 8, ["html", "label"])) : l("", !0)]),
462
+ }, null, 8, ["html", "label"])) : u("", !0)]),
458
463
  _: 1
459
464
  }, 8, ["open", "title"])
460
465
  ], 8, ve));
@@ -476,7 +481,7 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
476
481
  }, Fe = {
477
482
  key: 0,
478
483
  d: "m5 12 4 4L19 6"
479
- }, Ie = /* @__PURE__ */ m({
484
+ }, Ie = /* @__PURE__ */ h({
480
485
  __name: "UiCommandList",
481
486
  props: {
482
487
  items: {},
@@ -487,42 +492,42 @@ var R = "tool-site-theme", z = (e) => e === "system" || e === "light" || e === "
487
492
  commandHeader: { default: "Command" },
488
493
  descriptionHeader: { default: "What it does" }
489
494
  },
490
- setup(t) {
491
- let n = C(!1);
492
- b(() => {
493
- n.value = !0;
495
+ setup(e) {
496
+ let t = w(!1);
497
+ x(() => {
498
+ t.value = !0;
494
499
  });
495
- let { copied: r, pending: i, error: a, copy: c } = e({
500
+ let { copied: n, pending: i, error: a, copy: o } = r({
496
501
  unavailableMessage: "Clipboard unavailable. Select the command to copy it.",
497
502
  failureMessage: "Could not copy. Select the command to copy it."
498
- }), p = C(""), m = s(() => a.value || (r.value ? `${p.value} copied to clipboard.` : "")), h = (e) => (p.value = e, c(e));
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)
503
- ])]), d("tbody", null, [(S(!0), u(o, null, w(t.items, (c) => (S(), u("tr", { key: c.command }, [
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", {
503
+ }), l = w(""), m = c(() => a.value || (n.value ? `${l.value} copied to clipboard.` : "")), h = (e) => (l.value = e, o(e));
504
+ return (r, o) => (C(), d("div", Ee, [f("table", De, [f("thead", null, [f("tr", null, [
505
+ f("th", $, O(e.commandHeader), 1),
506
+ f("th", Oe, O(e.descriptionHeader), 1),
507
+ e.copyable ? (C(), d("td", ke)) : u("", !0)
508
+ ])]), f("tbody", null, [(C(!0), d(s, null, T(e.items, (c) => (C(), d("tr", { key: c.command }, [
509
+ f("td", Ae, [E(r.$slots, "command", { item: c }, () => [f("code", null, O(c.command), 1)])]),
510
+ f("td", je, [E(r.$slots, "description", { item: c }, () => [p(O(c.description), 1)])]),
511
+ e.copyable ? (C(), d("td", Me, [t.value ? (C(), d("button", {
507
512
  key: 0,
508
513
  type: "button",
509
514
  class: "fg-command-list__copy",
510
- disabled: O(i),
515
+ disabled: k(i),
511
516
  "aria-label": `Copy ${c.command}`,
512
517
  title: `Copy ${c.command}`,
513
518
  onClick: (e) => h(c.command)
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", {
519
+ }, [(C(), d("svg", Pe, [k(n) && !k(a) && l.value === c.command ? (C(), d("path", Fe)) : (C(), d(s, { key: 1 }, [o[0] ||= f("rect", {
515
520
  x: "8",
516
521
  y: "8",
517
522
  width: "12",
518
523
  height: "13",
519
524
  rx: "2"
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)
521
- ]))), 128))])]), d("span", {
522
- class: _(["fg-command-list__status", { "fg-site-sr-only": !O(a) }]),
525
+ }, null, -1), o[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))]))], 8, Ne)) : u("", !0)])) : u("", !0)
526
+ ]))), 128))])]), f("span", {
527
+ class: v(["fg-command-list__status", { "fg-site-sr-only": !k(a) }]),
523
528
  role: "status"
524
- }, D(m.value), 3)]));
529
+ }, O(m.value), 3)]));
525
530
  }
526
531
  });
527
532
  //#endregion
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 };
533
+ export { z as SITE_APPEARANCE_KEY, U as SITE_PROJECTS, Te as UiCapture, Ie as UiCommandList, W as UiSiteAppearancePicker, oe as UiSiteHeader, ge as UiSiteNav, V as applySiteAppearance, ee as siteThemeBootScript, H as useSiteAppearance };