@filipgutica/ui 1.6.0 → 1.7.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 CHANGED
@@ -176,8 +176,9 @@ breakpoint.
176
176
 
177
177
  `UiCapture` shows one panel: tabs in the header, the capture scaled to the panel
178
178
  width, and the `command` and `caption` slot below. `html` is trusted, checked-in
179
- terminal markup with a single root element. The expand button opens the capture
180
- at full size in a dialog and returns focus to the button on close. `v-model`
179
+ terminal markup with a single root element. The Full size button at the end of
180
+ the tab row, or a click on the capture, opens it at full size in a dialog, and
181
+ focus returns to the button on close. Phones show the button as an icon. `v-model`
181
182
  holds the active ID and defaults to the first item. Each capture has the ID
182
183
  `idPrefix` + `id` (`frame-` by default), so a deep link such as `#frame-read`
183
184
  selects its tab on load and on hash change. Without JavaScript every capture is
@@ -186,8 +187,8 @@ colors: set `--site-capture-bg` on `:root`, because the dialog renders outside
186
187
  the panel.
187
188
 
188
189
  `UiCommandList` renders a table of monospace commands and descriptions. Use the
189
- `description` slot for `<kbd>` or `<code>`, and `commandHeader` and
190
- `descriptionHeader` to rename the columns. Each row gets a copy button named
190
+ `command` slot to show a key as `<kbd>`, the `description` slot for `<kbd>` or
191
+ `<code>`, and `commandHeader` and `descriptionHeader` to rename the columns. Each row gets a copy button named
191
192
  "Copy <command>" once the page is interactive; set `copyable` to `false` to
192
193
  remove them. A status message announces each copy and shows a fallback when
193
194
  the clipboard is unavailable. At 640px and below each command stacks above its
@@ -10,6 +10,10 @@ export interface UiCommandListProps {
10
10
  descriptionHeader?: string;
11
11
  }
12
12
  type __VLS_Slots = {
13
+ /** Replaces the code-styled command, for a key shown as `<kbd>`. Copying still uses `item.command`. */
14
+ command?(props: {
15
+ item: UiCommandItem;
16
+ }): unknown;
13
17
  /** Replaces the plain description, for text with `<kbd>` or `<code>`. */
14
18
  description?(props: {
15
19
  item: UiCommandItem;
package/dist/site.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as e, i as t, n, o as r, r as i, t as a } from "./use-active-section-CiflgGBI.js";
2
- import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, 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 ee, useSlots as A, watch as j, withCtx as M } from "vue";
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 ee, useSlots as A, useTemplateRef as te, watch as j, withCtx as M } from "vue";
3
3
  import { tryOnMounted as N, usePreferredDark as P, useStorage as F } from "@vueuse/core";
4
4
  //#region src/site/appearance.ts
