vintage-frames 0.13.0 → 0.14.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.
Files changed (44) hide show
  1. package/custom-elements.json +8 -8
  2. package/dist/components/vf-checkbox.d.ts +6 -5
  3. package/dist/components/vf-checkbox.js +41 -37
  4. package/dist/components/vf-container.d.ts +11 -13
  5. package/dist/components/vf-container.js +24 -12
  6. package/dist/components/vf-fieldset.js +30 -22
  7. package/dist/components/vf-icon.js +55 -55
  8. package/dist/components/vf-list.js +30 -29
  9. package/dist/components/vf-menu.js +24 -22
  10. package/dist/components/vf-number-field.js +32 -30
  11. package/dist/components/vf-progress-bar.js +28 -29
  12. package/dist/components/vf-radio.js +3 -4
  13. package/dist/components/vf-scroll-area.js +27 -26
  14. package/dist/components/vf-select.js +108 -90
  15. package/dist/components/vf-separator.d.ts +5 -5
  16. package/dist/components/vf-separator.js +36 -10
  17. package/dist/components/vf-swatch.js +47 -45
  18. package/dist/components/vf-text-area.js +37 -35
  19. package/dist/components/vf-text-field.js +20 -18
  20. package/dist/components/vf-window.js +92 -72
  21. package/dist/index.d.ts +10 -1
  22. package/dist/index.js +60 -59
  23. package/dist/styles/base.d.ts +3 -1
  24. package/dist/styles/recipes/field.d.ts +10 -6
  25. package/dist/styles/recipes/field.js +8 -7
  26. package/dist/styles/recipes/focus.d.ts +7 -3
  27. package/dist/styles/recipes/rule.d.ts +11 -8
  28. package/dist/styles/recipes/rule.js +31 -13
  29. package/dist/styles/recipes/scroll-rail.d.ts +7 -6
  30. package/dist/styles/recipes/scroll-rail.js +18 -18
  31. package/dist/styles/recipes/shadow.d.ts +10 -6
  32. package/dist/styles/recipes/shadow.js +4 -2
  33. package/dist/styles/recipes/stroke.d.ts +85 -0
  34. package/dist/styles/recipes/stroke.js +53 -0
  35. package/dist/styles/recipes/surface.d.ts +8 -4
  36. package/dist/styles/recipes/surface.js +23 -17
  37. package/dist/styles/recipes/title-bar.d.ts +7 -0
  38. package/dist/styles/recipes/title-bar.js +25 -22
  39. package/dist/styles/recipes/toggle.js +3 -3
  40. package/dist/zoom.d.ts +9 -9
  41. package/docs/SPEC.md +23 -22
  42. package/editor/vscode.html-custom-data.json +4 -4
  43. package/editor/web-types.json +7 -7
  44. package/package.json +1 -1
@@ -5,25 +5,26 @@ import o from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js
5
5
  import { PlacementController as s, VfPositioned as c, warnMovableContract as l } from "../position.js";
6
6
  import { vfBodyDecls as u } from "../styles/recipes/body-face.js";
7
7
  import { vfBase as d } from "../styles/recipes/host.js";
8
- import { vfFocusUnderline as f } from "../styles/recipes/focus.js";
9
- import { GridSnapController as p } from "../grid-snap.js";
10
- import { DocumentListenersController as m } from "../document-listeners.js";
11
- import { DragController as h } from "../drag.js";
12
- import { dragSlop as g, prefersReducedMotion as _, runOutlineTravel as v } from "../motion.js";
13
- import { deriveDragOutline as y, deriveOpenArt as b, dotOutline as x, penPhase as S, xorPenCanvas as C } from "../open-art.js";
14
- import { FocusRuleController as w } from "../focus-modality.js";
15
- import { LitElement as T, css as E, html as D, nothing as O } from "lit";
16
- import { property as k, state as A } from "lit/decorators.js";
8
+ import { vfStrokeDecls as f } from "../styles/recipes/stroke.js";
9
+ import { vfFocusUnderline as p } from "../styles/recipes/focus.js";
10
+ import { GridSnapController as m } from "../grid-snap.js";
11
+ import { DocumentListenersController as h } from "../document-listeners.js";
12
+ import { DragController as g } from "../drag.js";
13
+ import { dragSlop as _, prefersReducedMotion as v, runOutlineTravel as y } from "../motion.js";
14
+ import { deriveDragOutline as b, deriveOpenArt as x, dotOutline as S, penPhase as C, xorPenCanvas as w } from "../open-art.js";
15
+ import { FocusRuleController as T } from "../focus-modality.js";
16
+ import { LitElement as E, css as D, html as O, nothing as k } from "lit";
17
+ import { property as A, state as j } from "lit/decorators.js";
17
18
  //#region src/components/vf-icon.ts
