@repobit/dex-system-design 3.0.3 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +35 -0
  3. package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +1 -0
  4. package/dist/src/components/agent-endpoints/agent-endpoints.js +12 -12
  5. package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
  6. package/dist/src/components/anchor/anchor-nav.d.ts +2 -1
  7. package/dist/src/components/anchor/anchor-nav.js +10 -10
  8. package/dist/src/components/anchor/anchor-nav.js.map +1 -1
  9. package/dist/src/components/audience-card/audience-card.css.js +1 -1
  10. package/dist/src/components/audience-card/audience-card.css.js.map +1 -1
  11. package/dist/src/components/audience-card/audience-card.d.ts +1 -0
  12. package/dist/src/components/audience-card/audience-card.js +8 -8
  13. package/dist/src/components/audience-card/audience-card.js.map +1 -1
  14. package/dist/src/components/awards/awards-flex.d.ts +3 -2
  15. package/dist/src/components/awards/awards-flex.js +16 -16
  16. package/dist/src/components/awards/awards-flex.js.map +1 -1
  17. package/dist/src/components/awards/awards-spotlight.d.ts +2 -1
  18. package/dist/src/components/awards/awards-spotlight.js +8 -8
  19. package/dist/src/components/awards/awards-spotlight.js.map +1 -1
  20. package/dist/src/components/awards/awards.d.ts +1 -1
  21. package/dist/src/components/bento-grid/bento-grid.d.ts +1 -0
  22. package/dist/src/components/bento-grid/bento-grid.js +10 -10
  23. package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
  24. package/dist/src/components/bento-grid/bento-item.css.js +1 -1
  25. package/dist/src/components/bento-grid/bento-item.css.js.map +1 -1
  26. package/dist/src/components/bento-grid/bento-item.d.ts +1 -0
  27. package/dist/src/components/bento-grid/bento-item.js +9 -9
  28. package/dist/src/components/bento-grid/bento-item.js.map +1 -1
  29. package/dist/src/components/button/button.d.ts +1 -1
  30. package/dist/src/components/cards/card.d.ts +2 -2
  31. package/dist/src/components/cards/card.js +11 -11
  32. package/dist/src/components/cards/card.js.map +1 -1
  33. package/dist/src/components/carousel/carousel.d.ts +2 -2
  34. package/dist/src/components/carousel/carousel.js +6 -6
  35. package/dist/src/components/carousel/carousel.js.map +1 -1
  36. package/dist/src/components/comparison-panel/comparison-panel.d.ts +1 -0
  37. package/dist/src/components/comparison-panel/comparison-panel.js +12 -12
  38. package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
  39. package/dist/src/components/compatibility-table/compatibility-table.d.ts +1 -0
  40. package/dist/src/components/compatibility-table/compatibility-table.js +14 -14
  41. package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
  42. package/dist/src/components/cta-banner/cta-banner.d.ts +1 -0
  43. package/dist/src/components/cta-banner/cta-banner.js +8 -8
  44. package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
  45. package/dist/src/components/grid/grid.css.js +1 -1
  46. package/dist/src/components/grid/grid.css.js.map +1 -1
  47. package/dist/src/components/grid/grid.d.ts +1 -0
  48. package/dist/src/components/grid/grid.js +4 -3
  49. package/dist/src/components/grid/grid.js.map +1 -1
  50. package/dist/src/components/header/header-code.d.ts +3 -2
  51. package/dist/src/components/header/header-code.js +13 -13
  52. package/dist/src/components/header/header-code.js.map +1 -1
  53. package/dist/src/components/heading/heading.d.ts +1 -1
  54. package/dist/src/components/heading/heading.js +5 -1
  55. package/dist/src/components/heading/heading.js.map +1 -1
  56. package/dist/src/components/hero/hero.d.ts +2 -1
  57. package/dist/src/components/hero/hero.js +9 -9
  58. package/dist/src/components/hero/hero.js.map +1 -1
  59. package/dist/src/components/install-options/install-options.d.ts +3 -2
  60. package/dist/src/components/install-options/install-options.js +17 -17
  61. package/dist/src/components/install-options/install-options.js.map +1 -1
  62. package/dist/src/components/link/link.d.ts +1 -1
  63. package/dist/src/components/list/list-item/list-item.d.ts +1 -1
  64. package/dist/src/components/logo-marquee/logo-marquee.d.ts +1 -0
  65. package/dist/src/components/logo-marquee/logo-marquee.js +5 -5
  66. package/dist/src/components/logo-marquee/logo-marquee.js.map +1 -1
  67. package/dist/src/components/motion-art/motion-art.js +1 -1
  68. package/dist/src/components/motion-art/motion-art.js.map +1 -1
  69. package/dist/src/components/overview/overview.d.ts +1 -0
  70. package/dist/src/components/overview/overview.js +7 -7
  71. package/dist/src/components/overview/overview.js.map +1 -1
  72. package/dist/src/components/page-switcher/page-switcher.d.ts +1 -0
  73. package/dist/src/components/page-switcher/page-switcher.js +5 -5
  74. package/dist/src/components/page-switcher/page-switcher.js.map +1 -1
  75. package/dist/src/components/pagination-dots/pagination-dots.d.ts +1 -1
  76. package/dist/src/components/partner-banner/partner-banner.d.ts +1 -0
  77. package/dist/src/components/partner-banner/partner-banner.js +7 -7
  78. package/dist/src/components/partner-banner/partner-banner.js.map +1 -1
  79. package/dist/src/components/post-card/post-card.d.ts +1 -0
  80. package/dist/src/components/post-card/post-card.js +5 -5
  81. package/dist/src/components/post-card/post-card.js.map +1 -1
  82. package/dist/src/components/process-steps/process-steps.d.ts +1 -0
  83. package/dist/src/components/process-steps/process-steps.js +7 -7
  84. package/dist/src/components/process-steps/process-steps.js.map +1 -1
  85. package/dist/src/components/quick-answer/quick-answer.d.ts +1 -0
  86. package/dist/src/components/quick-answer/quick-answer.js +7 -7
  87. package/dist/src/components/quick-answer/quick-answer.js.map +1 -1
  88. package/dist/src/components/review/review-grid.d.ts +1 -0
  89. package/dist/src/components/review/review-grid.js +3 -3
  90. package/dist/src/components/review/review-grid.js.map +1 -1
  91. package/dist/src/components/review/review.d.ts +1 -0
  92. package/dist/src/components/review/review.js +2 -2
  93. package/dist/src/components/review/review.js.map +1 -1
  94. package/dist/src/components/section-header/section-header.d.ts +1 -0
  95. package/dist/src/components/section-header/section-header.js +4 -4
  96. package/dist/src/components/section-header/section-header.js.map +1 -1
  97. package/dist/src/components/shared/controller.observer.d.ts +50 -0
  98. package/dist/src/components/shared/controller.observer.js +2 -0
  99. package/dist/src/components/shared/controller.observer.js.map +1 -0
  100. package/dist/src/components/spotlight-section/spotlight-section.d.ts +1 -0
  101. package/dist/src/components/spotlight-section/spotlight-section.js +7 -7
  102. package/dist/src/components/spotlight-section/spotlight-section.js.map +1 -1
  103. package/dist/src/components/stat/stat-highlight.d.ts +5 -5
  104. package/dist/src/components/stat/stat-highlight.js +2 -2
  105. package/dist/src/components/stat/stat-highlight.js.map +1 -1
  106. package/dist/src/components/stat/stat-tile.d.ts +1 -0
  107. package/dist/src/components/stat/stat-tile.js +5 -5
  108. package/dist/src/components/stat/stat-tile.js.map +1 -1
  109. package/dist/src/components/terminal/terminal-cursor.d.ts +1 -0
  110. package/dist/src/components/terminal/terminal-cursor.js +1 -1
  111. package/dist/src/components/terminal/terminal-cursor.js.map +1 -1
  112. package/dist/src/components/terminal/terminal-message.d.ts +4 -3
  113. package/dist/src/components/terminal/terminal-message.js +25 -25
  114. package/dist/src/components/terminal/terminal-message.js.map +1 -1
  115. package/dist/src/components/tooltip/tooltip.js +1 -1
  116. package/dist/src/components/tooltip/tooltip.js.map +1 -1
  117. package/dist/src/components/trust-panel/trust-panel.d.ts +1 -0
  118. package/dist/src/components/trust-panel/trust-panel.js +19 -19
  119. package/dist/src/components/trust-panel/trust-panel.js.map +1 -1
  120. package/dist/src/loader/create-loader.d.ts +13 -0
  121. package/dist/src/loader/create-loader.js +2 -0
  122. package/dist/src/loader/create-loader.js.map +1 -0
  123. package/dist/src/loader/loader.d.ts +44 -0
  124. package/dist/src/loader/loader.js +2 -0
  125. package/dist/src/loader/loader.js.map +1 -0
  126. package/dist/src/loader/registry.d.ts +2 -0
  127. package/dist/src/loader/registry.js +2 -0
  128. package/dist/src/loader/registry.js.map +1 -0
  129. package/dist/src/tokens/tokens.js +1 -1
  130. package/dist/src/tokens/tokens.js.map +1 -1
  131. package/package.json +12 -4
  132. package/schemas/component-manifest.json +8 -1
  133. package/dist/src/tokens/dark-derivation.d.ts +0 -70
  134. package/dist/src/tokens/dark-derivation.js +0 -2
  135. package/dist/src/tokens/dark-derivation.js.map +0 -1
  136. package/dist/src/tokens/dark-findings.d.ts +0 -59
  137. package/dist/src/tokens/dark-findings.js +0 -2
  138. package/dist/src/tokens/dark-findings.js.map +0 -1
  139. package/dist/src/tokens/story-chrome.d.ts +0 -72
  140. package/dist/src/tokens/story-chrome.js +0 -292
  141. package/dist/src/tokens/story-chrome.js.map +0 -1
  142. package/dist/src/tokens/token-map.d.ts +0 -114
  143. package/dist/src/tokens/token-map.js +0 -2
  144. package/dist/src/tokens/token-map.js.map +0 -1
  145. package/dist/src/tokens/token-purposes.d.ts +0 -63
  146. package/dist/src/tokens/token-purposes.js +0 -2
  147. package/dist/src/tokens/token-purposes.js.map +0 -1
  148. package/dist/src/tokens/type-ceiling-words.d.ts +0 -96
  149. package/dist/src/tokens/type-ceiling-words.js +0 -2
  150. package/dist/src/tokens/type-ceiling-words.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"audience-card.js","names":["_decorate","__decorate","AudienceCard","LitElement","_args","tokens","audienceCardCSS","nothing","property","defineElement"],"sources":["../../../../src/components/audience-card/audience-card.ts"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { tokens } from \"#tokens/tokens.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/heading/heading.ts\";\nimport { audienceCardCSS } from \"./audience-card.css.ts\";\n\ntype HeadingTag = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\n/**\n * The homepage's audience entry: who it is for, a title, a line of\n * description, and a round arrow into that audience's page. Drawn in the\n * foundation Figma file as Audience card.\n *\n * One link, not three. The arrow is the link and carries the accessible name\n * (`label`, the eyebrow by default, e.g. \"For home\"), so the page reads one\n * link per card instead of a title, a paragraph and an arrow. Its hit area is\n * stretched across the card by an ::after on the link itself (see\n * audience-card.css.ts), so a click anywhere on the card is a click on the\n * link: middle-click and Ctrl/Cmd-click open it in a new tab and the link's\n * context menu is there, which the click handler that stood here could not\n * do -- it forwarded a plain click() whatever the reader had asked for.\n *\n * Between md and lg -- the tablet frame -- the card turns into a row, the copy\n * on the left and the arrow on the right; above and below it stacks.\n */\n@defineElement(\"bd-audience-card\")\nexport class AudienceCard extends LitElement {\n static styles = [tokens, audienceCardCSS];\n\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n heading = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: String })\n href = \"\";\n @property({ type: String })\n target = \"\";\n @property({ type: String })\n label = \"\";\n // three cards under the hero's h1\n @property({ type: String })\n as: HeadingTag = \"h2\";\n\n render() {\n return html`\n <article class=\"card\">\n <div class=\"copy\">\n ${this.eyebrow\n ? html`<p class=\"eyebrow\"><slot name=\"icon\"></slot><span class=\"text\">${this.eyebrow}</span></p>`\n : nothing}\n <bd-h as=\"${this.as}\" visual-level=\"h4\" class=\"heading\"><span class=\"text\">${this.heading}</span></bd-h>\n ${this.description ? html`<p class=\"description\">${this.description}</p>` : nothing}\n </div>\n ${this.href\n ? html`<bd-button-link\n class=\"arrow\"\n variant=\"accent\"\n size=\"md\"\n icon-only\n href=\"${this.href}\"\n target=\"${this.target || nothing}\"\n label=\"${this.label || this.eyebrow || this.heading}\"\n ></bd-button-link>`\n : nothing}\n </article>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-audience-card\": AudienceCard;\n }\n}\n"],"mappings":"A,8YA4BO,IAAME,EAAN,cAA2BC,CAAW,C,8BAIjC,KAAA,QAAA,GAEA,KAAA,QAAA,GAEI,KAAA,YAAA,GAEP,KAAA,KAAA,GAEE,KAAA,OAAA,GAED,KAAA,MAAA,GAGS,KAAA,GAAA,I,QAhBD,KAAA,OAAA,CAACE,EAAQC,CAAe,C,CAkBxC,QAAS,CACP,MAAO,EAAI;;;YAGH,KAAK,QACH,CAAI,kEAAkE,KAAK,QAAQ,aACnFC,EAAQ;sBACA,KAAK,GAAG,yDAAyD,KAAK,QAAQ;YACxF,KAAK,YAAc,CAAI,0BAA0B,KAAK,YAAY,MAAQA,EAAQ;;UAEpF,KAAK,KACH,CAAI;;;;;sBAKM,KAAK,KAAK;wBACR,KAAK,QAAUA,EAAQ;uBACxB,KAAK,OAAS,KAAK,SAAW,KAAK,QAAQ;gCAEtDA,EAAQ;;KAGlB,CACF,EAxCGP,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,UAAA,IAAA,EAAA,EAEzBF,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,UAAA,IAAA,EAAA,EAEzBF,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,cAAA,IAAA,EAAA,EAEzBF,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,OAAA,IAAA,EAAA,EAEzBF,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,SAAA,IAAA,EAAA,EAEzBF,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,QAAA,IAAA,EAAA,EAGzBF,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAN,EAAA,UAAA,KAAA,IAAA,EAAA,EAjB3B,EAAAF,EAAA,CAAAS,EAAc,kBAAkB,CAAA,EAAAP,CAAA,E"}
