@atomic-ui/ui 0.2.0 → 0.3.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 (159) hide show
  1. package/README.md +81 -96
  2. package/custom-elements.json +851 -56
  3. package/dist/base/FieldElement.d.ts +11 -0
  4. package/dist/base/scroll-lock.d.ts +2 -0
  5. package/dist/base/styles.d.ts +24 -5
  6. package/dist/chunk-2YRTFWW2.js +26 -0
  7. package/dist/chunk-2YRTFWW2.js.map +1 -0
  8. package/dist/{chunk-UNVL3CNM.js → chunk-37PA72FC.js} +4 -4
  9. package/dist/{chunk-UNVL3CNM.js.map → chunk-37PA72FC.js.map} +1 -1
  10. package/dist/{chunk-D6C7XEY4.js → chunk-3KO55PZK.js} +7 -2
  11. package/dist/chunk-3KO55PZK.js.map +1 -0
  12. package/dist/{chunk-7BSZPUE3.js → chunk-3RE4H2XO.js} +2 -2
  13. package/dist/{chunk-R67PDFKE.js → chunk-46BYUQ5A.js} +2 -2
  14. package/dist/{chunk-NCASAXQT.js → chunk-4OYHT4BN.js} +2 -2
  15. package/dist/{chunk-3IQ73WNW.js → chunk-55DK75QF.js} +6 -4
  16. package/dist/chunk-55DK75QF.js.map +1 -0
  17. package/dist/{chunk-TGT7J4EG.js → chunk-5QSTXIPG.js} +2 -2
  18. package/dist/{chunk-HYPPG4NF.js → chunk-7P4Z4CLK.js} +55 -16
  19. package/dist/chunk-7P4Z4CLK.js.map +1 -0
  20. package/dist/{chunk-26O27BQS.js → chunk-APJ5JGRW.js} +3 -3
  21. package/dist/{chunk-WFKSOM6O.js → chunk-AUVIOU5G.js} +38 -14
  22. package/dist/chunk-AUVIOU5G.js.map +1 -0
  23. package/dist/{chunk-FFCIY7NM.js → chunk-CUUBAETM.js} +2 -2
  24. package/dist/{chunk-OMJMUFOW.js → chunk-DAH7RLW3.js} +3 -3
  25. package/dist/{chunk-6YYAOKNI.js → chunk-DJEZW7AC.js} +2 -2
  26. package/dist/{chunk-E3XJK7MY.js → chunk-DKZ425AM.js} +5 -3
  27. package/dist/chunk-DKZ425AM.js.map +1 -0
  28. package/dist/{chunk-EDSZI227.js → chunk-F4YQWKK2.js} +7 -4
  29. package/dist/chunk-F4YQWKK2.js.map +1 -0
  30. package/dist/chunk-FVCM4WHD.js +328 -0
  31. package/dist/chunk-FVCM4WHD.js.map +1 -0
  32. package/dist/{chunk-7XEPNEVQ.js → chunk-GBRML4RF.js} +2 -2
  33. package/dist/chunk-GBRML4RF.js.map +1 -0
  34. package/dist/{chunk-MVEFM5QI.js → chunk-HXINWP3V.js} +42 -13
  35. package/dist/chunk-HXINWP3V.js.map +1 -0
  36. package/dist/{chunk-OB7WULFK.js → chunk-IOBSIAHB.js} +2 -2
  37. package/dist/{chunk-4X723QBD.js → chunk-IZOTGWWI.js} +4 -4
  38. package/dist/{chunk-4X723QBD.js.map → chunk-IZOTGWWI.js.map} +1 -1
  39. package/dist/{chunk-QB2KMV6S.js → chunk-J2FACXYI.js} +3 -3
  40. package/dist/{chunk-UCHJCUYI.js → chunk-KKJEEKL2.js} +33 -7
  41. package/dist/chunk-KKJEEKL2.js.map +1 -0
  42. package/dist/{chunk-7OXTZJR4.js → chunk-KMCGX76Y.js} +2 -2
  43. package/dist/{chunk-KFD4O7VA.js → chunk-NKMVICB5.js} +2 -2
  44. package/dist/{chunk-OHDPGIJ3.js → chunk-OFLMG6RN.js} +3 -3
  45. package/dist/chunk-OFLMG6RN.js.map +1 -0
  46. package/dist/{chunk-XJXCTGDR.js → chunk-P6GDMZK4.js} +3 -3
  47. package/dist/{chunk-FJRHZA3C.js → chunk-PO6FCAIS.js} +3 -3
  48. package/dist/{chunk-2CFVV2NZ.js → chunk-PWLZFGS3.js} +3 -3
  49. package/dist/{chunk-J4JULXUG.js → chunk-QJIB36DM.js} +3 -3
  50. package/dist/chunk-QJIB36DM.js.map +1 -0
  51. package/dist/{chunk-OLLZFNO6.js → chunk-R7FKGFW6.js} +2 -2
  52. package/dist/{chunk-GQDUHZE3.js → chunk-RWWRTURA.js} +3 -3
  53. package/dist/{chunk-NKTMMJYD.js → chunk-RYBY35QE.js} +6 -5
  54. package/dist/chunk-RYBY35QE.js.map +1 -0
  55. package/dist/{chunk-UHLRXI6J.js → chunk-S7F5VKWU.js} +2 -2
  56. package/dist/chunk-S7F5VKWU.js.map +1 -0
  57. package/dist/{chunk-YK5QI57J.js → chunk-T5W3FDSF.js} +3 -3
  58. package/dist/chunk-T5W3FDSF.js.map +1 -0
  59. package/dist/{chunk-YD6IZ2C5.js → chunk-TCXKZDMR.js} +2 -2
  60. package/dist/{chunk-E2VBUWJ4.js → chunk-WGPB3QQU.js} +3 -3
  61. package/dist/{chunk-XEJMFFIM.js → chunk-XPCU4KUY.js} +3 -3
  62. package/dist/{chunk-XEJMFFIM.js.map → chunk-XPCU4KUY.js.map} +1 -1
  63. package/dist/{chunk-RZSZQMSE.js → chunk-YRYZUYY7.js} +2 -2
  64. package/dist/{chunk-7AJN2TIS.js → chunk-ZOTAAYO5.js} +12 -2
  65. package/dist/chunk-ZOTAAYO5.js.map +1 -0
  66. package/dist/components/accordion.js +2 -2
  67. package/dist/components/alert.js +2 -2
  68. package/dist/components/app-ui.d.ts +28 -12
  69. package/dist/components/app-ui.js +5 -4
  70. package/dist/components/blocks.d.ts +28 -2
  71. package/dist/components/blocks.js +3 -3
  72. package/dist/components/button.js +3 -3
  73. package/dist/components/changelog.js +4 -4
  74. package/dist/components/checkbox-group.js +3 -3
  75. package/dist/components/checkbox.js +3 -3
  76. package/dist/components/date-input.js +3 -3
  77. package/dist/components/dialog.d.ts +15 -0
  78. package/dist/components/dialog.js +3 -2
  79. package/dist/components/estimator.d.ts +1 -1
  80. package/dist/components/estimator.js +5 -5
  81. package/dist/components/fieldset.js +2 -2
  82. package/dist/components/grid.js +2 -2
  83. package/dist/components/help.js +2 -2
  84. package/dist/components/icon.js +2 -2
  85. package/dist/components/journey.d.ts +15 -1
  86. package/dist/components/journey.js +3 -3
  87. package/dist/components/layout.js +2 -2
  88. package/dist/components/link.js +3 -3
  89. package/dist/components/list.js +2 -2
  90. package/dist/components/marketing.d.ts +1 -1
  91. package/dist/components/marketing.js +3 -3
  92. package/dist/components/media.js +2 -2
  93. package/dist/components/navigation.js +3 -3
  94. package/dist/components/organisms.d.ts +1 -1
  95. package/dist/components/organisms.js +3 -3
  96. package/dist/components/page.js +2 -2
  97. package/dist/components/price.js +2 -2
  98. package/dist/components/progress.js +2 -2
  99. package/dist/components/property.d.ts +1 -1
  100. package/dist/components/property.js +3 -3
  101. package/dist/components/radio-group.js +3 -3
  102. package/dist/components/scene.d.ts +1 -1
  103. package/dist/components/scene.js +2 -2
  104. package/dist/components/scrubber.js +2 -2
  105. package/dist/components/select.js +3 -3
  106. package/dist/components/selling.d.ts +2 -0
  107. package/dist/components/selling.js +2 -2
  108. package/dist/components/site.d.ts +1 -1
  109. package/dist/components/site.js +7 -7
  110. package/dist/components/summary-list.js +2 -2
  111. package/dist/components/table.d.ts +94 -2
  112. package/dist/components/table.js +4 -2
  113. package/dist/components/text-input.js +3 -3
  114. package/dist/components/textarea.js +3 -3
  115. package/dist/index.d.ts +1 -1
  116. package/dist/index.js +40 -39
  117. package/dist/standalone/atomic-ui.js +3134 -0
  118. package/dist/standalone/atomic-ui.js.map +7 -0
  119. package/dist/standalone/index.html +174 -0
  120. package/package.json +18 -6
  121. package/scripts/copy-to-product.mjs +52 -0
  122. package/specimen/index.html +174 -0
  123. package/dist/chunk-3IQ73WNW.js.map +0 -1
  124. package/dist/chunk-7AJN2TIS.js.map +0 -1
  125. package/dist/chunk-7XEPNEVQ.js.map +0 -1
  126. package/dist/chunk-D6C7XEY4.js.map +0 -1
  127. package/dist/chunk-E3XJK7MY.js.map +0 -1
  128. package/dist/chunk-EDSZI227.js.map +0 -1
  129. package/dist/chunk-HYPPG4NF.js.map +0 -1
  130. package/dist/chunk-J4JULXUG.js.map +0 -1
  131. package/dist/chunk-MVEFM5QI.js.map +0 -1
  132. package/dist/chunk-NKTMMJYD.js.map +0 -1
  133. package/dist/chunk-OHDPGIJ3.js.map +0 -1
  134. package/dist/chunk-UCHJCUYI.js.map +0 -1
  135. package/dist/chunk-UHLRXI6J.js.map +0 -1
  136. package/dist/chunk-WDDWWCHN.js +0 -104
  137. package/dist/chunk-WDDWWCHN.js.map +0 -1
  138. package/dist/chunk-WFKSOM6O.js.map +0 -1
  139. package/dist/chunk-YK5QI57J.js.map +0 -1
  140. /package/dist/{chunk-7BSZPUE3.js.map → chunk-3RE4H2XO.js.map} +0 -0
  141. /package/dist/{chunk-R67PDFKE.js.map → chunk-46BYUQ5A.js.map} +0 -0
  142. /package/dist/{chunk-NCASAXQT.js.map → chunk-4OYHT4BN.js.map} +0 -0
  143. /package/dist/{chunk-TGT7J4EG.js.map → chunk-5QSTXIPG.js.map} +0 -0
  144. /package/dist/{chunk-26O27BQS.js.map → chunk-APJ5JGRW.js.map} +0 -0
  145. /package/dist/{chunk-FFCIY7NM.js.map → chunk-CUUBAETM.js.map} +0 -0
  146. /package/dist/{chunk-OMJMUFOW.js.map → chunk-DAH7RLW3.js.map} +0 -0
  147. /package/dist/{chunk-6YYAOKNI.js.map → chunk-DJEZW7AC.js.map} +0 -0
  148. /package/dist/{chunk-OB7WULFK.js.map → chunk-IOBSIAHB.js.map} +0 -0
  149. /package/dist/{chunk-QB2KMV6S.js.map → chunk-J2FACXYI.js.map} +0 -0
  150. /package/dist/{chunk-7OXTZJR4.js.map → chunk-KMCGX76Y.js.map} +0 -0
  151. /package/dist/{chunk-KFD4O7VA.js.map → chunk-NKMVICB5.js.map} +0 -0
  152. /package/dist/{chunk-XJXCTGDR.js.map → chunk-P6GDMZK4.js.map} +0 -0
  153. /package/dist/{chunk-FJRHZA3C.js.map → chunk-PO6FCAIS.js.map} +0 -0
  154. /package/dist/{chunk-2CFVV2NZ.js.map → chunk-PWLZFGS3.js.map} +0 -0
  155. /package/dist/{chunk-OLLZFNO6.js.map → chunk-R7FKGFW6.js.map} +0 -0
  156. /package/dist/{chunk-GQDUHZE3.js.map → chunk-RWWRTURA.js.map} +0 -0
  157. /package/dist/{chunk-YD6IZ2C5.js.map → chunk-TCXKZDMR.js.map} +0 -0
  158. /package/dist/{chunk-E2VBUWJ4.js.map → chunk-WGPB3QQU.js.map} +0 -0
  159. /package/dist/{chunk-RZSZQMSE.js.map → chunk-YRYZUYY7.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/selling.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, spaceAround, t, type } from '../base/tokens';\n\ntype Space = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\nconst card = css`\n .card { background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowSm}, 0 0 0 1px ${t.hairline}; }\n .h { margin: 0; font-family: ${t.fontHeading}; ${type('2xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .btn { display: inline-flex; justify-content: center; align-items: center; min-block-size: 44px; padding: ${space(2.5)} ${space(5)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: ${t.onBrand}; text-decoration: none; background: ${t.brand}; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n .btn:hover { background: ${t.brandHover}; }\n .btn.quiet { color: ${t.link}; background: transparent; box-shadow: inset 0 0 0 ${t.borderThin} ${t.border}; }\n .small { margin: 0; ${type('xs')} color: ${t.textMuted}; }\n .visually-hidden { ${visuallyHidden} }\n`;\n\nconst money = (amount: number, currency = 'GBP', digits = 0) => {\n try { return new Intl.NumberFormat(pageLocale(), { style: 'currency', currency, maximumFractionDigits: digits, minimumFractionDigits: digits }).format(amount); } catch { return String(Math.round(amount)); }\n};\n\n/** One plan in a comparison. */\nexport interface PlanItem {\n id: string;\n name: string;\n /** The price as shown, such as £12. */\n price: string;\n /** What the price is for, such as `a month`. */\n period?: string;\n note?: string;\n /** The rows this plan has, by their words, separated by commas. */\n includes: string;\n href?: string;\n /** A label such as `Most popular`, which also makes the plan stand out. */\n badge?: string;\n}\n\n/** One line a comparison checks every plan against. */\nexport interface PlanRow {\n id: string;\n label: string;\n}\n\n/**\n * Cover levels side by side, with a tick or a cross for each thing they\n * include and a button under each.\n *\n * A tick is never colour alone: each one says \"Included\" or \"Not included\" to\n * a screen reader. On a narrow screen the plans stack, each with its own list.\n *\n * @fires {CustomEvent<{ plan: PlanItem }>} impkt-select - When a plan is chosen. Cancel it to stay on the page.\n * @category content\n * @icon table\n */\nexport class ImpktPlanComparison extends ImpktElement {\n static properties = {\n heading: { type: String },\n plans: { type: Array },\n rows: { type: Array },\n buttonText: { type: String, attribute: 'button-text' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare plans: PlanItem[];\n declare rows: PlanRow[];\n declare buttonText: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'Compare cover';\n this.plans = [];\n this.rows = [];\n this.buttonText = 'Choose';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, targetSize, spaceAround, card, css`\n :host { display: block; container-type: inline-size; }\n .h { margin-block-end: ${space(5)}; }\n .grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: ${space(4)}; }\n .plan { position: relative; display: flex; flex-direction: column; gap: ${space(3)}; padding: ${space(6)}; }\n .plan.top { box-shadow: 0 0 0 2px ${t.brand}, ${t.shadowMd}; }\n .badge { position: absolute; inset-block-start: 0; inset-inline-start: 50%; transform: translate(-50%, -50%); padding: ${space(1)} ${space(3)}; border-radius: 999px; ${type('xs')} font-weight: ${fontWeight('bold')}; color: ${t.onBrand}; background: ${t.brand}; white-space: nowrap; }\n .name { margin: 0; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n .price { margin: 0; font-family: ${t.fontHeading}; ${type('3xl')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n .period { ${type('sm')} font-weight: ${fontWeight('regular')}; color: ${t.textMuted}; }\n .note { margin: 0; ${type('sm')} color: ${t.textMuted}; }\n ul { flex: 1; margin: 0; padding: ${space(3)} 0 0; list-style: none; display: grid; gap: ${space(2)}; border-block-start: 1px solid ${t.rule}; align-content: start; }\n li { display: flex; gap: ${space(2)}; ${type('sm')} }\n li[data-has='false'] { color: ${t.textMuted}; }\n .mark { flex-shrink: 0; inline-size: 1.25em; font-weight: ${fontWeight('bold')}; text-align: center; }\n li[data-has='true'] .mark { color: ${t.successText}; }\n @container (max-width: 40rem) { .grid { grid-template-columns: minmax(0, 1fr); gap: ${space(6)}; } }\n `];\n\n private has(plan: PlanItem, row: PlanRow): boolean {\n return plan.includes.split(',').map((s) => s.trim().toLowerCase()).includes(row.label.trim().toLowerCase());\n }\n\n private choose(plan: PlanItem, event: Event): void {\n const go = this.dispatchEvent(new CustomEvent('impkt-select', { detail: { plan }, bubbles: true, composed: true, cancelable: true }));\n if (!go) event.preventDefault();\n }\n\n render(): TemplateResult {\n return html`\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n <div class=\"grid\" style=${`--cols: ${Math.max(1, this.plans.length)}`}>\n ${this.plans.map((p) => html`<section class=\"card plan ${p.badge ? 'top' : ''}\" aria-labelledby=${this.id_(`n-${p.id}`)}>\n ${p.badge ? html`<span class=\"badge\">${p.badge}</span>` : nothing}\n <h3 class=\"name\" id=${this.id_(`n-${p.id}`)}>${p.name}</h3>\n <p class=\"price\">${p.price}${p.period ? html` <span class=\"period\">${p.period}</span>` : nothing}</p>\n ${p.note ? html`<p class=\"note\">${p.note}</p>` : nothing}\n <ul>${this.rows.map((r) => { const has = this.has(p, r); return html`<li data-has=${String(has)}><span class=\"mark\" aria-hidden=\"true\">${has ? '✓' : '–'}</span><span>${r.label}<span class=\"visually-hidden\">: ${say(has ? 'included' : 'not included')}</span></span></li>`; })}</ul>\n ${p.href ? html`<a class=\"btn ${p.badge ? '' : 'quiet'}\" href=${p.href} @click=${(e: Event) => this.choose(p, e)}>${this.buttonText}<span class=\"visually-hidden\"> ${p.name}</span></a>`\n : html`<button class=\"btn ${p.badge ? '' : 'quiet'}\" type=\"button\" @click=${(e: Event) => this.choose(p, e)}>${this.buttonText}<span class=\"visually-hidden\"> ${p.name}</span></button>`}\n </section>`)}\n </div>`;\n }\n}\n\n/** A YouTube or Vimeo address as its privacy-friendly embed, or null for a plain video file. */\nexport function embedOf(src: string, locale?: string): string | null {\n const yt = /(?:youtube\\.com\\/(?:watch\\?v=|embed\\/|shorts\\/)|youtu\\.be\\/)([\\w-]{6,})/.exec(src);\n // The player's own controls and captions in the page's language (ADR 0026).\n const hl = locale && !/^en\\b/i.test(locale) ? `&hl=${encodeURIComponent(locale.split('-')[0]!)}&cc_lang_pref=${encodeURIComponent(locale.split('-')[0]!)}` : '';\n if (yt) return `https://www.youtube-nocookie.com/embed/${yt[1]}?autoplay=1&rel=0${hl}`;\n const vimeo = /vimeo\\.com\\/(?:video\\/)?(\\d+)/.exec(src);\n if (vimeo) return `https://player.vimeo.com/video/${vimeo[1]}?autoplay=1&dnt=1`;\n return null;\n}\n\n/**\n * A video, with its title, captions and a transcript link.\n *\n * A YouTube or Vimeo video shows its poster and a Play button first, and only\n * loads the player when pressed, so the page stays fast and nothing is sent to\n * the video site until someone chooses to watch. A video file plays in the\n * browser's own player, with captions from `captions-src`.\n *\n * @category media\n * @icon play\n */\nexport class ImpktVideo extends ImpktElement {\n static properties = {\n videoSrc: { type: String, attribute: 'video-src' },\n label: { type: String },\n posterSrc: { type: String, attribute: 'poster-src' },\n captionsSrc: { type: String, attribute: 'captions-src' },\n transcriptHref: { type: String, attribute: 'transcript-href' },\n playText: { type: String, attribute: 'play-text' },\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 /** A YouTube or Vimeo address, or a video file such as an .mp4. */\n declare videoSrc: string;\n /** What the video is, read out before it plays. */\n declare label: string;\n declare posterSrc: string;\n /** A captions file in WebVTT, for a video file. */\n declare captionsSrc: string;\n declare transcriptHref: string;\n declare playText: string;\n declare ratio: '16:9' | '4:3' | '1:1' | '9:16';\n declare playing: boolean;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.videoSrc = '';\n this.label = 'Video';\n this.posterSrc = '';\n this.captionsSrc = '';\n this.transcriptHref = '';\n this.playText = 'Play video';\n this.ratio = '16:9';\n this.playing = false;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, css`\n :host { display: block; }\n .frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: ${t.radiusXl}; background: #111; }\n :host([ratio='4:3']) .frame { aspect-ratio: 4 / 3; }\n :host([ratio='1:1']) .frame { aspect-ratio: 1; }\n :host([ratio='9:16']) .frame { aspect-ratio: 9 / 16; max-inline-size: 420px; }\n iframe, video, img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: cover; }\n .play { position: absolute; inset: 0; display: grid; place-items: center; inline-size: 100%; padding: 0; color: #fff; background: linear-gradient(transparent 40%, rgb(0 0 0 / 0.55)); border: 0; cursor: pointer; }\n .disc { display: grid; place-items: center; inline-size: 72px; block-size: 72px; border-radius: 50%; background: ${t.brand}; box-shadow: ${t.shadowLg}; }\n .label { position: absolute; inset-inline-start: ${space(5)}; inset-block-end: ${space(4)}; ${type('lg')} font-weight: ${fontWeight('semibold')}; text-align: start; }\n .foot { margin: ${space(2)} 0 0; ${type('sm')} }\n .foot a { color: ${t.link}; }\n .empty { display: grid; place-items: center; block-size: 100%; color: #ccc; }\n `];\n\n render(): TemplateResult {\n const embed = embedOf(this.videoSrc, pageLocale(this));\n let player: TemplateResult;\n if (!this.videoSrc) player = html`<div class=\"empty\">${say('Add a video address')}</div>`;\n else if (embed && this.playing) player = html`<iframe src=${embed} title=${this.label} allow=\"autoplay; encrypted-media; picture-in-picture; fullscreen\" allowfullscreen></iframe>`;\n else if (embed) player = html`${this.posterSrc ? html`<img src=${this.posterSrc} alt=\"\" />` : nothing}\n <button class=\"play\" type=\"button\" @click=${() => { this.playing = true; }}>\n <span class=\"disc\" aria-hidden=\"true\"><svg width=\"28\" height=\"28\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M8 5v14l11-7z\"/></svg></span>\n <span class=\"label\">${this.playText}<span class=\"visually-hidden\">: ${this.label}</span></span>\n </button>`;\n else player = html`<video controls preload=\"metadata\" poster=${this.posterSrc || nothing} aria-label=${this.label}>\n <source src=${this.videoSrc} />\n ${this.captionsSrc ? html`<track kind=\"captions\" src=${this.captionsSrc} srclang=\"en\" label=\"English\" default />` : nothing}\n </video>`;\n return html`<div class=\"frame\" part=\"frame\">${player}</div>\n ${this.transcriptHref ? html`<p class=\"foot\"><a href=${this.transcriptHref}>${say('Read the transcript')}<span class=\"visually-hidden\">${say(' of {video}', { video: this.label })}</span></a></p>` : nothing}`;\n }\n}\n\nconst NOTICE_WORDS: Record<string, { heading: string; text: string }> = {\n mortgage: { heading: 'Your home may be repossessed', text: 'Your home may be repossessed if you do not keep up repayments on your mortgage.' },\n 'secured-loan': { heading: 'Think carefully before securing other debts against your home', text: 'Your home may be repossessed if you do not keep up repayments on a mortgage or any other debt secured on it.' },\n investment: { heading: 'Capital at risk', text: 'The value of investments can go down as well as up, and you may get back less than you put in.' },\n insurance: { heading: 'Important information', text: 'Read the policy documents to check the cover suits your needs. Limits and exclusions apply.' },\n custom: { heading: '', text: '' },\n};\n\n/**\n * The warning and the regulator wording a financial page must carry, as a\n * block of its own so it is never left off.\n *\n * Pick the kind to start from the usual words, or `custom` to write your own.\n * Whatever it says, check it with whoever signs off your financial promotions.\n *\n * @category feedback\n * @icon shield\n */\nexport class ImpktRegulatoryNotice extends ImpktElement {\n static properties = {\n kind: { type: String, reflect: true },\n heading: { type: String },\n text: { type: String },\n firm: { type: String },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare kind: 'mortgage' | 'secured-loan' | 'investment' | 'insurance' | 'custom';\n /** Leave empty to use the usual heading for the kind. */\n declare heading: string;\n /** Leave empty to use the usual warning for the kind. */\n declare text: string;\n /** Who you are and who regulates you, such as \"Acme Ltd is authorised and regulated by the Financial Conduct Authority (FRN 123456).\" */\n declare firm: string;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.kind = 'mortgage';\n this.heading = '';\n this.text = '';\n this.firm = '';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; }\n .box { padding: ${space(5)}; border-inline-start: 6px solid ${t.warning}; border-radius: ${t.radiusLg}; background: ${t.warningSubtle}; }\n :host([kind='insurance']) .box { border-color: ${t.info}; background: ${t.infoSubtle}; }\n strong { display: block; margin-block-end: ${space(1)}; ${type('md')} color: ${t.text}; }\n p { margin: 0; color: ${t.text}; }\n .firm { margin-block-start: ${space(3)}; ${type('sm')} color: ${t.textMuted}; }\n `];\n\n render(): TemplateResult {\n const preset = NOTICE_WORDS[this.kind] ?? NOTICE_WORDS.custom!;\n const heading = this.heading || (preset.heading ? say(preset.heading) : '');\n const text = this.text || (preset.text ? say(preset.text) : '');\n return html`<aside class=\"box\" part=\"box\" aria-label=${heading || say('Important information')}>\n ${heading ? html`<strong>${heading}</strong>` : nothing}\n ${text ? html`<p>${text}</p>` : nothing}\n ${this.firm ? html`<p class=\"firm\">${this.firm}</p>` : nothing}\n </aside>`;\n }\n}\n\n/** One band of a tax: everything above `from` and up to the next band's `from` is charged at `rate`. */\ninterface Band { from: number; rate: number }\n\n/**\n * Stamp Duty Land Tax for England and Northern Ireland, from 1 April 2025.\n * Exported so the numbers can be checked, and changed in one place.\n */\nexport const SDLT = {\n standard: [{ from: 0, rate: 0 }, { from: 125000, rate: 2 }, { from: 250000, rate: 5 }, { from: 925000, rate: 10 }, { from: 1500000, rate: 12 }] as Band[],\n firstTime: [{ from: 0, rate: 0 }, { from: 300000, rate: 5 }] as Band[],\n firstTimeLimit: 500000,\n additionalSurcharge: 5,\n};\n\nfunction taxOn(price: number, bands: Band[], extra = 0): number {\n let tax = 0;\n bands.forEach((band, i) => {\n const top = bands[i + 1]?.from ?? Infinity;\n if (price > band.from) tax += ((Math.min(price, top) - band.from) * (band.rate + extra)) / 100;\n });\n return Math.round(tax);\n}\n\n/** The stamp duty on a home, for a mover, a first-time buyer or a second home. */\nexport function stampDuty(price: number, buyer: 'mover' | 'first-time' | 'additional'): number {\n if (price <= 0) return 0;\n if (buyer === 'first-time' && price <= SDLT.firstTimeLimit) return taxOn(price, SDLT.firstTime);\n if (buyer === 'additional') return price < 40000 ? 0 : taxOn(price, SDLT.standard, SDLT.additionalSurcharge);\n return taxOn(price, SDLT.standard);\n}\n\nconst calcStyles = css`\n :host { display: block; container-type: inline-size; }\n .wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); overflow: hidden; }\n .inputs { display: flex; flex-direction: column; gap: ${space(5)}; padding: ${space(8)}; }\n label, legend { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1.5)}; padding: 0; }\n fieldset { margin: 0; padding: 0; border: 0; }\n .choices { display: flex; flex-wrap: wrap; gap: ${space(2)}; }\n .choices label { display: inline-flex; align-items: center; gap: ${space(2)}; margin: 0; padding: ${space(2)} ${space(3)}; font-weight: ${fontWeight('regular')}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; cursor: pointer; }\n .choices input { accent-color: ${t.brand}; }\n input[type='number'] { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${space(2)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; }\n .result { display: flex; flex-direction: column; justify-content: center; gap: ${space(2)}; padding: ${space(8)}; color: ${t.onBrand}; background: ${t.brand}; }\n .caption { margin: 0; ${type('sm')} opacity: 0.85; }\n output { display: block; font-family: ${t.fontHeading}; ${type('4xl')} font-weight: ${fontWeight('bold')}; }\n .line { margin: 0; ${type('sm')} }\n .foot { grid-column: 1 / -1; padding: ${space(4)} ${space(8)}; background: ${t.surfaceSubtle}; }\n @container (max-width: 44rem) { .wrap { grid-template-columns: minmax(0, 1fr); } .inputs, .result { padding: ${space(5)}; } .foot { padding: ${space(4)} ${space(5)}; } }\n`;\n\n/**\n * How much stamp duty a home would cost, for a home mover, a first-time buyer\n * or a second home, worked out as the price is typed.\n *\n * The rates are England and Northern Ireland's from 1 April 2025. Scotland and\n * Wales have their own taxes, and rates change, so the small print says which\n * rates these are and points to GOV.UK.\n *\n * @category form\n * @icon pound\n */\nexport class ImpktStampDutyCalculator extends ImpktElement {\n static properties = {\n heading: { type: String },\n price: { type: Number },\n buyer: { type: String },\n smallPrint: { type: String, attribute: 'small-print' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare price: number;\n declare buyer: 'mover' | 'first-time' | 'additional';\n declare smallPrint: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'How much stamp duty would you pay?';\n this.price = 385000;\n this.buyer = 'first-time';\n this.smallPrint = 'Based on Stamp Duty Land Tax rates in England and Northern Ireland from 1 April 2025. Scotland and Wales have their own taxes. Check what you would pay on GOV.UK.';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, calcStyles];\n\n render(): TemplateResult {\n const duty = stampDuty(this.price, this.buyer);\n const rate = this.price > 0 ? (duty / this.price) * 100 : 0;\n const buyers: [typeof this.buyer, string][] = [['first-time', say('First home')], ['mover', say('Moving home')], ['additional', say('Second home')]];\n return html`<div class=\"card wrap\" part=\"wrap\">\n <div class=\"inputs\">\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n <div><label for=${this.id_('price')}>${say('Price of the home (£)')}</label>\n <input id=${this.id_('price')} type=\"number\" min=\"0\" step=\"1000\" inputmode=\"numeric\" .value=${String(this.price)} @input=${(e: Event) => { this.price = Number((e.target as HTMLInputElement).value) || 0; }} /></div>\n <fieldset><legend>${say('Are you buying')}</legend><div class=\"choices\">\n ${buyers.map(([value, label]) => html`<label><input type=\"radio\" name=${this.id_('buyer')} .checked=${this.buyer === value} @change=${() => { this.buyer = value; }} />${label}</label>`)}\n </div></fieldset>\n </div>\n <div class=\"result\" aria-live=\"polite\">\n <p class=\"caption\">${say('Stamp duty to pay')}</p>\n <output for=${this.id_('price')}>${money(duty)}</output>\n <p class=\"line\">${duty ? say('About {rate}% of the price', { rate: rate.toFixed(1) }) : say('Nothing to pay at this price')}</p>\n ${this.buyer === 'first-time' && this.price > SDLT.firstTimeLimit ? html`<p class=\"line\">${say('First-time buyer relief stops above {limit}, so the usual rates apply.', { limit: money(SDLT.firstTimeLimit) })}</p>` : nothing}\n </div>\n ${this.smallPrint ? html`<div class=\"foot\"><p class=\"small\">${this.smallPrint}</p></div>` : nothing}\n </div>`;\n }\n}\n\n/**\n * Roughly how much someone could borrow, from what they earn, and the price\n * of home that buys with their deposit.\n *\n * Lenders usually lend four to four and a half times income; the multiple is\n * a setting. It is a guide, not an offer, and the small print says so.\n *\n * @category form\n * @icon pound\n */\nexport class ImpktAffordabilityCalculator extends ImpktElement {\n static properties = {\n heading: { type: String },\n income: { type: Number },\n secondIncome: { type: Number, attribute: 'second-income' },\n deposit: { type: Number },\n timesIncome: { type: Number, attribute: 'times-income' },\n smallPrint: { type: String, attribute: 'small-print' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare income: number;\n declare secondIncome: number;\n declare deposit: number;\n /** How many times income a lender would lend, such as 4.5. */\n declare timesIncome: number;\n declare smallPrint: string;\n declare headingLevel: 2 | 3;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'How much could you borrow?';\n this.income = 45000;\n this.secondIncome = 0;\n this.deposit = 30000;\n this.timesIncome = 4.5;\n this.smallPrint = 'This is a guide, not a mortgage offer. What a lender offers depends on your circumstances. Your home may be repossessed if you do not keep up repayments on your mortgage.';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, calcStyles];\n\n private field(key: 'income' | 'secondIncome' | 'deposit'): (event: Event) => void {\n return (event) => { this[key] = Number((event.target as HTMLInputElement).value) || 0; };\n }\n\n render(): TemplateResult {\n const borrow = Math.max(0, (this.income + this.secondIncome) * this.timesIncome);\n const input = (key: 'income' | 'secondIncome' | 'deposit', label: string) => html`<div><label for=${this.id_(key)}>${label}</label>\n <input id=${this.id_(key)} type=\"number\" min=\"0\" step=\"1000\" inputmode=\"numeric\" .value=${String(this[key])} @input=${this.field(key)} /></div>`;\n return html`<div class=\"card wrap\" part=\"wrap\">\n <div class=\"inputs\">\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${input('income', say('Your yearly income before tax (£)'))}\n ${input('secondIncome', say('A second person’s income, if buying together (£)'))}\n ${input('deposit', say('Your deposit (£)'))}\n </div>\n <div class=\"result\" aria-live=\"polite\">\n <p class=\"caption\">${say('You could borrow about')}</p>\n <output>${money(borrow)}</output>\n <p class=\"line\">${say('With your deposit, that’s a home of about {amount}.', { amount: money(borrow + this.deposit) })}</p>\n </div>\n ${this.smallPrint ? html`<div class=\"foot\"><p class=\"small\">${this.smallPrint}</p></div>` : nothing}\n </div>`;\n }\n}\n\n/**\n * How to get in touch: a phone number, opening hours, an email address, and a\n * short form to ask for a call back.\n *\n * The form fires `impkt-submit` with the name, phone number and best time; the\n * app sends it on. Then the block thanks them in place.\n *\n * @fires {CustomEvent<{ name: string; phone: string; when: string }>} impkt-submit - When the form is sent.\n * @category content\n * @icon phone\n */\nexport class ImpktContactBlock extends ImpktElement {\n static properties = {\n heading: { type: String },\n phone: { type: String },\n hours: { type: String },\n email: { type: String },\n callbackHeading: { type: String, attribute: 'callback-heading' },\n buttonText: { type: String, attribute: 'button-text' },\n doneText: { type: String, attribute: 'done-text' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare heading: string;\n declare phone: string;\n /** One line a day or range, such as \"Monday to Friday, 9am to 6pm\". */\n declare hours: string;\n declare email: string;\n /** Leave empty to show no call back form. */\n declare callbackHeading: string;\n declare buttonText: string;\n declare doneText: string;\n declare headingLevel: 2 | 3;\n declare sent: boolean;\n declare spaceAbove: Space;\n declare spaceBelow: Space;\n\n constructor() {\n super();\n this.heading = 'Talk to us';\n this.phone = '0800 000 0000';\n this.hours = 'Monday to Friday, 9am to 6pm\\nSaturday, 10am to 2pm';\n this.email = '';\n this.callbackHeading = 'Or we can call you';\n this.buttonText = 'Ask for a call back';\n this.doneText = 'Thanks. We’ll call you at the time you chose.';\n this.headingLevel = 2;\n this.sent = false;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, card, css`\n :host { display: block; container-type: inline-size; }\n .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(6)}; padding: ${space(8)}; }\n .phone { display: inline-block; margin: ${space(3)} 0; font-family: ${t.fontHeading}; ${type('3xl')} font-weight: ${fontWeight('bold')}; color: ${t.link}; text-decoration: none; }\n .hours { margin: 0; white-space: pre-line; color: ${t.textMuted}; }\n .email { display: inline-block; margin-block-start: ${space(3)}; color: ${t.link}; }\n form { display: grid; gap: ${space(3)}; padding: ${space(5)}; border-radius: ${t.radiusLg}; background: ${t.surfaceInset}; }\n .sub { margin: 0; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n label { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1)}; }\n input, select { box-sizing: border-box; inline-size: 100%; min-block-size: 44px; padding: ${space(2)} ${space(3)}; font: inherit; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; }\n .done { margin: 0; padding: ${space(5)}; border-radius: ${t.radiusLg}; background: ${t.successSubtle}; color: ${t.successText}; font-weight: ${fontWeight('semibold')}; }\n @container (max-width: 40rem) { .wrap { grid-template-columns: minmax(0, 1fr); padding: ${space(5)}; } }\n `];\n\n private submit(event: SubmitEvent): void {\n event.preventDefault();\n const form = new FormData(event.target as HTMLFormElement);\n const data = { name: String(form.get('name') ?? ''), phone: String(form.get('phone') ?? ''), when: String(form.get('when') ?? '') };\n this.dispatchEvent(new CustomEvent('impkt-submit', { detail: data, bubbles: true, composed: true }));\n this.sent = true;\n }\n\n render(): TemplateResult {\n return html`<div class=\"card wrap\" part=\"wrap\">\n <div>\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.phone ? html`<a class=\"phone\" href=${`tel:${this.phone.replace(/[^\\d+]/g, '')}`}>${this.phone}</a>` : nothing}\n ${this.hours ? html`<p class=\"hours\">${this.hours}</p>` : nothing}\n ${this.email ? html`<a class=\"email\" href=${`mailto:${this.email}`}>${this.email}</a>` : nothing}\n </div>\n ${!this.callbackHeading ? nothing : this.sent ? html`<p class=\"done\" role=\"status\">${this.doneText}</p>` : html`<form @submit=${this.submit} aria-labelledby=${this.id_('cb')}>\n <p class=\"sub\" id=${this.id_('cb')}>${this.callbackHeading}</p>\n <div><label for=${this.id_('name')}>${say('Your name')}</label><input id=${this.id_('name')} name=\"name\" autocomplete=\"name\" required /></div>\n <div><label for=${this.id_('tel')}>${say('Phone number')}</label><input id=${this.id_('tel')} name=\"phone\" type=\"tel\" autocomplete=\"tel\" required /></div>\n <div><label for=${this.id_('when')}>${say('Best time to call')}</label><select id=${this.id_('when')} name=\"when\"><option value=\"Morning\">${say('Morning')}</option><option value=\"Afternoon\">${say('Afternoon')}</option><option value=\"Evening\">${say('Evening')}</option></select></div>\n <button class=\"btn\" type=\"submit\">${this.buttonText}</button>\n </form>`}\n </div>`;\n }\n}\n\n// Working values, not settings: kept out of `properties` so the page designer does not offer them.\nImpktVideo.createProperty('playing', { state: true });\nImpktContactBlock.createProperty('sent', { state: true });\n\ncustomElements.define('impkt-plan-comparison', ImpktPlanComparison);\ncustomElements.define('impkt-video', ImpktVideo);\ncustomElements.define('impkt-regulatory-notice', ImpktRegulatoryNotice);\ncustomElements.define('impkt-stamp-duty-calculator', ImpktStampDutyCalculator);\ncustomElements.define('impkt-affordability-calculator', ImpktAffordabilityCalculator);\ncustomElements.define('impkt-contact-block', ImpktContactBlock);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-plan-comparison': ImpktPlanComparison;\n 'impkt-video': ImpktVideo;\n 'impkt-regulatory-notice': ImpktRegulatoryNotice;\n 'impkt-stamp-duty-calculator': ImpktStampDutyCalculator;\n 'impkt-affordability-calculator': ImpktAffordabilityCalculator;\n 'impkt-contact-block': ImpktContactBlock;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAS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CAAC,IAAI,IAAI,WAAW,CAAC,qBAAqB,KAAK,IAAI,MAAM,CAAC;AAAA,0BACzE,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,cAAc,CAAC,qBAAqB,KAAK,IAAI,KAAK,CAAC;AAAA,0BAC1E,KAAK,IAAI,MAAM,CAAC,IAAI,IAAI,mBAAmB,CAAC,sBAAsB,KAAK,IAAI,MAAM,CAAC,wCAAwC,IAAI,SAAS,CAAC,sCAAsC,IAAI,WAAW,CAAC,oCAAoC,IAAI,SAAS,CAAC;AAAA,4CAC9N,KAAK,UAAU;AAAA,cAC7C;AAAA;AAAA,EAEZ;AACF;AAGA,WAAW,eAAe,WAAW,EAAE,OAAO,KAAK,CAAC;AACpD,kBAAkB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AAExD,eAAe,OAAO,yBAAyB,mBAAmB;AAClE,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,2BAA2B,qBAAqB;AACtE,eAAe,OAAO,+BAA+B,wBAAwB;AAC7E,eAAe,OAAO,kCAAkC,4BAA4B;AACpF,eAAe,OAAO,uBAAuB,iBAAiB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  toneOf
3
- } from "./chunk-2CFVV2NZ.js";
3
+ } from "./chunk-PWLZFGS3.js";
4
4
  import {
5
5
  pageLocale
6
6
  } from "./chunk-3IGNZTJU.js";
@@ -16,7 +16,7 @@ import {
16
16
  targetSize,
17
17
  type,
18
18
  visuallyHidden
19
- } from "./chunk-D6C7XEY4.js";
19
+ } from "./chunk-3KO55PZK.js";
20
20
 
