@atomic-ui/blocks 0.0.0-stage → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +77 -2
  2. package/custom-elements.json +8688 -0
  3. package/dist/chunk-4JW2CHWS.js +708 -0
  4. package/dist/chunk-4JW2CHWS.js.map +1 -0
  5. package/dist/chunk-AFN7IAG2.js +379 -0
  6. package/dist/chunk-AFN7IAG2.js.map +1 -0
  7. package/dist/chunk-F4BTXUYP.js +65 -0
  8. package/dist/chunk-F4BTXUYP.js.map +1 -0
  9. package/dist/chunk-MYTYMOH6.js +193 -0
  10. package/dist/chunk-MYTYMOH6.js.map +1 -0
  11. package/dist/chunk-OTOFULMT.js +465 -0
  12. package/dist/chunk-OTOFULMT.js.map +1 -0
  13. package/dist/chunk-PORKVHAX.js +255 -0
  14. package/dist/chunk-PORKVHAX.js.map +1 -0
  15. package/dist/chunk-T7U4OPTW.js +413 -0
  16. package/dist/chunk-T7U4OPTW.js.map +1 -0
  17. package/dist/chunk-WHENVU5E.js +318 -0
  18. package/dist/chunk-WHENVU5E.js.map +1 -0
  19. package/dist/chunk-XHFUTZGU.js +228 -0
  20. package/dist/chunk-XHFUTZGU.js.map +1 -0
  21. package/dist/chunk-XJMKAK2I.js +442 -0
  22. package/dist/chunk-XJMKAK2I.js.map +1 -0
  23. package/dist/components/card-grid.d.ts +72 -0
  24. package/dist/components/card-grid.js +7 -0
  25. package/dist/components/card-grid.js.map +1 -0
  26. package/dist/components/changelog.d.ts +373 -0
  27. package/dist/components/changelog.js +16 -0
  28. package/dist/components/changelog.js.map +1 -0
  29. package/dist/components/estimator.d.ts +246 -0
  30. package/dist/components/estimator.js +11 -0
  31. package/dist/components/estimator.js.map +1 -0
  32. package/dist/components/marketing.d.ts +342 -0
  33. package/dist/components/marketing.js +17 -0
  34. package/dist/components/marketing.js.map +1 -0
  35. package/dist/components/organisms.d.ts +559 -0
  36. package/dist/components/organisms.js +23 -0
  37. package/dist/components/organisms.js.map +1 -0
  38. package/dist/components/property.d.ts +389 -0
  39. package/dist/components/property.js +17 -0
  40. package/dist/components/property.js.map +1 -0
  41. package/dist/components/scene.d.ts +138 -0
  42. package/dist/components/scene.js +7 -0
  43. package/dist/components/scene.js.map +1 -0
  44. package/dist/components/scrubber.d.ts +86 -0
  45. package/dist/components/scrubber.js +7 -0
  46. package/dist/components/scrubber.js.map +1 -0
  47. package/dist/components/selling.d.ts +409 -0
  48. package/dist/components/selling.js +23 -0
  49. package/dist/components/selling.js.map +1 -0
  50. package/dist/components/site.d.ts +235 -0
  51. package/dist/components/site.js +11 -0
  52. package/dist/components/site.js.map +1 -0
  53. package/dist/index.d.ts +21 -0
  54. package/dist/index.js +114 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/standalone/atomic-ui-blocks.js +1229 -0
  57. package/dist/standalone/atomic-ui-blocks.js.map +7 -0
  58. package/dist/standalone/index.html +78 -0
  59. package/package.json +64 -3
  60. package/scripts/copy-to-product.mjs +59 -0
  61. package/specimen/index.html +78 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/estimator.ts"],"sourcesContent":["/**\n * A cost estimator: a few questions, one at a time, with a budget beside them\n * that moves as the answers change, and then a result with a timeline, a team\n * and a way of working.\n *\n * Every number is content. Each choice says what it adds to the cost and the\n * weeks, or what it multiplies them by, and the bands say how big a team a\n * cost needs. The arithmetic lives here, in code, because a binding never\n * computes (ADR 0003): a studio changes its rates in the CMS, not the rules.\n */\nimport { css, html, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { ImpaktElement, pageLocale, say, focusRing, targetSize, visuallyHidden, fontSize, fontWeight, space, spaceAround, t, type, toneOf } from '@atomic-ui/ui';\n\n/** One answer to a question, and what it does to the estimate. */\nexport interface EstimatorChoice {\n id: string;\n label: string;\n /** A line under the label, such as \"iPhone and Android\". */\n hint?: string;\n /** Added to the cost, counted in units (see `unit`). */\n cost?: number;\n /** Added to the weeks. */\n weeks?: number;\n /** Multiplies the cost, such as 1.35 for a more polished first version. */\n costFactor?: number;\n /** Multiplies the weeks. */\n weeksFactor?: number;\n /** Engineers added to the team, such as one more to go faster. */\n engineers?: number;\n /** Shown beside the budget when it is picked. */\n tip?: string;\n /** How the summary names it, such as \"a SaaS platform\" or \"payments\". The label when left out. */\n phrase?: string;\n}\n\n/** One question. */\nexport interface EstimatorQuestion {\n id: string;\n heading: string;\n hint?: string;\n /** `one` picks one card, `many` picks any number, and `scale` is a slider across the choices in order. */\n kind: 'one' | 'many' | 'scale';\n choices: EstimatorChoice[];\n /** The choices picked at the start. A `one` or `scale` question takes the first id; with none, its first choice. */\n start?: string[];\n /** A short name for the question in the summary that is sent on, such as \"Polish\". Left out of it when there is none. */\n short?: string;\n /** For a `many` question, whether the summary lists what was picked, as in \"with payments and AI features\". Yes when left out. */\n inSummary?: boolean;\n}\n\n/** A band of cost: the first band whose `below` the cost is under applies, or the last one. */\nexport interface EstimatorBand {\n below?: number;\n /** For a team band, how many engineers. */\n engineers?: number;\n /** For a way-of-working band, what it is called. */\n text?: string;\n}\n\n/** One part of the timeline. The part with no share takes the weeks the others leave. */\nexport interface EstimatorPhase {\n label: string;\n /** Its share of the weeks, such as 0.1. At least one week either way. */\n share?: number;\n}\n\n/** What an estimate came to, as the `impakt-estimate` event carries it. */\nexport interface EstimateResult {\n low: number;\n high: number;\n weeks: number;\n engineers: number;\n way: string;\n summary: string;\n /** The ids picked for each question. */\n answers: Record<string, string[]>;\n}\n\nconst sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);\nconst bandFor = (bands: EstimatorBand[], cost: number): EstimatorBand | undefined =>\n bands.find((b) => typeof b.below === 'number' && cost < b.below) ?? bands.at(-1);\n\n/** The arithmetic, apart from the element so it can be checked on its own. */\nexport function estimate(\n questions: EstimatorQuestion[],\n answers: Record<string, string[]>,\n rules: { low: number; high: number; minWeeks: number; teams: EstimatorBand[]; ways: EstimatorBand[] },\n): { cost: number; low: number; high: number; weeks: number; engineers: number; way: string } {\n const chosen = questions.flatMap((q) => (answers[q.id] ?? []).flatMap((id) => q.choices.filter((c) => c.id === id)));\n let cost = sum(chosen.map((c) => c.cost ?? 0));\n let weeks = sum(chosen.map((c) => c.weeks ?? 0));\n for (const c of chosen) { cost *= c.costFactor ?? 1; weeks *= c.weeksFactor ?? 1; }\n const engineers = (bandFor(rules.teams, cost)?.engineers ?? 1) + sum(chosen.map((c) => c.engineers ?? 0));\n return {\n cost,\n low: Math.round(cost * rules.low),\n high: Math.round(cost * rules.high),\n weeks: Math.max(rules.minWeeks, Math.round(weeks)),\n engineers,\n way: bandFor(rules.ways, cost)?.text ?? '',\n };\n}\n\n/** The weeks each part of the timeline takes, adding up to the whole. */\nexport function phaseWeeks(phases: EstimatorPhase[], weeks: number): number[] {\n const fixed = phases.map((p) => (typeof p.share === 'number' ? Math.max(1, Math.round(weeks * p.share)) : 0));\n const rest = Math.max(1, weeks - sum(fixed));\n return phases.map((p, i) => (typeof p.share === 'number' ? fixed[i]! : rest));\n}\n\n/**\n * Asks a few questions one at a time and keeps a budget beside them that moves\n * with every answer, then shows the estimate: the range, the weeks, how long\n * each part takes, the team and the way of working. The visitor can send the\n * estimate on to a contact page, where a message box can start with it.\n *\n * @category form\n * @icon calculator\n * @fires {CustomEvent<EstimateResult>} impakt-estimate - When the estimate is sent on. The result is in detail.\n */\nexport class ImpaktEstimator extends ImpaktElement {\n static properties = {\n questions: { type: Array },\n teams: { type: Array },\n ways: { type: Array },\n phases: { type: Array },\n low: { type: Number },\n high: { type: Number },\n minWeeks: { type: Number, attribute: 'min-weeks' },\n currency: { type: String },\n unit: { type: Number },\n intro: { type: String },\n budgetLabel: { type: String, attribute: 'budget-label' },\n resultHeading: { type: String, attribute: 'result-heading' },\n teamText: { type: String, attribute: 'team-text' },\n teamTextOne: { type: String, attribute: 'team-text-one' },\n note: { type: String },\n contactHref: { type: String, attribute: 'contact-href' },\n sendLabel: { type: String, attribute: 'send-label' },\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\n /** The questions, in the order they are asked. */\n declare questions: EstimatorQuestion[];\n /** How many engineers each band of cost needs. */\n declare teams: EstimatorBand[];\n /** The way of working for each band of cost. */\n declare ways: EstimatorBand[];\n /** The parts of the timeline, in order. */\n declare phases: EstimatorPhase[];\n /** The low end of the range, as a share of the cost. */\n declare low: number;\n /** The high end of the range, as a share of the cost. */\n declare high: number;\n /** The fewest weeks an estimate says. */\n declare minWeeks: number;\n /** The currency the cost is in, such as GBP. */\n declare currency: string;\n /** What one unit of cost is worth, such as 1000 when the costs are in thousands. */\n declare unit: number;\n /** Beside the budget before anything is picked, such as \"Start by telling us what you are building.\" */\n declare intro: string;\n declare budgetLabel: string;\n declare resultHeading: string;\n /** The team, with {n} for the number of engineers. */\n declare teamText: string;\n /** The team when it has one engineer. */\n declare teamTextOne: string;\n /** A line under the result, such as how accurate it is. */\n declare note: string;\n /** Where the estimate is sent on to. With none, there is no button to send it. */\n declare contactHref: string;\n declare sendLabel: string;\n /** The level of each question's heading. */\n declare headingLevel: number;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n private at = 0;\n private answers: Record<string, string[]> = {};\n private tip = '';\n private copied = '';\n private started = false;\n\n constructor() {\n super();\n this.questions = [];\n this.teams = [];\n this.ways = [];\n this.phases = [];\n this.low = 0.85;\n this.high = 1.25;\n this.minWeeks = 1;\n this.currency = 'GBP';\n this.unit = 1;\n this.intro = '';\n this.budgetLabel = 'Indicative budget';\n this.resultHeading = 'Your estimate';\n this.teamText = '{n} engineers';\n this.teamTextOne = '1 engineer';\n this.note = '';\n this.contactHref = '';\n this.sendLabel = 'Send this to us';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, spaceAround, focusRing, css`\n :host { display: block; container-type: inline-size; }\n [hidden] { display: none !important; }\n .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${space(10)}; align-items: start; }\n .mono { font-family: ${t.fontMono}; font-size: ${fontSize('xs')}; letter-spacing: 0.04em; text-transform: uppercase; color: ${t.textMuted}; margin: 0; }\n .sr-only { ${visuallyHidden} }\n\n .progress { display: grid; gap: ${space(2)}; margin-block-end: ${space(6)}; }\n .bar { block-size: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }\n .bar i { display: block; block-size: 100%; background: ${t.brand}; transition: inline-size 300ms ease; }\n\n fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; }\n .q { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; ${type('3xl')} letter-spacing: ${t.trackingTight}; color: ${t.textHeading}; outline: none; }\n .hint { margin: 0 0 ${space(6)}; color: ${t.textMuted}; }\n\n .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(3)}; }\n .choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n .choice { position: relative; display: grid; gap: ${space(1)}; align-content: start; padding: ${space(4)}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }\n .choice:hover { border-color: ${t.borderStrong}; }\n .choice input { ${visuallyHidden} }\n .choice:has(input:checked) { border-color: ${t.brand}; box-shadow: inset 0 0 0 1px ${t.brand}; background: ${t.brandSubtle}; }\n .choice:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }\n .many .choice { padding: ${space(3)}; }\n .label { font-weight: ${fontWeight('semibold')}; }\n .small { ${type('sm')} color: ${t.textMuted}; }\n /* A tick for a picked feature, drawn in the corner. */\n .many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${space(2)}; inset-inline-end: ${space(3)}; color: ${t.brand}; font-weight: ${fontWeight('bold')}; }\n\n .scale { display: grid; gap: ${space(3)}; }\n .scale input { inline-size: 100%; accent-color: ${t.brand}; ${targetSize} }\n .ticks { display: flex; justify-content: space-between; ${type('sm')} color: ${t.textMuted}; }\n .ticks span[aria-current] { color: ${t.text}; font-weight: ${fontWeight('semibold')}; }\n .now { margin: 0; }\n\n .nav { display: flex; gap: ${space(3)}; margin-block-start: ${space(8)}; }\n button, .send { ${targetSize} display: inline-flex; align-items: center; justify-content: center; gap: ${space(2)}; padding: ${space(2.5)} ${space(5)}; border-radius: ${t.radiusLg}; font: inherit; font-weight: ${fontWeight('semibold')}; cursor: pointer; text-decoration: none; border: ${t.borderThin} solid transparent; }\n .primary, .send { background: ${t.brand}; color: ${t.onBrand}; }\n .primary:hover, .send:hover { background: ${t.brandHover}; }\n .secondary { background: transparent; color: ${t.text}; border-color: ${t.borderStrong}; }\n .secondary:hover { background: ${t.surfaceSubtle}; }\n\n .panel { position: sticky; inset-block-start: ${space(6)}; overflow: hidden; isolation: isolate; padding: ${space(8)}; border-radius: ${t.radiusXl}; background: ${t.surfaceCard}; box-shadow: ${t.shadowMd}; display: grid; gap: ${space(2)}; }\n /* The glow behind the budget grows as the product does. */\n .glow { position: absolute; z-index: -1; inset-block-start: -40%; inset-inline-end: -30%; inline-size: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, ${unsafeCSS(toneOf(1, 0))} 45%, transparent), color-mix(in srgb, ${unsafeCSS(toneOf(2, 1))} 25%, transparent) 45%, transparent 70%); transform: scale(var(--s, 0.7)); transform-origin: 70% 30%; transition: transform 500ms cubic-bezier(.2, .8, .2, 1); pointer-events: none; }\n .range { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; font-size: ${fontSize('5xl')}; line-height: 1; letter-spacing: ${t.trackingTight}; color: ${t.textHeading}; }\n .weeks { margin: 0; ${type('lg')} }\n .tip { margin: ${space(4)} 0 0; padding-block-start: ${space(4)}; border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent); color: ${t.textMuted}; }\n\n .result { display: grid; gap: ${space(6)}; }\n .summary { margin: 0; ${type('xl')} text-wrap: pretty; }\n .phases { display: flex; gap: 3px; block-size: 14px; border-radius: 7px; overflow: hidden; }\n .phases i { display: block; }\n .legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${space(2)} ${space(5)}; }\n .legend li { display: inline-flex; align-items: center; gap: ${space(2)}; }\n .legend li::before { content: ''; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--c); }\n dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(4)}; }\n dt { margin: 0 0 ${space(1)}; }\n dd { margin: 0; font-weight: ${fontWeight('semibold')}; }\n .actions { display: flex; flex-wrap: wrap; gap: ${space(3)}; }\n .note { margin: 0; ${type('sm')} color: ${t.textMuted}; }\n .status { margin: 0; ${type('sm')} }\n\n @container (max-width: 48rem) {\n .wrap { grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; }\n /* Not sticky once the panel is under the questions, but still the glow's containing block, so the panel clips it\n and it never widens the page (1.4.10). */\n .panel { position: relative; inset-block-start: auto; }\n .choices.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n }\n @container (max-width: 30rem) {\n .choices { grid-template-columns: minmax(0, 1fr); }\n .range { font-size: ${fontSize('4xl')}; }\n }\n @media (forced-colors: active) {\n .choice:has(input:checked) { outline: 3px solid Highlight; }\n .bar i, .phases i, .legend li::before { background: CanvasText !important; }\n .glow { display: none; }\n }\n `];\n\n /** The answers each question starts with. */\n private reset(): void {\n this.answers = Object.fromEntries((this.questions ?? []).map((q) => {\n const ids = (q.start ?? []).filter((id) => q.choices.some((c) => c.id === id));\n if (q.kind === 'many') return [q.id, ids];\n return [q.id, [ids[0] ?? q.choices[0]?.id].filter((x): x is string => Boolean(x))];\n }));\n this.at = 0;\n this.tip = '';\n this.copied = '';\n }\n\n protected willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('questions') || !this.started) { this.reset(); this.started = true; }\n }\n\n private get rules() {\n return { low: this.low, high: this.high, minWeeks: this.minWeeks, teams: this.teams ?? [], ways: this.ways ?? [] };\n }\n\n private money(n: number): string {\n try {\n return new Intl.NumberFormat(pageLocale(this), { style: 'currency', currency: this.currency || 'GBP', notation: 'compact', maximumFractionDigits: 0 }).format(n * (this.unit || 1));\n } catch {\n return String(n * (this.unit || 1));\n }\n }\n\n private listOf(words: string[]): string {\n try { return new Intl.ListFormat(pageLocale(this), { type: 'conjunction' }).format(words); } catch { return words.join(', '); }\n }\n\n private weeksWord(n: number): string { return n === 1 ? say('{n} week', { n }) : say('{n} weeks', { n }); }\n\n /** The largest the budget can be, so the glow is full size at it. */\n private get most(): number {\n const qs = this.questions ?? [];\n const answers = Object.fromEntries(qs.map((q) => {\n if (q.kind === 'many') return [q.id, q.choices.map((c) => c.id)];\n const best = [...q.choices].sort((a, b) => ((b.cost ?? 0) * (b.costFactor ?? 1)) - ((a.cost ?? 0) * (a.costFactor ?? 1)))[0];\n return [q.id, best ? [best.id] : []];\n }));\n return estimate(qs, answers, this.rules).high || 1;\n }\n\n private summaryOf(r: ReturnType<typeof estimate>): string {\n const qs = this.questions ?? [];\n const one = qs.find((q) => q.kind === 'one');\n const thing = one ? one.choices.find((c) => c.id === this.answers[one.id]?.[0]) : undefined;\n const many = qs.filter((q) => q.kind === 'many' && q.inSummary !== false).flatMap((q) => (this.answers[q.id] ?? []).map((id) => { const c = q.choices.find((x) => x.id === id); return c ? (c.phrase || c.label) : id; }));\n const name = thing ? (thing.phrase || thing.label) : '';\n const first = !name ? '' : many.length ? say('You are building {thing} with {list}.', { thing: name, list: this.listOf(many) }) : say('You are building {thing}.', { thing: name });\n const rest = say('Expect {range} and about {weeks} to a first release.', { range: this.rangeOf(r), weeks: this.weeksWord(r.weeks) });\n return first ? `${first} ${rest}` : rest;\n }\n\n private rangeOf(r: { low: number; high: number }): string { return say('{low} to {high}', { low: this.money(r.low), high: this.money(r.high) }); }\n private teamOf(n: number): string { return n === 1 ? this.teamTextOne : this.teamText.replace('{n}', String(n)); }\n\n private pick(q: EstimatorQuestion, choice: EstimatorChoice, on: boolean): void {\n const now = this.answers[q.id] ?? [];\n this.answers = { ...this.answers, [q.id]: q.kind === 'many' ? (on ? [...now.filter((id) => id !== choice.id), choice.id] : now.filter((id) => id !== choice.id)) : [choice.id] };\n if (on && choice.tip) this.tip = choice.tip;\n this.requestUpdate();\n }\n\n private go(to: number): void {\n const last = (this.questions ?? []).length;\n this.at = Math.max(0, Math.min(last, to));\n this.copied = '';\n this.requestUpdate();\n void this.updateComplete.then(() => (this.renderRoot.querySelector('.current .q') as HTMLElement | null)?.focus({ preventScroll: true }));\n }\n\n private result(): EstimateResult {\n const r = estimate(this.questions ?? [], this.answers, this.rules);\n return { low: r.low * (this.unit || 1), high: r.high * (this.unit || 1), weeks: r.weeks, engineers: r.engineers, way: r.way, summary: this.textOf(r), answers: this.answers };\n }\n\n /** The estimate as words to send or copy. */\n private textOf(r: ReturnType<typeof estimate>): string {\n const parts = [this.summaryOf(r), `${this.teamOf(r.engineers)}.`];\n if (r.way) parts.push(`${r.way}.`);\n const picked = (this.questions ?? []).filter((q) => q.short && q.kind !== 'many').map((q) => {\n const c = q.choices.find((x) => x.id === this.answers[q.id]?.[0]);\n return c ? `${q.short}: ${c.label}.` : '';\n }).filter(Boolean);\n const many = (this.questions ?? []).filter((q) => q.short && q.kind === 'many' && q.inSummary === false).map((q) => {\n const labels = (this.answers[q.id] ?? []).map((id) => q.choices.find((x) => x.id === id)?.label ?? id);\n return labels.length ? `${q.short}: ${this.listOf(labels)}.` : '';\n }).filter(Boolean);\n return [...parts, ...many, ...picked].join(' ');\n }\n\n private send(e: Event): void {\n const result = this.result();\n try { sessionStorage.setItem('impakt.estimate', result.summary); } catch { /* storage can be blocked; the link still goes */ }\n const go = this.dispatchEvent(new CustomEvent('impakt-estimate', { detail: result, bubbles: true, composed: true, cancelable: true }));\n if (!go) e.preventDefault();\n }\n\n private async copy(): Promise<void> {\n const text = this.result().summary;\n try {\n await navigator.clipboard.writeText(text);\n this.copied = say('Summary copied.');\n } catch {\n this.copied = say('Copying is blocked here. Select the summary above instead.');\n }\n this.requestUpdate();\n }\n\n private heading(text: string): TemplateResult {\n const l = Math.min(Math.max(this.headingLevel || 2, 2), 6);\n return html`<div class=\"q\" role=\"heading\" aria-level=${l} tabindex=\"-1\">${text}</div>`;\n }\n\n private renderQuestion(q: EstimatorQuestion, i: number): TemplateResult {\n const picked = this.answers[q.id] ?? [];\n const current = i === this.at;\n if (q.kind === 'scale') {\n const index = Math.max(0, q.choices.findIndex((c) => c.id === picked[0]));\n const chosen = q.choices[index];\n return html`<fieldset class=${current ? 'current' : ''} ?hidden=${!current}>\n <legend>${this.heading(q.heading)}</legend>\n ${q.hint ? html`<p class=\"hint\">${q.hint}</p>` : nothing}\n <div class=\"scale\">\n <input type=\"range\" min=\"0\" max=${Math.max(0, q.choices.length - 1)} step=\"1\" .value=${String(index)} aria-label=${q.heading} aria-valuetext=${chosen?.label ?? ''}\n @input=${(e: Event) => { const c = q.choices[Number((e.target as HTMLInputElement).value)]; if (c) this.pick(q, c, true); }}>\n <div class=\"ticks\" aria-hidden=\"true\">${q.choices.map((c, k) => html`<span aria-current=${k === index ? 'true' : nothing}>${c.label}</span>`)}</div>\n ${chosen?.hint ? html`<p class=\"now\">${chosen.hint}</p>` : nothing}\n </div>\n </fieldset>`;\n }\n const many = q.kind === 'many';\n return html`<fieldset class=${current ? 'current' : ''} ?hidden=${!current}>\n <legend>${this.heading(q.heading)}</legend>\n ${q.hint ? html`<p class=\"hint\">${q.hint}</p>` : nothing}\n <div class=\"choices ${many ? 'many' : ''}\">\n ${q.choices.map((c) => html`<label class=\"choice\">\n <input type=${many ? 'checkbox' : 'radio'} name=${`${this.uid}-${q.id}`} value=${c.id} .checked=${picked.includes(c.id)}\n @change=${(e: Event) => this.pick(q, c, (e.target as HTMLInputElement).checked)}>\n <span class=\"label\">${c.label}</span>\n ${c.hint ? html`<span class=\"small\">${c.hint}</span>` : nothing}\n </label>`)}\n </div>\n </fieldset>`;\n }\n\n private renderResult(r: ReturnType<typeof estimate>): TemplateResult {\n const weeks = phaseWeeks(this.phases ?? [], r.weeks);\n const current = this.at === (this.questions ?? []).length;\n return html`<div class=\"result ${current ? 'current' : ''}\" ?hidden=${!current}>\n ${this.heading(this.resultHeading)}\n <p class=\"summary\">${this.summaryOf(r)}</p>\n ${(this.phases ?? []).length ? html`\n <div class=\"phases\" aria-hidden=\"true\">${(this.phases ?? []).map((_, i) => html`<i style=${`flex-grow:${weeks[i]};background:${toneOf(undefined, i)}`}></i>`)}</div>\n <ul class=\"legend\">${(this.phases ?? []).map((p, i) => html`<li style=${`--c:${toneOf(undefined, i)}`}>${p.label} <b>${this.weeksWord(weeks[i]!)}</b></li>`)}</ul>` : nothing}\n <dl>\n <div><dt class=\"mono\">${say('Your team')}</dt><dd>${this.teamOf(r.engineers)}</dd></div>\n ${r.way ? html`<div><dt class=\"mono\">${say('Way of working')}</dt><dd>${r.way}</dd></div>` : nothing}\n </dl>\n <div class=\"actions\">\n ${this.contactHref ? html`<a class=\"send\" href=${this.contactHref} @click=${(e: Event) => this.send(e)}>${this.sendLabel} <span aria-hidden=\"true\">→</span></a>` : nothing}\n <button type=\"button\" class=\"secondary\" @click=${() => this.copy()}>${say('Copy summary')}</button>\n <button type=\"button\" class=\"secondary\" @click=${() => { this.reset(); this.go(0); }}>${say('Start again')}</button>\n </div>\n <p class=\"status\" role=\"status\">${this.copied}</p>\n ${this.note ? html`<p class=\"note\">${this.note}</p>` : nothing}\n </div>`;\n }\n\n render(): TemplateResult {\n const qs = this.questions ?? [];\n const total = qs.length;\n const r = estimate(qs, this.answers, this.rules);\n const done = this.at >= total;\n const scale = (0.6 + Math.min(1, r.high / this.most) * 1.1).toFixed(2);\n return html`<div class=\"wrap\">\n <div>\n <div class=\"progress\">\n <p class=\"mono\">${done ? this.resultHeading : say('Step {step} of {steps}', { step: this.at + 1, steps: total })}</p>\n <div class=\"bar\" aria-hidden=\"true\"><i style=${`inline-size:${total ? (done ? 100 : ((this.at + 1) / (total + 1)) * 100) : 0}%`}></i></div>\n </div>\n ${qs.map((q, i) => this.renderQuestion(q, i))}\n ${this.renderResult(r)}\n ${done ? nothing : html`<div class=\"nav\">\n ${this.at > 0 ? html`<button type=\"button\" class=\"secondary\" @click=${() => this.go(this.at - 1)}>${say('Back')}</button>` : nothing}\n <button type=\"button\" class=\"primary\" @click=${() => this.go(this.at + 1)}>${this.at === total - 1 ? say('See my estimate') : say('Next')} <span aria-hidden=\"true\">→</span></button>\n </div>`}\n </div>\n <aside class=\"panel\" part=\"panel\" style=${`--s:${scale}`}>\n <div class=\"glow\" aria-hidden=\"true\"></div>\n <p class=\"mono\">${this.budgetLabel}</p>\n <p class=\"range\" aria-live=\"polite\" aria-atomic=\"true\">${this.rangeOf(r)}</p>\n <p class=\"weeks\">${say('About {weeks} to a first release', { weeks: this.weeksWord(r.weeks) })}</p>\n <p class=\"tip\" aria-live=\"polite\">${this.tip || this.intro}</p>\n </aside>\n </div>`;\n }\n}\n\ncustomElements.define('impakt-estimator', ImpaktEstimator);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-estimator': ImpaktEstimator;\n }\n}\n"],"mappings":";AAUA,SAAS,KAAK,MAAM,SAAS,iBAAsC;AACnE,SAAS,eAAe,YAAY,KAAK,WAAW,YAAY,gBAAgB,UAAU,YAAY,OAAO,aAAa,GAAG,MAAM,cAAc;AAoEjJ,IAAM,MAAM,CAAC,OAAiB,GAAG,OAAO,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC;AAC1D,IAAM,UAAU,CAAC,OAAwB,SACvC,MAAM,KAAK,CAAC,MAAM,OAAO,EAAE,UAAU,YAAY,OAAO,EAAE,KAAK,KAAK,MAAM,GAAG,EAAE;AAG1E,SAAS,SACd,W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AA;AAAA,gDAEiC,OAAO,KAAK,EAAE;AAAA;AAAA,0BAEpC,KAAK,WAAW;AAAA,iEACuB,KAAK,QAAQ,CAAC,CAAC;AAAA,2BACrD,IAAI,oCAAoC,EAAE,OAAO,KAAK,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAAA,4CAC1D,KAAK,OAAO,KAAK,KAAK;AAAA;AAAA;AAAA,EAGhE;AACF;AAEA,eAAe,OAAO,oBAAoB,eAAe;","names":[]}
