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
|
@@ -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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
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(
|
|
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
|
-
|
|
58
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
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 ||
|
|
199
|
+
aria-label=${this.label || this.hostLabel || m}
|
|
198
200
|
aria-describedby=${this.describedBy}
|
|
199
|
-
aria-required=${this.required ? "true" :
|
|
200
|
-
aria-invalid=${this.validity.valid ?
|
|
201
|
-
aria-valuenow=${Number.isNaN(t) ?
|
|
202
|
-
aria-valuemin=${this.min ??
|
|
203
|
-
aria-valuemax=${this.max ??
|
|
204
|
-
.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=${
|
|
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=${
|
|
220
|
-
<path class=${
|
|
221
|
+
})} d=${l.d}></path>
|
|
222
|
+
<path class=${v({
|
|
221
223
|
fill: !0,
|
|
222
224
|
on: this.pressed === "down"
|
|
223
|
-
})} d=${
|
|
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([
|
|
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 {
|
|
250
|
+
export { b as VfNumberField };
|
|
@@ -48,8 +48,8 @@ export declare class VfProgressBar extends VfProgressBar_base {
|
|
|
48
48
|
private readonly trackSize;
|
|
49
49
|
/**
|
|
50
50
|
* The consumer's `--vf-progress-stripes` override, or `''` for the kit
|
|
51
|
-
* barber — which
|
|
52
|
-
*
|
|
51
|
+
* barber — which path the strip takes (src/tile-grid.ts). Re-read every
|
|
52
|
+
* update; a runtime token swap wants a `requestUpdate()`.
|
|
53
53
|
*/
|
|
54
54
|
private _pattern;
|
|
55
55
|
constructor();
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { vfElement as e } from "../define.js";
|
|
2
|
-
import { ScaleController as t, sys as n,
|
|
3
|
-
import
|
|
4
|
-
import { VfPositioned as
|
|
5
|
-
import { vfBase as
|
|
6
|
-
import { tileImage as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { ScaleController as t, sys as n, toSys as r } from "../scale.js";
|
|
3
|
+
import i from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
|
+
import { VfPositioned as a } from "../position.js";
|
|
5
|
+
import { vfBase as o } from "../styles/recipes/host.js";
|
|
6
|
+
import { tileImage as s, tileRects as c, tileSpan as l, vfTileMaskSize as u } from "../styles/recipes/tile.js";
|
|
7
|
+
import { RepeatTileController as d, patternOverride as f, tileGrid as p, vfRepeatTileSize as m, vfTileGrid as h } from "../tile-grid.js";
|
|
8
|
+
import { vfStrokeDecls as g } from "../styles/recipes/stroke.js";
|
|
9
9
|
import { GridSnapController as _ } from "../grid-snap.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { TrackWidthController as v } from "../track-width.js";
|
|
11
|
+
import { LitElement as y, css as b, html as x, unsafeCSS as S } from "lit";
|
|
12
|
+
import { property as C, query as w } from "lit/decorators.js";
|
|
12
13
|
//#region src/components/vf-progress-bar.ts
|
|
13
|
-
var
|
|
14
|
+
var T = 12, E = [
|
|
14
15
|
[
|
|
15
16
|
0,
|
|
16
17
|
0,
|
|
@@ -113,12 +114,16 @@ var w = 12, T = [
|
|
|
113
114
|
1,
|
|
114
115
|
1
|
|
115
116
|
]
|
|
116
|
-
],
|
|
117
|
+
], D = {
|
|
118
|
+
width: T,
|
|
119
|
+
height: T,
|
|
120
|
+
rects: E
|
|
121
|
+
}, O = s(T, T, c(E)), k = l(T), A = class extends a(y) {
|
|
117
122
|
static {
|
|
118
123
|
this.styles = [
|
|
119
|
-
|
|
124
|
+
o,
|
|
120
125
|
h,
|
|
121
|
-
|
|
126
|
+
b`
|
|
122
127
|
:host {
|
|
123
128
|
display: block;
|
|
124
129
|
height: calc(var(--vf-scale, 1) * 14px);
|
|
@@ -127,45 +132,48 @@ var w = 12, T = [
|
|
|
127
132
|
position: relative;
|
|
128
133
|
height: 100%;
|
|
129
134
|
background: var(--vf-progress-track, #ffffff);
|
|
130
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
131
135
|
border-radius: 0;
|
|
132
136
|
overflow: hidden;
|
|
137
|
+
${g()}
|
|
133
138
|
}
|
|
134
139
|
.fill {
|
|
135
140
|
height: 100%;
|
|
136
141
|
background: var(--vf-progress-fill, #000000);
|
|
137
|
-
/* The classic 1px black leading edge. */
|
|
138
|
-
border-right: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
139
142
|
}
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
/* The classic 1px black leading edge, on a fill with any width. */
|
|
144
|
+
.fill:not(.empty):not(.stripes) {
|
|
145
|
+
${g({ edges: ["right"] })}
|
|
142
146
|
}
|
|
143
147
|
.fill.stripes {
|
|
144
148
|
width: 100%;
|
|
145
|
-
border-right: none;
|
|
146
149
|
/* Chunky 45° barber stripes: a 12×12 system-px cell whose two black
|
|
147
150
|
\ bands are a staircase of axis-aligned 1px rects (genuine pixel
|
|
148
151
|
art — a *diagonal* edge would blur where these stay pixel-exact)
|
|
149
152
|
over this themeable white ground. The art itself rides the
|
|
150
|
-
.vf-tile-strip child (src/tile-grid.ts): the kit's
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
.vf-tile-strip child (src/tile-grid.ts): the kit's repeating
|
|
154
|
+
tile, or a consumer --vf-progress-stripes token's placed tile grid
|
|
155
|
+
at the token's documented 60-px tile geometry. This layer is the
|
|
156
|
+
strip's containing block and its clip. */
|
|
154
157
|
position: relative;
|
|
155
158
|
background-color: var(--vf-white, #fff);
|
|
156
|
-
--_vf-tile-image: var(--vf-progress-stripes, ${
|
|
159
|
+
--_vf-tile-image: var(--vf-progress-stripes, ${S(O)});
|
|
157
160
|
}
|
|
158
|
-
/* The animated strip:
|
|
159
|
-
the fill), and each cycle
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
box — no CSS length
|
|
161
|
+
/* The animated strip: the fill's width plus one 12px cell, resting
|
|
162
|
+
that cell to the left (fully covering the fill), and each cycle
|
|
163
|
+
advances one whole cell in 4 chunky steps — steppy, not smooth,
|
|
164
|
+
wrapping with zero phase jump because the art's period is the cell.
|
|
165
|
+
The animated value is a layout property, so every step is one
|
|
166
|
+
quantized length paint-snapped like any placed box — no CSS length
|
|
167
|
+
ever accumulates a phase. */
|
|
164
168
|
.vf-tile-strip {
|
|
165
169
|
position: absolute;
|
|
166
170
|
top: 0;
|
|
167
171
|
height: 100%;
|
|
172
|
+
width: calc(100% + var(--vf-scale, 1) * 12px);
|
|
168
173
|
left: calc(var(--vf-scale, 1) * -12px);
|
|
174
|
+
background-image: var(--_vf-barber-tile, none);
|
|
175
|
+
${m}
|
|
176
|
+
image-rendering: pixelated;
|
|
169
177
|
animation: vf-barber 0.4s steps(4, end) infinite;
|
|
170
178
|
}
|
|
171
179
|
@keyframes vf-barber {
|
|
@@ -179,8 +187,8 @@ var w = 12, T = [
|
|
|
179
187
|
/* Forced colors: the fill and track are the bar's whole reading, and
|
|
180
188
|
both have their own tokens with literal fallbacks the override
|
|
181
189
|
flattens to Canvas — remapped here like the palette tokens in vfBase.
|
|
182
|
-
The strip's
|
|
183
|
-
|
|
190
|
+
The strip's tile would keep its literal black ink (invisible on a
|
|
191
|
+
dark theme), so the strip hides and the layer repaints as a mask
|
|
184
192
|
over the ink token — same tile, same token a consumer overrides —
|
|
185
193
|
with the animation on the mask's position. The span-tiled mask keeps
|
|
186
194
|
the zoom caveat (no mask pipeline rasterizes exactly at a zoom-minted
|
|
@@ -192,8 +200,8 @@ var w = 12, T = [
|
|
|
192
200
|
}
|
|
193
201
|
.fill.stripes {
|
|
194
202
|
background-color: var(--vf-progress-fill, CanvasText);
|
|
195
|
-
mask-image: var(--vf-progress-stripes, ${
|
|
196
|
-
${
|
|
203
|
+
mask-image: var(--vf-progress-stripes, ${S(O)});
|
|
204
|
+
${u(T)}
|
|
197
205
|
animation: vf-barber-mask 0.4s steps(4, end) infinite;
|
|
198
206
|
}
|
|
199
207
|
.fill.stripes .vf-tile-strip {
|
|
@@ -220,7 +228,11 @@ var w = 12, T = [
|
|
|
220
228
|
#e;
|
|
221
229
|
#t;
|
|
222
230
|
constructor() {
|
|
223
|
-
super(), this.scale = new t(this), this.gridSnap = new _(this), this.value = 0, this.max = 100, this.indeterminate = !1, this.label = "", this.trackSize = new
|
|
231
|
+
super(), this.scale = new t(this), this.gridSnap = new _(this), this.value = 0, this.max = 100, this.indeterminate = !1, this.label = "", this.trackSize = new v(this, () => this.track), this._pattern = "", this.#e = new d(this, {
|
|
232
|
+
getBox: () => this.renderRoot?.querySelector(".vf-tile-strip"),
|
|
233
|
+
getArt: () => this.indeterminate && !this._pattern ? D : null,
|
|
234
|
+
property: "--_vf-barber-tile"
|
|
235
|
+
}), this.#t = this.attachInternals(), this.#t.role = "progressbar", this.#t.ariaValueMin = "0";
|
|
224
236
|
}
|
|
225
237
|
get effectiveMax() {
|
|
226
238
|
return this.max > 0 ? this.max : 100;
|
|
@@ -229,44 +241,45 @@ var w = 12, T = [
|
|
|
229
241
|
return Math.min(Math.max(this.value, 0), this.effectiveMax);
|
|
230
242
|
}
|
|
231
243
|
willUpdate(e) {
|
|
232
|
-
super.willUpdate(e), this.indeterminate && (this._pattern =
|
|
244
|
+
super.willUpdate(e), this.indeterminate && (this._pattern = f(this, "--vf-progress-stripes"));
|
|
233
245
|
}
|
|
234
246
|
updated(e) {
|
|
235
247
|
e.has("label") && (this.#t.ariaLabel = this.label || null), e.has("max") && (this.#t.ariaValueMax = String(this.effectiveMax)), (e.has("value") || e.has("max") || e.has("indeterminate")) && (this.#t.ariaValueNow = this.indeterminate ? null : String(this.clampedValue));
|
|
236
248
|
}
|
|
237
249
|
render() {
|
|
238
250
|
if (this.indeterminate) {
|
|
239
|
-
let e =
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
251
|
+
let e = null;
|
|
252
|
+
if (this._pattern) {
|
|
253
|
+
let t = r(this.trackSize.width, this), n = Math.max(1, Math.ceil((t + T) / k));
|
|
254
|
+
e = p({
|
|
255
|
+
cols: n,
|
|
256
|
+
rows: 1,
|
|
257
|
+
tile: k
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return x`
|
|
248
261
|
<div class="track vf-snap" part="track">
|
|
249
262
|
<div class="fill stripes vf-tile-grid" part="fill">
|
|
250
|
-
<div class="vf-tile-strip">${
|
|
263
|
+
<div class="vf-tile-strip">${e}</div>
|
|
251
264
|
</div>
|
|
252
265
|
</div>
|
|
253
266
|
`;
|
|
254
267
|
}
|
|
255
|
-
let e = this.clampedValue / this.effectiveMax, t =
|
|
256
|
-
return
|
|
268
|
+
let e = this.clampedValue / this.effectiveMax, t = r(this.trackSize.width, this), i = t > 0 ? `${n(Math.round(e * t), this)}px` : `${e * 100}%`;
|
|
269
|
+
return x`
|
|
257
270
|
<div class="track vf-snap" part="track">
|
|
258
271
|
<div
|
|
259
272
|
class="fill ${e <= 0 ? "empty" : ""}"
|
|
260
273
|
part="fill"
|
|
261
|
-
style="width: ${
|
|
274
|
+
style="width: ${i}"
|
|
262
275
|
></div>
|
|
263
276
|
</div>
|
|
264
277
|
`;
|
|
265
278
|
}
|
|
266
279
|
};
|
|
267
|
-
|
|
280
|
+
i([C({ type: Number })], A.prototype, "value", void 0), i([C({ type: Number })], A.prototype, "max", void 0), i([C({
|
|
268
281
|
type: Boolean,
|
|
269
282
|
reflect: !0
|
|
270
|
-
})],
|
|
283
|
+
})], A.prototype, "indeterminate", void 0), i([C()], A.prototype, "label", void 0), i([w(".track")], A.prototype, "track", void 0), A = i([e("vf-progress-bar")], A);
|
|
271
284
|
//#endregion
|
|
272
|
-
export {
|
|
285
|
+
export { A as VfProgressBar };
|
|
@@ -21,10 +21,9 @@ var y = class extends r(f(p)) {
|
|
|
21
21
|
m`
|
|
22
22
|
/* Keyboard focus underlines the circle itself — not the label, and not a
|
|
23
23
|
ring around either (see vfFocusUnderline). One blank row below the
|
|
24
|
-
well, which
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
pixel proud of the 13px well, so the gap reads as one row or two
|
|
24
|
+
well, which ends on the same row as vf-checkbox's box, so the two
|
|
25
|
+
rules land on the same row of a mixed list. The 12px sprite sits half
|
|
26
|
+
a pixel proud of the 13px well, so the gap reads as one row or two
|
|
28
27
|
depending on which way that rounds — the well is the anchor, not the
|
|
29
28
|
sprite. */
|
|
30
29
|
:host(:focus-visible) .circle::after {
|
|
@@ -3,19 +3,20 @@ import { ScaleController as t } from "../scale.js";
|
|
|
3
3
|
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
4
|
import { VfPositioned as r, placementIn as i } from "../position.js";
|
|
5
5
|
import { vfBase as a } from "../styles/recipes/host.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { vfStrokeDecls as o } from "../styles/recipes/stroke.js";
|
|
7
|
+
import { vfFocusRing as s } from "../styles/recipes/focus.js";
|
|
8
|
+
import { vfScrollRail as c } from "../styles/recipes/scroll-rail.js";
|
|
9
|
+
import { GridSnapController as l } from "../grid-snap.js";
|
|
10
|
+
import { ScrollStateController as u } from "../scroll-state.js";
|
|
11
|
+
import { ScrollRailController as d, renderScrollRail as f } from "../scroll-rail.js";
|
|
12
|
+
import { LitElement as p, css as m, html as h, nothing as g } from "lit";
|
|
13
|
+
import { property as _, query as v, state as y } from "lit/decorators.js";
|
|
13
14
|
//#region src/components/vf-scroll-area.ts
|
|
14
|
-
var
|
|
15
|
+
var b = class extends r(p) {
|
|
15
16
|
constructor() {
|
|
16
|
-
super(), this.scale = new t(this), this.gridSnap = new
|
|
17
|
+
super(), this.scale = new t(this), this.gridSnap = new l(this), this.axis = "vertical", this.corner = !1, this.label = "", this.scrollState = new u(this, () => this.viewport, () => this.content, (e) => {
|
|
17
18
|
this._scrollable = e.x || e.y;
|
|
18
|
-
}), this.rail = new
|
|
19
|
+
}), this.rail = new d(this, {
|
|
19
20
|
getScroll: () => this.viewport,
|
|
20
21
|
getContent: () => this.content
|
|
21
22
|
}), this._scrollable = !1, this.#e = () => {
|
|
@@ -38,13 +39,13 @@ var y = class extends r(f) {
|
|
|
38
39
|
static {
|
|
39
40
|
this.styles = [
|
|
40
41
|
a,
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
c,
|
|
43
|
+
m`
|
|
43
44
|
:host {
|
|
44
45
|
display: block;
|
|
45
46
|
}
|
|
46
|
-
/* The snapped wrapper:
|
|
47
|
-
|
|
47
|
+
/* The snapped wrapper: the 1px frame (the rails' outer line is this
|
|
48
|
+
stroke), a grid that reserves each rail as its own edge column/row —
|
|
48
49
|
the rails size themselves to the 15px inside the frame — and the
|
|
49
50
|
scroller and rails riding the grid-snap offset as one. */
|
|
50
51
|
.box {
|
|
@@ -53,8 +54,8 @@ var y = class extends r(f) {
|
|
|
53
54
|
display: grid;
|
|
54
55
|
grid-template-columns: 1fr;
|
|
55
56
|
grid-template-rows: 1fr;
|
|
56
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
57
57
|
background: var(--vf-white, #fff);
|
|
58
|
+
${o()}
|
|
58
59
|
}
|
|
59
60
|
:host(:not([axis])) .box,
|
|
60
61
|
:host([axis='vertical']) .box,
|
|
@@ -134,36 +135,36 @@ var y = class extends r(f) {
|
|
|
134
135
|
/* Focusable so keyboard users can scroll; inset ring to stay in-box. */
|
|
135
136
|
.viewport:focus-visible {
|
|
136
137
|
--vf-focus-offset: -2px;
|
|
137
|
-
${
|
|
138
|
+
${s}
|
|
138
139
|
}
|
|
139
140
|
`
|
|
140
141
|
];
|
|
141
142
|
}
|
|
142
143
|
render() {
|
|
143
144
|
let e = this.axis !== "horizontal", t = this.axis === "horizontal" || this.axis === "both", n = e && t || this.corner;
|
|
144
|
-
return
|
|
145
|
+
return h`
|
|
145
146
|
<div class="box vf-snap">
|
|
146
147
|
<div
|
|
147
148
|
class="viewport vf-scroll"
|
|
148
149
|
part="viewport"
|
|
149
|
-
tabindex=${this._scrollable ? "0" :
|
|
150
|
-
role=${this.label ? "region" : this._scrollable ? "group" :
|
|
151
|
-
aria-label=${this.label ||
|
|
150
|
+
tabindex=${this._scrollable ? "0" : g}
|
|
151
|
+
role=${this.label ? "region" : this._scrollable ? "group" : g}
|
|
152
|
+
aria-label=${this.label || g}
|
|
152
153
|
>
|
|
153
154
|
<div class="content">
|
|
154
155
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
155
156
|
</div>
|
|
156
157
|
</div>
|
|
157
|
-
${e ?
|
|
158
|
-
${t ?
|
|
159
|
-
${n ?
|
|
158
|
+
${e ? f(this.rail, "vertical") : g}
|
|
159
|
+
${t ? f(this.rail, "horizontal") : g}
|
|
160
|
+
${n ? h`<div class="vf-rail-corner" aria-hidden="true"></div>` : g}
|
|
160
161
|
</div>
|
|
161
162
|
`;
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
|
-
n([
|
|
165
|
+
n([_({ reflect: !0 })], b.prototype, "axis", void 0), n([_({
|
|
165
166
|
type: Boolean,
|
|
166
167
|
reflect: !0
|
|
167
|
-
})],
|
|
168
|
+
})], b.prototype, "corner", void 0), n([_()], b.prototype, "label", void 0), n([v(".viewport")], b.prototype, "viewport", void 0), n([v(".content")], b.prototype, "content", void 0), n([y()], b.prototype, "_scrollable", void 0), b = n([e("vf-scroll-area")], b);
|
|
168
169
|
//#endregion
|
|
169
|
-
export {
|
|
170
|
+
export { b as VfScrollArea };
|