vintage-frames 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +8 -8
- package/dist/components/vf-checkbox.d.ts +6 -5
- package/dist/components/vf-checkbox.js +41 -37
- package/dist/components/vf-container.d.ts +11 -13
- package/dist/components/vf-container.js +24 -12
- 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.js +28 -29
- 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-swatch.js +47 -45
- package/dist/components/vf-text-area.js +37 -35
- package/dist/components/vf-text-field.js +20 -18
- package/dist/components/vf-window.js +92 -72
- package/dist/index.d.ts +10 -1
- package/dist/index.js +60 -59
- 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/rule.d.ts +11 -8
- package/dist/styles/recipes/rule.js +31 -13
- package/dist/styles/recipes/scroll-rail.d.ts +7 -6
- package/dist/styles/recipes/scroll-rail.js +18 -18
- 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/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/zoom.d.ts +9 -9
- package/docs/SPEC.md +23 -22
- package/editor/vscode.html-custom-data.json +4 -4
- package/editor/web-types.json +7 -7
- package/package.json +1 -1
|
@@ -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,15 +5,15 @@ import { VfPositioned as i } from "../position.js";
|
|
|
5
5
|
import { vfBase as a } from "../styles/recipes/host.js";
|
|
6
6
|
import { tileImage as o, tileRects as s, tileSpan as c } from "../styles/recipes/tile.js";
|
|
7
7
|
import { RepeatTileController as l, patternOverride as u, tileGrid as d, vfRepeatTileSize as f, vfTileGrid as p } from "../tile-grid.js";
|
|
8
|
-
import {
|
|
9
|
-
import { vfFocusUnderline as
|
|
10
|
-
import { GridSnapController as
|
|
11
|
-
import { VfShadowRoleControl as
|
|
12
|
-
import { css as
|
|
13
|
-
import { property as
|
|
14
|
-
import { styleMap as
|
|
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,21 +35,21 @@ var C = [
|
|
|
35
35
|
2,
|
|
36
36
|
"#c0c0c0"
|
|
37
37
|
]
|
|
38
|
-
],
|
|
38
|
+
], T = {
|
|
39
39
|
width: 4,
|
|
40
40
|
height: 4,
|
|
41
|
-
rects:
|
|
42
|
-
},
|
|
41
|
+
rects: w
|
|
42
|
+
}, E = o(T.width, T.height, s(w)), D = c(T.width), O = class extends i(v) {
|
|
43
43
|
constructor(...e) {
|
|
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
|
|
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
45
|
getBox: () => this.renderRoot?.querySelector(".fill"),
|
|
46
|
-
getArt: () => this._pattern ? null :
|
|
46
|
+
getArt: () => this._pattern ? null : T,
|
|
47
47
|
property: "--_vf-checker-tile"
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
static {
|
|
51
51
|
this.shadowRootOptions = {
|
|
52
|
-
...
|
|
52
|
+
...v.shadowRootOptions,
|
|
53
53
|
delegatesFocus: !0
|
|
54
54
|
};
|
|
55
55
|
}
|
|
@@ -57,7 +57,7 @@ var C = [
|
|
|
57
57
|
this.styles = [
|
|
58
58
|
a,
|
|
59
59
|
p,
|
|
60
|
-
|
|
60
|
+
y`
|
|
61
61
|
:host {
|
|
62
62
|
display: inline-flex;
|
|
63
63
|
cursor: var(--vf-cursor, default);
|
|
@@ -65,7 +65,7 @@ var C = [
|
|
|
65
65
|
tile grid .fill renders for it at the token's documented 60-px
|
|
66
66
|
tile geometry (src/tile-grid.ts). The kit checker is .fill's own
|
|
67
67
|
repeating tile instead. */
|
|
68
|
-
--_checker: var(--vf-swatch-checker, ${
|
|
68
|
+
--_checker: var(--vf-swatch-checker, ${x(E)});
|
|
69
69
|
/* How deep a shadow this swatch actually casts — nothing unless the
|
|
70
70
|
shadow attribute is set. Resolved here once so the focus rule below
|
|
71
71
|
can compose the real depth rather than assume one, and so a consumer
|
|
@@ -75,24 +75,24 @@ var C = [
|
|
|
75
75
|
:host([shadow]) {
|
|
76
76
|
--_shadow-depth: var(--vf-shadow-offset, 2px);
|
|
77
77
|
}
|
|
78
|
-
/* The 1px black frame, and — as the button's own background
|
|
79
|
-
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. */
|
|
80
83
|
button {
|
|
81
84
|
display: block;
|
|
82
85
|
/* Also the anchor the focus rule below hangs from. */
|
|
83
86
|
position: relative;
|
|
84
|
-
padding: calc(var(--vf-scale, 1) * 1px);
|
|
85
87
|
margin: 0;
|
|
86
88
|
background: var(--vf-white, #fff);
|
|
87
|
-
border: calc(var(--vf-scale, 1) * 1px) solid var(--vf-black, #000);
|
|
88
89
|
cursor: inherit;
|
|
89
90
|
-webkit-appearance: none;
|
|
90
91
|
appearance: none;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
${m}
|
|
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
|
+
})}
|
|
96
96
|
}
|
|
97
97
|
/* Pressed: the white inset inverts to black — instant 1-bit feedback. */
|
|
98
98
|
button:active:not(:disabled) {
|
|
@@ -105,20 +105,22 @@ var C = [
|
|
|
105
105
|
to show, and a rule drawn over the fill would read as part of it.
|
|
106
106
|
|
|
107
107
|
The offset counts every row of ink below the pseudo-element's padding
|
|
108
|
-
box
|
|
109
|
-
whatever shadow this swatch is casting — none by
|
|
110
|
-
token under the shadow attribute — so it
|
|
111
|
-
rather than assuming a depth. The
|
|
112
|
-
same
|
|
113
|
-
|
|
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. */
|
|
114
116
|
button:focus-visible {
|
|
115
117
|
outline: none;
|
|
116
118
|
}
|
|
117
119
|
button:focus-visible::after {
|
|
118
|
-
|
|
119
|
-
${h}
|
|
120
|
-
left:
|
|
121
|
-
right:
|
|
120
|
+
${g}
|
|
121
|
+
bottom: ${h("(-3px - var(--_shadow-depth))")};
|
|
122
|
+
left: ${h(-1)};
|
|
123
|
+
right: ${h(-1)};
|
|
122
124
|
}
|
|
123
125
|
.fill {
|
|
124
126
|
display: block;
|
|
@@ -162,14 +164,14 @@ var C = [
|
|
|
162
164
|
}
|
|
163
165
|
render() {
|
|
164
166
|
let e = Math.max(1, (this.width ?? 24) - 4), t = Math.max(1, (this.height ?? 18) - 4), r = this._pattern ? d({
|
|
165
|
-
cols: Math.ceil(e /
|
|
166
|
-
rows: Math.ceil(t /
|
|
167
|
-
tile:
|
|
168
|
-
}) : null, i = this.color ?
|
|
167
|
+
cols: Math.ceil(e / D),
|
|
168
|
+
rows: Math.ceil(t / D),
|
|
169
|
+
tile: D
|
|
170
|
+
}) : null, i = this.color ? b`<span
|
|
169
171
|
class="tint"
|
|
170
|
-
style=${
|
|
172
|
+
style=${C({ "background-color": this.color })}
|
|
171
173
|
></span>` : null;
|
|
172
|
-
return
|
|
174
|
+
return b`
|
|
173
175
|
<button
|
|
174
176
|
part="button"
|
|
175
177
|
class="vf-snap"
|
|
@@ -189,12 +191,12 @@ var C = [
|
|
|
189
191
|
`;
|
|
190
192
|
}
|
|
191
193
|
};
|
|
192
|
-
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({
|
|
193
195
|
type: Boolean,
|
|
194
196
|
reflect: !0
|
|
195
|
-
})],
|
|
197
|
+
})], O.prototype, "shadow", void 0), r([S()], O.prototype, "label", void 0), r([S({
|
|
196
198
|
type: Boolean,
|
|
197
199
|
reflect: !0
|
|
198
|
-
})],
|
|
200
|
+
})], O.prototype, "disabled", void 0), O = r([e("vf-swatch")], O);
|
|
199
201
|
//#endregion
|
|
200
|
-
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 };
|