18
- var j, M = {
19
+ var M, N = {
19
20
  large: 32,
20
21
  small: 16
21
- }, N = 1, P = 8, F = (e, t) => t <= 0 ? Math.max(e, 0) : Math.min(Math.max(e, 0), t), I = class extends c(T) {
22
+ }, P = 1, F = 8, I = (e, t) => t <= 0 ? Math.max(e, 0) : Math.min(Math.max(e, 0), t), L = class extends c(E) {
22
23
  static {
23
- j = this;
24
+ M = this;
24
25
  }
25
26
  constructor(...t) {
26
- super(...t), this.label = "", this.size = "large", this.selectable = !1, this.selected = !1, this.target = !1, this.color = !1, this.open = !1, this.movable = !1, this.editable = !1, this.maxlength = 31, this.scale = new n(this), this.gridSnap = new p(this), this.focusRule = new w(this), this._editing = !1, this._draft = "", this.#e = 0, this._ghost = null, this.#t = null, this.#n = this.attachInternals(), this.#a = !1, this.#o = "", this.#s = "", this.#c = 0, this.#l = -Infinity, this.#u = !1, this.#d = null, this.#f = null, this.#p = new m(this, () => [[
27
+ super(...t), this.label = "", this.size = "large", this.selectable = !1, this.selected = !1, this.target = !1, this.color = !1, this.open = !1, this.movable = !1, this.editable = !1, this.maxlength = 31, this.scale = new n(this), this.gridSnap = new m(this), this.focusRule = new T(this), this._editing = !1, this._draft = "", this.#e = 0, this._ghost = null, this.#t = null, this.#n = this.attachInternals(), this.#a = !1, this.#o = "", this.#s = "", this.#c = 0, this.#l = -Infinity, this.#u = !1, this.#d = null, this.#f = null, this.#p = new h(this, () => [[
27
28
  document,
28
29
  "pointerdown",
29
30
  this.#te,
@@ -32,9 +33,9 @@ var j, M = {
32
33
  x: Math.max(e, 0),
33
34
  y: Math.max(t, 0)
34
35
  } : {
35
- x: F(e, n.width - a(this.offsetWidth, this)),
36
- y: F(t, n.height - a(this.offsetHeight, this))
37
- }, this.#g = new s(this, (e, t, n) => this.#m(e, t, n)), this.#_ = null, this.#v = new h(this, {
36
+ x: I(e, n.width - a(this.offsetWidth, this)),
37
+ y: I(t, n.height - a(this.offsetHeight, this))
38
+ }, this.#g = new s(this, (e, t, n) => this.#m(e, t, n)), this.#_ = null, this.#v = new g(this, {
38
39
  onDragStart: (e) => {
39
40
  if (!this.movable || e.button !== 0 || this._editing) return null;
40
41
  this.#L();
@@ -50,7 +51,7 @@ var j, M = {
50
51
  clientX: e.clientX,
51
52
  clientY: e.clientY
52
53
  },
53
- slop: g(e),
54
+ slop: _(e),
54
55
  proposal: null,
55
56
  outline: null,
56
57
  followers: [],
@@ -63,14 +64,14 @@ var j, M = {
63
64
  onDragEnd: (e, t) => {
64
65
  this.#A(e, t);
65
66
  }
66
- }), this.#y = new m(this, () => [[
67
+ }), this.#y = new h(this, () => [[
67
68
  document,
68
69
  "keydown",
69
70
  this.#b,
70
71
  !0
71
72
  ]]), this.#b = (e) => {
72
73
  e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this.#v.cancel());
73
- }, this.#x = null, this.#S = new m(this, () => [[
74
+ }, this.#x = null, this.#S = new h(this, () => [[
74
75
  document,
75
76
  "pointerdown",
76
77
  this.#C,