5
- var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "dark", te = `(function () {
5
+ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "dark", ne = `(function () {
6
6
  var root = document.documentElement, choice;
7
7
  try { choice = localStorage.getItem('${I}'); } catch (error) {}
8
8
  var dark = choice === 'dark';
@@ -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
- ], ne = { class: "fg-site-header" }, re = { class: "fg-site-header__inner" }, V = ["aria-label"], H = {
76
+ ], re = { class: "fg-site-header" }, V = { class: "fg-site-header__inner" }, H = ["aria-label"], U = {
77
77
  class: "fg-site-projects__menu fg-site-nav",
78
78
  "aria-label": "Projects"
79
- }, U = ["href", "aria-current"], W = { class: "fg-site-header__end" }, G = {
79
+ }, W = ["href", "aria-current"], G = { class: "fg-site-header__end" }, K = {
80
80
  key: 0,
81
81
  class: "fg-site-header__links",
82
82
  "aria-label": "Site links"
83
- }, K = ["href"], q = {
83
+ }, q = ["href"], J = {
84
84
  key: 0,
85
85
  class: "fg-site-appearance",
86
86
  role: "group",
87
87
  "aria-label": "Color theme"
88
- }, J = [
88
+ }, Y = [
89
89
  "aria-label",
90
90
  "title",
91
91
  "aria-pressed",
92
92
  "onClick"
93
- ], Y = {
93
+ ], X = {
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
- }, X = {
101
+ }, ie = {
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
- }, ie = /* @__PURE__ */ m({
104
+ }, ae = /* @__PURE__ */ m({
105
105
  __name: "UiSiteHeader",
106
106
  props: {
107
107
  project: {},
@@ -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", ne, [d("div", re, [d("details", {
135
+ }), y(() => document.removeEventListener("pointerdown", h)), (s, f) => (S(), u("header", re, [d("div", V, [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, V), d("nav", H, [(S(!0), u(o, null, w(O(B), (t) => (S(), u("a", {
155
+ }, [d("path", { d: "m4 6 4 4 4-4" })], -1)], 8, H), d("nav", U, [(S(!0), u(o, null, w(O(B), (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, 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", {
159
+ }, D(t.label), 9, W))), 128))])], 544), d("div", G, [e.links.length > 0 ? (S(), u("nav", K, [(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, 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", {
162
+ }, D(e.label), 9, q))), 128))])) : l("", !0), T(s.$slots, "default", {}, () => [i.value && O(r) ? (S(), u("div", J, [(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", Y, [e.value === "system" ? (S(), u(o, { key: 0 }, [f[1] ||= d("rect", {
170
+ }, [(S(), u("svg", X, [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", X))]))], 8, J)), 64))])) : l("", !0)])])])]));
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", ie))]))], 8, Y)), 64))])) : l("", !0)])])])]));
181
181
  }
182
- }), ae = ["id"], oe = ["role", "aria-labelledby"], se = ["id"], ce = [
182
+ }), oe = ["id"], se = ["role", "aria-labelledby"], ce = ["id"], le = [
183
183
  "href",
184
184
  "aria-current",
185
185
  "onClick"
186
- ], le = { key: 0 }, Z = /* @__PURE__ */ m({
186
+ ], ue = { key: 0 }, Z = /* @__PURE__ */ m({
187
187
  __name: "SiteNavLinks",
188
188
  props: {
189
189
  contentId: {},
@@ -212,14 +212,14 @@ 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, se)) : l("", !0), (S(!0), u(o, null, w(e.items, (e) => (S(), u("a", {
215
+ }, D(e.label), 9, ce)) : 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", le, D(e.label), 1)) : (S(), u(o, { key: 1 }, [f(D(e.label), 1)], 64))], 8, ce))), 128))], 8, oe))), 128))])], 8, ae));
220
+ }, [e.code ? (S(), u("code", ue, D(e.label), 1)) : (S(), u(o, { key: 1 }, [f(D(e.label), 1)], 64))], 8, le))), 128))], 8, se))), 128))])], 8, oe));
221
221
  }
222
- }), ue = ["data-enhanced"], de = ["open"], fe = ["aria-controls"], pe = "(max-width: 800px)", me = /* @__PURE__ */ m({
222
+ }), de = ["data-enhanced"], fe = ["open"], pe = ["aria-controls"], me = "(max-width: 800px)", he = /* @__PURE__ */ m({
223
223
  __name: "UiSiteNav",
224
224
  props: {
225
225
  label: {},
@@ -237,7 +237,7 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
237
237
  _ ? (e.preventDefault(), _.tabIndex = -1, _.focus({ preventScroll: !0 }), _ = null) : s.value || (e.preventDefault(), y());
238
238
  };
239
239
  return b(() => {
240
- h = matchMedia(pe), w(), o.value = !0, h.addEventListener("change", w);
240
+ h = matchMedia(me), w(), o.value = !0, h.addEventListener("change", w);
241
241
  }), x(() => h?.removeEventListener("change", w)), (a, h) => (S(), u("div", {
242
242
  ref_key: "root",
243
243
  ref: n,
@@ -250,7 +250,7 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
250
250
  }, [d("summary", {
251
251
  class: "fg-site-rail__summary",
252
252
  "aria-controls": O(t)
253
- }, " Menu ", 8, fe), p(Z, {
253
+ }, " Menu ", 8, pe), p(Z, {
254
254
  "content-id": O(t),
255
255
  label: e.label,
256
256
  groups: e.groups,
@@ -260,7 +260,7 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
260
260
  "label",
261
261
  "groups",
262
262
  "active-id"
263
- ])], 8, de)) : (S(), c(i, {
263
+ ])], 8, fe)) : (S(), c(i, {
264
264
  key: 1,
265
265
  open: l.value,
266
266
  "onUpdate:open": h[0] ||= (e) => l.value = e,
@@ -288,9 +288,9 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
288
288
  "active-id"
289
289
  ])]),
290
290
  _: 1
291
- }, 8, ["open"]))], 8, ue));
291
+ }, 8, ["open"]))], 8, de));
292
292
  }