1
+ {"version":3,"file":"audience-card.js","names":["_decorate","__decorate","AudienceCard","LitElement","_args","audienceCardCSS","nothing","property","defineElement"],"sources":["../../../../src/components/audience-card/audience-card.ts"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/heading/heading.ts\";\nimport { audienceCardCSS } from \"./audience-card.css.ts\";\n\ntype HeadingTag = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\n/**\n * The homepage's audience entry: who it is for, a title, a line of\n * description, and a round arrow into that audience's page. Drawn in the\n * foundation Figma file as Audience card.\n *\n * One link, not three. The arrow is the link and carries the accessible name\n * (`label`, the eyebrow by default, e.g. \"For home\"), so the page reads one\n * link per card instead of a title, a paragraph and an arrow. Its hit area is\n * stretched across the card by an ::after on the link itself (see\n * audience-card.css.ts), so a click anywhere on the card is a click on the\n * link: middle-click and Ctrl/Cmd-click open it in a new tab and the link's\n * context menu is there, which the click handler that stood here could not\n * do -- it forwarded a plain click() whatever the reader had asked for.\n *\n * Between md and lg -- the tablet frame -- the card turns into a row, the copy\n * on the left and the arrow on the right; above and below it stacks.\n */\n@defineElement(\"bd-audience-card\")\nexport class AudienceCard extends LitElement {\n static styles = [audienceCardCSS];\n\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n heading = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: String })\n href = \"\";\n @property({ type: String })\n target = \"\";\n @property({ type: String })\n label = \"\";\n // three cards under the hero's h1\n @property({ type: String })\n as: HeadingTag = \"h2\";\n\n render() {\n return html`\n <article class=\"card\">\n <div class=\"copy\">\n ${this.eyebrow\n ? html`<p class=\"eyebrow\"><slot name=\"icon\"></slot><span class=\"text\">${this.eyebrow}</span></p>`\n : nothing}\n ${this.heading\n ? html`<bd-h as=\"${this.as}\" visual-level=\"h4\" class=\"heading\"><span class=\"text\">${this.heading}</span></bd-h>`\n : nothing}\n ${this.description ? html`<p class=\"description\">${this.description}</p>` : nothing}\n </div>\n ${this.href\n ? html`<bd-button-link\n class=\"arrow\"\n variant=\"accent\"\n size=\"md\"\n icon-only\n href=\"${this.href}\"\n target=\"${this.target || nothing}\"\n label=\"${this.label || this.eyebrow || this.heading}\"\n ></bd-button-link>`\n : nothing}\n </article>\n `;\n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,EAGzBF,EAAA,CAAAO,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAL,EAAA,UAAA,KAAA,IAAA,EAAA,EAjB3B,EAAAF,EAAA,CAAAQ,EAAc,kBAAkB,CAAA,EAAAN,CAAA,E"}
@@ -1,4 +1,5 @@
1
1
  import { LitElement, nothing, type PropertyValues } from "lit";
2
+ import "../../tokens/tokens.js";
2
3
  import "../icons/av-comparatives-icon.js";
3
4
  import "../icons/best-brands-icon.js";
4
5
  import "../icons/laurel-icon.js";
@@ -50,8 +51,8 @@ export declare class AwardsFlex extends LitElement {
50
51
  _iconHeight(): 64 | 56;
51
52
  _renderIcon(iconKey: string): import("lit-html").TemplateResult<1>;
52
53
  _renderBadge(award: AwardsFlexBadge): import("lit-html").TemplateResult<1>;
53
- _renderQuoteCard(award: AwardsFlexBadge): import("lit-html").TemplateResult<1> | typeof nothing;
54
- _renderDots(): import("lit-html").TemplateResult<1> | typeof nothing;
54
+ _renderQuoteCard(award: AwardsFlexBadge): typeof nothing | import("lit-html").TemplateResult<1>;
55
+ _renderDots(): typeof nothing | import("lit-html").TemplateResult<1>;
55
56
  _renderCarousel(): import("lit-html").TemplateResult<1>;
56
57
  _renderLaurel(): import("lit-html").TemplateResult<1>;
57
58
  render(): import("lit-html").TemplateResult<1>;
@@ -1,14 +1,14 @@
1
- import{defineElement as e}from"../shared/define-element.js";import{tokens as t}from"../../tokens/tokens.js";import{below as n}from"../shared/token-scales.js";import r from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import"../paragraph/paragraph.js";import{ensembleCSS as i}from"../shared/ensemble.css.js";import{awardsFlexCSS as a}from"./awards-flex.css.js";import{MediaQueryController as o}from"../shared/controller.media-query.js";import"../icons/av-comparatives-icon.js";import"../icons/best-brands-icon.js";import"../icons/laurel-icon.js";import"../icons/pc-mag-2024-icon.js";import"../icons/pc-mag-business-icon.js";import"../icons/pc-mag-icon.js";import"../icons/pc-mag-readers-icon.js";import"../icons/top-product-icon.js";import"../pagination-dots/pagination-dots.js";import{ScrollSlides as s}from"./scroll-slides.js";import{LitElement as c,html as l,nothing as u}from"lit";import{property as d,state as f}from"lit/decorators.js";var p=3,m=1,h=class extends c{static{this.styles=[t,i,a]}constructor(){super(),this.background=`white`,this.layout=`compact`,this.carousel=!1,this.autoplay=!1,this.autoplayDelay=4e3,this.headline=``,this.subtext=``,this.badges=[],this._slide=0,this._groupSize=p,this._hovered=!1,this._focusWithin=!1,this._live=`polite`,this._slides=new s(this,{scroller:`.bd-awardsflex-carousel-viewport`,onSlide:e=>this._onScrolled(e)}),new o(this,n(`sm`),e=>this._setGroupSize(e?m:p))}_setGroupSize(e){if(e===this._groupSize)return;let t=this._slide*this._groupSize;this._groupSize=e,this._slide=Math.floor(t/e)}updated(e){(e.has(`autoplay`)||e.has(`carousel`)||e.has(`layout`)||e.has(`badges`)||e.has(`_groupSize`))&&this._slide>=this._slidesCount&&(this._slide=0),(e.has(`_slide`)||e.has(`_groupSize`))&&this._slides.go(this._slide)}_onScrolled(e){if(e===this._slide)return;this._slide=e;let t=this.renderRoot.querySelector(`bd-pagination-dots`);t?.autoplay&&(t.paused=!0)}get _groups(){let e=[];for(let t=0;t<this.badges.length;t+=this._groupSize)e.push(this.badges.slice(t,t+this._groupSize));return e}get _slidesCount(){return this.layout===`quotes`?this._groups.length:0}get _autoplayOffered(){return this.autoplay&&this.carousel&&this.layout===`quotes`&&this._slidesCount>1}_iconHeight(){return this.layout===`grid`?64:(this.layout,56)}_renderIcon(e){let t=this._iconHeight();switch(e){case`pc-mag`:return l`<bd-pc-mag-icon height=${t}></bd-pc-mag-icon>`;case`pc-mag-2024`:return l`<bd-pc-mag-2024-icon height=${t}></bd-pc-mag-2024-icon>`;case`pc-mag-business`:return l`<bd-pc-mag-business-icon height=${t}></bd-pc-mag-business-icon>`;case`pc-mag-readers`:return l`<bd-pc-mag-readers-icon height=${t}></bd-pc-mag-readers-icon>`;case`av-comparatives`:return l`<bd-av-comparatives-icon height=${t}></bd-av-comparatives-icon>`;case`best-brands`:return l`<bd-best-brands-icon height=${t}></bd-best-brands-icon>`;case`top-product`:return l`<bd-top-product-icon height=${t}></bd-top-product-icon>`;default:return l`<span class="bd-awardsflex-badge-fallback" aria-hidden="true">?</span>`}}_renderBadge(e){let t=`bd-awardsflex-badge ${e.type===`dark`?`bd-awardsflex-badge--dark`:``}`;return l`
1
+ import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{below as t}from"../shared/token-scales.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import"../paragraph/paragraph.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import{awardsFlexCSS as i}from"./awards-flex.css.js";import{MediaQueryController as a}from"../shared/controller.media-query.js";import"../icons/av-comparatives-icon.js";import"../icons/best-brands-icon.js";import"../icons/laurel-icon.js";import"../icons/pc-mag-2024-icon.js";import"../icons/pc-mag-business-icon.js";import"../icons/pc-mag-icon.js";import"../icons/pc-mag-readers-icon.js";import"../icons/top-product-icon.js";import"../pagination-dots/pagination-dots.js";import{ScrollSlides as o}from"./scroll-slides.js";import{LitElement as s,html as c,nothing as l}from"lit";import{property as u,state as d}from"lit/decorators.js";var f=3,p=1,m=class extends s{static{this.styles=[r,i]}constructor(){super(),this.background=`white`,this.layout=`compact`,this.carousel=!1,this.autoplay=!1,this.autoplayDelay=4e3,this.headline=``,this.subtext=``,this.badges=[],this._slide=0,this._groupSize=f,this._hovered=!1,this._focusWithin=!1,this._live=`polite`,this._slides=new o(this,{scroller:`.bd-awardsflex-carousel-viewport`,onSlide:e=>this._onScrolled(e)}),new a(this,t(`sm`),e=>this._setGroupSize(e?p:f))}_setGroupSize(e){if(e===this._groupSize)return;let t=this._slide*this._groupSize;this._groupSize=e,this._slide=Math.floor(t/e)}updated(e){(e.has(`autoplay`)||e.has(`carousel`)||e.has(`layout`)||e.has(`badges`)||e.has(`_groupSize`))&&this._slide>=this._slidesCount&&(this._slide=0),(e.has(`_slide`)||e.has(`_groupSize`))&&this._slides.go(this._slide)}_onScrolled(e){if(e===this._slide)return;this._slide=e;let t=this.renderRoot.querySelector(`bd-pagination-dots`);t?.autoplay&&(t.paused=!0)}get _groups(){let e=[];for(let t=0;t<this.badges.length;t+=this._groupSize)e.push(this.badges.slice(t,t+this._groupSize));return e}get _slidesCount(){return this.layout===`quotes`?this._groups.length:0}get _autoplayOffered(){return this.autoplay&&this.carousel&&this.layout===`quotes`&&this._slidesCount>1}_iconHeight(){return this.layout===`grid`?64:(this.layout,56)}_renderIcon(e){let t=this._iconHeight();switch(e){case`pc-mag`:return c`<bd-pc-mag-icon height=${t}></bd-pc-mag-icon>`;case`pc-mag-2024`:return c`<bd-pc-mag-2024-icon height=${t}></bd-pc-mag-2024-icon>`;case`pc-mag-business`:return c`<bd-pc-mag-business-icon height=${t}></bd-pc-mag-business-icon>`;case`pc-mag-readers`:return c`<bd-pc-mag-readers-icon height=${t}></bd-pc-mag-readers-icon>`;case`av-comparatives`:return c`<bd-av-comparatives-icon height=${t}></bd-av-comparatives-icon>`;case`best-brands`:return c`<bd-best-brands-icon height=${t}></bd-best-brands-icon>`;case`top-product`:return c`<bd-top-product-icon height=${t}></bd-top-product-icon>`;default:return c`<span class="bd-awardsflex-badge-fallback" aria-hidden="true">?</span>`}}_renderBadge(e){let t=`bd-awardsflex-badge ${e.type===`dark`?`bd-awardsflex-badge--dark`:``}`;return c`
2
2
  <div class="${t}" data-award-id="${e.id}" role="listitem" aria-label="${e.label||``}">
3
3
  ${this._renderIcon(e.icon)}
4
4
  </div>
5
- `}_renderQuoteCard(e){return e.quote?l`
5
+ `}_renderQuoteCard(e){return e.quote?c`
6
6
  <div class="bd-awardsflex-quote-card">
7
7
  ${this._renderBadge(e)}
8
8
  <p class="bd-awardsflex-quote-text">"${e.quote}"</p>
9
- ${e.source?l`<p class="bd-awardsflex-quote-source">${e.source}${e.date?l`, ${e.date}`:u}</p>`:u}
9
+ ${e.source?c`<p class="bd-awardsflex-quote-source">${e.source}${e.date?c`, ${e.date}`:l}</p>`:l}
10
10
  </div>
11
- `:u}_renderDots(){return!this.carousel||this._slidesCount<2?u:l`
11
+ `:l}_renderDots(){return!this.carousel||this._slidesCount<2?l:c`
12
12
  <bd-pagination-dots
13
13
  count=${this._slidesCount}
14
14
  current=${this._slide+1}
@@ -19,7 +19,7 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
19
19
  @bd-change=${e=>{this._slide=e.detail.current-1}}
20
20
  @bd-toggle=${e=>{this._live=e.detail.moving?`off`:`polite`}}
21
21
  ></bd-pagination-dots>
22
- `}_renderCarousel(){return l`
22
+ `}_renderCarousel(){return c`
23
23
  <div
24
24
  class="bd-awardsflex-carousel-viewport"
25
25
  @mouseenter=${()=>{this._hovered=!0}}
@@ -28,41 +28,41 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
28
28
  @focusout=${e=>{this._focusWithin=e.currentTarget.contains(e.relatedTarget)}}
29
29
  >
30
30
  <div class="bd-awardsflex-carousel-track" aria-live=${this._live}>
31
- ${this._groups.map((e,t)=>l`
31
+ ${this._groups.map((e,t)=>c`
32
32
  <div class="bd-awardsflex-carousel-slide" ?inert=${t!==this._slide}>
33
33
  ${e.map(e=>this._renderQuoteCard(e))}
34
34
  </div>
35
35
  `)}
36
36
  </div>
37
37
  </div>
38
- `}_renderLaurel(){return l`
38
+ `}_renderLaurel(){return c`
39
39
  <div class="bd-awardsflex-laurel">
40
40
  <slot name="icon">
41
41
  <bd-laurel-icon width="80" height="64"></bd-laurel-icon>
42
42
  </slot>
43
43
  </div>
44
- `}render(){let e=`bd-ensemble bd-awardsflex-root bd-awardsflex-root--${this.background} bd-awardsflex-root--${this.layout}`;return l`
44
+ `}render(){let e=`bd-ensemble bd-awardsflex-root bd-awardsflex-root--${this.background} bd-awardsflex-root--${this.layout}`;return c`
45
45
  <section class="${e}" aria-label="Awards and recognition">
46
46
  ${this._renderLaurel()}
47
- ${this.headline||this.subtext?l`
47
+ ${this.headline||this.subtext?c`
48
48
  <div class="bd-awardsflex-text-group">
49
- ${this.headline?l`<bd-h as="h3" class="bd-awardsflex-headline">${this.headline}</bd-h>`:u}
50
- ${this.subtext?l`<bd-p variant="large" class="bd-awardsflex-subtext">${this.subtext}</bd-p>`:u}
49
+ ${this.headline?c`<bd-h as="h3" class="bd-awardsflex-headline">${this.headline}</bd-h>`:l}
50
+ ${this.subtext?c`<bd-p variant="large" class="bd-awardsflex-subtext">${this.subtext}</bd-p>`:l}
51
51
  </div>
52
- `:u}
52
+ `:l}
53
53
 
54
- ${this.layout===`quotes`?l`
55
- ${this.carousel?this._renderCarousel():l`
54
+ ${this.layout===`quotes`?c`
55
+ ${this.carousel?this._renderCarousel():c`
56
56
  <div class="bd-awardsflex-quotes-row" role="list">
57
57
  ${this.badges.map(e=>this._renderQuoteCard(e))}
58
58
  </div>
59
59
  `}
60
60
  ${this._renderDots()}
61
- `:l`
61
+ `:c`
62
62
  <div class="bd-awardsflex-badges-row" role="list">
63
63
  ${this.badges.map(e=>this._renderBadge(e))}
64
64
  </div>
65
65
  `}
66
66
  </section>
67
- `}};r([d({type:String,reflect:!0})],h.prototype,`background`,void 0),r([d({type:String})],h.prototype,`layout`,void 0),r([d({type:Boolean})],h.prototype,`carousel`,void 0),r([d({type:Boolean})],h.prototype,`autoplay`,void 0),r([d({type:Number,attribute:`autoplay-delay`})],h.prototype,`autoplayDelay`,void 0),r([d({type:String})],h.prototype,`headline`,void 0),r([d({type:String})],h.prototype,`subtext`,void 0),r([d({type:Array})],h.prototype,`badges`,void 0),r([f()],h.prototype,`_slide`,void 0),r([f()],h.prototype,`_groupSize`,void 0),r([f()],h.prototype,`_hovered`,void 0),r([f()],h.prototype,`_focusWithin`,void 0),r([f()],h.prototype,`_live`,void 0),h=r([e(`bd-awards-flex`)],h);export{h as AwardsFlex};
67
+ `}};n([u({type:String,reflect:!0})],m.prototype,`background`,void 0),n([u({type:String})],m.prototype,`layout`,void 0),n([u({type:Boolean})],m.prototype,`carousel`,void 0),n([u({type:Boolean})],m.prototype,`autoplay`,void 0),n([u({type:Number,attribute:`autoplay-delay`})],m.prototype,`autoplayDelay`,void 0),n([u({type:String})],m.prototype,`headline`,void 0),n([u({type:String})],m.prototype,`subtext`,void 0),n([u({type:Array})],m.prototype,`badges`,void 0),n([d()],m.prototype,`_slide`,void 0),n([d()],m.prototype,`_groupSize`,void 0),n([d()],m.prototype,`_hovered`,void 0),n([d()],m.prototype,`_focusWithin`,void 0),n([d()],m.prototype,`_live`,void 0),m=n([e(`bd-awards-flex`)],m);export{m as AwardsFlex};
68
68
  //# sourceMappingURL=awards-flex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"awards-flex.js","names":["_decorate","__decorate","GROUP_SIZE","GROUP_SIZE_NARROW","AwardsFlex","LitElement","tokens","ensembleCSS","awardsFlexCSS","ScrollSlides","i","MediaQueryController","below","narrow","size","firstCard","changed","index","dots","groups","h","iconKey","classes","award","nothing","group","a","rootClasses","property","state","defineElement"],"sources":["../../../../src/components/awards/awards-flex.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { MediaQueryController } from \"#shared/controller.media-query.ts\";\nimport { tokens } from \"#tokens/tokens.ts\";\nimport \"#components/icons/av-comparatives-icon.ts\";\nimport \"#components/icons/best-brands-icon.ts\";\nimport \"#components/icons/laurel-icon.ts\";\nimport \"#components/icons/pc-mag-2024-icon.ts\";\nimport \"#components/icons/pc-mag-business-icon.ts\";\nimport \"#components/icons/pc-mag-icon.ts\";\nimport \"#components/icons/pc-mag-readers-icon.ts\";\nimport \"#components/icons/top-product-icon.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\nimport { awardsFlexCSS } from \"./awards-flex.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport { below } from \"#shared/token-scales.ts\";\nimport { ScrollSlides } from \"./scroll-slides.ts\";\n\n/* How many quote cards one carousel slide holds: three side by side, and one\n below sm. Three used to stack in a column on a phone, so a slide was about\n 1065px tall with every card on screen at once, and the dots paged between\n two such stacks. One card a slide gives the phone a carousel again -- six\n awards are six slides and six dots -- at about half the height. Drawn in the\n foundation Figma file as Awards carousel, breakpoint=mobile. */\nconst GROUP_SIZE = 3;\nconst GROUP_SIZE_NARROW = 1;\n\ntype Background = \"white\" | \"tint\";\ntype Layout = \"compact\" | \"grid\" | \"quotes\";\ntype Live = \"off\" | \"polite\";\n\ninterface AwardsFlexBadge {\n id : string;\n label? : string;\n type? : string;\n icon : string;\n quote? : string;\n source?: string;\n date? : string;\n}\n\n@defineElement(\"bd-awards-flex\")\nexport class AwardsFlex extends LitElement {\n static styles = [tokens, ensembleCSS, awardsFlexCSS];\n\n @property({ type: String, reflect: true })\n background: Background = \"white\";\n @property({ type: String })\n layout: Layout = \"compact\";\n @property({ type: Boolean })\n carousel = false;\n @property({ type: Boolean })\n autoplay = false;\n @property({ type: Number, attribute: \"autoplay-delay\" })\n autoplayDelay = 4000;\n @property({ type: String })\n headline = \"\";\n @property({ type: String })\n subtext = \"\";\n @property({ type: Array })\n badges: AwardsFlexBadge[] = [];\n @state()\n _slide = 0;\n @state()\n _groupSize = GROUP_SIZE;\n /* The pointer or focus on the slides holds the autoplay -- a hold, which\n lifts by itself. Stopping it for good is the atom's: a visitor who picks\n a dot has chosen a slide, and it stays. */\n @state()\n _hovered = false;\n @state()\n _focusWithin = false;\n /* The slides' live region. Off while they change on their own, so a\n screen reader is not read a new set of quotes every few seconds; polite\n once they are still, so a change the visitor asks for is announced.\n bd-pagination-dots says which, through bd-toggle. */\n @state()\n _live: Live = \"polite\";\n\n _slides: ScrollSlides;\n\n constructor() {\n super();\n this._slides = new ScrollSlides(this, {\n scroller: \".bd-awardsflex-carousel-viewport\",\n onSlide : i => this._onScrolled(i)\n });\n /* Watched rather than read once: a slide is a layout, and a phone turned\n sideways crosses the breakpoint. */\n new MediaQueryController(this, below(\"sm\"), narrow => this._setGroupSize(narrow ? GROUP_SIZE_NARROW : GROUP_SIZE));\n }\n\n /* Changing the slide size keeps the visitor on the slide that holds the card\n they were looking at: its first card, re-paged. */\n _setGroupSize(size: number) {\n if (size === this._groupSize) return;\n const firstCard = this._slide * this._groupSize;\n this._groupSize = size;\n this._slide = Math.floor(firstCard / size);\n }\n\n updated(changed: PropertyValues<this>) {\n if (\n changed.has(\"autoplay\") ||\n changed.has(\"carousel\") ||\n changed.has(\"layout\") ||\n changed.has(\"badges\") ||\n changed.has(\"_groupSize\")\n ) {\n // if the badge set shrank, make sure the current slide index is still valid\n if (this._slide >= this._slidesCount) {\n this._slide = 0;\n }\n }\n // a dot, the clock or a re-paging chose a slide: bring it in\n if (changed.has(\"_slide\") || changed.has(\"_groupSize\")) this._slides.go(this._slide);\n }\n\n /* A visitor scrolled to another slide. That is a choice of slide, as a dot\n is, so it stops autoplay for good the way a dot does. */\n _onScrolled(index: number) {\n if (index === this._slide) return;\n this._slide = index;\n const dots = this.renderRoot.querySelector(\"bd-pagination-dots\");\n if (dots?.autoplay) dots.paused = true;\n }\n\n get _groups() {\n // chunk badges into slides of _groupSize for the carousel\n const groups: AwardsFlexBadge[][] = [];\n for (let i = 0; i < this.badges.length; i += this._groupSize) {\n groups.push(this.badges.slice(i, i + this._groupSize));\n }\n return groups;\n }\n\n get _slidesCount() {\n return this.layout === \"quotes\" ? this._groups.length : 0;\n }\n\n /** True when the carousel is able to move on its own. */\n get _autoplayOffered() {\n return this.autoplay && this.carousel && this.layout === \"quotes\" && this._slidesCount > 1;\n }\n\n _iconHeight() {\n if (this.layout === \"grid\") return 64;\n if (this.layout === \"quotes\") return 56;\n return 56;\n }\n\n _renderIcon(iconKey: string) {\n const h = this._iconHeight();\n\n switch (iconKey) {\n case \"pc-mag\":\n return html`<bd-pc-mag-icon height=${h}></bd-pc-mag-icon>`;\n case \"pc-mag-2024\":\n return html`<bd-pc-mag-2024-icon height=${h}></bd-pc-mag-2024-icon>`;\n case \"pc-mag-business\":\n return html`<bd-pc-mag-business-icon height=${h}></bd-pc-mag-business-icon>`;\n case \"pc-mag-readers\":\n return html`<bd-pc-mag-readers-icon height=${h}></bd-pc-mag-readers-icon>`;\n case \"av-comparatives\":\n return html`<bd-av-comparatives-icon height=${h}></bd-av-comparatives-icon>`;\n case \"best-brands\":\n return html`<bd-best-brands-icon height=${h}></bd-best-brands-icon>`;\n case \"top-product\":\n return html`<bd-top-product-icon height=${h}></bd-top-product-icon>`;\n default:\n return html`<span class=\"bd-awardsflex-badge-fallback\" aria-hidden=\"true\">?</span>`;\n }\n }\n\n _renderBadge(award: AwardsFlexBadge) {\n const classes = `bd-awardsflex-badge ${award.type === \"dark\" ? \"bd-awardsflex-badge--dark\" : \"\"}`;\n return html`\n <div class=\"${classes}\" data-award-id=\"${award.id}\" role=\"listitem\" aria-label=\"${award.label || \"\"}\">\n ${this._renderIcon(award.icon)}\n </div>\n `;\n }\n\n _renderQuoteCard(award: AwardsFlexBadge) {\n if (!award.quote) return nothing;\n return html`\n <div class=\"bd-awardsflex-quote-card\">\n ${this._renderBadge(award)}\n <p class=\"bd-awardsflex-quote-text\">\"${award.quote}\"</p>\n ${award.source\n ? html`<p class=\"bd-awardsflex-quote-source\">${award.source}${award.date ? html`, ${award.date}` : nothing}</p>`\n : nothing}\n </div>\n `;\n }\n\n /* bd-pagination-dots, which runs the clock too, so the progress in the\n current pill and the change of slide are one thing. WCAG 2.2.2's way to\n stop it is the dots themselves: picking one stops autoplay for good. */\n _renderDots() {\n if (!this.carousel || this._slidesCount < 2) return nothing;\n return html`\n <bd-pagination-dots\n count=${this._slidesCount}\n current=${this._slide + 1}\n label=\"Awards\"\n ?autoplay=${this._autoplayOffered}\n delay=${this.autoplayDelay}\n ?held=${this._hovered || this._focusWithin}\n @bd-change=${(e: CustomEvent<{ current: number }>) => { this._slide = e.detail.current - 1; }}\n @bd-toggle=${(e: CustomEvent<{ moving: boolean }>) => { this._live = e.detail.moving ? \"off\" : \"polite\"; }}\n ></bd-pagination-dots>\n `;\n }\n\n /* The window is a scroll-snap scroller the browser drives -- a swipe, a\n trackpad and a wheel move it, and the dots follow (scroll-slides.ts). It\n used to be overflow: hidden around a track moved by an inline\n translateX, which nothing but the dots could move. */\n _renderCarousel() {\n return html`\n <div\n class=\"bd-awardsflex-carousel-viewport\"\n @mouseenter=${() => { this._hovered = true; }}\n @mouseleave=${() => { this._hovered = false; }}\n @focusin=${() => { this._focusWithin = true; }}\n @focusout=${(e: FocusEvent) => { this._focusWithin = (e.currentTarget as HTMLElement).contains(e.relatedTarget as Node | null); }}\n >\n <div class=\"bd-awardsflex-carousel-track\" aria-live=${this._live}>\n ${this._groups.map(\n (group, i) => html`\n <div class=\"bd-awardsflex-carousel-slide\" ?inert=${i !== this._slide}>\n ${group.map((a) => this._renderQuoteCard(a))}\n </div>\n `\n )}\n </div>\n </div>\n `;\n }\n\n _renderLaurel() {\n // slot lets a consumer override the icon while bd-laurel-icon remains\n // the default, matching the reference design (centered above the headline)\n return html`\n <div class=\"bd-awardsflex-laurel\">\n <slot name=\"icon\">\n <bd-laurel-icon width=\"80\" height=\"64\"></bd-laurel-icon>\n </slot>\n </div>\n `;\n }\n\n render() {\n const rootClasses = `bd-ensemble bd-awardsflex-root bd-awardsflex-root--${this.background} bd-awardsflex-root--${this.layout}`;\n\n return html`\n <section class=\"${rootClasses}\" aria-label=\"Awards and recognition\">\n ${this._renderLaurel()}\n ${(this.headline || this.subtext)\n ? html`\n <div class=\"bd-awardsflex-text-group\">\n ${this.headline\n ? html`<bd-h as=\"h3\" class=\"bd-awardsflex-headline\">${this.headline}</bd-h>`\n : nothing}\n ${this.subtext\n ? html`<bd-p variant=\"large\" class=\"bd-awardsflex-subtext\">${this.subtext}</bd-p>`\n : nothing}\n </div>\n `\n : nothing}\n\n ${this.layout === \"quotes\"\n ? html`\n ${this.carousel\n ? this._renderCarousel()\n : html`\n <div class=\"bd-awardsflex-quotes-row\" role=\"list\">\n ${this.badges.map((a) => this._renderQuoteCard(a))}\n </div>\n `}\n ${this._renderDots()}\n `\n : html`\n <div class=\"bd-awardsflex-badges-row\" role=\"list\">\n ${this.badges.map((a) => this._renderBadge(a))}\n </div>\n `}\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-awards-flex\": AwardsFlex;\n }\n}\n"],"mappings":"A,y9BA2BA,IAAME,EAAa,EACbC,EAAoB,EAiBbC,EAAN,cAAyBC,CAAW,C,OACzB,KAAA,OAAA,CAACC,EAAQC,EAAaC,CAAa,C,CAsCnD,aAAc,CACZ,MAAM,EApCiB,KAAA,WAAA,QAER,KAAA,OAAA,UAEN,KAAA,SAAA,GAEA,KAAA,SAAA,GAEK,KAAA,cAAA,IAEL,KAAA,SAAA,GAED,KAAA,QAAA,GAEkB,KAAA,OAAA,CAAC,EAEpB,KAAA,OAAA,EAEI,KAAA,WAAAN,EAKF,KAAA,SAAA,GAEI,KAAA,aAAA,GAMD,KAAA,MAAA,SAMZ,KAAK,QAAU,IAAIO,EAAa,KAAM,CACpC,SAAU,mCACV,QAAU,GAAK,KAAK,YAAYC,CAAC,CACnC,CAAC,EAGD,IAAIC,EAAqB,KAAMC,EAAM,IAAI,EAAG,GAAU,KAAK,cAAcC,EAASV,EAAoBD,CAAU,CAAC,CACnH,CAIA,cAAc,EAAc,CAC1B,GAAIY,IAAS,KAAK,WAAY,OAC9B,IAAMC,EAAY,KAAK,OAAS,KAAK,WACrC,KAAK,WAAaD,EAClB,KAAK,OAAS,KAAK,MAAMC,EAAYD,CAAI,CAC3C,CAEA,QAAQ,EAA+B,EAEnCE,EAAQ,IAAI,UAAU,GACtBA,EAAQ,IAAI,UAAU,GACtBA,EAAQ,IAAI,QAAQ,GACpBA,EAAQ,IAAI,QAAQ,GACpBA,EAAQ,IAAI,YAAY,IAGpB,KAAK,QAAU,KAAK,eACtB,KAAK,OAAS,IAIdA,EAAQ,IAAI,Q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AAA,EAExBJ,EAAA,CAAA6B,EAAM,CAAA,EAAAzB,EAAA,UAAA,SAAA,IAAA,EAAA,EAENJ,EAAA,CAAA6B,EAAM,CAAA,EAAAzB,EAAA,UAAA,aAAA,IAAA,EAAA,EAKNJ,EAAA,CAAA6B,EAAM,CAAA,EAAAzB,EAAA,UAAA,WAAA,IAAA,EAAA,EAENJ,EAAA,CAAA6B,EAAM,CAAA,EAAAzB,EAAA,UAAA,eAAA,IAAA,EAAA,EAMNJ,EAAA,CAAA6B,EAAM,CAAA,EAAAzB,EAAA,UAAA,QAAA,IAAA,EAAA,EAnCR,EAAAJ,EAAA,CAAA8B,EAAc,gBAAgB,CAAA,EAAA1B,CAAA,E"}
1
+ {"version":3,"file":"awards-flex.js","names":["_decorate","__decorate","GROUP_SIZE","GROUP_SIZE_NARROW","AwardsFlex","LitElement","ensembleCSS","awardsFlexCSS","ScrollSlides","i","MediaQueryController","below","narrow","size","firstCard","changed","index","dots","groups","h","iconKey","classes","award","nothing","group","a","rootClasses","property","state","defineElement"],"sources":["../../../../src/components/awards/awards-flex.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { MediaQueryController } from \"#shared/controller.media-query.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/icons/av-comparatives-icon.ts\";\nimport \"#components/icons/best-brands-icon.ts\";\nimport \"#components/icons/laurel-icon.ts\";\nimport \"#components/icons/pc-mag-2024-icon.ts\";\nimport \"#components/icons/pc-mag-business-icon.ts\";\nimport \"#components/icons/pc-mag-icon.ts\";\nimport \"#components/icons/pc-mag-readers-icon.ts\";\nimport \"#components/icons/top-product-icon.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\nimport { awardsFlexCSS } from \"./awards-flex.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport { below } from \"#shared/token-scales.ts\";\nimport { ScrollSlides } from \"./scroll-slides.ts\";\n\n/* How many quote cards one carousel slide holds: three side by side, and one\n below sm. Three used to stack in a column on a phone, so a slide was about\n 1065px tall with every card on screen at once, and the dots paged between\n two such stacks. One card a slide gives the phone a carousel again -- six\n awards are six slides and six dots -- at about half the height. Drawn in the\n foundation Figma file as Awards carousel, breakpoint=mobile. */\nconst GROUP_SIZE = 3;\nconst GROUP_SIZE_NARROW = 1;\n\ntype Background = \"white\" | \"tint\";\ntype Layout = \"compact\" | \"grid\" | \"quotes\";\ntype Live = \"off\" | \"polite\";\n\ninterface AwardsFlexBadge {\n id : string;\n label? : string;\n type? : string;\n icon : string;\n quote? : string;\n source?: string;\n date? : string;\n}\n\n@defineElement(\"bd-awards-flex\")\nexport class AwardsFlex extends LitElement {\n static styles = [ensembleCSS, awardsFlexCSS];\n\n @property({ type: String, reflect: true })\n background: Background = \"white\";\n @property({ type: String })\n layout: Layout = \"compact\";\n @property({ type: Boolean })\n carousel = false;\n @property({ type: Boolean })\n autoplay = false;\n @property({ type: Number, attribute: \"autoplay-delay\" })\n autoplayDelay = 4000;\n @property({ type: String })\n headline = \"\";\n @property({ type: String })\n subtext = \"\";\n @property({ type: Array })\n badges: AwardsFlexBadge[] = [];\n @state()\n _slide = 0;\n @state()\n _groupSize = GROUP_SIZE;\n /* The pointer or focus on the slides holds the autoplay -- a hold, which\n lifts by itself. Stopping it for good is the atom's: a visitor who picks\n a dot has chosen a slide, and it stays. */\n @state()\n _hovered = false;\n @state()\n _focusWithin = false;\n /* The slides' live region. Off while they change on their own, so a\n screen reader is not read a new set of quotes every few seconds; polite\n once they are still, so a change the visitor asks for is announced.\n bd-pagination-dots says which, through bd-toggle. */\n @state()\n _live: Live = \"polite\";\n\n _slides: ScrollSlides;\n\n constructor() {\n super();\n this._slides = new ScrollSlides(this, {\n scroller: \".bd-awardsflex-carousel-viewport\",\n onSlide : i => this._onScrolled(i)\n });\n /* Watched rather than read once: a slide is a layout, and a phone turned\n sideways crosses the breakpoint. */\n new MediaQueryController(this, below(\"sm\"), narrow => this._setGroupSize(narrow ? GROUP_SIZE_NARROW : GROUP_SIZE));\n }\n\n /* Changing the slide size keeps the visitor on the slide that holds the card\n they were looking at: its first card, re-paged. */\n _setGroupSize(size: number) {\n if (size === this._groupSize) return;\n const firstCard = this._slide * this._groupSize;\n this._groupSize = size;\n this._slide = Math.floor(firstCard / size);\n }\n\n updated(changed: PropertyValues<this>) {\n if (\n changed.has(\"autoplay\") ||\n changed.has(\"carousel\") ||\n changed.has(\"layout\") ||\n changed.has(\"badges\") ||\n changed.has(\"_groupSize\")\n ) {\n // if the badge set shrank, make sure the current slide index is still valid\n if (this._slide >= this._slidesCount) {\n this._slide = 0;\n }\n }\n // a dot, the clock or a re-paging chose a slide: bring it in\n if (changed.has(\"_slide\") || changed.has(\"_groupSize\")) this._slides.go(this._slide);\n }\n\n /* A visitor scrolled to another slide. That is a choice of slide, as a dot\n is, so it stops autoplay for good the way a dot does. */\n _onScrolled(index: number) {\n if (index === this._slide) return;\n this._slide = index;\n const dots = this.renderRoot.querySelector(\"bd-pagination-dots\");\n if (dots?.autoplay) dots.paused = true;\n }\n\n get _groups() {\n // chunk badges into slides of _groupSize for the carousel\n const groups: AwardsFlexBadge[][] = [];\n for (let i = 0; i < this.badges.length; i += this._groupSize) {\n groups.push(this.badges.slice(i, i + this._groupSize));\n }\n return groups;\n }\n\n get _slidesCount() {\n return this.layout === \"quotes\" ? this._groups.length : 0;\n }\n\n /** True when the carousel is able to move on its own. */\n get _autoplayOffered() {\n return this.autoplay && this.carousel && this.layout === \"quotes\" && this._slidesCount > 1;\n }\n\n _iconHeight() {\n if (this.layout === \"grid\") return 64;\n if (this.layout === \"quotes\") return 56;\n return 56;\n }\n\n _renderIcon(iconKey: string) {\n const h = this._iconHeight();\n\n switch (iconKey) {\n case \"pc-mag\":\n return html`<bd-pc-mag-icon height=${h}></bd-pc-mag-icon>`;\n case \"pc-mag-2024\":\n return html`<bd-pc-mag-2024-icon height=${h}></bd-pc-mag-2024-icon>`;\n case \"pc-mag-business\":\n return html`<bd-pc-mag-business-icon height=${h}></bd-pc-mag-business-icon>`;\n case \"pc-mag-readers\":\n return html`<bd-pc-mag-readers-icon height=${h}></bd-pc-mag-readers-icon>`;\n case \"av-comparatives\":\n return html`<bd-av-comparatives-icon height=${h}></bd-av-comparatives-icon>`;\n case \"best-brands\":\n return html`<bd-best-brands-icon height=${h}></bd-best-brands-icon>`;\n case \"top-product\":\n return html`<bd-top-product-icon height=${h}></bd-top-product-icon>`;\n default:\n return html`<span class=\"bd-awardsflex-badge-fallback\" aria-hidden=\"true\">?</span>`;\n }\n }\n\n _renderBadge(award: AwardsFlexBadge) {\n const classes = `bd-awardsflex-badge ${award.type === \"dark\" ? \"bd-awardsflex-badge--dark\" : \"\"}`;\n return html`\n <div class=\"${classes}\" data-award-id=\"${award.id}\" role=\"listitem\" aria-label=\"${award.label || \"\"}\">\n ${this._renderIcon(award.icon)}\n </div>\n `;\n }\n\n _renderQuoteCard(award: AwardsFlexBadge) {\n if (!award.quote) return nothing;\n return html`\n <div class=\"bd-awardsflex-quote-card\">\n ${this._renderBadge(award)}\n <p class=\"bd-awardsflex-quote-text\">\"${award.quote}\"</p>\n ${award.source\n ? html`<p class=\"bd-awardsflex-quote-source\">${award.source}${award.date ? html`, ${award.date}` : nothing}</p>`\n : nothing}\n </div>\n `;\n }\n\n /* bd-pagination-dots, which runs the clock too, so the progress in the\n current pill and the change of slide are one thing. WCAG 2.2.2's way to\n stop it is the dots themselves: picking one stops autoplay for good. */\n _renderDots() {\n if (!this.carousel || this._slidesCount < 2) return nothing;\n return html`\n <bd-pagination-dots\n count=${this._slidesCount}\n current=${this._slide + 1}\n label=\"Awards\"\n ?autoplay=${this._autoplayOffered}\n delay=${this.autoplayDelay}\n ?held=${this._hovered || this._focusWithin}\n @bd-change=${(e: CustomEvent<{ current: number }>) => { this._slide = e.detail.current - 1; }}\n @bd-toggle=${(e: CustomEvent<{ moving: boolean }>) => { this._live = e.detail.moving ? \"off\" : \"polite\"; }}\n ></bd-pagination-dots>\n `;\n }\n\n /* The window is a scroll-snap scroller the browser drives -- a swipe, a\n trackpad and a wheel move it, and the dots follow (scroll-slides.ts). It\n used to be overflow: hidden around a track moved by an inline\n translateX, which nothing but the dots could move. */\n _renderCarousel() {\n return html`\n <div\n class=\"bd-awardsflex-carousel-viewport\"\n @mouseenter=${() => { this._hovered = true; }}\n @mouseleave=${() => { this._hovered = false; }}\n @focusin=${() => { this._focusWithin = true; }}\n @focusout=${(e: FocusEvent) => { this._focusWithin = (e.currentTarget as HTMLElement).contains(e.relatedTarget as Node | null); }}\n >\n <div class=\"bd-awardsflex-carousel-track\" aria-live=${this._live}>\n ${this._groups.map(\n (group, i) => html`\n <div class=\"bd-awardsflex-carousel-slide\" ?inert=${i !== this._slide}>\n ${group.map((a) => this._renderQuoteCard(a))}\n </div>\n `\n )}\n </div>\n </div>\n `;\n }\n\n _renderLaurel() {\n // slot lets a consumer override the icon while bd-laurel-icon remains\n // the default, matching the reference design (centered above the headline)\n return html`\n <div class=\"bd-awardsflex-laurel\">\n <slot name=\"icon\">\n <bd-laurel-icon width=\"80\" height=\"64\"></bd-laurel-icon>\n </slot>\n </div>\n `;\n }\n\n render() {\n const rootClasses = `bd-ensemble bd-awardsflex-root bd-awardsflex-root--${this.background} bd-awardsflex-root--${this.layout}`;\n\n return html`\n <section class=\"${rootClasses}\" aria-label=\"Awards and recognition\">\n ${this._renderLaurel()}\n ${(this.headline || this.subtext)\n ? html`\n <div class=\"bd-awardsflex-text-group\">\n ${this.headline\n ? html`<bd-h as=\"h3\" class=\"bd-awardsflex-headline\">${this.headline}</bd-h>`\n : nothing}\n ${this.subtext\n ? html`<bd-p variant=\"large\" class=\"bd-awardsflex-subtext\">${this.subtext}</bd-p>`\n : nothing}\n </div>\n `\n : nothing}\n\n ${this.layout === \"quotes\"\n ? html`\n ${this.carousel\n ? this._renderCarousel()\n : html`\n <div class=\"bd-awardsflex-quotes-row\" role=\"list\">\n ${this.badges.map((a) => this._renderQuoteCard(a))}\n </div>\n `}\n ${this._renderDots()}\n `\n : html`\n <div class=\"bd-awardsflex-badges-row\" role=\"list\">\n ${this.badges.map((a) => this._renderBadge(a))}\n </div>\n `}\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-awards-flex\": AwardsFlex;\n }\n}\n"],"mappings":"A,w8BA4BA,IAAME,EAAa,EACbC,EAAoB,EAiBbC,EAAN,cAAyBC,CAAW,C,OACzB,KAAA,OAAA,CAACC,EAAaC,CAAa,C,CAsC3C,aAAc,CACZ,MAAM,EApCiB,KAAA,WAAA,QAER,KAAA,OAAA,UAEN,KAAA,SAAA,GAEA,KAAA,SAAA,GAEK,KAAA,cAAA,IAEL,KAAA,SAAA,GAED,KAAA,QAAA,GAEkB,KAAA,OAAA,CAAC,EAEpB,KAAA,OAAA,EAEI,KAAA,WAAAL,EAKF,KAAA,SAAA,GAEI,KAAA,aAAA,GAMD,KAAA,MAAA,SAMZ,KAAK,QAAU,IAAIM,EAAa,KAAM,CACpC,SAAU,mCACV,QAAU,GAAK,KAAK,YAAYC,CAAC,CACnC,CAAC,EAGD,IAAIC,EAAqB,KAAMC,EAAM,IAAI,EAAG,GAAU,KAAK,cAAcC,EAAST,EAAoBD,CAAU,CAAC,CACnH,CAIA,cAAc,EAAc,CAC1B,GAAIW,IAAS,KAAK,WAAY,OAC9B,IAAMC,EAAY,KAAK,OAAS,KAAK,WACrC,KAAK,WAAaD,EAClB,KAAK,OAAS,KAAK,MAAMC,EAAYD,CAAI,CAC3C,CAEA,QAAQ,EAA+B,EAEnCE,EAAQ,IAAI,UAAU,GACtBA,EAAQ,IAAI,UAAU,GACtBA,EAAQ,IAAI,QAAQ,GACpBA,EAAQ,IAAI,QAAQ,GACpBA,EAAQ,IAAI,YAAY,IAGpB,KAAK,QAAU,KA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AC,CAAA,EAAAvB,EAAA,UAAA,SAAA,IAAA,EAAA,EAExBJ,EAAA,CAAA4B,EAAM,CAAA,EAAAxB,EAAA,UAAA,SAAA,IAAA,EAAA,EAENJ,EAAA,CAAA4B,EAAM,CAAA,EAAAxB,EAAA,UAAA,aAAA,IAAA,EAAA,EAKNJ,EAAA,CAAA4B,EAAM,CAAA,EAAAxB,EAAA,UAAA,WAAA,IAAA,EAAA,EAENJ,EAAA,CAAA4B,EAAM,CAAA,EAAAxB,EAAA,UAAA,eAAA,IAAA,EAAA,EAMNJ,EAAA,CAAA4B,EAAM,CAAA,EAAAxB,EAAA,UAAA,QAAA,IAAA,EAAA,EAnCR,EAAAJ,EAAA,CAAA6B,EAAc,gBAAgB,CAAA,EAAAzB,CAAA,E"}
@@ -1,4 +1,5 @@
1
1
  import { LitElement, nothing, type PropertyValues } from "lit";
2
+ import "../../tokens/tokens.js";
2
3
  import "../heading/heading.js";
3
4
  import "../image/image.js";
4
5
  import "../pagination-dots/pagination-dots.js";
@@ -49,7 +50,7 @@ export declare class AwardsSpotlight extends LitElement {
49
50
  updated(changed: PropertyValues<this>): void;
50
51
  _onScrolled(index: number): void;
51
52
  _renderSlide(award: SpotlightAward, i: number): import("lit-html").TemplateResult<1>;
52
- render(): import("lit-html").TemplateResult<1> | typeof nothing;
53
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
53
54
  }
54
55
  declare global {
55
56
  interface HTMLElementTagNameMap {
@@ -1,4 +1,4 @@
1
- import{defineElement as e}from"../shared/define-element.js";import{tokens as t}from"../../tokens/tokens.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import"../pagination-dots/pagination-dots.js";import{ScrollSlides as i}from"./scroll-slides.js";import{awardsSpotlightCSS as a}from"./awards-spotlight.css.js";import"../image/image.js";import{LitElement as o,html as s,nothing as c}from"lit";import{property as l,state as u}from"lit/decorators.js";var d=class extends o{static{this.styles=[t,r,a]}constructor(){super(),this.awards=[],this.label=`Awards and recognition`,this.as=`h3`,this.autoplay=!1,this.autoplayDelay=6e3,this._slide=0,this._hovered=!1,this._focusWithin=!1,this._live=`polite`,this._slides=new i(this,{scroller:`.viewport`,onSlide:e=>this._onScrolled(e)})}updated(e){e.has(`awards`)&&this._slide>=this.awards.length&&(this._slide=0),e.has(`_slide`)&&this._slides.go(this._slide)}_onScrolled(e){if(e===this._slide)return;this._slide=e;let t=this.renderRoot.querySelector(`bd-pagination-dots`);t?.autoplay&&(t.paused=!0)}_renderSlide(e,t){let n=t===this._slide;return s`
1
+ import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import{ensembleCSS as n}from"../shared/ensemble.css.js";import"../pagination-dots/pagination-dots.js";import{ScrollSlides as r}from"./scroll-slides.js";import{awardsSpotlightCSS as i}from"./awards-spotlight.css.js";import"../image/image.js";import{LitElement as a,html as o,nothing as s}from"lit";import{property as c,state as l}from"lit/decorators.js";var u=class extends a{static{this.styles=[n,i]}constructor(){super(),this.awards=[],this.label=`Awards and recognition`,this.as=`h3`,this.autoplay=!1,this.autoplayDelay=6e3,this._slide=0,this._hovered=!1,this._focusWithin=!1,this._live=`polite`,this._slides=new r(this,{scroller:`.viewport`,onSlide:e=>this._onScrolled(e)})}updated(e){e.has(`awards`)&&this._slide>=this.awards.length&&(this._slide=0),e.has(`_slide`)&&this._slides.go(this._slide)}_onScrolled(e){if(e===this._slide)return;this._slide=e;let t=this.renderRoot.querySelector(`bd-pagination-dots`);t?.autoplay&&(t.paused=!0)}_renderSlide(e,t){let n=t===this._slide;return o`
2
2
  <div
3
3
  class="slide"
4
4
  role="group"
@@ -6,21 +6,21 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
6
6
  aria-label="${t+1} of ${this.awards.length}"
7
7
  ?inert=${!n}
8
8
  >
9
- ${e.logo?s`<div class="logo">
9
+ ${e.logo?o`<div class="logo">
10
10
  <bd-img
11
11
  src="${e.logo}"
12
12
  alt="${e.logoAlt||``}"
13
- width="${e.logoWidth??c}"
14
- height="${e.logoHeight??c}"
13
+ width="${e.logoWidth??s}"
14
+ height="${e.logoHeight??s}"
15
15
  fit="contain"
16
16
  ></bd-img>
17
- </div>`:c}
17
+ </div>`:s}
18
18
  <div class="copy">
19
19
  <bd-h as="${this.as}" visual-level="h3" color="primary" class="title"><span class="text">${e.title}</span></bd-h>
20
- ${e.body?s`<p class="body">${e.body}</p>`:c}
20
+ ${e.body?o`<p class="body">${e.body}</p>`:s}
21
21
  </div>
22
22
  </div>
23
- `}render(){let e=this.awards.length;return e?s`
23
+ `}render(){let e=this.awards.length;return e?o`
24
24
  <section class="bd-ensemble root" aria-label="${this.label}" aria-roledescription="carousel">
25
25
  <div class="card">
26
26
  <div
@@ -47,5 +47,5 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
47
47
  ></bd-pagination-dots>
48
48
  </div>
49
49
  </section>
50
- `:c}};n([l({type:Array})],d.prototype,`awards`,void 0),n([l({type:String})],d.prototype,`label`,void 0),n([l({type:String})],d.prototype,`as`,void 0),n([l({type:Boolean})],d.prototype,`autoplay`,void 0),n([l({type:Number,attribute:`autoplay-delay`})],d.prototype,`autoplayDelay`,void 0),n([u()],d.prototype,`_slide`,void 0),n([u()],d.prototype,`_hovered`,void 0),n([u()],d.prototype,`_focusWithin`,void 0),n([u()],d.prototype,`_live`,void 0),d=n([e(`bd-awards-spotlight`)],d);export{d as AwardsSpotlight};
50
+ `:s}};t([c({type:Array})],u.prototype,`awards`,void 0),t([c({type:String})],u.prototype,`label`,void 0),t([c({type:String})],u.prototype,`as`,void 0),t([c({type:Boolean})],u.prototype,`autoplay`,void 0),t([c({type:Number,attribute:`autoplay-delay`})],u.prototype,`autoplayDelay`,void 0),t([l()],u.prototype,`_slide`,void 0),t([l()],u.prototype,`_hovered`,void 0),t([l()],u.prototype,`_focusWithin`,void 0),t([l()],u.prototype,`_live`,void 0),u=t([e(`bd-awards-spotlight`)],u);export{u as AwardsSpotlight};
51
51
  //# sourceMappingURL=awards-spotlight.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"awards-spotlight.js","names":["_decorate","__decorate","AwardsSpotlight","LitElement","tokens","ensembleCSS","awardsSpotlightCSS","ScrollSlides","i","changed","index","dots","current","award","nothing","count","a","property","state","defineElement"],"sources":["../../../../src/components/awards/awards-spotlight.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { tokens } from \"#tokens/tokens.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/image/image.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\nimport { awardsSpotlightCSS } from \"./awards-spotlight.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport { ScrollSlides } from \"./scroll-slides.ts\";\n\ntype HeadingTag = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\ntype Live = \"off\" | \"polite\";\n\ninterface SpotlightAward {\n logo? : string;\n logoAlt? : string;\n logoWidth? : number;\n logoHeight?: number;\n title : string;\n body? : string;\n}\n\n/**\n * The homepage awards carousel: one award a slide, on a card. Each slide is\n * the award's mark, a title and a paragraph that says what the award is for;\n * the dots sit inside the card, under the slides. Drawn in the foundation\n * Figma file as Awards spotlight (desktop, tablet and mobile) and Award logo.\n *\n * Not bd-awards-flex. That one pages small quote cards, three a slide, under a\n * laurel and a headline of its own; this one gives each award room to say why\n * it was won, and leaves the section heading to the page around it.\n *\n * The slides are as tall as the tallest one -- the track stretches them -- so\n * the dots stay put from slide to slide and the section does not jump. They\n * sit in a scroll-snap scroller, so a swipe, a trackpad or a wheel moves them\n * and the dots follow (scroll-slides.ts).\n *\n * Autoplay is bd-pagination-dots': the progress in the current pill is the\n * clock. The pointer or focus on the slides holds it, a visitor picking a dot\n * or swiping to another slide stops it for good, and under\n * prefers-reduced-motion it never starts.\n */\n@defineElement(\"bd-awards-spotlight\")\nexport class AwardsSpotlight extends LitElement {\n static styles = [tokens, ensembleCSS, awardsSpotlightCSS];\n\n @property({ type: Array })\n awards: SpotlightAward[] = [];\n @property({ type: String })\n label = \"Awards and recognition\";\n // The page's section heading is the h2 above this; each award is under it.\n @property({ type: String })\n as: HeadingTag = \"h3\";\n @property({ type: Boolean })\n autoplay = false;\n @property({ type: Number, attribute: \"autoplay-delay\" })\n autoplayDelay = 6000;\n @state()\n _slide = 0;\n @state()\n _hovered = false;\n @state()\n _focusWithin = false;\n /* Off while the slides change on their own, so a screen reader is not\n read a new award every few seconds; polite once they are still, so a\n change the visitor asks for is announced. The dots say which. */\n @state()\n _live: Live = \"polite\";\n\n _slides: ScrollSlides;\n\n constructor() {\n super();\n this._slides = new ScrollSlides(this, { scroller: \".viewport\", onSlide: i => this._onScrolled(i) });\n }\n\n updated(changed: PropertyValues<this>) {\n // a shorter list must not leave the carousel on a slide that is gone\n if (changed.has(\"awards\") && this._slide >= this.awards.length) this._slide = 0;\n // a dot or the clock chose a slide: bring it in\n if (changed.has(\"_slide\")) this._slides.go(this._slide);\n }\n\n /* A visitor scrolled to another slide. That is a choice of slide, as a dot\n is, so it stops autoplay for good the way a dot does. */\n _onScrolled(index: number) {\n if (index === this._slide) return;\n this._slide = index;\n const dots = this.renderRoot.querySelector(\"bd-pagination-dots\");\n if (dots?.autoplay) dots.paused = true;\n }\n\n _renderSlide(award: SpotlightAward, i: number) {\n const current = i === this._slide;\n return html`\n <div\n class=\"slide\"\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label=\"${i + 1} of ${this.awards.length}\"\n ?inert=${!current}\n >\n ${award.logo\n ? html`<div class=\"logo\">\n <bd-img\n src=\"${award.logo}\"\n alt=\"${award.logoAlt || \"\"}\"\n width=\"${award.logoWidth ?? nothing}\"\n height=\"${award.logoHeight ?? nothing}\"\n fit=\"contain\"\n ></bd-img>\n </div>`\n : nothing}\n <div class=\"copy\">\n <bd-h as=\"${this.as}\" visual-level=\"h3\" color=\"primary\" class=\"title\"><span class=\"text\">${award.title}</span></bd-h>\n ${award.body ? html`<p class=\"body\">${award.body}</p>` : nothing}\n </div>\n </div>\n `;\n }\n\n render() {\n const count = this.awards.length;\n if (!count) return nothing;\n return html`\n <section class=\"bd-ensemble root\" aria-label=\"${this.label}\" aria-roledescription=\"carousel\">\n <div class=\"card\">\n <div\n class=\"viewport\"\n @mouseenter=${() => { this._hovered = true; }}\n @mouseleave=${() => { this._hovered = false; }}\n @focusin=${() => { this._focusWithin = true; }}\n @focusout=${(e: FocusEvent) => { this._focusWithin = (e.currentTarget as HTMLElement).contains(e.relatedTarget as Node | null); }}\n >\n <div class=\"track\" aria-live=${this._live}>\n ${this.awards.map((a, i) => this._renderSlide(a, i))}\n </div>\n </div>\n <bd-pagination-dots\n count=${count}\n current=${this._slide + 1}\n label=\"${this.label}\"\n item-label=\"Go to award\"\n ?autoplay=${this.autoplay && count > 1}\n delay=${this.autoplayDelay}\n ?held=${this._hovered || this._focusWithin}\n @bd-change=${(e: CustomEvent<{ current: number }>) => { this._slide = e.detail.current - 1; }}\n @bd-toggle=${(e: CustomEvent<{ moving: boolean }>) => { this._live = e.detail.moving ? \"off\" : \"polite\"; }}\n ></bd-pagination-dots>\n </div>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-awards-spotlight\": AwardsSpotlight;\n }\n}\n"],"mappings":"A,qjBA4CO,IAAME,EAAN,cAA8BC,CAAW,C,OAC9B,KAAA,OAAA,CAACC,EAAQC,EAAaC,CAAkB,C,CA2BxD,aAAc,CACZ,MAAM,EAzBmB,KAAA,OAAA,CAAC,EAEpB,KAAA,MAAA,yBAGS,KAAA,GAAA,KAEN,KAAA,SAAA,GAEK,KAAA,cAAA,IAEP,KAAA,OAAA,EAEE,KAAA,SAAA,GAEI,KAAA,aAAA,GAKD,KAAA,MAAA,SAMZ,KAA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","ScrollSlides","i","changed","index","dots","current","award","nothing","count","a","property","state","defineElement"],"sources":["../../../../src/components/awards/awards-spotlight.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/image/image.ts\";\nimport \"#components/pagination-dots/pagination-dots.ts\";\nimport { awardsSpotlightCSS } from \"./awards-spotlight.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport { ScrollSlides } from \"./scroll-slides.ts\";\n\ntype HeadingTag = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\ntype Live = \"off\" | \"polite\";\n\ninterface SpotlightAward {\n logo? : string;\n logoAlt? : string;\n logoWidth? : number;\n logoHeight?: number;\n title : string;\n body? : string;\n}\n\n/**\n * The homepage awards carousel: one award a slide, on a card. Each slide is\n * the award's mark, a title and a paragraph that says what the award is for;\n * the dots sit inside the card, under the slides. Drawn in the foundation\n * Figma file as Awards spotlight (desktop, tablet and mobile) and Award logo.\n *\n * Not bd-awards-flex. That one pages small quote cards, three a slide, under a\n * laurel and a headline of its own; this one gives each award room to say why\n * it was won, and leaves the section heading to the page around it.\n *\n * The slides are as tall as the tallest one -- the track stretches them -- so\n * the dots stay put from slide to slide and the section does not jump. They\n * sit in a scroll-snap scroller, so a swipe, a trackpad or a wheel moves them\n * and the dots follow (scroll-slides.ts).\n *\n * Autoplay is bd-pagination-dots': the progress in the current pill is the\n * clock. The pointer or focus on the slides holds it, a visitor picking a dot\n * or swiping to another slide stops it for good, and under\n * prefers-reduced-motion it never starts.\n */\n@defineElement(\"bd-awards-spotlight\")\nexport class AwardsSpotlight extends LitElement {\n static styles = [ensembleCSS, awardsSpotlightCSS];\n\n @property({ type: Array })\n awards: SpotlightAward[] = [];\n @property({ type: String })\n label = \"Awards and recognition\";\n // The page's section heading is the h2 above this; each award is under it.\n @property({ type: String })\n as: HeadingTag = \"h3\";\n @property({ type: Boolean })\n autoplay = false;\n @property({ type: Number, attribute: \"autoplay-delay\" })\n autoplayDelay = 6000;\n @state()\n _slide = 0;\n @state()\n _hovered = false;\n @state()\n _focusWithin = false;\n /* Off while the slides change on their own, so a screen reader is not\n read a new award every few seconds; polite once they are still, so a\n change the visitor asks for is announced. The dots say which. */\n @state()\n _live: Live = \"polite\";\n\n _slides: ScrollSlides;\n\n constructor() {\n super();\n this._slides = new ScrollSlides(this, { scroller: \".viewport\", onSlide: i => this._onScrolled(i) });\n }\n\n updated(changed: PropertyValues<this>) {\n // a shorter list must not leave the carousel on a slide that is gone\n if (changed.has(\"awards\") && this._slide >= this.awards.length) this._slide = 0;\n // a dot or the clock chose a slide: bring it in\n if (changed.has(\"_slide\")) this._slides.go(this._slide);\n }\n\n /* A visitor scrolled to another slide. That is a choice of slide, as a dot\n is, so it stops autoplay for good the way a dot does. */\n _onScrolled(index: number) {\n if (index === this._slide) return;\n this._slide = index;\n const dots = this.renderRoot.querySelector(\"bd-pagination-dots\");\n if (dots?.autoplay) dots.paused = true;\n }\n\n _renderSlide(award: SpotlightAward, i: number) {\n const current = i === this._slide;\n return html`\n <div\n class=\"slide\"\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label=\"${i + 1} of ${this.awards.length}\"\n ?inert=${!current}\n >\n ${award.logo\n ? html`<div class=\"logo\">\n <bd-img\n src=\"${award.logo}\"\n alt=\"${award.logoAlt || \"\"}\"\n width=\"${award.logoWidth ?? nothing}\"\n height=\"${award.logoHeight ?? nothing}\"\n fit=\"contain\"\n ></bd-img>\n </div>`\n : nothing}\n <div class=\"copy\">\n <bd-h as=\"${this.as}\" visual-level=\"h3\" color=\"primary\" class=\"title\"><span class=\"text\">${award.title}</span></bd-h>\n ${award.body ? html`<p class=\"body\">${award.body}</p>` : nothing}\n </div>\n </div>\n `;\n }\n\n render() {\n const count = this.awards.length;\n if (!count) return nothing;\n return html`\n <section class=\"bd-ensemble root\" aria-label=\"${this.label}\" aria-roledescription=\"carousel\">\n <div class=\"card\">\n <div\n class=\"viewport\"\n @mouseenter=${() => { this._hovered = true; }}\n @mouseleave=${() => { this._hovered = false; }}\n @focusin=${() => { this._focusWithin = true; }}\n @focusout=${(e: FocusEvent) => { this._focusWithin = (e.currentTarget as HTMLElement).contains(e.relatedTarget as Node | null); }}\n >\n <div class=\"track\" aria-live=${this._live}>\n ${this.awards.map((a, i) => this._renderSlide(a, i))}\n </div>\n </div>\n <bd-pagination-dots\n count=${count}\n current=${this._slide + 1}\n label=\"${this.label}\"\n item-label=\"Go to award\"\n ?autoplay=${this.autoplay && count > 1}\n delay=${this.autoplayDelay}\n ?held=${this._hovered || this._focusWithin}\n @bd-change=${(e: CustomEvent<{ current: number }>) => { this._slide = e.detail.current - 1; }}\n @bd-toggle=${(e: CustomEvent<{ moving: boolean }>) => { this._live = e.detail.moving ? \"off\" : \"polite\"; }}\n ></bd-pagination-dots>\n </div>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-awards-spotlight\": AwardsSpotlight;\n }\n}\n"],"mappings":"A,oiBA6CO,IAAME,EAAN,cAA8BC,CAAW,C,OAC9B,KAAA,OAAA,CAACC,EAAaC,CAAkB,C,CA2BhD,aAAc,CACZ,MAAM,EAzBmB,KAAA,OAAA,CAAC,EAEpB,KAAA,MAAA,yBAGS,KAAA,GAAA,KAEN,KAAA,SAAA,GAEK,KAAA,cAAA,IAEP,KAAA,OAAA,EAEE,KAAA,SAAA,GAEI,KAAA,aAAA,GAKD,KAAA,MAAA,SAMZ,KAAK,QAAU,IAAIC,EAAa,KAAM,CAAE,SAAU,YAAa,QAAS,GAAK,KAAK,YAAYC,CAAC,CAAE,CAAC,CACpG,CAEA,QAAQ,EAA+B,CAEjCC,EAAQ,IAAI,QAAQ,GAAK,KAAK,QAAU,KAAK,OAAO,SAAQ,KAAK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G,EAAE;yBAChF,GAAwC,CAAE,KAAK,MAAQ,EAAE,OAAO,OAAS,MAAQ,QAAU,EAAE;;;;MAxBhGD,CA6BrB,CACF,EA3GGb,EAAA,CAAAgB,EAAS,CAAE,KAAM,KAAM,CAAC,CAAA,EAAAd,EAAA,UAAA,SAAA,IAAA,EAAA,EAExBF,EAAA,CAAAgB,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAd,EAAA,UAAA,QAAA,IAAA,EAAA,EAGzBF,EAAA,CAAAgB,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAd,EAAA,UAAA,KAAA,IAAA,EAAA,EAEzBF,EAAA,CAAAgB,EAAS,CAAE,KAAM,OAAQ,CAAC,CAAA,EAAAd,EAAA,UAAA,WAAA,IAAA,EAAA,EAE1BF,EAAA,CAAAgB,EAAS,CAAE,KAAM,OAAQ,UAAW,gBAAiB,CAAC,CAAA,EAAAd,EAAA,UAAA,gBAAA,IAAA,EAAA,EAEtDF,EAAA,CAAAiB,EAAM,CAAA,EAAAf,EAAA,UAAA,SAAA,IAAA,EAAA,EAENF,EAAA,CAAAiB,EAAM,CAAA,EAAAf,EAAA,UAAA,WAAA,IAAA,EAAA,EAENF,EAAA,CAAAiB,EAAM,CAAA,EAAAf,EAAA,UAAA,eAAA,IAAA,EAAA,EAKNF,EAAA,CAAAiB,EAAM,CAAA,EAAAf,EAAA,UAAA,QAAA,IAAA,EAAA,EAxBR,EAAAF,EAAA,CAAAkB,EAAc,qBAAqB,CAAA,EAAAhB,CAAA,E"}
@@ -69,7 +69,7 @@ export declare class AwardsSection extends LitElement {
69
69
  * a `gap: 0` override. Omitting the element removes both the phantom gap and
70
70
  * the reason for the override.
71
71
  */
72
- _renderLower(): TemplateResult<1> | typeof nothing;
72
+ _renderLower(): typeof nothing | TemplateResult<1>;
73
73
  }
74
74
  declare global {
75
75
  interface HTMLElementTagNameMap {
@@ -1,4 +1,5 @@
1
1
  import { LitElement, type PropertyValues } from "lit";
2
+ import "../../tokens/tokens.js";
2
3
  import "../heading/heading.js";
3
4
  import "../paragraph/paragraph.js";
4
5
  import "./bento-item.js";
@@ -1,30 +1,30 @@
1
- import{defineElement as e}from"../shared/define-element.js";import{tokens as t}from"../../tokens/tokens.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import"../paragraph/paragraph.js";import{ensembleCSS as r}from"../shared/ensemble.css.js";import i,{BENTO_DEFAULTS as a,bentoColumnRules as o}from"./bento-grid.css.js";import"./bento-item.js";import{LitElement as s,html as c,nothing as l}from"lit";import{property as u}from"lit/decorators.js";var d=/* @__PURE__ */ new Map,f=e=>{let t=JSON.stringify(e);if(!d.has(t)){let n=new CSSStyleSheet;n.replaceSync(o(e)),d.set(t,n)}return d.get(t)},p=class extends s{constructor(...e){super(...e),this.eyebrow=``,this.title=``,this.description=``,this.maxColumns=2,this.minCardWidth=260,this.wideShare=.7,this.variant=`weighted`,this.equalColumns=3,this.background=`none`}static{this.styles=[t,r,i]}updated(e){e.has(`wideShare`)&&this._applyWeights(),[`maxColumns`,`equalColumns`,`minCardWidth`].some(t=>e.has(t))&&this._adoptColumnRules()}get _items(){return[...this.children].filter(e=>e.tagName===`BD-BENTO-ITEM`)}_applyWeights(){let e=this._items,t=0,n=0,r=Math.round(this.wideShare*24),i=24-r;for(;t<e.length;){let a=e[t];if(a.getAttribute(`priority`)===`featured`){a.style.setProperty(`--bd-bento-span`,`24`),t+=1;continue}let o=e[t+1],s=o&&o.getAttribute(`priority`)===`featured`;if(!o||s){a.style.setProperty(`--bd-bento-span`,`24`),t+=1;continue}let c=n%3==0;a.style.setProperty(`--bd-bento-span`,String(c?r:i)),o.style.setProperty(`--bd-bento-span`,String(c?i:r)),t+=2,n+=1}}get _isBrandSet(){let e=this._items;return e.length>1&&e.every(e=>e.getAttribute(`tone`)===`brand`)}_applyRowHeight(){this._isBrandSet?this.style.setProperty(`--bd-bento-row-height`,`1fr`):this.style.removeProperty(`--bd-bento-row-height`)}_adoptColumnRules(){let e={maxColumns:Math.min(2,this.maxColumns),equalColumns:Math.max(1,this.equalColumns),minCardWidth:this.minCardWidth},t=Object.keys(e).every(t=>e[t]===a[t]),n=this.renderRoot,r=n.adoptedStyleSheets.filter(e=>![...d.values()].includes(e));n.adoptedStyleSheets=t?r:[...r,f(e)]}_onSlotChange(){this._applyRowHeight(),this._applyWeights()}render(){return c`
1
+ import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../heading/heading.js";import"../paragraph/paragraph.js";import{ensembleCSS as n}from"../shared/ensemble.css.js";import r,{BENTO_DEFAULTS as i,bentoColumnRules as a}from"./bento-grid.css.js";import"./bento-item.js";import{LitElement as o,html as s,nothing as c}from"lit";import{property as l}from"lit/decorators.js";var u=/* @__PURE__ */ new Map,d=e=>{let t=JSON.stringify(e);if(!u.has(t)){let n=new CSSStyleSheet;n.replaceSync(a(e)),u.set(t,n)}return u.get(t)},f=class extends o{constructor(...e){super(...e),this.eyebrow=``,this.title=``,this.description=``,this.maxColumns=2,this.minCardWidth=260,this.wideShare=.7,this.variant=`weighted`,this.equalColumns=3,this.background=`none`}static{this.styles=[n,r]}updated(e){e.has(`wideShare`)&&this._applyWeights(),[`maxColumns`,`equalColumns`,`minCardWidth`].some(t=>e.has(t))&&this._adoptColumnRules()}get _items(){return[...this.children].filter(e=>e.tagName===`BD-BENTO-ITEM`)}_applyWeights(){let e=this._items,t=0,n=0,r=Math.round(this.wideShare*24),i=24-r;for(;t<e.length;){let a=e[t];if(a.getAttribute(`priority`)===`featured`){a.style.setProperty(`--bd-bento-span`,`24`),t+=1;continue}let o=e[t+1],s=o&&o.getAttribute(`priority`)===`featured`;if(!o||s){a.style.setProperty(`--bd-bento-span`,`24`),t+=1;continue}let c=n%3==0;a.style.setProperty(`--bd-bento-span`,String(c?r:i)),o.style.setProperty(`--bd-bento-span`,String(c?i:r)),t+=2,n+=1}}get _isBrandSet(){let e=this._items;return e.length>1&&e.every(e=>e.getAttribute(`tone`)===`brand`)}_applyRowHeight(){this._isBrandSet?this.style.setProperty(`--bd-bento-row-height`,`1fr`):this.style.removeProperty(`--bd-bento-row-height`)}_adoptColumnRules(){let e={maxColumns:Math.min(2,this.maxColumns),equalColumns:Math.max(1,this.equalColumns),minCardWidth:this.minCardWidth},t=Object.keys(e).every(t=>e[t]===i[t]),n=this.renderRoot,r=n.adoptedStyleSheets.filter(e=>![...u.values()].includes(e));n.adoptedStyleSheets=t?r:[...r,d(e)]}_onSlotChange(){this._applyRowHeight(),this._applyWeights()}render(){return s`
2
2
  <div class="bd-ensemble">
3
- ${this.eyebrow||this.title||this.description?c`
3
+ ${this.eyebrow||this.title||this.description?s`
4
4
  <div class="bd-bentogrid-header">
5
- ${this.eyebrow?c`
5
+ ${this.eyebrow?s`
6
6
  <bd-p variant="eyebrow" class="bd-bentogrid-eyebrow">
7
7
  <slot name="eyebrow">${this.eyebrow}</slot>
8
8
  </bd-p>
9
- `:l}
9
+ `:c}
10
10
 
11
- ${this.title?c`
11
+ ${this.title?s`
12
12
  <bd-h as="h2" class="bd-bentogrid-title">
13
13
  <slot name="title">${this.title}</slot>
14
14
  </bd-h>
15
- `:l}
15
+ `:c}
16
16
 
17
- ${this.description?c`
17
+ ${this.description?s`
18
18
  <bd-p variant="regular" class="bd-bentogrid-description">
19
19
  <slot name="description">${this.description}</slot>
20
20
  </bd-p>
21
- `:l}
21
+ `:c}
22
22
  </div>
23
- `:l}
23
+ `:c}
24
24
 
25
25
  <div class="bd-bentogrid-track" role="list">
26
26
  <slot @slotchange=${this._onSlotChange}></slot>
27
27
  </div>
28
28
  </div>
29
- `}};n([u({type:String})],p.prototype,`eyebrow`,void 0),n([u({type:String})],p.prototype,`title`,void 0),n([u({type:String})],p.prototype,`description`,void 0),n([u({type:Number,attribute:`max-columns`})],p.prototype,`maxColumns`,void 0),n([u({type:Number,attribute:`min-card-width`})],p.prototype,`minCardWidth`,void 0),n([u({type:Number,attribute:`wide-share`})],p.prototype,`wideShare`,void 0),n([u({type:String,reflect:!0})],p.prototype,`variant`,void 0),n([u({type:Number,attribute:`equal-columns`})],p.prototype,`equalColumns`,void 0),n([u({type:String,reflect:!0})],p.prototype,`background`,void 0),p=n([e(`bd-bento-grid`)],p);
29
+ `}};t([l({type:String})],f.prototype,`eyebrow`,void 0),t([l({type:String})],f.prototype,`title`,void 0),t([l({type:String})],f.prototype,`description`,void 0),t([l({type:Number,attribute:`max-columns`})],f.prototype,`maxColumns`,void 0),t([l({type:Number,attribute:`min-card-width`})],f.prototype,`minCardWidth`,void 0),t([l({type:Number,attribute:`wide-share`})],f.prototype,`wideShare`,void 0),t([l({type:String,reflect:!0})],f.prototype,`variant`,void 0),t([l({type:Number,attribute:`equal-columns`})],f.prototype,`equalColumns`,void 0),t([l({type:String,reflect:!0})],f.prototype,`background`,void 0),f=t([e(`bd-bento-grid`)],f);
30
30
  //# sourceMappingURL=bento-grid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bento-grid.js","names":["bentoGridCSS","_decorate","__decorate","bento_grid_css_default","columnSheets","columnSheetFor","key","options","sheet","bentoColumnRules","BentoGrid","LitElement","_args","tokens","ensembleCSS","changed","name","el","items","i","pairIndex","wideSpan","narrowSpan","current","next","nextIsFeatured","firstIsWide","isDefault","BENTO_DEFAULTS","root","sheets","nothing","property","defineElement"],"sources":["../../../../src/components/bento-grid/bento-grid.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { tokens } from \"#tokens/tokens.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport bentoGridCSS, { BENTO_DEFAULTS, TOTAL_UNITS, bentoColumnRules, type BentoColumnOptions } from \"./bento-grid.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport \"./bento-item.ts\";\n\n/* One sheet per set of numbers, shared by every grid that asks for it. */\nconst columnSheets = new Map<string, CSSStyleSheet>();\nconst columnSheetFor = (options: BentoColumnOptions) => {\n const key = JSON.stringify(options);\n if (!columnSheets.has(key)) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(bentoColumnRules(options));\n columnSheets.set(key, sheet);\n }\n return columnSheets.get(key)!;\n};\n\ntype Variant = \"weighted\" | \"equal\";\ntype Background = \"none\" | \"tint\";\n\n@defineElement(\"bd-bento-grid\")\nclass BentoGrid extends LitElement {\n static styles = [tokens, ensembleCSS, bentoGridCSS];\n\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n title = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: Number, attribute: \"max-columns\" })\n maxColumns = 2;\n @property({ type: Number, attribute: \"min-card-width\" })\n minCardWidth = 260;\n // Fixed wide/narrow ratio applied to every pair, e.g. 0.7 = 70/30.\n // Only used when variant=\"weighted\" (the default).\n @property({ type: Number, attribute: \"wide-share\" })\n wideShare = 0.7;\n // \"weighted\" (default) — pairs of cards alternate wide/narrow, per\n // _applyWeights below. \"equal\" — every card gets the same width, laid\n // out in a plain N-column grid (see equalColumns) with no pairing.\n @property({ type: String, reflect: true })\n variant: Variant = \"weighted\";\n // Column count for variant=\"equal\" once the grid is md wide; min(2, this)\n // from sm, and 1 below -- the grid's own width, not the viewport's, the\n // same steps as the weighted pairs. Ignored when variant=\"weighted\".\n @property({ type: Number, attribute: \"equal-columns\" })\n equalColumns = 3;\n // \"none\" (default, transparent) | \"tint\" (light blue wash behind the\n // whole grid, including header text) — a section-level background, not\n // per-card (bd-bento-item already has its own `tone=\"tint\"` for that).\n @property({ type: String, reflect: true })\n background: Background = \"none\";\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"wideShare\")) this._applyWeights();\n if (([\"maxColumns\", \"equalColumns\", \"minCardWidth\"] as const).some((name) => changed.has(name))) {\n this._adoptColumnRules();\n }\n }\n\n get _items() {\n return [...this.children].filter((el): el is HTMLElement => el.tagName === \"BD-BENTO-ITEM\");\n }\n\n // Assigns each item a `grid-column: span N` out of TOTAL_UNITS invisible\n // grid columns, instead of a flex-basis percentage. CSS Grid subtracts\n // `gap` from the available track space BEFORE distributing column widths,\n // so two items whose spans sum to TOTAL_UNITS always fit on the same row\n // with the gap properly accounted for.\n //\n // Rows are formed by walking items in DOM order and consuming exactly 2\n // \"slots\" per row UNLESS an item is priority=\"featured\", in which case it\n // consumes the whole row by itself (span = TOTAL_UNITS) and does not pair\n // with anything.\n //\n // Within a pair, the wide/narrow side follows a repeating 3-pair cycle,\n // NOT content length: pair 0 (rows 1-2) is wide-then-narrow, pairs 1 and 2\n // (rows 3-4, 5-6) are narrow-then-wide, then the cycle repeats.\n _applyWeights() {\n const items = this._items;\n let i = 0;\n let pairIndex = 0; // counts pairs only (featured/solo rows don't affect the pattern)\n\n const wideSpan = Math.round(this.wideShare * TOTAL_UNITS);\n const narrowSpan = TOTAL_UNITS - wideSpan;\n\n while (i < items.length) {\n const current = items[i];\n\n if (current.getAttribute(\"priority\") === \"featured\") {\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const next = items[i + 1];\n const nextIsFeatured = next && next.getAttribute(\"priority\") === \"featured\";\n\n if (!next || nextIsFeatured) {\n // odd one out (last item, or blocked by a featured item next) — full width\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const firstIsWide = pairIndex % 3 === 0;\n\n current.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? wideSpan : narrowSpan));\n next.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? narrowSpan : wideSpan));\n\n i += 2;\n pairIndex += 1;\n }\n }\n\n /* Brand cards are drawn as one set of equal bands: the full-row card is\n the pair's height, not shorter for having a wider copy column, and\n stacked cards match whatever their copy runs to. Only when every card is\n brand-toned -- the default cards are content-sized tiles, and evening\n those out would pad the short ones with empty space. */\n get _isBrandSet() {\n const items = this._items;\n return items.length > 1 && items.every((el) => el.getAttribute(\"tone\") === \"brand\");\n }\n\n _applyRowHeight() {\n if (this._isBrandSet) this.style.setProperty(\"--bd-bento-row-height\", \"1fr\");\n else this.style.removeProperty(\"--bd-bento-row-height\");\n }\n\n /* The column steps for the default numbers are in bento-grid.css.ts. A\n grid that changes one adopts the same rules computed from its own, after\n the defaults, and drops them again when it changes back. */\n _adoptColumnRules() {\n const options: BentoColumnOptions = {\n maxColumns : Math.min(2, this.maxColumns),\n equalColumns: Math.max(1, this.equalColumns),\n minCardWidth: this.minCardWidth\n };\n const isDefault = (Object.keys(options) as (keyof BentoColumnOptions)[]).every((name) => options[name] === BENTO_DEFAULTS[name]);\n const root = this.renderRoot as ShadowRoot;\n const sheets = root.adoptedStyleSheets.filter((sheet) => ![...columnSheets.values()].includes(sheet));\n root.adoptedStyleSheets = isDefault ? sheets : [...sheets, columnSheetFor(options)];\n }\n\n /* Spans and row heights follow the cards and their order, never the width,\n so they are set when the cards change. */\n _onSlotChange() {\n this._applyRowHeight();\n this._applyWeights();\n }\n\n render() {\n return html`\n <div class=\"bd-ensemble\">\n ${this.eyebrow || this.title || this.description\n ? html`\n <div class=\"bd-bentogrid-header\">\n ${this.eyebrow\n ? html`\n <bd-p variant=\"eyebrow\" class=\"bd-bentogrid-eyebrow\">\n <slot name=\"eyebrow\">${this.eyebrow}</slot>\n </bd-p>\n `\n : nothing}\n\n ${this.title\n ? html`\n <bd-h as=\"h2\" class=\"bd-bentogrid-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n `\n : nothing}\n\n ${this.description\n ? html`\n <bd-p variant=\"regular\" class=\"bd-bentogrid-description\">\n <slot name=\"description\">${this.description}</slot>\n </bd-p>\n `\n : nothing}\n </div>\n `\n : nothing}\n\n <div class=\"bd-bentogrid-track\" role=\"list\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-bento-grid\": BentoGrid;\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ules","BentoGrid","LitElement","_args","ensembleCSS","changed","name","el","items","i","pairIndex","wideSpan","narrowSpan","current","next","nextIsFeatured","firstIsWide","isDefault","BENTO_DEFAULTS","root","sheets","nothing","property","defineElement"],"sources":["../../../../src/components/bento-grid/bento-grid.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { defineElement } from \"#shared/define-element.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport bentoGridCSS, { BENTO_DEFAULTS, TOTAL_UNITS, bentoColumnRules, type BentoColumnOptions } from \"./bento-grid.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport \"./bento-item.ts\";\n\n/* One sheet per set of numbers, shared by every grid that asks for it. */\nconst columnSheets = new Map<string, CSSStyleSheet>();\nconst columnSheetFor = (options: BentoColumnOptions) => {\n const key = JSON.stringify(options);\n if (!columnSheets.has(key)) {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(bentoColumnRules(options));\n columnSheets.set(key, sheet);\n }\n return columnSheets.get(key)!;\n};\n\ntype Variant = \"weighted\" | \"equal\";\ntype Background = \"none\" | \"tint\";\n\n@defineElement(\"bd-bento-grid\")\nclass BentoGrid extends LitElement {\n static styles = [ensembleCSS, bentoGridCSS];\n\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n title = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: Number, attribute: \"max-columns\" })\n maxColumns = 2;\n @property({ type: Number, attribute: \"min-card-width\" })\n minCardWidth = 260;\n // Fixed wide/narrow ratio applied to every pair, e.g. 0.7 = 70/30.\n // Only used when variant=\"weighted\" (the default).\n @property({ type: Number, attribute: \"wide-share\" })\n wideShare = 0.7;\n // \"weighted\" (default) — pairs of cards alternate wide/narrow, per\n // _applyWeights below. \"equal\" — every card gets the same width, laid\n // out in a plain N-column grid (see equalColumns) with no pairing.\n @property({ type: String, reflect: true })\n variant: Variant = \"weighted\";\n // Column count for variant=\"equal\" once the grid is md wide; min(2, this)\n // from sm, and 1 below -- the grid's own width, not the viewport's, the\n // same steps as the weighted pairs. Ignored when variant=\"weighted\".\n @property({ type: Number, attribute: \"equal-columns\" })\n equalColumns = 3;\n // \"none\" (default, transparent) | \"tint\" (light blue wash behind the\n // whole grid, including header text) — a section-level background, not\n // per-card (bd-bento-item already has its own `tone=\"tint\"` for that).\n @property({ type: String, reflect: true })\n background: Background = \"none\";\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"wideShare\")) this._applyWeights();\n if (([\"maxColumns\", \"equalColumns\", \"minCardWidth\"] as const).some((name) => changed.has(name))) {\n this._adoptColumnRules();\n }\n }\n\n get _items() {\n return [...this.children].filter((el): el is HTMLElement => el.tagName === \"BD-BENTO-ITEM\");\n }\n\n // Assigns each item a `grid-column: span N` out of TOTAL_UNITS invisible\n // grid columns, instead of a flex-basis percentage. CSS Grid subtracts\n // `gap` from the available track space BEFORE distributing column widths,\n // so two items whose spans sum to TOTAL_UNITS always fit on the same row\n // with the gap properly accounted for.\n //\n // Rows are formed by walking items in DOM order and consuming exactly 2\n // \"slots\" per row UNLESS an item is priority=\"featured\", in which case it\n // consumes the whole row by itself (span = TOTAL_UNITS) and does not pair\n // with anything.\n //\n // Within a pair, the wide/narrow side follows a repeating 3-pair cycle,\n // NOT content length: pair 0 (rows 1-2) is wide-then-narrow, pairs 1 and 2\n // (rows 3-4, 5-6) are narrow-then-wide, then the cycle repeats.\n _applyWeights() {\n const items = this._items;\n let i = 0;\n let pairIndex = 0; // counts pairs only (featured/solo rows don't affect the pattern)\n\n const wideSpan = Math.round(this.wideShare * TOTAL_UNITS);\n const narrowSpan = TOTAL_UNITS - wideSpan;\n\n while (i < items.length) {\n const current = items[i];\n\n if (current.getAttribute(\"priority\") === \"featured\") {\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const next = items[i + 1];\n const nextIsFeatured = next && next.getAttribute(\"priority\") === \"featured\";\n\n if (!next || nextIsFeatured) {\n // odd one out (last item, or blocked by a featured item next) — full width\n current.style.setProperty(\"--bd-bento-span\", String(TOTAL_UNITS));\n i += 1;\n continue;\n }\n\n const firstIsWide = pairIndex % 3 === 0;\n\n current.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? wideSpan : narrowSpan));\n next.style.setProperty(\"--bd-bento-span\", String(firstIsWide ? narrowSpan : wideSpan));\n\n i += 2;\n pairIndex += 1;\n }\n }\n\n /* Brand cards are drawn as one set of equal bands: the full-row card is\n the pair's height, not shorter for having a wider copy column, and\n stacked cards match whatever their copy runs to. Only when every card is\n brand-toned -- the default cards are content-sized tiles, and evening\n those out would pad the short ones with empty space. */\n get _isBrandSet() {\n const items = this._items;\n return items.length > 1 && items.every((el) => el.getAttribute(\"tone\") === \"brand\");\n }\n\n _applyRowHeight() {\n if (this._isBrandSet) this.style.setProperty(\"--bd-bento-row-height\", \"1fr\");\n else this.style.removeProperty(\"--bd-bento-row-height\");\n }\n\n /* The column steps for the default numbers are in bento-grid.css.ts. A\n grid that changes one adopts the same rules computed from its own, after\n the defaults, and drops them again when it changes back. */\n _adoptColumnRules() {\n const options: BentoColumnOptions = {\n maxColumns : Math.min(2, this.maxColumns),\n equalColumns: Math.max(1, this.equalColumns),\n minCardWidth: this.minCardWidth\n };\n const isDefault = (Object.keys(options) as (keyof BentoColumnOptions)[]).every((name) => options[name] === BENTO_DEFAULTS[name]);\n const root = this.renderRoot as ShadowRoot;\n const sheets = root.adoptedStyleSheets.filter((sheet) => ![...columnSheets.values()].includes(sheet));\n root.adoptedStyleSheets = isDefault ? sheets : [...sheets, columnSheetFor(options)];\n }\n\n /* Spans and row heights follow the cards and their order, never the width,\n so they are set when the cards change. */\n _onSlotChange() {\n this._applyRowHeight();\n this._applyWeights();\n }\n\n render() {\n return html`\n <div class=\"bd-ensemble\">\n ${this.eyebrow || this.title || this.description\n ? html`\n <div class=\"bd-bentogrid-header\">\n ${this.eyebrow\n ? html`\n <bd-p variant=\"eyebrow\" class=\"bd-bentogrid-eyebrow\">\n <slot name=\"eyebrow\">${this.eyebrow}</slot>\n </bd-p>\n `\n : nothing}\n\n ${this.title\n ? html`\n <bd-h as=\"h2\" class=\"bd-bentogrid-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n `\n : nothing}\n\n ${this.description\n ? html`\n <bd-p variant=\"regular\" class=\"bd-bentogrid-description\">\n <slot name=\"description\">${this.description}</slot>\n </bd-p>\n `\n : nothing}\n </div>\n `\n : nothing}\n\n <div class=\"bd-bentogrid-track\" role=\"list\">\n <slot @slotchange=${this._onSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-bento-grid\": BentoGrid;\n }\n}"],"mappings":"A,weAYA,IAAMI,kBAAe,IAAI,IACnBC,EAAkB,GAAgC,CACtD,IAAMC,EAAM,KAAK,UAAUC,CAAO,EAClC,GAAI,CAACH,EAAa,IAAIE,CAAG,EAAG,CAC1B,IAAME,EAAQ,IAAI,cAClBA,EAAM,YAAYC,EAAiBF,CAAO,CAAC,EAC3CH,EAAa,IAAIE,EAAKE,CAAK,CAC7B,CACA,OAAOJ,EAAa,IAAIE,CAAG,CAC7B,EAMMI,EADN,cACwBC,CAAW,C,8BAIvB,KAAA,QAAA,GAEF,KAAA,MAAA,GAEM,KAAA,YAAA,GAED,KAAA,WAAA,EAEE,KAAA,aAAA,IAIH,KAAA,UAAA,GAKO,KAAA,QAAA,WAKJ,KAAA,aAAA,EAKU,KAAA,WAAA,M,QA9BT,KAAA,OAAA,CAACE,EAAab,CAAY,C,CAgC1C,QAAQ,EAA+B,CACjCc,EAAQ,IAAI,WAAW,GAAG,KAAK,cAAc,EAC5C,CAAC,aAAc,eAAgB,cAAc,CAAC,CAAW,KAAM,GAASA,EAAQ,IAAIC,CAAI,CAAC,GAC5F,KAAK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A,UAAA,YAAA,IAAA,EAAA,EAKlDT,EAAA,CAAA8B,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAArB,EAAA,UAAA,UAAA,IAAA,EAAA,EAKxCT,EAAA,CAAA8B,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,CAAA,EAAArB,EAAA,UAAA,eAAA,IAAA,EAAA,EAKrDT,EAAA,CAAA8B,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAArB,EAAA,UAAA,aAAA,IAAA,EAAA,EA/B1C,EAAAT,EAAA,CAAA+B,EAAc,eAAe,CAAA,EAAAtB,CAAA"}
@@ -1,2 +1,2 @@
1
- import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{box-sizing:border-box;height:100%;display:block}:host([tone=brand]){width:100%;container:bento-item/inline-size}.bd-bentoitem-box{background:var(--color-surface-container);border-radius:var(--card-radius);padding:var(--card-padding);text-align:start;box-sizing:border-box;height:100%;font-family:var(--typography-fontFamily-sans);min-width:0;transition:transform var(--transition-duration-normal) var(--transition-easing-ease), box-shadow var(--transition-duration-normal) var(--transition-easing-ease);flex-direction:column;justify-content:flex-start;align-items:stretch;display:flex}@media (hover:hover){.bd-bentoitem-box:hover{box-shadow:0px 14px 40px color-mix(in srgb, var(--color-neutral-1000) 7%, transparent);transform:translateY(-3px)}}@media (prefers-reduced-motion:reduce){.bd-bentoitem-box{transition:none}.bd-bentoitem-box:hover{transform:none}}.bd-bentoitem-icon-wrap{justify-content:flex-start;align-items:flex-start;gap:var(--spacing-8);padding-bottom:var(--spacing-8);flex-direction:column;min-height:48px;display:flex}.bd-bentoitem-icon,::slotted([slot=icon]){object-fit:contain;width:48px;max-width:48px;height:48px;max-height:48px;display:block}.bd-bentoitem-title-wrap{align-items:flex-start;gap:var(--spacing-4);margin-bottom:var(--spacing-8);width:100%;display:flex;overflow:hidden}.bd-bentoitem-body{color:var(--color-text-secondary);width:100%;margin:0 0 1em}::slotted(bd-p){width:100%}:host([tone=tint]) .bd-bentoitem-box{background:var(--status-brand-surface)}:host([tone=dark]) .bd-bentoitem-box{background:linear-gradient(160deg, var(--color-surface-inverse) 0%, var(--color-brand-950) 130%)}:host([tone=dark]) .bd-bentoitem-title-wrap bd-h,:host([tone=dark]) .bd-bentoitem-body{color:var(--color-text-inverse)}@media (width<768px){.bd-bentoitem-box{padding:var(--card-padding-compact)}}:host([tone=brand]) .bd-bentoitem-box{gap:var(--spacing-24);padding:var(--spacing-24);background:var(--color-surface-brand);border-radius:var(--shape-radius-2xl);color:var(--color-brand-on-fill);flex-direction:column;display:flex;position:relative;overflow:hidden}@container bento-item (width<518px){:host([tone=brand]) .bd-bentoitem-cta{margin-block-start:auto}:host([tone=brand]) .bd-bentoitem-cta ::slotted(*){--bd-button-width:100%}}:host([tone=brand]) .bd-bentoitem-box:hover{box-shadow:none;transform:none}.bd-bentoitem-media{aspect-ratio:1;border-radius:var(--shape-radius-xl);position:relative;overflow:hidden;container-type:size}::slotted([slot=media]){object-fit:cover;width:100%;height:100%;display:block}::slotted(bd-motion-art[slot=media]){width:100cqh;height:auto;margin-block-start:-50cqh;margin-inline-start:-50cqh;position:absolute;inset-block-start:50%;inset-inline-start:50%}.bd-bentoitem-text{align-items:flex-start;gap:var(--spacing-12);flex-direction:column;display:flex}.bd-bentoitem-brand-title{margin:0}.bd-bentoitem-brand-body{font-family:var(--typography-body-regular-fontFamily);font-size:var(--typography-body-regular-fontSize);font-weight:var(--typography-body-regular-fontWeight);line-height:var(--typography-body-regular-lineHeight);letter-spacing:var(--typography-body-regular-letterSpacing);color:var(--color-brand-on-fill);margin:0}@container bento-item (width>=518px){:host([tone=brand]) .bd-bentoitem-box{padding:var(--spacing-32);border-radius:var(--shape-radius-3xl);grid-template:".media"1fr"text media""cta media"".media"1fr/300px minmax(0,1fr);gap:0;display:grid}:host([tone=brand][priority=featured]) .bd-bentoitem-box{grid-template-columns:42% minmax(0,1fr)}.bd-bentoitem-text{grid-area:text}.bd-bentoitem-cta{grid-area:cta;margin-block-start:var(--spacing-24)}.bd-bentoitem-media{aspect-ratio:auto;border-radius:var(--radius-none);margin-block:calc(-1 * var(--spacing-32));grid-area:media;margin-inline-end:calc(-1 * var(--spacing-32))}::slotted(bd-motion-art[slot=media]){width:max(100cqw,100cqh);margin-block-start:calc(max(100cqw,100cqh)/-2);margin-inline-start:0;inset-inline-start:0}}@container bento-item (656px<=width<880px){::slotted(bd-motion-art[slot=media]){width:max(100cqw,135cqh);margin-block-start:calc(max(100cqw,135cqh)/-2)}}.text,.bd-bentoitem-brand-body{white-space:pre-line}`;export{t as default};
1
+ import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{box-sizing:border-box;height:100%;display:block}:host([tone=brand]){width:100%;container:bento-item/inline-size}.bd-bentoitem-box{background:var(--color-surface-container);border-radius:var(--card-radius);padding:var(--card-padding);text-align:start;box-sizing:border-box;height:100%;font-family:var(--typography-fontFamily-sans);min-width:0;transition:transform var(--transition-duration-normal) var(--transition-easing-ease), box-shadow var(--transition-duration-normal) var(--transition-easing-ease);flex-direction:column;justify-content:flex-start;align-items:stretch;display:flex}@media (hover:hover){.bd-bentoitem-box:hover{box-shadow:0px 14px 40px color-mix(in srgb, var(--color-neutral-1000) 7%, transparent);transform:translateY(-3px)}}@media (prefers-reduced-motion:reduce){.bd-bentoitem-box{transition:none}.bd-bentoitem-box:hover{transform:none}}.bd-bentoitem-icon-wrap{justify-content:flex-start;align-items:flex-start;gap:var(--spacing-8);padding-bottom:var(--spacing-8);flex-direction:column;min-height:48px;display:flex}.bd-bentoitem-icon,::slotted([slot=icon]){object-fit:contain;width:48px;max-width:48px;height:48px;max-height:48px;display:block}.bd-bentoitem-title-wrap{align-items:flex-start;gap:var(--spacing-4);margin-bottom:var(--spacing-8);width:100%;display:flex;overflow:hidden}.bd-bentoitem-body{color:var(--color-text-secondary);width:100%;margin:0 0 1em}::slotted(bd-p){width:100%}:host([tone=tint]) .bd-bentoitem-box{background:var(--status-brand-surface)}:host([tone=dark]) .bd-bentoitem-box{background:linear-gradient(160deg, var(--color-surface-inverse) 0%, var(--color-brand-950) 130%)}:host([tone=dark]) .bd-bentoitem-title-wrap bd-h,:host([tone=dark]) .bd-bentoitem-body{color:var(--color-text-inverse)}@media (width<768px){.bd-bentoitem-box{padding:var(--card-padding-compact)}}:host([tone=brand]) .bd-bentoitem-box{gap:var(--spacing-24);padding:var(--spacing-24);background:var(--color-surface-brand);border-radius:var(--shape-radius-2xl);color:var(--color-brand-on-fill);flex-direction:column;display:flex;position:relative;overflow:hidden}@container bento-item (width<518px){:host([tone=brand]) .bd-bentoitem-cta{margin-block-start:auto}:host([tone=brand]) .bd-bentoitem-cta ::slotted(*){--bd-button-width:100%}}:host([tone=brand]) .bd-bentoitem-box:hover{box-shadow:none;transform:none}.bd-bentoitem-media{aspect-ratio:1;border-radius:var(--shape-radius-xl);position:relative;overflow:hidden;container-type:size}::slotted([slot=media]){object-fit:cover;width:100%;height:100%;display:block}::slotted(bd-motion-art[slot=media]){width:100cqh;height:auto;margin-block-start:-50cqh;margin-inline-start:-50cqh;position:absolute;inset-block-start:50%;inset-inline-start:50%}.bd-bentoitem-text{align-items:flex-start;gap:var(--spacing-12);flex-direction:column;display:flex}.bd-bentoitem-brand-title{margin:0}.bd-bentoitem-brand-body{font-family:var(--typography-body-regular-fontFamily);font-size:var(--typography-body-regular-fontSize);font-weight:var(--typography-body-regular-fontWeight);line-height:var(--typography-body-regular-lineHeight);letter-spacing:var(--typography-body-regular-letterSpacing);color:var(--color-brand-on-fill);margin:0}@container bento-item (width>=518px){:host([tone=brand]) .bd-bentoitem-box{padding:var(--spacing-32);border-radius:var(--shape-radius-3xl);grid-template:".media"1fr"text media""cta media"".media"1fr/300px minmax(0,1fr);gap:0;display:grid}:host([tone=brand][priority=featured]) .bd-bentoitem-box{grid-template-columns:42% minmax(0,1fr)}.bd-bentoitem-text{grid-area:text}.bd-bentoitem-cta{grid-area:cta;margin-block-start:var(--spacing-24)}.bd-bentoitem-media{aspect-ratio:auto;border-radius:var(--radius-none);margin-block:calc(-1 * var(--spacing-32));grid-area:media;margin-inline-end:calc(-1 * var(--spacing-32))}::slotted(bd-motion-art[slot=media]){--bd-bento-art:max(100cqw, min(100cqh, 24.5rem));width:var(--bd-bento-art);margin-block-start:calc(var(--bd-bento-art) / -2);margin-inline-start:0;inset-inline-start:0}}@container bento-item (656px<=width<880px){::slotted(bd-motion-art[slot=media]){--bd-bento-art:max(100cqw, min(135cqh, 36rem))}}.text,.bd-bentoitem-brand-body{white-space:pre-line}`;export{t as default};
2
2
  //# sourceMappingURL=bento-item.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bento-item.css.js","names":["bento_item_css_default"],"sources":["../../../../src/components/bento-grid/bento-item.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { below } from \"#shared/token-scales.ts\";\n\nexport default css`\n :host {\n display: block;\n height: 100%;\n box-sizing: border-box;\n }\n\n /* A brand card is the container its own layout asks: the row, the column\n and the size of the art follow the card's width (BRAND, below). Only the\n brand tone: a size container contributes nothing to its own intrinsic\n width, and the other tones are also set in rows that size them to their\n content (Foundations/Visual Alignment's card family), where one would\n collapse. width: 100% for the same reason, in the grid cell a brand card\n always sits in. */\n :host([tone=\"brand\"]) {\n width: 100%;\n container: bento-item / inline-size;\n }\n\n .bd-bentoitem-box {\n background: var(--color-surface-container);\n border-radius: var(--card-radius);\n padding: var(--card-padding);\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n text-align: start;\n height: 100%;\n box-sizing: border-box;\n font-family: var(--typography-fontFamily-sans);\n min-width: 0;\n /* The same hover lift as trust-panel, now at the same scale step. */\n transition: transform var(--transition-duration-normal) var(--transition-easing-ease),\n box-shadow var(--transition-duration-normal) var(--transition-easing-ease);\n /* No edge. --color-surface-container is documented as \"the ground of a\n self-contained object -- a card, a tile, a panel -- one step off the page\n so it reads as its own object WITHOUT needing a border or a shadow to say\n so\", and this card sits on the page ground, so the tonal step is the\n separation and an edge is redundant with the role's own purpose.\n\n The rule, from the cards-and-surfaces review: a card on the page ground\n takes surface/container and no edge; a card on a tinted section takes\n surface/default plus a 1px border/container, because there is no tonal\n step available there and the edge earns its keep. Six components on the\n page ground drew no edge; this one drew one, and five identical siblings\n did not. See CLAUDE.md, \"A card's ground and its edge\". */\n }\n\n\n /* Only where something can hover: a tap leaves :hover on the card it\n touched, so a touch screen kept the last card lifted until the next tap\n landed somewhere else. */\n @media (hover: hover) {\n .bd-bentoitem-box:hover {\n transform: translateY(-3px);\n /* no token: trust-panel's card lift, the same 7% black layer -- see the\n reason there. */\n box-shadow: 0px 14px 40px color-mix(in srgb, var(--color-neutral-1000) 7%, transparent);\n }\n }\n\n /* Same reasoning as trust-panel, checked separately: the shadow is the part\n that communicates hover, the 3px is the part that moves. */\n @media (prefers-reduced-motion: reduce) {\n .bd-bentoitem-box {\n transition: none;\n }\n\n .bd-bentoitem-box:hover {\n transform: none;\n }\n }\n\n .bd-bentoitem-icon-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n gap: var(--spacing-8);\n padding-bottom: var(--spacing-8);\n min-height: 48px;\n }\n\n .bd-bentoitem-icon,\n ::slotted([slot=\"icon\"]) {\n max-width: 48px;\n max-height: 48px;\n width: 48px;\n height: 48px;\n object-fit: contain;\n display: block;\n }\n\n .bd-bentoitem-title-wrap {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-4);\n overflow: hidden;\n margin-bottom: var(--spacing-8);\n width: 100%;\n }\n\n .bd-bentoitem-body {\n margin: 0 0 1em 0;\n color: var(--color-text-secondary);\n width: 100%;\n }\n\n ::slotted(bd-p) {\n width: 100%;\n }\n\n /* === TONE VARIANTS ===\n The card has no edge (see .bd-bentoitem-box), so a tone is the fill\n alone. */\n :host([tone=\"tint\"]) .bd-bentoitem-box {\n background: var(--status-brand-surface);\n }\n\n :host([tone=\"dark\"]) .bd-bentoitem-box {\n /* The inverse ground the card's inverse ink is written for, running into\n the brand's darkest blue.\n no role: blue-950 is a gradient's far stop, decoration rather than a\n ground any text is measured against -- the same stop bd-cta-banner ends on. */\n background: linear-gradient(160deg, var(--color-surface-inverse) 0%, var(--color-brand-950) 130%);\n }\n\n :host([tone=\"dark\"]) .bd-bentoitem-title-wrap bd-h {\n color: var(--color-text-inverse);\n }\n\n :host([tone=\"dark\"]) .bd-bentoitem-body {\n color: var(--color-text-inverse);\n }\n\n /* below('md'), not below('sm'). The Comparison Panel and the Trust Panel both\n take the compact inset at md and this took it at sm, so the same card was\n affording 32px at 600px wide in one component and not in another. Two of\n the three picked md; this one moved. Visible: the inset steps down 192px\n of viewport earlier than it used to. */\n @media ${unsafeCSS(below('md'))} {\n .bd-bentoitem-box {\n padding: var(--card-padding-compact);\n }\n }\n\n /* === BRAND ===\n The homepage AI cards, as the Figma 2026_splitter frames draw them. No\n hover lift: the CTA is the card's one control, and a card that moves as a\n whole promises a link it does not have.\n\n A card narrower than 518 (every phone): a column at the compact inset --\n the copy, the art whole in a square at the card's inner width, the CTA\n across the card -- 24 apart, at the smaller corner. */\n :host([tone=\"brand\"]) .bd-bentoitem-box {\n position: relative;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-24);\n padding: var(--spacing-24);\n background: var(--color-surface-brand);\n border-radius: var(--shape-radius-2xl);\n color: var(--color-brand-on-fill);\n }\n\n /* A set of brand cards shares one row height (bento-grid.ts), so a card\n with shorter copy is taller than its content. In the column the slack\n goes above the CTA, which keeps every card's CTA on its bottom edge\n rather than leaving a gap under the shortest one.\n\n In the column the CTA also runs the card's width, as the Figma phone\n frame draws it; in the row it hugs its label. --bd-button-width is\n bd-button's width hook. It followed the screen (below md) while the\n layout followed the card, so a 518-543 card on a 550-575 screen drew the\n row with a CTA stretched across its 300 copy column. */\n @container bento-item (width < 518px) {\n :host([tone=\"brand\"]) .bd-bentoitem-cta {\n margin-block-start: auto;\n }\n\n :host([tone=\"brand\"]) .bd-bentoitem-cta ::slotted(*) {\n --bd-button-width: 100%;\n }\n }\n\n :host([tone=\"brand\"]) .bd-bentoitem-box:hover {\n transform: none;\n box-shadow: none;\n }\n\n .bd-bentoitem-media {\n position: relative;\n /* the art is square; the phone frame draws its box 302 by 308 */\n aspect-ratio: 1;\n overflow: hidden;\n border-radius: var(--shape-radius-xl);\n /* slotted motion art sizes itself from the box */\n container-type: size;\n }\n\n ::slotted([slot=\"media\"]) {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n /* bd-motion-art is square and draws at its own width, so the box gives it\n one: here the square box itself, the art whole. Margins, not a translate,\n so it centres in RTL too. */\n ::slotted(bd-motion-art[slot=\"media\"]) {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n width: 100cqh;\n height: auto;\n margin-block-start: -50cqh;\n margin-inline-start: -50cqh;\n }\n\n .bd-bentoitem-text {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--spacing-12);\n }\n\n .bd-bentoitem-brand-title {\n margin: 0;\n }\n\n .bd-bentoitem-brand-body {\n margin: 0;\n font-family: var(--typography-body-regular-fontFamily);\n font-size: var(--typography-body-regular-fontSize);\n font-weight: var(--typography-body-regular-fontWeight);\n line-height: var(--typography-body-regular-lineHeight);\n letter-spacing: var(--typography-body-regular-letterSpacing);\n color: var(--color-brand-on-fill);\n }\n\n /* A card 518 wide or wider, tablet and desktop alike, is a row at the\n card inset: the copy over the CTA in a 300 column on the near side, 24\n apart and centred down the card, and the art from the column's edge out\n to the card's, bleeding through the inset. The featured card's column is\n a share of the row instead.\n\n 518 is the narrowest card the frames draw as a row -- one of the pair at\n xl, half the 1060 column less the gap -- and it reads the card, not the\n screen: it was md, which gave a card in a narrow column at desktop the\n phone's column, and the 656 tablet card and the 518 pair the same row\n for different reasons. Measured: the column up to 511 wide (575 in\n Storybook), the row from 518, in every story. */\n @container bento-item (width >= 518px) {\n :host([tone=\"brand\"]) .bd-bentoitem-box {\n display: grid;\n /* no token: the copy's measure, the 300 every frame gives it */\n grid-template-columns: 300px minmax(0, 1fr);\n /* The copy and CTA centred down the card by the two 1fr rows around\n them, rather than by align-content: the art spans all four rows, so\n it runs the card's full height however much taller than its copy\n the shared row height makes the card. No row gap, so the empty rows\n add nothing to a card that is only as tall as its content; the 24\n between copy and CTA is the CTA's margin. */\n grid-template-rows: 1fr auto auto 1fr;\n grid-template-areas:\n \". media\"\n \"text media\"\n \"cta media\"\n \". media\";\n gap: 0;\n padding: var(--spacing-32);\n border-radius: var(--shape-radius-3xl);\n }\n\n :host([tone=\"brand\"][priority=\"featured\"]) .bd-bentoitem-box {\n /* not the column: the copy keeps to the near half of a full-row card */\n grid-template-columns: 42% minmax(0, 1fr);\n }\n\n .bd-bentoitem-text {\n grid-area: text;\n }\n\n .bd-bentoitem-cta {\n grid-area: cta;\n margin-block-start: var(--spacing-24);\n }\n\n .bd-bentoitem-media {\n grid-area: media;\n aspect-ratio: auto;\n border-radius: var(--radius-none);\n margin-block: calc(-1 * var(--spacing-32));\n margin-inline-end: calc(-1 * var(--spacing-32));\n }\n\n /* Beside the copy the art takes the card's height, so in one of the\n desktop pair -- whose art box is a tall strip -- the stack and the\n globe stay in the card beside their pills; a box wider than that, the\n featured card's, takes its own width. */\n ::slotted(bd-motion-art[slot=\"media\"]) {\n inset-inline-start: 0;\n width: max(100cqw, 100cqh);\n margin-block-start: calc(max(100cqw, 100cqh) / -2);\n margin-inline-start: 0;\n }\n }\n\n /* A card a whole tablet column wide or wider draws the art larger than its\n box, as the tablet frame does: held against the copy, centred down the\n card, and running off the card's outer edge and its top and bottom --\n never off the side its badges and pills face. 135% of the card's height\n is that frame's 434 square on a 321 card. The pair never reaches 656\n (634 at the widest page) and a card 880 wide is the desktop's, so this\n is the tablet card's rule, between the two; it was the md-to-lg band of\n the screen, where every card is the 656 column. */\n @container bento-item (656px <= width < 880px) {\n ::slotted(bd-motion-art[slot=\"media\"]) {\n width: max(100cqw, 135cqh);\n margin-block-start: calc(max(100cqw, 135cqh) / -2);\n }\n }\n\n /* A newline in the text is a line break, so a page can keep the breaks its\n copy was written with (a <br> in the authored eyebrow, heading or lead\n arrives as a newline in the property). Text only: nothing here renders\n HTML. The rule sits on a span around the text, not on bd-h or bd-p,\n whose own templates hold newlines that would break too. */\n .text,\n .bd-bentoitem-brand-body {\n white-space: pre-line;\n }\n`;\n"],"mappings":"A,4DAGA,IAAAA,EAAe,CAAG,okI"}
1
+ {"version":3,"file":"bento-item.css.js","names":["bento_item_css_default"],"sources":["../../../../src/components/bento-grid/bento-item.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { below } from \"#shared/token-scales.ts\";\n\nexport default css`\n :host {\n display: block;\n height: 100%;\n box-sizing: border-box;\n }\n\n /* A brand card is the container its own layout asks: the row, the column\n and the size of the art follow the card's width (BRAND, below). Only the\n brand tone: a size container contributes nothing to its own intrinsic\n width, and the other tones are also set in rows that size them to their\n content (Foundations/Visual Alignment's card family), where one would\n collapse. width: 100% for the same reason, in the grid cell a brand card\n always sits in. */\n :host([tone=\"brand\"]) {\n width: 100%;\n container: bento-item / inline-size;\n }\n\n .bd-bentoitem-box {\n background: var(--color-surface-container);\n border-radius: var(--card-radius);\n padding: var(--card-padding);\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n text-align: start;\n height: 100%;\n box-sizing: border-box;\n font-family: var(--typography-fontFamily-sans);\n min-width: 0;\n /* The same hover lift as trust-panel, now at the same scale step. */\n transition: transform var(--transition-duration-normal) var(--transition-easing-ease),\n box-shadow var(--transition-duration-normal) var(--transition-easing-ease);\n /* No edge. --color-surface-container is documented as \"the ground of a\n self-contained object -- a card, a tile, a panel -- one step off the page\n so it reads as its own object WITHOUT needing a border or a shadow to say\n so\", and this card sits on the page ground, so the tonal step is the\n separation and an edge is redundant with the role's own purpose.\n\n The rule, from the cards-and-surfaces review: a card on the page ground\n takes surface/container and no edge; a card on a tinted section takes\n surface/default plus a 1px border/container, because there is no tonal\n step available there and the edge earns its keep. Six components on the\n page ground drew no edge; this one drew one, and five identical siblings\n did not. See CLAUDE.md, \"A card's ground and its edge\". */\n }\n\n\n /* Only where something can hover: a tap leaves :hover on the card it\n touched, so a touch screen kept the last card lifted until the next tap\n landed somewhere else. */\n @media (hover: hover) {\n .bd-bentoitem-box:hover {\n transform: translateY(-3px);\n /* no token: trust-panel's card lift, the same 7% black layer -- see the\n reason there. */\n box-shadow: 0px 14px 40px color-mix(in srgb, var(--color-neutral-1000) 7%, transparent);\n }\n }\n\n /* Same reasoning as trust-panel, checked separately: the shadow is the part\n that communicates hover, the 3px is the part that moves. */\n @media (prefers-reduced-motion: reduce) {\n .bd-bentoitem-box {\n transition: none;\n }\n\n .bd-bentoitem-box:hover {\n transform: none;\n }\n }\n\n .bd-bentoitem-icon-wrap {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n gap: var(--spacing-8);\n padding-bottom: var(--spacing-8);\n min-height: 48px;\n }\n\n .bd-bentoitem-icon,\n ::slotted([slot=\"icon\"]) {\n max-width: 48px;\n max-height: 48px;\n width: 48px;\n height: 48px;\n object-fit: contain;\n display: block;\n }\n\n .bd-bentoitem-title-wrap {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-4);\n overflow: hidden;\n margin-bottom: var(--spacing-8);\n width: 100%;\n }\n\n .bd-bentoitem-body {\n margin: 0 0 1em 0;\n color: var(--color-text-secondary);\n width: 100%;\n }\n\n ::slotted(bd-p) {\n width: 100%;\n }\n\n /* === TONE VARIANTS ===\n The card has no edge (see .bd-bentoitem-box), so a tone is the fill\n alone. */\n :host([tone=\"tint\"]) .bd-bentoitem-box {\n background: var(--status-brand-surface);\n }\n\n :host([tone=\"dark\"]) .bd-bentoitem-box {\n /* The inverse ground the card's inverse ink is written for, running into\n the brand's darkest blue.\n no role: blue-950 is a gradient's far stop, decoration rather than a\n ground any text is measured against -- the same stop bd-cta-banner ends on. */\n background: linear-gradient(160deg, var(--color-surface-inverse) 0%, var(--color-brand-950) 130%);\n }\n\n :host([tone=\"dark\"]) .bd-bentoitem-title-wrap bd-h {\n color: var(--color-text-inverse);\n }\n\n :host([tone=\"dark\"]) .bd-bentoitem-body {\n color: var(--color-text-inverse);\n }\n\n /* below('md'), not below('sm'). The Comparison Panel and the Trust Panel both\n take the compact inset at md and this took it at sm, so the same card was\n affording 32px at 600px wide in one component and not in another. Two of\n the three picked md; this one moved. Visible: the inset steps down 192px\n of viewport earlier than it used to. */\n @media ${unsafeCSS(below('md'))} {\n .bd-bentoitem-box {\n padding: var(--card-padding-compact);\n }\n }\n\n /* === BRAND ===\n The homepage AI cards, as the Figma 2026_splitter frames draw them. No\n hover lift: the CTA is the card's one control, and a card that moves as a\n whole promises a link it does not have.\n\n A card narrower than 518 (every phone): a column at the compact inset --\n the copy, the art whole in a square at the card's inner width, the CTA\n across the card -- 24 apart, at the smaller corner. */\n :host([tone=\"brand\"]) .bd-bentoitem-box {\n position: relative;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-24);\n padding: var(--spacing-24);\n background: var(--color-surface-brand);\n border-radius: var(--shape-radius-2xl);\n color: var(--color-brand-on-fill);\n }\n\n /* A set of brand cards shares one row height (bento-grid.ts), so a card\n with shorter copy is taller than its content. In the column the slack\n goes above the CTA, which keeps every card's CTA on its bottom edge\n rather than leaving a gap under the shortest one.\n\n In the column the CTA also runs the card's width, as the Figma phone\n frame draws it; in the row it hugs its label. --bd-button-width is\n bd-button's width hook. It followed the screen (below md) while the\n layout followed the card, so a 518-543 card on a 550-575 screen drew the\n row with a CTA stretched across its 300 copy column. */\n @container bento-item (width < 518px) {\n :host([tone=\"brand\"]) .bd-bentoitem-cta {\n margin-block-start: auto;\n }\n\n :host([tone=\"brand\"]) .bd-bentoitem-cta ::slotted(*) {\n --bd-button-width: 100%;\n }\n }\n\n :host([tone=\"brand\"]) .bd-bentoitem-box:hover {\n transform: none;\n box-shadow: none;\n }\n\n .bd-bentoitem-media {\n position: relative;\n /* the art is square; the phone frame draws its box 302 by 308 */\n aspect-ratio: 1;\n overflow: hidden;\n border-radius: var(--shape-radius-xl);\n /* slotted motion art sizes itself from the box */\n container-type: size;\n }\n\n ::slotted([slot=\"media\"]) {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n /* bd-motion-art is square and draws at its own width, so the box gives it\n one: here the square box itself, the art whole. Margins, not a translate,\n so it centres in RTL too. */\n ::slotted(bd-motion-art[slot=\"media\"]) {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-start: 50%;\n width: 100cqh;\n height: auto;\n margin-block-start: -50cqh;\n margin-inline-start: -50cqh;\n }\n\n .bd-bentoitem-text {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--spacing-12);\n }\n\n .bd-bentoitem-brand-title {\n margin: 0;\n }\n\n .bd-bentoitem-brand-body {\n margin: 0;\n font-family: var(--typography-body-regular-fontFamily);\n font-size: var(--typography-body-regular-fontSize);\n font-weight: var(--typography-body-regular-fontWeight);\n line-height: var(--typography-body-regular-lineHeight);\n letter-spacing: var(--typography-body-regular-letterSpacing);\n color: var(--color-brand-on-fill);\n }\n\n /* A card 518 wide or wider, tablet and desktop alike, is a row at the\n card inset: the copy over the CTA in a 300 column on the near side, 24\n apart and centred down the card, and the art from the column's edge out\n to the card's, bleeding through the inset. The featured card's column is\n a share of the row instead.\n\n 518 is the narrowest card the frames draw as a row -- one of the pair at\n xl, half the 1060 column less the gap -- and it reads the card, not the\n screen: it was md, which gave a card in a narrow column at desktop the\n phone's column, and the 656 tablet card and the 518 pair the same row\n for different reasons. Measured: the column up to 511 wide (575 in\n Storybook), the row from 518, in every story. */\n @container bento-item (width >= 518px) {\n :host([tone=\"brand\"]) .bd-bentoitem-box {\n display: grid;\n /* no token: the copy's measure, the 300 every frame gives it */\n grid-template-columns: 300px minmax(0, 1fr);\n /* The copy and CTA centred down the card by the two 1fr rows around\n them, rather than by align-content: the art spans all four rows, so\n it runs the card's full height however much taller than its copy\n the shared row height makes the card. No row gap, so the empty rows\n add nothing to a card that is only as tall as its content; the 24\n between copy and CTA is the CTA's margin. */\n grid-template-rows: 1fr auto auto 1fr;\n grid-template-areas:\n \". media\"\n \"text media\"\n \"cta media\"\n \". media\";\n gap: 0;\n padding: var(--spacing-32);\n border-radius: var(--shape-radius-3xl);\n }\n\n :host([tone=\"brand\"][priority=\"featured\"]) .bd-bentoitem-box {\n /* not the column: the copy keeps to the near half of a full-row card */\n grid-template-columns: 42% minmax(0, 1fr);\n }\n\n .bd-bentoitem-text {\n grid-area: text;\n }\n\n .bd-bentoitem-cta {\n grid-area: cta;\n margin-block-start: var(--spacing-24);\n }\n\n .bd-bentoitem-media {\n grid-area: media;\n aspect-ratio: auto;\n border-radius: var(--radius-none);\n margin-block: calc(-1 * var(--spacing-32));\n margin-inline-end: calc(-1 * var(--spacing-32));\n }\n\n /* Beside the copy the art takes the card's height, so in one of the\n desktop pair -- whose art box is a tall strip -- the stack and the\n globe stay in the card beside their pills; a box wider than that, the\n featured card's, takes its own width.\n\n The card's height is its copy's, and a longer title or body made the\n art grow with it -- 599 square in a 599 card for a title three lines\n longer, its pills pushed off the card's edge. The height the art\n follows is therefore held to the card the frames draw, 391 with the\n homepage's copy: up to it the art is what it was, past it the art\n keeps that size and stays centred down the taller card.\n no token: the frames' card height, a dimension past the scale's 64 */\n ::slotted(bd-motion-art[slot=\"media\"]) {\n --bd-bento-art: max(100cqw, min(100cqh, 24.5rem));\n inset-inline-start: 0;\n width: var(--bd-bento-art);\n margin-block-start: calc(var(--bd-bento-art) / -2);\n margin-inline-start: 0;\n }\n }\n\n /* A card a whole tablet column wide or wider draws the art larger than its\n box, as the tablet frame does: held against the copy, centred down the\n card, and running off the card's outer edge and its top and bottom --\n never off the side its badges and pills face. 135% of the card's height\n is that frame's 434 square on a 321 card. The pair never reaches 656\n (634 at the widest page) and a card 880 wide is the desktop's, so this\n is the tablet card's rule, between the two; it was the md-to-lg band of\n the screen, where every card is the 656 column. */\n @container bento-item (656px <= width < 880px) {\n /* held, as above, to what the frame's card gives it: 135% of the 424\n its copy makes it here, 572 square.\n no token: the frame's art, a dimension past the scale's 64 */\n ::slotted(bd-motion-art[slot=\"media\"]) {\n --bd-bento-art: max(100cqw, min(135cqh, 36rem));\n }\n }\n\n /* A newline in the text is a line break, so a page can keep the breaks its\n copy was written with (a <br> in the authored eyebrow, heading or lead\n arrives as a newline in the property). Text only: nothing here renders\n HTML. The rule sits on a span around the text, not on bd-h or bd-p,\n whose own templates hold newlines that would break too. */\n .text,\n .bd-bentoitem-brand-body {\n white-space: pre-line;\n }\n`;\n"],"mappings":"A,4DAGA,IAAAA,EAAe,CAAG,gmI"}
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from "lit";
2
+ import "../../tokens/tokens.js";
2
3
  import "../badge/badge.js";
3
4
  import "../heading/heading.js";
4
5
  import "../paragraph/paragraph.js";