@atomic-ui/blocks 0.13.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/README.md +15 -15
  2. package/custom-elements.json +2961 -9573
  3. package/dist/{chunk-B6I3GVJ5.js → chunk-3G3NP4UC.js} +9 -4
  4. package/dist/chunk-3G3NP4UC.js.map +1 -0
  5. package/dist/{chunk-H262HKSL.js → chunk-7OFH762N.js} +53 -23
  6. package/dist/chunk-7OFH762N.js.map +1 -0
  7. package/dist/{chunk-WTVF3JRL.js → chunk-GDATDR2Q.js} +24 -7
  8. package/dist/chunk-GDATDR2Q.js.map +1 -0
  9. package/dist/chunk-GQ2I44OU.js +226 -0
  10. package/dist/chunk-GQ2I44OU.js.map +1 -0
  11. package/dist/chunk-HISF6RYK.js +199 -0
  12. package/dist/chunk-HISF6RYK.js.map +1 -0
  13. package/dist/{chunk-53V2GY6L.js → chunk-LJGOTYDJ.js} +76 -69
  14. package/dist/chunk-LJGOTYDJ.js.map +1 -0
  15. package/dist/{chunk-WIVKJL64.js → chunk-OBBPBN4S.js} +73 -164
  16. package/dist/chunk-OBBPBN4S.js.map +1 -0
  17. package/dist/chunk-OHXEZPBB.js +109 -0
  18. package/dist/chunk-OHXEZPBB.js.map +1 -0
  19. package/dist/{chunk-FNGN2F6Y.js → chunk-VOONXP5H.js} +30 -59
  20. package/dist/chunk-VOONXP5H.js.map +1 -0
  21. package/dist/chunk-XSKGWT2D.js +84 -0
  22. package/dist/chunk-XSKGWT2D.js.map +1 -0
  23. package/dist/components/changelog.d.ts +0 -288
  24. package/dist/components/changelog.js +3 -12
  25. package/dist/components/estimator.js +1 -1
  26. package/dist/components/g2-case.d.ts +8 -1
  27. package/dist/components/g2-case.js +1 -1
  28. package/dist/components/g2-site.d.ts +49 -41
  29. package/dist/components/g2-site.js +1 -3
  30. package/dist/components/journey.d.ts +13 -2
  31. package/dist/components/journey.js +1 -1
  32. package/dist/components/marketing.d.ts +0 -283
  33. package/dist/components/marketing.js +3 -13
  34. package/dist/components/organisms.d.ts +0 -489
  35. package/dist/components/organisms.js +3 -19
  36. package/dist/components/selling.d.ts +0 -255
  37. package/dist/components/selling.js +3 -15
  38. package/dist/components/site.d.ts +8 -53
  39. package/dist/components/site.js +3 -5
  40. package/dist/components/studio.d.ts +42 -98
  41. package/dist/components/studio.js +1 -3
  42. package/dist/index.d.ts +9 -13
  43. package/dist/index.js +25 -103
  44. package/dist/index.js.map +1 -1
  45. package/dist/standalone/atomic-ui-blocks.js +832 -1622
  46. package/dist/standalone/atomic-ui-blocks.js.map +4 -4
  47. package/dist/standalone/index.html +18 -26
  48. package/package.json +3 -3
  49. package/specimen/index.html +18 -26
  50. package/dist/chunk-53V2GY6L.js.map +0 -1
  51. package/dist/chunk-B6I3GVJ5.js.map +0 -1
  52. package/dist/chunk-FNGN2F6Y.js.map +0 -1
  53. package/dist/chunk-H262HKSL.js.map +0 -1
  54. package/dist/chunk-IT2NA25D.js +0 -571
  55. package/dist/chunk-IT2NA25D.js.map +0 -1
  56. package/dist/chunk-MMADM6OW.js +0 -782
  57. package/dist/chunk-MMADM6OW.js.map +0 -1
  58. package/dist/chunk-NHWD2LUR.js +0 -255
  59. package/dist/chunk-NHWD2LUR.js.map +0 -1
  60. package/dist/chunk-R7SSIE2E.js +0 -362
  61. package/dist/chunk-R7SSIE2E.js.map +0 -1
  62. package/dist/chunk-WIVKJL64.js.map +0 -1
  63. package/dist/chunk-WTVF3JRL.js.map +0 -1
  64. package/dist/chunk-XB6FD4SF.js +0 -438
  65. package/dist/chunk-XB6FD4SF.js.map +0 -1
  66. package/dist/chunk-YXMXLVK7.js +0 -230
  67. package/dist/chunk-YXMXLVK7.js.map +0 -1
  68. package/dist/chunk-ZD75GU6J.js +0 -75
  69. package/dist/chunk-ZD75GU6J.js.map +0 -1
  70. package/dist/chunk-ZODL5HD4.js +0 -535
  71. package/dist/chunk-ZODL5HD4.js.map +0 -1
  72. package/dist/components/card-grid.d.ts +0 -72
  73. package/dist/components/card-grid.js +0 -7
  74. package/dist/components/card-grid.js.map +0 -1
  75. package/dist/components/property.d.ts +0 -389
  76. package/dist/components/property.js +0 -17
  77. package/dist/components/property.js.map +0 -1
  78. package/dist/components/scene.d.ts +0 -138
  79. package/dist/components/scene.js +0 -7
  80. package/dist/components/scene.js.map +0 -1
  81. package/dist/components/scrubber.d.ts +0 -86
  82. package/dist/components/scrubber.js +0 -7
  83. package/dist/components/scrubber.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/g2-case.ts"],"sourcesContent":["/**\n * The G2 Noire blocks for a case study and the studio's process: the process\n * line, the week strip, the \"how might we\" callout, the hypothesis card and the\n * browser frame a product screenshot sits in.\n */\nimport { css, html, nothing, svg, type TemplateResult } from 'lit';\nimport { ImpaktElement, fontWeight, say, space, t, visuallyHidden } from '@atomic-ui/ui';\nimport { accent, accentOn, accentOnInk, band, bandLine, bandMuted, bandOn, bandRaised, ink, inkLine, levelOf, monoLabel, paper } from './g2-shared';\n\n/** One point on the process line. */\nexport interface ProcessNode {\n /**\n * What happens here, such as \"Discovery\". Leave empty for a point with no\n * words, such as where the line comes back to the main line: it is drawn\n * and is not in the list a screen reader meets.\n */\n label: string;\n /** How far the line dips here: 0 on the main line, 1 a step below (40px), 2 two steps. A fraction falls between. */\n depth?: number;\n /** The point the project is at now, filled in the accent. */\n current?: boolean;\n /**\n * Where the point falls along the line, from 0 at its start to 1 at its\n * end, such as 0.25 for a quarter of the way. Points left without one are\n * spaced evenly, as every point is when none has one.\n */\n at?: number;\n /** A flag above the point, such as \"Build merged\" or \"v1.0 launch\". */\n flag?: string;\n}\n\nconst STEP = 40;\n/** The main line is 40px into the drawing, as in the Sprint progress component (`10:483`). */\nconst TOP = 40;\n\n/**\n * A project's process drawn as one main line that dips to a different depth\n * for each phase, like a branch in version control: hollow rings for each\n * point, the current one larger and filled in the accent and each flagged one\n * filled in the accent too, a mono label by each (above a\n * point on the main line, below one that dips) and accent flags such as\n * \"Build merged\" and \"v1.0 launch\". A flag on the main line stands in for\n * its point's label there. Between two points that dip to different depths\n * the line comes back up to the main line, so each phase is its own valley,\n * as in the Sprint progress component (`10:483`).\n *\n * **The drawing is decoration; the list is the content.** A screen reader\n * meets an ordered list of the points, in order, with their flags and the\n * current one marked as the current step (1.1.1, 1.3.1). On a narrow column,\n * measured against its own width, the same list is drawn as a vertical rail\n * and the drawing is not shown, so nothing is lost at 320px (1.4.10).\n *\n * It is drawn for an ink band and takes the band's colours, and the band's\n * pattern, such as its column lines, shows through it; outside a band it draws\n * its own ink panel. Give a point `at` to place it where its phase falls, and\n * leave a point's label empty for one with no words. The current point keeps a ring in the band's text\n * colour, so it is not told by its colour alone (1.4.1, 1.4.11).\n *\n * @category content\n * @icon git-commit\n */\nexport class ImpaktProcessLine extends ImpaktElement {\n static properties = {\n nodes: { type: Array },\n lineLabel: { type: String, attribute: 'line-label' },\n label: { type: String },\n };\n /** The points, left to right. */\n declare nodes: ProcessNode[];\n /** A label at the start of the line, such as \"main\". */\n declare lineLabel: string;\n /** A name for the list, for a screen reader, such as \"How a project runs\". */\n declare label: string;\n\n constructor() {\n super();\n this.nodes = [];\n this.lineLabel = '';\n this.label = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n /* On a band, the band's own pattern shows through and the \"main\" label hangs above the drawing (10:483); outside one the line draws its own ink panel, with room in it for that label. */\n :host { display: block; container-type: inline-size; background: var(--impakt-band-panel, ${band}); color: ${bandOn}; }\n .visual { display: none; position: relative; margin-block-start: var(--impakt-band-panel-inset, 32px); }\n .visual svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }\n .visual path { fill: none; stroke: ${bandOn}; stroke-width: 1.5; vector-effect: non-scaling-stroke; }\n .ring { position: absolute; inline-size: 10px; block-size: 10px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid ${bandOn}; background: ${band}; transform: translate(-50%, -50%); }\n /* A flagged point is filled in the accent (10:483); the current one is filled and 2px larger, so it is not told by colour alone. */\n .ring.flagged, .ring.current { background: ${accent}; }\n .ring.current { inline-size: 12px; block-size: 12px; }\n /* Each label keeps to the space between its point and the next, wrapping rather than running into its neighbour. */\n .vlabel { position: absolute; transform: translateX(-50%); ${monoLabel}; color: ${bandMuted}; inline-size: max-content; max-inline-size: var(--slot); text-align: center; text-wrap: balance; }\n .lineLabel { position: absolute; inset-inline-start: 0; ${monoLabel}; color: ${bandMuted}; }\n .flag { display: inline-block; padding: 4px 8px; ${monoLabel}; font-weight: ${fontWeight('medium')}; background: ${accent}; color: ${accentOn}; white-space: nowrap; }\n .visual .flag { position: absolute; transform: translate(-50%, -100%); }\n\n ol { margin: 0; padding: ${space(6)} ${space(4)}; list-style: none; }\n li { position: relative; padding: 0 0 ${space(5)} 28px; }\n li::before { content: ''; position: absolute; inset-inline-start: 0; inset-block-start: 4px; inline-size: 10px; block-size: 10px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid ${bandOn}; background: ${band}; }\n li[aria-current]::before { background: ${accent}; }\n li:not(:last-child)::after { content: ''; position: absolute; inset-inline-start: 4.25px; inset-block-start: 14px; inset-block-end: -4px; inline-size: 1.5px; background: ${bandOn}; }\n .rlabel { ${monoLabel}; font-size: 0.75rem; color: ${bandOn}; }\n li .flag { margin-inline-start: ${space(2)}; }\n\n @container (min-width: 60rem) {\n .visual { display: block; }\n ol { ${visuallyHidden} }\n }\n @media (forced-colors: active) {\n .visual path { stroke: CanvasText; }\n .ring, li::before { border-color: CanvasText; background: Canvas; }\n .ring.current, .ring.flagged, li[aria-current]::before { background: Highlight; }\n li::after { background: CanvasText; }\n .flag { border: 1px solid CanvasText; }\n }\n `,\n ];\n\n render(): TemplateResult {\n const nodes = this.nodes ?? [];\n if (!nodes.length) return html``;\n const n = nodes.length;\n const depthOf = (node: ProcessNode) => Math.max(0, Math.min(4, Number(node.depth) || 0));\n const maxDepth = Math.max(...nodes.map(depthOf));\n // The lowest label hangs 14px under its point and is 15px tall; the drawing ends 26px under it, 170px for the frame's 75px dip.\n const height = Math.round(TOP + maxDepth * STEP + 55);\n // Where each point falls, from 0 to 1: its own `at`, or evenly spaced.\n const xs = nodes.map((node, i) => {\n const at = Number(node.at);\n return node.at != null && Number.isFinite(at) ? Math.max(0, Math.min(1, at)) : (i + 0.5) / n;\n });\n const pts = nodes.map((node, i) => ({ x: xs[i]! * 1000, y: TOP + depthOf(node) * STEP }));\n let d = `M0 ${pts[0]!.y} L${pts[0]!.x} ${pts[0]!.y}`;\n for (let i = 1; i < n; i++) {\n const a = pts[i - 1]!;\n const b = pts[i]!;\n // Level points join with a straight line. Two points that dip to different depths are two valleys: the line\n // comes back up to the main line halfway between them (10:483). Otherwise one curve, level at both ends.\n const curve = (from: { x: number; y: number }, to: { x: number; y: number }) => {\n const mid = (from.x + to.x) / 2;\n return ` C${mid} ${from.y} ${mid} ${to.y} ${to.x} ${to.y}`;\n };\n if (a.y === b.y) d += ` L${b.x} ${b.y}`;\n else if (a.y > TOP && b.y > TOP) {\n const peak = { x: (a.x + b.x) / 2, y: TOP };\n d += curve(a, peak) + curve(peak, b);\n } else d += curve(a, b);\n }\n d += ` L1000 ${pts[n - 1]!.y}`;\n const pct = (i: number) => `${xs[i]! * 100}%`;\n // Each label keeps to the room between its point and its nearest neighbour, wrapping rather than running into it.\n // Evenly spaced points keep a little air between their labels; placed points take the whole room, as the frame's do.\n const placed = nodes.some((node) => node.at != null);\n const slot = (i: number) => {\n const near = Math.min(i > 0 ? xs[i]! - xs[i - 1]! : 1, i < n - 1 ? xs[i + 1]! - xs[i]! : 1);\n return placed ? `calc(${near * 100}cqi + 0.25rem)` : `calc(${100 / n}cqi - 0.5rem)`;\n };\n const listed = nodes.filter((node) => node.label || node.flag);\n return html`<div class=\"visual\" part=\"drawing\" aria-hidden=\"true\" style=\"block-size:${height}px\">\n <svg viewBox=\"0 0 1000 ${height}\" preserveAspectRatio=\"none\" focusable=\"false\">${svg`<path d=${d} />`}</svg>\n ${this.lineLabel ? html`<span class=\"lineLabel\" style=\"inset-block-start:${TOP - 66}px\">${this.lineLabel}</span>` : nothing}\n ${nodes.map((node, i) => {\n const y = pts[i]!.y;\n // On the main line the label sits above the point, clear of the curves that leave it; a\n // flag there stands in for it. Below the main line the label hangs under the point.\n const onMain = depthOf(node) === 0;\n const style = (edge: string) => `inset-inline-start:${pct(i)};${edge};--slot:${slot(i)}`;\n const label = !node.label\n ? nothing\n : onMain\n ? node.flag\n ? nothing\n : html`<span class=\"vlabel\" style=${style(`inset-block-end:${height - y + 12}px`)}>${node.label}</span>`\n : html`<span class=\"vlabel\" style=${style(`inset-block-start:${y + 14}px`)}>${node.label}</span>`;\n return html`<span class=\"ring${node.current ? ' current' : ''}${node.flag ? ' flagged' : ''}\" style=\"inset-inline-start:${pct(i)};inset-block-start:${y}px\"></span>\n ${label}\n ${node.flag ? html`<span class=\"flag\" style=\"inset-inline-start:${pct(i)};inset-block-start:${y - 15}px\">${node.flag}</span>` : nothing}`;\n })}\n </div>\n <ol part=\"list\" role=\"list\" aria-label=${this.label || nothing}>\n ${listed.map(\n (node) => html`<li part=\"item\" aria-current=${node.current ? 'step' : nothing}>\n <span class=\"rlabel\">${node.label}</span>${node.flag ? html`<span class=\"flag\">${node.flag}</span>` : nothing}\n </li>`,\n )}\n </ol>`;\n }\n}\n\n/** One day of the week strip. */\nexport interface WeekDay {\n /** The day, such as \"Mon\". Set in mono capitals. */\n day: string;\n /** What happens, such as \"Plan\". */\n heading: string;\n /** A line about it. */\n text?: string;\n /** Pick this day out in the accent, such as the demo. */\n highlight?: boolean;\n}\n\n/**\n * A working week in five tiles, such as Mon Plan, Tue Make, Wed Review, Thu\n * Make and Fri Demo: a mono day, a heading and a line, on tiles raised off an\n * ink band, with one day picked out in the accent.\n *\n * A list, each heading at the level the page asks for (1.3.1). The accent day\n * is also the only one with ink words, and its heading says what it is, so it\n * is not told by colour alone (1.4.1). The tiles wrap on a narrow screen\n * (1.4.10).\n *\n * @category content\n * @icon calendar\n */\nexport class ImpaktWeekStrip extends ImpaktElement {\n static properties = {\n days: { type: Array },\n headingLevel: { type: Number, attribute: 'heading-level' },\n label: { type: String },\n };\n declare days: WeekDay[];\n declare headingLevel: number;\n /** A name for the list, for a screen reader. Leave empty for none. */\n declare label: string;\n\n constructor() {\n super();\n this.days = [];\n this.headingLevel = 3;\n this.label = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: 10px; }\n li { box-sizing: border-box; min-block-size: 150px; padding: ${space(5)}; background: ${bandRaised}; border: 1px solid ${bandLine}; color: ${bandOn}; }\n li.highlight { background: ${accent}; border-color: ${accent}; color: ${accentOn}; }\n .day { margin: 0; ${monoLabel}; color: ${bandMuted}; }\n .heading { margin: ${space(2)} 0 0; font-family: ${t.fontHeading}; font-size: 2rem; font-weight: ${fontWeight('semibold')}; line-height: 1.1; letter-spacing: -0.03em; }\n .text { margin: ${space(3)} 0 0; font-size: 0.875rem; line-height: 1.45; color: ${bandMuted}; }\n li.highlight :is(.day, .text) { color: ${accentOn}; }\n @media (forced-colors: active) { li, li.highlight { border-color: CanvasText; } li.highlight { border-width: 3px; } }\n `,\n ];\n\n render(): TemplateResult {\n if (!this.days?.length) return html``;\n const level = levelOf(this.headingLevel);\n return html`<ol part=\"list\" role=\"list\" aria-label=${this.label || nothing}>\n ${this.days.map(\n (day) => html`<li part=\"day\" class=${day.highlight ? 'highlight' : ''}>\n <p class=\"day\">${day.day}</p>\n <div class=\"heading\" role=\"heading\" aria-level=${level}>${day.heading}</div>\n ${day.text ? html`<p class=\"text\">${day.text}</p>` : nothing}\n </li>`,\n )}\n </ol>`;\n }\n}\n\n/**\n * A statement set apart on an ink panel, under a mono accent label: the \"How\n * might we\" of a case study.\n *\n * The panel stays ink in both themes, so the accent label on it keeps its\n * contrast (1.4.3). The label and statement are plain text, read in order.\n *\n * @category content\n * @icon quote\n * @slot - The statement, when it holds more than words. Replaces `text`.\n */\nexport class ImpaktCallout extends ImpaktElement {\n static properties = {\n label: { type: String },\n text: { type: String },\n };\n /** The label above, such as \"How might we\". */\n declare label: string;\n /** The statement. */\n declare text: string;\n\n constructor() {\n super();\n this.label = '';\n this.text = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n .panel { padding: ${space(8)} ${space(8)} ${space(10)}; background: ${ink}; color: ${paper}; border: 1px solid ${ink}; }\n .label { margin: 0 0 ${space(4)}; ${monoLabel}; font-weight: ${fontWeight('medium')}; color: ${accentOnInk}; }\n .text { margin: 0; max-inline-size: 26em; font-family: ${t.fontHeading}; font-size: clamp(1.5rem, 1rem + 2vw, 2rem); font-weight: ${fontWeight('semibold')}; line-height: 1.2; letter-spacing: -0.02em; }\n @media (prefers-color-scheme: dark) { .panel { border-color: ${inkLine}; } }\n @media (max-width: 30rem) { .panel { padding: ${space(6)}; } }\n @media (forced-colors: active) { .panel { border-color: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"panel\" part=\"panel\">\n ${this.label ? html`<p class=\"label\" part=\"label\">${this.label}</p>` : nothing}\n <p class=\"text\" part=\"text\"><slot>${this.text}</slot></p>\n </div>`;\n }\n}\n\n/**\n * A hypothesis to test: its number such as \"H1\", how much it matters, a\n * statement, and the metric that will tell, on a white card with an ink border.\n * Lay six out two to a row.\n *\n * `impact` draws the tag: \"High impact\" on the accent, \"Medium impact\" and\n * \"Low impact\" outlined in ink. The tag says the impact in words, so it is not\n * told by its colour (1.4.1).\n *\n * @category content\n * @icon flask\n */\nexport class ImpaktHypothesisCard extends ImpaktElement {\n static properties = {\n number: { type: String },\n statement: { type: String },\n metric: { type: String },\n impact: { type: String, reflect: true },\n impactLabel: { type: String, attribute: 'impact-label' },\n };\n /** The hypothesis's number, such as \"H1\". */\n declare number: string;\n /** What the team believes, such as \"A jobs board grouped by stage shows stuck cars faster than a shared spreadsheet.\" */\n declare statement: string;\n /** What will be measured, such as \"Time a car waits unnoticed\". */\n declare metric: string;\n /** How much it matters. Leave empty for no tag. */\n declare impact: 'high' | 'medium' | 'low' | '';\n /** The tag's words, in place of the impact's own. */\n declare impactLabel: string;\n\n constructor() {\n super();\n this.number = '';\n this.statement = '';\n this.metric = '';\n this.impact = '';\n this.impactLabel = '';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; block-size: 100%; }\n article { box-sizing: border-box; block-size: 100%; display: grid; align-content: start; gap: ${space(4)}; padding: ${space(6)}; background: ${t.surfaceCard}; color: ${t.text}; border: 1px solid ${t.text}; }\n .top { display: flex; justify-content: space-between; align-items: center; gap: ${space(2)}; flex-wrap: wrap; min-block-size: 22px; }\n .number { font-family: ${t.fontMono}; font-size: 0.75rem; letter-spacing: 0.06em; }\n .impact { margin: 0; padding: 3px 7px; ${monoLabel}; font-weight: ${fontWeight('medium')}; border: 1px solid ${t.text}; color: ${t.text}; }\n :host([impact='high']) .impact { background: ${accent}; color: ${accentOn}; border-color: ${accentOn}; }\n .statement { margin: 0; font-family: ${t.fontHeading}; font-size: 1.25rem; line-height: 1.35; letter-spacing: -0.01em; }\n .metric { margin: 0; ${monoLabel}; color: ${t.textMuted}; }\n @media (forced-colors: active) { article, .impact { border-color: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n const words: Record<string, string> = { high: 'High impact', medium: 'Medium impact', low: 'Low impact' };\n const impact = this.impactLabel || (this.impact && words[this.impact] ? say(words[this.impact]!) : '');\n return html`<article part=\"card\">\n ${\n this.number || impact\n ? html`<div class=\"top\">\n <span class=\"number\" part=\"number\">${this.number}</span>\n ${impact ? html`<p class=\"impact\" part=\"impact\">${impact}</p>` : nothing}\n </div>`\n : nothing\n }\n ${this.statement ? html`<p class=\"statement\" part=\"statement\">${this.statement}</p>` : nothing}\n ${this.metric ? html`<p class=\"metric\" part=\"metric\">${say('Metric')} · ${this.metric}</p>` : nothing}\n </article>`;\n }\n}\n\n/**\n * A window frame for a product screenshot on an ink band: a 40px bar with\n * three dots, the first in the accent, and a mono caption, over a canvas that\n * holds the picture. With no picture in it, the canvas shows a grid, as a\n * placeholder.\n *\n * **The frame is decoration; the picture carries the words.** Give the image\n * its own `alt`. The bar is hidden from a screen reader (1.1.1).\n *\n * @category media\n * @icon browser\n * @slot - The picture, such as an `<img>` with its `alt`.\n */\nexport class ImpaktBrowserFrame extends ImpaktElement {\n static properties = {\n caption: { type: String },\n ratio: { type: String },\n filled: { state: true },\n };\n /** The caption in the bar, such as \"Harbour · Cover\". It is decoration. */\n declare caption: string;\n /** The canvas's shape while it is empty, as a CSS aspect ratio. */\n declare ratio: string;\n declare protected filled: boolean;\n\n constructor() {\n super();\n this.caption = '';\n this.ratio = '16 / 9';\n this.filled = false;\n }\n\n static styles = [\n ...ImpaktElement.styles,\n css`\n :host { display: block; }\n .frame { border: 1px solid ${bandLine}; background: ${band}; color: ${bandOn}; }\n .bar { display: flex; align-items: center; gap: 6px; block-size: 40px; padding-inline: ${space(3)}; background: ${bandRaised}; border-block-end: 1px solid ${bandLine}; overflow: hidden; }\n .dot { flex: none; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${bandLine}; }\n .dot:first-child { background: ${accent}; }\n .caption { margin-inline-start: ${space(1.5)}; ${monoLabel}; color: ${bandMuted}; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .canvas { position: relative; }\n .canvas.empty { background-image: linear-gradient(to right, ${bandLine} 1px, transparent 1px), linear-gradient(to bottom, ${bandLine} 1px, transparent 1px); background-size: 28px 28px; }\n ::slotted(img), ::slotted(picture), ::slotted(video) { display: block; inline-size: 100%; block-size: auto; }\n @media (forced-colors: active) { .frame, .bar { border-color: CanvasText; } .dot { background: CanvasText; } }\n `,\n ];\n\n render(): TemplateResult {\n return html`<div class=\"frame\" part=\"frame\">\n <div class=\"bar\" part=\"bar\" aria-hidden=\"true\">\n <span class=\"dot\"></span><span class=\"dot\"></span><span class=\"dot\"></span>\n ${this.caption ? html`<span class=\"caption\" part=\"caption\">${this.caption}</span>` : nothing}\n </div>\n <div class=\"canvas ${this.filled ? '' : 'empty'}\" part=\"canvas\" style=${this.filled ? '' : `aspect-ratio: ${this.ratio || '16 / 9'}`}>\n <slot @slotchange=${this.onSlot}></slot>\n </div>\n </div>`;\n }\n\n private onSlot(e: Event): void {\n this.filled = (e.target as HTMLSlotElement).assignedElements().length > 0;\n }\n}\n\ncustomElements.define('impakt-process-line', ImpaktProcessLine);\ncustomElements.define('impakt-week-strip', ImpaktWeekStrip);\ncustomElements.define('impakt-callout', ImpaktCallout);\ncustomElements.define('impakt-hypothesis-card', ImpaktHypothesisCard);\ncustomElements.define('impakt-browser-frame', ImpaktBrowserFrame);\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-process-line': ImpaktProcessLine;\n 'impakt-week-strip': ImpaktWeekStrip;\n 'impakt-callout': ImpaktCallout;\n 'impakt-hypothesis-card': ImpaktHypothesisCard;\n 'impakt-browser-frame': ImpaktBrowserFrame;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA,SAAS,KAAK,MAAM,SAAS,WAAgC;AAC7D,SAAS,eAAe,YAAY,KAAK,OAAO,GAAG,sBAAsB;AAyBzE,IAAM,OAAO;AAEb,IAAM,MAAM;AA4BL,IAAM,oBAAN,cAAgC,cAAc;AAAA,EACnD;AAAA,SAAO,aAAa;AAAA,MAClB,OAAO,EAAE,MAAM,MAAM;AAAA,MACrB,WAAW,EAAE,MAAM,QAAQ,WAAW,aAAa;AAAA,MACnD,OAAO,EAAE,MAAM,OAAO;AAAA,IACxB;AAAA;AAAA,EAQA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ,CAAC;AACd,SAAK,YAAY;AACjB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA;AAAA,SAAO,SAAS;AAAA,MACd,GAAG,cAAc;AAAA,MACjB;AAAA;AAAA,kGAE8F,IAAI,aAAa,MAAM;AAAA;AAAA;AAAA,2CAG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,QAAQ,sDAAsD,QAAQ;AAAA;AAAA;AAAA;AAAA,IAIxI;AAAA;AAAA,EAEA,SAAyB;AACvB,WAAO;AAAA;AAAA;AAAA,UAGD,KAAK,UAAU,4CAA4C,KAAK,OAAO,YAAY,OAAO;AAAA;AAAA,2BAEzE,KAAK,SAAS,KAAK,OAAO,yBAAyB,KAAK,SAAS,KAAK,iBAAiB,KAAK,SAAS,QAAQ,EAAE;AAAA,4BAC9G,KAAK,MAAM;AAAA;AAAA;AAAA,EAGrC;AAAA,EAEQ,OAAO,GAAgB;AAC7B,SAAK,SAAU,EAAE,OAA2B,iBAAiB,EAAE,SAAS;AAAA,EAC1E;AACF;AAEA,eAAe,OAAO,uBAAuB,iBAAiB;AAC9D,eAAe,OAAO,qBAAqB,eAAe;AAC1D,eAAe,OAAO,kBAAkB,aAAa;AACrD,eAAe,OAAO,0BAA0B,oBAAoB;AACpE,eAAe,OAAO,wBAAwB,kBAAkB;","names":[]}
