@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.
- package/CHANGELOG.md +25 -0
- package/README.md +35 -0
- package/dist/src/components/agent-endpoints/agent-endpoints.d.ts +1 -0
- package/dist/src/components/agent-endpoints/agent-endpoints.js +12 -12
- package/dist/src/components/agent-endpoints/agent-endpoints.js.map +1 -1
- package/dist/src/components/anchor/anchor-nav.d.ts +2 -1
- package/dist/src/components/anchor/anchor-nav.js +10 -10
- package/dist/src/components/anchor/anchor-nav.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.css.js +1 -1
- package/dist/src/components/audience-card/audience-card.css.js.map +1 -1
- package/dist/src/components/audience-card/audience-card.d.ts +1 -0
- package/dist/src/components/audience-card/audience-card.js +8 -8
- package/dist/src/components/audience-card/audience-card.js.map +1 -1
- package/dist/src/components/awards/awards-flex.d.ts +3 -2
- package/dist/src/components/awards/awards-flex.js +16 -16
- package/dist/src/components/awards/awards-flex.js.map +1 -1
- package/dist/src/components/awards/awards-spotlight.d.ts +2 -1
- package/dist/src/components/awards/awards-spotlight.js +8 -8
- package/dist/src/components/awards/awards-spotlight.js.map +1 -1
- package/dist/src/components/awards/awards.d.ts +1 -1
- package/dist/src/components/bento-grid/bento-grid.d.ts +1 -0
- package/dist/src/components/bento-grid/bento-grid.js +10 -10
- package/dist/src/components/bento-grid/bento-grid.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.css.js +1 -1
- package/dist/src/components/bento-grid/bento-item.css.js.map +1 -1
- package/dist/src/components/bento-grid/bento-item.d.ts +1 -0
- package/dist/src/components/bento-grid/bento-item.js +9 -9
- package/dist/src/components/bento-grid/bento-item.js.map +1 -1
- package/dist/src/components/button/button.d.ts +1 -1
- package/dist/src/components/cards/card.d.ts +2 -2
- package/dist/src/components/cards/card.js +11 -11
- package/dist/src/components/cards/card.js.map +1 -1
- package/dist/src/components/carousel/carousel.d.ts +2 -2
- package/dist/src/components/carousel/carousel.js +6 -6
- package/dist/src/components/carousel/carousel.js.map +1 -1
- package/dist/src/components/comparison-panel/comparison-panel.d.ts +1 -0
- package/dist/src/components/comparison-panel/comparison-panel.js +12 -12
- package/dist/src/components/comparison-panel/comparison-panel.js.map +1 -1
- package/dist/src/components/compatibility-table/compatibility-table.d.ts +1 -0
- package/dist/src/components/compatibility-table/compatibility-table.js +14 -14
- package/dist/src/components/compatibility-table/compatibility-table.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.d.ts +1 -0
- package/dist/src/components/cta-banner/cta-banner.js +8 -8
- package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
- package/dist/src/components/grid/grid.css.js +1 -1
- package/dist/src/components/grid/grid.css.js.map +1 -1
- package/dist/src/components/grid/grid.d.ts +1 -0
- package/dist/src/components/grid/grid.js +4 -3
- package/dist/src/components/grid/grid.js.map +1 -1
- package/dist/src/components/header/header-code.d.ts +3 -2
- package/dist/src/components/header/header-code.js +13 -13
- package/dist/src/components/header/header-code.js.map +1 -1
- package/dist/src/components/heading/heading.d.ts +1 -1
- package/dist/src/components/heading/heading.js +5 -1
- package/dist/src/components/heading/heading.js.map +1 -1
- package/dist/src/components/hero/hero.d.ts +2 -1
- package/dist/src/components/hero/hero.js +9 -9
- package/dist/src/components/hero/hero.js.map +1 -1
- package/dist/src/components/install-options/install-options.d.ts +3 -2
- package/dist/src/components/install-options/install-options.js +17 -17
- package/dist/src/components/install-options/install-options.js.map +1 -1
- package/dist/src/components/link/link.d.ts +1 -1
- package/dist/src/components/list/list-item/list-item.d.ts +1 -1
- package/dist/src/components/logo-marquee/logo-marquee.d.ts +1 -0
- package/dist/src/components/logo-marquee/logo-marquee.js +5 -5
- package/dist/src/components/logo-marquee/logo-marquee.js.map +1 -1
- package/dist/src/components/motion-art/motion-art.js +1 -1
- package/dist/src/components/motion-art/motion-art.js.map +1 -1
- package/dist/src/components/overview/overview.d.ts +1 -0
- package/dist/src/components/overview/overview.js +7 -7
- package/dist/src/components/overview/overview.js.map +1 -1
- package/dist/src/components/page-switcher/page-switcher.d.ts +1 -0
- package/dist/src/components/page-switcher/page-switcher.js +5 -5
- package/dist/src/components/page-switcher/page-switcher.js.map +1 -1
- package/dist/src/components/pagination-dots/pagination-dots.d.ts +1 -1
- package/dist/src/components/partner-banner/partner-banner.d.ts +1 -0
- package/dist/src/components/partner-banner/partner-banner.js +7 -7
- package/dist/src/components/partner-banner/partner-banner.js.map +1 -1
- package/dist/src/components/post-card/post-card.d.ts +1 -0
- package/dist/src/components/post-card/post-card.js +5 -5
- package/dist/src/components/post-card/post-card.js.map +1 -1
- package/dist/src/components/process-steps/process-steps.d.ts +1 -0
- package/dist/src/components/process-steps/process-steps.js +7 -7
- package/dist/src/components/process-steps/process-steps.js.map +1 -1
- package/dist/src/components/quick-answer/quick-answer.d.ts +1 -0
- package/dist/src/components/quick-answer/quick-answer.js +7 -7
- package/dist/src/components/quick-answer/quick-answer.js.map +1 -1
- package/dist/src/components/review/review-grid.d.ts +1 -0
- package/dist/src/components/review/review-grid.js +3 -3
- package/dist/src/components/review/review-grid.js.map +1 -1
- package/dist/src/components/review/review.d.ts +1 -0
- package/dist/src/components/review/review.js +2 -2
- package/dist/src/components/review/review.js.map +1 -1
- package/dist/src/components/section-header/section-header.d.ts +1 -0
- package/dist/src/components/section-header/section-header.js +4 -4
- package/dist/src/components/section-header/section-header.js.map +1 -1
- package/dist/src/components/shared/controller.observer.d.ts +50 -0
- package/dist/src/components/shared/controller.observer.js +2 -0
- package/dist/src/components/shared/controller.observer.js.map +1 -0
- package/dist/src/components/spotlight-section/spotlight-section.d.ts +1 -0
- package/dist/src/components/spotlight-section/spotlight-section.js +7 -7
- package/dist/src/components/spotlight-section/spotlight-section.js.map +1 -1
- package/dist/src/components/stat/stat-highlight.d.ts +5 -5
- package/dist/src/components/stat/stat-highlight.js +2 -2
- package/dist/src/components/stat/stat-highlight.js.map +1 -1
- package/dist/src/components/stat/stat-tile.d.ts +1 -0
- package/dist/src/components/stat/stat-tile.js +5 -5
- package/dist/src/components/stat/stat-tile.js.map +1 -1
- package/dist/src/components/terminal/terminal-cursor.d.ts +1 -0
- package/dist/src/components/terminal/terminal-cursor.js +1 -1
- package/dist/src/components/terminal/terminal-cursor.js.map +1 -1
- package/dist/src/components/terminal/terminal-message.d.ts +4 -3
- package/dist/src/components/terminal/terminal-message.js +25 -25
- package/dist/src/components/terminal/terminal-message.js.map +1 -1
- package/dist/src/components/tooltip/tooltip.js +1 -1
- package/dist/src/components/tooltip/tooltip.js.map +1 -1
- package/dist/src/components/trust-panel/trust-panel.d.ts +1 -0
- package/dist/src/components/trust-panel/trust-panel.js +19 -19
- package/dist/src/components/trust-panel/trust-panel.js.map +1 -1
- package/dist/src/loader/create-loader.d.ts +13 -0
- package/dist/src/loader/create-loader.js +2 -0
- package/dist/src/loader/create-loader.js.map +1 -0
- package/dist/src/loader/loader.d.ts +44 -0
- package/dist/src/loader/loader.js +2 -0
- package/dist/src/loader/loader.js.map +1 -0
- package/dist/src/loader/registry.d.ts +2 -0
- package/dist/src/loader/registry.js +2 -0
- package/dist/src/loader/registry.js.map +1 -0
- package/dist/src/tokens/tokens.js +1 -1
- package/dist/src/tokens/tokens.js.map +1 -1
- package/package.json +12 -4
- package/schemas/component-manifest.json +8 -1
- package/dist/src/tokens/dark-derivation.d.ts +0 -70
- package/dist/src/tokens/dark-derivation.js +0 -2
- package/dist/src/tokens/dark-derivation.js.map +0 -1
- package/dist/src/tokens/dark-findings.d.ts +0 -59
- package/dist/src/tokens/dark-findings.js +0 -2
- package/dist/src/tokens/dark-findings.js.map +0 -1
- package/dist/src/tokens/story-chrome.d.ts +0 -72
- package/dist/src/tokens/story-chrome.js +0 -292
- package/dist/src/tokens/story-chrome.js.map +0 -1
- package/dist/src/tokens/token-map.d.ts +0 -114
- package/dist/src/tokens/token-map.js +0 -2
- package/dist/src/tokens/token-map.js.map +0 -1
- package/dist/src/tokens/token-purposes.d.ts +0 -63
- package/dist/src/tokens/token-purposes.js +0 -2
- package/dist/src/tokens/token-purposes.js.map +0 -1
- package/dist/src/tokens/type-ceiling-words.d.ts +0 -96
- package/dist/src/tokens/type-ceiling-words.js +0 -2
- package/dist/src/tokens/type-ceiling-words.js.map +0 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import
|
|
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 from"./compatibility-table.css.js";import{LitElement as i,html as a,nothing as o}from"lit";import{property as s}from"lit/decorators.js";var c=class extends i{constructor(...e){super(...e),this.title=``,this.description=``,this.variant=`default`,this.background=`default`,this.lightColumns=2,this.columns=null,this.rows=[]}static{this.styles=[n,r]}_defaultColumns(){return this.columns?this.columns:this.variant===`outcome`?[`Agent event`,`Without AI Guardian`,`With AI Guardian`]:this.variant===`risk`?[`Risk category`,`AI Guardian coverage`]:this.variant===`light`?null:[`Environment`,`Coverage`,`Notes`]}_cellLabel(e){let t=this._defaultColumns()?.[e];return t?`--bd-cell-label: "${String(t).replace(/["\\]/g,``)}: "`:o}_renderRow(e){return this.variant===`outcome`?a`
|
|
2
2
|
<tr class="bd-compattable-row">
|
|
3
3
|
<th class="bd-compattable-cell bd-compattable-cell--event" scope="row">${e.event}</th>
|
|
4
4
|
<td class="bd-compattable-cell bd-compattable-cell--without" style=${this._cellLabel(1)}>${e.without}</td>
|
|
5
5
|
<td class="bd-compattable-cell bd-compattable-cell--with" style=${this._cellLabel(2)}>${e.with}</td>
|
|
6
6
|
</tr>
|
|
7
|
-
`:this.variant===`risk`?
|
|
7
|
+
`:this.variant===`risk`?a`
|
|
8
8
|
<tr class="bd-compattable-row">
|
|
9
9
|
<th class="bd-compattable-cell bd-compattable-cell--category" scope="row">${e.category}</th>
|
|
10
10
|
<td class="bd-compattable-cell bd-compattable-cell--riskcoverage" style=${this._cellLabel(1)}>${e.coverage}</td>
|
|
11
11
|
</tr>
|
|
12
|
-
`:this.variant===`light`?
|
|
12
|
+
`:this.variant===`light`?a`
|
|
13
13
|
<tr class="bd-compattable-lightrow">
|
|
14
14
|
<th class="bd-compattable-lightlabel" scope="row">${e.label}</th>
|
|
15
15
|
<td class="bd-compattable-lightvalue">${e.value}</td>
|
|
16
16
|
</tr>
|
|
17
|
-
`:
|
|
17
|
+
`:a`
|
|
18
18
|
<tr class="bd-compattable-row">
|
|
19
19
|
<th class="bd-compattable-cell bd-compattable-cell--environment" scope="row">${e.environment}</th>
|
|
20
20
|
<td class="bd-compattable-cell bd-compattable-cell--coverage" style=${this._cellLabel(1)}>${e.coverage}</td>
|
|
21
21
|
<td class="bd-compattable-cell bd-compattable-cell--notes" style=${this._cellLabel(2)}><span class="bd-compattable-notes">${e.notes}</span></td>
|
|
22
22
|
</tr>
|
|
23
|
-
`}render(){let e=this._defaultColumns();return
|
|
23
|
+
`}render(){let e=this._defaultColumns();return a`
|
|
24
24
|
<div class="bd-ensemble bd-compattable-wrapper">
|
|
25
|
-
${this.title?
|
|
25
|
+
${this.title?a`
|
|
26
26
|
<bd-h as="h2" class="bd-compattable-title">
|
|
27
27
|
<slot name="title">${this.title}</slot>
|
|
28
28
|
</bd-h>
|
|
29
|
-
`:
|
|
29
|
+
`:o}
|
|
30
30
|
|
|
31
|
-
${this.description?
|
|
31
|
+
${this.description?a`
|
|
32
32
|
<bd-p variant="large" class="bd-compattable-description" color="muted">
|
|
33
33
|
<slot name="description">${this.description}</slot>
|
|
34
34
|
</bd-p>
|
|
35
|
-
`:
|
|
35
|
+
`:o}
|
|
36
36
|
|
|
37
|
-
${this.variant===`light`?
|
|
37
|
+
${this.variant===`light`?a`
|
|
38
38
|
<table
|
|
39
39
|
class="bd-compattable-lightgrid"
|
|
40
40
|
style="--bd-compattable-light-columns: ${this.lightColumns};"
|
|
@@ -44,13 +44,13 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
|
|
|
44
44
|
</tbody>
|
|
45
45
|
</table>
|
|
46
46
|
<slot name="rows"></slot>
|
|
47
|
-
`:
|
|
47
|
+
`:a`
|
|
48
48
|
<div class="bd-compattable-table-container">
|
|
49
49
|
<table class="bd-compattable-table">
|
|
50
|
-
<colgroup>${e.map(()=>
|
|
50
|
+
<colgroup>${e.map(()=>a`<col>`)}</colgroup>
|
|
51
51
|
<thead class="bd-compattable-header">
|
|
52
52
|
<tr>
|
|
53
|
-
${e.map(e=>
|
|
53
|
+
${e.map(e=>a`<th class="bd-compattable-header-cell" scope="col">${e}</th>`)}
|
|
54
54
|
</tr>
|
|
55
55
|
</thead>
|
|
56
56
|
<tbody class="bd-compattable-body">
|
|
@@ -63,5 +63,5 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
|
|
|
63
63
|
</div>
|
|
64
64
|
`}
|
|
65
65
|
</div>
|
|
66
|
-
`}};
|
|
66
|
+
`}};t([s({type:String})],c.prototype,`title`,void 0),t([s({type:String})],c.prototype,`description`,void 0),t([s({type:String,reflect:!0})],c.prototype,`variant`,void 0),t([s({type:String,reflect:!0})],c.prototype,`background`,void 0),t([s({type:Number,attribute:`light-columns`})],c.prototype,`lightColumns`,void 0),t([s({type:Array})],c.prototype,`columns`,void 0),t([s({type:Array})],c.prototype,`rows`,void 0),c=t([e(`bd-compatibility-table`)],c);
|
|
67
67
|
//# sourceMappingURL=compatibility-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibility-table.js","names":["compatibilityTableCSS","_decorate","__decorate","compatibility_table_css_default","CompatibilityTable","LitElement","_args","
|
|
1
|
+
{"version":3,"file":"compatibility-table.js","names":["compatibilityTableCSS","_decorate","__decorate","compatibility_table_css_default","CompatibilityTable","LitElement","_args","ensembleCSS","name","index","nothing","row","columns","col","property","defineElement"],"sources":["../../../../src/components/compatibility-table/compatibility-table.ts"],"sourcesContent":["import { LitElement, html, nothing, type TemplateResult } 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 compatibilityTableCSS from \"./compatibility-table.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\n\ntype Variant = \"default\" | \"outcome\" | \"risk\" | \"light\";\ntype Background = \"default\" | \"blue\" | \"bordered\";\n\ninterface CompatibilityRow {\n environment?: string;\n coverage? : string;\n notes? : string | TemplateResult;\n event? : string;\n without? : string;\n with? : string;\n category? : string;\n label? : string;\n value? : string;\n}\n\n@defineElement(\"bd-compatibility-table\")\nclass CompatibilityTable extends LitElement {\n static styles = [ensembleCSS, compatibilityTableCSS];\n\n @property({ type: String })\n title = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: String, reflect: true })\n variant: Variant = \"default\";\n @property({ type: String, reflect: true })\n background: Background = \"default\";\n @property({ type: Number, attribute: \"light-columns\" })\n lightColumns = 2;\n @property({ type: Array })\n columns: string[] | null = null;\n @property({ type: Array })\n rows: CompatibilityRow[] = [];\n\n _defaultColumns() {\n if (this.columns) return this.columns;\n if (this.variant === \"outcome\") return [\"Agent event\", \"Without AI Guardian\", \"With AI Guardian\"];\n if (this.variant === \"risk\") return [\"Risk category\", \"AI Guardian coverage\"];\n if (this.variant === \"light\") return null;\n return [\"Environment\", \"Coverage\", \"Notes\"];\n }\n\n /**\n * The column name a cell shows below md, where the header row is hidden.\n *\n * It has to come from `columns`, because that is what the header shows. The\n * stylesheet used to carry these as hardcoded strings in `content` --\n * \"Without AI Guardian: \" and four others -- so a consumer who passed their\n * own columns got them in the header and the component's English in the\n * cells. Measured at 375 with columns set to Romanian: the header read\n * \"Fara AI Guardian\" and the cell label still read \"Without AI Guardian\".\n * There was no way to change it and no way to translate it.\n *\n * Passed to CSS as a string custom property so the label stays generated\n * content: it is a visual stand-in for a header that is still in the\n * accessibility tree, and putting it in the DOM would say it twice.\n */\n _cellLabel(index: number) {\n const columns = this._defaultColumns();\n const name = columns?.[index];\n return name ? `--bd-cell-label: \"${String(name).replace(/[\"\\\\]/g, \"\")}: \"` : nothing;\n }\n\n /* A native table. It was divs carrying role=\"table\", \"row\", \"columnheader\"\n and \"cell\", which said in ARIA what the elements say for themselves --\n and only for as long as every role stayed in step with the markup, which\n the rowgroup note this replaces records it once did not. The first cell\n of a row names the row, so it is the row's <th>. */\n _renderRow(row: CompatibilityRow) {\n if (this.variant === \"outcome\") {\n return html`\n <tr class=\"bd-compattable-row\">\n <th class=\"bd-compattable-cell bd-compattable-cell--event\" scope=\"row\">${row.event}</th>\n <td class=\"bd-compattable-cell bd-compattable-cell--without\" style=${this._cellLabel(1)}>${row.without}</td>\n <td class=\"bd-compattable-cell bd-compattable-cell--with\" style=${this._cellLabel(2)}>${row.with}</td>\n </tr>\n `;\n }\n\n if (this.variant === \"risk\") {\n return html`\n <tr class=\"bd-compattable-row\">\n <th class=\"bd-compattable-cell bd-compattable-cell--category\" scope=\"row\">${row.category}</th>\n <td class=\"bd-compattable-cell bd-compattable-cell--riskcoverage\" style=${this._cellLabel(1)}>${row.coverage}</td>\n </tr>\n `;\n }\n\n if (this.variant === \"light\") {\n return html`\n <tr class=\"bd-compattable-lightrow\">\n <th class=\"bd-compattable-lightlabel\" scope=\"row\">${row.label}</th>\n <td class=\"bd-compattable-lightvalue\">${row.value}</td>\n </tr>\n `;\n }\n\n /* notes may be a template of several inline items, which the cell spaced\n as a flex row; a table cell cannot be one, so the content is wrapped */\n return html`\n <tr class=\"bd-compattable-row\">\n <th class=\"bd-compattable-cell bd-compattable-cell--environment\" scope=\"row\">${row.environment}</th>\n <td class=\"bd-compattable-cell bd-compattable-cell--coverage\" style=${this._cellLabel(1)}>${row.coverage}</td>\n <td class=\"bd-compattable-cell bd-compattable-cell--notes\" style=${this._cellLabel(2)}><span class=\"bd-compattable-notes\">${row.notes}</span></td>\n </tr>\n `;\n }\n\n render() {\n const columns = this._defaultColumns();\n\n return html`\n <div class=\"bd-ensemble bd-compattable-wrapper\">\n ${this.title\n ? html`\n <bd-h as=\"h2\" class=\"bd-compattable-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n `\n : nothing}\n\n ${this.description\n ? html`\n <bd-p variant=\"large\" class=\"bd-compattable-description\" color=\"muted\">\n <slot name=\"description\">${this.description}</slot>\n </bd-p>\n `\n : nothing}\n\n ${this.variant === \"light\"\n ? html`\n <table\n class=\"bd-compattable-lightgrid\"\n style=\"--bd-compattable-light-columns: ${this.lightColumns};\"\n >\n <tbody class=\"bd-compattable-lightbody\">\n ${this.rows.map((row) => this._renderRow(row))}\n </tbody>\n </table>\n <slot name=\"rows\"></slot>\n `\n : html`\n <div class=\"bd-compattable-table-container\">\n <table class=\"bd-compattable-table\">\n <colgroup>${columns!.map(() => html`<col>`)}</colgroup>\n <thead class=\"bd-compattable-header\">\n <tr>\n ${columns!.map(\n (col) => html`<th class=\"bd-compattable-header-cell\" scope=\"col\">${col}</th>`\n )}\n </tr>\n </thead>\n <tbody class=\"bd-compattable-body\">\n ${this.rows.map((row) => this._renderRow(row))}\n </tbody>\n </table>\n <!-- after the table, inside the card: a slotted element\n cannot become a row of a native table -->\n <slot name=\"rows\"></slot>\n </div>\n `}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-compatibility-table\": CompatibilityTable;\n }\n}"],"mappings":"A,8aAyBA,IACMI,EADN,cACiCC,CAAW,C,8BAIlC,KAAA,MAAA,GAEM,KAAA,YAAA,GAEK,KAAA,QAAA,UAEM,KAAA,WAAA,UAEV,KAAA,aAAA,EAEY,KAAA,QAAA,KAEA,KAAA,KAAA,CAAC,C,QAfZ,KAAA,OAAA,CAACE,EAAaP,CAAqB,C,CAiBnD,iBAAkB,CAKhB,OAJI,KAAK,QAAgB,KAAK,QAC1B,KAAK,UAAY,UAAkB,CAAC,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;;;;sBAIF,KAAK,KAAK,IAAK,GAAQ,KAAK,WAAWF,CAAG,CAAC,EAAE;;;;;;;cAOrD;;KAGZ,CACF,EAjJGV,EAAA,CAAAa,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAV,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAa,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAV,EAAA,UAAA,cAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAa,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAV,EAAA,UAAA,UAAA,IAAA,EAAA,EAExCH,EAAA,CAAAa,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAV,EAAA,UAAA,aAAA,IAAA,EAAA,EAExCH,EAAA,CAAAa,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,CAAA,EAAAV,EAAA,UAAA,eAAA,IAAA,EAAA,EAErDH,EAAA,CAAAa,EAAS,CAAE,KAAM,KAAM,CAAC,CAAA,EAAAV,EAAA,UAAA,UAAA,IAAA,EAAA,EAExBH,EAAA,CAAAa,EAAS,CAAE,KAAM,KAAM,CAAC,CAAA,EAAAV,EAAA,UAAA,OAAA,IAAA,EAAA,EAhB1B,EAAAH,EAAA,CAAAc,EAAc,wBAAwB,CAAA,EAAAX,CAAA"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import
|
|
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 from"./cta-banner.css.js";import{LitElement as i,html as a,nothing as o}from"lit";import{property as s}from"lit/decorators.js";var c=class extends i{constructor(...e){super(...e),this.title=``,this.description=``,this.caption=``}static{this.styles=[n,r]}render(){return a`
|
|
2
2
|
<div class="bd-ensemble bd-ctabanner-container">
|
|
3
|
-
${this.title?
|
|
3
|
+
${this.title?a`
|
|
4
4
|
<bd-h as="h2" color="on-brand" class="bd-ctabanner-title">
|
|
5
5
|
<slot name="title">${this.title}</slot>
|
|
6
6
|
</bd-h>
|
|
7
|
-
`:
|
|
7
|
+
`:o}
|
|
8
8
|
|
|
9
|
-
${this.description?
|
|
9
|
+
${this.description?a`
|
|
10
10
|
<bd-p variant="large" color="on-brand" class="bd-ctabanner-description">
|
|
11
11
|
<slot name="description">${this.description}</slot>
|
|
12
12
|
</bd-p>
|
|
13
|
-
`:
|
|
13
|
+
`:o}
|
|
14
14
|
|
|
15
15
|
<div class="bd-ctabanner-cta">
|
|
16
16
|
<slot name="primary-button"></slot>
|
|
17
17
|
<slot name="secondary-button"></slot>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
${this.caption?
|
|
20
|
+
${this.caption?a`
|
|
21
21
|
<bd-p variant="small" font-family="mono" class="bd-ctabanner-caption">
|
|
22
22
|
<slot name="caption">${this.caption}</slot>
|
|
23
23
|
</bd-p>
|
|
24
|
-
`:
|
|
24
|
+
`:o}
|
|
25
25
|
|
|
26
26
|
<!-- Freeform slot for extra content below the caption — contact
|
|
27
27
|
info, legal disclaimers, links, etc. Empty by default,
|
|
@@ -30,5 +30,5 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
|
|
|
30
30
|
<slot name="footer"></slot>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
|
-
`}};
|
|
33
|
+
`}};t([s({type:String})],c.prototype,`title`,void 0),t([s({type:String})],c.prototype,`description`,void 0),t([s({type:String})],c.prototype,`caption`,void 0),c=t([e(`bd-cta-banner`)],c);
|
|
34
34
|
//# sourceMappingURL=cta-banner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cta-banner.js","names":["ctaBannerCSS","_decorate","__decorate","cta_banner_css_default","CtaBanner","LitElement","_args","
|
|
1
|
+
{"version":3,"file":"cta-banner.js","names":["ctaBannerCSS","_decorate","__decorate","cta_banner_css_default","CtaBanner","LitElement","_args","ensembleCSS","nothing","property","defineElement"],"sources":["../../../../src/components/cta-banner/cta-banner.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/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport ctaBannerCSS from \"./cta-banner.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\n\n@defineElement(\"bd-cta-banner\")\nclass CtaBanner extends LitElement {\n static styles = [ensembleCSS, ctaBannerCSS];\n\n @property({ type: String })\n title = \"\";\n @property({ type: String })\n description = \"\";\n @property({ type: String })\n caption = \"\";\n\n render() {\n return html`\n <div class=\"bd-ensemble bd-ctabanner-container\">\n ${this.title\n ? html`\n <bd-h as=\"h2\" color=\"on-brand\" class=\"bd-ctabanner-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n `\n : nothing}\n\n ${this.description\n ? html`\n <bd-p variant=\"large\" color=\"on-brand\" class=\"bd-ctabanner-description\">\n <slot name=\"description\">${this.description}</slot>\n </bd-p>\n `\n : nothing}\n\n <div class=\"bd-ctabanner-cta\">\n <slot name=\"primary-button\"></slot>\n <slot name=\"secondary-button\"></slot>\n </div>\n\n ${this.caption\n ? html`\n <bd-p variant=\"small\" font-family=\"mono\" class=\"bd-ctabanner-caption\">\n <slot name=\"caption\">${this.caption}</slot>\n </bd-p>\n `\n : nothing}\n\n <!-- Freeform slot for extra content below the caption — contact\n info, legal disclaimers, links, etc. Empty by default,\n collapses to nothing when unused. -->\n <div class=\"bd-ctabanner-footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-cta-banner\": CtaBanner;\n }\n}"],"mappings":"A,qaAUA,IACMI,EADN,cACwBC,CAAW,C,8BAIzB,KAAA,MAAA,GAEM,KAAA,YAAA,GAEJ,KAAA,QAAA,E,QAPM,KAAA,OAAA,CAACE,EAAaP,CAAY,C,CAS1C,QAAS,CACP,MAAO,EAAI;;UAEL,KAAK,MACH,CAAI;;qCAEqB,KAAK,MAAM;;cAGpCQ,EAAQ;;UAEV,KAAK,YACH,CAAI;;2CAE2B,KAAK,YAAY;;cAGhDA,EAAQ;;;;;;;UAOV,KAAK,QACH,CAAI;;uCAEuB,KAAK,QAAQ;;cAGxCA,EAAQ;;;;;;;;;KAUlB,CACF,EAhDGP,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAL,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAL,EAAA,UAAA,cAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAQ,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAL,EAAA,UAAA,UAAA,IAAA,EAAA,EAR3B,EAAAH,EAAA,CAAAS,EAAc,eAAe,CAAA,EAAAN,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{display:block}.grid{--grid-cols-active:var(--grid-cols);--grid-gap-active:var(--grid-gap,var(--spacing-24));grid-template-columns:repeat(var(--grid-cols-active), 1fr);place-items:stretch start;gap:var(--grid-gap-active);display:grid}@media (width>=576px){.grid{--grid-cols-active:var(--grid-cols-sm);--grid-gap-active:var(--grid-gap-sm,var(--spacing-24))}}@media (width>=768px){.grid{--grid-cols-active:var(--grid-cols-md);--grid-gap-active:var(--grid-gap-md,var(--spacing-24))}}@media (width>=992px){.grid{--grid-cols-active:var(--grid-cols-lg);--grid-gap-active:var(--grid-gap-lg,var(--spacing-24))}}.grid.grid--fit{grid-template-columns:repeat(auto-fill, minmax(min(100%, max(var(--grid-min-col-width), (100% - var(--grid-cols-active) * var(--grid-gap-active)) / var(--grid-cols-active))), 1fr))}`;export{t as default};
|
|
1
|
+
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{display:block}.grid{--grid-cols-active:var(--grid-cols);--grid-gap-active:var(--grid-gap,var(--spacing-24));grid-template-columns:repeat(var(--grid-cols-active), 1fr);place-items:stretch start;gap:var(--grid-gap-active);display:grid}@media (width>=576px){.grid{--grid-cols-active:var(--grid-cols-sm);--grid-gap-active:var(--grid-gap-sm,var(--spacing-24))}}@media (width>=768px){.grid{--grid-cols-active:var(--grid-cols-md);--grid-gap-active:var(--grid-gap-md,var(--spacing-24))}}@media (width>=992px){.grid{--grid-cols-active:var(--grid-cols-lg);--grid-gap-active:var(--grid-gap-lg,var(--spacing-24))}}.grid.grid--fit{grid-template-columns:repeat(auto-fill, minmax(min(100%, max(var(--grid-min-col-width), (100% - var(--grid-cols-active) * var(--grid-gap-active)) / var(--grid-cols-active))), 1fr))}.grid--rows{row-gap:0;margin-block-end:calc(-1 * var(--grid-gap-active))}.grid--rows ::slotted(*){grid-template-rows:subgrid;grid-row:span var(--grid-item-rows);margin-block-end:var(--grid-gap-active);display:grid}`;export{t as default};
|
|
2
2
|
//# sourceMappingURL=grid.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.css.js","names":["grid_css_default"],"sources":["../../../../src/components/grid/grid.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above } from \"#shared/token-scales.ts\";\n\n/* The column steps follow the screen: cols, then cols-sm, cols-md and\n cols-lg from 576, 768 and 992 -- the sm, md and lg every other breakpoint\n in this package means. A grid's steps are a page's structure, and that is\n a question about the screen; it can answer differently at the same width\n in two places -- a 492 grid across a 600 screen and a 518 one beside the\n stat highlight at 1280 hold different layouts on the homepage.\n\n 2.6.0 stepped by the grid's own width instead, at the page column's widths\n (492, 656, 880). A grid as wide as the page stepped where it always had; a\n narrower one never reached its upper steps, so the homepage's stat tiles,\n two across beside the highlight since they were drawn, stacked one a row\n on every desktop, and bd-footer opted its grid out to keep its layout.\n Nothing that was measured gained from it, so the steps read the screen\n again.\n\n What reading its own width was for -- a 3-column step taken at a 992\n screen gave a 360 column 104px cells -- is min-col-width's: each step's\n count becomes the most columns there will be, and a column is never\n narrower than min-col-width, so a grid in a narrow column takes fewer,\n wider ones, wherever it is laid out. It asks the cells, which is the\n question a collection has, where the page's widths could only be answered\n by a grid as wide as the page. */\nexport default css`\n :host {\n display: block;\n }\n\n /* Each step below says only which columns and which gap apply; they are\n laid out here, once, so that min-col-width reads the same two. */\n .grid {\n display: grid;\n align-items: stretch;\n justify-items: start;\n --grid-cols-active: var(--grid-cols);\n --grid-gap-active: var(--grid-gap, var(--spacing-24));\n grid-template-columns: repeat(var(--grid-cols-active), 1fr);\n gap: var(--grid-gap-active);\n }\n\n /* The columns and the gap step together; a gap left unset carries the\n one below it up. */\n @media ${unsafeCSS(above('sm'))} {\n .grid {\n --grid-cols-active: var(--grid-cols-sm);\n --grid-gap-active: var(--grid-gap-sm, var(--spacing-24));\n }\n }\n\n @media ${unsafeCSS(above('md'))} {\n .grid {\n --grid-cols-active: var(--grid-cols-md);\n --grid-gap-active: var(--grid-gap-md, var(--spacing-24));\n }\n }\n\n @media ${unsafeCSS(above('lg'))} {\n .grid {\n --grid-cols-active: var(--grid-cols-lg);\n --grid-gap-active: var(--grid-gap-lg, var(--spacing-24));\n }\n }\n\n /* min-col-width: as many columns as fit at min-col-width, up to the\n step's count. auto-fill takes as many as fit; the second term of max()\n is what holds it to the count -- a column at least the grid less the\n count's gaps, over the count, leaves no room for one more, with a gap\n to spare so rounding cannot drop one either; and min(100%, ...) keeps\n one column inside a grid narrower than the floor. The columns then\n share what is left, as 1fr always has. */\n .grid.grid--fit {\n grid-template-columns: repeat(auto-fill, minmax(min(100%, max(\n var(--grid-min-col-width),\n (100% - var(--grid-cols-active) * var(--grid-gap-active)) / var(--grid-cols-active)\n )), 1fr));\n }\n`;\n"],"mappings":"A,4DAyBA,IAAAA,EAAe,CAAG,
|
|
1
|
+
{"version":3,"file":"grid.css.js","names":["grid_css_default"],"sources":["../../../../src/components/grid/grid.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above } from \"#shared/token-scales.ts\";\n\n/* The column steps follow the screen: cols, then cols-sm, cols-md and\n cols-lg from 576, 768 and 992 -- the sm, md and lg every other breakpoint\n in this package means. A grid's steps are a page's structure, and that is\n a question about the screen; it can answer differently at the same width\n in two places -- a 492 grid across a 600 screen and a 518 one beside the\n stat highlight at 1280 hold different layouts on the homepage.\n\n 2.6.0 stepped by the grid's own width instead, at the page column's widths\n (492, 656, 880). A grid as wide as the page stepped where it always had; a\n narrower one never reached its upper steps, so the homepage's stat tiles,\n two across beside the highlight since they were drawn, stacked one a row\n on every desktop, and bd-footer opted its grid out to keep its layout.\n Nothing that was measured gained from it, so the steps read the screen\n again.\n\n What reading its own width was for -- a 3-column step taken at a 992\n screen gave a 360 column 104px cells -- is min-col-width's: each step's\n count becomes the most columns there will be, and a column is never\n narrower than min-col-width, so a grid in a narrow column takes fewer,\n wider ones, wherever it is laid out. It asks the cells, which is the\n question a collection has, where the page's widths could only be answered\n by a grid as wide as the page. */\nexport default css`\n :host {\n display: block;\n }\n\n /* Each step below says only which columns and which gap apply; they are\n laid out here, once, so that min-col-width reads the same two. */\n .grid {\n display: grid;\n align-items: stretch;\n justify-items: start;\n --grid-cols-active: var(--grid-cols);\n --grid-gap-active: var(--grid-gap, var(--spacing-24));\n grid-template-columns: repeat(var(--grid-cols-active), 1fr);\n gap: var(--grid-gap-active);\n }\n\n /* The columns and the gap step together; a gap left unset carries the\n one below it up. */\n @media ${unsafeCSS(above('sm'))} {\n .grid {\n --grid-cols-active: var(--grid-cols-sm);\n --grid-gap-active: var(--grid-gap-sm, var(--spacing-24));\n }\n }\n\n @media ${unsafeCSS(above('md'))} {\n .grid {\n --grid-cols-active: var(--grid-cols-md);\n --grid-gap-active: var(--grid-gap-md, var(--spacing-24));\n }\n }\n\n @media ${unsafeCSS(above('lg'))} {\n .grid {\n --grid-cols-active: var(--grid-cols-lg);\n --grid-gap-active: var(--grid-gap-lg, var(--spacing-24));\n }\n }\n\n /* min-col-width: as many columns as fit at min-col-width, up to the\n step's count. auto-fill takes as many as fit; the second term of max()\n is what holds it to the count -- a column at least the grid less the\n count's gaps, over the count, leaves no room for one more, with a gap\n to spare so rounding cannot drop one either; and min(100%, ...) keeps\n one column inside a grid narrower than the floor. The columns then\n share what is left, as 1fr always has. */\n .grid.grid--fit {\n grid-template-columns: repeat(auto-fill, minmax(min(100%, max(\n var(--grid-min-col-width),\n (100% - var(--grid-cols-active) * var(--grid-gap-active)) / var(--grid-cols-active)\n )), 1fr));\n }\n\n /* item-rows: every item spans that many of the grid's rows as a subgrid,\n so its parts sit in rows it shares with the items beside it and line\n up across them, however each one's text wraps. The gap inside an item\n is the item's own row-gap.\n\n The track's row gap is 0 and the items are spaced by a margin under\n each one instead, the grid's gap, which the grid hands back under its\n last row: a subgrid's row-gap differing from its grid's is laid out by\n spreading the difference over the item's edges, so the gap between two\n items and the one inside each came out at neither value (40 and 8\n measured 46 and 14 in Chromium). bd-card's track does the same.\n\n A subgrid cannot be a size container -- containment makes it a grid of\n its own -- so an item laid out by its own width (container-type) does\n not line up here. A light-DOM item's own display or margin rule beats\n these, since the page's styles win over a shadow root's ::slotted(). */\n .grid--rows {\n row-gap: 0;\n margin-block-end: calc(-1 * var(--grid-gap-active));\n }\n\n .grid--rows ::slotted(*) {\n display: grid;\n grid-template-rows: subgrid;\n grid-row: span var(--grid-item-rows);\n margin-block-end: var(--grid-gap-active);\n }\n`;\n"],"mappings":"A,4DAyBA,IAAAA,EAAe,CAAG,8/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{space as t}from"../shared/token-scales.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import r from"./grid.css.js";import{LitElement as i,html as a}from"lit";import{property as o}from"lit/decorators.js";var s=class extends i{constructor(...e){super(...e),this.cols=1,this.colsSm=1,this.colsMd=2,this.colsLg=3,this.gap=`md`,this.gapSm=``,this.gapMd=``,this.gapLg=``,this.align=`stretch`,this.justify=`start`,this.padding=`none`,this.minColWidth=0}static{this.styles=[r]}render(){return a`
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{space as t}from"../shared/token-scales.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import r from"./grid.css.js";import{LitElement as i,html as a}from"lit";import{property as o}from"lit/decorators.js";var s=class extends i{constructor(...e){super(...e),this.cols=1,this.colsSm=1,this.colsMd=2,this.colsLg=3,this.gap=`md`,this.gapSm=``,this.gapMd=``,this.gapLg=``,this.align=`stretch`,this.justify=`start`,this.padding=`none`,this.minColWidth=0,this.itemRows=0}static{this.styles=[r]}render(){return a`
|
|
2
2
|
<div
|
|
3
|
-
class="grid ${this.minColWidth>0?`grid--fit`:``}"
|
|
3
|
+
class="grid ${this.minColWidth>0?`grid--fit`:``} ${this.itemRows>0?`grid--rows`:``}"
|
|
4
4
|
style="
|
|
5
5
|
--grid-cols: ${this.cols};
|
|
6
6
|
--grid-cols-sm: ${this.colsSm};
|
|
@@ -14,9 +14,10 @@ import{defineElement as e}from"../shared/define-element.js";import"../../tokens/
|
|
|
14
14
|
justify-items: ${this.justify};
|
|
15
15
|
padding: ${t(this.padding)};
|
|
16
16
|
${this.minColWidth>0?`--grid-min-col-width: ${this.minColWidth/16}rem;`:``}
|
|
17
|
+
${this.itemRows>0?`--grid-item-rows: ${Math.round(this.itemRows)};`:``}
|
|
17
18
|
"
|
|
18
19
|
>
|
|
19
20
|
<slot></slot>
|
|
20
21
|
</div>
|
|
21
|
-
`}};n([o({type:Number})],s.prototype,`cols`,void 0),n([o({type:Number,attribute:`cols-sm`})],s.prototype,`colsSm`,void 0),n([o({type:Number,attribute:`cols-md`})],s.prototype,`colsMd`,void 0),n([o({type:Number,attribute:`cols-lg`})],s.prototype,`colsLg`,void 0),n([o({type:String})],s.prototype,`gap`,void 0),n([o({type:String,attribute:`gap-sm`})],s.prototype,`gapSm`,void 0),n([o({type:String,attribute:`gap-md`})],s.prototype,`gapMd`,void 0),n([o({type:String,attribute:`gap-lg`})],s.prototype,`gapLg`,void 0),n([o({type:String})],s.prototype,`align`,void 0),n([o({type:String})],s.prototype,`justify`,void 0),n([o({type:String})],s.prototype,`padding`,void 0),n([o({type:Number,attribute:`min-col-width`})],s.prototype,`minColWidth`,void 0),s=n([e(`bd-grid`)],s);
|
|
22
|
+
`}};n([o({type:Number})],s.prototype,`cols`,void 0),n([o({type:Number,attribute:`cols-sm`})],s.prototype,`colsSm`,void 0),n([o({type:Number,attribute:`cols-md`})],s.prototype,`colsMd`,void 0),n([o({type:Number,attribute:`cols-lg`})],s.prototype,`colsLg`,void 0),n([o({type:String})],s.prototype,`gap`,void 0),n([o({type:String,attribute:`gap-sm`})],s.prototype,`gapSm`,void 0),n([o({type:String,attribute:`gap-md`})],s.prototype,`gapMd`,void 0),n([o({type:String,attribute:`gap-lg`})],s.prototype,`gapLg`,void 0),n([o({type:String})],s.prototype,`align`,void 0),n([o({type:String})],s.prototype,`justify`,void 0),n([o({type:String})],s.prototype,`padding`,void 0),n([o({type:Number,attribute:`min-col-width`})],s.prototype,`minColWidth`,void 0),n([o({type:Number,attribute:`item-rows`})],s.prototype,`itemRows`,void 0),s=n([e(`bd-grid`)],s);
|
|
22
23
|
//# sourceMappingURL=grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.js","names":["gridCSS","_decorate","__decorate","grid_css_default","BdGrid","LitElement","_args","space","property","defineElement"],"sources":["../../../../src/components/grid/grid.ts"],"sourcesContent":["import { LitElement, html } 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 gridCSS from \"#components/grid/grid.css.ts\";\nimport { space, type SpaceName } from \"#shared/token-scales.ts\";\n\ntype Align = \"start\" | \"center\" | \"end\" | \"stretch\";\ntype Justify = \"start\" | \"center\" | \"end\" | \"stretch\";\n\n@defineElement(\"bd-grid\")\nclass BdGrid extends LitElement {\n static styles = [gridCSS];\n\n /* The three responsive properties name their attribute, and that is the\n whole fix. Lit derives an observed attribute by LOWERCASING the property\n name -- not by dash-casing it -- so `colsSm` observed `colssm` and the\n `cols-sm` this component documents was not an attribute it had ever been\n listening for. observedAttributes read\n [\"cols\",\"colssm\",\"colsmd\",\"colslg\",\"gap\",\"align\",\"justify\",\"padding\"];\n `cols` worked because it is one word, which is why the failure looked like\n a responsive bug rather than a naming one.\n\n So every dash-cased column attribute in the package was inert and the\n properties kept their constructor defaults 1/1/2/3. Those defaults sit one\n step under the 2/3/4 the Responsive columns story asks for, which is why\n the rendered grid looked merely one breakpoint late instead of ignoring\n the markup entirely. Measured across five stories x six viewports, 25 of\n 66 readings rendered a column count nobody had asked for:\n\n Layout/Grid \"Single column\" cols-lg=\"1\" -> 3 columns at 992 and 1440\n Layout/Grid \"Gap scale\" cols-sm=\"3\" -> 1 column at 576-767\n Layout/Grid \"Alignment\" cols-sm=\"3\" -> 1 column at 576-767\n bd-footer quick links cols-lg=\"2\" -> 3 columns at 992 and 1440\n\n The last one is not a story: footer.ts writes cols-md/cols-lg in its own\n shadow root, so a shipped component's layout was running on the defaults\n too.\n\n Naming the attribute is what this package already does everywhere else --\n 94 explicit dash-cased mappings across 40 files, `heading-level`,\n `visual-level`, `max-columns`, `min-card-width` -- and it is what the\n component's own documentation promises: grid.stories.ts reads \"`cols`\n below 576, then `cols-sm`, `cols-md` at 768 and `cols-lg` at 992\", and its\n argTypes map colsSm to the control name \"cols-sm\". The code was the only\n part that disagreed.\n\n An explicit name replaces the lowercase one rather than adding to it, so\n `colssm` stops being observed. Nothing reads it: grepped for colssm,\n colsmd, colslg and fallbacksrc across src, schemas and docs -- zero\n occurrences outside these declarations. The responsive behaviour itself is\n untouched; the media queries in grid.css.ts and the 576/768/992 steps are\n the ones that were already there, and this adds no smartness to a layout\n primitive -- it only lets the primitive hear what it is told. */\n @property({ type: Number })\n cols = 1; // default cols\n @property({ type: Number, attribute: \"cols-sm\" })\n colsSm = 1; // optional cols on small screens\n @property({ type: Number, attribute: \"cols-md\" })\n colsMd = 2; // optional cols on medium\n @property({ type: Number, attribute: \"cols-lg\" })\n colsLg = 3; // optional cols on large\n @property({ type: String })\n gap: SpaceName = \"md\"; // e.g., 'sm', 'md'\n @property({ type: String, attribute: \"gap-sm\" })\n gapSm: SpaceName | \"\" = \"\"; // optional gap from sm; unset keeps the step below\n @property({ type: String, attribute: \"gap-md\" })\n gapMd: SpaceName | \"\" = \"\"; // optional gap from md\n @property({ type: String, attribute: \"gap-lg\" })\n gapLg: SpaceName | \"\" = \"\"; // optional gap from lg\n @property({ type: String })\n align: Align = \"stretch\"; // start, center, end, stretch\n @property({ type: String })\n justify: Justify = \"start\"; // start, center, end, stretch: justify-items takes no space-between\n @property({ type: String })\n padding: SpaceName = \"none\"; // e.g., 'none', 'sm', 'md', 'lg'\n /* The narrowest a column may be. Unset, each step's count is the\n columns there are; set, it is the most there will be, and the grid\n takes fewer, wider ones where that many would not fit (grid.css.ts).\n A number of px at the default text size, laid out in rem: a cell holds\n text, so its floor grows with the reader's text, as the gaps do. */\n @property({ type: Number, attribute: \"min-col-width\" })\n minColWidth = 0;\n\n render() {\n return html`\n <div\n class=\"grid ${this.minColWidth > 0 ? \"grid--fit\" : \"\"}\"\n style=\"\n --grid-cols: ${this.cols};\n --grid-cols-sm: ${this.colsSm};\n --grid-cols-md: ${this.colsMd};\n --grid-cols-lg: ${this.colsLg};\n ${space(this.gap) ? `--grid-gap: ${space(this.gap)};` : \"\"}\n --grid-gap-sm: ${space(this.gapSm) || \"var(--grid-gap)\"};\n --grid-gap-md: ${space(this.gapMd) || \"var(--grid-gap-sm)\"};\n --grid-gap-lg: ${space(this.gapLg) || \"var(--grid-gap-md)\"};\n align-items: ${this.align};\n justify-items: ${this.justify};\n padding: ${space(this.padding)};\n ${this.minColWidth > 0 ? `--grid-min-col-width: ${this.minColWidth / 16}rem;` : \"\"}\n \"\n >\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-grid\": BdGrid;\n }\n}\n"],"mappings":"A,4UAWA,IACMI,EADN,cACqBC,CAAW,C,8BA4CvB,KAAA,KAAA,EAEE,KAAA,OAAA,EAEA,KAAA,OAAA,EAEA,KAAA,OAAA,EAEQ,KAAA,IAAA,KAEO,KAAA,MAAA,GAEA,KAAA,MAAA,GAEA,KAAA,MAAA,GAET,KAAA,MAAA,UAEI,KAAA,QAAA,QAEE,KAAA,QAAA,OAOP,KAAA,YAAA,C,
|
|
1
|
+
{"version":3,"file":"grid.js","names":["gridCSS","_decorate","__decorate","grid_css_default","BdGrid","LitElement","_args","space","property","defineElement"],"sources":["../../../../src/components/grid/grid.ts"],"sourcesContent":["import { LitElement, html } 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 gridCSS from \"#components/grid/grid.css.ts\";\nimport { space, type SpaceName } from \"#shared/token-scales.ts\";\n\ntype Align = \"start\" | \"center\" | \"end\" | \"stretch\";\ntype Justify = \"start\" | \"center\" | \"end\" | \"stretch\";\n\n@defineElement(\"bd-grid\")\nclass BdGrid extends LitElement {\n static styles = [gridCSS];\n\n /* The three responsive properties name their attribute, and that is the\n whole fix. Lit derives an observed attribute by LOWERCASING the property\n name -- not by dash-casing it -- so `colsSm` observed `colssm` and the\n `cols-sm` this component documents was not an attribute it had ever been\n listening for. observedAttributes read\n [\"cols\",\"colssm\",\"colsmd\",\"colslg\",\"gap\",\"align\",\"justify\",\"padding\"];\n `cols` worked because it is one word, which is why the failure looked like\n a responsive bug rather than a naming one.\n\n So every dash-cased column attribute in the package was inert and the\n properties kept their constructor defaults 1/1/2/3. Those defaults sit one\n step under the 2/3/4 the Responsive columns story asks for, which is why\n the rendered grid looked merely one breakpoint late instead of ignoring\n the markup entirely. Measured across five stories x six viewports, 25 of\n 66 readings rendered a column count nobody had asked for:\n\n Layout/Grid \"Single column\" cols-lg=\"1\" -> 3 columns at 992 and 1440\n Layout/Grid \"Gap scale\" cols-sm=\"3\" -> 1 column at 576-767\n Layout/Grid \"Alignment\" cols-sm=\"3\" -> 1 column at 576-767\n bd-footer quick links cols-lg=\"2\" -> 3 columns at 992 and 1440\n\n The last one is not a story: footer.ts writes cols-md/cols-lg in its own\n shadow root, so a shipped component's layout was running on the defaults\n too.\n\n Naming the attribute is what this package already does everywhere else --\n 94 explicit dash-cased mappings across 40 files, `heading-level`,\n `visual-level`, `max-columns`, `min-card-width` -- and it is what the\n component's own documentation promises: grid.stories.ts reads \"`cols`\n below 576, then `cols-sm`, `cols-md` at 768 and `cols-lg` at 992\", and its\n argTypes map colsSm to the control name \"cols-sm\". The code was the only\n part that disagreed.\n\n An explicit name replaces the lowercase one rather than adding to it, so\n `colssm` stops being observed. Nothing reads it: grepped for colssm,\n colsmd, colslg and fallbacksrc across src, schemas and docs -- zero\n occurrences outside these declarations. The responsive behaviour itself is\n untouched; the media queries in grid.css.ts and the 576/768/992 steps are\n the ones that were already there, and this adds no smartness to a layout\n primitive -- it only lets the primitive hear what it is told. */\n @property({ type: Number })\n cols = 1; // default cols\n @property({ type: Number, attribute: \"cols-sm\" })\n colsSm = 1; // optional cols on small screens\n @property({ type: Number, attribute: \"cols-md\" })\n colsMd = 2; // optional cols on medium\n @property({ type: Number, attribute: \"cols-lg\" })\n colsLg = 3; // optional cols on large\n @property({ type: String })\n gap: SpaceName = \"md\"; // e.g., 'sm', 'md'\n @property({ type: String, attribute: \"gap-sm\" })\n gapSm: SpaceName | \"\" = \"\"; // optional gap from sm; unset keeps the step below\n @property({ type: String, attribute: \"gap-md\" })\n gapMd: SpaceName | \"\" = \"\"; // optional gap from md\n @property({ type: String, attribute: \"gap-lg\" })\n gapLg: SpaceName | \"\" = \"\"; // optional gap from lg\n @property({ type: String })\n align: Align = \"stretch\"; // start, center, end, stretch\n @property({ type: String })\n justify: Justify = \"start\"; // start, center, end, stretch: justify-items takes no space-between\n @property({ type: String })\n padding: SpaceName = \"none\"; // e.g., 'none', 'sm', 'md', 'lg'\n /* The narrowest a column may be. Unset, each step's count is the\n columns there are; set, it is the most there will be, and the grid\n takes fewer, wider ones where that many would not fit (grid.css.ts).\n A number of px at the default text size, laid out in rem: a cell holds\n text, so its floor grows with the reader's text, as the gaps do. */\n @property({ type: Number, attribute: \"min-col-width\" })\n minColWidth = 0;\n /* Rows each item shares with the items beside it. Unset, an item is one\n cell and lays itself out; set, every item is a subgrid of that many of\n the grid's rows (grid.css.ts), so the parts of one item -- a link over\n its line, a card's title over its copy -- line up with the same parts of\n its neighbours however differently their text wraps. The item places its\n parts in those rows; one that leaves a row empty leaves it at the height\n its neighbours give it. */\n @property({ type: Number, attribute: \"item-rows\" })\n itemRows = 0;\n\n render() {\n return html`\n <div\n class=\"grid ${this.minColWidth > 0 ? \"grid--fit\" : \"\"} ${this.itemRows > 0 ? \"grid--rows\" : \"\"}\"\n style=\"\n --grid-cols: ${this.cols};\n --grid-cols-sm: ${this.colsSm};\n --grid-cols-md: ${this.colsMd};\n --grid-cols-lg: ${this.colsLg};\n ${space(this.gap) ? `--grid-gap: ${space(this.gap)};` : \"\"}\n --grid-gap-sm: ${space(this.gapSm) || \"var(--grid-gap)\"};\n --grid-gap-md: ${space(this.gapMd) || \"var(--grid-gap-sm)\"};\n --grid-gap-lg: ${space(this.gapLg) || \"var(--grid-gap-md)\"};\n align-items: ${this.align};\n justify-items: ${this.justify};\n padding: ${space(this.padding)};\n ${this.minColWidth > 0 ? `--grid-min-col-width: ${this.minColWidth / 16}rem;` : \"\"}\n ${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,CAAAQ,EAAc,SAAS,CAAA,EAAAL,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement, nothing, type PropertyValues } from "lit";
|
|
2
|
+
import "../../tokens/tokens.js";
|
|
2
3
|
import "../button/button.js";
|
|
3
4
|
import "../heading/heading.js";
|
|
4
5
|
import "../paragraph/paragraph.js";
|
|
@@ -29,9 +30,9 @@ declare class HeaderCode extends LitElement {
|
|
|
29
30
|
_onPointerMove(event: PointerEvent): void;
|
|
30
31
|
_onPointerLeave(): void;
|
|
31
32
|
_onBadgeSlotChange(event: Event): void;
|
|
32
|
-
_renderRings(): import("lit-html").TemplateResult<1
|
|
33
|
+
_renderRings(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
33
34
|
_renderBadge(): import("lit-html").TemplateResult<1>;
|
|
34
|
-
_renderMeta(): import("lit-html").TemplateResult<1
|
|
35
|
+
_renderMeta(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
35
36
|
/**
|
|
36
37
|
* Level is the document-outline question and belongs to page composition;
|
|
37
38
|
* the type scale is this component's and stays where it was. visual-level
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import
|
|
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"../button/button.js";import r from"./header-code.css.js";import"../terminal/terminal-message.js";import{LitElement as i,html as a,nothing as o}from"lit";import{property as s,state as c}from"lit/decorators.js";var l=class extends i{static{this.styles=[n,r]}constructor(){super(),this.eyebrow=``,this.title=``,this.headingLevel=2,this.description=``,this.terminalCaption=``,this.variant=`default`,this.metaSpec=``,this.metaFacts=[],this._hasBadge=!1,this._scene=null,this._onPointerMove=this._onPointerMove.bind(this),this._onPointerLeave=this._onPointerLeave.bind(this)}firstUpdated(){this._bindScene()}updated(e){e.has(`variant`)&&this._bindScene()}disconnectedCallback(){super.disconnectedCallback(),this._unbindScene()}_bindScene(){this._unbindScene(),this.variant===`tint`&&(this._scene=this.shadowRoot?.querySelector(`.bd-headercode-scene`)||null,this._scene&&(this._scene.addEventListener(`pointermove`,this._onPointerMove),this._scene.addEventListener(`pointerleave`,this._onPointerLeave)))}_unbindScene(){this._scene&&=(this._scene.removeEventListener(`pointermove`,this._onPointerMove),this._scene.removeEventListener(`pointerleave`,this._onPointerLeave),null)}_onPointerMove(e){let t=this._scene.getBoundingClientRect(),n=(e.clientX-t.left)/t.width-.5,r=(e.clientY-t.top)/t.height-.5,i=n*18,a=-r*12;this.style.setProperty(`--rx`,`${a.toFixed(2)}deg`),this.style.setProperty(`--ry`,`${i.toFixed(2)}deg`)}_onPointerLeave(){this.style.removeProperty(`--rx`),this.style.removeProperty(`--ry`)}_onBadgeSlotChange(e){this._hasBadge=e.target.assignedNodes({flatten:!0}).length>0}_renderRings(){return this.variant===`tint`?a`
|
|
2
2
|
<div class="bd-headercode-rings" aria-hidden="true">
|
|
3
3
|
<span class="bd-headercode-ring" style="--d:1"></span>
|
|
4
4
|
<span class="bd-headercode-ring" style="--d:2"></span>
|
|
@@ -6,18 +6,18 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
|
|
|
6
6
|
<span class="bd-headercode-ring" style="--d:4"></span>
|
|
7
7
|
<span class="bd-headercode-ring" style="--d:5"></span>
|
|
8
8
|
</div>
|
|
9
|
-
`:
|
|
9
|
+
`:o}_renderBadge(){let e=a`<slot name="badge" @slotchange=${this._onBadgeSlotChange}></slot>`;return this._hasBadge?a`<span class="bd-headercode-badge">${e}</span>`:a`<span class="bd-headercode-badge-slot-holder" hidden>${e}</span>`}_renderMeta(){let e=!!this.metaSpec,t=this.metaFacts&&this.metaFacts.length>0;return!e&&!t?o:a`
|
|
10
10
|
<div class="bd-headercode-meta">
|
|
11
|
-
${e?
|
|
11
|
+
${e?a`<bd-p
|
|
12
12
|
variant="xsmall"
|
|
13
13
|
class="bd-headercode-meta-spec"
|
|
14
14
|
font-family="mono"
|
|
15
15
|
letter-spacing="widest"
|
|
16
|
-
>${this.metaSpec}</bd-p>`:
|
|
16
|
+
>${this.metaSpec}</bd-p>`:o}
|
|
17
17
|
|
|
18
|
-
${t?
|
|
18
|
+
${t?a`
|
|
19
19
|
<div class="bd-headercode-meta-facts">
|
|
20
|
-
${this.metaFacts.map(e=>
|
|
20
|
+
${this.metaFacts.map(e=>a`
|
|
21
21
|
<div class="bd-headercode-meta-fact">
|
|
22
22
|
<bd-p
|
|
23
23
|
variant="xsmall"
|
|
@@ -29,22 +29,22 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
|
|
|
29
29
|
</div>
|
|
30
30
|
`)}
|
|
31
31
|
</div>
|
|
32
|
-
`:
|
|
32
|
+
`:o}
|
|
33
33
|
</div>
|
|
34
|
-
`}get _headingTag(){let e=Number(this.headingLevel);return Number.isInteger(e)&&e>=1&&e<=6?`h${e}`:`h2`}render(){return
|
|
34
|
+
`}get _headingTag(){let e=Number(this.headingLevel);return Number.isInteger(e)&&e>=1&&e<=6?`h${e}`:`h2`}render(){return a`
|
|
35
35
|
<div class="bd-ensemble bd-headercode-container">
|
|
36
36
|
<div class="bd-headercode-left">
|
|
37
37
|
<div class="bd-headercode-breadcrumb">
|
|
38
38
|
<slot name="breadcrumb"></slot>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
${this.eyebrow?
|
|
41
|
+
${this.eyebrow?a`<bd-p variant="eyebrow" class="bd-headercode-eyebrow">${this.eyebrow}</bd-p>`:o}
|
|
42
42
|
|
|
43
43
|
<bd-h as="${this._headingTag}" visual-level="h1" class="bd-headercode-title">
|
|
44
44
|
<slot name="title">${this.title}</slot>
|
|
45
45
|
</bd-h>
|
|
46
46
|
|
|
47
|
-
${this.description?
|
|
47
|
+
${this.description?a`<bd-p variant="regular" class="bd-headercode-description">${this.description}</bd-p>`:o}
|
|
48
48
|
|
|
49
49
|
<div class="bd-headercode-cta">
|
|
50
50
|
<slot name="primary-button"></slot>
|
|
@@ -72,9 +72,9 @@ import{defineElement as e}from"../shared/define-element.js";import{tokens as t}f
|
|
|
72
72
|
<slot name="annotation-bottom"></slot>
|
|
73
73
|
</div>
|
|
74
74
|
|
|
75
|
-
${this.terminalCaption?
|
|
76
|
-
>${this.terminalCaption}</bd-p>`:
|
|
75
|
+
${this.terminalCaption?a`<bd-p variant="small" class="bd-headercode-terminal-caption" font-family="mono"
|
|
76
|
+
>${this.terminalCaption}</bd-p>`:o}
|
|
77
77
|
</div>
|
|
78
78
|
</div>
|
|
79
|
-
`}};
|
|
79
|
+
`}};t([s({type:String})],l.prototype,`eyebrow`,void 0),t([s({type:String})],l.prototype,`title`,void 0),t([s({type:Number,attribute:`heading-level`})],l.prototype,`headingLevel`,void 0),t([s({type:String})],l.prototype,`description`,void 0),t([s({type:String,attribute:`terminal-caption`})],l.prototype,`terminalCaption`,void 0),t([s({type:String,reflect:!0})],l.prototype,`variant`,void 0),t([s({type:String,attribute:`meta-spec`})],l.prototype,`metaSpec`,void 0),t([s({type:Array})],l.prototype,`metaFacts`,void 0),t([c()],l.prototype,`_hasBadge`,void 0),l=t([e(`bd-header-code`)],l);
|
|
80
80
|
//# sourceMappingURL=header-code.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-code.js","names":["headerCodeCSS","_decorate","__decorate","header_code_css_default","HeaderCode","LitElement","tokens","ensembleCSS","changed","rect","px","event","py","ry","rx","nothing","badgeSlot","hasSpec","hasFacts","fact","n","property","state","defineElement"],"sources":["../../../../src/components/header/header-code.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/button/button.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport \"#components/terminal/terminal-message.ts\";\nimport headerCodeCSS from \"./header-code.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\n\ntype Variant = \"default\" | \"tint\";\n\ninterface MetaFact {\n label: string;\n value: string;\n}\n\n@defineElement(\"bd-header-code\")\nclass HeaderCode extends LitElement {\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n title = \"\";\n @property({ type: Number, attribute: \"heading-level\" })\n headingLevel = 2;\n @property({ type: String })\n description = \"\";\n @property({ type: String, attribute: \"terminal-caption\" })\n terminalCaption = \"\";\n @property({ type: String, reflect: true })\n variant: Variant = \"default\";\n @property({ type: String, attribute: \"meta-spec\" })\n metaSpec = \"\";\n @property({ type: Array })\n metaFacts: MetaFact[] = [];\n @state()\n _hasBadge = false;\n\n static styles = [tokens, ensembleCSS, headerCodeCSS];\n\n _scene: HTMLElement | null;\n\n constructor() {\n super();\n this._scene = null;\n this._onPointerMove = this._onPointerMove.bind(this);\n this._onPointerLeave = this._onPointerLeave.bind(this);\n }\n\n firstUpdated() {\n this._bindScene();\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"variant\")) this._bindScene();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._unbindScene();\n }\n\n _bindScene() {\n this._unbindScene();\n if (this.variant !== \"tint\") return;\n\n this._scene = this.shadowRoot?.querySelector<HTMLElement>(\".bd-headercode-scene\") || null;\n if (!this._scene) return;\n\n this._scene.addEventListener(\"pointermove\", this._onPointerMove);\n this._scene.addEventListener(\"pointerleave\", this._onPointerLeave);\n }\n\n _unbindScene() {\n if (!this._scene) return;\n this._scene.removeEventListener(\"pointermove\", this._onPointerMove);\n this._scene.removeEventListener(\"pointerleave\", this._onPointerLeave);\n this._scene = null;\n }\n\n _onPointerMove(event: PointerEvent) {\n const rect = this._scene!.getBoundingClientRect();\n const px = (event.clientX - rect.left) / rect.width - 0.5;\n const py = (event.clientY - rect.top) / rect.height - 0.5;\n\n const ry = px * 18; // deg\n const rx = -py * 12; // deg\n\n this.style.setProperty(\"--rx\", `${rx.toFixed(2)}deg`);\n this.style.setProperty(\"--ry\", `${ry.toFixed(2)}deg`);\n }\n\n _onPointerLeave() {\n this.style.removeProperty(\"--rx\");\n this.style.removeProperty(\"--ry\");\n }\n\n _onBadgeSlotChange(event: Event) {\n this._hasBadge = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n\n _renderRings() {\n if (this.variant !== \"tint\") return nothing;\n\n return html`\n <div class=\"bd-headercode-rings\" aria-hidden=\"true\">\n <span class=\"bd-headercode-ring\" style=\"--d:1\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:2\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:3\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:4\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:5\"></span>\n </div>\n `;\n }\n\n _renderBadge() {\n const badgeSlot = html`<slot name=\"badge\" @slotchange=${this._onBadgeSlotChange}></slot>`;\n\n return this._hasBadge\n ? html`<span class=\"bd-headercode-badge\">${badgeSlot}</span>`\n : html`<span class=\"bd-headercode-badge-slot-holder\" hidden>${badgeSlot}</span>`;\n }\n\n _renderMeta() {\n const hasSpec = !!this.metaSpec;\n const hasFacts = this.metaFacts && this.metaFacts.length > 0;\n\n if (!hasSpec && !hasFacts) return nothing;\n\n\n return html`\n <div class=\"bd-headercode-meta\">\n ${hasSpec\n ? html`<bd-p\n variant=\"xsmall\"\n class=\"bd-headercode-meta-spec\"\n font-family=\"mono\"\n letter-spacing=\"widest\"\n >${this.metaSpec}</bd-p>`\n : nothing}\n\n ${hasFacts\n ? html`\n <div class=\"bd-headercode-meta-facts\">\n ${this.metaFacts.map(\n (fact) => html`\n <div class=\"bd-headercode-meta-fact\">\n <bd-p\n variant=\"xsmall\"\n class=\"bd-headercode-meta-fact-label\"\n font-family=\"mono\"\n letter-spacing=\"widest\"\n >${fact.label}</bd-p>\n <bd-p variant=\"regular\" font-weight=\"bold\" class=\"bd-headercode-meta-fact-value\">${fact.value}</bd-p>\n </div>\n `\n )}\n </div>\n `\n : nothing}\n </div>\n `;\n }\n\n\n /**\n * Level is the document-outline question and belongs to page composition;\n * the type scale is this component's and stays where it was. visual-level\n * pins the look at h1 so only the semantics move. Defaults to h2, because a\n * reusable section cannot know it is the page's only heading.\n */\n get _headingTag() {\n const n = Number(this.headingLevel);\n return Number.isInteger(n) && n >= 1 && n <= 6 ? `h${n}` : \"h2\";\n }\n\n render() {\n return html`\n <div class=\"bd-ensemble bd-headercode-container\">\n <div class=\"bd-headercode-left\">\n <div class=\"bd-headercode-breadcrumb\">\n <slot name=\"breadcrumb\"></slot>\n </div>\n\n ${this.eyebrow\n ? html`<bd-p variant=\"eyebrow\" class=\"bd-headercode-eyebrow\">${this.eyebrow}</bd-p>`\n : nothing}\n\n <bd-h as=\"${this._headingTag}\" visual-level=\"h1\" class=\"bd-headercode-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n\n ${this.description\n ? html`<bd-p variant=\"regular\" class=\"bd-headercode-description\">${this.description}</bd-p>`\n : nothing}\n\n <div class=\"bd-headercode-cta\">\n <slot name=\"primary-button\"></slot>\n <slot name=\"secondary-button\"></slot>\n ${this._renderBadge()}\n </div>\n\n ${this._renderMeta()}\n </div>\n\n <div class=\"bd-headercode-right\">\n <div class=\"bd-headercode-annotation bd-headercode-annotation--top\">\n <slot name=\"annotation-top\"></slot>\n </div>\n\n\n <div class=\"bd-headercode-scene\">\n <div class=\"bd-headercode-stack\">\n ${this._renderRings()}\n <slot name=\"terminal-content\"></slot>\n </div>\n </div>\n\n <div class=\"bd-headercode-annotation bd-headercode-annotation--bottom\">\n <slot name=\"annotation-bottom\"></slot>\n </div>\n\n ${this.terminalCaption\n ? html`<bd-p variant=\"small\" class=\"bd-headercode-terminal-caption\" font-family=\"mono\"\n>${this.terminalCaption}</bd-p>`\n : nothing}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\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K,aAAa,EAAE;;;;;;;;;YASxB,KAAK,gBACH,CAAI;GACf,KAAK,gBAAgB,SACVA,EAAQ;;;KAIpB,CACF,EApNGd,EAAA,CAAAoB,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAjB,EAAA,UAAA,UAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAoB,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAjB,EAAA,UAAA,QAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAoB,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,CAAA,EAAAjB,EAAA,UAAA,eAAA,IAAA,EAAA,EAErDH,EAAA,CAAAoB,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAjB,EAAA,UAAA,cAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAoB,EAAS,CAAE,KAAM,OAAQ,UAAW,kBAAmB,CAAC,CAAA,EAAAjB,EAAA,UAAA,kBAAA,IAAA,EAAA,EAExDH,EAAA,CAAAoB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAjB,EAAA,UAAA,UAAA,IAAA,EAAA,EAExCH,EAAA,CAAAoB,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,CAAA,EAAAjB,EAAA,UAAA,WAAA,IAAA,EAAA,EAEjDH,EAAA,CAAAoB,EAAS,CAAE,KAAM,KAAM,CAAC,CAAA,EAAAjB,EAAA,UAAA,YAAA,IAAA,EAAA,EAExBH,EAAA,CAAAqB,EAAM,CAAA,EAAAlB,EAAA,UAAA,YAAA,IAAA,EAAA,EAlBR,EAAAH,EAAA,CAAAsB,EAAc,gBAAgB,CAAA,EAAAnB,CAAA"}
|
|
1
|
+
{"version":3,"file":"header-code.js","names":["headerCodeCSS","_decorate","__decorate","header_code_css_default","HeaderCode","LitElement","ensembleCSS","changed","rect","px","event","py","ry","rx","nothing","badgeSlot","hasSpec","hasFacts","fact","n","property","state","defineElement"],"sources":["../../../../src/components/header/header-code.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/button/button.ts\";\nimport \"#components/heading/heading.ts\";\nimport \"#components/paragraph/paragraph.ts\";\nimport \"#components/terminal/terminal-message.ts\";\nimport headerCodeCSS from \"./header-code.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\n\ntype Variant = \"default\" | \"tint\";\n\ninterface MetaFact {\n label: string;\n value: string;\n}\n\n@defineElement(\"bd-header-code\")\nclass HeaderCode extends LitElement {\n @property({ type: String })\n eyebrow = \"\";\n @property({ type: String })\n title = \"\";\n @property({ type: Number, attribute: \"heading-level\" })\n headingLevel = 2;\n @property({ type: String })\n description = \"\";\n @property({ type: String, attribute: \"terminal-caption\" })\n terminalCaption = \"\";\n @property({ type: String, reflect: true })\n variant: Variant = \"default\";\n @property({ type: String, attribute: \"meta-spec\" })\n metaSpec = \"\";\n @property({ type: Array })\n metaFacts: MetaFact[] = [];\n @state()\n _hasBadge = false;\n\n static styles = [ensembleCSS, headerCodeCSS];\n\n _scene: HTMLElement | null;\n\n constructor() {\n super();\n this._scene = null;\n this._onPointerMove = this._onPointerMove.bind(this);\n this._onPointerLeave = this._onPointerLeave.bind(this);\n }\n\n firstUpdated() {\n this._bindScene();\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"variant\")) this._bindScene();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._unbindScene();\n }\n\n _bindScene() {\n this._unbindScene();\n if (this.variant !== \"tint\") return;\n\n this._scene = this.shadowRoot?.querySelector<HTMLElement>(\".bd-headercode-scene\") || null;\n if (!this._scene) return;\n\n this._scene.addEventListener(\"pointermove\", this._onPointerMove);\n this._scene.addEventListener(\"pointerleave\", this._onPointerLeave);\n }\n\n _unbindScene() {\n if (!this._scene) return;\n this._scene.removeEventListener(\"pointermove\", this._onPointerMove);\n this._scene.removeEventListener(\"pointerleave\", this._onPointerLeave);\n this._scene = null;\n }\n\n _onPointerMove(event: PointerEvent) {\n const rect = this._scene!.getBoundingClientRect();\n const px = (event.clientX - rect.left) / rect.width - 0.5;\n const py = (event.clientY - rect.top) / rect.height - 0.5;\n\n const ry = px * 18; // deg\n const rx = -py * 12; // deg\n\n this.style.setProperty(\"--rx\", `${rx.toFixed(2)}deg`);\n this.style.setProperty(\"--ry\", `${ry.toFixed(2)}deg`);\n }\n\n _onPointerLeave() {\n this.style.removeProperty(\"--rx\");\n this.style.removeProperty(\"--ry\");\n }\n\n _onBadgeSlotChange(event: Event) {\n this._hasBadge = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n\n\n _renderRings() {\n if (this.variant !== \"tint\") return nothing;\n\n return html`\n <div class=\"bd-headercode-rings\" aria-hidden=\"true\">\n <span class=\"bd-headercode-ring\" style=\"--d:1\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:2\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:3\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:4\"></span>\n <span class=\"bd-headercode-ring\" style=\"--d:5\"></span>\n </div>\n `;\n }\n\n _renderBadge() {\n const badgeSlot = html`<slot name=\"badge\" @slotchange=${this._onBadgeSlotChange}></slot>`;\n\n return this._hasBadge\n ? html`<span class=\"bd-headercode-badge\">${badgeSlot}</span>`\n : html`<span class=\"bd-headercode-badge-slot-holder\" hidden>${badgeSlot}</span>`;\n }\n\n _renderMeta() {\n const hasSpec = !!this.metaSpec;\n const hasFacts = this.metaFacts && this.metaFacts.length > 0;\n\n if (!hasSpec && !hasFacts) return nothing;\n\n\n return html`\n <div class=\"bd-headercode-meta\">\n ${hasSpec\n ? html`<bd-p\n variant=\"xsmall\"\n class=\"bd-headercode-meta-spec\"\n font-family=\"mono\"\n letter-spacing=\"widest\"\n >${this.metaSpec}</bd-p>`\n : nothing}\n\n ${hasFacts\n ? html`\n <div class=\"bd-headercode-meta-facts\">\n ${this.metaFacts.map(\n (fact) => html`\n <div class=\"bd-headercode-meta-fact\">\n <bd-p\n variant=\"xsmall\"\n class=\"bd-headercode-meta-fact-label\"\n font-family=\"mono\"\n letter-spacing=\"widest\"\n >${fact.label}</bd-p>\n <bd-p variant=\"regular\" font-weight=\"bold\" class=\"bd-headercode-meta-fact-value\">${fact.value}</bd-p>\n </div>\n `\n )}\n </div>\n `\n : nothing}\n </div>\n `;\n }\n\n\n /**\n * Level is the document-outline question and belongs to page composition;\n * the type scale is this component's and stays where it was. visual-level\n * pins the look at h1 so only the semantics move. Defaults to h2, because a\n * reusable section cannot know it is the page's only heading.\n */\n get _headingTag() {\n const n = Number(this.headingLevel);\n return Number.isInteger(n) && n >= 1 && n <= 6 ? `h${n}` : \"h2\";\n }\n\n render() {\n return html`\n <div class=\"bd-ensemble bd-headercode-container\">\n <div class=\"bd-headercode-left\">\n <div class=\"bd-headercode-breadcrumb\">\n <slot name=\"breadcrumb\"></slot>\n </div>\n\n ${this.eyebrow\n ? html`<bd-p variant=\"eyebrow\" class=\"bd-headercode-eyebrow\">${this.eyebrow}</bd-p>`\n : nothing}\n\n <bd-h as=\"${this._headingTag}\" visual-level=\"h1\" class=\"bd-headercode-title\">\n <slot name=\"title\">${this.title}</slot>\n </bd-h>\n\n ${this.description\n ? html`<bd-p variant=\"regular\" class=\"bd-headercode-description\">${this.description}</bd-p>`\n : nothing}\n\n <div class=\"bd-headercode-cta\">\n <slot name=\"primary-button\"></slot>\n <slot name=\"secondary-button\"></slot>\n ${this._renderBadge()}\n </div>\n\n ${this._renderMeta()}\n </div>\n\n <div class=\"bd-headercode-right\">\n <div class=\"bd-headercode-annotation bd-headercode-annotation--top\">\n <slot name=\"annotation-top\"></slot>\n </div>\n\n\n <div class=\"bd-headercode-scene\">\n <div class=\"bd-headercode-stack\">\n ${this._renderRings()}\n <slot name=\"terminal-content\"></slot>\n </div>\n </div>\n\n <div class=\"bd-headercode-annotation bd-headercode-annotation--bottom\">\n <slot name=\"annotation-bottom\"></slot>\n </div>\n\n ${this.terminalCaption\n ? html`<bd-p variant=\"small\" class=\"bd-headercode-terminal-caption\" font-family=\"mono\"\n>${this.terminalCaption}</bd-p>`\n : nothing}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-header-code\": HeaderCode;\n }\n}\n"],"mappings":"A,qfAmBA,IACMI,EADN,cACyBC,CAAW,C,OAoBlB,KAAA,OAAA,CAACC,EAAaN,CAAa,C,CAI3C,aAAc,CACZ,MAAM,EAvBE,KAAA,QAAA,GAEF,KAAA,MAAA,GAEO,KAAA,aAAA,EAED,KAAA,YAAA,GAEI,KAAA,gBAAA,GAEC,KAAA,QAAA,UAER,KAAA,SAAA,GAEa,KAAA,UAAA,CAAC,EAEb,KAAA,UAAA,GAQV,KAAK,OAAS,KACd,KAAK,eAAiB,KAAK,eAAe,KAAK,IAAI,EACnD,KAAK,gBAAkB,KAAK,gBAAgB,KAAK,IAAI,CACvD,CAEA,cAAe,CACb,KAAK,WAAW,CAClB,CAEA,QAAQ,EAA+B,CACjCO,EAAQ,IAAI,SAAS,GAAG,KAAK,WAAW,CAC9C,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EAC3B,KAAK,aAAa,CACpB,CAEA,YAAa,CACX,KAAK,aAAa,EACd,KAAK,UAAY,SAErB,KAAK,OAAS,KAAK,YAAY,cAA2B,sBAAsB,GAAK,KAChF,KAAK,SAEV,KAAK,OAAO,iBAAiB,cAAe,KAAK,cAAc,EAC/D,KAAK,OAAO,iBAAiB,eAAgB,KAAK,eAAe,GACnE,CAEA,cAAe,CACb,AAGA,KAAK,UAFL,KAAK,OAAO,oBAAoB,cAAe,KAAK,cAAc,EAClE,KAAK,OAAO,oBAAoB,eAAgB,KAAK,eAAe,EACtD,KAChB,CAEA,eAAe,EAAqB,CAClC,IAAMC,EAAO,KAAK,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A,IAAA,EAAA,EAlBR,EAAAH,EAAA,CAAAqB,EAAc,gBAAgB,CAAA,EAAAlB,CAAA"}
|
|
@@ -31,7 +31,7 @@ export declare class BdH extends LitElement {
|
|
|
31
31
|
* the heading keeps the styling its own CSS gives it.
|
|
32
32
|
*/
|
|
33
33
|
_computeStyles(): string;
|
|
34
|
-
render(): import("lit-html").TemplateResult
|
|
34
|
+
render(): import("lit-html").TemplateResult;
|
|
35
35
|
static styles: import("lit").CSSResult[];
|
|
36
36
|
}
|
|
37
37
|
declare global {
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"./heading.css.js";import{color as n,fontWeight as r,spacing as i,spacingShorthand as a}from"../shared/token-scales.js";import o from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{LitElement as s,
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"./heading.css.js";import{color as n,fontWeight as r,spacing as i,spacingShorthand as a}from"../shared/token-scales.js";import o from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{LitElement as s,nothing as c}from"lit";import{property as l}from"lit/decorators.js";import{html as u,unsafeStatic as d}from"lit/static-html.js";var f=class extends s{constructor(...e){super(...e),this.as=`h1`,this.visualLevel=``,this.ariaLevel=null,this.padding=``,this.paddingBottom=``,this.fontWeight=``,this.color=``}_isValidHeadingTag(e){return[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].includes(e)}_normaliseLevel(e){let t=String(e??``).trim().toLowerCase();return this._isValidHeadingTag(t)?t:/^[1-6]$/.test(t)?`h${t}`:``}_computeStyles(){return[[`padding`,a(this.padding)],[`padding-bottom`,i(this.paddingBottom)],[`font-weight`,r(this.fontWeight)],[`color`,n(this.color)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t};`).join(` `)}render(){let e=this._normaliseLevel(this.as)||`h2`,t=this._normaliseLevel(this.visualLevel)||e,n=d(e);return u`<${n}
|
|
2
|
+
class="bd-heading ${t}"
|
|
3
|
+
aria-level=${this.ariaLevel||c}
|
|
4
|
+
style=${this._computeStyles()||c}
|
|
5
|
+
><slot></slot></${n}>`}static{this.styles=[t]}};o([l({type:String,reflect:!0})],f.prototype,`as`,void 0),o([l({type:String,attribute:`visual-level`,reflect:!0})],f.prototype,`visualLevel`,void 0),o([l({type:Number,attribute:`aria-level`})],f.prototype,`ariaLevel`,void 0),o([l({type:String})],f.prototype,`padding`,void 0),o([l({type:String})],f.prototype,`paddingBottom`,void 0),o([l({type:String})],f.prototype,`fontWeight`,void 0),o([l({type:String})],f.prototype,`color`,void 0),f=o([e(`bd-h`)],f);export{f as BdH};
|
|
2
6
|
//# sourceMappingURL=heading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","names":["headingCSS","_decorate","heading_css_default","__decorate","BdH","LitElement","_args","tag","v","value","spacingShorthand","spacing","fontWeight","color","property","visual","
|
|
1
|
+
{"version":3,"file":"heading.js","names":["headingCSS","_decorate","heading_css_default","__decorate","html$1","BdH","LitElement","_args","tag","v","value","spacingShorthand","spacing","fontWeight","color","property","level","visual","unsafeStatic","nothing","defineElement"],"sources":["../../../../src/components/heading/heading.ts"],"sourcesContent":["import { LitElement, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { html, unsafeStatic } from \"lit/static-html.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 headingCSS from \"./heading.css.ts\";\nimport {\n spacingShorthand, spacing, fontWeight, color,\n type SpacingStep, type FontWeightStep, type ColorRole\n} from \"#shared/token-scales.ts\";\n\ntype HeadingTag = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\ntype HeadingLevel = HeadingTag | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n\n@defineElement(\"bd-h\")\nexport class BdH extends LitElement {\n @property({ type: String, reflect: true })\n as: HeadingLevel = \"h1\";\n /**\n * Which step of the heading type scale to render, when that has to differ\n * from the semantic level. Defaults to following `as`, so passing nothing\n * behaves exactly as before.\n *\n * The two were one axis: the tag chose the element AND the type scale, so\n * a section that had to stop being an h1 for the document outline would\n * have shrunk from 5xl to 4xl at the same time. Level is what the outline\n * reads; size is what the page looks like, and they are not the same\n * question. Accepts h1-h6 or 1-6.\n */\n @property({ type: String, attribute: \"visual-level\", reflect: true })\n visualLevel: HeadingLevel | \"\" = \"\";\n @property({ type: Number, attribute: \"aria-level\" })\n ariaLevel: string | null = null;\n @property({ type: String })\n padding = \"\";\n @property({ type: String })\n paddingBottom: SpacingStep | \"\" = \"\";\n @property({ type: String })\n fontWeight: FontWeightStep | \"\" = \"\";\n @property({ type: String })\n color: ColorRole | \"\" = \"\";\n\n _isValidHeadingTag(tag: string) {\n return [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"].includes(tag);\n }\n\n /** Accepts h1-h6 or a bare 1-6, and returns \"\" for anything else. */\n _normaliseLevel(value: unknown) {\n const v = String(value ?? \"\").trim()\n .toLowerCase();\n if (this._isValidHeadingTag(v)) return v;\n return /^[1-6]$/.test(v) ? `h${v}` : \"\";\n }\n\n /**\n * Each prop is a step name, resolved to a token reference by\n * shared/token-scales.ts. A value that is not on its scale is dropped, so\n * the heading keeps the styling its own CSS gives it.\n */\n _computeStyles() {\n const declarations = [\n [\"padding\", spacingShorthand(this.padding)],\n [\"padding-bottom\", spacing(this.paddingBottom)],\n [\"font-weight\", fontWeight(this.fontWeight)],\n [\"color\", color(this.color)]\n ];\n\n return declarations\n .filter(([, value]) => value)\n .map(([property, value]) => `${property}: ${value};`)\n .join(\" \");\n }\n\n\n render() {\n /* An unrecognised `as` used to fall back to h1, so a typo produced a\n page-level heading in a component that had no business owning one --\n the loudest possible thing to get wrong silently. It falls back to h2\n now: still a heading, never the page's. A missing `as` is unaffected,\n because the property defaults to h1 and h1 is valid. */\n const level = this._normaliseLevel(this.as) || \"h2\";\n const visual = this._normaliseLevel(this.visualLevel) || level;\n /* The tag is part of the template, so Lit keeps one heading element and\n updates it, and builds a new one only when the level changes. It used\n to be document.createElement on every render, which swapped the\n heading and its slot on every update -- a slotchange, a lost text\n selection and new layout each time a prop moved. unsafeStatic is safe\n here: _normaliseLevel returns h1-h6 or nothing. */\n const tag = unsafeStatic(level);\n return html`<${tag}\n class=\"bd-heading ${visual}\"\n aria-level=${this.ariaLevel || nothing}\n style=${this._computeStyles() || nothing}\n ><slot></slot></${tag}>`;\n }\n\n\n static styles = [headingCSS];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-h\": BdH;\n }\n}\n"],"mappings":"A,icAgBO,IAAMK,EAAN,cAAkBC,CAAW,C,8BAEf,KAAA,GAAA,KAac,KAAA,YAAA,GAEN,KAAA,UAAA,KAEjB,KAAA,QAAA,GAEwB,KAAA,cAAA,GAEA,KAAA,WAAA,GAEV,KAAA,MAAA,E,CAExB,mBAAmB,EAAa,CAC9B,MAAO,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAI,CAAC,CAAC,SAASE,CAAG,CAC1D,CAGA,gBAAgB,EAAgB,CAC9B,IAAMC,EAAI,OAAOC,GAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CACjC,YAAY,EAEf,OADI,KAAK,mBAAmBD,CAAC,EAAUA,EAChC,UAAU,KAAKA,CAAC,EAAI,IAAIA,IAAM,EACvC,CAOA,gBAAiB,CAQf,MAAO,CANL,CAAC,UAAkBE,EAAiB,KAAK,OAAO,CAAC,EACjD,CAAC,iBAAkBC,EAAQ,KAAK,aAAa,CAAC,EAC9C,CAAC,cAAkBC,EAAW,KAAK,UAAU,CAAC,EAC9C,CAAC,QAAkBC,EAAM,KAAK,KAAK,CAAC,CAG/B,CAAA,CACJ,QAAQ,EAAGJ,KAAWA,CAAK,CAAC,CAC5B,KAAK,CAACK,EAAUL,KAAW,GAAGK,EAAS,IAAIL,EAAM,EAAE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|
|
2
3
|
import "../button/button.js";
|
|
3
4
|
import "../icons/pause-icon.js";
|
|
4
5
|
import "../icons/play-icon.js";
|
|
@@ -48,7 +49,7 @@ export declare class Hero extends LitElement {
|
|
|
48
49
|
_onCardsSlot(e: Event): void;
|
|
49
50
|
_onMediaSlot(e: Event): void;
|
|
50
51
|
_syncMedia(): void;
|
|
51
|
-
_renderMedia(): import("lit-html").TemplateResult<1
|
|
52
|
+
_renderMedia(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
52
53
|
render(): import("lit-html").TemplateResult<1>;
|
|
53
54
|
}
|
|
54
55
|
declare global {
|