293
- }), he = [
293
+ }), ge = [
294
294
  "aria-label",
295
295
  "tabindex",
296
296
  "data-fit",
@@ -326,16 +326,12 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
326
326
  "--capture-scale": n.value
327
327
  }),
328
328
  innerHTML: e.html
329
- }, null, 12, he));
329
+ }, null, 12, ge));
330
330
  }
331
- }), ge = ["data-enhanced"], _e = ["id"], ve = { class: "fg-capture__preview" }, ye = [
332
- "aria-label",
333
- "title",
334
- "onClick"
335
- ], be = {
331
+ }), _e = ["data-enhanced"], ve = ["aria-label"], ye = ["id"], be = { class: "fg-capture__preview" }, xe = ["title", "onClick"], Se = {
336
332
  key: 0,
337
333
  class: "fg-capture__caption"
338
- }, xe = { key: 0 }, Se = /* @__PURE__ */ m({
334
+ }, Ce = { key: 0 }, we = /* @__PURE__ */ m({
339
335
  __name: "UiCapture",
340
336
  props: /*@__PURE__*/ h({
341
337
  items: {},
@@ -350,113 +346,132 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
350
346
  let i = ee(e, "modelValue"), a = C(!1), m = s(() => e.items.map(({ id: e, label: t }) => ({
351
347
  value: e,
352
348
  label: t
353
- }))), h = s(() => i.value ?? e.items[0]?.id ?? ""), _ = C(!1), v = E(), y, O = 0, k = 0, A = (e, t) => {
354
- t.currentTarget instanceof HTMLElement && (y = t.currentTarget), v.value = e, _.value = !0;
355
- }, j = (e) => {
356
- y?.isConnected && (e.preventDefault(), y.focus({ preventScroll: !0 }));
357
- }, N = () => {
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, A = te("fullSizeButton"), j = (e) => {
350
+ y.value = e, v.value = !0;
351
+ }, N = (e) => {
352
+ A.value?.isConnected && (e.preventDefault(), A.value.focus({ preventScroll: !0 }));
353
+ }, P = () => {
358
354
  try {
359
355
  return document.getElementById(decodeURIComponent(location.hash.slice(1)));
360
356
  } catch {
361
357
  return null;
362
358
  }
363
- }, P = async () => {
359
+ }, F = async () => {
364
360
  await g(), cancelAnimationFrame(O), cancelAnimationFrame(k), O = requestAnimationFrame(() => {
365
- k = requestAnimationFrame(() => N()?.scrollIntoView({
361
+ k = requestAnimationFrame(() => P()?.scrollIntoView({
366
362
  behavior: "instant",
367
363
  block: "start"
368
364
  }));
369
365
  });
370
- }, F = () => {
371
- let t = N();
366
+ }, I = () => {
367
+ let t = P();
372
368
  if (!t) return !1;
373
369
  let n = e.items.find(({ id: n }) => document.getElementById(`${e.idPrefix}${n}`)?.contains(t));
374
370
  return !n || h.value === n.id ? !1 : (i.value = n.id, !0);
375
- }, I = () => {
376
- F() && P();
371
+ }, L = () => {
372
+ I() && F();
377
373
  };
378
374
  return b(() => {
379
- a.value = !0, F(), location.hash && P(), window.addEventListener("hashchange", I), window.addEventListener("popstate", I);
375
+ a.value = !0, I(), location.hash && F(), window.addEventListener("hashchange", L), window.addEventListener("popstate", L);
380
376
  }), x(() => {
381
- cancelAnimationFrame(O), cancelAnimationFrame(k), window.removeEventListener("hashchange", I), window.removeEventListener("popstate", I);
377
+ cancelAnimationFrame(O), cancelAnimationFrame(k), window.removeEventListener("hashchange", L), window.removeEventListener("popstate", L);
382
378
  }), (s, g) => (S(), u("div", {
383
379
  class: "fg-capture",
384
380
  "data-enhanced": a.value
385
- }, [p(n, {
386
- "model-value": h.value,
387
- items: m.value,
388
- label: e.label,
389
- "onUpdate:modelValue": g[0] ||= (e) => i.value = e
390
- }, {
391
- panel: M(({ value: t }) => [(S(!0), u(o, null, w(e.items, (n) => (S(), u(o, { key: n.id }, [n.id === t ? (S(), u("figure", {
392
- key: 0,
393
- id: `${e.idPrefix}${n.id}`,
394
- class: "fg-capture__figure"
395
- }, [d("div", ve, [p(Q, {
396
- html: n.html,
397
- label: `Terminal capture: ${n.label}`,
398
- fit: a.value
399
- }, null, 8, [
400
- "html",
401
- "label",
402
- "fit"
403
- ]), a.value ? (S(), u("button", {
381
+ }, [
382
+ a.value && _.value ? (S(), u("button", {
404
383
  key: 0,
384
+ ref_key: "fullSizeButton",
385
+ ref: A,
405
386
  type: "button",
406
- class: "fg-capture__expand",
407
- "aria-label": `Expand ${n.label} capture`,
387
+ class: "fg-capture__full",
388
+ "aria-label": `Expand ${_.value.label} capture at full size`,
408
389
  "aria-haspopup": "dialog",
409
- title: `Open ${n.label} capture at full size`,
410
- onClick: (e) => A(n, e)
411
- }, null, 8, ye)) : l("", !0)]), n.command || s.$slots.caption ? (S(), u("figcaption", be, [n.command ? (S(), u("code", xe, D(n.command), 1)) : l("", !0), T(s.$slots, "caption", { item: n })])) : l("", !0)], 8, _e)) : l("", !0)], 64))), 128))]),
412
- _: 3
413
- }, 8, [
414
- "model-value",
415
- "items",
416
- "label"
417
- ]), p(t, {
418
- open: _.value,
419
- "onUpdate:open": g[2] ||= (e) => _.value = e,
420
- title: `${v.value?.label ?? ""} capture`,
421
- description: "Scroll to read the full capture.",
422
- class: "fg-capture-viewer",
423
- onCloseAutoFocus: j
424
- }, {
425
- footer: M(() => [p(r, {
426
- variant: "secondary",
427
- size: "lg",
428
- onClick: g[1] ||= (e) => _.value = !1
390
+ onClick: g[0] ||= (e) => j(_.value)
391
+ }, [...g[4] ||= [d("svg", {
392
+ viewBox: "0 0 24 24",
393
+ fill: "none",
394
+ stroke: "currentColor",
395
+ "stroke-width": "1.5",
396
+ "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, ve)) : l("", !0),
398
+ p(n, {
399
+ "model-value": h.value,
400
+ items: m.value,
401
+ label: e.label,
402
+ "onUpdate:modelValue": g[1] ||= (e) => i.value = e
429
403
  }, {
430
- default: M(() => [...g[3] ||= [f(" Close capture ", -1)]]),
404
+ panel: M(({ value: t }) => [(S(!0), u(o, null, w(e.items, (n) => (S(), u(o, { key: n.id }, [n.id === t ? (S(), u("figure", {
405
+ key: 0,
406
+ id: `${e.idPrefix}${n.id}`,
407
+ class: "fg-capture__figure"
408
+ }, [d("div", be, [p(Q, {
409
+ html: n.html,
410
+ label: `Terminal capture: ${n.label}`,
411
+ fit: a.value
412
+ }, null, 8, [
413
+ "html",
414
+ "label",
415
+ "fit"
416
+ ]), a.value ? (S(), u("button", {
417
+ key: 0,
418
+ type: "button",
419
+ class: "fg-capture__expand",
420
+ tabindex: "-1",
421
+ "aria-hidden": "true",
422
+ title: `Open ${n.label} capture at full size`,
423
+ onClick: (e) => j(n)
424
+ }, null, 8, xe)) : l("", !0)]), n.command || s.$slots.caption ? (S(), u("figcaption", Se, [n.command ? (S(), u("code", Ce, D(n.command), 1)) : l("", !0), T(s.$slots, "caption", { item: n })])) : l("", !0)], 8, ye)) : l("", !0)], 64))), 128))]),
425
+ _: 3
426
+ }, 8, [
427
+ "model-value",
428
+ "items",
429
+ "label"
430
+ ]),
431
+ p(t, {
432
+ open: v.value,
433
+ "onUpdate:open": g[3] ||= (e) => v.value = e,
434
+ title: `${y.value?.label ?? ""} capture`,
435
+ description: "Scroll to read the full capture.",
436
+ class: "fg-capture-viewer",
437
+ onCloseAutoFocus: N
438
+ }, {
439
+ footer: M(() => [p(r, {
440
+ variant: "secondary",
441
+ size: "lg",
442
+ onClick: g[2] ||= (e) => v.value = !1
443
+ }, {
444
+ default: M(() => [...g[5] ||= [f(" Close capture ", -1)]]),
445
+ _: 1
446
+ })]),
447
+ default: M(() => [y.value ? (S(), c(Q, {
448
+ key: 0,
449
+ html: y.value.html,
450
+ label: `${y.value.label} capture at full size`,
451
+ fit: !1
452
+ }, null, 8, ["html", "label"])) : l("", !0)]),
431
453
  _: 1
432
- })]),
433
- default: M(() => [v.value ? (S(), c(Q, {
434
- key: 0,
435
- html: v.value.html,
436
- label: `${v.value.label} capture at full size`,
437
- fit: !1
438
- }, null, 8, ["html", "label"])) : l("", !0)]),
439
- _: 1
440
- }, 8, ["open", "title"])], 8, ge));
454
+ }, 8, ["open", "title"])
455
+ ], 8, _e));
441
456
  }
442
- }), Ce = { class: "fg-command-list" }, we = { class: "fg-command-list__table" }, Te = { scope: "col" }, Ee = { scope: "col" }, De = { key: 0 }, $ = { class: "fg-command-list__command" }, Oe = { class: "fg-command-list__description" }, ke = {
457
+ }), Te = { class: "fg-command-list" }, Ee = { class: "fg-command-list__table" }, De = { scope: "col" }, $ = { scope: "col" }, Oe = { key: 0 }, ke = { class: "fg-command-list__command" }, Ae = { class: "fg-command-list__description" }, je = {
443
458
  key: 0,
444
459
  class: "fg-command-list__action"
445
- }, Ae = [
460
+ }, Me = [
446
461
  "disabled",
447
462
  "aria-label",
448
463
  "title",
449
464
  "onClick"
450
- ], je = {
465
+ ], Ne = {
451
466
  viewBox: "0 0 24 24",
452
467
  fill: "none",
453
468
  stroke: "currentColor",
454
469
  "stroke-width": "1.5",
455
470
  "aria-hidden": "true"
456
- }, Me = {
471
+ }, Pe = {
457
472
  key: 0,
458
473
  d: "m5 12 4 4L19 6"
459
- }, Ne = /* @__PURE__ */ m({
474
+ }, Fe = /* @__PURE__ */ m({
460
475
  __name: "UiCommandList",
461
476
  props: {
462
477
  items: {},
@@ -476,14 +491,14 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
476
491
  unavailableMessage: "Clipboard unavailable. Select the command to copy it.",
477
492
  failureMessage: "Could not copy. Select the command to copy it."
478
493
  }), p = C(""), m = s(() => a.value || (r.value ? `${p.value} copied to clipboard.` : "")), h = (e) => (p.value = e, c(e));
479
- return (e, s) => (S(), u("div", Ce, [d("table", we, [d("thead", null, [d("tr", null, [
480
- d("th", Te, D(t.commandHeader), 1),
481
- d("th", Ee, D(t.descriptionHeader), 1),
482
- t.copyable ? (S(), u("td", De)) : l("", !0)
494
+ return (e, s) => (S(), u("div", Te, [d("table", Ee, [d("thead", null, [d("tr", null, [
495
+ d("th", De, D(t.commandHeader), 1),
496
+ d("th", $, D(t.descriptionHeader), 1),
497
+ t.copyable ? (S(), u("td", Oe)) : l("", !0)
483
498
  ])]), d("tbody", null, [(S(!0), u(o, null, w(t.items, (c) => (S(), u("tr", { key: c.command }, [
484
- d("td", $, [d("code", null, D(c.command), 1)]),
485
- d("td", Oe, [T(e.$slots, "description", { item: c }, () => [f(D(c.description), 1)])]),
486
- t.copyable ? (S(), u("td", ke, [n.value ? (S(), u("button", {
499
+ d("td", ke, [T(e.$slots, "command", { item: c }, () => [d("code", null, D(c.command), 1)])]),
500
+ d("td", Ae, [T(e.$slots, "description", { item: c }, () => [f(D(c.description), 1)])]),
501
+ t.copyable ? (S(), u("td", je, [n.value ? (S(), u("button", {
487
502
  key: 0,
488
503
  type: "button",
489
504
  class: "fg-command-list__copy",
@@ -491,13 +506,13 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
491
506
  "aria-label": `Copy ${c.command}`,
492
507
  title: `Copy ${c.command}`,
493
508
  onClick: (e) => h(c.command)
494
- }, [(S(), u("svg", je, [O(r) && !O(a) && p.value === c.command ? (S(), u("path", Me)) : (S(), u(o, { key: 1 }, [s[0] ||= d("rect", {
509
+ }, [(S(), u("svg", Ne, [O(r) && !O(a) && p.value === c.command ? (S(), u("path", Pe)) : (S(), u(o, { key: 1 }, [s[0] ||= d("rect", {
495
510
  x: "8",
496
511
  y: "8",
497
512
  width: "12",
498
513
  height: "13",
499
514
  rx: "2"
500
- }, 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, Ae)) : l("", !0)])) : l("", !0)
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, Me)) : l("", !0)])) : l("", !0)
501
516
  ]))), 128))])]), d("span", {
502
517
  class: _(["fg-command-list__status", { "fg-site-sr-only": !O(a) }]),
503
518
  role: "status"
@@ -505,4 +520,4 @@ var I = "tool-site-theme", L = (e) => e === "system" || e === "light" || e === "
505
520
  }
506
521
  });
507
522
  //#endregion
508
- export { I as SITE_APPEARANCE_KEY, B as SITE_PROJECTS, Se as UiCapture, Ne as UiCommandList, ie as UiSiteHeader, me as UiSiteNav, R as applySiteAppearance, te as siteThemeBootScript, z as useSiteAppearance };
523
+ export { I as SITE_APPEARANCE_KEY, B as SITE_PROJECTS, we as UiCapture, Fe as UiCommandList, ae as UiSiteHeader, he as UiSiteNav, R as applySiteAppearance, ne as siteThemeBootScript, z as useSiteAppearance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/ui",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "A compact Vue design system with Tailwind CSS and VS Code theme support",
5
5
  "type": "module",
6
6
  "sideEffects": [
package/src/site.css CHANGED
@@ -170,6 +170,7 @@
170
170
  * screen background with --site-capture-bg on :root, which also reaches the
171
171
  * full-size viewer. Nothing clips the panel, so focus rings inside it stay whole. */
172
172
  .fg-capture {
173
+ position: relative;
173
174
  min-width: 0;
174
175
  border: 1px solid var(--color-border-subtle);
175
176
  border-radius: var(--radius-panel);
@@ -177,6 +178,27 @@
177
178
  }
178
179
  .fg-capture .fg-tabs__list { width: 100%; margin-block-end: 0; padding-inline: var(--space-2); }
179
180
  .fg-capture .fg-tabs__tab { min-height: var(--control-lg); }
181
+ /* The Full size control sits at the end of the tab row; the list reserves its width. */
182
+ .fg-capture[data-enhanced="true"] .fg-tabs__list { padding-inline-end: calc(var(--space-2) + 6.5rem); }
183
+ .fg-capture__full {
184
+ position: absolute;
185
+ top: 0;
186
+ right: var(--space-2);
187
+ display: inline-flex;
188
+ align-items: center;
189
+ gap: var(--space-1);
190
+ min-height: var(--control-lg);
191
+ padding-inline: var(--space-2);
192
+ border: 0;
193
+ border-radius: var(--radius-control);
194
+ background: transparent;
195
+ color: var(--color-muted);
196
+ font: var(--text-sm) / var(--leading) var(--font-ui);
197
+ cursor: pointer;
198
+ }
199
+ .fg-capture__full:hover { color: var(--color-text); }
200
+ .fg-capture__full svg { width: 14px; height: 14px; flex: none; }
201
+ .fg-capture__full:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
180
202
  /* Without JavaScript every capture is listed under its own heading. */
181
203
  .fg-capture .fg-tabs__heading { margin: 0; padding: var(--space-3) var(--space-4); }
182
204
  .fg-capture:not([data-enhanced="true"]) .fg-tabs__panel + .fg-tabs__panel { border-top: 1px solid var(--color-border-subtle); }
@@ -407,6 +429,10 @@
407
429
  }
408
430
  @media (max-width: 640px) {
409
431
  .fg-dialog__content.fg-capture-viewer { width: 100%; max-width: none; }
432
+ /* Phones keep the icon; the accessible name still says Full size. */
433
+ .fg-capture[data-enhanced="true"] .fg-tabs__list { padding-inline-end: calc(var(--space-2) + var(--control-lg)); }
434
+ .fg-capture__full { min-width: var(--control-lg); justify-content: center; }
435
+ .fg-capture__full-label { display: none; }
410
436
  .fg-command-list__table,
411
437
  .fg-command-list tbody { display: block; }
412
438
  .fg-command-list thead {