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,17 +3,17 @@ import { ScaleController as t, sysLength as n } from "../scale.js";
|
|
|
3
3
|
import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
4
|
import { VfPositioned as i } from "../position.js";
|
|
5
5
|
import { vfBase as a } from "../styles/recipes/host.js";
|
|
6
|
-
import { tileImage as o, tileRects as s, tileSpan as c
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { GridSnapController as
|
|
11
|
-
import { VfShadowRoleControl as
|
|
12
|
-
import { css as
|
|
13
|
-
import { property as
|
|
14
|
-
import { styleMap as
|
|
6
|
+
import { tileImage as o, tileRects as s, tileSpan as c } from "../styles/recipes/tile.js";
|
|
7
|
+
import { RepeatTileController as l, patternOverride as u, tileGrid as d, vfRepeatTileSize as f, vfTileGrid as p } from "../tile-grid.js";
|
|
8
|
+
import { vfStrokeDecls as m, vfStrokeInset as h } from "../styles/recipes/stroke.js";
|
|
9
|
+
import { vfFocusUnderline as g } from "../styles/recipes/focus.js";
|
|
10
|
+
import { GridSnapController as _ } from "../grid-snap.js";
|
|
11
|
+
import { VfShadowRoleControl as v } from "../form-control.js";
|
|
12
|
+
import { css as y, html as b, unsafeCSS as x } from "lit";
|
|
13
|
+
import { property as S } from "lit/decorators.js";
|
|
14
|
+
import { styleMap as C } from "lit/directives/style-map.js";
|
|
15
15
|
//#region src/components/vf-swatch.ts
|
|
16
|
-
var
|
|
16
|
+
var w = [
|
|
17
17
|
[
|
|
18
18
|
0,
|
|
19
19
|
0,
|
|
@@ -35,33 +35,37 @@ var C = 4, w = [
|
|
|
35
35
|
2,
|
|
36
36
|
"#c0c0c0"
|
|
37
37
|
]
|
|
38
|
-
], T =
|
|
38
|
+
], T = {
|
|
39
|
+
width: 4,
|
|
40
|
+
height: 4,
|
|
41
|
+
rects: w
|
|
42
|
+
}, E = o(T.width, T.height, s(w)), D = c(T.width), O = class extends i(v) {
|
|
39
43
|
constructor(...e) {
|
|
40
|
-
super(...e), this.width = 24, this.height = 18, this.shadow = !1, this.label = "", this.disabled = !1, this.scale = new t(this), this.gridSnap = new
|
|
44
|
+
super(...e), this.width = 24, this.height = 18, this.shadow = !1, this.label = "", this.disabled = !1, this.scale = new t(this), this.gridSnap = new _(this), this._pattern = "", this.#e = new l(this, {
|
|
45
|
+
getBox: () => this.renderRoot?.querySelector(".fill"),
|
|
46
|
+
getArt: () => this._pattern ? null : T,
|
|
47
|
+
property: "--_vf-checker-tile"
|
|
48
|
+
});
|
|
41
49
|
}
|
|
42
50
|
static {
|
|
43
51
|
this.shadowRootOptions = {
|
|
44
|
-
...
|
|
52
|
+
...v.shadowRootOptions,
|
|
45
53
|
delegatesFocus: !0
|
|
46
54
|
};
|
|
47
55
|
}
|
|
48
56
|
static {
|
|
49
57
|
this.styles = [
|
|
50
58
|
a,
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
p,
|
|
60
|
+
y`
|
|
53
61
|
:host {
|
|
54
62
|
display: inline-flex;
|
|
55
63
|
cursor: var(--vf-cursor, default);
|
|
56
|
-
/* The
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
the whole-surface raster for the kit checker, or the placed tile
|
|
62
|
-
grid at the token's documented 60-px tile geometry for a consumer
|
|
63
|
-
override. */
|
|
64
|
-
--_checker: var(--vf-swatch-checker, ${b(T)});
|
|
64
|
+
/* The consumer's checker token, as the art channel of the placed
|
|
65
|
+
tile grid .fill renders for it at the token's documented 60-px
|
|
66
|
+
tile geometry (src/tile-grid.ts). The kit checker is .fill's own
|
|
67
|
+
repeating tile instead. */
|
|
68
|
+
--_checker: var(--vf-swatch-checker, ${x(E)});
|
|
65
69
|
/* How deep a shadow this swatch actually casts — nothing unless the
|
|
66
70
|
shadow attribute is set. Resolved here once so the focus rule below
|
|
67
71
|
can compose the real depth rather than assume one, and so a consumer
|
|
@@ -71,24 +75,24 @@ var C = 4, w = [
|
|
|
71
75
|
:host([shadow]) {
|
|
72
76
|
--_shadow-depth: var(--vf-shadow-offset, 2px);
|
|
73
77
|
}
|
|
74
|
-
/* The 1px black frame, and — as the button's own background
|
|
75
|
-
through its 1px padding
|
|
78
|
+
/* The 1px black frame, a stroke, and — as the button's own background
|
|
79
|
+
showing through its 1px padding inside the stroke — the white inset
|
|
80
|
+
ring around the fill. After the stroke, the opt-in depth: the kit's
|
|
81
|
+
one hard shadow, painted outside the border box like every raised
|
|
82
|
+
surface's, and nothing at depth 0. */
|
|
76
83
|
button {
|
|
77
84
|
display: block;
|
|
78
85
|
/* Also the anchor the focus rule below hangs from. */
|
|
79
86
|
position: relative;
|
|
80
|
-
padding: calc(var(--vf-scale, 1) * 1px);
|
|
81
87
|
margin: 0;
|
|
82
88
|
background: var(--vf-white, #fff);
|
|
83
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
84
89
|
cursor: inherit;
|
|
85
90
|
-webkit-appearance: none;
|
|
86
91
|
appearance: none;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
${u}
|
|
92
|
+
${m({
|
|
93
|
+
padding: 1,
|
|
94
|
+
shadows: "calc(var(--vf-scale, 1) * var(--_shadow-depth)) calc(var(--vf-scale, 1) * var(--_shadow-depth)) 0 0 var(--vf-black, #000)"
|
|
95
|
+
})}
|
|
92
96
|
}
|
|
93
97
|
/* Pressed: the white inset inverts to black — instant 1-bit feedback. */
|
|
94
98
|
button:active:not(:disabled) {
|
|
@@ -101,48 +105,48 @@ var C = 4, w = [
|
|
|
101
105
|
to show, and a rule drawn over the fill would read as part of it.
|
|
102
106
|
|
|
103
107
|
The offset counts every row of ink below the pseudo-element's padding
|
|
104
|
-
box
|
|
105
|
-
whatever shadow this swatch is casting — none by
|
|
106
|
-
token under the shadow attribute — so it
|
|
107
|
-
rather than assuming a depth. The
|
|
108
|
-
same
|
|
109
|
-
|
|
108
|
+
box, which runs under the frame's stroke, before the blank row and
|
|
109
|
+
the rule itself — whatever shadow this swatch is casting — none by
|
|
110
|
+
default, a rethemeable token under the shadow attribute — so it
|
|
111
|
+
composes --_shadow-depth rather than assuming a depth. The rule spans
|
|
112
|
+
that same box, the shape the swatch reads as (the shadow is a depth
|
|
113
|
+
cue, not part of the silhouette). Under forced colors the stroke is a
|
|
114
|
+
border and the padding box sits inside it, so the insets grow by it
|
|
115
|
+
there. */
|
|
110
116
|
button:focus-visible {
|
|
111
117
|
outline: none;
|
|
112
118
|
}
|
|
113
119
|
button:focus-visible::after {
|
|
114
|
-
|
|
115
|
-
${
|
|
116
|
-
left:
|
|
117
|
-
right:
|
|
120
|
+
${g}
|
|
121
|
+
bottom: ${h("(-3px - var(--_shadow-depth))")};
|
|
122
|
+
left: ${h(-1)};
|
|
123
|
+
right: ${h(-1)};
|
|
118
124
|
}
|
|
119
125
|
.fill {
|
|
120
126
|
display: block;
|
|
121
|
-
/* The containing block for the
|
|
127
|
+
/* The containing block for the token's tile grid and the tint. */
|
|
122
128
|
position: relative;
|
|
123
129
|
width: 100%;
|
|
124
130
|
height: 100%;
|
|
125
|
-
/* The
|
|
126
|
-
|
|
127
|
-
background-image: var(--
|
|
128
|
-
${
|
|
131
|
+
/* The kit checker: the repeating tile the swatch writes
|
|
132
|
+
(src/tile-grid.ts). */
|
|
133
|
+
background-image: var(--_vf-checker-tile, none);
|
|
134
|
+
${f}
|
|
135
|
+
image-rendering: pixelated;
|
|
129
136
|
/* Forced colors would delete the color layer and keep the checker,
|
|
130
137
|
showing "transparent" for every color. The fill is CONTENT, not
|
|
131
138
|
chrome — the color is the one thing the control exists to show,
|
|
132
139
|
the case forced-color-adjust's own spec exempts (its example is a
|
|
133
|
-
color picker). It inherits to the
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
color picker). It inherits to the tiles and tint. Frame, inset
|
|
141
|
+
and press feedback stay on the forced palette like every other
|
|
142
|
+
control's. */
|
|
136
143
|
@media (forced-colors: active) {
|
|
137
144
|
forced-color-adjust: none;
|
|
138
145
|
}
|
|
139
146
|
}
|
|
140
|
-
/* A consumer checker token switches the fill to the placed tile grid
|
|
141
|
-
|
|
142
|
-
would show the underlay's drifting copy of itself. The grid's tiles
|
|
143
|
-
resolve the token through the shared private property. */
|
|
147
|
+
/* A consumer checker token switches the fill to the placed tile grid,
|
|
148
|
+
whose tiles resolve the token through the shared private property. */
|
|
144
149
|
.fill.patterned {
|
|
145
|
-
background-image: none;
|
|
146
150
|
--_vf-tile-image: var(--_checker);
|
|
147
151
|
}
|
|
148
152
|
/* The color, painted over the checker so a translucent value reads as
|
|
@@ -156,21 +160,18 @@ var C = 4, w = [
|
|
|
156
160
|
}
|
|
157
161
|
#e;
|
|
158
162
|
willUpdate(e) {
|
|
159
|
-
super.willUpdate(e), this._pattern =
|
|
163
|
+
super.willUpdate(e), this._pattern = u(this, "--vf-swatch-checker");
|
|
160
164
|
}
|
|
161
165
|
render() {
|
|
162
|
-
let e = Math.max(1, (this.width ?? 24) - 4), t = Math.max(1, (this.height ?? 18) - 4), r =
|
|
163
|
-
cols: Math.ceil(e /
|
|
164
|
-
rows: Math.ceil(t /
|
|
165
|
-
tile:
|
|
166
|
-
}) :
|
|
167
|
-
class="vf-tile-raster"
|
|
168
|
-
style="width:${n(r(e))};height:${n(r(t))};background-image:${this.#e.for(C, C, w, r(e), r(t))}"
|
|
169
|
-
></span>`, a = this.color ? y`<span
|
|
166
|
+
let e = Math.max(1, (this.width ?? 24) - 4), t = Math.max(1, (this.height ?? 18) - 4), r = this._pattern ? d({
|
|
167
|
+
cols: Math.ceil(e / D),
|
|
168
|
+
rows: Math.ceil(t / D),
|
|
169
|
+
tile: D
|
|
170
|
+
}) : null, i = this.color ? b`<span
|
|
170
171
|
class="tint"
|
|
171
|
-
style=${
|
|
172
|
+
style=${C({ "background-color": this.color })}
|
|
172
173
|
></span>` : null;
|
|
173
|
-
return
|
|
174
|
+
return b`
|
|
174
175
|
<button
|
|
175
176
|
part="button"
|
|
176
177
|
class="vf-snap"
|
|
@@ -183,19 +184,19 @@ var C = 4, w = [
|
|
|
183
184
|
<span
|
|
184
185
|
class="fill vf-tile-grid${this._pattern ? " patterned" : ""}"
|
|
185
186
|
part="fill"
|
|
186
|
-
>${
|
|
187
|
+
>${r}${i}</span
|
|
187
188
|
>
|
|
188
189
|
</button>
|
|
189
190
|
${this.renderDescription()}
|
|
190
191
|
`;
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
|
-
r([
|
|
194
|
+
r([S()], O.prototype, "color", void 0), r([S({ type: Number })], O.prototype, "width", void 0), r([S({ type: Number })], O.prototype, "height", void 0), r([S({
|
|
194
195
|
type: Boolean,
|
|
195
196
|
reflect: !0
|
|
196
|
-
})],
|
|
197
|
+
})], O.prototype, "shadow", void 0), r([S()], O.prototype, "label", void 0), r([S({
|
|
197
198
|
type: Boolean,
|
|
198
199
|
reflect: !0
|
|
199
|
-
})],
|
|
200
|
+
})], O.prototype, "disabled", void 0), O = r([e("vf-swatch")], O);
|
|
200
201
|
//#endregion
|
|
201
|
-
export {
|
|
202
|
+
export { O as VfSwatch };
|
|
@@ -2,25 +2,26 @@ import { vfElement as e } from "../define.js";
|
|
|
2
2
|
import t from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
3
3
|
import { VfPositioned as n } from "../position.js";
|
|
4
4
|
import { vfBase as r } from "../styles/recipes/host.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
5
|
+
import { vfStrokeDecls as i, vfStrokeInset as a } from "../styles/recipes/stroke.js";
|
|
6
|
+
import { vfField as o } from "../styles/recipes/field.js";
|
|
7
|
+
import { vfScrollRail as s } from "../styles/recipes/scroll-rail.js";
|
|
8
|
+
import { ScrollStateController as c } from "../scroll-state.js";
|
|
9
|
+
import { ScrollRailController as l, renderScrollRail as u } from "../scroll-rail.js";
|
|
10
|
+
import { VfTextControlBase as d } from "../text-control.js";
|
|
11
|
+
import { css as f, html as p, nothing as m } from "lit";
|
|
12
|
+
import { property as h, query as g } from "lit/decorators.js";
|
|
13
|
+
import { live as _ } from "lit/directives/live.js";
|
|
13
14
|
//#region src/components/vf-text-area.ts
|
|
14
|
-
var
|
|
15
|
+
var v = class extends n(d) {
|
|
15
16
|
constructor(...e) {
|
|
16
|
-
super(...e), this.rows = 4, this.scrollState = new
|
|
17
|
+
super(...e), this.rows = 4, this.scrollState = new c(this, () => this.textarea), this.rail = new l(this, { getScroll: () => this.textarea });
|
|
17
18
|
}
|
|
18
19
|
static {
|
|
19
20
|
this.styles = [
|
|
20
21
|
r,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
o,
|
|
23
|
+
s,
|
|
24
|
+
f`
|
|
24
25
|
:host {
|
|
25
26
|
display: inline-block;
|
|
26
27
|
/* A sensible default width (authored system px, scaled) so a bare field
|
|
@@ -34,31 +35,32 @@ var g = class extends n(l) {
|
|
|
34
35
|
out [textarea | rail] — the rail sizes itself to the 15px inside the
|
|
35
36
|
frame. */
|
|
36
37
|
.vf-field-well {
|
|
37
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
38
38
|
background: var(--vf-white, #fff);
|
|
39
39
|
display: grid;
|
|
40
40
|
grid-template-columns: 1fr auto;
|
|
41
|
+
${i()}
|
|
41
42
|
}
|
|
42
|
-
/* The focus rule anchors to the well's
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
/* The focus rule anchors to the well's padding box, which runs under
|
|
44
|
+
the frame's stroke: the same −2 as the borderless single-line well
|
|
45
|
+
puts the rule one blank row under the frame, edge to edge. Under
|
|
46
|
+
forced colors the frame is a border again and the padding box sits
|
|
47
|
+
inside it, so the offsets grow by it there. */
|
|
47
48
|
.vf-field-well.vf-focus-rule::after {
|
|
48
|
-
|
|
49
|
-
left:
|
|
50
|
-
right:
|
|
49
|
+
bottom: ${a(-3)};
|
|
50
|
+
left: ${a(-1)};
|
|
51
|
+
right: ${a(-1)};
|
|
51
52
|
}
|
|
52
|
-
/* textarea.vf-field so the
|
|
53
|
-
|
|
53
|
+
/* textarea.vf-field so the overrides out-rank the vf-field skin's own
|
|
54
|
+
stroke (a bare element selector would lose to the class). */
|
|
54
55
|
textarea.vf-field {
|
|
55
56
|
display: block;
|
|
56
57
|
width: 100%;
|
|
57
58
|
min-width: 0;
|
|
58
|
-
/*
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
/* No frame of its own — the frame is the well's (above). The 3px/6px
|
|
60
|
+
padding inside it holds the text exactly where the framed field
|
|
61
|
+
puts it, 4px/7px from the frame box. */
|
|
61
62
|
border: 0;
|
|
63
|
+
box-shadow: none;
|
|
62
64
|
padding: calc(var(--vf-scale, 1) * 3px) calc(var(--vf-scale, 1) * 6px);
|
|
63
65
|
/* Wrapped entry copy on the display face's native line (editable
|
|
64
66
|
text is display type) — the same face token the static-text
|
|
@@ -78,30 +80,30 @@ var g = class extends n(l) {
|
|
|
78
80
|
];
|
|
79
81
|
}
|
|
80
82
|
render() {
|
|
81
|
-
return
|
|
83
|
+
return p`
|
|
82
84
|
<div class=${this.wellClass}>
|
|
83
85
|
<textarea
|
|
84
86
|
part="textarea"
|
|
85
87
|
class="vf-field vf-scroll"
|
|
86
88
|
rows=${this.rows}
|
|
87
|
-
aria-label=${this.label || this.hostLabel ||
|
|
89
|
+
aria-label=${this.label || this.hostLabel || m}
|
|
88
90
|
aria-describedby=${this.describedBy}
|
|
89
|
-
aria-required=${this.required ? "true" :
|
|
90
|
-
aria-invalid=${this.validity.valid ?
|
|
91
|
+
aria-required=${this.required ? "true" : m}
|
|
92
|
+
aria-invalid=${this.validity.valid ? m : "true"}
|
|
91
93
|
autocomplete=${this.forwardedAttr("autocomplete")}
|
|
92
94
|
inputmode=${this.forwardedAttr("inputmode")}
|
|
93
95
|
enterkeyhint=${this.forwardedAttr("enterkeyhint")}
|
|
94
96
|
maxlength=${this.forwardedAttr("maxlength")}
|
|
95
97
|
spellcheck=${this.forwardedAttr("spellcheck")}
|
|
96
98
|
autocapitalize=${this.forwardedAttr("autocapitalize")}
|
|
97
|
-
.value=${
|
|
99
|
+
.value=${_(this.value)}
|
|
98
100
|
placeholder=${this.placeholder}
|
|
99
101
|
?disabled=${this.isDisabled}
|
|
100
102
|
?readonly=${this.readonly}
|
|
101
103
|
@input=${this.handleInput}
|
|
102
104
|
@change=${this.handleChange}
|
|
103
105
|
></textarea>
|
|
104
|
-
${
|
|
106
|
+
${u(this.rail, "vertical")}
|
|
105
107
|
</div>
|
|
106
108
|
${this.renderDescription()}
|
|
107
109
|
`;
|
|
@@ -110,6 +112,6 @@ var g = class extends n(l) {
|
|
|
110
112
|
super.handleInput(e), this.scrollState.measure(), this.rail.sync();
|
|
111
113
|
}
|
|
112
114
|
};
|
|
113
|
-
t([
|
|
115
|
+
t([h({ type: Number })], v.prototype, "rows", void 0), t([g("textarea")], v.prototype, "textarea", void 0), v = t([e("vf-text-area")], v);
|
|
114
116
|
//#endregion
|
|
115
|
-
export {
|
|
117
|
+
export { v as VfTextArea };
|
|
@@ -2,21 +2,22 @@ import { vfElement as e } from "../define.js";
|
|
|
2
2
|
import t from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
3
3
|
import { VfPositioned as n } from "../position.js";
|
|
4
4
|
import { vfBase as r } from "../styles/recipes/host.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { vfStrokeInset as i } from "../styles/recipes/stroke.js";
|
|
6
|
+
import { vfField as a } from "../styles/recipes/field.js";
|
|
7
|
+
import { VfTextControlBase as o } from "../text-control.js";
|
|
8
|
+
import { css as s, html as c, nothing as l } from "lit";
|
|
9
|
+
import { property as u } from "lit/decorators.js";
|
|
10
|
+
import { live as d } from "lit/directives/live.js";
|
|
10
11
|
//#region src/components/vf-text-field.ts
|
|
11
|
-
var
|
|
12
|
+
var f = class extends n(o) {
|
|
12
13
|
constructor(...e) {
|
|
13
14
|
super(...e), this.type = "text";
|
|
14
15
|
}
|
|
15
16
|
static {
|
|
16
17
|
this.styles = [
|
|
17
18
|
r,
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
a,
|
|
20
|
+
s`
|
|
20
21
|
:host {
|
|
21
22
|
display: inline-block;
|
|
22
23
|
/* A sensible default width (authored system px, scaled) so a bare field
|
|
@@ -24,7 +25,7 @@ var d = class extends n(a) {
|
|
|
24
25
|
on the host or the --vf-field-width token. */
|
|
25
26
|
width: calc(var(--vf-scale, 1) * var(--vf-field-width, 180px));
|
|
26
27
|
}
|
|
27
|
-
input {
|
|
28
|
+
input.vf-field {
|
|
28
29
|
display: block;
|
|
29
30
|
width: 100%;
|
|
30
31
|
/* min-, not height: the default line box exactly fills the 22px well,
|
|
@@ -32,28 +33,29 @@ var d = class extends n(a) {
|
|
|
32
33
|
WCAG 1.4.12 text-spacing condition) grows the well instead of
|
|
33
34
|
clipping the text inside a pinned one. */
|
|
34
35
|
min-height: calc(var(--vf-scale, 1) * var(--vf-control-height, 22px));
|
|
35
|
-
|
|
36
|
+
/* The 6px text inset, inside the well's stroke (vfField). */
|
|
37
|
+
padding: ${i(0)} ${i(6)};
|
|
36
38
|
}
|
|
37
39
|
`
|
|
38
40
|
];
|
|
39
41
|
}
|
|
40
42
|
static {
|
|
41
|
-
this.forwardedAttributes = [...
|
|
43
|
+
this.forwardedAttributes = [...o.forwardedAttributes, "pattern"];
|
|
42
44
|
}
|
|
43
45
|
handleKeydown(e) {
|
|
44
46
|
this.isSubmitEnter(e) && this.requestImplicitSubmit() && e.preventDefault();
|
|
45
47
|
}
|
|
46
48
|
render() {
|
|
47
|
-
return
|
|
49
|
+
return c`
|
|
48
50
|
<div class=${this.wellClass}>
|
|
49
51
|
<input
|
|
50
52
|
part="input"
|
|
51
53
|
class="vf-field"
|
|
52
54
|
type=${this.type}
|
|
53
|
-
aria-label=${this.label || this.hostLabel ||
|
|
55
|
+
aria-label=${this.label || this.hostLabel || l}
|
|
54
56
|
aria-describedby=${this.describedBy}
|
|
55
|
-
aria-required=${this.required ? "true" :
|
|
56
|
-
aria-invalid=${this.validity.valid ?
|
|
57
|
+
aria-required=${this.required ? "true" : l}
|
|
58
|
+
aria-invalid=${this.validity.valid ? l : "true"}
|
|
57
59
|
autocomplete=${this.forwardedAttr("autocomplete")}
|
|
58
60
|
inputmode=${this.forwardedAttr("inputmode")}
|
|
59
61
|
enterkeyhint=${this.forwardedAttr("enterkeyhint")}
|
|
@@ -61,7 +63,7 @@ var d = class extends n(a) {
|
|
|
61
63
|
pattern=${this.forwardedAttr("pattern")}
|
|
62
64
|
spellcheck=${this.forwardedAttr("spellcheck")}
|
|
63
65
|
autocapitalize=${this.forwardedAttr("autocapitalize")}
|
|
64
|
-
.value=${
|
|
66
|
+
.value=${d(this.value)}
|
|
65
67
|
placeholder=${this.placeholder}
|
|
66
68
|
?disabled=${this.isDisabled}
|
|
67
69
|
?readonly=${this.readonly}
|
|
@@ -74,6 +76,6 @@ var d = class extends n(a) {
|
|
|
74
76
|
`;
|
|
75
77
|
}
|
|
76
78
|
};
|
|
77
|
-
t([
|
|
79
|
+
t([u()], f.prototype, "type", void 0), f = t([e("vf-text-field")], f);
|
|
78
80
|
//#endregion
|
|
79
|
-
export {
|
|
81
|
+
export { f as VfTextField };
|
|
@@ -227,20 +227,17 @@ export declare class VfWindow extends VfWindow_base {
|
|
|
227
227
|
private readonly titleCenter;
|
|
228
228
|
/**
|
|
229
229
|
* The consumer's `--vf-dots-pattern` override, or `''` for the kit dots —
|
|
230
|
-
* which
|
|
231
|
-
*
|
|
230
|
+
* which path the utility bar takes (src/tile-grid.ts). Re-read every
|
|
231
|
+
* update; a runtime token swap wants a `requestUpdate()`.
|
|
232
232
|
*/
|
|
233
233
|
private _dotsPattern;
|
|
234
234
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
236
|
+
* A consumer `--vf-dots-pattern`'s placed tile grid, rendered into the
|
|
237
|
+
* utility bar's `.vf-dots` layer at the token's documented 30-px geometry
|
|
237
238
|
* (src/tile-grid.ts): the bar interior is the declared width minus the
|
|
238
|
-
* frame borders.
|
|
239
|
-
*
|
|
240
|
-
* boundary — the layer's clip crops the overdraw; a consumer
|
|
241
|
-
* `--vf-dots-pattern` renders the placed tile grid at the token's
|
|
242
|
-
* documented 30-px geometry instead. A window with no declared width
|
|
243
|
-
* renders neither and the layer keeps its CSS-repeated tile.
|
|
239
|
+
* frame borders. A window with no declared width renders none, and the
|
|
240
|
+
* layer repeats the token in CSS instead (`vf-dots-token`).
|
|
244
241
|
*/
|
|
245
242
|
private _dotsTexture;
|
|
246
243
|
/**
|