21
21
  // packages/ui/src/components/estimator.ts
22
22
  import { css, html, nothing, unsafeCSS } from "lit";
@@ -393,4 +393,4 @@ export {
393
393
  phaseWeeks,
394
394
  ImpktEstimator
395
395
  };
396
- //# sourceMappingURL=chunk-YK5QI57J.js.map
396
+ //# sourceMappingURL=chunk-T5W3FDSF.js.map
@@ -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 { ImpktElement } from '../base/ImpktElement';\nimport { pageLocale } from '../base/locale';\nimport { say } from '../base/say';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, spaceAround, t, type } from '../base/tokens';\nimport { toneOf } from './changelog';\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 `impkt-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>} impkt-estimate - When the estimate is sent on. The result is in detail.\n */\nexport class ImpktEstimator extends ImpktElement {\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 = [...ImpktElement.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 .panel { position: static; }\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('strata.estimate', result.summary); } catch { /* storage can be blocked; the link still goes */ }\n const go = this.dispatchEvent(new CustomEvent('impkt-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('impkt-estimator', ImpktEstimator);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-estimator': ImpktEstimator;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,KAAK,MAAM,SAAS,iBAAsC;AA0EnE,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,WACA,SACA,OAC4F;AAC5F,QAAM,SAAS,UAAU,QAAQ,CAAC,OAAO,QAAQ,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAE,QAAQ,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AACnH,MAAI,OAAO,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC7C,MAAI,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAC/C,aAAW,KAAK,QAAQ;AAAE,YAAQ,EAAE,cAAc;AAAG,aAAS,EAAE,eAAe;AAAA,EAAG;AAClF,QAAM,aAAa,QAAQ,MAAM,OAAO,IAAI,GAAG,aAAa,KAAK,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AACxG,SAAO;AAAA,IACL;AAAA,IACA,KAAK,KAAK,MAAM,OAAO,MAAM,GAAG;AAAA,IAChC,MAAM,KAAK,MAAM,OAAO,MAAM,IAAI;AAAA,IAClC,OAAO,KAAK,IAAI,MAAM,UAAU,KAAK,MAAM,KAAK,CAAC;AAAA,IACjD;AAAA,IACA,KAAK,QAAQ,MAAM,MAAM,IAAI,GAAG,QAAQ;AAAA,EAC1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,KAAM,MAAO,CAAC,GAAG;AAAA;AAAA,UAE/H,GAAG,IAAI,CAAC,GAAG,MAAM,KAAK,eAAe,GAAG,CAAC,CAAC,CAAC;AAAA,UAC3C,KAAK,aAAa,CAAC,CAAC;AAAA,UACpB,OAAO,UAAU;AAAA,YACf,KAAK,KAAK,IAAI,sDAAsD,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,cAAc,OAAO;AAAA,yDACrF,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,OAAO,QAAQ,IAAI,IAAI,iBAAiB,IAAI,IAAI,MAAM,CAAC;AAAA,eACpI;AAAA;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,mBAAmB,cAAc;","names":[]}
@@ -5,7 +5,7 @@ import {
5
5
  lineHeight,
6
6
  space,
7
7
  t
8
- } from "./chunk-D6C7XEY4.js";
8
+ } from "./chunk-3KO55PZK.js";
9
9
 
10
10
  // packages/ui/src/components/fieldset.ts
11
11
  import { css, html, nothing } from "lit";
@@ -53,4 +53,4 @@ customElements.define("impkt-fieldset", ImpktFieldset);
53
53
  export {
54
54
  ImpktFieldset
55
55
  };
56
- //# sourceMappingURL=chunk-YD6IZ2C5.js.map
56
+ //# sourceMappingURL=chunk-TCXKZDMR.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  FieldElement,
3
3
  fieldWidths
4
- } from "./chunk-7AJN2TIS.js";
4
+ } from "./chunk-ZOTAAYO5.js";
5
5
  import {
6
6
  fontSize,
7
7
  space,
8
8
  t
9
- } from "./chunk-D6C7XEY4.js";
9
+ } from "./chunk-3KO55PZK.js";
10
10
 
11
11
  // packages/ui/src/components/textarea.ts
12
12
  import { html, css, nothing } from "lit";
@@ -115,4 +115,4 @@ customElements.define("impkt-textarea", ImpktTextarea);
115
115
  export {
116
116
  ImpktTextarea
117
117
  };
118
- //# sourceMappingURL=chunk-E2VBUWJ4.js.map
118
+ //# sourceMappingURL=chunk-WGPB3QQU.js.map
@@ -6,7 +6,7 @@ import {
6
6
  space,
7
7
  t,
8
8
  visuallyHidden
9
- } from "./chunk-D6C7XEY4.js";
9
+ } from "./chunk-3KO55PZK.js";
10
10
 
11
11
  // packages/ui/src/components/progress.ts
12
12
  import { html, css, nothing } from "lit";
@@ -41,7 +41,7 @@ var ImpktProgress = class extends ImpktElement {
41
41
  }
42
42
  li {
43
43
  flex: 1;
44
- font-size: ${fontSize("xs")};
44
+ font-size: ${fontSize("sm")};
45
45
  color: ${t.textMuted};
46
46
  padding-block-start: ${space(2)};
47
47
  border-block-start: 4px solid ${t.border};
@@ -93,4 +93,4 @@ customElements.define("impkt-progress", ImpktProgress);
93
93
  export {
94
94
  ImpktProgress
95
95
  };
96
- //# sourceMappingURL=chunk-XEJMFFIM.js.map
96
+ //# sourceMappingURL=chunk-XPCU4KUY.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/progress.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\nexport interface ProgressStep {\n id: string;\n label: string;\n}\n\n/**\n * Where the customer is in a journey.\n *\n * **It is not a `progressbar`.** That role is for a task completing — a file\n * uploading, a price calculating — and it carries `aria-valuenow`. A journey\n * indicator is navigation: an ordered list of named steps with\n * `aria-current=\"step\"` on the one you are on. Using `progressbar` here\n * announces a percentage and loses the step names, which are the only useful\n * part.\n *\n * **The position is said in words.** \"Step 2 of 5\" is visually hidden and read\n * aloud, because the visual design communicates position through colour and a\n * filled bar, and neither is available to a screen-reader user — nor to anyone\n * who cannot distinguish the filled colour from the empty one, which is 1.4.1.\n\n *\n * @category content\n * @icon progress\n */\nexport class ImpktProgress extends ImpktElement {\n static properties = {\n steps: { type: Array },\n current: { type: String },\n label: { type: String },\n };\n\n declare steps: ProgressStep[];\n /** The id of the step being shown. */\n declare current: string;\n declare label: string;\n\n constructor() {\n super();\n this.steps = [];\n this.current = '';\n this.label = 'Progress';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n margin-block-end: ${space(5)};\n }\n ol {\n display: flex;\n gap: ${space(2)};\n list-style: none;\n margin: 0;\n padding: 0;\n }\n li {\n flex: 1;\n font-size: ${fontSize('xs')};\n color: ${t.textMuted};\n padding-block-start: ${space(2)};\n border-block-start: 4px solid ${t.border};\n }\n li[data-state='done'] {\n color: ${t.text};\n border-block-start-color: ${t.brand};\n }\n li[data-state='current'] {\n color: ${t.text};\n font-weight: ${fontWeight('semibold')};\n border-block-start-color: ${t.brand};\n }\n .sr-only {\n ${visuallyHidden}\n }\n /* Below 30rem the labels stop fitting; the position in words is the part\n that has to survive, so the list collapses to bars and the current\n step's name. */\n @media (max-width: 30rem) {\n li:not([data-state='current']) span:not(.sr-only) {\n ${visuallyHidden}\n }\n }\n `,\n ];\n\n render(): TemplateResult {\n const index = this.steps.findIndex((s) => s.id === this.current);\n return html`\n <nav part=\"nav\" aria-label=${this.label}>\n <ol part=\"list\">\n ${this.steps.map((step, i) => {\n const state = i < index ? 'done' : i === index ? 'current' : 'todo';\n return html`\n <li data-state=${state} aria-current=${state === 'current' ? 'step' : nothing}>\n ${state === 'current'\n ? html`<span class=\"sr-only\">${say('Step {step} of {steps}:', { step: i + 1, steps: this.steps.length })} </span>`\n : nothing}\n <span>${step.label}</span>\n </li>\n `;\n })}\n </ol>\n </nav>\n `;\n }\n}\n\ncustomElements.define('impkt-progress', ImpktProgress);\n\ndeclare global {\n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;AAAA,+BACY,KAAK,iBAAiB,UAAU,YAAY,SAAS,OAAO;AAAA,kBACzE,UAAU,YACR,6BAA6B,IAAI,2BAA2B,EAAE,MAAM,IAAI,GAAG,OAAO,KAAK,MAAM,OAAO,CAAC,CAAC,aACtG,OAAO;AAAA,wBACH,KAAK,KAAK;AAAA;AAAA;AAAA,IAGxB,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAIV;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
1
+ {"version":3,"sources":["../src/components/progress.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\nexport interface ProgressStep {\n id: string;\n label: string;\n}\n\n/**\n * Where the customer is in a journey.\n *\n * **It is not a `progressbar`.** That role is for a task completing — a file\n * uploading, a price calculating — and it carries `aria-valuenow`. A journey\n * indicator is navigation: an ordered list of named steps with\n * `aria-current=\"step\"` on the one you are on. Using `progressbar` here\n * announces a percentage and loses the step names, which are the only useful\n * part.\n *\n * **The position is said in words.** \"Step 2 of 5\" is visually hidden and read\n * aloud, because the visual design communicates position through colour and a\n * filled bar, and neither is available to a screen-reader user — nor to anyone\n * who cannot distinguish the filled colour from the empty one, which is 1.4.1.\n\n *\n * @category content\n * @icon progress\n */\nexport class ImpktProgress extends ImpktElement {\n static properties = {\n steps: { type: Array },\n current: { type: String },\n label: { type: String },\n };\n\n declare steps: ProgressStep[];\n /** The id of the step being shown. */\n declare current: string;\n declare label: string;\n\n constructor() {\n super();\n this.steps = [];\n this.current = '';\n this.label = 'Progress';\n }\n\n static styles = [\n ...ImpktElement.styles,\n css`\n :host {\n display: block;\n margin-block-end: ${space(5)};\n }\n ol {\n display: flex;\n gap: ${space(2)};\n list-style: none;\n margin: 0;\n padding: 0;\n }\n li {\n flex: 1;\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n padding-block-start: ${space(2)};\n border-block-start: 4px solid ${t.border};\n }\n li[data-state='done'] {\n color: ${t.text};\n border-block-start-color: ${t.brand};\n }\n li[data-state='current'] {\n color: ${t.text};\n font-weight: ${fontWeight('semibold')};\n border-block-start-color: ${t.brand};\n }\n .sr-only {\n ${visuallyHidden}\n }\n /* Below 30rem the labels stop fitting; the position in words is the part\n that has to survive, so the list collapses to bars and the current\n step's name. */\n @media (max-width: 30rem) {\n li:not([data-state='current']) span:not(.sr-only) {\n ${visuallyHidden}\n }\n }\n `,\n ];\n\n render(): TemplateResult {\n const index = this.steps.findIndex((s) => s.id === this.current);\n return html`\n <nav part=\"nav\" aria-label=${this.label}>\n <ol part=\"list\">\n ${this.steps.map((step, i) => {\n const state = i < index ? 'done' : i === index ? 'current' : 'todo';\n return html`\n <li data-state=${state} aria-current=${state === 'current' ? 'step' : nothing}>\n ${state === 'current'\n ? html`<span class=\"sr-only\">${say('Step {step} of {steps}:', { step: i + 1, steps: this.steps.length })} </span>`\n : nothing}\n <span>${step.label}</span>\n </li>\n `;\n })}\n </ol>\n </nav>\n `;\n }\n}\n\ncustomElements.define('impkt-progress', ImpktProgress);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-progress': ImpktProgress }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA8BjD,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,OAAO,EAAE,MAAM,OAAO;AAAA,IACxB;AAAA;AAAA,EAOA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,UAAU;AACf,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA,4BAGwB,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,eAIrB,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAOF,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,SAAS;AAAA,+BACG,MAAM,CAAC,CAAC;AAAA,wCACC,EAAE,MAAM;AAAA;AAAA;AAAA,iBAG/B,EAAE,IAAI;AAAA,oCACa,EAAE,KAAK;AAAA;AAAA;AAAA,iBAG1B,EAAE,IAAI;AAAA,uBACA,WAAW,UAAU,CAAC;AAAA,oCACT,EAAE,KAAK;AAAA;AAAA;AAAA,UAGjC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOZ,cAAc;AAAA;AAAA;AAAA;AAAA,IAIxB;AAAA;AAAA,EAEA,SAAyB;AACvB,UAAM,QAAQ,KAAK,MAAM,UAAU,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO;AAC/D,WAAO;AAAA,mCACwB,KAAK,KAAK;AAAA;AAAA,YAEjC,KAAK,MAAM,IAAI,CAAC,MAAM,MAAM;AAC5B,YAAM,QAAQ,IAAI,QAAQ,SAAS,MAAM,QAAQ,YAAY;AAC7D,aAAO;AAAA,+BACY,KAAK,iBAAiB,UAAU,YAAY,SAAS,OAAO;AAAA,kBACzE,UAAU,YACR,6BAA6B,IAAI,2BAA2B,EAAE,MAAM,IAAI,GAAG,OAAO,KAAK,MAAM,OAAO,CAAC,CAAC,aACtG,OAAO;AAAA,wBACH,KAAK,KAAK;AAAA;AAAA;AAAA,IAGxB,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAIV;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  t,
8
8
  token,
9
9
  visuallyHidden
10
- } from "./chunk-D6C7XEY4.js";
10
+ } from "./chunk-3KO55PZK.js";
11
11
 