@@ -0,0 +1,65 @@
1
+ // packages/blocks/src/components/card-grid.ts
2
+ import { css, html, nothing } from "lit";
3
+ import { ImpaktElement, focusRing, fontSize, fontWeight, lineHeight, space, spaceAround, t, iconSvg } from "@atomic-ui/ui";
4
+ var ImpaktCardGrid = class extends ImpaktElement {
5
+ static {
6
+ this.properties = {
7
+ items: { type: Array },
8
+ columns: { type: String, reflect: true },
9
+ headingLevel: { type: Number, attribute: "heading-level" },
10
+ ratio: { type: String, reflect: true },
11
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
12
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
13
+ };
14
+ }
15
+ constructor() {
16
+ super();
17
+ this.items = [];
18
+ this.columns = "three";
19
+ this.headingLevel = 3;
20
+ this.ratio = "4:3";
21
+ this.spaceAbove = "none";
22
+ this.spaceBelow = "none";
23
+ }
24
+ static {
25
+ this.styles = [...ImpaktElement.styles, focusRing, spaceAround, css`
26
+ :host { display: block; container-type: inline-size; --ratio: 4 / 3; }
27
+ :host([ratio='16:9']) { --ratio: 16 / 9; }
28
+ :host([ratio='3:2']) { --ratio: 3 / 2; }
29
+ :host([ratio='1:1']) { --ratio: 1 / 1; }
30
+ ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
31
+ :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
32
+ :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
33
+ li { position: relative; display: flex; flex-direction: column; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.hairline}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}; overflow: hidden; transition: box-shadow 150ms ease-in-out, transform 150ms ease-in-out; }
34
+ li.linked:hover { box-shadow: ${t.shadowLg}; transform: translateY(-2px); }
35
+ img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
36
+ .words { display: flex; flex-direction: column; gap: ${space(2)}; padding: ${space(5)}; flex: 1; }
37
+ .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-size: ${fontSize("lg")}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; }
38
+ .h a { color: inherit; text-decoration: none; border-radius: ${t.radiusSm}; }
39
+ .h a::after { content: ''; position: absolute; inset: 0; }
40
+ li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }
41
+ .body { margin: 0; line-height: ${lineHeight("normal")}; }
42
+ .badge { align-self: flex-start; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("medium")}; background: ${t.brandSubtle}; color: ${t.brand}; box-shadow: inset 0 0 0 1px ${t.hairline}; }
43
+ .more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${space(1)}; color: ${t.link}; font-weight: ${fontWeight("semibold")}; }
44
+ @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
45
+ @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
46
+ `];
47
+ }
48
+ render() {
49
+ return html`<ul part="list">${(this.items ?? []).map((card) => html`<li class=${card.href ? "linked" : ""} part="card">
50
+ ${card.imageSrc ? html`<img src=${card.imageSrc} alt=${card.imageAlt ?? ""} loading="lazy" />` : nothing}
51
+ <div class="words">
52
+ ${card.badge ? html`<span class="badge">${card.badge}</span>` : nothing}
53
+ <div class="h" role="heading" aria-level=${this.headingLevel}>${card.href ? html`<a href=${card.href}>${card.heading}</a>` : card.heading}</div>
54
+ ${card.text ? html`<p class="body">${card.text}</p>` : nothing}
55
+ ${card.href ? html`<span class="more" aria-hidden="true">${iconSvg("arrow-right", "1em")}</span>` : nothing}
56
+ </div>
57
+ </li>`)}</ul>`;
58
+ }
59
+ };
60
+ customElements.define("impakt-card-grid", ImpaktCardGrid);
61
+
62
+ export {
63
+ ImpaktCardGrid
64
+ };
65
+ //# sourceMappingURL=chunk-F4BTXUYP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/card-grid.ts"],"sourcesContent":["/**\n * A row of linked cards.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement, focusRing, fontSize, fontWeight, lineHeight, space, spaceAround, t, iconSvg } from '@atomic-ui/ui';\n\n/** One card in a row of them. */\nexport interface CardItem {\n id?: string;\n heading: string;\n text?: string;\n imageSrc?: string;\n imageAlt?: string;\n href?: string;\n badge?: string;\n}\n\n/**\n * A row of cards, each a picture, a heading, a line of text and a link: the\n * developments on a developments page, or the house types at one of them.\n *\n * **The whole card is the link's target, and the heading is its name.** The\n * link is on the heading, so a screen reader hears \"Larkfield Meadows, link\"\n * once rather than the whole card read out as one long link, and a pointer\n * can still press anywhere on the card.\n *\n * @category content\n * @icon cards\n */\nexport class ImpaktCardGrid extends ImpaktElement {\n static properties = {\n items: { type: Array },\n columns: { type: String, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n ratio: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: CardItem[];\n declare columns: 'two' | 'three' | 'four';\n /** The level of each card's heading. One below the heading above the cards. */\n declare headingLevel: 2 | 3 | 4;\n /** The shape of each card's picture. */\n declare ratio: '16:9' | '4:3' | '3:2' | '1:1';\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.items = [];\n this.columns = 'three';\n this.headingLevel = 3;\n this.ratio = '4:3';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, spaceAround, css`\n :host { display: block; container-type: inline-size; --ratio: 4 / 3; }\n :host([ratio='16:9']) { --ratio: 16 / 9; }\n :host([ratio='3:2']) { --ratio: 3 / 2; }\n :host([ratio='1:1']) { --ratio: 1 / 1; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n li { position: relative; display: flex; flex-direction: column; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.hairline}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}; overflow: hidden; transition: box-shadow 150ms ease-in-out, transform 150ms ease-in-out; }\n li.linked:hover { box-shadow: ${t.shadowLg}; transform: translateY(-2px); }\n img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }\n .words { display: flex; flex-direction: column; gap: ${space(2)}; padding: ${space(5)}; flex: 1; }\n .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-size: ${fontSize('lg')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; }\n .h a { color: inherit; text-decoration: none; border-radius: ${t.radiusSm}; }\n .h a::after { content: ''; position: absolute; inset: 0; }\n li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }\n .body { margin: 0; line-height: ${lineHeight('normal')}; }\n .badge { align-self: flex-start; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('medium')}; background: ${t.brandSubtle}; color: ${t.brand}; box-shadow: inset 0 0 0 1px ${t.hairline}; }\n .more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${space(1)}; color: ${t.link}; font-weight: ${fontWeight('semibold')}; }\n @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n return html`<ul part=\"list\">${(this.items ?? []).map((card) => html`<li class=${card.href ? 'linked' : ''} part=\"card\">\n ${card.imageSrc ? html`<img src=${card.imageSrc} alt=${card.imageAlt ?? ''} loading=\"lazy\" />` : nothing}\n <div class=\"words\">\n ${card.badge ? html`<span class=\"badge\">${card.badge}</span>` : nothing}\n <div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${card.href ? html`<a href=${card.href}>${card.heading}</a>` : card.heading}</div>\n ${card.text ? html`<p class=\"body\">${card.text}</p>` : nothing}\n ${card.href ? html`<span class=\"more\" aria-hidden=\"true\">${iconSvg('arrow-right', '1em')}</span>` : nothing}\n </div>\n </li>`)}</ul>`;\n }\n}\n\ncustomElements.define('impakt-card-grid', ImpaktCardGrid);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-card-grid': ImpaktCardGrid;\n }\n}\n"],"mappings":";AAGA,SAAS,KAAK,MAAM,eAAoC;AACxD,SAAS,eAAe,WAAW,UAAU,YAAY,YAAY,OAAO,aAAa,GAAG,eAAe;AAyBpG,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,YAAY,EAAE,MAAM,QAAQ,SAAS,MAAM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QAAQ,KAAK,YAAY,EAAE,uBAAuB,OAAO;AAAA;AAAA,UAEpG,KAAK,QAAQ,2BAA2B,KAAK,KAAK,YAAY,OAAO;AAAA,mDAC5B,KAAK,YAAY,IAAI,KAAK,OAAO,eAAe,KAAK,IAAI,IAAI,KAAK,OAAO,SAAS,KAAK,OAAO;AAAA,UACvI,KAAK,OAAO,uBAAuB,KAAK,IAAI,SAAS,OAAO;AAAA,UAC5D,KAAK,OAAO,6CAA6C,QAAQ,eAAe,KAAK,CAAC,YAAY,OAAO;AAAA;AAAA,UAEzG,CAAC;AAAA,EACT;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
@@ -0,0 +1,193 @@
1
+ // packages/blocks/src/components/site.ts
2
+ import { css, html, nothing } from "lit";
3
+ import { ImpaktElement, focusRing, hideOn, fontSize, fontWeight, space, t, type, toneOf } from "@atomic-ui/ui";
4
+ var STRIPE = [0, 1, 2, 3, 4];
5
+ var MONO = t.fontMono;
6
+ var ImpaktSiteHeader = class extends ImpaktElement {
7
+ static {
8
+ this.properties = {
9
+ brand: { type: String },
10
+ logoSrc: { type: String, attribute: "logo-src" },
11
+ logoAlt: { type: String, attribute: "logo-alt" },
12
+ home: { type: String },
13
+ badge: { type: String },
14
+ meta: { type: String },
15
+ links: { type: Array },
16
+ label: { type: String },
17
+ menuText: { type: String, attribute: "menu-text" },
18
+ status: { type: String },
19
+ statusMeta: { type: String, attribute: "status-meta" },
20
+ statusTone: { type: String, attribute: "status-tone" },
21
+ actionText: { type: String, attribute: "action-text" },
22
+ actionHref: { type: String, attribute: "action-href" }
23
+ };
24
+ }
25
+ constructor() {
26
+ super();
27
+ this.brand = "";
28
+ this.logoSrc = "";
29
+ this.logoAlt = "";
30
+ this.home = "/";
31
+ this.badge = "";
32
+ this.meta = "";
33
+ this.links = [];
34
+ this.label = "Main";
35
+ this.menuText = "Menu";
36
+ this.status = "";
37
+ this.statusMeta = "";
38
+ this.statusTone = "success";
39
+ this.actionText = "";
40
+ this.actionHref = "";
41
+ }
42
+ static {
43
+ this.styles = [...ImpaktElement.styles, focusRing, css`
44
+ :host { display: block; container-type: inline-size; }
45
+ .bar { display: flex; align-items: center; gap: ${space(6)}; }
46
+ .start { display: flex; align-items: center; gap: ${space(3)}; flex: none; }
47
+ .middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }
48
+ .middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }
49
+ slot { display: contents; }
50
+ .brand { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight("semibold")}; ${type("2xl")} letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }
51
+ .brand img { display: block; block-size: 32px; inline-size: auto; }
52
+ .chip { display: inline-flex; align-items: center; gap: ${space(1)}; padding: 2px ${space(2)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${MONO}; font-size: ${fontSize("xs")}; }
53
+ .chip svg { inline-size: 12px; block-size: 12px; }
54
+ .meta { font-family: ${MONO}; font-size: ${fontSize("xs")}; opacity: 0.72; }
55
+ .middle impakt-nav { flex: 1 1 8rem; }
56
+ .end { display: flex; align-items: center; gap: ${space(3)}; flex: none; }
57
+ .end:empty, .start:empty { display: none; }
58
+ .status { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border: ${t.borderThin} solid ${t.border}; border-radius: 999px; background: ${t.surfaceCard}; font-family: ${MONO}; font-size: ${fontSize("xs")}; white-space: nowrap; }
59
+ .status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }
60
+ .status .hash { opacity: 0.72; }
61
+ @container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${space(3)}; } }
62
+ `];
63
+ }
64
+ act() {
65
+ this.dispatchEvent(new CustomEvent("impakt-action", { bubbles: true, composed: true }));
66
+ }
67
+ render() {
68
+ const wordmark = this.logoSrc ? html`<img src=${this.logoSrc} alt=${this.logoAlt || this.brand} />` : html`${this.brand}`;
69
+ return html`<div class="bar" part="bar">
70
+ <div class="start"><slot name="start">
71
+ ${this.brand || this.logoSrc ? html`<a class="brand" href=${this.home || "/"} part="brand">${wordmark}</a>` : nothing}
72
+ ${this.badge ? html`<span class="chip" part="badge"><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>${this.badge}</span>` : nothing}
73
+ ${this.meta ? html`<span class="meta" part="meta">${this.meta}</span>` : nothing}
74
+ </slot></div>
75
+ <div class="middle"><slot name="middle">${(this.links ?? []).length ? html`<impakt-nav align="center" size="sm" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impakt-nav>` : nothing}</slot></div>
76
+ <div class="end"><slot name="end">
77
+ ${this.status ? html`<span class="status" part="status" style=${`--tone:${toneOf(this.statusTone, 0)}`}><span class="dot" aria-hidden="true"></span>${this.status}${this.statusMeta ? html` <span class="hash">${this.statusMeta}</span>` : nothing}</span>` : nothing}
78
+ ${this.actionText ? html`<impakt-button variant="primary" icon-after="arrow-right" href=${this.actionHref || nothing} @click=${this.act}>${this.actionText}</impakt-button>` : nothing}
79
+ </slot></div>
80
+ </div>`;
81
+ }
82
+ };
83
+ var ImpaktWordmark = class extends ImpaktElement {
84
+ static {
85
+ this.properties = {
86
+ text: { type: String },
87
+ src: { type: String },
88
+ alt: { type: String },
89
+ href: { type: String },
90
+ size: { type: String, reflect: true },
91
+ hideOn: { type: String, reflect: true, attribute: "hide-on" }
92
+ };
93
+ }
94
+ constructor() {
95
+ super();
96
+ this.text = "";
97
+ this.src = "";
98
+ this.alt = "";
99
+ this.href = "/";
100
+ this.size = "md";
101
+ this.hideOn = "never";
102
+ }
103
+ static {
104
+ this.styles = [...ImpaktElement.styles, focusRing, hideOn, css`
105
+ :host { display: inline-flex; align-items: center; flex: none; }
106
+ a { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight("semibold")}; letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }
107
+ :host([size='sm']) a { ${type("xl")} } :host([size='md']) a { ${type("2xl")} } :host([size='lg']) a { ${type("3xl")} }
108
+ img { display: block; block-size: 32px; inline-size: auto; }
109
+ @media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${type("xl")} } }
110
+ `];
111
+ }
112
+ render() {
113
+ return html`<a href=${this.href || "/"} part="link">${this.src ? html`<img src=${this.src} alt=${this.alt || this.text || this.textContent?.trim() || ""} />` : html`<slot>${this.text}</slot>`}</a>`;
114
+ }
115
+ };
116
+ var ImpaktSiteFooter = class extends ImpaktElement {
117
+ static {
118
+ this.properties = {
119
+ brand: { type: String },
120
+ log: { type: Array },
121
+ columns: { type: Array },
122
+ columnsOnPhone: { type: String, attribute: "columns-on-phone", reflect: true },
123
+ legal: { type: String },
124
+ stripe: { type: Boolean, reflect: true },
125
+ headingLevel: { type: Number, attribute: "heading-level" }
126
+ };
127
+ }
128
+ constructor() {
129
+ super();
130
+ this.brand = "";
131
+ this.log = [];
132
+ this.columns = [];
133
+ this.columnsOnPhone = "shown";
134
+ this.legal = "";
135
+ this.stripe = false;
136
+ this.headingLevel = 2;
137
+ }
138
+ static {
139
+ this.styles = [...ImpaktElement.styles, focusRing, css`
140
+ /* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */
141
+ :host { display: block; container-type: inline-size; position: relative; padding-block: ${space(8)} ${space(4)}; margin-block-end: calc(-1 * ${space(8)}); }
142
+ .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${space(10)}; }
143
+ .brand { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }
144
+ ul { list-style: none; margin: 0; padding: 0; }
145
+ .log { margin-block-start: ${space(8)}; display: grid; gap: ${space(3)}; font-family: ${MONO}; font-size: ${fontSize("sm")}; }
146
+ .log li { display: flex; align-items: center; gap: ${space(3)}; opacity: 0.72; }
147
+ .log li:first-child { opacity: 1; }
148
+ .log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }
149
+ .log .code { margin-inline-end: ${space(3)}; }
150
+ .columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${space(8)}; }
151
+ .h { margin: 0 0 ${space(4)}; font-family: ${MONO}; font-size: ${fontSize("xs")}; font-weight: ${fontWeight("medium")}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }
152
+ .columns ul { display: grid; gap: ${space(3)}; }
153
+ a { color: inherit; text-decoration: none; font-weight: ${fontWeight("medium")}; border-radius: ${t.radiusSm}; }
154
+ a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
155
+ .legal { margin: ${space(16)} 0 0; font-family: ${MONO}; font-size: ${fontSize("xs")}; opacity: 0.72; }
156
+ .stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }
157
+ .stripe span { flex: 1; }
158
+ @container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
159
+ @container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }
160
+ @media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }
161
+ `];
162
+ }
163
+ heading(text) {
164
+ const level = Math.min(Math.max(this.headingLevel || 2, 2), 4);
165
+ return level === 3 ? html`<h3 class="h">${text}</h3>` : level === 4 ? html`<h4 class="h">${text}</h4>` : html`<h2 class="h">${text}</h2>`;
166
+ }
167
+ render() {
168
+ const log = this.log ?? [];
169
+ return html`<div part="footer">
170
+ <div class="top">
171
+ <div>
172
+ ${this.brand ? html`<p class="brand" part="brand">${this.brand}</p>` : nothing}
173
+ ${log.length ? html`<ul class="log" part="log">${log.map((line, i) => html`<li style=${`--tone:${toneOf(line.tone ?? (i === 0 ? "success" : "accent"), i)}`}><span class="dot" aria-hidden="true"></span><span>${line.meta ? html`<span class="code">${line.meta}</span>` : nothing}${line.text}</span></li>`)}</ul>` : nothing}
174
+ </div>
175
+ <div class="columns" part="columns" style=${`--count:${Math.max(1, (this.columns ?? []).length)}`}>
176
+ ${(this.columns ?? []).map((column) => html`<div>${this.heading(column.heading)}<ul>${(column.links ?? []).map((link) => html`<li><a href=${link.href}>${link.label}</a></li>`)}</ul></div>`)}
177
+ </div>
178
+ </div>
179
+ ${this.legal ? html`<p class="legal" part="legal">${this.legal}</p>` : nothing}
180
+ ${this.stripe ? html`<div class="stripe" aria-hidden="true">${STRIPE.map((i) => html`<span style=${`background:${toneOf(void 0, i)}`}></span>`)}</div>` : nothing}
181
+ </div>`;
182
+ }
183
+ };
184
+ customElements.define("impakt-site-header", ImpaktSiteHeader);
185
+ customElements.define("impakt-wordmark", ImpaktWordmark);
186
+ customElements.define("impakt-site-footer", ImpaktSiteFooter);
187
+
188
+ export {
189
+ ImpaktSiteHeader,
190
+ ImpaktWordmark,
191
+ ImpaktSiteFooter
192
+ };
193
+ //# sourceMappingURL=chunk-MYTYMOH6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/site.ts"],"sourcesContent":["/**\n * A site's own header and footer, drawn as one piece each, for the layout's\n * header and footer slots, and the wordmark that starts a header.\n *\n * The chip that sits beside a wordmark is a product component, `impakt-chip`,\n * and comes from `@atomic-ui/ui`.\n *\n * The page frame (`impakt-page`) gives them their landmarks, so neither draws a\n * `<header>` or `<footer>` of its own: a second banner would be one a screen\n * reader announces twice.\n */\nimport { css, html, nothing, type TemplateResult } from 'lit';\n// The base, the tokens and the nav and button these draw come from @atomic-ui/ui, which defines its elements on import.\nimport { ImpaktElement, focusRing, hideOn, fontSize, fontWeight, space, t, type, toneOf, type NavLink, type Tone } from '@atomic-ui/ui';\n\n/** The footer stripe's colours, left to right. */\n/** The stripe's segments take the brand's chart colours in order. */\nconst STRIPE = [0, 1, 2, 3, 4];\n\n/** Code-like labels: a branch, a hash, a commit message. */\nconst MONO = t.fontMono;\n\n// Quieter words are faded to 0.72, no further: that keeps them at 4.5:1 on the page and card colours (1.4.3).\n\n\n/**\n * The site header: the brand, the main links and one call to action, with an\n * optional chip beside the brand and a status before the action.\n *\n * The links fold behind a Menu button when they do not fit, as `impakt-nav`\n * does. The chip and the status are labels, not controls, and they are left\n * out on a phone so the brand, the menu and the action keep the row.\n *\n * **Build your own.** Place components in its three slots, start, middle and\n * end, and each slot that holds something replaces what the props draw there:\n * a wordmark and chips at the start, a nav in the middle, a status and a\n * button at the end, in any order. Give a component `hideOn: 'phone'` to leave\n * it out on a phone, so the phone's header is built from the same pieces.\n *\n * @category layout\n * @icon header\n * @slot start - The brand: a wordmark or logo, and any chips beside it.\n * @slot middle - The links, usually one nav.\n * @slot end - A status and the call to action.\n * @fires {CustomEvent<null>} impakt-action - When the call to action is pressed.\n */\nexport class ImpaktSiteHeader extends ImpaktElement {\n static properties = {\n brand: { type: String },\n logoSrc: { type: String, attribute: 'logo-src' },\n logoAlt: { type: String, attribute: 'logo-alt' },\n home: { type: String },\n badge: { type: String },\n meta: { type: String },\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n status: { type: String },\n statusMeta: { type: String, attribute: 'status-meta' },\n statusTone: { type: String, attribute: 'status-tone' },\n actionText: { type: String, attribute: 'action-text' },\n actionHref: { type: String, attribute: 'action-href' },\n };\n /** The site's name, set as a wordmark when there is no logo picture. */\n declare brand: string;\n /** A logo picture, used instead of the wordmark. */\n declare logoSrc: string;\n /** What the logo says. Leave empty to use the brand name. */\n declare logoAlt: string;\n /** Where the brand links to. */\n declare home: string;\n /** A short chip beside the brand, such as \"main\". */\n declare badge: string;\n /** A code-like line after the chip, such as a commit hash. */\n declare meta: string;\n declare links: NavLink[];\n /** The name of the links' landmark. */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /** A status before the action, such as the stage the site is at. */\n declare status: string;\n /** A code-like line in the status, such as a hash. */\n declare statusMeta: string;\n declare statusTone: Tone;\n declare actionText: string;\n declare actionHref: string;\n\n constructor() {\n super();\n this.brand = '';\n this.logoSrc = '';\n this.logoAlt = '';\n this.home = '/';\n this.badge = '';\n this.meta = '';\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.status = '';\n this.statusMeta = '';\n this.statusTone = 'success';\n this.actionText = '';\n this.actionHref = '';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; container-type: inline-size; }\n .bar { display: flex; align-items: center; gap: ${space(6)}; }\n .start { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .middle { flex: 1 1 8rem; min-inline-size: 0; display: flex; align-items: center; justify-content: center; }\n .middle ::slotted(*) { flex: 1 1 auto; min-inline-size: 0; }\n slot { display: contents; }\n .brand { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; ${type('2xl')} letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n .brand img { display: block; block-size: 32px; inline-size: auto; }\n .chip { display: inline-flex; align-items: center; gap: ${space(1)}; padding: 2px ${space(2)}; border-radius: ${t.radius}; background: color-mix(in srgb, currentColor 7%, transparent); font-family: ${MONO}; font-size: ${fontSize('xs')}; }\n .chip svg { inline-size: 12px; block-size: 12px; }\n .meta { font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; }\n .middle impakt-nav { flex: 1 1 8rem; }\n .end { display: flex; align-items: center; gap: ${space(3)}; flex: none; }\n .end:empty, .start:empty { display: none; }\n .status { display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border: ${t.borderThin} solid ${t.border}; border-radius: 999px; background: ${t.surfaceCard}; font-family: ${MONO}; font-size: ${fontSize('xs')}; white-space: nowrap; }\n .status .dot { inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--tone); }\n .status .hash { opacity: 0.72; }\n @container (max-width: 56rem) { .chip, .meta, .status { display: none; } .bar { gap: ${space(3)}; } }\n `];\n\n private act(): void {\n this.dispatchEvent(new CustomEvent('impakt-action', { bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const wordmark = this.logoSrc\n ? html`<img src=${this.logoSrc} alt=${this.logoAlt || this.brand} />`\n : html`${this.brand}`;\n // Each region shows what is placed in its slot, or, when nothing is, what the props describe.\n return html`<div class=\"bar\" part=\"bar\">\n <div class=\"start\"><slot name=\"start\">\n ${this.brand || this.logoSrc ? html`<a class=\"brand\" href=${this.home || '/'} part=\"brand\">${wordmark}</a>` : nothing}\n ${this.badge ? html`<span class=\"chip\" part=\"badge\"><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>${this.badge}</span>` : nothing}\n ${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}\n </slot></div>\n <div class=\"middle\"><slot name=\"middle\">${(this.links ?? []).length ? html`<impakt-nav align=\"center\" size=\"sm\" .links=${this.links} .label=${this.label} .menuText=${this.menuText}></impakt-nav>` : nothing}</slot></div>\n <div class=\"end\"><slot name=\"end\">\n ${this.status ? html`<span class=\"status\" part=\"status\" style=${`--tone:${toneOf(this.statusTone, 0)}`}><span class=\"dot\" aria-hidden=\"true\"></span>${this.status}${this.statusMeta ? html` <span class=\"hash\">${this.statusMeta}</span>` : nothing}</span>` : nothing}\n ${this.actionText ? html`<impakt-button variant=\"primary\" icon-after=\"arrow-right\" href=${this.actionHref || nothing} @click=${this.act}>${this.actionText}</impakt-button>` : nothing}\n </slot></div>\n </div>`;\n }\n}\n\n/**\n * The site's name as a wordmark, or its logo, linking home: the start of a\n * site header.\n *\n * @category layout\n * @icon logo\n */\nexport class ImpaktWordmark extends ImpaktElement {\n static properties = {\n text: { type: String },\n src: { type: String },\n alt: { type: String },\n href: { type: String },\n size: { type: String, reflect: true },\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n };\n /** The name, set in the heading face. */\n declare text: string;\n /** A logo picture, used instead of the name. */\n declare src: string;\n /** What the logo says. Leave empty to use the name. */\n declare alt: string;\n declare href: string;\n /** Larger on a wide header, smaller on a phone's. */\n declare size: 'sm' | 'md' | 'lg';\n declare hideOn: 'never' | 'phone' | 'wide';\n\n constructor() {\n super();\n this.text = '';\n this.src = '';\n this.alt = '';\n this.href = '/';\n this.size = 'md';\n this.hideOn = 'never';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, hideOn, css`\n :host { display: inline-flex; align-items: center; flex: none; }\n a { color: inherit; text-decoration: none; font-family: ${t.fontHeading}; font-weight: ${fontWeight('semibold')}; letter-spacing: -0.02em; line-height: 1; border-radius: ${t.radiusSm}; }\n :host([size='sm']) a { ${type('xl')} } :host([size='md']) a { ${type('2xl')} } :host([size='lg']) a { ${type('3xl')} }\n img { display: block; block-size: 32px; inline-size: auto; }\n @media (max-width: 40rem) { :host([size='md']) a, :host([size='lg']) a { ${type('xl')} } }\n `];\n\n render(): TemplateResult {\n // The name arrives as the element's words when a page places it, or as `text` when it is set directly.\n return html`<a href=${this.href || '/'} part=\"link\">${this.src ? html`<img src=${this.src} alt=${this.alt || this.text || this.textContent?.trim() || ''} />` : html`<slot>${this.text}</slot>`}</a>`;\n }\n}\n\n/** One line of a footer's log: a code, what it says, and the colour of its dot. */\nexport interface FooterLogLine {\n meta?: string;\n text: string;\n tone?: Tone;\n}\n\n/** A column of footer links under a short heading. */\nexport interface FooterColumn {\n heading: string;\n links: NavLink[];\n}\n\n/**\n * The site footer: the footer band with the brand set large, an optional log of\n * lines beside it, columns of links, a legal line and a stripe of the brand's\n * colours along the foot.\n *\n * Each column is a list under its own heading, so a screen reader can move\n * from one to the next. The log is a list too; its dots are decoration.\n *\n * @category layout\n * @icon footer\n */\nexport class ImpaktSiteFooter extends ImpaktElement {\n static properties = {\n brand: { type: String },\n log: { type: Array },\n columns: { type: Array },\n columnsOnPhone: { type: String, attribute: 'columns-on-phone', reflect: true },\n legal: { type: String },\n stripe: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n };\n /** The site's name, set large. */\n declare brand: string;\n /** Lines set in code type under the brand, newest first. The first is bright. */\n declare log: FooterLogLine[];\n declare columns: FooterColumn[];\n /** `hidden` leaves the link columns out on a phone, so the footer there is the name, the lines and the legal line. */\n declare columnsOnPhone: 'shown' | 'hidden';\n /** The line at the foot, such as the copyright. */\n declare legal: string;\n /** A stripe of the brand's colours along the bottom edge. */\n declare stripe: boolean;\n /** The level of each column's heading. */\n declare headingLevel: 2 | 3 | 4;\n\n constructor() {\n super();\n this.brand = '';\n this.log = [];\n this.columns = [];\n this.columnsOnPhone = 'shown';\n this.legal = '';\n this.stripe = false;\n this.headingLevel = 2;\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n /* The page frame's footer band gives the colours; this sits flush with its foot so the stripe meets the edge. */\n :host { display: block; container-type: inline-size; position: relative; padding-block: ${space(8)} ${space(4)}; margin-block-end: calc(-1 * ${space(8)}); }\n .top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: ${space(10)}; }\n .brand { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; font-size: clamp(3rem, 6vw, 4.5rem); line-height: 1; letter-spacing: -0.03em; }\n ul { list-style: none; margin: 0; padding: 0; }\n .log { margin-block-start: ${space(8)}; display: grid; gap: ${space(3)}; font-family: ${MONO}; font-size: ${fontSize('sm')}; }\n .log li { display: flex; align-items: center; gap: ${space(3)}; opacity: 0.72; }\n .log li:first-child { opacity: 1; }\n .log .dot { flex: none; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--tone); }\n .log .code { margin-inline-end: ${space(3)}; }\n .columns { display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: ${space(8)}; }\n .h { margin: 0 0 ${space(4)}; font-family: ${MONO}; font-size: ${fontSize('xs')}; font-weight: ${fontWeight('medium')}; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.72; }\n .columns ul { display: grid; gap: ${space(3)}; }\n a { color: inherit; text-decoration: none; font-weight: ${fontWeight('medium')}; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n .legal { margin: ${space(16)} 0 0; font-family: ${MONO}; font-size: ${fontSize('xs')}; opacity: 0.72; }\n .stripe { position: absolute; inset-inline: -100vmax; inset-block-end: 0; block-size: 6px; display: flex; }\n .stripe span { flex: 1; }\n @container (max-width: 48rem) { .top { grid-template-columns: 1fr; } .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 40rem) { :host([columns-on-phone='hidden']) .columns { display: none; } }\n @media (forced-colors: active) { :host { border-block-start: 1px solid CanvasText; } .log .dot { border: 1px solid CanvasText; } }\n `];\n\n private heading(text: string): TemplateResult {\n const level = Math.min(Math.max(this.headingLevel || 2, 2), 4);\n return level === 3 ? html`<h3 class=\"h\">${text}</h3>` : level === 4 ? html`<h4 class=\"h\">${text}</h4>` : html`<h2 class=\"h\">${text}</h2>`;\n }\n\n render(): TemplateResult {\n const log = this.log ?? [];\n return html`<div part=\"footer\">\n <div class=\"top\">\n <div>\n ${this.brand ? html`<p class=\"brand\" part=\"brand\">${this.brand}</p>` : nothing}\n ${log.length ? html`<ul class=\"log\" part=\"log\">${log.map((line, i) => html`<li style=${`--tone:${toneOf(line.tone ?? (i === 0 ? 'success' : 'accent'), i)}`}><span class=\"dot\" aria-hidden=\"true\"></span><span>${line.meta ? html`<span class=\"code\">${line.meta}</span>` : nothing}${line.text}</span></li>`)}</ul>` : nothing}\n </div>\n <div class=\"columns\" part=\"columns\" style=${`--count:${Math.max(1, (this.columns ?? []).length)}`}>\n ${(this.columns ?? []).map((column) => html`<div>${this.heading(column.heading)}<ul>${(column.links ?? []).map((link) => html`<li><a href=${link.href}>${link.label}</a></li>`)}</ul></div>`)}\n </div>\n </div>\n ${this.legal ? html`<p class=\"legal\" part=\"legal\">${this.legal}</p>` : nothing}\n ${this.stripe ? html`<div class=\"stripe\" aria-hidden=\"true\">${STRIPE.map((i) => html`<span style=${`background:${toneOf(undefined, i)}`}></span>`)}</div>` : nothing}\n </div>`;\n }\n}\n\ncustomElements.define('impakt-site-header', ImpaktSiteHeader);\ncustomElements.define('impakt-wordmark', ImpaktWordmark);\ncustomElements.define('impakt-site-footer', ImpaktSiteFooter);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-site-header': ImpaktSiteHeader;\n 'impakt-wordmark': ImpaktWordmark;\n 'impakt-site-footer': ImpaktSiteFooter;\n }\n}\n"],"mappings":";AAWA,SAAS,KAAK,MAAM,eAAoC;AAExD,SAAS,eAAe,WAAW,QAAQ,UAAU,YAAY,OAAO,GAAG,MAAM,cAAuC;AAIxH,IAAM,SAAS,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAG7B,IAAM,OAAO,EAAE;AA0BR,IAAM,mBAAN,cAA+B,cAAc;AAAA,EAClD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,MAC/C,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW;AAAA,MAC/C,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,MAAM;AAAA,MAC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