@@ -1,571 +0,0 @@
1
- // packages/blocks/src/components/changelog.ts
2
- import { css, html, nothing, svg } from "lit";
3
- import {
4
- say,
5
- ImpaktElement,
6
- focusRing,
7
- visuallyHidden,
8
- fontSize,
9
- fontWeight,
10
- space,
11
- spaceAround,
12
- t,
13
- token,
14
- type,
15
- iconSvg,
16
- toneOf,
17
- TONE
18
- } from "@atomic-ui/ui";
19
- function revealOnView(el, onShow) {
20
- const show = () => {
21
- el.setAttribute("shown", "");
22
- onShow?.();
23
- };
24
- if (typeof IntersectionObserver !== "function") {
25
- show();
26
- return () => void 0;
27
- }
28
- const io = new IntersectionObserver(
29
- (entries) => {
30
- if (entries.some((e) => e.isIntersecting)) {
31
- show();
32
- io.disconnect();
33
- }
34
- },
35
- { threshold: 0.25 }
36
- );
37
- io.observe(el);
38
- return () => io.disconnect();
39
- }
40
- var reduced = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
41
- var mono = css`.mono { font-family: ${t.fontMono}; font-size: ${fontSize("xs")}; letter-spacing: 0.04em; }`;
42
- var heading = (level, text, cls) => {
43
- const l = Math.min(Math.max(level || 3, 2), 6);
44
- switch (l) {
45
- case 2:
46
- return html`<h2 class=${cls}>${text}</h2>`;
47
- case 4:
48
- return html`<h4 class=${cls}>${text}</h4>`;
49
- case 5:
50
- return html`<h5 class=${cls}>${text}</h5>`;
51
- case 6:
52
- return html`<h6 class=${cls}>${text}</h6>`;
53
- default:
54
- return html`<h3 class=${cls}>${text}</h3>`;
55
- }
56
- };
57
- var words = css`
58
- .h { margin: 0; color: var(--impakt-heading, ${t.textHeading}); font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; letter-spacing: ${t.trackingTight}; text-wrap: balance; }
59
- .body { margin: 0; color: inherit; opacity: 0.8; text-wrap: pretty; }
60
- .meta { margin: 0; color: inherit; opacity: 0.72; text-transform: uppercase; }
61
- .sr-only { ${visuallyHidden} }
62
- `;
63
- var ImpaktReleaseCard = class extends ImpaktElement {
64
- constructor() {
65
- super();
66
- this.raf = 0;
67
- this.label = "";
68
- this.heading = "";
69
- this.text = "";
70
- this.beforeSrc = "";
71
- this.beforeAlt = "";
72
- this.afterSrc = "";
73
- this.afterAlt = "";
74
- this.items = [];
75
- this.href = "";
76
- this.headingLevel = 3;
77
- this.spaceAbove = "none";
78
- this.spaceBelow = "none";
79
- }
80
- static {
81
- this.properties = {
82
- label: { type: String },
83
- heading: { type: String },
84
- text: { type: String },
85
- beforeSrc: { type: String, attribute: "before-src" },
86
- beforeAlt: { type: String, attribute: "before-alt" },
87
- afterSrc: { type: String, attribute: "after-src" },
88
- afterAlt: { type: String, attribute: "after-alt" },
89
- items: { type: Array },
90
- href: { type: String },
91
- headingLevel: { type: Number, attribute: "heading-level" },
92
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
93
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
94
- };
95
- }
96
- static {
97
- this.styles = [
98
- ...ImpaktElement.styles,
99
- spaceAround,
100
- mono,
101
- words,
102
- css`
103
- :host { display: block; }
104
- article { display: flex; flex-direction: column; gap: ${space(3)}; }
105
- .media { border-radius: ${t.radiusXl}; overflow: clip; background: ${t.surfaceInset}; }
106
- .media img { display: block; inline-size: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
107
- impakt-before-after { display: block; }
108
- .h { font-size: ${fontSize("3xl")}; }
109
- .h a { color: inherit; text-decoration: none; }
110
- .h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
111
- .h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }
112
- ul { list-style: none; margin: ${space(1)} 0 0; padding: 0; display: grid; gap: ${space(1)}; }
113
- li { display: grid; grid-template-columns: 1.25em minmax(0, 1fr); gap: ${space(2)}; padding: ${space(1)} ${space(3)}; border-radius: ${t.radius}; }
114
- li[data-change='added'] { background: ${t.successSubtle}; color: ${t.successText}; }
115
- li[data-change='removed'] { background: ${t.dangerSubtle}; color: ${t.dangerText}; }
116
- li[data-change='same'] { color: ${t.textMuted}; }
117
- .sign { font-weight: ${fontWeight("bold")}; }
118
- `
119
- ];
120
- }
121
- /** Sweep the seam, as Commit's release wipe does: off the screenshot on hover, back on leaving. */
122
- wipe(to) {
123
- const ba = this.renderRoot.querySelector("impakt-before-after");
124
- if (!ba) return;
125
- cancelAnimationFrame(this.raf);
126
- if (reduced()) {
127
- ba.position = to;
128
- return;
129
- }
130
- const from = ba.position ?? SEAM;
131
- const start = performance.now();
132
- const ease = (k) => k < 0.5 ? 4 * k * k * k : 1 - Math.pow(-2 * k + 2, 3) / 2;
133
- const step = (now) => {
134
- const k = Math.min(1, (now - start) / 450);
135
- ba.position = from + (to - from) * ease(k);
136
- if (k < 1) this.raf = requestAnimationFrame(step);
137
- };
138
- this.raf = requestAnimationFrame(step);
139
- }
140
- disconnectedCallback() {
141
- super.disconnectedCallback();
142
- cancelAnimationFrame(this.raf);
143
- }
144
- render() {
145
- const both = this.beforeSrc && this.afterSrc;
146
- const title = this.href ? html`<a href=${this.href}>${this.heading}</a>` : this.heading;
147
- const SIGN = { added: "+", removed: "\u2212", same: " " };
148
- const SAID = { added: say("Added"), removed: say("Removed"), same: say("Kept") };
149
- return html`<article part="card">
150
- ${both ? html`<div class="media" @pointerenter=${(e) => e.pointerType === "mouse" && this.wipe(0)} @pointerleave=${(e) => e.pointerType === "mouse" && this.wipe(SEAM)}><impakt-before-after .position=${SEAM} .beforeSrc=${this.beforeSrc} .beforeAlt=${this.beforeAlt} .afterSrc=${this.afterSrc} .afterAlt=${this.afterAlt} .beforeLabel=${say("Before")} .afterLabel=${say("Shipped")} .label=${say("Compare {name} before and after", { name: this.heading })}></impakt-before-after></div>` : this.afterSrc || this.beforeSrc ? html`<div class="media"><img src=${this.afterSrc || this.beforeSrc} alt=${this.afterSrc ? this.afterAlt : this.beforeAlt} loading="lazy" /></div>` : nothing}
151
- ${this.label ? html`<p class="meta mono">${this.label}</p>` : nothing}
152
- ${this.heading ? headingWith(this.headingLevel, title) : nothing}
153
- ${this.text ? html`<p class="body">${this.text}</p>` : nothing}
154
- ${(this.items ?? []).length ? html`<ul class="mono" part="diff">${this.items.map((line) => html`<li data-change=${line.change}><span class="sign" aria-hidden="true">${SIGN[line.change] ?? " "}</span><span><span class="sr-only">${SAID[line.change] ?? ""}: </span>${line.text}</span></li>`)}</ul>` : nothing}
155
- </article>`;
156
- }
157
- };
158
- var ImpaktReleaseList = class extends ImpaktElement {
159
- static {
160
- this.properties = {
161
- items: { type: Array },
162
- columns: { type: String, reflect: true },
163
- headingLevel: { type: Number, attribute: "heading-level" },
164
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
165
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
166
- };
167
- }
168
- constructor() {
169
- super();
170
- this.items = [];
171
- this.columns = "two";
172
- this.headingLevel = 3;
173
- this.spaceAbove = "none";
174
- this.spaceBelow = "none";
175
- }
176
- static {
177
- this.styles = [
178
- ...ImpaktElement.styles,
179
- spaceAround,
180
- css`
181
- :host { display: block; container-type: inline-size; }
182
- ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(12)} ${space(10)}; }
183
- :host([columns='one']) ul { grid-template-columns: minmax(0, 1fr); }
184
- :host([columns='three']) ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
185
- @container (max-width: 44rem) { ul, :host([columns='three']) ul { grid-template-columns: minmax(0, 1fr); } }
186
- `
187
- ];
188
- }
189
- render() {
190
- const here = typeof location === "undefined" ? "" : location.pathname.replace(/\/$/, "");
191
- const shown = (this.items ?? []).filter((item) => !item.href || item.href.replace(/\/$/, "") !== here);
192
- return html`<ul part="list">${shown.map((item) => {
193
- const heading2 = item.heading ?? item.title ?? "";
194
- return html`<li><impakt-release-card
195
- .label=${item.label ?? ""} .heading=${heading2} .text=${item.text ?? ""} .href=${item.href ?? ""}
196
- .beforeSrc=${item.beforeSrc ?? ""} .beforeAlt=${item.beforeAlt || say("{name} as a wireframe", { name: heading2 })}
197
- .afterSrc=${item.afterSrc ?? ""} .afterAlt=${item.afterAlt || say("{name} as it shipped", { name: heading2 })}
198
- .items=${item.items ?? []} .headingLevel=${this.headingLevel}></impakt-release-card></li>`;
199
- })}</ul>`;
200
- }
201
- };
202
- var SEAM = 42;
203
- function headingWith(level, content) {
204
- const l = Math.min(Math.max(level || 3, 2), 6);
205
- if (l === 2) return html`<h2 class="h">${content}</h2>`;
206
- if (l === 4) return html`<h4 class="h">${content}</h4>`;
207
- if (l === 5) return html`<h5 class="h">${content}</h5>`;
208
- if (l === 6) return html`<h6 class="h">${content}</h6>`;
209
- return html`<h3 class="h">${content}</h3>`;
210
- }
211
- var ImpaktBranchList = class extends ImpaktElement {
212
- constructor() {
213
- super();
214
- this.unwatch = () => void 0;
215
- this.items = [];
216
- this.trunk = "";
217
- this.look = "tones";
218
- this.current = -1;
219
- this.currentText = "";
220
- this.headingLevel = 3;
221
- this.spaceAbove = "none";
222
- this.spaceBelow = "none";
223
- }
224
- static {
225
- this.properties = {
226
- items: { type: Array },
227
- trunk: { type: String },
228
- look: { type: String, reflect: true },
229
- current: { type: Number },
230
- currentText: { type: String, attribute: "current-text" },
231
- headingLevel: { type: Number, attribute: "heading-level" },
232
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
233
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
234
- };
235
- }
236
- static {
237
- this.styles = [
238
- ...ImpaktElement.styles,
239
- spaceAround,
240
- mono,
241
- words,
242
- css`
243
- :host { display: block; container-type: inline-size; --trunk: color-mix(in srgb, currentColor 70%, transparent); }
244
- ul { list-style: none; margin: 0; padding: 0; position: relative; }
245
- ul::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 11px; inline-size: 3px; border-radius: 3px; background: var(--trunk); }
246
- li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); padding-block: ${space(6)}; }
247
- .graph { position: relative; }
248
- .graph svg { position: absolute; inset-block-start: -${space(6)}; inset-inline-start: 0; inline-size: 96px; block-size: calc(100% + ${space(12)}); overflow: visible; }
249
- .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: ${space(4)} ${space(10)}; align-items: start; }
250
- .path { margin: 0 0 ${space(2)}; opacity: 0.72; }
251
- .h { font-size: ${fontSize("3xl")}; line-height: 1.05; }
252
- .h a { color: inherit; text-decoration: none; }
253
- .h a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
254
- .h a:focus-visible { outline: none; box-shadow: ${t.focusShadow}; border-radius: ${t.radiusSm}; }
255
- .detail { display: flex; flex-direction: column; gap: ${space(3)}; padding-block-start: ${space(1)}; }
256
- .tags { margin: 0; opacity: 0.7; text-transform: uppercase; }
257
- .end { position: relative; display: flex; align-items: center; gap: ${space(3)}; padding-block-start: ${space(4)}; }
258
- .end::before { content: ''; inline-size: 16px; block-size: 16px; margin-inline-start: 5px; border-radius: 50%; background: currentColor; }
259
- @container (max-width: 44rem) {
260
- li { grid-template-columns: 56px minmax(0, 1fr); }
261
- .graph svg { inline-size: 56px; }
262
- .row { grid-template-columns: minmax(0, 1fr); }
263
- .h { font-size: ${fontSize("2xl")}; }
264
- }
265
- /*
266
- * The mono look, as the Branches component (12:683) draws it: rows 120px apart, a 1.5px trunk at 10px, and
267
- * each branch a fixed S-curve out to 60px by 28px down, straight to 78 and back by 110, so its shape does not
268
- * change with the row's height. The path and heading sit on the left and the line and tags in a 490px column
269
- * on the right, level with the path; a hairline closes each row 114px down. On a phone (14:989) the trunk is
270
- * at 8px, the branch reaches 40px and the words stack in one column.
271
- */
272
- :host([look='mono']) { --trunk: currentColor; }
273
- :host([look='mono']) ul::before { inset-inline-start: 10px; inline-size: 1.5px; border-radius: 0; }
274
- :host([look='mono']) li { grid-template-columns: 86px minmax(0, 1fr); padding-block: 24px 5px; }
275
- :host([look='mono']) .graph svg { inset-block-start: -24px; inline-size: 96px; block-size: 110px; }
276
- :host([look='mono']) .graph svg path { stroke-width: 1.5; }
277
- :host([look='mono']) .ring { position: absolute; inset-inline-start: 55px; inset-block-start: 20px; inline-size: 10px; block-size: 10px; box-sizing: border-box; border-radius: 50%; border: 1px solid currentColor; background: ${t.surfaceCard}; }
278
- :host([look='mono']) .ring.current { background: ${token("color.accent.default", "#ffd43b")}; }
279
- :host([look='mono']) .text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 490px); grid-template-areas: 'path detail' 'h detail'; grid-template-rows: auto 1fr; column-gap: ${space(10)}; align-content: start; padding-block-end: 20px; border-block-end: ${t.borderThin} solid ${t.rule}; }
280
- :host([look='mono']) .row { display: contents; }
281
- :host([look='mono']) .path { grid-area: path; margin: 0 0 4.6px; font-size: 0.6875rem; line-height: 1.4; letter-spacing: ${t.trackingWide}; text-transform: uppercase; opacity: 1; color: ${t.textMuted}; }
282
- :host([look='mono']) .h { grid-area: h; margin: 0; font-size: 2rem; line-height: 1.1; font-weight: ${fontWeight("semibold")}; letter-spacing: -0.03em; }
283
- :host([look='mono']) .detail { grid-area: detail; gap: 8px; padding: 0; }
284
- :host([look='mono']) .body { margin: 0; font-size: 1rem; line-height: 1.45; color: ${t.textMuted}; opacity: 1; }
285
- :host([look='mono']) .tags { font-size: 0.6875rem; line-height: 1.4; letter-spacing: ${t.trackingWide}; opacity: 1; color: ${t.textMuted}; }
286
- :host([look='mono']) .end { gap: 0; margin: 0; padding-block-start: 8px; font-size: 0.6875rem; line-height: 1.4; letter-spacing: ${t.trackingWide}; text-transform: uppercase; color: ${t.textMuted}; }
287
- /* The trunk runs on, unbroken, into its end dot, which sits on the trunk; the words line up with the rows' words. */
288
- :host([look='mono']) .end::before { flex: none; inline-size: 10px; block-size: 10px; margin-inline: 5.75px calc(86px - 15.75px); background: ${t.text}; }
289
- :host([look='mono']) .end::after { content: ''; position: absolute; inset-block-start: 0; inset-inline-start: 10px; inline-size: 1.5px; block-size: 15.7px; background: var(--trunk); }
290
- :host([look='mono']) li:last-child .graph svg { block-size: 110px; }
291
- @container (max-width: 44rem) {
292
- /* Set on the list, since a container query cannot restyle the container itself. */
293
- :host([look='mono']) ul::before { inset-inline-start: 8px; }
294
- :host([look='mono']) li { grid-template-columns: 60px minmax(0, 1fr); padding-block: 18px 5px; }
295
- :host([look='mono']) .graph svg { inset-block-start: -18px; inline-size: 60px; block-size: 132px; }
296
- :host([look='mono']) .ring { inset-inline-start: 35px; inset-block-start: 38px; }
297
- :host([look='mono']) .text { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'path' 'h' 'detail'; padding-block-end: 12px; }
298
- :host([look='mono']) .h { font-size: 1.5rem; line-height: 1.15; }
299
- :host([look='mono']) .detail { margin-block-start: 6px; }
300
- :host([look='mono']) .body { font-size: 0.875rem; line-height: 1.43; }
301
- :host([look='mono']) .tags { display: none; }
302
- :host([look='mono']) .end::before { margin-inline: 3.75px calc(60px - 13.75px); }
303
- :host([look='mono']) .end::after { inset-inline-start: 8px; }
304
- }
305
- :host([look='mono']) .graph .narrow { display: none; }
306
- @container (max-width: 44rem) { :host([look='mono']) .graph .wide { display: none; } :host([look='mono']) .graph .narrow { display: inline; } }
307
- @media (forced-colors: active) { :host([look='mono']) .ring.current { background: Highlight; } }
308
- /* Branch draw: each branch opens down from the trunk, 120 ms after the one above, then its dot pops. */
309
- @media (prefers-reduced-motion: no-preference) {
310
- .graph svg { clip-path: inset(0 0 100% 0); transition: clip-path 700ms cubic-bezier(.25, 1, .5, 1) calc(var(--i, 0) * 120ms); }
311
- .graph circle, .ring { transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 200ms ease-out calc(var(--i, 0) * 120ms + 500ms); }
312
- :host([shown]) .graph svg { clip-path: inset(0); }
313
- :host([shown]) .graph circle, :host([shown]) .ring { transform: scale(1); }
314
- }
315
- `
316
- ];
317
- }
318
- connectedCallback() {
319
- super.connectedCallback();
320
- this.unwatch = revealOnView(this);
321
- }
322
- disconnectedCallback() {
323
- super.disconnectedCallback();
324
- this.unwatch();
325
- }
326
- render() {
327
- const mono2 = this.look === "mono";
328
- const branch = (colour) => mono2 ? svg`<svg aria-hidden="true" focusable="false">
329
- <path class="wide" d="M10.75 0C10.75 16 60.75 6 60.75 28V78C60.75 100 10.75 92 10.75 110" fill="none" stroke=${colour} />
330
- <path class="narrow" d="M8.75 0C8.75 16 40.75 6 40.75 28V104C40.75 126 8.75 118 8.75 132" fill="none" stroke=${colour} />
331
- </svg>` : svg`<svg viewBox="0 0 96 200" preserveAspectRatio="none" aria-hidden="true" focusable="false">
332
- <path d="M12 0 C12 40 60 30 60 70 L60 120 C60 160 12 160 12 200" fill="none" stroke=${colour} stroke-width="3" vector-effect="non-scaling-stroke" />
333
- <circle cx="60" cy="86" r="8" fill=${colour} />
334
- </svg>`;
335
- return html`<ul part="list">${(this.items ?? []).map((item, i) => {
336
- const current = i === this.current;
337
- const words2 = html`${item.heading}${current && this.currentText ? html`<span class="sr-only"> (${this.currentText})</span>` : nothing}`;
338
- return html`<li part="item" style=${`--i:${i}`}>
339
- <div class="graph">${branch(mono2 ? "currentColor" : toneOf(item.tone, i))}${mono2 ? html`<span class=${current ? "ring current" : "ring"} aria-hidden="true"></span>` : nothing}</div>
340
- <div class="text">
341
- ${item.path ? html`<p class="path mono">${item.path}</p>` : nothing}
342
- <div class="row">
343
- ${heading(this.headingLevel, item.href ? html`<a href=${item.href}>${words2}</a>` : words2, "h")}
344
- <div class="detail">
345
- ${item.text ? html`<p class="body">${item.text}</p>` : nothing}
346
- ${item.tags?.length ? html`<p class="tags mono">${item.tags.join(" \xB7 ")}</p>` : nothing}
347
- </div>
348
- </div>
349
- </div>
350
- </li>`;
351
- })}</ul>
352
- ${this.trunk ? html`<p class="end mono" part="trunk">${this.trunk}</p>` : nothing}`;
353
- }
354
- };
355
- var ImpaktCheckList = class extends ImpaktElement {
356
- constructor() {
357
- super();
358
- this.unwatch = () => void 0;
359
- /** How far each figure has counted up, from 0 to 1, while the checks run. */
360
- this.counted = null;
361
- this.items = [];
362
- this.summary = "";
363
- this.spaceAbove = "none";
364
- this.spaceBelow = "none";
365
- }
366
- static {
367
- this.properties = {
368
- items: { type: Array },
369
- summary: { type: String },
370
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
371
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
372
- };
373
- }
374
- static {
375
- this.styles = [
376
- ...ImpaktElement.styles,
377
- spaceAround,
378
- mono,
379
- words,
380
- css`
381
- :host { display: block; container-type: inline-size; }
382
- .summary { display: inline-flex; align-items: center; gap: ${space(2)}; margin: 0 0 ${space(6)}; padding: ${space(1)} ${space(3)}; border-radius: ${t.radiusXl}; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
383
- .summary::before { content: ''; inline-size: 8px; block-size: 8px; border-radius: 50%; background: ${t.success}; }
384
- /* The rows share one grid, so the figure column fits the widest figure and every row lines up. */
385
- ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 32px max-content minmax(0, 1fr) auto; column-gap: ${space(6)}; }
386
- li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; padding-block: ${space(5)}; border-block-end: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
387
- /* Checks run: each tick pops in, 150 ms after the one above. */
388
- @media (prefers-reduced-motion: no-preference) {
389
- .tick { transform: scale(0); transition: transform 600ms cubic-bezier(.34, 1.56, .64, 1) calc(var(--i, 0) * 150ms); }
390
- :host([shown]) .tick { transform: scale(1); }
391
- }
392
- .sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
393
- /* A passed check is a filled disc with a tick cut out of it, as a CI run shows one. */
394
- .tick { display: inline-flex; align-items: center; justify-content: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: ${t.success}; color: var(--impakt-color-status-success-on, #fff); }
395
- .figure { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight("bold")}; font-size: ${fontSize("5xl")}; line-height: 1; letter-spacing: ${t.trackingTight}; white-space: nowrap; }
396
- .label { margin: 0; ${type("xl")} }
397
- .status { margin: 0; opacity: 0.72; }
398
- @container (max-width: 40rem) {
399
- ul { grid-template-columns: 28px minmax(0, 1fr); }
400
- li { row-gap: ${space(1)}; }
401
- .label, .status { grid-column: 2; }
402
- .figure { font-size: ${fontSize("4xl")}; }
403
- }
404
- `
405
- ];
406
- }
407
- connectedCallback() {
408
- super.connectedCallback();
409
- this.unwatch = revealOnView(this, () => this.run());
410
- }
411
- disconnectedCallback() {
412
- super.disconnectedCallback();
413
- this.unwatch();
414
- }
415
- /** Checks run: each figure counts up over 1200 ms, 150 ms after the one above. */
416
- run() {
417
- if (reduced()) return;
418
- const items = this.items ?? [];
419
- const start = performance.now();
420
- const step = (now) => {
421
- this.counted = items.map((_, i) => Math.min(1, Math.max(0, (now - start - i * 150) / 1200)));
422
- this.requestUpdate();
423
- if (this.counted.some((k) => k < 1)) requestAnimationFrame(step);
424
- else this.counted = null;
425
- };
426
- requestAnimationFrame(step);
427
- }
428
- render() {
429
- const shownFigure = (figure, i) => {
430
- const k = this.counted?.[i];
431
- const m = /^(\d+)(.*)$/.exec(figure);
432
- if (k === void 0 || k >= 1 || !m) return html`${figure}`;
433
- const eased = 1 - Math.pow(1 - k, 3);
434
- return html`<span aria-hidden="true">${Math.round(Number(m[1]) * eased)}${m[2]}</span><span class="sr-only">${figure}</span>`;
435
- };
436
- return html`${this.summary ? html`<p class="summary mono" part="summary">${this.summary}</p>` : nothing}
437
- <ul part="list">${(this.items ?? []).map(
438
- (item, i) => html`<li part="item" style=${`--i:${i}`}>
439
- <span class="tick" aria-hidden="true">${iconSvg("check", "16px")}</span>
440
- <p class="figure">${shownFigure(item.figure, i)}</p>
441
- <p class="label">${item.label}</p>
442
- ${item.status ? html`<p class="status mono">${item.status}</p>` : html`<span></span>`}
443
- </li>`
444
- )}</ul>`;
445
- }
446
- };
447
- var ImpaktBranchTimeline = class extends ImpaktElement {
448
- constructor() {
449
- super();
450
- this.unwatch = () => void 0;
451
- this.lanes = [];
452
- this.marks = [];
453
- this.span = 20;
454
- this.unit = "";
455
- this.every = 2;
456
- this.release = "";
457
- this.releaseAt = 0;
458
- this.label = "";
459
- this.spaceAbove = "none";
460
- this.spaceBelow = "none";
461
- }
462
- static {
463
- this.properties = {
464
- lanes: { type: Array },
465
- marks: { type: Array },
466
- span: { type: Number },
467
- unit: { type: String },
468
- every: { type: Number },
469
- release: { type: String },
470
- releaseAt: { type: Number, attribute: "release-at" },
471
- label: { type: String },
472
- spaceAbove: { type: String, reflect: true, attribute: "space-above" },
473
- spaceBelow: { type: String, reflect: true, attribute: "space-below" }
474
- };
475
- }
476
- static {
477
- this.styles = [
478
- ...ImpaktElement.styles,
479
- focusRing,
480
- spaceAround,
481
- mono,
482
- words,
483
- css`
484
- :host { display: block; }
485
- /* On a narrow screen the graph scrolls sideways, so the scroller takes focus and the arrow keys move it (2.1.1). */
486
- figure { margin: 0; overflow-x: auto; border-radius: ${t.radiusSm}; }
487
- svg { display: block; inline-size: 100%; min-inline-size: 640px; block-size: auto; overflow: visible; }
488
- text { font-family: ${t.fontMono}; font-size: 12px; fill: currentColor; }
489
- .faint { opacity: 0.5; }
490
- /* A lane's label keeps a band of the page colour around it, so a line crossing it stays legible. */
491
- .halo { paint-order: stroke; stroke: var(--impakt-color-surface-card, #fff); stroke-width: 5px; stroke-linejoin: round; }
492
- /* Graph draw: the graph opens left to right, so each demo appears as the line reaches it. */
493
- @media (prefers-reduced-motion: no-preference) {
494
- svg { clip-path: inset(0 100% 0 0); transition: clip-path 1400ms cubic-bezier(.25, 1, .5, 1); }
495
- :host([shown]) svg { clip-path: inset(0 -40px 0 0); }
496
- }
497
- `
498
- ];
499
- }
500
- connectedCallback() {
501
- super.connectedCallback();
502
- this.unwatch = revealOnView(this);
503
- }
504
- disconnectedCallback() {
505
- super.disconnectedCallback();
506
- this.unwatch();
507
- }
508
- render() {
509
- const W = 1200;
510
- const left = 24;
511
- const right = W - 60;
512
- const span = this.span > 0 ? this.span : 20;
513
- const x = (v) => left + Math.min(Math.max(v, 0), span) / span * (right - left);
514
- const lanes = this.lanes ?? [];
515
- const rowH = 52;
516
- const H = 40 + (lanes.length + 1) * rowH + 40;
517
- const mainY = 40;
518
- const laneY = (i) => mainY + (i + 1) * rowH;
519
- const ticks = [];
520
- for (let v = 0; v <= span; v += Math.max(1, this.every || 2)) ticks.push(v);
521
- const laneOf = (at) => lanes.findIndex((l) => at >= l.from && at <= l.to);
522
- const marked = (i) => (this.marks ?? []).some((m) => laneOf(m.at) === i);
523
- const unit = this.unit || say("wk");
524
- const label = this.label || say("Project timeline");
525
- const described = lanes.map((l) => `${l.label}: ${say("{unit} {from} to {to}", { unit, from: l.from, to: l.to })}`).join("; ");
526
- return html`<figure part="figure" tabindex="0">
527
- <svg viewBox="0 0 ${W} ${H}" role="img" aria-label=${`${label}. ${described}${this.release ? `. ${say("{name} at {unit} {at}", { name: this.release, unit, at: this.releaseAt })}` : ""}`}>
528
- <line x1=${left} y1=${mainY} x2=${right + 40} y2=${mainY} stroke="currentColor" stroke-width="3" stroke-linecap="round" />
529
- <path d="M${right + 28} ${mainY - 7} L${right + 40} ${mainY} L${right + 28} ${mainY + 7}" fill="none" stroke="currentColor" stroke-width="3" />
530
- ${lanes.map((l, i) => {
531
- const c = toneOf(l.tone, i);
532
- const y = laneY(i);
533
- const a = x(l.from);
534
- const b = x(l.to);
535
- const bend = Math.min(36, (b - a) / 3);
536
- return svg`<g>
537
- <path d="M${a} ${mainY} C${a} ${(mainY + y) / 2} ${a + bend} ${y} ${a + bend * 1.6} ${y} L${b - bend * 1.6} ${y} C${b - bend} ${y} ${b} ${(mainY + y) / 2} ${b} ${mainY}" fill="none" stroke=${c} stroke-width="3" />
538
- <circle cx=${a} cy=${mainY} r="7" fill=${c} />
539
- <text x=${a + bend * 1.6} y=${marked(i) ? y - 10 : y + 20} class="halo" style=${`fill:${c}`}>${l.label}</text>
540
- </g>`;
541
- })}
542
- ${(this.marks ?? []).map((m) => {
543
- const i = laneOf(m.at);
544
- const y = i >= 0 ? laneY(i) : mainY;
545
- const c = i >= 0 ? toneOf(lanes[i].tone, i) : "currentColor";
546
- return svg`<g><circle cx=${x(m.at)} cy=${y} r="6" fill="var(--impakt-color-surface-card, #fff)" stroke=${c} stroke-width="3" /><text x=${x(m.at)} y=${y + 22} text-anchor="middle" class="faint">${m.label}</text></g>`;
547
- })}
548
- ${this.release ? svg`<g>
549
- <circle cx=${x(this.releaseAt)} cy=${mainY} r="10" fill=${TONE.success} />
550
- <rect x=${x(this.releaseAt) - 8} y=${mainY - 36} rx="4" width=${this.release.length * 7.6 + 16} height="22" fill=${TONE.success} />
551
- <text x=${x(this.releaseAt)} y=${mainY - 21} style="fill:var(--impakt-color-surface-card, #fff)">${this.release}</text>
552
- </g>` : nothing}
553
- ${ticks.map((v) => svg`<text x=${x(v)} y=${H - 10} text-anchor="middle" class="faint">${unit} ${v}</text>`)}
554
- </svg>
555
- </figure>`;
556
- }
557
- };
558
- customElements.define("impakt-release-card", ImpaktReleaseCard);
559
- customElements.define("impakt-release-list", ImpaktReleaseList);
560
- customElements.define("impakt-branch-list", ImpaktBranchList);
561
- customElements.define("impakt-check-list", ImpaktCheckList);
562
- customElements.define("impakt-branch-timeline", ImpaktBranchTimeline);
563
-
564
- export {
565
- ImpaktReleaseCard,
566
- ImpaktReleaseList,
567
- ImpaktBranchList,
568
- ImpaktCheckList,
569
- ImpaktBranchTimeline
570
- };
571
- //# sourceMappingURL=chunk-IT2NA25D.js.map