12
12
  // packages/ui/src/components/scrubber.ts
13
13
  import { html, css } from "lit";
@@ -233,4 +233,4 @@ customElements.define("impkt-scrubber", ImpktScrubber);
233
233
  export {
234
234
  ImpktScrubber
235
235
  };
236
- //# sourceMappingURL=chunk-RZSZQMSE.js.map
236
+ //# sourceMappingURL=chunk-YRYZUYY7.js.map
@@ -7,7 +7,7 @@ import {
7
7
  space,
8
8
  t,
9
9
  visuallyHidden
10
- } from "./chunk-D6C7XEY4.js";
10
+ } from "./chunk-3KO55PZK.js";
11
11
 
12
12
  // packages/ui/src/base/FieldElement.ts
13
13
  import { html, css, nothing } from "lit";
@@ -119,6 +119,16 @@ var FieldElement = class extends ImpktElement {
119
119
  ].filter(Boolean);
120
120
  return ids.length ? ids.join(" ") : nothing;
121
121
  }
122
+ /**
123
+ * Focusing the element focuses its control, so `el.focus()` from an app, a
124
+ * React ref or the error summary's link lands where someone can type, rather
125
+ * than on a host that cannot take focus and so silently does nothing.
126
+ */
127
+ focus(options) {
128
+ const control = this.renderRoot?.querySelector(`#${this.controlId}`) ?? this.renderRoot?.querySelector("input, select, textarea, button");
129
+ if (control) control.focus(options);
130
+ else super.focus(options);
131
+ }
122
132
  /**
123
133
  * `<label for>` by default. A group of controls — radios, checkboxes —
124
134
  * cannot use one, because `for` names a single control, so those override
@@ -167,4 +177,4 @@ export {
167
177
  fieldWidths,
168
178
  FieldElement
169
179
  };
170
- //# sourceMappingURL=chunk-7AJN2TIS.js.map
180
+ //# sourceMappingURL=chunk-ZOTAAYO5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/base/FieldElement.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from './ImpktElement';\nimport { focusRing, visuallyHidden } from './styles';\nimport { fontSize, fontWeight, lineHeight, space, t } from './tokens';\n\n/**\n * The shared anatomy of a form control: a label, an optional description, a\n * control, and an error.\n *\n * This exists because the ARIA wiring between those four is where accessible\n * forms actually fail, and it fails the same way every time — a description\n * that is never announced, an error that appears silently, a label that points\n * at nothing. Written once, it is right once.\n *\n * Everything is rendered inside this component's own shadow root, including\n * the native control. That is not an implementation detail: `aria-describedby`\n * cannot cross a shadow boundary, so a component that slotted the input from\n * outside could not describe it. Keeping the whole relationship in one tree is\n * what makes the wiring work at all.\n */\n/**\n * How wide a single-line control is, from what it holds: a postcode is short,\n * an email address is long. A width that matches the answer is a hint about\n * what to type (1.3.5 is about the purpose, this is about the size). Applied by\n * the controls that take a `width`, through `--impkt-field-width`.\n */\nexport const fieldWidths = css`\n :host { --impkt-field-width: 100%; }\n :host([width='xs']) { --impkt-field-width: 8ch; }\n :host([width='sm']) { --impkt-field-width: 14ch; }\n :host([width='md']) { --impkt-field-width: 24ch; }\n :host([width='lg']) { --impkt-field-width: 40ch; }\n`;\n\n/**\n * The base of every form control.\n *\n * @fires {CustomEvent<{ value: string }>} impkt-change - When the answer changes. The answer is in detail.value.\n */\nexport abstract class FieldElement extends ImpktElement {\n /** Form controls participate in a `<form>` like native ones. */\n static formAssociated = true;\n\n static properties = {\n label: { type: String },\n name: { type: String },\n value: { type: String },\n description: { type: String },\n error: { type: String },\n required: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n requiredText: { type: String, attribute: 'required-text' },\n };\n\n declare label: string;\n declare name: string;\n declare value: string;\n declare description: string;\n declare error: string;\n declare required: boolean;\n declare disabled: boolean;\n declare readonly: boolean;\n /**\n * How \"you must answer this\" is said.\n *\n * Words, not an asterisk. 3.3.2 asks for labels or instructions, and an\n * asterisk is neither until a legend explains it — which puts the\n * explanation somewhere other than the field it explains. It is a property\n * so a partner can reword it, not so they can empty it.\n */\n declare requiredText: string;\n\n protected internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.label = '';\n this.name = '';\n this.value = '';\n this.description = '';\n this.error = '';\n this.required = false;\n this.disabled = false;\n this.readonly = false;\n this.requiredText = 'required';\n // happy-dom and older engines do not implement attachInternals. A control\n // that cannot associate with a form is still a usable control, so this\n // degrades rather than throwing on construction.\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n .label {\n display: block;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('semibold')};\n line-height: ${lineHeight('normal')};\n margin-block-end: ${space(1)};\n color: ${t.text};\n }\n .required {\n font-weight: ${fontWeight('regular')};\n color: ${t.textMuted};\n }\n .description {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.textMuted};\n margin-block-end: ${space(2)};\n }\n .error {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.dangerText};\n margin-block-start: ${space(1)};\n display: flex;\n gap: ${space(1)};\n }\n .error:empty {\n display: none;\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n :host([disabled]) {\n opacity: 0.6;\n }\n `,\n ];\n\n protected get controlId(): string {\n return this.id_('control');\n }\n\n /**\n * What the control points `aria-describedby` at.\n *\n * The error id is included only while there is an error. A describedby that\n * always names an empty element trains a screen-reader user to expect\n * nothing after the description, and then the one time it matters they have\n * already learned to ignore it.\n */\n protected get describedBy(): string | typeof nothing {\n const ids = [\n this.description ? this.id_('description') : '',\n this.error ? this.id_('error') : '',\n ].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n /**\n * Focusing the element focuses its control, so `el.focus()` from an app, a\n * React ref or the error summary's link lands where someone can type, rather\n * than on a host that cannot take focus and so silently does nothing.\n */\n focus(options?: FocusOptions): void {\n const control = this.renderRoot?.querySelector<HTMLElement>(`#${this.controlId}`)\n ?? this.renderRoot?.querySelector<HTMLElement>('input, select, textarea, button');\n if (control) control.focus(options);\n else super.focus(options);\n }\n\n /** Subclasses render the control itself; everything round it is here. */\n protected abstract renderControl(): TemplateResult;\n\n /**\n * `<label for>` by default. A group of controls — radios, checkboxes —\n * cannot use one, because `for` names a single control, so those override\n * this and render a `<fieldset>` and `<legend>` instead.\n */\n protected renderLabel(): TemplateResult {\n return html`\n <label class=\"label\" for=${this.controlId} part=\"label\">\n ${this.label}${this.required\n ? html`<span class=\"required\"> (${this.requiredText})</span>`\n : nothing}\n </label>\n `;\n }\n\n render(): TemplateResult {\n return html`\n ${this.renderLabel()}\n ${this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing}\n ${this.renderControl()}\n <!--\n The error region is always present, even when empty. A live region\n inserted at the same moment as its content is announced unreliably\n across screen readers; one that already exists and is then filled is\n announced consistently. \"polite\" rather than \"assertive\" because a\n validation message should not interrupt what is being read.\n -->\n <div\n class=\"error\"\n id=${this.id_('error')}\n part=\"error\"\n aria-live=\"polite\"\n >\n ${this.error || nothing}\n </div>\n `;\n }\n\n /** Keep the form value in step with the control. */\n protected setFormValue(value: string): void {\n this.value = value;\n this.internals?.setFormValue(value);\n this.dispatchEvent(new CustomEvent('impkt-change', { detail: { value }, bubbles: true, composed: true }));\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA0BjD,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAapB,IAAe,eAAf,cAAoC,aAAa;AAAA,EAoCtD,cAAc;AACZ,UAAM;AAHR,SAAU,YAAqC;AAI7C,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,cAAc;AACnB,SAAK,QAAQ;AACb,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,eAAe;AAIpB,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EArDA;AAAA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAA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G.js";
4
- import "../chunk-D6C7XEY4.js";
3
+ } from "../chunk-5QSTXIPG.js";
4
+ import "../chunk-3KO55PZK.js";
5
5
  export {
6
6
  ImpktAccordion
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ImpktAlert
3
- } from "../chunk-FFCIY7NM.js";
4
- import "../chunk-D6C7XEY4.js";
3
+ } from "../chunk-CUUBAETM.js";
4
+ import "../chunk-3KO55PZK.js";
5
5
  export {
6
6
  ImpktAlert
7
7
  };