@@ -119,7 +120,7 @@ var j, M = {
119
120
  if (t.includes(this) || (this.#G(), this.#f = null, e.shiftKey || e.metaKey)) return;
120
121
  let n = this.#i;
121
122
  if (n !== null) {
122
- let e = t.find((e) => e instanceof j);
123
+ let e = t.find((e) => e instanceof M);
123
124
  if (e?.selected && e.#i === n) return;
124
125
  }
125
126
  this.#X(!1);
@@ -158,7 +159,7 @@ var j, M = {
158
159
  case "ArrowDown": {
159
160
  if (!this.movable) return;
160
161
  t.preventDefault(), this.focusRule.reveal();
161
- let e = t.shiftKey ? P : N, n = t.key === "ArrowLeft" ? -e : t.key === "ArrowRight" ? e : 0, r = t.key === "ArrowUp" ? -e : t.key === "ArrowDown" ? e : 0;
162
+ let e = t.shiftKey ? F : P, n = t.key === "ArrowLeft" ? -e : t.key === "ArrowRight" ? e : 0, r = t.key === "ArrowUp" ? -e : t.key === "ArrowDown" ? e : 0;
162
163
  this.#L();
163
164
  let i = this.#g.seed();
164
165
  this.#g.moveTo(i.x + n, i.y + r);
@@ -168,7 +169,7 @@ var j, M = {
168
169
  };
169
170
  }
170
171
  static {
171
- this.styles = [d, E`
172
+ this.styles = [d, D`
172
173
  :host {
173
174
  display: inline-block;
174
175
  cursor: var(--vf-cursor, default);
@@ -333,8 +334,7 @@ var j, M = {
333
334
  position: absolute;
334
335
  inset: calc(var(--vf-scale, 1) * -2px) calc(var(--vf-scale, 1) * -1px);
335
336
  background: var(--vf-white, #fff);
336
- border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
337
- padding: calc(var(--vf-scale, 1) * 1px);
337
+ ${f({ padding: 1 })}
338
338
  }
339
339
  .rename {
340
340
  display: block;
@@ -386,12 +386,12 @@ var j, M = {
386
386
  as a visible focus (see focus-modality.ts). */
387
387
  .caption.focus-rule .label::after {
388
388
  --vf-focus-underline-offset: -2px;
389
- ${f}
389
+ ${p}
390
390
  }
391
391
  /* No name, no plate — the rule falls back to the art cell. */
392
392
  .art.focus-rule::after {
393
393
  --vf-focus-underline-offset: -2px;
394
- ${f}
394
+ ${p}
395
395
  }
396
396
  :host(:focus) {
397
397
  outline: none;
@@ -553,7 +553,7 @@ var j, M = {
553
553
  y: Math.round((e.top - u) / o),
554
554
  width: Math.round(e.width / o),
555
555
  height: Math.round(e.height / o)
556
- }), m = Math.round((d - l) / o), h = Math.round((f - u) / o), g = this.open && this._ghost ? this._ghost : this.#t, _ = g != null && (g instanceof HTMLCanvasElement ? g.width > 0 : g.complete && g.naturalWidth > 0), v = _ ? g.getBoundingClientRect() : null, b = y(_ ? g : null, {
556
+ }), m = Math.round((d - l) / o), h = Math.round((f - u) / o), g = this.open && this._ghost ? this._ghost : this.#t, _ = g != null && (g instanceof HTMLCanvasElement ? g.width > 0 : g.complete && g.naturalWidth > 0), v = _ ? g.getBoundingClientRect() : null, y = b(_ ? g : null, {
557
557
  width: m,
558
558
  height: h,
559
559
  art: v && v.width > 0 ? p(v) : null,
@@ -565,15 +565,15 @@ var j, M = {
565
565
  },
566
566
  plate: c ? p(c) : null
567
567
  });
568
- if (!b) return null;
569
- let x = C("drag-outline"), S = x.style;
570
- S.position = "absolute", S.width = i(b.width), S.height = i(b.height);
571
- let w = t ?? a, T = t ? t.getBoundingClientRect() : e, E = {
568
+ if (!y) return null;
569
+ let x = w("drag-outline"), S = x.style;
570
+ S.position = "absolute", S.width = i(y.width), S.height = i(y.height);
571
+ let C = t ?? a, T = t ? t.getBoundingClientRect() : e, E = {
572
572
  x: Math.round((l - T.left) / o),
573
573
  y: Math.round((u - T.top) / o)
574
574
  };
575
- return w.append(x), {
576
- ring: b,
575
+ return C.append(x), {
576
+ ring: y,
577
577
  canvas: x,
578
578
  base: E,
579
579
  phase: -1
@@ -582,8 +582,8 @@ var j, M = {
582
582
  #P(e, t, n) {
583
583
  let r = e.base.x + t, a = e.base.y + n;
584
584
  e.canvas.style.left = i(r), e.canvas.style.top = i(a);
585
- let o = S(r, a);
586
- o !== e.phase && (e.phase = o, x(e.ring, e.canvas, o));
585
+ let o = C(r, a);
586
+ o !== e.phase && (e.phase = o, S(e.ring, e.canvas, o));
587
587
  }
588
588
  #F(e) {
589
589
  let { left: t, top: n } = e.proposal ?? {
@@ -634,7 +634,7 @@ var j, M = {
634
634
  n.selectNodeContents(e), t = n.getBoundingClientRect().width, n.detach();
635
635
  }
636
636
  let n = t / r(this) + 2, i = Math.max(2, Math.ceil(n / 2) * 2);
637
- this.#e = this._editing && t === 0 ? Math.max(i, M[this.size]) : i, e.style.width = this.#z;
637
+ this.#e = this._editing && t === 0 ? Math.max(i, N[this.size]) : i, e.style.width = this.#z;
638
638
  }
639
639
  get #z() {
640
640
  return this.#e ? `calc(var(--vf-scale, 1) * ${this.#e}px)` : "";
@@ -660,7 +660,7 @@ var j, M = {
660
660
  }
661
661
  let n = e instanceof HTMLImageElement ? `${this.size} ${e.currentSrc}` : "";
662
662
  if (n !== "" && n === this.#o && this._ghost) return;
663
- let r = b(e);
663
+ let r = x(e);
664
664
  if (r) {
665
665
  r.className = "ghost", r.style.width = `calc(var(--vf-scale, 1) * ${r.width}px)`, r.style.height = `calc(var(--vf-scale, 1) * ${r.height}px)`;
666
666
  let t = e instanceof HTMLImageElement ? e.alt : "";
@@ -701,7 +701,7 @@ var j, M = {
701
701
  }
702
702
  render() {
703
703
  let e = this._editing, t = e ? this._draft : this.label, n = this.focusRule.marked && !e, r = t !== "" || e, i = `caption${e ? " editing" : ""}${n && t ? " focus-rule" : ""}`, a = `art${this.open && this._ghost ? " open" : ""}${n && !t ? " focus-rule" : ""}`, o = this.width ? `width: calc(var(--vf-scale, 1) * ${this.width}px)` : "";
704
- return D`<div
704
+ return O`<div
705
705
  class="frame vf-snap"
706
706
  part="frame"
707
707
  style=${o}
@@ -713,9 +713,9 @@ var j, M = {
713
713
  @dblclick=${this.#Q}
714
714
  >
715
715
  <div class=${a} part="icon">
716
- ${this.size === "small" ? D`<slot name="small" @slotchange=${this.#B}></slot>` : D`<slot name="large" @slotchange=${this.#B}></slot>`}${this._ghost ?? O}
716
+ ${this.size === "small" ? O`<slot name="small" @slotchange=${this.#B}></slot>` : O`<slot name="large" @slotchange=${this.#B}></slot>`}${this._ghost ?? k}
717
717
  </div>
718
- ${r ? D`<div class=${i}>
718
+ ${r ? O`<div class=${i}>
719
719
  <!-- No whitespace around the span: it is the measured run, and a
720
720
  stray space would widen it. -->
721
721
  <div class="label" part="label"><span
@@ -724,7 +724,7 @@ var j, M = {
724
724
  style=${this.#e ? `width: ${this.#z}` : ""}
725
725
  >${t}</span
726
726
  ></div>
727
- ${e ? D`<div class="rename-box">
727
+ ${e ? O`<div class="rename-box">
728
728
  <input
729
729
  class="rename"
730
730
  part="input"
@@ -736,8 +736,8 @@ var j, M = {
736
736
  @keydown=${this.#ae}
737
737
  @blur=${this.commitEditing}
738
738
  />
739
- </div>` : O}
740
- </div>` : O}
739
+ </div>` : k}
740
+ </div>` : k}
741
741
  </div>`;
742
742
  }
743
743
  #K() {
@@ -786,10 +786,10 @@ var j, M = {
786
786
  async dragTo(e, t) {
787
787
  if (this.#x?.finish(), await this.updateComplete, this.#x?.finish(), !this.isConnected) return !1;
788
788
  this.#L();
789
- let n = this.#g.seed(), r = this.#g.resolve(e, t), i = r.x - n.x, a = r.y - n.y, o = i === 0 && a === 0 || _() || this._editing || this.#_ !== null ? null : this.#N(this.#T(), this.#M());
789
+ let n = this.#g.seed(), r = this.#g.resolve(e, t), i = r.x - n.x, a = r.y - n.y, o = i === 0 && a === 0 || v() || this._editing || this.#_ !== null ? null : this.#N(this.#T(), this.#M());
790
790
  return o ? (this.#P(o, 0, 0), new Promise((e) => {
791
791
  let t = null;
792
- t = v(Math.hypot(i, a), (e) => this.#P(o, Math.round(i * e), Math.round(a * e)), () => {
792
+ t = y(Math.hypot(i, a), (e) => this.#P(o, Math.round(i * e), Math.round(a * e)), () => {
793
793
  this.#x === t && (this.#x = null, this.#S.detach()), o.canvas.remove(), this.isConnected && this.#g.moveTo(r.x, r.y), e(!0);
794
794
  }), this.#x = t, this.#S.attach();
795
795
  })) : (this.#g.moveTo(r.x, r.y), !1);
@@ -799,7 +799,7 @@ var j, M = {
799
799
  #$;
800
800
  #ee(e, t) {
801
801
  let n = this.#d;
802
- return !n || n.pointerId !== e.pointerId || (this.#d = null, !(e.type !== "pointercancel" && !t && !this._editing && Math.hypot(e.clientX - n.x, e.clientY - n.y) < g(e))) ? !1 : n.second ? !0 : (this.#f = {
802
+ return !n || n.pointerId !== e.pointerId || (this.#d = null, !(e.type !== "pointercancel" && !t && !this._editing && Math.hypot(e.clientX - n.x, e.clientY - n.y) < _(e))) ? !1 : n.second ? !0 : (this.#f = {
803
803
  time: n.time,
804
804
  x: n.x,
805
805
  y: n.y
@@ -818,27 +818,27 @@ var j, M = {
818
818
  #ae;
819
819
  #oe;
820
820
  };
821
- o([k()], I.prototype, "label", void 0), o([k({ reflect: !0 })], I.prototype, "size", void 0), o([k({
821
+ o([A()], L.prototype, "label", void 0), o([A({ reflect: !0 })], L.prototype, "size", void 0), o([A({
822
822
  type: Boolean,
823
823
  reflect: !0
824
- })], I.prototype, "selectable", void 0), o([k({
824
+ })], L.prototype, "selectable", void 0), o([A({
825
825
  type: Boolean,
826
826
  reflect: !0
827
- })], I.prototype, "selected", void 0), o([k({
827
+ })], L.prototype, "selected", void 0), o([A({
828
828
  type: Boolean,
829
829
  reflect: !0
830
- })], I.prototype, "target", void 0), o([k({
830
+ })], L.prototype, "target", void 0), o([A({
831
831
  type: Boolean,
832
832
  reflect: !0
833
- })], I.prototype, "color", void 0), o([k({
833
+ })], L.prototype, "color", void 0), o([A({
834
834
  type: Boolean,
835
835
  reflect: !0
836
- })], I.prototype, "open", void 0), o([k({
836
+ })], L.prototype, "open", void 0), o([A({
837
837
  type: Boolean,
838
838
  reflect: !0
839
- })], I.prototype, "movable", void 0), o([k({
839
+ })], L.prototype, "movable", void 0), o([A({
840
840
  type: Boolean,
841
841
  reflect: !0
842
- })], I.prototype, "editable", void 0), o([k({ type: Number })], I.prototype, "width", void 0), o([k({ type: Number })], I.prototype, "maxlength", void 0), o([A()], I.prototype, "_editing", void 0), o([A()], I.prototype, "_draft", void 0), o([A()], I.prototype, "_ghost", void 0), I = j = o([t("vf-icon")], I);
842
+ })], L.prototype, "editable", void 0), o([A({ type: Number })], L.prototype, "width", void 0), o([A({ type: Number })], L.prototype, "maxlength", void 0), o([j()], L.prototype, "_editing", void 0), o([j()], L.prototype, "_draft", void 0), o([j()], L.prototype, "_ghost", void 0), L = M = o([t("vf-icon")], L);
843
843
  //#endregion
844
- export { I as VfIcon };
844
+ export { L as VfIcon };
@@ -4,21 +4,22 @@ import { ScaleController as n } from "../scale.js";
4
4
  import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
5
5
  import { VfPositioned as i } from "../position.js";
6
6
  import { vfBase as a } from "../styles/recipes/host.js";
7
- import { vfFocusRing as o } from "../styles/recipes/focus.js";
8
- import { vfScrollRail as s } from "../styles/recipes/scroll-rail.js";
9
- import { GridSnapController as c } from "../grid-snap.js";
10
- import { ScrollStateController as l } from "../scroll-state.js";
11
- import { ScrollRailController as u, renderScrollRail as d } from "../scroll-rail.js";
12
- import { TypeAheadBuffer as f } from "../type-ahead.js";
13
- import { LitElement as p, css as m, html as h, nothing as g } from "lit";
14
- import { property as _, query as v, queryAssignedElements as y, state as b } from "lit/decorators.js";
7
+ import { vfStrokeDecls as o } from "../styles/recipes/stroke.js";
8
+ import { vfFocusRing as s } from "../styles/recipes/focus.js";
9
+ import { vfScrollRail as c } from "../styles/recipes/scroll-rail.js";
10
+ import { GridSnapController as l } from "../grid-snap.js";
11
+ import { ScrollStateController as u } from "../scroll-state.js";
12
+ import { ScrollRailController as d, renderScrollRail as f } from "../scroll-rail.js";
13
+ import { TypeAheadBuffer as p } from "../type-ahead.js";
14
+ import { LitElement as m, css as h, html as g, nothing as _ } from "lit";
15
+ import { property as v, query as y, queryAssignedElements as b, state as x } from "lit/decorators.js";
15
16
  //#region src/components/vf-list.ts
16
- var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = class extends i(p) {
17
+ var S = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), C = class extends i(m) {
17
18
  static {
18
19
  this.styles = [
19
20
  a,
20
- s,
21
- m`
21
+ c,
22
+ h`
22
23
  :host {
23
24
  display: block;
24
25
  }
@@ -26,21 +27,21 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
26
27
  :host([disabled]) {
27
28
  color: var(--vf-disabled, #c0c0c0);
28
29
  }
29
- /* The snapped wrapper: a real 1px frame (the rail's outer line), the
30
+ /* The snapped wrapper: the 1px frame (the rail's outer line), the
30
31
  [rows | rail] grid — the rail sizes itself to the 15px inside the
31
32
  frame — and everything riding the grid-snap offset as one. */
32
33
  .box {
33
- border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
34
34
  background: var(--vf-white, #fff);
35
35
  display: grid;
36
36
  grid-template-columns: 1fr auto;
37
+ ${o()}
37
38
  }
38
39
  .list {
39
40
  grid-area: 1 / 1;
40
41
  min-width: 0;
41
42
  background: var(--vf-white, #fff);
42
- /* The clamp is the content box's — the .box border adds the 2px frame
43
- on top, keeping the clamped total where it always was. */
43
+ /* The clamp is the content box's — the .box frame adds its 2px on
44
+ top, keeping the clamped total where it always was. */
44
45
  max-height: calc(var(--vf-scale, 1) * var(--vf-list-max-height, 200px));
45
46
  /* Native scrolling; the bar itself is hidden by the recipe
46
47
  (.vf-scroll) and the reservation is the rail element, not a native
@@ -55,7 +56,7 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
55
56
  render()); the ring keeps that stop visible, inset to stay in-box. */
56
57
  .list:focus-visible {
57
58
  --vf-focus-offset: -2px;
58
- ${o}
59
+ ${s}
59
60
  }
60
61
  `
61
62
  ];
@@ -66,12 +67,12 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
66
67
  #r;
67
68
  #i;
68
69
  constructor() {
69
- super(), this.scale = new n(this), this.gridSnap = new c(this), this.scrollState = new l(this, () => this.viewport, () => this.content, (e) => {
70
+ super(), this.scale = new n(this), this.gridSnap = new l(this), this.scrollState = new u(this, () => this.viewport, () => this.content, (e) => {
70
71
  this._scrollable = e.x || e.y;
71
- }), this.rail = new u(this, {
72
+ }), this.rail = new d(this, {
72
73
  getScroll: () => this.viewport,
73
74
  getContent: () => this.content
74
- }), this._scrollable = !1, this.multiple = !1, this.value = "", this.values = [], this.disabled = !1, this.label = "", this.#e = -1, this.#t = -1, this.#n = new f(), this.#r = [], this.#i = this.attachInternals(), this.#l = (e) => {
75
+ }), this._scrollable = !1, this.multiple = !1, this.value = "", this.values = [], this.disabled = !1, this.label = "", this.#e = -1, this.#t = -1, this.#n = new p(), this.#r = [], this.#i = this.attachInternals(), this.#l = (e) => {
75
76
  if (this.disabled) return;
76
77
  let t = e.target?.closest("vf-list-item") ?? null;
77
78
  if (!t || t.disabled) return;
@@ -156,21 +157,21 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
156
157
  e.has("multiple") && (this.#i.ariaMultiSelectable = this.multiple ? "true" : null), e.has("disabled") && (this.#i.ariaDisabled = this.disabled ? "true" : null, this.#c()), e.has("label") && (this.#i.ariaLabel = this.label || null), e.has("values") ? (e.get("values") !== void 0 || this.values.length > 0) && this.#a(this.values) : e.has("value") && (e.get("value") !== void 0 || this.value !== "") && this.#a(this.value ? [this.value] : []);
157
158
  }
158
159
  #a(e) {
159
- x(e, this.#r) || this.#s(e, !1);
160
+ S(e, this.#r) || this.#s(e, !1);
160
161
  }
161
162
  render() {
162
- return h`
163
+ return g`
163
164
  <div class="box vf-snap">
164
165
  <div
165
166
  class="list vf-scroll"
166
167
  part="list"
167
- tabindex=${this.disabled && this._scrollable ? "0" : g}
168
+ tabindex=${this.disabled && this._scrollable ? "0" : _}
168
169
  >
169
170
  <div class="list-content">
170
171
  <slot @slotchange=${this.#o}></slot>
171
172
  </div>
172
173
  </div>
173
- ${d(this.rail, "vertical")}
174
+ ${f(this.rail, "vertical")}
174
175
  </div>
175
176
  `;
176
177
  }
@@ -187,7 +188,7 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
187
188
  let o = r.filter((e) => e.selected).map((e) => e.value);
188
189
  this.#r = [...o];
189
190
  let s = o[0] ?? "";
190
- this.value !== s && (this.value = s), x(this.values, o) || (this.values = o), this.#c(), n && !x(a, o) && e(this, "vf-change", {
191
+ this.value !== s && (this.value = s), S(this.values, o) || (this.values = o), this.#c(), n && !S(a, o) && e(this, "vf-change", {
191
192
  value: this.value,
192
193
  values: [...o]
193
194
  });
@@ -231,15 +232,15 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
231
232
  !t || t.disabled || (t.focus(), t.scrollIntoView({ block: "nearest" }));
232
233
  }
233
234
  };
234
- r([v(".list")], S.prototype, "viewport", void 0), r([v(".list-content")], S.prototype, "content", void 0), r([b()], S.prototype, "_scrollable", void 0), r([_({
235
+ r([y(".list")], C.prototype, "viewport", void 0), r([y(".list-content")], C.prototype, "content", void 0), r([x()], C.prototype, "_scrollable", void 0), r([v({
235
236
  type: Boolean,
236
237
  reflect: !0
237
- })], S.prototype, "multiple", void 0), r([_()], S.prototype, "value", void 0), r([_({ attribute: !1 })], S.prototype, "values", void 0), r([_({
238
+ })], C.prototype, "multiple", void 0), r([v()], C.prototype, "value", void 0), r([v({ attribute: !1 })], C.prototype, "values", void 0), r([v({
238
239
  type: Boolean,
239
240
  reflect: !0
240
- })], S.prototype, "disabled", void 0), r([_()], S.prototype, "label", void 0), r([y({
241
+ })], C.prototype, "disabled", void 0), r([v()], C.prototype, "label", void 0), r([b({
241
242
  selector: "vf-list-item",
242
243
  flatten: !0
243
- })], S.prototype, "_items", void 0), S = r([t("vf-list")], S);
244
+ })], C.prototype, "_items", void 0), C = r([t("vf-list")], C);
244
245
  //#endregion
245
- export { S as VfList };
246
+ export { C as VfList };
@@ -125,22 +125,23 @@ var T = class extends a(_) {
125
125
  @media (forced-colors: active) {
126
126
  forced-color-adjust: none;
127
127
  }
128
- background: var(--vf-highlight, #000);
129
128
  color: var(--vf-highlight-text, #fff);
130
- /* The hilite leaves the bar's top row white: System 7's plate is rows
131
- 1..18 of the 20px bar (the Label specimen in Menus.png is 18px of
132
- plate, and InfiniteMac shows the white row above it). Transparent
133
- borders + padding-box clip inset the paint without moving the box:
134
- the top row shows the bar's white through, the bottom row the bar's
135
- own black rule, and the hit rect stays the full bar height so a
136
- click slammed against the screen top still opens the menu. The
137
- 18px content box centers the 16px em on the same rows as the
138
- closed state, so the title never shifts. Declared only while open
139
- because forced-colors mode repaints transparent borders CanvasText
140
- on closed labels; here forced-color-adjust above already exempts
141
- them. */
142
- border-block: calc(var(--vf-scale, 1) * 1px) solid transparent;
143
- background-clip: padding-box;
129
+ }
130
+ /* The hilite leaves the bar's top row white: System 7's plate is rows
131
+ 1..18 of the 20px bar (the Label specimen in Menus.png is 18px of
132
+ plate, and InfiniteMac shows the white row above it). So the plate is
133
+ a layer inset a row top and bottom rather than the label's own
134
+ background: the top row shows the bar's white through, the bottom row
135
+ the bar's own black rule, and the hit rect stays the full bar height
136
+ so a click slammed against the screen top still opens the menu. The
137
+ title doesn't move. The label is positioned (vf-snap), and the title
138
+ is too, so the plate paints under it in tree order. */
139
+ :host([open]) .label::before,
140
+ .label.flash-on::before {
141
+ content: '';
142
+ position: absolute;
143
+ inset: calc(var(--vf-scale, 1) * 1px) 0;
144
+ background: var(--vf-highlight, #000);
144
145
  }
145
146
  /* The title rides in its own box so the focus rule spans the title and
146
147
  not the bar cell's 10px padding — the same reason vf-button wraps its
@@ -198,13 +199,14 @@ var T = class extends a(_) {
198
199
  from. (The nowrap rows make min-content the widest row, so the
199
200
  shrink-to-fit abspos width IS the MDEF width.) */
200
201
  min-width: 100%;
201
- /* No vertical inset: every panel in Menus.png — both pulldowns, the
202
- open popup and the closed pill — puts its first row's ink at +4 from
203
- the border box, which is the 1px border plus the row's own 3px ✓
204
- bias. The bottom border likewise sits immediately after the last row.
205
- A 2px inset here displaced every row by 2px against the art; it was
206
- invisible while the rows themselves were 6px too tall. */
207
- padding: 0;
202
+ /* No inset of its own beyond the frame, whose 1px stroke is the
203
+ panel's padding (vfPanel): every panel in Menus.png — both
204
+ pulldowns, the open popup and the closed pill — puts its first
205
+ row's ink at +4 from the border box, which is the 1px frame plus
206
+ the row's own 3px ✓ bias. The bottom line likewise sits
207
+ immediately after the last row. A 2px inset here displaced every
208
+ row by 2px against the art; it was invisible while the rows
209
+ themselves were 6px too tall. */
208
210
  z-index: 1000;
209
211
  /* As on the title: the held press, not the browser, owns touch moves
210
212
  over the dropped panel. */
@@ -3,16 +3,17 @@ import { vfElement as t } from "../define.js";
3
3
  import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
4
4
  import { VfPositioned as r } from "../position.js";
5
5
  import { vfBase as i } from "../styles/recipes/host.js";
6
- import { vfField as a } from "../styles/recipes/field.js";
7
- import { STEPPER as o, STEPPER_DOWN_FILL as s, STEPPER_UP_FILL as c } from "../glyphs.js";
8
- import { VfTextControlBase as l } from "../text-control.js";
9
- import { decimalsOf as u } from "../number.js";
10
- import { css as d, html as f, nothing as p } from "lit";
11
- import { property as m, query as h, state as g } from "lit/decorators.js";
12
- import { classMap as _ } from "lit/directives/class-map.js";
13
- import { live as v } from "lit/directives/live.js";
6
+ import { vfStrokeInset as a } from "../styles/recipes/stroke.js";
7
+ import { vfField as o } from "../styles/recipes/field.js";
8
+ import { STEPPER as s, STEPPER_DOWN_FILL as c, STEPPER_UP_FILL as l } from "../glyphs.js";
9
+ import { VfTextControlBase as u } from "../text-control.js";
10
+ import { decimalsOf as d } from "../number.js";
11
+ import { css as f, html as p, nothing as m } from "lit";
12
+ import { property as h, query as g, state as _ } from "lit/decorators.js";
13
+ import { classMap as v } from "lit/directives/class-map.js";
14
+ import { live as y } from "lit/directives/live.js";
14
15
  //#region src/components/vf-number-field.ts
15
- var y = class extends r(l) {
16
+ var b = class extends r(u) {
16
17
  constructor(...t) {
17
18
  super(...t), this.step = 1, this.pressed = null, this.#l = (e) => {
18
19
  if (this.isDisabled || this.readonly) return;
@@ -48,14 +49,14 @@ var y = class extends r(l) {
48
49
  this.value = e.target.value, this.#o("vf-input");
49
50
  }, this.#p = (t) => {
50
51
  let n = t.target.value, r = parseFloat(n);
51
- this.value = Number.isNaN(r) ? n : String(Number(this.#r(r).toFixed(u(this.step)))), this.#o("vf-change"), e(this, "change");
52
+ this.value = Number.isNaN(r) ? n : String(Number(this.#r(r).toFixed(d(this.step)))), this.#o("vf-change"), e(this, "change");
52
53
  };
53
54
  }
54
55
  static {
55
56
  this.styles = [
56
57
  i,
57
- a,
58
- d`
58
+ o,
59
+ f`
59
60
  :host {
60
61
  display: inline-flex;
61
62
  /* NOT stretch: that sized the well to the stepper's 25px, making this
@@ -82,7 +83,7 @@ var y = class extends r(l) {
82
83
  (1 above / 2 below) — optically centered, still on the device grid. */
83
84
  margin-top: calc(var(--vf-scale, 1) * 1px);
84
85
  }
85
- input {
86
+ input.vf-field {
86
87
  flex: 1 1 auto;
87
88
  width: var(--vf-number-field-width, 4em);
88
89
  min-width: 2em;
@@ -94,7 +95,8 @@ var y = class extends r(l) {
94
95
  fills it, and a user stylesheet raising line-height grows the well
95
96
  instead of clipping the digits. */
96
97
  min-height: calc(var(--vf-scale, 1) * var(--vf-control-height, 22px));
97
- padding: 0 calc(var(--vf-scale, 1) * 6px);
98
+ /* The 6px text inset, inside the well's stroke (vfField). */
99
+ padding: ${a(0)} ${a(6)};
98
100
  text-align: right;
99
101
  }
100
102
 
@@ -152,7 +154,7 @@ var y = class extends r(l) {
152
154
  return this.min != null && e < this.min ? this.min : this.max != null && e > this.max ? this.max : e;
153
155
  }
154
156
  #i(t) {
155
- let n = String(Number(this.#r(t).toFixed(u(this.step))));
157
+ let n = String(Number(this.#r(t).toFixed(d(this.step))));
156
158
  n !== this.value && (this.value = n, this.#o("vf-change"), e(this, "input"), e(this, "change"));
157
159
  }
158
160
  #a(e) {
@@ -181,7 +183,7 @@ var y = class extends r(l) {
181
183
  #p;
182
184
  render() {
183
185
  let e = this.isDisabled, t = this.#n();
184
- return f`
186
+ return p`
185
187
  <div class=${this.wellClass}>
186
188
  <input
187
189
  part="input"
@@ -194,14 +196,14 @@ var y = class extends r(l) {
194
196
  maxlength=${this.forwardedAttr("maxlength")}
195
197
  spellcheck=${this.forwardedAttr("spellcheck")}
196
198
  autocapitalize=${this.forwardedAttr("autocapitalize")}
197
- aria-label=${this.label || this.hostLabel || p}
199
+ aria-label=${this.label || this.hostLabel || m}
198
200
  aria-describedby=${this.describedBy}
199
- aria-required=${this.required ? "true" : p}
200
- aria-invalid=${this.validity.valid ? p : "true"}
201
- aria-valuenow=${Number.isNaN(t) ? p : t}
202
- aria-valuemin=${this.min ?? p}
203
- aria-valuemax=${this.max ?? p}
204
- .value=${v(this.value)}
201
+ aria-required=${this.required ? "true" : m}
202
+ aria-invalid=${this.validity.valid ? m : "true"}
203
+ aria-valuenow=${Number.isNaN(t) ? m : t}
204
+ aria-valuemin=${this.min ?? m}
205
+ aria-valuemax=${this.max ?? m}
206
+ .value=${y(this.value)}
205
207
  placeholder=${this.placeholder}
206
208
  ?disabled=${e}
207
209
  ?readonly=${this.readonly}
@@ -212,15 +214,15 @@ var y = class extends r(l) {
212
214
  </div>
213
215
  <span class="stepper vf-snap" part="stepper">
214
216
  <svg viewBox="0 0 15 25" shape-rendering="crispEdges" fill="currentColor" aria-hidden="true">
215
- <path d=${o.d}></path>
216
- <path class=${_({
217
+ <path d=${s.d}></path>
218
+ <path class=${v({
217
219
  fill: !0,
218
220
  on: this.pressed === "up"
219
- })} d=${c.d}></path>
220
- <path class=${_({
221
+ })} d=${l.d}></path>
222
+ <path class=${v({
221
223
  fill: !0,
222
224
  on: this.pressed === "down"
223
- })} d=${s.d}></path>
225
+ })} d=${c.d}></path>
224
226
  </svg>
225
227
  <span
226
228
  class="hit up"
@@ -243,6 +245,6 @@ var y = class extends r(l) {
243
245
  `;
244
246
  }
245
247
  };
246
- n([m({ type: Number })], y.prototype, "min", void 0), n([m({ type: Number })], y.prototype, "max", void 0), n([m({ type: Number })], y.prototype, "step", void 0), n([g()], y.prototype, "pressed", void 0), n([h("input")], y.prototype, "input", void 0), y = n([t("vf-number-field")], y);
248
+ n([h({ type: Number })], b.prototype, "min", void 0), n([h({ type: Number })], b.prototype, "max", void 0), n([h({ type: Number })], b.prototype, "step", void 0), n([_()], b.prototype, "pressed", void 0), n([g("input")], b.prototype, "input", void 0), b = n([t("vf-number-field")], b);
247
249
  //#endregion
248
- export { y as VfNumberField };
250
+ export { b as VfNumberField };