@f-ewald/components 1.22.2 → 1.23.1
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/README.md +4 -1
- package/custom-elements.json +760 -96
- package/dist/address-autocomplete.d.ts +14 -0
- package/dist/address-autocomplete.d.ts.map +1 -1
- package/dist/address-autocomplete.js +205 -3
- package/dist/address-autocomplete.js.map +1 -1
- package/dist/autocomplete-input.d.ts +14 -0
- package/dist/autocomplete-input.d.ts.map +1 -1
- package/dist/autocomplete-input.js +205 -3
- package/dist/autocomplete-input.js.map +1 -1
- package/dist/form-field.d.ts +29 -1
- package/dist/form-field.d.ts.map +1 -1
- package/dist/form-field.js +376 -4
- package/dist/form-field.js.map +1 -1
- package/dist/icons.d.ts +55 -0
- package/dist/icons.d.ts.map +1 -1
- package/dist/icons.js +55 -0
- package/dist/icons.js.map +1 -1
- package/dist/mcp-server.js +39 -0
- package/dist/mcp-server.js.map +1 -1
- package/dist/text-area.d.ts +9 -0
- package/dist/text-area.d.ts.map +1 -1
- package/dist/text-area.js +123 -11
- package/dist/text-area.js.map +1 -1
- package/dist/utils/form-field-control.d.ts +15 -0
- package/dist/utils/form-field-control.d.ts.map +1 -0
- package/dist/utils/form-field-control.js +7 -0
- package/dist/utils/form-field-control.js.map +1 -0
- package/docs/address-autocomplete.md +9 -0
- package/docs/autocomplete-input.md +9 -1
- package/docs/design-language.md +11 -0
- package/docs/form-field.md +18 -0
- package/docs/icons.md +70 -0
- package/docs/text-area.md +9 -1
- package/llms.txt +94 -11
- package/package.json +1 -1
package/dist/form-field.js
CHANGED
|
@@ -5,9 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { LitElement, css, html, nothing } from "lit";
|
|
8
|
-
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
import { customElement, property, queryAssignedElements, state, } from "lit/decorators.js";
|
|
9
9
|
import { tokens } from "./tokens.js";
|
|
10
|
+
import { formFieldControl, supportsFormFieldControl, } from "./utils/form-field-control.js";
|
|
10
11
|
let instanceCount = 0;
|
|
12
|
+
const NATIVE_TEXT_INPUT_TYPES = new Set([
|
|
13
|
+
"date",
|
|
14
|
+
"datetime-local",
|
|
15
|
+
"email",
|
|
16
|
+
"month",
|
|
17
|
+
"number",
|
|
18
|
+
"password",
|
|
19
|
+
"search",
|
|
20
|
+
"tel",
|
|
21
|
+
"text",
|
|
22
|
+
"time",
|
|
23
|
+
"url",
|
|
24
|
+
"week",
|
|
25
|
+
]);
|
|
11
26
|
/**
|
|
12
27
|
* Per-field wrapper for a form control: label, slotted control, and an
|
|
13
28
|
* optional hint or error message, in one consistent unit repeated across a
|
|
@@ -15,6 +30,11 @@ let instanceCount = 0;
|
|
|
15
30
|
* (`form-select`, `multi-select`, `autocomplete-input`, `ui-checkbox`, etc.)
|
|
16
31
|
* without intercepting its events or value.
|
|
17
32
|
*
|
|
33
|
+
* Set `floating-label` for supported text controls (`input`, `textarea`,
|
|
34
|
+
* `autocomplete-input`, `address-autocomplete`, and `text-area`). The label
|
|
35
|
+
* then rests inside an empty field and moves to a smaller top-left position
|
|
36
|
+
* while focused or non-empty. Other controls keep the external label.
|
|
37
|
+
*
|
|
18
38
|
* The label wraps the default slot for a best-effort visual/click
|
|
19
39
|
* association only: every existing value-entry control encapsulates its
|
|
20
40
|
* real `<input>` inside its own shadow DOM, so there is no light-DOM `id` a
|
|
@@ -38,7 +58,32 @@ let FormField = class FormField extends LitElement {
|
|
|
38
58
|
this.error = "";
|
|
39
59
|
/** Shows a required indicator next to the label. */
|
|
40
60
|
this.required = false;
|
|
61
|
+
/** Moves labels inside supported text controls until they receive focus or content. */
|
|
62
|
+
this.floatingLabel = false;
|
|
63
|
+
this._floatingKind = null;
|
|
64
|
+
this._nativeHasValue = false;
|
|
41
65
|
this.#messageId = `form-field-message-${++instanceCount}`;
|
|
66
|
+
this.#configuredControls = new Set();
|
|
67
|
+
this.#resetForm = null;
|
|
68
|
+
this.#placeholderControl = null;
|
|
69
|
+
this.#placeholder = "";
|
|
70
|
+
this.#accessibleNameControl = null;
|
|
71
|
+
this.#accessibleName = null;
|
|
72
|
+
this.#nativeEventControl = null;
|
|
73
|
+
this.#nativeFocused = false;
|
|
74
|
+
this.#onNativeValueChange = () => this._onControlValueChange();
|
|
75
|
+
this.#onNativeFocus = () => this._onControlFocusIn();
|
|
76
|
+
this.#onNativeBlur = () => this._onControlFocusOut();
|
|
77
|
+
this.#onNativeAnimation = (event) => {
|
|
78
|
+
if (event instanceof AnimationEvent)
|
|
79
|
+
this._onNativeAnimationStart(event);
|
|
80
|
+
};
|
|
81
|
+
this.#onFormReset = () => {
|
|
82
|
+
window.setTimeout(() => {
|
|
83
|
+
this.#updateNativeValue();
|
|
84
|
+
this.#syncNativePlaceholder();
|
|
85
|
+
});
|
|
86
|
+
};
|
|
42
87
|
}
|
|
43
88
|
static { this.styles = [
|
|
44
89
|
tokens,
|
|
@@ -75,6 +120,94 @@ let FormField = class FormField extends LitElement {
|
|
|
75
120
|
line-height: var(--ui-line-height-tight, 1.25);
|
|
76
121
|
color: var(--ui-text, #0f172a);
|
|
77
122
|
}
|
|
123
|
+
.control-label.floating-native {
|
|
124
|
+
position: relative;
|
|
125
|
+
display: block;
|
|
126
|
+
border-radius: var(--ui-radius-sm, 0.25rem);
|
|
127
|
+
background: var(--ui-surface, #ffffff);
|
|
128
|
+
box-shadow: inset 0 0 0 1px var(--ui-border, #e2e8f0);
|
|
129
|
+
}
|
|
130
|
+
.control-label.floating-native:focus-within {
|
|
131
|
+
box-shadow:
|
|
132
|
+
inset 0 0 0 1px var(--ui-primary, #4f46e5),
|
|
133
|
+
var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));
|
|
134
|
+
}
|
|
135
|
+
.control-label.floating-native .label-text {
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 50%;
|
|
138
|
+
left: 0.75rem;
|
|
139
|
+
right: 0.75rem;
|
|
140
|
+
z-index: 1;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
transform: translateY(-50%);
|
|
143
|
+
color: var(--ui-text-muted, #64748b);
|
|
144
|
+
font-weight: var(--ui-font-weight-regular, 400);
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
text-overflow: ellipsis;
|
|
147
|
+
cursor: text;
|
|
148
|
+
transition:
|
|
149
|
+
top 150ms ease,
|
|
150
|
+
transform 150ms ease,
|
|
151
|
+
font-size 150ms ease;
|
|
152
|
+
}
|
|
153
|
+
.control-label.floating-native.multiline .label-text {
|
|
154
|
+
top: 0.5rem;
|
|
155
|
+
transform: none;
|
|
156
|
+
}
|
|
157
|
+
.control-label.floating-native.has-value .label-text,
|
|
158
|
+
.control-label.floating-native:focus-within .label-text {
|
|
159
|
+
top: 0.25rem;
|
|
160
|
+
transform: none;
|
|
161
|
+
font-size: var(--ui-font-size-xs, 0.6875rem);
|
|
162
|
+
}
|
|
163
|
+
.control-label.floating-native ::slotted(input),
|
|
164
|
+
.control-label.floating-native ::slotted(textarea) {
|
|
165
|
+
display: block;
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
width: 100%;
|
|
168
|
+
min-height: 3rem;
|
|
169
|
+
margin: 0;
|
|
170
|
+
padding: 1.25rem 0.75rem 0.25rem;
|
|
171
|
+
border: 0;
|
|
172
|
+
border-radius: var(--ui-radius-sm, 0.25rem);
|
|
173
|
+
color: var(--ui-text, #0f172a);
|
|
174
|
+
background: transparent;
|
|
175
|
+
font-family: var(
|
|
176
|
+
--ui-font,
|
|
177
|
+
ui-sans-serif,
|
|
178
|
+
system-ui,
|
|
179
|
+
sans-serif,
|
|
180
|
+
"Apple Color Emoji",
|
|
181
|
+
"Segoe UI Emoji",
|
|
182
|
+
"Segoe UI Symbol",
|
|
183
|
+
"Noto Color Emoji"
|
|
184
|
+
);
|
|
185
|
+
font-size: var(--ui-font-size-sm, 0.75rem);
|
|
186
|
+
line-height: var(--ui-line-height-tight, 1.25);
|
|
187
|
+
}
|
|
188
|
+
.control-label.floating-native ::slotted(input) {
|
|
189
|
+
height: 3rem;
|
|
190
|
+
}
|
|
191
|
+
.control-label.floating-native ::slotted(textarea) {
|
|
192
|
+
padding-bottom: 0.5rem;
|
|
193
|
+
resize: vertical;
|
|
194
|
+
}
|
|
195
|
+
.control-label.floating-native ::slotted(input:focus-visible),
|
|
196
|
+
.control-label.floating-native ::slotted(textarea:focus-visible) {
|
|
197
|
+
outline: none;
|
|
198
|
+
}
|
|
199
|
+
.control-label.floating-native ::slotted(input:disabled),
|
|
200
|
+
.control-label.floating-native ::slotted(textarea:disabled) {
|
|
201
|
+
cursor: not-allowed;
|
|
202
|
+
opacity: 0.6;
|
|
203
|
+
}
|
|
204
|
+
.control-label.floating-native:has(:disabled) .label-text {
|
|
205
|
+
cursor: not-allowed;
|
|
206
|
+
opacity: 0.6;
|
|
207
|
+
}
|
|
208
|
+
.control-label.floating-native ::slotted(input:-webkit-autofill) {
|
|
209
|
+
animation: form-field-autofill 0.001s;
|
|
210
|
+
}
|
|
78
211
|
.required-mark {
|
|
79
212
|
color: var(--ui-danger, #dc2626);
|
|
80
213
|
}
|
|
@@ -98,15 +231,242 @@ let FormField = class FormField extends LitElement {
|
|
|
98
231
|
white-space: nowrap;
|
|
99
232
|
border: 0;
|
|
100
233
|
}
|
|
234
|
+
@media (prefers-reduced-motion: reduce) {
|
|
235
|
+
.control-label.floating-native .label-text {
|
|
236
|
+
transition: none;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
@keyframes form-field-autofill {
|
|
240
|
+
from {
|
|
241
|
+
opacity: 1;
|
|
242
|
+
}
|
|
243
|
+
to {
|
|
244
|
+
opacity: 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
@media (forced-colors: active) {
|
|
248
|
+
.control-label.floating-native {
|
|
249
|
+
border: 1px solid CanvasText;
|
|
250
|
+
box-shadow: none;
|
|
251
|
+
}
|
|
252
|
+
.control-label.floating-native:focus-within {
|
|
253
|
+
outline: 2px solid CanvasText;
|
|
254
|
+
outline-offset: 2px;
|
|
255
|
+
box-shadow: none;
|
|
256
|
+
}
|
|
257
|
+
.control-label.floating-native ::slotted(input:disabled),
|
|
258
|
+
.control-label.floating-native ::slotted(textarea:disabled),
|
|
259
|
+
.control-label.floating-native:has(:disabled) .label-text {
|
|
260
|
+
color: GrayText;
|
|
261
|
+
opacity: 1;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
101
264
|
`,
|
|
102
265
|
]; }
|
|
103
266
|
#messageId;
|
|
267
|
+
#configuredControls;
|
|
268
|
+
#resetForm;
|
|
269
|
+
#placeholderControl;
|
|
270
|
+
#placeholder;
|
|
271
|
+
#accessibleNameControl;
|
|
272
|
+
#accessibleName;
|
|
273
|
+
#nativeEventControl;
|
|
274
|
+
#nativeFocused;
|
|
275
|
+
#onNativeValueChange;
|
|
276
|
+
#onNativeFocus;
|
|
277
|
+
#onNativeBlur;
|
|
278
|
+
#onNativeAnimation;
|
|
279
|
+
#onFormReset;
|
|
280
|
+
/** Synchronizes label configuration after the component first renders. */
|
|
281
|
+
firstUpdated() {
|
|
282
|
+
this.#syncControls();
|
|
283
|
+
}
|
|
284
|
+
/** Resynchronizes delegated controls when public label configuration changes. */
|
|
285
|
+
updated(changed) {
|
|
286
|
+
if (changed.has("label") ||
|
|
287
|
+
changed.has("required") ||
|
|
288
|
+
changed.has("floatingLabel")) {
|
|
289
|
+
this.#syncControls();
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
/** Removes delegated configuration and form listeners when disconnected. */
|
|
293
|
+
disconnectedCallback() {
|
|
294
|
+
super.disconnectedCallback();
|
|
295
|
+
for (const control of this.#configuredControls)
|
|
296
|
+
control[formFieldControl](null);
|
|
297
|
+
this.#configuredControls.clear();
|
|
298
|
+
this.#bindNativePlaceholder(null);
|
|
299
|
+
this.#bindNativeAccessibleName(null);
|
|
300
|
+
this.#bindNativeEvents(null);
|
|
301
|
+
this.#bindResetForm(null);
|
|
302
|
+
}
|
|
303
|
+
/** Handles assigned-control changes and updates the floating-label strategy. */
|
|
304
|
+
_onSlotChange() {
|
|
305
|
+
this.#syncControls();
|
|
306
|
+
}
|
|
307
|
+
/** Tracks native input/textarea content after user edits. */
|
|
308
|
+
_onControlValueChange() {
|
|
309
|
+
if (this._floatingKind !== "native")
|
|
310
|
+
return;
|
|
311
|
+
this.#updateNativeValue();
|
|
312
|
+
this.#syncNativePlaceholder();
|
|
313
|
+
}
|
|
314
|
+
/** Reveals the native placeholder once focus floats the label. */
|
|
315
|
+
_onControlFocusIn() {
|
|
316
|
+
if (this._floatingKind !== "native")
|
|
317
|
+
return;
|
|
318
|
+
this.#nativeFocused = true;
|
|
319
|
+
this.#syncNativePlaceholder();
|
|
320
|
+
}
|
|
321
|
+
/** Hides the native placeholder again when an empty field loses focus. */
|
|
322
|
+
_onControlFocusOut() {
|
|
323
|
+
if (this._floatingKind !== "native")
|
|
324
|
+
return;
|
|
325
|
+
this.#nativeFocused = false;
|
|
326
|
+
this.#syncNativePlaceholder();
|
|
327
|
+
}
|
|
328
|
+
/** Focuses a native control when its shadow-rendered floating label is clicked. */
|
|
329
|
+
_onControlLabelClick(event) {
|
|
330
|
+
if (this._floatingKind !== "native")
|
|
331
|
+
return;
|
|
332
|
+
const control = this.#nativeControl();
|
|
333
|
+
if (!control || event.composedPath().includes(control))
|
|
334
|
+
return;
|
|
335
|
+
control.focus();
|
|
336
|
+
}
|
|
337
|
+
/** Synchronizes native value state when WebKit applies autofill without input events. */
|
|
338
|
+
_onNativeAnimationStart(event) {
|
|
339
|
+
if (this._floatingKind !== "native" ||
|
|
340
|
+
event.animationName !== "form-field-autofill") {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
this.#updateNativeValue();
|
|
344
|
+
this.#syncNativePlaceholder();
|
|
345
|
+
}
|
|
346
|
+
/** Finds the sole assigned native text control, if present. */
|
|
347
|
+
#nativeControl() {
|
|
348
|
+
if (this._assignedElements?.length !== 1)
|
|
349
|
+
return null;
|
|
350
|
+
const [element] = this._assignedElements;
|
|
351
|
+
if (element instanceof HTMLTextAreaElement)
|
|
352
|
+
return element;
|
|
353
|
+
if (!(element instanceof HTMLInputElement))
|
|
354
|
+
return null;
|
|
355
|
+
return NATIVE_TEXT_INPUT_TYPES.has(element.type) ? element : null;
|
|
356
|
+
}
|
|
357
|
+
/** Pushes current label configuration into a supported slotted control. */
|
|
358
|
+
#syncControls() {
|
|
359
|
+
const assigned = this._assignedElements ?? [];
|
|
360
|
+
const delegated = this.floatingLabel &&
|
|
361
|
+
Boolean(this.label) &&
|
|
362
|
+
assigned.length === 1 &&
|
|
363
|
+
supportsFormFieldControl(assigned[0])
|
|
364
|
+
? assigned[0]
|
|
365
|
+
: null;
|
|
366
|
+
const native = this.floatingLabel && Boolean(this.label) && !delegated
|
|
367
|
+
? this.#nativeControl()
|
|
368
|
+
: null;
|
|
369
|
+
const nextConfigured = new Set();
|
|
370
|
+
if (delegated) {
|
|
371
|
+
delegated[formFieldControl]({
|
|
372
|
+
label: this.label,
|
|
373
|
+
required: this.required,
|
|
374
|
+
floating: true,
|
|
375
|
+
});
|
|
376
|
+
nextConfigured.add(delegated);
|
|
377
|
+
}
|
|
378
|
+
for (const control of this.#configuredControls) {
|
|
379
|
+
if (!nextConfigured.has(control))
|
|
380
|
+
control[formFieldControl](null);
|
|
381
|
+
}
|
|
382
|
+
this.#configuredControls = nextConfigured;
|
|
383
|
+
this._floatingKind = delegated ? "delegated" : native ? "native" : null;
|
|
384
|
+
this.#updateNativeValue();
|
|
385
|
+
this.#bindNativePlaceholder(native);
|
|
386
|
+
this.#bindNativeAccessibleName(native);
|
|
387
|
+
this.#bindNativeEvents(native);
|
|
388
|
+
this.#bindResetForm(native?.form ?? null);
|
|
389
|
+
}
|
|
390
|
+
/** Updates whether a native control currently contains a value. */
|
|
391
|
+
#updateNativeValue() {
|
|
392
|
+
this._nativeHasValue = Boolean(this.#nativeControl()?.value);
|
|
393
|
+
}
|
|
394
|
+
/** Preserves the consumer placeholder while floating mode temporarily hides it. */
|
|
395
|
+
#bindNativePlaceholder(control) {
|
|
396
|
+
if (control === this.#placeholderControl) {
|
|
397
|
+
this.#syncNativePlaceholder();
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
if (this.#placeholderControl)
|
|
401
|
+
this.#placeholderControl.placeholder = this.#placeholder;
|
|
402
|
+
this.#placeholderControl = control;
|
|
403
|
+
this.#placeholder = control?.placeholder ?? "";
|
|
404
|
+
this.#nativeFocused = control === document.activeElement;
|
|
405
|
+
this.#syncNativePlaceholder();
|
|
406
|
+
}
|
|
407
|
+
/** Applies the correct placeholder for the native label's focus/value state. */
|
|
408
|
+
#syncNativePlaceholder() {
|
|
409
|
+
if (!this.#placeholderControl)
|
|
410
|
+
return;
|
|
411
|
+
this.#placeholderControl.placeholder =
|
|
412
|
+
this.#nativeFocused || this._nativeHasValue ? this.#placeholder : "";
|
|
413
|
+
}
|
|
414
|
+
/** Applies a shadow-boundary-safe accessible name and restores any prior value. */
|
|
415
|
+
#bindNativeAccessibleName(control) {
|
|
416
|
+
if (control !== this.#accessibleNameControl) {
|
|
417
|
+
if (this.#accessibleNameControl) {
|
|
418
|
+
if (this.#accessibleName == null) {
|
|
419
|
+
this.#accessibleNameControl.removeAttribute("aria-label");
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
this.#accessibleNameControl.setAttribute("aria-label", this.#accessibleName);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
this.#accessibleNameControl = control;
|
|
426
|
+
this.#accessibleName = control?.getAttribute("aria-label") ?? null;
|
|
427
|
+
}
|
|
428
|
+
if (!control)
|
|
429
|
+
return;
|
|
430
|
+
control.setAttribute("aria-label", this.required ? `${this.label} (required)` : this.label);
|
|
431
|
+
}
|
|
432
|
+
/** Moves native field listeners directly between assigned controls. */
|
|
433
|
+
#bindNativeEvents(control) {
|
|
434
|
+
if (control === this.#nativeEventControl)
|
|
435
|
+
return;
|
|
436
|
+
this.#nativeEventControl?.removeEventListener("input", this.#onNativeValueChange);
|
|
437
|
+
this.#nativeEventControl?.removeEventListener("change", this.#onNativeValueChange);
|
|
438
|
+
this.#nativeEventControl?.removeEventListener("focus", this.#onNativeFocus);
|
|
439
|
+
this.#nativeEventControl?.removeEventListener("blur", this.#onNativeBlur);
|
|
440
|
+
this.#nativeEventControl?.removeEventListener("animationstart", this.#onNativeAnimation);
|
|
441
|
+
this.#nativeEventControl = control;
|
|
442
|
+
this.#nativeEventControl?.addEventListener("input", this.#onNativeValueChange);
|
|
443
|
+
this.#nativeEventControl?.addEventListener("change", this.#onNativeValueChange);
|
|
444
|
+
this.#nativeEventControl?.addEventListener("focus", this.#onNativeFocus);
|
|
445
|
+
this.#nativeEventControl?.addEventListener("blur", this.#onNativeBlur);
|
|
446
|
+
this.#nativeEventControl?.addEventListener("animationstart", this.#onNativeAnimation);
|
|
447
|
+
}
|
|
448
|
+
/** Moves the reset listener to the native control's current owner form. */
|
|
449
|
+
#bindResetForm(form) {
|
|
450
|
+
if (form === this.#resetForm)
|
|
451
|
+
return;
|
|
452
|
+
this.#resetForm?.removeEventListener("reset", this.#onFormReset);
|
|
453
|
+
this.#resetForm = form;
|
|
454
|
+
this.#resetForm?.addEventListener("reset", this.#onFormReset);
|
|
455
|
+
}
|
|
104
456
|
render() {
|
|
105
457
|
const message = this.error || this.hint;
|
|
458
|
+
const delegatedFloating = this._floatingKind === "delegated";
|
|
459
|
+
const nativeFloating = this._floatingKind === "native";
|
|
460
|
+
const nativeMultiline = nativeFloating && this.#nativeControl() instanceof HTMLTextAreaElement;
|
|
106
461
|
return html `
|
|
107
462
|
<div class="field">
|
|
108
|
-
<label
|
|
109
|
-
${
|
|
463
|
+
<label
|
|
464
|
+
class="control-label ${nativeFloating ? "floating-native" : ""} ${nativeMultiline
|
|
465
|
+
? "multiline"
|
|
466
|
+
: ""} ${this._nativeHasValue ? "has-value" : ""}"
|
|
467
|
+
@click=${this._onControlLabelClick}
|
|
468
|
+
>
|
|
469
|
+
${this.label && !delegatedFloating
|
|
110
470
|
? html `<span class="label-text">
|
|
111
471
|
<span>${this.label}</span>
|
|
112
472
|
${this.required
|
|
@@ -115,7 +475,7 @@ let FormField = class FormField extends LitElement {
|
|
|
115
475
|
: nothing}
|
|
116
476
|
</span>`
|
|
117
477
|
: nothing}
|
|
118
|
-
<slot></slot>
|
|
478
|
+
<slot @slotchange=${this._onSlotChange}></slot>
|
|
119
479
|
</label>
|
|
120
480
|
${message
|
|
121
481
|
? html `<span id=${this.#messageId} class="message ${this.error ? "error" : ""}" role=${this.error ? "alert" : nothing}
|
|
@@ -138,6 +498,18 @@ __decorate([
|
|
|
138
498
|
__decorate([
|
|
139
499
|
property({ type: Boolean })
|
|
140
500
|
], FormField.prototype, "required", void 0);
|
|
501
|
+
__decorate([
|
|
502
|
+
property({ type: Boolean, reflect: true, attribute: "floating-label" })
|
|
503
|
+
], FormField.prototype, "floatingLabel", void 0);
|
|
504
|
+
__decorate([
|
|
505
|
+
queryAssignedElements()
|
|
506
|
+
], FormField.prototype, "_assignedElements", void 0);
|
|
507
|
+
__decorate([
|
|
508
|
+
state()
|
|
509
|
+
], FormField.prototype, "_floatingKind", void 0);
|
|
510
|
+
__decorate([
|
|
511
|
+
state()
|
|
512
|
+
], FormField.prototype, "_nativeHasValue", void 0);
|
|
141
513
|
FormField = __decorate([
|
|
142
514
|
customElement("form-field")
|
|
143
515
|
], FormField);
|
package/dist/form-field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.js","sourceRoot":"","sources":["../src/form-field.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,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AE;wCAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAkB;AArEnC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiGrB","sourcesContent":["import { LitElement, css, html, nothing } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\n\nlet instanceCount = 0;\n\n/**\n * Per-field wrapper for a form control: label, slotted control, and an\n * optional hint or error message, in one consistent unit repeated across a\n * form. Purely presentational — composes whatever control is slotted\n * (`form-select`, `multi-select`, `autocomplete-input`, `ui-checkbox`, etc.)\n * without intercepting its events or value.\n *\n * The label wraps the default slot for a best-effort visual/click\n * association only: every existing value-entry control encapsulates its\n * real `<input>` inside its own shadow DOM, so there is no light-DOM `id` a\n * `for` attribute could target from outside, and this component cannot set\n * `aria-describedby`/`aria-invalid` on an arbitrary slotted control's\n * shadow-encapsulated input for the same reason. The error message uses\n * `role=\"alert\"` as the practical accessibility mitigation instead of true\n * `aria-describedby` association.\n *\n * @element form-field\n * @slot - The wrapped form control.\n */\n@customElement(\"form-field\")\nexport class FormField extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .field {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n .control-label {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n .label-text {\n display: flex;\n align-items: baseline;\n gap: 0.25rem;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .required-mark {\n color: var(--ui-danger, #dc2626);\n }\n .message {\n font-size: var(--ui-font-size-xs, 0.6875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text-muted, #64748b);\n }\n .message.error {\n color: var(--ui-danger, #dc2626);\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n `,\n ];\n\n /** Field label text. */\n @property() label = \"\";\n /** Optional helper text shown below the control when there's no `error`. */\n @property() hint = \"\";\n /** Optional error text; replaces the `hint` display when non-empty. */\n @property() error = \"\";\n /** Shows a required indicator next to the label. */\n @property({ type: Boolean }) required = false;\n\n readonly #messageId = `form-field-message-${++instanceCount}`;\n\n override render() {\n const message = this.error || this.hint;\n return html`\n <div class=\"field\">\n <label class=\"control-label\">\n ${this.label\n ? html`<span class=\"label-text\">\n <span>${this.label}</span>\n ${this.required\n ? html`<span class=\"required-mark\" aria-hidden=\"true\">*</span\n ><span class=\"sr-only\"> (required)</span>`\n : nothing}\n </span>`\n : nothing}\n <slot></slot>\n </label>\n ${message\n ? html`<span id=${this.#messageId} class=\"message ${this.error ? \"error\" : \"\"}\" role=${this.error ? \"alert\" : nothing}\n >${message}</span\n >`\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"form-field\": FormField;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form-field.js","sourceRoot":"","sources":["../src/form-field.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EACL,aAAa,EACb,QAAQ,EACR,qBAAqB,EACrB,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GAEzB,MAAM,+BAA+B,CAAC;AAEvC,IAAI,aAAa,GAAG,CAAC,CAAC;AACtB,MAAM,uBAAuB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;YACJ,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;CACF,CAAA;AA9Qa;IAAX,QAAQ,EAAE;wCAAY;AAEX;IAAX,QAAQ,EAAE;uCAAW;AAEV;IAAX,QAAQ,EAAE;wCAAY;AAEM;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAkB;AAG9C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;gDAClD;AAGL;IADhB,qBAAqB,EAAE;oDAC2B;AAElC;IAAhB,KAAK,EAAE;gDAA6D;AACpD;IAAhB,KAAK,EAAE;kDAAiC;AApM9B,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAmcrB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport {\n customElement,\n property,\n queryAssignedElements,\n state,\n} from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport {\n formFieldControl,\n supportsFormFieldControl,\n type FormFieldControl,\n} from \"./utils/form-field-control.js\";\n\nlet instanceCount = 0;\nconst NATIVE_TEXT_INPUT_TYPES = new Set([\n \"date\",\n \"datetime-local\",\n \"email\",\n \"month\",\n \"number\",\n \"password\",\n \"search\",\n \"tel\",\n \"text\",\n \"time\",\n \"url\",\n \"week\",\n]);\n\n/**\n * Per-field wrapper for a form control: label, slotted control, and an\n * optional hint or error message, in one consistent unit repeated across a\n * form. Purely presentational — composes whatever control is slotted\n * (`form-select`, `multi-select`, `autocomplete-input`, `ui-checkbox`, etc.)\n * without intercepting its events or value.\n *\n * Set `floating-label` for supported text controls (`input`, `textarea`,\n * `autocomplete-input`, `address-autocomplete`, and `text-area`). The label\n * then rests inside an empty field and moves to a smaller top-left position\n * while focused or non-empty. Other controls keep the external label.\n *\n * The label wraps the default slot for a best-effort visual/click\n * association only: every existing value-entry control encapsulates its\n * real `<input>` inside its own shadow DOM, so there is no light-DOM `id` a\n * `for` attribute could target from outside, and this component cannot set\n * `aria-describedby`/`aria-invalid` on an arbitrary slotted control's\n * shadow-encapsulated input for the same reason. The error message uses\n * `role=\"alert\"` as the practical accessibility mitigation instead of true\n * `aria-describedby` association.\n *\n * @element form-field\n * @slot - The wrapped form control.\n */\n@customElement(\"form-field\")\nexport class FormField extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n }\n .field {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n .control-label {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n .label-text {\n display: flex;\n align-items: baseline;\n gap: 0.25rem;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n font-weight: var(--ui-font-weight-medium, 500);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text, #0f172a);\n }\n .control-label.floating-native {\n position: relative;\n display: block;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-surface, #ffffff);\n box-shadow: inset 0 0 0 1px var(--ui-border, #e2e8f0);\n }\n .control-label.floating-native:focus-within {\n box-shadow:\n inset 0 0 0 1px var(--ui-primary, #4f46e5),\n var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .control-label.floating-native .label-text {\n position: absolute;\n top: 50%;\n left: 0.75rem;\n right: 0.75rem;\n z-index: 1;\n overflow: hidden;\n transform: translateY(-50%);\n color: var(--ui-text-muted, #64748b);\n font-weight: var(--ui-font-weight-regular, 400);\n white-space: nowrap;\n text-overflow: ellipsis;\n cursor: text;\n transition:\n top 150ms ease,\n transform 150ms ease,\n font-size 150ms ease;\n }\n .control-label.floating-native.multiline .label-text {\n top: 0.5rem;\n transform: none;\n }\n .control-label.floating-native.has-value .label-text,\n .control-label.floating-native:focus-within .label-text {\n top: 0.25rem;\n transform: none;\n font-size: var(--ui-font-size-xs, 0.6875rem);\n }\n .control-label.floating-native ::slotted(input),\n .control-label.floating-native ::slotted(textarea) {\n display: block;\n box-sizing: border-box;\n width: 100%;\n min-height: 3rem;\n margin: 0;\n padding: 1.25rem 0.75rem 0.25rem;\n border: 0;\n border-radius: var(--ui-radius-sm, 0.25rem);\n color: var(--ui-text, #0f172a);\n background: transparent;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n }\n .control-label.floating-native ::slotted(input) {\n height: 3rem;\n }\n .control-label.floating-native ::slotted(textarea) {\n padding-bottom: 0.5rem;\n resize: vertical;\n }\n .control-label.floating-native ::slotted(input:focus-visible),\n .control-label.floating-native ::slotted(textarea:focus-visible) {\n outline: none;\n }\n .control-label.floating-native ::slotted(input:disabled),\n .control-label.floating-native ::slotted(textarea:disabled) {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .control-label.floating-native:has(:disabled) .label-text {\n cursor: not-allowed;\n opacity: 0.6;\n }\n .control-label.floating-native ::slotted(input:-webkit-autofill) {\n animation: form-field-autofill 0.001s;\n }\n .required-mark {\n color: var(--ui-danger, #dc2626);\n }\n .message {\n font-size: var(--ui-font-size-xs, 0.6875rem);\n line-height: var(--ui-line-height-tight, 1.25);\n color: var(--ui-text-muted, #64748b);\n }\n .message.error {\n color: var(--ui-danger, #dc2626);\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n @media (prefers-reduced-motion: reduce) {\n .control-label.floating-native .label-text {\n transition: none;\n }\n }\n @keyframes form-field-autofill {\n from {\n opacity: 1;\n }\n to {\n opacity: 1;\n }\n }\n @media (forced-colors: active) {\n .control-label.floating-native {\n border: 1px solid CanvasText;\n box-shadow: none;\n }\n .control-label.floating-native:focus-within {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .control-label.floating-native ::slotted(input:disabled),\n .control-label.floating-native ::slotted(textarea:disabled),\n .control-label.floating-native:has(:disabled) .label-text {\n color: GrayText;\n opacity: 1;\n }\n }\n `,\n ];\n\n /** Field label text. */\n @property() label = \"\";\n /** Optional helper text shown below the control when there's no `error`. */\n @property() hint = \"\";\n /** Optional error text; replaces the `hint` display when non-empty. */\n @property() error = \"\";\n /** Shows a required indicator next to the label. */\n @property({ type: Boolean }) required = false;\n /** Moves labels inside supported text controls until they receive focus or content. */\n @property({ type: Boolean, reflect: true, attribute: \"floating-label\" })\n floatingLabel = false;\n\n @queryAssignedElements()\n private readonly _assignedElements!: HTMLElement[];\n\n @state() private _floatingKind: \"delegated\" | \"native\" | null = null;\n @state() private _nativeHasValue = false;\n\n readonly #messageId = `form-field-message-${++instanceCount}`;\n #configuredControls = new Set<FormFieldControl>();\n #resetForm: HTMLFormElement | null = null;\n #placeholderControl: HTMLInputElement | HTMLTextAreaElement | null = null;\n #placeholder = \"\";\n #accessibleNameControl: HTMLInputElement | HTMLTextAreaElement | null = null;\n #accessibleName: string | null = null;\n #nativeEventControl: HTMLInputElement | HTMLTextAreaElement | null = null;\n #nativeFocused = false;\n readonly #onNativeValueChange = () => this._onControlValueChange();\n readonly #onNativeFocus = () => this._onControlFocusIn();\n readonly #onNativeBlur = () => this._onControlFocusOut();\n readonly #onNativeAnimation = (event: Event) => {\n if (event instanceof AnimationEvent) this._onNativeAnimationStart(event);\n };\n readonly #onFormReset = () => {\n window.setTimeout(() => {\n this.#updateNativeValue();\n this.#syncNativePlaceholder();\n });\n };\n\n /** Synchronizes label configuration after the component first renders. */\n protected override firstUpdated(): void {\n this.#syncControls();\n }\n\n /** Resynchronizes delegated controls when public label configuration changes. */\n protected override updated(changed: PropertyValues<this>): void {\n if (\n changed.has(\"label\") ||\n changed.has(\"required\") ||\n changed.has(\"floatingLabel\")\n ) {\n this.#syncControls();\n }\n }\n\n /** Removes delegated configuration and form listeners when disconnected. */\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n for (const control of this.#configuredControls) control[formFieldControl](null);\n this.#configuredControls.clear();\n this.#bindNativePlaceholder(null);\n this.#bindNativeAccessibleName(null);\n this.#bindNativeEvents(null);\n this.#bindResetForm(null);\n }\n\n /** Handles assigned-control changes and updates the floating-label strategy. */\n private _onSlotChange(): void {\n this.#syncControls();\n }\n\n /** Tracks native input/textarea content after user edits. */\n private _onControlValueChange(): void {\n if (this._floatingKind !== \"native\") return;\n this.#updateNativeValue();\n this.#syncNativePlaceholder();\n }\n\n /** Reveals the native placeholder once focus floats the label. */\n private _onControlFocusIn(): void {\n if (this._floatingKind !== \"native\") return;\n this.#nativeFocused = true;\n this.#syncNativePlaceholder();\n }\n\n /** Hides the native placeholder again when an empty field loses focus. */\n private _onControlFocusOut(): void {\n if (this._floatingKind !== \"native\") return;\n this.#nativeFocused = false;\n this.#syncNativePlaceholder();\n }\n\n /** Focuses a native control when its shadow-rendered floating label is clicked. */\n private _onControlLabelClick(event: MouseEvent): void {\n if (this._floatingKind !== \"native\") return;\n const control = this.#nativeControl();\n if (!control || event.composedPath().includes(control)) return;\n control.focus();\n }\n\n /** Synchronizes native value state when WebKit applies autofill without input events. */\n private _onNativeAnimationStart(event: AnimationEvent): void {\n if (\n this._floatingKind !== \"native\" ||\n event.animationName !== \"form-field-autofill\"\n ) {\n return;\n }\n this.#updateNativeValue();\n this.#syncNativePlaceholder();\n }\n\n /** Finds the sole assigned native text control, if present. */\n #nativeControl(): HTMLInputElement | HTMLTextAreaElement | null {\n if (this._assignedElements?.length !== 1) return null;\n const [element] = this._assignedElements;\n if (element instanceof HTMLTextAreaElement) return element;\n if (!(element instanceof HTMLInputElement)) return null;\n return NATIVE_TEXT_INPUT_TYPES.has(element.type) ? element : null;\n }\n\n /** Pushes current label configuration into a supported slotted control. */\n #syncControls(): void {\n const assigned = this._assignedElements ?? [];\n const delegated =\n this.floatingLabel &&\n Boolean(this.label) &&\n assigned.length === 1 &&\n supportsFormFieldControl(assigned[0])\n ? assigned[0]\n : null;\n const native =\n this.floatingLabel && Boolean(this.label) && !delegated\n ? this.#nativeControl()\n : null;\n const nextConfigured = new Set<FormFieldControl>();\n\n if (delegated) {\n delegated[formFieldControl]({\n label: this.label,\n required: this.required,\n floating: true,\n });\n nextConfigured.add(delegated);\n }\n for (const control of this.#configuredControls) {\n if (!nextConfigured.has(control)) control[formFieldControl](null);\n }\n this.#configuredControls = nextConfigured;\n\n this._floatingKind = delegated ? \"delegated\" : native ? \"native\" : null;\n this.#updateNativeValue();\n this.#bindNativePlaceholder(native);\n this.#bindNativeAccessibleName(native);\n this.#bindNativeEvents(native);\n this.#bindResetForm(native?.form ?? null);\n }\n\n /** Updates whether a native control currently contains a value. */\n #updateNativeValue(): void {\n this._nativeHasValue = Boolean(this.#nativeControl()?.value);\n }\n\n /** Preserves the consumer placeholder while floating mode temporarily hides it. */\n #bindNativePlaceholder(\n control: HTMLInputElement | HTMLTextAreaElement | null,\n ): void {\n if (control === this.#placeholderControl) {\n this.#syncNativePlaceholder();\n return;\n }\n if (this.#placeholderControl) this.#placeholderControl.placeholder = this.#placeholder;\n this.#placeholderControl = control;\n this.#placeholder = control?.placeholder ?? \"\";\n this.#nativeFocused = control === document.activeElement;\n this.#syncNativePlaceholder();\n }\n\n /** Applies the correct placeholder for the native label's focus/value state. */\n #syncNativePlaceholder(): void {\n if (!this.#placeholderControl) return;\n this.#placeholderControl.placeholder =\n this.#nativeFocused || this._nativeHasValue ? this.#placeholder : \"\";\n }\n\n /** Applies a shadow-boundary-safe accessible name and restores any prior value. */\n #bindNativeAccessibleName(\n control: HTMLInputElement | HTMLTextAreaElement | null,\n ): void {\n if (control !== this.#accessibleNameControl) {\n if (this.#accessibleNameControl) {\n if (this.#accessibleName == null) {\n this.#accessibleNameControl.removeAttribute(\"aria-label\");\n } else {\n this.#accessibleNameControl.setAttribute(\"aria-label\", this.#accessibleName);\n }\n }\n this.#accessibleNameControl = control;\n this.#accessibleName = control?.getAttribute(\"aria-label\") ?? null;\n }\n if (!control) return;\n control.setAttribute(\n \"aria-label\",\n this.required ? `${this.label} (required)` : this.label,\n );\n }\n\n /** Moves native field listeners directly between assigned controls. */\n #bindNativeEvents(control: HTMLInputElement | HTMLTextAreaElement | null): void {\n if (control === this.#nativeEventControl) return;\n this.#nativeEventControl?.removeEventListener(\"input\", this.#onNativeValueChange);\n this.#nativeEventControl?.removeEventListener(\"change\", this.#onNativeValueChange);\n this.#nativeEventControl?.removeEventListener(\"focus\", this.#onNativeFocus);\n this.#nativeEventControl?.removeEventListener(\"blur\", this.#onNativeBlur);\n this.#nativeEventControl?.removeEventListener(\n \"animationstart\",\n this.#onNativeAnimation,\n );\n this.#nativeEventControl = control;\n this.#nativeEventControl?.addEventListener(\"input\", this.#onNativeValueChange);\n this.#nativeEventControl?.addEventListener(\"change\", this.#onNativeValueChange);\n this.#nativeEventControl?.addEventListener(\"focus\", this.#onNativeFocus);\n this.#nativeEventControl?.addEventListener(\"blur\", this.#onNativeBlur);\n this.#nativeEventControl?.addEventListener(\n \"animationstart\",\n this.#onNativeAnimation,\n );\n }\n\n /** Moves the reset listener to the native control's current owner form. */\n #bindResetForm(form: HTMLFormElement | null): void {\n if (form === this.#resetForm) return;\n this.#resetForm?.removeEventListener(\"reset\", this.#onFormReset);\n this.#resetForm = form;\n this.#resetForm?.addEventListener(\"reset\", this.#onFormReset);\n }\n\n override render() {\n const message = this.error || this.hint;\n const delegatedFloating = this._floatingKind === \"delegated\";\n const nativeFloating = this._floatingKind === \"native\";\n const nativeMultiline =\n nativeFloating && this.#nativeControl() instanceof HTMLTextAreaElement;\n return html`\n <div class=\"field\">\n <label\n class=\"control-label ${nativeFloating ? \"floating-native\" : \"\"} ${nativeMultiline\n ? \"multiline\"\n : \"\"} ${this._nativeHasValue ? \"has-value\" : \"\"}\"\n @click=${this._onControlLabelClick}\n >\n ${this.label && !delegatedFloating\n ? html`<span class=\"label-text\">\n <span>${this.label}</span>\n ${this.required\n ? html`<span class=\"required-mark\" aria-hidden=\"true\">*</span\n ><span class=\"sr-only\"> (required)</span>`\n : nothing}\n </span>`\n : nothing}\n <slot @slotchange=${this._onSlotChange}></slot>\n </label>\n ${message\n ? html`<span id=${this.#messageId} class=\"message ${this.error ? \"error\" : \"\"}\" role=${this.error ? \"alert\" : nothing}\n >${message}</span\n >`\n : nothing}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"form-field\": FormField;\n }\n}\n"]}
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,54 +1,109 @@
|
|
|
1
|
+
/** Close, dismiss, or clear (e.g. a modal, toast, or clearable input). */
|
|
1
2
|
export declare const iconX: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
3
|
+
/** A hamburger menu toggle, e.g. collapsing or opening a sidebar/nav drawer. */
|
|
2
4
|
export declare const iconBars3: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
5
|
+
/** "Previous" navigation, e.g. pagination or carousel back controls. */
|
|
3
6
|
export declare const iconChevronLeft: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
7
|
+
/** "Next" navigation, or a collapsed disclosure/submenu indicator. */
|
|
4
8
|
export declare const iconChevronRight: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
9
|
+
/** "Scroll to top", or an expanded/upward disclosure control. */
|
|
5
10
|
export declare const iconChevronUp: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
11
|
+
/** Settings, preferences, or configuration entry points. */
|
|
6
12
|
export declare const iconCog: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
13
|
+
/** Neutral informational messages, e.g. an info toast or status banner. */
|
|
7
14
|
export declare const iconInfo: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
15
|
+
/** Help, tooltips, or "learn more" affordances. */
|
|
8
16
|
export declare const iconQuestionMarkCircle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
17
|
+
/** Edit actions, e.g. an edit icon-button or inline edit toggle. */
|
|
9
18
|
export declare const iconPencil: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
19
|
+
/** Delete/remove actions, typically paired with a destructive/danger style. */
|
|
10
20
|
export declare const iconTrash: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
21
|
+
/** An overflow ("kebab") menu trigger, e.g. dropdown-button's icon variant. */
|
|
11
22
|
export declare const iconEllipsisVertical: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
23
|
+
/** "Add new" actions, e.g. creating a new item or row. */
|
|
12
24
|
export declare const iconPlus: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
25
|
+
/** A list-view toggle, or to represent list-type content. */
|
|
13
26
|
export declare const iconListBullet: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
27
|
+
/** Monetary values, pricing, or billing-related content. */
|
|
14
28
|
export declare const iconCurrencyDollar: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
29
|
+
/** A primary navigation link to the app's home or dashboard. */
|
|
15
30
|
export declare const iconHome: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
31
|
+
/** A location, address, or map marker. */
|
|
16
32
|
export declare const iconMapPin: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
33
|
+
/** Timestamps, durations, or time-related metadata. */
|
|
17
34
|
export declare const iconClock: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
35
|
+
/** Tags, labels, or categorical metadata. */
|
|
18
36
|
export declare const iconTag: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
37
|
+
/** Dates, due dates, or calendar-related metadata. */
|
|
19
38
|
export declare const iconCalendar: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
39
|
+
/** "Expand" or "view fullscreen" actions. */
|
|
20
40
|
export declare const iconArrowsPointingOut: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
41
|
+
/** A map-view toggle, or to represent map/geographic content. */
|
|
21
42
|
export declare const iconMap: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
43
|
+
/** Success states, confirmations, or a selected-item checkmark. */
|
|
22
44
|
export declare const iconCheckCircle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
45
|
+
/** A light-theme toggle, or to represent daytime/light mode. */
|
|
23
46
|
export declare const iconSun: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
47
|
+
/** Security warnings, or at-risk/compromised states. */
|
|
24
48
|
export declare const iconShieldExclamation: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
49
|
+
/** Refresh actions, or an animated busy/loading spinner. */
|
|
25
50
|
export declare const iconArrowPath: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
51
|
+
/** "Continue" or forward-progressing actions, e.g. a compact next-step arrow. */
|
|
26
52
|
export declare const iconArrowRight: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
53
|
+
/** Download or export actions. */
|
|
27
54
|
export declare const iconArrowDownTray: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
55
|
+
/** Swap, exchange, or compare actions between two items. */
|
|
28
56
|
export declare const iconArrowsRightLeft: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
57
|
+
/** Copy-link or hyperlink-related actions, e.g. copy-link-button. */
|
|
29
58
|
export declare const iconLink: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
59
|
+
/** "Like"/"favorite" actions in their unselected state. */
|
|
30
60
|
export declare const iconHeart: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
61
|
+
/** "Like"/"favorite" actions in their selected/active state; pair with iconHeart for the unselected state. */
|
|
31
62
|
export declare const iconHeartSolid: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
63
|
+
/** "Show"/"preview" actions or a visible/reviewed state, e.g. password visibility or a review status. */
|
|
32
64
|
export declare const iconEye: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
65
|
+
/** "Hide" actions or a hidden/masked state; pair with iconEye for the visible state. */
|
|
33
66
|
export declare const iconEyeSlash: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
67
|
+
/** Verified, secure, or trusted states. */
|
|
34
68
|
export declare const iconShieldCheck: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
69
|
+
/** A generic user/person fallback, e.g. user-avatar's icon fallback. */
|
|
35
70
|
export declare const iconUserCircle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
71
|
+
/** Task lists, checklists, or clipboard/notes content. */
|
|
36
72
|
export declare const iconClipboardDocumentList: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
73
|
+
/** System, hardware, or technical/processing content. */
|
|
37
74
|
export declare const iconCpuChip: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
75
|
+
/** Folders, directories, or grouped file content. */
|
|
38
76
|
export declare const iconFolder: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
77
|
+
/** "Scroll to bottom", a downward disclosure, or an expanded tree/accordion indicator. */
|
|
39
78
|
export declare const iconChevronDown: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
79
|
+
/** A generic file/document icon, e.g. tile-grid's default file icon. */
|
|
40
80
|
export declare const iconDocument: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
81
|
+
/** A grid or kanban-view toggle, or to represent card/tile layouts. */
|
|
41
82
|
export declare const iconSquares2x2: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
83
|
+
/** Messaging, comments, or conversation-related content. */
|
|
42
84
|
export declare const iconChatBubbleLeftRight: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
85
|
+
/** Links that open in a new tab/window, or navigate to an external site. */
|
|
43
86
|
export declare const iconArrowTopRightOnSquare: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
87
|
+
/** Education, learning, or certification-related content. */
|
|
44
88
|
export declare const iconAcademicCap: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
89
|
+
/** Queues, backlogs, or ordered work-item lists. */
|
|
45
90
|
export declare const iconQueueList: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
91
|
+
/** Warning states, e.g. the warning variant of toast-notification. */
|
|
46
92
|
export declare const iconExclamationTriangle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
93
|
+
/** Error states, e.g. the error variant of toast-notification. */
|
|
47
94
|
export declare const iconExclamationCircle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
95
|
+
/** A dark-theme toggle, or to represent night/dark mode. */
|
|
48
96
|
export declare const iconMoon: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
97
|
+
/** A "system/auto" theme option, or to represent a desktop device. */
|
|
49
98
|
export declare const iconComputerDesktop: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
99
|
+
/** Code snippets, developer tools, or technical/API content. */
|
|
50
100
|
export declare const iconCodeBracketSquare: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
101
|
+
/** Plugins, integrations, or extensible/add-on features. */
|
|
51
102
|
export declare const iconPuzzlePiece: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
103
|
+
/** Teams, groups, or multi-user/collaboration content. */
|
|
52
104
|
export declare const iconUsers: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
105
|
+
/** Logout/sign-out actions. */
|
|
53
106
|
export declare const iconArrowRightOnRectangle: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
107
|
+
/** Tools, maintenance, or build/configuration actions. */
|
|
108
|
+
export declare const iconWrenchScrewdriver: (size?: number) => import("lit-html").TemplateResult<2>;
|
|
54
109
|
//# sourceMappingURL=icons.d.ts.map
|
package/dist/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK,yDAC2O,CAAC;AAE9P,eAAO,MAAM,SAAS,yDAC+P,CAAC;AAEtR,eAAO,MAAM,eAAe,yDACwO,CAAC;AAErQ,eAAO,MAAM,gBAAgB,yDACqO,CAAC;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