@@ -6,14 +6,15 @@ import { ImpktElement } from '../base/ImpktElement';
6
6
  *
7
7
  * It is a native `<dialog>` opened with `showModal()`, like the dialog, so the
8
8
  * focus trap, Escape, the inert page behind it and the return of focus all come
9
- * from the browser. The slide is a decoration and stops for anyone who has
10
- * asked for reduced motion.
9
+ * from the browser. The page behind it does not scroll while it is open. The
10
+ * slide is a decoration and stops for anyone who has asked for reduced motion.
11
+ * On a phone it fills the screen.
11
12
  *
12
13
  * @category feedback
13
14
  * @icon drawer
14
15
  * @slot - The body of the panel.
15
16
  * @slot footer - Buttons pinned to the bottom of the panel.
16
- * @fires impkt-close - When the panel is closed.
17
+ * @fires {CustomEvent<null>} impkt-close - When the panel is closed.
17
18
  */
18
19
  export declare class ImpktDrawer extends ImpktElement {
19
20
  static properties: {
@@ -42,6 +43,7 @@ export declare class ImpktDrawer extends ImpktElement {
42
43
  private hasFooter;
43
44
  private get dialog();
44
45
  updated(changed: Map<string, unknown>): void;
46
+ disconnectedCallback(): void;
45
47
  private close;
46
48
  private footerChanged;
47
49
  render(): TemplateResult;
@@ -49,14 +51,24 @@ export declare class ImpktDrawer extends ImpktElement {
49
51
  /**
50
52
  * A short message in the corner that goes away: "Viewing booked", "Saved".
51
53
  *
52
- * It says itself to a screen reader through a live region, and its timer stops
53
- * while it is pointed at or focused. Set `duration` to 0 to keep it up until it
54
- * is closed. Anything a person must act on belongs in an alert on the page.
54
+ * It says itself to a screen reader through a live region that is on the page
55
+ * before the message is, and its timer stops while it is pointed at or focused.
56
+ * Set `duration` to 0 to keep it up until it is closed. A message with a button,
57
+ * such as Undo, stays until it is closed whatever the duration, because a
58
+ * button that disappears on a timer cannot be pressed by someone who needs
59
+ * longer (2.2.1). Escape closes it while focus is inside it. Anything a person
60
+ * must act on belongs in an alert on the page.
61
+ *
62
+ * It never takes the page's clicks: only the message itself can be pressed, so
63
+ * the page beside and behind the corner it sits in still works. On a phone it
64
+ * spans the screen above the bottom edge, clear of the home bar and of a bottom
65
+ * bar that sets `--impkt-bottom-bar`, and it rises without moving for anyone who
66
+ * has asked for reduced motion.
55
67
  *
56
68
  * @category feedback
57
69
  * @icon toast
58
- * @fires impkt-close - When the message goes away.
59
- * @fires impkt-action - When its button is pressed.
70
+ * @fires {CustomEvent<null>} impkt-close - When the message goes away.
71
+ * @fires {CustomEvent<null>} impkt-action - When its button is pressed.
60
72
  */
61
73
  export declare class ImpktToast extends ImpktElement {
62
74
  static properties: {
@@ -114,12 +126,14 @@ export interface MenuItem {
114
126
  * A button that opens a short list of actions or links.
115
127
  *
116
128
  * It follows the ARIA menu button pattern: the arrow keys, Home and End move
117
- * through it, Escape closes it and puts focus back on the button, and a click
118
- * anywhere else closes it.
129
+ * through it, a letter moves to the next item that starts with it, Escape
130
+ * closes it and puts focus back on the button, and a click anywhere else closes
131
+ * it. A list that would run off the side of the screen opens towards the other
132
+ * edge instead, so it never makes a phone scroll sideways.
119
133
  *
120
134
  * @category navigation
121
135
  * @icon menu
122
- * @fires impkt-select - When an item without an address is chosen. The value is in detail.value.
136
+ * @fires {CustomEvent<{ value: string }>} impkt-select - When an item without an address is chosen. The value is in detail.value.
123
137
  */
124
138
  export declare class ImpktMenu extends ImpktElement {
125
139
  static properties: {
@@ -154,6 +168,8 @@ export declare class ImpktMenu extends ImpktElement {
154
168
  private get entries();
155
169
  private get trigger();
156
170
  private toggle;
171
+ /** Open towards the other edge when the list would run off the screen. */
172
+ private keepOnScreen;
157
173
  private triggerKey;
158
174
  private listKey;
159
175
  private choose;
@@ -170,7 +186,7 @@ export declare function pageWindow(page: number, pages: number): Array<number |
170
186
  *
171
187
  * @category navigation
172
188
  * @icon pagination
173
- * @fires impkt-page - When a page is chosen. The number is in detail.page.
189
+ * @fires {CustomEvent<{ page: number }>} impkt-page - When a page is chosen. The number is in detail.page.
174
190
  */
175
191
  export declare class ImpktPagination extends ImpktElement {
176
192
  static properties: {
@@ -8,11 +8,12 @@ import {
8
8
  ImpktSlotPicker,
9
9
  ImpktToast,
10
10
  pageWindow
11
- } from "../chunk-HYPPG4NF.js";
11
+ } from "../chunk-7P4Z4CLK.js";
12
+ import "../chunk-2YRTFWW2.js";
12
13
  import "../chunk-3IGNZTJU.js";
13
- import "../chunk-KFD4O7VA.js";
14
- import "../chunk-7AJN2TIS.js";
15
- import "../chunk-D6C7XEY4.js";
14
+ import "../chunk-NKMVICB5.js";
15
+ import "../chunk-ZOTAAYO5.js";
16
+ import "../chunk-3KO55PZK.js";
16
17
  export {
17
18
  ImpktAvatar,
18
19
  ImpktAvatarGroup,
@@ -62,19 +62,31 @@ export declare class ImpktVisuallyHidden extends ImpktElement {
62
62
  export interface TabItem {
63
63
  id: string;
64
64
  label: string;
65
+ /** The panel's words. A child with `slot` set to the tab's id is shown instead, for anything richer. */
65
66
  body: string;
66
67
  }
67
68
  /**
68
69
  * Panels of content behind a row of tabs, one shown at a time: the floor plans
69
- * of three house types, or what is included and what costs extra.
70
+ * of three house types, or a case's summary, tasks and files.
70
71
  *
71
72
  * It follows the ARIA tabs pattern. The tabs are one stop in the tab order,
72
73
  * the arrow keys, Home and End move between them, and each panel is labelled
73
74
  * by its tab. Use an accordion instead when someone may want to compare panels.
74
75
  *
76
+ * **The tabs stay on one row** and scroll sideways when they do not fit, as the
77
+ * design guide sets, and the chosen tab is scrolled into view, so on a phone it
78
+ * is never hidden off the edge. With `two-rows`, a set of more than four tabs is
79
+ * laid out in two rows on a narrow screen instead, so every tab can be seen.
80
+ *
81
+ * **The chosen tab is kept** when the tabs are given again, as a React or Vue app
82
+ * does on every render, so long as a tab with that id is still there.
83
+ *
84
+ * A panel shows its item's `body`, or a child whose `slot` is the item's id.
85
+ *
75
86
  * @category content
76
87
  * @icon tabs
77
- * @fires impkt-change - When another tab is chosen.
88
+ * @slot - A child with `slot` set to a tab's id is that tab's panel.
89
+ * @fires {CustomEvent<{ value: string }>} impkt-change - When another tab is chosen.
78
90
  */
79
91
  export declare class ImpktTabs extends ImpktElement {
80
92
  static properties: {
@@ -88,17 +100,31 @@ export declare class ImpktTabs extends ImpktElement {
88
100
  label: {
89
101
  type: StringConstructor;
90
102
  };
103
+ twoRows: {
104
+ type: BooleanConstructor;
105
+ reflect: boolean;
106
+ attribute: string;
107
+ };
91
108
  };
92
109
  items: TabItem[];
93
110
  /** The id of the tab shown first. The first tab when it is empty. */
94
111
  selected: string;
95
112
  /** What the set of tabs is about, for a screen reader. */
96
113
  label: string;
114
+ /** On a narrow screen, lay more than four tabs out in two rows rather than scroll them. */
115
+ twoRows: boolean;
97
116
  constructor();
98
117
  static styles: import("lit").CSSResult[];
99
118
  private current;
100
119
  private choose;
101
120
  private onKey;
121
+ /**
122
+ * Bring the chosen tab into view inside the row of tabs. Only the row scrolls:
123
+ * `scrollIntoView` would scroll the page too, and move someone who is reading
124
+ * further down.
125
+ */
126
+ private reveal;
127
+ updated(changed: Map<string, unknown>): void;
102
128
  render(): TemplateResult;
103
129
  }
104
130
  /** One card in a row of them. */
@@ -4,9 +4,9 @@ import {
4
4
  ImpktSpacer,
5
5
  ImpktTabs,
6
6
  ImpktVisuallyHidden
7
- } from "../chunk-MVEFM5QI.js";
8
- import "../chunk-KFD4O7VA.js";
9
- import "../chunk-D6C7XEY4.js";
7
+ } from "../chunk-HXINWP3V.js";
8
+ import "../chunk-NKMVICB5.js";
9
+ import "../chunk-3KO55PZK.js";
10
10
  export {
11
11
  ImpktCardGrid,
12
12
  ImpktDivider,