vintage-frames 0.12.8 → 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.
- package/custom-elements.json +26 -26
- package/dist/chrome.d.ts +1 -1
- package/dist/components/vf-checkbox.d.ts +6 -5
- package/dist/components/vf-checkbox.js +41 -37
- package/dist/components/vf-container.d.ts +16 -20
- package/dist/components/vf-container.js +25 -17
- package/dist/components/vf-desktop.d.ts +4 -5
- package/dist/components/vf-desktop.js +13 -18
- package/dist/components/vf-fieldset.js +30 -22
- package/dist/components/vf-icon.js +55 -55
- package/dist/components/vf-list.js +30 -29
- package/dist/components/vf-menu.js +24 -22
- package/dist/components/vf-number-field.js +32 -30
- package/dist/components/vf-progress-bar.d.ts +2 -2
- package/dist/components/vf-progress-bar.js +65 -52
- package/dist/components/vf-radio.js +3 -4
- package/dist/components/vf-scroll-area.js +27 -26
- package/dist/components/vf-select.js +108 -90
- package/dist/components/vf-separator.d.ts +5 -5
- package/dist/components/vf-separator.js +36 -10
- package/dist/components/vf-slider.js +11 -11
- package/dist/components/vf-swatch.d.ts +2 -2
- package/dist/components/vf-swatch.js +73 -72
- package/dist/components/vf-text-area.js +37 -35
- package/dist/components/vf-text-field.js +20 -18
- package/dist/components/vf-window.d.ts +6 -9
- package/dist/components/vf-window.js +106 -87
- package/dist/index.d.ts +20 -10
- package/dist/index.js +63 -62
- package/dist/pattern-fill.d.ts +21 -50
- package/dist/pattern-fill.js +19 -54
- package/dist/scroll-rail.d.ts +6 -6
- package/dist/scroll-rail.js +24 -29
- package/dist/styles/base.d.ts +3 -1
- package/dist/styles/recipes/field.d.ts +10 -6
- package/dist/styles/recipes/field.js +8 -7
- package/dist/styles/recipes/focus.d.ts +7 -3
- package/dist/styles/recipes/pattern.d.ts +19 -10
- package/dist/styles/recipes/pattern.js +27 -18
- package/dist/styles/recipes/rule.d.ts +11 -8
- package/dist/styles/recipes/rule.js +31 -13
- package/dist/styles/recipes/scroll-rail.d.ts +21 -13
- package/dist/styles/recipes/scroll-rail.js +27 -37
- package/dist/styles/recipes/shadow.d.ts +10 -6
- package/dist/styles/recipes/shadow.js +4 -2
- package/dist/styles/recipes/stroke.d.ts +85 -0
- package/dist/styles/recipes/stroke.js +53 -0
- package/dist/styles/recipes/surface.d.ts +8 -4
- package/dist/styles/recipes/surface.js +23 -17
- package/dist/styles/recipes/tile.d.ts +11 -3
- package/dist/styles/recipes/tile.js +12 -12
- package/dist/styles/recipes/title-bar.d.ts +7 -0
- package/dist/styles/recipes/title-bar.js +25 -22
- package/dist/styles/recipes/toggle.js +3 -3
- package/dist/tile-grid.d.ts +98 -64
- package/dist/tile-grid.js +63 -30
- package/dist/track-width.d.ts +1 -2
- package/dist/zoom.d.ts +9 -9
- package/docs/SPEC.md +33 -32
- package/editor/vscode.html-custom-data.json +5 -5
- package/editor/web-types.json +8 -8
- package/package.json +1 -1
|
@@ -6,28 +6,29 @@ import { VfPositioned as o } from "../position.js";
|
|
|
6
6
|
import { vfBodyDecls as s } from "../styles/recipes/body-face.js";
|
|
7
7
|
import { vfDisplay as c } from "../styles/recipes/display-face.js";
|
|
8
8
|
import { vfBase as l } from "../styles/recipes/host.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
9
|
+
import { vfStrokeDecls as u, vfStrokeInset as d } from "../styles/recipes/stroke.js";
|
|
10
|
+
import { vfPanel as f } from "../styles/recipes/surface.js";
|
|
11
|
+
import { vfFocusUnderline as p } from "../styles/recipes/focus.js";
|
|
12
|
+
import { GridSnapController as m } from "../grid-snap.js";
|
|
13
|
+
import { DocumentListenersController as h } from "../document-listeners.js";
|
|
14
|
+
import { runSelectionBlink as g } from "../motion.js";
|
|
15
|
+
import { CARET_DOWN as _, CARET_DOWN_SMALL as v, CARET_UP as y, CARET_UP_SMALL as b, glyphSvg as x } from "../glyphs.js";
|
|
16
|
+
import { VfShadowRoleControl as S } from "../form-control.js";
|
|
17
|
+
import { FocusRuleController as C } from "../focus-modality.js";
|
|
18
|
+
import { VfOption as w } from "./vf-option.js";
|
|
19
|
+
import { clampScroll as T, ensureVisibleScroll as E, firstPickableRow as D, lastPickableRow as O, layoutClampedPopup as k } from "../popup-overflow.js";
|
|
20
|
+
import { TypeAheadBuffer as A } from "../type-ahead.js";
|
|
21
|
+
import { css as j, html as M, nothing as N } from "lit";
|
|
22
|
+
import { property as P, query as F, queryAssignedElements as I, state as L } from "lit/decorators.js";
|
|
23
|
+
import { classMap as R } from "lit/directives/class-map.js";
|
|
23
24
|
//#region src/components/vf-select.ts
|
|
24
|
-
var
|
|
25
|
+
var z = class extends o(S) {
|
|
25
26
|
static {
|
|
26
27
|
this.styles = [
|
|
27
28
|
l,
|
|
28
29
|
c,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
f,
|
|
31
|
+
j`
|
|
31
32
|
:host {
|
|
32
33
|
/* A popup menu is sized to its widest option — never stretched to fill
|
|
33
34
|
its container. fit-content holds that intrinsic width even inside a
|
|
@@ -65,22 +66,28 @@ var L = class extends o(b) {
|
|
|
65
66
|
/* 18px, not the 22px fields: the reference pill measures 156×18 plus
|
|
66
67
|
its 1px hard shadow (the 157×19 ink box on the sheet). */
|
|
67
68
|
height: calc(var(--vf-scale, 1) * var(--vf-popup-height, 18px));
|
|
68
|
-
/* Left inset = the checkmark gutter (--vf-select-gutter), so the selected
|
|
69
|
-
label sits at the SAME x it will occupy in the open list (where the ✓
|
|
70
|
-
fills that gutter). The right inset stays the small 8px. */
|
|
71
|
-
padding: 0 calc(var(--vf-scale, 1) * 8px) 0
|
|
72
|
-
calc(var(--vf-scale, 1) * var(--vf-select-gutter, 16px));
|
|
73
69
|
background: var(--vf-white, #fff);
|
|
74
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
75
70
|
border-radius: 0;
|
|
76
|
-
/* At depth 0 the shadow is the border box itself, which paints nothing. */
|
|
77
|
-
box-shadow: calc(var(--vf-scale, 1) * var(--_shadow-depth))
|
|
78
|
-
calc(var(--vf-scale, 1) * var(--_shadow-depth)) 0 0 var(--vf-black, #000);
|
|
79
71
|
/* The press-drag gesture owns pointer moves while the button is held;
|
|
80
72
|
suppress the browser's own touch panning/scrolling so a touch drag
|
|
81
73
|
tracks the list instead of scrolling the page. */
|
|
82
74
|
touch-action: none;
|
|
83
75
|
cursor: var(--vf-cursor, default);
|
|
76
|
+
/* The 1px frame is a stroke, the hard shadow after it in the list —
|
|
77
|
+
at depth 0 the shadow is the border box itself, which paints
|
|
78
|
+
nothing. Left inset = the checkmark gutter (--vf-select-gutter), so
|
|
79
|
+
the selected label sits at the SAME x it will occupy in the open
|
|
80
|
+
list (where the ✓ fills that gutter). The right inset stays the
|
|
81
|
+
small 8px. */
|
|
82
|
+
${u({
|
|
83
|
+
padding: [
|
|
84
|
+
0,
|
|
85
|
+
8,
|
|
86
|
+
0,
|
|
87
|
+
"var(--vf-select-gutter, 16px)"
|
|
88
|
+
],
|
|
89
|
+
shadows: "calc(var(--vf-scale, 1) * var(--_shadow-depth)) calc(var(--vf-scale, 1) * var(--_shadow-depth)) 0 0 var(--vf-black, #000)"
|
|
90
|
+
})}
|
|
84
91
|
}
|
|
85
92
|
/* Keyboard focus is the kit's dashed rule under the pill, not a ring
|
|
86
93
|
around it (see vfFocusUnderline). It goes BELOW the whole box rather
|
|
@@ -88,11 +95,12 @@ var L = class extends o(b) {
|
|
|
88
95
|
has one line and the label already shares it with the ▼.
|
|
89
96
|
|
|
90
97
|
The offset counts every row of ink below the pseudo-element's padding
|
|
91
|
-
box
|
|
92
|
-
the hard shadow (1px, or none under no-shadow):
|
|
93
|
-
The
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
box, which runs under the pill's stroke, before the blank row and the
|
|
99
|
+
rule itself — the hard shadow (1px, or none under no-shadow):
|
|
100
|
+
−(depth + 1 + 1). The rule spans that same box, which is the shape
|
|
101
|
+
the pill reads as (the shadow is a depth cue, not part of the
|
|
102
|
+
silhouette). Under forced colors the stroke is a border and the
|
|
103
|
+
padding box sits inside it, so the insets grow by it there.
|
|
96
104
|
|
|
97
105
|
Gated on a class, not :focus-visible — the same problem the editable
|
|
98
106
|
fields have, arrived at from the other direction. The pill suppresses
|
|
@@ -107,10 +115,10 @@ var L = class extends o(b) {
|
|
|
107
115
|
outline: none;
|
|
108
116
|
}
|
|
109
117
|
.control.vf-focus-rule::after {
|
|
110
|
-
|
|
111
|
-
${d}
|
|
112
|
-
left:
|
|
113
|
-
right:
|
|
118
|
+
${p}
|
|
119
|
+
bottom: ${d("(-3px - var(--_shadow-depth))")};
|
|
120
|
+
left: ${d(-1)};
|
|
121
|
+
right: ${d(-1)};
|
|
114
122
|
}
|
|
115
123
|
/* The label is a 1×1 grid: the visible value and an invisible stack of
|
|
116
124
|
every option's text share the one cell, so the cell — and thus the
|
|
@@ -194,16 +202,10 @@ var L = class extends o(b) {
|
|
|
194
202
|
position: fixed;
|
|
195
203
|
z-index: 10000;
|
|
196
204
|
margin: 0;
|
|
197
|
-
padding: 0;
|
|
198
205
|
/* Match the closed pill's 1px hard shadow — the shared .vf-panel recipe
|
|
199
206
|
defaults to the 2px menu shadow, which would overhang the pill's shadow
|
|
200
207
|
by 1px on the right and bottom. */
|
|
201
208
|
--vf-shadow-offset: 1px;
|
|
202
|
-
/* A CLIP, never a scroll surface: positionPanel gives the panel a whole
|
|
203
|
-
number of row slots and the rows are rolled by transform inside it.
|
|
204
|
-
System 7 put no scrollbar on a menu, and an un-quantized native scroll
|
|
205
|
-
would break the row lattice the pill overlay is built on. */
|
|
206
|
-
overflow: hidden;
|
|
207
209
|
/* The screen-edge reserve, resolved here and read back by
|
|
208
210
|
positionPanel: the clamp is JS geometry, so the tokens can't be spent
|
|
209
211
|
in a declaration, but their defaults and the cascade still belong in
|
|
@@ -216,6 +218,18 @@ var L = class extends o(b) {
|
|
|
216
218
|
.panel.open {
|
|
217
219
|
display: block;
|
|
218
220
|
}
|
|
221
|
+
/* A CLIP, never a scroll surface: positionPanel gives the panel a whole
|
|
222
|
+
number of row slots and the rows are rolled by transform inside it.
|
|
223
|
+
System 7 put no scrollbar on a menu, and an un-quantized native scroll
|
|
224
|
+
would break the row lattice the pill overlay is built on. An element
|
|
225
|
+
inside the panel rather than the panel itself, whose frame is a
|
|
226
|
+
stroke: the panel would clip at its outer edge and let rolled rows
|
|
227
|
+
paint over the frame. The arrow slots place against it. */
|
|
228
|
+
.clip {
|
|
229
|
+
position: relative;
|
|
230
|
+
height: 100%;
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
}
|
|
219
233
|
/* The rolling strip — a box for the options to ride, whose translateY
|
|
220
234
|
positionPanel and the arrow timer write. Transform rather than
|
|
221
235
|
scrollTop: both keep
|
|
@@ -290,7 +304,7 @@ var L = class extends o(b) {
|
|
|
290
304
|
return this.rowScroll < this.optionItems.length - this.visibleSlots;
|
|
291
305
|
}
|
|
292
306
|
constructor() {
|
|
293
|
-
super(), this.value = "", this.name = "", this.size = "regular", this.noShadow = !1, this.label = "", this.open = !1, this.cachedOptions = [], this.scale = new r(this), this.gridSnap = new
|
|
307
|
+
super(), this.value = "", this.name = "", this.size = "regular", this.noShadow = !1, this.label = "", this.open = !1, this.cachedOptions = [], this.scale = new r(this), this.gridSnap = new m(this), this.focusRule = new C(this), this.panelListeners = new h(this, () => [
|
|
294
308
|
[
|
|
295
309
|
document,
|
|
296
310
|
"pointerdown",
|
|
@@ -308,7 +322,7 @@ var L = class extends o(b) {
|
|
|
308
322
|
"resize",
|
|
309
323
|
this.handleWindowResize
|
|
310
324
|
]
|
|
311
|
-
]), this.pressListeners = new
|
|
325
|
+
]), this.pressListeners = new h(this, () => [
|
|
312
326
|
[
|
|
313
327
|
document,
|
|
314
328
|
"pointermove",
|
|
@@ -327,7 +341,7 @@ var L = class extends o(b) {
|
|
|
327
341
|
this.handlePressCancel,
|
|
328
342
|
!0
|
|
329
343
|
]
|
|
330
|
-
]), this.activeIndex = -1, this.rowScroll = 0, this.visibleSlots = 0, this.rowHeight = 0, this.arrowScroll = null, this.pressStartArrow = null, this.pressing = !1, this.pressOpenedPanel = !1, this.pressMoved = !1, this.pressStartOption = null, this.pressDownTime = 0, this.pressDownX = 0, this.pressDownY = 0, this.swallowClick = !1, this.blinking = !1, this.typeAhead = new
|
|
344
|
+
]), this.activeIndex = -1, this.rowScroll = 0, this.visibleSlots = 0, this.rowHeight = 0, this.arrowScroll = null, this.pressStartArrow = null, this.pressing = !1, this.pressOpenedPanel = !1, this.pressMoved = !1, this.pressStartOption = null, this.pressDownTime = 0, this.pressDownX = 0, this.pressDownY = 0, this.swallowClick = !1, this.blinking = !1, this.typeAhead = new A(), this.handleSlotChange = () => {
|
|
331
345
|
if (this.cachedOptions = this.assignedOptions ?? [], this.applySize(), this.value === "") {
|
|
332
346
|
let e = this.optionItems.find((e) => !e.disabled);
|
|
333
347
|
e && (this.value = this.optionValue(e));
|
|
@@ -485,7 +499,7 @@ var L = class extends o(b) {
|
|
|
485
499
|
positionPanel(e) {
|
|
486
500
|
let t = this.controlEl, n = this.panelEl;
|
|
487
501
|
if (!t || !n) return;
|
|
488
|
-
let r = t.getBoundingClientRect(), a = getComputedStyle(n), o = parseFloat(a.borderTopWidth) || 0, s = this.optionItems[0]?.getBoundingClientRect()?.height || r.height - 2 * o, c = (e) => i(parseFloat(a.getPropertyValue(e)) || 0, this), l =
|
|
502
|
+
let r = t.getBoundingClientRect(), a = getComputedStyle(n), o = (parseFloat(a.borderTopWidth) || 0) + (parseFloat(a.paddingTop) || 0), s = this.optionItems[0]?.getBoundingClientRect()?.height || r.height - 2 * o, c = (e) => i(parseFloat(a.getPropertyValue(e)) || 0, this), l = k({
|
|
489
503
|
idealTop: r.top - e * s,
|
|
490
504
|
rowHeight: s,
|
|
491
505
|
border: o,
|
|
@@ -503,11 +517,11 @@ var L = class extends o(b) {
|
|
|
503
517
|
this.rowsEl && (this.rowsEl.style.transform = e ? `translateY(${-e}px)` : ""), this.upArrowEl?.classList.toggle("shown", this.showUpArrow), this.downArrowEl?.classList.toggle("shown", this.showDownArrow);
|
|
504
518
|
}
|
|
505
519
|
revealRow(e) {
|
|
506
|
-
let t =
|
|
520
|
+
let t = E(e, this.rowScroll, this.optionItems.length, this.visibleSlots);
|
|
507
521
|
t !== this.rowScroll && (this.rowScroll = t, this.applyScroll());
|
|
508
522
|
}
|
|
509
523
|
stepArrowScroll(e) {
|
|
510
|
-
let t =
|
|
524
|
+
let t = T(this.rowScroll + e, this.rowScroll, this.optionItems.length, this.visibleSlots);
|
|
511
525
|
return t !== this.rowScroll && (this.rowScroll = t, this.applyScroll(), !0);
|
|
512
526
|
}
|
|
513
527
|
startArrowScroll(e) {
|
|
@@ -583,7 +597,7 @@ var L = class extends o(b) {
|
|
|
583
597
|
if (e.disabled || this.blinking) return;
|
|
584
598
|
let t = this.optionItems.indexOf(e);
|
|
585
599
|
this.setActive(t, !1), this.blinking = !0;
|
|
586
|
-
let n =
|
|
600
|
+
let n = g((t) => {
|
|
587
601
|
e.active = t;
|
|
588
602
|
}, () => {
|
|
589
603
|
this.commit(e);
|
|
@@ -599,7 +613,7 @@ var L = class extends o(b) {
|
|
|
599
613
|
this.value = r, e(this, "vf-change", { value: r }), t(this, "input"), t(this, "change");
|
|
600
614
|
}
|
|
601
615
|
optionFromEvent(e) {
|
|
602
|
-
return e.composedPath().find((e) => e instanceof
|
|
616
|
+
return e.composedPath().find((e) => e instanceof w);
|
|
603
617
|
}
|
|
604
618
|
endPress() {
|
|
605
619
|
this.pressing && (this.pressing = !1, this.pressStartOption = null, this.pressStartArrow = null, this.pressListeners.detach());
|
|
@@ -609,7 +623,7 @@ var L = class extends o(b) {
|
|
|
609
623
|
if (!this.open || !n) return null;
|
|
610
624
|
let r = n.getBoundingClientRect();
|
|
611
625
|
if (e < r.left || e >= r.right || t < r.top || t >= r.bottom) return null;
|
|
612
|
-
let i =
|
|
626
|
+
let i = D(this.rowScroll), a = O(this.rowScroll, this.optionItems.length, this.visibleSlots);
|
|
613
627
|
for (let n = i; n <= a; n += 1) {
|
|
614
628
|
let r = this.optionItems[n];
|
|
615
629
|
if (!r) continue;
|
|
@@ -632,10 +646,10 @@ var L = class extends o(b) {
|
|
|
632
646
|
this.selectOption(e);
|
|
633
647
|
}
|
|
634
648
|
render() {
|
|
635
|
-
let e = this.optionItems.find((e) => this.optionValue(e) === this.value), t = e ? (e.textContent ?? "").trim() : "", n = this.isDisabled, r = this.size === "small", i = r ?
|
|
636
|
-
return
|
|
649
|
+
let e = this.optionItems.find((e) => this.optionValue(e) === this.value), t = e ? (e.textContent ?? "").trim() : "", n = this.isDisabled, r = this.size === "small", i = r ? v : _, a = r ? b : y;
|
|
650
|
+
return M`
|
|
637
651
|
<div
|
|
638
|
-
class=${
|
|
652
|
+
class=${R({
|
|
639
653
|
control: !0,
|
|
640
654
|
"vf-snap": !0,
|
|
641
655
|
"vf-focus-rule": this.focusRule.marked && !this.open,
|
|
@@ -647,20 +661,20 @@ var L = class extends o(b) {
|
|
|
647
661
|
aria-expanded=${this.open ? "true" : "false"}
|
|
648
662
|
aria-disabled=${n ? "true" : "false"}
|
|
649
663
|
aria-controls="listbox"
|
|
650
|
-
aria-label=${this.label || this.hostLabel ||
|
|
664
|
+
aria-label=${this.label || this.hostLabel || N}
|
|
651
665
|
aria-describedby=${this.describedBy}
|
|
652
|
-
aria-required=${this.required ? "true" :
|
|
653
|
-
aria-invalid=${this.validity.valid ?
|
|
666
|
+
aria-required=${this.required ? "true" : N}
|
|
667
|
+
aria-invalid=${this.validity.valid ? N : "true"}
|
|
654
668
|
tabindex=${n ? "-1" : "0"}
|
|
655
669
|
>
|
|
656
670
|
<span class="label" part="label">
|
|
657
671
|
<span class="value">${t}</span>
|
|
658
672
|
<span class="sizer" aria-hidden="true">
|
|
659
|
-
${this.optionItems.map((e) =>
|
|
673
|
+
${this.optionItems.map((e) => M`<span>${(e.textContent ?? "").trim()}</span>`)}
|
|
660
674
|
</span>
|
|
661
675
|
</span>
|
|
662
676
|
<span class="arrow" part="arrow" aria-hidden="true"
|
|
663
|
-
>${
|
|
677
|
+
>${x(i, "caret")}</span
|
|
664
678
|
>
|
|
665
679
|
</div>
|
|
666
680
|
<div
|
|
@@ -668,47 +682,51 @@ var L = class extends o(b) {
|
|
|
668
682
|
class="panel vf-panel ${this.open ? "open" : ""}"
|
|
669
683
|
part="panel"
|
|
670
684
|
role="listbox"
|
|
671
|
-
aria-label=${this.label || this.hostLabel ||
|
|
685
|
+
aria-label=${this.label || this.hostLabel || N}
|
|
672
686
|
aria-hidden=${this.open ? "false" : "true"}
|
|
673
687
|
>
|
|
674
|
-
<!-- role="presentation"
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
688
|
+
<!-- role="presentation" on the clip and the strip that carries the
|
|
689
|
+
roll, so neither stands between the listbox and the options it
|
|
690
|
+
owns. -->
|
|
691
|
+
<div class="clip" role="presentation">
|
|
692
|
+
<div class="rows" role="presentation">
|
|
693
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
694
|
+
</div>
|
|
695
|
+
<!-- Pointer affordances only, hence aria-hidden: the clipped options
|
|
696
|
+
stay in the accessibility tree un-hidden (clipping is
|
|
697
|
+
presentation, and a native <select> exposes its whole list too),
|
|
698
|
+
and keyboard and AT users reach every row with the arrows,
|
|
699
|
+
Home/End and type-ahead. -->
|
|
700
|
+
<div
|
|
701
|
+
class="arrow-slot up"
|
|
702
|
+
part="scroll-arrow"
|
|
703
|
+
aria-hidden="true"
|
|
704
|
+
@pointerenter=${this.handleArrowEnter}
|
|
705
|
+
@pointermove=${this.handleArrowEnter}
|
|
706
|
+
@pointerleave=${this.handleArrowLeave}
|
|
707
|
+
>
|
|
708
|
+
${x(a, "caret")}
|
|
709
|
+
</div>
|
|
710
|
+
<div
|
|
711
|
+
class="arrow-slot down"
|
|
712
|
+
part="scroll-arrow"
|
|
713
|
+
aria-hidden="true"
|
|
714
|
+
@pointerenter=${this.handleArrowEnter}
|
|
715
|
+
@pointermove=${this.handleArrowEnter}
|
|
716
|
+
@pointerleave=${this.handleArrowLeave}
|
|
717
|
+
>
|
|
718
|
+
${x(i, "caret")}
|
|
719
|
+
</div>
|
|
702
720
|
</div>
|
|
703
721
|
</div>
|
|
704
722
|
${this.renderDescription()}
|
|
705
723
|
`;
|
|
706
724
|
}
|
|
707
725
|
};
|
|
708
|
-
a([
|
|
726
|
+
a([P()], z.prototype, "value", void 0), a([P({ reflect: !0 })], z.prototype, "name", void 0), a([P({ reflect: !0 })], z.prototype, "size", void 0), a([P({
|
|
709
727
|
type: Boolean,
|
|
710
728
|
reflect: !0,
|
|
711
729
|
attribute: "no-shadow"
|
|
712
|
-
})],
|
|
730
|
+
})], z.prototype, "noShadow", void 0), a([P()], z.prototype, "label", void 0), a([L()], z.prototype, "open", void 0), a([F(".control")], z.prototype, "controlEl", void 0), a([F(".panel")], z.prototype, "panelEl", void 0), a([F(".rows")], z.prototype, "rowsEl", void 0), a([F(".arrow-slot.up")], z.prototype, "upArrowEl", void 0), a([F(".arrow-slot.down")], z.prototype, "downArrowEl", void 0), a([I({ selector: "vf-option" })], z.prototype, "assignedOptions", void 0), a([L()], z.prototype, "cachedOptions", void 0), z = a([n("vf-select")], z);
|
|
713
731
|
//#endregion
|
|
714
|
-
export {
|
|
732
|
+
export { z as VfSelect };
|
|
@@ -10,13 +10,13 @@ declare const VfSeparator_base: (new (...args: any[]) => import("../position.js"
|
|
|
10
10
|
*
|
|
11
11
|
* Containers may restyle it via custom properties:
|
|
12
12
|
* - `--vf-separator-color` — line color (default `var(--vf-black, #000)`).
|
|
13
|
-
* - `--vf-separator-style` —
|
|
14
|
-
* `vf-menu` sets these so slotted separators render as the
|
|
15
|
-
* dotted menu rule (see Menus.png).
|
|
13
|
+
* - `--vf-separator-style` — `solid` (the default) or `dotted`, one system px
|
|
14
|
+
* on and one off. `vf-menu` sets these so slotted separators render as the
|
|
15
|
+
* classic dimmed dotted menu rule (see Menus.png).
|
|
16
16
|
* @cssprop --vf-separator-color - `vf-separator` rule color — `vf-menu` sets it
|
|
17
17
|
* to `--vf-disabled` for the dimmed menu rule
|
|
18
|
-
* @cssprop [--vf-separator-style=solid] - `vf-separator` rule style
|
|
19
|
-
* sets `dotted` (see `Menus.png`)
|
|
18
|
+
* @cssprop [--vf-separator-style=solid] - `vf-separator` rule style: `solid`
|
|
19
|
+
* or `dotted` — `vf-menu` sets `dotted` (see `Menus.png`)
|
|
20
20
|
*/
|
|
21
21
|
export declare class VfSeparator extends VfSeparator_base {
|
|
22
22
|
#private;
|
|
@@ -19,20 +19,46 @@ var u = class extends r(o) {
|
|
|
19
19
|
height: auto;
|
|
20
20
|
align-self: stretch;
|
|
21
21
|
}
|
|
22
|
-
/* The rule ink lives on an inner element rather than
|
|
23
|
-
|
|
22
|
+
/* The rule ink lives on an inner element rather than the host so it can
|
|
23
|
+
ride the snap offset (see .vf-snap in base.ts). The element is the
|
|
24
|
+
line — the host is one system px across — so it paints its own
|
|
25
|
+
background rather than a border, whose width Safari rounds before
|
|
26
|
+
page zoom (see vfStrokeDecls). */
|
|
24
27
|
.rule {
|
|
25
28
|
width: 100%;
|
|
26
29
|
height: 100%;
|
|
27
|
-
|
|
28
|
-
var(--vf-separator-style, solid)
|
|
29
|
-
var(--vf-separator-color, var(--vf-black, #000));
|
|
30
|
+
background: var(--vf-separator-color, var(--vf-black, #000));
|
|
30
31
|
}
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
/* Dotted: one system px of ink, one off, from the start of the rule. */
|
|
33
|
+
@container style(--vf-separator-style: dotted) {
|
|
34
|
+
.rule {
|
|
35
|
+
background: repeating-linear-gradient(
|
|
36
|
+
to right,
|
|
37
|
+
var(--vf-separator-color, var(--vf-black, #000)) 0 calc(var(--vf-scale, 1) * 1px),
|
|
38
|
+
transparent calc(var(--vf-scale, 1) * 1px) calc(var(--vf-scale, 1) * 2px)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
:host([vertical]) .rule {
|
|
42
|
+
background: repeating-linear-gradient(
|
|
43
|
+
to bottom,
|
|
44
|
+
var(--vf-separator-color, var(--vf-black, #000)) 0 calc(var(--vf-scale, 1) * 1px),
|
|
45
|
+
transparent calc(var(--vf-scale, 1) * 1px) calc(var(--vf-scale, 1) * 2px)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/* Forced colors repaints backgrounds and deletes gradients, so the line
|
|
50
|
+
is a border there, as every kit stroke is (vfStrokeDecls). */
|
|
51
|
+
@media (forced-colors: active) {
|
|
52
|
+
.rule {
|
|
53
|
+
background: none;
|
|
54
|
+
border-top: calc(var(--vf-scale, 1) * 1px) var(--vf-separator-style, solid)
|
|
55
|
+
var(--vf-separator-color, var(--vf-black, #000));
|
|
56
|
+
}
|
|
57
|
+
:host([vertical]) .rule {
|
|
58
|
+
border-top: none;
|
|
59
|
+
border-left: calc(var(--vf-scale, 1) * 1px) var(--vf-separator-style, solid)
|
|
60
|
+
var(--vf-separator-color, var(--vf-black, #000));
|
|
61
|
+
}
|
|
36
62
|
}
|
|
37
63
|
`];
|
|
38
64
|
}
|
|
@@ -5,12 +5,12 @@ import o from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js
|
|
|
5
5
|
import { VfPositioned as s } from "../position.js";
|
|
6
6
|
import { vfBase as c } from "../styles/recipes/host.js";
|
|
7
7
|
import { vfFocusUnderline as l } from "../styles/recipes/focus.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { GridSnapController as u } from "../grid-snap.js";
|
|
9
|
+
import { SLIDER_THUMB as d, SLIDER_THUMB_FACE as f } from "../glyphs.js";
|
|
10
|
+
import { VfFormControl as p } from "../form-control.js";
|
|
11
|
+
import { FocusRuleController as m } from "../focus-modality.js";
|
|
12
|
+
import { decimalsOf as h } from "../number.js";
|
|
13
|
+
import { TrackWidthController as g } from "../track-width.js";
|
|
14
14
|
import { css as _, html as v } from "lit";
|
|
15
15
|
import { property as y, query as b } from "lit/decorators.js";
|
|
16
16
|
//#region src/components/vf-slider.ts
|
|
@@ -21,7 +21,7 @@ function D(e, t) {
|
|
|
21
21
|
};
|
|
22
22
|
return r(1, 0, e - 2, 1), r(1, 3, e - 2, 1), r(0, 1, 1, 2), r(e - 1, 1, 1, 2), r(1, 1, Math.min(Math.max(t, 0), e - 1) - 1, 2), n.join("");
|
|
23
23
|
}
|
|
24
|
-
var O = class extends s(
|
|
24
|
+
var O = class extends s(p) {
|
|
25
25
|
static {
|
|
26
26
|
this.styles = [c, _`
|
|
27
27
|
:host {
|
|
@@ -110,7 +110,7 @@ var O = class extends s(m) {
|
|
|
110
110
|
#t;
|
|
111
111
|
#n;
|
|
112
112
|
constructor() {
|
|
113
|
-
super(), this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.name = "", this.label = "", this.trackSize = new
|
|
113
|
+
super(), this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.name = "", this.label = "", this.trackSize = new g(this, () => this.track), this.scale = new r(this), this.gridSnap = new u(this), this.selfManagedTabIndex = !1, this.#e = new m(this), this.#t = 0, this.#n = !1, this.#f = (e) => {
|
|
114
114
|
if (!(this.isDisabled || e.button !== 0)) {
|
|
115
115
|
e.preventDefault(), this.#e.suppress(), this.focus(), this.#n = !0, this.#t = this.value;
|
|
116
116
|
try {
|
|
@@ -181,7 +181,7 @@ var O = class extends s(m) {
|
|
|
181
181
|
}
|
|
182
182
|
#o(e) {
|
|
183
183
|
let t = this.#i, n = Math.round((e - this.min) / t), r = this.#a(this.min + n * t);
|
|
184
|
-
return Number(r.toFixed(
|
|
184
|
+
return Number(r.toFixed(h(t)));
|
|
185
185
|
}
|
|
186
186
|
get #s() {
|
|
187
187
|
let e = Number.isFinite(this.value) ? this.value : this.min;
|
|
@@ -242,8 +242,8 @@ var O = class extends s(m) {
|
|
|
242
242
|
shape-rendering="crispEdges"
|
|
243
243
|
aria-hidden="true"
|
|
244
244
|
>
|
|
245
|
-
<path class="thumb-face" d=${
|
|
246
|
-
<path class="thumb-outline" d=${
|
|
245
|
+
<path class="thumb-face" d=${f.d}></path>
|
|
246
|
+
<path class="thumb-outline" d=${d.d}></path>
|
|
247
247
|
</svg>
|
|
248
248
|
</span>
|
|
249
249
|
</div>
|
|
@@ -83,8 +83,8 @@ export declare class VfSwatch extends VfSwatch_base {
|
|
|
83
83
|
private readonly gridSnap;
|
|
84
84
|
/**
|
|
85
85
|
* The consumer's `--vf-swatch-checker` override, or `''` for the kit
|
|
86
|
-
* checker — which
|
|
87
|
-
*
|
|
86
|
+
* checker — which path render() takes (src/tile-grid.ts). Re-read every
|
|
87
|
+
* update; a runtime token swap wants a `requestUpdate()`.
|
|
88
88
|
*/
|
|
89
89
|
private _pattern;
|
|
90
90
|
protected willUpdate(changed: PropertyValues<this>): void;
|