@atomic-ui/ui 0.10.1 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/custom-elements.json +9631 -6026
  2. package/dist/base/FieldElement.d.ts +10 -3
  3. package/dist/{chunk-YWP2Z3JN.js → chunk-2TNF7O43.js} +7 -5
  4. package/dist/{chunk-YWP2Z3JN.js.map → chunk-2TNF7O43.js.map} +1 -1
  5. package/dist/{chunk-FKUBEVCU.js → chunk-2WHOBIOY.js} +11 -9
  6. package/dist/{chunk-FKUBEVCU.js.map → chunk-2WHOBIOY.js.map} +1 -1
  7. package/dist/{chunk-26BO3W56.js → chunk-3BWCD5U5.js} +5 -3
  8. package/dist/{chunk-26BO3W56.js.map → chunk-3BWCD5U5.js.map} +1 -1
  9. package/dist/chunk-3GPGDERO.js +201 -0
  10. package/dist/chunk-3GPGDERO.js.map +1 -0
  11. package/dist/{chunk-3T7J66Z2.js → chunk-3KAFK24X.js} +13 -11
  12. package/dist/chunk-3KAFK24X.js.map +1 -0
  13. package/dist/chunk-4MMRBNW7.js +104 -0
  14. package/dist/chunk-4MMRBNW7.js.map +1 -0
  15. package/dist/{chunk-5OJAJA3U.js → chunk-5HCWL2YD.js} +6 -4
  16. package/dist/{chunk-5OJAJA3U.js.map → chunk-5HCWL2YD.js.map} +1 -1
  17. package/dist/{chunk-AG4EP3OY.js → chunk-5IGBH4GL.js} +8 -6
  18. package/dist/{chunk-AG4EP3OY.js.map → chunk-5IGBH4GL.js.map} +1 -1
  19. package/dist/{chunk-AL4IUSML.js → chunk-5OYQZWP2.js} +5 -3
  20. package/dist/{chunk-AL4IUSML.js.map → chunk-5OYQZWP2.js.map} +1 -1
  21. package/dist/chunk-5PRB7P7N.js +167 -0
  22. package/dist/chunk-5PRB7P7N.js.map +1 -0
  23. package/dist/chunk-6CDQSHVW.js +21 -0
  24. package/dist/chunk-6CDQSHVW.js.map +1 -0
  25. package/dist/{chunk-MLKNZL5J.js → chunk-6J22I7F6.js} +14 -12
  26. package/dist/chunk-6J22I7F6.js.map +1 -0
  27. package/dist/chunk-72WNCCDC.js +136 -0
  28. package/dist/chunk-72WNCCDC.js.map +1 -0
  29. package/dist/chunk-7UI3OBXL.js +104 -0
  30. package/dist/chunk-7UI3OBXL.js.map +1 -0
  31. package/dist/{chunk-D6NET2VB.js → chunk-ALFE35FS.js} +30 -3
  32. package/dist/chunk-ALFE35FS.js.map +1 -0
  33. package/dist/chunk-AYINRYNC.js +184 -0
  34. package/dist/chunk-AYINRYNC.js.map +1 -0
  35. package/dist/{chunk-2D2IMQII.js → chunk-BAYSDP44.js} +52 -30
  36. package/dist/chunk-BAYSDP44.js.map +1 -0
  37. package/dist/{chunk-2EP3IV3G.js → chunk-BGHAANTP.js} +22 -8
  38. package/dist/chunk-BGHAANTP.js.map +1 -0
  39. package/dist/{chunk-OJO62KRX.js → chunk-CFCFKLTN.js} +85 -10
  40. package/dist/chunk-CFCFKLTN.js.map +1 -0
  41. package/dist/{chunk-UFPI4I2Y.js → chunk-CQT3VPYK.js} +8 -29
  42. package/dist/chunk-CQT3VPYK.js.map +1 -0
  43. package/dist/{chunk-AURT72IC.js → chunk-DXLEYNID.js} +13 -7
  44. package/dist/chunk-DXLEYNID.js.map +1 -0
  45. package/dist/{chunk-L4CIBOGK.js → chunk-EKPTMRBG.js} +5 -3
  46. package/dist/{chunk-L4CIBOGK.js.map → chunk-EKPTMRBG.js.map} +1 -1
  47. package/dist/{chunk-Z2EWQMTR.js → chunk-F4IXELLK.js} +5 -3
  48. package/dist/{chunk-Z2EWQMTR.js.map → chunk-F4IXELLK.js.map} +1 -1
  49. package/dist/{chunk-APQEXM4I.js → chunk-FJHPGOGS.js} +5 -3
  50. package/dist/{chunk-APQEXM4I.js.map → chunk-FJHPGOGS.js.map} +1 -1
  51. package/dist/chunk-FLAUZU7Y.js +345 -0
  52. package/dist/chunk-FLAUZU7Y.js.map +1 -0
  53. package/dist/{chunk-3NEWOO2P.js → chunk-FZWUQC42.js} +7 -5
  54. package/dist/{chunk-3NEWOO2P.js.map → chunk-FZWUQC42.js.map} +1 -1
  55. package/dist/{chunk-ONED3PUB.js → chunk-HSXLSJVG.js} +54 -8
  56. package/dist/chunk-HSXLSJVG.js.map +1 -0
  57. package/dist/{chunk-V7EB7Q2M.js → chunk-JTCTQBAX.js} +2 -131
  58. package/dist/chunk-JTCTQBAX.js.map +1 -0
  59. package/dist/{chunk-ZL3JFUIE.js → chunk-K5QFVLCI.js} +7 -5
  60. package/dist/{chunk-ZL3JFUIE.js.map → chunk-K5QFVLCI.js.map} +1 -1
  61. package/dist/{chunk-DN5YZFSG.js → chunk-KE6WCXQP.js} +55 -9
  62. package/dist/chunk-KE6WCXQP.js.map +1 -0
  63. package/dist/chunk-LBHTXY7K.js +75 -0
  64. package/dist/chunk-LBHTXY7K.js.map +1 -0
  65. package/dist/{chunk-OZGKK3N5.js → chunk-LP4RTYTL.js} +88 -9
  66. package/dist/chunk-LP4RTYTL.js.map +1 -0
  67. package/dist/{chunk-MOO63SHZ.js → chunk-LXVPWTSY.js} +80 -23
  68. package/dist/chunk-LXVPWTSY.js.map +1 -0
  69. package/dist/{chunk-JNLKM3JT.js → chunk-N6EEW2GF.js} +6 -4
  70. package/dist/{chunk-JNLKM3JT.js.map → chunk-N6EEW2GF.js.map} +1 -1
  71. package/dist/chunk-NHEU5FT6.js +115 -0
  72. package/dist/chunk-NHEU5FT6.js.map +1 -0
  73. package/dist/chunk-QPOM7W3D.js +104 -0
  74. package/dist/chunk-QPOM7W3D.js.map +1 -0
  75. package/dist/{chunk-FU3CEHBS.js → chunk-R6PBY3YN.js} +6 -4
  76. package/dist/{chunk-FU3CEHBS.js.map → chunk-R6PBY3YN.js.map} +1 -1
  77. package/dist/{chunk-TJOYBDKS.js → chunk-R6YMSJR7.js} +65 -36
  78. package/dist/chunk-R6YMSJR7.js.map +1 -0
  79. package/dist/{chunk-ZEIV5X3U.js → chunk-SOYKSPPX.js} +73 -23
  80. package/dist/chunk-SOYKSPPX.js.map +1 -0
  81. package/dist/{chunk-NKMJMVZP.js → chunk-T52CUOCJ.js} +5 -3
  82. package/dist/{chunk-NKMJMVZP.js.map → chunk-T52CUOCJ.js.map} +1 -1
  83. package/dist/chunk-UBNCJROR.js +294 -0
  84. package/dist/chunk-UBNCJROR.js.map +1 -0
  85. package/dist/chunk-UFENSIWD.js +135 -0
  86. package/dist/chunk-UFENSIWD.js.map +1 -0
  87. package/dist/{chunk-A4M3A4SZ.js → chunk-UYTIJCCW.js} +10 -42
  88. package/dist/chunk-UYTIJCCW.js.map +1 -0
  89. package/dist/chunk-XX6JZW5N.js +36 -0
  90. package/dist/chunk-XX6JZW5N.js.map +1 -0
  91. package/dist/{chunk-2ZF3J7OO.js → chunk-XXSZL5CY.js} +17 -5
  92. package/dist/chunk-XXSZL5CY.js.map +1 -0
  93. package/dist/{chunk-6PMA6NHE.js → chunk-Y55FNQHS.js} +5 -3
  94. package/dist/{chunk-6PMA6NHE.js.map → chunk-Y55FNQHS.js.map} +1 -1
  95. package/dist/chunk-ZAWGJC4I.js +176 -0
  96. package/dist/chunk-ZAWGJC4I.js.map +1 -0
  97. package/dist/chunk-ZUQ3DOG2.js +110 -0
  98. package/dist/chunk-ZUQ3DOG2.js.map +1 -0
  99. package/dist/components/accordion.d.ts +22 -0
  100. package/dist/components/accordion.js +6 -2
  101. package/dist/components/alert.d.ts +22 -1
  102. package/dist/components/alert.js +3 -2
  103. package/dist/components/app-bar.d.ts +153 -0
  104. package/dist/components/app-bar.js +15 -0
  105. package/dist/components/app-bar.js.map +1 -0
  106. package/dist/components/app-ui.d.ts +29 -2
  107. package/dist/components/app-ui.js +5 -4
  108. package/dist/components/badge.d.ts +17 -1
  109. package/dist/components/badge.js +4 -3
  110. package/dist/components/blocks.js +5 -4
  111. package/dist/components/button.d.ts +18 -2
  112. package/dist/components/button.js +4 -3
  113. package/dist/components/checkbox-group.js +4 -3
  114. package/dist/components/checkbox.js +4 -3
  115. package/dist/components/checked.d.ts +77 -0
  116. package/dist/components/checked.js +10 -0
  117. package/dist/components/checked.js.map +1 -0
  118. package/dist/components/chip-group.d.ts +113 -0
  119. package/dist/components/chip-group.js +11 -0
  120. package/dist/components/chip-group.js.map +1 -0
  121. package/dist/components/chip.d.ts +11 -0
  122. package/dist/components/chip.js +3 -2
  123. package/dist/components/code-diff.d.ts +77 -0
  124. package/dist/components/code-diff.js +10 -0
  125. package/dist/components/code-diff.js.map +1 -0
  126. package/dist/components/date-input.js +4 -3
  127. package/dist/components/dialog.d.ts +15 -0
  128. package/dist/components/dialog.js +3 -2
  129. package/dist/components/fieldset.js +3 -2
  130. package/dist/components/grid.js +3 -2
  131. package/dist/components/help.js +3 -2
  132. package/dist/components/icon.js +3 -2
  133. package/dist/components/journey.js +4 -3
  134. package/dist/components/language-switch.d.ts +59 -0
  135. package/dist/components/language-switch.js +10 -0
  136. package/dist/components/language-switch.js.map +1 -0
  137. package/dist/components/layout.d.ts +8 -2
  138. package/dist/components/layout.js +3 -2
  139. package/dist/components/link.js +4 -3
  140. package/dist/components/list.js +3 -2
  141. package/dist/components/media.js +3 -2
  142. package/dist/components/meter.d.ts +112 -0
  143. package/dist/components/meter.js +13 -0
  144. package/dist/components/meter.js.map +1 -0
  145. package/dist/components/navigation.d.ts +52 -0
  146. package/dist/components/navigation.js +4 -3
  147. package/dist/components/page.d.ts +13 -8
  148. package/dist/components/page.js +3 -2
  149. package/dist/components/price.js +3 -2
  150. package/dist/components/progress.d.ts +16 -2
  151. package/dist/components/progress.js +3 -2
  152. package/dist/components/radio-group.js +4 -3
  153. package/dist/components/redaction.d.ts +51 -0
  154. package/dist/components/redaction.js +10 -0
  155. package/dist/components/redaction.js.map +1 -0
  156. package/dist/components/rows.d.ts +28 -0
  157. package/dist/components/rows.js +7 -3
  158. package/dist/components/select.d.ts +6 -0
  159. package/dist/components/select.js +4 -3
  160. package/dist/components/shell.js +4 -3
  161. package/dist/components/source.d.ts +68 -0
  162. package/dist/components/source.js +10 -0
  163. package/dist/components/source.js.map +1 -0
  164. package/dist/components/status-pill-style.d.ts +16 -0
  165. package/dist/components/status-pill-style.js +15 -0
  166. package/dist/components/status-pill-style.js.map +1 -0
  167. package/dist/components/status.d.ts +66 -0
  168. package/dist/components/status.js +10 -0
  169. package/dist/components/status.js.map +1 -0
  170. package/dist/components/summary-list.js +3 -2
  171. package/dist/components/switch.js +4 -3
  172. package/dist/components/table.d.ts +19 -0
  173. package/dist/components/table.js +4 -3
  174. package/dist/components/text-input.js +5 -4
  175. package/dist/components/textarea.d.ts +5 -0
  176. package/dist/components/textarea.js +4 -3
  177. package/dist/components/tool-card.d.ts +107 -0
  178. package/dist/components/tool-card.js +11 -0
  179. package/dist/components/tool-card.js.map +1 -0
  180. package/dist/components/tool-kit-tokens.d.ts +25 -0
  181. package/dist/components/tool-kit-tokens.js +8 -0
  182. package/dist/components/tool-kit-tokens.js.map +1 -0
  183. package/dist/index.d.ts +11 -0
  184. package/dist/index.js +116 -70
  185. package/dist/standalone/atomic-ui.js +2030 -692
  186. package/dist/standalone/atomic-ui.js.map +4 -4
  187. package/package.json +2 -2
  188. package/dist/chunk-2D2IMQII.js.map +0 -1
  189. package/dist/chunk-2EP3IV3G.js.map +0 -1
  190. package/dist/chunk-2ZF3J7OO.js.map +0 -1
  191. package/dist/chunk-3T7J66Z2.js.map +0 -1
  192. package/dist/chunk-7UWJXPR3.js +0 -97
  193. package/dist/chunk-7UWJXPR3.js.map +0 -1
  194. package/dist/chunk-A4M3A4SZ.js.map +0 -1
  195. package/dist/chunk-AURT72IC.js.map +0 -1
  196. package/dist/chunk-AYKYHZGQ.js +0 -108
  197. package/dist/chunk-AYKYHZGQ.js.map +0 -1
  198. package/dist/chunk-D6NET2VB.js.map +0 -1
  199. package/dist/chunk-DN5YZFSG.js.map +0 -1
  200. package/dist/chunk-MLKNZL5J.js.map +0 -1
  201. package/dist/chunk-MOO63SHZ.js.map +0 -1
  202. package/dist/chunk-OJO62KRX.js.map +0 -1
  203. package/dist/chunk-ONED3PUB.js.map +0 -1
  204. package/dist/chunk-OZGKK3N5.js.map +0 -1
  205. package/dist/chunk-QU3U2CS2.js +0 -144
  206. package/dist/chunk-QU3U2CS2.js.map +0 -1
  207. package/dist/chunk-TJOYBDKS.js.map +0 -1
  208. package/dist/chunk-UFPI4I2Y.js.map +0 -1
  209. package/dist/chunk-V7EB7Q2M.js.map +0 -1
  210. package/dist/chunk-ZEIV5X3U.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/blocks.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget, visuallyHidden } from '../base/styles';\nimport { fontWeight, lineHeight, space, t } from '../base/tokens';\nimport { announceNavigate } from './shell';\n\n/**\n * A line between two parts of a page.\n *\n * It is decoration, so a screen reader passes over it. Where the change of\n * subject matters, a heading says so better.\n *\n * @category layout\n * @icon divider\n */\nexport class ImpaktDivider extends ImpaktElement {\n static properties = {\n spacing: { type: String, reflect: true },\n tone: { type: String, reflect: true },\n };\n /** Space above and below the line. */\n declare spacing: 'sm' | 'md' | 'lg' | 'xl';\n declare tone: 'subtle' | 'strong';\n\n constructor() {\n super();\n this.spacing = 'md';\n this.tone = 'subtle';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n hr { margin: ${space(4)} 0; border: 0; border-block-start: ${t.borderThin} solid ${t.border}; opacity: 0.5; }\n :host([tone='strong']) hr { opacity: 1; border-block-start-width: ${t.borderThick}; }\n :host([spacing='sm']) hr { margin-block: ${space(2)}; }\n :host([spacing='lg']) hr { margin-block: ${space(8)}; }\n :host([spacing='xl']) hr { margin-block: ${space(12)}; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<hr aria-hidden=\"true\" part=\"line\" />`;\n }\n}\n\n/**\n * Empty space, from the spacing scale, for the rare place where the gaps of the\n * containers around it are not enough.\n *\n * @category layout\n * @icon spacer\n */\nexport class ImpaktSpacer extends ImpaktElement {\n static properties = { size: { type: String, reflect: true } };\n declare size: 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.size = 'md';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; block-size: ${space(4)}; }\n :host([size='sm']) { block-size: ${space(2)}; }\n :host([size='lg']) { block-size: ${space(8)}; }\n :host([size='xl']) { block-size: ${space(12)}; }\n :host([size='2xl']) { block-size: ${space(16)}; }\n `,\n ];\n\n render(): TemplateResult {\n return html``;\n }\n}\n\n/**\n * Words a screen reader says that are not shown: \"(opens a map)\" after a link\n * whose purpose is clear on screen from where it sits.\n *\n * @category typography\n * @icon hidden\n * @slot - The words to say.\n */\nexport class ImpaktVisuallyHidden extends ImpaktElement {\n static styles = [...ImpaktElement.styles, css`:host { ${visuallyHidden} }`];\n render(): TemplateResult {\n return html`<slot></slot>`;\n }\n}\n\n/** One tab and what it shows. */\nexport interface TabItem {\n id: string;\n label: string;\n /** The panel's words. A child with `slot` set to the tab's id is shown instead, for anything richer. */\n body?: string;\n /** A number shown on the tab, such as the open tasks behind it. */\n count?: number;\n /** The count in words for a screen reader, such as \"2 overdue tasks\". The number alone when empty. */\n countLabel?: string;\n /** Where the tab goes. When every tab has one, the tabs are links to pages, not panels. */\n href?: string;\n}\n\n/**\n * Panels of content behind a row of tabs, one shown at a time: the floor plans\n * of three house types, or a case's summary, tasks and files.\n *\n * It follows the ARIA tabs pattern. The tabs are one stop in the tab order,\n * the arrow keys, Home and End move between them, and each panel is labelled\n * by its tab. Use an accordion instead when someone may want to compare panels.\n *\n * **The tabs stay on one row** and scroll sideways when they do not fit, as the\n * design guide sets, and the chosen tab is scrolled into view, so on a phone it\n * is never hidden off the edge. With `two-rows`, a set of more than four tabs is\n * laid out in two rows on a narrow screen instead, so every tab can be seen.\n *\n * **The chosen tab is kept** when the tabs are given again, as a React or Vue app\n * does on every render, so long as a tab with that id is still there.\n *\n * A panel shows its item's `body`, or a child whose `slot` is the item's id.\n *\n * **Tabs that go to pages are links.** When every item has an `href`, such as\n * a job's Overview, Money and Notes, each of which has its own address, the\n * tabs are drawn the same but are a `nav` of links, the current one marked\n * `aria-current=\"page\"`, with no panels. A row of links is not the ARIA tabs\n * pattern, and announcing it as one would promise arrow keys and panels that\n * are not there. They send `impakt-navigate` like the side navigation, so an\n * app can route without a reload.\n *\n * `look=\"pill\"` draws the tabs as pills in a rounded bar, with the chosen one\n * filled, as a product's workspace tabs are.\n *\n * @category content\n * @icon tabs\n * @slot - A child with `slot` set to a tab's id is that tab's panel.\n * @fires {CustomEvent<{ value: string }>} impakt-change - When another tab is chosen.\n * @fires {CustomEvent<{ href: string; id: string }>} impakt-navigate - When a tab that is a link is followed. Cancel it to route in the app.\n */\nexport class ImpaktTabs extends ImpaktElement {\n static properties = {\n items: { type: Array },\n selected: { type: String, reflect: true },\n label: { type: String },\n twoRows: { type: Boolean, reflect: true, attribute: 'two-rows' },\n look: { type: String, reflect: true },\n };\n declare items: TabItem[];\n /** The id of the tab shown first. The first tab when it is empty. */\n declare selected: string;\n /** What the set of tabs is about, for a screen reader. */\n declare label: string;\n /** On a narrow screen, lay more than four tabs out in two rows rather than scroll them. */\n declare twoRows: boolean;\n /** `line` underlines the chosen tab; `pill` fills it, in a rounded bar. */\n declare look: 'line' | 'pill';\n\n constructor() {\n super();\n this.items = [];\n this.selected = '';\n this.label = '';\n this.twoRows = false;\n this.look = 'line';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget(\"[role='tab']\"),\n css`\n /* Only the two-row layout needs a size container. Making every tab set one\n would take its width from its parent alone, so in a flex row, with no\n width given, it would shrink to nothing. In a row it may still shrink\n below its tabs, which then scroll, rather than widen the page. */\n :host { display: block; min-inline-size: 0; }\n :host([two-rows]) { container-type: inline-size; }\n [role='tablist'] { display: flex; gap: ${space(1)}; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-block-end: ${t.borderThin} solid ${t.border}; }\n [role='tab'] { ${targetSize} position: relative; flex: none; padding: ${space(3)} ${space(4)}; font: inherit; font-weight: ${fontWeight('semibold')}; white-space: nowrap; color: ${t.textMuted}; background: transparent; border: 0; border-block-end: 3px solid transparent; margin-block-end: -1px; cursor: pointer; border-radius: ${t.radius} ${t.radius} 0 0; }\n /* Inside a box that scrolls the ring would be clipped, so it is drawn inside the tab. */\n [role='tab']:focus-visible { box-shadow: inset 0 0 0 2px ${t.text}, inset 0 0 0 4px ${t.surfaceCard}; }\n [role='tab']:hover { color: ${t.text}; background: ${t.surfaceInset}; }\n [role='tab'][aria-selected='true'] { color: ${t.link}; border-block-end-color: currentColor; }\n [role='tabpanel'] { padding-block: ${space(5)}; line-height: ${lineHeight('normal')}; }\n .body { white-space: pre-line; }\n @container (max-width: 40rem) {\n :host([two-rows]) [role='tablist'].many { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); overflow: visible; border-block-end: 0; gap: ${space(1)}; }\n :host([two-rows]) .many [role='tab'] { white-space: normal; padding-inline: ${space(2)}; margin: 0; border-block-end-width: 3px; border-block-end-color: ${t.rule}; border-radius: ${t.radius}; }\n :host([two-rows]) .many [role='tab'][aria-selected='true'] { border-block-end-color: currentColor; background: ${t.brandSubtle}; }\n }\n @media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }\n .count { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 20px; block-size: 20px; margin-inline-start: ${space(2)}; padding: 0 ${space(1.5)}; border-radius: 999px; font-size: 12px; font-weight: ${fontWeight('semibold')}; background: ${t.brand}; color: ${t.onBrand}; font-variant-numeric: tabular-nums; }\n .sr-only { ${visuallyHidden} }\n /* Links drawn as tabs. */\n nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: ${space(1)}; overflow-x: auto; scrollbar-width: thin; border-block-end: ${t.borderThin} solid ${t.border}; }\n nav a { ${targetSize} position: relative; display: inline-flex; align-items: center; flex: none; padding: ${space(3)} ${space(4)}; font-weight: ${fontWeight('semibold')}; white-space: nowrap; color: ${t.textMuted}; text-decoration: none; border-block-end: 3px solid transparent; margin-block-end: -1px; border-radius: ${t.radius} ${t.radius} 0 0; }\n nav a:hover { color: ${t.text}; background: ${t.surfaceInset}; }\n nav a[aria-current='page'] { color: ${t.link}; border-block-end-color: currentColor; }\n nav a:focus-visible { box-shadow: inset 0 0 0 2px ${t.text}, inset 0 0 0 4px ${t.surfaceCard}; outline: none; }\n /* The pill look, for either kind. */\n :host([look='pill']) :is([role='tablist'], nav ul) { padding: ${space(1)}; border: 0; border-radius: 999px; background: ${t.surfaceCard}; gap: ${space(0.5)}; }\n :host([look='pill']) :is([role='tab'], nav a) { padding: ${space(2)} ${space(4)}; margin: 0; border: 0; border-radius: 999px; font-weight: ${fontWeight('medium')}; color: ${t.text}; }\n :host([look='pill']) :is([role='tab'], nav a):hover { background: ${t.surfaceInset}; }\n :host([look='pill']) :is([role='tab'][aria-selected='true'], nav a[aria-current='page']) { background: ${t.text}; color: ${t.surfaceCard}; }\n @media (forced-colors: active) { :host([look='pill']) :is([role='tab'][aria-selected='true'], nav a[aria-current='page']) { border: 2px solid Highlight; } }\n `,\n ];\n\n private countOf(item: TabItem): TemplateResult | typeof nothing {\n if (typeof item.count !== 'number') return nothing;\n return item.countLabel\n ? html`<span class=\"count\" aria-hidden=\"true\">${item.count}</span><span class=\"sr-only\">, ${item.countLabel}</span>`\n : html`<span class=\"count\">${item.count}</span>`;\n }\n\n private get linked(): boolean {\n const items = this.items ?? [];\n return items.length > 0 && items.every((i) => Boolean(i.href));\n }\n\n private current(): string {\n const items = this.items ?? [];\n return items.some((i) => i.id === this.selected) ? this.selected : (items[0]?.id ?? '');\n }\n\n private choose(id: string, focus: boolean): void {\n if (id === this.current()) return;\n this.selected = id;\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: { value: id }, bubbles: true, composed: true }));\n if (focus) void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>(`#${this.id_(`tab-${id}`)}`)?.focus({ preventScroll: true }));\n }\n\n private onKey(event: KeyboardEvent): void {\n const items = this.items ?? [];\n const at = items.findIndex((i) => i.id === this.current());\n const to = { ArrowRight: at + 1, ArrowLeft: at - 1, Home: 0, End: items.length - 1 }[event.key];\n if (to === undefined || !items.length) return;\n event.preventDefault();\n this.choose(items[(to + items.length) % items.length]!.id, true);\n }\n\n /**\n * Bring the chosen tab into view inside the row of tabs. Only the row scrolls:\n * `scrollIntoView` would scroll the page too, and move someone who is reading\n * further down.\n */\n private reveal(): void {\n const list = this.renderRoot.querySelector<HTMLElement>(\"[role='tablist']\");\n const tab = this.renderRoot.querySelector<HTMLElement>(\"[role='tab'][aria-selected='true']\");\n if (!list || !tab || list.scrollWidth <= list.clientWidth) return;\n const start = tab.offsetLeft - list.offsetLeft;\n const end = start + tab.offsetWidth;\n if (start < list.scrollLeft) list.scrollLeft = start - 16;\n else if (end > list.scrollLeft + list.clientWidth) list.scrollLeft = end - list.clientWidth + 16;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('selected') || changed.has('items')) this.reveal();\n }\n\n render(): TemplateResult {\n const items = this.items ?? [];\n const current = this.current();\n if (this.linked) {\n return html`<nav aria-label=${this.label || nothing} part=\"tabs\"><ul>\n ${items.map((item) => html`<li><a href=${item.href!} part=\"tab\" aria-current=${item.id === current ? 'page' : nothing} @click=${(e: MouseEvent) => announceNavigate(this, e, { href: item.href!, id: item.id })}>${item.label}${this.countOf(item)}</a></li>`)}\n </ul></nav>`;\n }\n const many = items.length > 4;\n return html`<div role=\"tablist\" aria-label=${this.label || nothing} part=\"tabs\" class=${many ? 'many' : ''} style=${many ? `--columns:${Math.ceil(items.length / 2)}` : nothing} @keydown=${this.onKey}>\n ${items.map((item) => html`<button role=\"tab\" type=\"button\" id=${this.id_(`tab-${item.id}`)} aria-selected=${item.id === current ? 'true' : 'false'} aria-controls=${this.id_(`panel-${item.id}`)} tabindex=${item.id === current ? '0' : '-1'} @click=${() => this.choose(item.id, false)}>${item.label}${this.countOf(item)}</button>`)}\n </div>\n ${items.map((item) => html`<div role=\"tabpanel\" id=${this.id_(`panel-${item.id}`)} aria-labelledby=${this.id_(`tab-${item.id}`)} tabindex=\"0\" ?hidden=${item.id !== current} part=\"panel\"><slot name=${item.id}><span class=\"body\">${item.body ?? ''}</span></slot></div>`)}`;\n }\n}\n\ncustomElements.define('impakt-divider', ImpaktDivider);\ncustomElements.define('impakt-spacer', ImpaktSpacer);\ncustomElements.define('impakt-visually-hidden', ImpaktVisuallyHidden);\ncustomElements.define('impakt-tabs', ImpaktTabs);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-divider': ImpaktDivider;\n 'impakt-spacer': ImpaktSpacer;\n 'impakt-visually-hidden': ImpaktVisuallyHidden;\n 'impakt-tabs': ImpaktTabs;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAejD,IAAM,gBAAN,cAA4B,cAAc;AAAA,EAC/C;AAAA,SAAO,aAAa;AAAA,MAClB,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EAKA,cAAc;AACZ,UAAM;AACN,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA;AAAA,mBAEe,MAAM,CAAC,CAAC,sCAAsC,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,wEACvB,EAAE,WAAW;AAAA,+CACtC,MAAM,CAAC,CAAC;AAAA,+CACR,MAAM,CAAC,CAAC;AAAA,+CACR,MAAM,EAAE,CAAC;AAAA;AAAA,IAEtD;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,EACT;AACF;AASO,IAAM,eAAN,cAA2B,cAAc;AAAA,EAC9C;AAAA,SAAO,aAAa,EAAE,MAAM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2C,KAAK,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC,kBAAkB,KAAK,OAAO,UAAU,SAAS,OAAO,kBAAkB,KAAK,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC,aAAa,KAAK,OAAO,UAAU,MAAM,IAAI,WAAW,MAAM,KAAK,OAAO,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,GAAG,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC;AAAA;AAAA,MAEzU,MAAM,IAAI,CAAC,SAAS,+BAA+B,KAAK,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC,oBAAoB,KAAK,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC,yBAAyB,KAAK,OAAO,OAAO,4BAA4B,KAAK,EAAE,uBAAuB,KAAK,QAAQ,EAAE,sBAAsB,CAAC;AAAA,EAC7Q;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;AACrD,eAAe,OAAO,iBAAiB,YAAY;AACnD,eAAe,OAAO,0BAA0B,oBAAoB;AACpE,eAAe,OAAO,eAAe,UAAU;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/dialog.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize, touchTarget } from '../base/styles';\nimport { lockScroll, unlockScroll } from '../base/scroll-lock';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\n/**\n * A modal dialog — \"are you sure you want to leave this order?\".\n *\n * **It is a native `<dialog>` opened with `showModal()`, and that is the whole\n * design.** The platform then provides, correctly and in every browser: a\n * focus trap, Escape to close, the rest of the page made inert so a screen\n * reader cannot wander out of the dialog, rendering in the top layer so no\n * `z-index` can cover it, and focus returned to whatever opened it when it\n * closes.\n *\n * Every one of those is a thing hand-rolled modals get wrong. The focus trap\n * is the famous one, but inertness is the worse failure: a dialog that traps\n * the Tab key but leaves the background in the accessibility tree lets a\n * screen-reader user read straight past it into a page they cannot interact\n * with, and nothing on screen tells them that is what happened.\n *\n * What is left to get right is the labelling. `aria-labelledby` points at the\n * dialog's own heading, so it is announced by name on open rather than as\n * \"dialog\".\n *\n * Two things the platform leaves out are added. The page behind does not scroll\n * while the dialog is open, so a finger on the backdrop does not move the page\n * out from under it. And with `phone-full-screen` the dialog fills a phone's\n * screen, which suits a dialog holding a form; a short question is better left\n * as a box in the middle, which is the default.\n\n *\n * @category feedback\n * @icon dialog\n * @fires {CustomEvent<null>} impakt-close - When the dialog is closed.\n * @slot - The body of the dialog.\n */\nexport class ImpaktDialog extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n heading: { type: String },\n closeLabel: { type: String, attribute: 'close-label' },\n dismissible: { type: Boolean },\n phoneFullScreen: { type: Boolean, reflect: true, attribute: 'phone-full-screen' },\n };\n\n declare open: boolean;\n declare heading: string;\n declare closeLabel: string;\n /** When false, Escape and the backdrop do not close it — a decision must be made. */\n declare dismissible: boolean;\n /** Fill the screen on a phone, for a dialog that holds a form or a long text. */\n declare phoneFullScreen: boolean;\n\n constructor() {\n super();\n this.open = false;\n this.heading = '';\n this.closeLabel = 'Close';\n this.dismissible = true;\n this.phoneFullScreen = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.close'),\n css`\n dialog {\n padding: 0;\n border: 0;\n border-radius: ${t.radius2xl};\n background: ${t.surfaceCard};\n color: ${t.text};\n box-shadow: ${t.shadowXl}, 0 0 0 1px ${t.hairline};\n max-inline-size: min(32rem, calc(100vw - 2rem));\n /* 1.4.10 Reflow: a dialog taller than the viewport must scroll inside\n itself rather than clipping, at 320px and at 400% zoom alike. */\n max-block-size: calc(100vh - 2rem);\n overflow: auto;\n }\n dialog::backdrop {\n background: color-mix(in srgb, ${t.text} 30%, transparent);\n backdrop-filter: blur(2px);\n }\n .head {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: ${space(3)};\n padding: ${space(5)} ${space(5)} 0;\n }\n .heading {\n margin: 0;\n font-family: ${t.fontHeading};\n font-size: ${fontSize('xl')};\n font-weight: ${fontWeight('bold')};\n color: ${t.textHeading};\n }\n .body {\n padding: ${space(4)} ${space(5)} ${space(5)};\n }\n @media (max-width: 40rem) {\n :host([phone-full-screen]) dialog {\n inline-size: 100vw;\n max-inline-size: 100vw;\n block-size: 100dvh;\n max-block-size: 100dvh;\n margin: 0;\n border-radius: 0;\n }\n }\n .close {\n ${targetSize}\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n background: none;\n border: 0;\n border-radius: ${t.radius};\n font: inherit;\n font-size: ${fontSize('lg')};\n color: ${t.text};\n cursor: pointer;\n }\n `,\n ];\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n updated(changed: Map<string, unknown>): void {\n if (!changed.has('open')) return;\n const dialog = this.dialog;\n if (!dialog) return;\n // happy-dom and older engines do not implement showModal. Falling back to\n // the `open` attribute renders a NON-modal dialog — no focus trap, no\n // inert background — so it is used only to keep tests and ancient browsers\n // from throwing, never as an equivalent.\n if (this.open) {\n if (typeof dialog.showModal === 'function') dialog.showModal();\n else dialog.setAttribute('open', '');\n lockScroll(this);\n } else {\n if (typeof dialog.close === 'function' && dialog.open) dialog.close();\n else dialog.removeAttribute('open');\n unlockScroll(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n unlockScroll(this);\n }\n\n private close(): void {\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n render(): TemplateResult {\n return html`\n <dialog\n part=\"dialog\"\n aria-labelledby=${this.heading ? this.id_('heading') : nothing}\n @cancel=${(e: Event) => {\n // `cancel` fires on Escape. Blocking it is what makes a dialog\n // non-dismissible, and it is why `dismissible` exists rather than\n // leaving a caller to re-open on close.\n if (!this.dismissible) e.preventDefault();\n else this.close();\n }}\n @close=${() => {\n if (this.open) this.close();\n }}\n >\n <div class=\"head\">\n ${this.heading ? html`<h2 class=\"heading\" id=${this.id_('heading')} part=\"heading\">${this.heading}</h2>` : nothing}\n ${\n this.dismissible\n ? html`<button class=\"close\" part=\"close\" type=\"button\" @click=${this.close}>\n <span aria-hidden=\"true\">×</span>\n <span class=\"sr-only\" style=\"position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)\">${this.closeLabel}</span>\n </button>`\n : nothing\n }\n </div>\n <div class=\"body\" part=\"body\"><slot></slot></div>\n </dialog>\n `;\n }\n}\n\ncustomElements.define('impakt-dialog', ImpaktDialog);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-dialog': ImpaktDialog;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAsCjD,IAAM,eAAN,cAA2B,cAAc;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,MACrD,aAAa,EAAE,MAAM,QAAQ;AAAA,MAC7B,iBAAiB,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,oBAAoB;AAAA,IAClF;AAAA;AAAA,EAUA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,aAAa;AAClB,SAAK,cAAc;AACnB,SAAK,kBAAkB;AAAA,EACzB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA,YAAY,QAAQ;AAAA,MACpB;AAAA;AAAA;AAAA;AAAA,yBAIqB,EAAE,SAAS;AAAA,sBACd,EAAE,WAAW;AAAA,iBAClB,EAAE,IAAI;AAAA,sBACD,EAAE,QAAQ,eAAe,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAQhB,EAAE,IAAI;AAAA;AAAA;AAAA;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,KAAK,CAAC,CAAC;AAAA,EACvF;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,0BAGe,KAAK,UAAU,KAAK,IAAI,SAAS,IAAI,OAAO;AAAA,kBACpD,CAAC,MAAa;AAItB,UAAI,CAAC,KAAK,YAAa,GAAE,eAAe;AAAA,UACnC,MAAK,MAAM;AAAA,IAClB,CAAC;AAAA,iBACQ,MAAM;AACb,UAAI,KAAK,KAAM,MAAK,MAAM;AAAA,IAC5B,CAAC;AAAA;AAAA;AAAA,YAGG,KAAK,UAAU,8BAA8B,KAAK,IAAI,SAAS,CAAC,mBAAmB,KAAK,OAAO,UAAU,OAAO;AAAA,YAEhH,KAAK,cACD,+DAA+D,KAAK,KAAK;AAAA;AAAA,4HAEmC,KAAK,UAAU;AAAA,2BAE3H,OACN;AAAA;AAAA;AAAA;AAAA;AAAA,EAKR;AACF;AAEA,eAAe,OAAO,iBAAiB,YAAY;","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 {\n const url = new URL(href, location.href);\n // A link to another site is never where the reader is, even when its path matches, as a\n // product at app.example.com linking back to example.com/ would otherwise mark that link.\n if (url.origin !== location.origin) return null;\n path = url.pathname.replace(/\\/$/, '') || '/';\n } catch {\n return null;\n }\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 {\n return this.menuOpen;\n }\n private set open(next: boolean) {\n this.menuOpen = next;\n this.requestUpdate();\n }\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 = [\n ...ImpaktElement.styles,\n focusRing,\n 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 /* With no script the element is never defined, so it cannot measure itself and fold. The links\n wrap onto more lines instead, so they are never cut off or drawn over what is beside them. */\n :host(:not(:defined)) ul { flex-wrap: wrap; row-gap: 0; }\n `,\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 // An element the server drew waits for the element around it before it draws here, and the\n // screen can report a size in that wait. There is nothing to measure until it has drawn.\n if (!this.hasUpdated) return;\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')) {\n this.needs = 0;\n this.fit();\n }\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 = [\n ...ImpaktElement.styles,\n focusRing,\n 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\n render(): TemplateResult {\n const items = this.items ?? [];\n return html`<nav aria-label=${this.label} part=\"nav\"><ol>\n ${items.map(\n (item, i) =>\n html`<li>${\n i === items.length - 1 ? html`<span aria-current=\"page\">${item.label}</span>` : html`<a href=${item.href} part=\"link\">${item.label}</a>`\n }</li>`,\n )}\n </ol></nav>`;\n }\n}\n\ncustomElements.define('impakt-nav', ImpaktNav);\ncustomElements.define('impakt-breadcrumbs', ImpaktBreadcrumbs);\ndeclare global {\n interface HTM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L;AACF;AAEA,eAAe,OAAO,cAAc,SAAS;AAC7C,eAAe,OAAO,sBAAsB,iBAAiB;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/base/FieldElement.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpaktElement } from './ImpaktElement';\nimport { focusRing, visuallyHidden } from './styles';\nimport { fontSize, fontWeight, lineHeight, space, t } from './tokens';\n\n/**\n * The shared anatomy of a form control: a label, an optional description, a\n * control, and an error.\n *\n * This exists because the ARIA wiring between those four is where accessible\n * forms actually fail, and it fails the same way every time — a description\n * that is never announced, an error that appears silently, a label that points\n * at nothing. Written once, it is right once.\n *\n * Everything is rendered inside this component's own shadow root, including\n * the native control. That is not an implementation detail: `aria-describedby`\n * cannot cross a shadow boundary, so a component that slotted the input from\n * outside could not describe it. Keeping the whole relationship in one tree is\n * what makes the wiring work at all.\n */\n/**\n * How wide a single-line control is, from what it holds: a postcode is short,\n * an email address is long. A width that matches the answer is a hint about\n * what to type (1.3.5 is about the purpose, this is about the size). Applied by\n * the controls that take a `width`, through `--impakt-field-width`.\n */\nexport const fieldWidths = css`\n :host { --impakt-field-width: 100%; }\n :host([width='xs']) { --impakt-field-width: 8ch; }\n :host([width='sm']) { --impakt-field-width: 14ch; }\n :host([width='md']) { --impakt-field-width: 24ch; }\n :host([width='lg']) { --impakt-field-width: 40ch; }\n`;\n\n/**\n * The base of every form control.\n *\n * @fires {CustomEvent<{ value: string }>} impakt-change - When the answer changes. The answer is in detail.value.\n */\nexport abstract class FieldElement extends ImpaktElement {\n /** Form controls participate in a `<form>` like native ones. */\n static formAssociated = true;\n\n static properties = {\n label: { type: String },\n name: { type: String },\n value: { type: String },\n description: { type: String },\n error: { type: String },\n required: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n requiredText: { type: String, attribute: 'required-text' },\n };\n\n declare label: string;\n declare name: string;\n declare value: string;\n declare description: string;\n declare error: string;\n declare required: boolean;\n declare disabled: boolean;\n declare readonly: boolean;\n /**\n * How \"you must answer this\" is said.\n *\n * Words, not an asterisk. 3.3.2 asks for labels or instructions, and an\n * asterisk is neither until a legend explains it — which puts the\n * explanation somewhere other than the field it explains. It is a property\n * so a partner can reword it, not so they can empty it.\n */\n declare requiredText: string;\n\n protected internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.label = '';\n this.name = '';\n this.value = '';\n this.description = '';\n this.error = '';\n this.required = false;\n this.disabled = false;\n this.readonly = false;\n this.requiredText = 'required';\n // happy-dom and older engines do not implement attachInternals. A control\n // that cannot associate with a form is still a usable control, so this\n // degrades rather than throwing on construction.\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n .label {\n display: block;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('semibold')};\n line-height: ${lineHeight('normal')};\n margin-block-end: ${space(1)};\n color: ${t.text};\n }\n .required {\n font-weight: ${fontWeight('regular')};\n color: ${t.textMuted};\n }\n .description {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.textMuted};\n margin-block-end: ${space(2)};\n }\n .error {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.dangerText};\n margin-block-start: ${space(1)};\n display: flex;\n gap: ${space(1)};\n }\n .error:empty {\n display: none;\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n /*\n * Only the control is dimmed. Dimming the whole host took the question,\n * the hint and the error below 4.5:1, and a disabled field still has to\n * say what it is and why it cannot be changed. The native disabled\n * control itself is exempt from the contrast criterion.\n */\n :host([disabled]) :is(input, select, textarea, button) {\n opacity: 0.6;\n cursor: not-allowed;\n }\n `,\n ];\n\n protected get controlId(): string {\n return this.id_('control');\n }\n\n /**\n * What the control points `aria-describedby` at.\n *\n * The error id is included only while there is an error. A describedby that\n * always names an empty element trains a screen-reader user to expect\n * nothing after the description, and then the one time it matters they have\n * already learned to ignore it.\n */\n protected get describedBy(): string | typeof nothing {\n const ids = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n /**\n * Focusing the element focuses its control, so `el.focus()` from an app, a\n * React ref or the error summary's link lands where someone can type, rather\n * than on a host that cannot take focus and so silently does nothing.\n */\n focus(options?: FocusOptions): void {\n const control =\n this.renderRoot?.querySelector<HTMLElement>(`#${this.controlId}`) ?? this.renderRoot?.querySelector<HTMLElement>('input, select, textarea, button');\n if (control) control.focus(options);\n else super.focus(options);\n }\n\n /** Subclasses render the control itself; everything round it is here. */\n protected abstract renderControl(): TemplateResult;\n\n /**\n * `<label for>` by default. A group of controls — radios, checkboxes —\n * cannot use one, because `for` names a single control, so those override\n * this and render a `<fieldset>` and `<legend>` instead.\n */\n protected renderLabel(): TemplateResult {\n return html`\n <label class=\"label\" for=${this.controlId} part=\"label\">\n ${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}\n </label>\n `;\n }\n\n render(): TemplateResult {\n return html`\n ${this.renderLabel()}\n ${\n this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing\n }\n ${this.renderControl()}\n <!--\n The error region is always present, even when empty. A live region\n inserted at the same moment as its content is announced unreliably\n across screen readers; one that already exists and is then filled is\n announced consistently. \"polite\" rather than \"assertive\" because a\n validation message should not interrupt what is being read.\n -->\n <div\n class=\"error\"\n id=${this.id_('error')}\n part=\"error\"\n aria-live=\"polite\"\n >\n ${this.error || nothing}\n </div>\n `;\n }\n\n /** Keep the form value in step with the control. */\n protected setFormValue(value: string): void {\n this.value = value;\n this.internals?.setFormValue(value);\n this.dispatchEvent(new CustomEvent('impakt-change', { detail: this.changeDetail(value), bubbles: true, composed: true }));\n }\n\n /** What `impakt-change` carries. A control with more to say than its value adds it here. */\n protected changeDetail(value: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,YAAY,aAAa,OAAO;AAAA;AAAA;AAAA,EAG1G;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,QACH,KAAK,YAAY,CAAC;AAAA,QAElB,KAAK,cACD,mCAAmC,KAAK,IAAI,aAAa,CAAC;AAAA,cACxD,KAAK,WAAW;AAAA,oBAElB,OACN;AAAA,QACE,KAAK,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAUf,KAAK,IAAI,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA,UAIpB,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAG7B;AAAA;AAAA,EAGU,aAAa,OAAqB;AAC1C,SAAK,QAAQ;AACb,SAAK,WAAW,aAAa,KAAK;AAClC,SAAK,cAAc,IAAI,YAAY,iBAAiB,EAAE,QAAQ,KAAK,aAAa,KAAK,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EAC1H;AAAA;AAAA,EAGU,aAAa,OAAkC;AACvD,WAAO,EAAE,MAAM;AAAA,EACjB;AACF;","names":[]}
@@ -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 hideLabels: { type: Boolean, attribute: 'hide-labels', 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 * Draw the bars or steps alone, for a card too small for the names. The\n * names and \"Step 2 of 5\" are still read aloud. Each step is also a `step`\n * part, with `step-done`, `step-current` or `step-todo`, and its name is the\n * `step-label` part, for finer styling.\n */\n declare hideLabels: boolean;\n\n constructor() {\n super();\n this.steps = [];\n this.current = '';\n this.label = 'Progress';\n this.look = 'steps';\n this.hideLabels = false;\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 :host([hide-labels]) .name {\n ${visuallyHidden}\n }\n /* Below 30rem the labels stop fitting; the position in words is the part\n that has to survive, so the list collapses to bars and the current\n step's name. */\n @media (max-width: 30rem) {\n li:not([data-state='current']) .name {\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 part=\"step step-${state}\" data-state=${state} aria-current=${state === 'current' ? 'step' : nothing}>\n ${\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 }\n <span class=\"name\" part=\"step-label\">${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 {\n 'impakt-progress': ImpaktProgress;\n }\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,MACpC,YAAY,EAAE,MAAM,SAAS,WAAW,eAAe,SAAS,KAAK;A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AEjC,KAAK,MAAM,IAAI,CAAC,MAAM,MAAM;AAC5B,YAAM,QAAQ,IAAI,QAAQ,SAAS,MAAM,QAAQ,YAAY;AAC7D,aAAO;AAAA,oCACiB,KAAK,gBAAgB,KAAK,iBAAiB,UAAU,YAAY,SAAS,OAAO;AAAA,kBAEnG,UAAU,YACN,6BAA6B,IAAI,2BAA2B,EAAE,MAAM,IAAI,GAAG,OAAO,KAAK,MAAM,OAAO,CAAC,CAAC,aACtG,OACN;AAAA,uDACuC,KAAK,KAAK;AAAA;AAAA;AAAA,IAGvD,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAIV;AACF;AAEA,eAAe,OAAO,mBAAmB,cAAc;","names":[]}
@@ -1,144 +0,0 @@
1
- import {
2
- onServer
3
- } from "./chunk-6WVL3HOC.js";
4
- import {
5
- ImpaktElement,
6
- focusRing,
7
- fontSize,
8
- fontWeight,
9
- space,
10
- t,
11
- targetSize
12
- } from "./chunk-V7EB7Q2M.js";
13
-
14
- // packages/ui/src/components/accordion.ts
15
- import { html, css } from "lit";
16
- var ImpaktAccordion = class extends ImpaktElement {
17
- static {
18
- this.properties = {
19
- items: { type: Array },
20
- headingLevel: { type: Number, attribute: "heading-level" },
21
- open: { type: Array },
22
- multiple: { type: Boolean },
23
- enhanced: { state: true }
24
- };
25
- }
26
- constructor() {
27
- super();
28
- this.items = [];
29
- this.headingLevel = 3;
30
- this.open = [];
31
- this.multiple = true;
32
- this.enhanced = false;
33
- }
34
- connectedCallback() {
35
- if (!onServer && !this.shadowRoot) this.enhanced = true;
36
- super.connectedCallback();
37
- }
38
- firstUpdated() {
39
- this.enhanced = true;
40
- }
41
- static {
42
- this.styles = [
43
- ...ImpaktElement.styles,
44
- focusRing,
45
- css`
46
- :host {
47
- display: block;
48
- }
49
- .item {
50
- border-block-end: ${t.borderThin} solid ${t.rule};
51
- }
52
- button {
53
- ${targetSize}
54
- display: flex;
55
- align-items: center;
56
- justify-content: space-between;
57
- gap: ${space(3)};
58
- inline-size: 100%;
59
- padding: ${space(3)} 0;
60
- background: none;
61
- border: 0;
62
- font: inherit;
63
- font-size: ${fontSize("md")};
64
- font-weight: ${fontWeight("semibold")};
65
- color: ${t.text};
66
- text-align: start;
67
- cursor: pointer;
68
- }
69
- button:hover {
70
- color: ${t.link};
71
- }
72
- .marker {
73
- flex: none;
74
- transition: transform 120ms ease-in-out;
75
- }
76
- button[aria-expanded='true'] .marker {
77
- transform: rotate(90deg);
78
- }
79
- /* With no script the element is never defined: the buttons cannot work, so they do not look as if they do. */
80
- :host(:not(:defined)) button {
81
- cursor: default;
82
- pointer-events: none;
83
- }
84
- :host(:not(:defined)) button:hover {
85
- color: ${t.text};
86
- }
87
- :host(:not(:defined)) .marker {
88
- display: none;
89
- }
90
- .panel {
91
- padding-block-end: ${space(4)};
92
- font-size: ${fontSize("md")};
93
- }
94
- `
95
- ];
96
- }
97
- toggle(id) {
98
- const isOpen = this.open.includes(id);
99
- if (isOpen) this.open = this.open.filter((o) => o !== id);
100
- else this.open = this.multiple ? [...this.open, id] : [id];
101
- }
102
- render() {
103
- return html`
104
- ${this.items.map((item) => {
105
- const expanded = !this.enhanced || this.open.includes(item.id);
106
- const panelId = this.id_(`panel-${item.id}`);
107
- const buttonId = this.id_(`button-${item.id}`);
108
- return html`
109
- <div class="item" part="item">
110
- <div role="heading" aria-level=${this.headingLevel}>
111
- <button
112
- id=${buttonId}
113
- part="header"
114
- type="button"
115
- aria-expanded=${expanded ? "true" : "false"}
116
- aria-controls=${panelId}
117
- @click=${() => this.toggle(item.id)}
118
- >
119
- <span>${item.heading}</span>
120
- <span class="marker" aria-hidden="true">›</span>
121
- </button>
122
- </div>
123
- <div
124
- id=${panelId}
125
- class="panel"
126
- part="panel"
127
- role="region"
128
- aria-labelledby=${buttonId}
129
- ?hidden=${!expanded}
130
- >
131
- <slot name=${`panel-${item.id}`}>${item.body}</slot>
132
- </div>
133
- </div>
134
- `;
135
- })}
136
- `;
137
- }
138
- };
139
- customElements.define("impakt-accordion", ImpaktAccordion);
140
-
141
- export {
142
- ImpaktAccordion
143
- };
144
- //# sourceMappingURL=chunk-QU3U2CS2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/accordion.ts"],"sourcesContent":["import { html, css, type TemplateResult } from 'lit';\nimport { onServer } from '../base/server';\nimport { ImpaktElement } from '../base/ImpaktElement';\nimport { focusRing, targetSize } from '../base/styles';\nimport { fontSize, fontWeight, space, t } from '../base/tokens';\n\nexport interface AccordionItem {\n id: string;\n heading: string;\n body: string;\n}\n\n/**\n * Disclosure sections — frequently asked questions, \"what does this mean?\".\n *\n * **Each header is a button inside a heading.** The heading is what lets a\n * screen-reader user jump between sections without tabbing through every\n * paragraph; the button is what makes the section openable. One without the\n * other is a common half-implementation: all-headings cannot be operated,\n * all-buttons cannot be navigated.\n *\n * `headingLevel` is a property because the right level depends on what is\n * above the accordion on the page, and guessing produces exactly the skipped\n * levels that 1.3.1 is about.\n *\n * **Panels are hidden, not unmounted.** `hidden` keeps the content in the\n * accessibility tree's structure and lets in-page search find it when opened,\n * and it means `aria-controls` always points at an element that exists.\n *\n * **A panel can hold more than words.** `body` is plain text, which is what a\n * composition can author safely. Content rendered elsewhere, such as an FAQ\n * answer with links and a list, is slotted instead: a child with\n * `slot=\"panel-<item id>\"` replaces that item's body. The slot sits inside the\n * panel, so the region, its label and its `hidden` state are unchanged, and a\n * panel with nothing slotted still shows its body.\n *\n * **Without script every panel is open.** A page built to finished HTML may load\n * no script at all, and a closed panel there could never be opened. So an\n * accordion drawn on the server has every panel open and its markers hidden: the\n * questions and answers read as a plain list. When the script loads it closes\n * the panels that `open` does not name, and the buttons work.\n *\n * @category content\n * @icon accordion\n */\nexport class ImpaktAccordion extends ImpaktElement {\n static properties = {\n items: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n open: { type: Array },\n multiple: { type: Boolean },\n enhanced: { state: true },\n };\n\n declare items: AccordionItem[];\n declare headingLevel: number;\n /** Ids currently expanded. */\n declare open: string[];\n /** When false, opening one closes the others. */\n declare multiple: boolean;\n /** Whether the script is running here, so the panels can be closed and opened. */\n declare private enhanced: boolean;\n\n constructor() {\n super();\n this.items = [];\n this.headingLevel = 3;\n this.open = [];\n this.multiple = true;\n this.enhanced = false;\n }\n\n connectedCallback(): void {\n // Drawn here from nothing, the panels start as `open` says. Drawn on the server first, the\n // first draw here must match what the server sent, with every panel open, and firstUpdated\n // then closes them.\n if (!onServer && !this.shadowRoot) this.enhanced = true;\n super.connectedCallback();\n }\n\n protected firstUpdated(): void {\n this.enhanced = true;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n }\n .item {\n border-block-end: ${t.borderThin} solid ${t.rule};\n }\n button {\n ${targetSize}\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: ${space(3)};\n inline-size: 100%;\n padding: ${space(3)} 0;\n background: none;\n border: 0;\n font: inherit;\n font-size: ${fontSize('md')};\n font-weight: ${fontWeight('semibold')};\n color: ${t.text};\n text-align: start;\n cursor: pointer;\n }\n button:hover {\n color: ${t.link};\n }\n .marker {\n flex: none;\n transition: transform 120ms ease-in-out;\n }\n button[aria-expanded='true'] .marker {\n transform: rotate(90deg);\n }\n /* With no script the element is never defined: the buttons cannot work, so they do not look as if they do. */\n :host(:not(:defined)) button {\n cursor: default;\n pointer-events: none;\n }\n :host(:not(:defined)) button:hover {\n color: ${t.text};\n }\n :host(:not(:defined)) .marker {\n display: none;\n }\n .panel {\n padding-block-end: ${space(4)};\n font-size: ${fontSize('md')};\n }\n `,\n ];\n\n private toggle(id: string): void {\n const isOpen = this.open.includes(id);\n if (isOpen) this.open = this.open.filter((o) => o !== id);\n else this.open = this.multiple ? [...this.open, id] : [id];\n }\n\n render(): TemplateResult {\n return html`\n ${this.items.map((item) => {\n const expanded = !this.enhanced || this.open.includes(item.id);\n const panelId = this.id_(`panel-${item.id}`);\n const buttonId = this.id_(`button-${item.id}`);\n return html`\n <div class=\"item\" part=\"item\">\n <div role=\"heading\" aria-level=${this.headingLevel}>\n <button\n id=${buttonId}\n part=\"header\"\n type=\"button\"\n aria-expanded=${expanded ? 'true' : 'false'}\n aria-controls=${panelId}\n @click=${() => this.toggle(item.id)}\n >\n <span>${item.heading}</span>\n <span class=\"marker\" aria-hidden=\"true\">›</span>\n </button>\n </div>\n <div\n id=${panelId}\n class=\"panel\"\n part=\"panel\"\n role=\"region\"\n aria-labelledby=${buttonId}\n ?hidden=${!expanded}\n >\n <slot name=${`panel-${item.id}`}>${item.body}</slot>\n </div>\n </div>\n `;\n })}\n `;\n }\n}\n\ncustomElements.define('impakt-accordion', ImpaktAccordion);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-accordion': ImpaktAccordion;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,MAAM,WAAgC;AA6CxC,IAAM,kBAAN,cAA8B,cAAc;AAAA,EACjD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,MAAM,EAAE,MAAM,MAAM;AAAA,MACpB,UAAU,EAAE,MAAM,QAAQ;AAAA,MAC1B,UAAU,EAAE,OAAO,KAAK;AAAA,IAC1B;AAAA;AAAA,EAWA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,eAAe;AACpB,SAAK,OAAO,CAAC;AACb,SAAK,WAAW;AAChB,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,oBAA0B;AAIxB,QAAI,CAAC,YAAY,CAAC,KAAK,WAAY,MAAK,WAAW;AACnD,UAAM,kBAAkB;AAAA,EAC1B;AAAA,EAEU,eAAqB;AAC7B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKwB,EAAE,UAAU,UAAU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A;AAAA;AAAA;AAAA;AAAA,mBAKjB,OAAO;AAAA;AAAA;AAAA;AAAA,gCAIM,QAAQ;AAAA,wBAChB,CAAC,QAAQ;AAAA;AAAA,2BAEN,SAAS,KAAK,EAAE,EAAE,IAAI,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA,IAIpD,CAAC,CAAC;AAAA;AAAA,EAEN;AACF;AAEA,eAAe,OAAO,oBAAoB,eAAe;","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, token, 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, `danger` an\n * action that removes or cancels something, and `accent` the brand's\n * second colour, for the one action a page is built around.\n */\n declare variant: 'primary' | 'secondary' | 'ghost' | 'dark' | 'subtle' | 'danger' | 'accent';\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:\n | 'none'\n | 'arrow-right'\n | 'arrow-left'\n | 'chevron-right'\n | 'chevron-down'\n | 'check'\n | 'close'\n | 'menu'\n | 'plus'\n | 'minus'\n | 'search'\n | 'external'\n | 'download'\n | 'home'\n | 'phone'\n | 'mail'\n | 'map-pin'\n | 'calendar'\n | 'clock'\n | 'user'\n | 'star'\n | 'heart'\n | 'shield'\n | 'leaf'\n | 'sun'\n | 'bolt'\n | 'key'\n | 'info'\n | 'warning'\n | 'document'\n | 'pound'\n | 'chat'\n | 'grid'\n | 'clipboard'\n | 'map-pinned'\n | 'users'\n | 'radio'\n | 'settings'\n | 'log-out'\n | 'arrow-up-right'\n | 'more'\n | 'upload'\n | 'image'\n | 'lock'\n | 'eye'\n | 'trash'\n | 'pencil'\n | 'qr-code'\n | 'battery';\n /** An icon after the words, such as arrow-right. */\n declare iconAfter:\n | 'none'\n | 'arrow-right'\n | 'arrow-left'\n | 'chevron-right'\n | 'chevron-down'\n | 'check'\n | 'close'\n | 'menu'\n | 'plus'\n | 'minus'\n | 'search'\n | 'external'\n | 'download'\n | 'home'\n | 'phone'\n | 'mail'\n | 'map-pin'\n | 'calendar'\n | 'clock'\n | 'user'\n | 'star'\n | 'heart'\n | 'shield'\n | 'leaf'\n | 'sun'\n | 'bolt'\n | 'key'\n | 'info'\n | 'warning'\n | 'document'\n | 'pound'\n | 'chat'\n | 'grid'\n | 'clipboard'\n | 'map-pinned'\n | 'users'\n | 'radio'\n | 'settings'\n | 'log-out'\n | 'arrow-up-right'\n | 'more'\n | 'upload'\n | 'image'\n | 'lock'\n | 'eye'\n | 'trash'\n | 'pencil'\n | 'qr-code'\n | '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:\n | 'none'\n | 'arrow-right'\n | 'arrow-left'\n | 'chevron-right'\n | 'chevron-down'\n | 'check'\n | 'close'\n | 'menu'\n | 'plus'\n | 'minus'\n | 'search'\n | 'external'\n | 'download'\n | 'home'\n | 'phone'\n | 'mail'\n | 'map-pin'\n | 'calendar'\n | 'clock'\n | 'user'\n | 'star'\n | 'heart'\n | 'shield'\n | 'leaf'\n | 'sun'\n | 'bolt'\n | 'key'\n | 'info'\n | 'warning'\n | 'document'\n | 'pound'\n | 'chat'\n | 'grid'\n | 'clipboard'\n | 'map-pinned'\n | 'users'\n | 'radio'\n | 'settings'\n | 'log-out'\n | 'arrow-up-right'\n | 'more'\n | 'upload'\n | 'image'\n | 'lock'\n | 'eye'\n | 'trash'\n | 'pencil'\n | 'qr-code'\n | '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 /* Accent: the brand's second colour as a fill, for the one action a page is built around. The words on it are the colour the tokens measured against it. */\n .accent {\n background: ${token('color.accent.default', '#ffd43b')};\n color: ${token('color.accent.on', '#1a1a1a')};\n }\n .accent:hover:not([aria-disabled='true']) {\n background: ${token('color.accent.hover', '#e0bb34')};\n }\n .accent:active:not([aria-disabled='true']) {\n background: color-mix(in srgb, ${token('color.accent.hover', '#e0bb34')}, ${token('color.accent.on', '#1a1a1a')} 10%);\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('impakt-button', ImpaktButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-button': ImpaktButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAwCjD,IAAM,eAAN,cAA2B,cAAc;AAAA,EAsM9C,cAAc;AACZ,UAAM;AAHR,SAAQ,YAAqC;AAI3C,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,YAAY;AACjB,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EA1NA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,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;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/textarea.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { FieldElement, fieldWidths } from '../base/FieldElement';\nimport { fontSize, space, t } from '../base/tokens';\n\n/** Several lines of text — a delivery instruction, an additional note.\n *\n * @category form\n * @icon field\n */\nexport class ImpaktTextarea extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n width: { type: String, reflect: true },\n rows: { type: Number },\n maxlength: { type: Number },\n fillFrom: { type: String, attribute: 'fill-from' },\n };\n\n declare rows: number;\n declare maxlength: number | undefined;\n /** `estimate` starts an empty box with the estimate a cost estimator sent on, so the visitor can edit it. */\n declare fillFrom: 'none' | 'estimate';\n\n /** How wide the box is, to suit the answer. Full width on a phone whatever this says. */\n declare width: 'full' | 'lg' | 'md' | 'sm' | 'xs';\n\n constructor() {\n super();\n this.width = 'full';\n this.rows = 4;\n this.maxlength = undefined;\n this.fillFrom = 'none';\n }\n\n static styles = [\n ...FieldElement.styles,\n fieldWidths,\n css`\n textarea {\n inline-size: min(100%, var(--impakt-field-width));\n padding: ${space(2.5)} ${space(3)};\n font-family: inherit;\n font-size: ${fontSize('md')};\n color: ${t.text};\n background: var(--impakt-color-field-surface, ${t.surfaceCard});\n border: ${t.borderThin} solid ${t.border};\n border-radius: ${t.radiusLg};\n box-shadow: var(--impakt-shadow-field, ${t.shadowXs});\n transition: border-color 120ms ease-in-out, box-shadow 120ms ease-in-out;\n /* Resizing is left on deliberately. 1.4.4 and 1.4.12 both assume text\n can be made bigger, and a fixed box is where that stops working. */\n resize: vertical;\n }\n textarea:hover:not(:disabled) {\n border-color: ${t.borderStrong};\n }\n textarea:focus-visible {\n border-color: ${t.brand};\n box-shadow: ${t.focusShadow}, 0 0 0 6px ${t.brandHalo};\n }\n :host([invalid]) textarea {\n border-color: ${t.danger};\n border-width: ${t.borderThick};\n }\n `,\n ];\n\n private filled = false;\n /** The estimate it was filled with, kept until the visitor edits it, so a binding that has not caught up yet cannot empty the box. */\n private filledText = '';\n\n /** @ignore */\n protected willUpdate(changed: Map<string, unknown>): void {\n super.willUpdate?.(changed as never);\n if (this.filledText && changed.has('value') && !this.value) this.value = this.filledText;\n }\n\n /** Fills the box once, when it is first asked to and is still empty. Props can arrive after the element joins the page. */\n private fill(): void {\n if (this.filled || this.fillFrom !== 'estimate') return;\n this.filled = true;\n if (this.value) return;\n let saved: string | null = null;\n try {\n saved = sessionStorage.getItem('impakt.estimate');\n } catch {\n saved = null;\n }\n if (saved) {\n this.filledText = saved;\n this.setFormValue(saved);\n }\n }\n\n protected renderControl(): TemplateResult {\n return html`\n <textarea\n id=${this.controlId}\n part=\"textarea\"\n name=${this.name || nothing}\n rows=${this.rows}\n maxlength=${this.maxlength ?? nothing}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n aria-describedby=${this.describedBy}\n aria-invalid=${this.error ? 'true' : nothing}\n .value=${this.value}\n @input=${(e: Event) => {\n this.filledText = '';\n this.setFormValue((e.target as HTMLTextAreaElement).value);\n }}\n ></textarea>\n `;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n this.fill();\n }\n}\n\ncustomElements.define('impakt-textarea', ImpaktTextarea);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-textarea': ImpaktTextarea;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AASjD,IAAM,iBAAN,cAA6B,aAAa;AAAA,EAiB/C,cAAc;AACZ,UAAM;AAwCR,SAAQ,SAAS;AAEjB;AAAA,SAAQ,aAAa;AAzCnB,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,WAAW;AAAA,EAClB;AAAA,EAtBA;AAAA,SAAO,aAAa;AAAA,MAClB,GAAG,aAAa;AAAA,MAChB,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,WAAW,EAAE,MAAM,OAAO;AAAA,MAC1B,UAAU,EAAE,MAAM,QAAQ,WAAW,YAAY;AAAA,IACnD;AAAA;AAAA,EAkBA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA,mBAGe,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC;AAAA;AAAA,qBAEpB,SAAS,IAAI,CAAC;AAAA,iBAClB,EAAE,IAAI;AAAA,wDACiC,EAAE,WAAW;AAAA,kBACnD,EAAE,UAAU,UAAU,EAAE,MAAM;AAAA,yBACvB,EAAE,QAAQ;AAAA,iDACc,EAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAOnC,EAAE,YAAY;AAAA;AAAA;AAAA,wBAGd,EAAE,KAAK;AAAA,sBACT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version":3,"sources":["../src/base/tokens.ts","../src/base/styles.ts","../src/base/say.ts","../src/base/ImpaktElement.ts"],"sourcesContent":["/**\n * Token helpers.\n *\n * Components never name a colour, a size or a radius. They name a token, and a\n * brand decides what it holds — which is what makes a rebrand a content\n * publish rather than a rebuild\n * ([ADR 0005](https://github.com/matthill8286/strata/blob/main/docs/decisions/0005-design-tokens.md)).\n *\n * Every reference carries a fallback so that a component dropped onto a page\n * with no token stylesheet still renders something legible. An unstyled\n * component is indistinguishable from a broken one, and the fallback is what\n * keeps a missing stylesheet a visible annoyance rather than a blank screen.\n *\n * These return `CSSResult` rather than strings. Lit's `css` tag refuses plain\n * interpolated strings, which is a deliberate guard against injecting\n * attacker-controlled text into a stylesheet; `unsafeCSS` is the documented\n * way past it and is safe here because every value is a literal in this file,\n * never anything authored or fetched.\n */\nimport { css, unsafeCSS, type CSSResult } from 'lit';\n\n/** `color.brand.default` → `var(--impakt-color-brand-default, <fallback>)`. */\nexport const token = (path: string, fallback: string): CSSResult => unsafeCSS(`var(--impakt-${path.replace(/\\./g, '-')}, ${fallback})`);\n\nexport const t = {\n brand: token('color.brand.default', '#1f4ed8'),\n brandHover: token('color.brand.hover', '#1b45be'),\n brandActive: token('color.brand.active', '#183ba4'),\n brandSubtle: token('color.brand.subtle', '#e4eafa'),\n onBrand: token('color.text.on-brand', '#ffffff'),\n\n surfaceCard: token('color.surface.card', '#ffffff'),\n surfaceInset: token('color.surface.inset', '#f4f4f4'),\n surfaceSubtle: token('color.surface.subtle', '#e4eafa'),\n\n text: token('color.text.default', '#1a1a1a'),\n textMuted: token('color.text.muted', '#717171'),\n textPlaceholder: token('color.text.placeholder', '#767676'),\n textHeading: token('color.text.heading', '#1f4ed8'),\n link: token('color.text.link', '#1f4ed8'),\n linkHover: token('color.text.link-hover', '#193ead'),\n\n border: token('color.border.default', '#929292'),\n borderStrong: token('color.border.strong', '#818181'),\n\n danger: token('color.status.danger.default', '#c8102e'),\n dangerText: token('color.status.danger.text', '#c8102e'),\n dangerSubtle: token('color.status.danger.subtle', '#f8e2e6'),\n warning: token('color.status.warning.default', '#b45309'),\n warningText: token('color.status.warning.text', '#b45309'),\n warningSubtle: token('color.status.warning.subtle', '#f6eae1'),\n success: token('color.status.success.default', '#047857'),\n successText: token('color.status.success.text', '#047857'),\n successSubtle: token('color.status.success.subtle', '#e0f0ea'),\n info: token('color.status.info.default', '#1f4ed8'),\n infoText: token('color.status.info.text', '#1f4ed8'),\n infoSubtle: token('color.status.info.subtle', '#e4eafa'),\n\n fontBody: token('font.family.body', 'system-ui, sans-serif'),\n fontHeading: token('font.family.heading', 'system-ui, sans-serif'),\n /** Code-like labels: hashes, branches, version lines. */\n fontMono: token('font.family.mono', 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'),\n /** The small line above a heading: the body face, or the code face for a brand that asks. */\n fontEyebrow: token('font.family.eyebrow', 'inherit'),\n\n focusShadow: token('focus.ring.shadow', '0 0 0 2px #ffffff, 0 0 0 4px #1a1a1a'),\n focusOffset: token('focus.ring.offset', '2px'),\n\n targetMin: token('target.min', '24px'),\n\n radiusSm: token('radius.sm', '2px'),\n radius: token('radius.md', '4px'),\n radiusLg: token('radius.lg', '8px'),\n\n borderThin: token('border.width.thin', '1px'),\n borderThick: token('border.width.thick', '2px'),\n\n radiusXs: token('radius.xs', '2px'),\n radiusXl: token('radius.xl', '12px'),\n radius2xl: token('radius.2xl', '16px'),\n\n /** Hairline borders and rings, from the text colour, so they suit any surface. */\n hairline: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 10%, transparent)'),\n rule: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 15%, transparent)'),\n /** A wash of the text colour, for hover and pressed states on quiet controls. */\n wash: unsafeCSS('color-mix(in srgb, var(--impakt-color-text-default, #1a1a1a) 5%, transparent)'),\n /** The brand at a fifth, for focus halos round fields. */\n brandHalo: unsafeCSS('color-mix(in srgb, var(--impakt-color-brand-default, #1f4ed8) 22%, transparent)'),\n\n shadowXs: token('shadow.xs', '0 1px 2px 0 rgb(0 0 0 / 0.05)'),\n shadowSm: token('shadow.sm', '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)'),\n shadowMd: token('shadow.md', '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)'),\n shadowLg: token('shadow.lg', '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)'),\n shadowXl: token('shadow.xl', '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)'),\n\n trackingTight: token('font.tracking.tight', '-0.02em'),\n trackingWide: token('font.tracking.wide', '0.06em'),\n} as const;\n\n/**\n * A size on the type scale with its own line height, so text drawn at\n * `type('xl')` has the leading that size reads best at.\n */\nexport const type = (name: string): CSSResult =>\n unsafeCSS(`font-size: var(--impakt-font-size-${name}, 1rem); line-height: var(--impakt-font-leading-${name}, 1.5);`);\n\n/** `space(3)` → `space.3`, `space(0.5)` → `space.0-5`. Spacing is always a token, never a number. */\nexport const space = (step: number): CSSResult => token(`space.${String(step).replace('.', '-')}`, `${step * 4}px`);\n/** `font.size.lg` → the custom property. */\nexport const fontSize = (name: string): CSSResult => token(`font.size.${name}`, '1rem');\nexport const lineHeight = (name: string): CSSResult => token(`font.line-height.${name}`, '1.5');\nexport const fontWeight = (name: string): CSSResult => token(`font.weight.${name}`, '400');\n\n/**\n * Space above and below a section, from the spacing scale: `none`, `sm`,\n * `md`, `lg` or `xl`, set by `space-above` and `space-below`. A section names\n * a step rather than a size, so a page keeps the brand's rhythm.\n */\nexport const spaceAround: CSSResult = css`\n :host([space-above='sm']) { margin-block-start: ${space(2)}; }\n :host([space-above='md']) { margin-block-start: ${space(4)}; }\n :host([space-above='lg']) { margin-block-start: ${space(6)}; }\n :host([space-above='xl']) { margin-block-start: ${space(8)}; }\n :host([space-above='2xl']) { margin-block-start: clamp(${space(14)}, 8vw, ${space(28)}); }\n :host([space-below='sm']) { margin-block-end: ${space(2)}; }\n :host([space-below='md']) { margin-block-end: ${space(4)}; }\n :host([space-below='lg']) { margin-block-end: ${space(6)}; }\n :host([space-below='xl']) { margin-block-end: ${space(8)}; }\n :host([space-below='2xl']) { margin-block-end: clamp(${space(14)}, 8vw, ${space(28)}); }\n`;\n","/**\n * Shared style fragments.\n *\n * Three of these carry an accessibility guarantee and are therefore not\n * negotiable per component: the focus ring, the minimum target size and the\n * reduced-motion rule. A component that wants its own focus treatment is a\n * component that will get it subtly wrong on one brand, so there is one.\n */\nimport { css, unsafeCSS, type CSSResult } from 'lit';\nimport { t } from './tokens';\n\n/**\n * The focus ring.\n *\n * `:focus-visible` rather than `:focus`, so a mouse click on a button does not\n * draw a ring the user did not ask for while keyboard focus still does.\n *\n * The ring is two-tone — a light inner band inside a dark outer one — drawn\n * with `box-shadow` and a transparent `outline` behind it. The outline is not\n * decoration: it is what survives Windows High Contrast Mode, where box-shadow\n * is dropped entirely and a shadow-only ring disappears for exactly the users\n * who most need it.\n *\n * The colours come from locked tokens a brand cannot reach\n * ([ADR 0010](https://github.com/matthill8286/strata/blob/main/docs/decisions/0010-what-a-brand-may-set.md)).\n */\nexport const focusRing = css`\n :host(:focus-visible),\n :host(:not([disabled])) :focus-visible {\n outline: 2px solid transparent;\n outline-offset: ${t.focusOffset};\n box-shadow: ${t.focusShadow};\n }\n`;\n\n/**\n * WCAG 2.2, 2.5.8 Target Size (Minimum): 24 by 24 CSS pixels.\n *\n * Applied as a minimum rather than a fixed size so a control grows with its\n * content and never shrinks below the floor. It reads the locked token, which\n * is deliberately outside the spacing scale — otherwise a brand tightening its\n * spacing unit would shrink every tap target with it.\n */\nexport const targetSize = css`\n min-block-size: ${t.targetMin};\n min-inline-size: ${t.targetMin};\n`;\n\n/**\n * Visible to a screen reader, invisible on screen.\n *\n * `clip-path` with a 1px box rather than `display: none` or `visibility:\n * hidden`, both of which remove the text from the accessibility tree — which\n * is the one thing this must not do.\n */\nexport const visuallyHidden = css`\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n`;\n\n/**\n * 2.3.3 Animation from Interactions, and plain decency.\n *\n * `0.01ms` rather than `0` because a zero-duration transition does not fire a\n * `transitionend` event in every engine, and components that wait for one hang.\n */\nexport const reducedMotion = css`\n @media (prefers-reduced-motion: reduce) {\n :host,\n :host *,\n :host *::before,\n :host *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n }\n`;\n\n/** The base every component starts from. */\nexport const base = css`\n :host {\n box-sizing: border-box;\n font-family: ${t.fontBody};\n color: ${t.text};\n }\n :host([hidden]) {\n display: none !important;\n }\n *,\n *::before,\n *::after {\n box-sizing: inherit;\n }\n`;\n\n/**\n * On a touch screen a control is at least 44 by 44 CSS pixels.\n *\n * The 24px floor above is WCAG 2.2's minimum, and it is right for a mouse. A finger\n * is broader, and the design guide sets 44px on a touch screen, which is also\n * 2.5.5's enhanced size. It is applied by pointer rather than by width, because a\n * small laptop window is still driven by a mouse and a large tablet by a finger.\n * Pass the selectors that are the controls, inside the component's shadow root.\n */\nexport const touchTarget = (selector: string): CSSResult =>\n // Under :host, so it outweighs the component's own rule for the same control whatever the order.\n unsafeCSS(`@media (pointer: coarse) { :host :is(${selector}) { min-block-size: 44px; min-inline-size: 44px; } }`);\n\n/**\n * `hide-on`: an element left out on a phone, or on anything wider, so a phone's\n * header is built from the same pieces as a wide one. The width is the one the\n * nav folds at. A component that offers `hideOn` reflects it as `hide-on` and\n * adds this to its styles.\n */\nexport const hideOn = css`\n @media (max-width: 40rem) { :host([hide-on='phone']) { display: none !important; } }\n @media (min-width: 40.0625rem) { :host([hide-on='wide']) { display: none !important; } }\n`;\n","/**\n * The library's own words, in the page's language (ADR 0026).\n *\n * Every word a component shows that a page did not give it, such as \"Skip to\n * content\", \"Next slide\" or \"There is a problem\", goes through `say`. The\n * renderer puts the site's wording in place before it draws a page\n * (`applySiteLanguage` in `@atomic-ui/renderer-core`), translated into the page's\n * language and with any of the site's own rewording. Without it, the English\n * here is shown, which is what every site did before it had languages.\n *\n * The English is the key, with `{name}` for a value put in, so the list of\n * words to translate (`SITE_WORDING` in `@atomic-ui/content-schemas`) can be\n * checked against this library by a test.\n */\nconst WORDING = Symbol.for('strata.wording');\n\ntype Store = { words?: Record<string, string> };\n\nexport function say(english: string, values?: Record<string, string | number>): string {\n const words = (globalThis as Record<symbol, Store | undefined>)[WORDING]?.words;\n const chosen = words?.[english];\n const text = typeof chosen === 'string' && chosen.trim() ? chosen : english;\n return values ? text.replace(/\\{(\\w+)\\}/g, (whole, name: string) => (name in values ? String(values[name]) : whole)) : text;\n}\n","import { LitElement, css } from 'lit';\nimport { base, reducedMotion } from './styles';\nimport { say } from './say';\n\nlet counter = 0;\n\n/**\n * The base every Impakt component extends.\n *\n * It carries the two style fragments that are not a per-component choice — the\n * reset and the reduced-motion rule — and a stable id generator for the ARIA\n * wiring. It deliberately carries nothing else: a base class that grows\n * behaviour becomes the place every component's exceptions are negotiated.\n */\nexport class ImpaktElement extends LitElement {\n static styles = [base, reducedMotion, css``];\n\n /**\n * A unique id for this instance, for `aria-describedby` and friends.\n *\n * Generated once in the constructor rather than in `render`, because an id\n * that changes between renders breaks the relationship it exists to express\n * — and it breaks it silently, since the markup still looks correct.\n */\n protected readonly uid = `impakt-${(counter += 1)}`;\n\n protected id_(part: string): string {\n return `${this.uid}-${part}`;\n }\n\n /** @ignore */\n connectedCallback(): void {\n super.connectedCallback();\n this.sayDefaults();\n }\n\n /**\n * The words a component ships with, in the page's language (ADR 0026).\n *\n * Defaults stay plain English in the constructor, so the component manifest\n * still sees them (a prop with no default is read as required). When the\n * element joins the page, each word it holds is looked up in the site's\n * wording; anything that is not one of Strata's own words, such as a page's\n * own text or a variant name, is left exactly as it is.\n *\n * @ignore\n */\n private sayDefaults(): void {\n const props = (this.constructor as typeof LitElement).elementProperties;\n const self = this as unknown as Record<string, unknown>;\n for (const name of props.keys()) {\n const value = self[name as string];\n if (typeof value !== 'string' || !value) continue;\n const said = say(value);\n if (said !== value) self[name as string] = said;\n }\n }\n}\n"],"mappings":";AAmBA,SAAS,KAAK,iBAAiC;AAGxC,IAAM,QAAQ,CAAC,MAAc,aAAgC,UAAU,gBAAgB,KAAK,QAAQ,OAAO,GAAG,CAAC,KAAK,QAAQ,GAAG;AAE/H,IAAM,IAAI;AAAA,EACf,OAAO,MAAM,uBAAuB,SAAS;AAAA,EAC7C,YAAY,MAAM,qBAAqB,SAAS;AAAA,EAChD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,SAAS,MAAM,uBAAuB,SAAS;AAAA,EAE/C,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,cAAc,MAAM,uBAAuB,SAAS;AAAA,EACpD,eAAe,MAAM,wBAAwB,SAAS;AAAA,EAEtD,MAAM,MAAM,sBAAsB,SAAS;AAAA,EAC3C,WAAW,MAAM,oBAAoB,SAAS;AAAA,EAC9C,iBAAiB,MAAM,0BAA0B,SAAS;AAAA,EAC1D,aAAa,MAAM,sBAAsB,SAAS;AAAA,EAClD,MAAM,MAAM,mBAAmB,SAAS;AAAA,EACxC,WAAW,MAAM,yBAAyB,SAAS;AAAA,EAEnD,QAAQ,MAAM,wBAAwB,SAAS;AAAA,EAC/C,cAAc,MAAM,uBAAuB,SAAS;AAAA,EAEpD,QAAQ,MAAM,+BAA+B,SAAS;AAAA,EACtD,YAAY,MAAM,4BAA4B,SAAS;AAAA,EACvD,cAAc,MAAM,8BAA8B,SAAS;AAAA,EAC3D,SAAS,MAAM,gCAAgC,SAAS;AAAA,EACxD,aAAa,MAAM,6BAA6B,SAAS;AAAA,EACzD,eAAe,MAAM,+BAA+B,SAAS;AAAA,EAC7D,S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AAS,MAAO,MAAK,IAAc,IAAI;AAAA,IAC7C;AAAA,EACF;AACF;","names":["css","unsafeCSS","css","unsafeCSS","css","css"]}
@@ -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 = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.close'),\n css`\n dialog { box-sizing: border-box; display: none; flex-direction: column; inline-size: min(28rem, 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; color: ${t.text}; background: ${t.surfaceCard}; box-shadow: ${t.shadowXl}; animation: from-right 240ms cubic-bezier(0.16, 1, 0.3, 1); }\n dialog[open] { display: flex; }\n :host([side='left']) dialog { margin: 0 auto 0 0; animation-name: from-left; }\n :host([side='bottom']) dialog { inline-size: 100vw; block-size: fit-content; max-block-size: 90dvh; margin: auto 0 0 0; padding-block-end: env(safe-area-inset-bottom); border-radius: 28px 28px 0 0; animation-name: from-bottom; }\n :host([side='bottom']) .head { box-shadow: none; }\n :host([side='bottom']) .foot { box-shadow: none; }\n :host([side='bottom']) .foot ::slotted(*) { flex: 1; }\n @keyframes from-bottom { from { transform: translateY(100%); } }\n dialog::backdrop { background: color-mix(in srgb, ${t.text} 30%, transparent); backdrop-filter: blur(2px); }\n @keyframes from-right { from { transform: translateX(100%); } }\n @keyframes from-left { from { transform: translateX(-100%); } }\n .head { display: flex; align-items: center; justify-content: space-between; gap: ${space(3)}; padding: ${space(4)} ${space(5)}; box-shadow: 0 1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }\n h2 { margin: 0; font-family: ${t.fontHeading}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n .close { ${targetSize} display: inline-flex; align-items: center; justify-content: center; padding: 0; color: ${t.text}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .close:hover { background: ${t.surfaceSubtle}; }\n .body { flex: 1; overflow: auto; padding: ${space(5)}; }\n .foot { display: flex; gap: ${space(3)}; justify-content: flex-end; padding: ${space(4)} ${space(5)}; box-shadow: 0 -1px 0 color-mix(in srgb, ${t.text} 8%, transparent); }\n .foot[hidden] { display: none; }\n `,\n ];\n\n private hasFooter = false;\n\n private get dialog(): HTMLDialogElement | null {\n return this.renderRoot.querySelector('dialog');\n }\n\n updated(changed: Map<string, unknown>): void {\n if (!changed.has('open')) return;\n const dialog = this.dialog;\n if (!dialog) return;\n if (this.open) {\n if (typeof dialog.showModal === 'function') dialog.showModal();\n else dialog.setAttribute('open', '');\n lockScroll(this);\n } else {\n if (typeof dialog.close === 'function' && dialog.open) dialog.close();\n else dialog.removeAttribute('open');\n unlockScroll(this);\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n unlockScroll(this);\n }\n\n private close(): void {\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private footerChanged(event: Event): void {\n this.hasFooter = (event.target as HTMLSlotElement).assignedNodes().length > 0;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n return html`<dialog part=\"dialog\" aria-labelledby=${this.heading ? this.id_('heading') : nothing}\n @cancel=${() => this.close()}\n @close=${() => {\n if (this.open) this.close();\n }}\n @click=${(event: Event) => {\n if (event.target === this.dialog) this.close();\n }}>\n <div class=\"head\">\n ${this.heading ? html`<h2 id=${this.id_('heading')}>${this.heading}</h2>` : html`<span></span>`}\n <button class=\"close\" type=\"button\" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg('close', '20px')}</button>\n </div>\n <div class=\"body\" part=\"body\"><slot></slot></div>\n <div class=\"foot\" part=\"footer\" ?hidden=${!this.hasFooter}><slot name=\"footer\" @slotchange=${this.footerChanged}></slot></div>\n </dialog>`;\n }\n}\n\nconst TOAST_ICON: Record<string, string> = { neutral: 'info', success: 'check', warning: 'warning', danger: 'warning' };\n\n/**\n * A short message in the corner that goes away: \"Viewing booked\", \"Saved\".\n *\n * It says itself to a screen reader through a live region that is on the page\n * before the message is, and its timer stops while it is pointed at or focused.\n * Set `duration` to 0 to keep it up until it is closed. A message with a button,\n * such as Undo, stays until it is closed whatever the duration, because a\n * button that disappears on a timer cannot be pressed by someone who needs\n * longer (2.2.1). Escape closes it while focus is inside it. Anything a person\n * must act on belongs in an alert on the page.\n *\n * It never takes the page's clicks: only the message itself can be pressed, so\n * the page beside and behind the corner it sits in still works. On a phone it\n * spans the screen above the bottom edge, clear of the home bar and of a bottom\n * bar that sets `--impakt-bottom-bar`, and it rises without moving for anyone who\n * has asked for reduced motion.\n *\n * @category feedback\n * @icon toast\n * @fires {CustomEvent<null>} impakt-close - When the message goes away.\n * @fires {CustomEvent<null>} impakt-action - When its button is pressed.\n */\nexport class ImpaktToast extends ImpaktElement {\n static properties = {\n open: { type: Boolean, reflect: true },\n message: { type: String },\n tone: { type: String, reflect: true },\n duration: { type: Number },\n actionText: { type: String, attribute: 'action-text' },\n closeLabel: { type: String, attribute: 'close-label' },\n };\n declare open: boolean;\n declare message: string;\n declare tone: 'neutral' | 'success' | 'warning' | 'danger';\n /** How long it stays. 0 keeps it up until it is closed. */\n declare duration: number;\n declare actionText: string;\n declare closeLabel: string;\n\n private timer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n super();\n this.open = false;\n this.message = '';\n this.tone = 'neutral';\n this.duration = 6;\n this.actionText = '';\n this.closeLabel = 'Dismiss';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n css`\n .region { position: fixed; inset-block-end: calc(${space(4)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); inset-inline-end: ${space(4)}; z-index: 1000; inline-size: min(24rem, calc(100vw - ${space(8)})); pointer-events: none; }\n @media (max-width: 40rem) { .region { inset-inline: ${space(3)}; inline-size: auto; inset-block-end: calc(${space(3)} + env(safe-area-inset-bottom, 0px) + var(--impakt-bottom-bar, 0px)); } }\n .toast { pointer-events: auto; max-block-size: 40vh; overflow: auto; display: flex; align-items: flex-start; gap: ${space(3)}; padding: ${space(3)} ${space(3)} ${space(3)} ${space(4)}; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusXl}; box-shadow: ${t.shadowXl}, 0 0 0 1px color-mix(in srgb, ${t.text} 8%, transparent); animation: rise 220ms cubic-bezier(0.16, 1, 0.3, 1); }\n /* It rises without fading in, so its words are at full contrast from the first frame they are read in (1.4.3). */\n @keyframes rise { from { transform: translateY(${space(3)}); } }\n .mark { display: inline-flex; flex: none; margin-block-start: ${space(0.5)}; color: ${t.info}; }\n :host([tone='success']) .mark { color: ${t.success}; }\n :host([tone='warning']) .mark { color: ${t.warning}; }\n :host([tone='danger']) .mark { color: ${t.danger}; }\n .message { flex: 1; align-self: center; margin: 0; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .action, .close { ${targetSize} padding: 0 ${space(2)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('semibold')}; color: ${t.link}; background: none; border: 0; border-radius: ${t.radius}; cursor: pointer; }\n .close { display: inline-flex; align-items: center; justify-content: center; color: ${t.textMuted}; }\n .action:hover, .close:hover { background: ${t.surfaceSubtle}; }\n `,\n touchTarget('.action, .close'),\n ];\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.stop();\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('open') || changed.has('duration')) {\n this.stop();\n if (this.open) this.start();\n }\n }\n\n private start(): void {\n this.stop();\n if (this.duration > 0 && !this.actionText) this.timer = setTimeout(() => this.close(), this.duration * 1000);\n }\n\n private stop(): void {\n if (this.timer) clearTimeout(this.timer);\n this.timer = undefined;\n }\n\n private close(): void {\n this.stop();\n if (!this.open) return;\n this.open = false;\n this.dispatchEvent(new CustomEvent('impakt-close', { bubbles: true, composed: true }));\n }\n\n private action(): void {\n this.dispatchEvent(new CustomEvent('impakt-action', { bubbles: true, composed: true }));\n this.close();\n }\n\n render(): TemplateResult {\n return html`<div class=\"region\" role=\"status\" aria-live=\"polite\">\n ${\n this.open\n ? html`<div class=\"toast\" part=\"toast\" @mouseenter=${this.stop} @mouseleave=${this.start} @focusin=${this.stop} @focusout=${this.start}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n this.close();\n }\n }}>\n <span class=\"mark\">${iconSvg(TOAST_ICON[this.tone] ?? 'info', '20px')}</span>\n <p class=\"message\">${this.message}</p>\n ${this.actionText ? html`<button class=\"action\" type=\"button\" @click=${this.action}>${this.actionText}</button>` : nothing}\n <button class=\"close\" type=\"button\" aria-label=${this.closeLabel} @click=${this.close}>${iconSvg('close', '16px')}</button>\n </div>`\n : nothing\n }\n </div>`;\n }\n}\n\nexport interface MenuItem {\n id?: string;\n text: string;\n /** Where it goes. Without one it fires impakt-select with its value. */\n href?: string;\n value?: string;\n icon?: string;\n tone?: '' | 'danger';\n}\n\n/**\n * A button that opens a short list of actions or links.\n *\n * It follows the ARIA menu button pattern: the arrow keys, Home and End move\n * through it, a letter moves to the next item that starts with it, Escape\n * closes it and puts focus back on the button, and a click anywhere else closes\n * it. A list that would run off the side of the screen opens towards the other\n * edge instead, so it never makes a phone scroll sideways.\n *\n * **The button can hold your own content.** Put an avatar and a name in the\n * `trigger` slot for an account menu; they replace the icon and label, and\n * become the button's accessible name, so include the words. Put who is signed\n * in, or any other note, in the `header` slot; it sits above the items and\n * outside the menu, so the arrow keys still move through the items alone.\n *\n * @category navigation\n * @icon menu\n * @slot trigger - What the button shows, in place of the icon and label.\n * @slot header - A note above the items, such as the name and email of who is signed in.\n * @csspart trigger - The button.\n * @csspart chevron - The arrow on the button.\n * @csspart panel - The box that opens, holding the header and the items.\n * @csspart header - The box round the header slot.\n * @csspart list - The list of items.\n * @fires {CustomEvent<{ value: string }>} impakt-select - When an item without an address is chosen. The value is in detail.value.\n */\nexport class ImpaktMenu extends ImpaktElement {\n static properties = {\n label: { type: String },\n icon: { type: String },\n items: { type: Array },\n edge: { type: String, reflect: true },\n open: { type: Boolean, reflect: true },\n };\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 = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.trigger, .item'),\n css`\n :host { position: relative; display: inline-block; }\n .trigger { ${targetSize} display: inline-flex; align-items: center; gap: ${space(2)}; padding: ${space(2)} ${space(3.5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('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 .panel { position: absolute; z-index: 100; inset-block-start: calc(100% + ${space(1.5)}); inset-inline-start: 0; box-sizing: border-box; min-inline-size: 13rem; max-inline-size: min(20rem, 90vw); padding: ${space(1.5)}; 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 .list { margin: 0; padding: 0; list-style: none; }\n .header { padding: ${space(2)} ${space(2.5)} ${space(2.5)}; margin-block-end: ${space(1.5)}; border-block-end: ${t.borderThin} solid ${t.border}; ${type('sm')} color: ${t.textMuted}; overflow-wrap: anywhere; }\n :host([edge='end']) .panel, .panel.flip-end { inset-inline: auto 0; }\n :host([edge='end']) .panel.flip-start { inset-inline: 0 auto; }\n @keyframes pop { from { opacity: 0; transform: translateY(-${space(1)}); } }\n .item { ${targetSize} box-sizing: border-box; display: flex; align-items: center; gap: ${space(2.5)}; inline-size: 100%; padding: ${space(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\n private outside = (event: Event): void => {\n if (!event.composedPath().includes(this)) this.toggle(false);\n };\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('click', this.outside);\n }\n\n private get entries(): HTMLElement[] {\n return Array.from(this.renderRoot.querySelectorAll<HTMLElement>('.item'));\n }\n\n private get trigger(): HTMLElement | null {\n return this.renderRoot.querySelector('.trigger');\n }\n\n private toggle(open: boolean, focus?: 'first' | 'last'): void {\n this.open = open;\n if (open) {\n document.addEventListener('click', this.outside);\n void this.updateComplete.then(() => {\n this.keepOnScreen();\n this.entries[focus === 'last' ? this.entries.length - 1 : 0]?.focus();\n });\n } else document.removeEventListener('click', this.outside);\n }\n\n /** Open towards the other edge when the list would run off the screen. */\n private keepOnScreen(): void {\n const list = this.renderRoot.querySelector<HTMLElement>('.panel');\n if (!list) return;\n list.classList.remove('flip-start', 'flip-end');\n const box = list.getBoundingClientRect();\n const width = document.documentElement.clientWidth;\n if (box.right > width - 8) list.classList.add('flip-end');\n else if (box.left < 8) list.classList.add('flip-start');\n }\n\n private triggerKey(event: KeyboardEvent): void {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n this.toggle(true, event.key === 'ArrowUp' ? 'last' : 'first');\n }\n }\n\n private listKey(event: KeyboardEvent): void {\n const entries = this.entries;\n const at = entries.indexOf((this.renderRoot as ShadowRoot).activeElement as HTMLElement);\n const go: Record<string, number> = {\n ArrowDown: (at + 1) % entries.length,\n ArrowUp: (at - 1 + entries.length) % entries.length,\n Home: 0,\n End: entries.length - 1,\n };\n if (event.key in go) {\n event.preventDefault();\n entries[go[event.key]!]?.focus();\n } else if (event.key.length === 1 && /\\S/.test(event.key) && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const letter = event.key.toLowerCase();\n const next = [...entries.slice(at + 1), ...entries.slice(0, at + 1)].find((e) => (e.textContent ?? '').trim().toLowerCase().startsWith(letter));\n next?.focus();\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.toggle(false);\n this.trigger?.focus();\n } else if (event.key === 'Tab') this.toggle(false);\n }\n\n private choose(item: MenuItem): 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}><slot name=\"trigger\">${iconSvg(this.icon, '18px')}${this.label}</slot><span class=\"chev\" part=\"chevron\">${iconSvg('chevron-down', '16px')}</span></button>\n ${\n this.open\n ? html`<div class=\"panel\" part=\"panel\">${\n this.querySelector?.(':scope > [slot=\"header\"]') ? html`<div class=\"header\" part=\"header\"><slot name=\"header\"></slot></div>` : nothing\n }<ul class=\"list\" part=\"list\" id=${this.id_('list')} role=\"menu\" aria-label=${this.label} @keydown=${this.listKey}>\n ${this.items.map(\n (item) =>\n html`<li role=\"none\">${\n 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>`\n }</li>`,\n )}\n </ul></div>`\n : nothing\n }`;\n }\n}\n\n/** Which page numbers to show: the ends and the neighbours, with gaps between. */\nexport function pageWindow(page: number, pages: number): Array<number | 'gap'> {\n const wanted = [...new Set([1, page - 1, page, page + 1, pages])].filter((n) => n >= 1 && n <= pages).sort((a, b) => a - b);\n return wanted.flatMap((n, i): Array<number | 'gap'> => {\n const previous = wanted[i - 1];\n if (previous === undefined || n === previous + 1) return [n];\n return n === previous + 2 ? [previous + 1, n] : ['gap', n];\n });\n}\n\n/**\n * Page numbers for a long list.\n *\n * Give it `href-pattern` and every number is a real link, with `{page}` swapped\n * for the number. Without one the numbers are buttons and it fires\n * `impakt-page`. On a narrow screen the numbers fold to \"Page 2 of 9\".\n *\n * @category navigation\n * @icon pagination\n * @fires {CustomEvent<{ page: number }>} impakt-page - When a page is chosen. The number is in detail.page.\n */\nexport class ImpaktPagination extends ImpaktElement {\n static properties = {\n page: { type: Number },\n pages: { type: Number },\n hrefPattern: { type: String, attribute: 'href-pattern' },\n label: { type: String },\n previousText: { type: String, attribute: 'previous-text' },\n nextText: { type: String, attribute: 'next-text' },\n };\n declare page: number;\n declare pages: number;\n declare hrefPattern: string;\n declare label: string;\n declare previousText: string;\n declare nextText: string;\n\n constructor() {\n super();\n this.page = 1;\n this.pages = 1;\n this.hrefPattern = '';\n this.label = 'Pages';\n this.previousText = 'Previous';\n this.nextText = 'Next';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n focusRing,\n touchTarget('.n, .step'),\n css`\n :host { display: block; container-type: inline-size; }\n nav { display: flex; align-items: center; justify-content: space-between; gap: ${space(2)}; }\n ul { display: flex; align-items: center; gap: ${space(1)}; margin: 0; padding: 0; list-style: none; }\n .n, .step { ${targetSize} box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: ${space(1.5)}; min-inline-size: 44px; padding: 0 ${space(2.5)}; font: inherit; ${type('sm')} font-weight: ${fontWeight('medium')}; color: ${t.text}; text-decoration: none; background: none; border: 0; border-radius: ${t.radiusLg}; cursor: pointer; }\n .n:hover, .step:hover { background: ${t.surfaceSubtle}; }\n .n[aria-current] { color: ${t.onBrand}; background: ${t.brand}; font-weight: ${fontWeight('semibold')}; }\n .step[aria-disabled='true'] { color: ${t.textMuted}; opacity: 0.55; background: none; cursor: not-allowed; }\n .gap { color: ${t.textMuted}; padding: 0 ${space(1)}; }\n .count { display: none; ${type('sm')} color: ${t.textMuted}; }\n @container (max-width: 34rem) { ul { display: none; } .count { display: block; } }\n `,\n ];\n\n private go(page: number, event: Event): void {\n if (this.hrefPattern) return;\n event.preventDefault();\n this.page = page;\n this.dispatchEvent(new CustomEvent('impakt-page', { detail: { page }, bubbles: true, composed: true }));\n }\n\n private link(page: number, classes: string, content: unknown, label: string, current: boolean): TemplateResult {\n return this.hrefPattern\n ? html`<a class=${classes} href=${this.hrefPattern.replace('{page}', String(page))} aria-label=${label} aria-current=${current ? 'page' : nothing}>${content}</a>`\n : html`<button class=${classes} type=\"button\" aria-label=${label} aria-current=${current ? 'page' : nothing} @click=${(e: Event) => this.go(page, e)}>${content}</button>`;\n }\n\n private step(to: number, words: string, icon: string, off: boolean): TemplateResult {\n const content = icon === 'arrow-left' ? html`${iconSvg(icon, '16px')}${words}` : html`${words}${iconSvg(icon, '16px')}`;\n return off ? html`<span class=\"step\" aria-disabled=\"true\">${content}</span>` : this.link(to, 'step', content, words, false);\n }\n\n render(): TemplateResult {\n const page = Math.min(Math.max(this.page, 1), Math.max(this.pages, 1));\n return html`<nav aria-label=${this.label} part=\"nav\">\n ${this.step(page - 1, this.previousText, 'arrow-left', page <= 1)}\n <ul>${pageWindow(page, this.pages).map((n) => html`<li>${n === 'gap' ? html`<span class=\"gap\" aria-hidden=\"true\">…</span>` : this.link(n, 'n', n, say('Page {page}', { page: n }), n === page)}</li>`)}</ul>\n <span class=\"count\">${say('Page {page} of {pages}', { page, pages: this.pages })}</span>\n ${this.step(page + 1, this.nextText, 'arrow-right', page >= this.pages)}\n </nav>`;\n }\n}\n\nconst initialsOf = (name: string): string => {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n return ((words[0]?.[0] ?? '') + (words.length > 1 ? words[words.length - 1]![0]! : '')).toUpperCase();\n};\n\n/**\n * A person's photo, or their initials when there is no photo or it fails.\n *\n * @category content\n * @icon avatar\n */\nexport class ImpaktAvatar extends ImpaktElement {\n static properties = {\n fullName: { type: String, attribute: 'full-name' },\n src: { type: String },\n size: { type: String, reflect: true },\n };\n declare fullName: string;\n declare src: string;\n 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 = [\n ...ImpaktElement.styles,\n css`\n :host { --size: 40px; display: inline-block; inline-size: var(--size); block-size: var(--size); vertical-align: middle; }\n :host([size='sm']) { --size: 32px; }\n :host([size='lg']) { --size: 56px; }\n :host([size='xl']) { --size: 80px; }\n .face { display: flex; align-items: center; justify-content: center; inline-size: 100%; block-size: 100%; overflow: hidden; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; font-size: calc(var(--size) * 0.38); font-weight: ${fontWeight('semibold')}; }\n img { inline-size: 100%; block-size: 100%; object-fit: cover; }\n `,\n ];\n\n willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('src')) this.failed = false;\n }\n\n render(): TemplateResult {\n if (this.src && !this.failed) {\n return html`<div class=\"face\"><img src=${this.src} alt=${this.fullName} @error=${() => {\n this.failed = true;\n this.requestUpdate();\n }} /></div>`;\n }\n return html`<div class=\"face\" role=\"img\" aria-label=${this.fullName || say('Person')}>${initialsOf(this.fullName) || iconSvg('user', '55%')}</div>`;\n }\n}\n\nexport interface AvatarItem {\n id?: string;\n name: string;\n src?: string;\n}\n\n/**\n * A few people overlapped in a row, with a count for the rest: the sales team,\n * the neighbours who have already moved in.\n *\n * @category content\n * @icon avatars\n */\nexport class ImpaktAvatarGroup extends ImpaktElement {\n static properties = {\n items: { type: Array },\n max: { type: Number },\n size: { type: String, reflect: true },\n moreLabel: { type: String, attribute: 'more-label' },\n };\n declare items: AvatarItem[];\n declare max: number;\n 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 = [\n ...ImpaktElement.styles,\n css`\n ul { display: flex; margin: 0; padding: 0; list-style: none; }\n li { margin-inline-start: -${space(2.5)}; border-radius: 50%; box-shadow: 0 0 0 2px ${t.surfaceCard}; line-height: 0; }\n li:first-child { margin-inline-start: 0; }\n .more { display: flex; align-items: center; justify-content: center; inline-size: 40px; block-size: 40px; ${type('xs')} line-height: 1; font-weight: ${fontWeight('semibold')}; color: ${t.text}; background: ${t.surfaceSubtle}; border-radius: 50%; }\n :host([size='sm']) .more { inline-size: 32px; block-size: 32px; }\n :host([size='lg']) .more { inline-size: 56px; block-size: 56px; }\n .sr { ${visuallyHidden} }\n `,\n ];\n\n render(): TemplateResult {\n const shown = this.items.slice(0, this.max);\n const rest = this.items.length - shown.length;\n return html`<ul part=\"list\">\n ${shown.map((item) => html`<li><impakt-avatar full-name=${item.name} src=${item.src ?? ''} size=${this.size}></impakt-avatar></li>`)}\n ${rest > 0 ? html`<li><span class=\"more\"><span aria-hidden=\"true\">+${rest}</span><span class=\"sr\">${rest} ${this.moreLabel}</span></span></li>` : nothing}\n </ul>`;\n }\n}\n\n/**\n * What a list says when it has nothing in it, and what to do about that.\n *\n * @category feedback\n * @icon empty\n * @role heading\n * @slot actions - The next thing to do, usually one button.\n */\nexport class ImpaktEmptyState extends ImpaktElement {\n static properties = {\n icon: { type: String },\n heading: { type: String },\n lead: { type: String },\n framed: { type: Boolean, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare icon: string;\n declare heading: string;\n declare lead: string;\n /** Draws a dashed outline round it. */\n declare framed: boolean;\n declare headingLevel: 2 | 3 | 4;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n constructor() {\n super();\n this.icon = 'search';\n this.heading = '';\n this.lead = '';\n this.framed = false;\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n css`\n .wrap { display: flex; flex-direction: column; align-items: center; gap: ${space(2)}; padding: ${space(12)} ${space(6)}; text-align: center; }\n :host([framed]) .wrap { border: ${t.borderThin} dashed ${t.border}; border-radius: ${t.radiusXl}; }\n .mark { display: inline-flex; align-items: center; justify-content: center; inline-size: 56px; block-size: 56px; margin-block-end: ${space(2)}; color: ${t.brand}; background: ${t.brandSubtle}; border-radius: 50%; }\n .h { margin: 0; font-family: ${t.fontHeading}; ${type('xl')} font-weight: ${fontWeight('bold')}; color: ${t.textHeading}; }\n p { margin: 0; max-inline-size: 42ch; color: ${t.textMuted}; text-wrap: pretty; }\n .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: ${space(3)}; margin-block-start: ${space(3)}; }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"wrap\" part=\"wrap\">\n <span class=\"mark\">${iconSvg(this.icon, '26px')}</span>\n ${this.heading ? html`<div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${this.heading}</div>` : nothing}\n ${this.lead ? html`<p>${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>`;\n }\n}\n\nexport interface SlotDay {\n id?: string;\n /** The day, as 2026-11-14. */\n date: string;\n /** The times on offer, separated by commas: 10:00, 11:30, 14:00. */\n times: string;\n}\n\nconst timesOf = (day: SlotDay | undefined): string[] =>\n String(day?.times ?? '')\n .split(',')\n .map((time) => time.trim())\n .filter(Boolean);\n\n/** A day's parts in the page's language. A date that cannot be read is shown as it was written. */\nfunction dayParts(date: string): { weekday: string; day: string; month: string } {\n const parsed = new Date(`${date}T00:00:00Z`);\n if (Number.isNaN(parsed.getTime())) return { weekday: '', day: date, month: '' };\n const locale = pageLocale();\n const part = (options: Intl.DateTimeFormatOptions): string => new Intl.DateTimeFormat(locale, { timeZone: 'UTC', ...options }).format(parsed);\n return { weekday: part({ weekday: 'short' }), day: part({ day: 'numeric' }), month: part({ month: 'short' }) };\n}\n\n/**\n * Choose a day, then a time: a viewing, a call back, a site visit.\n *\n * Both rows are native radios under the styling, so the arrow keys and screen\n * readers work as they do for any radio group. Its value is the day and time\n * together, as 2026-11-14T10:00.\n *\n * @category form\n * @icon calendar\n */\nexport class ImpaktSlotPicker extends FieldElement {\n static properties = {\n ...FieldElement.properties,\n days: { type: Array },\n dayLabel: { type: String, attribute: 'day-label' },\n timeLabel: { type: String, attribute: 'time-label' },\n emptyText: { type: String, attribute: 'empty-text' },\n };\n declare days: SlotDay[];\n declare dayLabel: string;\n declare timeLabel: string;\n /** What is said when no times are on offer. */\n declare emptyText: string;\n\n private day = '';\n\n constructor() {\n super();\n this.days = [];\n this.dayLabel = 'Day';\n this.timeLabel = 'Time';\n this.emptyText = 'No times are available at the moment.';\n }\n\n static styles = [\n ...FieldElement.styles,\n css`\n fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }\n legend { padding: 0; }\n .row-label { ${type('sm')} color: ${t.textMuted}; margin-block: ${space(2)}; }\n .days { display: flex; gap: ${space(2)}; overflow-x: auto; padding: ${space(1)}; margin: -${space(1)}; scrollbar-width: thin; }\n .times { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: ${space(2)}; }\n label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; box-sizing: border-box; min-block-size: 44px; color: ${t.text}; background: ${t.surfaceCard}; border-radius: ${t.radiusLg}; box-shadow: inset 0 0 0 1px ${t.border}; cursor: pointer; transition: background-color 120ms ease-in-out; }\n label:hover { background: ${t.surfaceSubtle}; }\n label:has(input:checked) { color: ${t.onBrand}; background: ${t.brand}; box-shadow: none; }\n label:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }\n input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }\n .day { flex: none; inline-size: 4.5rem; padding-block: ${space(2.5)}; }\n .weekday, .month { ${type('xs')} }\n .num { ${type('xl')} font-weight: ${fontWeight('semibold')}; }\n .time { padding: ${space(2)}; ${type('sm')} font-weight: ${fontWeight('medium')}; }\n .empty { margin: 0; color: ${t.textMuted}; }\n :host([invalid]) .days label, :host([invalid]) .times label { box-shadow: inset 0 0 0 1px ${t.danger}; }\n `,\n ];\n\n private get currentDay(): SlotDay | undefined {\n const wanted = this.day || this.value.split('T')[0];\n return this.days.find((day) => day.date === wanted) ?? this.days[0];\n }\n\n private chooseDay(date: string): void {\n this.day = date;\n if (this.value && !this.value.startsWith(`${date}T`)) this.setFormValue('');\n this.requestUpdate();\n }\n\n protected renderLabel(): TemplateResult {\n return html`<legend class=\"label\" part=\"label\">${this.label}${this.required ? html`<span class=\"required\"> (${this.requiredText})</span>` : nothing}</legend>`;\n }\n\n protected renderControl(): TemplateResult {\n const current = this.currentDay;\n if (!current) return html`<p class=\"empty\">${this.emptyText}</p>`;\n return html`\n <div class=\"row-label\" id=${this.id_('days')}>${this.dayLabel}</div>\n <div class=\"days\" part=\"days\" role=\"radiogroup\" aria-labelledby=${this.id_('days')}>\n ${this.days.map((day) => {\n const parts = dayParts(day.date);\n return html`<label class=\"day\"><input type=\"radio\" name=${`${this.uid}-day`} .checked=${day.date === current.date} ?disabled=${this.disabled} @change=${() => this.chooseDay(day.date)} />\n <span class=\"weekday\">${parts.weekday}</span><span class=\"num\">${parts.day}</span><span class=\"month\">${parts.month}</span></label>`;\n })}\n </div>\n <div class=\"row-label\" id=${this.id_('times')}>${this.timeLabel}</div>\n <div class=\"times\" part=\"times\" role=\"radiogroup\" aria-labelledby=${this.id_('times')}>\n ${timesOf(current).map((time, i) => {\n const value = `${current.date}T${time}`;\n return html`<label class=\"time\"><input type=\"radio\" name=${`${this.uid}-time`} .checked=${this.value === value} ?required=${this.required && i === 0} ?disabled=${this.disabled} @change=${() => this.setFormValue(value)} />${time}</label>`;\n })}\n </div>`;\n }\n\n render(): TemplateResult {\n return html`<fieldset part=\"fieldset\" ?disabled=${this.disabled} aria-describedby=${this.describedBy} aria-invalid=${this.error ? 'true' : nothing}>\n ${this.renderLabel()}\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">${this.description}</div>` : nothing}\n ${this.renderControl()}\n <div class=\"error\" id=${this.id_('error')} part=\"error\" aria-live=\"polite\">${this.error || nothing}</div>\n </fieldset>`;\n }\n\n updated(changed: Map<string, unknown>): void {\n if (changed.has('error')) this.toggleAttribute('invalid', Boolean(this.error));\n }\n}\n\ncustomElements.define('impakt-drawer', ImpaktDrawer);\ncustomElements.define('impakt-toast', ImpaktToast);\ncustomElements.define('impakt-menu', ImpaktMenu);\ncustomElements.define('impakt-pagination', ImpaktPagination);\ncustomElements.define('impakt-avatar', ImpaktAvatar);\ncustomElements.define('impakt-avatar-group', ImpaktAvatarGroup);\ncustomElements.define('impakt-empty-state', ImpaktEmptyState);\ncustomElements.define('impakt-slot-picker', ImpaktSlotPicker);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-drawer': ImpaktDrawer;\n 'impakt-toast': ImpaktToast;\n 'impakt-menu': ImpaktMenu;\n 'impakt-pagination': ImpaktPagination;\n 'impakt-avatar': ImpaktAvatar;\n 'impakt-avatar-group': ImpaktAvatarGroup;\n 'impakt-empty-state': ImpaktEmptyState;\n 'impakt-slot-picker': ImpaktSlotPicker;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AA6BjD,IAAM,eAAN,cAA2B,cAAc;AAAA,EAa9C,cAAc;AACZ,UAAM;AAiCR,SAAQ,YAAY;AAhClB,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,aAAa;AAAA,EACpB;AAAA,EAlBA;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACrC,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,YAAY,EAAE,MAAM,QAAQ,WAAW,cAAc;AAAA,IACvD;AAAA;AAAA,EAeA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA,MACA,YAAY,QAAQ;AAAA,MACpB;AAAA,oOACgO,EAAE,IAAI,iBAAiB,EAAE,WAAW,iBAAiB,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