@atomic-ui/ui 0.1.4 → 0.1.5

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 (90) hide show
  1. package/README.md +18 -6
  2. package/dist/base/FieldElement.d.ts +7 -0
  3. package/dist/{chunk-A4CJ2F3J.js → chunk-4AJPS5AU.js} +8 -4
  4. package/dist/chunk-4AJPS5AU.js.map +1 -0
  5. package/dist/{chunk-QYHWR6C5.js → chunk-4JKUAA6K.js} +8 -4
  6. package/dist/chunk-4JKUAA6K.js.map +1 -0
  7. package/dist/{chunk-TIKX5POO.js → chunk-57P4WO4Y.js} +32 -12
  8. package/dist/chunk-57P4WO4Y.js.map +1 -0
  9. package/dist/{chunk-OBCSDZHP.js → chunk-5RVMMKMO.js} +2 -2
  10. package/dist/{chunk-DIZCGSJA.js → chunk-6GKI67P7.js} +14 -2
  11. package/dist/chunk-6GKI67P7.js.map +1 -0
  12. package/dist/chunk-AXQ5YBN2.js +236 -0
  13. package/dist/chunk-AXQ5YBN2.js.map +1 -0
  14. package/dist/chunk-CFGLOYWW.js +85 -0
  15. package/dist/chunk-CFGLOYWW.js.map +1 -0
  16. package/dist/{chunk-ZXCSQ6MK.js → chunk-DI2CJ3MZ.js} +9 -1
  17. package/dist/chunk-DI2CJ3MZ.js.map +1 -0
  18. package/dist/{chunk-LFOWTFMR.js → chunk-DR3SJ7ZV.js} +2 -2
  19. package/dist/chunk-G6UVYMA6.js +56 -0
  20. package/dist/chunk-G6UVYMA6.js.map +1 -0
  21. package/dist/{chunk-CGMDIZPO.js → chunk-H6L3FSQY.js} +2 -2
  22. package/dist/{chunk-4KFHQBH2.js → chunk-JPEWRJSQ.js} +16 -3
  23. package/dist/chunk-JPEWRJSQ.js.map +1 -0
  24. package/dist/{chunk-PDXOPY22.js → chunk-KWURASAB.js} +2 -2
  25. package/dist/chunk-LLRJU7XE.js +195 -0
  26. package/dist/chunk-LLRJU7XE.js.map +1 -0
  27. package/dist/{chunk-4Y3HJBJY.js → chunk-OFAVRPRK.js} +2 -1
  28. package/dist/chunk-OFAVRPRK.js.map +1 -0
  29. package/dist/{chunk-GGODB3GY.js → chunk-QELX47AP.js} +70 -8
  30. package/dist/chunk-QELX47AP.js.map +1 -0
  31. package/dist/chunk-QH46SOPJ.js +134 -0
  32. package/dist/chunk-QH46SOPJ.js.map +1 -0
  33. package/dist/chunk-U2S7OESF.js +135 -0
  34. package/dist/chunk-U2S7OESF.js.map +1 -0
  35. package/dist/{chunk-MAMBT7BZ.js → chunk-ZDYTNFQI.js} +8 -4
  36. package/dist/chunk-ZDYTNFQI.js.map +1 -0
  37. package/dist/components/blocks.d.ts +174 -0
  38. package/dist/components/blocks.js +17 -0
  39. package/dist/components/blocks.js.map +1 -0
  40. package/dist/components/button.d.ts +26 -0
  41. package/dist/components/button.js +2 -1
  42. package/dist/components/checkbox-group.js +2 -2
  43. package/dist/components/checkbox.js +2 -2
  44. package/dist/components/date-input.js +2 -2
  45. package/dist/components/fieldset.d.ts +49 -0
  46. package/dist/components/fieldset.js +8 -0
  47. package/dist/components/fieldset.js.map +1 -0
  48. package/dist/components/grid.d.ts +1 -1
  49. package/dist/components/grid.js +1 -1
  50. package/dist/components/icon.d.ts +89 -0
  51. package/dist/components/icon.js +14 -0
  52. package/dist/components/icon.js.map +1 -0
  53. package/dist/components/layout.d.ts +65 -2
  54. package/dist/components/layout.js +1 -1
  55. package/dist/components/link.d.ts +11 -0
  56. package/dist/components/link.js +2 -1
  57. package/dist/components/marketing.d.ts +257 -0
  58. package/dist/components/marketing.js +17 -0
  59. package/dist/components/marketing.js.map +1 -0
  60. package/dist/components/media.d.ts +12 -0
  61. package/dist/components/media.js +1 -1
  62. package/dist/components/navigation.d.ts +91 -0
  63. package/dist/components/navigation.js +11 -0
  64. package/dist/components/navigation.js.map +1 -0
  65. package/dist/components/page.d.ts +119 -0
  66. package/dist/components/page.js +10 -0
  67. package/dist/components/page.js.map +1 -0
  68. package/dist/components/radio-group.js +2 -2
  69. package/dist/components/select.d.ts +6 -0
  70. package/dist/components/select.js +2 -2
  71. package/dist/components/text-input.d.ts +6 -0
  72. package/dist/components/text-input.js +2 -2
  73. package/dist/components/textarea.d.ts +6 -0
  74. package/dist/components/textarea.js +2 -2
  75. package/dist/index.d.ts +6 -0
  76. package/dist/index.js +82 -32
  77. package/package.json +2 -2
  78. package/dist/chunk-4KFHQBH2.js.map +0 -1
  79. package/dist/chunk-4Y3HJBJY.js.map +0 -1
  80. package/dist/chunk-A4CJ2F3J.js.map +0 -1
  81. package/dist/chunk-DIZCGSJA.js.map +0 -1
  82. package/dist/chunk-GGODB3GY.js.map +0 -1
  83. package/dist/chunk-MAMBT7BZ.js.map +0 -1
  84. package/dist/chunk-QYHWR6C5.js.map +0 -1
  85. package/dist/chunk-TIKX5POO.js.map +0 -1
  86. package/dist/chunk-ZXCSQ6MK.js.map +0 -1
  87. /package/dist/{chunk-OBCSDZHP.js.map → chunk-5RVMMKMO.js.map} +0 -0
  88. /package/dist/{chunk-LFOWTFMR.js.map → chunk-DR3SJ7ZV.js.map} +0 -0
  89. /package/dist/{chunk-CGMDIZPO.js.map → chunk-H6L3FSQY.js.map} +0 -0
  90. /package/dist/{chunk-PDXOPY22.js.map → chunk-KWURASAB.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/marketing.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, lineHeight, space, spaceAround, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/** A heading at a level the author chose, drawn at a size the component chose. */\nconst heading = (level: number, text: string, cls: string): TemplateResult =>\n html`<div class=${cls} role=\"heading\" aria-level=${level}>${text}</div>`;\n\nconst headingStyles = css`\n .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; }\n .eyebrow { margin: 0; color: ${t.brand}; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('semibold')}; letter-spacing: 0.06em; text-transform: uppercase; }\n .body { margin: 0; line-height: ${lineHeight('normal')}; max-inline-size: 65ch; }\n`;\n\n/**\n * The opening of a page: a short label, a big heading, a line of text, the\n * page's main actions and, beside them, a picture.\n *\n * Put the buttons in the `actions` slot. The picture goes beside the words on\n * a wide screen and below them on a phone, so the heading is always the first\n * thing read.\n *\n * @category layout\n * @icon hero\n * @role heading\n * @slot actions - The page's main buttons and links.\n */\nexport class ImpktHero extends ImpktElement {\n static properties = {\n eyebrow: { type: String },\n heading: { type: String },\n lead: { type: String },\n level: { type: Number, reflect: true },\n imageSrc: { type: String, attribute: 'image-src' },\n imageAlt: { type: String, attribute: 'image-alt' },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** A short label above the heading, such as the name of the development. */\n declare eyebrow: string;\n declare heading: string;\n /** A sentence or two under the heading. */\n declare lead: string;\n /** The heading's level in the page. A page's hero is usually its only level 1. */\n declare level: 1 | 2;\n declare imageSrc: string;\n /** What the picture shows. Leave empty only when it is decoration. */\n declare imageAlt: string;\n /** Where the words sit. Centred heroes have no picture beside them. */\n declare align: 'start' | 'center';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.eyebrow = '';\n this.heading = '';\n this.lead = '';\n this.level = 1;\n this.imageSrc = '';\n this.imageAlt = '';\n this.align = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, headingStyles, css`\n :host { display: block; container-type: inline-size; }\n .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; align-items: center; }\n .hero.pictured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }\n .words { display: flex; flex-direction: column; gap: ${space(4)}; }\n :host([align='center']) .words { align-items: center; text-align: center; margin-inline: auto; max-inline-size: 48rem; }\n .h { font-size: ${fontSize('3xl')}; }\n .body { font-size: ${fontSize('lg')}; color: ${t.text}; }\n .actions { display: flex; flex-wrap: wrap; gap: ${space(3)} ${space(4)}; align-items: center; margin-block-start: ${space(2)}; }\n :host([align='center']) .actions { justify-content: center; }\n img { display: block; inline-size: 100%; block-size: auto; border-radius: ${t.radiusLg}; aspect-ratio: 4 / 3; object-fit: cover; }\n @container (max-width: 48rem) { .hero.pictured { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n const pictured = Boolean(this.imageSrc) && this.align !== 'center';\n return html`<div class=\"hero ${pictured ? 'pictured' : ''}\" part=\"hero\">\n <div class=\"words\">\n ${this.eyebrow ? html`<p class=\"eyebrow\" part=\"eyebrow\">${this.eyebrow}</p>` : nothing}\n ${heading(this.level, this.heading, 'h')}\n ${this.lead ? html`<p class=\"body\">${this.lead}</p>` : nothing}\n <div class=\"actions\"><slot name=\"actions\"></slot></div>\n </div>\n ${pictured ? html`<img src=${this.imageSrc} alt=${this.imageAlt} part=\"image\" />` : nothing}\n </div>`;\n }\n}\n\n/** One benefit or feature in a list of them. */\nexport interface FeatureItem {\n id?: string;\n icon?: string;\n heading: string;\n text?: string;\n}\n\n/**\n * Benefits or features side by side, each with an icon, a short heading and a\n * line of text: \"Ten years of cover\", \"Lower bills from day one\".\n *\n * The icons are decoration, because each heading already says what it is.\n * The items are a list, so a screen reader says how many there are.\n *\n * @category content\n * @icon features\n */\nexport class ImpktFeatureList extends ImpktElement {\n static properties = {\n items: { type: Array },\n columns: { type: String, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n layout: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: FeatureItem[];\n declare columns: 'two' | 'three' | 'four';\n /** The level of each item's heading. One below the heading above the list. */\n declare headingLevel: 2 | 3 | 4;\n /** Icons above the words, or beside them. */\n declare layout: 'stacked' | 'inline';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.items = [];\n this.columns = 'three';\n this.headingLevel = 3;\n this.layout = 'stacked';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, headingStyles, css`\n :host { display: block; container-type: inline-size; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(8)} ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n li { display: flex; flex-direction: column; gap: ${space(2)}; }\n :host([layout='inline']) li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: ${space(4)}; align-items: start; }\n :host([layout='inline']) .words { display: flex; flex-direction: column; gap: ${space(1)}; }\n .icon { display: inline-flex; align-items: center; justify-content: center; inline-size: 48px; block-size: 48px; border-radius: ${t.radiusLg}; background: ${t.brandSubtle}; color: ${t.brand}; margin-block-end: ${space(2)}; }\n :host([layout='inline']) .icon { margin: 0; }\n .h { font-size: ${fontSize('lg')}; }\n .body { color: ${t.text}; }\n @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n return html`<ul part=\"list\">${(this.items ?? []).map((item) => html`<li part=\"item\">\n ${item.icon ? html`<span class=\"icon\">${iconSvg(item.icon, '24px')}</span>` : nothing}\n <div class=\"words\">${heading(this.headingLevel, item.heading, 'h')}${item.text ? html`<p class=\"body\">${item.text}</p>` : nothing}</div>\n </li>`)}</ul>`;\n }\n}\n\n/**\n * Something a customer said, and who said it.\n *\n * It is a `blockquote` with a `figcaption`, so the words and the person are\n * tied together for a screen reader as well as on the screen.\n *\n * @category content\n * @icon quote\n */\nexport class ImpktQuote extends ImpktElement {\n static properties = {\n quote: { type: String },\n person: { type: String },\n about: { type: String },\n imageSrc: { type: String, attribute: 'image-src' },\n size: { type: String, reflect: true },\n align: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n /** The words they said, without quotation marks. */\n declare quote: string;\n /** Who said it. */\n declare person: string;\n /** Who they are, such as \"Bought at Larkfield Meadows, 2025\". */\n declare about: string;\n /** A photo of them. It is decoration, because their name is beside it. */\n declare imageSrc: string;\n declare size: 'md' | 'lg';\n declare align: 'start' | 'center';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.quote = '';\n this.person = '';\n this.about = '';\n this.imageSrc = '';\n this.size = 'md';\n this.align = 'start';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, spaceAround, css`\n :host { display: block; }\n figure { margin: 0; display: flex; flex-direction: column; gap: ${space(4)}; max-inline-size: 48rem; }\n :host([align='center']) figure { margin-inline: auto; align-items: center; text-align: center; }\n blockquote { margin: 0; font-family: ${t.fontHeading}; font-size: ${fontSize('lg')}; line-height: ${lineHeight('normal')}; color: inherit; }\n :host([size='lg']) blockquote { font-size: ${fontSize('2xl')}; line-height: ${lineHeight('tight')}; }\n blockquote::before { content: '\\\\201C'; } blockquote::after { content: '\\\\201D'; }\n figcaption { display: flex; align-items: center; gap: ${space(3)}; }\n img { inline-size: 48px; block-size: 48px; border-radius: 50%; object-fit: cover; }\n .name { font-weight: ${fontWeight('semibold')}; }\n .detail { color: ${t.textMuted}; font-size: ${fontSize('sm')}; }\n `];\n\n render(): TemplateResult {\n return html`<figure part=\"figure\">\n <blockquote part=\"quote\">${this.quote}</blockquote>\n ${this.person ? html`<figcaption>${this.imageSrc ? html`<img src=${this.imageSrc} alt=\"\" />` : nothing}<span><span class=\"name\">${this.person}</span>${this.about ? html`<br /><span class=\"detail\">${this.about}</span>` : nothing}</span></figcaption>` : nothing}\n </figure>`;\n }\n}\n\n/**\n * A number that makes a point, with what it counts beneath it: \"36 years\",\n * \"Building in Kent since 1987\".\n *\n * @category content\n * @icon stat\n */\nexport class ImpktStat extends ImpktElement {\n static properties = {\n figure: { type: String },\n label: { type: String },\n note: { type: String },\n align: { type: String, reflect: true },\n };\n /** The number, written as it should appear, such as \"36\" or \"£280k\". */\n declare figure: string;\n /** What the number counts. */\n declare label: string;\n /** A line more, if the label needs it. */\n declare note: string;\n declare align: 'start' | 'center';\n\n constructor() {\n super();\n this.figure = '';\n this.label = '';\n this.note = '';\n this.align = 'start';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: block; }\n .stat { display: flex; flex-direction: column; gap: ${space(1)}; }\n :host([align='center']) .stat { align-items: center; text-align: center; }\n .value { font-family: ${t.fontHeading}; font-size: ${fontSize('3xl')}; font-weight: ${fontWeight('bold')}; line-height: 1; color: ${t.textHeading}; }\n .label { font-weight: ${fontWeight('semibold')}; }\n .detail { color: ${t.textMuted}; font-size: ${fontSize('sm')}; }\n `];\n\n render(): TemplateResult {\n // Read as one phrase, \"36 years\", rather than a bare number and then a label.\n return html`<p class=\"stat\" part=\"stat\" style=\"margin:0\"><span class=\"value\">${this.figure}</span> <span class=\"label\">${this.label}</span>${this.note ? html` <span class=\"detail\">${this.note}</span>` : nothing}</p>`;\n }\n}\n\n/**\n * A short label on something: \"New\", \"Selling fast\", \"2 left\".\n *\n * The tone colours it, and the words carry the meaning, so it reads the same\n * without the colour (1.4.1).\n *\n * @category feedback\n * @icon badge\n * @slot - The badge's words.\n */\nexport class ImpktBadge extends ImpktElement {\n static properties = {\n tone: { type: String, reflect: true },\n icon: { type: String },\n };\n declare tone: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info';\n /** An icon before the words. */\n declare icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n\n constructor() {\n super();\n this.tone = 'neutral';\n this.icon = 'none';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: inline-flex; }\n span { display: inline-flex; align-items: center; gap: ${space(1)}; padding: ${space(1)} ${space(2)}; border-radius: 999px; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('semibold')}; line-height: 1.2; background: ${t.surfaceInset}; color: ${t.text}; border: ${t.borderThin} solid transparent; }\n :host([tone='brand']) span { background: ${t.brandSubtle}; color: ${t.brand}; }\n :host([tone='success']) span { background: ${t.successSubtle}; color: ${t.successText}; }\n :host([tone='warning']) span { background: ${t.warningSubtle}; color: ${t.warningText}; }\n :host([tone='danger']) span { background: ${t.dangerSubtle}; color: ${t.dangerText}; }\n :host([tone='info']) span { background: ${t.infoSubtle}; color: ${t.infoText}; }\n @media (forced-colors: active) { span { border-color: CanvasText; } }\n `];\n\n render(): TemplateResult {\n return html`<span part=\"badge\">${iconSvg(this.icon, '1em')}<slot></slot></span>`;\n }\n}\n\ncustomElements.define('impkt-hero', ImpktHero);\ncustomElements.define('impkt-feature-list', ImpktFeatureList);\ncustomElements.define('impkt-quote', ImpktQuote);\ncustomElements.define('impkt-stat', ImpktStat);\ncustomElements.define('impkt-badge', ImpktBadge);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-hero': ImpktHero; 'impkt-feature-list': ImpktFeatureList; 'impkt-quote': ImpktQuote; 'impkt-stat': ImpktStat; 'impkt-badge': ImpktBadge;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cAAc,SAAS;AAC7C,eAAe,OAAO,eAAe,UAAU;","names":[]}
@@ -0,0 +1,85 @@
1
+ import {
2
+ ImpktElement,
3
+ t
4
+ } from "./chunk-5NUF7ZQA.js";
5
+
6
+ // packages/ui/src/components/icon.ts
7
+ import { css, html, nothing, svg } from "lit";
8
+ var ICONS = {
9
+ "arrow-right": svg`<path d="M5 12h14M13 6l6 6-6 6"/>`,
10
+ "arrow-left": svg`<path d="M19 12H5M11 6l-6 6 6 6"/>`,
11
+ "chevron-right": svg`<path d="M9 6l6 6-6 6"/>`,
12
+ "chevron-down": svg`<path d="M6 9l6 6 6-6"/>`,
13
+ check: svg`<path d="M5 12.5l4.5 4.5L19 7"/>`,
14
+ close: svg`<path d="M6 6l12 12M18 6L6 18"/>`,
15
+ menu: svg`<path d="M4 7h16M4 12h16M4 17h16"/>`,
16
+ plus: svg`<path d="M12 5v14M5 12h14"/>`,
17
+ minus: svg`<path d="M5 12h14"/>`,
18
+ search: svg`<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4 4"/>`,
19
+ external: svg`<path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>`,
20
+ download: svg`<path d="M12 4v11M7 10l5 5 5-5M5 20h14"/>`,
21
+ home: svg`<path d="M4 11l8-7 8 7M6 9.5V20h12V9.5"/><path d="M10 20v-6h4v6"/>`,
22
+ phone: svg`<path d="M7 3.5h3l1.5 4-2 1.5a11 11 0 0 0 5.5 5.5l1.5-2 4 1.5v3a2 2 0 0 1-2 2A16 16 0 0 1 5 5.5a2 2 0 0 1 2-2z"/>`,
23
+ mail: svg`<rect x="3.5" y="5.5" width="17" height="13" rx="1.5"/><path d="M4 7l8 6 8-6"/>`,
24
+ "map-pin": svg`<path d="M12 21s-6.5-6-6.5-11a6.5 6.5 0 0 1 13 0c0 5-6.5 11-6.5 11z"/><circle cx="12" cy="10" r="2.5"/>`,
25
+ calendar: svg`<rect x="4" y="5.5" width="16" height="14.5" rx="1.5"/><path d="M4 10h16M8.5 3.5v4M15.5 3.5v4"/>`,
26
+ clock: svg`<circle cx="12" cy="12" r="8.5"/><path d="M12 7.5V12l3 2"/>`,
27
+ user: svg`<circle cx="12" cy="8.5" r="3.5"/><path d="M5 20a7 7 0 0 1 14 0"/>`,
28
+ star: svg`<path d="M12 4l2.4 5 5.4.6-4 3.7 1.1 5.4L12 16l-4.9 2.7 1.1-5.4-4-3.7 5.4-.6z"/>`,
29
+ heart: svg`<path d="M12 19.5s-7.5-4.6-7.5-10A4 4 0 0 1 12 7a4 4 0 0 1 7.5 2.5c0 5.4-7.5 10-7.5 10z"/>`,
30
+ shield: svg`<path d="M12 3.5l7 2.5v5.5c0 4.5-3 7.8-7 9-4-1.2-7-4.5-7-9V6z"/><path d="M9 12l2 2 4-4"/>`,
31
+ leaf: svg`<path d="M5 19c0-8 5-13 14-14 0 9-5 14-13 14z"/><path d="M5 19l7-7"/>`,
32
+ sun: svg`<circle cx="12" cy="12" r="3.5"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6L7 7M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4"/>`,
33
+ bolt: svg`<path d="M13 3L5 13.5h6L10 21l8-10.5h-6z"/>`,
34
+ key: svg`<circle cx="8" cy="15" r="3.5"/><path d="M10.5 12.5L19 4M16 7l2.5 2.5M14 9l2 2"/>`,
35
+ info: svg`<circle cx="12" cy="12" r="8.5"/><path d="M12 11v5.5M12 7.5v.5"/>`,
36
+ warning: svg`<path d="M12 4l9 15.5H3z"/><path d="M12 10v4M12 16.5v.5"/>`,
37
+ document: svg`<path d="M6 3.5h8l4 4V20a.5.5 0 0 1-.5.5h-11A.5.5 0 0 1 6 20z"/><path d="M14 3.5V8h4M9 13h6M9 16.5h6"/>`,
38
+ pound: svg`<path d="M16 6.5a3.5 3.5 0 0 0-6.5 1.8V20M7 13h7M7 20h10"/>`,
39
+ chat: svg`<path d="M4.5 5.5h15v10h-9l-4 3.5v-3.5h-2z"/>`
40
+ };
41
+ var ICON_NAMES = Object.keys(ICONS);
42
+ function iconSvg(name, size = "1.25em") {
43
+ const shape = name ? ICONS[name] : void 0;
44
+ if (!shape) return nothing;
45
+ return html`<svg class="icon" viewBox="0 0 24 24" width=${size} height=${size} fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${shape}</svg>`;
46
+ }
47
+ var ImpktIcon = class extends ImpktElement {
48
+ static {
49
+ this.properties = {
50
+ name: { type: String, reflect: true },
51
+ label: { type: String },
52
+ size: { type: String, reflect: true },
53
+ tone: { type: String, reflect: true }
54
+ };
55
+ }
56
+ constructor() {
57
+ super();
58
+ this.name = "star";
59
+ this.label = "";
60
+ this.size = "md";
61
+ this.tone = "inherit";
62
+ }
63
+ static {
64
+ this.styles = [...ImpktElement.styles, css`
65
+ :host { display: inline-flex; vertical-align: middle; line-height: 0; }
66
+ :host([tone='brand']) { color: ${t.brand}; }
67
+ :host([tone='muted']) { color: ${t.textMuted}; }
68
+ @media (forced-colors: active) { :host { color: CanvasText; } }
69
+ `];
70
+ }
71
+ render() {
72
+ const size = { sm: "16px", md: "24px", lg: "32px", xl: "48px" }[this.size] ?? "24px";
73
+ const drawn = iconSvg(this.name, size);
74
+ return this.label ? html`<span role="img" aria-label=${this.label}>${drawn}</span>` : html`${drawn}`;
75
+ }
76
+ };
77
+ customElements.define("impkt-icon", ImpktIcon);
78
+
79
+ export {
80
+ ICONS,
81
+ ICON_NAMES,
82
+ iconSvg,
83
+ ImpktIcon
84
+ };
85
+ //# sourceMappingURL=chunk-CFGLOYWW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/icon.ts"],"sourcesContent":["import { css, html, nothing, svg, type SVGTemplateResult, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { t } from '../base/tokens';\n\n/**\n * The icons the library draws, each on a 24 by 24 grid in strokes of the\n * current text colour. Kept to a set the components need and editors reach\n * for, so an icon always matches the line weight of the ones beside it.\n */\nexport const ICONS = {\n 'arrow-right': svg`<path d=\"M5 12h14M13 6l6 6-6 6\"/>`,\n 'arrow-left': svg`<path d=\"M19 12H5M11 6l-6 6 6 6\"/>`,\n 'chevron-right': svg`<path d=\"M9 6l6 6-6 6\"/>`,\n 'chevron-down': svg`<path d=\"M6 9l6 6 6-6\"/>`,\n check: svg`<path d=\"M5 12.5l4.5 4.5L19 7\"/>`,\n close: svg`<path d=\"M6 6l12 12M18 6L6 18\"/>`,\n menu: svg`<path d=\"M4 7h16M4 12h16M4 17h16\"/>`,\n plus: svg`<path d=\"M12 5v14M5 12h14\"/>`,\n minus: svg`<path d=\"M5 12h14\"/>`,\n search: svg`<circle cx=\"11\" cy=\"11\" r=\"6.5\"/><path d=\"M16 16l4 4\"/>`,\n external: svg`<path d=\"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5\"/>`,\n download: svg`<path d=\"M12 4v11M7 10l5 5 5-5M5 20h14\"/>`,\n home: svg`<path d=\"M4 11l8-7 8 7M6 9.5V20h12V9.5\"/><path d=\"M10 20v-6h4v6\"/>`,\n phone: svg`<path d=\"M7 3.5h3l1.5 4-2 1.5a11 11 0 0 0 5.5 5.5l1.5-2 4 1.5v3a2 2 0 0 1-2 2A16 16 0 0 1 5 5.5a2 2 0 0 1 2-2z\"/>`,\n mail: svg`<rect x=\"3.5\" y=\"5.5\" width=\"17\" height=\"13\" rx=\"1.5\"/><path d=\"M4 7l8 6 8-6\"/>`,\n 'map-pin': svg`<path d=\"M12 21s-6.5-6-6.5-11a6.5 6.5 0 0 1 13 0c0 5-6.5 11-6.5 11z\"/><circle cx=\"12\" cy=\"10\" r=\"2.5\"/>`,\n calendar: svg`<rect x=\"4\" y=\"5.5\" width=\"16\" height=\"14.5\" rx=\"1.5\"/><path d=\"M4 10h16M8.5 3.5v4M15.5 3.5v4\"/>`,\n clock: svg`<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 7.5V12l3 2\"/>`,\n user: svg`<circle cx=\"12\" cy=\"8.5\" r=\"3.5\"/><path d=\"M5 20a7 7 0 0 1 14 0\"/>`,\n star: svg`<path d=\"M12 4l2.4 5 5.4.6-4 3.7 1.1 5.4L12 16l-4.9 2.7 1.1-5.4-4-3.7 5.4-.6z\"/>`,\n heart: svg`<path d=\"M12 19.5s-7.5-4.6-7.5-10A4 4 0 0 1 12 7a4 4 0 0 1 7.5 2.5c0 5.4-7.5 10-7.5 10z\"/>`,\n shield: svg`<path d=\"M12 3.5l7 2.5v5.5c0 4.5-3 7.8-7 9-4-1.2-7-4.5-7-9V6z\"/><path d=\"M9 12l2 2 4-4\"/>`,\n leaf: svg`<path d=\"M5 19c0-8 5-13 14-14 0 9-5 14-13 14z\"/><path d=\"M5 19l7-7\"/>`,\n sun: svg`<circle cx=\"12\" cy=\"12\" r=\"3.5\"/><path d=\"M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6L7 7M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4\"/>`,\n bolt: svg`<path d=\"M13 3L5 13.5h6L10 21l8-10.5h-6z\"/>`,\n key: svg`<circle cx=\"8\" cy=\"15\" r=\"3.5\"/><path d=\"M10.5 12.5L19 4M16 7l2.5 2.5M14 9l2 2\"/>`,\n info: svg`<circle cx=\"12\" cy=\"12\" r=\"8.5\"/><path d=\"M12 11v5.5M12 7.5v.5\"/>`,\n warning: svg`<path d=\"M12 4l9 15.5H3z\"/><path d=\"M12 10v4M12 16.5v.5\"/>`,\n document: svg`<path d=\"M6 3.5h8l4 4V20a.5.5 0 0 1-.5.5h-11A.5.5 0 0 1 6 20z\"/><path d=\"M14 3.5V8h4M9 13h6M9 16.5h6\"/>`,\n pound: svg`<path d=\"M16 6.5a3.5 3.5 0 0 0-6.5 1.8V20M7 13h7M7 20h10\"/>`,\n chat: svg`<path d=\"M4.5 5.5h15v10h-9l-4 3.5v-3.5h-2z\"/>`,\n} as const satisfies Record<string, SVGTemplateResult>;\n\nexport type IconName = keyof typeof ICONS;\nexport const ICON_NAMES = Object.keys(ICONS) as IconName[];\n\n/** An icon as markup, for components that draw one beside their own words. Always decorative. */\nexport function iconSvg(name: string | undefined, size = '1.25em'): TemplateResult | typeof nothing {\n const shape = name ? ICONS[name as IconName] : undefined;\n if (!shape) return nothing;\n return html`<svg class=\"icon\" viewBox=\"0 0 24 24\" width=${size} height=${size} fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\">${shape}</svg>`;\n}\n\n/**\n * A small picture that stands for something: a phone beside a number, a tick\n * beside a benefit.\n *\n * **An icon is decorative unless it is labelled.** With no `label` it is\n * hidden from screen readers, because the words beside it already say what it\n * means. Give it a label only when it stands alone and carries meaning (1.1.1).\n *\n * @category media\n * @icon star\n */\nexport class ImpktIcon extends ImpktElement {\n static properties = {\n name: { type: String, reflect: true },\n label: { type: String },\n size: { type: String, reflect: true },\n tone: { type: String, reflect: true },\n };\n /** Which icon. */\n declare name: 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n /** What the icon means, when it stands alone. Leave empty when words beside it say the same. */\n declare label: string;\n declare size: 'sm' | 'md' | 'lg' | 'xl';\n /** The icon's colour. */\n declare tone: 'inherit' | 'brand' | 'muted';\n\n constructor() {\n super();\n this.name = 'star';\n this.label = '';\n this.size = 'md';\n this.tone = 'inherit';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: inline-flex; vertical-align: middle; line-height: 0; }\n :host([tone='brand']) { color: ${t.brand}; }\n :host([tone='muted']) { color: ${t.textMuted}; }\n @media (forced-colors: active) { :host { color: CanvasText; } }\n `];\n\n render(): TemplateResult {\n const size = { sm: '16px', md: '24px', lg: '32px', xl: '48px' }[this.size] ?? '24px';\n const drawn = iconSvg(this.name, size);\n return this.label ? html`<span role=\"img\" aria-label=${this.label}>${drawn}</span>` : html`${drawn}`;\n }\n}\n\ncustomElements.define('impkt-icon', ImpktIcon);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-icon': ImpktIcon } }\n"],"mappings":";;;;;;AAAA,SAAS,KAAK,MAAM,SAAS,WAAwD;AAS9E,IAAM,QAAQ;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,MAAM;AACR;AAGO,IAAM,aAAa,OAAO,KAAK,KAAK;AAGpC,SAAS,QAAQ,MAA0B,OAAO,UAA2C;AAClG,QAAM,QAAQ,OAAO,MAAM,IAAgB,IAAI;AAC/C,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,mDAAmD,IAAI,WAAW,IAAI,8IAA8I,KAAK;AAClO;AAaO,IAAM,YAAN,cAAwB,aAAa;AAAA,EAC1C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACpC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EASA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,aAAa,QAAQ;AAAA;AAAA,qCAEN,EAAE,KAAK;AAAA,qCACP,EAAE,SAAS;AAAA;AAAA,GAE7C;AAAA;AAAA,EAED,SAAyB;AACvB,UAAM,OAAO,EAAE,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,OAAO,EAAE,KAAK,IAAI,KAAK;AAC9E,UAAM,QAAQ,QAAQ,KAAK,MAAM,IAAI;AACrC,WAAO,KAAK,QAAQ,mCAAmC,KAAK,KAAK,IAAI,KAAK,YAAY,OAAO,KAAK;AAAA,EACpG;AACF;AAEA,eAAe,OAAO,cAAc,SAAS;","names":[]}
@@ -11,6 +11,13 @@ import {
11
11
 
12
12
  // packages/ui/src/base/FieldElement.ts
13
13
  import { html, css, nothing } from "lit";
14
+ var fieldWidths = css`
15
+ :host { --impkt-field-width: 100%; }
16
+ :host([width='xs']) { --impkt-field-width: 8ch; }
17
+ :host([width='sm']) { --impkt-field-width: 14ch; }
18
+ :host([width='md']) { --impkt-field-width: 24ch; }
19
+ :host([width='lg']) { --impkt-field-width: 40ch; }
20
+ `;
14
21
  var FieldElement = class extends ImpktElement {
15
22
  constructor() {
16
23
  super();
@@ -157,6 +164,7 @@ var FieldElement = class extends ImpktElement {
157
164
  };
158
165
 
159
166
  export {
167
+ fieldWidths,
160
168
  FieldElement
161
169
  };
162
- //# sourceMappingURL=chunk-ZXCSQ6MK.js.map
170
+ //# sourceMappingURL=chunk-DI2CJ3MZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/base/FieldElement.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from './ImpktElement';\nimport { focusRing, visuallyHidden } from './styles';\nimport { fontSize, fontWeight, lineHeight, space, t } from './tokens';\n\n/**\n * The shared anatomy of a form control: a label, an optional description, a\n * control, and an error.\n *\n * This exists because the ARIA wiring between those four is where accessible\n * forms actually fail, and it fails the same way every time — a description\n * that is never announced, an error that appears silently, a label that points\n * at nothing. Written once, it is right once.\n *\n * Everything is rendered inside this component's own shadow root, including\n * the native control. That is not an implementation detail: `aria-describedby`\n * cannot cross a shadow boundary, so a component that slotted the input from\n * outside could not describe it. Keeping the whole relationship in one tree is\n * what makes the wiring work at all.\n */\n/**\n * How wide a single-line control is, from what it holds: a postcode is short,\n * an email address is long. A width that matches the answer is a hint about\n * what to type (1.3.5 is about the purpose, this is about the size). Applied by\n * the controls that take a `width`, through `--impkt-field-width`.\n */\nexport const fieldWidths = css`\n :host { --impkt-field-width: 100%; }\n :host([width='xs']) { --impkt-field-width: 8ch; }\n :host([width='sm']) { --impkt-field-width: 14ch; }\n :host([width='md']) { --impkt-field-width: 24ch; }\n :host([width='lg']) { --impkt-field-width: 40ch; }\n`;\n\nexport abstract class FieldElement extends ImpktElement {\n /** Form controls participate in a `<form>` like native ones. */\n static formAssociated = true;\n\n static properties = {\n label: { type: String },\n name: { type: String },\n value: { type: String },\n description: { type: String },\n error: { type: String },\n required: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n readonly: { type: Boolean, reflect: true },\n requiredText: { type: String, attribute: 'required-text' },\n };\n\n declare label: string;\n declare name: string;\n declare value: string;\n declare description: string;\n declare error: string;\n declare required: boolean;\n declare disabled: boolean;\n declare readonly: boolean;\n /**\n * How \"you must answer this\" is said.\n *\n * Words, not an asterisk. 3.3.2 asks for labels or instructions, and an\n * asterisk is neither until a legend explains it — which puts the\n * explanation somewhere other than the field it explains. It is a property\n * so a partner can reword it, not so they can empty it.\n */\n declare requiredText: string;\n\n protected internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this.label = '';\n this.name = '';\n this.value = '';\n this.description = '';\n this.error = '';\n this.required = false;\n this.disabled = false;\n this.readonly = false;\n this.requiredText = 'required';\n // happy-dom and older engines do not implement attachInternals. A control\n // that cannot associate with a form is still a usable control, so this\n // degrades rather than throwing on construction.\n try {\n this.internals = this.attachInternals();\n } catch {\n this.internals = null;\n }\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: block;\n margin-block-end: ${space(4)};\n }\n .label {\n display: block;\n font-size: ${fontSize('sm')};\n font-weight: ${fontWeight('semibold')};\n line-height: ${lineHeight('normal')};\n margin-block-end: ${space(1)};\n color: ${t.text};\n }\n .required {\n font-weight: ${fontWeight('regular')};\n color: ${t.textMuted};\n }\n .description {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.textMuted};\n margin-block-end: ${space(2)};\n }\n .error {\n font-size: ${fontSize('sm')};\n line-height: ${lineHeight('normal')};\n color: ${t.dangerText};\n margin-block-start: ${space(1)};\n display: flex;\n gap: ${space(1)};\n }\n .error:empty {\n display: none;\n }\n .visually-hidden {\n ${visuallyHidden}\n }\n :host([disabled]) {\n opacity: 0.6;\n }\n `,\n ];\n\n protected get controlId(): string {\n return this.id_('control');\n }\n\n /**\n * What the control points `aria-describedby` at.\n *\n * The error id is included only while there is an error. A describedby that\n * always names an empty element trains a screen-reader user to expect\n * nothing after the description, and then the one time it matters they have\n * already learned to ignore it.\n */\n protected get describedBy(): string | typeof nothing {\n const ids = [\n this.description ? this.id_('description') : '',\n this.error ? this.id_('error') : '',\n ].filter(Boolean);\n return ids.length ? ids.join(' ') : nothing;\n }\n\n /** Subclasses render the control itself; everything round it is here. */\n protected abstract renderControl(): TemplateResult;\n\n /**\n * `<label for>` by default. A group of controls — radios, checkboxes —\n * cannot use one, because `for` names a single control, so those override\n * this and render a `<fieldset>` and `<legend>` instead.\n */\n protected renderLabel(): TemplateResult {\n return html`\n <label class=\"label\" for=${this.controlId} part=\"label\">\n ${this.label}${this.required\n ? html`<span class=\"required\"> (${this.requiredText})</span>`\n : nothing}\n </label>\n `;\n }\n\n render(): TemplateResult {\n return html`\n ${this.renderLabel()}\n ${this.description\n ? html`<div class=\"description\" id=${this.id_('description')} part=\"description\">\n ${this.description}\n </div>`\n : nothing}\n ${this.renderControl()}\n <!--\n The error region is always present, even when empty. A live region\n inserted at the same moment as its content is announced unreliably\n across screen readers; one that already exists and is then filled is\n announced consistently. \"polite\" rather than \"assertive\" because a\n validation message should not interrupt what is being read.\n -->\n <div\n class=\"error\"\n id=${this.id_('error')}\n part=\"error\"\n aria-live=\"polite\"\n >\n ${this.error || nothing}\n </div>\n `;\n }\n\n /** Keep the form value in step with the control. */\n protected setFormValue(value: string): void {\n this.value = value;\n this.internals?.setFormValue(value);\n this.dispatchEvent(new CustomEvent('impkt-change', { detail: { value }, bubbles: true, composed: true }));\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AA0BjD,IAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQpB,IAAe,eAAf,cAAoC,aAAa;AAAA,EAoCtD,cAAc;AACZ,UAAM;AAHR,SAAU,YAAqC;AAI7C,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,cAAc;AACnB,SAAK,QAAQ;AACb,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,WAAW;AAChB,SAAK,eAAe;AAIpB,QAAI;AACF,WAAK,YAAY,KAAK,gBAAgB;AAAA,IACxC,QAAQ;AACN,WAAK,YAAY;AAAA,IACnB;AAAA,EACF;AAAA,EArDA;AAAA;AAAA,SAAO,iBAAiB;AAAA;AAAA,EAExB;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,MAAM,EAAE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cAAuC;AACnD,UAAM,MAAM;AAAA,MACV,KAAK,cAAc,KAAK,IAAI,aAAa,IAAI;AAAA,MAC7C,KAAK,QAAQ,KAAK,IAAI,OAAO,IAAI;AAAA,IACnC,EAAE,OAAO,OAAO;AAChB,WAAO,IAAI,SAAS,IAAI,KAAK,GAAG,IAAI;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUU,cAA8B;AACtC,WAAO;AAAA,iCACsB,KAAK,SAAS;AAAA,UACrC,KAAK,KAAK,GAAG,KAAK,WAChB,gCAAgC,KAAK,YAAY,aACjD,OAAO;AAAA;AAAA;AAAA,EAGjB;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA,QACH,KAAK,YAAY,CAAC;AAAA,QAClB,KAAK,cACH,mCAAmC,KAAK,IAAI,aAAa,CAAC;AAAA,cACtD,KAAK,WAAW;AAAA,oBAEpB,OAAO;AAAA,QACT,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,gBAAgB,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,EAC1G;AACF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FieldElement
3
- } from "./chunk-ZXCSQ6MK.js";
3
+ } from "./chunk-DI2CJ3MZ.js";
4
4
  import {
5
5
  fontSize,
6
6
  space,
@@ -85,4 +85,4 @@ customElements.define("impkt-checkbox", ImpktCheckbox);
85
85
  export {
86
86
  ImpktCheckbox
87
87
  };
88
- //# sourceMappingURL=chunk-LFOWTFMR.js.map
88
+ //# sourceMappingURL=chunk-DR3SJ7ZV.js.map
@@ -0,0 +1,56 @@
1
+ import {
2
+ ImpktElement,
3
+ fontSize,
4
+ fontWeight,
5
+ lineHeight,
6
+ space,
7
+ t
8
+ } from "./chunk-5NUF7ZQA.js";
9
+
10
+ // packages/ui/src/components/fieldset.ts
11
+ import { css, html, nothing } from "lit";
12
+ var ImpktFieldset = class extends ImpktElement {
13
+ static {
14
+ this.properties = {
15
+ legend: { type: String },
16
+ description: { type: String },
17
+ error: { type: String, reflect: true },
18
+ size: { type: String, reflect: true }
19
+ };
20
+ }
21
+ constructor() {
22
+ super();
23
+ this.legend = "";
24
+ this.description = "";
25
+ this.error = "";
26
+ this.size = "md";
27
+ }
28
+ static {
29
+ this.styles = [...ImpktElement.styles, css`
30
+ :host { display: block; margin-block-end: ${space(6)}; }
31
+ fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
32
+ legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize("md")}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; color: ${t.text}; }
33
+ :host([size='lg']) legend { font-size: ${fontSize("xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
34
+ :host([size='xl']) legend { font-size: ${fontSize("2xl")}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }
35
+ .description { margin-block-end: ${space(3)}; font-size: ${fontSize("sm")}; color: ${t.textMuted}; line-height: ${lineHeight("normal")}; }
36
+ .error { margin-block-end: ${space(3)}; font-size: ${fontSize("sm")}; color: ${t.dangerText}; font-weight: ${fontWeight("semibold")}; }
37
+ .error:empty { display: none; }
38
+ :host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }
39
+ `];
40
+ }
41
+ render() {
42
+ const described = [this.description ? this.id_("description") : "", this.error ? this.id_("error") : ""].filter(Boolean).join(" ");
43
+ return html`<fieldset part="fieldset" aria-describedby=${described || nothing}>
44
+ <legend part="legend">${this.legend}</legend>
45
+ ${this.description ? html`<div class="description" id=${this.id_("description")}>${this.description}</div>` : nothing}
46
+ <div class="error" id=${this.id_("error")} aria-live="polite">${this.error || nothing}</div>
47
+ <div class="fields" part="fields"><slot></slot></div>
48
+ </fieldset>`;
49
+ }
50
+ };
51
+ customElements.define("impkt-fieldset", ImpktFieldset);
52
+
53
+ export {
54
+ ImpktFieldset
55
+ };
56
+ //# sourceMappingURL=chunk-G6UVYMA6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/fieldset.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { fontSize, fontWeight, lineHeight, space, t } from '../base/tokens';\n\n/**\n * Fields that belong together under one question: the lines of an address,\n * or a name in two parts.\n *\n * **The question is the group's name.** It is a `fieldset` with a `legend`, so\n * a screen reader says \"Your address, group\" on the way in, and each field\n * inside is heard as part of it (1.3.1, 3.3.2). An error for the group as a\n * whole, such as \"Enter a full address\", is tied to it the same way.\n *\n * @category form\n * @icon fieldset\n * @slot - The fields in the group.\n */\nexport class ImpktFieldset extends ImpktElement {\n static properties = {\n legend: { type: String },\n description: { type: String },\n error: { type: String, reflect: true },\n size: { type: String, reflect: true },\n };\n /** The question the fields answer together. */\n declare legend: string;\n /** A hint for the whole group, under the question. */\n declare description: string;\n /** What is wrong with the group as a whole. */\n declare error: string;\n /** How large the question is. A page that asks only this question makes it the page's heading size. */\n declare size: 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.legend = '';\n this.description = '';\n this.error = '';\n this.size = 'md';\n }\n\n static styles = [...ImpktElement.styles, css`\n :host { display: block; margin-block-end: ${space(6)}; }\n fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; font-size: ${fontSize('md')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; color: ${t.text}; }\n :host([size='lg']) legend { font-size: ${fontSize('xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n :host([size='xl']) legend { font-size: ${fontSize('2xl')}; font-family: ${t.fontHeading}; color: ${t.textHeading}; }\n .description { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.textMuted}; line-height: ${lineHeight('normal')}; }\n .error { margin-block-end: ${space(3)}; font-size: ${fontSize('sm')}; color: ${t.dangerText}; font-weight: ${fontWeight('semibold')}; }\n .error:empty { display: none; }\n :host([error]:not([error=''])) .fields { padding-inline-start: ${space(4)}; border-inline-start: 4px solid ${t.danger}; }\n `];\n\n render(): TemplateResult {\n const described = [this.description ? this.id_('description') : '', this.error ? this.id_('error') : ''].filter(Boolean).join(' ');\n return html`<fieldset part=\"fieldset\" aria-describedby=${described || nothing}>\n <legend part=\"legend\">${this.legend}</legend>\n ${this.description ? html`<div class=\"description\" id=${this.id_('description')}>${this.description}</div>` : nothing}\n <div class=\"error\" id=${this.id_('error')} aria-live=\"polite\">${this.error || nothing}</div>\n <div class=\"fields\" part=\"fields\"><slot></slot></div>\n </fieldset>`;\n }\n}\n\ncustomElements.define('impkt-fieldset', ImpktFieldset);\ndeclare global { interface HTMLElementTagNameMap { 'impkt-fieldset': ImpktFieldset } }\n"],"mappings":";;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAiBjD,IAAM,gBAAN,cAA4B,aAAa;AAAA,EAC9C;AAAA,SAAO,aAAa;AAAA,MAClB,QAAQ,EAAE,MAAM,OAAO;AAAA,MACvB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,OAAO,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACrC,MAAM,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,IACtC;AAAA;AAAA,EAUA,cAAc;AACZ,UAAM;AACN,SAAK,SAAS;AACd,SAAK,cAAc;AACnB,SAAK,QAAQ;AACb,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS,CAAC,GAAG,aAAa,QAAQ;AAAA,gDACK,MAAM,CAAC,CAAC;AAAA;AAAA,6CAEX,MAAM,CAAC,CAAC,gBAAgB,SAAS,IAAI,CAAC,kBAAkB,WAAW,MAAM,CAAC,kBAAkB,WAAW,OAAO,CAAC,YAAY,EAAE,IAAI;AAAA,6CACjI,SAAS,IAAI,CAAC,kBAAkB,EAAE,WAAW,YAAY,EAAE,WAAW;AAAA,6CACtE,SAAS,KAAK,CAAC,kBAAkB,EAAE,WAAW,YAAY,EAAE,WAAW;AAAA,uCAC7E,MAAM,CAAC,CAAC,gBAAgB,SAAS,IAAI,CAAC,YAAY,EAAE,SAAS,kBAAkB,WAAW,QAAQ,CAAC;AAAA,iCACzG,MAAM,CAAC,CAAC,gBAAgB,SAAS,IAAI,CAAC,YAAY,EAAE,UAAU,kBAAkB,WAAW,UAAU,CAAC;AAAA;AAAA,qEAElE,MAAM,CAAC,CAAC,oCAAoC,EAAE,MAAM;AAAA,GACtH;AAAA;AAAA,EAED,SAAyB;AACvB,UAAM,YAAY,CAAC,KAAK,cAAc,KAAK,IAAI,aAAa,IAAI,IAAI,KAAK,QAAQ,KAAK,IAAI,OAAO,IAAI,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACjI,WAAO,kDAAkD,aAAa,OAAO;AAAA,8BACnD,KAAK,MAAM;AAAA,QACjC,KAAK,cAAc,mCAAmC,KAAK,IAAI,aAAa,CAAC,IAAI,KAAK,WAAW,WAAW,OAAO;AAAA,8BAC7F,KAAK,IAAI,OAAO,CAAC,uBAAuB,KAAK,SAAS,OAAO;AAAA;AAAA;AAAA,EAGzF;AACF;AAEA,eAAe,OAAO,kBAAkB,aAAa;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FieldElement
3
- } from "./chunk-ZXCSQ6MK.js";
3
+ } from "./chunk-DI2CJ3MZ.js";
4
4
  import {
5
5
  fontSize,
6
6
  space,
@@ -133,4 +133,4 @@ customElements.define("impkt-date-input", ImpktDateInput);
133
133
  export {
134
134
  ImpktDateInput
135
135
  };
136
- //# sourceMappingURL=chunk-CGMDIZPO.js.map
136
+ //# sourceMappingURL=chunk-H6L3FSQY.js.map
@@ -1,6 +1,11 @@
1
+ import {
2
+ iconSvg
3
+ } from "./chunk-CFGLOYWW.js";
1
4
  import {
2
5
  ImpktElement,
3
6
  focusRing,
7
+ fontWeight,
8
+ space,
4
9
  t,
5
10
  visuallyHidden
6
11
  } from "./chunk-5NUF7ZQA.js";
@@ -12,7 +17,9 @@ var ImpktLink = class extends ImpktElement {
12
17
  this.properties = {
13
18
  href: { type: String },
14
19
  external: { type: Boolean, reflect: true },
15
- externalText: { type: String, attribute: "external-text" }
20
+ externalText: { type: String, attribute: "external-text" },
21
+ variant: { type: String, reflect: true },
22
+ icon: { type: String }
16
23
  };
17
24
  }
18
25
  constructor() {
@@ -20,6 +27,8 @@ var ImpktLink = class extends ImpktElement {
20
27
  this.href = "";
21
28
  this.external = false;
22
29
  this.externalText = "opens in a new tab";
30
+ this.variant = "inline";
31
+ this.icon = "none";
23
32
  }
24
33
  static {
25
34
  this.styles = [
@@ -38,6 +47,10 @@ var ImpktLink = class extends ImpktElement {
38
47
  a:hover {
39
48
  color: ${t.linkHover};
40
49
  }
50
+ :host([variant='standalone']) { display: inline-block; }
51
+ :host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${space(1)}; font-weight: ${fontWeight("semibold")}; text-decoration-thickness: 1px; }
52
+ :host([variant='standalone']) a:hover .icon { transform: translateX(2px); }
53
+ .icon { flex: none; transition: transform 120ms ease-in-out; }
41
54
  .sr-only {
42
55
  ${visuallyHidden}
43
56
  }
@@ -52,7 +65,7 @@ var ImpktLink = class extends ImpktElement {
52
65
  target=${this.external ? "_blank" : nothing}
53
66
  rel=${this.external ? "noopener noreferrer" : nothing}
54
67
  >
55
- <slot></slot>${this.external ? html`<span class="sr-only"> (${this.externalText})</span>` : nothing}
68
+ <slot></slot>${iconSvg(this.icon !== "none" ? this.icon : this.variant === "standalone" ? this.external ? "external" : "arrow-right" : void 0, "1em")}${this.external ? html`<span class="sr-only"> (${this.externalText})</span>` : nothing}
56
69
  </a>
57
70
  `;
58
71
  }
@@ -62,4 +75,4 @@ customElements.define("impkt-link", ImpktLink);
62
75
  export {
63
76
  ImpktLink
64
77
  };
65
- //# sourceMappingURL=chunk-4KFHQBH2.js.map
78
+ //# sourceMappingURL=chunk-JPEWRJSQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/link.ts"],"sourcesContent":["import { html, css, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, visuallyHidden } from '../base/styles';\nimport { fontWeight, space, t } from '../base/tokens';\nimport { iconSvg } from './icon';\n\n/**\n * A link.\n *\n * **A new tab is always announced.** When `external` is set, the accessible\n * name gains \"opens in a new tab\" — not as a tooltip, which no screen reader\n * reads, and not as an icon alone, which carries no text. An unannounced new\n * tab breaks the back button for someone who cannot see that the window\n * changed, and that is what 3.2.5 is about.\n *\n * **It is underlined.** 1.4.1 Use of Colour: a link distinguished from body\n * text only by being a different colour is not distinguished at all for a\n * reader who cannot tell the two colours apart.\n\n *\n * @category action\n * @icon link\n * @slot - The link text.\n */\nexport class ImpktLink extends ImpktElement {\n static properties = {\n href: { type: String },\n external: { type: Boolean, reflect: true },\n externalText: { type: String, attribute: 'external-text' },\n variant: { type: String, reflect: true },\n icon: { type: String },\n };\n\n declare href: string;\n declare external: boolean;\n declare externalText: string;\n /** In a sentence, or on its own line as a call to action, bolder and with an arrow. */\n declare variant: 'inline' | 'standalone';\n /** An icon after the words. A standalone link has an arrow unless it says otherwise. */\n declare icon: 'none' | 'arrow-right' | 'arrow-left' | 'chevron-right' | 'chevron-down' | 'check' | 'close' | 'menu' | 'plus' | 'minus' | 'search' | 'external' | 'download' | 'home' | 'phone' | 'mail' | 'map-pin' | 'calendar' | 'clock' | 'user' | 'star' | 'heart' | 'shield' | 'leaf' | 'sun' | 'bolt' | 'key' | 'info' | 'warning' | 'document' | 'pound' | 'chat';\n\n constructor() {\n super();\n this.href = '';\n this.external = false;\n this.externalText = 'opens in a new tab';\n this.variant = 'inline';\n this.icon = 'none';\n }\n\n static styles = [\n ...ImpktElement.styles,\n focusRing,\n css`\n :host {\n display: inline;\n }\n a {\n color: ${t.link};\n text-decoration: underline;\n text-underline-offset: 0.2em;\n border-radius: ${t.radiusSm};\n }\n a:hover {\n color: ${t.linkHover};\n }\n :host([variant='standalone']) { display: inline-block; }\n :host([variant='standalone']) a { display: inline-flex; align-items: center; gap: ${space(1)}; font-weight: ${fontWeight('semibold')}; text-decoration-thickness: 1px; }\n :host([variant='standalone']) a:hover .icon { transform: translateX(2px); }\n .icon { flex: none; transition: transform 120ms ease-in-out; }\n .sr-only {\n ${visuallyHidden}\n }\n `,\n ];\n\n render(): TemplateResult {\n return html`\n <a\n part=\"link\"\n href=${this.href || nothing}\n target=${this.external ? '_blank' : nothing}\n rel=${this.external ? 'noopener noreferrer' : nothing}\n >\n <slot></slot>${iconSvg(this.icon !== 'none' ? this.icon : this.variant === 'standalone' ? (this.external ? 'external' : 'arrow-right') : undefined, '1em')}${this.external ? html`<span class=\"sr-only\"> (${this.externalText})</span>` : nothing}\n </a>\n `;\n }\n}\n\ncustomElements.define('impkt-link', ImpktLink);\n\ndeclare global {\n interface HTMLElementTagNameMap { 'impkt-link': ImpktLink }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,MAAM,KAAK,eAAoC;AAwBjD,IAAM,YAAN,cAAwB,aAAa;AAAA,EAC1C;AAAA,SAAO,aAAa;AAAA,MAClB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,SAAS,SAAS,KAAK;AAAA,MACzC,cAAc,EAAE,MAAM,QAAQ,WAAW,gBAAgB;AAAA,MACzD,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK;AAAA,MACvC,MAAM,EAAE,MAAM,OAAO;AAAA,IACvB;AAAA;AAAA,EAUA,cAAc;AACZ,UAAM;AACN,SAAK,OAAO;AACZ,SAAK,WAAW;AAChB,SAAK,eAAe;AACpB,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,aAAa;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKa,EAAE,IAAI;AAAA;AAAA;AAAA,yBAGE,EAAE,QAAQ;AAAA;AAAA;AAAA,iBAGlB,EAAE,SAAS;AAAA;AAAA;AAAA,0FAG8D,MAAM,CAAC,CAAC,kBAAkB,WAAW,UAAU,CAAC;AAAA;AAAA;AAAA;AAAA,UAIhI,cAAc;AAAA;AAAA;AAAA,IAGtB;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,eAGI,KAAK,QAAQ,OAAO;AAAA,iBAClB,KAAK,WAAW,WAAW,OAAO;AAAA,cACrC,KAAK,WAAW,wBAAwB,OAAO;AAAA;AAAA,uBAEtC,QAAQ,KAAK,SAAS,SAAS,KAAK,OAAO,KAAK,YAAY,eAAgB,KAAK,WAAW,aAAa,gBAAiB,QAAW,KAAK,CAAC,GAAG,KAAK,WAAW,+BAA+B,KAAK,YAAY,aAAa,OAAO;AAAA;AAAA;AAAA,EAGvP;AACF;AAEA,eAAe,OAAO,cAAc,SAAS;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FieldElement
3
- } from "./chunk-ZXCSQ6MK.js";
3
+ } from "./chunk-DI2CJ3MZ.js";
4
4
  import {
5
5
  fontSize,
6
6
  space,
@@ -128,4 +128,4 @@ customElements.define("impkt-checkbox-group", ImpktCheckboxGroup);
128
128
  export {
129
129
  ImpktCheckboxGroup
130
130
  };
131
- //# sourceMappingURL=chunk-PDXOPY22.js.map
131
+ //# sourceMappingURL=chunk-KWURASAB.js.map
@@ -0,0 +1,195 @@
1
+ import {
2
+ iconSvg
3
+ } from "./chunk-CFGLOYWW.js";
4
+ import {
5
+ ImpktElement,
6
+ focusRing,
7
+ fontSize,
8
+ fontWeight,
9
+ lineHeight,
10
+ space,
11
+ spaceAround,
12
+ t,
13
+ targetSize,
14
+ visuallyHidden
15
+ } from "./chunk-5NUF7ZQA.js";
16
+
17
+ // packages/ui/src/components/blocks.ts
18
+ import { css, html, nothing } from "lit";
19
+ var ImpktDivider = class extends ImpktElement {
20
+ static {
21
+ this.properties = {
22
+ spacing: { type: String, reflect: true },
23
+ tone: { type: String, reflect: true }
24
+ };
25
+ }
26
+ constructor() {
27
+ super();
28
+ this.spacing = "md";
29
+ this.tone = "subtle";
30
+ }
31
+ static {
32
+ this.styles = [...ImpktElement.styles, css`
33
+ :host { display: block; }
34
+ hr { margin: ${space(4)} 0; border: 0; border-block-start: ${t.borderThin} solid ${t.border}; opacity: 0.5; }
35
+ :host([tone='strong']) hr { opacity: 1; border-block-start-width: ${t.borderThick}; }
36
+ :host([spacing='sm']) hr { margin-block: ${space(2)}; }
37
+ :host([spacing='lg']) hr { margin-block: ${space(8)}; }
38
+ :host([spacing='xl']) hr { margin-block: ${space(12)}; }
39
+ `];
40
+ }
41
+ render() {
42
+ return html`<hr aria-hidden="true" part="line" />`;
43
+ }
44
+ };
45
+ var ImpktSpacer = class extends ImpktElement {
46
+ static {
47
+ this.properties = { size: { type: String, reflect: true } };
48
+ }
49
+ constructor() {
50
+ super();
51
+ this.size = "md";
52
+ }
53
+ static {
54
+ this.styles = [...ImpktElement.styles, css`
55
+ :host { display: block; block-size: ${space(4)}; }
56
+ :host([size='sm']) { block-size: ${space(2)}; }
57
+ :host([size='lg']) { block-size: ${space(8)}; }
58
+ :host([size='xl']) { block-size: ${space(12)}; }
59
+ :host([size='2xl']) { block-size: ${space(16)}; }
60
+ `];
61
+ }
62
+ render() {
63
+ return html``;
64
+ }
65
+ };
66
+ var ImpktVisuallyHidden = class extends ImpktElement {
67
+ static {
68
+ this.styles = [...ImpktElement.styles, css`:host { ${visuallyHidden} }`];
69
+ }
70
+ render() {
71
+ return html`<slot></slot>`;
72
+ }
73
+ };
74
+ var ImpktTabs = class extends ImpktElement {
75
+ static {
76
+ this.properties = {
77
+ items: { type: Array },
78
+ selected: { type: String, reflect: true },
79
+ label: { type: String }
80
+ };
81
+ }
82
+ constructor() {
83
+ super();
84
+ this.items = [];
85
+ this.selected = "";
86
+ this.label = "";
87
+ }
88
+ static {
89
+ this.styles = [...ImpktElement.styles, focusRing, css`
90
+ :host { display: block; }
91
+ [role='tablist'] { display: flex; flex-wrap: wrap; gap: ${space(1)}; border-block-end: ${t.borderThin} solid ${t.border}; }
92
+ [role='tab'] { ${targetSize} padding: ${space(3)} ${space(4)}; font: inherit; font-weight: ${fontWeight("semibold")}; 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; }
93
+ [role='tab']:hover { color: ${t.text}; background: ${t.surfaceInset}; }
94
+ [role='tab'][aria-selected='true'] { color: ${t.link}; border-block-end-color: currentColor; }
95
+ [role='tabpanel'] { padding-block: ${space(5)}; line-height: ${lineHeight("normal")}; white-space: pre-line; }
96
+ @media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }
97
+ `];
98
+ }
99
+ current() {
100
+ const items = this.items ?? [];
101
+ return items.some((i) => i.id === this.selected) ? this.selected : items[0]?.id ?? "";
102
+ }
103
+ choose(id, focus) {
104
+ if (id === this.current()) return;
105
+ this.selected = id;
106
+ this.dispatchEvent(new CustomEvent("impkt-change", { detail: { value: id }, bubbles: true, composed: true }));
107
+ if (focus) void this.updateComplete.then(() => this.renderRoot.querySelector(`#${this.id_(`tab-${id}`)}`)?.focus());
108
+ }
109
+ onKey(event) {
110
+ const items = this.items ?? [];
111
+ const at = items.findIndex((i) => i.id === this.current());
112
+ const to = { ArrowRight: at + 1, ArrowLeft: at - 1, Home: 0, End: items.length - 1 }[event.key];
113
+ if (to === void 0 || !items.length) return;
114
+ event.preventDefault();
115
+ this.choose(items[(to + items.length) % items.length].id, true);
116
+ }
117
+ render() {
118
+ const items = this.items ?? [];
119
+ const current = this.current();
120
+ return html`<div role="tablist" aria-label=${this.label || nothing} part="tabs" @keydown=${this.onKey}>
121
+ ${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}</button>`)}
122
+ </div>
123
+ ${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">${item.body}</div>`)}`;
124
+ }
125
+ };
126
+ var ImpktCardGrid = class extends ImpktElement {
127
+ static {
128
+ this.properties = {
129
+ items: { type: Array },
130
+ columns: { type: String, reflect: true },
131
+ headingLevel: { type: Number, attribute: "heading-level" },
132
+ ratio: { type: String, reflect: true },
133
+ spaceAbove: { type: String, reflect: true, attribute: "space-above" },
134
+ spaceBelow: { type: String, reflect: true, attribute: "space-below" }
135
+ };
136
+ }
137
+ constructor() {
138
+ super();
139
+ this.items = [];
140
+ this.columns = "three";
141
+ this.headingLevel = 3;
142
+ this.ratio = "4:3";
143
+ this.spaceAbove = "none";
144
+ this.spaceBelow = "none";
145
+ }
146
+ static {
147
+ this.styles = [...ImpktElement.styles, focusRing, spaceAround, css`
148
+ :host { display: block; container-type: inline-size; --ratio: 4 / 3; }
149
+ :host([ratio='16:9']) { --ratio: 16 / 9; }
150
+ :host([ratio='3:2']) { --ratio: 3 / 2; }
151
+ :host([ratio='1:1']) { --ratio: 1 / 1; }
152
+ ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }
153
+ :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
154
+ :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
155
+ li { position: relative; display: flex; flex-direction: column; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; overflow: hidden; transition: box-shadow 120ms ease-in-out; }
156
+ li.linked:hover { box-shadow: 0 6px 20px rgb(0 0 0 / 10%); }
157
+ img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }
158
+ .words { display: flex; flex-direction: column; gap: ${space(2)}; padding: ${space(5)}; flex: 1; }
159
+ .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-size: ${fontSize("lg")}; font-weight: ${fontWeight("bold")}; line-height: ${lineHeight("tight")}; }
160
+ .h a { color: inherit; text-decoration: none; border-radius: ${t.radiusSm}; }
161
+ .h a::after { content: ''; position: absolute; inset: 0; }
162
+ li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }
163
+ .body { margin: 0; line-height: ${lineHeight("normal")}; }
164
+ .badge { align-self: flex-start; padding: ${space(1)} ${space(2)}; border-radius: 999px; font-size: ${fontSize("sm")}; font-weight: ${fontWeight("semibold")}; background: ${t.brandSubtle}; color: ${t.brand}; }
165
+ .more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${space(1)}; color: ${t.link}; font-weight: ${fontWeight("semibold")}; }
166
+ @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
167
+ @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }
168
+ `];
169
+ }
170
+ render() {
171
+ return html`<ul part="list">${(this.items ?? []).map((card) => html`<li class=${card.href ? "linked" : ""} part="card">
172
+ ${card.imageSrc ? html`<img src=${card.imageSrc} alt=${card.imageAlt ?? ""} loading="lazy" />` : nothing}
173
+ <div class="words">
174
+ ${card.badge ? html`<span class="badge">${card.badge}</span>` : nothing}
175
+ <div class="h" role="heading" aria-level=${this.headingLevel}>${card.href ? html`<a href=${card.href}>${card.heading}</a>` : card.heading}</div>
176
+ ${card.text ? html`<p class="body">${card.text}</p>` : nothing}
177
+ ${card.href ? html`<span class="more" aria-hidden="true">${iconSvg("arrow-right", "1em")}</span>` : nothing}
178
+ </div>
179
+ </li>`)}</ul>`;
180
+ }
181
+ };
182
+ customElements.define("impkt-divider", ImpktDivider);
183
+ customElements.define("impkt-spacer", ImpktSpacer);
184
+ customElements.define("impkt-visually-hidden", ImpktVisuallyHidden);
185
+ customElements.define("impkt-tabs", ImpktTabs);
186
+ customElements.define("impkt-card-grid", ImpktCardGrid);
187
+
188
+ export {
189
+ ImpktDivider,
190
+ ImpktSpacer,
191
+ ImpktVisuallyHidden,
192
+ ImpktTabs,
193
+ ImpktCardGrid
194
+ };
195
+ //# sourceMappingURL=chunk-LLRJU7XE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/blocks.ts"],"sourcesContent":["import { css, html, nothing, type TemplateResult } from 'lit';\nimport { ImpktElement } from '../base/ImpktElement';\nimport { focusRing, targetSize, visuallyHidden } from '../base/styles';\nimport { fontSize, fontWeight, lineHeight, space, spaceAround, t } from '../base/tokens';\nimport { iconSvg } from './icon';\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 ImpktDivider extends ImpktElement {\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 = [...ImpktElement.styles, 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 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 ImpktSpacer extends ImpktElement {\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 = [...ImpktElement.styles, 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 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 ImpktVisuallyHidden extends ImpktElement {\n static styles = [...ImpktElement.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 body: 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 what is included and what costs extra.\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 * @category content\n * @icon tabs\n * @fires impkt-change - When another tab is chosen.\n */\nexport class ImpktTabs extends ImpktElement {\n static properties = {\n items: { type: Array },\n selected: { type: String, reflect: true },\n label: { type: String },\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\n constructor() {\n super();\n this.items = [];\n this.selected = '';\n this.label = '';\n }\n\n static styles = [...ImpktElement.styles, focusRing, css`\n :host { display: block; }\n [role='tablist'] { display: flex; flex-wrap: wrap; gap: ${space(1)}; border-block-end: ${t.borderThin} solid ${t.border}; }\n [role='tab'] { ${targetSize} padding: ${space(3)} ${space(4)}; font: inherit; font-weight: ${fontWeight('semibold')}; 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 [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')}; white-space: pre-line; }\n @media (forced-colors: active) { [role='tab'][aria-selected='true'] { border-block-end-color: Highlight; } }\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('impkt-change', { detail: { value: id }, bubbles: true, composed: true }));\n if (focus) void this.updateComplete.then(() => this.renderRoot.querySelector<HTMLElement>(`#${this.id_(`tab-${id}`)}`)?.focus());\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 render(): TemplateResult {\n const items = this.items ?? [];\n const current = this.current();\n return html`<div role=\"tablist\" aria-label=${this.label || nothing} part=\"tabs\" @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}</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\">${item.body}</div>`)}`;\n }\n}\n\n/** One card in a row of them. */\nexport interface CardItem {\n id?: string;\n heading: string;\n text?: string;\n imageSrc?: string;\n imageAlt?: string;\n href?: string;\n badge?: string;\n}\n\n/**\n * A row of cards, each a picture, a heading, a line of text and a link: the\n * developments on a developments page, or the house types at one of them.\n *\n * **The whole card is the link's target, and the heading is its name.** The\n * link is on the heading, so a screen reader hears \"Larkfield Meadows, link\"\n * once rather than the whole card read out as one long link, and a pointer\n * can still press anywhere on the card.\n *\n * @category content\n * @icon cards\n */\nexport class ImpktCardGrid extends ImpktElement {\n static properties = {\n items: { type: Array },\n columns: { type: String, reflect: true },\n headingLevel: { type: Number, attribute: 'heading-level' },\n ratio: { type: String, reflect: true },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n declare items: CardItem[];\n declare columns: 'two' | 'three' | 'four';\n /** The level of each card's heading. One below the heading above the cards. */\n declare headingLevel: 2 | 3 | 4;\n /** The shape of each card's picture. */\n declare ratio: '16:9' | '4:3' | '3:2' | '1:1';\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl';\n\n constructor() {\n super();\n this.items = [];\n this.columns = 'three';\n this.headingLevel = 3;\n this.ratio = '4:3';\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [...ImpktElement.styles, focusRing, spaceAround, css`\n :host { display: block; container-type: inline-size; --ratio: 4 / 3; }\n :host([ratio='16:9']) { --ratio: 16 / 9; }\n :host([ratio='3:2']) { --ratio: 3 / 2; }\n :host([ratio='1:1']) { --ratio: 1 / 1; }\n ul { list-style: none; margin: 0; padding: 0; display: grid; gap: ${space(6)}; grid-template-columns: repeat(3, minmax(0, 1fr)); }\n :host([columns='two']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n :host([columns='four']) ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }\n li { position: relative; display: flex; flex-direction: column; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; overflow: hidden; transition: box-shadow 120ms ease-in-out; }\n li.linked:hover { box-shadow: 0 6px 20px rgb(0 0 0 / 10%); }\n img { display: block; inline-size: 100%; aspect-ratio: var(--ratio); object-fit: cover; }\n .words { display: flex; flex-direction: column; gap: ${space(2)}; padding: ${space(5)}; flex: 1; }\n .h { margin: 0; color: ${t.textHeading}; font-family: ${t.fontHeading}; font-size: ${fontSize('lg')}; font-weight: ${fontWeight('bold')}; line-height: ${lineHeight('tight')}; }\n .h a { color: inherit; text-decoration: none; border-radius: ${t.radiusSm}; }\n .h a::after { content: ''; position: absolute; inset: 0; }\n li.linked:hover .h a { text-decoration: underline; text-underline-offset: 0.2em; }\n .body { margin: 0; line-height: ${lineHeight('normal')}; }\n .badge { align-self: flex-start; padding: ${space(1)} ${space(2)}; border-radius: 999px; font-size: ${fontSize('sm')}; font-weight: ${fontWeight('semibold')}; background: ${t.brandSubtle}; color: ${t.brand}; }\n .more { margin-block-start: auto; display: inline-flex; align-items: center; gap: ${space(1)}; color: ${t.link}; font-weight: ${fontWeight('semibold')}; }\n @container (max-width: 48rem) { ul, :host([columns='four']) ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n @container (max-width: 32rem) { ul, :host([columns='two']) ul, :host([columns='four']) ul { grid-template-columns: minmax(0, 1fr); } }\n `];\n\n render(): TemplateResult {\n return html`<ul part=\"list\">${(this.items ?? []).map((card) => html`<li class=${card.href ? 'linked' : ''} part=\"card\">\n ${card.imageSrc ? html`<img src=${card.imageSrc} alt=${card.imageAlt ?? ''} loading=\"lazy\" />` : nothing}\n <div class=\"words\">\n ${card.badge ? html`<span class=\"badge\">${card.badge}</span>` : nothing}\n <div class=\"h\" role=\"heading\" aria-level=${this.headingLevel}>${card.href ? html`<a href=${card.href}>${card.heading}</a>` : card.heading}</div>\n ${card.text ? html`<p class=\"body\">${card.text}</p>` : nothing}\n ${card.href ? html`<span class=\"more\" aria-hidden=\"true\">${iconSvg('arrow-right', '1em')}</span>` : nothing}\n </div>\n </li>`)}</ul>`;\n }\n}\n\ncustomElements.define('impkt-divider', ImpktDivider);\ncustomElements.define('impkt-spacer', ImpktSpacer);\ncustomElements.define('impkt-visually-hidden', ImpktVisuallyHidden);\ncustomElements.define('impkt-tabs', ImpktTabs);\ncustomElements.define('impkt-card-grid', ImpktCardGrid);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impkt-divider': ImpktDivider; 'impkt-spacer': ImpktSpacer; 'impkt-visually-hidden': ImpktVisuallyHidden; 'impkt-tabs': ImpktTabs; 'impkt-card-grid': ImpktCardGrid;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,eAAoC;AAejD,IAAM,eAAN,cAA2B,aAAa;AAAA,EAC7C;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,CAAC,GAAG,aAAa,QAAQ;AAAA;AAAA,mBAExB,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,GACrD;AAAA;AAAA,EAED,SAAyB;AACvB,WAAO;AAAA,EACT;AACF;AASO,IAAM,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