@su-labs/fields 0.0.0-stage → 19.2.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/CHANGELOG.md ADDED
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [22.2.0] - 2026-11-20
9
+
10
+ ### Added
11
+
12
+ - `su-lib-email-field`: `floating`, a label that sits inside the field and moves up onto its border, smaller and in the accent colour, when the field is focused or filled
13
+ - `su-lib-email-field`: `showProblem`, to show what's wrong before the field was left, for example when its form is sent (use it with `novalidate` on the form, so the browser's own bubble doesn't show)
14
+
15
+ ## [22.1.0] - 2026-11-14
16
+
17
+ ### Added
18
+
19
+ - `su-lib-email-field`: an email input that checks the address the way people mistype it, says what's wrong once the field is left, shows a tick when it looks right, and suggests a common domain for a likely typo (`gmial.com` → `gmail.com`) applied with one tap; `required`, your own `domains` and `messages`, `validityChange`. The check is exported as `suCheckEmail`
20
+ - `su-lib-checkbox`: a real checkbox whose tick draws itself in, with a squash when pressed and a dash when partly checked; `[(checked)]`, `indeterminate`, `disabled`
21
+ - `su-lib-chips`: toggle chips to pick several options or one (`multiple`), each popping a tick in when picked; typed `[(value)]`, disabled options
22
+ - `su-lib-switch`: a real checkbox (`role="switch"`) drawn as a sliding switch, with a stretching knob, a spring and a tick when on; `[(checked)]`, the label before or after it (`labelPosition`), `small` or `medium`, `disabled`, and `busy` (ignores clicks while saving, then shows the saved value); themed with `--su-switch-*` variables
23
+
24
+ ## [22.0.0] - 2026-11-11
25
+
26
+ ### Added
27
+
28
+ - `SuCodeBoxesComponent` (`su-lib-code-boxes`): a short code typed into boxes that fill one by one and turn green in a wave once complete; one real text field underneath, so pasting, phone keyboards and screen readers work
29
+ - `SuStrengthMeterComponent` (`su-lib-strength-meter`): four bars under a new password that fill and change colour as it gets stronger, with its word per step; a `meter` for screen readers
30
+ - `suPasswordStrength()` and `suStrengthLevel()`: the meter's rule, usable on its own
31
+ - `SuAutoGrowDirective` (`textarea[suAutoGrow]`): a text box that grows a line at a time with a soft spring, and shrinks back when emptied
32
+ - `--su-field-*` CSS variables for colours, and no motion for visitors who ask their device for less
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Yevheniy Alekseyev <yev.alekseyev@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,185 @@
1
- # Temporary Holding Version
1
+ # Fields
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@su-labs/fields`
4
+
5
+ ![Angular Version](https://img.shields.io/badge/Angular-v22-DD0031?style=for-the-badge&logo=angular&logoColor=white)
6
+ ![License](https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge)
7
+
8
+ Small animated form fields for Angular, built on plain inputs so forms, pasting, phone keyboards and screen readers keep working:
9
+
10
+ - **Code boxes**: a short code typed into boxes that fill one by one, then turn green in a wave once it's complete.
11
+ - **Strength meter**: four bars under a new password that fill and change colour as it gets stronger.
12
+ - **Auto grow**: a text box that grows a line at a time with a soft spring.
13
+
14
+ Every animation stops for visitors who ask their device for less motion.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @su-labs/fields@ng19
20
+ ```
21
+
22
+ This is the Angular 19 version. For the newest Angular, install `@su-labs/fields` without a tag.
23
+
24
+ ## Code boxes
25
+
26
+ ```ts
27
+ import { SuCodeBoxesComponent } from '@su-labs/fields';
28
+
29
+ code = signal('');
30
+ isComplete = computed(() => /^[A-Z0-9]{6}$/.test(this.code()));
31
+ ```
32
+
33
+ ```html
34
+ <su-lib-code-boxes [(value)]="code" [length]="6" label="Room code" [complete]="isComplete()" />
35
+ ```
36
+
37
+ | Input | Type | |
38
+ |---|---|---|
39
+ | `value` | `string` (two-way) | The code typed so far, in capitals without spaces |
40
+ | `length` | `number` | How many boxes |
41
+ | `label` | `string` | The field's name for screen readers |
42
+ | `complete` | `boolean` | The code is whole and valid: the boxes turn green |
43
+
44
+ ## Strength meter
45
+
46
+ ```html
47
+ <input #password type="password" autocomplete="new-password" />
48
+ <su-lib-strength-meter
49
+ [field]="password"
50
+ label="Password strength"
51
+ [levelNames]="{ weak: 'Weak', fair: 'Fair', good: 'Good', strong: 'Strong' }"
52
+ [minLength]="10"
53
+ />
54
+ ```
55
+
56
+ The meter follows the field's typing. If your code empties the field, send it an `input` event so the meter sees it.
57
+
58
+ The rule is exported too: `suPasswordStrength(password, minLength)` gives 0 to 4 bars, and `suStrengthLevel(bars)` its step
59
+ (`weak`, `fair`, `good`, `strong`).
60
+
61
+ ## Auto grow
62
+
63
+ ```html
64
+ <textarea suAutoGrow rows="2"></textarea>
65
+ <textarea [suAutoGrow]="isOn()" rows="2"></textarea>
66
+ ```
67
+
68
+ It also shrinks back when its form is reset.
69
+
70
+ ## Switch
71
+
72
+ A real checkbox (`role="switch"`) drawn as a sliding switch: the knob stretches while pressed, springs across, and a
73
+ tick pops in when it's on. The label goes inside.
74
+
75
+ ```html
76
+ <su-lib-switch [(checked)]="notify">Email me about new games</su-lib-switch>
77
+
78
+ <su-lib-switch labelPosition="start" size="small" [checked]="isPublic()" [busy]="saving()" (checkedChange)="save($event)">
79
+ <strong>Show me on the leaderboard</strong>
80
+ <small>Others see your screen name and best scores</small>
81
+ </su-lib-switch>
82
+ ```
83
+
84
+ | Input / output | Default | Description |
85
+ |---|---|---|
86
+ | `checked` / `checkedChange` | `false` | Whether it's on; `[(checked)]` binds both ways |
87
+ | `labelPosition` | `'end'` | `'end'`: label after the switch; `'start'`: label first, switch at the end of the row |
88
+ | `size` | `'medium'` | `'small'` or `'medium'` |
89
+ | `disabled` | `false` | |
90
+ | `busy` | `false` | While saving: clicks are ignored and `aria-busy` is set; once done it shows `checked` again, so a change that failed to save flips back |
91
+
92
+ | Variable | Default |
93
+ |---|---|
94
+ | `--su-switch-on` / `--su-switch-tick` | `#111` / `#fff` (the knob and the tick when on) |
95
+ | `--su-switch-track-on` | the on colour at 35% |
96
+ | `--su-switch-knob-off` / `--su-switch-track-off` / `--su-switch-border` | grey / a faint tint / a soft line |
97
+ | `--su-switch-width` / `--su-switch-height` | `3rem` / `1.75rem` (`--su-switch-small-width`, `--su-switch-small-height`: `2.125rem` / `1.25rem`) |
98
+ | `--su-switch-label-weight` / `--su-switch-focus-outline` | `500` / `2px solid currentColor` |
99
+
100
+ ## Email field
101
+
102
+ An email input that checks the address the way people mistype it: no @, nothing before or after it, no dot in the
103
+ domain, spaces, or a one-letter ending. It stays quiet while you type and says what's wrong once you leave the field;
104
+ a tick shows when the address looks right. For a likely typo in a common domain it offers the fix, applied with one tap:
105
+ `jo@gmial.com` → "Did you mean jo@gmail.com?"
106
+
107
+ ```html
108
+ <su-lib-email-field label="Email" required [(value)]="email" (validityChange)="emailOk.set($event)" />
109
+ ```
110
+
111
+ To show your own messages instead of the browser's bubble, turn the browser's check off and show the field's problem
112
+ when the form is sent:
113
+
114
+ ```html
115
+ <form novalidate (submit)="send()">
116
+ <su-lib-email-field label="Email" floating required [showProblem]="sent()" [(value)]="email" />
117
+ </form>
118
+ ```
119
+
120
+ | Input / output | Default | Description |
121
+ |---|---|---|
122
+ | `value` | `''` | The address; `[(value)]` binds both ways |
123
+ | `label` | — | The visible label |
124
+ | `placeholder` | — | |
125
+ | `required` | `false` | An empty field counts as a problem |
126
+ | `floating` | `false` | The label sits inside the field and moves up onto its border when focused or filled |
127
+ | `showProblem` | `false` | Shows the problem before the field was left, e.g. once its form is sent |
128
+ | `domains` | common providers | Domains to suggest for a typo, e.g. your company's |
129
+ | `messages` | English | `Partial<SuEmailMessages>`: the problem texts and "Did you mean" |
130
+ | `validityChange` | — | Whether the address is valid, on every change |
131
+
132
+ The check itself is exported: `suCheckEmail(value, domains?)` gives `{ valid, problem, suggestion }`.
133
+
134
+ ## Checkbox
135
+
136
+ A real checkbox whose tick draws itself in, with a small squash when pressed and a dash when partly checked.
137
+
138
+ ```html
139
+ <su-lib-checkbox [(checked)]="agree">I agree to the terms</su-lib-checkbox>
140
+ <su-lib-checkbox [checked]="all()" [indeterminate]="some()" (checkedChange)="selectAll($event)">Select all</su-lib-checkbox>
141
+ ```
142
+
143
+ Inputs: `checked` / `checkedChange` (`[(checked)]`), `indeterminate`, `disabled`. Size and tick colour:
144
+ `--su-checkbox-size` (`1.25rem`), `--su-checkbox-tick` (`#fff`); the box uses `--su-field-accent` when checked.
145
+
146
+ ## Chips
147
+
148
+ Toggle chips to pick several options, or one with `multiple` off. Each is a button (`aria-pressed`) that pops a tick in
149
+ when picked; the value keeps the options' order and type.
150
+
151
+ ```ts
152
+ categories: readonly SuChipOption<Category>[] = [
153
+ { value: 'tools', label: 'Tools' },
154
+ { value: 'garden', label: 'Garden' },
155
+ ];
156
+ picked = signal<readonly Category[]>([]);
157
+ ```
158
+
159
+ ```html
160
+ <su-lib-chips label="Categories" [options]="categories" [(value)]="picked" />
161
+ ```
162
+
163
+ Inputs: `options` (`{ value, label, disabled? }`), `value` (`[(value)]`), `label` (the group's name for screen readers),
164
+ `multiple` (`true`). Spacing: `--su-chips-gap` (`0.5rem`).
165
+
166
+ ## Theming
167
+
168
+ Set these CSS variables (each has a fallback):
169
+
170
+ | Variable | Used for |
171
+ |---|---|
172
+ | `--su-field-surface` | Box background |
173
+ | `--su-field-border` | Box border |
174
+ | `--su-field-filled-border` | Border of a filled box |
175
+ | `--su-field-text` | Letters in the boxes |
176
+ | `--su-field-accent` | The box the next letter goes into |
177
+ | `--su-field-success`, `--su-field-success-bg` | A complete code, a strong password |
178
+ | `--su-field-warning` | A fair password |
179
+ | `--su-field-danger` | A weak password |
180
+ | `--su-field-track` | Empty meter bars |
181
+ | `--su-field-font-mono` | Letters in the boxes |
182
+
183
+ ## License
184
+
185
+ MIT
@@ -0,0 +1,398 @@
1
+ import * as i0 from '@angular/core';
2
+ import { model, input, computed, ChangeDetectionStrategy, Component, signal, effect, booleanAttribute, inject, ElementRef, DestroyRef, afterNextRender, Directive, output, linkedSignal, untracked } from '@angular/core';
3
+
4
+ /**
5
+ * A short code typed into a row of boxes that fill one by one, then turn green in a wave once the code is complete.
6
+ * One real text field lies over the boxes, so typing, pasting, the phone keyboard and screen readers all work as usual.
7
+ */
8
+ class SuCodeBoxesComponent {
9
+ value = model('');
10
+ length = input.required();
11
+ label = input.required();
12
+ /** The code is whole and well-formed: the boxes turn green */
13
+ complete = input(false);
14
+ boxes = computed(() => Array.from({ length: this.length() }, (_, index) => index));
15
+ /** Capitals without spaces, never longer than the boxes */
16
+ onInput(field) {
17
+ const code = field.value
18
+ .replace(/\s/g, '')
19
+ .toUpperCase()
20
+ .slice(0, this.length());
21
+ field.value = code;
22
+ this.value.set(code);
23
+ }
24
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuCodeBoxesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuCodeBoxesComponent, isStandalone: true, selector: "su-lib-code-boxes", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, complete: { classPropertyName: "complete", publicName: "complete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<input\n #field\n class=\"field\"\n type=\"text\"\n inputmode=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n spellcheck=\"false\"\n required\n [attr.maxlength]=\"length()\"\n [attr.aria-label]=\"label()\"\n [value]=\"value()\"\n (input)=\"onInput(field)\"\n/>\n<span class=\"boxes\" [class.is-complete]=\"complete()\" aria-hidden=\"true\">\n @for (index of boxes(); track index) {\n <span\n class=\"box\"\n [class.is-filled]=\"index < value().length\"\n [class.is-current]=\"index === value().length\"\n [style.--index]=\"index\"\n >{{ value()[index] }}</span\n >\n }\n</span>\n", styles: [":host{display:block;position:relative;width:fit-content}.field{background:transparent;border:0;caret-color:transparent;color:transparent;cursor:text;font-size:1rem;inset:0;opacity:.01;position:absolute;width:100%;z-index:1}.boxes{display:flex;gap:.5rem}.box{align-items:center;background:var(--su-field-surface, transparent);border:1px solid var(--su-field-border, rgba(127, 127, 127, .4));border-radius:.5rem;color:var(--su-field-text, currentColor);display:flex;font-family:var(--su-field-font-mono, monospace);font-size:1.375rem;height:3rem;justify-content:center;transition:border-color .2s ease,background-color .2s ease,color .2s ease;width:2.5rem}.box.is-filled{animation:box-pop .22s cubic-bezier(.34,1.56,.64,1);border-color:var(--su-field-filled-border, currentColor)}.field:focus-visible+.boxes .box.is-current,.field:focus+.boxes .box.is-current{border-color:var(--su-field-accent, #3b82f6);box-shadow:0 0 0 3px color-mix(in srgb,var(--su-field-accent, #3b82f6) 25%,transparent)}.boxes.is-complete .box{animation:box-done .36s ease calc(var(--index) * 60ms) both;background:var(--su-field-success-bg, #e6f4ea);border-color:var(--su-field-success, #2e8b57);color:var(--su-field-success, #2e8b57);transition-delay:calc(var(--index) * 60ms)}@keyframes box-pop{0%{transform:scale(.85)}}@keyframes box-done{50%{transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){.box,.boxes.is-complete .box{animation:none;transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
26
+ }
27
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuCodeBoxesComponent, decorators: [{
28
+ type: Component,
29
+ args: [{ selector: 'su-lib-code-boxes', changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\n #field\n class=\"field\"\n type=\"text\"\n inputmode=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n spellcheck=\"false\"\n required\n [attr.maxlength]=\"length()\"\n [attr.aria-label]=\"label()\"\n [value]=\"value()\"\n (input)=\"onInput(field)\"\n/>\n<span class=\"boxes\" [class.is-complete]=\"complete()\" aria-hidden=\"true\">\n @for (index of boxes(); track index) {\n <span\n class=\"box\"\n [class.is-filled]=\"index < value().length\"\n [class.is-current]=\"index === value().length\"\n [style.--index]=\"index\"\n >{{ value()[index] }}</span\n >\n }\n</span>\n", styles: [":host{display:block;position:relative;width:fit-content}.field{background:transparent;border:0;caret-color:transparent;color:transparent;cursor:text;font-size:1rem;inset:0;opacity:.01;position:absolute;width:100%;z-index:1}.boxes{display:flex;gap:.5rem}.box{align-items:center;background:var(--su-field-surface, transparent);border:1px solid var(--su-field-border, rgba(127, 127, 127, .4));border-radius:.5rem;color:var(--su-field-text, currentColor);display:flex;font-family:var(--su-field-font-mono, monospace);font-size:1.375rem;height:3rem;justify-content:center;transition:border-color .2s ease,background-color .2s ease,color .2s ease;width:2.5rem}.box.is-filled{animation:box-pop .22s cubic-bezier(.34,1.56,.64,1);border-color:var(--su-field-filled-border, currentColor)}.field:focus-visible+.boxes .box.is-current,.field:focus+.boxes .box.is-current{border-color:var(--su-field-accent, #3b82f6);box-shadow:0 0 0 3px color-mix(in srgb,var(--su-field-accent, #3b82f6) 25%,transparent)}.boxes.is-complete .box{animation:box-done .36s ease calc(var(--index) * 60ms) both;background:var(--su-field-success-bg, #e6f4ea);border-color:var(--su-field-success, #2e8b57);color:var(--su-field-success, #2e8b57);transition-delay:calc(var(--index) * 60ms)}@keyframes box-pop{0%{transform:scale(.85)}}@keyframes box-done{50%{transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){.box,.boxes.is-complete .box{animation:none;transition:none}}\n"] }]
30
+ }] });
31
+
32
+ /** How strong a new password looks, one step per bar of the meter */
33
+ const SU_STRENGTH_LEVELS = ['weak', 'fair', 'good', 'strong'];
34
+ /** Shortest password the meter counts as more than weak, unless told otherwise */
35
+ const SU_DEFAULT_MIN_PASSWORD_LENGTH = 8;
36
+ /**
37
+ * Bars of the strength meter a password fills, from 0 (empty) to 4. Under the minimum length it stays at one bar,
38
+ * whatever else it has. Then one bar each for: four characters past the minimum, letters with digits, and symbols or
39
+ * mixed case.
40
+ */
41
+ function suPasswordStrength(password, minLength = SU_DEFAULT_MIN_PASSWORD_LENGTH) {
42
+ if (password.length === 0) {
43
+ return 0;
44
+ }
45
+ if (password.length < minLength) {
46
+ return 1;
47
+ }
48
+ const extras = [
49
+ password.length >= minLength + 4,
50
+ /\p{L}/u.test(password) && /\d/.test(password),
51
+ /[^\p{L}\d]/u.test(password) ||
52
+ (/\p{Lu}/u.test(password) && /\p{Ll}/u.test(password)),
53
+ ].filter(Boolean).length;
54
+ return 1 + extras;
55
+ }
56
+ /** The meter's word for a number of bars, or null for an empty password */
57
+ const suStrengthLevel = (bars) => SU_STRENGTH_LEVELS[bars - 1] ?? null;
58
+
59
+ /**
60
+ * Four bars under a new password that fill, and change colour, as the password gets stronger. It follows the field's
61
+ * own typing, so forms keep their plain fields; a form that empties the field by code sends it an `input` event.
62
+ * Its texts come in as inputs, so it fits any language.
63
+ */
64
+ class SuStrengthMeterComponent {
65
+ field = input.required();
66
+ /** The meter's name for screen readers, e.g. "Password strength" */
67
+ label = input.required();
68
+ /** The word shown for each step */
69
+ levelNames = input.required();
70
+ minLength = input(SU_DEFAULT_MIN_PASSWORD_LENGTH);
71
+ password = signal('');
72
+ steps = SU_STRENGTH_LEVELS;
73
+ bars = computed(() => suPasswordStrength(this.password(), this.minLength()));
74
+ level = computed(() => suStrengthLevel(this.bars()));
75
+ levelName = computed(() => {
76
+ const level = this.level();
77
+ return level ? this.levelNames()[level] : null;
78
+ });
79
+ constructor() {
80
+ effect(onCleanup => {
81
+ const field = this.field();
82
+ const read = () => this.password.set(field.value);
83
+ read();
84
+ field.addEventListener('input', read);
85
+ onCleanup(() => field.removeEventListener('input', read));
86
+ });
87
+ }
88
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStrengthMeterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
89
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuStrengthMeterComponent, isStandalone: true, selector: "su-lib-strength-meter", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, levelNames: { classPropertyName: "levelNames", publicName: "levelNames", isSignal: true, isRequired: true, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n class=\"bars\"\n role=\"meter\"\n [attr.aria-label]=\"label()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"steps.length\"\n [attr.aria-valuenow]=\"bars()\"\n [attr.aria-valuetext]=\"levelName()\"\n>\n @for (step of steps; track step; let index = $index) {\n <span class=\"bar\" [class.is-filled]=\"index < bars()\" [style.--index]=\"index\"></span>\n }\n</div>\n@if (levelName(); as name) {\n <small class=\"level\" [attr.data-level]=\"level()\" aria-hidden=\"true\">{{ name }}</small>\n}\n", styles: [":host{display:grid;gap:.375rem}.bars{display:grid;gap:.375rem;grid-template-columns:repeat(4,1fr)}.bar{background:var(--su-field-track, rgba(127, 127, 127, .2));border-radius:9999px;height:.3125rem;overflow:hidden;position:relative}.bar:after{background:var(--meter-colour, var(--su-field-danger, #c0392b));border-radius:inherit;content:\"\";inset:0;position:absolute;transform:scaleX(0);transform-origin:left;transition:transform .26s cubic-bezier(.34,1.56,.64,1) calc(var(--index) * 40ms),background-color .26s ease}.bar.is-filled:after{transform:scaleX(1)}:host:has(.level[data-level=fair]){--meter-colour: var(--su-field-warning, #c98a00)}:host:has(.level[data-level=good]),:host:has(.level[data-level=strong]){--meter-colour: var(--su-field-success, #2e8b57)}.level{color:var(--meter-colour, var(--su-field-danger, #c0392b));font-size:.75rem;font-weight:600;justify-self:end}@media(prefers-reduced-motion:reduce){.bar:after{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
90
+ }
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStrengthMeterComponent, decorators: [{
92
+ type: Component,
93
+ args: [{ selector: 'su-lib-strength-meter', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"bars\"\n role=\"meter\"\n [attr.aria-label]=\"label()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"steps.length\"\n [attr.aria-valuenow]=\"bars()\"\n [attr.aria-valuetext]=\"levelName()\"\n>\n @for (step of steps; track step; let index = $index) {\n <span class=\"bar\" [class.is-filled]=\"index < bars()\" [style.--index]=\"index\"></span>\n }\n</div>\n@if (levelName(); as name) {\n <small class=\"level\" [attr.data-level]=\"level()\" aria-hidden=\"true\">{{ name }}</small>\n}\n", styles: [":host{display:grid;gap:.375rem}.bars{display:grid;gap:.375rem;grid-template-columns:repeat(4,1fr)}.bar{background:var(--su-field-track, rgba(127, 127, 127, .2));border-radius:9999px;height:.3125rem;overflow:hidden;position:relative}.bar:after{background:var(--meter-colour, var(--su-field-danger, #c0392b));border-radius:inherit;content:\"\";inset:0;position:absolute;transform:scaleX(0);transform-origin:left;transition:transform .26s cubic-bezier(.34,1.56,.64,1) calc(var(--index) * 40ms),background-color .26s ease}.bar.is-filled:after{transform:scaleX(1)}:host:has(.level[data-level=fair]){--meter-colour: var(--su-field-warning, #c98a00)}:host:has(.level[data-level=good]),:host:has(.level[data-level=strong]){--meter-colour: var(--su-field-success, #2e8b57)}.level{color:var(--meter-colour, var(--su-field-danger, #c0392b));font-size:.75rem;font-weight:600;justify-self:end}@media(prefers-reduced-motion:reduce){.bar:after{transition:none}}\n"] }]
94
+ }], ctorParameters: () => [] });
95
+
96
+ /** A soft spring that overshoots a little, as the box settles on its new height */
97
+ const SPRING = 'height 240ms cubic-bezier(0.34, 1.56, 0.64, 1)';
98
+ /**
99
+ * A text box that grows a line at a time as the text gets longer, and shrinks back when it is emptied, with a soft
100
+ * spring (none for visitors who asked their device for less motion). `[suAutoGrow]="false"` leaves it as it is.
101
+ */
102
+ class SuAutoGrowDirective {
103
+ isOn = input(true, { alias: 'suAutoGrow', transform: booleanAttribute });
104
+ box = inject(ElementRef).nativeElement;
105
+ constructor() {
106
+ const destroyRef = inject(DestroyRef);
107
+ afterNextRender(() => {
108
+ const onReset = () => setTimeout(() => this.fit());
109
+ this.box.form?.addEventListener('reset', onReset);
110
+ destroyRef.onDestroy(() => this.box.form?.removeEventListener('reset', onReset));
111
+ });
112
+ }
113
+ fit() {
114
+ if (!this.isOn()) {
115
+ return;
116
+ }
117
+ const box = this.box;
118
+ const from = box.offsetHeight;
119
+ box.style.transition = 'none';
120
+ box.style.height = 'auto';
121
+ const to = box.scrollHeight + box.offsetHeight - box.clientHeight;
122
+ box.style.height = `${from}px`;
123
+ void box.offsetHeight;
124
+ box.style.overflowY = 'hidden';
125
+ box.style.transition = matchMedia('(prefers-reduced-motion: reduce)')
126
+ .matches
127
+ ? 'none'
128
+ : SPRING;
129
+ box.style.height = `${to}px`;
130
+ }
131
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuAutoGrowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
132
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.25", type: SuAutoGrowDirective, isStandalone: true, selector: "textarea[suAutoGrow]", inputs: { isOn: { classPropertyName: "isOn", publicName: "suAutoGrow", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "fit()" } }, ngImport: i0 });
133
+ }
134
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuAutoGrowDirective, decorators: [{
135
+ type: Directive,
136
+ args: [{
137
+ selector: 'textarea[suAutoGrow]',
138
+ host: { '(input)': 'fit()' },
139
+ }]
140
+ }], ctorParameters: () => [] });
141
+
142
+ /**
143
+ * A real checkbox (`role="switch"`) drawn as a sliding switch: the knob stretches while pressed, springs across and a
144
+ * tick pops in when it's on. Put the label inside: `<su-lib-switch [(checked)]="on">Reduce motion</su-lib-switch>`.
145
+ *
146
+ * It shows a click at once and follows `checked` whenever it changes. While `busy` (e.g. saving the change) it ignores
147
+ * clicks, and once no longer busy it shows `checked` again, so a change that failed to save flips back.
148
+ */
149
+ class SuSwitchComponent {
150
+ checked = input(false, { transform: booleanAttribute });
151
+ disabled = input(false, { transform: booleanAttribute });
152
+ /** Busy saving the change: clicks are ignored, and `aria-busy` is set */
153
+ busy = input(false, { transform: booleanAttribute });
154
+ /** @default 'end' */
155
+ labelPosition = input('end');
156
+ /** @default 'medium' */
157
+ size = input('medium');
158
+ /** Switched by the user: the new value */
159
+ checkedChange = output();
160
+ shown = linkedSignal(() => this.checked());
161
+ constructor() {
162
+ effect(() => {
163
+ if (!this.busy()) {
164
+ untracked(() => this.shown.set(this.checked()));
165
+ }
166
+ });
167
+ }
168
+ onClick(event) {
169
+ if (this.busy()) {
170
+ event.preventDefault();
171
+ }
172
+ }
173
+ onChange(event) {
174
+ if (event.target instanceof HTMLInputElement) {
175
+ this.shown.set(event.target.checked);
176
+ this.checkedChange.emit(event.target.checked);
177
+ }
178
+ }
179
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuSwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
180
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: SuSwitchComponent, isStandalone: true, selector: "su-lib-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<label class=\"su-switch su-switch-{{ size() }}\" [class.is-label-start]=\"labelPosition() === 'start'\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [checked]=\"shown()\"\n [disabled]=\"disabled()\"\n [attr.aria-busy]=\"busy() ? true : null\"\n (click)=\"onClick($event)\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-switch-track\" aria-hidden=\"true\"></span>\n <span class=\"su-switch-label\"><ng-content /></span>\n</label>\n", styles: [":host{display:block}.su-switch{align-items:center;cursor:pointer;display:inline-flex;font-weight:var(--su-switch-label-weight, 500);gap:.75rem}.su-switch input{height:1px;opacity:0;position:absolute;width:1px}.su-switch.is-label-start{display:flex;flex-direction:row-reverse;gap:1rem;justify-content:space-between;width:100%}.su-switch-label{display:grid;gap:.125rem}.is-label-start .su-switch-label{flex:1}.su-switch-label:empty{display:none}.su-switch-track{--switch-width: var(--su-switch-width, 3rem);--switch-height: var(--su-switch-height, 1.75rem);--switch-inset: .1875rem;--switch-knob: calc(var(--switch-height) - 2 * var(--switch-inset));--switch-travel: calc(var(--switch-width) - var(--switch-height));--switch-stretch: calc(var(--switch-knob) * .3);--knob-width: var(--switch-knob);--knob-move: 0rem;--knob-scale: .7;--knob-colour: var(--su-switch-knob-off, #9b9a97);background:var(--su-switch-track-off, rgba(0, 0, 0, .06));border-radius:9999px;box-shadow:inset 0 0 0 2px var(--su-switch-border, rgba(0, 0, 0, .14));flex-shrink:0;height:var(--switch-height);position:relative;transition:background-color .2s ease,box-shadow .2s ease;width:var(--switch-width)}.su-switch-small .su-switch-track{--switch-width: var(--su-switch-small-width, 2.125rem);--switch-height: var(--su-switch-small-height, 1.25rem)}.su-switch-track:after{background:var(--knob-colour);border-radius:9999px;box-shadow:0 1px 3px #00000040;content:\"\";height:var(--switch-knob);left:var(--switch-inset);position:absolute;scale:var(--knob-scale);top:var(--switch-inset);transition:translate .25s cubic-bezier(.34,1.56,.64,1),width .2s ease,scale .25s cubic-bezier(.34,1.56,.64,1),background-color .2s ease;translate:var(--knob-move) 0;width:var(--knob-width)}.su-switch-track:before{background:var(--su-switch-tick, #fff);content:\"\";height:var(--switch-knob);left:calc(var(--switch-inset) + var(--switch-travel));mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E\") center/55% no-repeat;opacity:0;position:absolute;scale:.3;top:var(--switch-inset);transition:opacity .15s ease,scale .25s cubic-bezier(.34,1.56,.64,1);width:var(--switch-knob);z-index:1}.su-switch:active input:not(:disabled)+.su-switch-track{--knob-scale: 1;--knob-width: calc(var(--switch-knob) + var(--switch-stretch))}.su-switch input:checked+.su-switch-track{--knob-move: var(--switch-travel);--knob-scale: 1;--knob-colour: var(--su-switch-on, #111);background:var(--su-switch-track-on, color-mix(in srgb, var(--su-switch-on, #111) 35%, Canvas));box-shadow:none}.su-switch input:checked+.su-switch-track:before{opacity:1;scale:1}.su-switch:active input:checked:not(:disabled)+.su-switch-track{--knob-move: calc(var(--switch-travel) - var(--switch-stretch))}.su-switch:active input:checked:not(:disabled)+.su-switch-track:before{opacity:0}.su-switch input:focus-visible+.su-switch-track{outline:var(--su-switch-focus-outline, 2px solid currentColor);outline-offset:2px}.su-switch:has(input:disabled){cursor:not-allowed}.su-switch input:disabled+.su-switch-track{opacity:.5}@media(prefers-reduced-motion:reduce){.su-switch-track,.su-switch-track:after,.su-switch-track:before{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
181
+ }
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuSwitchComponent, decorators: [{
183
+ type: Component,
184
+ args: [{ selector: 'su-lib-switch', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"su-switch su-switch-{{ size() }}\" [class.is-label-start]=\"labelPosition() === 'start'\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [checked]=\"shown()\"\n [disabled]=\"disabled()\"\n [attr.aria-busy]=\"busy() ? true : null\"\n (click)=\"onClick($event)\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-switch-track\" aria-hidden=\"true\"></span>\n <span class=\"su-switch-label\"><ng-content /></span>\n</label>\n", styles: [":host{display:block}.su-switch{align-items:center;cursor:pointer;display:inline-flex;font-weight:var(--su-switch-label-weight, 500);gap:.75rem}.su-switch input{height:1px;opacity:0;position:absolute;width:1px}.su-switch.is-label-start{display:flex;flex-direction:row-reverse;gap:1rem;justify-content:space-between;width:100%}.su-switch-label{display:grid;gap:.125rem}.is-label-start .su-switch-label{flex:1}.su-switch-label:empty{display:none}.su-switch-track{--switch-width: var(--su-switch-width, 3rem);--switch-height: var(--su-switch-height, 1.75rem);--switch-inset: .1875rem;--switch-knob: calc(var(--switch-height) - 2 * var(--switch-inset));--switch-travel: calc(var(--switch-width) - var(--switch-height));--switch-stretch: calc(var(--switch-knob) * .3);--knob-width: var(--switch-knob);--knob-move: 0rem;--knob-scale: .7;--knob-colour: var(--su-switch-knob-off, #9b9a97);background:var(--su-switch-track-off, rgba(0, 0, 0, .06));border-radius:9999px;box-shadow:inset 0 0 0 2px var(--su-switch-border, rgba(0, 0, 0, .14));flex-shrink:0;height:var(--switch-height);position:relative;transition:background-color .2s ease,box-shadow .2s ease;width:var(--switch-width)}.su-switch-small .su-switch-track{--switch-width: var(--su-switch-small-width, 2.125rem);--switch-height: var(--su-switch-small-height, 1.25rem)}.su-switch-track:after{background:var(--knob-colour);border-radius:9999px;box-shadow:0 1px 3px #00000040;content:\"\";height:var(--switch-knob);left:var(--switch-inset);position:absolute;scale:var(--knob-scale);top:var(--switch-inset);transition:translate .25s cubic-bezier(.34,1.56,.64,1),width .2s ease,scale .25s cubic-bezier(.34,1.56,.64,1),background-color .2s ease;translate:var(--knob-move) 0;width:var(--knob-width)}.su-switch-track:before{background:var(--su-switch-tick, #fff);content:\"\";height:var(--switch-knob);left:calc(var(--switch-inset) + var(--switch-travel));mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E\") center/55% no-repeat;opacity:0;position:absolute;scale:.3;top:var(--switch-inset);transition:opacity .15s ease,scale .25s cubic-bezier(.34,1.56,.64,1);width:var(--switch-knob);z-index:1}.su-switch:active input:not(:disabled)+.su-switch-track{--knob-scale: 1;--knob-width: calc(var(--switch-knob) + var(--switch-stretch))}.su-switch input:checked+.su-switch-track{--knob-move: var(--switch-travel);--knob-scale: 1;--knob-colour: var(--su-switch-on, #111);background:var(--su-switch-track-on, color-mix(in srgb, var(--su-switch-on, #111) 35%, Canvas));box-shadow:none}.su-switch input:checked+.su-switch-track:before{opacity:1;scale:1}.su-switch:active input:checked:not(:disabled)+.su-switch-track{--knob-move: calc(var(--switch-travel) - var(--switch-stretch))}.su-switch:active input:checked:not(:disabled)+.su-switch-track:before{opacity:0}.su-switch input:focus-visible+.su-switch-track{outline:var(--su-switch-focus-outline, 2px solid currentColor);outline-offset:2px}.su-switch:has(input:disabled){cursor:not-allowed}.su-switch input:disabled+.su-switch-track{opacity:.5}@media(prefers-reduced-motion:reduce){.su-switch-track,.su-switch-track:after,.su-switch-track:before{transition:none}}\n"] }]
185
+ }], ctorParameters: () => [] });
186
+
187
+ /** Domains `suCheckEmail` suggests when one is mistyped */
188
+ const SU_COMMON_EMAIL_DOMAINS = [
189
+ 'gmail.com',
190
+ 'hotmail.com',
191
+ 'outlook.com',
192
+ 'live.com',
193
+ 'yahoo.com',
194
+ 'icloud.com',
195
+ 'me.com',
196
+ 'aol.com',
197
+ 'proton.me',
198
+ 'protonmail.com',
199
+ 'gmx.com',
200
+ 'yandex.com',
201
+ 'hotmail.es',
202
+ 'yahoo.es',
203
+ ];
204
+ /** How far a typed domain may be from a common one, in single-letter edits, to suggest it */
205
+ const MAX_TYPO_DISTANCE = 2;
206
+ function editDistance(a, b) {
207
+ let previous = Array.from({ length: b.length + 1 }, (_, index) => index);
208
+ for (let i = 1; i <= a.length; i++) {
209
+ const current = [i];
210
+ for (let j = 1; j <= b.length; j++) {
211
+ current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
212
+ }
213
+ previous = current;
214
+ }
215
+ return previous[b.length];
216
+ }
217
+ /** The common domain a typed one most likely meant, or null when it's already common or nothing is close */
218
+ function closestDomain(domain, domains) {
219
+ if (!domain || domains.includes(domain)) {
220
+ return null;
221
+ }
222
+ let best = null;
223
+ for (const candidate of domains) {
224
+ const distance = editDistance(domain, candidate);
225
+ if (distance <= MAX_TYPO_DISTANCE && (!best || distance < best.distance)) {
226
+ best = { domain: candidate, distance };
227
+ }
228
+ }
229
+ return best?.domain ?? null;
230
+ }
231
+ function problemOf(email) {
232
+ if (email === '') {
233
+ return 'empty';
234
+ }
235
+ if (/\s/.test(email)) {
236
+ return 'spaces';
237
+ }
238
+ const parts = email.split('@');
239
+ if (parts.length !== 2) {
240
+ return 'at';
241
+ }
242
+ const [name, domain] = parts;
243
+ if (!name) {
244
+ return 'name';
245
+ }
246
+ if (!domain) {
247
+ return 'domain';
248
+ }
249
+ const labels = domain.split('.');
250
+ if (labels.length < 2 || labels.some((label) => label === '')) {
251
+ return 'dot';
252
+ }
253
+ return /^\p{L}{2,}$/u.test(labels[labels.length - 1]) ? null : 'ending';
254
+ }
255
+ /**
256
+ * Checks an email address the way people mistype them: empty, spaces, not exactly one @, nothing before or after it,
257
+ * a domain without a proper dot, or an ending shorter than two letters. It also suggests a common domain for a
258
+ * likely typo (`gmial.com` → `gmail.com`), even when the address is otherwise valid.
259
+ */
260
+ function suCheckEmail(value, domains = SU_COMMON_EMAIL_DOMAINS) {
261
+ const email = value.trim();
262
+ const problem = problemOf(email);
263
+ const [name = '', domain = ''] = email.split('@');
264
+ const fixable = problem === null || problem === 'dot' || problem === 'ending';
265
+ const fix = fixable && name ? closestDomain(domain.toLowerCase(), domains) : null;
266
+ return { valid: problem === null, problem, suggestion: fix ? `${name}@${fix}` : null };
267
+ }
268
+
269
+ const SU_EMAIL_MESSAGES = {
270
+ empty: 'Enter your email address',
271
+ spaces: 'An email address has no spaces',
272
+ at: 'An email address has one @, like name@example.com',
273
+ name: 'Add the part before the @',
274
+ domain: 'Add the part after the @, like example.com',
275
+ dot: 'The part after the @ needs a dot, like example.com',
276
+ ending: 'The ending after the last dot needs at least two letters',
277
+ suggestion: 'Did you mean',
278
+ };
279
+ let nextId = 0;
280
+ /**
281
+ * An email field that checks the address the way people mistype it, and suggests a common domain for a likely typo
282
+ * (`gmial.com` → `gmail.com`, applied with one tap). It stays quiet while typing and says what's wrong once the field
283
+ * is left; a tick shows when the address looks right.
284
+ */
285
+ class SuEmailFieldComponent {
286
+ value = model('');
287
+ /** The visible label */
288
+ label = input.required();
289
+ placeholder = input();
290
+ /** An empty field counts as a problem @default false */
291
+ required = input(false, { transform: booleanAttribute });
292
+ messages = input({});
293
+ /** The label sits inside the field and moves up onto its border when the field is focused or filled @default false */
294
+ floating = input(false, { transform: booleanAttribute });
295
+ /** Shows the problem before the field was left, e.g. when its form is sent @default false */
296
+ showProblem = input(false, { transform: booleanAttribute });
297
+ /** Domains to suggest when one is mistyped */
298
+ domains = input(SU_COMMON_EMAIL_DOMAINS);
299
+ /** Whether the address is valid, on every change */
300
+ validityChange = output();
301
+ id = `su-email-${nextId++}`;
302
+ touched = signal(false);
303
+ check = computed(() => suCheckEmail(this.value(), this.domains()));
304
+ text = computed(() => ({ ...SU_EMAIL_MESSAGES, ...this.messages() }));
305
+ /** The problem to show: once the field was left or `showProblem` is on, and an empty field only when it's required */
306
+ problem = computed(() => {
307
+ const { problem } = this.check();
308
+ const isShown = this.touched() || this.showProblem();
309
+ if (!isShown || !problem || (problem === 'empty' && !this.required())) {
310
+ return null;
311
+ }
312
+ return problem;
313
+ });
314
+ constructor() {
315
+ effect(() => this.validityChange.emit(this.check().valid));
316
+ }
317
+ onInput(event) {
318
+ if (event.target instanceof HTMLInputElement) {
319
+ this.value.set(event.target.value);
320
+ }
321
+ }
322
+ apply(suggestion) {
323
+ this.value.set(suggestion);
324
+ this.touched.set(true);
325
+ }
326
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuEmailFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
327
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuEmailFieldComponent, isStandalone: true, selector: "su-lib-email-field", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null }, floating: { classPropertyName: "floating", publicName: "floating", isSignal: true, isRequired: false, transformFunction: null }, showProblem: { classPropertyName: "showProblem", publicName: "showProblem", isSignal: true, isRequired: false, transformFunction: null }, domains: { classPropertyName: "domains", publicName: "domains", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", validityChange: "validityChange" }, host: { properties: { "class.is-floating": "floating()" } }, ngImport: i0, template: "@let result = check();\n@let t = text();\n@if (!floating()) {\n <label class=\"su-email-label\" [for]=\"id\">{{ label() }}</label>\n}\n<div class=\"su-email-box\" [class.is-valid]=\"result.valid\" [class.is-invalid]=\"problem() !== null\">\n <input\n class=\"su-email-input\"\n type=\"email\"\n inputmode=\"email\"\n autocomplete=\"email\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [id]=\"id\"\n [value]=\"value()\"\n [required]=\"required()\"\n [attr.placeholder]=\"floating() ? ' ' : (placeholder() ?? null)\"\n [attr.aria-invalid]=\"problem() !== null ? true : null\"\n [attr.aria-describedby]=\"id + '-message'\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (floating()) {\n <label class=\"su-email-label su-email-floating-label\" [for]=\"id\">{{ label() }}</label>\n }\n <span class=\"su-email-tick\" aria-hidden=\"true\"></span>\n</div>\n<p class=\"su-email-message\" aria-live=\"polite\" [id]=\"id + '-message'\">\n @if (problem(); as problem) {\n <span class=\"su-email-problem\">{{ t[problem] }}</span>\n }\n @if (result.suggestion; as suggestion) {\n <span class=\"su-email-suggestion\">\n {{ t.suggestion }}\n <button type=\"button\" class=\"su-email-fix\" (click)=\"apply(suggestion)\">{{ suggestion }}</button>?\n </span>\n }\n</p>\n", styles: [":host{display:grid;gap:.375rem}.su-email-label{font-size:.875rem}.su-email-box{position:relative}.su-email-input{background:var(--su-field-surface, transparent);border:1px solid var(--su-field-border, rgba(127, 127, 127, .4));border-radius:.5rem;box-sizing:border-box;color:var(--su-field-text, currentColor);font:inherit;min-height:2.75rem;padding:.5rem 2.5rem .5rem .75rem;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.su-email-input:focus-visible{border-color:var(--su-field-accent, #3b82f6);box-shadow:0 0 0 3px color-mix(in srgb,var(--su-field-accent, #3b82f6) 25%,transparent);outline:none}.is-valid .su-email-input{border-color:var(--su-field-success, #2e8b57)}.is-invalid .su-email-input{animation:su-email-nudge .26s ease;border-color:var(--su-field-danger, #c0392b)}.su-email-tick{background:var(--su-field-success, #2e8b57);height:1.1rem;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E\") center/contain no-repeat;opacity:0;pointer-events:none;position:absolute;right:.75rem;scale:.3;top:50%;transition:opacity .15s ease,scale .25s cubic-bezier(.34,1.56,.64,1);translate:0 -50%;width:1.1rem}.is-valid .su-email-tick{opacity:1;scale:1}.su-email-message{display:grid;font-size:.8125rem;gap:.25rem;margin:0;min-height:1.25rem}.su-email-message:empty{min-height:0}.su-email-problem{color:var(--su-field-danger, #c0392b)}.su-email-suggestion{color:var(--su-field-text, currentColor)}.su-email-fix{background:none;border:0;border-radius:4px;color:var(--su-field-accent, #3b82f6);cursor:pointer;font:inherit;font-weight:600;padding:0;text-decoration:underline;text-underline-offset:2px}.su-email-fix:focus-visible{outline:2px solid var(--su-field-accent, #3b82f6);outline-offset:2px}:host(.is-floating) .su-email-input{line-height:1.25rem;min-height:3.25rem;padding-block:1.375rem .375rem}.su-email-floating-label{color:var(--su-field-label, color-mix(in srgb, var(--su-field-text, currentColor) 60%, transparent));font-size:1rem;left:.75rem;line-height:1.25rem;pointer-events:none;position:absolute;top:1rem;transform-origin:left top;transition:translate .2s cubic-bezier(.22,1,.36,1),scale .2s cubic-bezier(.22,1,.36,1),color .2s ease}.su-email-box:focus-within .su-email-floating-label,.su-email-box:has(.su-email-input:not(:placeholder-shown)) .su-email-floating-label{scale:.75;translate:0 -.6875rem}.su-email-box:focus-within .su-email-floating-label{color:var(--su-field-accent, #3b82f6)}.is-invalid .su-email-floating-label{color:var(--su-field-danger, #c0392b)}@keyframes su-email-nudge{25%{translate:-3px 0}75%{translate:3px 0}}@media(prefers-reduced-motion:reduce){.is-invalid .su-email-input{animation:none}.su-email-tick,.su-email-floating-label{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
328
+ }
329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuEmailFieldComponent, decorators: [{
330
+ type: Component,
331
+ args: [{ selector: 'su-lib-email-field', changeDetection: ChangeDetectionStrategy.OnPush, host: { '[class.is-floating]': 'floating()' }, template: "@let result = check();\n@let t = text();\n@if (!floating()) {\n <label class=\"su-email-label\" [for]=\"id\">{{ label() }}</label>\n}\n<div class=\"su-email-box\" [class.is-valid]=\"result.valid\" [class.is-invalid]=\"problem() !== null\">\n <input\n class=\"su-email-input\"\n type=\"email\"\n inputmode=\"email\"\n autocomplete=\"email\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [id]=\"id\"\n [value]=\"value()\"\n [required]=\"required()\"\n [attr.placeholder]=\"floating() ? ' ' : (placeholder() ?? null)\"\n [attr.aria-invalid]=\"problem() !== null ? true : null\"\n [attr.aria-describedby]=\"id + '-message'\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (floating()) {\n <label class=\"su-email-label su-email-floating-label\" [for]=\"id\">{{ label() }}</label>\n }\n <span class=\"su-email-tick\" aria-hidden=\"true\"></span>\n</div>\n<p class=\"su-email-message\" aria-live=\"polite\" [id]=\"id + '-message'\">\n @if (problem(); as problem) {\n <span class=\"su-email-problem\">{{ t[problem] }}</span>\n }\n @if (result.suggestion; as suggestion) {\n <span class=\"su-email-suggestion\">\n {{ t.suggestion }}\n <button type=\"button\" class=\"su-email-fix\" (click)=\"apply(suggestion)\">{{ suggestion }}</button>?\n </span>\n }\n</p>\n", styles: [":host{display:grid;gap:.375rem}.su-email-label{font-size:.875rem}.su-email-box{position:relative}.su-email-input{background:var(--su-field-surface, transparent);border:1px solid var(--su-field-border, rgba(127, 127, 127, .4));border-radius:.5rem;box-sizing:border-box;color:var(--su-field-text, currentColor);font:inherit;min-height:2.75rem;padding:.5rem 2.5rem .5rem .75rem;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.su-email-input:focus-visible{border-color:var(--su-field-accent, #3b82f6);box-shadow:0 0 0 3px color-mix(in srgb,var(--su-field-accent, #3b82f6) 25%,transparent);outline:none}.is-valid .su-email-input{border-color:var(--su-field-success, #2e8b57)}.is-invalid .su-email-input{animation:su-email-nudge .26s ease;border-color:var(--su-field-danger, #c0392b)}.su-email-tick{background:var(--su-field-success, #2e8b57);height:1.1rem;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E\") center/contain no-repeat;opacity:0;pointer-events:none;position:absolute;right:.75rem;scale:.3;top:50%;transition:opacity .15s ease,scale .25s cubic-bezier(.34,1.56,.64,1);translate:0 -50%;width:1.1rem}.is-valid .su-email-tick{opacity:1;scale:1}.su-email-message{display:grid;font-size:.8125rem;gap:.25rem;margin:0;min-height:1.25rem}.su-email-message:empty{min-height:0}.su-email-problem{color:var(--su-field-danger, #c0392b)}.su-email-suggestion{color:var(--su-field-text, currentColor)}.su-email-fix{background:none;border:0;border-radius:4px;color:var(--su-field-accent, #3b82f6);cursor:pointer;font:inherit;font-weight:600;padding:0;text-decoration:underline;text-underline-offset:2px}.su-email-fix:focus-visible{outline:2px solid var(--su-field-accent, #3b82f6);outline-offset:2px}:host(.is-floating) .su-email-input{line-height:1.25rem;min-height:3.25rem;padding-block:1.375rem .375rem}.su-email-floating-label{color:var(--su-field-label, color-mix(in srgb, var(--su-field-text, currentColor) 60%, transparent));font-size:1rem;left:.75rem;line-height:1.25rem;pointer-events:none;position:absolute;top:1rem;transform-origin:left top;transition:translate .2s cubic-bezier(.22,1,.36,1),scale .2s cubic-bezier(.22,1,.36,1),color .2s ease}.su-email-box:focus-within .su-email-floating-label,.su-email-box:has(.su-email-input:not(:placeholder-shown)) .su-email-floating-label{scale:.75;translate:0 -.6875rem}.su-email-box:focus-within .su-email-floating-label{color:var(--su-field-accent, #3b82f6)}.is-invalid .su-email-floating-label{color:var(--su-field-danger, #c0392b)}@keyframes su-email-nudge{25%{translate:-3px 0}75%{translate:3px 0}}@media(prefers-reduced-motion:reduce){.is-invalid .su-email-input{animation:none}.su-email-tick,.su-email-floating-label{transition:none}}\n"] }]
332
+ }], ctorParameters: () => [] });
333
+
334
+ /**
335
+ * A real checkbox whose tick draws itself in, with a small squash when pressed and a dash when partly checked. Put the
336
+ * label inside: `<su-lib-checkbox [(checked)]="agree">I agree</su-lib-checkbox>`.
337
+ */
338
+ class SuCheckboxComponent {
339
+ checked = input(false, { transform: booleanAttribute });
340
+ /** Partly checked, e.g. some of a group; a click checks it */
341
+ indeterminate = input(false, { transform: booleanAttribute });
342
+ disabled = input(false, { transform: booleanAttribute });
343
+ /** Ticked or unticked by the user: the new value */
344
+ checkedChange = output();
345
+ shown = linkedSignal(() => this.checked());
346
+ onChange(event) {
347
+ if (event.target instanceof HTMLInputElement) {
348
+ this.shown.set(event.target.checked);
349
+ this.checkedChange.emit(event.target.checked);
350
+ }
351
+ }
352
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
353
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: SuCheckboxComponent, isStandalone: true, selector: "su-lib-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<label class=\"su-checkbox\" [class.is-mixed]=\"indeterminate() && !shown()\">\n <input\n type=\"checkbox\"\n [checked]=\"shown()\"\n [indeterminate]=\"indeterminate() && !shown()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-checkbox-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\">\n <path class=\"su-checkbox-tick\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"su-checkbox-dash\" d=\"M6 12h12\" />\n </svg>\n </span>\n <span class=\"su-checkbox-label\"><ng-content /></span>\n</label>\n", styles: [":host{display:block}.su-checkbox{align-items:center;cursor:pointer;display:inline-flex;gap:.625rem}.su-checkbox input{height:1px;opacity:0;position:absolute;width:1px}.su-checkbox-box{align-items:center;background:var(--su-field-surface, transparent);border:2px solid var(--su-field-border, rgba(127, 127, 127, .5));border-radius:.375rem;box-sizing:border-box;display:inline-flex;flex-shrink:0;height:var(--su-checkbox-size, 1.25rem);justify-content:center;transition:background-color .18s ease,border-color .18s ease,scale .25s cubic-bezier(.34,1.56,.64,1);width:var(--su-checkbox-size, 1.25rem)}.su-checkbox-box svg{fill:none;height:80%;stroke:var(--su-checkbox-tick, #fff);stroke-linecap:round;stroke-linejoin:round;stroke-width:3.5;width:80%}.su-checkbox-tick,.su-checkbox-dash{stroke-dasharray:24;stroke-dashoffset:24;transition:stroke-dashoffset .22s ease-out 60ms}.su-checkbox:active input:not(:disabled)+.su-checkbox-box{scale:.86}.su-checkbox input:checked+.su-checkbox-box,.is-mixed .su-checkbox-box{background:var(--su-field-accent, #3b82f6);border-color:var(--su-field-accent, #3b82f6)}.su-checkbox input:checked+.su-checkbox-box .su-checkbox-tick,.is-mixed .su-checkbox-dash{stroke-dashoffset:0}.su-checkbox input:focus-visible+.su-checkbox-box{outline:2px solid var(--su-field-accent, #3b82f6);outline-offset:2px}.su-checkbox:has(input:disabled){cursor:not-allowed;opacity:.5}.su-checkbox-label:empty{display:none}@media(prefers-reduced-motion:reduce){.su-checkbox-box,.su-checkbox-tick,.su-checkbox-dash{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
354
+ }
355
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuCheckboxComponent, decorators: [{
356
+ type: Component,
357
+ args: [{ selector: 'su-lib-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"su-checkbox\" [class.is-mixed]=\"indeterminate() && !shown()\">\n <input\n type=\"checkbox\"\n [checked]=\"shown()\"\n [indeterminate]=\"indeterminate() && !shown()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-checkbox-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\">\n <path class=\"su-checkbox-tick\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"su-checkbox-dash\" d=\"M6 12h12\" />\n </svg>\n </span>\n <span class=\"su-checkbox-label\"><ng-content /></span>\n</label>\n", styles: [":host{display:block}.su-checkbox{align-items:center;cursor:pointer;display:inline-flex;gap:.625rem}.su-checkbox input{height:1px;opacity:0;position:absolute;width:1px}.su-checkbox-box{align-items:center;background:var(--su-field-surface, transparent);border:2px solid var(--su-field-border, rgba(127, 127, 127, .5));border-radius:.375rem;box-sizing:border-box;display:inline-flex;flex-shrink:0;height:var(--su-checkbox-size, 1.25rem);justify-content:center;transition:background-color .18s ease,border-color .18s ease,scale .25s cubic-bezier(.34,1.56,.64,1);width:var(--su-checkbox-size, 1.25rem)}.su-checkbox-box svg{fill:none;height:80%;stroke:var(--su-checkbox-tick, #fff);stroke-linecap:round;stroke-linejoin:round;stroke-width:3.5;width:80%}.su-checkbox-tick,.su-checkbox-dash{stroke-dasharray:24;stroke-dashoffset:24;transition:stroke-dashoffset .22s ease-out 60ms}.su-checkbox:active input:not(:disabled)+.su-checkbox-box{scale:.86}.su-checkbox input:checked+.su-checkbox-box,.is-mixed .su-checkbox-box{background:var(--su-field-accent, #3b82f6);border-color:var(--su-field-accent, #3b82f6)}.su-checkbox input:checked+.su-checkbox-box .su-checkbox-tick,.is-mixed .su-checkbox-dash{stroke-dashoffset:0}.su-checkbox input:focus-visible+.su-checkbox-box{outline:2px solid var(--su-field-accent, #3b82f6);outline-offset:2px}.su-checkbox:has(input:disabled){cursor:not-allowed;opacity:.5}.su-checkbox-label:empty{display:none}@media(prefers-reduced-motion:reduce){.su-checkbox-box,.su-checkbox-tick,.su-checkbox-dash{transition:none}}\n"] }]
358
+ }] });
359
+
360
+ /**
361
+ * Toggle chips to pick several options (or one, with `multiple` off): each is a button that pops a tick in when
362
+ * picked. `<su-lib-chips label="Categories" [options]="categories" [(value)]="picked" />`
363
+ */
364
+ class SuChipsComponent {
365
+ options = input.required();
366
+ /** The picked values, in the options' order */
367
+ value = model([]);
368
+ /** The group's name for screen readers */
369
+ label = input.required();
370
+ /** Several can be picked; off, picking one replaces the other @default true */
371
+ multiple = input(true, { transform: booleanAttribute });
372
+ isPicked(value) {
373
+ return this.value().includes(value);
374
+ }
375
+ toggle(option) {
376
+ if (!this.multiple()) {
377
+ this.value.set([option.value]);
378
+ return;
379
+ }
380
+ const picked = this.isPicked(option.value)
381
+ ? this.value().filter((value) => value !== option.value)
382
+ : [...this.value(), option.value];
383
+ this.value.set(this.options().map((item) => item.value).filter((value) => picked.includes(value)));
384
+ }
385
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuChipsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
386
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: SuChipsComponent, isStandalone: true, selector: "su-lib-chips", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<div class=\"su-chips\" role=\"group\" [attr.aria-label]=\"label()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"su-chip\"\n [attr.aria-pressed]=\"isPicked(option.value)\"\n [disabled]=\"option.disabled ?? false\"\n (click)=\"toggle(option)\"\n >\n <span class=\"su-chip-tick\" aria-hidden=\"true\"></span>\n {{ option.label }}\n </button>\n }\n</div>\n", styles: [":host{display:block}.su-chips{display:flex;flex-wrap:wrap;gap:var(--su-chips-gap, .5rem)}.su-chip{align-items:center;background:var(--su-field-surface, transparent);border:1px solid var(--su-field-border, rgba(127, 127, 127, .4));border-radius:9999px;color:var(--su-field-text, currentColor);cursor:pointer;display:inline-flex;font:inherit;font-size:.875rem;gap:0;padding:.35rem .85rem;transition:background-color .18s ease,border-color .18s ease,color .18s ease,gap .22s cubic-bezier(.34,1.56,.64,1),scale .22s cubic-bezier(.34,1.56,.64,1)}.su-chip:active:not(:disabled){scale:.94}.su-chip[aria-pressed=true]{background:color-mix(in srgb,var(--su-field-accent, #3b82f6) 14%,transparent);border-color:var(--su-field-accent, #3b82f6);gap:.35rem}.su-chip:focus-visible{outline:2px solid var(--su-field-accent, #3b82f6);outline-offset:2px}.su-chip:disabled{cursor:not-allowed;opacity:.5}.su-chip-tick{background:var(--su-field-accent, #3b82f6);height:.9rem;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E\") center/contain no-repeat;opacity:0;scale:.3;transition:opacity .15s ease,scale .25s cubic-bezier(.34,1.56,.64,1),width .22s cubic-bezier(.34,1.56,.64,1);width:0}[aria-pressed=true] .su-chip-tick{opacity:1;scale:1;width:.9rem}@media(prefers-reduced-motion:reduce){.su-chip,.su-chip-tick{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
387
+ }
388
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuChipsComponent, decorators: [{
389
+ type: Component,
390
+ args: [{ selector: 'su-lib-chips', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"su-chips\" role=\"group\" [attr.aria-label]=\"label()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"su-chip\"\n [attr.aria-pressed]=\"isPicked(option.value)\"\n [disabled]=\"option.disabled ?? false\"\n (click)=\"toggle(option)\"\n >\n <span class=\"su-chip-tick\" aria-hidden=\"true\"></span>\n {{ option.label }}\n </button>\n }\n</div>\n", styles: [":host{display:block}.su-chips{display:flex;flex-wrap:wrap;gap:var(--su-chips-gap, .5rem)}.su-chip{align-items:center;background:var(--su-field-surface, transparent);border:1px solid var(--su-field-border, rgba(127, 127, 127, .4));border-radius:9999px;color:var(--su-field-text, currentColor);cursor:pointer;display:inline-flex;font:inherit;font-size:.875rem;gap:0;padding:.35rem .85rem;transition:background-color .18s ease,border-color .18s ease,color .18s ease,gap .22s cubic-bezier(.34,1.56,.64,1),scale .22s cubic-bezier(.34,1.56,.64,1)}.su-chip:active:not(:disabled){scale:.94}.su-chip[aria-pressed=true]{background:color-mix(in srgb,var(--su-field-accent, #3b82f6) 14%,transparent);border-color:var(--su-field-accent, #3b82f6);gap:.35rem}.su-chip:focus-visible{outline:2px solid var(--su-field-accent, #3b82f6);outline-offset:2px}.su-chip:disabled{cursor:not-allowed;opacity:.5}.su-chip-tick{background:var(--su-field-accent, #3b82f6);height:.9rem;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E\") center/contain no-repeat;opacity:0;scale:.3;transition:opacity .15s ease,scale .25s cubic-bezier(.34,1.56,.64,1),width .22s cubic-bezier(.34,1.56,.64,1);width:0}[aria-pressed=true] .su-chip-tick{opacity:1;scale:1;width:.9rem}@media(prefers-reduced-motion:reduce){.su-chip,.su-chip-tick{transition:none}}\n"] }]
391
+ }] });
392
+
393
+ /**
394
+ * Generated bundle index. Do not edit.
395
+ */
396
+
397
+ export { SU_COMMON_EMAIL_DOMAINS, SU_DEFAULT_MIN_PASSWORD_LENGTH, SU_EMAIL_MESSAGES, SU_STRENGTH_LEVELS, SuAutoGrowDirective, SuCheckboxComponent, SuChipsComponent, SuCodeBoxesComponent, SuEmailFieldComponent, SuStrengthMeterComponent, SuSwitchComponent, suCheckEmail, suPasswordStrength, suStrengthLevel };
398
+ //# sourceMappingURL=su-labs-fields.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"su-labs-fields.mjs","sources":["../../../../compat/angular-19/build/fields/src/lib/code-boxes/code-boxes.component.ts","../../../../compat/angular-19/build/fields/src/lib/code-boxes/code-boxes.component.html","../../../../compat/angular-19/build/fields/src/lib/strength-meter/password-strength.ts","../../../../compat/angular-19/build/fields/src/lib/strength-meter/strength-meter.component.ts","../../../../compat/angular-19/build/fields/src/lib/strength-meter/strength-meter.component.html","../../../../compat/angular-19/build/fields/src/lib/auto-grow/auto-grow.directive.ts","../../../../compat/angular-19/build/fields/src/lib/switch/switch.component.ts","../../../../compat/angular-19/build/fields/src/lib/switch/switch.component.html","../../../../compat/angular-19/build/fields/src/lib/email-field/email-check.ts","../../../../compat/angular-19/build/fields/src/lib/email-field/email-field.component.ts","../../../../compat/angular-19/build/fields/src/lib/email-field/email-field.component.html","../../../../compat/angular-19/build/fields/src/lib/checkbox/checkbox.component.ts","../../../../compat/angular-19/build/fields/src/lib/checkbox/checkbox.component.html","../../../../compat/angular-19/build/fields/src/lib/chips/chips.component.ts","../../../../compat/angular-19/build/fields/src/lib/chips/chips.component.html","../../../../compat/angular-19/build/fields/src/su-labs-fields.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\n\n/**\n * A short code typed into a row of boxes that fill one by one, then turn green in a wave once the code is complete.\n * One real text field lies over the boxes, so typing, pasting, the phone keyboard and screen readers all work as usual.\n */\n@Component({\n selector: 'su-lib-code-boxes',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './code-boxes.component.html',\n styleUrl: './code-boxes.component.scss',\n})\nexport class SuCodeBoxesComponent {\n readonly value = model('');\n readonly length = input.required<number>();\n readonly label = input.required<string>();\n /** The code is whole and well-formed: the boxes turn green */\n readonly complete = input(false);\n\n protected readonly boxes = computed(() =>\n Array.from({ length: this.length() }, (_, index) => index)\n );\n\n /** Capitals without spaces, never longer than the boxes */\n protected onInput(field: HTMLInputElement): void {\n const code = field.value\n .replace(/\\s/g, '')\n .toUpperCase()\n .slice(0, this.length());\n field.value = code;\n this.value.set(code);\n }\n}\n","<input\n #field\n class=\"field\"\n type=\"text\"\n inputmode=\"text\"\n autocomplete=\"off\"\n autocapitalize=\"characters\"\n spellcheck=\"false\"\n required\n [attr.maxlength]=\"length()\"\n [attr.aria-label]=\"label()\"\n [value]=\"value()\"\n (input)=\"onInput(field)\"\n/>\n<span class=\"boxes\" [class.is-complete]=\"complete()\" aria-hidden=\"true\">\n @for (index of boxes(); track index) {\n <span\n class=\"box\"\n [class.is-filled]=\"index < value().length\"\n [class.is-current]=\"index === value().length\"\n [style.--index]=\"index\"\n >{{ value()[index] }}</span\n >\n }\n</span>\n","/** How strong a new password looks, one step per bar of the meter */\nexport const SU_STRENGTH_LEVELS = ['weak', 'fair', 'good', 'strong'] as const;\nexport type SuStrengthLevel = (typeof SU_STRENGTH_LEVELS)[number];\n\n/** Shortest password the meter counts as more than weak, unless told otherwise */\nexport const SU_DEFAULT_MIN_PASSWORD_LENGTH = 8;\n\n/**\n * Bars of the strength meter a password fills, from 0 (empty) to 4. Under the minimum length it stays at one bar,\n * whatever else it has. Then one bar each for: four characters past the minimum, letters with digits, and symbols or\n * mixed case.\n */\nexport function suPasswordStrength(\n password: string,\n minLength = SU_DEFAULT_MIN_PASSWORD_LENGTH\n): number {\n if (password.length === 0) {\n return 0;\n }\n if (password.length < minLength) {\n return 1;\n }\n const extras = [\n password.length >= minLength + 4,\n /\\p{L}/u.test(password) && /\\d/.test(password),\n /[^\\p{L}\\d]/u.test(password) ||\n (/\\p{Lu}/u.test(password) && /\\p{Ll}/u.test(password)),\n ].filter(Boolean).length;\n return 1 + extras;\n}\n\n/** The meter's word for a number of bars, or null for an empty password */\nexport const suStrengthLevel = (bars: number): SuStrengthLevel | null =>\n SU_STRENGTH_LEVELS[bars - 1] ?? null;\n","import { ChangeDetectionStrategy, Component, computed, effect, input, signal } from '@angular/core';\nimport { SU_DEFAULT_MIN_PASSWORD_LENGTH, SU_STRENGTH_LEVELS, suPasswordStrength, SuStrengthLevel, suStrengthLevel } from './password-strength';\n\n/**\n * Four bars under a new password that fill, and change colour, as the password gets stronger. It follows the field's\n * own typing, so forms keep their plain fields; a form that empties the field by code sends it an `input` event.\n * Its texts come in as inputs, so it fits any language.\n */\n@Component({\n selector: 'su-lib-strength-meter',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './strength-meter.component.html',\n styleUrl: './strength-meter.component.scss',\n})\nexport class SuStrengthMeterComponent {\n readonly field = input.required<HTMLInputElement>();\n /** The meter's name for screen readers, e.g. \"Password strength\" */\n readonly label = input.required<string>();\n /** The word shown for each step */\n readonly levelNames =\n input.required<Readonly<Record<SuStrengthLevel, string>>>();\n readonly minLength = input(SU_DEFAULT_MIN_PASSWORD_LENGTH);\n\n private readonly password = signal('');\n protected readonly steps = SU_STRENGTH_LEVELS;\n protected readonly bars = computed(() =>\n suPasswordStrength(this.password(), this.minLength())\n );\n protected readonly level = computed(() => suStrengthLevel(this.bars()));\n protected readonly levelName = computed(() => {\n const level = this.level();\n return level ? this.levelNames()[level] : null;\n });\n\n constructor() {\n effect(onCleanup => {\n const field = this.field();\n const read = () => this.password.set(field.value);\n read();\n field.addEventListener('input', read);\n onCleanup(() => field.removeEventListener('input', read));\n });\n }\n}\n","<div\n class=\"bars\"\n role=\"meter\"\n [attr.aria-label]=\"label()\"\n aria-valuemin=\"0\"\n [attr.aria-valuemax]=\"steps.length\"\n [attr.aria-valuenow]=\"bars()\"\n [attr.aria-valuetext]=\"levelName()\"\n>\n @for (step of steps; track step; let index = $index) {\n <span class=\"bar\" [class.is-filled]=\"index < bars()\" [style.--index]=\"index\"></span>\n }\n</div>\n@if (levelName(); as name) {\n <small class=\"level\" [attr.data-level]=\"level()\" aria-hidden=\"true\">{{ name }}</small>\n}\n","import { afterNextRender, booleanAttribute, DestroyRef, Directive, ElementRef, inject, input } from '@angular/core';\n\n/** A soft spring that overshoots a little, as the box settles on its new height */\nconst SPRING = 'height 240ms cubic-bezier(0.34, 1.56, 0.64, 1)';\n\n/**\n * A text box that grows a line at a time as the text gets longer, and shrinks back when it is emptied, with a soft\n * spring (none for visitors who asked their device for less motion). `[suAutoGrow]=\"false\"` leaves it as it is.\n */\n@Directive({\n selector: 'textarea[suAutoGrow]',\n host: { '(input)': 'fit()' },\n})\nexport class SuAutoGrowDirective {\n readonly isOn = input(true, { alias: 'suAutoGrow', transform: booleanAttribute });\n\n private readonly box: HTMLTextAreaElement = inject(ElementRef).nativeElement;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const onReset = () => setTimeout(() => this.fit());\n this.box.form?.addEventListener('reset', onReset);\n destroyRef.onDestroy(() =>\n this.box.form?.removeEventListener('reset', onReset)\n );\n });\n }\n\n protected fit(): void {\n if (!this.isOn()) {\n return;\n }\n const box = this.box;\n const from = box.offsetHeight;\n box.style.transition = 'none';\n box.style.height = 'auto';\n const to = box.scrollHeight + box.offsetHeight - box.clientHeight;\n box.style.height = `${from}px`;\n void box.offsetHeight;\n box.style.overflowY = 'hidden';\n box.style.transition = matchMedia('(prefers-reduced-motion: reduce)')\n .matches\n ? 'none'\n : SPRING;\n box.style.height = `${to}px`;\n }\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, effect, input, linkedSignal, output, untracked } from '@angular/core';\n\n/** Where the label sits: after the switch, or before it with the switch at the end of the row */\nexport type SuSwitchLabelPosition = 'start' | 'end';\n\nexport type SuSwitchSize = 'small' | 'medium';\n\n/**\n * A real checkbox (`role=\"switch\"`) drawn as a sliding switch: the knob stretches while pressed, springs across and a\n * tick pops in when it's on. Put the label inside: `<su-lib-switch [(checked)]=\"on\">Reduce motion</su-lib-switch>`.\n *\n * It shows a click at once and follows `checked` whenever it changes. While `busy` (e.g. saving the change) it ignores\n * clicks, and once no longer busy it shows `checked` again, so a change that failed to save flips back.\n */\n@Component({\n selector: 'su-lib-switch',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './switch.component.html',\n styleUrl: './switch.component.scss',\n})\nexport class SuSwitchComponent {\n readonly checked = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Busy saving the change: clicks are ignored, and `aria-busy` is set */\n readonly busy = input(false, { transform: booleanAttribute });\n /** @default 'end' */\n readonly labelPosition = input<SuSwitchLabelPosition>('end');\n /** @default 'medium' */\n readonly size = input<SuSwitchSize>('medium');\n /** Switched by the user: the new value */\n readonly checkedChange = output<boolean>();\n\n protected readonly shown = linkedSignal(() => this.checked());\n\n constructor() {\n effect(() => {\n if (!this.busy()) {\n untracked(() => this.shown.set(this.checked()));\n }\n });\n }\n\n protected onClick(event: MouseEvent): void {\n if (this.busy()) {\n event.preventDefault();\n }\n }\n\n protected onChange(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.shown.set(event.target.checked);\n this.checkedChange.emit(event.target.checked);\n }\n }\n}\n","<label class=\"su-switch su-switch-{{ size() }}\" [class.is-label-start]=\"labelPosition() === 'start'\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [checked]=\"shown()\"\n [disabled]=\"disabled()\"\n [attr.aria-busy]=\"busy() ? true : null\"\n (click)=\"onClick($event)\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-switch-track\" aria-hidden=\"true\"></span>\n <span class=\"su-switch-label\"><ng-content /></span>\n</label>\n","/** What's wrong with an email address, in the order it's checked */\nexport type SuEmailProblem = 'empty' | 'spaces' | 'at' | 'name' | 'domain' | 'dot' | 'ending';\n\n/** The outcome of `suCheckEmail` */\nexport interface SuEmailCheck {\n readonly valid: boolean;\n readonly problem: SuEmailProblem | null;\n /** The address with a common domain in place of a likely typo, e.g. `jo@gmail.com` for `jo@gmial.com`, or null */\n readonly suggestion: string | null;\n}\n\n/** Domains `suCheckEmail` suggests when one is mistyped */\nexport const SU_COMMON_EMAIL_DOMAINS: readonly string[] = [\n 'gmail.com',\n 'hotmail.com',\n 'outlook.com',\n 'live.com',\n 'yahoo.com',\n 'icloud.com',\n 'me.com',\n 'aol.com',\n 'proton.me',\n 'protonmail.com',\n 'gmx.com',\n 'yandex.com',\n 'hotmail.es',\n 'yahoo.es',\n];\n\n/** How far a typed domain may be from a common one, in single-letter edits, to suggest it */\nconst MAX_TYPO_DISTANCE = 2;\n\nfunction editDistance(a: string, b: string): number {\n let previous = Array.from({ length: b.length + 1 }, (_, index) => index);\n for (let i = 1; i <= a.length; i++) {\n const current = [i];\n for (let j = 1; j <= b.length; j++) {\n current[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));\n }\n previous = current;\n }\n return previous[b.length];\n}\n\n/** The common domain a typed one most likely meant, or null when it's already common or nothing is close */\nfunction closestDomain(domain: string, domains: readonly string[]): string | null {\n if (!domain || domains.includes(domain)) {\n return null;\n }\n let best: { readonly domain: string; readonly distance: number } | null = null;\n for (const candidate of domains) {\n const distance = editDistance(domain, candidate);\n if (distance <= MAX_TYPO_DISTANCE && (!best || distance < best.distance)) {\n best = { domain: candidate, distance };\n }\n }\n return best?.domain ?? null;\n}\n\nfunction problemOf(email: string): SuEmailProblem | null {\n if (email === '') {\n return 'empty';\n }\n if (/\\s/.test(email)) {\n return 'spaces';\n }\n const parts = email.split('@');\n if (parts.length !== 2) {\n return 'at';\n }\n const [name, domain] = parts;\n if (!name) {\n return 'name';\n }\n if (!domain) {\n return 'domain';\n }\n const labels = domain.split('.');\n if (labels.length < 2 || labels.some((label) => label === '')) {\n return 'dot';\n }\n return /^\\p{L}{2,}$/u.test(labels[labels.length - 1]) ? null : 'ending';\n}\n\n/**\n * Checks an email address the way people mistype them: empty, spaces, not exactly one @, nothing before or after it,\n * a domain without a proper dot, or an ending shorter than two letters. It also suggests a common domain for a\n * likely typo (`gmial.com` → `gmail.com`), even when the address is otherwise valid.\n */\nexport function suCheckEmail(value: string, domains: readonly string[] = SU_COMMON_EMAIL_DOMAINS): SuEmailCheck {\n const email = value.trim();\n const problem = problemOf(email);\n const [name = '', domain = ''] = email.split('@');\n const fixable = problem === null || problem === 'dot' || problem === 'ending';\n const fix = fixable && name ? closestDomain(domain.toLowerCase(), domains) : null;\n return { valid: problem === null, problem, suggestion: fix ? `${name}@${fix}` : null };\n}\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, effect, input, model, output, signal } from '@angular/core';\nimport { SU_COMMON_EMAIL_DOMAINS, suCheckEmail, SuEmailProblem } from './email-check';\n\n/** The field's texts, e.g. in the page's language */\nexport interface SuEmailMessages extends Readonly<Record<SuEmailProblem, string>> {\n /** Before a suggested address: \"Did you mean jo@gmail.com?\" */\n readonly suggestion: string;\n}\n\nexport const SU_EMAIL_MESSAGES: SuEmailMessages = {\n empty: 'Enter your email address',\n spaces: 'An email address has no spaces',\n at: 'An email address has one @, like name@example.com',\n name: 'Add the part before the @',\n domain: 'Add the part after the @, like example.com',\n dot: 'The part after the @ needs a dot, like example.com',\n ending: 'The ending after the last dot needs at least two letters',\n suggestion: 'Did you mean',\n};\n\nlet nextId = 0;\n\n/**\n * An email field that checks the address the way people mistype it, and suggests a common domain for a likely typo\n * (`gmial.com` → `gmail.com`, applied with one tap). It stays quiet while typing and says what's wrong once the field\n * is left; a tick shows when the address looks right.\n */\n@Component({\n selector: 'su-lib-email-field',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.is-floating]': 'floating()' },\n templateUrl: './email-field.component.html',\n styleUrl: './email-field.component.scss',\n})\nexport class SuEmailFieldComponent {\n readonly value = model('');\n /** The visible label */\n readonly label = input.required<string>();\n readonly placeholder = input<string>();\n /** An empty field counts as a problem @default false */\n readonly required = input(false, { transform: booleanAttribute });\n readonly messages = input<Partial<SuEmailMessages>>({});\n /** The label sits inside the field and moves up onto its border when the field is focused or filled @default false */\n readonly floating = input(false, { transform: booleanAttribute });\n /** Shows the problem before the field was left, e.g. when its form is sent @default false */\n readonly showProblem = input(false, { transform: booleanAttribute });\n /** Domains to suggest when one is mistyped */\n readonly domains = input<readonly string[]>(SU_COMMON_EMAIL_DOMAINS);\n /** Whether the address is valid, on every change */\n readonly validityChange = output<boolean>();\n\n protected readonly id = `su-email-${nextId++}`;\n protected readonly touched = signal(false);\n protected readonly check = computed(() => suCheckEmail(this.value(), this.domains()));\n protected readonly text = computed<SuEmailMessages>(() => ({ ...SU_EMAIL_MESSAGES, ...this.messages() }));\n /** The problem to show: once the field was left or `showProblem` is on, and an empty field only when it's required */\n protected readonly problem = computed(() => {\n const { problem } = this.check();\n const isShown = this.touched() || this.showProblem();\n if (!isShown || !problem || (problem === 'empty' && !this.required())) {\n return null;\n }\n return problem;\n });\n\n constructor() {\n effect(() => this.validityChange.emit(this.check().valid));\n }\n\n protected onInput(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.value.set(event.target.value);\n }\n }\n\n protected apply(suggestion: string): void {\n this.value.set(suggestion);\n this.touched.set(true);\n }\n}\n","@let result = check();\n@let t = text();\n@if (!floating()) {\n <label class=\"su-email-label\" [for]=\"id\">{{ label() }}</label>\n}\n<div class=\"su-email-box\" [class.is-valid]=\"result.valid\" [class.is-invalid]=\"problem() !== null\">\n <input\n class=\"su-email-input\"\n type=\"email\"\n inputmode=\"email\"\n autocomplete=\"email\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n [id]=\"id\"\n [value]=\"value()\"\n [required]=\"required()\"\n [attr.placeholder]=\"floating() ? ' ' : (placeholder() ?? null)\"\n [attr.aria-invalid]=\"problem() !== null ? true : null\"\n [attr.aria-describedby]=\"id + '-message'\"\n (input)=\"onInput($event)\"\n (blur)=\"touched.set(true)\"\n />\n @if (floating()) {\n <label class=\"su-email-label su-email-floating-label\" [for]=\"id\">{{ label() }}</label>\n }\n <span class=\"su-email-tick\" aria-hidden=\"true\"></span>\n</div>\n<p class=\"su-email-message\" aria-live=\"polite\" [id]=\"id + '-message'\">\n @if (problem(); as problem) {\n <span class=\"su-email-problem\">{{ t[problem] }}</span>\n }\n @if (result.suggestion; as suggestion) {\n <span class=\"su-email-suggestion\">\n {{ t.suggestion }}\n <button type=\"button\" class=\"su-email-fix\" (click)=\"apply(suggestion)\">{{ suggestion }}</button>?\n </span>\n }\n</p>\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input, linkedSignal, output } from '@angular/core';\n\n/**\n * A real checkbox whose tick draws itself in, with a small squash when pressed and a dash when partly checked. Put the\n * label inside: `<su-lib-checkbox [(checked)]=\"agree\">I agree</su-lib-checkbox>`.\n */\n@Component({\n selector: 'su-lib-checkbox',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './checkbox.component.html',\n styleUrl: './checkbox.component.scss',\n})\nexport class SuCheckboxComponent {\n readonly checked = input(false, { transform: booleanAttribute });\n /** Partly checked, e.g. some of a group; a click checks it */\n readonly indeterminate = input(false, { transform: booleanAttribute });\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Ticked or unticked by the user: the new value */\n readonly checkedChange = output<boolean>();\n\n protected readonly shown = linkedSignal(() => this.checked());\n\n protected onChange(event: Event): void {\n if (event.target instanceof HTMLInputElement) {\n this.shown.set(event.target.checked);\n this.checkedChange.emit(event.target.checked);\n }\n }\n}\n","<label class=\"su-checkbox\" [class.is-mixed]=\"indeterminate() && !shown()\">\n <input\n type=\"checkbox\"\n [checked]=\"shown()\"\n [indeterminate]=\"indeterminate() && !shown()\"\n [disabled]=\"disabled()\"\n (change)=\"onChange($event)\"\n />\n <span class=\"su-checkbox-box\" aria-hidden=\"true\">\n <svg viewBox=\"0 0 24 24\">\n <path class=\"su-checkbox-tick\" d=\"M5 12.5l4.5 4.5L19 7.5\" />\n <path class=\"su-checkbox-dash\" d=\"M6 12h12\" />\n </svg>\n </span>\n <span class=\"su-checkbox-label\"><ng-content /></span>\n</label>\n","import { booleanAttribute, ChangeDetectionStrategy, Component, input, model } from '@angular/core';\n\n/** One chip: the value it stands for and its text */\nexport interface SuChipOption<TValue extends string> {\n readonly value: TValue;\n readonly label: string;\n readonly disabled?: boolean;\n}\n\n/**\n * Toggle chips to pick several options (or one, with `multiple` off): each is a button that pops a tick in when\n * picked. `<su-lib-chips label=\"Categories\" [options]=\"categories\" [(value)]=\"picked\" />`\n */\n@Component({\n selector: 'su-lib-chips',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './chips.component.html',\n styleUrl: './chips.component.scss',\n})\nexport class SuChipsComponent<TValue extends string> {\n readonly options = input.required<readonly SuChipOption<TValue>[]>();\n /** The picked values, in the options' order */\n readonly value = model<readonly TValue[]>([]);\n /** The group's name for screen readers */\n readonly label = input.required<string>();\n /** Several can be picked; off, picking one replaces the other @default true */\n readonly multiple = input(true, { transform: booleanAttribute });\n\n protected isPicked(value: TValue): boolean {\n return this.value().includes(value);\n }\n\n protected toggle(option: SuChipOption<TValue>): void {\n if (!this.multiple()) {\n this.value.set([option.value]);\n return;\n }\n const picked = this.isPicked(option.value)\n ? this.value().filter((value) => value !== option.value)\n : [...this.value(), option.value];\n this.value.set(this.options().map((item) => item.value).filter((value) => picked.includes(value)));\n }\n}\n","<div class=\"su-chips\" role=\"group\" [attr.aria-label]=\"label()\">\n @for (option of options(); track option.value) {\n <button\n type=\"button\"\n class=\"su-chip\"\n [attr.aria-pressed]=\"isPicked(option.value)\"\n [disabled]=\"option.disabled ?? false\"\n (click)=\"toggle(option)\"\n >\n <span class=\"su-chip-tick\" aria-hidden=\"true\"></span>\n {{ option.label }}\n </button>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEA;;;AAGG;MAOU,oBAAoB,CAAA;AACtB,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC;AACjB,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAU;AACjC,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU;;AAEhC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC;AAEb,IAAA,KAAK,GAAG,QAAQ,CAAC,MAClC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC,CAC3D;;AAGS,IAAA,OAAO,CAAC,KAAuB,EAAA;AACvC,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC;AAChB,aAAA,OAAO,CAAC,KAAK,EAAE,EAAE;AACjB,aAAA,WAAW;aACX,KAAK,CAAC,CAAC,EA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,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACpG;wGAtBW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,omBCnB7B,+bAcA,EAAA,MAAA,EAAA,CAAA,49CAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDKa,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;+BACE,cAAc,EAAA,eAAA,EACP,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+bAAA,EAAA,MAAA,EAAA,CAAA,49CAAA,CAAA,EAAA;;;AEfjD;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@su-labs/fields" />
5
+ export * from './public-api';
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * A text box that grows a line at a time as the text gets longer, and shrinks back when it is emptied, with a soft
4
+ * spring (none for visitors who asked their device for less motion). `[suAutoGrow]="false"` leaves it as it is.
5
+ */
6
+ export declare class SuAutoGrowDirective {
7
+ readonly isOn: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
8
+ private readonly box;
9
+ constructor();
10
+ protected fit(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuAutoGrowDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SuAutoGrowDirective, "textarea[suAutoGrow]", never, { "isOn": { "alias": "suAutoGrow"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
13
+ }
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * A real checkbox whose tick draws itself in, with a small squash when pressed and a dash when partly checked. Put the
4
+ * label inside: `<su-lib-checkbox [(checked)]="agree">I agree</su-lib-checkbox>`.
5
+ */
6
+ export declare class SuCheckboxComponent {
7
+ readonly checked: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
8
+ /** Partly checked, e.g. some of a group; a click checks it */
9
+ readonly indeterminate: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
10
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
11
+ /** Ticked or unticked by the user: the new value */
12
+ readonly checkedChange: import("@angular/core").OutputEmitterRef<boolean>;
13
+ protected readonly shown: import("@angular/core").WritableSignal<boolean>;
14
+ protected onChange(event: Event): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuCheckboxComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuCheckboxComponent, "su-lib-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, ["*"], true, never>;
17
+ }
@@ -0,0 +1,24 @@
1
+ import * as i0 from "@angular/core";
2
+ /** One chip: the value it stands for and its text */
3
+ export interface SuChipOption<TValue extends string> {
4
+ readonly value: TValue;
5
+ readonly label: string;
6
+ readonly disabled?: boolean;
7
+ }
8
+ /**
9
+ * Toggle chips to pick several options (or one, with `multiple` off): each is a button that pops a tick in when
10
+ * picked. `<su-lib-chips label="Categories" [options]="categories" [(value)]="picked" />`
11
+ */
12
+ export declare class SuChipsComponent<TValue extends string> {
13
+ readonly options: import("@angular/core").InputSignal<readonly SuChipOption<TValue>[]>;
14
+ /** The picked values, in the options' order */
15
+ readonly value: import("@angular/core").ModelSignal<readonly TValue[]>;
16
+ /** The group's name for screen readers */
17
+ readonly label: import("@angular/core").InputSignal<string>;
18
+ /** Several can be picked; off, picking one replaces the other @default true */
19
+ readonly multiple: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
20
+ protected isPicked(value: TValue): boolean;
21
+ protected toggle(option: SuChipOption<TValue>): void;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuChipsComponent<any>, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuChipsComponent<any>, "su-lib-chips", never, { "options": { "alias": "options"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
24
+ }
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * A short code typed into a row of boxes that fill one by one, then turn green in a wave once the code is complete.
4
+ * One real text field lies over the boxes, so typing, pasting, the phone keyboard and screen readers all work as usual.
5
+ */
6
+ export declare class SuCodeBoxesComponent {
7
+ readonly value: import("@angular/core").ModelSignal<string>;
8
+ readonly length: import("@angular/core").InputSignal<number>;
9
+ readonly label: import("@angular/core").InputSignal<string>;
10
+ /** The code is whole and well-formed: the boxes turn green */
11
+ readonly complete: import("@angular/core").InputSignal<boolean>;
12
+ protected readonly boxes: import("@angular/core").Signal<number[]>;
13
+ /** Capitals without spaces, never longer than the boxes */
14
+ protected onInput(field: HTMLInputElement): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuCodeBoxesComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuCodeBoxesComponent, "su-lib-code-boxes", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "length": { "alias": "length"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "complete": { "alias": "complete"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
17
+ }
@@ -0,0 +1,17 @@
1
+ /** What's wrong with an email address, in the order it's checked */
2
+ export type SuEmailProblem = 'empty' | 'spaces' | 'at' | 'name' | 'domain' | 'dot' | 'ending';
3
+ /** The outcome of `suCheckEmail` */
4
+ export interface SuEmailCheck {
5
+ readonly valid: boolean;
6
+ readonly problem: SuEmailProblem | null;
7
+ /** The address with a common domain in place of a likely typo, e.g. `jo@gmail.com` for `jo@gmial.com`, or null */
8
+ readonly suggestion: string | null;
9
+ }
10
+ /** Domains `suCheckEmail` suggests when one is mistyped */
11
+ export declare const SU_COMMON_EMAIL_DOMAINS: readonly string[];
12
+ /**
13
+ * Checks an email address the way people mistype them: empty, spaces, not exactly one @, nothing before or after it,
14
+ * a domain without a proper dot, or an ending shorter than two letters. It also suggests a common domain for a
15
+ * likely typo (`gmial.com` → `gmail.com`), even when the address is otherwise valid.
16
+ */
17
+ export declare function suCheckEmail(value: string, domains?: readonly string[]): SuEmailCheck;
@@ -0,0 +1,41 @@
1
+ import { SuEmailProblem } from './email-check';
2
+ import * as i0 from "@angular/core";
3
+ /** The field's texts, e.g. in the page's language */
4
+ export interface SuEmailMessages extends Readonly<Record<SuEmailProblem, string>> {
5
+ /** Before a suggested address: "Did you mean jo@gmail.com?" */
6
+ readonly suggestion: string;
7
+ }
8
+ export declare const SU_EMAIL_MESSAGES: SuEmailMessages;
9
+ /**
10
+ * An email field that checks the address the way people mistype it, and suggests a common domain for a likely typo
11
+ * (`gmial.com` → `gmail.com`, applied with one tap). It stays quiet while typing and says what's wrong once the field
12
+ * is left; a tick shows when the address looks right.
13
+ */
14
+ export declare class SuEmailFieldComponent {
15
+ readonly value: import("@angular/core").ModelSignal<string>;
16
+ /** The visible label */
17
+ readonly label: import("@angular/core").InputSignal<string>;
18
+ readonly placeholder: import("@angular/core").InputSignal<string | undefined>;
19
+ /** An empty field counts as a problem @default false */
20
+ readonly required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
21
+ readonly messages: import("@angular/core").InputSignal<Partial<SuEmailMessages>>;
22
+ /** The label sits inside the field and moves up onto its border when the field is focused or filled @default false */
23
+ readonly floating: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
24
+ /** Shows the problem before the field was left, e.g. when its form is sent @default false */
25
+ readonly showProblem: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
26
+ /** Domains to suggest when one is mistyped */
27
+ readonly domains: import("@angular/core").InputSignal<readonly string[]>;
28
+ /** Whether the address is valid, on every change */
29
+ readonly validityChange: import("@angular/core").OutputEmitterRef<boolean>;
30
+ protected readonly id: string;
31
+ protected readonly touched: import("@angular/core").WritableSignal<boolean>;
32
+ protected readonly check: import("@angular/core").Signal<import("@su-labs/fields").SuEmailCheck>;
33
+ protected readonly text: import("@angular/core").Signal<SuEmailMessages>;
34
+ /** The problem to show: once the field was left or `showProblem` is on, and an empty field only when it's required */
35
+ protected readonly problem: import("@angular/core").Signal<"empty" | "spaces" | "at" | "name" | "domain" | "dot" | "ending" | null>;
36
+ constructor();
37
+ protected onInput(event: Event): void;
38
+ protected apply(suggestion: string): void;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuEmailFieldComponent, never>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuEmailFieldComponent, "su-lib-email-field", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; "floating": { "alias": "floating"; "required": false; "isSignal": true; }; "showProblem": { "alias": "showProblem"; "required": false; "isSignal": true; }; "domains": { "alias": "domains"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "validityChange": "validityChange"; }, never, never, true, never>;
41
+ }
@@ -0,0 +1,13 @@
1
+ /** How strong a new password looks, one step per bar of the meter */
2
+ export declare const SU_STRENGTH_LEVELS: readonly ["weak", "fair", "good", "strong"];
3
+ export type SuStrengthLevel = (typeof SU_STRENGTH_LEVELS)[number];
4
+ /** Shortest password the meter counts as more than weak, unless told otherwise */
5
+ export declare const SU_DEFAULT_MIN_PASSWORD_LENGTH = 8;
6
+ /**
7
+ * Bars of the strength meter a password fills, from 0 (empty) to 4. Under the minimum length it stays at one bar,
8
+ * whatever else it has. Then one bar each for: four characters past the minimum, letters with digits, and symbols or
9
+ * mixed case.
10
+ */
11
+ export declare function suPasswordStrength(password: string, minLength?: number): number;
12
+ /** The meter's word for a number of bars, or null for an empty password */
13
+ export declare const suStrengthLevel: (bars: number) => SuStrengthLevel | null;
@@ -0,0 +1,22 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Four bars under a new password that fill, and change colour, as the password gets stronger. It follows the field's
4
+ * own typing, so forms keep their plain fields; a form that empties the field by code sends it an `input` event.
5
+ * Its texts come in as inputs, so it fits any language.
6
+ */
7
+ export declare class SuStrengthMeterComponent {
8
+ readonly field: import("@angular/core").InputSignal<HTMLInputElement>;
9
+ /** The meter's name for screen readers, e.g. "Password strength" */
10
+ readonly label: import("@angular/core").InputSignal<string>;
11
+ /** The word shown for each step */
12
+ readonly levelNames: import("@angular/core").InputSignal<Readonly<Record<"weak" | "fair" | "good" | "strong", string>>>;
13
+ readonly minLength: import("@angular/core").InputSignal<number>;
14
+ private readonly password;
15
+ protected readonly steps: readonly ["weak", "fair", "good", "strong"];
16
+ protected readonly bars: import("@angular/core").Signal<number>;
17
+ protected readonly level: import("@angular/core").Signal<"weak" | "fair" | "good" | "strong" | null>;
18
+ protected readonly levelName: import("@angular/core").Signal<string | null>;
19
+ constructor();
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuStrengthMeterComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuStrengthMeterComponent, "su-lib-strength-meter", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "levelNames": { "alias": "levelNames"; "required": true; "isSignal": true; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
22
+ }
@@ -0,0 +1,29 @@
1
+ import * as i0 from "@angular/core";
2
+ /** Where the label sits: after the switch, or before it with the switch at the end of the row */
3
+ export type SuSwitchLabelPosition = 'start' | 'end';
4
+ export type SuSwitchSize = 'small' | 'medium';
5
+ /**
6
+ * A real checkbox (`role="switch"`) drawn as a sliding switch: the knob stretches while pressed, springs across and a
7
+ * tick pops in when it's on. Put the label inside: `<su-lib-switch [(checked)]="on">Reduce motion</su-lib-switch>`.
8
+ *
9
+ * It shows a click at once and follows `checked` whenever it changes. While `busy` (e.g. saving the change) it ignores
10
+ * clicks, and once no longer busy it shows `checked` again, so a change that failed to save flips back.
11
+ */
12
+ export declare class SuSwitchComponent {
13
+ readonly checked: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
14
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
15
+ /** Busy saving the change: clicks are ignored, and `aria-busy` is set */
16
+ readonly busy: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
17
+ /** @default 'end' */
18
+ readonly labelPosition: import("@angular/core").InputSignal<SuSwitchLabelPosition>;
19
+ /** @default 'medium' */
20
+ readonly size: import("@angular/core").InputSignal<SuSwitchSize>;
21
+ /** Switched by the user: the new value */
22
+ readonly checkedChange: import("@angular/core").OutputEmitterRef<boolean>;
23
+ protected readonly shown: import("@angular/core").WritableSignal<boolean>;
24
+ constructor();
25
+ protected onClick(event: MouseEvent): void;
26
+ protected onChange(event: Event): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuSwitchComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuSwitchComponent, "su-lib-switch", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, ["*"], true, never>;
29
+ }
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@su-labs/fields",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "19.2.0",
4
+ "description": "Animated Angular form fields: code boxes that fill one by one, a password strength meter, an email field that catches typos, a sliding switch, checkboxes, chips, and a text box that grows as you type.",
5
+ "keywords": [
6
+ "angular",
7
+ "form",
8
+ "input",
9
+ "otp",
10
+ "code-input",
11
+ "password-strength",
12
+ "textarea",
13
+ "auto-grow",
14
+ "switch",
15
+ "toggle",
16
+ "checkbox",
17
+ "chips",
18
+ "email",
19
+ "animation",
20
+ "ui"
21
+ ],
22
+ "author": {
23
+ "name": "Yevheniy Alekseyev",
24
+ "email": "yev.alekseyev@gmail.com",
25
+ "url": "https://github.com/Greezaaa"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/Greezaaa/settings-utils-lib.git",
30
+ "directory": "projects/su-labs/fields"
31
+ },
32
+ "homepage": "https://su-labs.dev/fields/",
33
+ "bugs": {
34
+ "url": "https://github.com/Greezaaa/settings-utils-lib/issues"
35
+ },
36
+ "peerDependencies": {
37
+ "@angular/common": "^19.0.0",
38
+ "@angular/core": "^19.0.0"
39
+ },
40
+ "dependencies": {
41
+ "tslib": "^2.3.0"
42
+ },
43
+ "sideEffects": false,
44
+ "license": "MIT",
45
+ "module": "fesm2022/su-labs-fields.mjs",
46
+ "typings": "index.d.ts",
47
+ "exports": {
48
+ "./package.json": {
49
+ "default": "./package.json"
50
+ },
51
+ ".": {
52
+ "types": "./index.d.ts",
53
+ "default": "./fesm2022/su-labs-fields.mjs"
54
+ }
55
+ }
6
56
  }
@@ -0,0 +1,9 @@
1
+ export * from './lib/code-boxes/code-boxes.component';
2
+ export * from './lib/strength-meter/password-strength';
3
+ export * from './lib/strength-meter/strength-meter.component';
4
+ export * from './lib/auto-grow/auto-grow.directive';
5
+ export * from './lib/switch/switch.component';
6
+ export * from './lib/email-field/email-check';
7
+ export * from './lib/email-field/email-field.component';
8
+ export * from './lib/checkbox/checkbox.component';
9
+ export * from './lib/chips/chips.component';