@atomic-ui/ui 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +112 -0
- package/dist/{chunk-BGHAANTP.js → chunk-5OCDXZXG.js} +3 -2
- package/dist/chunk-5OCDXZXG.js.map +1 -0
- package/dist/{chunk-MGDX7Z74.js → chunk-EIWICFXL.js} +4 -3
- package/dist/chunk-EIWICFXL.js.map +1 -0
- package/dist/{chunk-SY7NTW3U.js → chunk-NZSKUEYS.js} +17 -9
- package/dist/chunk-NZSKUEYS.js.map +1 -0
- package/dist/{chunk-UBNCJROR.js → chunk-SRXC6ZPM.js} +11 -5
- package/dist/chunk-SRXC6ZPM.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 +22 -0
- package/dist/components/app-bar.js +2 -2
- package/dist/components/app-ui.d.ts +8 -0
- package/dist/components/app-ui.js +1 -1
- package/dist/components/chip.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/rows.js +1 -1
- package/dist/index.js +5 -5
- package/dist/standalone/atomic-ui.js +100 -94
- 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-MGDX7Z74.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomic-ui/ui",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "The Impakt component library: standard custom elements, styled only from design tokens, built to WCAG 2.2 AA.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"lit": "^3.3.3",
|
|
38
|
-
"@atomic-ui/design-tokens": "^0.13.
|
|
38
|
+
"@atomic-ui/design-tokens": "^0.13.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
@@ -1 +0,0 @@
|
|
|
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 :host([look='outlined']) span.chip { border: ${t.borderThin} solid ${t.text}; background: ${t.surfaceCard}; }\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(--impakt-color-chart-${tone}, ${TONE[CYCLE[(tone - 1) % CYCLE.length]!]})`;\n if (tone && tone in TONE) return TONE[tone];\n return `var(--impakt-color-chart-${(i % 5) + 1}, ${TONE[CYCLE[i % CYCLE.length]!]})`;\n};\n"],"mappings":";;;;;;;;;;;;;AAIA,SAAS,KAAK,MAAM,eAAoC;;;ACSjD,IAAM,OAAkC;AAAA,EAC7C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAEO,IAAM,QAAqB,CAAC,WAAW,QAAQ,WAAW,UAAU,UAAU,OAAO;AAKrF,IAAM,SAAS,CAAC,MAAwB,MAAsB;AACnE,MAAI,OAAO,SAAS,SAAU,QAAO,4BAA4B,IAAI,KAAK,KAAK,OAAO,OAAO,KAAK,MAAM,MAAM,CAAE,CAAC;AACjH,MAAI,QAAQ,QAAQ,KAAM,QAAO,KAAK,IAAI;AAC1C,SAAO,4BAA6B,IAAI,IAAK,CAAC,KAAK,KAAK,MAAM,IAAI,MAAM,MAAM,CAAE,CAAC;AACnF;;;ADpBA,IAAM,OAAO,EAAE;AASR,IAAM,aAAN,cAAyB,cAAc;AAAA,EAC5C;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,OAAO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iCAC7D,KAAK,SAAS,WACZ,oQACA;AACR,WAAO,4CAA4C,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,EAAE,IAAI,IAAI,uBAAuB,KAAK,KAAK,UAAU,KAAK,OAAO,2BAA2B,KAAK,IAAI,YAAY,OAAO;AAAA,EAC3M;AACF;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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};\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: 1.45; 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,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AC;AAAA;AAAA,mBAEV,SAAS,IAAI,CAAC;AAAA,qBACZ,MAAM,sBAAsB,KAAK,CAAC;AAAA,eACxC,EAAE,IAAI;AAAA,oBACD,EAAE,WAAW;AAAA,gBACjB,EAAE,UAAU,6BAA6B,EAAE,IAAI,IAAI,MAAM,oBAAoB,KAAK,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/dialog.ts"],"sourcesContent":["import { html, css, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget } from '../base/styles';\nimport { lockScroll, unlockScroll } from '../base/scroll-lock';\nimport { fontSize, space, t, token } from '../base/tokens';\n\n/**\n * The dialog's shape, from the brand (`dialog.*` in `@atomic-ui/design-tokens`). Each fallback is\n * the dialog every brand derives: no edge, a lifted shadow, the page dimmed and blurred behind and\n * a bold heading, with 20px round its content. The Impakt theme sets the G2 dialog over it.\n */\nconst D = {\n edgeWidth: token('dialog.edge-width', '0px'),\n backdrop: token('dialog.backdrop', 'color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 30%, transparent)'),\n backdropBlur: token('dialog.backdrop-blur', '2px'),\n padding: token('dialog.padding', '20px'),\n /** On a phone the dialog keeps no more than 20px round its content. */\n phonePadding: unsafeCSS(`min(${token('dialog.padding', '20px')}, 20px)`),\n headingSize: token('dialog.heading.size', '1.25rem'),\n headingLineHeight: token('dialog.heading.line-height', 'normal'),\n headingTracking: token('dialog.heading.tracking', '0em'),\n headingWeight: token('dialog.heading.weight', '700'),\n};\n\n/**\n * A modal dialog — \"are you sure you want to leave this order?\".\n *\n * **It is a native `<dialog>` opened with `showModal()`, and that is the whole\n * design.** The platform then provides, correctly and in every browser: a\n * focus trap, Escape to close, the rest of the page made inert so a screen\n * reader cannot wander out of the dialog, rendering in the top layer so no\n * `z-index` can cover it, and focus returned to whatever opened it when it\n * closes.\n *\n * Every one of those is a thing hand-rolled modals get wrong. The focus trap\n * is the famous one, but inertness is the worse failure: a dialog that traps\n * the Tab key but leaves the background in the accessibility tree lets a\n * screen-reader user read straight past it into a page they cannot interact\n * with, and nothing on screen tells them that is what happened.\n *\n * What is left to get right is the labelling. `aria-labelledby` points at the\n * dialog's own heading, so it is announced by name on open rather than as\n * \"dialog\".\n *\n * Two things the platform leaves out are added. The page behind does not scroll\n * while the dialog is open, so a finger on the backdrop does not move the page\n * out from under it. And with `phone-full-screen` the dialog fills a phone's\n * screen, which suits a dialog holding a form; a short question is better left\n * as a box in the middle, which is the default.\n\n *\n * @category feedback\n * @icon dialog\n * @fires {CustomEvent<null>} impakt-close - When the dialog is closed.\n * @slot - The body of the dialog.\n * @slot footer - The dialog's actions, set at the end of a row along its foot, such as \"Cancel\" and \"Send\".\n * @slot actions - The same as `footer`, for a page that names it so.\n */\nexport class ImpaktDialog extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n heading: { type: String },\n closeLabel: { type: String, attribute: 'close-label' },\n dismissible: { type: Boolean },\n phoneFullScreen: { type: Boolean, reflect: true, attribute: 'phone-full-screen' },\n size: { type: String, reflect: true },\n eyebrow: { type: String },\n };\n\n declare open: boolean;\n declare heading: string;\n declare closeLabel: string;\n /** When false, Escape and the backdrop do not close it — a decision must be made. */\n declare dismissible: boolean;\n /** Fill the screen on a phone, for a dialog that holds a form or a long text. */\n declare phoneFullScreen: boolean;\n /** `md` is a short question, 32rem wide. `lg` is 720px, for a dialog that holds a form or a review (G2 frame 45:653). */\n declare size: 'md' | 'lg';\n /** A short line above the heading in the code face, such as \"Step 2 of 3\". It is read before the heading but is not part of the dialog's name. */\n declare eyebrow: string;\n\n constructor() {\n super();\n this.open = false;\n this.heading = '';\n this.closeLabel = 'Close';\n this.dismissible = true;\n this.phoneFullScreen = false;\n this.size = 'md';\n this.eyebrow = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.close'),\n css`\n dialog {\n padding: 0;\n /* No edge and a lifted shadow, or under Noire an ink edge and no shadow (dialog.edge-width, shadow.dialog). */\n border: ${D.edgeWidth} solid ${t.text};\n border-radius: ${t.radius2xl};\n background: ${t.surfaceCard};\n color: ${t.text};\n box-shadow: var(--impakt-shadow-dialog, ${t.shadowXl}, 0 0 0 1px ${t.hairline});\n max-inline-size: min(32rem, calc(100vw - 2rem));\n /* 1.4.10 Reflow: a dialog taller than the viewport must scroll inside\n itself rather than clipping, at 320px and at 400% zoom alike. */\n max-block-size: calc(100vh - 2rem);\n overflow: auto;\n }\n /* The page behind, dimmed with the text colour and blurred, or under Noire the ink at half strength (dialog.backdrop). */\n dialog::backdrop {\n background: ${D.backdrop};\n backdrop-filter: blur(${D.backdropBlur});\n }\n :host([size='lg']) dialog {\n inline-size: 720px;\n max-inline-size: calc(100vw - 2rem);\n }\n .titles {\n display: flex;\n flex-direction: column;\n gap: ${space(2)};\n min-inline-size: 0;\n }\n .eyebrow {\n margin: 0;\n font-family: ${t.fontMono};\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n }\n .foot {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: ${space(3)};\n border-block-start: ${t.borderThin} solid var(--impakt-color-line-soft, #dcdcd8);\n }\n .foot.empty {\n display: none;\n }\n .head {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: ${space(3)};\n padding: ${D.padding} ${D.padding} 0;\n }\n /* The heading: bold in the xl size, or under Noire (G2) about 32px, semibold and tight (dialog.heading.*). */\n .heading {\n margin: 0;\n font-family: ${t.fontHeading};\n font-size: ${D.headingSize};\n line-height: ${D.headingLineHeight};\n letter-spacing: ${D.headingTracking};\n font-weight: ${D.headingWeight};\n color: ${t.textHeading};\n }\n .body {\n padding: ${space(4)} ${D.padding} ${D.padding};\n }\n .foot {\n padding: ${space(5)} ${D.padding};\n }\n @media (max-width: 40rem) {\n .heading { font-size: min(${D.headingSize}, 1.5rem); }\n .head { padding: ${D.phonePadding} ${D.phonePadding} 0; }\n .body { padding: ${space(4)} ${D.phonePadding} ${D.phonePadding}; }\n .foot { padding: ${space(4)} ${D.phonePadding}; }\n }\n @media (max-width: 40rem) {\n :host([phone-full-screen]) dialog {\n inline-size: 100vw;\n max-inline-size: 100vw;\n block-size: 100dvh;\n max-block-size: 100dvh;\n margin: 0;\n border-radius: 0;\n }\n }\n .close {\n ${targetSize}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n background: none;\n border: 0;\n border-radius: ${t.radius};\n font: inherit;\n font-size: ${fontSize('lg')};\n color: ${t.text};\n cursor: pointer;\n }\n `,\n ];\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n updated(changed: Map<string, unknown>): void {\n if (!changed.has('open')) return;\n const dialog = this.dialog;\n if (!dialog) return;\n // happy-dom and older engines do not implement showModal. Falling back to\n // the `open` attribute renders a NON-modal dialog — no focus trap, no\n // inert background — so it is used only to keep tests and ancient browsers\n // from throwing, never as an equivalent.\n if (this.open) {\n if (typeof dialog.showModal === 'function') dialog.showModal();\n else dialog.setAttribute('open', '');\n lockScroll(this);\n } else {\n if (typeof dialog.close === 'function' && dialog.open) dialog.close();\n else dialog.removeAttribute('open');\n unlockScroll(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n unlockScroll(this);\n }\n\n private hasFooter = false;\n\n private onFooter(): void {\n const slots = Array.from(this.renderRoot.querySelectorAll<HTMLSlotElement>('slot[name=\"footer\"], slot[name=\"actions\"]'));\n const next = slots.some((slot) => slot.assignedElements({ flatten: true }).length > 0);\n if (next !== this.hasFooter) {\n this.hasFooter = next;\n this.requestUpdate();\n }\n }\n\n private close(): void {\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n return html`\n <dialog\n part=\"dialog\"\n aria-labelledby=${this.heading ? this.id_('heading') : nothing}\n @cancel=${(e: Event) => {\n // `cancel` fires on Escape. Blocking it is what makes a dialog\n // non-dismissible, and it is why `dismissible` exists rather than\n // leaving a caller to re-open on close.\n if (!this.dismissible) e.preventDefault();\n else this.close();\n }}\n @close=${() => {\n if (this.open) this.close();\n }}\n >\n <div class=\"head\" part=\"head\">\n <div class=\"titles\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n ${this.heading ? html`<h2 class=\"heading\" id=${this.id_('heading')} part=\"heading\">${this.heading}</h2>` : nothing}\n </div>\n ${\n this.dismissible\n ? html`<button class=\"close\" part=\"close\" type=\"button\" @click=${this.close}>\n <span aria-hidden=\"true\">×</span>\n <span class=\"sr-only\" style=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)\">${this.closeLabel}</span>\n </button>`\n : nothing\n }\n </div>\n <div class=\"body\" part=\"body\"><slot></slot></div>\n <div class=\"foot ${this.hasFooter ? '' : 'empty'}\" part=\"footer\">\n <slot name=\"footer\" @slotchange=${this.onFooter}></slot><slot name=\"actions\" @slotchange=${this.onFooter}></slot>\n </div>\n </dialog>\n `;\n }\n}\n\ncustomElements.define('impakt-dialog', ImpaktDialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-dialog': ImpaktDialog;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,SAAS,iBAAsC;AAWnE,IAAM,IAAI;AAAA,EACR,WAAW,MAAM,qBAAqB,KAAK;AAAA,EAC3C,UAAU,MAAM,mBAAmB,gFAAgF;AAAA,EACnH,cAAc,MAAM,wBAAwB,KAAK;AAAA,EACjD,SAAS,MAAM,kBAAkB,MAAM;AAAA;AAAA,EAEvC,cAAc,UAAU,OAAO,MAAM,kBAAkB,MAAM,CAAC,SAAS;AAAA,EACvE,aAAa,MAAM,uBAAuB,SAAS;AAAA,EACnD,mBAAmB,MAAM,8BAA8B,QAAQ;AAAA,EAC/D,iBAAiB,MAAM,2BAA2B,KAAK;AAAA,EACvD,eAAe,MAAM,yBAAyB,KAAK;AACrD;AAoCO,IAAM,eAAN,cAA2B,cAAc;AAAA,EAuB9C,cAAc;AACZ,UAAM;AAgJR,SAAQ,YAAY;AA/IlB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,aAAa;AAClB,SAAK,cAAc;AACnB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,UAAU;AAAA,EACjB;AAAA,EA/BA;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE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vH,UAAM,OAAO,MAAM,KAAK,CAAC,SAAS,KAAK,iBAAiB,EAAE,SAAS,KAAK,CAAC,EAAE,SAAS,CAAC;AACrF,QAAI,SAAS,KAAK,WAAW;AAC3B,WAAK,YAAY;AACjB,WAAK,cAAc;AAAA,IACrB;AAAA,EACF;AAAA,EAEQ,QAAc;AACpB,SAAK,OAAO;AACZ,SAAK,cAAc,IAAI,YAAY,gBAAgB,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EACvF;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,0BAGe,KAAK,UAAU,KAAK,IAAI,SAAS,IAAI,OAAO;AAAA,kBACpD,CAAC,MAAa;AAItB,UAAI,CAAC,KAAK,YAAa,GAAE,eAAe;AAAA,UACnC,MAAK,MAAM;AAAA,IAClB,CAAC;AAAA,iBACQ,MAAM;AACb,UAAI,KAAK,KAAM,MAAK,MAAM;AAAA,IAC5B,CAAC;AAAA;AAAA;AAAA;AAAA,cAIK,KAAK,UAAU,yCAAyC,KAAK,OAAO,SAAS,OAAO;AAAA,cACpF,KAAK,UAAU,8BAA8B,KAAK,IAAI,SAAS,CAAC,mBAAmB,KAAK,OAAO,UAAU,OAAO;AAAA;AAAA,YAGlH,KAAK,cACD,+DAA+D,KAAK,KAAK;AAAA;AAAA,4HAEmC,KAAK,UAAU;AAAA,2BAE3H,OACN;AAAA;AAAA;AAAA,2BAGiB,KAAK,YAAY,KAAK,OAAO;AAAA,4CACZ,KAAK,QAAQ,4CAA4C,KAAK,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIhH;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/app-ui.ts"],"sourcesContent":["import { css, html, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { FieldElement } from '../base/FieldElement';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { lockScroll, unlockScroll } from '../base/scroll-lock';\nimport { fontWeight, space, spaceAround, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A panel that slides in from the side: a basket, filters, a plot's details.\n *\n * It is a native `<dialog>` opened with `showModal()`, like the dialog, so the\n * focus trap, Escape, the inert page behind it and the return of focus all come\n * from the browser. The page behind it does not scroll while it is open. The\n * slide is a decoration and stops for anyone who has asked for reduced motion.\n * On a phone it fills the screen.\n *\n * With `side=\"bottom\"` it is a sheet that rises from the bottom edge, as a\n * phone's dialogs do: as wide as the screen, as tall as its content up to\n * nine tenths of the screen, with its top corners rounded.\n *\n * @category feedback\n * @icon drawer\n * @slot - The body of the panel.\n * @slot footer - Buttons pinned to the bottom of the panel.\n * @fires {CustomEvent<null>} impakt-close - When the panel is closed.\n */\nexport class ImpaktDrawer extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n heading: { type: String },\n side: { type: String, reflect: true },\n closeLabel: { type: String, attribute: 'close-label' },\n };\n declare open: boolean;\n declare heading: string;\n /** Which edge it comes in from. `bottom` is a sheet, for a phone. */\n declare side: 'left' | 'right' | 'bottom';\n declare closeLabel: string;\n\n constructor() {\n super();\n this.open = false;\n this.heading = '';\n this.side = 'right';\n this.closeLabel = 'Close';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.close'),\n css`\n dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }\n dialog[open] { display: flex; }\n :host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }\n :host([side='bottom']) dialog { inline-size: 100vw; block-size: fit-content; max-block-size: 90dvh; margin: auto 0 0 0; padding-block-end: env(safe-area-inset-bottom); border-radius: 28px 28px 0 0; animation-name: from-bottom; }\n :host([side='bottom']) .head { box-shadow: none; }\n :host([side='bottom']) .foot { box-shadow: none; }\n :host([side='bottom']) .foot ::slotted(*) { flex: 1; }\n @keyframes from-bottom { from { transform: translateY(100%); } }\n dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }\n @keyframes from-right { from { transform: translateX(100%); } }\n @keyframes from-left { from { transform: translateX(-100%); } }\n .head { display: flex; align-items: center; justify-content: space-between; gap: ${space(3)}; padding: ${space(4)} ${space(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }\n h2 { margin: 0; font-family: ${t.fontHeading}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .close { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${t.text}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .close:hover { background: ${t.surfaceSubtle}; }\n .body { flex: 1; overflow: auto; padding: ${space(5)}; }\n .foot { display: flex; gap: ${space(3)}; justify-content: flex-end; padding: ${space(4)} ${space(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }\n .foot[hidden] { display: none; }\n `,\n ];\n\n private hasFooter = false;\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n updated(changed: Map<string, unknown>): void {\n if (!changed.has('open')) return;\n const dialog = this.dialog;\n if (!dialog) return;\n if (this.open) {\n if (typeof dialog.showModal === 'function') dialog.showModal();\n else dialog.setAttribute('open', '');\n lockScroll(this);\n } else {\n if (typeof dialog.close === 'function' && dialog.open) dialog.close();\n else dialog.removeAttribute('open');\n unlockScroll(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n unlockScroll(this);\n }\n\n private close(): void {\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private footerChanged(event: Event): void {\n this.hasFooter = (event.target as HTMLSlotElement).assignedNodes().length > 0;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n return html`<dialog part=\"dialog\" aria-labelledby=${this.heading ? this.id_('heading') : nothing}\n @cancel=${() => this.close()}\n @close=${() => {\n if (this.open) this.close();\n }}\n @click=${(event: Event) => {\n if (event.target === this.dialog) this.close();\n }}>\n <div class=\"head\">\n ${this.heading ? html`<h2 id=${this.id_('heading')}>${this.heading}</h2>` : html`<span></span>`}\n <button class=\"close\" type=\"button\" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg('close', '20px')}</button>\n </div>\n <div class=\"body\" part=\"body\"><slot></slot></div>\n <div class=\"foot\" part=\"footer\" ?hidden=${!this.hasFooter}><slot name=\"footer\" @slotchange=${this.footerChanged}></slot></div>\n </dialog>`;\n }\n}\n\nconst TOAST_ICON: Record<string, string> = { neutral: 'info', success: 'check', warning: 'warning', danger: 'warning' };\n\n/**\n * A short message in the corner that goes away: \"Viewing booked\", \"Saved\".\n *\n * It says itself to a screen reader through a live region that is on the page\n * before the message is, and its timer stops while it is pointed at or focused.\n * Set `duration` to 0 to keep it up until it is closed. A message with a button,\n * such as Undo, stays until it is closed whatever the duration, because a\n * button that disappears on a timer cannot be pressed by someone who needs\n * longer (2.2.1). Escape closes it while focus is inside it. Anything a person\n * must act on belongs in an alert on the page.\n *\n * It never takes the page's clicks: only the message itself can be pressed, so\n * the page beside and behind the corner it sits in still works. On a phone it\n * spans the screen above the bottom edge, clear of the home bar and of a bottom\n * bar that sets `--impakt-bottom-bar`, and it rises without moving for anyone who\n * has asked for reduced motion.\n *\n * @category feedback\n * @icon toast\n * @fires {CustomEvent<null>} impakt-close - When the message goes away.\n * @fires {CustomEvent<null>} impakt-action - When its button is pressed.\n */\nexport class ImpaktToast extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n message: { type: String },\n tone: { type: String, reflect: true },\n duration: { type: Number },\n actionText: { type: String, attribute: 'action-text' },\n closeLabel: { type: String, attribute: 'close-label' },\n };\n declare open: boolean;\n declare message: string;\n declare tone: 'neutral' | 'success' | 'warning' | 'danger';\n /** How long it stays. 0 keeps it up until it is closed. */\n declare duration: number;\n declare actionText: string;\n declare closeLabel: string;\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n super();\n this.open = false;\n this.message = '';\n this.tone = 'neutral';\n this.duration = 6;\n this.actionText = '';\n this.closeLabel = 'Dismiss';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n .region { position: fixed; inset-block-end: calc(${space(4)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); inset-inline-end: ${space(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${space(8)})); pointer-events: none; }\n @media (max-width: 40rem) { .region { inset-inline: ${space(3)}; inline-size: auto; inset-block-end: calc(${space(3)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); } }\n .toast { pointer-events: auto; max-block-size: 40vh; overflow: auto; display: flex; align-items: flex-start; gap: ${space(3)}; padding: ${space(3)} ${space(3)} ${space(3)} ${space(4)}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowXl}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }\n /* It rises without fading in, so its words are at full contrast from the first frame they are read in (1.4.3). */\n @keyframes rise { from { transform: translateY(${space(3)}); } }\n .mark { display: inline-flex; flex: none; margin-block-start: ${space(0.5)}; color: ${t.info}; }\n :host([tone='success']) .mark { color: ${t.success}; }\n :host([tone='warning']) .mark { color: ${t.warning}; }\n :host([tone='danger']) .mark { color: ${t.danger}; }\n .message { flex: 1; align-self: center; margin: 0; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .action, .close { ${targetSize} padding: 0 ${space(2)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }\n .action:hover, .close:hover { background: ${t.surfaceSubtle}; }\n `,\n touchTarget('.action, .close'),\n ];\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.stop();\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('open') || changed.has('duration')) {\n this.stop();\n if (this.open) this.start();\n }\n }\n\n private start(): void {\n this.stop();\n if (this.duration > 0 && !this.actionText) this.timer = setTimeout(() => this.close(), this.duration * 1000);\n }\n\n private stop(): void {\n if (this.timer) clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private close(): void {\n this.stop();\n if (!this.open) return;\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private action(): void {\n this.dispatchEvent(new CustomEvent('impakt-action', { bubbles: true, composed: true }));\n this.close();\n }\n\n render(): TemplateResult {\n return html`<div class=\"region\" role=\"status\" aria-live=\"polite\">\n ${\n this.open\n ? html`<div class=\"toast\" part=\"toast\" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n this.close();\n }\n }}>\n <span class=\"mark\">${iconSvg(TOAST_ICON[this.tone] ?? 'info', '20px')}</span>\n <p class=\"message\">${this.message}</p>\n ${this.actionText ? html`<button class=\"action\" type=\"button\" @click=${this.action}>${this.actionText}</button>` : nothing}\n <button class=\"close\" type=\"button\" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg('close', '16px')}</button>\n </div>`\n : nothing\n }\n </div>`;\n }\n}\n\nexport interface MenuItem {\n id?: string;\n text: string;\n /** Where it goes. Without one it fires impakt-select with its value. */\n href?: string;\n value?: string;\n icon?: string;\n tone?: '' | 'danger';\n /** A group name. Items with the same group are drawn together under it, as a labelled group, in the order the groups first appear. */\n group?: string;\n /** A short note on the right in the code face, such as \"Open\" or \"Coming soon\". It is read with the item. */\n meta?: string;\n /** The page you are on: an ink fill, `aria-current=\"page\"`, and \"You are here\" when there is no meta. */\n current?: boolean;\n /** Shown but not chosen, such as a tool still to come. It stays in the arrow-key order and says it is unavailable. */\n disabled?: boolean;\n}\n\n/** The G2 soft rule, until the theme carries it. */\nconst LINE_SOFT = unsafeCSS('var(--impakt-color-line-soft, #dcdcd8)');\n\n/**\n * A button that opens a short list of actions or links.\n *\n * It follows the ARIA menu button pattern: the arrow keys, Home and End move\n * through it, a letter moves to the next item that starts with it, Escape\n * closes it and puts focus back on the button, and a click anywhere else closes\n * it. A list that would run off the side of the screen opens towards the other\n * edge instead, so it never makes a phone scroll sideways.\n *\n * **The button can hold your own content.** Put an avatar and a name in the\n * `trigger` slot for an account menu; they replace the icon and label, and\n * become the button's accessible name, so include the words. Put who is signed\n * in, or any other note, in the `header` slot; it sits above the items and\n * outside the menu, so the arrow keys still move through the items alone.\n *\n * @category navigation\n * @icon menu\n * **Items can be grouped, noted and marked.** An item's `group` draws it under\n * a label in the code face, as a `group` named by that label, with a soft rule\n * above each group after the first. Its `meta` is a quiet note at the end. The\n * page you are on is `current`, an ink row with `aria-current=\"page\"`, and a\n * `disabled` item is still reached by the arrow keys but says it is unavailable\n * and does nothing (G2 tool switcher, frames 53:960 and 53:800).\n *\n * @slot trigger - What the button shows, in place of the icon and label.\n * @slot header - A note above the items, such as the name and email of who is signed in.\n * @csspart trigger - The button.\n * @csspart chevron - The arrow on the button.\n * @csspart panel - The box that opens, holding the header and the items.\n * @csspart header - The box round the header slot.\n * @csspart list - The list of items.\n * @fires {CustomEvent<{ value: string }>} impakt-select - When an item without an address is chosen. The value is in detail.value.\n */\nexport class ImpaktMenu extends ImpaktElement {\n static properties = {\n label: { type: String },\n icon: { type: String },\n items: { type: Array },\n edge: { type: String, reflect: true },\n open: { type: Boolean, reflect: true },\n triggerLook: { type: String, reflect: true, attribute: 'trigger-look' },\n };\n declare label: string;\n declare icon: string;\n /** `button` is a bordered button with a chevron. `text` is plain words with \"▾\", \"▴\" when open, as a tool's name in a header is. */\n declare triggerLook: 'button' | 'text';\n declare items: MenuItem[];\n /** Which edge of the button the list lines up with. */\n declare edge: 'start' | 'end';\n declare open: boolean;\n\n constructor() {\n super();\n this.label = 'Menu';\n this.icon = '';\n this.items = [];\n this.edge = 'start';\n this.open = false;\n this.triggerLook = 'button';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.trigger, .item'),\n css`\n :host { position: relative; display: inline-block; }\n .trigger { ${targetSize} display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(2)} ${space(3.5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('medium')}; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.text}; border-radius: ${t.radiusLg}; cursor: pointer; }\n :host([trigger-look='text']) .trigger { padding: ${space(1)} ${space(1)}; font-size: 1rem; line-height: 1.25; background: transparent; border-color: transparent; }\n :host([trigger-look='text']) .trigger:hover { background: transparent; text-decoration: underline; text-underline-offset: 0.2em; }\n .caret { font-size: 0.75em; line-height: 1; }\n .trigger:hover { background: ${t.surfaceSubtle}; }\n .chev { display: inline-flex; color: ${t.textMuted}; transition: transform 120ms ease-in-out; }\n :host([open]) .chev { transform: rotate(180deg); }\n /* G2: a 1px ink border and the one shadow the design allows, the open menu's. */\n .panel { position: absolute; z-index: 100; inset-block-start: calc(100% + ${space(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(24rem, 90vw); padding: ${space(2)} 0; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.text}; border-radius: ${t.radiusXl}; box-shadow: var(--impakt-shadow-overlay, 0 16px 32px rgb(0 0 0 / 0.2)); animation: pop 120ms ease-out; }\n .list, .group { margin: 0; padding: 0; list-style: none; }\n .grouped + .grouped, .grouped:not(:first-child) { margin-block-start: ${space(2)}; padding-block-start: ${space(2)}; border-block-start: ${t.borderThin} solid ${LINE_SOFT}; }\n .group-label { display: block; padding: ${space(2)} 18px ${space(1)}; font-family: ${t.fontMono}; font-size: 0.875rem; line-height: 1.4; color: ${t.textMuted}; }\n .header { padding: ${space(2)} ${space(2.5)} ${space(2.5)}; margin-block-end: ${space(1.5)}; border-block-end: ${t.borderThin} solid ${t.border}; ${type('sm')} color: ${t.textMuted}; overflow-wrap: anywhere; }\n :host([edge='end']) .panel, .panel.flip-end { inset-inline: auto 0; }\n :host([edge='end']) .panel.flip-start { inset-inline: 0 auto; }\n @keyframes pop { from { opacity: 0; transform: translateY(-${space(1)}); } }\n .item { ${targetSize} box-sizing: border-box; display: flex; align-items: center; gap: ${space(2.5)}; inline-size: 100%; padding: ${space(3)} 18px; font: inherit; font-size: 1rem; line-height: 1.25; font-weight: ${fontWeight('medium')}; text-align: start; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: 0; cursor: pointer; }\n .item:hover, .item:focus { background: ${t.surfaceSubtle}; }\n .item .meta { margin-inline-start: auto; padding-inline-start: ${space(4)}; font-family: ${t.fontMono}; font-size: 0.875rem; font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; white-space: nowrap; }\n .item[aria-current] { background: ${t.text}; color: var(--impakt-color-text-inverse, var(--impakt-solid-card, ${t.surfaceCard})); }\n .item[aria-current] .meta { color: color-mix(in srgb, var(--impakt-color-text-inverse, var(--impakt-solid-card, ${t.surfaceCard})) 66%, ${t.text}); }\n .item[aria-disabled='true'] { color: ${t.textMuted}; cursor: not-allowed; }\n .item[aria-disabled='true']:hover { background: none; }\n .item[aria-disabled='true']:focus { background: ${t.surfaceSubtle}; }\n @media (forced-colors: active) { .panel { border-color: CanvasText; } .item[aria-current] { outline: 2px solid Highlight; outline-offset: -2px; } .item[aria-disabled='true'] { color: GrayText; } }\n .item.danger { color: ${t.dangerText}; }\n .item svg { flex: none; }\n `,\n ];\n\n private outside = (event: Event): void => {\n if (!event.composedPath().includes(this)) this.toggle(false);\n };\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('click', this.outside);\n }\n\n private get entries(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLElement>('.item'));\n }\n\n private get trigger(): HTMLElement | null {\n return this.renderRoot.querySelector('.trigger');\n }\n\n private toggle(open: boolean, focus?: 'first' | 'last'): void {\n this.open = open;\n if (open) {\n document.addEventListener('click', this.outside);\n void this.updateComplete.then(() => {\n this.keepOnScreen();\n this.entries[focus === 'last' ? this.entries.length - 1 : 0]?.focus();\n });\n } else document.removeEventListener('click', this.outside);\n }\n\n /** Open towards the other edge when the list would run off the screen. */\n private keepOnScreen(): void {\n const list = this.renderRoot.querySelector<HTMLElement>('.panel');\n if (!list) return;\n list.classList.remove('flip-start', 'flip-end');\n const box = list.getBoundingClientRect();\n const width = document.documentElement.clientWidth;\n if (box.right > width - 8) list.classList.add('flip-end');\n else if (box.left < 8) list.classList.add('flip-start');\n }\n\n private triggerKey(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n this.toggle(true, event.key === 'ArrowUp' ? 'last' : 'first');\n }\n }\n\n private listKey(event: KeyboardEvent): void {\n const entries = this.entries;\n const at = entries.indexOf((this.renderRoot as ShadowRoot).activeElement as HTMLElement);\n const go: Record<string, number> = {\n ArrowDown: (at + 1) % entries.length,\n ArrowUp: (at - 1 + entries.length) % entries.length,\n Home: 0,\n End: entries.length - 1,\n };\n if (event.key in go) {\n event.preventDefault();\n entries[go[event.key]!]?.focus();\n } else if (event.key.length === 1 && /\\S/.test(event.key) && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const letter = event.key.toLowerCase();\n const next = [...entries.slice(at + 1), ...entries.slice(0, at + 1)].find((e) => (e.textContent ?? '').trim().toLowerCase().startsWith(letter));\n next?.focus();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.toggle(false);\n this.trigger?.focus();\n } else if (event.key === 'Tab') this.toggle(false);\n }\n\n private choose(item: MenuItem, event?: Event): void {\n if (item.disabled) {\n event?.preventDefault();\n return;\n }\n this.toggle(false);\n this.trigger?.focus();\n if (!item.href) this.dispatchEvent(new CustomEvent('impakt-select', { detail: { value: item.value ?? item.text }, bubbles: true, composed: true }));\n }\n\n private renderItem(item: MenuItem): TemplateResult {\n const meta = item.meta || (item.current ? say('You are here') : '');\n const inner = html`${iconSvg(item.icon, '18px')}<span class=\"text\">${item.text}</span>${meta ? html`<span class=\"meta\">${meta}</span>` : nothing}`;\n const cls = `item ${item.tone === 'danger' ? 'danger' : ''}`;\n const current = item.current ? 'page' : nothing;\n const disabled = item.disabled ? 'true' : nothing;\n return html`<li role=\"none\">${\n item.href && !item.disabled\n ? html`<a class=${cls} role=\"menuitem\" tabindex=\"-1\" href=${item.href} aria-current=${current} @click=${(e: Event) => this.choose(item, e)}>${inner}</a>`\n : html`<button class=${cls} role=\"menuitem\" tabindex=\"-1\" type=\"button\" aria-current=${current} aria-disabled=${disabled} @click=${(e: Event) => this.choose(item, e)}>${inner}</button>`\n }</li>`;\n }\n\n /** The items in runs: each run of items with the same group, in order. Items with no group are a run with no label. */\n private get runs(): Array<{ group: string; items: MenuItem[] }> {\n const runs: Array<{ group: string; items: MenuItem[] }> = [];\n for (const item of this.items ?? []) {\n const group = item.group ?? '';\n const last = runs[runs.length - 1];\n const existing = group ? runs.find((r) => r.group === group) : undefined;\n if (existing) existing.items.push(item);\n else if (last && !group && !last.group) last.items.push(item);\n else runs.push({ group, items: [item] });\n }\n return runs;\n }\n\n render(): TemplateResult {\n const text = this.triggerLook === 'text';\n const runs = this.runs;\n const grouped = runs.some((r) => r.group);\n return html`<button class=\"trigger\" part=\"trigger\" type=\"button\" aria-haspopup=\"menu\" aria-expanded=${String(this.open)} aria-controls=${this.id_('list')}\n @click=${() => this.toggle(!this.open)} @keydown=${this.triggerKey}><slot name=\"trigger\">${iconSvg(this.icon, '18px')}${this.label}</slot>${\n text\n ? html`<span class=\"caret\" part=\"chevron\" aria-hidden=\"true\">${this.open ? '▴' : '▾'}</span>`\n : html`<span class=\"chev\" part=\"chevron\">${iconSvg('chevron-down', '16px')}</span>`\n }</button>\n ${\n this.open\n ? html`<div class=\"panel\" part=\"panel\">${\n this.querySelector?.(':scope > [slot=\"header\"]') ? html`<div class=\"header\" part=\"header\"><slot name=\"header\"></slot></div>` : nothing\n }<ul class=\"list\" part=\"list\" id=${this.id_('list')} role=\"menu\" aria-label=${this.label} @keydown=${this.listKey}>\n ${\n grouped\n ? runs.map((run, i) => {\n const id = this.id_(`group-${i}`);\n return html`<li role=\"none\" class=\"grouped\">${run.group ? html`<span class=\"group-label\" id=${id} part=\"group-label\">${run.group}</span>` : nothing}<ul class=\"group\" role=\"group\" aria-labelledby=${run.group ? id : nothing}>${run.items.map((item) => this.renderItem(item))}</ul></li>`;\n })\n : (this.items ?? []).map((item) => this.renderItem(item))\n }\n </ul></div>`\n : nothing\n }`;\n }\n}\n\n/** Which page numbers to show: the ends and the neighbours, with gaps between. */\nexport function pageWindow(page: number, pages: number): Array<number | 'gap'> {\n const wanted = [...new Set([1, page - 1, page, page + 1, pages])].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);\n return wanted.flatMap((n, i): Array<number | 'gap'> => {\n const previous = wanted[i - 1];\n if (previous === undefined || n === previous + 1) return [n];\n return n === previous + 2 ? [previous + 1, n] : ['gap', n];\n });\n}\n\n/**\n * Page numbers for a long list.\n *\n * Give it `href-pattern` and every number is a real link, with `{page}` swapped\n * for the number. Without one the numbers are buttons and it fires\n * `impakt-page`. On a narrow screen the numbers fold to \"Page 2 of 9\".\n *\n * @category navigation\n * @icon pagination\n * @fires {CustomEvent<{ page: number }>} impakt-page - When a page is chosen. The number is in detail.page.\n */\nexport class ImpaktPagination extends ImpaktElement {\n static properties = {\n page: { type: Number },\n pages: { type: Number },\n hrefPattern: { type: String, attribute: 'href-pattern' },\n label: { type: String },\n previousText: { type: String, attribute: 'previous-text' },\n nextText: { type: String, attribute: 'next-text' },\n };\n declare page: number;\n declare pages: number;\n declare hrefPattern: string;\n declare label: string;\n declare previousText: string;\n declare nextText: string;\n\n constructor() {\n super();\n this.page = 1;\n this.pages = 1;\n this.hrefPattern = '';\n this.label = 'Pages';\n this.previousText = 'Previous';\n this.nextText = 'Next';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.n, .step'),\n css`\n :host { display: block; container-type: inline-size; }\n nav { display: flex; align-items: center; justify-content: space-between; gap: ${space(2)}; }\n ul { display: flex; align-items: center; gap: ${space(1)}; margin: 0; padding: 0; list-style: none; }\n .n, .step { ${targetSize} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${space(1.5)}; min-inline-size: 44px; padding: 0 ${space(2.5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('medium')}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n .n:hover, .step:hover { background: ${t.surfaceSubtle}; }\n .n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${fontWeight('semibold')}; }\n .step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }\n .gap { color: ${t.textMuted}; padding: 0 ${space(1)}; }\n .count { display: none; ${type('sm')} color: ${t.textMuted}; }\n @container (max-width: 34rem) { ul { display: none; } .count { display: block; } }\n `,\n ];\n\n private go(page: number, event: Event): void {\n if (this.hrefPattern) return;\n event.preventDefault();\n this.page = page;\n this.dispatchEvent(new CustomEvent('impakt-page', { detail: { page }, bubbles: true, composed: true }));\n }\n\n private link(page: number, classes: string, content: unknown, label: string, current: boolean): TemplateResult {\n return this.hrefPattern\n ? html`<a class=${classes} href=${this.hrefPattern.replace('{page}', String(page))} aria-label=${label} aria-current=${current ? 'page' : nothing}>${content}</a>`\n : html`<button class=${classes} type=\"button\" aria-label=${label} aria-current=${current ? 'page' : nothing} @click=${(e: Event) => this.go(page, e)}>${content}</button>`;\n }\n\n private step(to: number, words: string, icon: string, off: boolean): TemplateResult {\n const content = icon === 'arrow-left' ? html`${iconSvg(icon, '16px')}${words}` : html`${words}${iconSvg(icon, '16px')}`;\n return off ? html`<span class=\"step\" aria-disabled=\"true\">${content}</span>` : this.link(to, 'step', content, words, false);\n }\n\n render(): TemplateResult {\n const page = Math.min(Math.max(this.page, 1), Math.max(this.pages, 1));\n return html`<nav aria-label=${this.label} part=\"nav\">\n ${this.step(page - 1, this.previousText, 'arrow-left', page <= 1)}\n <ul>${pageWindow(page, this.pages).map((n) => html`<li>${n === 'gap' ? html`<span class=\"gap\" aria-hidden=\"true\">…</span>` : this.link(n, 'n', n, say('Page {page}', { page: n }), n === page)}</li>`)}</ul>\n <span class=\"count\">${say('Page {page} of {pages}', { page, pages: this.pages })}</span>\n ${this.step(page + 1, this.nextText, 'arrow-right', page >= this.pages)}\n </nav>`;\n }\n}\n\nconst initialsOf = (name: string): string => {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n return ((words[0]?.[0] ?? '') + (words.length > 1 ? words[words.length - 1]![0]! : '')).toUpperCase();\n};\n\n/**\n * A person's photo, or their initials when there is no photo or it fails.\n *\n * @category content\n * @icon avatar\n */\nexport class ImpaktAvatar extends ImpaktElement {\n static properties = {\n fullName: { type: String, attribute: 'full-name' },\n src: { type: String },\n size: { type: String, reflect: true },\n };\n declare fullName: string;\n declare src: string;\n /** `xs` is 22px, for a row of people in a header. */\n declare size: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n private failed = false;\n\n constructor() {\n super();\n this.fullName = '';\n this.src = '';\n this.size = 'md';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }\n :host([size='xs']) { --size: 22px; }\n :host([size='sm']) { --size: 32px; }\n :host([size='lg']) { --size: 56px; }\n :host([size='xl']) { --size: 80px; }\n .face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${fontWeight('semibold')}; }\n img { inline-size: 100%; block-size: 100%; object-fit: cover; }\n `,\n ];\n\n willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('src')) this.failed = false;\n }\n\n render(): TemplateResult {\n if (this.src && !this.failed) {\n return html`<div class=\"face\"><img src=${this.src} alt=${this.fullName} @error=${() => {\n this.failed = true;\n this.requestUpdate();\n }} /></div>`;\n }\n return html`<div class=\"face\" role=\"img\" aria-label=${this.fullName || say('Person')}>${initialsOf(this.fullName) || iconSvg('user', '55%')}</div>`;\n }\n}\n\nexport interface AvatarItem {\n id?: string;\n name: string;\n src?: string;\n}\n\n/**\n * A few people overlapped in a row, with a count for the rest: the sales team,\n * the neighbours who have already moved in.\n *\n * @category content\n * @icon avatars\n */\nexport class ImpaktAvatarGroup extends ImpaktElement {\n static properties = {\n items: { type: Array },\n max: { type: Number },\n size: { type: String, reflect: true },\n moreLabel: { type: String, attribute: 'more-label' },\n };\n declare items: AvatarItem[];\n declare max: number;\n /** `xs` is 22px faces with a 1px ink outline, overlapped less, as in the G2 site header (frame 9:264). */\n declare size: 'xs' | 'sm' | 'md' | 'lg';\n /** How the people left out are described to a screen reader, after the number. */\n declare moreLabel: string;\n\n constructor() {\n super();\n this.items = [];\n this.max = 4;\n this.size = 'md';\n this.moreLabel = 'more people';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n ul { display: flex; margin: 0; padding: 0; list-style: none; }\n li { margin-inline-start: -${space(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }\n li:first-child { margin-inline-start: 0; }\n .more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${type('xs')} line-height: 1; font-weight: ${fontWeight('semibold')}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }\n :host([size='sm']) .more { inline-size: 32px; block-size: 32px; }\n :host([size='xs']) li { margin-inline-start: -${space(1)}; box-shadow: 0 0 0 1px ${t.text}; }\n :host([size='xs']) li:first-child { margin-inline-start: 0; }\n :host([size='xs']) .more { inline-size: 22px; block-size: 22px; font-size: 10px; }\n :host([size='lg']) .more { inline-size: 56px; block-size: 56px; }\n .sr { ${visuallyHidden} }\n `,\n ];\n\n render(): TemplateResult {\n const shown = this.items.slice(0, this.max);\n const rest = this.items.length - shown.length;\n return html`<ul part=\"list\">\n ${shown.map((item) => html`<li><impakt-avatar full-name=${item.name} src=${item.src ?? ''} size=${this.size}></impakt-avatar></li>`)}\n ${rest > 0 ? html`<li><span class=\"more\"><span aria-hidden=\"true\">+${rest}</span><span class=\"sr\">${rest} ${this.moreLabel}</span></span></li>` : nothing}\n </ul>`;\n }\n}\n\n/**\n * What a list says when it has nothing in it, and what to do about that.\n *\n * @category feedback\n * @icon empty\n * @role heading\n * @slot actions - The next thing to do, usually one button.\n */\nexport class ImpaktEmptyState extends ImpaktElement {\n static properties = {\n icon: { type: String },\n heading: { type: String },\n lead: { type: String },\n framed: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare icon: string;\n declare heading: string;\n declare lead: string;\n /** Draws a dashed outline round it. */\n declare framed: boolean;\n declare headingLevel: 2 | 3 | 4;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.icon = 'search';\n this.heading = '';\n this.lead = '';\n this.framed = false;\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n .wrap { display: flex; flex-direction: column; align-items: center; gap: ${space(2)}; padding: ${space(12)} ${space(6)}; text-align: center; }\n :host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }\n .mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${space(2)}; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; }\n .h { margin: 0; font-family: ${t.fontHeading}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }\n .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${space(3)}; margin-block-start: ${space(3)}; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"wrap\" part=\"wrap\">\n <span class=\"mark\">${iconSvg(this.icon, '26px')}</span>\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.lead ? html`<p>${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>`;\n }\n}\n\nexport interface SlotDay {\n id?: string;\n /** The day, as 2026-11-14. */\n date: string;\n /** The times on offer, separated by commas: 10:00, 11:30, 14:00. */\n times: string;\n}\n\nconst timesOf = (day: SlotDay | undefined): string[] =>\n String(day?.times ?? '')\n .split(',')\n .map((time) => time.trim())\n .filter(Boolean);\n\n/** A day's parts in the page's language. A date that cannot be read is shown as it was written. */\nfunction dayParts(date: string): { weekday: string; day: string; month: string } {\n const parsed = new Date(`${date}T00:00:00Z`);\n if (Number.isNaN(parsed.getTime())) return { weekday: '', day: date, month: '' };\n const locale = pageLocale();\n const part = (options: Intl.DateTimeFormatOptions): string => new Intl.DateTimeFormat(locale, { timeZone: 'UTC', ...options }).format(parsed);\n return { weekday: part({ weekday: 'short' }), day: part({ day: 'numeric' }), month: part({ month: 'short' }) };\n}\n\n/**\n * Choose a day, then a time: a viewing, a call back, a site visit.\n *\n * Both rows are native radios under the styling, so the arrow keys and screen\n * readers work as they do for any radio group. Its value is the day and time\n * together, as 2026-11-14T10:00.\n *\n * @category form\n * @icon calendar\n */\nexport class ImpaktSlotPicker extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n days: { type: Array },\n dayLabel: { type: String, attribute: 'day-label' },\n timeLabel: { type: String, attribute: 'time-label' },\n emptyText: { type: String, attribute: 'empty-text' },\n };\n declare days: SlotDay[];\n declare dayLabel: string;\n declare timeLabel: string;\n /** What is said when no times are on offer. */\n declare emptyText: string;\n\n private day = '';\n\n constructor() {\n super();\n this.days = [];\n this.dayLabel = 'Day';\n this.timeLabel = 'Time';\n this.emptyText = 'No times are available at the moment.';\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }\n legend { padding: 0; }\n .row-label { ${type('sm')} color: ${t.textMuted}; margin-block: ${space(2)}; }\n .days { display: flex; gap: ${space(2)}; overflow-x: auto; padding: ${space(1)}; margin: -${space(1)}; scrollbar-width: thin; }\n .times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${space(2)}; }\n label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusLg}; box-shadow: inset 0 0 0 1px ${t.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }\n label:hover { background: ${t.surfaceSubtle}; }\n label:has(input:checked) { color: ${t.onBrand}; background: ${t.brand}; box-shadow: none; }\n label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }\n input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }\n .day { flex: none; inline-size: 4.5rem; padding-block: ${space(2.5)}; }\n .weekday, .month { ${type('xs')} }\n .num { ${type('xl')} font-weight: ${fontWeight('semibold')}; }\n .time { padding: ${space(2)}; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .empty { margin: 0; color: ${t.textMuted}; }\n :host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${t.danger}; }\n `,\n ];\n\n private get currentDay(): SlotDay | undefined {\n const wanted = this.day || this.value.split('T')[0];\n return this.days.find((day) => day.date === wanted) ?? this.days[0];\n }\n\n private chooseDay(date: string): void {\n this.day = date;\n if (this.value && !this.value.startsWith(`${date}T`)) this.setFormValue('');\n this.requestUpdate();\n }\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}</legend>`;\n }\n\n protected renderControl(): TemplateResult {\n const current = this.currentDay;\n if (!current) return html`<p class=\"empty\">${this.emptyText}</p>`;\n return html`\n <div class=\"row-label\" id=${this.id_('days')}>${this.dayLabel}</div>\n <div class=\"days\" part=\"days\" role=\"radiogroup\" aria-labelledby=${this.id_('days')}>\n ${this.days.map((day) => {\n const parts = dayParts(day.date);\n return html`<label class=\"day\"><input type=\"radio\" name=${`${this.uid}-day`} .checked=${day.date === current.date} ?disabled=${this.disabled} @change=${() => this.chooseDay(day.date)} />\n <span class=\"weekday\">${parts.weekday}</span><span class=\"num\">${parts.day}</span><span class=\"month\">${parts.month}</span></label>`;\n })}\n </div>\n <div class=\"row-label\" id=${this.id_('times')}>${this.timeLabel}</div>\n <div class=\"times\" part=\"times\" role=\"radiogroup\" aria-labelledby=${this.id_('times')}>\n ${timesOf(current).map((time, i) => {\n const value = `${current.date}T${time}`;\n return html`<label class=\"time\"><input type=\"radio\" name=${`${this.uid}-time`} .checked=${this.value === value} ?required=${this.required && i === 0} ?disabled=${this.disabled} @change=${() => this.setFormValue(value)} />${time}</label>`;\n })}\n </div>`;\n }\n\n render(): TemplateResult {\n return html`<fieldset part=\"fieldset\" ?disabled=${this.disabled} 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 updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-drawer', ImpaktDrawer);\ncustomElements.define('impakt-toast', ImpaktToast);\ncustomElements.define('impakt-menu', ImpaktMenu);\ncustomElements.define('impakt-pagination', ImpaktPagination);\ncustomElements.define('impakt-avatar', ImpaktAvatar);\ncustomElements.define('impakt-avatar-group', ImpaktAvatarGroup);\ncustomElements.define('impakt-empty-state', ImpaktEmptyState);\ncustomElements.define('impakt-slot-picker', ImpaktSlotPicker);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-drawer': ImpaktDrawer;\n 'impakt-toast': ImpaktToast;\n 'impakt-menu': ImpaktMenu;\n 'impakt-pagination': ImpaktPagination;\n 'impakt-avatar': ImpaktAvatar;\n 'impakt-avatar-group': ImpaktAvatarGroup;\n 'impakt-empty-state': ImpaktEmptyState;\n 'impakt-slot-picker': ImpaktSlotPicker;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,SAAS,iBAAsC;AA6B5D,IAAM,eAAN,cAA2B,cAAc;AAAA,EAa9C,cAAc;AACZ,UAAM;AAiCR,SAAQ,YAAY;AAhClB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,aAAa;AAAA,EACpB;AAAA,EAlBA;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,IACvD;AAAA;AAAA,EAeA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA,YAAY,QAAQ;AAAA,MACpB;AAAA,oOAC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WAAO,2CAA2C,KAAK,QAAQ,qBAAqB,KAAK,WAAW,iBAAiB,KAAK,QAAQ,SAAS,OAAO;AAAA,QAC9I,KAAK,YAAY,CAAC;AAAA,QAClB,KAAK,cAAc,mCAAmC,KAAK,IAAI,aAAa,CAAC,uBAAuB,KAAK,WAAW,WAAW,OAAO;AAAA,QACtI,KAAK,cAAc,CAAC;AAAA,8BACE,KAAK,IAAI,OAAO,CAAC,oCAAoC,KAAK,SAAS,OAAO;AAAA;AAAA,EAEtG;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;AACnD,eAAe,OAAO,gBAAgB,WAAW;AACjD,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,qBAAqB,gBAAgB;AAC3D,eAAe,OAAO,iBAAiB,YAAY;AACnD,eAAe,OAAO,uBAAuB,iBAAiB;AAC9D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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/**\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 scroll sideways if they still do\n * not fit. Folding them away behind a button would hide where you are; a row\n * that scrolls keeps the current page in view and every page one swipe or one\n * Tab away. 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 */\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 320 wide (53:960), so \"Your account\" and its note sit on one line. */\n impakt-menu.switcher::part(panel) {\n min-inline-size: min(20rem, calc(100vw - 2 * ${space(4)}));\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 }\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\" 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\" 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;AAgEjD,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,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