vintage-frames 0.1.0 → 0.2.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 (47) hide show
  1. package/README.md +12 -233
  2. package/custom-elements.json +290 -38
  3. package/dist/components/vf-button.d.ts +1 -1
  4. package/dist/components/vf-container.d.ts +2 -2
  5. package/dist/components/vf-desktop.d.ts +1 -1
  6. package/dist/components/vf-fieldset.d.ts +1 -1
  7. package/dist/components/vf-fieldset.js +6 -1
  8. package/dist/components/vf-grid.d.ts +1 -1
  9. package/dist/components/vf-icon.d.ts +1 -1
  10. package/dist/components/vf-img.d.ts +1 -1
  11. package/dist/components/vf-label.d.ts +1 -1
  12. package/dist/components/vf-list-item.d.ts +9 -1
  13. package/dist/components/vf-list-item.js +15 -14
  14. package/dist/components/vf-list.d.ts +1 -1
  15. package/dist/components/vf-menu-bar.d.ts +1 -1
  16. package/dist/components/vf-menu-item.d.ts +10 -1
  17. package/dist/components/vf-menu-item.js +35 -34
  18. package/dist/components/vf-menu.d.ts +11 -2
  19. package/dist/components/vf-menu.js +33 -32
  20. package/dist/components/vf-option.d.ts +11 -1
  21. package/dist/components/vf-option.js +16 -15
  22. package/dist/components/vf-paragraph.d.ts +3 -3
  23. package/dist/components/vf-progress-bar.d.ts +1 -1
  24. package/dist/components/vf-scroll-area.d.ts +1 -1
  25. package/dist/components/vf-select.d.ts +1 -1
  26. package/dist/components/vf-separator.d.ts +1 -1
  27. package/dist/components/vf-slider.d.ts +1 -1
  28. package/dist/components/vf-stack.d.ts +27 -9
  29. package/dist/components/vf-stack.js +30 -8
  30. package/dist/components/vf-swatch.d.ts +1 -1
  31. package/dist/components/vf-window.d.ts +1 -1
  32. package/dist/cross-center.d.ts +76 -0
  33. package/dist/cross-center.js +69 -0
  34. package/dist/define.d.ts +2 -2
  35. package/dist/define.js +1 -1
  36. package/dist/grid-snap.d.ts +2 -24
  37. package/dist/grid-snap.js +7 -33
  38. package/dist/index.d.ts +5 -5
  39. package/dist/index.js +50 -50
  40. package/dist/position.d.ts +11 -2
  41. package/dist/styles/recipes/host.js +14 -1
  42. package/dist/styles/recipes/toggle.js +16 -0
  43. package/dist/text-control.d.ts +1 -1
  44. package/docs/SPEC.md +287 -2249
  45. package/editor/vscode.html-custom-data.json +48 -8
  46. package/editor/web-types.json +92 -12
  47. package/package.json +2 -4
package/dist/index.js CHANGED
@@ -19,53 +19,53 @@ import { vfToggle as te } from "./styles/recipes/toggle.js";
19
19
  import { vfField as ne } from "./styles/recipes/field.js";
20
20
  import { vfScrollRail as re } from "./styles/recipes/scroll-rail.js";
21
21
  import { TileRasterCache as ie, patternOverride as ae, tileGrid as oe, vfTileGrid as se } from "./tile-grid.js";
