@atomic-ui/ui 0.10.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +9839 -6255
- package/dist/base/FieldElement.d.ts +10 -3
- package/dist/{chunk-YWP2Z3JN.js → chunk-2TNF7O43.js} +7 -5
- package/dist/{chunk-YWP2Z3JN.js.map → chunk-2TNF7O43.js.map} +1 -1
- package/dist/{chunk-FKUBEVCU.js → chunk-2WHOBIOY.js} +11 -9
- package/dist/{chunk-FKUBEVCU.js.map → chunk-2WHOBIOY.js.map} +1 -1
- package/dist/{chunk-26BO3W56.js → chunk-3BWCD5U5.js} +5 -3
- package/dist/{chunk-26BO3W56.js.map → chunk-3BWCD5U5.js.map} +1 -1
- package/dist/chunk-3GPGDERO.js +201 -0
- package/dist/chunk-3GPGDERO.js.map +1 -0
- package/dist/{chunk-3T7J66Z2.js → chunk-3KAFK24X.js} +13 -11
- package/dist/chunk-3KAFK24X.js.map +1 -0
- package/dist/{chunk-5OJAJA3U.js → chunk-5HCWL2YD.js} +6 -4
- package/dist/{chunk-5OJAJA3U.js.map → chunk-5HCWL2YD.js.map} +1 -1
- package/dist/{chunk-AG4EP3OY.js → chunk-5IGBH4GL.js} +8 -6
- package/dist/{chunk-AG4EP3OY.js.map → chunk-5IGBH4GL.js.map} +1 -1
- package/dist/{chunk-AL4IUSML.js → chunk-5OYQZWP2.js} +5 -3
- package/dist/{chunk-AL4IUSML.js.map → chunk-5OYQZWP2.js.map} +1 -1
- package/dist/chunk-5PRB7P7N.js +167 -0
- package/dist/chunk-5PRB7P7N.js.map +1 -0
- package/dist/chunk-6CDQSHVW.js +21 -0
- package/dist/chunk-6CDQSHVW.js.map +1 -0
- package/dist/{chunk-MLKNZL5J.js → chunk-6J22I7F6.js} +14 -12
- package/dist/chunk-6J22I7F6.js.map +1 -0
- package/dist/chunk-72WNCCDC.js +136 -0
- package/dist/chunk-72WNCCDC.js.map +1 -0
- package/dist/chunk-7UI3OBXL.js +104 -0
- package/dist/chunk-7UI3OBXL.js.map +1 -0
- package/dist/{chunk-D6NET2VB.js → chunk-ALFE35FS.js} +30 -3
- package/dist/chunk-ALFE35FS.js.map +1 -0
- package/dist/chunk-AYINRYNC.js +184 -0
- package/dist/chunk-AYINRYNC.js.map +1 -0
- package/dist/{chunk-2D2IMQII.js → chunk-BAITBJUC.js} +51 -29
- package/dist/chunk-BAITBJUC.js.map +1 -0
- package/dist/{chunk-2EP3IV3G.js → chunk-BGHAANTP.js} +22 -8
- package/dist/chunk-BGHAANTP.js.map +1 -0
- package/dist/{chunk-OJO62KRX.js → chunk-CFCFKLTN.js} +85 -10
- package/dist/chunk-CFCFKLTN.js.map +1 -0
- package/dist/{chunk-UFPI4I2Y.js → chunk-CQT3VPYK.js} +8 -29
- package/dist/chunk-CQT3VPYK.js.map +1 -0
- package/dist/{chunk-AURT72IC.js → chunk-DXLEYNID.js} +13 -7
- package/dist/chunk-DXLEYNID.js.map +1 -0
- package/dist/{chunk-L4CIBOGK.js → chunk-EKPTMRBG.js} +5 -3
- package/dist/{chunk-L4CIBOGK.js.map → chunk-EKPTMRBG.js.map} +1 -1
- package/dist/{chunk-7UWJXPR3.js → chunk-F3NHPQU5.js} +17 -36
- package/dist/chunk-F3NHPQU5.js.map +1 -0
- package/dist/{chunk-Z2EWQMTR.js → chunk-F4IXELLK.js} +5 -3
- package/dist/{chunk-Z2EWQMTR.js.map → chunk-F4IXELLK.js.map} +1 -1
- package/dist/{chunk-APQEXM4I.js → chunk-FJHPGOGS.js} +5 -3
- package/dist/{chunk-APQEXM4I.js.map → chunk-FJHPGOGS.js.map} +1 -1
- package/dist/chunk-FLAUZU7Y.js +345 -0
- package/dist/chunk-FLAUZU7Y.js.map +1 -0
- package/dist/{chunk-3NEWOO2P.js → chunk-FZWUQC42.js} +7 -5
- package/dist/{chunk-3NEWOO2P.js.map → chunk-FZWUQC42.js.map} +1 -1
- package/dist/{chunk-ONED3PUB.js → chunk-HSXLSJVG.js} +54 -8
- package/dist/chunk-HSXLSJVG.js.map +1 -0
- package/dist/{chunk-V7EB7Q2M.js → chunk-JTCTQBAX.js} +2 -131
- package/dist/chunk-JTCTQBAX.js.map +1 -0
- package/dist/{chunk-ZL3JFUIE.js → chunk-K5QFVLCI.js} +7 -5
- package/dist/{chunk-ZL3JFUIE.js.map → chunk-K5QFVLCI.js.map} +1 -1
- package/dist/{chunk-DN5YZFSG.js → chunk-KE6WCXQP.js} +55 -9
- package/dist/chunk-KE6WCXQP.js.map +1 -0
- package/dist/chunk-LBHTXY7K.js +75 -0
- package/dist/chunk-LBHTXY7K.js.map +1 -0
- package/dist/{chunk-OZGKK3N5.js → chunk-LP4RTYTL.js} +88 -9
- package/dist/chunk-LP4RTYTL.js.map +1 -0
- package/dist/{chunk-MOO63SHZ.js → chunk-LXVPWTSY.js} +80 -23
- package/dist/chunk-LXVPWTSY.js.map +1 -0
- package/dist/{chunk-JNLKM3JT.js → chunk-N6EEW2GF.js} +6 -4
- package/dist/{chunk-JNLKM3JT.js.map → chunk-N6EEW2GF.js.map} +1 -1
- package/dist/chunk-NHEU5FT6.js +115 -0
- package/dist/chunk-NHEU5FT6.js.map +1 -0
- package/dist/chunk-P3BPW446.js +294 -0
- package/dist/chunk-P3BPW446.js.map +1 -0
- package/dist/chunk-QPOM7W3D.js +104 -0
- package/dist/chunk-QPOM7W3D.js.map +1 -0
- package/dist/{chunk-FU3CEHBS.js → chunk-R6PBY3YN.js} +6 -4
- package/dist/{chunk-FU3CEHBS.js.map → chunk-R6PBY3YN.js.map} +1 -1
- package/dist/{chunk-TJOYBDKS.js → chunk-R6YMSJR7.js} +65 -36
- package/dist/chunk-R6YMSJR7.js.map +1 -0
- package/dist/{chunk-ZEIV5X3U.js → chunk-SOYKSPPX.js} +73 -23
- package/dist/chunk-SOYKSPPX.js.map +1 -0
- package/dist/{chunk-NKMJMVZP.js → chunk-T52CUOCJ.js} +5 -3
- package/dist/{chunk-NKMJMVZP.js.map → chunk-T52CUOCJ.js.map} +1 -1
- package/dist/chunk-UFENSIWD.js +135 -0
- package/dist/chunk-UFENSIWD.js.map +1 -0
- package/dist/{chunk-A4M3A4SZ.js → chunk-UYTIJCCW.js} +10 -42
- package/dist/chunk-UYTIJCCW.js.map +1 -0
- package/dist/chunk-XX6JZW5N.js +36 -0
- package/dist/chunk-XX6JZW5N.js.map +1 -0
- package/dist/{chunk-2ZF3J7OO.js → chunk-XXSZL5CY.js} +17 -5
- package/dist/chunk-XXSZL5CY.js.map +1 -0
- package/dist/{chunk-6PMA6NHE.js → chunk-Y55FNQHS.js} +5 -3
- package/dist/{chunk-6PMA6NHE.js.map → chunk-Y55FNQHS.js.map} +1 -1
- package/dist/chunk-ZAWGJC4I.js +176 -0
- package/dist/chunk-ZAWGJC4I.js.map +1 -0
- package/dist/chunk-ZUQ3DOG2.js +110 -0
- package/dist/chunk-ZUQ3DOG2.js.map +1 -0
- package/dist/components/accordion.d.ts +22 -0
- package/dist/components/accordion.js +6 -2
- package/dist/components/alert.d.ts +22 -1
- package/dist/components/alert.js +3 -2
- package/dist/components/app-bar.d.ts +153 -0
- package/dist/components/app-bar.js +15 -0
- package/dist/components/app-bar.js.map +1 -0
- package/dist/components/app-ui.d.ts +29 -2
- package/dist/components/app-ui.js +5 -4
- package/dist/components/badge.d.ts +17 -1
- package/dist/components/badge.js +4 -3
- package/dist/components/blocks.js +5 -4
- package/dist/components/button.d.ts +18 -2
- package/dist/components/button.js +4 -3
- package/dist/components/checkbox-group.js +4 -3
- package/dist/components/checkbox.js +4 -3
- package/dist/components/checked.d.ts +77 -0
- package/dist/components/checked.js +10 -0
- package/dist/components/checked.js.map +1 -0
- package/dist/components/chip-group.d.ts +113 -0
- package/dist/components/chip-group.js +11 -0
- package/dist/components/chip-group.js.map +1 -0
- package/dist/components/chip.d.ts +11 -0
- package/dist/components/chip.js +3 -2
- package/dist/components/code-diff.d.ts +77 -0
- package/dist/components/code-diff.js +10 -0
- package/dist/components/code-diff.js.map +1 -0
- package/dist/components/date-input.js +4 -3
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.js +3 -2
- package/dist/components/fieldset.js +3 -2
- package/dist/components/grid.js +3 -2
- package/dist/components/help.js +3 -2
- package/dist/components/icon.js +3 -2
- package/dist/components/journey.js +4 -3
- package/dist/components/language-switch.d.ts +59 -0
- package/dist/components/language-switch.js +10 -0
- package/dist/components/language-switch.js.map +1 -0
- package/dist/components/layout.d.ts +8 -2
- package/dist/components/layout.js +3 -2
- package/dist/components/link.js +4 -3
- package/dist/components/list.js +3 -2
- package/dist/components/media.js +3 -2
- package/dist/components/meter.d.ts +112 -0
- package/dist/components/meter.js +13 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/navigation.d.ts +52 -0
- package/dist/components/navigation.js +4 -3
- package/dist/components/page.d.ts +13 -8
- package/dist/components/page.js +3 -2
- package/dist/components/price.js +3 -2
- package/dist/components/progress.d.ts +16 -2
- package/dist/components/progress.js +3 -2
- package/dist/components/radio-group.js +4 -3
- package/dist/components/redaction.d.ts +51 -0
- package/dist/components/redaction.js +10 -0
- package/dist/components/redaction.js.map +1 -0
- package/dist/components/rows.d.ts +28 -0
- package/dist/components/rows.js +7 -3
- package/dist/components/select.js +4 -3
- package/dist/components/shell.js +4 -3
- package/dist/components/source.d.ts +68 -0
- package/dist/components/source.js +10 -0
- package/dist/components/source.js.map +1 -0
- package/dist/components/status-pill-style.d.ts +16 -0
- package/dist/components/status-pill-style.js +15 -0
- package/dist/components/status-pill-style.js.map +1 -0
- package/dist/components/status.d.ts +66 -0
- package/dist/components/status.js +10 -0
- package/dist/components/status.js.map +1 -0
- package/dist/components/summary-list.js +3 -2
- package/dist/components/switch.js +4 -3
- package/dist/components/table.d.ts +19 -0
- package/dist/components/table.js +4 -3
- package/dist/components/text-input.js +5 -4
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +4 -3
- package/dist/components/tool-card.d.ts +107 -0
- package/dist/components/tool-card.js +11 -0
- package/dist/components/tool-card.js.map +1 -0
- package/dist/components/tool-kit-tokens.d.ts +25 -0
- package/dist/components/tool-kit-tokens.js +8 -0
- package/dist/components/tool-kit-tokens.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +116 -70
- package/dist/standalone/atomic-ui.js +2047 -733
- package/dist/standalone/atomic-ui.js.map +4 -4
- package/package.json +2 -2
- package/dist/chunk-2D2IMQII.js.map +0 -1
- package/dist/chunk-2EP3IV3G.js.map +0 -1
- package/dist/chunk-2ZF3J7OO.js.map +0 -1
- package/dist/chunk-3T7J66Z2.js.map +0 -1
- package/dist/chunk-7UWJXPR3.js.map +0 -1
- package/dist/chunk-A4M3A4SZ.js.map +0 -1
- package/dist/chunk-AURT72IC.js.map +0 -1
- package/dist/chunk-AYKYHZGQ.js +0 -108
- package/dist/chunk-AYKYHZGQ.js.map +0 -1
- package/dist/chunk-D6NET2VB.js.map +0 -1
- package/dist/chunk-DN5YZFSG.js.map +0 -1
- package/dist/chunk-MLKNZL5J.js.map +0 -1
- package/dist/chunk-MOO63SHZ.js.map +0 -1
- package/dist/chunk-OJO62KRX.js.map +0 -1
- package/dist/chunk-ONED3PUB.js.map +0 -1
- package/dist/chunk-OZGKK3N5.js.map +0 -1
- package/dist/chunk-QU3U2CS2.js +0 -144
- package/dist/chunk-QU3U2CS2.js.map +0 -1
- package/dist/chunk-TJOYBDKS.js.map +0 -1
- package/dist/chunk-UFPI4I2Y.js.map +0 -1
- package/dist/chunk-V7EB7Q2M.js.map +0 -1
- package/dist/chunk-ZEIV5X3U.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nothing, type TemplateResult } from 'lit';
|
|
1
|
+
import { nothing, type CSSResult, type TemplateResult } from 'lit';
|
|
2
2
|
import { ImpaktElement } from './ImpaktElement';
|
|
3
3
|
/**
|
|
4
4
|
* The shared anatomy of a form control: a label, an optional description, a
|
|
@@ -21,7 +21,14 @@ import { ImpaktElement } from './ImpaktElement';
|
|
|
21
21
|
* what to type (1.3.5 is about the purpose, this is about the size). Applied by
|
|
22
22
|
* the controls that take a `width`, through `--impakt-field-width`.
|
|
23
23
|
*/
|
|
24
|
-
export declare const fieldWidths:
|
|
24
|
+
export declare const fieldWidths: CSSResult;
|
|
25
|
+
/**
|
|
26
|
+
* The box a single control is drawn in, shared by the text input, the select and
|
|
27
|
+
* the textarea so they match: a 1px ink border, no shadow, and on focus the
|
|
28
|
+
* locked two-band ring rather than a wide halo (G2 Noire, frames 33:492 and 36:398).
|
|
29
|
+
* A product can still set `--impakt-shadow-field` or `--impakt-color-field-border`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const fieldControl: (selector: string) => CSSResult;
|
|
25
32
|
/**
|
|
26
33
|
* The base of every form control.
|
|
27
34
|
*
|
|
@@ -82,7 +89,7 @@ export declare abstract class FieldElement extends ImpaktElement {
|
|
|
82
89
|
requiredText: string;
|
|
83
90
|
protected internals: ElementInternals | null;
|
|
84
91
|
constructor();
|
|
85
|
-
static styles:
|
|
92
|
+
static styles: CSSResult[];
|
|
86
93
|
protected get controlId(): string;
|
|
87
94
|
/**
|
|
88
95
|
* What the control points `aria-describedby` at.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HSXLSJVG.js";
|
|
4
|
+
import {
|
|
5
|
+
targetSize
|
|
6
|
+
} from "./chunk-72WNCCDC.js";
|
|
4
7
|
import {
|
|
5
8
|
fontSize,
|
|
6
9
|
space,
|
|
7
|
-
t
|
|
8
|
-
|
|
9
|
-
} from "./chunk-V7EB7Q2M.js";
|
|
10
|
+
t
|
|
11
|
+
} from "./chunk-JTCTQBAX.js";
|
|
10
12
|
|
|
11
13
|
// packages/ui/src/components/radio-group.ts
|
|
12
14
|
import { html, css, nothing } from "lit";
|
|
@@ -136,4 +138,4 @@ customElements.define("impakt-radio-group", ImpaktRadioGroup);
|
|
|
136
138
|
export {
|
|
137
139
|
ImpaktRadioGroup
|
|
138
140
|
};
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
141
|
+
//# sourceMappingURL=chunk-2TNF7O43.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/radio-group.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement } from '../base/FieldElement';\nimport { targetSize } from '../base/styles';\nimport { fontSize, space, t } from '../base/tokens';\n\nexport interface RadioOption {\n value: string;\n label: string;\n description?: string;\n}\n\n/**\n * A choose-one group.\n *\n * **It renders native radios, and that is the whole design.** A group of\n * `<input type=\"radio\">` sharing a name already has roving tabindex, arrow-key\n * navigation that wraps, Home and End, selection-follows-focus, and the right\n * announcement in every screen reader — all of it, correctly, with no\n * JavaScript. Hand-rolling that is the single most commonly attempted and most\n * commonly botched widget in any design system, and every version of it is a\n * worse version of what the platform ships.\n *\n * Because the radios share one shadow root, their `name` scopes to this\n * component and cannot collide with another group on the page.\n *\n * The label is a `<legend>` inside a `<fieldset>`, not a `<label for>`:\n * `for` names one control, and the question here is asked of the set.\n\n *\n * @category form\n * @icon radio\n */\nexport class ImpaktRadioGroup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n options: { type: Array },\n };\n\n declare options: RadioOption[];\n\n constructor() {\n super();\n this.options = [];\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n min-inline-size: 0;\n }\n legend {\n padding: 0;\n }\n .option {\n display: flex;\n align-items: flex-start;\n gap: ${space(3)};\n padding: ${space(3)};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radius};\n margin-block-end: ${space(2)};\n cursor: pointer;\n }\n .option:hover {\n background: ${t.surfaceSubtle};\n }\n /* The whole row is the target, not the 20px dot — 2.5.8 is a floor and\n a comfortable target is the actual goal. */\n .option input {\n ${targetSize}\n inline-size: 20px;\n block-size: 20px;\n margin: 0;\n flex: none;\n accent-color: ${t.brand};\n }\n .option-text {\n display: block;\n font-size: ${fontSize('md')};\n }\n .option-description {\n display: block;\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n margin-block-start: ${space(1)};\n }\n :host([invalid]) .option {\n border-color: ${t.danger};\n }\n `,\n ];\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </legend>`;\n }\n\n protected renderControl(): TemplateResult {\n return html`\n ${this.options.map((option, i) => {\n const id = this.id_(`opt-${i}`);\n const descId = option.description ? this.id_(`opt-${i}-desc`) : undefined;\n return html`\n <label class=\"option\" part=\"option\" for=${id}>\n <input\n type=\"radio\"\n id=${id}\n name=${this.uid}\n value=${option.value}\n .checked=${this.value === option.value}\n ?disabled=${this.disabled}\n ?required=${this.required && i === 0}\n aria-describedby=${descId ?? nothing}\n @change=${() => this.setFormValue(option.value)}\n />\n <span>\n <span class=\"option-text\">${option.label}</span>\n ${option.description ? html`<span class=\"option-description\" id=${descId!}>${option.description}</span>` : nothing}\n </span>\n </label>\n `;\n })}\n `;\n }\n\n /**\n * The fieldset wraps everything, so the whole field is rebuilt here rather\n * than relying on the base class's flat order.\n */\n render(): TemplateResult {\n return html`\n <fieldset\n part=\"fieldset\"\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n >\n ${this.renderLabel()}\n ${\n this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing\n }\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">\n ${this.error || nothing}\n </div>\n </fieldset>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-radio-group', ImpaktRadioGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-radio-group': ImpaktRadioGroup;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/radio-group.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement } from '../base/FieldElement';\nimport { targetSize } from '../base/styles';\nimport { fontSize, space, t } from '../base/tokens';\n\nexport interface RadioOption {\n value: string;\n label: string;\n description?: string;\n}\n\n/**\n * A choose-one group.\n *\n * **It renders native radios, and that is the whole design.** A group of\n * `<input type=\"radio\">` sharing a name already has roving tabindex, arrow-key\n * navigation that wraps, Home and End, selection-follows-focus, and the right\n * announcement in every screen reader — all of it, correctly, with no\n * JavaScript. Hand-rolling that is the single most commonly attempted and most\n * commonly botched widget in any design system, and every version of it is a\n * worse version of what the platform ships.\n *\n * Because the radios share one shadow root, their `name` scopes to this\n * component and cannot collide with another group on the page.\n *\n * The label is a `<legend>` inside a `<fieldset>`, not a `<label for>`:\n * `for` names one control, and the question here is asked of the set.\n\n *\n * @category form\n * @icon radio\n */\nexport class ImpaktRadioGroup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n options: { type: Array },\n };\n\n declare options: RadioOption[];\n\n constructor() {\n super();\n this.options = [];\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n min-inline-size: 0;\n }\n legend {\n padding: 0;\n }\n .option {\n display: flex;\n align-items: flex-start;\n gap: ${space(3)};\n padding: ${space(3)};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radius};\n margin-block-end: ${space(2)};\n cursor: pointer;\n }\n .option:hover {\n background: ${t.surfaceSubtle};\n }\n /* The whole row is the target, not the 20px dot — 2.5.8 is a floor and\n a comfortable target is the actual goal. */\n .option input {\n ${targetSize}\n inline-size: 20px;\n block-size: 20px;\n margin: 0;\n flex: none;\n accent-color: ${t.brand};\n }\n .option-text {\n display: block;\n font-size: ${fontSize('md')};\n }\n .option-description {\n display: block;\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n margin-block-start: ${space(1)};\n }\n :host([invalid]) .option {\n border-color: ${t.danger};\n }\n `,\n ];\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </legend>`;\n }\n\n protected renderControl(): TemplateResult {\n return html`\n ${this.options.map((option, i) => {\n const id = this.id_(`opt-${i}`);\n const descId = option.description ? this.id_(`opt-${i}-desc`) : undefined;\n return html`\n <label class=\"option\" part=\"option\" for=${id}>\n <input\n type=\"radio\"\n id=${id}\n name=${this.uid}\n value=${option.value}\n .checked=${this.value === option.value}\n ?disabled=${this.disabled}\n ?required=${this.required && i === 0}\n aria-describedby=${descId ?? nothing}\n @change=${() => this.setFormValue(option.value)}\n />\n <span>\n <span class=\"option-text\">${option.label}</span>\n ${option.description ? html`<span class=\"option-description\" id=${descId!}>${option.description}</span>` : nothing}\n </span>\n </label>\n `;\n })}\n `;\n }\n\n /**\n * The fieldset wraps everything, so the whole field is rebuilt here rather\n * than relying on the base class's flat order.\n */\n render(): TemplateResult {\n return html`\n <fieldset\n part=\"fieldset\"\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n >\n ${this.renderLabel()}\n ${\n this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing\n }\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">\n ${this.error || nothing}\n </div>\n </fieldset>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-radio-group', ImpaktRadioGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-radio-group': ImpaktRadioGroup;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAgCjD,IAAM,mBAAN,cAA+B,aAAa;AAAA,EACjD;AAAA,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,KAAK;AAAA,yBACT,KAAK,UAAU,OAAO,KAAK;AAAA,0BAC1B,KAAK,QAAQ;AAAA,0BACb,KAAK,YAAY,MAAM,CAAC;AAAA,iCACjB,UAAU,OAAO;AAAA,wBAC1B,MAAM,KAAK,aAAa,OAAO,KAAK,CAAC;AAAA;AAAA;AAAA,0CAGnB,OAAO,KAAK;AAAA,gBACtC,OAAO,cAAc,2CAA2C,MAAO,IAAI,OAAO,WAAW,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA,IAI1H,CAAC,CAAC;AAAA;AAAA,EAEN;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,2BAGgB,KAAK,WAAW;AAAA,uBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA;AAAA,UAE1C,KAAK,YAAY,CAAC;AAAA,UAElB,KAAK,cACD,mCAAmC,KAAK,IAAI,aAAa,CAAC;AAAA,gBACxD,KAAK,WAAW;AAAA,sBAElB,OACN;AAAA,UACE,KAAK,cAAc,CAAC;AAAA,gCACE,KAAK,IAAI,OAAO,CAAC;AAAA,YACrC,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA;AAAA,EAI/B;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
|
|
@@ -4,21 +4,23 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
FieldElement,
|
|
6
6
|
fieldWidths
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HSXLSJVG.js";
|
|
8
8
|
import {
|
|
9
9
|
ImpaktElement,
|
|
10
10
|
focusRing,
|
|
11
|
+
say,
|
|
12
|
+
targetSize,
|
|
13
|
+
touchTarget,
|
|
14
|
+
visuallyHidden
|
|
15
|
+
} from "./chunk-72WNCCDC.js";
|
|
16
|
+
import {
|
|
11
17
|
fontSize,
|
|
12
18
|
fontWeight,
|
|
13
|
-
say,
|
|
14
19
|
space,
|
|
15
20
|
spaceAround,
|
|
16
21
|
t,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
type,
|
|
20
|
-
visuallyHidden
|
|
21
|
-
} from "./chunk-V7EB7Q2M.js";
|
|
22
|
+
type
|
|
23
|
+
} from "./chunk-JTCTQBAX.js";
|
|
22
24
|
|
|
23
25
|
// packages/ui/src/components/journey.ts
|
|
24
26
|
import { css, html, nothing } from "lit";
|
|
@@ -510,7 +512,7 @@ var ImpaktTaskList = class extends ImpaktElement {
|
|
|
510
512
|
a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.link}; font-weight: ${fontWeight("semibold")}; text-underline-offset: 0.2em; }
|
|
511
513
|
.title { font-weight: ${fontWeight("semibold")}; }
|
|
512
514
|
.hint { display: block; ${type("sm")} color: ${t.textMuted}; }
|
|
513
|
-
.tag { flex-shrink: 0; padding: ${space(1)} ${space(2.5)}; border-radius:
|
|
515
|
+
.tag { flex-shrink: 0; padding: ${space(1)} ${space(2.5)}; border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999)); ${type("sm")} font-weight: ${fontWeight("semibold")}; background: ${t.surfaceInset}; color: ${t.text}; }
|
|
514
516
|
.tag[data-status='done'] { background: ${t.successSubtle}; color: ${t.successText}; }
|
|
515
517
|
.tag[data-status='in-progress'] { background: ${t.brandSubtle}; color: ${t.link}; }
|
|
516
518
|
.tag[data-status='cannot-start'] { background: transparent; color: ${t.textMuted}; }
|
|
@@ -555,4 +557,4 @@ export {
|
|
|
555
557
|
ImpaktRangeInput,
|
|
556
558
|
ImpaktTaskList
|
|
557
559
|
};
|
|
558
|
-
//# sourceMappingURL=chunk-
|
|
560
|
+
//# sourceMappingURL=chunk-2WHOBIOY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/journey.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, spaceAround, t, type } from '../base/tokens';\n\n/** One address a postcode search found. */\nexport interface AddressItem {\n id: string;\n /** The address on one line, as the customer will recognise it. */\n line: string;\n}\n\n/** One mistake on the page, and the field it is about. */\nexport interface ErrorItem {\n id: string;\n text: string;\n /** The field to go to, such as `#postcode`. */\n href: string;\n}\n\n/** One part of a long application. */\nexport interface TaskItem {\n id: string;\n title: string;\n /** Where the part is filled in. Left out while it cannot be started. */\n href?: string;\n status: 'done' | 'in-progress' | 'not-started' | 'cannot-start';\n /** A line under the title, such as how long it takes. */\n hint?: string;\n}\n\nconst inputStyles = css`\n input, select {\n box-sizing: border-box;\n inline-size: min(100%, var(--impakt-field-width));\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(3)};\n font: inherit;\n /* 16px whatever the page around it sets, so a phone does not zoom in on focus. */\n font-size: max(${fontSize('md')}, 16px);\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n }\n input:focus-visible, select:focus-visible { border-color: ${t.brand}; box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo}; outline: none; }\n :host([invalid]) input, :host([invalid]) select { border-color: ${t.danger}; border-width: ${t.borderThick}; }\n .btn {\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(4)};\n font: inherit;\n font-weight: ${fontWeight('semibold')};\n color: ${t.onBrand};\n background: ${t.brand};\n border: 0;\n border-radius: ${t.radiusLg};\n cursor: pointer;\n }\n .btn:hover { background: ${t.brandHover}; }\n .quiet { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; padding: 0; font: inherit; color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; cursor: pointer; }\n .visually-hidden { ${visuallyHidden} }\n`;\n\n/**\n * Find an address from a postcode, then pick it from a list.\n *\n * The addresses come from the app. With `lookup-url` set, the component asks\n * that address itself (`?postcode=…`, answering `[{ id, line }]`); otherwise\n * it fires `impakt-lookup` with the postcode and the app sets `addresses`.\n * There is always a way to type the address in, because no list is complete.\n *\n * @fires {CustomEvent<{ postcode: string }>} impakt-lookup - When a postcode is searched for. The postcode is in detail.postcode.\n * @category form\n * @icon home\n */\nexport class ImpaktAddressLookup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n postcodeLabel: { type: String, attribute: 'postcode-label' },\n findText: { type: String, attribute: 'find-text' },\n chooseLabel: { type: String, attribute: 'choose-label' },\n manualText: { type: String, attribute: 'manual-text' },\n notFoundText: { type: String, attribute: 'not-found-text' },\n lookupUrl: { type: String, attribute: 'lookup-url' },\n addresses: { type: Array },\n };\n declare postcodeLabel: string;\n declare findText: string;\n declare chooseLabel: string;\n declare manualText: string;\n declare notFoundText: string;\n /** An address that returns `[{ id, line }]` for `?postcode=`. Optional. */\n declare lookupUrl: string;\n declare addresses: AddressItem[];\n declare manual: boolean;\n declare postcode: string;\n declare searched: boolean;\n declare busy: boolean;\n\n constructor() {\n super();\n this.label = 'Your address';\n this.postcodeLabel = 'Postcode';\n this.findText = 'Find address';\n this.chooseLabel = 'Choose your address';\n this.manualText = 'Enter the address yourself';\n this.notFoundText = 'No addresses found for that postcode. Check it, or enter the address yourself.';\n this.lookupUrl = '';\n this.addresses = [];\n this.manual = false;\n this.postcode = '';\n this.searched = false;\n this.busy = false;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n inputStyles,\n css`\n .row { display: flex; flex-wrap: wrap; gap: ${space(2)}; align-items: flex-end; }\n .row label { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1)}; }\n .postcode input { inline-size: 12ch; text-transform: uppercase; }\n .choose { margin-block-start: ${space(4)}; }\n .choose select { inline-size: 100%; }\n .manual { display: grid; gap: ${space(3)}; margin-block-start: ${space(3)}; }\n .manual label { display: block; ${type('sm')} margin-block-end: ${space(1)}; }\n .manual input { inline-size: 100%; }\n .note { ${type('sm')} color: ${t.textMuted}; margin: ${space(2)} 0 0; }\n .switch { margin-block-start: ${space(3)}; }\n `,\n ];\n\n private async find(): Promise<void> {\n const postcode = this.postcode.trim().toUpperCase();\n if (!postcode) return;\n this.dispatchEvent(new CustomEvent('impakt-lookup', { detail: { postcode }, bubbles: true, composed: true }));\n if (!this.lookupUrl) {\n this.searched = true;\n return;\n }\n this.busy = true;\n try {\n const url = new URL(this.lookupUrl, globalThis.location?.href);\n url.searchParams.set('postcode', postcode);\n const found = await (await fetch(url)).json();\n this.addresses = Array.isArray(found) ? found : [];\n } catch {\n this.addresses = [];\n } finally {\n this.busy = false;\n this.searched = true;\n }\n }\n\n private manualLine(): string {\n const parts = ['line1', 'line2', 'town', 'mpostcode'].map((p) => (this.renderRoot.querySelector<HTMLInputElement>(`#${this.id_(p)}`)?.value ?? '').trim());\n return parts.filter(Boolean).join(', ');\n }\n\n protected renderControl(): TemplateResult {\n if (this.manual) {\n const field = (key: string, label: string, autocomplete: string) =>\n html`<div><label for=${this.id_(key)}>${label}</label><input id=${this.id_(key)} autocomplete=${autocomplete} @input=${() => this.setFormValue(this.manualLine())} /></div>`;\n return html`<div class=\"manual\" role=\"group\" aria-label=${this.label}>\n ${field('line1', say('Building and street'), 'address-line1')}\n ${field('line2', say('Second line (optional)'), 'address-line2')}\n ${field('town', say('Town or city'), 'address-level2')}\n ${field('mpostcode', say('Postcode'), 'postal-code')}\n <button class=\"quiet switch\" type=\"button\" @click=${() => {\n this.manual = false;\n }}>${say('Find the address from the postcode')}</button>\n </div>`;\n }\n return html`\n <div class=\"row\">\n <div class=\"postcode\"><label for=${this.controlId}>${this.postcodeLabel}</label>\n <input id=${this.controlId} autocomplete=\"postal-code\" .value=${this.postcode} aria-describedby=${this.describedBy}\n @input=${(e: Event) => {\n this.postcode = (e.target as HTMLInputElement).value;\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n void this.find();\n }\n }} /></div>\n <button class=\"btn\" type=\"button\" ?disabled=${this.busy} @click=${() => this.find()}>${this.busy ? 'Finding…' : this.findText}</button>\n </div>\n ${\n this.addresses.length\n ? html`<div class=\"choose\"><label class=\"label\" for=${this.id_('choose')}>${this.chooseLabel}</label>\n <select id=${this.id_('choose')} @change=${(e: Event) => this.setFormValue((e.target as HTMLSelectElement).value)}>\n <option value=\"\">${this.addresses.length} ${this.addresses.length === 1 ? 'address' : 'addresses'} found</option>\n ${this.addresses.map((a) => html`<option value=${a.line} ?selected=${a.line === this.value}>${a.line}</option>`)}\n </select></div>`\n : this.searched && !this.busy\n ? html`<p class=\"note\" role=\"status\">${this.notFoundText}</p>`\n : nothing\n }\n <button class=\"quiet switch\" type=\"button\" @click=${() => {\n this.manual = true;\n }}>${this.manualText}</button>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\n/**\n * Every mistake on the page, listed at the top, each linking to its field.\n *\n * It takes focus when it appears, so someone using a screen reader hears what\n * is wrong straight away rather than finding out field by field. It draws\n * nothing while there are no mistakes. Each link moves focus to its field, which\n * may be a field inside another component, such as `#postcode` for an\n * `impakt-text-input` with that id.\n *\n * @category feedback\n * @icon alert\n */\nexport class ImpaktErrorSummary extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare items: ErrorItem[];\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.heading = 'There is a problem';\n this.items = [];\n this.spaceAbove = 'none';\n this.spaceBelow = 'md';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n touchTarget('a'),\n css`\n :host { display: block; }\n .box { padding: ${space(5)}; border: ${t.borderThick} solid ${t.danger}; border-inline-start-width: 6px; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }\n .box:focus { outline: 3px solid ${t.danger}; outline-offset: 2px; }\n h2 { margin: 0 0 ${space(3)}; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${space(2)}; }\n a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; text-underline-offset: 0.2em; }\n `,\n ];\n\n private go(event: Event, href: string): void {\n const id = href.replace(/^#/, '');\n const root = this.getRootNode() as Document | ShadowRoot;\n const target = (root.querySelector?.(`#${CSS.escape(id)}`) ?? document.getElementById(id)) as HTMLElement | null;\n if (!target) return;\n event.preventDefault();\n target.scrollIntoView({ block: 'center' });\n (target as HTMLElement & { focus: () => void }).focus();\n }\n\n updated(changed: Map<string, unknown>): void {\n const before = changed.get('items') as ErrorItem[] | undefined;\n if (changed.has('items') && this.items.length && !before?.length) this.renderRoot.querySelector<HTMLElement>('.box')?.focus();\n }\n\n render(): TemplateResult | typeof nothing {\n if (!this.items.length) return nothing;\n return html`<div class=\"box\" role=\"alert\" tabindex=\"-1\" aria-labelledby=${this.id_('h')} part=\"box\">\n <h2 id=${this.id_('h')}>${this.heading}</h2>\n <ul>${this.items.map((i) => html`<li><a href=${i.href} @click=${(e: Event) => this.go(e, i.href)}>${i.text}</a></li>`)}</ul>\n </div>`;\n }\n}\n\nconst fileSize = (bytes: number) =>\n bytes >= 1048576 ? say('{size} MB', { size: (bytes / 1048576).toFixed(1) }) : say('{size} KB', { size: Math.max(1, Math.round(bytes / 1024)) });\n\n/**\n * Add one or more files, such as proof of identity or photos for a claim.\n *\n * A file can be chosen or dropped on the box. Each one is checked for type and\n * size here and listed with a Remove button; the upload itself is the app's,\n * which gets the files on `impakt-files`. The answer is the file names.\n *\n * The file input itself takes focus, so Tab reaches it and Enter or Space opens\n * the file chooser; the visible button is its label and draws its focus ring.\n * A file that is added or removed is said to a screen reader, and a file that\n * does not fit marks the box and says why.\n *\n * @fires {CustomEvent<{ files: File[] }>} impakt-files - When the files change. The files are in detail.files.\n *\n * @category form\n * @icon upload\n */\nexport class ImpaktFileUpload extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n accept: { type: String },\n manyFiles: { type: Boolean, attribute: 'many-files' },\n maxSizeMb: { type: Number, attribute: 'max-size-mb' },\n chooseText: { type: String, attribute: 'choose-text' },\n dropText: { type: String, attribute: 'drop-text' },\n };\n /** File types allowed, such as `.pdf,.jpg,.png`. Empty allows any. */\n declare accept: string;\n /** Let more than one file be added. */\n declare manyFiles: boolean;\n declare maxSizeMb: number;\n declare chooseText: string;\n declare dropText: string;\n declare files: File[];\n declare over: boolean;\n declare protected said: string;\n\n constructor() {\n super();\n this.label = 'Upload a file';\n this.accept = '.pdf,.jpg,.jpeg,.png';\n this.manyFiles = false;\n this.maxSizeMb = 10;\n this.chooseText = 'Choose file';\n this.dropText = 'or drop it here';\n this.files = [];\n this.over = false;\n this.said = '';\n }\n\n static styles = [\n ...FieldElement.styles,\n inputStyles,\n targetSize,\n touchTarget('label.btn, .quiet'),\n css`\n .zone { display: flex; flex-wrap: wrap; align-items: center; gap: ${space(3)}; padding: ${space(5)}; border: 2px dashed ${t.border}; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }\n .zone.over { border-color: ${t.brand}; background: ${t.brandSubtle}; }\n :host([invalid]) .zone { border-color: ${t.danger}; border-style: solid; }\n :host([disabled]) label.btn { cursor: not-allowed; }\n .drop { color: ${t.textMuted}; }\n input[type='file'] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }\n label.btn { display: inline-flex; align-items: center; }\n input[type='file']:focus-visible + label.btn { box-shadow: ${t.focusShadow}; }\n ul { margin: ${space(3)} 0 0; padding: 0; list-style: none; display: grid; gap: ${space(2)}; }\n li { display: flex; justify-content: space-between; gap: ${space(3)}; align-items: center; padding: ${space(2)} ${space(3)}; border-radius: ${t.radius}; background: ${t.surfaceInset}; }\n .size { color: ${t.textMuted}; ${type('sm')} }\n `,\n ];\n\n private fits(file: File): string | null {\n if (this.maxSizeMb && file.size > this.maxSizeMb * 1048576) return say('{file} is bigger than {size} MB', { file: file.name, size: this.maxSizeMb });\n const kinds = this.accept\n .split(',')\n .map((k) => k.trim().toLowerCase())\n .filter(Boolean);\n if (\n kinds.length &&\n !kinds.some((k) =>\n k.startsWith('.') ? file.name.toLowerCase().endsWith(k) : file.type === k || (k.endsWith('/*') && file.type.startsWith(k.slice(0, -1))),\n )\n ) {\n return say('{file} must be {kinds}', { file: file.name, kinds: kinds.map((k) => k.replace('.', '').toUpperCase()).join(', ') });\n }\n return null;\n }\n\n /** Adds files, keeping only those that pass, and says why any did not. */\n add(list: FileList | File[]): void {\n const chosen = Array.from(list);\n const problems = chosen.map((f) => this.fits(f)).filter((p): p is string => Boolean(p));\n const good = chosen.filter((f) => !this.fits(f));\n const kept = this.manyFiles ? good : good.slice(0, 1);\n this.files = this.manyFiles ? [...this.files, ...good] : kept.length ? kept : this.files;\n this.error = problems.join('. ');\n this.said = kept.map((f) => say('{file} added', { file: f.name })).join('. ');\n this.sync();\n }\n\n private removeFile(index: number): void {\n const gone = this.files[index];\n this.files = this.files.filter((_, i) => i !== index);\n this.said = gone ? say('{file} removed', { file: gone.name }) : '';\n this.sync();\n // The button that was pressed has gone, so focus goes back to the file input rather than to the top of the page.\n void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>('input[type=\"file\"]')?.focus());\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n\n private sync(): void {\n this.setFormValue(this.files.map((f) => f.name).join(', '));\n this.dispatchEvent(new CustomEvent('impakt-files', { detail: { files: this.files }, bubbles: true, composed: true }));\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <div class=\"zone ${this.over ? 'over' : ''}\"\n @dragover=${(e: DragEvent) => {\n e.preventDefault();\n this.over = true;\n }}\n @dragleave=${() => {\n this.over = false;\n }}\n @drop=${(e: DragEvent) => {\n e.preventDefault();\n this.over = false;\n if (e.dataTransfer?.files) this.add(e.dataTransfer.files);\n }}>\n <input id=${this.controlId} type=\"file\" accept=${this.accept || nothing} ?multiple=${this.manyFiles} ?disabled=${this.disabled} ?required=${this.required} aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}\n @change=${(e: Event) => {\n const f = (e.target as HTMLInputElement).files;\n if (f) this.add(f);\n (e.target as HTMLInputElement).value = '';\n }} />\n <label class=\"btn\" for=${this.controlId}>${this.chooseText}</label>\n <span class=\"drop\">${this.dropText}</span>\n </div>\n <p class=\"visually-hidden\" role=\"status\">${this.said}</p>\n ${this.files.length ? html`<ul aria-label=${say('Files added')}>${this.files.map((f, i) => html`<li><span>${f.name} <span class=\"size\">${fileSize(f.size)}</span></span><button class=\"quiet\" type=\"button\" @click=${() => this.removeFile(i)}>${say('Remove')}<span class=\"visually-hidden\"> ${f.name}</span></button></li>`)}</ul>` : nothing}\n `;\n }\n}\n\n/** The currency's symbol, such as £ for GBP. */\nfunction symbolOf(currency: string): string {\n try {\n return (\n new Intl.NumberFormat(pageLocale(), { style: 'currency', currency, maximumFractionDigits: 0 }).formatToParts(0).find((p) => p.type === 'currency')\n ?.value ?? ''\n );\n } catch {\n return '';\n }\n}\n\n/** \"250000\" → \"250,000\". Anything not a number is left as typed. */\nexport function groupDigits(value: string): string {\n const digits = value.replace(/[^\\d.]/g, '');\n if (!digits) return '';\n const [whole, part] = digits.split('.');\n return `${Number(whole).toLocaleString('en-GB')}${part !== undefined ? `.${part.slice(0, 2)}` : ''}`;\n}\n\n/**\n * An amount of money, with the currency sign in front and commas as it is\n * read back, so £250,000 is not mistaken for £25,000.\n *\n * The answer is the plain number, such as `250000`.\n *\n * @category form\n * @icon pound\n */\nexport class ImpaktMoneyInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n currency: { type: String },\n lowest: { type: Number },\n highest: { type: Number },\n pence: { type: Boolean },\n width: { type: String, reflect: true },\n };\n declare currency: string;\n declare lowest: number | undefined;\n declare highest: number | undefined;\n /** Allow pence. Off for amounts like a house price. */\n declare pence: boolean;\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n declare shown: string;\n\n constructor() {\n super();\n this.currency = 'GBP';\n this.lowest = undefined;\n this.highest = undefined;\n this.pence = false;\n this.width = 'md';\n this.shown = '';\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n inputStyles,\n css`\n .wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--impakt-field-width)); }\n .sign { display: flex; align-items: center; padding: 0 ${space(3)}; font-weight: ${fontWeight('semibold')}; background: ${t.surfaceInset}; border: ${t.borderThin} solid ${t.border}; border-inline-end: 0; border-radius: ${t.radiusLg} 0 0 ${t.radiusLg}; }\n .wrap input { inline-size: 100%; border-radius: 0 ${t.radiusLg} ${t.radiusLg} 0; }\n `,\n ];\n\n willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('value') && this.value !== this.shown.replace(/,/g, '')) this.shown = groupDigits(this.value);\n }\n\n private typed(raw: string): void {\n const clean = raw.replace(/[^\\d.]/g, '');\n const value = this.pence ? clean : clean.split('.')[0]!;\n this.shown = raw;\n this.setFormValue(value);\n }\n\n private check(): void {\n this.shown = groupDigits(this.value);\n const n = Number(this.value);\n if (!this.value) return;\n const money = (x: number) => `${symbolOf(this.currency)}${x.toLocaleString('en-GB')}`;\n if (this.lowest !== undefined && n < this.lowest) this.error = say('Enter an amount of {amount} or more', { amount: money(this.lowest) });\n else if (this.highest !== undefined && n > this.highest) this.error = say('Enter an amount of {amount} or less', { amount: money(this.highest) });\n else if (\n this.error === say('Enter an amount of {amount} or more', { amount: money(this.lowest ?? 0) }) ||\n this.error === say('Enter an amount of {amount} or less', { amount: money(this.highest ?? 0) })\n )\n this.error = '';\n }\n\n /** The currency sign describes the field too, so a screen reader hears that the amount is in pounds. */\n protected get describedBy(): string | typeof nothing {\n const ids = [symbolOf(this.currency) ? this.id_('sign') : '', super.describedBy === nothing ? '' : String(super.describedBy)].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n protected renderControl(): TemplateResult {\n return html`<div class=\"wrap\">\n <span class=\"sign\" id=${this.id_('sign')}>${symbolOf(this.currency)}</span>\n <input id=${this.controlId} inputmode=${this.pence ? 'decimal' : 'numeric'} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}\n aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => this.typed((e.target as HTMLInputElement).value)} @blur=${() => this.check()} />\n </div>`;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\n/**\n * Choose a number by sliding, with the value read out beside the label, such\n * as a deposit or how many years. It is a native range control, so arrow keys,\n * a finger and a screen reader all work.\n *\n * @category form\n * @icon sliders\n */\nexport class ImpaktRangeInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n lowest: { type: Number },\n highest: { type: Number },\n step: { type: Number },\n currency: { type: String },\n unit: { type: String },\n };\n declare lowest: number;\n declare highest: number;\n declare step: number;\n /** Show the value as money in this currency, such as GBP. Empty shows a plain number. */\n declare currency: string;\n /** A word after the value, such as `years`. */\n declare unit: string;\n\n constructor() {\n super();\n this.label = 'How much';\n this.lowest = 0;\n this.highest = 100;\n this.step = 1;\n this.currency = '';\n this.unit = '';\n this.value = '50';\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n .top { display: flex; justify-content: space-between; gap: ${space(3)}; }\n output { font-weight: ${fontWeight('semibold')}; color: ${t.text}; }\n input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${t.brand}; }\n .ends { display: flex; justify-content: space-between; ${type('sm')} color: ${t.textMuted}; }\n `,\n ];\n\n /** The value as the customer reads it, such as £25,000 or 25 years. */\n shownAs(n: number): string {\n const locale = pageLocale(this);\n let s = n.toLocaleString(locale);\n if (this.currency) {\n try {\n s = new Intl.NumberFormat(locale, { style: 'currency', currency: this.currency, maximumFractionDigits: 0 }).format(n);\n } catch {\n /* keep the number */\n }\n }\n return this.unit ? `${s} ${this.unit}` : s;\n }\n\n render(): TemplateResult {\n const n = Number(this.value) || 0;\n return html`\n <div class=\"top\"><label class=\"label\" for=${this.controlId}>${this.label}${this.required ? html` <span class=\"required\">(${this.requiredText})</span>` : nothing}</label>\n <output for=${this.controlId}>${this.shownAs(n)}</output></div>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n ${this.renderControl()}\n <div class=\"ends\" aria-hidden=\"true\"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n `;\n }\n\n protected renderControl(): TemplateResult {\n return html`<input id=${this.controlId} type=\"range\" min=${this.lowest} max=${this.highest} step=${this.step} .value=${this.value} ?disabled=${this.disabled}\n aria-valuetext=${this.shownAs(Number(this.value) || 0)} aria-describedby=${this.describedBy}\n @input=${(e: Event) => this.setFormValue((e.target as HTMLInputElement).value)} />`;\n }\n}\n\nconst TASK_WORDS: Record<TaskItem['status'], string> = {\n done: 'Completed',\n 'in-progress': 'In progress',\n 'not-started': 'Not started',\n 'cannot-start': 'Cannot start yet',\n};\n\n/**\n * The parts of a long application, each with whether it is done, so someone\n * can leave and come back to where they were.\n *\n * @category content\n * @icon list\n */\nexport class ImpaktTaskList extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare items: TaskItem[];\n declare headingLevel: 2 | 3;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.heading = 'Your application';\n this.items = [];\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n touchTarget('a'),\n css`\n :host { display: block; }\n .h { margin: 0 0 ${space(2)}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .count { margin: 0 0 ${space(4)}; color: ${t.textMuted}; }\n ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${t.rule}; }\n li { display: flex; justify-content: space-between; align-items: center; gap: ${space(4)}; padding: ${space(4)} 0; border-block-end: 1px solid ${t.rule}; }\n a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.link}; font-weight: ${fontWeight('semibold')}; text-underline-offset: 0.2em; }\n .title { font-weight: ${fontWeight('semibold')}; }\n .hint { display: block; ${type('sm')} color: ${t.textMuted}; }\n .tag { flex-shrink: 0; padding: ${space(1)} ${space(2.5)}; border-radius: 999px; ${type('sm')} font-weight: ${fontWeight('semibold')}; background: ${t.surfaceInset}; color: ${t.text}; }\n .tag[data-status='done'] { background: ${t.successSubtle}; color: ${t.successText}; }\n .tag[data-status='in-progress'] { background: ${t.brandSubtle}; color: ${t.link}; }\n .tag[data-status='cannot-start'] { background: transparent; color: ${t.textMuted}; }\n `,\n ];\n\n render(): TemplateResult {\n const done = this.items.filter((i) => i.status === 'done').length;\n return html`\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.items.length ? html`<p class=\"count\">${say(this.items.length === 1 ? 'You have completed {done} of {total} part.' : 'You have completed {done} of {total} parts.', { done, total: this.items.length })}</p>` : nothing}\n <ul>${this.items.map(\n (i) => html`<li>\n <span>${i.href && i.status !== 'cannot-start' ? html`<a href=${i.href} aria-describedby=${this.id_(`s-${i.id}`)}>${i.title}</a>` : html`<span class=\"title\">${i.title}</span>`}\n ${i.hint ? html`<span class=\"hint\">${i.hint}</span>` : nothing}</span>\n <span class=\"tag\" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${TASK_WORDS[i.status] ? say(TASK_WORDS[i.status]) : i.status}</span>\n </li>`,\n )}</ul>`;\n }\n}\n\n// Working values, not settings: kept out of `properties` so the page designer does not offer them.\nImpaktAddressLookup.createProperty('manual', { state: true });\nImpaktAddressLookup.createProperty('postcode', { state: true });\nImpaktAddressLookup.createProperty('searched', { state: true });\nImpaktAddressLookup.createProperty('busy', { state: true });\nImpaktFileUpload.createProperty('files', { state: true });\nImpaktFileUpload.createProperty('over', { state: true });\nImpaktFileUpload.createProperty('said', { state: true });\nImpaktMoneyInput.createProperty('shown', { state: true });\n\ncustomElements.define('impakt-address-lookup', ImpaktAddressLookup);\ncustomElements.define('impakt-error-summary', ImpaktErrorSummary);\ncustomElements.define('impakt-file-upload', ImpaktFileUpload);\ncustomElements.define('impakt-money-input', ImpaktMoneyInput);\ncustomElements.define('impakt-range-input', ImpaktRangeInput);\ncustomElements.define('impakt-task-list', ImpaktTaskList);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-address-lookup': ImpaktAddressLookup;\n 'impakt-error-summary': ImpaktErrorSummary;\n 'impakt-file-upload': ImpaktFileUpload;\n 'impakt-money-input': ImpaktMoneyInput;\n 'impakt-range-input': ImpaktRangeInput;\n 'impakt-task-list': ImpaktTaskList;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAkCxD,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,eAKL,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,qBAGhB,SAAS,IAAI,CAAC;AA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AE,OAAO,0BAA0B,EAAE,IAAI,YAAY,OAAO;AAAA,wCAChC,EAAE,MAAM,OAAO,KAAK,IAAI,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,WAAW,EAAE,MAAM,IAAI,IAAI,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM;AAAA;AAAA,IAErI,CAAC;AAAA,EACL;AACF;AAGA,oBAAoB,eAAe,UAAU,EAAE,OAAO,KAAK,CAAC;AAC5D,oBAAoB,eAAe,YAAY,EAAE,OAAO,KAAK,CAAC;AAC9D,oBAAoB,eAAe,YAAY,EAAE,OAAO,KAAK,CAAC;AAC9D,oBAAoB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AAC1D,iBAAiB,eAAe,SAAS,EAAE,OAAO,KAAK,CAAC;AACxD,iBAAiB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AACvD,iBAAiB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AACvD,iBAAiB,eAAe,SAAS,EAAE,OAAO,KAAK,CAAC;AAExD,eAAe,OAAO,yBAAyB,mBAAmB;AAClE,eAAe,OAAO,wBAAwB,kBAAkB;AAChE,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/components/journey.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, spaceAround, t, type } from '../base/tokens';\n\n/** One address a postcode search found. */\nexport interface AddressItem {\n id: string;\n /** The address on one line, as the customer will recognise it. */\n line: string;\n}\n\n/** One mistake on the page, and the field it is about. */\nexport interface ErrorItem {\n id: string;\n text: string;\n /** The field to go to, such as `#postcode`. */\n href: string;\n}\n\n/** One part of a long application. */\nexport interface TaskItem {\n id: string;\n title: string;\n /** Where the part is filled in. Left out while it cannot be started. */\n href?: string;\n status: 'done' | 'in-progress' | 'not-started' | 'cannot-start';\n /** A line under the title, such as how long it takes. */\n hint?: string;\n}\n\nconst inputStyles = css`\n input, select {\n box-sizing: border-box;\n inline-size: min(100%, var(--impakt-field-width));\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(3)};\n font: inherit;\n /* 16px whatever the page around it sets, so a phone does not zoom in on focus. */\n font-size: max(${fontSize('md')}, 16px);\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n }\n input:focus-visible, select:focus-visible { border-color: ${t.brand}; box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo}; outline: none; }\n :host([invalid]) input, :host([invalid]) select { border-color: ${t.danger}; border-width: ${t.borderThick}; }\n .btn {\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(4)};\n font: inherit;\n font-weight: ${fontWeight('semibold')};\n color: ${t.onBrand};\n background: ${t.brand};\n border: 0;\n border-radius: ${t.radiusLg};\n cursor: pointer;\n }\n .btn:hover { background: ${t.brandHover}; }\n .quiet { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; padding: 0; font: inherit; color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; cursor: pointer; }\n .visually-hidden { ${visuallyHidden} }\n`;\n\n/**\n * Find an address from a postcode, then pick it from a list.\n *\n * The addresses come from the app. With `lookup-url` set, the component asks\n * that address itself (`?postcode=…`, answering `[{ id, line }]`); otherwise\n * it fires `impakt-lookup` with the postcode and the app sets `addresses`.\n * There is always a way to type the address in, because no list is complete.\n *\n * @fires {CustomEvent<{ postcode: string }>} impakt-lookup - When a postcode is searched for. The postcode is in detail.postcode.\n * @category form\n * @icon home\n */\nexport class ImpaktAddressLookup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n postcodeLabel: { type: String, attribute: 'postcode-label' },\n findText: { type: String, attribute: 'find-text' },\n chooseLabel: { type: String, attribute: 'choose-label' },\n manualText: { type: String, attribute: 'manual-text' },\n notFoundText: { type: String, attribute: 'not-found-text' },\n lookupUrl: { type: String, attribute: 'lookup-url' },\n addresses: { type: Array },\n };\n declare postcodeLabel: string;\n declare findText: string;\n declare chooseLabel: string;\n declare manualText: string;\n declare notFoundText: string;\n /** An address that returns `[{ id, line }]` for `?postcode=`. Optional. */\n declare lookupUrl: string;\n declare addresses: AddressItem[];\n declare manual: boolean;\n declare postcode: string;\n declare searched: boolean;\n declare busy: boolean;\n\n constructor() {\n super();\n this.label = 'Your address';\n this.postcodeLabel = 'Postcode';\n this.findText = 'Find address';\n this.chooseLabel = 'Choose your address';\n this.manualText = 'Enter the address yourself';\n this.notFoundText = 'No addresses found for that postcode. Check it, or enter the address yourself.';\n this.lookupUrl = '';\n this.addresses = [];\n this.manual = false;\n this.postcode = '';\n this.searched = false;\n this.busy = false;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n inputStyles,\n css`\n .row { display: flex; flex-wrap: wrap; gap: ${space(2)}; align-items: flex-end; }\n .row label { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1)}; }\n .postcode input { inline-size: 12ch; text-transform: uppercase; }\n .choose { margin-block-start: ${space(4)}; }\n .choose select { inline-size: 100%; }\n .manual { display: grid; gap: ${space(3)}; margin-block-start: ${space(3)}; }\n .manual label { display: block; ${type('sm')} margin-block-end: ${space(1)}; }\n .manual input { inline-size: 100%; }\n .note { ${type('sm')} color: ${t.textMuted}; margin: ${space(2)} 0 0; }\n .switch { margin-block-start: ${space(3)}; }\n `,\n ];\n\n private async find(): Promise<void> {\n const postcode = this.postcode.trim().toUpperCase();\n if (!postcode) return;\n this.dispatchEvent(new CustomEvent('impakt-lookup', { detail: { postcode }, bubbles: true, composed: true }));\n if (!this.lookupUrl) {\n this.searched = true;\n return;\n }\n this.busy = true;\n try {\n const url = new URL(this.lookupUrl, globalThis.location?.href);\n url.searchParams.set('postcode', postcode);\n const found = await (await fetch(url)).json();\n this.addresses = Array.isArray(found) ? found : [];\n } catch {\n this.addresses = [];\n } finally {\n this.busy = false;\n this.searched = true;\n }\n }\n\n private manualLine(): string {\n const parts = ['line1', 'line2', 'town', 'mpostcode'].map((p) => (this.renderRoot.querySelector<HTMLInputElement>(`#${this.id_(p)}`)?.value ?? '').trim());\n return parts.filter(Boolean).join(', ');\n }\n\n protected renderControl(): TemplateResult {\n if (this.manual) {\n const field = (key: string, label: string, autocomplete: string) =>\n html`<div><label for=${this.id_(key)}>${label}</label><input id=${this.id_(key)} autocomplete=${autocomplete} @input=${() => this.setFormValue(this.manualLine())} /></div>`;\n return html`<div class=\"manual\" role=\"group\" aria-label=${this.label}>\n ${field('line1', say('Building and street'), 'address-line1')}\n ${field('line2', say('Second line (optional)'), 'address-line2')}\n ${field('town', say('Town or city'), 'address-level2')}\n ${field('mpostcode', say('Postcode'), 'postal-code')}\n <button class=\"quiet switch\" type=\"button\" @click=${() => {\n this.manual = false;\n }}>${say('Find the address from the postcode')}</button>\n </div>`;\n }\n return html`\n <div class=\"row\">\n <div class=\"postcode\"><label for=${this.controlId}>${this.postcodeLabel}</label>\n <input id=${this.controlId} autocomplete=\"postal-code\" .value=${this.postcode} aria-describedby=${this.describedBy}\n @input=${(e: Event) => {\n this.postcode = (e.target as HTMLInputElement).value;\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n void this.find();\n }\n }} /></div>\n <button class=\"btn\" type=\"button\" ?disabled=${this.busy} @click=${() => this.find()}>${this.busy ? 'Finding…' : this.findText}</button>\n </div>\n ${\n this.addresses.length\n ? html`<div class=\"choose\"><label class=\"label\" for=${this.id_('choose')}>${this.chooseLabel}</label>\n <select id=${this.id_('choose')} @change=${(e: Event) => this.setFormValue((e.target as HTMLSelectElement).value)}>\n <option value=\"\">${this.addresses.length} ${this.addresses.length === 1 ? 'address' : 'addresses'} found</option>\n ${this.addresses.map((a) => html`<option value=${a.line} ?selected=${a.line === this.value}>${a.line}</option>`)}\n </select></div>`\n : this.searched && !this.busy\n ? html`<p class=\"note\" role=\"status\">${this.notFoundText}</p>`\n : nothing\n }\n <button class=\"quiet switch\" type=\"button\" @click=${() => {\n this.manual = true;\n }}>${this.manualText}</button>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\n/**\n * Every mistake on the page, listed at the top, each linking to its field.\n *\n * It takes focus when it appears, so someone using a screen reader hears what\n * is wrong straight away rather than finding out field by field. It draws\n * nothing while there are no mistakes. Each link moves focus to its field, which\n * may be a field inside another component, such as `#postcode` for an\n * `impakt-text-input` with that id.\n *\n * @category feedback\n * @icon alert\n */\nexport class ImpaktErrorSummary extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare items: ErrorItem[];\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.heading = 'There is a problem';\n this.items = [];\n this.spaceAbove = 'none';\n this.spaceBelow = 'md';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n touchTarget('a'),\n css`\n :host { display: block; }\n .box { padding: ${space(5)}; border: ${t.borderThick} solid ${t.danger}; border-inline-start-width: 6px; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }\n .box:focus { outline: 3px solid ${t.danger}; outline-offset: 2px; }\n h2 { margin: 0 0 ${space(3)}; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${space(2)}; }\n a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; text-underline-offset: 0.2em; }\n `,\n ];\n\n private go(event: Event, href: string): void {\n const id = href.replace(/^#/, '');\n const root = this.getRootNode() as Document | ShadowRoot;\n const target = (root.querySelector?.(`#${CSS.escape(id)}`) ?? document.getElementById(id)) as HTMLElement | null;\n if (!target) return;\n event.preventDefault();\n target.scrollIntoView({ block: 'center' });\n (target as HTMLElement & { focus: () => void }).focus();\n }\n\n updated(changed: Map<string, unknown>): void {\n const before = changed.get('items') as ErrorItem[] | undefined;\n if (changed.has('items') && this.items.length && !before?.length) this.renderRoot.querySelector<HTMLElement>('.box')?.focus();\n }\n\n render(): TemplateResult | typeof nothing {\n if (!this.items.length) return nothing;\n return html`<div class=\"box\" role=\"alert\" tabindex=\"-1\" aria-labelledby=${this.id_('h')} part=\"box\">\n <h2 id=${this.id_('h')}>${this.heading}</h2>\n <ul>${this.items.map((i) => html`<li><a href=${i.href} @click=${(e: Event) => this.go(e, i.href)}>${i.text}</a></li>`)}</ul>\n </div>`;\n }\n}\n\nconst fileSize = (bytes: number) =>\n bytes >= 1048576 ? say('{size} MB', { size: (bytes / 1048576).toFixed(1) }) : say('{size} KB', { size: Math.max(1, Math.round(bytes / 1024)) });\n\n/**\n * Add one or more files, such as proof of identity or photos for a claim.\n *\n * A file can be chosen or dropped on the box. Each one is checked for type and\n * size here and listed with a Remove button; the upload itself is the app's,\n * which gets the files on `impakt-files`. The answer is the file names.\n *\n * The file input itself takes focus, so Tab reaches it and Enter or Space opens\n * the file chooser; the visible button is its label and draws its focus ring.\n * A file that is added or removed is said to a screen reader, and a file that\n * does not fit marks the box and says why.\n *\n * @fires {CustomEvent<{ files: File[] }>} impakt-files - When the files change. The files are in detail.files.\n *\n * @category form\n * @icon upload\n */\nexport class ImpaktFileUpload extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n accept: { type: String },\n manyFiles: { type: Boolean, attribute: 'many-files' },\n maxSizeMb: { type: Number, attribute: 'max-size-mb' },\n chooseText: { type: String, attribute: 'choose-text' },\n dropText: { type: String, attribute: 'drop-text' },\n };\n /** File types allowed, such as `.pdf,.jpg,.png`. Empty allows any. */\n declare accept: string;\n /** Let more than one file be added. */\n declare manyFiles: boolean;\n declare maxSizeMb: number;\n declare chooseText: string;\n declare dropText: string;\n declare files: File[];\n declare over: boolean;\n declare protected said: string;\n\n constructor() {\n super();\n this.label = 'Upload a file';\n this.accept = '.pdf,.jpg,.jpeg,.png';\n this.manyFiles = false;\n this.maxSizeMb = 10;\n this.chooseText = 'Choose file';\n this.dropText = 'or drop it here';\n this.files = [];\n this.over = false;\n this.said = '';\n }\n\n static styles = [\n ...FieldElement.styles,\n inputStyles,\n targetSize,\n touchTarget('label.btn, .quiet'),\n css`\n .zone { display: flex; flex-wrap: wrap; align-items: center; gap: ${space(3)}; padding: ${space(5)}; border: 2px dashed ${t.border}; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }\n .zone.over { border-color: ${t.brand}; background: ${t.brandSubtle}; }\n :host([invalid]) .zone { border-color: ${t.danger}; border-style: solid; }\n :host([disabled]) label.btn { cursor: not-allowed; }\n .drop { color: ${t.textMuted}; }\n input[type='file'] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }\n label.btn { display: inline-flex; align-items: center; }\n input[type='file']:focus-visible + label.btn { box-shadow: ${t.focusShadow}; }\n ul { margin: ${space(3)} 0 0; padding: 0; list-style: none; display: grid; gap: ${space(2)}; }\n li { display: flex; justify-content: space-between; gap: ${space(3)}; align-items: center; padding: ${space(2)} ${space(3)}; border-radius: ${t.radius}; background: ${t.surfaceInset}; }\n .size { color: ${t.textMuted}; ${type('sm')} }\n `,\n ];\n\n private fits(file: File): string | null {\n if (this.maxSizeMb && file.size > this.maxSizeMb * 1048576) return say('{file} is bigger than {size} MB', { file: file.name, size: this.maxSizeMb });\n const kinds = this.accept\n .split(',')\n .map((k) => k.trim().toLowerCase())\n .filter(Boolean);\n if (\n kinds.length &&\n !kinds.some((k) =>\n k.startsWith('.') ? file.name.toLowerCase().endsWith(k) : file.type === k || (k.endsWith('/*') && file.type.startsWith(k.slice(0, -1))),\n )\n ) {\n return say('{file} must be {kinds}', { file: file.name, kinds: kinds.map((k) => k.replace('.', '').toUpperCase()).join(', ') });\n }\n return null;\n }\n\n /** Adds files, keeping only those that pass, and says why any did not. */\n add(list: FileList | File[]): void {\n const chosen = Array.from(list);\n const problems = chosen.map((f) => this.fits(f)).filter((p): p is string => Boolean(p));\n const good = chosen.filter((f) => !this.fits(f));\n const kept = this.manyFiles ? good : good.slice(0, 1);\n this.files = this.manyFiles ? [...this.files, ...good] : kept.length ? kept : this.files;\n this.error = problems.join('. ');\n this.said = kept.map((f) => say('{file} added', { file: f.name })).join('. ');\n this.sync();\n }\n\n private removeFile(index: number): void {\n const gone = this.files[index];\n this.files = this.files.filter((_, i) => i !== index);\n this.said = gone ? say('{file} removed', { file: gone.name }) : '';\n this.sync();\n // The button that was pressed has gone, so focus goes back to the file input rather than to the top of the page.\n void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>('input[type=\"file\"]')?.focus());\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n\n private sync(): void {\n this.setFormValue(this.files.map((f) => f.name).join(', '));\n this.dispatchEvent(new CustomEvent('impakt-files', { detail: { files: this.files }, bubbles: true, composed: true }));\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <div class=\"zone ${this.over ? 'over' : ''}\"\n @dragover=${(e: DragEvent) => {\n e.preventDefault();\n this.over = true;\n }}\n @dragleave=${() => {\n this.over = false;\n }}\n @drop=${(e: DragEvent) => {\n e.preventDefault();\n this.over = false;\n if (e.dataTransfer?.files) this.add(e.dataTransfer.files);\n }}>\n <input id=${this.controlId} type=\"file\" accept=${this.accept || nothing} ?multiple=${this.manyFiles} ?disabled=${this.disabled} ?required=${this.required} aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}\n @change=${(e: Event) => {\n const f = (e.target as HTMLInputElement).files;\n if (f) this.add(f);\n (e.target as HTMLInputElement).value = '';\n }} />\n <label class=\"btn\" for=${this.controlId}>${this.chooseText}</label>\n <span class=\"drop\">${this.dropText}</span>\n </div>\n <p class=\"visually-hidden\" role=\"status\">${this.said}</p>\n ${this.files.length ? html`<ul aria-label=${say('Files added')}>${this.files.map((f, i) => html`<li><span>${f.name} <span class=\"size\">${fileSize(f.size)}</span></span><button class=\"quiet\" type=\"button\" @click=${() => this.removeFile(i)}>${say('Remove')}<span class=\"visually-hidden\"> ${f.name}</span></button></li>`)}</ul>` : nothing}\n `;\n }\n}\n\n/** The currency's symbol, such as £ for GBP. */\nfunction symbolOf(currency: string): string {\n try {\n return (\n new Intl.NumberFormat(pageLocale(), { style: 'currency', currency, maximumFractionDigits: 0 }).formatToParts(0).find((p) => p.type === 'currency')\n ?.value ?? ''\n );\n } catch {\n return '';\n }\n}\n\n/** \"250000\" → \"250,000\". Anything not a number is left as typed. */\nexport function groupDigits(value: string): string {\n const digits = value.replace(/[^\\d.]/g, '');\n if (!digits) return '';\n const [whole, part] = digits.split('.');\n return `${Number(whole).toLocaleString('en-GB')}${part !== undefined ? `.${part.slice(0, 2)}` : ''}`;\n}\n\n/**\n * An amount of money, with the currency sign in front and commas as it is\n * read back, so £250,000 is not mistaken for £25,000.\n *\n * The answer is the plain number, such as `250000`.\n *\n * @category form\n * @icon pound\n */\nexport class ImpaktMoneyInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n currency: { type: String },\n lowest: { type: Number },\n highest: { type: Number },\n pence: { type: Boolean },\n width: { type: String, reflect: true },\n };\n declare currency: string;\n declare lowest: number | undefined;\n declare highest: number | undefined;\n /** Allow pence. Off for amounts like a house price. */\n declare pence: boolean;\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n declare shown: string;\n\n constructor() {\n super();\n this.currency = 'GBP';\n this.lowest = undefined;\n this.highest = undefined;\n this.pence = false;\n this.width = 'md';\n this.shown = '';\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n inputStyles,\n css`\n .wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--impakt-field-width)); }\n .sign { display: flex; align-items: center; padding: 0 ${space(3)}; font-weight: ${fontWeight('semibold')}; background: ${t.surfaceInset}; border: ${t.borderThin} solid ${t.border}; border-inline-end: 0; border-radius: ${t.radiusLg} 0 0 ${t.radiusLg}; }\n .wrap input { inline-size: 100%; border-radius: 0 ${t.radiusLg} ${t.radiusLg} 0; }\n `,\n ];\n\n willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('value') && this.value !== this.shown.replace(/,/g, '')) this.shown = groupDigits(this.value);\n }\n\n private typed(raw: string): void {\n const clean = raw.replace(/[^\\d.]/g, '');\n const value = this.pence ? clean : clean.split('.')[0]!;\n this.shown = raw;\n this.setFormValue(value);\n }\n\n private check(): void {\n this.shown = groupDigits(this.value);\n const n = Number(this.value);\n if (!this.value) return;\n const money = (x: number) => `${symbolOf(this.currency)}${x.toLocaleString('en-GB')}`;\n if (this.lowest !== undefined && n < this.lowest) this.error = say('Enter an amount of {amount} or more', { amount: money(this.lowest) });\n else if (this.highest !== undefined && n > this.highest) this.error = say('Enter an amount of {amount} or less', { amount: money(this.highest) });\n else if (\n this.error === say('Enter an amount of {amount} or more', { amount: money(this.lowest ?? 0) }) ||\n this.error === say('Enter an amount of {amount} or less', { amount: money(this.highest ?? 0) })\n )\n this.error = '';\n }\n\n /** The currency sign describes the field too, so a screen reader hears that the amount is in pounds. */\n protected get describedBy(): string | typeof nothing {\n const ids = [symbolOf(this.currency) ? this.id_('sign') : '', super.describedBy === nothing ? '' : String(super.describedBy)].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n protected renderControl(): TemplateResult {\n return html`<div class=\"wrap\">\n <span class=\"sign\" id=${this.id_('sign')}>${symbolOf(this.currency)}</span>\n <input id=${this.controlId} inputmode=${this.pence ? 'decimal' : 'numeric'} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}\n aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => this.typed((e.target as HTMLInputElement).value)} @blur=${() => this.check()} />\n </div>`;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\n/**\n * Choose a number by sliding, with the value read out beside the label, such\n * as a deposit or how many years. It is a native range control, so arrow keys,\n * a finger and a screen reader all work.\n *\n * @category form\n * @icon sliders\n */\nexport class ImpaktRangeInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n lowest: { type: Number },\n highest: { type: Number },\n step: { type: Number },\n currency: { type: String },\n unit: { type: String },\n };\n declare lowest: number;\n declare highest: number;\n declare step: number;\n /** Show the value as money in this currency, such as GBP. Empty shows a plain number. */\n declare currency: string;\n /** A word after the value, such as `years`. */\n declare unit: string;\n\n constructor() {\n super();\n this.label = 'How much';\n this.lowest = 0;\n this.highest = 100;\n this.step = 1;\n this.currency = '';\n this.unit = '';\n this.value = '50';\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n .top { display: flex; justify-content: space-between; gap: ${space(3)}; }\n output { font-weight: ${fontWeight('semibold')}; color: ${t.text}; }\n input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${t.brand}; }\n .ends { display: flex; justify-content: space-between; ${type('sm')} color: ${t.textMuted}; }\n `,\n ];\n\n /** The value as the customer reads it, such as £25,000 or 25 years. */\n shownAs(n: number): string {\n const locale = pageLocale(this);\n let s = n.toLocaleString(locale);\n if (this.currency) {\n try {\n s = new Intl.NumberFormat(locale, { style: 'currency', currency: this.currency, maximumFractionDigits: 0 }).format(n);\n } catch {\n /* keep the number */\n }\n }\n return this.unit ? `${s} ${this.unit}` : s;\n }\n\n render(): TemplateResult {\n const n = Number(this.value) || 0;\n return html`\n <div class=\"top\"><label class=\"label\" for=${this.controlId}>${this.label}${this.required ? html` <span class=\"required\">(${this.requiredText})</span>` : nothing}</label>\n <output for=${this.controlId}>${this.shownAs(n)}</output></div>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n ${this.renderControl()}\n <div class=\"ends\" aria-hidden=\"true\"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n `;\n }\n\n protected renderControl(): TemplateResult {\n return html`<input id=${this.controlId} type=\"range\" min=${this.lowest} max=${this.highest} step=${this.step} .value=${this.value} ?disabled=${this.disabled}\n aria-valuetext=${this.shownAs(Number(this.value) || 0)} aria-describedby=${this.describedBy}\n @input=${(e: Event) => this.setFormValue((e.target as HTMLInputElement).value)} />`;\n }\n}\n\nconst TASK_WORDS: Record<TaskItem['status'], string> = {\n done: 'Completed',\n 'in-progress': 'In progress',\n 'not-started': 'Not started',\n 'cannot-start': 'Cannot start yet',\n};\n\n/**\n * The parts of a long application, each with whether it is done, so someone\n * can leave and come back to where they were.\n *\n * @category content\n * @icon list\n */\nexport class ImpaktTaskList extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare items: TaskItem[];\n declare headingLevel: 2 | 3;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.heading = 'Your application';\n this.items = [];\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n spaceAround,\n touchTarget('a'),\n css`\n :host { display: block; }\n .h { margin: 0 0 ${space(2)}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .count { margin: 0 0 ${space(4)}; color: ${t.textMuted}; }\n ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${t.rule}; }\n li { display: flex; justify-content: space-between; align-items: center; gap: ${space(4)}; padding: ${space(4)} 0; border-block-end: 1px solid ${t.rule}; }\n a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.link}; font-weight: ${fontWeight('semibold')}; text-underline-offset: 0.2em; }\n .title { font-weight: ${fontWeight('semibold')}; }\n .hint { display: block; ${type('sm')} color: ${t.textMuted}; }\n .tag { flex-shrink: 0; padding: ${space(1)} ${space(2.5)}; border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999)); ${type('sm')} font-weight: ${fontWeight('semibold')}; background: ${t.surfaceInset}; color: ${t.text}; }\n .tag[data-status='done'] { background: ${t.successSubtle}; color: ${t.successText}; }\n .tag[data-status='in-progress'] { background: ${t.brandSubtle}; color: ${t.link}; }\n .tag[data-status='cannot-start'] { background: transparent; color: ${t.textMuted}; }\n `,\n ];\n\n render(): TemplateResult {\n const done = this.items.filter((i) => i.status === 'done').length;\n return html`\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.items.length ? html`<p class=\"count\">${say(this.items.length === 1 ? 'You have completed {done} of {total} part.' : 'You have completed {done} of {total} parts.', { done, total: this.items.length })}</p>` : nothing}\n <ul>${this.items.map(\n (i) => html`<li>\n <span>${i.href && i.status !== 'cannot-start' ? html`<a href=${i.href} aria-describedby=${this.id_(`s-${i.id}`)}>${i.title}</a>` : html`<span class=\"title\">${i.title}</span>`}\n ${i.hint ? html`<span class=\"hint\">${i.hint}</span>` : nothing}</span>\n <span class=\"tag\" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${TASK_WORDS[i.status] ? say(TASK_WORDS[i.status]) : i.status}</span>\n </li>`,\n )}</ul>`;\n }\n}\n\n// Working values, not settings: kept out of `properties` so the page designer does not offer them.\nImpaktAddressLookup.createProperty('manual', { state: true });\nImpaktAddressLookup.createProperty('postcode', { state: true });\nImpaktAddressLookup.createProperty('searched', { state: true });\nImpaktAddressLookup.createProperty('busy', { state: true });\nImpaktFileUpload.createProperty('files', { state: true });\nImpaktFileUpload.createProperty('over', { state: true });\nImpaktFileUpload.createProperty('said', { state: true });\nImpaktMoneyInput.createProperty('shown', { state: true });\n\ncustomElements.define('impakt-address-lookup', ImpaktAddressLookup);\ncustomElements.define('impakt-error-summary', ImpaktErrorSummary);\ncustomElements.define('impakt-file-upload', ImpaktFileUpload);\ncustomElements.define('impakt-money-input', ImpaktMoneyInput);\ncustomElements.define('impakt-range-input', ImpaktRangeInput);\ncustomElements.define('impakt-task-list', ImpaktTaskList);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-address-lookup': ImpaktAddressLookup;\n 'impakt-error-summary': ImpaktErrorSummary;\n 'impakt-file-upload': ImpaktFileUpload;\n 'impakt-money-input': ImpaktMoneyInput;\n 'impakt-range-input': ImpaktRangeInput;\n 'impakt-task-list': ImpaktTaskList;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAkCxD,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,eAKL,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,qBAGhB,SAAS,IAAI,CAAC;AAAA,aACtB,EAAE,IAAI;AAAA,kBACD,EAAE,WAAW;AAAA,cACjB,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,qBACvB,EAAE,QAAQ;AAAA;AAAA,8DAE+B,EAAE,KAAK,iBAAiB,EAAE,WAAW,eAAe,EAAE,SAAS;AAAA,oEACzD,EAAE,MAAM,mBAAmB,EAAE,WAAW;AAAA;AAAA;AAAA,eAG7F,MAAM,GAAG,CAAC,IAAI,M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E,OAAO,KAAK,CAAC;AAC5D,oBAAoB,eAAe,YAAY,EAAE,OAAO,KAAK,CAAC;AAC9D,oBAAoB,eAAe,YAAY,EAAE,OAAO,KAAK,CAAC;AAC9D,oBAAoB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AAC1D,iBAAiB,eAAe,SAAS,EAAE,OAAO,KAAK,CAAC;AACxD,iBAAiB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AACvD,iBAAiB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AACvD,iBAAiB,eAAe,SAAS,EAAE,OAAO,KAAK,CAAC;AAExD,eAAe,OAAO,yBAAyB,mBAAmB;AAClE,eAAe,OAAO,wBAAwB,kBAAkB;AAChE,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImpaktElement,
|
|
3
|
-
focusRing
|
|
3
|
+
focusRing
|
|
4
|
+
} from "./chunk-72WNCCDC.js";
|
|
5
|
+
import {
|
|
4
6
|
fontWeight,
|
|
5
7
|
t
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JTCTQBAX.js";
|
|
7
9
|
|
|
8
10
|
// packages/ui/src/components/help.ts
|
|
9
11
|
import { html, css, nothing } from "lit";
|
|
@@ -85,4 +87,4 @@ customElements.define("impakt-help", ImpaktHelp);
|
|
|
85
87
|
export {
|
|
86
88
|
ImpaktHelp
|
|
87
89
|
};
|
|
88
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-3BWCD5U5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/help.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing } from '../base/styles';\nimport { fontWeight, t } from '../base/tokens';\n\n/**\n * What form a help mechanism takes.\n *\n * `link` goes somewhere: a help page, a contact form, a chat. The other four\n * are the \"human contact details\" that 3.2.6 Consistent Help names, shown as\n * text so a reader can see them without following anything.\n */\nexport type HelpKind = 'link' | 'phone' | 'email' | 'address' | 'hours';\n\n/**\n * A help link, or contact details shown as text.\n *\n * **Its identity is `mechanismId`, not its wording or destination.** 3.2.6\n * Consistent Help asks that help offered on several pages appears in the same\n * relative order on each. Strata checks that at publish by comparing these ids\n * across pages, so the label can be reworded and the number can change\n * without the check treating it as a different mechanism. It is literal and\n * cannot be bound, because an id that a data response could change is one the\n * check cannot compare.\n *\n * **Contact details are text, not a link to a page that has them.** The\n * criterion lists a phone number, an email address and a postal address as\n * help in their own right, and a reader who has to follow a link to find the\n * number has been given a link rather than the number. A phone number renders\n * as a `tel:` link and an email address as a `mailto:` link, each with the\n * detail itself as the visible text. The link target is derived from the\n * visible detail rather than authored separately, so the number a reader sees\n * and the number their phone dials cannot drift apart. An address or opening\n * hours render as plain text and keep the line breaks they were written with.\n *\n * **Contact links are named by their caption and their detail.** A phone\n * link's accessible name is \"Call us 0800 123 456\" rather than the bare\n * number, because a reader moving through a list of links hears each one out\n * of context (2.4.4 Link Purpose). The visible text stays inside the name, so\n * 2.5.3 Label in Name holds for a reader who speaks it.\n *\n * **Nothing unnamed or empty is ever rendered.** Runtime bindings may be\n * absent while data loads, or resolve to blank text. A link with no label, or\n * contact details with no detail, render nothing rather than a focusable link\n * with no name or a caption with nothing under it. Contact details whose\n * caption is blank still show the detail, because a phone number or an\n * address names itself. For that reason the caption is optional for contact\n * details, and publishing requires a label only on a link. Publishing does\n * require what each kind cannot do without: a link's label and address, and\n * contact details' detail, so the empty states are only reached at runtime.\n *\n * **Every link meets the minimum target size.** Links here are at least the\n * locked `target.min` token in both directions (2.5.8 Target Size), because a\n * help link usually stands on its own line, where the criterion's inline\n * exemption does not apply.\n *\n * @category action\n * @icon help\n * @role help\n */\nexport class ImpaktHelp extends ImpaktElement {\n static properties = {\n mechanismId: { type: String, attribute: 'mechanism-id' },\n kind: { type: String, reflect: true },\n href: { type: String },\n label: { type: String },\n detail: { type: String },\n };\n\n /** Stable identity across pages, independent of wording and destination. */\n declare mechanismId: string;\n // Written out as a union rather than as `HelpKind` so the manifest offers it\n // as a fixed choice: which form help takes is a design decision, not data.\n /** Whether this is a link to help, or contact details shown as text. */\n declare kind: 'link' | 'phone' | 'email' | 'address' | 'hours';\n /** Where a link goes. Phone and email links are built from the detail instead. */\n declare href: string;\n /**\n * The visible name. For a link it is the link text. For contact details it\n * is the caption shown above them, such as \"Call us\".\n */\n declare label: string;\n /**\n * The contact detail itself: a phone number, an email address, a postal\n * address or opening hours. Line breaks are kept. Unused by a link.\n */\n declare detail: string;\n\n constructor() {\n super();\n this.kind = 'link';\n this.href = '';\n // Defaulted, so the manifest does not mark it required: contact details\n // may leave the caption out. A link without one is refused at publish.\n this.label = '';\n this.detail = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; }\n a { display: inline-flex; align-items: center; min-height: ${t.targetMin}; min-width: ${t.targetMin};\n color: ${t.link}; text-decoration: underline; overflow-wrap: anywhere; max-width: 100%; }\n a:hover { color: ${t.linkHover}; }\n .contact { margin: 0; }\n .caption { display: block; font-weight: ${fontWeight('semibold')}; }\n /* An address is written one line at a time, and opening hours are often one\n day to a line. Long unbroken values still wrap at 320px (1.4.10). */\n .detail { white-space: pre-line; overflow-wrap: anywhere; }\n `,\n ];\n\n render(): TemplateResult | typeof nothing {\n switch (this.kind) {\n case 'phone':\n case 'email':\n case 'address':\n case 'hours':\n return this.renderContact();\n default:\n // An absent or unrecognised kind keeps the original link behaviour, so\n // a page published before contact details existed renders unchanged.\n return this.renderLink();\n }\n }\n\n private renderLink(): TemplateResult | typeof nothing {\n // Runtime bindings may be absent while data loads, or resolve to blank text.\n // Do not expose an unnamed focusable link in those states.\n if (!text(this.label)) return nothing;\n return html`<a part=\"link\" href=${this.href}>${this.label}</a>`;\n }\n\n private renderContact(): TemplateResult | typeof nothing {\n const detail = text(this.detail);\n // A caption with nothing under it is not help, so neither is drawn.\n if (!detail) return nothing;\n const caption = text(this.label);\n const target = contactHref(this.kind, detail);\n const captionId = this.id_('caption');\n const detailId = this.id_('detail');\n const captionPart = caption ? html`<span class=\"caption\" part=\"label\" id=${captionId}>${caption}</span>` : nothing;\n const detailPart = target\n ? html`<a part=\"link\" href=${target} aria-labelledby=${caption ? `${captionId} ${detailId}` : nothing}\n ><span class=\"detail\" part=\"detail\" id=${detailId}>${detail}</span></a>`\n : html`<span class=\"detail\" part=\"detail\">${detail}</span>`;\n return html`<p class=\"contact\" part=\"contact\">${captionPart}${detailPart}</p>`;\n }\n}\n\n/** Trimmed text, or empty for anything that is not a string. */\nfunction text(value: unknown): string {\n return typeof value === 'string' ? value.trim() : '';\n}\n\n/**\n * The link a contact detail opens, or empty when it should stay as text.\n *\n * A phone number is reduced to its digits and one leading `+`, and the \"(0)\"\n * that UK numbers print after the country code is dropped, because the\n * separators a reader expects are not dialled. A value with no digits, or an\n * email address without an `@`, stays as plain text. The reader still sees\n * it, and nothing offers to dial or mail something that cannot work.\n */\nfunction contactHref(kind: string, detail: string): string {\n if (kind === 'phone') {\n const digits = detail\n .replace(/\\(0\\)/g, '')\n .replace(/[^\\d+]/g, '')\n .replace(/(?!^)\\+/g, '');\n return /\\d/.test(digits) ? `tel:${digits}` : '';\n }\n if (kind === 'email') return /^[^\\s@]+@[^\\s@]+$/.test(detail) ? `mailto:${detail}` : '';\n return '';\n}\n\ncustomElements.define('impakt-help', ImpaktHelp);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-help': ImpaktHelp;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/help.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing } from '../base/styles';\nimport { fontWeight, t } from '../base/tokens';\n\n/**\n * What form a help mechanism takes.\n *\n * `link` goes somewhere: a help page, a contact form, a chat. The other four\n * are the \"human contact details\" that 3.2.6 Consistent Help names, shown as\n * text so a reader can see them without following anything.\n */\nexport type HelpKind = 'link' | 'phone' | 'email' | 'address' | 'hours';\n\n/**\n * A help link, or contact details shown as text.\n *\n * **Its identity is `mechanismId`, not its wording or destination.** 3.2.6\n * Consistent Help asks that help offered on several pages appears in the same\n * relative order on each. Strata checks that at publish by comparing these ids\n * across pages, so the label can be reworded and the number can change\n * without the check treating it as a different mechanism. It is literal and\n * cannot be bound, because an id that a data response could change is one the\n * check cannot compare.\n *\n * **Contact details are text, not a link to a page that has them.** The\n * criterion lists a phone number, an email address and a postal address as\n * help in their own right, and a reader who has to follow a link to find the\n * number has been given a link rather than the number. A phone number renders\n * as a `tel:` link and an email address as a `mailto:` link, each with the\n * detail itself as the visible text. The link target is derived from the\n * visible detail rather than authored separately, so the number a reader sees\n * and the number their phone dials cannot drift apart. An address or opening\n * hours render as plain text and keep the line breaks they were written with.\n *\n * **Contact links are named by their caption and their detail.** A phone\n * link's accessible name is \"Call us 0800 123 456\" rather than the bare\n * number, because a reader moving through a list of links hears each one out\n * of context (2.4.4 Link Purpose). The visible text stays inside the name, so\n * 2.5.3 Label in Name holds for a reader who speaks it.\n *\n * **Nothing unnamed or empty is ever rendered.** Runtime bindings may be\n * absent while data loads, or resolve to blank text. A link with no label, or\n * contact details with no detail, render nothing rather than a focusable link\n * with no name or a caption with nothing under it. Contact details whose\n * caption is blank still show the detail, because a phone number or an\n * address names itself. For that reason the caption is optional for contact\n * details, and publishing requires a label only on a link. Publishing does\n * require what each kind cannot do without: a link's label and address, and\n * contact details' detail, so the empty states are only reached at runtime.\n *\n * **Every link meets the minimum target size.** Links here are at least the\n * locked `target.min` token in both directions (2.5.8 Target Size), because a\n * help link usually stands on its own line, where the criterion's inline\n * exemption does not apply.\n *\n * @category action\n * @icon help\n * @role help\n */\nexport class ImpaktHelp extends ImpaktElement {\n static properties = {\n mechanismId: { type: String, attribute: 'mechanism-id' },\n kind: { type: String, reflect: true },\n href: { type: String },\n label: { type: String },\n detail: { type: String },\n };\n\n /** Stable identity across pages, independent of wording and destination. */\n declare mechanismId: string;\n // Written out as a union rather than as `HelpKind` so the manifest offers it\n // as a fixed choice: which form help takes is a design decision, not data.\n /** Whether this is a link to help, or contact details shown as text. */\n declare kind: 'link' | 'phone' | 'email' | 'address' | 'hours';\n /** Where a link goes. Phone and email links are built from the detail instead. */\n declare href: string;\n /**\n * The visible name. For a link it is the link text. For contact details it\n * is the caption shown above them, such as \"Call us\".\n */\n declare label: string;\n /**\n * The contact detail itself: a phone number, an email address, a postal\n * address or opening hours. Line breaks are kept. Unused by a link.\n */\n declare detail: string;\n\n constructor() {\n super();\n this.kind = 'link';\n this.href = '';\n // Defaulted, so the manifest does not mark it required: contact details\n // may leave the caption out. A link without one is refused at publish.\n this.label = '';\n this.detail = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; }\n a { display: inline-flex; align-items: center; min-height: ${t.targetMin}; min-width: ${t.targetMin};\n color: ${t.link}; text-decoration: underline; overflow-wrap: anywhere; max-width: 100%; }\n a:hover { color: ${t.linkHover}; }\n .contact { margin: 0; }\n .caption { display: block; font-weight: ${fontWeight('semibold')}; }\n /* An address is written one line at a time, and opening hours are often one\n day to a line. Long unbroken values still wrap at 320px (1.4.10). */\n .detail { white-space: pre-line; overflow-wrap: anywhere; }\n `,\n ];\n\n render(): TemplateResult | typeof nothing {\n switch (this.kind) {\n case 'phone':\n case 'email':\n case 'address':\n case 'hours':\n return this.renderContact();\n default:\n // An absent or unrecognised kind keeps the original link behaviour, so\n // a page published before contact details existed renders unchanged.\n return this.renderLink();\n }\n }\n\n private renderLink(): TemplateResult | typeof nothing {\n // Runtime bindings may be absent while data loads, or resolve to blank text.\n // Do not expose an unnamed focusable link in those states.\n if (!text(this.label)) return nothing;\n return html`<a part=\"link\" href=${this.href}>${this.label}</a>`;\n }\n\n private renderContact(): TemplateResult | typeof nothing {\n const detail = text(this.detail);\n // A caption with nothing under it is not help, so neither is drawn.\n if (!detail) return nothing;\n const caption = text(this.label);\n const target = contactHref(this.kind, detail);\n const captionId = this.id_('caption');\n const detailId = this.id_('detail');\n const captionPart = caption ? html`<span class=\"caption\" part=\"label\" id=${captionId}>${caption}</span>` : nothing;\n const detailPart = target\n ? html`<a part=\"link\" href=${target} aria-labelledby=${caption ? `${captionId} ${detailId}` : nothing}\n ><span class=\"detail\" part=\"detail\" id=${detailId}>${detail}</span></a>`\n : html`<span class=\"detail\" part=\"detail\">${detail}</span>`;\n return html`<p class=\"contact\" part=\"contact\">${captionPart}${detailPart}</p>`;\n }\n}\n\n/** Trimmed text, or empty for anything that is not a string. */\nfunction text(value: unknown): string {\n return typeof value === 'string' ? value.trim() : '';\n}\n\n/**\n * The link a contact detail opens, or empty when it should stay as text.\n *\n * A phone number is reduced to its digits and one leading `+`, and the \"(0)\"\n * that UK numbers print after the country code is dropped, because the\n * separators a reader expects are not dialled. A value with no digits, or an\n * email address without an `@`, stays as plain text. The reader still sees\n * it, and nothing offers to dial or mail something that cannot work.\n */\nfunction contactHref(kind: string, detail: string): string {\n if (kind === 'phone') {\n const digits = detail\n .replace(/\\(0\\)/g, '')\n .replace(/[^\\d+]/g, '')\n .replace(/(?!^)\\+/g, '');\n return /\\d/.test(digits) ? `tel:${digits}` : '';\n }\n if (kind === 'email') return /^[^\\s@]+@[^\\s@]+$/.test(detail) ? `mailto:${detail}` : '';\n return '';\n}\n\ncustomElements.define('impakt-help', ImpaktHelp);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-help': ImpaktHelp;\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA4DjD,IAAM,aAAN,cAAyB,cAAc;AAAA,EAC5C;AAAA,SAAO,aAAa;AAAA,MAClB,aAAa,EAAE,MAAM,QAAQ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