@atomic-ui/ui 0.13.0 → 0.13.2
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 +586 -3
- package/dist/base/FieldElement.d.ts +10 -0
- package/dist/{chunk-2BGOBD6Y.js → chunk-273AYERA.js} +2 -2
- package/dist/{chunk-EUOBFMWC.js → chunk-6IQIFKY6.js} +2 -2
- package/dist/{chunk-WEX5RKVC.js → chunk-BTACNWU6.js} +2 -2
- package/dist/{chunk-BGHAANTP.js → chunk-C767LTJE.js} +4 -2
- package/dist/chunk-C767LTJE.js.map +1 -0
- package/dist/{chunk-RNFGIXJ7.js → chunk-CN4J5RS2.js} +2 -2
- package/dist/{chunk-UBNCJROR.js → chunk-DJLUWM3C.js} +20 -5
- package/dist/chunk-DJLUWM3C.js.map +1 -0
- package/dist/{chunk-F2MFV7RM.js → chunk-DKVLA7AF.js} +2 -2
- package/dist/{chunk-MGDX7Z74.js → chunk-EIWICFXL.js} +4 -3
- package/dist/chunk-EIWICFXL.js.map +1 -0
- package/dist/{chunk-P5FAKEFK.js → chunk-GIIJ32FN.js} +2 -2
- package/dist/{chunk-LSEK5MEZ.js → chunk-H5HWJ2D4.js} +2 -2
- package/dist/{chunk-B2GWXXIW.js → chunk-JDKOHA3B.js} +2 -2
- package/dist/{chunk-G7CVRNY5.js → chunk-JX5RJRME.js} +5 -4
- package/dist/chunk-JX5RJRME.js.map +1 -0
- package/dist/{chunk-WT7MHYJR.js → chunk-KDU2POFS.js} +11 -5
- package/dist/chunk-KDU2POFS.js.map +1 -0
- package/dist/{chunk-EA3M6KPB.js → chunk-NCVBRUJM.js} +6 -1
- package/dist/chunk-NCVBRUJM.js.map +1 -0
- package/dist/{chunk-SY7NTW3U.js → chunk-VR543SMV.js} +18 -10
- package/dist/chunk-VR543SMV.js.map +1 -0
- package/dist/{chunk-QJBRENLI.js → chunk-WGFHYSXH.js} +7 -3
- package/dist/{chunk-QJBRENLI.js.map → chunk-WGFHYSXH.js.map} +1 -1
- package/dist/{chunk-PII4SJL5.js → chunk-X57BTN6V.js} +14 -2
- package/dist/chunk-X57BTN6V.js.map +1 -0
- package/dist/{chunk-RCZPRFHQ.js → chunk-ZOWOKIE4.js} +2 -2
- package/dist/chunk-ZOWOKIE4.js.map +1 -0
- package/dist/components/app-bar.d.ts +27 -4
- package/dist/components/app-bar.js +3 -3
- package/dist/components/app-ui.d.ts +12 -0
- package/dist/components/app-ui.js +2 -2
- package/dist/components/checkbox-group.d.ts +4 -0
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +2 -2
- package/dist/components/chip-group.d.ts +1 -0
- package/dist/components/chip-group.js +2 -2
- package/dist/components/chip.js +1 -1
- package/dist/components/date-input.d.ts +4 -0
- package/dist/components/date-input.js +2 -2
- package/dist/components/dialog.js +1 -1
- package/dist/components/journey.d.ts +16 -0
- package/dist/components/journey.js +2 -2
- package/dist/components/navigation.d.ts +6 -0
- package/dist/components/navigation.js +5 -3
- package/dist/components/page.js +1 -1
- package/dist/components/radio-group.d.ts +4 -0
- package/dist/components/radio-group.js +2 -2
- package/dist/components/rows.js +1 -1
- package/dist/components/select.d.ts +4 -0
- package/dist/components/select.js +2 -2
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +2 -2
- package/dist/components/text-input.d.ts +4 -0
- package/dist/components/text-input.js +2 -2
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -19
- package/dist/standalone/atomic-ui.js +204 -169
- package/dist/standalone/atomic-ui.js.map +3 -3
- package/package.json +2 -2
- package/dist/chunk-BGHAANTP.js.map +0 -1
- package/dist/chunk-EA3M6KPB.js.map +0 -1
- package/dist/chunk-G7CVRNY5.js.map +0 -1
- package/dist/chunk-MGDX7Z74.js.map +0 -1
- package/dist/chunk-PII4SJL5.js.map +0 -1
- package/dist/chunk-RCZPRFHQ.js.map +0 -1
- package/dist/chunk-SY7NTW3U.js.map +0 -1
- package/dist/chunk-UBNCJROR.js.map +0 -1
- package/dist/chunk-WT7MHYJR.js.map +0 -1
- /package/dist/{chunk-2BGOBD6Y.js.map → chunk-273AYERA.js.map} +0 -0
- /package/dist/{chunk-EUOBFMWC.js.map → chunk-6IQIFKY6.js.map} +0 -0
- /package/dist/{chunk-WEX5RKVC.js.map → chunk-BTACNWU6.js.map} +0 -0
- /package/dist/{chunk-RNFGIXJ7.js.map → chunk-CN4J5RS2.js.map} +0 -0
- /package/dist/{chunk-F2MFV7RM.js.map → chunk-DKVLA7AF.js.map} +0 -0
- /package/dist/{chunk-P5FAKEFK.js.map → chunk-GIIJ32FN.js.map} +0 -0
- /package/dist/{chunk-LSEK5MEZ.js.map → chunk-H5HWJ2D4.js.map} +0 -0
- /package/dist/{chunk-B2GWXXIW.js.map → chunk-JDKOHA3B.js.map} +0 -0
|
@@ -87,6 +87,10 @@ export declare abstract class FieldElement extends ImpaktElement {
|
|
|
87
87
|
type: StringConstructor;
|
|
88
88
|
attribute: string;
|
|
89
89
|
};
|
|
90
|
+
look: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
reflect: boolean;
|
|
93
|
+
};
|
|
90
94
|
};
|
|
91
95
|
label: string;
|
|
92
96
|
name: string;
|
|
@@ -105,6 +109,12 @@ export declare abstract class FieldElement extends ImpaktElement {
|
|
|
105
109
|
* so a partner can reword it, not so they can empty it.
|
|
106
110
|
*/
|
|
107
111
|
requiredText: string;
|
|
112
|
+
/**
|
|
113
|
+
* `default` takes the brand's field label; `site` is the mono uppercase label of the site's
|
|
114
|
+
* forms, as the G2 contact frame (20:1100) draws "NAME" and "MESSAGE" and as
|
|
115
|
+
* `impakt-chip-group look="site"` draws its own (#66).
|
|
116
|
+
*/
|
|
117
|
+
look: 'default' | 'site';
|
|
108
118
|
protected internals: ElementInternals | null;
|
|
109
119
|
constructor();
|
|
110
120
|
static styles: CSSResult[];
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
FieldElement,
|
|
6
6
|
fieldWidths
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-X57BTN6V.js";
|
|
8
8
|
import {
|
|
9
9
|
ImpaktElement,
|
|
10
10
|
focusRing,
|
|
@@ -557,4 +557,4 @@ export {
|
|
|
557
557
|
ImpaktRangeInput,
|
|
558
558
|
ImpaktTaskList
|
|
559
559
|
};
|
|
560
|
-
//# sourceMappingURL=chunk-
|
|
560
|
+
//# sourceMappingURL=chunk-273AYERA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X57BTN6V.js";
|
|
4
4
|
import {
|
|
5
5
|
targetSize,
|
|
6
6
|
touchTarget
|
|
@@ -89,4 +89,4 @@ customElements.define("impakt-checkbox", ImpaktCheckbox);
|
|
|
89
89
|
export {
|
|
90
90
|
ImpaktCheckbox
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-6IQIFKY6.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
FieldElement,
|
|
3
3
|
fieldControl,
|
|
4
4
|
fieldWidths
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-X57BTN6V.js";
|
|
6
6
|
import {
|
|
7
7
|
visuallyHidden
|
|
8
8
|
} from "./chunk-72WNCCDC.js";
|
|
@@ -105,4 +105,4 @@ customElements.define("impakt-select", ImpaktSelect);
|
|
|
105
105
|
export {
|
|
106
106
|
ImpaktSelect
|
|
107
107
|
};
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-BTACNWU6.js.map
|
|
@@ -61,7 +61,9 @@ var ImpaktChip = class extends ImpaktElement {
|
|
|
61
61
|
:host { display: inline-flex; flex: none; }
|
|
62
62
|
span.chip { display: inline-flex; align-items: center; gap: ${space(1.5)}; padding: 3px ${space(2.5)}; border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999)); font-family: ${MONO}; font-size: ${fontSize("xs")}; line-height: 1.2; white-space: nowrap; }
|
|
63
63
|
:host([look='filled']) span.chip { border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }
|
|
64
|
-
|
|
64
|
+
/* The edge is the border grey where the brand derives it, and ink under Noire (G2) (chip.outlined.edge, #69). */
|
|
65
|
+
/* Spaced 0.04em where the brand derives it, and not at all under Noire (G2) (chip.outlined.tracking). */
|
|
66
|
+
:host([look='outlined']) span.chip { border: ${t.borderThin} solid color-mix(in srgb, ${t.text} ${token("chip.outlined.edge", "0%")}, ${t.border}); background: ${t.surfaceCard}; letter-spacing: ${token("chip.outlined.tracking", "0.04em")}; }
|
|
65
67
|
:host([size='marketing']) span.chip { font-size: 11px; font-weight: ${fontWeight("medium")}; text-transform: uppercase; letter-spacing: 0.06em; }
|
|
66
68
|
/* Body: a 35px square box in the body face, for a row of tags such as a stack (G2 case study, 21:1493). */
|
|
67
69
|
:host([size='body']) span.chip { box-sizing: border-box; min-block-size: 35px; padding: ${space(1.5)} ${space(3)}; border: ${t.borderThin} solid ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontBody}; font-size: 14px; line-height: 1.2; }
|
|
@@ -91,4 +93,4 @@ export {
|
|
|
91
93
|
toneOf,
|
|
92
94
|
ImpaktChip
|
|
93
95
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
96
|
+
//# sourceMappingURL=chunk-C767LTJE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chip.ts","../src/base/tone.ts"],"sourcesContent":["/**\n * A short label: a branch, a status with its dot, or a code such as a commit\n * hash.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { hideOn } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport { toneOf, type Tone } from '../base/tone';\n\n/** Code-like labels: a branch, a hash, a commit message. */\nconst MONO = t.fontMono;\n\n/**\n * A short label: a branch name with its icon, a status with its dot, or a\n * code such as a commit hash. It says something; it does nothing.\n *\n * @category content\n * @icon badge\n */\nexport class ImpaktChip extends ImpaktElement {\n static properties = {\n label: { type: String },\n meta: { type: String },\n icon: { type: String, reflect: true },\n tone: { type: String },\n look: { type: String, reflect: true },\n size: { type: String, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n declare label: string;\n /** A code after the label, quieter, such as a hash. */\n declare meta: string;\n /** A coloured dot, a branch, or nothing before the label. */\n declare icon: 'none' | 'dot' | 'branch';\n /** The dot's colour: a named tone, or 1 to 5 for the brand's chart colours. */\n declare tone: Tone;\n /** `outlined` on the card colour, `filled` with a faint wash, or `plain` words in the code face. */\n declare look: 'outlined' | 'filled' | 'plain';\n /**\n * `md` is the chip in a line of text. `marketing` sets the words in\n * capitals at 11px with 6% tracking, as the site's labels are. `lg` is a\n * studio tool tag: a square 49px box with an ink border, the label in\n * Archivo at 20px and the meta in capitals in the code face (frame 21:1152).\n */\n declare size: 'md' | 'marketing' | 'body' | 'lg';\n declare hideOn: 'never' | 'phone' | 'wide';\n\n constructor() {\n super();\n this.label = '';\n this.meta = '';\n this.icon = 'none';\n this.tone = 'success';\n this.look = 'filled';\n this.size = 'md';\n this.hideOn = 'never';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n hideOn,\n css`\n :host { display: inline-flex; flex: none; }\n span.chip { display: inline-flex; align-items: center; gap: ${space(1.5)}; padding: 3px ${space(2.5)}; border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999)); font-family: ${MONO}; font-size: ${fontSize('xs')}; line-height: 1.2; white-space: nowrap; }\n :host([look='filled']) span.chip { border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); }\n /* The edge is the border grey where the brand derives it, and ink under Noire (G2) (chip.outlined.edge, #69). */\n /* Spaced 0.04em where the brand derives it, and not at all under Noire (G2) (chip.outlined.tracking). */\n :host([look='outlined']) span.chip { border: ${t.borderThin} solid color-mix(in srgb, ${t.text} ${token('chip.outlined.edge', '0%')}, ${t.border}); background: ${t.surfaceCard}; letter-spacing: ${token('chip.outlined.tracking', '0.04em')}; }\n :host([size='marketing']) span.chip { font-size: 11px; font-weight: ${fontWeight('medium')}; text-transform: uppercase; letter-spacing: 0.06em; }\n /* Body: a 35px square box in the body face, for a row of tags such as a stack (G2 case study, 21:1493). */\n :host([size='body']) span.chip { box-sizing: border-box; min-block-size: 35px; padding: ${space(1.5)} ${space(3)}; border: ${t.borderThin} solid ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontBody}; font-size: 14px; line-height: 1.2; }\n :host([size='lg']) span.chip { box-sizing: border-box; min-block-size: 49px; gap: ${space(3)}; padding: ${space(2)} ${space(4)}; border: ${t.borderThin} solid ${t.text}; border-radius: ${t.radius}; font-family: ${t.fontBody}; font-size: 20px; line-height: 1.2; }\n :host([size='lg']) .meta { font-family: ${MONO}; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 1; color: ${t.textMuted}; }\n :host([look='plain']) span.chip { padding: 0; }\n .dot { flex: none; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--tone); }\n /* Yellow means \"needs your attention\": the accent, with an ink stroke so it shows on white. */\n .dot.warn { background: ${token('color.accent.default', '#ffd43b')}; box-shadow: 0 0 0 1px ${t.text}; }\n @media (forced-colors: active) { .dot, .dot.warn { background: CanvasText; } }\n svg { inline-size: 12px; block-size: 12px; }\n .meta { opacity: 0.72; text-transform: none; }\n :host([look='plain']) .label { opacity: 0.72; }\n `,\n ];\n\n render(): TemplateResult {\n const icon =\n this.icon === 'dot'\n ? html`<span class=\"dot ${this.tone === 'warning' ? 'warn' : ''}\" aria-hidden=\"true\"></span>`\n : this.icon === 'branch'\n ? html`<svg viewBox=\"0 0 14 14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><circle cx=\"3.5\" cy=\"3\" r=\"1.5\"/><circle cx=\"3.5\" cy=\"11\" r=\"1.5\"/><circle cx=\"10.5\" cy=\"4.5\" r=\"1.5\"/><path d=\"M3.5 4.5v5M10.5 6c0 2.5-3 2.5-6 4\"/></svg>`\n : nothing;\n return html`<span class=\"chip\" part=\"chip\" style=${`--tone:${toneOf(this.tone, 0)}`}>${icon}<span class=\"label\">${this.label}</span>${this.meta ? html` <span class=\"meta\">${this.meta}</span>` : nothing}</span>`;\n }\n}\n\ncustomElements.define('impakt-chip', ImpaktChip);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-chip': ImpaktChip;\n }\n}\n","/**\n * Colours named by what they are in the brand, for a line, a lane, a dot or a\n * stripe. A tone is a brand token, never a hex value, so a partner's brand\n * restyles everything drawn with one.\n *\n * It is shared: `impakt-chip` here and the changelog, site and estimator blocks\n * in `@atomic-ui/blocks` all colour themselves with it.\n */\n\n/** A colour for a line or a lane, named by what it is in the brand. */\nexport type NamedTone = 'brand' | 'accent' | 'info' | 'success' | 'warning' | 'danger';\n/** A named tone, or 1 to 5 for the brand's chart colours in order. */\nexport type Tone = NamedTone | 1 | 2 | 3 | 4 | 5;\nexport const TONE: Record<NamedTone, string> = {\n brand: 'var(--impakt-color-brand-default, #1f4ed8)',\n accent: 'var(--impakt-color-accent-default, #c8a15a)',\n info: 'var(--impakt-color-status-info-default, #1f4ed8)',\n success: 'var(--impakt-color-status-success-default, #047857)',\n warning: 'var(--impakt-color-status-warning-default, #b45309)',\n danger: 'var(--impakt-color-status-danger-default, #c8102e)',\n};\n/** When an item names no tone, lanes take these in turn. */\nexport const CYCLE: NamedTone[] = ['success', 'info', 'warning', 'accent', 'danger', 'brand'];\n/**\n * A named tone, or for an item that names none, the brand's chart colour for its\n * place (color.chart.1 to 5), falling back to the status colours in turn.\n */\nexport const toneOf = (tone: Tone | undefined, i: number): string => {\n if (typeof tone === 'number') return `var(--impak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ACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X57BTN6V.js";
|
|
4
4
|
import {
|
|
5
5
|
targetSize,
|
|
6
6
|
touchTarget,
|
|
@@ -310,4 +310,4 @@ export {
|
|
|
310
310
|
ImpaktSwitch,
|
|
311
311
|
ImpaktSegmentedControl
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-CN4J5RS2.js.map
|
|
@@ -14,6 +14,10 @@ import {
|
|
|
14
14
|
|
|
15
15
|
// packages/ui/src/components/app-bar.ts
|
|
16
16
|
import { css, html, nothing } from "lit";
|
|
17
|
+
var MENU_PARTS = ["trigger", "chevron", "panel", "header", "list", "group", "group-label", "item", "current", "label", "meta"];
|
|
18
|
+
var exportPrefixed = (prefix) => MENU_PARTS.map((part) => `${part}: ${prefix}-${part}`).join(", ");
|
|
19
|
+
var SWITCHER_PARTS = exportPrefixed("switcher");
|
|
20
|
+
var ORGANISATION_PARTS = exportPrefixed("organisation");
|
|
17
21
|
var ImpaktAppBar = class extends ImpaktElement {
|
|
18
22
|
static {
|
|
19
23
|
this.properties = {
|
|
@@ -190,9 +194,11 @@ var ImpaktAppBar = class extends ImpaktElement {
|
|
|
190
194
|
impakt-menu::part(chevron) {
|
|
191
195
|
color: inherit;
|
|
192
196
|
}
|
|
193
|
-
/* The switcher's panel is
|
|
197
|
+
/* The switcher's panel is 340 wide (53:960), so "Your account" and "Plans, team, billing" sit on one line.
|
|
198
|
+
On a 390 screen that still leaves the 16px gutters; narrower than that it keeps to the gutters and the words may wrap. */
|
|
194
199
|
impakt-menu.switcher::part(panel) {
|
|
195
|
-
|
|
200
|
+
inline-size: min(21.25rem, calc(100vw - 2 * ${space(4)}));
|
|
201
|
+
max-inline-size: none;
|
|
196
202
|
}
|
|
197
203
|
impakt-menu.org::part(trigger),
|
|
198
204
|
a.org,
|
|
@@ -222,6 +228,15 @@ var ImpaktAppBar = class extends ImpaktElement {
|
|
|
222
228
|
grid-template-areas: 'start end' 'pages pages';
|
|
223
229
|
padding-block: ${space(2)};
|
|
224
230
|
}
|
|
231
|
+
/* On its own row the track wraps rather than scrolls, so no page is cut off at the edge (#64). */
|
|
232
|
+
.pages {
|
|
233
|
+
overflow: visible;
|
|
234
|
+
}
|
|
235
|
+
.pages ul {
|
|
236
|
+
flex-wrap: wrap;
|
|
237
|
+
inline-size: fit-content;
|
|
238
|
+
max-inline-size: 100%;
|
|
239
|
+
}
|
|
225
240
|
}
|
|
226
241
|
@container (max-width: 30rem) {
|
|
227
242
|
.bar {
|
|
@@ -260,14 +275,14 @@ var ImpaktAppBar = class extends ImpaktElement {
|
|
|
260
275
|
}
|
|
261
276
|
renderSwitcher() {
|
|
262
277
|
if (this.switcher.length)
|
|
263
|
-
return html`<impakt-menu class="switcher" edge="end" trigger-look="text" .label=${this.switcherLabel} .items=${this.switcher}></impakt-menu>`;
|
|
278
|
+
return html`<impakt-menu class="switcher" exportparts=${SWITCHER_PARTS} edge="end" trigger-look="text" .label=${this.switcherLabel} .items=${this.switcher}></impakt-menu>`;
|
|
264
279
|
if (this.toolsHref) return html`<a class="all" href=${this.toolsHref}>${this.switcherLabel}</a>`;
|
|
265
280
|
return nothing;
|
|
266
281
|
}
|
|
267
282
|
renderAccount() {
|
|
268
283
|
if (this.signedOut) return html`<a class="sign-in" part="sign-in" href=${this.signInHref}>${this.signInText}</a>`;
|
|
269
284
|
if (this.organisationItems.length)
|
|
270
|
-
return html`<impakt-menu class="org" edge="end" trigger-look="text" .label=${this.organisation} .items=${this.organisationItems}></impakt-menu>`;
|
|
285
|
+
return html`<impakt-menu class="org" exportparts=${ORGANISATION_PARTS} edge="end" trigger-look="text" .label=${this.organisation} .items=${this.organisationItems}></impakt-menu>`;
|
|
271
286
|
if (this.organisationHref) return html`<a class="org" href=${this.organisationHref}>${this.organisation}</a>`;
|
|
272
287
|
return nothing;
|
|
273
288
|
}
|
|
@@ -291,4 +306,4 @@ customElements.define("impakt-app-bar", ImpaktAppBar);
|
|
|
291
306
|
export {
|
|
292
307
|
ImpaktAppBar
|
|
293
308
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
309
|
+
//# sourceMappingURL=chunk-DJLUWM3C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/app-bar.ts"],"sourcesContent":["/**\n * The frame every AI tool sits in: the app bar.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, touchTarget } from '../base/styles';\nimport { space, t, token } from '../base/tokens';\nimport { kit } from './tool-kit-tokens';\nimport type { MenuItem } from './app-ui';\nimport './app-ui';\n\nexport interface AppBarLink {\n label: string;\n href: string;\n /** The page that is showing. */\n current?: boolean;\n}\n\n/**\n * An item in the \"All tools\" switcher or the organisation menu. `group`,\n * `meta`, `current` and `disabled` are drawn by `impakt-menu`: the group's\n * heading (\"Tools\", \"Working in\", \"Account\"), a mono note on the right\n * (\"Open\", \"You are here\", \"Coming soon\"), the tool that is showing, and a\n * tool that cannot be opened yet.\n */\nexport type AppBarMenuItem = MenuItem & {\n group?: string;\n meta?: string;\n current?: boolean;\n disabled?: boolean;\n};\n\n/** The menu's parts, passed on under a prefix so a product can reach them from outside the bar. */\nconst MENU_PARTS = ['trigger', 'chevron', 'panel', 'header', 'list', 'group', 'group-label', 'item', 'current', 'label', 'meta'];\nconst exportPrefixed = (prefix: string): string => MENU_PARTS.map((part) => `${part}: ${prefix}-${part}`).join(', ');\nconst SWITCHER_PARTS = exportPrefixed('switcher');\nconst ORGANISATION_PARTS = exportPrefixed('organisation');\n\n/**\n * The bar at the top of every AI tool: the Impakt mark and the tool's name on\n * the left, the tool's own pages in the middle, and the way to other tools and\n * the organisation on the right.\n *\n * It is a `header` landmark, 56px tall. \"impakt\" links home; the tool's name\n * follows a \"/\". The tool's pages, when it has more than one, are a `nav`\n * drawn as a segmented track, and the page that is showing is marked with\n * `aria-current=\"page\"` as well as a dot, so it is never told by colour.\n *\n * On the right, the built-in \"All tools\" switcher is an `impakt-menu` of the\n * `switcher` items, grouped and annotated (Tools, Working in, Account). Put\n * your own controls in the `tools` slot to replace it, and put a language switch\n * or anything else before it in the `extra` slot. Then comes the organisation menu, from\n * `organisation-items`; or, when `signed-out`, a \"Sign in\" link in its place.\n *\n * **On a narrow screen the pages move to a second row** under the mark and\n * the menus, the full width of the bar, and the segmented track wraps onto\n * another line when they still do not fit, so every page stays in sight at 390\n * and at 320 (#64). Folding them away behind a button would hide where you\n * are, and a row that scrolls hides the pages past the edge with no sign that\n * they are there. The bar reflows to 320px without the page scrolling sideways.\n *\n * Figma: kit `33:361`, `33:365`; every tool screen, such as `36:431`, `36:642`,\n * `37:420`, `37:591`, `39:468`, `39:603`, `39:746`, `53:674`, `53:801`; signed\n * out `36:382`; dark `48:527`, `48:857`; the switcher open `53:960`, `53:800`.\n *\n * @category navigation\n * @icon menu\n * @slot tools - Replaces the built-in \"All tools\" switcher.\n * @slot extra - Before the \"All tools\" switcher, such as an `impakt-language-switch` (39:468).\n * @csspart bar - The header.\n * @csspart home - The link home.\n * @csspart pages - The tool's own pages.\n * @csspart sign-in - The sign-in link.\n * @csspart switcher-trigger - The \"All tools\" switcher's button.\n * @csspart switcher-chevron - The arrow on the switcher's button.\n * @csspart switcher-header - The box round the switcher's header, when it has one.\n * @csspart switcher-panel - The box the switcher opens, 340px wide as in `53:960`.\n * @csspart switcher-list - The switcher's list of items.\n * @csspart switcher-group - A group of the switcher's items, with its label.\n * @csspart switcher-group-label - A group's label in the switcher, such as \"Tools\".\n * @csspart switcher-item - An item in the switcher. The tool you are in is also `switcher-current`.\n * @csspart switcher-current - The switcher's item for the tool you are in.\n * @csspart switcher-label - An item's words in the switcher.\n * @csspart switcher-meta - An item's note in the switcher, such as \"Plans, team, billing\".\n * @csspart organisation-trigger - The organisation menu's button.\n * @csspart organisation-chevron - The arrow on the organisation menu's button.\n * @csspart organisation-panel - The box the organisation menu opens.\n * @csspart organisation-header - The box round the organisation menu's header, when it has one.\n * @csspart organisation-list - The organisation menu's list of items.\n * @csspart organisation-group - A group of the organisation menu's items, with its label.\n * @csspart organisation-group-label - A group's label in the organisation menu.\n * @csspart organisation-item - An item in the organisation menu. The page you are on is also `organisation-current`.\n * @csspart organisation-current - The organisation menu's item for the page you are on.\n * @csspart organisation-label - An item's words in the organisation menu.\n * @csspart organisation-meta - An item's note in the organisation menu.\n */\nexport class ImpaktAppBar extends ImpaktElement {\n static properties = {\n tool: { type: String },\n home: { type: String },\n brand: { type: String },\n links: { type: Array },\n pagesLabel: { type: String, attribute: 'pages-label' },\n switcher: { type: Array },\n switcherLabel: { type: String, attribute: 'switcher-label' },\n toolsHref: { type: String, attribute: 'tools-href' },\n organisation: { type: String },\n organisationItems: { type: Array, attribute: 'organisation-items' },\n organisationHref: { type: String, attribute: 'organisation-href' },\n signedOut: { type: Boolean, reflect: true, attribute: 'signed-out' },\n signInHref: { type: String, attribute: 'sign-in-href' },\n signInText: { type: String, attribute: 'sign-in-text' },\n };\n\n /** The tool's name, as it follows \"impakt /\": \"accessibility\". */\n declare tool: string;\n /** Where \"impakt\" leads. */\n declare home: string;\n /** The word beside the mark. */\n declare brand: string;\n /** The tool's own pages, drawn in the middle. */\n declare links: AppBarLink[];\n /** The name of the pages' navigation landmark. */\n declare pagesLabel: string;\n /** The \"All tools\" menu: the tools, where you are working, and the account. */\n declare switcher: AppBarMenuItem[];\n /** The switcher's button. */\n declare switcherLabel: string;\n /** With no `switcher` items, \"All tools\" is a link here instead. */\n declare toolsHref: string;\n /** The organisation's name on its menu button. */\n declare organisation: string;\n /** The organisation menu. */\n declare organisationItems: AppBarMenuItem[];\n /** With no `organisation-items`, the organisation is a link here instead. */\n declare organisationHref: string;\n /** Nobody is signed in: a \"Sign in\" link takes the organisation's place. */\n declare signedOut: boolean;\n declare signInHref: string;\n declare signInText: string;\n\n constructor() {\n super();\n this.tool = '';\n this.home = '/';\n this.brand = 'impakt';\n this.links = [];\n this.pagesLabel = 'Tool pages';\n this.switcher = [];\n this.switcherLabel = 'All tools';\n this.toolsHref = '';\n this.organisation = 'Your organisation';\n this.organisationItems = [];\n this.organisationHref = '';\n this.signedOut = false;\n this.signInHref = '/sign-in';\n this.signInText = 'Sign in';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.home, .pages a, .sign-in, a.org, .all'),\n css`\n :host {\n display: block;\n container-type: inline-size;\n font-family: ${t.fontBody};\n font-size: ${kit.small};\n }\n .bar {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n grid-template-areas: 'start pages end';\n align-items: center;\n gap: ${space(2)} ${space(4)};\n min-block-size: 56px;\n padding: ${space(2)} ${space(4)};\n color: ${t.text};\n background: ${t.surfaceCard};\n border-block-end: 1px solid ${token('color.line.grid', 'light-dark(#DCDCD8, #1F1F1F)')};\n }\n .start {\n grid-area: start;\n display: flex;\n align-items: center;\n gap: ${space(2.5)};\n min-inline-size: 0;\n }\n .home {\n display: inline-flex;\n align-items: center;\n gap: ${space(2.5)};\n min-block-size: ${t.targetMin};\n color: inherit;\n text-decoration: none;\n }\n .home:hover .word {\n text-decoration: underline;\n text-underline-offset: 3px;\n }\n .mark {\n display: inline-grid;\n place-items: center;\n flex: none;\n inline-size: 28px;\n block-size: 28px;\n font-weight: ${kit.medium};\n color: ${kit.onInverse};\n background: ${kit.inverse};\n }\n .sep {\n color: ${t.textMuted};\n }\n .tool {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .pages {\n grid-area: pages;\n min-inline-size: 0;\n max-inline-size: 100%;\n overflow-x: auto;\n scrollbar-width: thin;\n }\n .pages ul {\n display: flex;\n inline-size: max-content;\n margin: 0;\n padding: 3px;\n list-style: none;\n background: ${t.surfaceSubtle};\n border: 1px solid ${kit.lineSoft};\n }\n .pages a {\n display: inline-flex;\n align-items: center;\n gap: ${space(1.5)};\n min-block-size: 28px;\n padding: 0 ${space(2.5)};\n font-weight: ${kit.regular};\n color: ${t.textMuted};\n text-decoration: none;\n white-space: nowrap;\n border: 1px solid transparent;\n }\n .pages a:hover {\n color: ${t.text};\n }\n .pages a[aria-current='page'] {\n color: ${t.text};\n background: ${t.surfaceCard};\n border-color: ${kit.lineSoft};\n }\n .dot {\n inline-size: 5px;\n block-size: 5px;\n border-radius: 50%;\n background: currentColor;\n }\n .end {\n grid-area: end;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: ${space(2)} ${space(3)};\n min-inline-size: 0;\n }\n .all {\n color: ${t.textMuted};\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n min-block-size: ${t.targetMin};\n }\n .all:hover {\n color: ${t.text};\n text-decoration: underline;\n }\n impakt-menu.switcher::part(trigger) {\n padding: ${space(1)} ${space(1)};\n font-family: ${t.fontBody};\n font-size: ${kit.small};\n font-weight: ${kit.regular};\n color: ${t.textMuted};\n background: transparent;\n border: 0;\n border-radius: 0;\n box-shadow: none;\n }\n impakt-menu.switcher::part(trigger):hover {\n color: ${t.text};\n }\n impakt-menu::part(chevron) {\n color: inherit;\n }\n /* The switcher's panel is 340 wide (53:960), so \"Your account\" and \"Plans, team, billing\" sit on one line.\n On a 390 screen that still leaves the 16px gutters; narrower than that it keeps to the gutters and the words may wrap. */\n impakt-menu.switcher::part(panel) {\n inline-size: min(21.25rem, calc(100vw - 2 * ${space(4)}));\n max-inline-size: none;\n }\n impakt-menu.org::part(trigger),\n a.org,\n .sign-in {\n display: inline-flex;\n align-items: center;\n gap: ${space(2)};\n padding: 9px 14px;\n font-family: ${t.fontBody};\n font-size: ${kit.small};\n font-weight: ${kit.medium};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: 1px solid ${t.text};\n border-radius: 0;\n box-shadow: none;\n text-decoration: none;\n }\n impakt-menu.org::part(trigger):hover,\n a.org:hover,\n .sign-in:hover {\n background: ${t.surfaceSubtle};\n }\n @container (max-width: 56rem) {\n .bar {\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-areas: 'start end' 'pages pages';\n padding-block: ${space(2)};\n }\n /* On its own row the track wraps rather than scrolls, so no page is cut off at the edge (#64). */\n .pages {\n overflow: visible;\n }\n .pages ul {\n flex-wrap: wrap;\n inline-size: fit-content;\n max-inline-size: 100%;\n }\n }\n @container (max-width: 30rem) {\n .bar {\n grid-template-columns: minmax(0, 1fr);\n grid-template-areas: 'start' 'end' 'pages';\n padding-inline: ${space(4)};\n }\n .end {\n justify-content: flex-start;\n }\n }\n @media (forced-colors: active) {\n .pages a[aria-current='page'] {\n border-color: CanvasText;\n }\n .mark {\n border: 1px solid CanvasText;\n }\n }\n `,\n ];\n\n private renderPages(): TemplateResult | typeof nothing {\n if (!this.links.length) return nothing;\n return html`<nav class=\"pages\" part=\"pages\" aria-label=${this.pagesLabel}>\n <ul>\n ${this.links.map(\n (link) =>\n html`<li>\n <a href=${link.href} aria-current=${link.current ? 'page' : nothing}\n >${link.current ? html`<span class=\"dot\" aria-hidden=\"true\"></span>` : nothing}${link.label}</a\n >\n </li>`,\n )}\n </ul>\n </nav>`;\n }\n\n private renderSwitcher(): TemplateResult | typeof nothing {\n if (this.switcher.length)\n return html`<impakt-menu class=\"switcher\" exportparts=${SWITCHER_PARTS} edge=\"end\" trigger-look=\"text\" .label=${this.switcherLabel} .items=${this.switcher as MenuItem[]}></impakt-menu>`;\n if (this.toolsHref) return html`<a class=\"all\" href=${this.toolsHref}>${this.switcherLabel}</a>`;\n return nothing;\n }\n\n private renderAccount(): TemplateResult | typeof nothing {\n if (this.signedOut) return html`<a class=\"sign-in\" part=\"sign-in\" href=${this.signInHref}>${this.signInText}</a>`;\n if (this.organisationItems.length)\n return html`<impakt-menu class=\"org\" exportparts=${ORGANISATION_PARTS} edge=\"end\" trigger-look=\"text\" .label=${this.organisation} .items=${this.organisationItems as MenuItem[]}></impakt-menu>`;\n if (this.organisationHref) return html`<a class=\"org\" href=${this.organisationHref}>${this.organisation}</a>`;\n return nothing;\n }\n\n render(): TemplateResult {\n return html`<header class=\"bar\" part=\"bar\">\n <div class=\"start\">\n <a class=\"home\" part=\"home\" href=${this.home}><span class=\"mark\" aria-hidden=\"true\">i</span><span class=\"word\">${this.brand}</span></a>\n ${this.tool ? html`<span class=\"sep\" aria-hidden=\"true\">/</span><span class=\"tool\">${this.tool}</span>` : nothing}\n </div>\n ${this.renderPages()}\n <div class=\"end\">\n <slot name=\"extra\"></slot>\n <slot name=\"tools\">${this.renderSwitcher()}</slot>\n ${this.renderAccount()}\n </div>\n </header>`;\n }\n}\n\ncustomElements.define('impakt-app-bar', ImpaktAppBar);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-app-bar': ImpaktAppBar;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAGA,SAAS,KAAK,MAAM,eAAoC;AA8BxD,IAAM,aAAa,CAAC,WAAW,WAAW,SAAS,UAAU,QAAQ,SAAS,eAAe,QAAQ,WAAW,SAAS,MAAM;AAC/H,IAAM,iBAAiB,CAAC,WAA2B,WAAW,IAAI,CAAC,SAAS,GAAG,IAAI,KAAK,MAAM,IAAI,IAAI,EAAE,EAAE,KAAK,IAAI;AACnH,IAAM,iBAAiB,eAAe,UAAU;AAChD,IAAM,qBAAqB,eAAe,cAAc;AA4DjD,IAAM,eAAN,cAA2B,cAAc;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,UAAU,EAAE,MAAM,MAAM;AAAA,MACxB,eAAe,EAAE,MAAM,QAAQ,WAAW,iBAAiB;AAAA,MA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AAO,4CAA4C,kBAAkB,0CAA0C,KAAK,YAAY,WAAW,KAAK,iBAA+B;AACjL,QAAI,KAAK,iBAAkB,QAAO,2BAA2B,KAAK,gBAAgB,IAAI,KAAK,YAAY;AACvG,WAAO;AAAA,EACT;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA,2CAEgC,KAAK,IAAI,qEAAqE,KAAK,KAAK;AAAA,UACzH,KAAK,OAAO,uEAAuE,KAAK,IAAI,YAAY,OAAO;AAAA;AAAA,QAEjH,KAAK,YAAY,CAAC;AAAA;AAAA;AAAA,6BAGG,KAAK,eAAe,CAAC;AAAA,UACxC,KAAK,cAAc,CAAC;AAAA;AAAA;AAAA,EAG5B;AACF;AAEA,eAAe,OAAO,kBAAkB,YAAY;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X57BTN6V.js";
|
|
4
4
|
import {
|
|
5
5
|
targetSize
|
|
6
6
|
} from "./chunk-72WNCCDC.js";
|
|
@@ -130,4 +130,4 @@ customElements.define("impakt-checkbox-group", ImpaktCheckboxGroup);
|
|
|
130
130
|
export {
|
|
131
131
|
ImpaktCheckboxGroup
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
133
|
+
//# sourceMappingURL=chunk-DKVLA7AF.js.map
|
|
@@ -50,7 +50,8 @@ var TILE = {
|
|
|
50
50
|
lgRadius: token("tile.lg.radius", "12px"),
|
|
51
51
|
lgLabelSize: token("tile.lg.label.size", "0.875rem"),
|
|
52
52
|
lgLabelTracking: token("tile.lg.label.tracking", "0em"),
|
|
53
|
-
lgLabelTransform: token("tile.lg.label.transform", "none")
|
|
53
|
+
lgLabelTransform: token("tile.lg.label.transform", "none"),
|
|
54
|
+
captionLineHeight: token("tile.caption.line-height", "1.5")
|
|
54
55
|
};
|
|
55
56
|
var TILE_VALUE = unsafeCSS(`calc(var(--impakt-type-stat-size, 3.25rem) * ${TILE.valueStat} + ${TILE.valueSize} * (1 - ${TILE.valueStat}))`);
|
|
56
57
|
var TILE_VALUE_PHONE = unsafeCSS(`calc(2.5rem * ${TILE.valueStat} + ${TILE.valueSize} * (1 - ${TILE.valueStat}))`);
|
|
@@ -106,7 +107,7 @@ var ImpaktStatTile = class extends ImpaktElement {
|
|
|
106
107
|
.label { font-family: ${TILE.labelFont}; font-size: ${TILE.labelSize}; font-weight: ${TILE.labelWeight}; letter-spacing: ${TILE.labelTracking}; text-transform: ${TILE.labelTransform}; color: ${t.textMuted}; }
|
|
107
108
|
/* The figure: light at 34px where the brand derives it, or under Noire (G2) Archivo SemiBold 52/1.04, -4%. A word fits as well as a number. */
|
|
108
109
|
.value { margin-block-start: ${TILE.valueSpace}; font-size: ${TILE_VALUE}; line-height: ${TILE.valueLineHeight}; letter-spacing: ${TILE.valueTracking}; font-weight: ${TILE.valueWeight}; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
|
|
109
|
-
.caption { font-size: ${fontSize("sm")}; line-height:
|
|
110
|
+
.caption { font-size: ${fontSize("sm")}; line-height: ${TILE.captionLineHeight}; color: ${t.textMuted}; }
|
|
110
111
|
:host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; border-radius: ${TILE.lgRadius}; }
|
|
111
112
|
:host([size='lg']) .label { font-size: ${TILE.lgLabelSize}; letter-spacing: ${TILE.lgLabelTracking}; text-transform: ${TILE.lgLabelTransform}; }
|
|
112
113
|
:host([size='lg']) .value { margin-block-start: auto; font-size: 64px; line-height: 1; font-weight: ${LIGHT}; }
|
|
@@ -336,4 +337,4 @@ export {
|
|
|
336
337
|
ImpaktRow,
|
|
337
338
|
ImpaktFilterChip
|
|
338
339
|
};
|
|
339
|
-
//# sourceMappingURL=chunk-
|
|
340
|
+
//# sourceMappingURL=chunk-EIWICFXL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/rows.ts"],"sourcesContent":["import { html, css, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport { pageLocale } from '../base/locale';\nimport { iconSvg } from './icon';\nimport { statusPill, statusPillStyles, type StatusTone } from './status-pill-style';\n\n/** The colour that reads on the text colour, which a toned band sets; the card otherwise. */\nconst INVERSE = token('color.text.inverse', 'var(--impakt-solid-card, var(--impakt-color-surface-card, #ffffff))');\n\n/**\n * The summary tile's shape, from the brand (`tile.*` in `@atomic-ui/design-tokens`). Each\n * fallback is the tile every brand derives: the inset grey, a small capitals label and a light\n * figure at its foot. The Impakt theme sets the G2 tile over it.\n */\nconst TILE = {\n padding: token('tile.padding', '12px 16px'),\n gap: token('tile.gap', '4px'),\n minHeight: token('tile.min-height', '84px'),\n align: token('tile.align', 'stretch'),\n edgeWidth: token('tile.edge-width', '0px'),\n radius: token('tile.radius', '8px'),\n fill: token('tile.fill', '0%'),\n hover: token('tile.hover', '5%'),\n labelFont: token('tile.label.font', 'var(--impakt-font-family-body, system-ui, sans-serif)'),\n labelSize: token('tile.label.size', '11px'),\n labelWeight: token('tile.label.weight', '500'),\n labelTracking: token('tile.label.tracking', '0.06em'),\n labelTransform: token('tile.label.transform', 'uppercase'),\n valueSize: token('tile.value.size', '34px'),\n /** 1 where the figure is the brand's stat text style, read where the tile is so a compact summary can set it smaller; 0 where it is `valueSize`. */\n valueStat: token('tile.value.stat', '0'),\n valueLineHeight: token('tile.value.line-height', '1.1'),\n valueTracking: token('tile.value.tracking', '0em'),\n valueWeight: token('tile.value.weight', '300'),\n valueSpace: token('tile.value.space', 'auto'),\n lgRadius: token('tile.lg.radius', '12px'),\n lgLabelSize: token('tile.lg.label.size', '0.875rem'),\n lgLabelTracking: token('tile.lg.label.tracking', '0em'),\n lgLabelTransform: token('tile.lg.label.transform', 'none'),\n captionLineHeight: token('tile.caption.line-height', '1.5'),\n};\n/** The figure's size: the stat text style, or the tile's own size, as `tile.value.stat` says. */\nconst TILE_VALUE = unsafeCSS(`calc(var(--impakt-type-stat-size, 3.25rem) * ${TILE.valueStat} + ${TILE.valueSize} * (1 - ${TILE.valueStat}))`);\n/** On a phone the stat style is 2.5rem; the tile's own size is kept. */\nconst TILE_VALUE_PHONE = unsafeCSS(`calc(2.5rem * ${TILE.valueStat} + ${TILE.valueSize} * (1 - ${TILE.valueStat}))`);\n/** The tile's fill: the card, the inset surface, or a mix, as much of the card as the brand says. */\nconst TILE_FILL = unsafeCSS(`color-mix(in srgb, ${t.surfaceCard} ${TILE.fill}, ${t.surfaceInset})`);\n\n/** The light weight large numbers are set in, 300 when the theme does not say. */\nconst LIGHT = token('font.weight.light', '300');\n\n/**\n * A count with its name: \"UK 4\", \"Active import jobs 12\". A dashboard shows a\n * row of them.\n *\n * **The name comes before the number in the reading order.** A screen reader\n * says \"UK, 4\", which makes sense heard on its own; \"4, UK\" does not. With\n * `href` the whole tile is one link, named by the label, the value and the\n * caption together.\n *\n * **It is the G2 summary tile** (frames 33:451, 36:473, 37:469, 39:770): white,\n * a 1px ink border, the label in the code face, the figure large and tight\n * (a word works as the figure too, such as \"First audit\"), the note under it,\n * and under the note an optional status pill, such as \"All proven\". The\n * status is words, so it does not rest on its dot's colour.\n *\n * @category content\n * @icon badge\n */\nexport class ImpaktStatTile extends ImpaktElement {\n static properties = {\n label: { type: String },\n value: { type: String },\n caption: { type: String },\n href: { type: String },\n tone: { type: String, reflect: true },\n size: { type: String, reflect: true },\n status: { type: String },\n statusTone: { type: String, attribute: 'status-tone' },\n };\n /** What is counted, such as \"UK\" or \"Active import jobs\". */\n declare label: string;\n /** The count or figure, such as \"4\". */\n declare value: string;\n /** A line under the figure, such as \"3 arriving in the next two weeks\". */\n declare caption: string;\n /** Where the tile goes when it is pressed, such as the list it counts. */\n declare href: string;\n /** `plain` is a quiet tile on a card; `brand` is the one figure a screen leads with. */\n declare tone: 'plain' | 'brand';\n /** `lg` sets the figure larger, for the lead figure. */\n declare size: 'md' | 'lg';\n /** A status under the note, drawn as a pill, such as \"All proven\". */\n declare status: string;\n /** The status's tone. */\n declare statusTone: StatusTone;\n\n constructor() {\n super();\n this.label = '';\n this.value = '';\n this.caption = '';\n this.href = '';\n this.tone = 'plain';\n this.size = 'md';\n this.status = '';\n this.statusTone = 'neutral';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n statusPillStyles,\n css`\n :host { display: block; }\n .tile {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: ${TILE.align};\n gap: ${TILE.gap};\n block-size: 100%;\n min-block-size: ${TILE.minHeight};\n padding: ${TILE.padding};\n border: ${TILE.edgeWidth} solid ${t.text};\n border-radius: ${TILE.radius};\n background: ${TILE_FILL};\n color: ${t.text};\n text-decoration: none;\n }\n a.tile:hover { background: color-mix(in srgb, ${TILE_FILL}, ${t.text} ${TILE.hover}); }\n .label { font-family: ${TILE.labelFont}; font-size: ${TILE.labelSize}; font-weight: ${TILE.labelWeight}; letter-spacing: ${TILE.labelTracking}; text-transform: ${TILE.labelTransform}; color: ${t.textMuted}; }\n /* The figure: light at 34px where the brand derives it, or under Noire (G2) Archivo SemiBold 52/1.04, -4%. A word fits as well as a number. */\n .value { margin-block-start: ${TILE.valueSpace}; font-size: ${TILE_VALUE}; line-height: ${TILE.valueLineHeight}; letter-spacing: ${TILE.valueTracking}; font-weight: ${TILE.valueWeight}; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }\n .caption { font-size: ${fontSize('sm')}; line-height: ${TILE.captionLineHeight}; color: ${t.textMuted}; }\n :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; border-radius: ${TILE.lgRadius}; }\n :host([size='lg']) .label { font-size: ${TILE.lgLabelSize}; letter-spacing: ${TILE.lgLabelTracking}; text-transform: ${TILE.lgLabelTransform}; }\n :host([size='lg']) .value { margin-block-start: auto; font-size: 64px; line-height: 1; font-weight: ${LIGHT}; }\n :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; border-color: ${t.brand}; }\n :host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }\n :host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }\n @media (max-width: 40rem) { .value { font-size: ${TILE_VALUE_PHONE}; } }\n @media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n const inner = html`\n <span class=\"label\" part=\"label\">${this.label}</span>\n <span class=\"value\" part=\"value\">${this.value}</span>\n ${this.caption ? html`<span class=\"caption\" part=\"caption\">${this.caption}</span>` : nothing}\n ${statusPill(this.status, this.statusTone)}\n `;\n return this.href ? html`<a class=\"tile\" href=${this.href} part=\"tile\">${inner}</a>` : html`<div class=\"tile\" part=\"tile\">${inner}</div>`;\n }\n}\n\n/**\n * A date as a small block of month and day: \"DEC 2\". It sits at the start of a\n * row, beside what happens on that date.\n *\n * **The full date is what a screen reader hears.** The short month and day are\n * hidden from it, and the date is read in full in the page's language, such as\n * \"2 December 2026\", because \"DEC 2\" said aloud is ambiguous.\n *\n * @category content\n * @icon calendar\n */\nexport class ImpaktDateTile extends ImpaktElement {\n static properties = {\n date: { type: String },\n tone: { type: String, reflect: true },\n };\n /** The date, as YYYY-MM-DD. */\n declare date: string;\n /** `brand` is filled with the brand colour; `plain` is a quiet tile. */\n declare tone: 'brand' | 'plain';\n\n constructor() {\n super();\n this.date = '';\n this.tone = 'brand';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: inline-block; flex: none; }\n time {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: 48px;\n block-size: 52px;\n border-radius: ${t.radiusLg};\n background: ${t.brand};\n color: ${t.onBrand};\n line-height: 1;\n }\n :host([tone='plain']) time { background: ${t.surfaceInset}; color: ${t.text}; }\n .month { font-size: 10px; font-weight: ${fontWeight('medium')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .day { margin-block-start: ${space(1)}; font-size: 20px; font-weight: ${fontWeight('medium')}; font-variant-numeric: tabular-nums; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { time { border: 1px solid CanvasText; } }\n `,\n ];\n\n private parts(): { month: string; day: string; full: string } | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(this.date ?? '');\n if (!match) return null;\n // Noon UTC, so no time zone moves the date to the day before or after.\n const when = new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), 12));\n if (Number.isNaN(when.getTime())) return null;\n const locale = pageLocale(this);\n const say = (options: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { ...options, timeZone: 'UTC' }).format(when);\n return { month: say({ month: 'short' }).replace('.', ''), day: say({ day: 'numeric' }), full: say({ day: 'numeric', month: 'long', year: 'numeric' }) };\n }\n\n render(): TemplateResult {\n const parts = this.parts();\n if (!parts) return html`${nothing}`;\n return html`<time datetime=${this.date} part=\"tile\">\n <span class=\"month\" aria-hidden=\"true\">${parts.month}</span>\n <span class=\"day\" aria-hidden=\"true\">${parts.day}</span>\n <span class=\"sr-only\">${parts.full}</span>\n </time>`;\n }\n}\n\n/**\n * One line in a list: a title, a line of detail under it, and room at the\n * start and the end. It is the task with its tick, the job that needs\n * attention, the delivery with its date, the setting with its arrow.\n *\n * **With `href` the whole row is one target, without nesting controls in a\n * link.** The title is the link, and it is stretched over the row, so the row\n * can be pressed anywhere. Anything in the `end` slot, such as a button, sits\n * above the stretched link and stays its own control, because a button inside\n * a link is two controls a screen reader cannot tell apart (4.1.2).\n *\n * A chevron is drawn at the end of a row that is a link, as the sign that it\n * goes somewhere. Put rows in an element with `role=\"list\"` and give each\n * `role=\"listitem\"` when they are a list, so a screen reader says how many\n * there are.\n *\n * @category content\n * @icon list\n * @slot start - Before the title: a dot, a date tile, a checkbox.\n * @slot end - After the title: a badge, a button.\n */\nexport class ImpaktRow extends ImpaktElement {\n static properties = {\n heading: { type: String },\n meta: { type: String },\n href: { type: String },\n divided: { type: Boolean, reflect: true },\n muted: { type: Boolean, reflect: true },\n selected: { type: Boolean, reflect: true },\n };\n /** The row's title. */\n declare heading: string;\n /** The line of detail under the title, such as \"CY-2026-00421 · Due 20 Nov 2026\". */\n declare meta: string;\n /** Where the row goes when it is pressed. */\n declare href: string;\n /** Draw a hairline above the row, for rows stacked on a card. */\n declare divided: boolean;\n /** Set the title quieter, for something finished, such as a done task. */\n declare muted: boolean;\n /**\n * The row being shown, such as the open case in a list beside it: an ink\n * fill with the words turned over (the paper in dark), and `aria-current`\n * on the row so it is not said by colour alone (frame 37:656).\n */\n declare selected: boolean;\n\n constructor() {\n super();\n this.selected = false;\n this.heading = '';\n this.meta = '';\n this.href = '';\n this.divided = false;\n this.muted = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host { display: block; }\n :host([divided]) .row { border-block-start: ${t.borderThin} solid ${t.hairline}; }\n .row { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block: ${space(3)}; }\n .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(0.5)}; }\n .title { font-size: ${fontSize('md')}; font-weight: ${fontWeight('medium')}; color: ${t.text}; }\n :host([muted]) .title { color: ${t.textMuted}; font-weight: ${fontWeight('regular')}; }\n /* The meta is a label: the code face where the brand sets its labels in one, as G2 does (36:452, 37:646). */\n .meta { font-family: ${t.fontEyebrow}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n a { color: inherit; text-decoration: none; }\n /* The link is stretched over the row, so the row is one target. */\n a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }\n a:focus-visible { outline: none; }\n a:focus-visible::after { box-shadow: ${t.focusShadow}; }\n .row:has(a):hover .title { text-decoration: underline; text-underline-offset: 0.2em; }\n .start, .end { flex: none; display: flex; align-items: center; gap: ${space(2)}; }\n .start.empty, .end.empty { display: none; }\n /* Controls at the end stay pressable above the stretched link. */\n .end { position: relative; z-index: 1; }\n .chevron { flex: none; color: ${t.textMuted}; }\n :host([selected]) .row { padding-inline: ${space(4)}; background: ${t.text}; --impakt-color-text-default: ${INVERSE}; --impakt-color-text-muted: color-mix(in srgb, ${INVERSE} 72%, ${t.text}); --impakt-color-text-inverse: ${t.text}; }\n :host([selected]) :is(.title, .meta, .chevron) { color: ${INVERSE}; }\n :host([selected]) .meta, :host([selected]) .chevron { color: color-mix(in srgb, ${INVERSE} 72%, ${t.text}); }\n @media (forced-colors: active) { :host([selected]) .row { outline: 2px solid Highlight; } }\n `,\n ];\n\n private filled = { start: false, end: false };\n\n private onSlot(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const name = slot.name as 'start' | 'end';\n this.filled = {\n ...this.filled,\n [name]: slot.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim() !== ''),\n };\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const title = this.href\n ? html`<a class=\"title\" href=${this.href} part=\"link\">${this.heading}</a>`\n : html`<span class=\"title\" part=\"title\">${this.heading}</span>`;\n return html`<div class=\"row\" part=\"row\" aria-current=${this.selected ? 'true' : nothing}>\n <div class=\"start ${this.filled.start ? '' : 'empty'}\"><slot name=\"start\" @slotchange=${this.onSlot}></slot></div>\n <div class=\"text\">${title}${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}</div>\n <div class=\"end ${this.filled.end ? '' : 'empty'}\"><slot name=\"end\" @slotchange=${this.onSlot}></slot></div>\n ${this.href && !this.selected ? html`<span class=\"chevron\" aria-hidden=\"true\">${iconSvg('chevron-right', '20px')}</span>` : nothing}\n </div>`;\n }\n}\n\n/**\n * A pressable filter: \"UK 4\", \"Completed 27\". A row of them narrows a list.\n *\n * **It is a toggle button.** It carries `aria-pressed`, so a screen reader says\n * whether the filter is on, and it is filled when it is on, so that does not\n * rest on colour alone (1.4.1). When only one filter in a row can be on, the\n * app turns the others off when it hears `impakt-change`.\n *\n * The count is read with the label. Set `count-label` when the number needs its\n * noun to make sense aloud, such as \"4 jobs\".\n *\n * @category action\n * @icon badge\n * @fires {CustomEvent<{ pressed: boolean }>} impakt-change - When the filter is turned on or off.\n */\nexport class ImpaktFilterChip extends ImpaktElement {\n static properties = {\n label: { type: String },\n count: { type: Number },\n countLabel: { type: String, attribute: 'count-label' },\n pressed: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n };\n declare label: string;\n /** How many things the filter would show. Left out when not set. */\n declare count: number | undefined;\n /** The count in words for a screen reader, such as \"4 jobs\". The number alone when empty. */\n declare countLabel: string;\n declare pressed: boolean;\n declare disabled: boolean;\n\n constructor() {\n super();\n this.label = '';\n this.count = undefined;\n this.countLabel = '';\n this.pressed = false;\n this.disabled = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('button'),\n css`\n :host { display: inline-block; }\n /* The containing block for the words kept for screen readers, so a control scrolled out of a row cannot widen the page. */\n button {\n ${targetSize}\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: ${space(2)};\n /* 36px with a hairline edge and medium words, or under Noire 35px with an ink edge (filter-chip.* tokens). */\n min-block-size: ${token('filter-chip.height', '36px')};\n padding: 0 ${space(3.5)};\n font: inherit;\n font-size: ${fontSize('sm')};\n font-weight: ${token('filter-chip.weight', '500')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid color-mix(in srgb, ${t.text} ${token('filter-chip.edge', '10%')}, transparent);\n border-radius: var(--impakt-radius-pill, calc(${t.radius} * 9999));\n cursor: pointer;\n white-space: nowrap;\n }\n button:hover:not(:disabled) { background: ${t.surfaceInset}; }\n button[aria-pressed='true'] { background: ${t.text}; color: ${INVERSE}; border-color: ${t.text}; }\n button:disabled { cursor: not-allowed; opacity: 0.5; }\n .count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }\n button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { button[aria-pressed='true'] { border: 2px solid Highlight; } }\n `,\n ];\n\n private toggle(): void {\n if (this.disabled) return;\n this.pressed = !this.pressed;\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: { pressed: this.pressed }, bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const hasCount = typeof this.count === 'number' && !Number.isNaN(this.count);\n return html`<button type=\"button\" part=\"button\" aria-pressed=${this.pressed ? 'true' : 'false'} ?disabled=${this.disabled} @click=${this.toggle}>\n <span>${this.label}</span>\n ${\n hasCount\n ? this.countLabel\n ? html`<span class=\"count\" aria-hidden=\"true\">${this.count}</span><span class=\"sr-only\">${this.countLabel}</span>`\n : html`<span class=\"count\">${this.count}</span>`\n : nothing\n }\n </button>`;\n }\n}\n\ncustomElements.define('impakt-stat-tile', ImpaktStatTile);\ncustomElements.define('impakt-date-tile', ImpaktDateTile);\ncustomElements.define('impakt-row', ImpaktRow);\ncustomElements.define('impakt-filter-chip', ImpaktFilterChip);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-stat-tile': ImpaktStatTile;\n 'impakt-date-tile': ImpaktDateTile;\n 'impakt-row': ImpaktRow;\n 'impakt-filter-chip': ImpaktFilterChip;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,SAAS,iBAAsC;AASnE,IAAM,UAAU,MAAM,sBAAsB,qEAAqE;AAOjH,IAAM,OAAO;AAAA,EACX,SAAS,MAAM,gBAAgB,WAAW;AAAA,EAC1C,KAAK,MAAM,YAAY,KAAK;AAAA,EAC5B,WAAW,MAAM,mBAAmB,MAAM;AAAA,EAC1C,OAAO,MAAM,cAAc,SAAS;AAAA,EACpC,WAAW,MAAM,mBAAmB,KAAK;AAAA,EACzC,QAAQ,MAAM,eAAe,KAAK;AAAA,EAClC,MAAM,MAAM,aAAa,IAAI;AAAA,EAC7B,OAAO,MAAM,cAAc,IAAI;AAAA,EAC/B,WAAW,MAAM,mBAA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CAAC;AAAA,sDAC7C,EAAE,MAAM;AAAA;AAAA;AAAA;AAAA,gDAId,EAAE,YAAY;AAAA,gDACd,EAAE,IAAI,YAAY,OAAO,mBAAmB,EAAE,IAAI;AAAA;AAAA,0DAExC,EAAE,SAAS;AAAA;AAAA,iBAEpD,cAAc;AAAA;AAAA;AAAA,IAG7B;AAAA;AAAA,EAEQ,SAAe;AACrB,QAAI,KAAK,SAAU;AACnB,SAAK,UAAU,CAAC,KAAK;AACrB,SAAK,cAAc,IAAI,YAAY,iBAAiB,EAAE,QAAQ,EAAE,SAAS,KAAK,QAAQ,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EAC3H;AAAA,EAEA,SAAyB;AACvB,UAAM,WAAW,OAAO,KAAK,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK,KAAK;AAC3E,WAAO,wDAAwD,KAAK,UAAU,SAAS,OAAO,cAAc,KAAK,QAAQ,WAAW,KAAK,MAAM;AAAA,cACrI,KAAK,KAAK;AAAA,QAEhB,WACI,KAAK,aACH,8CAA8C,KAAK,KAAK,gCAAgC,KAAK,UAAU,YACvG,2BAA2B,KAAK,KAAK,YACvC,OACN;AAAA;AAAA,EAEJ;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X57BTN6V.js";
|
|
4
4
|
import {
|
|
5
5
|
say
|
|
6
6
|
} from "./chunk-72WNCCDC.js";
|
|
@@ -137,4 +137,4 @@ customElements.define("impakt-date-input", ImpaktDateInput);
|
|
|
137
137
|
export {
|
|
138
138
|
ImpaktDateInput
|
|
139
139
|
};
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
140
|
+
//# sourceMappingURL=chunk-GIIJ32FN.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldElement
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X57BTN6V.js";
|
|
4
4
|
import {
|
|
5
5
|
targetSize
|
|
6
6
|
} from "./chunk-72WNCCDC.js";
|
|
@@ -138,4 +138,4 @@ customElements.define("impakt-radio-group", ImpaktRadioGroup);
|
|
|
138
138
|
export {
|
|
139
139
|
ImpaktRadioGroup
|
|
140
140
|
};
|
|
141
|
-
//# sourceMappingURL=chunk-
|
|
141
|
+
//# sourceMappingURL=chunk-H5HWJ2D4.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
FieldElement,
|
|
3
3
|
fieldControl,
|
|
4
4
|
fieldWidths
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-X57BTN6V.js";
|
|
6
6
|
import {
|
|
7
7
|
iconSvg
|
|
8
8
|
} from "./chunk-5OYQZWP2.js";
|
|
@@ -106,4 +106,4 @@ customElements.define("impakt-text-input", ImpaktTextInput);
|
|
|
106
106
|
export {
|
|
107
107
|
ImpaktTextInput
|
|
108
108
|
};
|
|
109
|
-
//# sourceMappingURL=chunk-
|
|
109
|
+
//# sourceMappingURL=chunk-JDKOHA3B.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-XX6JZW5N.js";
|
|
4
4
|
import {
|
|
5
5
|
FieldElement
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X57BTN6V.js";
|
|
7
7
|
import {
|
|
8
8
|
space,
|
|
9
9
|
t
|
|
@@ -45,7 +45,8 @@ var ImpaktChipGroup = class extends FieldElement {
|
|
|
45
45
|
}
|
|
46
46
|
:host([look='site']) legend {
|
|
47
47
|
font-family: ${t.fontMono};
|
|
48
|
-
|
|
48
|
+
/* G2 Mono S is 11px (20:1100); the ramp's 2xs is 12px, so the size is set here, as the text fields' site label is. */
|
|
49
|
+
font-size: 0.6875rem;
|
|
49
50
|
font-weight: ${kit.medium};
|
|
50
51
|
text-transform: uppercase;
|
|
51
52
|
letter-spacing: 0.06em;
|
|
@@ -54,7 +55,7 @@ var ImpaktChipGroup = class extends FieldElement {
|
|
|
54
55
|
.chips {
|
|
55
56
|
display: flex;
|
|
56
57
|
flex-wrap: wrap;
|
|
57
|
-
gap: ${space(1.5)};
|
|
58
|
+
gap: var(--impakt-chip-group-gap, ${space(1.5)});
|
|
58
59
|
}
|
|
59
60
|
.chip {
|
|
60
61
|
position: relative;
|
|
@@ -198,4 +199,4 @@ customElements.define("impakt-chip-group", ImpaktChipGroup);
|
|
|
198
199
|
export {
|
|
199
200
|
ImpaktChipGroup
|
|
200
201
|
};
|
|
201
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-JX5RJRME.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/chip-group.ts"],"sourcesContent":["/**\n * A choice made with square chips: one, or several.\n */\nimport { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement } from '../base/FieldElement';\nimport { space, t } from '../base/tokens';\nimport { kit } from './tool-kit-tokens';\n\nexport interface ChipOption {\n value: string;\n label: string;\n}\n\n/**\n * A short choice drawn as a row of square chips, such as \"What do you need\"\n * or \"Budget\" on a brief form, or the answers in an estimator.\n *\n * **Under each chip is a native control.** A single choice is a set of radios\n * and several is a set of checkboxes, so a single choice has the arrow keys,\n * Home and End and the right announcement without any script, and each\n * checkbox is its own tab stop, as it should be. The control lies over its\n * chip, invisible, so the whole chip is what is pressed and a screen reader\n * exploring by touch finds it where it is drawn.\n *\n * The question is a `legend` in a `fieldset`, because it is asked of the set.\n * `look=\"site\"` draws it in the site's form style: mono, uppercase, 11px.\n *\n * It joins its form like the other fields. A single choice submits its value;\n * several submit their values joined with commas, in the options' order.\n * `required` with nothing chosen makes the form invalid.\n *\n * Figma: site brief form `20:1157`; estimator `10:547`, `10:557`; mobile `15:945`.\n *\n * @category form\n * @icon checkbox\n * @csspart chip - Each chip.\n * @csspart fieldset - The fieldset.\n * @cssprop --impakt-chip-group-gap - The space between the chips, 6px unless set; the estimator sets 8px, as its frame does (`10:547`).\n */\nexport class ImpaktChipGroup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n options: { type: Array },\n values: { type: Array },\n multiple: { type: Boolean, reflect: true },\n look: { type: String, reflect: true },\n missingText: { type: String, attribute: 'missing-text' },\n };\n\n declare options: ChipOption[];\n /** What is chosen when `multiple` is set. */\n declare values: string[];\n /** Choose several, as checkboxes, rather than one, as radios. */\n declare multiple: boolean;\n /** `default` takes the product's field label; `site` is the mono uppercase label of the site's forms. */\n declare look: 'default' | 'site';\n /** What the browser says when a required choice is missing. */\n declare missingText: string;\n\n constructor() {\n super();\n this.options = [];\n this.values = [];\n this.multiple = false;\n this.look = 'default';\n this.missingText = 'Choose an option';\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 :host([look='site']) legend {\n font-family: ${t.fontMono};\n /* G2 Mono S is 11px (20:1100); the ramp's 2xs is 12px, so the size is set here, as the text fields' site label is. */\n font-size: 0.6875rem;\n font-weight: ${kit.medium};\n text-transform: uppercase;\n letter-spacing: 0.06em;\n margin-block-end: ${space(2)};\n }\n .chips {\n display: flex;\n flex-wrap: wrap;\n gap: var(--impakt-chip-group-gap, ${space(1.5)});\n }\n .chip {\n position: relative;\n display: inline-flex;\n align-items: center;\n min-block-size: 35px;\n padding: 0 ${space(3)};\n font-family: ${t.fontBody};\n font-size: ${kit.small};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: 1px solid ${t.text};\n border-radius: 0;\n cursor: pointer;\n }\n .chip input {\n position: absolute;\n inset: 0;\n inline-size: 100%;\n block-size: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n }\n .chip:hover {\n background: ${t.surfaceSubtle};\n }\n .chip.on {\n color: ${kit.onInverse};\n background: ${kit.inverse};\n }\n .chip:has(input:focus-visible) {\n outline: 2px solid transparent;\n outline-offset: ${t.focusOffset};\n box-shadow: ${t.focusShadow};\n }\n :host([disabled]) .chip {\n opacity: 0.6;\n cursor: not-allowed;\n }\n :host([invalid]) .chip {\n border-color: ${t.danger};\n }\n @media (pointer: coarse) {\n .chip {\n min-block-size: 44px;\n }\n }\n @media (forced-colors: active) {\n .chip {\n border-color: ButtonText;\n }\n .chip.on {\n forced-color-adjust: none;\n color: HighlightText;\n background: Highlight;\n border-color: Highlight;\n }\n .chip:has(input:focus-visible) {\n outline-color: Highlight;\n }\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 private chosen(value: string): boolean {\n return this.multiple ? this.values.includes(value) : this.value === value;\n }\n\n private choose(value: string, checked: boolean): void {\n if (this.multiple) {\n const next = checked ? [...this.values, value] : this.values.filter((v) => v !== value);\n this.values = this.options.filter((o) => next.includes(o.value)).map((o) => o.value);\n this.setFormValue(this.values.join(','));\n } else this.setFormValue(value);\n this.syncValidity();\n }\n\n private syncValidity(): void {\n const empty = this.multiple ? this.values.length === 0 : !this.value;\n try {\n if (this.required && empty) {\n const anchor = this.renderRoot?.querySelector?.('input') ?? undefined;\n this.internals?.setValidity({ valueMissing: true }, this.missingText, anchor as HTMLElement | undefined);\n } else this.internals?.setValidity({});\n } catch {\n // An engine without ElementInternals validity still has a working control.\n }\n }\n\n protected renderControl(): TemplateResult {\n const type = this.multiple ? 'checkbox' : 'radio';\n return html`<div class=\"chips\">\n ${this.options.map((option, i) => {\n const on = this.chosen(option.value);\n return html`<label class=\"chip ${on ? 'on' : ''}\" part=\"chip\">\n <input\n type=${type}\n id=${i === 0 ? this.controlId : this.id_(`opt-${i}`)}\n name=${this.uid}\n value=${option.value}\n .checked=${on}\n ?disabled=${this.disabled}\n ?required=${!this.multiple && this.required && i === 0}\n @change=${(e: Event) => this.choose(option.value, (e.target as HTMLInputElement).checked)}\n /><span>${option.label}</span>\n </label>`;\n })}\n </div>`;\n }\n\n render(): TemplateResult {\n return html`\n <fieldset part=\"fieldset\" aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}>\n ${this.renderLabel()}\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">${this.description}</div>` : nothing}\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">${this.error || nothing}</div>\n </fieldset>\n `;\n }\n\n firstUpdated(): void {\n const initial = this.multiple ? this.values.join(',') : this.value;\n this.internals?.setFormValue(initial || null);\n this.syncValidity();\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n if (changed.has('required') || changed.has('multiple')) this.syncValidity();\n }\n\n /** A form reset clears the choice. */\n formResetCallback(): void {\n this.value = '';\n this.values = [];\n this.internals?.setFormValue(null);\n this.syncValidity();\n }\n}\n\ncustomElements.define('impakt-chip-group', ImpaktChipGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-chip-group': ImpaktChipGroup;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,MAAM,KAAK,eAAoC;AAoCjD,IAAM,kBAAN,cAA8B,aAAa;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,SAAS,EAAE,MAAM,MAAM;AAAA,MACvB,QAAQ,EAAE,MAAM,MAAM;AAAA,MACtB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,aAAa,EAAE,MAAM,QAAQ,WAAW,eAAe;AAAA,IACzD;AAAA;AAAA,EAYA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU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,OAAO,OAAQ,EAAE,OAA4B,OAAO,CAAC;AAAA,oBACjF,OAAO,KAAK;AAAA;AAAA,IAE1B,CAAC,CAAC;AAAA;AAAA,EAEN;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,mDACwC,KAAK,WAAW,iBAAiB,KAAK,QAAQ,SAAS,OAAO;AAAA,UACvG,KAAK,YAAY,CAAC;AAAA,UAClB,KAAK,cAAc,mCAAmC,KAAK,IAAI,aAAa,CAAC,uBAAuB,KAAK,WAAW,WAAW,OAAO;AAAA,UACtI,KAAK,cAAc,CAAC;AAAA,gCACE,KAAK,IAAI,OAAO,CAAC,oCAAoC,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAGxG;AAAA,EAEA,eAAqB;AACnB,UAAM,UAAU,KAAK,WAAW,KAAK,OAAO,KAAK,GAAG,IAAI,KAAK;AAC7D,SAAK,WAAW,aAAa,WAAW,IAAI;AAC5C,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAC7E,QAAI,QAAQ,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,EAAG,MAAK,aAAa;AAAA,EAC5E;AAAA;AAAA,EAGA,oBAA0B;AACxB,SAAK,QAAQ;AACb,SAAK,SAAS,CAAC;AACf,SAAK,WAAW,aAAa,IAAI;AACjC,SAAK,aAAa;AAAA,EACpB;AACF;AAEA,eAAe,OAAO,qBAAqB,eAAe;","names":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
F,
|
|
2
3
|
FieldElement,
|
|
3
4
|
fieldControl,
|
|
4
5
|
fieldWidths
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X57BTN6V.js";
|
|
6
7
|
|
|
7
8
|
// packages/ui/src/components/textarea.ts
|
|
8
9
|
import { html, css, nothing } from "lit";
|
|
@@ -35,9 +36,13 @@ var ImpaktTextarea = class extends FieldElement {
|
|
|
35
36
|
fieldControl("textarea"),
|
|
36
37
|
css`
|
|
37
38
|
textarea {
|
|
38
|
-
/*
|
|
39
|
-
can be made bigger, and a fixed box is where that stops working.
|
|
40
|
-
|
|
39
|
+
/* Every brand but Impakt keeps the resize grip: 1.4.4 and 1.4.12 both assume text
|
|
40
|
+
can be made bigger, and a fixed box is where that stops working. The G2 textarea
|
|
41
|
+
(20:1100) draws no grip, so under Impakt the box grows with its words instead
|
|
42
|
+
(field.resize and field.sizing), never shorter than its rows (#66). */
|
|
43
|
+
resize: var(--impakt-field-resize, vertical);
|
|
44
|
+
field-sizing: var(--impakt-field-sizing, fixed);
|
|
45
|
+
min-block-size: calc(var(--impakt-textarea-rows, 4) * 1lh + 2 * ${F.paddingBlock} + 2px);
|
|
41
46
|
}
|
|
42
47
|
`
|
|
43
48
|
];
|
|
@@ -70,6 +75,7 @@ var ImpaktTextarea = class extends FieldElement {
|
|
|
70
75
|
part="textarea"
|
|
71
76
|
name=${this.name || nothing}
|
|
72
77
|
rows=${this.rows}
|
|
78
|
+
style=${`--impakt-textarea-rows: ${this.rows}`}
|
|
73
79
|
maxlength=${this.maxlength ?? nothing}
|
|
74
80
|
placeholder=${this.placeholder || nothing}
|
|
75
81
|
?disabled=${this.disabled}
|
|
@@ -95,4 +101,4 @@ customElements.define("impakt-textarea", ImpaktTextarea);
|
|
|
95
101
|
export {
|
|
96
102
|
ImpaktTextarea
|
|
97
103
|
};
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
104
|
+
//# sourceMappingURL=chunk-KDU2POFS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/textarea.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { F, FieldElement, fieldControl, fieldWidths } from '../base/FieldElement';\n\n/** Several lines of text — a delivery instruction, an additional note.\n *\n * @category form\n * @icon field\n */\nexport class ImpaktTextarea extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n rows: { type: Number },\n maxlength: { type: Number },\n fillFrom: { type: String, attribute: 'fill-from' },\n placeholder: { type: String },\n };\n\n declare rows: number;\n declare maxlength: number | undefined;\n /** `estimate` starts an empty box with the estimate a cost estimator sent on, so the visitor can edit it. */\n declare fillFrom: 'none' | 'estimate';\n /** An example of what to write. The label is still the field's name; a placeholder never replaces it. */\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.rows = 4;\n this.maxlength = undefined;\n this.fillFrom = 'none';\n this.placeholder = '';\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n fieldControl('textarea'),\n css`\n textarea {\n /* Every brand but Impakt keeps the resize grip: 1.4.4 and 1.4.12 both assume text\n can be made bigger, and a fixed box is where that stops working. The G2 textarea\n (20:1100) draws no grip, so under Impakt the box grows with its words instead\n (field.resize and field.sizing), never shorter than its rows (#66). */\n resize: var(--impakt-field-resize, vertical);\n field-sizing: var(--impakt-field-sizing, fixed);\n min-block-size: calc(var(--impakt-textarea-rows, 4) * 1lh + 2 * ${F.paddingBlock} + 2px);\n }\n `,\n ];\n\n private filled = false;\n /** The estimate it was filled with, kept until the visitor edits it, so a binding that has not caught up yet cannot empty the box. */\n private filledText = '';\n\n /** @ignore */\n protected willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate?.(changed as never);\n if (this.filledText && changed.has('value') && !this.value) this.value = this.filledText;\n }\n\n /** Fills the box once, when it is first asked to and is still empty. Props can arrive after the element joins the page. */\n private fill(): void {\n if (this.filled || this.fillFrom !== 'estimate') return;\n this.filled = true;\n if (this.value) return;\n let saved: string | null = null;\n try {\n saved = sessionStorage.getItem('impakt.estimate');\n } catch {\n saved = null;\n }\n if (saved) {\n this.filledText = saved;\n this.setFormValue(saved);\n }\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <textarea\n id=${this.controlId}\n part=\"textarea\"\n name=${this.name || nothing}\n rows=${this.rows}\n style=${`--impakt-textarea-rows: ${this.rows}`}\n maxlength=${this.maxlength ?? nothing}\n placeholder=${this.placeholder || nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n .value=${this.value}\n @input=${(e: Event) => {\n this.filledText = '';\n this.setFormValue((e.target as HTMLTextAreaElement).value);\n }}\n ></textarea>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n this.fill();\n }\n}\n\ncustomElements.define('impakt-textarea', ImpaktTextarea);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-textarea': ImpaktTextarea;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAQjD,IAAM,iBAAN,cAA6B,aAAa;AAAA,EAoB/C,cAAc;AACZ,UAAM;AAyBR,SAAQ,SAAS;AAEjB;AAAA,SAAQ,aAAa;AA1BnB,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AAAA,EA1BA;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,WAAW,EAAE,MAAM,OAAO;AAAA,MAC1B,UAAU,EAAE,MAAM,QAAQ,WAAW,YAAY;AAAA,MACjD,aAAa,EAAE,MAAM,OAAO;AAAA,IAC9B;AAAA;AAAA,EAqBA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA,aAAa,UAAU;AAAA,MACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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10 @@ import {
|
|
|
17
17
|
|
|
18
18
|
// packages/ui/src/components/navigation.ts
|
|
19
19
|
import { css, html, nothing } from "lit";
|
|
20
|
+
function linkCurrent(href, current = "") {
|
|
21
|
+
if (current) return href === current ? "page" : null;
|
|
22
|
+
return where(href);
|
|
23
|
+
}
|
|
20
24
|
function where(href) {
|
|
21
25
|
if (typeof location === "undefined" || !href || href.startsWith("#")) return null;
|
|
22
26
|
let path;
|
|
@@ -271,7 +275,8 @@ customElements.define("impakt-nav", ImpaktNav);
|
|
|
271
275
|
customElements.define("impakt-breadcrumbs", ImpaktBreadcrumbs);
|
|
272
276
|
|
|
273
277
|
export {
|
|
278
|
+
linkCurrent,
|
|
274
279
|
ImpaktNav,
|
|
275
280
|
ImpaktBreadcrumbs
|
|
276
281
|
};
|
|
277
|
-
//# sourceMappingURL=chunk-
|
|
282
|
+
//# sourceMappingURL=chunk-NCVBRUJM.js.map
|