22
- import { GridSnapController as ce, applyGridSnap as le, requestGridSnap as ue } from "./grid-snap.js";
23
- import { DocumentListenersController as de } from "./document-listeners.js";
24
- import { BUTTON_FACE as fe, BUTTON_FRAME as pe, RING_FRAME as me, RING_HOLE as he, RING_INSET as ge, SCREEN_CORNER as _e, steppedCornerClip as ve, steppedRectClip as ye, steppedRingClip as be } from "./pixel-frame.js";
25
- import { VfDesktop as xe } from "./components/vf-desktop.js";
26
- import { VfSized as Se } from "./size.js";
27
- import { DragController as Ce } from "./drag.js";
28
- import { emit as we } from "./events.js";
29
- import { ScrollStateController as Te } from "./scroll-state.js";
30
- import { BLINK_FLIPS as Ee, BLINK_INTERVAL_MS as De, PRESS_HOLD_MS as Oe, RENAME_DELAY_MS as ke, prefersReducedMotion as Ae, runSelectionBlink as je } from "./motion.js";
31
- import { CARET_DOWN as Me, CHECKBOX_X as Ne, CHECKMARK as Pe, RADIO_DOT as Fe, RADIO_FACE as Ie, RADIO_RING as Le, RADIO_RING_PRESSED as Re, SLIDER_THUMB as ze, SLIDER_THUMB_FACE as Be, STEPPER as Ve, STEPPER_DOWN_FILL as He, STEPPER_UP_FILL as Ue, glyphSvg as We } from "./glyphs.js";
32
- import { ScrollRailController as Ge, renderScrollRail as Ke } from "./scroll-rail.js";
33
- import { VfScrollArea as qe } from "./components/vf-scroll-area.js";
34
- import { VfWindow as Je } from "./components/vf-window.js";
35
- import { VfModalDialog as Ye, modalDialogStyles as Xe } from "./modal-dialog.js";
36
- import { VfButtonGroup as Ze } from "./components/vf-button-group.js";
37
- import { VfDialog as Qe } from "./components/vf-dialog.js";
38
- import { VfSeparator as $e } from "./components/vf-separator.js";
39
- import { VfFormControl as et } from "./form-control.js";
40
- import { VfButton as tt } from "./components/vf-button.js";
41
- import { VfSwatch as nt } from "./components/vf-swatch.js";
42
- import { VfToggleControl as rt } from "./toggle-control.js";
43
- import { VfCheckbox as it } from "./components/vf-checkbox.js";
44
- import { VfRadio as at } from "./components/vf-radio.js";
45
- import { VfRadioGroup as ot } from "./components/vf-radio-group.js";
46
- import { FocusRuleController as st, focusModality as ct, trackFocusModality as lt } from "./focus-modality.js";
47
- import { VfTextControlBase as ut } from "./text-control.js";
48
- import { VfTextField as dt } from "./components/vf-text-field.js";
49
- import { VfTextArea as ft } from "./components/vf-text-area.js";
50
- import { VfNumberField as pt } from "./components/vf-number-field.js";
51
- import { VfOption as mt } from "./components/vf-option.js";
52
- import { VfSelect as ht } from "./components/vf-select.js";
53
- import { TrackWidthController as gt } from "./track-width.js";
54
- import { VfProgressBar as _t } from "./components/vf-progress-bar.js";
55
- import { VfSlider as vt } from "./components/vf-slider.js";
56
- import { VfLabel as yt } from "./components/vf-label.js";
57
- import { VfParagraph as bt } from "./components/vf-paragraph.js";
58
- import { VfImg as xt } from "./components/vf-img.js";
59
- import { VfIcon as St } from "./components/vf-icon.js";
60
- import { VfMenuBar as Ct } from "./components/vf-menu-bar.js";
61
- import { VfMenu as wt } from "./components/vf-menu.js";
62
- import { VfMenuItem as Tt } from "./components/vf-menu-item.js";
63
- import { VfList as Et } from "./components/vf-list.js";
64
- import { VfListItem as Dt } from "./components/vf-list-item.js";
65
- import { VfFieldset as Ot } from "./components/vf-fieldset.js";
66
- import { VfGrid as kt } from "./components/vf-grid.js";
67
- import { VfStack as At } from "./components/vf-stack.js";
68
- import { VfContainer as jt } from "./components/vf-container.js";
69
- import { CURSOR_ARROW as Mt, CURSOR_CROSSHAIR as Nt, CURSOR_I_BEAM as Pt, CURSOR_WAIT as Ft } from "./cursor-art.js";
70
- import { applyCursor as It } from "./cursor.js";
71
- export { Ee as BLINK_FLIPS, De as BLINK_INTERVAL_MS, fe as BUTTON_FACE, pe as BUTTON_FRAME, Me as CARET_DOWN, Ne as CHECKBOX_X, Pe as CHECKMARK, n as CLASSIC_DPI, r as CSS_REFERENCE_DPI, Mt as CURSOR_ARROW, Nt as CURSOR_CROSSHAIR, Pt as CURSOR_I_BEAM, Ft as CURSOR_WAIT, de as DocumentListenersController, Ce as DragController, st as FocusRuleController, ce as GridSnapController, E as PIXEL_GRID_METRICS, Oe as PRESS_HOLD_MS, w as PlacementController, Fe as RADIO_DOT, Ie as RADIO_FACE, Le as RADIO_RING, Re as RADIO_RING_PRESSED, ke as RENAME_DELAY_MS, me as RING_FRAME, he as RING_HOLE, ge as RING_INSET, _e as SCREEN_CORNER, ze as SLIDER_THUMB, Be as SLIDER_THUMB_FACE, Ve as STEPPER, He as STEPPER_DOWN_FILL, Ue as STEPPER_UP_FILL, i as SYSTEM_PX_IN_CSS_PX, u as ScaleController, Ge as ScrollRailController, Te as ScrollStateController, L as TILE_LATTICE, ie as TileRasterCache, gt as TrackWidthController, O as VF_BODY_FAMILY, j as VF_DISPLAY_FAMILY, tt as VfButton, Ze as VfButtonGroup, it as VfCheckbox, jt as VfContainer, xe as VfDesktop, Qe as VfDialog, Ot as VfFieldset, et as VfFormControl, kt as VfGrid, St as VfIcon, xt as VfImg, yt as VfLabel, Et as VfList, Dt as VfListItem, wt as VfMenu, Ct as VfMenuBar, Tt as VfMenuItem, Ye as VfModalDialog, pt as VfNumberField, mt as VfOption, bt as VfParagraph, T as VfPositioned, _t as VfProgressBar, at as VfRadio, ot as VfRadioGroup, qe as VfScrollArea, ht as VfSelect, $e as VfSeparator, Se as VfSized, vt as VfSlider, At as VfStack, nt as VfSwatch, ft as VfTextArea, ut as VfTextControlBase, dt as VfTextField, rt as VfToggleControl, Je as VfWindow, It as applyCursor, le as applyGridSnap, d as applyScale, e as defineElement, a as devicePxPerSystemPx, f as effectiveScale, we as emit, ct as focusModality, p as getScale, o as getZoom, We as glyphSvg, Xe as modalDialogStyles, m as onScaleChange, s as onZoomChange, ae as patternOverride, Ae as prefersReducedMotion, k as registerBodyFace, M as registerDisplayFace, D as registerEmbeddedFont, Ke as renderScrollRail, ue as requestGridSnap, c as resetZoomBaseline, je as runSelectionBlink, h as snapSys, g as snapToDevicePx, _ as snapToSystemPx, ve as steppedCornerClip, ye as steppedRectClip, be as steppedRingClip, v as sys, y as sysLength, b as sysLengths, x as systemPxQuantum, oe as tileGrid, R as tileImage, z as tileRaster, B as tileRects, V as tileSpan, S as toSys, C as toSysExact, lt as trackFocusModality, l as truePixelRatio, F as vfBase, A as vfBodyDecls, q as vfChromeFrame, N as vfDisplay, P as vfDisplayDecls, W as vfDots, t as vfElement, ne as vfField, Q as vfFocus, $ as vfFocusRing, ee as vfFocusUnderline, K as vfHardShadowDecls, J as vfModalFrame, Y as vfPanel, re as vfScrollRail, I as vfStaticText, G as vfStripes, se as vfTileGrid, H as vfTileMaskSize, U as vfTileSize, X as vfTitleBar, te as vfToggle, Z as vfWindowWidgets };
22
+ import { GridSnapController as ce, requestGridSnap as le } from "./grid-snap.js";
23
+ import { DocumentListenersController as ue } from "./document-listeners.js";
24
+ import { BUTTON_FACE as de, BUTTON_FRAME as fe, RING_FRAME as pe, RING_HOLE as me, RING_INSET as he, SCREEN_CORNER as ge, steppedCornerClip as _e, steppedRectClip as ve, steppedRingClip as ye } from "./pixel-frame.js";
25
+ import { VfDesktop as be } from "./components/vf-desktop.js";
26
+ import { VfSized as xe } from "./size.js";
27
+ import { DragController as Se } from "./drag.js";
28
+ import { emit as Ce } from "./events.js";
29
+ import { ScrollStateController as we } from "./scroll-state.js";
30
+ import { BLINK_FLIPS as Te, BLINK_INTERVAL_MS as Ee, PRESS_HOLD_MS as De, RENAME_DELAY_MS as Oe, prefersReducedMotion as ke, runSelectionBlink as Ae } from "./motion.js";
31
+ import { CARET_DOWN as je, CHECKBOX_X as Me, CHECKMARK as Ne, RADIO_DOT as Pe, RADIO_FACE as Fe, RADIO_RING as Ie, RADIO_RING_PRESSED as Le, SLIDER_THUMB as Re, SLIDER_THUMB_FACE as ze, STEPPER as Be, STEPPER_DOWN_FILL as Ve, STEPPER_UP_FILL as He, glyphSvg as Ue } from "./glyphs.js";
32
+ import { ScrollRailController as We, renderScrollRail as Ge } from "./scroll-rail.js";
33
+ import { VfScrollArea as Ke } from "./components/vf-scroll-area.js";
34
+ import { VfWindow as qe } from "./components/vf-window.js";
35
+ import { VfModalDialog as Je, modalDialogStyles as Ye } from "./modal-dialog.js";
36
+ import { VfButtonGroup as Xe } from "./components/vf-button-group.js";
37
+ import { VfDialog as Ze } from "./components/vf-dialog.js";
38
+ import { VfSeparator as Qe } from "./components/vf-separator.js";
39
+ import { VfFormControl as $e } from "./form-control.js";
40
+ import { VfButton as et } from "./components/vf-button.js";
41
+ import { VfSwatch as tt } from "./components/vf-swatch.js";
42
+ import { VfToggleControl as nt } from "./toggle-control.js";
43
+ import { VfCheckbox as rt } from "./components/vf-checkbox.js";
44
+ import { VfRadio as it } from "./components/vf-radio.js";
45
+ import { VfRadioGroup as at } from "./components/vf-radio-group.js";
46
+ import { FocusRuleController as ot, focusModality as st, trackFocusModality as ct } from "./focus-modality.js";
47
+ import { VfTextControlBase as lt } from "./text-control.js";
48
+ import { VfTextField as ut } from "./components/vf-text-field.js";
49
+ import { VfTextArea as dt } from "./components/vf-text-area.js";
50
+ import { VfNumberField as ft } from "./components/vf-number-field.js";
51
+ import { VfOption as pt } from "./components/vf-option.js";
52
+ import { VfSelect as mt } from "./components/vf-select.js";
53
+ import { TrackWidthController as ht } from "./track-width.js";
54
+ import { VfProgressBar as gt } from "./components/vf-progress-bar.js";
55
+ import { VfSlider as _t } from "./components/vf-slider.js";
56
+ import { VfLabel as vt } from "./components/vf-label.js";
57
+ import { VfParagraph as yt } from "./components/vf-paragraph.js";
58
+ import { VfImg as bt } from "./components/vf-img.js";
59
+ import { VfIcon as xt } from "./components/vf-icon.js";
60
+ import { VfMenuBar as St } from "./components/vf-menu-bar.js";
61
+ import { VfMenu as Ct } from "./components/vf-menu.js";
62
+ import { VfMenuItem as wt } from "./components/vf-menu-item.js";
63
+ import { VfList as Tt } from "./components/vf-list.js";
64
+ import { VfListItem as Et } from "./components/vf-list-item.js";
65
+ import { VfFieldset as Dt } from "./components/vf-fieldset.js";
66
+ import { VfGrid as Ot } from "./components/vf-grid.js";
67
+ import { VfStack as kt } from "./components/vf-stack.js";
68
+ import { VfContainer as At } from "./components/vf-container.js";
69
+ import { CURSOR_ARROW as jt, CURSOR_CROSSHAIR as Mt, CURSOR_I_BEAM as Nt, CURSOR_WAIT as Pt } from "./cursor-art.js";
70
+ import { applyCursor as Ft } from "./cursor.js";
71
+ export { Te as BLINK_FLIPS, Ee as BLINK_INTERVAL_MS, de as BUTTON_FACE, fe as BUTTON_FRAME, je as CARET_DOWN, Me as CHECKBOX_X, Ne as CHECKMARK, n as CLASSIC_DPI, r as CSS_REFERENCE_DPI, jt as CURSOR_ARROW, Mt as CURSOR_CROSSHAIR, Nt as CURSOR_I_BEAM, Pt as CURSOR_WAIT, ue as DocumentListenersController, Se as DragController, ot as FocusRuleController, ce as GridSnapController, E as PIXEL_GRID_METRICS, De as PRESS_HOLD_MS, w as PlacementController, Pe as RADIO_DOT, Fe as RADIO_FACE, Ie as RADIO_RING, Le as RADIO_RING_PRESSED, Oe as RENAME_DELAY_MS, pe as RING_FRAME, me as RING_HOLE, he as RING_INSET, ge as SCREEN_CORNER, Re as SLIDER_THUMB, ze as SLIDER_THUMB_FACE, Be as STEPPER, Ve as STEPPER_DOWN_FILL, He as STEPPER_UP_FILL, i as SYSTEM_PX_IN_CSS_PX, u as ScaleController, We as ScrollRailController, we as ScrollStateController, L as TILE_LATTICE, ie as TileRasterCache, ht as TrackWidthController, O as VF_BODY_FAMILY, j as VF_DISPLAY_FAMILY, et as VfButton, Xe as VfButtonGroup, rt as VfCheckbox, At as VfContainer, be as VfDesktop, Ze as VfDialog, Dt as VfFieldset, $e as VfFormControl, Ot as VfGrid, xt as VfIcon, bt as VfImg, vt as VfLabel, Tt as VfList, Et as VfListItem, Ct as VfMenu, St as VfMenuBar, wt as VfMenuItem, Je as VfModalDialog, ft as VfNumberField, pt as VfOption, yt as VfParagraph, T as VfPositioned, gt as VfProgressBar, it as VfRadio, at as VfRadioGroup, Ke as VfScrollArea, mt as VfSelect, Qe as VfSeparator, xe as VfSized, _t as VfSlider, kt as VfStack, tt as VfSwatch, dt as VfTextArea, lt as VfTextControlBase, ut as VfTextField, nt as VfToggleControl, qe as VfWindow, Ft as applyCursor, d as applyScale, e as defineElement, a as devicePxPerSystemPx, f as effectiveScale, Ce as emit, st as focusModality, p as getScale, o as getZoom, Ue as glyphSvg, Ye as modalDialogStyles, m as onScaleChange, s as onZoomChange, ae as patternOverride, ke as prefersReducedMotion, k as registerBodyFace, M as registerDisplayFace, D as registerEmbeddedFont, Ge as renderScrollRail, le as requestGridSnap, c as resetZoomBaseline, Ae as runSelectionBlink, h as snapSys, g as snapToDevicePx, _ as snapToSystemPx, _e as steppedCornerClip, ve as steppedRectClip, ye as steppedRingClip, v as sys, y as sysLength, b as sysLengths, x as systemPxQuantum, oe as tileGrid, R as tileImage, z as tileRaster, B as tileRects, V as tileSpan, S as toSys, C as toSysExact, ct as trackFocusModality, l as truePixelRatio, F as vfBase, A as vfBodyDecls, q as vfChromeFrame, N as vfDisplay, P as vfDisplayDecls, W as vfDots, t as vfElement, ne as vfField, Q as vfFocus, $ as vfFocusRing, ee as vfFocusUnderline, K as vfHardShadowDecls, J as vfModalFrame, Y as vfPanel, re as vfScrollRail, I as vfStaticText, G as vfStripes, se as vfTileGrid, H as vfTileMaskSize, U as vfTileSize, X as vfTitleBar, te as vfToggle, Z as vfWindowWidgets };
@@ -11,8 +11,17 @@ export declare abstract class VfPositionedInterface extends LitElement {
11
11
  left?: number | null;
12
12
  }
