@atomic-ui/ui 0.7.1 → 0.8.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 (141) hide show
  1. package/README.md +8 -8
  2. package/custom-elements.json +487 -34
  3. package/dist/base/FieldElement.d.ts +4 -0
  4. package/dist/{chunk-TRZO5CHU.js → chunk-26BO3W56.js} +8 -4
  5. package/dist/chunk-26BO3W56.js.map +1 -0
  6. package/dist/{chunk-4ZQTXTPA.js → chunk-2EP3IV3G.js} +8 -4
  7. package/dist/chunk-2EP3IV3G.js.map +1 -0
  8. package/dist/{chunk-NU34ZQFR.js → chunk-2ZF3J7OO.js} +8 -5
  9. package/dist/chunk-2ZF3J7OO.js.map +1 -0
  10. package/dist/{chunk-WP5WJ4V5.js → chunk-3NEWOO2P.js} +3 -3
  11. package/dist/chunk-3NEWOO2P.js.map +1 -0
  12. package/dist/{chunk-AMDTBUUL.js → chunk-3T7J66Z2.js} +16 -4
  13. package/dist/chunk-3T7J66Z2.js.map +1 -0
  14. package/dist/{chunk-XU2XODVH.js → chunk-5OJAJA3U.js} +3 -3
  15. package/dist/chunk-5OJAJA3U.js.map +1 -0
  16. package/dist/{chunk-3EF4T242.js → chunk-6PMA6NHE.js} +8 -4
  17. package/dist/chunk-6PMA6NHE.js.map +1 -0
  18. package/dist/{chunk-HNBG2POR.js → chunk-7C56LPNJ.js} +2 -2
  19. package/dist/{chunk-HNBG2POR.js.map → chunk-7C56LPNJ.js.map} +1 -1
  20. package/dist/{chunk-EJSX4WCD.js → chunk-7UWJXPR3.js} +12 -8
  21. package/dist/chunk-7UWJXPR3.js.map +1 -0
  22. package/dist/{chunk-WH43U4IY.js → chunk-A4M3A4SZ.js} +4 -4
  23. package/dist/{chunk-WH43U4IY.js.map → chunk-A4M3A4SZ.js.map} +1 -1
  24. package/dist/{chunk-I54DOEZB.js → chunk-AG4EP3OY.js} +3 -3
  25. package/dist/{chunk-I54DOEZB.js.map → chunk-AG4EP3OY.js.map} +1 -1
  26. package/dist/{chunk-WS4AYRSL.js → chunk-AL4IUSML.js} +7 -4
  27. package/dist/{chunk-WS4AYRSL.js.map → chunk-AL4IUSML.js.map} +1 -1
  28. package/dist/{chunk-ZQBEFP2O.js → chunk-APQEXM4I.js} +8 -4
  29. package/dist/chunk-APQEXM4I.js.map +1 -0
  30. package/dist/{chunk-YYYQPKQ7.js → chunk-AURT72IC.js} +2 -2
  31. package/dist/{chunk-KFAGXPIK.js → chunk-AVDSYLOY.js} +3 -3
  32. package/dist/{chunk-KFAGXPIK.js.map → chunk-AVDSYLOY.js.map} +1 -1
  33. package/dist/{chunk-GJPHQLLN.js → chunk-AYKYHZGQ.js} +2 -2
  34. package/dist/{chunk-GJPHQLLN.js.map → chunk-AYKYHZGQ.js.map} +1 -1
  35. package/dist/{chunk-QBORJTS4.js → chunk-D3JWVMJE.js} +55 -19
  36. package/dist/chunk-D3JWVMJE.js.map +1 -0
  37. package/dist/{chunk-RXX4CN5J.js → chunk-EGJZDKMW.js} +2 -2
  38. package/dist/{chunk-RXX4CN5J.js.map → chunk-EGJZDKMW.js.map} +1 -1
  39. package/dist/{chunk-XZQH2M5I.js → chunk-FAE6TGGT.js} +21 -9
  40. package/dist/chunk-FAE6TGGT.js.map +1 -0
  41. package/dist/{chunk-UPOTBKKK.js → chunk-FU3CEHBS.js} +2 -2
  42. package/dist/{chunk-UPOTBKKK.js.map → chunk-FU3CEHBS.js.map} +1 -1
  43. package/dist/{chunk-UF6KCRNT.js → chunk-JNLKM3JT.js} +29 -13
  44. package/dist/chunk-JNLKM3JT.js.map +1 -0
  45. package/dist/{chunk-2HWO5TFV.js → chunk-KAQJVGYW.js} +14 -9
  46. package/dist/{chunk-2HWO5TFV.js.map → chunk-KAQJVGYW.js.map} +1 -1
  47. package/dist/{chunk-BMJFSUP3.js → chunk-MLKNZL5J.js} +26 -10
  48. package/dist/chunk-MLKNZL5J.js.map +1 -0
  49. package/dist/{chunk-PYVUQNFQ.js → chunk-MOO63SHZ.js} +2 -2
  50. package/dist/{chunk-PYVUQNFQ.js.map → chunk-MOO63SHZ.js.map} +1 -1
  51. package/dist/{chunk-A7YBFS4H.js → chunk-NKMJMVZP.js} +2 -2
  52. package/dist/{chunk-5ZQVL3V2.js → chunk-ONED3PUB.js} +8 -7
  53. package/dist/{chunk-5ZQVL3V2.js.map → chunk-ONED3PUB.js.map} +1 -1
  54. package/dist/{chunk-FWR6SEIA.js → chunk-OXDMAJMZ.js} +30 -6
  55. package/dist/chunk-OXDMAJMZ.js.map +1 -0
  56. package/dist/{chunk-MLRTPQQO.js → chunk-OZGKK3N5.js} +11 -6
  57. package/dist/chunk-OZGKK3N5.js.map +1 -0
  58. package/dist/{chunk-RZWRAJCD.js → chunk-P6HG5RB2.js} +71 -29
  59. package/dist/chunk-P6HG5RB2.js.map +1 -0
  60. package/dist/{chunk-ON3QWAFV.js → chunk-TE3CBEJQ.js} +31 -12
  61. package/dist/chunk-TE3CBEJQ.js.map +1 -0
  62. package/dist/{chunk-OE6O3XQB.js → chunk-UQY6IUMW.js} +16 -3
  63. package/dist/chunk-UQY6IUMW.js.map +1 -0
  64. package/dist/{chunk-YR6T73GY.js → chunk-V7EB7Q2M.js} +1 -1
  65. package/dist/chunk-V7EB7Q2M.js.map +1 -0
  66. package/dist/{chunk-DE3INTHZ.js → chunk-YWP2Z3JN.js} +3 -3
  67. package/dist/{chunk-DE3INTHZ.js.map → chunk-YWP2Z3JN.js.map} +1 -1
  68. package/dist/{chunk-WS5AUJ35.js → chunk-Z2EWQMTR.js} +7 -4
  69. package/dist/chunk-Z2EWQMTR.js.map +1 -0
  70. package/dist/{chunk-INA53XXW.js → chunk-ZL3JFUIE.js} +3 -3
  71. package/dist/chunk-ZL3JFUIE.js.map +1 -0
  72. package/dist/components/accordion.js +2 -2
  73. package/dist/components/alert.js +2 -2
  74. package/dist/components/app-ui.d.ts +13 -0
  75. package/dist/components/app-ui.js +4 -4
  76. package/dist/components/badge.js +3 -3
  77. package/dist/components/blocks.js +4 -4
  78. package/dist/components/button.d.ts +4 -3
  79. package/dist/components/button.js +3 -3
  80. package/dist/components/checkbox-group.js +3 -3
  81. package/dist/components/checkbox.js +3 -3
  82. package/dist/components/chip.js +2 -2
  83. package/dist/components/date-input.js +3 -3
  84. package/dist/components/dialog.js +2 -2
  85. package/dist/components/fieldset.js +2 -2
  86. package/dist/components/grid.js +2 -2
  87. package/dist/components/help.js +2 -2
  88. package/dist/components/icon.js +2 -2
  89. package/dist/components/journey.js +3 -3
  90. package/dist/components/layout.js +2 -2
  91. package/dist/components/link.js +3 -3
  92. package/dist/components/list.js +2 -2
  93. package/dist/components/media.js +2 -2
  94. package/dist/components/navigation.js +3 -3
  95. package/dist/components/page.d.ts +12 -1
  96. package/dist/components/page.js +2 -2
  97. package/dist/components/price.js +2 -2
  98. package/dist/components/progress.d.ts +12 -0
  99. package/dist/components/progress.js +2 -2
  100. package/dist/components/radio-group.js +3 -3
  101. package/dist/components/rows.js +3 -3
  102. package/dist/components/select.d.ts +11 -0
  103. package/dist/components/select.js +3 -3
  104. package/dist/components/shell.js +3 -3
  105. package/dist/components/summary-list.js +2 -2
  106. package/dist/components/switch.d.ts +17 -0
  107. package/dist/components/switch.js +3 -3
  108. package/dist/components/table.js +3 -3
  109. package/dist/components/text-input.js +4 -4
  110. package/dist/components/textarea.js +3 -3
  111. package/dist/index.d.ts +2 -2
  112. package/dist/index.js +35 -35
  113. package/dist/standalone/atomic-ui.js +101 -59
  114. package/dist/standalone/atomic-ui.js.map +3 -3
  115. package/dist/standalone/index.html +189 -150
  116. package/package.json +2 -2
  117. package/scripts/copy-to-product.mjs +8 -7
  118. package/specimen/index.html +189 -150
  119. package/dist/chunk-3EF4T242.js.map +0 -1
  120. package/dist/chunk-4ZQTXTPA.js.map +0 -1
  121. package/dist/chunk-AMDTBUUL.js.map +0 -1
  122. package/dist/chunk-BMJFSUP3.js.map +0 -1
  123. package/dist/chunk-EJSX4WCD.js.map +0 -1
  124. package/dist/chunk-FWR6SEIA.js.map +0 -1
  125. package/dist/chunk-INA53XXW.js.map +0 -1
  126. package/dist/chunk-MLRTPQQO.js.map +0 -1
  127. package/dist/chunk-NU34ZQFR.js.map +0 -1
  128. package/dist/chunk-OE6O3XQB.js.map +0 -1
  129. package/dist/chunk-ON3QWAFV.js.map +0 -1
  130. package/dist/chunk-QBORJTS4.js.map +0 -1
  131. package/dist/chunk-RZWRAJCD.js.map +0 -1
  132. package/dist/chunk-TRZO5CHU.js.map +0 -1
  133. package/dist/chunk-UF6KCRNT.js.map +0 -1
  134. package/dist/chunk-WP5WJ4V5.js.map +0 -1
  135. package/dist/chunk-WS5AUJ35.js.map +0 -1
  136. package/dist/chunk-XU2XODVH.js.map +0 -1
  137. package/dist/chunk-XZQH2M5I.js.map +0 -1
  138. package/dist/chunk-YR6T73GY.js.map +0 -1
  139. package/dist/chunk-ZQBEFP2O.js.map +0 -1
  140. /package/dist/{chunk-YYYQPKQ7.js.map → chunk-AURT72IC.js.map} +0 -0
  141. /package/dist/{chunk-A7YBFS4H.js.map → chunk-NKMJMVZP.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/progress.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { ImpaktElement } from '../base/ImpaktElement';\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 ImpaktProgress extends ImpaktElement {\n static properties = {\n steps: { type: Array },\n current: { type: String },\n label: { type: String },\n look: { type: String, reflect: true },\n };\n\n declare steps: ProgressStep[];\n /** The id of the step being shown. */\n declare current: string;\n declare label: string;\n /**\n * `steps` is the full indicator. `bars` is a compact one for a card: short\n * rounded bars, the done steps in the text colour and the current one in the\n * brand, with small names under them. The current step is also set in a\n * heavier weight, so it does not rest on colour alone.\n */\n declare look: 'steps' | 'bars';\n\n constructor() {\n super();\n this.steps = [];\n this.current = '';\n this.label = 'Progress';\n this.look = 'steps';\n }\n\n static styles = [\n ...ImpaktElement.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 :host([look='bars']) {\n margin-block-end: 0;\n }\n :host([look='bars']) ol {\n gap: ${space(1.5)};\n }\n :host([look='bars']) li {\n position: relative;\n padding-block-start: ${space(3)};\n border: 0;\n font-size: 12px;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n :host([look='bars']) li::before {\n content: '';\n position: absolute;\n inset-inline: 0;\n inset-block-start: 0;\n block-size: 5px;\n border-radius: 999px;\n background: ${t.border};\n }\n :host([look='bars']) li[data-state='done']::before {\n background: ${t.text};\n }\n :host([look='bars']) li[data-state='current']::before {\n background: ${t.brand};\n }\n @media (forced-colors: active) {\n :host([look='bars']) li::before { background: GrayText; }\n :host([look='bars']) li[data-state='done']::before, :host([look='bars']) li[data-state='current']::before { background: CanvasText; }\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('impakt-progress', ImpaktProgress);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impakt-progress': ImpaktProgress }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA8BjD,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,UAAU;AACf,SAAK,QAAQ;AACb,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA;AAAA;AAAA,4BAGwB,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,eAIrB,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAO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,OAAO,mBAAmB,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/badge.ts"],"sourcesContent":["/**\n * A short label on something, coloured by its tone.\n */\nimport { css, html, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { fontWeight, space, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A short label on something: \"New\", \"Selling fast\", \"2 left\".\n *\n * The tone colours it, and the words carry the meaning, so it reads the same\n * without the colour (1.4.1).\n *\n * @category feedback\n * @icon badge\n * @slot - The badge's words.\n */\nexport class ImpaktBadge extends ImpaktElement {\n static properties = {\n tone: { type: String, reflect: true },\n icon: { type: String },\n };\n /**\n * Its colour. `inverse` is the text colour as a fill, for a label that has to\n * stand out on a photo or a light card. `solid` is the brand as a fill, for\n * the one label on a screen that matters most.\n */\n declare tone: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info' | 'inverse' | 'solid';\n /** An icon before the words. */\n declare icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n\n constructor() {\n super();\n this.tone = 'neutral';\n this.icon = 'none';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: inline-flex; }\n span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(0.5)} ${space(2)}; border-radius: ${t.radius}; ${type('sm')} font-weight: ${fontWeight('medium')}; background: ${t.surfaceInset}; color: ${t.text}; box-shadow: inset 0 0 0 1px ${t.hairline}; }\n :host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }\n :host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }\n :host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }\n :host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }\n :host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }\n :host([tone='inverse']) span { background: ${t.text}; color: ${t.surfaceCard}; box-shadow: none; }\n :host([tone='solid']) span { background: ${t.brand}; color: ${t.onBrand}; box-shadow: none; }\n @media (forced-colors: active) { span { border-color: CanvasText; } }\n `];\n\n render(): TemplateResult {\n return html`<span part=\"badge\">${iconSvg(this.icon, '1em')}<slot></slot></span>`;\n }\n}\n\ncustomElements.define('impakt-badge', ImpaktBadge);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-badge': ImpaktBadge;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,SAAS,KAAK,YAAiC;AAexC,IAAM,cAAN,cAA0B,cAAc;AAAA,EAC7C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,OAAO;AAAA,IACvB;AAAA;AAAA,EAUA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,cAAc,QAAQ;AAAA;AAAA,6DAEiB,MAAM,CAAC,CAAC,cAAc,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,oBAAoB,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC,iBAAiB,WAAW,QAAQ,CAAC,iBAAiB,EAAE,YAAY,YAAY,EAAE,IAAI,iCAAiC,EAAE,QAAQ;AAAA,+CACtO,EAAE,WAAW,YAAY,EAAE,KAAK;AAAA,iDAC9B,EAAE,aAAa,YAAY,EAAE,WAAW;AAAA,iDACxC,EAAE,aAAa,YAAY,EAAE,WAAW;AAAA,gDACzC,EAAE,YAAY,YAAY,EAAE,UAAU;AAAA,8CACxC,EAAE,UAAU,YAAY,EAAE,QAAQ;AAAA,iDAC/B,EAAE,IAAI,YAAY,EAAE,WAAW;AAAA,+CACjC,EAAE,KAAK,YAAY,EAAE,OAAO;AAAA;AAAA,GAExE;AAAA;AAAA,EAED,SAAyB;AACvB,WAAO,0BAA0B,QAAQ,KAAK,MAAM,KAAK,CAAC;AAAA,EAC5D;AACF;AAEA,eAAe,OAAO,gBAAgB,WAAW;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/button.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A button.\n *\n * Two decisions carry the accessibility weight here.\n *\n * **A busy button is not a disabled button.** While an action is in flight the\n * control keeps its place in the tab order and reports `aria-disabled`, rather\n * than taking the native `disabled` attribute. A natively disabled element is\n * removed from the tab order, so a keyboard user who had just activated it\n * loses their focus position to the top of the document — at precisely the\n * moment something is happening that they need to be told about. Activation is\n * blocked in the handler instead.\n *\n * **It renders a real `<button>`.** A `<div role=\"button\">` needs Enter and\n * Space handling, a tabindex, and a disabled story, and it will still not\n * submit a form. The native element already has all of that, correctly, in\n * every browser and every assistive technology.\n\n *\n * **A button that goes somewhere is a link.** With `href` set it renders an\n * `<a>` styled as a button, so it opens in a new tab, shows its address and is\n * announced as a link, which is what it is.\n *\n * **An icon-only button still has a name.** With `icon` set and no words, the\n * button shows the icon alone and `label` becomes its accessible name, so a\n * screen reader says \"Back\" rather than \"button\". Without a `label` an\n * icon-only button is not rendered as icon-only, because it would be nameless\n * (4.1.2).\n *\n * @category action\n * @icon button\n * @slot - The button label.\n * @fires click - When the button is pressed. Not while it is busy or disabled.\n */\nexport class ImpaktButton extends ImpaktElement {\n static formAssociated = true;\n\n static properties = {\n hideOn: { type: String, reflect: true, attribute: 'hide-on' },\n variant: { type: String, reflect: true },\n type: { type: String },\n disabled: { type: Boolean, reflect: true },\n busy: { type: Boolean, reflect: true },\n busyLabel: { type: String, attribute: 'busy-label' },\n full: { type: Boolean, reflect: true },\n fullOnPhone: { type: Boolean, attribute: 'full-on-phone', reflect: true },\n size: { type: String, reflect: true },\n iconBefore: { type: String, attribute: 'icon-before' },\n iconAfter: { type: String, attribute: 'icon-after' },\n href: { type: String },\n icon: { type: String },\n label: { type: String },\n };\n\n /** Leave it out on a phone, where a header has no room for it. */\n declare hideOn: 'never' | 'phone';\n /**\n * How much the button asks for attention. `dark` is the strong second\n * choice on a light page, `subtle` a quiet filled one, and `danger` an\n * action that removes or cancels something.\n */\n declare variant: 'primary' | 'secondary' | 'ghost' | 'dark' | 'subtle' | 'danger';\n declare type: 'button' | 'submit' | 'reset';\n declare disabled: boolean;\n declare busy: boolean;\n /** Announced when the button becomes busy. Says what is happening, not that something is. */\n declare busyLabel: string;\n declare full: boolean;\n /** As wide as its space on a phone only, such as a form's send button. */\n declare fullOnPhone: boolean;\n declare size: 'sm' | 'md' | 'lg';\n /** An icon before the words, such as phone or calendar. */\n declare iconBefore: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n /** An icon after the words, such as arrow-right. */\n declare iconAfter: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n /** Where the button goes, when it opens a page rather than doing something here. */\n declare href: string;\n /** Draws the button as this icon alone, a round button. Needs `label`. */\n declare icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat' | 'grid' | 'clipboard' | 'map-pinned' | 'users' | 'radio' | 'settings' | 'log-out' | 'arrow-up-right' | 'more' | 'upload' | 'image' | 'lock' | 'eye' | 'trash' | 'pencil' | 'qr-code' | 'battery';\n /** The accessible name of an icon-only button, such as \"Back\" or \"More actions\". */\n declare label: string;\n\n private internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.hideOn = 'never';\n this.variant = 'primary';\n this.type = 'button';\n this.disabled = false;\n this.busy = false;\n this.busyLabel = 'Working';\n this.full = false;\n this.fullOnPhone = false;\n this.size = 'md';\n this.iconBefore = 'none';\n this.iconAfter = 'none';\n this.href = '';\n this.icon = 'none';\n this.label = '';\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('button, a'),\n css`\n @media (max-width: 40rem) { :host([hide-on='phone']) { display: none; } }\n :host {\n display: inline-block;\n }\n :host([full]) {\n display: block;\n }\n @media (max-width: 40rem) { :host([full-on-phone]) { display: block; } }\n button, a {\n ${targetSize}\n box-sizing: border-box;\n text-decoration: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ${space(2)};\n inline-size: 100%;\n min-block-size: 40px;\n padding: ${space(2)} ${space(4)};\n font-family: inherit;\n ${type('sm')}\n font-weight: ${fontWeight('semibold')};\n border-radius: ${t.radiusLg};\n border: ${t.borderThin} solid transparent;\n cursor: pointer;\n transition: background-color 120ms ease-in-out, border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n }\n :host([size='sm']) :is(button, a) { min-block-size: 32px; padding: ${space(1)} ${space(3)}; ${type('sm')} gap: ${space(1.5)}; }\n :host([size='lg']) :is(button, a) { min-block-size: 48px; padding: ${space(3)} ${space(6)}; ${type('md')} }\n .icon { flex: none; inline-size: 1.15em; block-size: 1.15em; }\n /* The cursor is the only thing that changes while busy. Moving or\n recolouring a control the moment it is pressed is how a user loses it. */\n button[aria-disabled='true'] {\n cursor: progress;\n }\n :host([disabled]) button {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Solid: the brand, with a hairline highlight along the top edge. */\n .primary {\n background: ${t.brand};\n color: ${t.onBrand};\n box-shadow: ${t.shadowXs}, inset 0 1px 0 0 rgb(255 255 255 / 0.12);\n }\n .primary:hover:not([aria-disabled='true']) {\n background: var(--impakt-color-action-hover, ${t.brandHover});\n color: var(--impakt-color-action-on-hover, ${t.onBrand});\n }\n /* A brand whose buttons turn on hover lifts the trailing arrow a quarter-turn. */\n .after { transition: transform 160ms ease-out; }\n :is(button, a):hover:not([aria-disabled='true']) .after { transform: rotate(var(--impakt-motion-button-turn, 0deg)); }\n @media (prefers-reduced-motion: reduce) { .after { transition: none; } }\n .primary:active:not([aria-disabled='true']) {\n background: ${t.brandActive};\n }\n\n /* Outline: the card, a hairline border and the text colour, for the second choice. */\n .secondary {\n background: ${t.surfaceCard};\n color: ${t.text};\n border-color: ${t.rule};\n box-shadow: ${t.shadowXs};\n }\n .secondary:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceCard}, ${t.text} 4%);\n border-color: color-mix(in srgb, ${t.text} 25%, transparent);\n }\n\n /* Plain: words only until it is pointed at. */\n .ghost {\n background: transparent;\n color: ${t.link};\n }\n .ghost:hover:not([aria-disabled='true']) {\n background: ${t.wash};\n }\n\n /* Dark: the text colour as a fill, the strong second choice on a light page. */\n .dark {\n background: ${t.text};\n color: ${t.surfaceCard};\n }\n .dark:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 14%);\n }\n .dark:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 24%);\n }\n\n /* Subtle: a quiet fill, for an action that sits beside the main one. */\n .subtle {\n background: ${t.surfaceInset};\n color: ${t.text};\n }\n .subtle:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 6%);\n }\n .subtle:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 12%);\n }\n\n /* Danger: the danger text colour as a fill, so white words on it keep 4.5:1. */\n .danger {\n background: ${t.dangerText};\n color: ${t.surfaceCard};\n }\n .danger:hover:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.dangerText}, ${t.text} 15%);\n }\n .danger:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${t.dangerText}, ${t.text} 28%);\n }\n\n /* Icon only: a round button as tall as it is wide. */\n .icon-only {\n inline-size: 40px;\n min-inline-size: 40px;\n block-size: 40px;\n min-block-size: 40px;\n padding: 0;\n border-radius: 999px;\n }\n :host([size='sm']) .icon-only { inline-size: 32px; min-inline-size: 32px; block-size: 32px; min-block-size: 32px; padding: 0; }\n :host([size='lg']) .icon-only { inline-size: 48px; min-inline-size: 48px; block-size: 48px; min-block-size: 48px; padding: 0; }\n\n .sr-only {\n ${visuallyHidden}\n }\n\n /* Windows High Contrast Mode drops background and border colours, so a\n button styled only by background becomes invisible. A forced-colors\n border puts the boundary back. */\n @media (forced-colors: active) {\n button, a {\n border-color: ButtonBorder;\n }\n }\n `,\n ];\n\n private onClick(event: MouseEvent): void {\n if (this.disabled || this.busy) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n // A shadow-rooted button does not submit the outer form by itself, because\n // the click never reaches it. `requestSubmit` rather than `submit` so that\n // native validation and the submit event both still run.\n if (this.type === 'submit') this.internals?.form?.requestSubmit();\n if (this.type === 'reset') this.internals?.form?.reset();\n }\n\n render(): TemplateResult {\n const iconOnly = Boolean(this.icon && this.icon !== 'none' && this.label);\n const cls = iconOnly ? `${this.variant} icon-only` : this.variant;\n if (iconOnly) {\n const drawn = iconSvg(this.icon);\n if (this.href && !this.disabled) {\n return html`<a class=${cls} href=${this.href} part=\"button\" aria-label=${this.label}>${drawn}</a>`;\n }\n return html`\n <button\n class=${cls}\n type=\"button\"\n part=\"button\"\n aria-label=${this.label}\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n ${drawn}\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n const words = html`${iconSvg(this.iconBefore)}<slot></slot>${this.iconAfter && this.iconAfter !== 'none' ? html`<span class=\"after\" aria-hidden=\"true\">${iconSvg(this.iconAfter)}</span>` : nothing}`;\n if (this.href && !this.disabled) {\n return html`<a class=${this.variant} href=${this.href} part=\"button\">${words}</a>`;\n }\n return html`\n <button\n class=${this.variant}\n type=\"button\"\n part=\"button\"\n ?disabled=${this.disabled}\n aria-disabled=${this.busy ? 'true' : nothing}\n aria-busy=${this.busy ? 'true' : nothing}\n @click=${this.onClick}\n >\n ${words}\n ${this.busy ? html`<span class=\"sr-only\">${this.busyLabel}</span>` : nothing}\n </button>\n `;\n }\n}\n\ncustomElements.define('imp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,YAAM,QAAQ,QAAQ,KAAK,IAAI;AAC/B,UAAI,KAAK,QAAQ,CAAC,KAAK,UAAU;AAC/B,eAAO,gBAAgB,GAAG,SAAS,KAAK,IAAI,6BAA6B,KAAK,KAAK,IAAI,KAAK;AAAA,MAC9F;AACA,aAAO;AAAA;AAAA,kBAEK,GAAG;AAAA;AAAA;AAAA,uBAGE,KAAK,KAAK;AAAA,sBACX,KAAK,QAAQ;AAAA,0BACT,KAAK,OAAO,SAAS,OAAO;AAAA,sBAChC,KAAK,OAAO,SAAS,OAAO;AAAA,mBAC/B,KAAK,OAAO;AAAA;AAAA,YAEnB,KAAK;AAAA,YACL,KAAK,OAAO,6BAA6B,KAAK,SAAS,YAAY,OAAO;AAAA;AAAA;AAAA,IAGlF;AACA,UAAM,QAAQ,OAAO,QAAQ,KAAK,UAAU,CAAC,gBAAgB,KAAK,aAAa,KAAK,cAAc,SAAS,8CAA8C,QAAQ,KAAK,SAAS,CAAC,YAAY,OAAO;AACnM,QAAI,KAAK,QAAQ,CAAC,KAAK,UAAU;AAC/B,aAAO,gBAAgB,KAAK,OAAO,SAAS,KAAK,IAAI,kBAAkB,KAAK;AAAA,IAC9E;AACA,WAAO;AAAA;AAAA,gBAEK,KAAK,OAAO;AAAA;AAAA;AAAA,oBAGR,KAAK,QAAQ;AAAA,wBACT,KAAK,OAAO,SAAS,OAAO;AAAA,oBAChC,KAAK,OAAO,SAAS,OAAO;AAAA,iBAC/B,KAAK,OAAO;AAAA;AAAA,UAEnB,KAAK;AAAA,UACL,KAAK,OAAO,6BAA6B,KAAK,SAAS,YAAY,OAAO;AAAA;AAAA;AAAA,EAGlF;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/rows.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport { pageLocale } from '../base/locale';\nimport { iconSvg } from './icon';\n\n/** The light weight large numbers are set in, 300 when the theme does not say. */\nconst LIGHT = token('font.weight.light', '300');\n\n/**\n * A count with its name: \"UK 4\", \"Active import jobs 12\". A dashboard shows a\n * row of them.\n *\n * **The name comes before the number in the reading order.** A screen reader\n * says \"UK, 4\", which makes sense heard on its own; \"4, UK\" does not. With\n * `href` the whole tile is one link, named by the label, the value and the\n * caption together.\n *\n * @category content\n * @icon badge\n */\nexport class ImpaktStatTile extends ImpaktElement {\n static properties = {\n label: { type: String },\n value: { type: String },\n caption: { type: String },\n href: { type: String },\n tone: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** What is counted, such as \"UK\" or \"Active import jobs\". */\n declare label: string;\n /** The count or figure, such as \"4\". */\n declare value: string;\n /** A line under the figure, such as \"3 arriving in the next two weeks\". */\n declare caption: string;\n /** Where the tile goes when it is pressed, such as the list it counts. */\n declare href: string;\n /** `plain` is a quiet tile on a card; `brand` is the one figure a screen leads with. */\n declare tone: 'plain' | 'brand';\n /** `lg` sets the figure larger, for the lead figure. */\n declare size: 'md' | 'lg';\n\n constructor() {\n super();\n this.label = '';\n this.value = '';\n this.caption = '';\n this.href = '';\n this.tone = 'plain';\n this.size = 'md';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; }\n .tile {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: ${space(1)};\n block-size: 100%;\n min-block-size: 84px;\n padding: ${space(3)} ${space(4)};\n border-radius: ${t.radiusLg};\n background: ${t.surfaceInset};\n color: ${t.text};\n text-decoration: none;\n }\n a.tile:hover { background: color-mix(in srgb, ${t.surfaceInset}, ${t.text} 5%); }\n .label { font-size: 11px; font-weight: ${fontWeight('medium')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }\n .value { margin-block-start: auto; font-size: 34px; line-height: 1.1; font-weight: ${LIGHT}; font-variant-numeric: tabular-nums; }\n .caption { font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n :host([size='lg']) .tile { min-block-size: 200px; padding: ${space(6)}; border-radius: ${t.radiusXl}; }\n :host([size='lg']) .label { font-size: ${fontSize('sm')}; letter-spacing: normal; text-transform: none; }\n :host([size='lg']) .value { font-size: 64px; line-height: 1; }\n :host([tone='brand']) .tile { background: ${t.brand}; color: ${t.onBrand}; }\n :host([tone='brand']) a.tile:hover { background: ${t.brandHover}; }\n :host([tone='brand']) .label, :host([tone='brand']) .caption { color: ${t.onBrand}; }\n @media (forced-colors: active) { .tile { border: 1px solid CanvasText; } }\n `];\n\n render(): TemplateResult {\n const inner = html`\n <span class=\"label\" part=\"label\">${this.label}</span>\n <span class=\"value\" part=\"value\">${this.value}</span>\n ${this.caption ? html`<span class=\"caption\" part=\"caption\">${this.caption}</span>` : nothing}\n `;\n return this.href\n ? html`<a class=\"tile\" href=${this.href} part=\"tile\">${inner}</a>`\n : html`<div class=\"tile\" part=\"tile\">${inner}</div>`;\n }\n}\n\n/**\n * A date as a small block of month and day: \"DEC 2\". It sits at the start of a\n * row, beside what happens on that date.\n *\n * **The full date is what a screen reader hears.** The short month and day are\n * hidden from it, and the date is read in full in the page's language, such as\n * \"2 December 2026\", because \"DEC 2\" said aloud is ambiguous.\n *\n * @category content\n * @icon calendar\n */\nexport class ImpaktDateTile extends ImpaktElement {\n static properties = {\n date: { type: String },\n tone: { type: String, reflect: true },\n };\n /** The date, as YYYY-MM-DD. */\n declare date: string;\n /** `brand` is filled with the brand colour; `plain` is a quiet tile. */\n declare tone: 'brand' | 'plain';\n\n constructor() {\n super();\n this.date = '';\n this.tone = 'brand';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: inline-block; flex: none; }\n time {\n position: relative;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n inline-size: 48px;\n block-size: 52px;\n border-radius: ${t.radiusLg};\n background: ${t.brand};\n color: ${t.onBrand};\n line-height: 1;\n }\n :host([tone='plain']) time { background: ${t.surfaceInset}; color: ${t.text}; }\n .month { font-size: 10px; font-weight: ${fontWeight('medium')}; letter-spacing: ${t.trackingWide}; text-transform: uppercase; }\n .day { margin-block-start: ${space(1)}; font-size: 20px; font-weight: ${fontWeight('medium')}; font-variant-numeric: tabular-nums; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { time { border: 1px solid CanvasText; } }\n `];\n\n private parts(): { month: string; day: string; full: string } | null {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(this.date ?? '');\n if (!match) return null;\n // Noon UTC, so no time zone moves the date to the day before or after.\n const when = new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), 12));\n if (Number.isNaN(when.getTime())) return null;\n const locale = pageLocale(this);\n const say = (options: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { ...options, timeZone: 'UTC' }).format(when);\n return { month: say({ month: 'short' }).replace('.', ''), day: say({ day: 'numeric' }), full: say({ day: 'numeric', month: 'long', year: 'numeric' }) };\n }\n\n render(): TemplateResult {\n const parts = this.parts();\n if (!parts) return html`${nothing}`;\n return html`<time datetime=${this.date} part=\"tile\">\n <span class=\"month\" aria-hidden=\"true\">${parts.month}</span>\n <span class=\"day\" aria-hidden=\"true\">${parts.day}</span>\n <span class=\"sr-only\">${parts.full}</span>\n </time>`;\n }\n}\n\n/**\n * One line in a list: a title, a line of detail under it, and room at the\n * start and the end. It is the task with its tick, the job that needs\n * attention, the delivery with its date, the setting with its arrow.\n *\n * **With `href` the whole row is one target, without nesting controls in a\n * link.** The title is the link, and it is stretched over the row, so the row\n * can be pressed anywhere. Anything in the `end` slot, such as a button, sits\n * above the stretched link and stays its own control, because a button inside\n * a link is two controls a screen reader cannot tell apart (4.1.2).\n *\n * A chevron is drawn at the end of a row that is a link, as the sign that it\n * goes somewhere. Put rows in an element with `role=\"list\"` and give each\n * `role=\"listitem\"` when they are a list, so a screen reader says how many\n * there are.\n *\n * @category content\n * @icon list\n * @slot start - Before the title: a dot, a date tile, a checkbox.\n * @slot end - After the title: a badge, a button.\n */\nexport class ImpaktRow extends ImpaktElement {\n static properties = {\n heading: { type: String },\n meta: { type: String },\n href: { type: String },\n divided: { type: Boolean, reflect: true },\n muted: { type: Boolean, reflect: true },\n };\n /** The row's title. */\n declare heading: string;\n /** The line of detail under the title, such as \"CY-2026-00421 · Due 20 Nov 2026\". */\n declare meta: string;\n /** Where the row goes when it is pressed. */\n declare href: string;\n /** Draw a hairline above the row, for rows stacked on a card. */\n declare divided: boolean;\n /** Set the title quieter, for something finished, such as a done task. */\n declare muted: boolean;\n\n constructor() {\n super();\n this.heading = '';\n this.meta = '';\n this.href = '';\n this.divided = false;\n this.muted = false;\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; }\n :host([divided]) .row { border-block-start: ${t.borderThin} solid ${t.hairline}; }\n .row { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block: ${space(3)}; }\n .text { flex: 1; min-inline-size: 0; display: flex; flex-direction: column; gap: ${space(0.5)}; }\n .title { font-size: ${fontSize('md')}; font-weight: ${fontWeight('medium')}; color: ${t.text}; }\n :host([muted]) .title { color: ${t.textMuted}; font-weight: ${fontWeight('regular')}; }\n .meta { font-size: ${fontSize('sm')}; color: ${t.textMuted}; }\n a { color: inherit; text-decoration: none; }\n /* The link is stretched over the row, so the row is one target. */\n a::after { content: ''; position: absolute; inset: 0; border-radius: ${t.radius}; }\n a:focus-visible { outline: none; }\n a:focus-visible::after { box-shadow: ${t.focusShadow}; }\n .row:has(a):hover .title { text-decoration: underline; text-underline-offset: 0.2em; }\n .start, .end { flex: none; display: flex; align-items: center; gap: ${space(2)}; }\n .start.empty, .end.empty { display: none; }\n /* Controls at the end stay pressable above the stretched link. */\n .end { position: relative; z-index: 1; }\n .chevron { flex: none; color: ${t.textMuted}; }\n `];\n\n private filled = { start: false, end: false };\n\n private onSlot(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n const name = slot.name as 'start' | 'end';\n this.filled = { ...this.filled, [name]: slot.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim() !== '') };\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const title = this.href\n ? html`<a class=\"title\" href=${this.href} part=\"link\">${this.heading}</a>`\n : html`<span class=\"title\" part=\"title\">${this.heading}</span>`;\n return html`<div class=\"row\" part=\"row\">\n <div class=\"start ${this.filled.start ? '' : 'empty'}\"><slot name=\"start\" @slotchange=${this.onSlot}></slot></div>\n <div class=\"text\">${title}${this.meta ? html`<span class=\"meta\" part=\"meta\">${this.meta}</span>` : nothing}</div>\n <div class=\"end ${this.filled.end ? '' : 'empty'}\"><slot name=\"end\" @slotchange=${this.onSlot}></slot></div>\n ${this.href ? html`<span class=\"chevron\" aria-hidden=\"true\">${iconSvg('chevron-right', '20px')}</span>` : nothing}\n </div>`;\n }\n}\n\n/**\n * A pressable filter: \"UK 4\", \"Completed 27\". A row of them narrows a list.\n *\n * **It is a toggle button.** It carries `aria-pressed`, so a screen reader says\n * whether the filter is on, and it is filled when it is on, so that does not\n * rest on colour alone (1.4.1). When only one filter in a row can be on, the\n * app turns the others off when it hears `impakt-change`.\n *\n * The count is read with the label. Set `count-label` when the number needs its\n * noun to make sense aloud, such as \"4 jobs\".\n *\n * @category action\n * @icon badge\n * @fires {CustomEvent<{ pressed: boolean }>} impakt-change - When the filter is turned on or off.\n */\nexport class ImpaktFilterChip extends ImpaktElement {\n static properties = {\n label: { type: String },\n count: { type: Number },\n countLabel: { type: String, attribute: 'count-label' },\n pressed: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n };\n declare label: string;\n /** How many things the filter would show. Left out when not set. */\n declare count: number | undefined;\n /** The count in words for a screen reader, such as \"4 jobs\". The number alone when empty. */\n declare countLabel: string;\n declare pressed: boolean;\n declare disabled: boolean;\n\n constructor() {\n super();\n this.label = '';\n this.count = undefined;\n this.countLabel = '';\n this.pressed = false;\n this.disabled = false;\n }\n\n static styles = [...ImpaktElement.styles, focusRing, touchTarget('button'), css`\n :host { display: inline-block; }\n /* The containing block for the words kept for screen readers, so a control scrolled out of a row cannot widen the page. */\n button {\n ${targetSize}\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: ${space(2)};\n min-block-size: 36px;\n padding: 0 ${space(3.5)};\n font: inherit;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('medium')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.hairline};\n border-radius: 999px;\n cursor: pointer;\n white-space: nowrap;\n }\n button:hover:not(:disabled) { background: ${t.surfaceInset}; }\n button[aria-pressed='true'] { background: ${t.text}; color: ${t.surfaceCard}; border-color: ${t.text}; }\n button:disabled { cursor: not-allowed; opacity: 0.5; }\n .count { font-variant-numeric: tabular-nums; color: ${t.textMuted}; }\n button[aria-pressed='true'] .count { color: inherit; opacity: 0.8; }\n .sr-only { ${visuallyHidden} }\n @media (forced-colors: active) { button[aria-pressed='true'] { border: 2px solid Highlight; } }\n `];\n\n private toggle(): void {\n if (this.disabled) return;\n this.pressed = !this.pressed;\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: { pressed: this.pressed }, bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const hasCount = typeof this.count === 'number' && !Number.isNaN(this.count);\n return html`<button type=\"button\" part=\"button\" aria-pressed=${this.pressed ? 'true' : 'false'} ?disabled=${this.disabled} @click=${this.toggle}>\n <span>${this.label}</span>\n ${hasCount\n ? this.countLabel\n ? html`<span class=\"count\" aria-hidden=\"true\">${this.count}</span><span class=\"sr-only\">${this.countLabel}</span>`\n : html`<span class=\"count\">${this.count}</span>`\n : nothing}\n </button>`;\n }\n}\n\ncustomElements.define('impakt-stat-tile', ImpaktStatTile);\ncustomElements.define('impakt-date-tile', ImpaktDateTile);\ncustomElements.define('impakt-row', ImpaktRow);\ncustomElements.define('impakt-filter-chip', ImpaktFilterChip);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-stat-tile': ImpaktStatTile;\n 'impakt-date-tile': ImpaktDateTile;\n 'impakt-row': ImpaktRow;\n 'impakt-filter-chip': ImpaktFilterChip;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAQxD,IAAM,QAAQ,MAAM,qBAAqB,KAAK;AAcvC,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EAcA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AACb,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,cAAc,QAAQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAM1C,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,iBAGJ,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA,uBACd,EAAE,QAAQ;AAAA,oBACb,EAAE,YAAY;AAAA,eACnB,EAAE,IAAI;AAAA;AAAA;AAAA,oDAG+B,EAAE,YAAY,KAAK,EAAE,IAAI;AAAA,6CAChC,WAAW,QAAQ,CAAC,qBAAqB,EAAE,YAAY,uCAAuC,EAAE,SAAS;AAAA,yFAC7D,KAAK;AAAA,4BAClE,SAAS,IAAI,CAAC,YAAY,EAAE,SAAS;AAAA,iEACA,MAAM,CAAC,CAAC,oBAAoB,EA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AAK,UAAU,YAAY,CAAC,OAAO,MAAM,KAAK,KAAK;AAC3E,WAAO,wDAAwD,KAAK,UAAU,SAAS,OAAO,cAAc,KAAK,QAAQ,WAAW,KAAK,MAAM;AAAA,cACrI,KAAK,KAAK;AAAA,QAChB,WACE,KAAK,aACH,8CAA8C,KAAK,KAAK,gCAAgC,KAAK,UAAU,YACvG,2BAA2B,KAAK,KAAK,YACvC,OAAO;AAAA;AAAA,EAEf;AACF;AAEA,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,oBAAoB,cAAc;AACxD,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/journey.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, spaceAround, t, type } from '../base/tokens';\n\n/** One address a postcode search found. */\nexport interface AddressItem {\n id: string;\n /** The address on one line, as the customer will recognise it. */\n line: string;\n}\n\n/** One mistake on the page, and the field it is about. */\nexport interface ErrorItem {\n id: string;\n text: string;\n /** The field to go to, such as `#postcode`. */\n href: string;\n}\n\n/** One part of a long application. */\nexport interface TaskItem {\n id: string;\n title: string;\n /** Where the part is filled in. Left out while it cannot be started. */\n href?: string;\n status: 'done' | 'in-progress' | 'not-started' | 'cannot-start';\n /** A line under the title, such as how long it takes. */\n hint?: string;\n}\n\nconst inputStyles = css`\n input, select {\n box-sizing: border-box;\n inline-size: min(100%, var(--impakt-field-width));\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(3)};\n font: inherit;\n /* 16px whatever the page around it sets, so a phone does not zoom in on focus. */\n font-size: max(${fontSize('md')}, 16px);\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n }\n input:focus-visible, select:focus-visible { border-color: ${t.brand}; box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo}; outline: none; }\n :host([invalid]) input, :host([invalid]) select { border-color: ${t.danger}; border-width: ${t.borderThick}; }\n .btn {\n min-block-size: 44px;\n padding: ${space(2.5)} ${space(4)};\n font: inherit;\n font-weight: ${fontWeight('semibold')};\n color: ${t.onBrand};\n background: ${t.brand};\n border: 0;\n border-radius: ${t.radiusLg};\n cursor: pointer;\n }\n .btn:hover { background: ${t.brandHover}; }\n .quiet { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; padding: 0; font: inherit; color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; background: none; border: 0; cursor: pointer; }\n .visually-hidden { ${visuallyHidden} }\n`;\n\n/**\n * Find an address from a postcode, then pick it from a list.\n *\n * The addresses come from the app. With `lookup-url` set, the component asks\n * that address itself (`?postcode=…`, answering `[{ id, line }]`); otherwise\n * it fires `impakt-lookup` with the postcode and the app sets `addresses`.\n * There is always a way to type the address in, because no list is complete.\n *\n * @fires {CustomEvent<{ postcode: string }>} impakt-lookup - When a postcode is searched for. The postcode is in detail.postcode.\n * @category form\n * @icon home\n */\nexport class ImpaktAddressLookup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n postcodeLabel: { type: String, attribute: 'postcode-label' },\n findText: { type: String, attribute: 'find-text' },\n chooseLabel: { type: String, attribute: 'choose-label' },\n manualText: { type: String, attribute: 'manual-text' },\n notFoundText: { type: String, attribute: 'not-found-text' },\n lookupUrl: { type: String, attribute: 'lookup-url' },\n addresses: { type: Array },\n };\n declare postcodeLabel: string;\n declare findText: string;\n declare chooseLabel: string;\n declare manualText: string;\n declare notFoundText: string;\n /** An address that returns `[{ id, line }]` for `?postcode=`. Optional. */\n declare lookupUrl: string;\n declare addresses: AddressItem[];\n declare manual: boolean;\n declare postcode: string;\n declare searched: boolean;\n declare busy: boolean;\n\n constructor() {\n super();\n this.label = 'Your address';\n this.postcodeLabel = 'Postcode';\n this.findText = 'Find address';\n this.chooseLabel = 'Choose your address';\n this.manualText = 'Enter the address yourself';\n this.notFoundText = 'No addresses found for that postcode. Check it, or enter the address yourself.';\n this.lookupUrl = '';\n this.addresses = [];\n this.manual = false;\n this.postcode = '';\n this.searched = false;\n this.busy = false;\n }\n\n static styles = [...FieldElement.styles, fieldWidths, inputStyles, css`\n .row { display: flex; flex-wrap: wrap; gap: ${space(2)}; align-items: flex-end; }\n .row label { display: block; ${type('sm')} font-weight: ${fontWeight('semibold')}; margin-block-end: ${space(1)}; }\n .postcode input { inline-size: 12ch; text-transform: uppercase; }\n .choose { margin-block-start: ${space(4)}; }\n .choose select { inline-size: 100%; }\n .manual { display: grid; gap: ${space(3)}; margin-block-start: ${space(3)}; }\n .manual label { display: block; ${type('sm')} margin-block-end: ${space(1)}; }\n .manual input { inline-size: 100%; }\n .note { ${type('sm')} color: ${t.textMuted}; margin: ${space(2)} 0 0; }\n .switch { margin-block-start: ${space(3)}; }\n `];\n\n private async find(): Promise<void> {\n const postcode = this.postcode.trim().toUpperCase();\n if (!postcode) return;\n this.dispatchEvent(new CustomEvent('impakt-lookup', { detail: { postcode }, bubbles: true, composed: true }));\n if (!this.lookupUrl) { this.searched = true; return; }\n this.busy = true;\n try {\n const url = new URL(this.lookupUrl, globalThis.location?.href);\n url.searchParams.set('postcode', postcode);\n const found = await (await fetch(url)).json();\n this.addresses = Array.isArray(found) ? found : [];\n } catch {\n this.addresses = [];\n } finally {\n this.busy = false;\n this.searched = true;\n }\n }\n\n private manualLine(): string {\n const parts = ['line1', 'line2', 'town', 'mpostcode'].map((p) => (this.renderRoot.querySelector<HTMLInputElement>(`#${this.id_(p)}`)?.value ?? '').trim());\n return parts.filter(Boolean).join(', ');\n }\n\n protected renderControl(): TemplateResult {\n if (this.manual) {\n const field = (key: string, label: string, autocomplete: string) => html`<div><label for=${this.id_(key)}>${label}</label><input id=${this.id_(key)} autocomplete=${autocomplete} @input=${() => this.setFormValue(this.manualLine())} /></div>`;\n return html`<div class=\"manual\" role=\"group\" aria-label=${this.label}>\n ${field('line1', say('Building and street'), 'address-line1')}\n ${field('line2', say('Second line (optional)'), 'address-line2')}\n ${field('town', say('Town or city'), 'address-level2')}\n ${field('mpostcode', say('Postcode'), 'postal-code')}\n <button class=\"quiet switch\" type=\"button\" @click=${() => { this.manual = false; }}>${say('Find the address from the postcode')}</button>\n </div>`;\n }\n return html`\n <div class=\"row\">\n <div class=\"postcode\"><label for=${this.controlId}>${this.postcodeLabel}</label>\n <input id=${this.controlId} autocomplete=\"postal-code\" .value=${this.postcode} aria-describedby=${this.describedBy}\n @input=${(e: Event) => { this.postcode = (e.target as HTMLInputElement).value; }}\n @keydown=${(e: KeyboardEvent) => { if (e.key === 'Enter') { e.preventDefault(); void this.find(); } }} /></div>\n <button class=\"btn\" type=\"button\" ?disabled=${this.busy} @click=${() => this.find()}>${this.busy ? 'Finding…' : this.findText}</button>\n </div>\n ${this.addresses.length ? html`<div class=\"choose\"><label class=\"label\" for=${this.id_('choose')}>${this.chooseLabel}</label>\n <select id=${this.id_('choose')} @change=${(e: Event) => this.setFormValue((e.target as HTMLSelectElement).value)}>\n <option value=\"\">${this.addresses.length} ${this.addresses.length === 1 ? 'address' : 'addresses'} found</option>\n ${this.addresses.map((a) => html`<option value=${a.line} ?selected=${a.line === this.value}>${a.line}</option>`)}\n </select></div>`\n : this.searched && !this.busy ? html`<p class=\"note\" role=\"status\">${this.notFoundText}</p>` : nothing}\n <button class=\"quiet switch\" type=\"button\" @click=${() => { this.manual = true; }}>${this.manualText}</button>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\n/**\n * Every mistake on the page, listed at the top, each linking to its field.\n *\n * It takes focus when it appears, so someone using a screen reader hears what\n * is wrong straight away rather than finding out field by field. It draws\n * nothing while there are no mistakes. Each link moves focus to its field, which\n * may be a field inside another component, such as `#postcode` for an\n * `impakt-text-input` with that id.\n *\n * @category feedback\n * @icon alert\n */\nexport class ImpaktErrorSummary extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\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 items: ErrorItem[];\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.heading = 'There is a problem';\n this.items = [];\n this.spaceAbove = 'none';\n this.spaceBelow = 'md';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, spaceAround, touchTarget('a'), css`\n :host { display: block; }\n .box { padding: ${space(5)}; border: ${t.borderThick} solid ${t.danger}; border-inline-start-width: 6px; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }\n .box:focus { outline: 3px solid ${t.danger}; outline-offset: 2px; }\n h2 { margin: 0 0 ${space(3)}; ${type('lg')} font-weight: ${fontWeight('bold')}; color: ${t.text}; }\n ul { margin: 0; padding: 0; list-style: none; display: grid; gap: ${space(2)}; }\n a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; text-underline-offset: 0.2em; }\n `];\n\n private go(event: Event, href: string): void {\n const id = href.replace(/^#/, '');\n const root = this.getRootNode() as Document | ShadowRoot;\n const target = (root.querySelector?.(`#${CSS.escape(id)}`) ?? document.getElementById(id)) as HTMLElement | null;\n if (!target) return;\n event.preventDefault();\n target.scrollIntoView({ block: 'center' });\n (target as HTMLElement & { focus: () => void }).focus();\n }\n\n updated(changed: Map<string, unknown>): void {\n const before = changed.get('items') as ErrorItem[] | undefined;\n if (changed.has('items') && this.items.length && !before?.length) this.renderRoot.querySelector<HTMLElement>('.box')?.focus();\n }\n\n render(): TemplateResult | typeof nothing {\n if (!this.items.length) return nothing;\n return html`<div class=\"box\" role=\"alert\" tabindex=\"-1\" aria-labelledby=${this.id_('h')} part=\"box\">\n <h2 id=${this.id_('h')}>${this.heading}</h2>\n <ul>${this.items.map((i) => html`<li><a href=${i.href} @click=${(e: Event) => this.go(e, i.href)}>${i.text}</a></li>`)}</ul>\n </div>`;\n }\n}\n\nconst fileSize = (bytes: number) => (bytes >= 1048576 ? say('{size} MB', { size: (bytes / 1048576).toFixed(1) }) : say('{size} KB', { size: Math.max(1, Math.round(bytes / 1024)) }));\n\n/**\n * Add one or more files, such as proof of identity or photos for a claim.\n *\n * A file can be chosen or dropped on the box. Each one is checked for type and\n * size here and listed with a Remove button; the upload itself is the app's,\n * which gets the files on `impakt-files`. The answer is the file names.\n *\n * The file input itself takes focus, so Tab reaches it and Enter or Space opens\n * the file chooser; the visible button is its label and draws its focus ring.\n * A file that is added or removed is said to a screen reader, and a file that\n * does not fit marks the box and says why.\n *\n * @fires {CustomEvent<{ files: File[] }>} impakt-files - When the files change. The files are in detail.files.\n *\n * @category form\n * @icon upload\n */\nexport class ImpaktFileUpload extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n accept: { type: String },\n manyFiles: { type: Boolean, attribute: 'many-files' },\n maxSizeMb: { type: Number, attribute: 'max-size-mb' },\n chooseText: { type: String, attribute: 'choose-text' },\n dropText: { type: String, attribute: 'drop-text' },\n };\n /** File types allowed, such as `.pdf,.jpg,.png`. Empty allows any. */\n declare accept: string;\n /** Let more than one file be added. */\n declare manyFiles: boolean;\n declare maxSizeMb: number;\n declare chooseText: string;\n declare dropText: string;\n declare files: File[];\n declare over: boolean;\n protected declare said: string;\n\n constructor() {\n super();\n this.label = 'Upload a file';\n this.accept = '.pdf,.jpg,.jpeg,.png';\n this.manyFiles = false;\n this.maxSizeMb = 10;\n this.chooseText = 'Choose file';\n this.dropText = 'or drop it here';\n this.files = [];\n this.over = false;\n this.said = '';\n }\n\n static styles = [...FieldElement.styles, inputStyles, targetSize, touchTarget('label.btn, .quiet'), css`\n .zone { display: flex; flex-wrap: wrap; align-items: center; gap: ${space(3)}; padding: ${space(5)}; border: 2px dashed ${t.border}; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; }\n .zone.over { border-color: ${t.brand}; background: ${t.brandSubtle}; }\n :host([invalid]) .zone { border-color: ${t.danger}; border-style: solid; }\n :host([disabled]) label.btn { cursor: not-allowed; }\n .drop { color: ${t.textMuted}; }\n input[type='file'] { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }\n label.btn { display: inline-flex; align-items: center; }\n input[type='file']:focus-visible + label.btn { box-shadow: ${t.focusShadow}; }\n ul { margin: ${space(3)} 0 0; padding: 0; list-style: none; display: grid; gap: ${space(2)}; }\n li { display: flex; justify-content: space-between; gap: ${space(3)}; align-items: center; padding: ${space(2)} ${space(3)}; border-radius: ${t.radius}; background: ${t.surfaceInset}; }\n .size { color: ${t.textMuted}; ${type('sm')} }\n `];\n\n private fits(file: File): string | null {\n if (this.maxSizeMb && file.size > this.maxSizeMb * 1048576) return say('{file} is bigger than {size} MB', { file: file.name, size: this.maxSizeMb });\n const kinds = this.accept.split(',').map((k) => k.trim().toLowerCase()).filter(Boolean);\n if (kinds.length && !kinds.some((k) => (k.startsWith('.') ? file.name.toLowerCase().endsWith(k) : file.type === k || (k.endsWith('/*') && file.type.startsWith(k.slice(0, -1)))))) {\n return say('{file} must be {kinds}', { file: file.name, kinds: kinds.map((k) => k.replace('.', '').toUpperCase()).join(', ') });\n }\n return null;\n }\n\n /** Adds files, keeping only those that pass, and says why any did not. */\n add(list: FileList | File[]): void {\n const chosen = Array.from(list);\n const problems = chosen.map((f) => this.fits(f)).filter((p): p is string => Boolean(p));\n const good = chosen.filter((f) => !this.fits(f));\n const kept = this.manyFiles ? good : good.slice(0, 1);\n this.files = this.manyFiles ? [...this.files, ...good] : kept.length ? kept : this.files;\n this.error = problems.join('. ');\n this.said = kept.map((f) => say('{file} added', { file: f.name })).join('. ');\n this.sync();\n }\n\n private removeFile(index: number): void {\n const gone = this.files[index];\n this.files = this.files.filter((_, i) => i !== index);\n this.said = gone ? say('{file} removed', { file: gone.name }) : '';\n this.sync();\n // The button that was pressed has gone, so focus goes back to the file input rather than to the top of the page.\n void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>('input[type=\"file\"]')?.focus());\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n\n private sync(): void {\n this.setFormValue(this.files.map((f) => f.name).join(', '));\n this.dispatchEvent(new CustomEvent('impakt-files', { detail: { files: this.files }, bubbles: true, composed: true }));\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <div class=\"zone ${this.over ? 'over' : ''}\"\n @dragover=${(e: DragEvent) => { e.preventDefault(); this.over = true; }}\n @dragleave=${() => { this.over = false; }}\n @drop=${(e: DragEvent) => { e.preventDefault(); this.over = false; if (e.dataTransfer?.files) this.add(e.dataTransfer.files); }}>\n <input id=${this.controlId} type=\"file\" accept=${this.accept || nothing} ?multiple=${this.manyFiles} ?disabled=${this.disabled} ?required=${this.required} aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}\n @change=${(e: Event) => { const f = (e.target as HTMLInputElement).files; if (f) this.add(f); (e.target as HTMLInputElement).value = ''; }} />\n <label class=\"btn\" for=${this.controlId}>${this.chooseText}</label>\n <span class=\"drop\">${this.dropText}</span>\n </div>\n <p class=\"visually-hidden\" role=\"status\">${this.said}</p>\n ${this.files.length ? html`<ul aria-label=${say('Files added')}>${this.files.map((f, i) => html`<li><span>${f.name} <span class=\"size\">${fileSize(f.size)}</span></span><button class=\"quiet\" type=\"button\" @click=${() => this.removeFile(i)}>${say('Remove')}<span class=\"visually-hidden\"> ${f.name}</span></button></li>`)}</ul>` : nothing}\n `;\n }\n}\n\n/** The currency's symbol, such as £ for GBP. */\nfunction symbolOf(currency: string): string {\n try {\n return new Intl.NumberFormat(pageLocale(), { style: 'currency', currency, maximumFractionDigits: 0 }).formatToParts(0).find((p) => p.type === 'currency')?.value ?? '';\n } catch {\n return '';\n }\n}\n\n/** \"250000\" → \"250,000\". Anything not a number is left as typed. */\nexport function groupDigits(value: string): string {\n const digits = value.replace(/[^\\d.]/g, '');\n if (!digits) return '';\n const [whole, part] = digits.split('.');\n return `${Number(whole).toLocaleString('en-GB')}${part !== undefined ? `.${part.slice(0, 2)}` : ''}`;\n}\n\n/**\n * An amount of money, with the currency sign in front and commas as it is\n * read back, so £250,000 is not mistaken for £25,000.\n *\n * The answer is the plain number, such as `250000`.\n *\n * @category form\n * @icon pound\n */\nexport class ImpaktMoneyInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n currency: { type: String },\n lowest: { type: Number },\n highest: { type: Number },\n pence: { type: Boolean },\n width: { type: String, reflect: true },\n };\n declare currency: string;\n declare lowest: number | undefined;\n declare highest: number | undefined;\n /** Allow pence. Off for amounts like a house price. */\n declare pence: boolean;\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n declare shown: string;\n\n constructor() {\n super();\n this.currency = 'GBP';\n this.lowest = undefined;\n this.highest = undefined;\n this.pence = false;\n this.width = 'md';\n this.shown = '';\n }\n\n static styles = [...FieldElement.styles, fieldWidths, inputStyles, css`\n .wrap { display: flex; align-items: stretch; inline-size: min(100%, var(--impakt-field-width)); }\n .sign { display: flex; align-items: center; padding: 0 ${space(3)}; font-weight: ${fontWeight('semibold')}; background: ${t.surfaceInset}; border: ${t.borderThin} solid ${t.border}; border-inline-end: 0; border-radius: ${t.radiusLg} 0 0 ${t.radiusLg}; }\n .wrap input { inline-size: 100%; border-radius: 0 ${t.radiusLg} ${t.radiusLg} 0; }\n `];\n\n willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('value') && this.value !== this.shown.replace(/,/g, '')) this.shown = groupDigits(this.value);\n }\n\n private typed(raw: string): void {\n const clean = raw.replace(/[^\\d.]/g, '');\n const value = this.pence ? clean : clean.split('.')[0]!;\n this.shown = raw;\n this.setFormValue(value);\n }\n\n private check(): void {\n this.shown = groupDigits(this.value);\n const n = Number(this.value);\n if (!this.value) return;\n const money = (x: number) => `${symbolOf(this.currency)}${x.toLocaleString('en-GB')}`;\n if (this.lowest !== undefined && n < this.lowest) this.error = say('Enter an amount of {amount} or more', { amount: money(this.lowest) });\n else if (this.highest !== undefined && n > this.highest) this.error = say('Enter an amount of {amount} or less', { amount: money(this.highest) });\n else if (this.error === say('Enter an amount of {amount} or more', { amount: money(this.lowest ?? 0) }) || this.error === say('Enter an amount of {amount} or less', { amount: money(this.highest ?? 0) })) this.error = '';\n }\n\n /** The currency sign describes the field too, so a screen reader hears that the amount is in pounds. */\n protected get describedBy(): string | typeof nothing {\n const ids = [symbolOf(this.currency) ? this.id_('sign') : '', super.describedBy === nothing ? '' : String(super.describedBy)].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n protected renderControl(): TemplateResult {\n return html`<div class=\"wrap\">\n <span class=\"sign\" id=${this.id_('sign')}>${symbolOf(this.currency)}</span>\n <input id=${this.controlId} inputmode=${this.pence ? 'decimal' : 'numeric'} .value=${this.shown} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required}\n aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}\n @input=${(e: Event) => this.typed((e.target as HTMLInputElement).value)} @blur=${() => this.check()} />\n </div>`;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\n/**\n * Choose a number by sliding, with the value read out beside the label, such\n * as a deposit or how many years. It is a native range control, so arrow keys,\n * a finger and a screen reader all work.\n *\n * @category form\n * @icon sliders\n */\nexport class ImpaktRangeInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n lowest: { type: Number },\n highest: { type: Number },\n step: { type: Number },\n currency: { type: String },\n unit: { type: String },\n };\n declare lowest: number;\n declare highest: number;\n declare step: number;\n /** Show the value as money in this currency, such as GBP. Empty shows a plain number. */\n declare currency: string;\n /** A word after the value, such as `years`. */\n declare unit: string;\n\n constructor() {\n super();\n this.label = 'How much';\n this.lowest = 0;\n this.highest = 100;\n this.step = 1;\n this.currency = '';\n this.unit = '';\n this.value = '50';\n }\n\n static styles = [...FieldElement.styles, css`\n .top { display: flex; justify-content: space-between; gap: ${space(3)}; }\n output { font-weight: ${fontWeight('semibold')}; color: ${t.text}; }\n input { inline-size: 100%; min-block-size: 32px; margin: 0; accent-color: ${t.brand}; }\n .ends { display: flex; justify-content: space-between; ${type('sm')} color: ${t.textMuted}; }\n `];\n\n /** The value as the customer reads it, such as £25,000 or 25 years. */\n shownAs(n: number): string {\n const locale = pageLocale(this);\n let s = n.toLocaleString(locale);\n if (this.currency) { try { s = new Intl.NumberFormat(locale, { style: 'currency', currency: this.currency, maximumFractionDigits: 0 }).format(n); } catch { /* keep the number */ } }\n return this.unit ? `${s} ${this.unit}` : s;\n }\n\n render(): TemplateResult {\n const n = Number(this.value) || 0;\n return html`\n <div class=\"top\"><label class=\"label\" for=${this.controlId}>${this.label}${this.required ? html` <span class=\"required\">(${this.requiredText})</span>` : nothing}</label>\n <output for=${this.controlId}>${this.shownAs(n)}</output></div>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n ${this.renderControl()}\n <div class=\"ends\" aria-hidden=\"true\"><span>${this.shownAs(this.lowest)}</span><span>${this.shownAs(this.highest)}</span></div>\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n `;\n }\n\n protected renderControl(): TemplateResult {\n return html`<input id=${this.controlId} type=\"range\" min=${this.lowest} max=${this.highest} step=${this.step} .value=${this.value} ?disabled=${this.disabled}\n aria-valuetext=${this.shownAs(Number(this.value) || 0)} aria-describedby=${this.describedBy}\n @input=${(e: Event) => this.setFormValue((e.target as HTMLInputElement).value)} />`;\n }\n}\n\nconst TASK_WORDS: Record<TaskItem['status'], string> = {\n done: 'Completed',\n 'in-progress': 'In progress',\n 'not-started': 'Not started',\n 'cannot-start': 'Cannot start yet',\n};\n\n/**\n * The parts of a long application, each with whether it is done, so someone\n * can leave and come back to where they were.\n *\n * @category content\n * @icon list\n */\nexport class ImpaktTaskList extends ImpaktElement {\n static properties = {\n heading: { type: String },\n items: { type: Array },\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 items: TaskItem[];\n declare headingLevel: 2 | 3;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.heading = 'Your application';\n this.items = [];\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, spaceAround, touchTarget('a'), css`\n :host { display: block; }\n .h { margin: 0 0 ${space(2)}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .count { margin: 0 0 ${space(4)}; color: ${t.textMuted}; }\n ul { margin: 0; padding: 0; list-style: none; border-block-start: 1px solid ${t.rule}; }\n li { display: flex; justify-content: space-between; align-items: center; gap: ${space(4)}; padding: ${space(4)} 0; border-block-end: 1px solid ${t.rule}; }\n a { display: inline-flex; align-items: center; min-block-size: ${t.targetMin}; color: ${t.link}; font-weight: ${fontWeight('semibold')}; text-underline-offset: 0.2em; }\n .title { font-weight: ${fontWeight('semibold')}; }\n .hint { display: block; ${type('sm')} color: ${t.textMuted}; }\n .tag { flex-shrink: 0; padding: ${space(1)} ${space(2.5)}; border-radius: 999px; ${type('sm')} font-weight: ${fontWeight('semibold')}; background: ${t.surfaceInset}; color: ${t.text}; }\n .tag[data-status='done'] { background: ${t.successSubtle}; color: ${t.successText}; }\n .tag[data-status='in-progress'] { background: ${t.brandSubtle}; color: ${t.link}; }\n .tag[data-status='cannot-start'] { background: transparent; color: ${t.textMuted}; }\n `];\n\n render(): TemplateResult {\n const done = this.items.filter((i) => i.status === 'done').length;\n return html`\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.items.length ? html`<p class=\"count\">${say(this.items.length === 1 ? 'You have completed {done} of {total} part.' : 'You have completed {done} of {total} parts.', { done, total: this.items.length })}</p>` : nothing}\n <ul>${this.items.map((i) => html`<li>\n <span>${i.href && i.status !== 'cannot-start' ? html`<a href=${i.href} aria-describedby=${this.id_(`s-${i.id}`)}>${i.title}</a>` : html`<span class=\"title\">${i.title}</span>`}\n ${i.hint ? html`<span class=\"hint\">${i.hint}</span>` : nothing}</span>\n <span class=\"tag\" data-status=${i.status} id=${this.id_(`s-${i.id}`)}>${TASK_WORDS[i.status] ? say(TASK_WORDS[i.status]) : i.status}</span>\n </li>`)}</ul>`;\n }\n}\n\n// Working values, not settings: kept out of `properties` so the page designer does not offer them.\nImpaktAddressLookup.createProperty('manual', { state: true });\nImpaktAddressLookup.createProperty('postcode', { state: true });\nImpaktAddressLookup.createProperty('searched', { state: true });\nImpaktAddressLookup.createProperty('busy', { state: true });\nImpaktFileUpload.createProperty('files', { state: true });\nImpaktFileUpload.createProperty('over', { state: true });\nImpaktFileUpload.createProperty('said', { state: true });\nImpaktMoneyInput.createProperty('shown', { state: true });\n\ncustomElements.define('impakt-address-lookup', ImpaktAddressLookup);\ncustomElements.define('impakt-error-summary', ImpaktErrorSummary);\ncustomElements.define('impakt-file-upload', ImpaktFileUpload);\ncustomElements.define('impakt-money-input', ImpaktMoneyInput);\ncustomElements.define('impakt-range-input', ImpaktRangeInput);\ncustomElements.define('impakt-task-list', ImpaktTaskList);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-address-lookup': ImpaktAddressLookup;\n 'impakt-error-summary': ImpaktErrorSummary;\n 'impakt-file-upload': ImpaktFileUpload;\n 'impakt-money-input': ImpaktMoneyInput;\n 'impakt-range-input': ImpaktRangeInput;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AAE,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,SAAS,2BAA2B,EAAE,KAAK,SAAS;AAAA,YAC1K,EAAE,OAAO,0BAA0B,EAAE,IAAI,YAAY,OAAO;AAAA,wCAChC,EAAE,MAAM,OAAO,KAAK,IAAI,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,WAAW,EAAE,MAAM,IAAI,IAAI,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM;AAAA,YAC/H,CAAC;AAAA,EACX;AACF;AAGA,oBAAoB,eAAe,UAAU,EAAE,OAAO,KAAK,CAAC;AAC5D,oBAAoB,eAAe,YAAY,EAAE,OAAO,KAAK,CAAC;AAC9D,oBAAoB,eAAe,YAAY,EAAE,OAAO,KAAK,CAAC;AAC9D,oBAAoB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AAC1D,iBAAiB,eAAe,SAAS,EAAE,OAAO,KAAK,CAAC;AACxD,iBAAiB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AACvD,iBAAiB,eAAe,QAAQ,EAAE,OAAO,KAAK,CAAC;AACvD,iBAAiB,eAAe,SAAS,EAAE,OAAO,KAAK,CAAC;AAExD,eAAe,OAAO,yBAAyB,mBAAmB;AAClE,eAAe,OAAO,wBAAwB,kBAAkB;AAChE,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/app-ui.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { pageLocale } from '../base/locale';\nimport { FieldElement } from '../base/FieldElement';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { lockScroll, unlockScroll } from '../base/scroll-lock';\nimport { fontWeight, space, spaceAround, t, type } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A panel that slides in from the side: a basket, filters, a plot's details.\n *\n * It is a native `<dialog>` opened with `showModal()`, like the dialog, so the\n * focus trap, Escape, the inert page behind it and the return of focus all come\n * from the browser. The page behind it does not scroll while it is open. The\n * slide is a decoration and stops for anyone who has asked for reduced motion.\n * On a phone it fills the screen.\n *\n * With `side=\"bottom\"` it is a sheet that rises from the bottom edge, as a\n * phone's dialogs do: as wide as the screen, as tall as its content up to\n * nine tenths of the screen, with its top corners rounded.\n *\n * @category feedback\n * @icon drawer\n * @slot - The body of the panel.\n * @slot footer - Buttons pinned to the bottom of the panel.\n * @fires {CustomEvent<null>} impakt-close - When the panel is closed.\n */\nexport class ImpaktDrawer extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n heading: { type: String },\n side: { type: String, reflect: true },\n closeLabel: { type: String, attribute: 'close-label' },\n };\n declare open: boolean;\n declare heading: string;\n /** Which edge it comes in from. `bottom` is a sheet, for a phone. */\n declare side: 'left' | 'right' | 'bottom';\n declare closeLabel: string;\n\n constructor() {\n super();\n this.open = false;\n this.heading = '';\n this.side = 'right';\n this.closeLabel = 'Close';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, touchTarget('.close'), css`\n dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }\n dialog[open] { display: flex; }\n :host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }\n :host([side='bottom']) dialog { inline-size: 100vw; block-size: fit-content; max-block-size: 90dvh; margin: auto 0 0 0; padding-block-end: env(safe-area-inset-bottom); border-radius: 28px 28px 0 0; animation-name: from-bottom; }\n :host([side='bottom']) .head { box-shadow: none; }\n :host([side='bottom']) .foot { box-shadow: none; }\n :host([side='bottom']) .foot ::slotted(*) { flex: 1; }\n @keyframes from-bottom { from { transform: translateY(100%); } }\n dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }\n @keyframes from-right { from { transform: translateX(100%); } }\n @keyframes from-left { from { transform: translateX(-100%); } }\n .head { display: flex; align-items: center; justify-content: space-between; gap: ${space(3)}; padding: ${space(4)} ${space(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }\n h2 { margin: 0; font-family: ${t.fontHeading}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .close { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${t.text}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .close:hover { background: ${t.surfaceSubtle}; }\n .body { flex: 1; overflow: auto; padding: ${space(5)}; }\n .foot { display: flex; gap: ${space(3)}; justify-content: flex-end; padding: ${space(4)} ${space(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }\n .foot[hidden] { display: none; }\n `];\n\n private hasFooter = false;\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n updated(changed: Map<string, unknown>): void {\n if (!changed.has('open')) return;\n const dialog = this.dialog;\n if (!dialog) return;\n if (this.open) {\n if (typeof dialog.showModal === 'function') dialog.showModal();\n else dialog.setAttribute('open', '');\n lockScroll(this);\n } else {\n if (typeof dialog.close === 'function' && dialog.open) dialog.close();\n else dialog.removeAttribute('open');\n unlockScroll(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n unlockScroll(this);\n }\n\n private close(): void {\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private footerChanged(event: Event): void {\n this.hasFooter = (event.target as HTMLSlotElement).assignedNodes().length > 0;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n return html`<dialog part=\"dialog\" aria-labelledby=${this.heading ? this.id_('heading') : nothing}\n @cancel=${() => this.close()}\n @close=${() => { if (this.open) this.close(); }}\n @click=${(event: Event) => { if (event.target === this.dialog) this.close(); }}>\n <div class=\"head\">\n ${this.heading ? html`<h2 id=${this.id_('heading')}>${this.heading}</h2>` : html`<span></span>`}\n <button class=\"close\" type=\"button\" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg('close', '20px')}</button>\n </div>\n <div class=\"body\" part=\"body\"><slot></slot></div>\n <div class=\"foot\" part=\"footer\" ?hidden=${!this.hasFooter}><slot name=\"footer\" @slotchange=${this.footerChanged}></slot></div>\n </dialog>`;\n }\n}\n\nconst TOAST_ICON: Record<string, string> = { neutral: 'info', success: 'check', warning: 'warning', danger: 'warning' };\n\n/**\n * A short message in the corner that goes away: \"Viewing booked\", \"Saved\".\n *\n * It says itself to a screen reader through a live region that is on the page\n * before the message is, and its timer stops while it is pointed at or focused.\n * Set `duration` to 0 to keep it up until it is closed. A message with a button,\n * such as Undo, stays until it is closed whatever the duration, because a\n * button that disappears on a timer cannot be pressed by someone who needs\n * longer (2.2.1). Escape closes it while focus is inside it. Anything a person\n * must act on belongs in an alert on the page.\n *\n * It never takes the page's clicks: only the message itself can be pressed, so\n * the page beside and behind the corner it sits in still works. On a phone it\n * spans the screen above the bottom edge, clear of the home bar and of a bottom\n * bar that sets `--impakt-bottom-bar`, and it rises without moving for anyone who\n * has asked for reduced motion.\n *\n * @category feedback\n * @icon toast\n * @fires {CustomEvent<null>} impakt-close - When the message goes away.\n * @fires {CustomEvent<null>} impakt-action - When its button is pressed.\n */\nexport class ImpaktToast extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n message: { type: String },\n tone: { type: String, reflect: true },\n duration: { type: Number },\n actionText: { type: String, attribute: 'action-text' },\n closeLabel: { type: String, attribute: 'close-label' },\n };\n declare open: boolean;\n declare message: string;\n declare tone: 'neutral' | 'success' | 'warning' | 'danger';\n /** How long it stays. 0 keeps it up until it is closed. */\n declare duration: number;\n declare actionText: string;\n declare closeLabel: string;\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n super();\n this.open = false;\n this.message = '';\n this.tone = 'neutral';\n this.duration = 6;\n this.actionText = '';\n this.closeLabel = 'Dismiss';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n .region { position: fixed; inset-block-end: calc(${space(4)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); inset-inline-end: ${space(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${space(8)})); pointer-events: none; }\n @media (max-width: 40rem) { .region { inset-inline: ${space(3)}; inline-size: auto; inset-block-end: calc(${space(3)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); } }\n .toast { pointer-events: auto; max-block-size: 40vh; overflow: auto; display: flex; align-items: flex-start; gap: ${space(3)}; padding: ${space(3)} ${space(3)} ${space(3)} ${space(4)}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowXl}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }\n /* It rises without fading in, so its words are at full contrast from the first frame they are read in (1.4.3). */\n @keyframes rise { from { transform: translateY(${space(3)}); } }\n .mark { display: inline-flex; flex: none; margin-block-start: ${space(0.5)}; color: ${t.info}; }\n :host([tone='success']) .mark { color: ${t.success}; }\n :host([tone='warning']) .mark { color: ${t.warning}; }\n :host([tone='danger']) .mark { color: ${t.danger}; }\n .message { flex: 1; align-self: center; margin: 0; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .action, .close { ${targetSize} padding: 0 ${space(2)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }\n .action:hover, .close:hover { background: ${t.surfaceSubtle}; }\n `, touchTarget('.action, .close')];\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.stop();\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('open') || changed.has('duration')) {\n this.stop();\n if (this.open) this.start();\n }\n }\n\n private start(): void {\n this.stop();\n if (this.duration > 0 && !this.actionText) this.timer = setTimeout(() => this.close(), this.duration * 1000);\n }\n\n private stop(): void {\n if (this.timer) clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private close(): void {\n this.stop();\n if (!this.open) return;\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private action(): void {\n this.dispatchEvent(new CustomEvent('impakt-action', { bubbles: true, composed: true }));\n this.close();\n }\n\n render(): TemplateResult {\n return html`<div class=\"region\" role=\"status\" aria-live=\"polite\">\n ${this.open ? html`<div class=\"toast\" part=\"toast\" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}\n @keydown=${(e: KeyboardEvent) => { if (e.key === 'Escape') { e.preventDefault(); this.close(); } }}>\n <span class=\"mark\">${iconSvg(TOAST_ICON[this.tone] ?? 'info', '20px')}</span>\n <p class=\"message\">${this.message}</p>\n ${this.actionText ? html`<button class=\"action\" type=\"button\" @click=${this.action}>${this.actionText}</button>` : nothing}\n <button class=\"close\" type=\"button\" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg('close', '16px')}</button>\n </div>` : nothing}\n </div>`;\n }\n}\n\nexport interface MenuItem {\n id?: string;\n text: string;\n /** Where it goes. Without one it fires impakt-select with its value. */\n href?: string;\n value?: string;\n icon?: string;\n tone?: '' | 'danger';\n}\n\n/**\n * A button that opens a short list of actions or links.\n *\n * It follows the ARIA menu button pattern: the arrow keys, Home and End move\n * through it, a letter moves to the next item that starts with it, Escape\n * closes it and puts focus back on the button, and a click anywhere else closes\n * it. A list that would run off the side of the screen opens towards the other\n * edge instead, so it never makes a phone scroll sideways.\n *\n * @category navigation\n * @icon menu\n * @fires {CustomEvent<{ value: string }>} impakt-select - When an item without an address is chosen. The value is in detail.value.\n */\nexport class ImpaktMenu extends ImpaktElement {\n static properties = {\n label: { type: String },\n icon: { type: String },\n items: { type: Array },\n edge: { type: String, reflect: true },\n open: { type: Boolean, reflect: true },\n };\n declare label: string;\n declare icon: string;\n declare items: MenuItem[];\n /** Which edge of the button the list lines up with. */\n declare edge: 'start' | 'end';\n declare open: boolean;\n\n constructor() {\n super();\n this.label = 'Menu';\n this.icon = '';\n this.items = [];\n this.edge = 'start';\n this.open = false;\n }\n\n static styles = [...ImpaktElement.styles, focusRing, touchTarget('.trigger, .item'), css`\n :host { position: relative; display: inline-block; }\n .trigger { ${targetSize} display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(2)} ${space(3.5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.text}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: ${t.shadowXs}; cursor: pointer; }\n .trigger:hover { background: ${t.surfaceSubtle}; }\n .chev { display: inline-flex; color: ${t.textMuted}; transition: transform 120ms ease-in-out; }\n :host([open]) .chev { transform: rotate(180deg); }\n .list { position: absolute; z-index: 100; inset-block-start: calc(100% + ${space(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(20rem, 90vw); margin: 0; padding: ${space(1.5)}; list-style: none; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowLg}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: pop 120ms ease-out; }\n :host([edge='end']) .list, .list.flip-end { inset-inline: auto 0; }\n :host([edge='end']) .list.flip-start { inset-inline: 0 auto; }\n @keyframes pop { from { opacity: 0; transform: translateY(-${space(1)}); } }\n .item { ${targetSize} box-sizing: border-box; display: flex; align-items: center; gap: ${space(2.5)}; inline-size: 100%; padding: ${space(2)} ${space(2.5)}; font: inherit; ${type('sm')} text-align: start; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .item:hover, .item:focus { background: ${t.surfaceSubtle}; }\n .item.danger { color: ${t.dangerText}; }\n .item svg { flex: none; }\n `];\n\n private outside = (event: Event): void => {\n if (!event.composedPath().includes(this)) this.toggle(false);\n };\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('click', this.outside);\n }\n\n private get entries(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLElement>('.item'));\n }\n\n private get trigger(): HTMLElement | null {\n return this.renderRoot.querySelector('.trigger');\n }\n\n private toggle(open: boolean, focus?: 'first' | 'last'): void {\n this.open = open;\n if (open) {\n document.addEventListener('click', this.outside);\n void this.updateComplete.then(() => {\n this.keepOnScreen();\n this.entries[focus === 'last' ? this.entries.length - 1 : 0]?.focus();\n });\n } else document.removeEventListener('click', this.outside);\n }\n\n /** Open towards the other edge when the list would run off the screen. */\n private keepOnScreen(): void {\n const list = this.renderRoot.querySelector<HTMLElement>('.list');\n if (!list) return;\n list.classList.remove('flip-start', 'flip-end');\n const box = list.getBoundingClientRect();\n const width = document.documentElement.clientWidth;\n if (box.right > width - 8) list.classList.add('flip-end');\n else if (box.left < 8) list.classList.add('flip-start');\n }\n\n private triggerKey(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n this.toggle(true, event.key === 'ArrowUp' ? 'last' : 'first');\n }\n }\n\n private listKey(event: KeyboardEvent): void {\n const entries = this.entries;\n const at = entries.indexOf((this.renderRoot as ShadowRoot).activeElement as HTMLElement);\n const go: Record<string, number> = { ArrowDown: (at + 1) % entries.length, ArrowUp: (at - 1 + entries.length) % entries.length, Home: 0, End: entries.length - 1 };\n if (event.key in go) {\n event.preventDefault();\n entries[go[event.key]!]?.focus();\n } else if (event.key.length === 1 && /\\S/.test(event.key) && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const letter = event.key.toLowerCase();\n const next = [...entries.slice(at + 1), ...entries.slice(0, at + 1)].find((e) => (e.textContent ?? '').trim().toLowerCase().startsWith(letter));\n next?.focus();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.toggle(false);\n this.trigger?.focus();\n } else if (event.key === 'Tab') this.toggle(false);\n }\n\n private choose(item: MenuItem): void {\n this.toggle(false);\n this.trigger?.focus();\n if (!item.href) this.dispatchEvent(new CustomEvent('impakt-select', { detail: { value: item.value ?? item.text }, bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n const inner = (item: MenuItem): TemplateResult => html`${iconSvg(item.icon, '18px')}<span>${item.text}</span>`;\n return html`<button class=\"trigger\" part=\"trigger\" type=\"button\" aria-haspopup=\"menu\" aria-expanded=${String(this.open)} aria-controls=${this.id_('list')}\n @click=${() => this.toggle(!this.open)} @keydown=${this.triggerKey}>${iconSvg(this.icon, '18px')}${this.label}<span class=\"chev\">${iconSvg('chevron-down', '16px')}</span></button>\n ${this.open ? html`<ul class=\"list\" part=\"list\" id=${this.id_('list')} role=\"menu\" aria-label=${this.label} @keydown=${this.listKey}>\n ${this.items.map((item) => html`<li role=\"none\">${item.href\n ? html`<a class=\"item ${item.tone === 'danger' ? 'danger' : ''}\" role=\"menuitem\" tabindex=\"-1\" href=${item.href} @click=${() => this.choose(item)}>${inner(item)}</a>`\n : html`<button class=\"item ${item.tone === 'danger' ? 'danger' : ''}\" role=\"menuitem\" tabindex=\"-1\" type=\"button\" @click=${() => this.choose(item)}>${inner(item)}</button>`}</li>`)}\n </ul>` : nothing}`;\n }\n}\n\n/** Which page numbers to show: the ends and the neighbours, with gaps between. */\nexport function pageWindow(page: number, pages: number): Array<number | 'gap'> {\n const wanted = [...new Set([1, page - 1, page, page + 1, pages])].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);\n return wanted.flatMap((n, i): Array<number | 'gap'> => {\n const previous = wanted[i - 1];\n if (previous === undefined || n === previous + 1) return [n];\n return n === previous + 2 ? [previous + 1, n] : ['gap', n];\n });\n}\n\n/**\n * Page numbers for a long list.\n *\n * Give it `href-pattern` and every number is a real link, with `{page}` swapped\n * for the number. Without one the numbers are buttons and it fires\n * `impakt-page`. On a narrow screen the numbers fold to \"Page 2 of 9\".\n *\n * @category navigation\n * @icon pagination\n * @fires {CustomEvent<{ page: number }>} impakt-page - When a page is chosen. The number is in detail.page.\n */\nexport class ImpaktPagination extends ImpaktElement {\n static properties = {\n page: { type: Number },\n pages: { type: Number },\n hrefPattern: { type: String, attribute: 'href-pattern' },\n label: { type: String },\n previousText: { type: String, attribute: 'previous-text' },\n nextText: { type: String, attribute: 'next-text' },\n };\n declare page: number;\n declare pages: number;\n declare hrefPattern: string;\n declare label: string;\n declare previousText: string;\n declare nextText: string;\n\n constructor() {\n super();\n this.page = 1;\n this.pages = 1;\n this.hrefPattern = '';\n this.label = 'Pages';\n this.previousText = 'Previous';\n this.nextText = 'Next';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, touchTarget('.n, .step'), css`\n :host { display: block; container-type: inline-size; }\n nav { display: flex; align-items: center; justify-content: space-between; gap: ${space(2)}; }\n ul { display: flex; align-items: center; gap: ${space(1)}; margin: 0; padding: 0; list-style: none; }\n .n, .step { ${targetSize} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${space(1.5)}; min-inline-size: 44px; padding: 0 ${space(2.5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('medium')}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n .n:hover, .step:hover { background: ${t.surfaceSubtle}; }\n .n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${fontWeight('semibold')}; }\n .step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }\n .gap { color: ${t.textMuted}; padding: 0 ${space(1)}; }\n .count { display: none; ${type('sm')} color: ${t.textMuted}; }\n @container (max-width: 34rem) { ul { display: none; } .count { display: block; } }\n `];\n\n private go(page: number, event: Event): void {\n if (this.hrefPattern) return;\n event.preventDefault();\n this.page = page;\n this.dispatchEvent(new CustomEvent('impakt-page', { detail: { page }, bubbles: true, composed: true }));\n }\n\n private link(page: number, classes: string, content: unknown, label: string, current: boolean): TemplateResult {\n return this.hrefPattern\n ? html`<a class=${classes} href=${this.hrefPattern.replace('{page}', String(page))} aria-label=${label} aria-current=${current ? 'page' : nothing}>${content}</a>`\n : html`<button class=${classes} type=\"button\" aria-label=${label} aria-current=${current ? 'page' : nothing} @click=${(e: Event) => this.go(page, e)}>${content}</button>`;\n }\n\n private step(to: number, words: string, icon: string, off: boolean): TemplateResult {\n const content = icon === 'arrow-left' ? html`${iconSvg(icon, '16px')}${words}` : html`${words}${iconSvg(icon, '16px')}`;\n return off ? html`<span class=\"step\" aria-disabled=\"true\">${content}</span>` : this.link(to, 'step', content, words, false);\n }\n\n render(): TemplateResult {\n const page = Math.min(Math.max(this.page, 1), Math.max(this.pages, 1));\n return html`<nav aria-label=${this.label} part=\"nav\">\n ${this.step(page - 1, this.previousText, 'arrow-left', page <= 1)}\n <ul>${pageWindow(page, this.pages).map((n) => html`<li>${n === 'gap' ? html`<span class=\"gap\" aria-hidden=\"true\">…</span>` : this.link(n, 'n', n, say('Page {page}', { page: n }), n === page)}</li>`)}</ul>\n <span class=\"count\">${say('Page {page} of {pages}', { page, pages: this.pages })}</span>\n ${this.step(page + 1, this.nextText, 'arrow-right', page >= this.pages)}\n </nav>`;\n }\n}\n\nconst initialsOf = (name: string): string => {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n return ((words[0]?.[0] ?? '') + (words.length > 1 ? words[words.length - 1]![0]! : '')).toUpperCase();\n};\n\n/**\n * A person's photo, or their initials when there is no photo or it fails.\n *\n * @category content\n * @icon avatar\n */\nexport class ImpaktAvatar extends ImpaktElement {\n static properties = {\n fullName: { type: String, attribute: 'full-name' },\n src: { type: String },\n size: { type: String, reflect: true },\n };\n declare fullName: string;\n declare src: string;\n declare size: 'sm' | 'md' | 'lg' | 'xl';\n\n private failed = false;\n\n constructor() {\n super();\n this.fullName = '';\n this.src = '';\n this.size = 'md';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }\n :host([size='sm']) { --size: 32px; }\n :host([size='lg']) { --size: 56px; }\n :host([size='xl']) { --size: 80px; }\n .face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${fontWeight('semibold')}; }\n img { inline-size: 100%; block-size: 100%; object-fit: cover; }\n `];\n\n willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('src')) this.failed = false;\n }\n\n render(): TemplateResult {\n if (this.src && !this.failed) {\n return html`<div class=\"face\"><img src=${this.src} alt=${this.fullName} @error=${() => { this.failed = true; this.requestUpdate(); }} /></div>`;\n }\n return html`<div class=\"face\" role=\"img\" aria-label=${this.fullName || say('Person')}>${initialsOf(this.fullName) || iconSvg('user', '55%')}</div>`;\n }\n}\n\nexport interface AvatarItem {\n id?: string;\n name: string;\n src?: string;\n}\n\n/**\n * A few people overlapped in a row, with a count for the rest: the sales team,\n * the neighbours who have already moved in.\n *\n * @category content\n * @icon avatars\n */\nexport class ImpaktAvatarGroup extends ImpaktElement {\n static properties = {\n items: { type: Array },\n max: { type: Number },\n size: { type: String, reflect: true },\n moreLabel: { type: String, attribute: 'more-label' },\n };\n declare items: AvatarItem[];\n declare max: number;\n declare size: 'sm' | 'md' | 'lg';\n /** How the people left out are described to a screen reader, after the number. */\n declare moreLabel: string;\n\n constructor() {\n super();\n this.items = [];\n this.max = 4;\n this.size = 'md';\n this.moreLabel = 'more people';\n }\n\n static styles = [...ImpaktElement.styles, css`\n ul { display: flex; margin: 0; padding: 0; list-style: none; }\n li { margin-inline-start: -${space(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }\n li:first-child { margin-inline-start: 0; }\n .more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${type('xs')} line-height: 1; font-weight: ${fontWeight('semibold')}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }\n :host([size='sm']) .more { inline-size: 32px; block-size: 32px; }\n :host([size='lg']) .more { inline-size: 56px; block-size: 56px; }\n .sr { ${visuallyHidden} }\n `];\n\n render(): TemplateResult {\n const shown = this.items.slice(0, this.max);\n const rest = this.items.length - shown.length;\n return html`<ul part=\"list\">\n ${shown.map((item) => html`<li><impakt-avatar full-name=${item.name} src=${item.src ?? ''} size=${this.size}></impakt-avatar></li>`)}\n ${rest > 0 ? html`<li><span class=\"more\"><span aria-hidden=\"true\">+${rest}</span><span class=\"sr\">${rest} ${this.moreLabel}</span></span></li>` : nothing}\n </ul>`;\n }\n}\n\n/**\n * What a list says when it has nothing in it, and what to do about that.\n *\n * @category feedback\n * @icon empty\n * @role heading\n * @slot actions - The next thing to do, usually one button.\n */\nexport class ImpaktEmptyState extends ImpaktElement {\n static properties = {\n icon: { type: String },\n heading: { type: String },\n lead: { type: String },\n framed: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare icon: string;\n declare heading: string;\n declare lead: string;\n /** Draws a dashed outline round it. */\n declare framed: boolean;\n declare headingLevel: 2 | 3 | 4;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.icon = 'search';\n this.heading = '';\n this.lead = '';\n this.framed = false;\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpaktElement.styles, spaceAround, css`\n .wrap { display: flex; flex-direction: column; align-items: center; gap: ${space(2)}; padding: ${space(12)} ${space(6)}; text-align: center; }\n :host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }\n .mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${space(2)}; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; }\n .h { margin: 0; font-family: ${t.fontHeading}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }\n .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${space(3)}; margin-block-start: ${space(3)}; }\n `];\n\n render(): TemplateResult {\n return html`<div class=\"wrap\" part=\"wrap\">\n <span class=\"mark\">${iconSvg(this.icon, '26px')}</span>\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.lead ? html`<p>${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>`;\n }\n}\n\nexport interface SlotDay {\n id?: string;\n /** The day, as 2026-11-14. */\n date: string;\n /** The times on offer, separated by commas: 10:00, 11:30, 14:00. */\n times: string;\n}\n\nconst timesOf = (day: SlotDay | undefined): string[] => String(day?.times ?? '').split(',').map((time) => time.trim()).filter(Boolean);\n\n/** A day's parts in the page's language. A date that cannot be read is shown as it was written. */\nfunction dayParts(date: string): { weekday: string; day: string; month: string } {\n const parsed = new Date(`${date}T00:00:00Z`);\n if (Number.isNaN(parsed.getTime())) return { weekday: '', day: date, month: '' };\n const locale = pageLocale();\n const part = (options: Intl.DateTimeFormatOptions): string => new Intl.DateTimeFormat(locale, { timeZone: 'UTC', ...options }).format(parsed);\n return { weekday: part({ weekday: 'short' }), day: part({ day: 'numeric' }), month: part({ month: 'short' }) };\n}\n\n/**\n * Choose a day, then a time: a viewing, a call back, a site visit.\n *\n * Both rows are native radios under the styling, so the arrow keys and screen\n * readers work as they do for any radio group. Its value is the day and time\n * together, as 2026-11-14T10:00.\n *\n * @category form\n * @icon calendar\n */\nexport class ImpaktSlotPicker extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n days: { type: Array },\n dayLabel: { type: String, attribute: 'day-label' },\n timeLabel: { type: String, attribute: 'time-label' },\n emptyText: { type: String, attribute: 'empty-text' },\n };\n declare days: SlotDay[];\n declare dayLabel: string;\n declare timeLabel: string;\n /** What is said when no times are on offer. */\n declare emptyText: string;\n\n private day = '';\n\n constructor() {\n super();\n this.days = [];\n this.dayLabel = 'Day';\n this.timeLabel = 'Time';\n this.emptyText = 'No times are available at the moment.';\n }\n\n static styles = [...FieldElement.styles, css`\n fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }\n legend { padding: 0; }\n .row-label { ${type('sm')} color: ${t.textMuted}; margin-block: ${space(2)}; }\n .days { display: flex; gap: ${space(2)}; overflow-x: auto; padding: ${space(1)}; margin: -${space(1)}; scrollbar-width: thin; }\n .times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${space(2)}; }\n label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusLg}; box-shadow: inset 0 0 0 1px ${t.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }\n label:hover { background: ${t.surfaceSubtle}; }\n label:has(input:checked) { color: ${t.onBrand}; background: ${t.brand}; box-shadow: none; }\n label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }\n input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }\n .day { flex: none; inline-size: 4.5rem; padding-block: ${space(2.5)}; }\n .weekday, .month { ${type('xs')} }\n .num { ${type('xl')} font-weight: ${fontWeight('semibold')}; }\n .time { padding: ${space(2)}; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .empty { margin: 0; color: ${t.textMuted}; }\n :host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${t.danger}; }\n `];\n\n private get currentDay(): SlotDay | undefined {\n const wanted = this.day || this.value.split('T')[0];\n return this.days.find((day) => day.date === wanted) ?? this.days[0];\n }\n\n private chooseDay(date: string): void {\n this.day = date;\n if (this.value && !this.value.startsWith(`${date}T`)) this.setFormValue('');\n this.requestUpdate();\n }\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}</legend>`;\n }\n\n protected renderControl(): TemplateResult {\n const current = this.currentDay;\n if (!current) return html`<p class=\"empty\">${this.emptyText}</p>`;\n return html`\n <div class=\"row-label\" id=${this.id_('days')}>${this.dayLabel}</div>\n <div class=\"days\" part=\"days\" role=\"radiogroup\" aria-labelledby=${this.id_('days')}>\n ${this.days.map((day) => {\n const parts = dayParts(day.date);\n return html`<label class=\"day\"><input type=\"radio\" name=${`${this.uid}-day`} .checked=${day.date === current.date} ?disabled=${this.disabled} @change=${() => this.chooseDay(day.date)} />\n <span class=\"weekday\">${parts.weekday}</span><span class=\"num\">${parts.day}</span><span class=\"month\">${parts.month}</span></label>`;\n })}\n </div>\n <div class=\"row-label\" id=${this.id_('times')}>${this.timeLabel}</div>\n <div class=\"times\" part=\"times\" role=\"radiogroup\" aria-labelledby=${this.id_('times')}>\n ${timesOf(current).map((time, i) => {\n const value = `${current.date}T${time}`;\n return html`<label class=\"time\"><input type=\"radio\" name=${`${this.uid}-time`} .checked=${this.value === value} ?required=${this.required && i === 0} ?disabled=${this.disabled} @change=${() => this.setFormValue(value)} />${time}</label>`;\n })}\n </div>`;\n }\n\n render(): TemplateResult {\n return html`<fieldset part=\"fieldset\" ?disabled=${this.disabled} aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}>\n ${this.renderLabel()}\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">${this.description}</div>` : nothing}\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">${this.error || nothing}</div>\n </fieldset>`;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-drawer', ImpaktDrawer);\ncustomElements.define('impakt-toast', ImpaktToast);\ncustomElements.define('impakt-menu', ImpaktMenu);\ncustomElements.define('impakt-pagination', ImpaktPagination);\ncustomElements.define('impakt-avatar', ImpaktAvatar);\ncustomElements.define('impakt-avatar-group', ImpaktAvatarGroup);\ncustomElements.define('impakt-empty-state', ImpaktEmptyState);\ncustomElements.define('impakt-slot-picker', ImpaktSlotPicker);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-drawer': ImpaktDrawer; 'impakt-toast': ImpaktToast; 'impakt-menu': ImpaktMenu; 'impakt-pagination': ImpaktPagination;\n 'impakt-avatar': ImpaktAvatar; 'impakt-avatar-group': ImpaktAvatarGroup; 'impakt-empty-state': ImpaktEmptyState; 'impakt-slot-picker': ImpaktSlotPicker;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AA6BjD,IAAM,eAAN,cAA2B,cAAc;AAAA,EAa9C,cAAc;AACZ,UAAM;AA4BR,SAAQ,YAAY;AA3BlB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,aAAa;AAAA,EACpB;AAAA,EAlBA;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,IACvD;AAAA;AAAA,EAeA;AAAA,SAAO,SAAS,CAAC,GAAG,cAAc,QAAQ,WAAW,YAAY,QAAQ,GAAG;AAAA,oOACsJ,EAAE,IAAI,iBAAiB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AAC,MAAM,IAAI;AAAA,IACrO,CAAC,CAAC;AAAA;AAAA,EAER;AAAA,EAEA,SAAyB;AACvB,WAAO,2CAA2C,KAAK,QAAQ,qBAAqB,KAAK,WAAW,iBAAiB,KAAK,QAAQ,SAAS,OAAO;AAAA,QAC9I,KAAK,YAAY,CAAC;AAAA,QAClB,KAAK,cAAc,mCAAmC,KAAK,IAAI,aAAa,CAAC,uBAAuB,KAAK,WAAW,WAAW,OAAO;AAAA,QACtI,KAAK,cAAc,CAAC;AAAA,8BACE,KAAK,IAAI,OAAO,CAAC,oCAAoC,KAAK,SAAS,OAAO;AAAA;AAAA,EAEtG;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;AACnD,eAAe,OAAO,gBAAgB,WAAW;AACjD,eAAe,OAAO,eAAe,UAAU;AAC/C,eAAe,OAAO,qBAAqB,gBAAgB;AAC3D,eAAe,OAAO,iBAAiB,YAAY;AACnD,eAAe,OAAO,uBAAuB,iBAAiB;AAC9D,eAAe,OAAO,sBAAsB,gBAAgB;AAC5D,eAAe,OAAO,sBAAsB,gBAAgB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/help.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing } from '../base/styles';\nimport { fontWeight, t } from '../base/tokens';\n\n/**\n * What form a help mechanism takes.\n *\n * `link` goes somewhere: a help page, a contact form, a chat. The other four\n * are the \"human contact details\" that 3.2.6 Consistent Help names, shown as\n * text so a reader can see them without following anything.\n */\nexport type HelpKind = 'link' | 'phone' | 'email' | 'address' | 'hours';\n\n/**\n * A help link, or contact details shown as text.\n *\n * **Its identity is `mechanismId`, not its wording or destination.** 3.2.6\n * Consistent Help asks that help offered on several pages appears in the same\n * relative order on each. Strata checks that at publish by comparing these ids\n * across pages, so the label can be reworded and the number can change\n * without the check treating it as a different mechanism. It is literal and\n * cannot be bound, because an id that a data response could change is one the\n * check cannot compare.\n *\n * **Contact details are text, not a link to a page that has them.** The\n * criterion lists a phone number, an email address and a postal address as\n * help in their own right, and a reader who has to follow a link to find the\n * number has been given a link rather than the number. A phone number renders\n * as a `tel:` link and an email address as a `mailto:` link, each with the\n * detail itself as the visible text. The link target is derived from the\n * visible detail rather than authored separately, so the number a reader sees\n * and the number their phone dials cannot drift apart. An address or opening\n * hours render as plain text and keep the line breaks they were written with.\n *\n * **Contact links are named by their caption and their detail.** A phone\n * link's accessible name is \"Call us 0800 123 456\" rather than the bare\n * number, because a reader moving through a list of links hears each one out\n * of context (2.4.4 Link Purpose). The visible text stays inside the name, so\n * 2.5.3 Label in Name holds for a reader who speaks it.\n *\n * **Nothing unnamed or empty is ever rendered.** Runtime bindings may be\n * absent while data loads, or resolve to blank text. A link with no label, or\n * contact details with no detail, render nothing rather than a focusable link\n * with no name or a caption with nothing under it. Contact details whose\n * caption is blank still show the detail, because a phone number or an\n * address names itself. For that reason the caption is optional for contact\n * details, and publishing requires a label only on a link. Publishing does\n * require what each kind cannot do without: a link's label and address, and\n * contact details' detail, so the empty states are only reached at runtime.\n *\n * **Every link meets the minimum target size.** Links here are at least the\n * locked `target.min` token in both directions (2.5.8 Target Size), because a\n * help link usually stands on its own line, where the criterion's inline\n * exemption does not apply.\n *\n * @category action\n * @icon help\n * @role help\n */\nexport class ImpaktHelp extends ImpaktElement {\n static properties = {\n mechanismId: { type: String, attribute: 'mechanism-id' },\n kind: { type: String, reflect: true },\n href: { type: String },\n label: { type: String },\n detail: { type: String },\n };\n\n /** Stable identity across pages, independent of wording and destination. */\n declare mechanismId: string;\n // Written out as a union rather than as `HelpKind` so the manifest offers it\n // as a fixed choice: which form help takes is a design decision, not data.\n /** Whether this is a link to help, or contact details shown as text. */\n declare kind: 'link' | 'phone' | 'email' | 'address' | 'hours';\n /** Where a link goes. Phone and email links are built from the detail instead. */\n declare href: string;\n /**\n * The visible name. For a link it is the link text. For contact details it\n * is the caption shown above them, such as \"Call us\".\n */\n declare label: string;\n /**\n * The contact detail itself: a phone number, an email address, a postal\n * address or opening hours. Line breaks are kept. Unused by a link.\n */\n declare detail: string;\n\n constructor() {\n super();\n this.kind = 'link';\n this.href = '';\n // Defaulted, so the manifest does not mark it required: contact details\n // may leave the caption out. A link without one is refused at publish.\n this.label = '';\n this.detail = '';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; }\n a { display: inline-flex; align-items: center; min-height: ${t.targetMin}; min-width: ${t.targetMin};\n color: ${t.link}; text-decoration: underline; overflow-wrap: anywhere; max-width: 100%; }\n a:hover { color: ${t.linkHover}; }\n .contact { margin: 0; }\n .caption { display: block; font-weight: ${fontWeight('semibold')}; }\n /* An address is written one line at a time, and opening hours are often one\n day to a line. Long unbroken values still wrap at 320px (1.4.10). */\n .detail { white-space: pre-line; overflow-wrap: anywhere; }\n `];\n\n render(): TemplateResult | typeof nothing {\n switch (this.kind) {\n case 'phone':\n case 'email':\n case 'address':\n case 'hours':\n return this.renderContact();\n default:\n // An absent or unrecognised kind keeps the original link behaviour, so\n // a page published before contact details existed renders unchanged.\n return this.renderLink();\n }\n }\n\n private renderLink(): TemplateResult | typeof nothing {\n // Runtime bindings may be absent while data loads, or resolve to blank text.\n // Do not expose an unnamed focusable link in those states.\n if (!text(this.label)) return nothing;\n return html`<a part=\"link\" href=${this.href}>${this.label}</a>`;\n }\n\n private renderContact(): TemplateResult | typeof nothing {\n const detail = text(this.detail);\n // A caption with nothing under it is not help, so neither is drawn.\n if (!detail) return nothing;\n const caption = text(this.label);\n const target = contactHref(this.kind, detail);\n const captionId = this.id_('caption');\n const detailId = this.id_('detail');\n const captionPart = caption\n ? html`<span class=\"caption\" part=\"label\" id=${captionId}>${caption}</span>`\n : nothing;\n const detailPart = target\n ? html`<a part=\"link\" href=${target} aria-labelledby=${caption ? `${captionId} ${detailId}` : nothing}\n ><span class=\"detail\" part=\"detail\" id=${detailId}>${detail}</span></a>`\n : html`<span class=\"detail\" part=\"detail\">${detail}</span>`;\n return html`<p class=\"contact\" part=\"contact\">${captionPart}${detailPart}</p>`;\n }\n}\n\n/** Trimmed text, or empty for anything that is not a string. */\nfunction text(value: unknown): string {\n return typeof value === 'string' ? value.trim() : '';\n}\n\n/**\n * The link a contact detail opens, or empty when it should stay as text.\n *\n * A phone number is reduced to its digits and one leading `+`, and the \"(0)\"\n * that UK numbers print after the country code is dropped, because the\n * separators a reader expects are not dialled. A value with no digits, or an\n * email address without an `@`, stays as plain text. The reader still sees\n * it, and nothing offers to dial or mail something that cannot work.\n */\nfunction contactHref(kind: string, detail: string): string {\n if (kind === 'phone') {\n const digits = detail.replace(/\\(0\\)/g, '').replace(/[^\\d+]/g, '').replace(/(?!^)\\+/g, '');\n return /\\d/.test(digits) ? `tel:${digits}` : '';\n }\n if (kind === 'email') return /^[^\\s@]+@[^\\s@]+$/.test(detail) ? `mailto:${detail}` : '';\n return '';\n}\n\ncustomElements.define('impakt-help', ImpaktHelp);\ndeclare global {\n interface HTMLElementTagNameMap { 'impakt-help': ImpaktHelp }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA4DjD,IAAM,aAAN,cAAyB,cAAc;AAAA,EAC5C;AAAA,SAAO,aAAa;AAAA,MAClB,aAAa,EAAE,MAAM,QAAQ,WAAW,eAAe;AAAA,MACvD,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,QAAQ,EAAE,MAAM,OAAO;AAAA,IACzB;AAAA;AAAA,EAqBA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,OAAO;AAGZ,SAAK,QAAQ;AACb,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA;AA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EAAE,QAAQ,WAAW,EAAE,EAAE,QAAQ,YAAY,EAAE;AACzF,WAAO,KAAK,KAAK,MAAM,IAAI,OAAO,MAAM,KAAK;AAAA,EAC/C;AACA,MAAI,SAAS,QAAS,QAAO,oBAAoB,KAAK,MAAM,IAAI,UAAU,MAAM,KAAK;AACrF,SAAO;AACT;AAEA,eAAe,OAAO,eAAe,UAAU;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/shell.ts"],"sourcesContent":["import { html, css, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize } from '../base/styles';\nimport { fontSize, fontWeight, space, t, token } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/** One destination in a product's navigation. */\nexport interface ShellNavItem {\n /** A stable name for the destination, sent back with `impakt-navigate`. */\n id?: string;\n label: string;\n href: string;\n /** An icon from `impakt-icon`'s set, such as `grid` or `users`. */\n icon?: string;\n}\n\n/** The phone layout starts below this width. Desktop and phone only; there is no tablet layout. */\nconst PHONE = unsafeCSS('48rem');\n\n/** Normalise a path so `/jobs/` and `/jobs` compare equal. */\nfunction pathOf(href: string): string | null {\n if (!href || href.startsWith('#')) return null;\n try {\n const base = typeof location === 'undefined' ? 'http://localhost/' : location.href;\n return new URL(href, base).pathname.replace(/\\/$/, '') || '/';\n } catch {\n return null;\n }\n}\n\n/**\n * Whether an item is where the person is. `current` is the path the app's\n * router reports. Without it the browser's address is used, which is right\n * for a site and stale in a single-page app that never reloads.\n *\n * An item is current on its own path and on the paths below it, so Jobs stays\n * marked on `/jobs/123`. The root item, `/`, is current only on `/`.\n */\nexport function isCurrent(href: string, current: string): boolean {\n const path = pathOf(href);\n if (!path) return false;\n const here = pathOf(current || (typeof location === 'undefined' ? '' : location.pathname));\n if (!here) return false;\n if (path === here) return true;\n return path !== '/' && here.startsWith(`${path}/`);\n}\n\n/**\n * Tell the app a navigation link was followed, so a single-page app can route\n * without a reload. The event is cancelable: an app that calls\n * `preventDefault()` on it takes over, and the browser does not follow the\n * link. A click with a modifier key, or with any button but the main one, is\n * left to the browser, so \"open in a new tab\" keeps working.\n */\nexport function announceNavigate(host: HTMLElement, event: MouseEvent, item: { href: string; id?: string }): void {\n if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n const go = new CustomEvent('impakt-navigate', {\n detail: { href: item.href, id: item.id ?? item.href },\n bubbles: true,\n composed: true,\n cancelable: true,\n });\n if (!host.dispatchEvent(go)) event.preventDefault();\n}\n\n/**\n * A product's main navigation down the side of the screen: an icon and a word\n * for each place, with a footer slot for an action that belongs at the bottom,\n * such as Sign out.\n *\n * **The place you are on is marked in words as well as colour.** Its link\n * carries `aria-current=\"page\"`, which a screen reader announces, and it is\n * filled, so it does not rely on a colour change alone (1.4.1).\n *\n * **Every item has a word.** The icons are decorative and hidden from screen\n * readers, because an icon alone is a guess for anyone who has not learned the\n * product.\n *\n * **It works with an app's router.** Set `current` to the router's path, and\n * cancel `impakt-navigate` to route without a reload.\n *\n * @category action\n * @icon menu\n * @slot footer - An action pinned to the bottom of the side, such as Sign out.\n * @fires {CustomEvent<{ href: string; id: string }>} impakt-navigate - When an item is followed. Cancel it to route in the app instead of the browser.\n */\nexport class ImpaktSideNav extends ImpaktElement {\n static properties = {\n items: { type: Array },\n label: { type: String },\n current: { type: String },\n };\n /** The places, in order. */\n declare items: ShellNavItem[];\n /** What the navigation is called for a screen reader, such as \"Main\". */\n declare label: string;\n /** The path the person is on, from the app's router. Leave empty to use the address bar. */\n declare current: string;\n\n constructor() {\n super();\n this.items = [];\n this.label = 'Main';\n this.current = '';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: flex; flex-direction: column; gap: ${space(5)}; block-size: 100%; }\n .card { padding: ${space(2)}; border-radius: ${t.radiusXl}; background: ${t.surfaceCard}; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(0.5)}; }\n a {\n ${targetSize}\n display: flex;\n align-items: center;\n gap: ${space(3)};\n min-block-size: 44px;\n padding: 0 ${space(3.5)};\n border-radius: ${t.radiusLg};\n color: ${t.text};\n font-size: ${fontSize('md')};\n font-weight: ${fontWeight('medium')};\n text-decoration: none;\n transition: background-color 120ms ease-in-out, color 120ms ease-in-out;\n }\n a:hover { background: ${t.surfaceInset}; }\n a[aria-current='page'] { background: ${t.text}; color: ${t.surfaceCard}; }\n .icon { flex: none; }\n .footer { margin-block-start: auto; }\n .footer.empty { display: none; }\n @media (prefers-reduced-motion: reduce) { a { transition: none; } }\n @media (forced-colors: active) { a[aria-current='page'] { border: 2px solid Highlight; } }\n `];\n\n private footerFilled = false;\n\n private onFooter(event: Event): void {\n const slot = event.target as HTMLSlotElement;\n this.footerFilled = slot.assignedNodes({ flatten: true }).some((n) => n.nodeType === Node.ELEMENT_NODE || (n.textContent ?? '').trim() !== '');\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n return html`\n <nav class=\"card\" aria-label=${this.label} part=\"nav\">\n <ul part=\"list\">\n ${this.items.map((item) => html`\n <li>\n <a\n href=${item.href}\n part=\"link\"\n aria-current=${isCurrent(item.href, this.current) ? 'page' : nothing}\n @click=${(e: MouseEvent) => announceNavigate(this, e, item)}\n >${iconSvg(item.icon, '20px')}<span>${item.label}</span></a>\n </li>\n `)}\n </ul>\n </nav>\n <div class=\"card footer ${this.footerFilled ? '' : 'empty'}\" part=\"footer\"><slot name=\"footer\" @slotchange=${this.onFooter}></slot></div>\n `;\n }\n}\n\n/**\n * A product's main navigation along the bottom of a phone screen: four or five\n * places, each an icon above a word.\n *\n * It follows the same rules as `impakt-side-nav`: the current place carries\n * `aria-current=\"page\"` and is filled, every item has a word, and\n * `impakt-navigate` lets an app route without a reload. Each item is at least\n * 48px tall, above the 24px floor of 2.5.8, because it is pressed with a thumb.\n *\n * @category action\n * @icon menu\n * @fires {CustomEvent<{ href: string; id: string }>} impakt-navigate - When an item is followed. Cancel it to route in the app instead of the browser.\n */\nexport class ImpaktTabBar extends ImpaktElement {\n static properties = {\n items: { type: Array },\n label: { type: String },\n current: { type: String },\n };\n /** The places, in order. Four or five fit a phone. */\n declare items: ShellNavItem[];\n /** What the navigation is called for a screen reader, such as \"Main\". */\n declare label: string;\n /** The path the person is on, from the app's router. Leave empty to use the address bar. */\n declare current: string;\n\n constructor() {\n super();\n this.items = [];\n this.label = 'Main';\n this.current = '';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; }\n nav { padding: ${space(1.5)}; border-radius: ${t.radiusXl}; background: ${t.text}; box-shadow: ${t.shadowLg}; }\n ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${space(1)}; }\n li { flex: 1 1 0; min-inline-size: 0; }\n a {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: ${space(1)};\n min-block-size: 50px;\n padding: ${space(1)};\n border-radius: ${t.radiusLg};\n /* The resting items are a blend of the card and text colours that keeps 4.5:1 on the bar. */\n color: color-mix(in srgb, ${t.surfaceCard} 74%, ${t.text});\n font-size: 11px;\n font-weight: ${fontWeight('medium')};\n line-height: 1.25;\n text-decoration: none;\n text-align: center;\n }\n a:hover { color: ${t.surfaceCard}; }\n a[aria-current='page'] { background: color-mix(in srgb, ${t.text}, ${t.surfaceCard} 16%); color: ${t.surfaceCard}; }\n span.word { max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n @media (forced-colors: active) { a[aria-current='page'] { border: 2px solid Highlight; } }\n `];\n\n render(): TemplateResult {\n return html`\n <nav aria-label=${this.label} part=\"nav\">\n <ul part=\"list\">\n ${this.items.map((item) => html`\n <li>\n <a\n href=${item.href}\n part=\"link\"\n aria-current=${isCurrent(item.href, this.current) ? 'page' : nothing}\n @click=${(e: MouseEvent) => announceNavigate(this, e, item)}\n >${iconSvg(item.icon, '22px')}<span class=\"word\">${item.label}</span></a>\n </li>\n `)}\n </ul>\n </nav>\n `;\n }\n}\n\n/**\n * The frame a signed-in product sits in, on a desktop and on a phone.\n *\n * On a desktop it is a rounded frame on a darker canvas, with the brand and\n * the side navigation on the left, a top bar along the top and the page's\n * content below it. On a phone the side navigation and the top bar step aside:\n * the page's own header sits on a dark band, the content rises over it on a\n * light sheet, and the tab bar floats at the bottom.\n *\n * **It gives the page its landmarks.** The content is the `main` landmark, the\n * top bar is a `header`, and a Skip to content link is the first thing a\n * keyboard reaches. The navigation elements bring their own `nav` landmarks.\n *\n * **Both navigations are in the page; only one is shown.** The side\n * navigation is hidden on a phone and the tab bar on a desktop, with\n * `display: none`, so a screen reader meets the one that is on screen.\n *\n * @category layout\n * @icon layout\n * @slot - The page's content.\n * @slot brand - The product's logo, at the top of the side.\n * @slot nav - The side navigation, an `impakt-side-nav`.\n * @slot workspace - The start of the top bar, such as the workspace's name.\n * @slot search - The middle of the top bar, such as a search field.\n * @slot actions - The end of the top bar: the main action and the account.\n * @slot phone-header - The page's header on a phone, on the dark band above the content.\n * @slot tab-bar - The phone navigation, an `impakt-tab-bar`.\n */\nexport class ImpaktAppShell extends ImpaktElement {\n static properties = {\n skipText: { type: String, attribute: 'skip-text' },\n topBarLabel: { type: String, attribute: 'top-bar-label' },\n };\n /** The words of the link that skips to the content. */\n declare skipText: string;\n /** What the top bar is called for a screen reader. Leave empty when there is only one top bar, as there usually is. */\n declare topBarLabel: string;\n\n constructor() {\n super();\n this.skipText = 'Skip to content';\n this.topBarLabel = '';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host {\n display: block;\n min-block-size: 100svh;\n background: var(--impakt-shell-canvas, ${t.surfaceInset});\n color: ${t.text};\n /* The text and card colours, kept before the phone header turns them round. */\n --impakt-shell-ink: ${t.text};\n --impakt-shell-paper: ${t.surfaceCard};\n }\n .frame {\n position: relative;\n box-sizing: border-box;\n display: grid;\n grid-template-columns: var(--impakt-shell-side, 190px) minmax(0, 1fr);\n grid-template-rows: auto 1fr;\n grid-template-areas: 'brand top' 'side main';\n gap: ${space(5)};\n min-block-size: calc(100svh - 2 * ${space(5)});\n margin: ${space(5)};\n padding: ${space(5)};\n border-radius: var(--impakt-shell-radius, 36px);\n background: ${token('color.surface.page', '#f2f5f4')};\n }\n .brand { grid-area: brand; display: flex; align-items: center; min-block-size: 52px; }\n .side { grid-area: side; display: flex; flex-direction: column; min-block-size: 0; }\n .side ::slotted(*) { flex: 1; }\n header { grid-area: top; display: flex; align-items: center; gap: ${space(5)}; min-inline-size: 0; }\n .workspace { flex: none; }\n .search { flex: 1 1 auto; display: flex; justify-content: center; min-inline-size: 0; }\n .search ::slotted(*) { inline-size: min(100%, 420px); }\n .actions { flex: none; display: flex; align-items: center; gap: ${space(3)}; }\n main { grid-area: main; min-inline-size: 0; }\n main:focus { outline: none; }\n .phone-header, .tab-bar { display: none; }\n .skip {\n position: absolute;\n inset-inline-start: ${space(2)};\n inset-block-start: ${space(2)};\n z-index: 20;\n padding: ${space(2)} ${space(4)};\n background: ${t.surfaceCard};\n color: ${t.link};\n border-radius: ${t.radius};\n transform: translateY(-200%);\n }\n .skip:not(:focus) { clip-path: inset(50%); }\n .skip:focus { transform: none; }\n\n @media (max-width: ${PHONE}) {\n :host { background: ${t.text}; }\n .frame {\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n border-radius: 0;\n min-block-size: 100svh;\n background: transparent;\n }\n .brand, .side, header { display: none; }\n /* The page's header sits on the dark band, so the elements slotted into it\n are given the card colour as their text colour. Custom properties\n inherit through the slot, so an impakt-heading or impakt-text there\n reads light without being told. */\n .phone-header {\n display: block;\n padding: calc(${space(4)} + env(safe-area-inset-top)) ${space(5)} ${space(10)};\n color: var(--impakt-shell-paper);\n --impakt-color-text-default: var(--impakt-shell-paper);\n --impakt-color-text-heading: var(--impakt-shell-paper);\n --impakt-color-text-muted: color-mix(in srgb, var(--impakt-shell-paper) 74%, var(--impakt-shell-ink));\n --impakt-color-link: var(--impakt-shell-paper);\n }\n main {\n position: relative;\n flex: 1;\n margin-block-start: calc(-1 * ${space(6)});\n /* Room for the floating tab bar, so the last of the content can scroll clear of it. */\n padding: ${space(4)} ${space(4)} calc(96px + env(safe-area-inset-bottom));\n border-radius: 28px 28px 0 0;\n background: ${token('color.surface.page', '#f2f5f4')};\n }\n .tab-bar {\n display: block;\n position: fixed;\n z-index: 10;\n inset-inline: ${space(4)};\n inset-block-end: calc(${space(3)} + env(safe-area-inset-bottom));\n }\n }\n `];\n\n private skip(event: Event): void {\n event.preventDefault();\n const main = this.renderRoot.querySelector('main');\n main?.focus();\n main?.scrollIntoView();\n }\n\n render(): TemplateResult {\n return html`\n <div class=\"frame\" part=\"frame\">\n <a class=\"skip\" href=\"#content\" part=\"skip\" @click=${this.skip}>${this.skipText}</a>\n <div class=\"brand\" part=\"brand\"><slot name=\"brand\"></slot></div>\n <div class=\"side\" part=\"side\"><slot name=\"nav\"></slot></div>\n <header aria-label=${this.topBarLabel || nothing} part=\"top-bar\">\n <div class=\"workspace\"><slot name=\"workspace\"></slot></div>\n <div class=\"search\"><slot name=\"search\"></slot></div>\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </header>\n <div class=\"phone-header\" part=\"phone-header\"><slot name=\"phone-header\"></slot></div>\n <main id=\"content\" tabindex=\"-1\" part=\"main\"><slot></slot></main>\n <div class=\"tab-bar\" part=\"tab-bar\"><slot name=\"tab-bar\"></slot></div>\n </div>\n `;\n }\n}\n\ncustomElements.define('impakt-side-nav', ImpaktSideNav);\ncustomElements.define('impakt-tab-bar', ImpaktTabBar);\ncustomElements.define('impakt-app-shell', ImpaktAppShell);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-side-nav': ImpaktSideNav;\n 'impakt-tab-bar': ImpaktTabBar;\n 'impakt-app-shell': ImpaktAppShell;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,SAAS,iBAAsC;AAiBnE,IAAM,QAAQ,UAAU,OAAO;AAG/B,SAAS,OAAO,MAA6B;AAC3C,MAAI,CAAC,QAAQ,KAAK,WAAW,GA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A;AAAA;AAAA;AAAA;AAAA,wCAU7C,MAAM,CAAC,CAAC;AAAA;AAAA,mBAE7B,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA,sBAEjB,MAAM,sBAAsB,SAAS,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAMpC,MAAM,CAAC,CAAC;AAAA,gCACA,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,GAGrC;AAAA;AAAA,EAEO,KAAK,OAAoB;AAC/B,UAAM,eAAe;AACrB,UAAM,OAAO,KAAK,WAAW,cAAc,MAAM;AACjD,UAAM,MAAM;AACZ,UAAM,eAAe;AAAA,EACvB;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA,6DAEkD,KAAK,IAAI,IAAI,KAAK,QAAQ;AAAA;AAAA;AAAA,6BAG1D,KAAK,eAAe,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUtD;AACF;AAEA,eAAe,OAAO,mBAAmB,aAAa;AACtD,eAAe,OAAO,kBAAkB,YAAY;AACpD,eAAe,OAAO,oBAAoB,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/checkbox-group.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement } from '../base/FieldElement';\nimport { targetSize } from '../base/styles';\nimport { fontSize, space, t } from '../base/tokens';\n\nexport interface CheckboxOption {\n value: string;\n label: string;\n description?: string;\n}\n\n/**\n * A choose-several group — the multi-select question type.\n *\n * Same shape as the radio group and for the same reasons: a `<fieldset>` with\n * a `<legend>`, because the question is asked of the set and `label for` names\n * one control.\n *\n * It differs from radios in one way that matters. Checkboxes have no roving\n * tabindex — every box is its own tab stop, which is correct, because each is\n * an independent yes or no rather than one choice among several. Nothing needs\n * to be implemented for that; it is what the platform does, and it is worth\n * knowing it is deliberate rather than missing.\n\n *\n * @category form\n * @icon checkbox\n */\nexport class ImpaktCheckboxGroup extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n options: { type: Array },\n values: { type: Array },\n };\n\n declare options: CheckboxOption[];\n declare values: string[];\n\n constructor() {\n super();\n this.options = [];\n this.values = [];\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n min-inline-size: 0;\n }\n legend {\n padding: 0;\n }\n .option {\n display: flex;\n align-items: flex-start;\n gap: ${space(3)};\n padding: ${space(3)};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radius};\n margin-block-end: ${space(2)};\n cursor: pointer;\n }\n .option:hover {\n background: ${t.surfaceSubtle};\n }\n .option input {\n ${targetSize}\n inline-size: 20px;\n block-size: 20px;\n margin: 0;\n flex: none;\n accent-color: ${t.brand};\n }\n .option-text {\n display: block;\n font-size: ${fontSize('md')};\n }\n .option-description {\n display: block;\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n margin-block-start: ${space(1)};\n }\n :host([invalid]) .option {\n border-color: ${t.danger};\n }\n `,\n ];\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </legend>`;\n }\n\n private onToggle(value: string, checked: boolean): void {\n this.values = checked ? [...this.values, value] : this.values.filter((v) => v !== value);\n // One form value, comma-joined — a multi-select arrives at a pricing API as\n // a list, and the order follows the options rather than the clicks.\n this.setFormValue(\n this.options.filter((o) => this.values.includes(o.value)).map((o) => o.value).join(','),\n );\n }\n\n protected renderControl(): TemplateResult {\n return html`\n ${this.options.map((option, i) => {\n const id = this.id_(`opt-${i}`);\n const descId = option.description ? this.id_(`opt-${i}-desc`) : undefined;\n return html`\n <label class=\"option\" part=\"option\" for=${id}>\n <input\n type=\"checkbox\"\n id=${id}\n value=${option.value}\n .checked=${this.values.includes(option.value)}\n ?disabled=${this.disabled}\n aria-describedby=${descId ?? nothing}\n @change=${(e: Event) => this.onToggle(option.value, (e.target as HTMLInputElement).checked)}\n />\n <span>\n <span class=\"option-text\">${option.label}</span>\n ${option.description\n ? html`<span class=\"option-description\" id=${descId!}>${option.description}</span>`\n : nothing}\n </span>\n </label>\n `;\n })}\n `;\n }\n\n render(): TemplateResult {\n return html`\n <fieldset part=\"fieldset\" aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}>\n ${this.renderLabel()}\n ${this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">${this.description}</div>`\n : nothing}\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">${this.error || nothing}</div>\n </fieldset>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-checkbox-group', ImpaktCheckboxGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impakt-checkbox-group': ImpaktCheckboxGroup }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA4BjD,IAAM,sBAAN,cAAkC,aAAa;AAAA,EACpD;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,SAAS,EAAE,MAAM,MAAM;AAAA,MACvB,QAAQ,EAAE,MAAM,MAAM;AAAA,IACxB;AAAA;AAAA,EAKA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU,CAAC;AAChB,SAAK,SAAS,CAAC;AAAA,EACjB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAaW,MAAM,CAAC,CAAC;AAAA,mBACJ,MAAM,CAAC,CAAC;AAAA,kBACT,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,MAAM;AAAA,4BACL,MAAM,CAAC,CAAC;AA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AA;AAAA;AAAA,0CAG/D,OAAO,KAAK;AAAA,gBACtC,OAAO,cACL,2CAA2C,MAAO,IAAI,OAAO,WAAW,YACxE,OAAO;AAAA;AAAA;AAAA;AAAA,IAInB,CAAC,CAAC;AAAA;AAAA,EAEN;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,mDACwC,KAAK,WAAW,iBAAiB,KAAK,QAAQ,SAAS,OAAO;AAAA,UACvG,KAAK,YAAY,CAAC;AAAA,UAClB,KAAK,cACH,mCAAmC,KAAK,IAAI,aAAa,CAAC,uBAAuB,KAAK,WAAW,WACjG,OAAO;AAAA,UACT,KAAK,cAAc,CAAC;AAAA,gCACE,KAAK,IAAI,OAAO,CAAC,oCAAoC,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAGxG;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,yBAAyB,mBAAmB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/fieldset.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { fontSize, fontWeight, lineHeight, space, t } from '../base/tokens';\n\n/**\n * Fields that belong together under one question: the lines of an address,\n * or a name in two parts.\n *\n * **The question is the group's name.** It is a `fieldset` with a `legend`, so\n * a screen reader says \"Your address, group\" on the way in, and each field\n * inside is heard as part of it (1.3.1, 3.3.2). An error for the group as a\n * whole, such as \"Enter a full address\", is tied to it the same way.\n *\n * @category form\n * @icon fieldset\n * @slot - The fields in the group.\n */\nexport class ImpaktFieldset extends ImpaktElement {\n static properties = {\n legend: { type: String },\n description: { type: String },\n error: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** The question the fields answer together. */\n declare legend: string;\n /** A hint for the whole group, under the question. */\n declare description: string;\n /** What is wrong with the group as a whole. */\n declare error: string;\n /** How large the question is. A page that asks only this question makes it the page's heading size. */\n declare size: 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.legend = '';\n this.description = '';\n this.error = '';\n this.size = 'md';\n }\n\n static styles = [...ImpaktElement.styles, css`\n :host { display: block; margin-block-end: ${space(6)}; }\n fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize('md')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; color: ${t.text}; }\n :host([size='lg']) legend { font-size: ${fontSize('xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n :host([size='xl']) legend { font-size: ${fontSize('2xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n .description { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; line-height: ${lineHeight('normal')}; }\n .error { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; }\n .error:empty { display: none; }\n :host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }\n `];\n\n render(): TemplateResult {\n const described = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean).join(' ');\n return html`<fieldset part=\"fieldset\" aria-describedby=${described || nothing}>\n <legend part=\"legend\">${this.legend}</legend>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n <div class=\"fields\" part=\"fields\"><slot></slot></div>\n </fieldset>`;\n }\n}\n\ncustomElements.define('impakt-fieldset', ImpaktFieldset);\ndeclare global { interface HTMLElementTagNameMap { 'impakt-fieldset': ImpaktFieldset } }\n"],"mappings":";;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAiBjD,IAAM,iBAAN,cAA6B,cAAc;AAAA,EACh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AAa,CAAC,IAAI,KAAK,WAAW,WAAW,OAAO;AAAA,8BAC7F,KAAK,IAAI,OAAO,CAAC,uBAAuB,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAGzF;AACF;AAEA,eAAe,OAAO,mBAAmB,cAAc;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/date-input.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { say } from '../base/say';\nimport { FieldElement } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/**\n * A date, as three fields.\n *\n * **Why not `<input type=\"date\">`.** The native control is excellent for\n * picking a date near today — an appointment, a start date — and poor for a\n * date of birth, which is the date this product asks for most. Its picker\n * opens on the current month and makes a user born in 1958 navigate eight\n * hundred steps back, its text entry expects a locale-specific format the\n * field does not state, and its rendering differs enough between browsers that\n * no single hint is correct everywhere.\n *\n * Three fields is the pattern government services converged on after testing\n * it on exactly this problem. Each part is typed directly, in any order, with\n * no picker to fight.\n *\n * **The accessibility shape.** A `<fieldset>` and `<legend>` ask the question\n * once; each part has its own visible label, so \"Month\" is announced rather\n * than \"second field\"; `inputmode=\"numeric\"` brings up a number pad without\n * `type=\"number\"`, which on a date part gives spinners, scroll-wheel surprises\n * and silent stripping of a leading zero. The parts carry `autocomplete`\n * tokens so autofill still works, which is 1.3.5.\n\n *\n * @category form\n * @icon calendar\n */\nexport class ImpaktDateInput extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n day: { type: String },\n month: { type: String },\n year: { type: String },\n autocompleteSection: { type: String, attribute: 'autocomplete-section' },\n };\n\n declare day: string;\n declare month: string;\n declare year: string;\n /** \"bday\" fills a date of birth. Empty disables autofill for this field. */\n declare autocompleteSection: string;\n\n constructor() {\n super();\n this.day = '';\n this.month = '';\n this.year = '';\n this.autocompleteSection = 'bday';\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset {\n border: 0;\n margin: 0;\n padding: 0;\n min-inline-size: 0;\n }\n legend {\n padding: 0;\n }\n .parts {\n display: flex;\n gap: ${space(3)};\n }\n .part {\n display: flex;\n flex-direction: column;\n gap: ${space(1)};\n }\n .part label {\n font-size: ${fontSize('sm')};\n color: ${t.textMuted};\n }\n input {\n min-block-size: 44px;\n padding: ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: ${t.surfaceCard};\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radius};\n /* Room for the digits plus the padding and border, so the box is never narrower than a finger. */\n inline-size: calc(3ch + ${space(6)} + 2px);\n }\n .year input {\n inline-size: calc(5ch + ${space(6)} + 2px);\n }\n :host([invalid]) input {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </legend>`;\n }\n\n private datePart(\n name: 'day' | 'month' | 'year',\n label: string,\n length: number,\n autocomplete: string,\n ): TemplateResult {\n const id = this.id_(name);\n return html`\n <div class=\"part ${name}\">\n <label for=${id}>${label}</label>\n <input\n id=${id}\n type=\"text\"\n inputmode=\"numeric\"\n maxlength=${length}\n .value=${this[name]}\n autocomplete=${this.autocompleteSection ? `${this.autocompleteSection}-${autocomplete}` : nothing}\n ?disabled=${this.disabled}\n @input=${(e: Event) => {\n this[name] = (e.target as HTMLInputElement).value;\n this.emit();\n }}\n />\n </div>\n `;\n }\n\n /** ISO, or empty while incomplete. Partial dates are not half-valid. */\n private emit(): void {\n const complete = this.day && this.month && this.year.length === 4;\n const iso = complete\n ? `${this.year}-${this.month.padStart(2, '0')}-${this.day.padStart(2, '0')}`\n : '';\n this.setFormValue(iso);\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <div class=\"parts\" part=\"parts\">\n ${this.datePart('day', say('Day'), 2, 'day')}\n ${this.datePart('month', say('Month'), 2, 'month')}\n ${this.datePart('year', say('Year'), 4, 'year')}\n </div>\n `;\n }\n\n render(): TemplateResult {\n return html`\n <fieldset part=\"fieldset\" aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}>\n ${this.renderLabel()}\n ${this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">${this.description}</div>`\n : nothing}\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">${this.error || nothing}</div>\n </fieldset>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-date-input', ImpaktDateInput);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impakt-date-input': ImpaktDateInput }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA+BjD,IAAM,kBAAN,cAA8B,aAAa;AAAA,EAChD;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,KAAK,EAAE,MAAM,OAAO;AAAA,MACpB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,qBAAqB,EAAE,MAAM,QAAQ,WAAW,uBAAuB;AAAA,IACzE;AAAA;AAAA,EAQA,cAAc;AACZ,UAAM;AACN,SAAK,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,sBAAsB;AAAA,EAC7B;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAYW,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,eAKR,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA,qBAGF,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA,mBAIT,MAAM,CAAC,CAAC;AAAA;A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,GAAG,KAAK,CAAC;AAAA,UAC1C,KAAK,SAAS,SAAS,IAAI,OAAO,GAAG,GAAG,OAAO,CAAC;AAAA,UAChD,KAAK,SAAS,QAAQ,IAAI,MAAM,GAAG,GAAG,MAAM,CAAC;AAAA;AAAA;AAAA,EAGrD;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,mDACwC,KAAK,WAAW,iBAAiB,KAAK,QAAQ,SAAS,OAAO;AAAA,UACvG,KAAK,YAAY,CAAC;AAAA,UAClB,KAAK,cACH,mCAAmC,KAAK,IAAI,aAAa,CAAC,uBAAuB,KAAK,WAAW,WACjG,OAAO;AAAA,UACT,KAAK,cAAc,CAAC;AAAA,gCACE,KAAK,IAAI,OAAO,CAAC,oCAAoC,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAGxG;AAAA,EAEA,QAAQ,SAAqC;AAC3C,QAAI,QAAQ,IAAI,OAAO,EAAG,MAAK,gBAAgB,WAAW,QAAQ,KAAK,KAAK,CAAC;AAAA,EAC/E;AACF;AAEA,eAAe,OAAO,qBAAqB,eAAe;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/navigation.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/** One link in a navigation or a trail. */\nexport interface NavLink {\n label: string;\n href: string;\n}\n\n/** Whether a link is the page the visitor is on, or a page above it. */\nfunction where(href: string): 'page' | 'section' | null {\n // A link to a place on this page, or to nowhere yet (\"#\"), is not where the reader is.\n if (typeof location === 'undefined' || !href || href.startsWith('#')) return null;\n let path: string;\n try { path = new URL(href, location.href).pathname.replace(/\\/$/, '') || '/'; } catch { return null; }\n const here = location.pathname.replace(/\\/$/, '') || '/';\n if (path === here) return 'page';\n return path !== '/' && here.startsWith(`${path}/`) ? 'section' : null;\n}\n\n/**\n * The site's main navigation: a row of links that folds into a Menu button\n * when there is not room for all of them, whatever the screen.\n *\n * **The page you are on is marked in words as well as colour.** Its link\n * carries `aria-current=\"page\"`, which a screen reader announces, and an\n * underline, so it does not rely on colour alone (1.4.1).\n *\n * **The menu is a disclosure, not a pop-up.** The Menu button says whether the\n * list is open (`aria-expanded`), the links follow it in the reading order, and\n * Escape closes it and returns focus to the button.\n *\n * @category action\n * @icon menu\n */\nexport class ImpaktNav extends ImpaktElement {\n static properties = {\n links: { type: Array },\n label: { type: String },\n menuText: { type: String, attribute: 'menu-text' },\n menuLook: { type: String, reflect: true, attribute: 'menu-look' },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n };\n /** The links, in order. */\n declare links: NavLink[];\n /** What the navigation is called for a screen reader, such as \"Main\". */\n declare label: string;\n /** The words on the button that opens the links on a narrow screen. */\n declare menuText: string;\n /**\n * The Menu button: `button` with its words, or `icon`, a round button with\n * only the icon, the words kept as its name for screen readers.\n */\n declare menuLook: 'button' | 'icon';\n /** `sm` sets the links a step smaller and closer, as a site header's are. */\n declare size: 'md' | 'sm';\n /** Where the links sit along the row. */\n declare align: 'start' | 'center' | 'end';\n /** Whether the menu is open on a narrow screen. Not a setting: it is the visitor's. */\n private menuOpen = false;\n private get open(): boolean { return this.menuOpen; }\n private set open(next: boolean) { this.menuOpen = next; this.requestUpdate(); }\n\n constructor() {\n super();\n this.links = [];\n this.label = 'Main';\n this.menuText = 'Menu';\n this.menuLook = 'button';\n this.size = 'md';\n this.align = 'end';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n /* It grows to fill a row it sits in, because it measures itself to decide when to fold. */\n :host { display: block; flex: 1 1 8rem; min-inline-size: 0; }\n nav { display: flex; flex-direction: column; position: relative; }\n li { flex: none; }\n ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${space(1)} ${space(6)}; align-items: center; justify-content: flex-end; }\n :host([align='start']) ul { justify-content: flex-start; }\n :host([align='center']) ul { justify-content: center; }\n a { ${targetSize} display: inline-flex; align-items: center; padding: ${space(2)} ${space(1)}; color: inherit; font-weight: ${fontWeight('semibold')}; text-decoration: none; border-radius: ${t.radiusSm}; }\n a:hover { text-decoration: underline; text-underline-offset: 0.25em; }\n a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }\n .toggle { display: none; ${targetSize} align-items: center; gap: ${space(2)}; align-self: flex-end; padding: ${space(2)} ${space(3)}; font: inherit; font-weight: ${fontWeight('semibold')}; color: inherit; background: transparent; border: ${t.borderThin} solid currentColor; border-radius: ${t.radius}; cursor: pointer; }\n /* When they do not fit, the links fold behind a Menu button and open as a panel under it. */\n :host([folded]) { flex: 0 0 auto; }\n :host([folded]) .toggle { display: inline-flex; }\n :host([menu-look='icon']) .toggle { inline-size: 44px; block-size: 44px; padding: 0; justify-content: center; border: 0; border-radius: 50%; background: ${t.brand}; color: ${t.onBrand}; }\n :host([menu-look='icon']) .toggle .words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n :host([size='sm']) ul { column-gap: ${space(6)}; }\n :host([size='sm']) a { padding-inline: 0; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('medium')}; }\n :host([size='sm'][folded]) a { padding-inline: ${space(3)}; }\n :host([folded]) ul { display: none; position: absolute; inset-block-start: calc(100% + ${space(2)}); inset-inline-end: 0; z-index: 30; flex-direction: column; align-items: stretch; gap: 0; min-inline-size: 14rem; padding: ${space(2)}; background: ${t.surfaceCard}; color: ${t.text}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; box-shadow: 0 8px 24px rgb(0 0 0 / 14%); }\n :host([folded]) ul.open { display: flex; }\n :host([folded]) li { text-align: start; }\n :host([folded]) a { display: flex; padding: ${space(3)} ${space(3)}; }\n `];\n\n /** The width the links need in one row. Measured once for each set of links, and again while folded it cannot be read. */\n private needs = 0;\n private resize?: ResizeObserver;\n\n private fit(): void {\n const room = this.getBoundingClientRect().width;\n if (room <= 0) return;\n if (!this.needs) {\n this.removeAttribute('folded');\n const items = Array.from(this.renderRoot.querySelectorAll('li'));\n const gap = Number.parseFloat(getComputedStyle(this.renderRoot.querySelector('ul')!).columnGap) || 0;\n this.needs = items.reduce((total, item) => total + item.getBoundingClientRect().width, 0) + gap * Math.max(0, items.length - 1);\n }\n const fold = this.needs > room;\n this.toggleAttribute('folded', fold);\n if (!fold && this.menuOpen) this.open = false;\n }\n\n protected updated(changed: Map<string, unknown>): void {\n if (changed.has('links')) { this.needs = 0; this.fit(); }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n if (typeof ResizeObserver === 'function') {\n this.resize = new ResizeObserver(() => this.fit());\n this.resize.observe(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.resize?.disconnect();\n }\n\n private toggle(): void {\n this.open = !this.open;\n }\n\n private onKey(event: KeyboardEvent): void {\n if (event.key !== 'Escape' || !this.open) return;\n this.open = false;\n this.renderRoot.querySelector<HTMLButtonElement>('.toggle')?.focus();\n }\n\n render(): TemplateResult {\n const list = this.id_('links');\n return html`<nav aria-label=${this.label || nothing} part=\"nav\" @keydown=${this.onKey}>\n <button class=\"toggle\" type=\"button\" aria-expanded=${this.open ? 'true' : 'false'} aria-controls=${list} @click=${this.toggle}>${iconSvg(this.open ? 'close' : this.menuLook === 'icon' ? 'menu-two' : 'menu')}<span class=\"words\">${this.menuText}</span></button>\n <ul id=${list} class=${this.open ? 'open' : ''} part=\"list\">\n ${(this.links ?? []).map((link) => {\n const current = where(link.href);\n return html`<li><a href=${link.href} aria-current=${current === 'page' ? 'page' : current === 'section' ? 'true' : nothing} part=\"link\">${link.label}</a></li>`;\n })}\n </ul>\n </nav>`;\n }\n}\n\n/**\n * Where the page sits in the site, as a trail of links back to the top: Home,\n * then Developments, then this page.\n *\n * The last item is the page itself. It is not a link, and it carries\n * `aria-current=\"page\"`. The separators are drawn, not written, so a screen\n * reader reads the trail as a list rather than a string of slashes.\n *\n * @category action\n * @icon breadcrumbs\n */\nexport class ImpaktBreadcrumbs extends ImpaktElement {\n static properties = {\n items: { type: Array },\n label: { type: String },\n };\n /** The trail, from the top of the site down to this page. */\n declare items: NavLink[];\n /** What the trail is called for a screen reader. */\n declare label: string;\n\n constructor() {\n super();\n this.items = [];\n this.label = 'Breadcrumb';\n }\n\n static styles = [...ImpaktElement.styles, focusRing, css`\n :host { display: block; font-size: ${fontSize('sm')}; }\n ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: ${space(1)}; }\n li { display: inline-flex; align-items: center; gap: ${space(1)}; }\n li + li::before { content: ''; inline-size: 0.45em; block-size: 0.45em; border-block-start: 1.5px solid ${t.textMuted}; border-inline-end: 1.5px solid ${t.textMuted}; transform: rotate(45deg); margin-inline: ${space(1)} ${space(2)}; }\n a { color: ${t.link}; text-decoration: underline; text-underline-offset: 0.2em; border-radius: ${t.radiusSm}; }\n a:hover { color: ${t.linkHover}; }\n [aria-current] { color: ${t.textMuted}; }\n .sr-only { ${visuallyHidden} }\n `];\n\n render(): TemplateResult {\n const items = this.items ?? [];\n return html`<nav aria-label=${this.label} part=\"nav\"><ol>\n ${items.map((item, i) => html`<li>${i === items.length - 1\n ? html`<span aria-current=\"page\">${item.label}</span>`\n : html`<a href=${item.href} part=\"link\">${item.label}</a>`}</li>`)}\n </ol></nav>`;\n }\n}\n\ncustomElements.define('impakt-nav', ImpaktNav);\ncustomElements.define('impakt-breadcrumbs', ImpaktBreadcrumbs);\ndeclare global { interface HTMLElementTagNameMap { 'impakt-nav': ImpaktNav; 'impakt-breadcrumbs': ImpaktBreadcrumbs } }\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAaxD,SAAS,MAAM,MAAyC;AAEtD,MAAI,OAAO,aAAa,eAAe,CAAC,QAAQ,KAAK,WAAW,GAAG,EAAG,QAAO;AAC7E,MAAI;AACJ,MAAI;AAAE,WAAO,IAAI,IAAI,M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