@atomic-ui/ui 0.10.0 → 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,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement,
|
|
3
|
+
fieldControl,
|
|
3
4
|
fieldWidths
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HSXLSJVG.js";
|
|
6
|
+
import {
|
|
7
|
+
visuallyHidden
|
|
8
|
+
} from "./chunk-72WNCCDC.js";
|
|
5
9
|
import {
|
|
6
10
|
fontSize,
|
|
7
11
|
space,
|
|
8
|
-
t
|
|
9
|
-
|
|
10
|
-
} from "./chunk-V7EB7Q2M.js";
|
|
12
|
+
t
|
|
13
|
+
} from "./chunk-JTCTQBAX.js";
|
|
11
14
|
|
|
12
15
|
// packages/ui/src/components/select.ts
|
|
13
16
|
import { html, css, nothing } from "lit";
|
|
@@ -32,45 +35,23 @@ var ImpaktSelect = class extends FieldElement {
|
|
|
32
35
|
this.styles = [
|
|
33
36
|
...FieldElement.styles,
|
|
34
37
|
fieldWidths,
|
|
38
|
+
fieldControl("select"),
|
|
35
39
|
css`
|
|
36
40
|
:host([hide-label]) .label {
|
|
37
41
|
${visuallyHidden}
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color: ${t.text};
|
|
46
|
-
background: var(--impakt-color-field-surface, ${t.surfaceCard});
|
|
47
|
-
border: ${t.borderThin} solid ${t.border};
|
|
48
|
-
border-radius: ${t.radiusLg};
|
|
49
|
-
box-shadow: var(--impakt-shadow-field, ${t.shadowXs});
|
|
50
|
-
transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;
|
|
51
|
-
}
|
|
52
|
-
select:hover:not(:disabled) {
|
|
53
|
-
border-color: ${t.borderStrong};
|
|
54
|
-
}
|
|
55
|
-
/* A brand halo as well as the focus ring, so the field being typed in is plain at a glance. */
|
|
56
|
-
select:focus-visible {
|
|
57
|
-
border-color: ${t.brand};
|
|
58
|
-
box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};
|
|
59
|
-
}
|
|
60
|
-
select:disabled {
|
|
61
|
-
background: ${t.surfaceInset};
|
|
62
|
-
cursor: not-allowed;
|
|
63
|
-
}
|
|
64
|
-
:host([invalid]) select {
|
|
65
|
-
border-color: ${t.danger};
|
|
66
|
-
border-width: ${t.borderThick};
|
|
67
|
-
}
|
|
43
|
+
/* The browser's own arrow is replaced by a small "▾", drawn beside the box's end and hidden from screen readers. */
|
|
44
|
+
.box { position: relative; display: block; inline-size: min(100%, var(--impakt-field-width)); }
|
|
45
|
+
select { inline-size: 100%; appearance: none; -webkit-appearance: none; padding-inline-end: ${space(9)}; cursor: pointer; }
|
|
46
|
+
.caret { position: absolute; inset-inline-end: ${space(3.5)}; inset-block-start: 50%; transform: translateY(-50%); font-size: ${fontSize("sm")}; line-height: 1; color: ${t.text}; pointer-events: none; }
|
|
47
|
+
/* A forced colours mode draws the box in the system colours; the caret takes the text colour. */
|
|
48
|
+
@media (forced-colors: active) { .caret { color: CanvasText; } }
|
|
68
49
|
`
|
|
69
50
|
];
|
|
70
51
|
}
|
|
71
52
|
renderControl() {
|
|
72
53
|
return html`
|
|
73
|
-
<select
|
|
54
|
+
<span class="box" part="box"><select
|
|
74
55
|
id=${this.controlId}
|
|
75
56
|
part="select"
|
|
76
57
|
name=${this.name || nothing}
|
|
@@ -82,7 +63,7 @@ var ImpaktSelect = class extends FieldElement {
|
|
|
82
63
|
>
|
|
83
64
|
<option value="" ?selected=${!this.value}>${this.placeholder}</option>
|
|
84
65
|
${this.options.map((o) => html`<option value=${o.value} ?selected=${this.value === o.value}>${o.label}</option>`)}
|
|
85
|
-
</select>
|
|
66
|
+
</select><span class="caret" aria-hidden="true">▾</span></span>
|
|
86
67
|
`;
|
|
87
68
|
}
|
|
88
69
|
updated(changed) {
|
|
@@ -94,4 +75,4 @@ customElements.define("impakt-select", ImpaktSelect);
|
|
|
94
75
|
export {
|
|
95
76
|
ImpaktSelect
|
|
96
77
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
78
|
+
//# sourceMappingURL=chunk-F3NHPQU5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/select.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldControl, fieldWidths } from '../base/FieldElement';\nimport { visuallyHidden } from '../base/styles';\nimport { fontSize, space, t } from '../base/tokens';\n\nexport interface SelectOption {\n value: string;\n label: string;\n}\n\n/**\n * A dropdown.\n *\n * A native `<select>`, because the alternative is a listbox widget that has to\n * reimplement type-ahead, keyboard selection, and the platform's own picker on\n * touch — and whose main advantage is that the arrow can be restyled. On a\n * phone, native wins outright: it opens the system control that the user\n * already knows how to drive.\n *\n * The empty first option carries a real label rather than being blank, so a\n * screen reader announces a choice to make rather than silence.\n\n *\n * @category form\n * @icon select\n */\nexport class ImpaktSelect extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n options: { type: Array },\n placeholder: { type: String },\n hideLabel: { type: Boolean, attribute: 'hide-label', reflect: true },\n };\n\n declare options: SelectOption[];\n /**\n * Keep the label for screen readers only, for a picker whose purpose is\n * plain from where it sits, such as a filter above a table or a role in a\n * team row. The label stays its accessible name.\n */\n declare hideLabel: boolean;\n declare placeholder: string;\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.options = [];\n this.placeholder = 'Choose an option';\n this.hideLabel = false;\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n fieldControl('select'),\n css`\n :host([hide-label]) .label {\n ${visuallyHidden}\n }\n /* The browser's own arrow is replaced by a small \"▾\", drawn beside the box's end and hidden from screen readers. */\n .box { position: relative; display: block; inline-size: min(100%, var(--impakt-field-width)); }\n select { inline-size: 100%; appearance: none; -webkit-appearance: none; padding-inline-end: ${space(9)}; cursor: pointer; }\n .caret { position: absolute; inset-inline-end: ${space(3.5)}; inset-block-start: 50%; transform: translateY(-50%); font-size: ${fontSize('sm')}; line-height: 1; color: ${t.text}; pointer-events: none; }\n /* A forced colours mode draws the box in the system colours; the caret takes the text colour. */\n @media (forced-colors: active) { .caret { color: CanvasText; } }\n `,\n ];\n\n protected renderControl(): TemplateResult {\n return html`\n <span class=\"box\" part=\"box\"><select\n id=${this.controlId}\n part=\"select\"\n name=${this.name || nothing}\n ?disabled=${this.disabled}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n @change=${(e: Event) => this.setFormValue((e.target as HTMLSelectElement).value)}\n >\n <option value=\"\" ?selected=${!this.value}>${this.placeholder}</option>\n ${this.options.map((o) => html`<option value=${o.value} ?selected=${this.value === o.value}>${o.label}</option>`)}\n </select><span class=\"caret\" aria-hidden=\"true\">▾</span></span>\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-select', ImpaktSelect);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-select': ImpaktSelect;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA0BjD,IAAM,eAAN,cAA2B,aAAa;AAAA,EAC7C;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE,MAAM,MAAM;AAAA,MACvB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,WAAW,EAAE,MAAM,SAAS,WAAW,cAAc,SAAS,KAAK;AAAA,IACrE;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,UAAU,CAAC;AAChB,SAAK,cAAc;AACnB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA,aAAa,QAAQ;AAAA,MACrB;AAAA;AAAA,UAEM,cAAc;AAAA;AAAA;AAAA;AAAA,oGAI4E,MAAM,CAAC,CAAC;AAAA,uDACrD,MAAM,GAAG,CAAC,qEAAqE,SAAS,IAAI,CAAC,4BAA4B,EAAE,IAAI;AAAA;AAAA;AAAA;AAAA,IAIpL;AAAA;AAAA,EAEU,gBAAgC;AACxC,WAAO;AAAA;AAAA,aAEE,KAAK,SAAS;AAAA;AAAA,eAEZ,KAAK,QAAQ,OAAO;AAAA,oBACf,KAAK,QAAQ;AAAA,oBACb,KAAK,QAAQ;AAAA,2BACN,KAAK,WAAW;AAAA,uBACpB,KAAK,QAAQ,SAAS,OAAO;AAAA,kBAClC,CAAC,MAAa,KAAK,aAAc,EAAE,OAA6B,KAAK,CAAC;AAAA;AAAA,qCAEnD,CAAC,KAAK,KAAK,IAAI,KAAK,WAAW;AAAA,UAC1D,KAAK,QAAQ,IAAI,CAAC,MAAM,qBAAqB,EAAE,KAAK,cAAc,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,KAAK,WAAW,CAAC;AAAA;AAAA;AAAA,EAGvH;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;","names":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ImpaktElement
|
|
2
|
+
ImpaktElement
|
|
3
|
+
} from "./chunk-72WNCCDC.js";
|
|
4
|
+
import {
|
|
3
5
|
fontSize,
|
|
4
6
|
fontWeight,
|
|
5
7
|
lineHeight,
|
|
6
8
|
space,
|
|
7
9
|
t
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JTCTQBAX.js";
|
|
9
11
|
|
|
10
12
|
// packages/ui/src/components/fieldset.ts
|
|
11
13
|
import { css, html, nothing } from "lit";
|
|
@@ -56,4 +58,4 @@ customElements.define("impakt-fieldset", ImpaktFieldset);
|
|
|
56
58
|
export {
|
|
57
59
|
ImpaktFieldset
|
|
58
60
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-F4IXELLK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/fieldset.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { fontSize, fontWeight, lineHeight, space, t } from '../base/tokens';\n\n/**\n * Fields that belong together under one question: the lines of an address,\n * or a name in two parts.\n *\n * **The question is the group's name.** It is a `fieldset` with a `legend`, so\n * a screen reader says \"Your address, group\" on the way in, and each field\n * inside is heard as part of it (1.3.1, 3.3.2). An error for the group as a\n * whole, such as \"Enter a full address\", is tied to it the same way.\n *\n * @category form\n * @icon fieldset\n * @slot - The fields in the group.\n */\nexport class ImpaktFieldset extends ImpaktElement {\n static properties = {\n legend: { type: String },\n description: { type: String },\n error: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** The question the fields answer together. */\n declare legend: string;\n /** A hint for the whole group, under the question. */\n declare description: string;\n /** What is wrong with the group as a whole. */\n declare error: string;\n /** How large the question is. A page that asks only this question makes it the page's heading size. */\n declare size: 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.legend = '';\n this.description = '';\n this.error = '';\n this.size = 'md';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; margin-block-end: ${space(6)}; }\n fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize('md')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; color: ${t.text}; }\n :host([size='lg']) legend { font-size: ${fontSize('xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n :host([size='xl']) legend { font-size: ${fontSize('2xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n .description { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; line-height: ${lineHeight('normal')}; }\n .error { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; }\n .error:empty { display: none; }\n :host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }\n `,\n ];\n\n render(): TemplateResult {\n const described = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean).join(' ');\n return html`<fieldset part=\"fieldset\" aria-describedby=${described || nothing}>\n <legend part=\"legend\">${this.legend}</legend>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n <div class=\"fields\" part=\"fields\"><slot></slot></div>\n </fieldset>`;\n }\n}\n\ncustomElements.define('impakt-fieldset', ImpaktFieldset);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-fieldset': ImpaktFieldset;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/fieldset.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { fontSize, fontWeight, lineHeight, space, t } from '../base/tokens';\n\n/**\n * Fields that belong together under one question: the lines of an address,\n * or a name in two parts.\n *\n * **The question is the group's name.** It is a `fieldset` with a `legend`, so\n * a screen reader says \"Your address, group\" on the way in, and each field\n * inside is heard as part of it (1.3.1, 3.3.2). An error for the group as a\n * whole, such as \"Enter a full address\", is tied to it the same way.\n *\n * @category form\n * @icon fieldset\n * @slot - The fields in the group.\n */\nexport class ImpaktFieldset extends ImpaktElement {\n static properties = {\n legend: { type: String },\n description: { type: String },\n error: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** The question the fields answer together. */\n declare legend: string;\n /** A hint for the whole group, under the question. */\n declare description: string;\n /** What is wrong with the group as a whole. */\n declare error: string;\n /** How large the question is. A page that asks only this question makes it the page's heading size. */\n declare size: 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.legend = '';\n this.description = '';\n this.error = '';\n this.size = 'md';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; margin-block-end: ${space(6)}; }\n fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize('md')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; color: ${t.text}; }\n :host([size='lg']) legend { font-size: ${fontSize('xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n :host([size='xl']) legend { font-size: ${fontSize('2xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n .description { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; line-height: ${lineHeight('normal')}; }\n .error { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; }\n .error:empty { display: none; }\n :host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }\n `,\n ];\n\n render(): TemplateResult {\n const described = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean).join(' ');\n return html`<fieldset part=\"fieldset\" aria-describedby=${described || nothing}>\n <legend part=\"legend\">${this.legend}</legend>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n <div class=\"fields\" part=\"fields\"><slot></slot></div>\n </fieldset>`;\n }\n}\n\ncustomElements.define('impakt-fieldset', ImpaktFieldset);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-fieldset': ImpaktFieldset;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAiBjD,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,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eAAe,OAAO,mBAAmB,cAAc;","names":[]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
ImpaktElement
|
|
2
|
+
ImpaktElement
|
|
3
|
+
} from "./chunk-72WNCCDC.js";
|
|
4
|
+
import {
|
|
3
5
|
spaceAround,
|
|
4
6
|
token
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JTCTQBAX.js";
|
|
6
8
|
|
|
7
9
|
// packages/ui/src/components/grid.ts
|
|
8
10
|
import { css, html } from "lit";
|
|
@@ -75,4 +77,4 @@ customElements.define("impakt-grid", ImpaktGrid);
|
|
|
75
77
|
export {
|
|
76
78
|
ImpaktGrid
|
|
77
79
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-FJHPGOGS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/grid.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { spaceAround, token } from '../base/tokens';\n\n/** Column widths as fractions, for each choice of `widths`. */\nconst WIDTHS: Record<string, string> = {\n '2:1': '2fr 1fr',\n '1:2': '1fr 2fr',\n '3:1': '3fr 1fr',\n '1:3': '1fr 3fr',\n '1:2:1': '1fr 2fr 1fr',\n '2:1:1': '2fr 1fr 1fr',\n '1:1:2': '1fr 1fr 2fr',\n};\n\n/**\n * A responsive row with named column slots. Child order stays inside each\n * column; changing a page's visual grid never reorders its reading sequence.\n *\n * Gutters come from the brand's layout, so every grid for a partner keeps the\n * same rhythm. Where the columns stack is a choice, because a three-column\n * row of cards may work on a tablet where two columns of long text do not.\n *\n * @category layout\n * @icon columns\n * @slot column-1 - First column.\n * @slot column-2 - Second column.\n * @slot column-3 - Third column.\n * @slot column-4 - Fourth column.\n */\nexport class ImpaktGrid extends ImpaktElement {\n static properties = {\n columns: { type: String, reflect: true },\n widths: { type: String, reflect: true },\n gap: { type: String, reflect: true },\n stackOn: { type: String, reflect: true, attribute: 'stack-on' },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare columns: 'one' | 'two' | 'three' | 'four' | 'sidebar-left' | 'sidebar-right';\n /** How wide each column is against the others. Applies when it has as many parts as there are columns. */\n declare widths: 'equal' | '2:1' | '1:2' | '3:1' | '1:3' | '1:2:1' | '2:1:1' | '1:1:2';\n /** The space between columns, from the brand's gutters. */\n declare gap: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n /** The screens on which the columns stack, one above another, in column order. */\n declare stackOn: 'phone' | 'tablet' | 'never';\n /** How columns of different heights line up. */\n declare align: 'stretch' | 'start' | 'center' | 'end';\n /** Space before the grid, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Space after the grid, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n constructor() {\n super();\n this.columns = 'two';\n this.widths = 'equal';\n this.gap = 'md';\n this.stackOn = 'phone';\n this.align = 'stretch';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host { display: block; min-inline-size: 0; container-type: inline-size; }\n .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${token('layout.gutter.md', '16px')}; align-items: stretch; }\n :host([gap='none']) .columns { gap: 0; }\n :host([gap='sm']) .columns { gap: ${token('layout.gutter.sm', '8px')}; }\n :host([gap='lg']) .columns { gap: ${token('layout.gutter.lg', '32px')}; }\n :host([gap='xl']) .columns { gap: ${token('layout.gutter.xl', '48px')}; }\n :host([align='start']) .columns { align-items: start; }\n :host([align='center']) .columns { align-items: center; }\n :host([align='end']) .columns { align-items: end; }\n :host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }\n :host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n :host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }\n :host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }\n .column { min-inline-size: 0; overflow-wrap: anywhere; }\n ::slotted(*) { max-inline-size: 100%; }\n @container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n @container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n `,\n ];\n render() {\n const count = this.columns === 'one' ? 1 : this.columns === 'three' ? 3 : this.columns === 'four' ? 4 : 2;\n const fractions = WIDTHS[this.widths]?.split(' ');\n // A width split for a different number of columns would leave a column out, so it is ignored.\n const template = fractions && fractions.length === count ? fractions.map((f) => `minmax(0, ${f})`).join(' ') : '';\n return html`<div class=\"columns\" part=\"row\" style=${template ? `grid-template-columns: ${template}` : ''}>${Array.from({ length: count }, (_, i) => html`<div class=\"column\" part=\"column\"><slot name=${`column-${i + 1}`}></slot></div>`)}</div>`;\n }\n}\ncustomElements.define('impakt-grid', ImpaktGrid);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-grid': ImpaktGrid;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/grid.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { spaceAround, token } from '../base/tokens';\n\n/** Column widths as fractions, for each choice of `widths`. */\nconst WIDTHS: Record<string, string> = {\n '2:1': '2fr 1fr',\n '1:2': '1fr 2fr',\n '3:1': '3fr 1fr',\n '1:3': '1fr 3fr',\n '1:2:1': '1fr 2fr 1fr',\n '2:1:1': '2fr 1fr 1fr',\n '1:1:2': '1fr 1fr 2fr',\n};\n\n/**\n * A responsive row with named column slots. Child order stays inside each\n * column; changing a page's visual grid never reorders its reading sequence.\n *\n * Gutters come from the brand's layout, so every grid for a partner keeps the\n * same rhythm. Where the columns stack is a choice, because a three-column\n * row of cards may work on a tablet where two columns of long text do not.\n *\n * @category layout\n * @icon columns\n * @slot column-1 - First column.\n * @slot column-2 - Second column.\n * @slot column-3 - Third column.\n * @slot column-4 - Fourth column.\n */\nexport class ImpaktGrid extends ImpaktElement {\n static properties = {\n columns: { type: String, reflect: true },\n widths: { type: String, reflect: true },\n gap: { type: String, reflect: true },\n stackOn: { type: String, reflect: true, attribute: 'stack-on' },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare columns: 'one' | 'two' | 'three' | 'four' | 'sidebar-left' | 'sidebar-right';\n /** How wide each column is against the others. Applies when it has as many parts as there are columns. */\n declare widths: 'equal' | '2:1' | '1:2' | '3:1' | '1:3' | '1:2:1' | '2:1:1' | '1:1:2';\n /** The space between columns, from the brand's gutters. */\n declare gap: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n /** The screens on which the columns stack, one above another, in column order. */\n declare stackOn: 'phone' | 'tablet' | 'never';\n /** How columns of different heights line up. */\n declare align: 'stretch' | 'start' | 'center' | 'end';\n /** Space before the grid, from the spacing scale. */\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n /** Space after the grid, from the spacing scale. */\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n constructor() {\n super();\n this.columns = 'two';\n this.widths = 'equal';\n this.gap = 'md';\n this.stackOn = 'phone';\n this.align = 'stretch';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n :host { display: block; min-inline-size: 0; container-type: inline-size; }\n .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${token('layout.gutter.md', '16px')}; align-items: stretch; }\n :host([gap='none']) .columns { gap: 0; }\n :host([gap='sm']) .columns { gap: ${token('layout.gutter.sm', '8px')}; }\n :host([gap='lg']) .columns { gap: ${token('layout.gutter.lg', '32px')}; }\n :host([gap='xl']) .columns { gap: ${token('layout.gutter.xl', '48px')}; }\n :host([align='start']) .columns { align-items: start; }\n :host([align='center']) .columns { align-items: center; }\n :host([align='end']) .columns { align-items: end; }\n :host([columns='one']) .columns { grid-template-columns: minmax(0, 1fr); }\n :host([columns='three']) .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='four']) .columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n :host([columns='sidebar-left']) .columns { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }\n :host([columns='sidebar-right']) .columns { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }\n .column { min-inline-size: 0; overflow-wrap: anywhere; }\n ::slotted(*) { max-inline-size: 100%; }\n @container (max-width: 40rem) { :host(:not([stack-on='never'])) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n @container (max-width: 64rem) { :host([stack-on='tablet']) .columns { grid-template-columns: minmax(0, 1fr) !important; } }\n `,\n ];\n render() {\n const count = this.columns === 'one' ? 1 : this.columns === 'three' ? 3 : this.columns === 'four' ? 4 : 2;\n const fractions = WIDTHS[this.widths]?.split(' ');\n // A width split for a different number of columns would leave a column out, so it is ignored.\n const template = fractions && fractions.length === count ? fractions.map((f) => `minmax(0, ${f})`).join(' ') : '';\n return html`<div class=\"columns\" part=\"row\" style=${template ? `grid-template-columns: ${template}` : ''}>${Array.from({ length: count }, (_, i) => html`<div class=\"column\" part=\"column\"><slot name=${`column-${i + 1}`}></slot></div>`)}</div>`;\n }\n}\ncustomElements.define('impakt-grid', ImpaktGrid);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-grid': ImpaktGrid;\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAK1B,IAAM,SAAiC;AAAA,EACrC,OAAO;AAAA,EACP,OAAO;A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AAM,WAAW,aAAa,UAAU,WAAW,QAAQ,UAAU,IAAI,CAAC,MAAM,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI;AAC/G,WAAO,6CAA6C,WAAW,0BAA0B,QAAQ,KAAK,EAAE,IAAI,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM,oDAAoD,UAAU,IAAI,CAAC,EAAE,gBAAgB,CAAC;AAAA,EAC5O;AACF;AACA,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import {
|
|
2
|
+
statusPill,
|
|
3
|
+
statusPillStyles
|
|
4
|
+
} from "./chunk-6CDQSHVW.js";
|
|
5
|
+
import {
|
|
6
|
+
onServer
|
|
7
|
+
} from "./chunk-6WVL3HOC.js";
|
|
8
|
+
import {
|
|
9
|
+
ImpaktElement,
|
|
10
|
+
focusRing,
|
|
11
|
+
targetSize
|
|
12
|
+
} from "./chunk-72WNCCDC.js";
|
|
13
|
+
import {
|
|
14
|
+
fontSize,
|
|
15
|
+
fontWeight,
|
|
16
|
+
space,
|
|
17
|
+
t
|
|
18
|
+
} from "./chunk-JTCTQBAX.js";
|
|
19
|
+
|
|
20
|
+
// packages/ui/src/components/accordion.ts
|
|
21
|
+
import { html, css, nothing, unsafeCSS } from "lit";
|
|
22
|
+
var LINE_SOFT = unsafeCSS("var(--impakt-color-line-soft, #dcdcd8)");
|
|
23
|
+
var ImpaktAccordion = class extends ImpaktElement {
|
|
24
|
+
static {
|
|
25
|
+
this.properties = {
|
|
26
|
+
items: { type: Array },
|
|
27
|
+
headingLevel: { type: Number, attribute: "heading-level" },
|
|
28
|
+
open: { type: Array },
|
|
29
|
+
multiple: { type: Boolean },
|
|
30
|
+
look: { type: String, reflect: true },
|
|
31
|
+
enhanced: { state: true }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.items = [];
|
|
37
|
+
this.headingLevel = 3;
|
|
38
|
+
this.open = [];
|
|
39
|
+
this.multiple = true;
|
|
40
|
+
this.look = "plain";
|
|
41
|
+
this.enhanced = false;
|
|
42
|
+
}
|
|
43
|
+
connectedCallback() {
|
|
44
|
+
if (!onServer && !this.shadowRoot) this.enhanced = true;
|
|
45
|
+
super.connectedCallback();
|
|
46
|
+
}
|
|
47
|
+
firstUpdated() {
|
|
48
|
+
this.enhanced = true;
|
|
49
|
+
}
|
|
50
|
+
static {
|
|
51
|
+
this.styles = [
|
|
52
|
+
...ImpaktElement.styles,
|
|
53
|
+
focusRing,
|
|
54
|
+
statusPillStyles,
|
|
55
|
+
css`
|
|
56
|
+
:host {
|
|
57
|
+
display: block;
|
|
58
|
+
border-block-start: ${t.borderThin} solid ${t.text};
|
|
59
|
+
}
|
|
60
|
+
.item {
|
|
61
|
+
border-block-end: ${t.borderThin} solid ${t.text};
|
|
62
|
+
}
|
|
63
|
+
/* The heading row. The button is stretched over it, so the whole row opens the panel, the status included. */
|
|
64
|
+
.head {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: ${space(4)};
|
|
69
|
+
}
|
|
70
|
+
.h {
|
|
71
|
+
flex: 1;
|
|
72
|
+
min-inline-size: 0;
|
|
73
|
+
margin: 0;
|
|
74
|
+
}
|
|
75
|
+
button {
|
|
76
|
+
${targetSize}
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: baseline;
|
|
79
|
+
flex-wrap: wrap;
|
|
80
|
+
column-gap: ${space(4)};
|
|
81
|
+
row-gap: ${space(1)};
|
|
82
|
+
inline-size: 100%;
|
|
83
|
+
padding: ${space(8)} 0;
|
|
84
|
+
background: none;
|
|
85
|
+
border: 0;
|
|
86
|
+
font: inherit;
|
|
87
|
+
/* G2 heading S: 24/1.15, -2.5%, semibold. */
|
|
88
|
+
font-size: var(--impakt-type-heading-s-size, 1.5rem);
|
|
89
|
+
line-height: 1.15;
|
|
90
|
+
letter-spacing: -0.025em;
|
|
91
|
+
font-weight: ${fontWeight("semibold")};
|
|
92
|
+
color: ${t.text};
|
|
93
|
+
text-align: start;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
button::after {
|
|
97
|
+
content: '';
|
|
98
|
+
position: absolute;
|
|
99
|
+
inset: 0;
|
|
100
|
+
}
|
|
101
|
+
button:focus-visible {
|
|
102
|
+
box-shadow: none;
|
|
103
|
+
}
|
|
104
|
+
button:focus-visible::after {
|
|
105
|
+
box-shadow: ${t.focusShadow};
|
|
106
|
+
}
|
|
107
|
+
button:hover .q {
|
|
108
|
+
text-decoration: underline;
|
|
109
|
+
text-decoration-thickness: 1px;
|
|
110
|
+
text-underline-offset: 0.15em;
|
|
111
|
+
}
|
|
112
|
+
.meta {
|
|
113
|
+
font-family: ${t.fontMono};
|
|
114
|
+
font-size: ${fontSize("sm")};
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
letter-spacing: normal;
|
|
117
|
+
color: ${t.textMuted};
|
|
118
|
+
}
|
|
119
|
+
.status-pill {
|
|
120
|
+
flex: none;
|
|
121
|
+
}
|
|
122
|
+
.pills {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
justify-content: flex-end;
|
|
126
|
+
gap: ${space(2)};
|
|
127
|
+
max-inline-size: 50%;
|
|
128
|
+
}
|
|
129
|
+
/* A plus that turns to a minus: two bars, the upright one hidden when open. Drawn, not typed, so it is the same in every face. */
|
|
130
|
+
.marker {
|
|
131
|
+
position: relative;
|
|
132
|
+
flex: none;
|
|
133
|
+
inline-size: 18px;
|
|
134
|
+
block-size: 18px;
|
|
135
|
+
/* Centred on the question's first line, not sat on its baseline. */
|
|
136
|
+
align-self: flex-start;
|
|
137
|
+
margin-block-start: calc((1lh - 18px) / 2);
|
|
138
|
+
}
|
|
139
|
+
.marker::before,
|
|
140
|
+
.marker::after {
|
|
141
|
+
content: '';
|
|
142
|
+
position: absolute;
|
|
143
|
+
background: ${t.text};
|
|
144
|
+
}
|
|
145
|
+
.marker::before {
|
|
146
|
+
inset-inline: 0;
|
|
147
|
+
inset-block-start: calc(50% - 1px);
|
|
148
|
+
block-size: 2px;
|
|
149
|
+
}
|
|
150
|
+
.marker::after {
|
|
151
|
+
inset-block: 0;
|
|
152
|
+
inset-inline-start: calc(50% - 1px);
|
|
153
|
+
inline-size: 2px;
|
|
154
|
+
transition: transform 120ms ease-in-out;
|
|
155
|
+
}
|
|
156
|
+
.item.open .marker::after {
|
|
157
|
+
transform: scaleY(0);
|
|
158
|
+
}
|
|
159
|
+
@media (forced-colors: active) {
|
|
160
|
+
.marker::before,
|
|
161
|
+
.marker::after {
|
|
162
|
+
background: CanvasText;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/* With no script the element is never defined: the buttons cannot work, so they do not look as if they do. */
|
|
166
|
+
:host(:not(:defined)) button {
|
|
167
|
+
cursor: default;
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
}
|
|
170
|
+
:host(:not(:defined)) .marker {
|
|
171
|
+
display: none;
|
|
172
|
+
}
|
|
173
|
+
.panel {
|
|
174
|
+
max-inline-size: 48rem;
|
|
175
|
+
margin-block-start: calc(-1 * ${space(4)});
|
|
176
|
+
padding-block-end: ${space(8)};
|
|
177
|
+
font-size: ${fontSize("md")};
|
|
178
|
+
line-height: 1.6;
|
|
179
|
+
color: ${t.textMuted};
|
|
180
|
+
}
|
|
181
|
+
/*
|
|
182
|
+
* Issues (frames 36:716, 36:430): rows divided by soft rules, each a code, a small "+" and the finding in
|
|
183
|
+
* body type. An open finding becomes an inset soft box with an ink edge: the code above the heading, the
|
|
184
|
+
* heading in heading S, the status at the top right, and the panel under them, with no marker.
|
|
185
|
+
*/
|
|
186
|
+
:host([look='issues']) {
|
|
187
|
+
border-block-start: 0;
|
|
188
|
+
}
|
|
189
|
+
:host([look='issues']) .item {
|
|
190
|
+
border-block-end: ${t.borderThin} solid ${LINE_SOFT};
|
|
191
|
+
}
|
|
192
|
+
/* The finding keeps at least 16rem; on a narrow screen the status wraps under it, at the end, rather than squeezing it. */
|
|
193
|
+
:host([look='issues']) .head {
|
|
194
|
+
flex-wrap: wrap;
|
|
195
|
+
gap: ${space(2)} ${space(4)};
|
|
196
|
+
}
|
|
197
|
+
:host([look='issues']) .h {
|
|
198
|
+
flex: 1 1 16rem;
|
|
199
|
+
}
|
|
200
|
+
:host([look='issues']) .head > :is(.status-pill, .pills) {
|
|
201
|
+
margin-inline-start: auto;
|
|
202
|
+
}
|
|
203
|
+
:host([look='issues']) button {
|
|
204
|
+
align-items: center;
|
|
205
|
+
column-gap: ${space(3)};
|
|
206
|
+
padding-block: ${space(5)};
|
|
207
|
+
font-size: 1.25rem;
|
|
208
|
+
line-height: 1.2;
|
|
209
|
+
letter-spacing: -0.01em;
|
|
210
|
+
font-weight: ${fontWeight("regular")};
|
|
211
|
+
}
|
|
212
|
+
:host([look='issues']) .meta {
|
|
213
|
+
margin-inline-end: ${space(1)};
|
|
214
|
+
}
|
|
215
|
+
:host([look='issues']) .marker {
|
|
216
|
+
inline-size: 12px;
|
|
217
|
+
block-size: 12px;
|
|
218
|
+
}
|
|
219
|
+
:host([look='issues']) .marker::before {
|
|
220
|
+
inset-block-start: calc(50% - 0.75px);
|
|
221
|
+
block-size: 1.5px;
|
|
222
|
+
}
|
|
223
|
+
:host([look='issues']) .marker::after {
|
|
224
|
+
inset-inline-start: calc(50% - 0.75px);
|
|
225
|
+
inline-size: 1.5px;
|
|
226
|
+
}
|
|
227
|
+
:host([look='issues']) .item.open {
|
|
228
|
+
margin-block: ${space(4)};
|
|
229
|
+
padding: ${space(6)};
|
|
230
|
+
background: ${t.surfaceSubtle};
|
|
231
|
+
border: ${t.borderThin} solid ${t.text};
|
|
232
|
+
}
|
|
233
|
+
:host([look='issues']) .item.open .head {
|
|
234
|
+
align-items: flex-start;
|
|
235
|
+
}
|
|
236
|
+
:host([look='issues']) .item.open button {
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
align-items: flex-start;
|
|
239
|
+
row-gap: ${space(2)};
|
|
240
|
+
padding-block: 0;
|
|
241
|
+
font-size: var(--impakt-type-heading-s-size, 1.5rem);
|
|
242
|
+
line-height: 1.15;
|
|
243
|
+
letter-spacing: -0.025em;
|
|
244
|
+
font-weight: ${fontWeight("semibold")};
|
|
245
|
+
}
|
|
246
|
+
:host([look='issues']) .item.open .meta {
|
|
247
|
+
letter-spacing: normal;
|
|
248
|
+
font-weight: 400;
|
|
249
|
+
}
|
|
250
|
+
:host([look='issues']) .item.open .marker {
|
|
251
|
+
display: none;
|
|
252
|
+
}
|
|
253
|
+
:host([look='issues']) .panel {
|
|
254
|
+
max-inline-size: none;
|
|
255
|
+
margin: ${space(4)} 0 0;
|
|
256
|
+
padding: 0;
|
|
257
|
+
color: ${t.text};
|
|
258
|
+
}
|
|
259
|
+
:host([look='issues']) .panel[hidden] {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
/* Without script every finding is open and has no marker; it reads as a list, not as boxes. */
|
|
263
|
+
:host([look='issues']:not(:defined)) .item.open {
|
|
264
|
+
margin: 0;
|
|
265
|
+
padding: ${space(5)} 0;
|
|
266
|
+
background: none;
|
|
267
|
+
border: 0;
|
|
268
|
+
border-block-end: ${t.borderThin} solid ${LINE_SOFT};
|
|
269
|
+
}
|
|
270
|
+
@media (max-width: 40rem) {
|
|
271
|
+
button {
|
|
272
|
+
padding-block: ${space(6)};
|
|
273
|
+
font-size: 1.25rem;
|
|
274
|
+
}
|
|
275
|
+
:host([look='issues']) button {
|
|
276
|
+
padding-block: ${space(4)};
|
|
277
|
+
font-size: 1.125rem;
|
|
278
|
+
}
|
|
279
|
+
:host([look='issues']) .item.open {
|
|
280
|
+
padding: ${space(4)};
|
|
281
|
+
}
|
|
282
|
+
:host([look='issues']) .item.open button {
|
|
283
|
+
padding-block: 0;
|
|
284
|
+
font-size: 1.25rem;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
`
|
|
288
|
+
];
|
|
289
|
+
}
|
|
290
|
+
toggle(id) {
|
|
291
|
+
const isOpen = this.open.includes(id);
|
|
292
|
+
if (isOpen) this.open = this.open.filter((o) => o !== id);
|
|
293
|
+
else this.open = this.multiple ? [...this.open, id] : [id];
|
|
294
|
+
}
|
|
295
|
+
render() {
|
|
296
|
+
const issues = this.look === "issues";
|
|
297
|
+
return html`
|
|
298
|
+
${this.items.map((item) => {
|
|
299
|
+
const expanded = !this.enhanced || this.open.includes(item.id);
|
|
300
|
+
const panelId = this.id_(`panel-${item.id}`);
|
|
301
|
+
const buttonId = this.id_(`button-${item.id}`);
|
|
302
|
+
return html`
|
|
303
|
+
<div class="item ${expanded ? "open" : ""}" part="item">
|
|
304
|
+
<div class="head" part="head">
|
|
305
|
+
<div class="h" role="heading" aria-level=${this.headingLevel}>
|
|
306
|
+
<button
|
|
307
|
+
id=${buttonId}
|
|
308
|
+
part="header"
|
|
309
|
+
type="button"
|
|
310
|
+
aria-expanded=${expanded ? "true" : "false"}
|
|
311
|
+
aria-controls=${panelId}
|
|
312
|
+
@click=${() => this.toggle(item.id)}
|
|
313
|
+
>
|
|
314
|
+
${item.meta ? html`<span class="meta" part="meta">${item.meta}</span>` : nothing}
|
|
315
|
+
${issues ? html`<span class="marker" aria-hidden="true"></span>` : nothing}
|
|
316
|
+
<span class="q">${item.heading}</span>
|
|
317
|
+
</button>
|
|
318
|
+
</div>
|
|
319
|
+
${item.tags?.length ? html`<span class="pills" part="pills">
|
|
320
|
+
${statusPill(item.status, item.statusTone)}${item.tags.map((tag) => statusPill(tag.label, tag.tone ?? "neutral", "tag"))}
|
|
321
|
+
</span>` : statusPill(item.status, item.statusTone)}
|
|
322
|
+
${issues ? nothing : html`<span class="marker" aria-hidden="true"></span>`}
|
|
323
|
+
</div>
|
|
324
|
+
<div
|
|
325
|
+
id=${panelId}
|
|
326
|
+
class="panel"
|
|
327
|
+
part="panel"
|
|
328
|
+
role="region"
|
|
329
|
+
aria-labelledby=${buttonId}
|
|
330
|
+
?hidden=${!expanded}
|
|
331
|
+
>
|
|
332
|
+
<slot name=${`panel-${item.id}`}>${item.body}</slot>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
`;
|
|
336
|
+
})}
|
|
337
|
+
`;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
customElements.define("impakt-accordion", ImpaktAccordion);
|
|
341
|
+
|
|
342
|
+
export {
|
|
343
|
+
ImpaktAccordion
|
|
344
|
+
};
|
|
345
|
+
//# sourceMappingURL=chunk-FLAUZU7Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/accordion.ts"],"sourcesContent":["import { html, css, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { onServer } from '../base/server';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\nimport { statusPill, statusPillStyles, type StatusTone } from './status-pill-style';\n\n/** The G2 soft rule between findings, until the theme carries it. */\nconst LINE_SOFT = unsafeCSS('var(--impakt-color-line-soft, #dcdcd8)');\n\nexport interface AccordionItem {\n id: string;\n heading: string;\n body: string;\n /** A short code before the heading, in the code face, such as \"01\" or \"WCAG 1.4.3\". It is part of the button's name. */\n meta?: string;\n /** A status after the heading, drawn as a pill, such as \"Fixed\". It is outside the button, so its name stays the question. */\n status?: string;\n /** The status's tone. */\n statusTone?: StatusTone;\n /** More pills after the status, such as \"Found by the model\" or \"WCAG 1.1.1\". Each one is words, so none rests on its dot. */\n tags?: Array<{ label: string; tone?: StatusTone }>;\n}\n\n/**\n * Disclosure sections — frequently asked questions, \"what does this mean?\".\n *\n * **Each header is a button inside a heading.** The heading is what lets a\n * screen-reader user jump between sections without tabbing through every\n * paragraph; the button is what makes the section openable. One without the\n * other is a common half-implementation: all-headings cannot be operated,\n * all-buttons cannot be navigated.\n *\n * `headingLevel` is a property because the right level depends on what is\n * above the accordion on the page, and guessing produces exactly the skipped\n * levels that 1.3.1 is about.\n *\n * **Panels are hidden, not unmounted.** `hidden` keeps the content in the\n * accessibility tree's structure and lets in-page search find it when opened,\n * and it means `aria-controls` always points at an element that exists.\n *\n * **A panel can hold more than words.** `body` is plain text, which is what a\n * composition can author safely. Content rendered elsewhere, such as an FAQ\n * answer with links and a list, is slotted instead: a child with\n * `slot=\"panel-<item id>\"` replaces that item's body. The slot sits inside the\n * panel, so the region, its label and its `hidden` state are unchanged, and a\n * panel with nothing slotted still shows its body.\n *\n * **Without script every panel is open.** A page built to finished HTML may load\n * no script at all, and a closed panel there could never be opened. So an\n * accordion drawn on the server has every panel open and its markers hidden: the\n * questions and answers read as a plain list. When the script loads it closes\n * the panels that `open` does not name, and the buttons work.\n *\n * @category content\n * @icon accordion\n */\nexport class ImpaktAccordion extends ImpaktElement {\n static properties = {\n items: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n open: { type: Array },\n multiple: { type: Boolean },\n look: { type: String, reflect: true },\n enhanced: { state: true },\n };\n\n declare items: AccordionItem[];\n declare headingLevel: number;\n /** Ids currently expanded. */\n declare open: string[];\n /** When false, opening one closes the others. */\n declare multiple: boolean;\n /**\n * `plain` is the site's questions: a \"+\" at the end that turns to \"−\" when\n * open. `issues` is a list of findings in a tool: the \"+\" at the start and an\n * open panel drawn as an inset soft panel with an ink border.\n */\n declare look: 'plain' | 'issues';\n /** Whether the script is running here, so the panels can be closed and opened. */\n declare private enhanced: boolean;\n\n constructor() {\n super();\n this.items = [];\n this.headingLevel = 3;\n this.open = [];\n this.multiple = true;\n this.look = 'plain';\n this.enhanced = false;\n }\n\n connectedCallback(): void {\n // Drawn here from nothing, the panels start as `open` says. Drawn on the server first, the\n // first draw here must match what the server sent, with every panel open, and firstUpdated\n // then closes them.\n if (!onServer && !this.shadowRoot) this.enhanced = true;\n super.connectedCallback();\n }\n\n protected firstUpdated(): void {\n this.enhanced = true;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n statusPillStyles,\n css`\n :host {\n display: block;\n border-block-start: ${t.borderThin} solid ${t.text};\n }\n .item {\n border-block-end: ${t.borderThin} solid ${t.text};\n }\n /* The heading row. The button is stretched over it, so the whole row opens the panel, the status included. */\n .head {\n position: relative;\n display: flex;\n align-items: center;\n gap: ${space(4)};\n }\n .h {\n flex: 1;\n min-inline-size: 0;\n margin: 0;\n }\n button {\n ${targetSize}\n display: flex;\n align-items: baseline;\n flex-wrap: wrap;\n column-gap: ${space(4)};\n row-gap: ${space(1)};\n inline-size: 100%;\n padding: ${space(8)} 0;\n background: none;\n border: 0;\n font: inherit;\n /* G2 heading S: 24/1.15, -2.5%, semibold. */\n font-size: var(--impakt-type-heading-s-size, 1.5rem);\n line-height: 1.15;\n letter-spacing: -0.025em;\n font-weight: ${fontWeight('semibold')};\n color: ${t.text};\n text-align: start;\n cursor: pointer;\n }\n button::after {\n content: '';\n position: absolute;\n inset: 0;\n }\n button:focus-visible {\n box-shadow: none;\n }\n button:focus-visible::after {\n box-shadow: ${t.focusShadow};\n }\n button:hover .q {\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-underline-offset: 0.15em;\n }\n .meta {\n font-family: ${t.fontMono};\n font-size: ${fontSize('sm')};\n font-weight: 400;\n letter-spacing: normal;\n color: ${t.textMuted};\n }\n .status-pill {\n flex: none;\n }\n .pills {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: ${space(2)};\n max-inline-size: 50%;\n }\n /* A plus that turns to a minus: two bars, the upright one hidden when open. Drawn, not typed, so it is the same in every face. */\n .marker {\n position: relative;\n flex: none;\n inline-size: 18px;\n block-size: 18px;\n /* Centred on the question's first line, not sat on its baseline. */\n align-self: flex-start;\n margin-block-start: calc((1lh - 18px) / 2);\n }\n .marker::before,\n .marker::after {\n content: '';\n position: absolute;\n background: ${t.text};\n }\n .marker::before {\n inset-inline: 0;\n inset-block-start: calc(50% - 1px);\n block-size: 2px;\n }\n .marker::after {\n inset-block: 0;\n inset-inline-start: calc(50% - 1px);\n inline-size: 2px;\n transition: transform 120ms ease-in-out;\n }\n .item.open .marker::after {\n transform: scaleY(0);\n }\n @media (forced-colors: active) {\n .marker::before,\n .marker::after {\n background: CanvasText;\n }\n }\n /* With no script the element is never defined: the buttons cannot work, so they do not look as if they do. */\n :host(:not(:defined)) button {\n cursor: default;\n pointer-events: none;\n }\n :host(:not(:defined)) .marker {\n display: none;\n }\n .panel {\n max-inline-size: 48rem;\n margin-block-start: calc(-1 * ${space(4)});\n padding-block-end: ${space(8)};\n font-size: ${fontSize('md')};\n line-height: 1.6;\n color: ${t.textMuted};\n }\n /*\n * Issues (frames 36:716, 36:430): rows divided by soft rules, each a code, a small \"+\" and the finding in\n * body type. An open finding becomes an inset soft box with an ink edge: the code above the heading, the\n * heading in heading S, the status at the top right, and the panel under them, with no marker.\n */\n :host([look='issues']) {\n border-block-start: 0;\n }\n :host([look='issues']) .item {\n border-block-end: ${t.borderThin} solid ${LINE_SOFT};\n }\n /* The finding keeps at least 16rem; on a narrow screen the status wraps under it, at the end, rather than squeezing it. */\n :host([look='issues']) .head {\n flex-wrap: wrap;\n gap: ${space(2)} ${space(4)};\n }\n :host([look='issues']) .h {\n flex: 1 1 16rem;\n }\n :host([look='issues']) .head > :is(.status-pill, .pills) {\n margin-inline-start: auto;\n }\n :host([look='issues']) button {\n align-items: center;\n column-gap: ${space(3)};\n padding-block: ${space(5)};\n font-size: 1.25rem;\n line-height: 1.2;\n letter-spacing: -0.01em;\n font-weight: ${fontWeight('regular')};\n }\n :host([look='issues']) .meta {\n margin-inline-end: ${space(1)};\n }\n :host([look='issues']) .marker {\n inline-size: 12px;\n block-size: 12px;\n }\n :host([look='issues']) .marker::before {\n inset-block-start: calc(50% - 0.75px);\n block-size: 1.5px;\n }\n :host([look='issues']) .marker::after {\n inset-inline-start: calc(50% - 0.75px);\n inline-size: 1.5px;\n }\n :host([look='issues']) .item.open {\n margin-block: ${space(4)};\n padding: ${space(6)};\n background: ${t.surfaceSubtle};\n border: ${t.borderThin} solid ${t.text};\n }\n :host([look='issues']) .item.open .head {\n align-items: flex-start;\n }\n :host([look='issues']) .item.open button {\n flex-direction: column;\n align-items: flex-start;\n row-gap: ${space(2)};\n padding-block: 0;\n font-size: var(--impakt-type-heading-s-size, 1.5rem);\n line-height: 1.15;\n letter-spacing: -0.025em;\n font-weight: ${fontWeight('semibold')};\n }\n :host([look='issues']) .item.open .meta {\n letter-spacing: normal;\n font-weight: 400;\n }\n :host([look='issues']) .item.open .marker {\n display: none;\n }\n :host([look='issues']) .panel {\n max-inline-size: none;\n margin: ${space(4)} 0 0;\n padding: 0;\n color: ${t.text};\n }\n :host([look='issues']) .panel[hidden] {\n display: none;\n }\n /* Without script every finding is open and has no marker; it reads as a list, not as boxes. */\n :host([look='issues']:not(:defined)) .item.open {\n margin: 0;\n padding: ${space(5)} 0;\n background: none;\n border: 0;\n border-block-end: ${t.borderThin} solid ${LINE_SOFT};\n }\n @media (max-width: 40rem) {\n button {\n padding-block: ${space(6)};\n font-size: 1.25rem;\n }\n :host([look='issues']) button {\n padding-block: ${space(4)};\n font-size: 1.125rem;\n }\n :host([look='issues']) .item.open {\n padding: ${space(4)};\n }\n :host([look='issues']) .item.open button {\n padding-block: 0;\n font-size: 1.25rem;\n }\n }\n `,\n ];\n\n private toggle(id: string): void {\n const isOpen = this.open.includes(id);\n if (isOpen) this.open = this.open.filter((o) => o !== id);\n else this.open = this.multiple ? [...this.open, id] : [id];\n }\n\n render(): TemplateResult {\n // In the issues look the \"+\" sits between the code and the finding, so it is inside the button.\n const issues = this.look === 'issues';\n return html`\n ${this.items.map((item) => {\n const expanded = !this.enhanced || this.open.includes(item.id);\n const panelId = this.id_(`panel-${item.id}`);\n const buttonId = this.id_(`button-${item.id}`);\n return html`\n <div class=\"item ${expanded ? 'open' : ''}\" part=\"item\">\n <div class=\"head\" part=\"head\">\n <div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>\n <button\n id=${buttonId}\n part=\"header\"\n type=\"button\"\n aria-expanded=${expanded ? 'true' : 'false'}\n aria-controls=${panelId}\n @click=${() => this.toggle(item.id)}\n >\n ${item.meta ? html`<span class=\"meta\" part=\"meta\">${item.meta}</span>` : nothing}\n ${issues ? html`<span class=\"marker\" aria-hidden=\"true\"></span>` : nothing}\n <span class=\"q\">${item.heading}</span>\n </button>\n </div>\n ${\n item.tags?.length\n ? html`<span class=\"pills\" part=\"pills\">\n ${statusPill(item.status, item.statusTone)}${item.tags.map((tag) => statusPill(tag.label, tag.tone ?? 'neutral', 'tag'))}\n </span>`\n : statusPill(item.status, item.statusTone)\n }\n ${issues ? nothing : html`<span class=\"marker\" aria-hidden=\"true\"></span>`}\n </div>\n <div\n id=${panelId}\n class=\"panel\"\n part=\"panel\"\n role=\"region\"\n aria-labelledby=${buttonId}\n ?hidden=${!expanded}\n >\n <slot name=${`panel-${item.id}`}>${item.body}</slot>\n </div>\n </div>\n `;\n })}\n `;\n }\n}\n\ncustomElements.define('impakt-accordion', ImpaktAccordion);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-accordion': ImpaktAccordion;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,SAAS,iBAAsC;AAQnE,IAAM,YAAY,UAAU,wCAAwC;AAiD7D,IAAM,kBAAN,cAA8B,cAAc;AAAA,EACjD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,MAAM,EAAE,MAAM,MAAM;AAAA,MACpB,UAAU,EAAE,MAAM,QAAQ;AAAA,MAC1B,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,UAAU,EAAE,OAAO,KAAK;AAAA,IAC1B;AAAA;AAAA,EAiBA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,eAAe;AACpB,SAAK,OAAO,CAAC;AACb,SAAK,WAA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AAO,IAAI,QAAQ,WAAW,KAAK,CAAC,CAAC;AAAA,6BAExH,WAAW,KAAK,QAAQ,KAAK,UAAU,CAC7C;AAAA,gBACE,SAAS,UAAU,qDAAqD;AAAA;AAAA;AAAA,mBAGrE,OAAO;AAAA;AAAA;AAAA;AAAA,gCAIM,QAAQ;AAAA,wBAChB,CAAC,QAAQ;AAAA;AAAA,2BAEN,SAAS,KAAK,EAAE,EAAE,IAAI,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA,IAIpD,CAAC,CAAC;AAAA;AAAA,EAEN;AACF;AAEA,eAAe,OAAO,oBAAoB,eAAe;","names":[]}
|
|
@@ -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/checkbox-group.ts
|
|
12
14
|
import { html, css, nothing } from "lit";
|
|
@@ -128,4 +130,4 @@ customElements.define("impakt-checkbox-group", ImpaktCheckboxGroup);
|
|
|
128
130
|
export {
|
|
129
131
|
ImpaktCheckboxGroup
|
|
130
132
|
};
|
|
131
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-FZWUQC42.js.map
|