13
13
  /**
14
- * Explicit placement — `top`/`left` in whole system px, on (nearly) every
15
- * component.
14
+ * Explicit placement — `top`/`left` in whole system px, on **every** component.
15
+ *
16
+ * No exceptions, deliberately. These are web components, and a consumer may put
17
+ * one wherever they like; the kit does not get to decide that a `vf-option` is
18
+ * only ever a popup row. The rows a container normally owns (`vf-option`,
19
+ * `vf-menu-item`, `vf-list-item`) and a bar's `vf-menu` take the pair on the
20
+ * same terms as anything else — and stating an origin on one *inside* its
21
+ * managing parent does take it out of that parent's flow layout, which is the
22
+ * placement working, not failing. Each of those components documents what its
23
+ * container stops doing for it. `vf-dialog` takes the pair in viewport
24
+ * coordinates, the one difference the platform forces (see modal-dialog.ts).
16
25
  *
17
26
  * A DITL resource laid a dialog out as a list of items, each with a rectangle
18
27
  * in the window's own coordinates; arranging controls by stating where they go
@@ -51,7 +51,20 @@ var n = t`
51
51
  painted element(s). Absolutely positioned satellites that anchor to the
52
52
  host (vf-menu's panel, the default button's ring) compose the same
53
53
  variables into their own insets instead. Controller-owned — never set the
54
- variables by hand. */
54
+ variables by hand.
55
+
56
+ The reset below makes the two properties per-host: custom properties
57
+ inherit, so without it a host needing no correction of its own would
58
+ resolve an ancestor component's values here and its paint would leave the
59
+ grid by exactly that amount — invisibly, since the controller measures
60
+ the host box, which never moves. (Measured: a placed vf-button on a
61
+ corrected vf-desktop painted at the desktop's -0.39px offset.) The
62
+ controller's writes land on the host's inline style, which wins over
63
+ this rule. */
64
+ :host {
65
+ --vf-snap-dx: 0px;
66
+ --vf-snap-dy: 0px;
67
+ }
55
68
  .vf-snap {
56
69
  position: relative;
57
70
  left: var(--vf-snap-dx, 0px);
@@ -7,6 +7,22 @@ var t = e`
7
7
  gap: calc(var(--vf-scale, 1) * 6px);
8
8
  cursor: var(--vf-cursor, default);
9
9
  }
10
+ /* The well PAINTS 3 system px below the row top. Centering the 13px well
11
+ in the 20px row is the layout — kept, because the host's height and its
12
+ exported baseline are consumer-visible (moving them off the well's
13
+ centered bottom reflowed every line holding a toggle) — but centering
14
+ lands on 3.5, an exact tie, half a system px off the pixel grid at every
15
+ density where 3.5 system px isn't whole device px. So the paint steps
16
+ back half a pixel through the same relative "top" the grid-snap
17
+ correction rides (this rule overrides vfBase's .vf-snap, so it must
18
+ compose the variable), landing the ink on row 3: ties resolve toward the
19
+ start, as QuickDraw's "div 2" did — the title-bar and vf-stack
20
+ convention. The half-pixel gap between layout box and painted box is the
21
+ documented snap idiom, not a fault. */
22
+ .box,
23
+ .circle {
24
+ top: calc(var(--vf-snap-dy, 0px) - var(--vf-scale, 1) * 0.5px);
25
+ }
10
26
  /* The focus rule is drawn under the box/circle, not around the host. */
11
27
  :host(:focus-visible) {
12
28
  outline: none;
@@ -69,7 +69,7 @@ export declare class VfTextControlBase extends VfShadowRoleControl {
69
69
  protected forwardedAttr(name: string): string | typeof nothing;
70
70
  /** Default-on display scaling (true 72dpi size); see src/scale.ts. */
71
71
  protected readonly scale: ScaleController;
72
- /** Device-pixel grid snapping (opt in with applyGridSnap()); see src/grid-snap.ts. */
72
+ /** Device-pixel grid snapping; see src/grid-snap.ts. */
73
73
  protected readonly gridSnap: GridSnapController;
74
74
  /**
75
75
  * Whether the well wears the kit's dashed focus rule — keyboard focus only.