@repobit/dex-system-design 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- 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 +12 -1
- package/dist/src/components/audience-card/audience-card.js +6 -6
- package/dist/src/components/audience-card/audience-card.js.map +1 -1
- package/dist/src/components/card/card-grid.d.ts +1 -1
- package/dist/src/components/card/card-grid.js +1 -1
- package/dist/src/components/card/card-grid.js.map +1 -1
- package/dist/src/components/card/card.css.js +1 -1
- package/dist/src/components/card/card.css.js.map +1 -1
- package/dist/src/components/card/card.d.ts +12 -3
- package/dist/src/components/card/card.js +2 -1
- package/dist/src/components/card/card.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/img/img.css.js +1 -1
- package/dist/src/components/img/img.css.js.map +1 -1
- package/package.json +2 -2
- package/schemas/component-manifest.json +23 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.3.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@4.2.0...@repobit/dex-system-design@4.3.0) (2026-11-17)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **DEX-29440:** bd-card draws the website's Columns card variations
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **DEX-29440:** website card variations hold their layout at every width
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [4.2.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@4.1.0...@repobit/dex-system-design@4.2.0) (2026-11-17)
|
|
7
18
|
|
|
8
19
|
### Features
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../shared/token-scales.js";import"../shared/fill-width.css.js";import{css as e}from"lit";var t=e`:host{grid-template-rows:auto auto 1fr auto;width:100%;display:grid}@supports (width:-moz-available){:host{width:-moz-available}}@supports (width:-webkit-fill-available){:host{width:-webkit-fill-available}}@supports (width:stretch){:host{width:-webkit-fill-available;width:-moz-available;width:stretch}}.card{box-sizing:border-box;grid-row:1/-1;grid-template-rows:subgrid;padding:var(--card-padding-compact);background:var(--color-surface-default);border:var(--border-width-1) solid var(--color-border-container);border-radius:var(--card-radius);grid-template-columns:minmax(0,1fr);row-gap:0;display:grid;position:relative}.copy{display:contents}.copy>[hidden]{display:none}.eyebrow{align-items:center;gap:var(--spacing-8);margin:0 0 var(--spacing-8);font-family:var(--typography-label-default-fontFamily);font-size:var(--typography-label-default-fontSize);font-weight:var(--typography-label-default-fontWeight);line-height:var(--typography-label-default-lineHeight);letter-spacing:var(--typography-label-default-letterSpacing);text-transform:uppercase;color:var(--color-text-brand);grid-row:1;display:flex}::slotted([slot=icon]){color:var(--color-text-brand);flex:none}.title{grid-row:2}::slotted(bd-h[slot=title]),::slotted(bd-display[slot=title]){--bd-heading-font-size:var(--typography-heading-h4-fontSize);--bd-heading-font-weight:var(--typography-heading-h4-fontWeight);--bd-heading-line-height:var(--typography-heading-h4-lineHeight);--bd-heading-letter-spacing:var(--typography-heading-h4-letterSpacing);--bd-heading-font-family:var(--typography-heading-h4-fontFamily)}.description{margin:var(--spacing-8) 0 0;grid-row:3}::slotted(bd-p[slot=description]){--bd-paragraph-font-size:var(--typography-body-regular-fontSize);--bd-paragraph-font-weight:var(--typography-body-regular-fontWeight);--bd-paragraph-line-height:var(--typography-body-regular-lineHeight);--bd-paragraph-letter-spacing:var(--typography-body-regular-letterSpacing);--bd-paragraph-margin-bottom:0}.arrow{grid-row:4;place-self:end;margin-block-start:var(--spacing-8)}.arrow::part(button):after{content:"";position:absolute;inset:0}@media (width>=768px) and (width<992px){.card{column-gap:var(--spacing-24);grid-template-columns:minmax(0,1fr) auto}.arrow{grid-area:1/2/-1;align-self:center;margin-block-start:0}}`;export{t as audienceCardCSS};
|
|
1
|
+
import"../shared/token-scales.js";import"../shared/fill-width.css.js";import{css as e}from"lit";var t=e`:host{grid-template-rows:auto auto 1fr auto;width:100%;display:grid}@supports (width:-moz-available){:host{width:-moz-available}}@supports (width:-webkit-fill-available){:host{width:-webkit-fill-available}}@supports (width:stretch){:host{width:-webkit-fill-available;width:-moz-available;width:stretch}}.card{box-sizing:border-box;grid-row:1/-1;grid-template-rows:subgrid;padding:var(--card-padding-compact);background:var(--color-surface-default);border:var(--border-width-1) solid var(--color-border-container);border-radius:var(--card-radius);grid-template-columns:minmax(0,1fr);row-gap:0;display:grid;position:relative}.copy{display:contents}.copy>[hidden]{display:none}.eyebrow{align-items:center;gap:var(--spacing-8);margin:0 0 var(--spacing-8);font-family:var(--typography-label-default-fontFamily);font-size:var(--typography-label-default-fontSize);font-weight:var(--typography-label-default-fontWeight);line-height:var(--typography-label-default-lineHeight);letter-spacing:var(--typography-label-default-letterSpacing);text-transform:uppercase;color:var(--color-text-brand);grid-row:1;display:flex}::slotted([slot=icon]){color:var(--color-text-brand);flex:none}.title{grid-row:2}::slotted(bd-h[slot=title]),::slotted(bd-display[slot=title]){--bd-heading-font-size:var(--typography-heading-h4-fontSize);--bd-heading-font-weight:var(--typography-heading-h4-fontWeight);--bd-heading-line-height:var(--typography-heading-h4-lineHeight);--bd-heading-letter-spacing:var(--typography-heading-h4-letterSpacing);--bd-heading-font-family:var(--typography-heading-h4-fontFamily)}.description{margin:var(--spacing-8) 0 0;grid-row:3}::slotted(bd-p[slot=description]){--bd-paragraph-font-size:var(--typography-body-regular-fontSize);--bd-paragraph-font-weight:var(--typography-body-regular-fontWeight);--bd-paragraph-line-height:var(--typography-body-regular-lineHeight);--bd-paragraph-letter-spacing:var(--typography-body-regular-letterSpacing);--bd-paragraph-margin-bottom:0}.arrow{grid-row:4;place-self:end;margin-block-start:var(--spacing-8)}.arrow::part(button):after{content:"";position:absolute;inset:0}@media (width>=768px) and (width<992px){.card{column-gap:var(--spacing-24);grid-template-columns:minmax(0,1fr) auto}.arrow{grid-area:1/2/-1;align-self:center;margin-block-start:0}}:host([appearance=outline]) .card{column-gap:var(--spacing-24);border:var(--border-width-2) solid var(--color-border-brand);grid-template-columns:minmax(0,1fr) auto}:host([appearance=outline]) .arrow{grid-area:1/2/-1;align-self:center;margin-block-start:0}`;export{t as audienceCardCSS};
|
|
2
2
|
//# sourceMappingURL=audience-card.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience-card.css.js","names":["audienceCardCSS"],"sources":["../../../../src/components/audience-card/audience-card.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above, below, bodyRole, headingRole } from \"#shared/token-scales.ts\";\nimport { hostFillsWidth } from \"#shared/fill-width.css.ts\";\n\n/* The card sits on the hero's brand band and the page below it at once, so\n it takes the second clause of the card rule: surface/default with a\n border/container edge, at the card corner and the compact inset.\n\n Four rows, one per part: the eyebrow, the title, the description and the\n arrow. The host is a grid of its own four, and the card a subgrid of them;\n in a bd-grid with item-rows=\"4\" the host is in turn a subgrid of the\n grid's rows (grid.css.ts), so every card's title starts on one line and\n its description on the next, however differently the cards' titles wrap.\n A part a card leaves out leaves its row at the height the others give it,\n so the rest still line up.\n\n That is also why the host is no longer a size container: containment\n makes a grid its own, and a subgrid inside it lines up with nothing. The\n row the card becomes between md and lg is the documented one, the hero's\n tablet frame, and follows the screen. */\nexport const audienceCardCSS = css`\n /* bd-grid places its items at start, so the host asks for its column's\n whole width rather than its content's; the width is the column less the\n host's margins (shared/fill-width.css.ts). */\n :host {\n display: grid;\n grid-template-rows: auto auto 1fr auto;\n }\n\n ${hostFillsWidth()}\n\n .card {\n box-sizing: border-box;\n display: grid;\n grid-row: 1 / -1;\n grid-template-rows: subgrid;\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n padding: var(--card-padding-compact);\n background: var(--color-surface-default);\n border: var(--border-width-1) solid var(--color-border-container);\n border-radius: var(--card-radius);\n /* the containing block for the link's stretched hit area, below */\n position: relative;\n }\n\n /* the copy's parts are the card's rows, not a box of their own */\n .copy {\n display: contents;\n }\n\n /* Each part's box is hidden while its slot is empty; the attribute's\n selector outweighs the display a box sets below. */\n .copy > [hidden] {\n display: none;\n }\n\n /* The eyebrow is text, so the card sets it: label-default in capitals, in\n text/brand -- the draft paints it status/info/accent, a status role on a\n plain label. The icon sits in the same line, before it. The parts are 8\n apart, as margins rather than the row gap, so a part a card leaves out\n takes its space with it. */\n .eyebrow {\n grid-row: 1;\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n margin: 0 0 var(--spacing-8);\n font-family: var(--typography-label-default-fontFamily);\n font-size: var(--typography-label-default-fontSize);\n font-weight: var(--typography-label-default-fontWeight);\n line-height: var(--typography-label-default-lineHeight);\n letter-spacing: var(--typography-label-default-letterSpacing);\n text-transform: uppercase;\n color: var(--color-text-brand);\n }\n\n ::slotted([slot=\"icon\"]) {\n flex: none;\n color: var(--color-text-brand);\n }\n\n .title {\n grid-row: 2;\n }\n\n /* The card's title: the h4 role 3.x drew it at, at whatever level the\n page picks. */\n ::slotted(bd-h[slot=\"title\"]),\n ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(headingRole(\"heading-h4\"))}\n }\n\n .description {\n grid-row: 3;\n margin: var(--spacing-8) 0 0;\n }\n\n /* The description: body-regular, as 3.x drew it, with no flow margin --\n the parts' margins are the spacing here. */\n ::slotted(bd-p[slot=\"description\"]) {\n ${unsafeCSS(bodyRole(\"body-regular\"))}\n --bd-paragraph-margin-bottom: 0;\n }\n\n /* bottom-right, under the copy, on the card's last row */\n .arrow {\n grid-row: 4;\n justify-self: end;\n align-self: end;\n margin-block-start: var(--spacing-8);\n }\n\n /* The stretched link: the arrow's own <a> (bd-button's part=\"button\")\n draws an ::after over the whole card, so the card is the link's hit area\n -- middle-click, Ctrl/Cmd-click and the link menu included -- with no\n script. Nothing between the card and the <a> is positioned, so the card\n is what it fills. The pointer over it is the link's own. It paints\n nothing, so it takes no corner of its own. */\n .arrow::part(button)::after {\n content: \"\";\n position: absolute;\n inset: 0;\n }\n\n /* The tablet row, copy left and the arrow right and centred down the\n card, between md and lg, as the hero's tablet frame draws it: one card\n a row there, so nothing beside it to line up with. Above and below it\n stacks, the arrow bottom-right. */\n @media ${unsafeCSS(above(\"md\"))} and ${unsafeCSS(below(\"lg\"))} {\n .card {\n grid-template-columns: minmax(0, 1fr) auto;\n column-gap: var(--spacing-24);\n }\n\n .arrow {\n grid-column: 2;\n grid-row: 1 / -1;\n align-self: center;\n margin-block-start: 0;\n }\n }\n`;\n"],"mappings":"A,gGAoBA,IAAaA,EAAkB,CAAG,
|
|
1
|
+
{"version":3,"file":"audience-card.css.js","names":["audienceCardCSS"],"sources":["../../../../src/components/audience-card/audience-card.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above, below, bodyRole, headingRole } from \"#shared/token-scales.ts\";\nimport { hostFillsWidth } from \"#shared/fill-width.css.ts\";\n\n/* The card sits on the hero's brand band and the page below it at once, so\n it takes the second clause of the card rule: surface/default with a\n border/container edge, at the card corner and the compact inset.\n\n Four rows, one per part: the eyebrow, the title, the description and the\n arrow. The host is a grid of its own four, and the card a subgrid of them;\n in a bd-grid with item-rows=\"4\" the host is in turn a subgrid of the\n grid's rows (grid.css.ts), so every card's title starts on one line and\n its description on the next, however differently the cards' titles wrap.\n A part a card leaves out leaves its row at the height the others give it,\n so the rest still line up.\n\n That is also why the host is no longer a size container: containment\n makes a grid its own, and a subgrid inside it lines up with nothing. The\n row the card becomes between md and lg is the documented one, the hero's\n tablet frame, and follows the screen. */\nexport const audienceCardCSS = css`\n /* bd-grid places its items at start, so the host asks for its column's\n whole width rather than its content's; the width is the column less the\n host's margins (shared/fill-width.css.ts). */\n :host {\n display: grid;\n grid-template-rows: auto auto 1fr auto;\n }\n\n ${hostFillsWidth()}\n\n .card {\n box-sizing: border-box;\n display: grid;\n grid-row: 1 / -1;\n grid-template-rows: subgrid;\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n padding: var(--card-padding-compact);\n background: var(--color-surface-default);\n border: var(--border-width-1) solid var(--color-border-container);\n border-radius: var(--card-radius);\n /* the containing block for the link's stretched hit area, below */\n position: relative;\n }\n\n /* the copy's parts are the card's rows, not a box of their own */\n .copy {\n display: contents;\n }\n\n /* Each part's box is hidden while its slot is empty; the attribute's\n selector outweighs the display a box sets below. */\n .copy > [hidden] {\n display: none;\n }\n\n /* The eyebrow is text, so the card sets it: label-default in capitals, in\n text/brand -- the draft paints it status/info/accent, a status role on a\n plain label. The icon sits in the same line, before it. The parts are 8\n apart, as margins rather than the row gap, so a part a card leaves out\n takes its space with it. */\n .eyebrow {\n grid-row: 1;\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n margin: 0 0 var(--spacing-8);\n font-family: var(--typography-label-default-fontFamily);\n font-size: var(--typography-label-default-fontSize);\n font-weight: var(--typography-label-default-fontWeight);\n line-height: var(--typography-label-default-lineHeight);\n letter-spacing: var(--typography-label-default-letterSpacing);\n text-transform: uppercase;\n color: var(--color-text-brand);\n }\n\n ::slotted([slot=\"icon\"]) {\n flex: none;\n color: var(--color-text-brand);\n }\n\n .title {\n grid-row: 2;\n }\n\n /* The card's title: the h4 role 3.x drew it at, at whatever level the\n page picks. */\n ::slotted(bd-h[slot=\"title\"]),\n ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(headingRole(\"heading-h4\"))}\n }\n\n .description {\n grid-row: 3;\n margin: var(--spacing-8) 0 0;\n }\n\n /* The description: body-regular, as 3.x drew it, with no flow margin --\n the parts' margins are the spacing here. */\n ::slotted(bd-p[slot=\"description\"]) {\n ${unsafeCSS(bodyRole(\"body-regular\"))}\n --bd-paragraph-margin-bottom: 0;\n }\n\n /* bottom-right, under the copy, on the card's last row */\n .arrow {\n grid-row: 4;\n justify-self: end;\n align-self: end;\n margin-block-start: var(--spacing-8);\n }\n\n /* The stretched link: the arrow's own <a> (bd-button's part=\"button\")\n draws an ::after over the whole card, so the card is the link's hit area\n -- middle-click, Ctrl/Cmd-click and the link menu included -- with no\n script. Nothing between the card and the <a> is positioned, so the card\n is what it fills. The pointer over it is the link's own. It paints\n nothing, so it takes no corner of its own. */\n .arrow::part(button)::after {\n content: \"\";\n position: absolute;\n inset: 0;\n }\n\n /* The tablet row, copy left and the arrow right and centred down the\n card, between md and lg, as the hero's tablet frame draws it: one card\n a row there, so nothing beside it to line up with. Above and below it\n stacks, the arrow bottom-right. */\n @media ${unsafeCSS(above(\"md\"))} and ${unsafeCSS(below(\"lg\"))} {\n .card {\n grid-template-columns: minmax(0, 1fr) auto;\n column-gap: var(--spacing-24);\n }\n\n .arrow {\n grid-column: 2;\n grid-row: 1 / -1;\n align-self: center;\n margin-block-start: 0;\n }\n }\n\n /* === OUTLINE: the Trusted page's anchor card (DEX-29440) ===\n A brand edge, as bd-card's outline draws one, and the copy and the arrow\n side by side at every width, the arrow centred down the card, as the\n tablet row above draws them. */\n :host([appearance=\"outline\"]) .card {\n grid-template-columns: minmax(0, 1fr) auto;\n column-gap: var(--spacing-24);\n border: var(--border-width-2) solid var(--color-border-brand);\n }\n\n :host([appearance=\"outline\"]) .arrow {\n grid-column: 2;\n grid-row: 1 / -1;\n align-self: center;\n margin-block-start: 0;\n }\n`;\n"],"mappings":"A,gGAoBA,IAAaA,EAAkB,CAAG,g/E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
1
|
+
import { LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import { SlotController } from "../shared/controller.slot.js";
|
|
3
3
|
import "../../tokens/tokens.js";
|
|
4
4
|
import "../button/button.js";
|
|
@@ -36,13 +36,23 @@ import "../icons/arrow.js";
|
|
|
36
36
|
*
|
|
37
37
|
* Wherever the card is wide enough it turns into a row, the copy on the left
|
|
38
38
|
* and the arrow on the right; narrower it stacks.
|
|
39
|
+
*
|
|
40
|
+
* `appearance="outline"` is the Trusted page's anchor card (the website's
|
|
41
|
+
* Columns in the trusted-new template, DEX-29440): a brand edge, and the
|
|
42
|
+
* arrow a primary button beside the copy, centred down the card, at every
|
|
43
|
+
* width.
|
|
39
44
|
*/
|
|
45
|
+
declare const APPEARANCES: readonly ["standard", "outline"];
|
|
46
|
+
type Appearance = typeof APPEARANCES[number];
|
|
40
47
|
export declare class BdAudienceCard extends LitElement {
|
|
41
48
|
static styles: import("lit").CSSResult[];
|
|
49
|
+
/** standard (default), or outline: a brand edge and the primary arrow beside the copy. Reflected, for the stylesheet. */
|
|
50
|
+
appearance: Appearance;
|
|
42
51
|
href: string;
|
|
43
52
|
target: string;
|
|
44
53
|
label: string;
|
|
45
54
|
_slots: SlotController<"eyebrow" | "title" | "description" | "icon">;
|
|
55
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
46
56
|
/** The link's name: `label`, else the eyebrow's text, else the title's. */
|
|
47
57
|
get _name(): string;
|
|
48
58
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -52,3 +62,4 @@ declare global {
|
|
|
52
62
|
"bd-audience-card": BdAudienceCard;
|
|
53
63
|
}
|
|
54
64
|
}
|
|
65
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
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"../p/p.js";import{SlotController as
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{isOneOf as t}from"../shared/prop-vocabulary.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../p/p.js";import{SlotController as r}from"../shared/controller.slot.js";import"../h/h.js";import"../icons/arrow.js";import"../button/button.js";import{audienceCardCSS as i}from"./audience-card.css.js";import{LitElement as a,html as o,nothing as s}from"lit";import{property as c}from"lit/decorators.js";var l=[`standard`,`outline`],u=class extends a{constructor(...e){super(...e),this.appearance=`standard`,this.href=``,this.target=``,this.label=``,this._slots=new r(this,{slots:[`icon`,`description`],text:[`eyebrow`,`title`]})}static{this.styles=[i]}willUpdate(e){e.has(`appearance`)&&!t(l,this.appearance)&&(this.appearance=`standard`)}get _name(){return this.label||this._slots.text(`eyebrow`)||this._slots.text(`title`)}render(){let e=e=>this._slots.has(e);return o`
|
|
2
2
|
<article class="card">
|
|
3
3
|
<div class="copy">
|
|
4
4
|
<p class="eyebrow" ?hidden=${!e(`icon`)&&!e(`eyebrow`)}><slot name="icon"></slot><slot name="eyebrow"></slot></p>
|
|
5
5
|
<div class="title" ?hidden=${!e(`title`)}><slot name="title"></slot></div>
|
|
6
6
|
<div class="description" ?hidden=${!e(`description`)}><slot name="description"></slot></div>
|
|
7
7
|
</div>
|
|
8
|
-
${this.href?
|
|
8
|
+
${this.href?o`<bd-button
|
|
9
9
|
class="arrow"
|
|
10
|
-
appearance="accent"
|
|
10
|
+
appearance="${this.appearance===`outline`?`primary`:`accent`}"
|
|
11
11
|
size="md"
|
|
12
12
|
href="${this.href}"
|
|
13
|
-
target="${this.target||
|
|
14
|
-
><bd-icon name="arrow" label="${this._name}"></bd-icon></bd-button>`:
|
|
13
|
+
target="${this.target||s}"
|
|
14
|
+
><bd-icon name="arrow" label="${this._name}"></bd-icon></bd-button>`:s}
|
|
15
15
|
</article>
|
|
16
|
-
`}};
|
|
16
|
+
`}};n([c({type:String,reflect:!0})],u.prototype,`appearance`,void 0),n([c({type:String})],u.prototype,`href`,void 0),n([c({type:String})],u.prototype,`target`,void 0),n([c({type:String})],u.prototype,`label`,void 0),u=n([e(`bd-audience-card`)],u);export{u as BdAudienceCard};
|
|
17
17
|
//# sourceMappingURL=audience-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audience-card.js","names":["_decorate","__decorate","BdAudienceCard","LitElement","_args","SlotController","audienceCardCSS","has","name","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 { SlotController } from \"#shared/controller.slot.ts\";\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\";\n/* The atoms the page writes into the card's slots: 3.x drew its title\n itself, so a page importing only this module still gets them. */\nimport \"#components/h/h.ts\";\nimport \"#components/p/p.ts\";\nimport { audienceCardCSS } from \"./audience-card.css.ts\";\nimport \"#components/icons/arrow.ts\";\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 * <bd-audience-card href=\"/consumer/\">\n * <bd-icon slot=\"icon\" name=\"home\"></bd-icon>\n * <span slot=\"eyebrow\">For home</span>\n * <bd-h slot=\"title\" as=\"h2\">Protect Your Digital Life</bd-h>\n * <bd-p slot=\"description\">AI-powered protection against scams …</bd-p>\n * </bd-audience-card>\n *\n * The card sets the eyebrow's type (label-default in capitals, brand ink),\n * the title's size (the h4 role) and the description's (body-regular); the\n * page picks the title's level. Each part's box is hidden while its slot is\n * empty, and the eyebrow line while both the icon and the eyebrow are.\n *\n * One link, not three. The arrow is the link and carries the accessible name:\n * `label` when the page gives one, otherwise the eyebrow's text (\"For home\"),\n * then the title's, copied from the slots and followed through every edit --\n * the name sits on a bd-icon inside the button's own shadow root, where no\n * aria-labelledby from here can reach. So the page reads one link per card\n * instead of a title, a paragraph and an arrow. Its hit area is stretched\n * 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 * Wherever the card is wide enough it turns into a row, the copy on the left\n * and the arrow on the right; narrower it stacks.\n */\n@defineElement(\"bd-audience-card\")\nexport class BdAudienceCard extends LitElement {\n static styles = [audienceCardCSS];\n\n @property({ type: String })\n href = \"\";\n @property({ type: String })\n target = \"\";\n /* The arrow link's accessible name, when it is not the eyebrow's words. */\n @property({ type: String })\n label = \"\";\n\n _slots = new SlotController(this, {\n slots: [\"icon\", \"description\"],\n text : [\"eyebrow\", \"title\"]\n });\n\n /** The link's name: `label`, else the eyebrow's text, else the title's. */\n get _name() {\n return this.label || this._slots.text(\"eyebrow\") || this._slots.text(\"title\");\n }\n\n render() {\n const has = (name: \"icon\" | \"eyebrow\" | \"title\" | \"description\") => this._slots.has(name);\n return html`\n <article class=\"card\">\n <div class=\"copy\">\n <p class=\"eyebrow\" ?hidden=${!has(\"icon\") && !has(\"eyebrow\")}><slot name=\"icon\"></slot><slot name=\"eyebrow\"></slot></p>\n <div class=\"title\" ?hidden=${!has(\"title\")}><slot name=\"title\"></slot></div>\n <div class=\"description\" ?hidden=${!has(\"description\")}><slot name=\"description\"></slot></div>\n </div>\n ${this.href\n ? html`<bd-button\n class=\"arrow\"\n appearance=\"accent\"\n size=\"md\"\n href=\"${this.href}\"\n target=\"${this.target || nothing}\"\n ><bd-icon name=\"arrow\" label=\"${this._name}\"></bd-icon></bd-button>`\n : nothing}\n </article>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-audience-card\": BdAudienceCard;\n }\n}\n"],"mappings":"A,
|
|
1
|
+
{"version":3,"file":"audience-card.js","names":["_decorate","__decorate","APPEARANCES","BdAudienceCard","LitElement","_args","SlotController","audienceCardCSS","changed","isOneOf","has","name","nothing","property","defineElement"],"sources":["../../../../src/components/audience-card/audience-card.ts"],"sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport \"#components/button/button.ts\";\n/* The atoms the page writes into the card's slots: 3.x drew its title\n itself, so a page importing only this module still gets them. */\nimport \"#components/h/h.ts\";\nimport \"#components/p/p.ts\";\nimport { audienceCardCSS } from \"./audience-card.css.ts\";\nimport \"#components/icons/arrow.ts\";\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 * <bd-audience-card href=\"/consumer/\">\n * <bd-icon slot=\"icon\" name=\"home\"></bd-icon>\n * <span slot=\"eyebrow\">For home</span>\n * <bd-h slot=\"title\" as=\"h2\">Protect Your Digital Life</bd-h>\n * <bd-p slot=\"description\">AI-powered protection against scams …</bd-p>\n * </bd-audience-card>\n *\n * The card sets the eyebrow's type (label-default in capitals, brand ink),\n * the title's size (the h4 role) and the description's (body-regular); the\n * page picks the title's level. Each part's box is hidden while its slot is\n * empty, and the eyebrow line while both the icon and the eyebrow are.\n *\n * One link, not three. The arrow is the link and carries the accessible name:\n * `label` when the page gives one, otherwise the eyebrow's text (\"For home\"),\n * then the title's, copied from the slots and followed through every edit --\n * the name sits on a bd-icon inside the button's own shadow root, where no\n * aria-labelledby from here can reach. So the page reads one link per card\n * instead of a title, a paragraph and an arrow. Its hit area is stretched\n * 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 * Wherever the card is wide enough it turns into a row, the copy on the left\n * and the arrow on the right; narrower it stacks.\n *\n * `appearance=\"outline\"` is the Trusted page's anchor card (the website's\n * Columns in the trusted-new template, DEX-29440): a brand edge, and the\n * arrow a primary button beside the copy, centred down the card, at every\n * width.\n */\nconst APPEARANCES = [\"standard\", \"outline\"] as const;\ntype Appearance = typeof APPEARANCES[number];\n\n@defineElement(\"bd-audience-card\")\nexport class BdAudienceCard extends LitElement {\n static styles = [audienceCardCSS];\n\n /** standard (default), or outline: a brand edge and the primary arrow beside the copy. Reflected, for the stylesheet. */\n @property({ type: String, reflect: true })\n appearance: Appearance = \"standard\";\n\n @property({ type: String })\n href = \"\";\n @property({ type: String })\n target = \"\";\n /* The arrow link's accessible name, when it is not the eyebrow's words. */\n @property({ type: String })\n label = \"\";\n\n _slots = new SlotController(this, {\n slots: [\"icon\", \"description\"],\n text : [\"eyebrow\", \"title\"]\n });\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") && !isOneOf(APPEARANCES, this.appearance)) this.appearance = \"standard\";\n }\n\n /** The link's name: `label`, else the eyebrow's text, else the title's. */\n get _name() {\n return this.label || this._slots.text(\"eyebrow\") || this._slots.text(\"title\");\n }\n\n render() {\n const has = (name: \"icon\" | \"eyebrow\" | \"title\" | \"description\") => this._slots.has(name);\n return html`\n <article class=\"card\">\n <div class=\"copy\">\n <p class=\"eyebrow\" ?hidden=${!has(\"icon\") && !has(\"eyebrow\")}><slot name=\"icon\"></slot><slot name=\"eyebrow\"></slot></p>\n <div class=\"title\" ?hidden=${!has(\"title\")}><slot name=\"title\"></slot></div>\n <div class=\"description\" ?hidden=${!has(\"description\")}><slot name=\"description\"></slot></div>\n </div>\n ${this.href\n ? html`<bd-button\n class=\"arrow\"\n appearance=\"${this.appearance === \"outline\" ? \"primary\" : \"accent\"}\"\n size=\"md\"\n href=\"${this.href}\"\n target=\"${this.target || nothing}\"\n ><bd-icon name=\"arrow\" label=\"${this._name}\"></bd-icon></bd-button>`\n : nothing}\n </article>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-audience-card\": BdAudienceCard;\n }\n}\n"],"mappings":"A,khBAoDA,IAAME,EAAc,CAAC,WAAY,SAAS,EAI7BC,EAAN,cAA6BC,CAAW,C,8BAKpB,KAAA,WAAA,WAGlB,KAAA,KAAA,GAEE,KAAA,OAAA,GAGD,KAAA,MAAA,GAEC,KAAA,OAAA,IAAIE,EAAe,KAAM,CAChC,MAAO,CAAC,OAAQ,aAAa,EAC7B,KAAO,CAAC,UAAW,OAAO,CAC5B,CAAC,C,QAjBe,KAAA,OAAA,CAACC,CAAe,C,CAmBhC,WAAW,EAA+B,CACpCC,EAAQ,IAAI,YAAY,GAAK,CAACC,EAAQP,EAAa,KAAK,UAAU,IAAG,KAAK,WAAa,WAC7F,CAGA,IAAI,OAAQ,CACV,OAAO,KAAK,OAAS,KAAK,OAAO,KAAK,SAAS,GAAK,KAAK,OAAO,KAAK,OAAO,CAC9E,CAEA,QAAS,CACP,IAAMQ,EAAO,GAAuD,KAAK,OAAO,IAAIC,CAAI,EACxF,MAAO,EAAI;;;uCAGwB,CAACD,EAAI,MAAM,GAAK,CAACA,EAAI,SAAS,EAAE;uCAChC,CAACA,EAAI,OAAO,EAAE;6CACR,CAACA,EAAI,aAAa,EAAE;;UAEvD,KAAK,KACH,CAAI;;4BAEY,KAAK,aAAe,UAAY,UAAY,SAAS;;sBAE3D,KAAK,KAAK;wBACR,KAAK,QAAUE,EAAQ;4CACH,KAAK,MAAM,0BAC3CA,EAAQ;;KAGlB,CACF,EA9CGZ,EAAA,CAAAa,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAV,EAAA,UAAA,aAAA,IAAA,EAAA,EAGxCH,EAAA,CAAAa,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAV,EAAA,UAAA,OAAA,IAAA,EAAA,EAEzBH,EAAA,CAAAa,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAV,EAAA,UAAA,SAAA,IAAA,EAAA,EAGzBH,EAAA,CAAAa,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAAAV,EAAA,UAAA,QAAA,IAAA,EAAA,EAb3B,EAAAH,EAAA,CAAAc,EAAc,kBAAkB,CAAA,EAAAX,CAAA,E"}
|
|
@@ -3,7 +3,7 @@ import { ObserverController } from "../shared/controller.observer.js";
|
|
|
3
3
|
import { SlotController } from "../shared/controller.slot.js";
|
|
4
4
|
import "../../tokens/tokens.js";
|
|
5
5
|
import type { BdCard } from "./card.js";
|
|
6
|
-
export declare const CARD_APPEARANCES: readonly ["fill", "outline", "feature", "inline"];
|
|
6
|
+
export declare const CARD_APPEARANCES: readonly ["fill", "outline", "feature", "inline", "media"];
|
|
7
7
|
export type CardAppearance = typeof CARD_APPEARANCES[number];
|
|
8
8
|
declare const BACKGROUNDS: readonly ["none", "tint"];
|
|
9
9
|
type Background = typeof BACKGROUNDS[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{isOneOf as t}from"../shared/prop-vocabulary.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{ObserverController as r}from"../shared/controller.observer.js";import{SlotController as i}from"../shared/controller.slot.js";import{ensembleCSS as a}from"../shared/ensemble.css.js";import o from"./card-grid.css.js";import{LitElement as s,html as c}from"lit";import{property as l}from"lit/decorators.js";var u=[`fill`,`outline`,`feature`,`inline`],d=[`none`,`tint`],f=class extends s{constructor(...e){super(...e),this.appearance=`fill`,this.background=`none`,this._slots=new i(this,{slots:[`title`,`description`,``]}),this._content=new r(this,()=>new MutationObserver(()=>this._syncRows()),e=>{e.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`slot`]}),this.hasUpdated&&this._syncRows()}),this._sync=()=>{let e=this._cards();this._pushAppearance(e),this._syncRows(e),this._syncColumns(e)}}static{this.styles=[a,o]}willUpdate(e){e.has(`appearance`)&&!t(u,this.appearance)&&(this.appearance=`fill`),e.has(`background`)&&!t(d,this.background)&&(this.background=`none`)}updated(e){e.has(`appearance`)&&this._pushAppearance()}firstUpdated(){this._sync(),customElements.get(`bd-card`)||customElements.whenDefined(`bd-card`).then(this._sync)}_cards(){return[...this.children].filter(e=>e.localName===`bd-card`&&!e.slot)}_columnCount(e){return e<=4?e:e<=6?3:e<=8?4:e===9?3:4}_syncColumns(e=this._cards()){let t=e.length,n=this._columnCount(t),r=Math.min(n,3);this.style.setProperty(`--bd-card-cols`,String(n)),this.style.setProperty(`--bd-card-tracks`,String(n*2)),this.style.setProperty(`--bd-card-tracks-md`,String(r*2));let i=e=>{let n=t%e;return n?{first:t-n,start:e-n+1}:null},a=i(n),o=i(r);e.forEach((e,t)=>{a?.first===t?e.style.setProperty(`--bd-card-start`,String(a.start)):e.style.removeProperty(`--bd-card-start`),o?.first===t?e.style.setProperty(`--bd-card-start-md`,String(o.start)):e.style.removeProperty(`--bd-card-start-md`)})}_syncRows(e=this._cards()){let t=Math.max(0,...e.map(e=>e._contentNodes?.().length??0));this.style.setProperty(`--bd-card-content-rows`,String(t)),this.style.setProperty(`--bd-card-rows`,String(t+3))}_pushAppearance(e=this._cards()){for(let t of e)t._takeAppearance?.(this.appearance)}render(){let e=this._slots.has(`title`),t=this._slots.has(`description`),n=e||t;return c`
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{isOneOf as t}from"../shared/prop-vocabulary.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import{ObserverController as r}from"../shared/controller.observer.js";import{SlotController as i}from"../shared/controller.slot.js";import{ensembleCSS as a}from"../shared/ensemble.css.js";import o from"./card-grid.css.js";import{LitElement as s,html as c}from"lit";import{property as l}from"lit/decorators.js";var u=[`fill`,`outline`,`feature`,`inline`,`media`],d=[`none`,`tint`],f=class extends s{constructor(...e){super(...e),this.appearance=`fill`,this.background=`none`,this._slots=new i(this,{slots:[`title`,`description`,``]}),this._content=new r(this,()=>new MutationObserver(()=>this._syncRows()),e=>{e.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`slot`]}),this.hasUpdated&&this._syncRows()}),this._sync=()=>{let e=this._cards();this._pushAppearance(e),this._syncRows(e),this._syncColumns(e)}}static{this.styles=[a,o]}willUpdate(e){e.has(`appearance`)&&!t(u,this.appearance)&&(this.appearance=`fill`),e.has(`background`)&&!t(d,this.background)&&(this.background=`none`)}updated(e){e.has(`appearance`)&&this._pushAppearance()}firstUpdated(){this._sync(),customElements.get(`bd-card`)||customElements.whenDefined(`bd-card`).then(this._sync)}_cards(){return[...this.children].filter(e=>e.localName===`bd-card`&&!e.slot)}_columnCount(e){return e<=4?e:e<=6?3:e<=8?4:e===9?3:4}_syncColumns(e=this._cards()){let t=e.length,n=this._columnCount(t),r=Math.min(n,3);this.style.setProperty(`--bd-card-cols`,String(n)),this.style.setProperty(`--bd-card-tracks`,String(n*2)),this.style.setProperty(`--bd-card-tracks-md`,String(r*2));let i=e=>{let n=t%e;return n?{first:t-n,start:e-n+1}:null},a=i(n),o=i(r);e.forEach((e,t)=>{a?.first===t?e.style.setProperty(`--bd-card-start`,String(a.start)):e.style.removeProperty(`--bd-card-start`),o?.first===t?e.style.setProperty(`--bd-card-start-md`,String(o.start)):e.style.removeProperty(`--bd-card-start-md`)})}_syncRows(e=this._cards()){let t=Math.max(0,...e.map(e=>e._contentNodes?.().length??0));this.style.setProperty(`--bd-card-content-rows`,String(t)),this.style.setProperty(`--bd-card-rows`,String(t+3))}_pushAppearance(e=this._cards()){for(let t of e)t._takeAppearance?.(this.appearance)}render(){let e=this._slots.has(`title`),t=this._slots.has(`description`),n=e||t;return c`
|
|
2
2
|
<section class="bd-ensemble root ${n?`headed`:``}">
|
|
3
3
|
<div class="header" ?hidden=${!n}>
|
|
4
4
|
<div class="title" ?hidden=${!e}><slot name="title"></slot></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-grid.js","names":["cardGridCSS","_decorate","__decorate","card_grid_css_default","CARD_APPEARANCES","BACKGROUNDS","BdCardGrid","LitElement","_args","SlotController","ObserverController","observer","cards","ensembleCSS","changed","isOneOf","el","count","cols","colsMd","shortRow","left","n","wide","md","i","card","contentRows","hasTitle","hasDescription","headed","property","defineElement"],"sources":["../../../../src/components/card/card-grid.ts"],"sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ObserverController } from \"#shared/controller.observer.ts\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport cardGridCSS from \"./card-grid.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport type { BdCard } from \"./card.ts\";\n\n/* bd-card's arrangements, which the grid hands to its cards. Declared here\n rather than in card.ts, which imports this module to register the family. */\nexport const CARD_APPEARANCES = [\"fill\", \"outline\", \"feature\", \"inline\"] as const;\nexport type CardAppearance = typeof CARD_APPEARANCES[number];\n\nconst BACKGROUNDS = [\"none\", \"tint\"] as const;\ntype Background = typeof BACKGROUNDS[number];\n\n/**\n * A grid of bd-card children, which lines the parts of a row of cards up\n * with each other: a title and a description over it, and the cards.\n *\n * <bd-card-grid appearance=\"outline\">\n * <bd-h slot=\"title\" as=\"h2\">Trusted For The AI Era</bd-h>\n * <bd-p slot=\"description\">Pioneering AI in Cybersecurity since 2008.</bd-p>\n * <bd-card>…</bd-card>\n * </bd-card-grid>\n *\n * It was bd-card-section, and it survives N10 because it coordinates its\n * cards rather than only heading them:\n *\n * - the column count follows the number of cards (_columnCount), and a\n * short last row sits in the middle;\n * - from md every card is a subgrid spanning the grid's rows -- icon,\n * title, one row per content node, actions -- so each part starts on one\n * line across a row however the text above it wraps. A\n * MutationObserver recounts the rows when a card's content changes;\n * - `appearance` goes to every card whose markup sets none, as the\n * section's `variant` did.\n *\n * The page writes the title and picks its level; the grid draws it at the\n * heading-h1 role, the 48/700 exception CLAUDE.md records for this one\n * section, and the description at body-regular in secondary ink, both\n * centred. A grid with neither pads nothing above or below its cards, so it\n * sits under a bd-section-header inside a bd-section, which is how a page\n * writes what bd-card-features-section and bd-light-carousel-section drew.\n */\n@defineElement(\"bd-card-grid\")\nexport class BdCardGrid extends LitElement {\n static styles = [ensembleCSS, cardGridCSS];\n\n /** The arrangement handed to every bd-card whose own markup sets none. */\n @property({ type: String, reflect: true })\n appearance: CardAppearance = \"fill\";\n\n /** The grid's ground: none, or tint, the brand wash behind the title and the cards. */\n @property({ type: String, reflect: true })\n background: Background = \"none\";\n\n _slots = new SlotController(this, { slots: [\"title\", \"description\", \"\"] });\n\n /* Content added to or removed from a card changes its row count, which\n doesn't trigger slotchange on the grid, and so does a bare text node\n whose words turn blank or stop being blank (characterData). Watched for\n as long as the grid is connected; on a reconnect the rows are counted\n again at once, since nothing reports what changed while it was out of\n the page. */\n _content = new ObserverController(this,\n () => new MutationObserver(() => this._syncRows()),\n observer => {\n observer.observe(this, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: [\"slot\"] });\n if (this.hasUpdated) this._syncRows();\n });\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") && !isOneOf(CARD_APPEARANCES, this.appearance)) this.appearance = \"fill\";\n if (changed.has(\"background\") && !isOneOf(BACKGROUNDS, this.background)) this.background = \"none\";\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\")) this._pushAppearance();\n }\n\n firstUpdated() {\n this._sync();\n /* bd-card is a module of its own, which the loader imports beside this\n one, and this one does not import it (card.ts imports this). A grid\n defined first syncs cards that are not upgraded yet: they count no\n rows and take no appearance. Their upgrade is no slotchange and no\n mutation the observer sees, so the grid syncs again once it happens. */\n if (!customElements.get(\"bd-card\")) void customElements.whenDefined(\"bd-card\").then(this._sync);\n }\n\n /* The cards the grid lays out: its own bd-card children in the default slot. */\n _cards() {\n return [...this.children].filter((el): el is BdCard => el.localName === \"bd-card\" && !el.slot);\n }\n\n _columnCount(count: number) {\n if (count <= 4) return count;\n if (count <= 6) return 3;\n if (count <= 8) return 4;\n if (count === 9) return 3;\n return 4;\n }\n\n /* The column count follows the number of cards, and card-grid.css.ts turns\n it into tracks, so nothing here measures the track. Every card spans two\n tracks of a grid twice as fine, which is what lets a short last row sit\n in the middle: its first card starts as many tracks in as the row is\n short of cards. Between md and lg a card's 200px floor fits three to a\n row, not four, so that band has its own count and its own short row. */\n _syncColumns(cards = this._cards()) {\n const count = cards.length;\n const cols = this._columnCount(count);\n const colsMd = Math.min(cols, 3);\n this.style.setProperty(\"--bd-card-cols\", String(cols));\n this.style.setProperty(\"--bd-card-tracks\", String(cols * 2));\n this.style.setProperty(\"--bd-card-tracks-md\", String(colsMd * 2));\n\n const shortRow = (n: number) => {\n const left = count % n;\n return left ? { first: count - left, start: n - left + 1 } : null;\n };\n const wide = shortRow(cols);\n const md = shortRow(colsMd);\n cards.forEach((card, i) => {\n if (wide?.first === i) card.style.setProperty(\"--bd-card-start\", String(wide.start));\n else card.style.removeProperty(\"--bd-card-start\");\n if (md?.first === i) card.style.setProperty(\"--bd-card-start-md\", String(md.start));\n else card.style.removeProperty(\"--bd-card-start-md\");\n });\n }\n\n /* The shared row tracks every card spans from md: icon, title, the longest\n run of content nodes, actions. Only a card's default-slot nodes are\n content rows (bd-card's _contentNodes), so a title, a badge or a\n description is never counted as one. */\n _syncRows(cards = this._cards()) {\n const contentRows = Math.max(0, ...cards.map(card => card._contentNodes?.().length ?? 0));\n this.style.setProperty(\"--bd-card-content-rows\", String(contentRows));\n this.style.setProperty(\"--bd-card-rows\", String(contentRows + 3));\n }\n\n /* The grid's appearance, onto every card the page did not give one. A\n card's reflected default is not the page's choice; bd-card records what\n is (_ownAppearance) and takes the push only without one. A card not yet\n upgraded has no _takeAppearance, so it is left alone rather than given a\n property that would shadow its own; firstUpdated syncs it once it is. */\n _pushAppearance(cards = this._cards()) {\n for (const card of cards) card._takeAppearance?.(this.appearance);\n }\n\n _sync = () => {\n const cards = this._cards();\n this._pushAppearance(cards);\n this._syncRows(cards);\n this._syncColumns(cards);\n };\n\n render() {\n const hasTitle = this._slots.has(\"title\");\n const hasDescription = this._slots.has(\"description\");\n const headed = hasTitle || hasDescription;\n return html`\n <section class=\"bd-ensemble root ${headed ? \"headed\" : \"\"}\">\n <div class=\"header\" ?hidden=${!headed}>\n <div class=\"title\" ?hidden=${!hasTitle}><slot name=\"title\"></slot></div>\n <div class=\"description\" ?hidden=${!hasDescription}><slot name=\"description\"></slot></div>\n </div>\n <div class=\"track\"><slot @slotchange=${this._sync}></slot></div>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-card-grid\": BdCardGrid;\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"card-grid.js","names":["cardGridCSS","_decorate","__decorate","card_grid_css_default","CARD_APPEARANCES","BACKGROUNDS","BdCardGrid","LitElement","_args","SlotController","ObserverController","observer","cards","ensembleCSS","changed","isOneOf","el","count","cols","colsMd","shortRow","left","n","wide","md","i","card","contentRows","hasTitle","hasDescription","headed","property","defineElement"],"sources":["../../../../src/components/card/card-grid.ts"],"sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { ObserverController } from \"#shared/controller.observer.ts\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\nimport cardGridCSS from \"./card-grid.css.ts\";\nimport { ensembleCSS } from \"#shared/ensemble.css.ts\";\nimport type { BdCard } from \"./card.ts\";\n\n/* bd-card's arrangements, which the grid hands to its cards. Declared here\n rather than in card.ts, which imports this module to register the family. */\nexport const CARD_APPEARANCES = [\"fill\", \"outline\", \"feature\", \"inline\", \"media\"] as const;\nexport type CardAppearance = typeof CARD_APPEARANCES[number];\n\nconst BACKGROUNDS = [\"none\", \"tint\"] as const;\ntype Background = typeof BACKGROUNDS[number];\n\n/**\n * A grid of bd-card children, which lines the parts of a row of cards up\n * with each other: a title and a description over it, and the cards.\n *\n * <bd-card-grid appearance=\"outline\">\n * <bd-h slot=\"title\" as=\"h2\">Trusted For The AI Era</bd-h>\n * <bd-p slot=\"description\">Pioneering AI in Cybersecurity since 2008.</bd-p>\n * <bd-card>…</bd-card>\n * </bd-card-grid>\n *\n * It was bd-card-section, and it survives N10 because it coordinates its\n * cards rather than only heading them:\n *\n * - the column count follows the number of cards (_columnCount), and a\n * short last row sits in the middle;\n * - from md every card is a subgrid spanning the grid's rows -- icon,\n * title, one row per content node, actions -- so each part starts on one\n * line across a row however the text above it wraps. A\n * MutationObserver recounts the rows when a card's content changes;\n * - `appearance` goes to every card whose markup sets none, as the\n * section's `variant` did.\n *\n * The page writes the title and picks its level; the grid draws it at the\n * heading-h1 role, the 48/700 exception CLAUDE.md records for this one\n * section, and the description at body-regular in secondary ink, both\n * centred. A grid with neither pads nothing above or below its cards, so it\n * sits under a bd-section-header inside a bd-section, which is how a page\n * writes what bd-card-features-section and bd-light-carousel-section drew.\n */\n@defineElement(\"bd-card-grid\")\nexport class BdCardGrid extends LitElement {\n static styles = [ensembleCSS, cardGridCSS];\n\n /** The arrangement handed to every bd-card whose own markup sets none. */\n @property({ type: String, reflect: true })\n appearance: CardAppearance = \"fill\";\n\n /** The grid's ground: none, or tint, the brand wash behind the title and the cards. */\n @property({ type: String, reflect: true })\n background: Background = \"none\";\n\n _slots = new SlotController(this, { slots: [\"title\", \"description\", \"\"] });\n\n /* Content added to or removed from a card changes its row count, which\n doesn't trigger slotchange on the grid, and so does a bare text node\n whose words turn blank or stop being blank (characterData). Watched for\n as long as the grid is connected; on a reconnect the rows are counted\n again at once, since nothing reports what changed while it was out of\n the page. */\n _content = new ObserverController(this,\n () => new MutationObserver(() => this._syncRows()),\n observer => {\n observer.observe(this, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: [\"slot\"] });\n if (this.hasUpdated) this._syncRows();\n });\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") && !isOneOf(CARD_APPEARANCES, this.appearance)) this.appearance = \"fill\";\n if (changed.has(\"background\") && !isOneOf(BACKGROUNDS, this.background)) this.background = \"none\";\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\")) this._pushAppearance();\n }\n\n firstUpdated() {\n this._sync();\n /* bd-card is a module of its own, which the loader imports beside this\n one, and this one does not import it (card.ts imports this). A grid\n defined first syncs cards that are not upgraded yet: they count no\n rows and take no appearance. Their upgrade is no slotchange and no\n mutation the observer sees, so the grid syncs again once it happens. */\n if (!customElements.get(\"bd-card\")) void customElements.whenDefined(\"bd-card\").then(this._sync);\n }\n\n /* The cards the grid lays out: its own bd-card children in the default slot. */\n _cards() {\n return [...this.children].filter((el): el is BdCard => el.localName === \"bd-card\" && !el.slot);\n }\n\n _columnCount(count: number) {\n if (count <= 4) return count;\n if (count <= 6) return 3;\n if (count <= 8) return 4;\n if (count === 9) return 3;\n return 4;\n }\n\n /* The column count follows the number of cards, and card-grid.css.ts turns\n it into tracks, so nothing here measures the track. Every card spans two\n tracks of a grid twice as fine, which is what lets a short last row sit\n in the middle: its first card starts as many tracks in as the row is\n short of cards. Between md and lg a card's 200px floor fits three to a\n row, not four, so that band has its own count and its own short row. */\n _syncColumns(cards = this._cards()) {\n const count = cards.length;\n const cols = this._columnCount(count);\n const colsMd = Math.min(cols, 3);\n this.style.setProperty(\"--bd-card-cols\", String(cols));\n this.style.setProperty(\"--bd-card-tracks\", String(cols * 2));\n this.style.setProperty(\"--bd-card-tracks-md\", String(colsMd * 2));\n\n const shortRow = (n: number) => {\n const left = count % n;\n return left ? { first: count - left, start: n - left + 1 } : null;\n };\n const wide = shortRow(cols);\n const md = shortRow(colsMd);\n cards.forEach((card, i) => {\n if (wide?.first === i) card.style.setProperty(\"--bd-card-start\", String(wide.start));\n else card.style.removeProperty(\"--bd-card-start\");\n if (md?.first === i) card.style.setProperty(\"--bd-card-start-md\", String(md.start));\n else card.style.removeProperty(\"--bd-card-start-md\");\n });\n }\n\n /* The shared row tracks every card spans from md: icon, title, the longest\n run of content nodes, actions. Only a card's default-slot nodes are\n content rows (bd-card's _contentNodes), so a title, a badge or a\n description is never counted as one. */\n _syncRows(cards = this._cards()) {\n const contentRows = Math.max(0, ...cards.map(card => card._contentNodes?.().length ?? 0));\n this.style.setProperty(\"--bd-card-content-rows\", String(contentRows));\n this.style.setProperty(\"--bd-card-rows\", String(contentRows + 3));\n }\n\n /* The grid's appearance, onto every card the page did not give one. A\n card's reflected default is not the page's choice; bd-card records what\n is (_ownAppearance) and takes the push only without one. A card not yet\n upgraded has no _takeAppearance, so it is left alone rather than given a\n property that would shadow its own; firstUpdated syncs it once it is. */\n _pushAppearance(cards = this._cards()) {\n for (const card of cards) card._takeAppearance?.(this.appearance);\n }\n\n _sync = () => {\n const cards = this._cards();\n this._pushAppearance(cards);\n this._syncRows(cards);\n this._syncColumns(cards);\n };\n\n render() {\n const hasTitle = this._slots.has(\"title\");\n const hasDescription = this._slots.has(\"description\");\n const headed = hasTitle || hasDescription;\n return html`\n <section class=\"bd-ensemble root ${headed ? \"headed\" : \"\"}\">\n <div class=\"header\" ?hidden=${!headed}>\n <div class=\"title\" ?hidden=${!hasTitle}><slot name=\"title\"></slot></div>\n <div class=\"description\" ?hidden=${!hasDescription}><slot name=\"description\"></slot></div>\n </div>\n <div class=\"track\"><slot @slotchange=${this._sync}></slot></div>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-card-grid\": BdCardGrid;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{--_icon-width:var(--icon-2xl-size);--_icon-height:var(--icon-2xl-size);display:block}:host([hidden]){display:none}.card{box-sizing:border-box;text-align:start;background:var(--bd-card-bg,var(--color-surface-container));border:var(--bd-card-border,none);border-radius:var(--card-radius);width:100%;min-width:0;height:100%;padding:var(--card-padding);font-family:var(--typography-fontFamily-sans);flex-direction:column;align-items:flex-start;display:flex;position:relative}:host([background=tint]) .card{background:var(--status-brand-surface)}.card [hidden]{display:none}.icon{padding-bottom:var(--spacing-8);flex-direction:column;align-items:flex-start;display:flex}::slotted([slot=icon]){box-sizing:border-box;width:var(--_icon-width);height:var(--_icon-height);flex:none}::slotted(bd-icon[slot=icon]){--bd-icon-size:var(--_icon-width);padding-block:calc((var(--_icon-height) - var(--_icon-width)) / 2);justify-content:center}::slotted(bd-img[slot=icon]){flex-direction:column;justify-content:center;display:flex}::slotted(bd-mark[slot=icon]){justify-content:center;align-items:center;display:flex}.heading{gap:var(--spacing-4);width:100%;margin-bottom:var(--spacing-8);flex-direction:column;display:flex}.title-row{align-items:center;gap:var(--spacing-8);display:flex}.title{min-width:0}.badge{flex:none;display:flex}::slotted(bd-h[slot=title]),::slotted(bd-display[slot=title]){--bd-heading-font-size:var(--typography-heading-h5-fontSize);--bd-heading-font-weight:var(--typography-fontWeight-bold);--bd-heading-line-height:var(--typography-heading-h5-lineHeight);--bd-heading-letter-spacing:var(--typography-heading-h5-letterSpacing);--bd-heading-font-family:var(--typography-heading-h5-fontFamily);margin:0}::slotted([slot=description]){--bd-paragraph-font-size:var(--typography-body-small-fontSize);--bd-paragraph-font-weight:var(--typography-body-small-fontWeight);--bd-paragraph-line-height:var(--typography-body-small-lineHeight);--bd-paragraph-letter-spacing:var(--typography-body-small-letterSpacing);--bd-heading-color:var(--color-text-muted);--bd-paragraph-color:var(--color-text-muted);--bd-paragraph-margin-bottom:0}.content{flex-direction:column;flex:1;width:100%;display:flex}::slotted(bd-p:last-child){--bd-paragraph-margin-bottom:0}.actions{align-items:flex-start;gap:var(--spacing-8);width:100%;margin-top:var(--spacing-16);padding-top:var(--spacing-8);flex-wrap:wrap;display:flex}.actions-start{justify-content:flex-start}.actions-center{justify-content:center}.actions-end{justify-content:flex-end}.centred{text-align:center;align-items:center}.centred .icon{align-items:center;width:100%}.centred .title-row{justify-content:center}.centred .content{align-items:center}:host([appearance=outline]){--_icon-width:65px;--_icon-height:75px}:host([appearance=outline]) .card{border:var(--border-width-2) solid var(--color-border-brand);border-radius:var(--shape-radius-2xl);padding:var(--spacing-40)}:host([appearance=outline]) .heading{margin-top:var(--spacing-64)}:host([appearance=outline]) ::slotted(bd-h[slot=title]),:host([appearance=outline]) ::slotted(bd-display[slot=title]){--bd-heading-color:var(--color-text-brand);--bd-paragraph-color:var(--color-text-brand)}:host([appearance=outline]) ::slotted([slot=description]),:host([appearance=outline]) .content ::slotted(*){--bd-paragraph-color:var(--color-text-secondary);text-align:center}:host([appearance=feature]),:host([appearance=inline]){--_icon-width:var(--icon-xl-size);--_icon-height:var(--icon-xl-size)}:host([appearance=feature]) .icon{padding-bottom:var(--spacing-16)}@media (width>=768px){:host([appearance=feature]) .card{grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:start;display:grid}:host([appearance=feature]) .icon{grid-area:1/1/span 3;margin-inline-end:var(--spacing-16);padding-bottom:0}:host([appearance=feature]) .heading,:host([appearance=feature]) .content,:host([appearance=feature]) .actions{grid-column:2}}:host([appearance=inline]) .card{grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:start;display:grid}:host([appearance=inline]) .icon{bottom:var(--spacing-6);grid-column:1;align-self:center;margin-inline-end:var(--spacing-8);padding-bottom:0;position:relative}:host([appearance=inline]) .heading{grid-column:2;align-self:center;margin-bottom:0}:host([appearance=inline]) .title-row{gap:var(--spacing-4)}:host([appearance=inline]) .title{padding-block:var(--spacing-10)}:host([appearance=inline]) .content,:host([appearance=inline]) .actions{grid-column:1/-1}@media (width<768px){:host([appearance=inline]) .card{padding:var(--card-padding-compact)}}@media (width>=768px){.in-grid{grid-template-rows:subgrid;grid-row:1/-1;align-content:start;align-items:start;row-gap:0;display:grid}.in-grid .icon{grid-row:1}.in-grid .heading{grid-row:2}.in-grid .content{grid-template-rows:subgrid;grid-row:3
|
|
1
|
+
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{--_icon-width:var(--icon-2xl-size);--_icon-height:var(--icon-2xl-size);display:block}:host([hidden]){display:none}.card{box-sizing:border-box;text-align:start;background:var(--bd-card-bg,var(--color-surface-container));border:var(--bd-card-border,none);border-radius:var(--card-radius);width:100%;min-width:0;height:100%;padding:var(--card-padding);font-family:var(--typography-fontFamily-sans);flex-direction:column;align-items:flex-start;display:flex;position:relative}:host([background=tint]) .card{background:var(--status-brand-surface)}.card [hidden]{display:none}.media{padding-bottom:var(--spacing-16);display:flex}::slotted([slot=media]){max-width:100%;height:var(--icon-3xl-size);flex:none}::slotted(bd-img[slot=media]){--bd-img-height:var(--icon-3xl-size)}.icon{padding-bottom:var(--spacing-8);flex-direction:column;align-items:flex-start;display:flex}::slotted([slot=icon]){box-sizing:border-box;width:var(--_icon-width);height:var(--_icon-height);flex:none}::slotted(bd-icon[slot=icon]){--bd-icon-size:var(--_icon-width);padding-block:calc((var(--_icon-height) - var(--_icon-width)) / 2);justify-content:center}::slotted(bd-img[slot=icon]){flex-direction:column;justify-content:center;display:flex}::slotted(bd-img[slot=icon][fit=contain]){--bd-img-height:100%}::slotted(bd-mark[slot=icon]){justify-content:center;align-items:center;display:flex}.heading{gap:var(--spacing-4);width:100%;margin-bottom:var(--spacing-8);flex-direction:column;display:flex}.title-row{align-items:center;gap:var(--spacing-8);display:flex}.title{min-width:0}.badge{flex:none;display:flex}::slotted(bd-h[slot=title]),::slotted(bd-display[slot=title]){--bd-heading-font-size:var(--typography-heading-h5-fontSize);--bd-heading-font-weight:var(--typography-fontWeight-bold);--bd-heading-line-height:var(--typography-heading-h5-lineHeight);--bd-heading-letter-spacing:var(--typography-heading-h5-letterSpacing);--bd-heading-font-family:var(--typography-heading-h5-fontFamily);margin:0}::slotted([slot=description]){--bd-paragraph-font-size:var(--typography-body-small-fontSize);--bd-paragraph-font-weight:var(--typography-body-small-fontWeight);--bd-paragraph-line-height:var(--typography-body-small-lineHeight);--bd-paragraph-letter-spacing:var(--typography-body-small-letterSpacing);--bd-heading-color:var(--color-text-muted);--bd-paragraph-color:var(--color-text-muted);--bd-paragraph-margin-bottom:0}.content{flex-direction:column;flex:1;width:100%;display:flex}::slotted(bd-p:last-child){--bd-paragraph-margin-bottom:0}.actions{align-items:flex-start;gap:var(--spacing-8);width:100%;margin-top:var(--spacing-16);padding-top:var(--spacing-8);flex-wrap:wrap;display:flex}.actions-start{justify-content:flex-start}.actions-center{justify-content:center}.actions-end{justify-content:flex-end}.centred{text-align:center;align-items:center}.centred .icon{align-items:center;width:100%}.centred .media{justify-content:center;width:100%}.centred .title-row{justify-content:center}.centred .content{align-items:center}:host([appearance=outline]){--_icon-width:65px;--_icon-height:75px}:host([appearance=outline]) .card{border:var(--border-width-2) solid var(--color-border-brand);border-radius:var(--shape-radius-2xl);padding:var(--spacing-40)}:host([appearance=outline]) .heading{margin-top:var(--spacing-64)}:host([appearance=outline]) ::slotted(bd-h[slot=title]),:host([appearance=outline]) ::slotted(bd-display[slot=title]){--bd-heading-color:var(--color-text-brand);--bd-paragraph-color:var(--color-text-brand)}:host([appearance=outline]) ::slotted([slot=description]),:host([appearance=outline]) .content ::slotted(*){--bd-paragraph-color:var(--color-text-secondary);text-align:center}:host([appearance=feature]),:host([appearance=inline]){--_icon-width:var(--icon-xl-size);--_icon-height:var(--icon-xl-size)}:host([appearance=feature]) .icon{padding-bottom:var(--spacing-16)}@media (width>=768px){:host([appearance=feature]) .card{grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:start;display:grid}:host([appearance=feature]) .icon{grid-area:1/1/span 3;margin-inline-end:var(--spacing-16);padding-bottom:0}:host([appearance=feature]) .heading,:host([appearance=feature]) .content,:host([appearance=feature]) .actions{grid-column:2}}:host([appearance=inline]) .card{grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:start;display:grid}:host([appearance=inline]) .icon{bottom:var(--spacing-6);grid-column:1;align-self:center;margin-inline-end:var(--spacing-8);padding-bottom:0;position:relative}:host([appearance=inline]) .heading{grid-column:2;align-self:center;margin-bottom:0}:host([appearance=inline]) .title-row{gap:var(--spacing-4)}:host([appearance=inline]) .title{padding-block:var(--spacing-10)}:host([appearance=inline]) .content,:host([appearance=inline]) .actions{grid-column:1/-1}@media (width<768px){:host([appearance=inline]) .card{padding:var(--card-padding-compact)}}:host([appearance=media]) .card{background:var(--color-surface-media);--bd-heading-color:var(--color-text-on-media);--bd-paragraph-color:var(--color-text-on-media);overflow:hidden}:host([appearance=media]) .media{padding:0;position:absolute;inset:0}:host([appearance=media]) .icon,:host([appearance=media]) .heading,:host([appearance=media]) .content,:host([appearance=media]) .actions{position:relative}:host([appearance=media]) .card:before{content:"";flex:none;grid-row:1;padding-block-start:66.6667%}:host([appearance=media]) .media:after{content:"";background:linear-gradient(to bottom, transparent, var(--color-surface-media));position:absolute;inset:0}:host([appearance=media]) ::slotted([slot=media]){width:100%;max-width:none;height:100%}:host([appearance=media]) ::slotted(bd-img[slot=media]){--bd-img-height:auto;--bd-img-min-width:100%;grid-template:minmax(0,1fr)/minmax(0,1fr);place-items:stretch stretch;display:grid}:host([appearance=media]) ::slotted(bd-h[slot=title]),:host([appearance=media]) ::slotted(bd-display[slot=title]){--bd-heading-font-size:var(--typography-heading-h3-fontSize);--bd-heading-font-weight:var(--typography-heading-h3-fontWeight);--bd-heading-line-height:var(--typography-heading-h3-lineHeight);--bd-heading-letter-spacing:var(--typography-heading-h3-letterSpacing);--bd-heading-font-family:var(--typography-heading-h3-fontFamily)}:host([appearance=media]) ::slotted([slot=description]),:host([appearance=media]) .content ::slotted(*){--bd-paragraph-font-size:var(--typography-body-large-fontSize);--bd-paragraph-font-weight:var(--typography-body-large-fontWeight);--bd-paragraph-line-height:var(--typography-body-large-lineHeight);--bd-paragraph-letter-spacing:var(--typography-body-large-letterSpacing);--bd-paragraph-color:var(--color-text-on-media)}:host([appearance=media]) .heading{margin-bottom:var(--spacing-16)}:host([appearance=media]) .content{flex:none}@media (width<768px){:host([appearance=media]) .card{padding:var(--card-padding-compact)}}@media (width>=768px){.in-grid{grid-template-rows:subgrid;grid-row:1/-1;align-content:start;align-items:start;row-gap:0;display:grid}.in-grid .media,.in-grid .icon{grid-row:1}.in-grid .heading{grid-row:2}.in-grid .content{grid-template-rows:subgrid;grid-row:3/-2;align-items:start;row-gap:0;display:grid}.in-grid.centred .content{justify-items:center}.in-grid .actions{grid-row:-2}:host([appearance=feature]) .in-grid .icon{grid-row:1/-1}:host([appearance=inline]) .in-grid .icon,:host([appearance=inline]) .in-grid .heading{grid-row:1/span 2}:host([appearance=media]) .in-grid .media{grid-row:auto}}`;export{t as default};
|
|
2
2
|
//# sourceMappingURL=card.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.css.js","names":["card_css_default"],"sources":["../../../../src/components/card/card.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above, below, bodyRole, headingRole, ink } from \"#shared/token-scales.ts\";\n\n/* bd-card's four arrangements. fill and outline are bd-card-item's looks,\n feature is bd-card-features-item's and inline bd-light-carousel-item's\n standard one, each carried over from the stylesheet that drew it and\n measured against that render. */\nexport default css`\n /* The icon's frame, which each appearance sizes below: 48 square on fill,\n the step bd-card-item drew. */\n :host {\n display: block;\n --_icon-width: var(--icon-2xl-size);\n --_icon-height: var(--icon-2xl-size);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .card {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: start;\n /* The container ground, or what a tinted bd-card-grid hands its cards:\n the default ground and an edge (CLAUDE.md, A card's ground and its\n edge). */\n background: var(--bd-card-bg, var(--color-surface-container));\n border: var(--bd-card-border, none);\n border-radius: var(--card-radius);\n padding: var(--card-padding);\n font-family: var(--typography-fontFamily-sans);\n }\n\n :host([background=\"tint\"]) .card {\n background: var(--status-brand-surface);\n }\n\n /* Each part's box is hidden while its slot is empty; the attribute's\n selector outweighs the display a box sets below. */\n .card [hidden] {\n display: none;\n }\n\n /* === ICON ===\n The page writes the atom and the card sizes it, on the slotted element\n itself: 3.x cloned the icon into its shadow root and wrote a size on the\n clone. A bd-icon draws its svg at its own height, so the frame's width is\n the icon's size and the padding centres it in a taller frame; a bd-img\n stretches its image to the frame's width and centres it; a bd-mark keeps\n the size its drawing declares, centred in the frame. */\n .icon {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding-bottom: var(--spacing-8);\n }\n\n ::slotted([slot=\"icon\"]) {\n box-sizing: border-box;\n flex: none;\n width: var(--_icon-width);\n height: var(--_icon-height);\n }\n\n ::slotted(bd-icon[slot=\"icon\"]) {\n --bd-icon-size: var(--_icon-width);\n justify-content: center;\n padding-block: calc((var(--_icon-height) - var(--_icon-width)) / 2);\n }\n\n ::slotted(bd-img[slot=\"icon\"]) {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n ::slotted(bd-mark[slot=\"icon\"]) {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* === TITLE, BADGE, DESCRIPTION ===\n The badge sits beside the title in every appearance, and the description\n under both. */\n .heading {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n width: 100%;\n margin-bottom: var(--spacing-8);\n }\n\n .title-row {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n }\n\n .title {\n min-width: 0;\n }\n\n .badge {\n display: flex;\n flex: none;\n }\n\n /* The card's title: the h5 role in bold, as all three 3.x cards drew it\n (visual-level=\"h5\" font-weight=\"bold\"), at every level the page picks. */\n ::slotted(bd-h[slot=\"title\"]),\n ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(headingRole(\"heading-h5\"))}\n /* no role: the h5 role at 700, which 3.x's font-weight=\"bold\" asked for;\n no heading role carries the h5 size at that weight. */\n --bd-heading-font-weight: var(--typography-fontWeight-bold);\n margin: 0;\n }\n\n /* bd-card-item's subtitle: body-small in muted ink, with no flow margin. */\n ::slotted([slot=\"description\"]) {\n ${unsafeCSS(bodyRole(\"body-small\"))}\n ${unsafeCSS(ink(\"muted\"))}\n --bd-paragraph-margin-bottom: 0;\n }\n\n /* === CONTENT AND ACTIONS === */\n .content {\n flex: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n /* The card's own padding ends it; a closing paragraph's flow margin would\n add 16px inside that padding. Paragraphs before it keep theirs. */\n ::slotted(bd-p:last-child) {\n --bd-paragraph-margin-bottom: 0;\n }\n\n .actions {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: var(--spacing-8);\n width: 100%;\n margin-top: var(--spacing-16);\n padding-top: var(--spacing-8);\n }\n\n .actions-start {\n justify-content: flex-start;\n }\n\n .actions-center {\n justify-content: center;\n }\n\n .actions-end {\n justify-content: flex-end;\n }\n\n /* === CENTRED: align=\"center\", and every outline card === */\n .centred {\n align-items: center;\n text-align: center;\n }\n\n .centred .icon {\n align-items: center;\n width: 100%;\n }\n\n .centred .title-row {\n justify-content: center;\n }\n\n .centred .content {\n align-items: center;\n }\n\n /* === OUTLINE: a brand edge, a wider inset and a taller icon, centred ===\n The title takes the brand ink and the copy the secondary one. 3.x wrote\n the title's colour on the bd-h host, which paints its own ink, so its\n outline titles rendered in the primary ink; the hook is what reaches it. */\n :host([appearance=\"outline\"]) {\n /* no token: the outline icon frame's width, which 3.x wrote in script; the dimension scale stops at 64 */\n --_icon-width: 65px;\n /* no token: the outline icon frame's height, as above */\n --_icon-height: 75px;\n }\n\n :host([appearance=\"outline\"]) .card {\n border: var(--border-width-2) solid var(--color-border-brand);\n border-radius: var(--shape-radius-2xl);\n padding: var(--spacing-40);\n }\n\n :host([appearance=\"outline\"]) .heading {\n margin-top: var(--spacing-64);\n }\n\n :host([appearance=\"outline\"]) ::slotted(bd-h[slot=\"title\"]),\n :host([appearance=\"outline\"]) ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(ink(\"primary\"))}\n }\n\n :host([appearance=\"outline\"]) ::slotted([slot=\"description\"]),\n :host([appearance=\"outline\"]) .content ::slotted(*) {\n --bd-paragraph-color: var(--color-text-secondary);\n text-align: center;\n }\n\n /* === FEATURE: the icon in a column beside everything else ===\n bd-card-features-item's row: a 32 icon, 16 from the title, the badge 8\n beside it. Below md the icon stacks over the title, 16 above it. */\n :host([appearance=\"feature\"]),\n :host([appearance=\"inline\"]) {\n --_icon-width: var(--icon-xl-size);\n --_icon-height: var(--icon-xl-size);\n }\n\n :host([appearance=\"feature\"]) .icon {\n padding-bottom: var(--spacing-16);\n }\n\n @media ${unsafeCSS(above(\"md\"))} {\n :host([appearance=\"feature\"]) .card {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: start;\n align-content: start;\n }\n\n :host([appearance=\"feature\"]) .icon {\n grid-column: 1;\n grid-row: 1 / span 3;\n padding-bottom: 0;\n margin-inline-end: var(--spacing-16);\n }\n\n :host([appearance=\"feature\"]) .heading,\n :host([appearance=\"feature\"]) .content,\n :host([appearance=\"feature\"]) .actions {\n grid-column: 2;\n }\n }\n\n /* === INLINE: the icon in one row with the title and the badge ===\n bd-light-carousel-item's standard header: a 32 icon 8 from the title,\n centred on it and raised 6, the badge 4 beside the title, and 10 above\n and below the title. The copy runs the card's full width under the row,\n and the card takes the compact inset below md, as that item did. */\n :host([appearance=\"inline\"]) .card {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: start;\n align-content: start;\n }\n\n :host([appearance=\"inline\"]) .icon {\n grid-column: 1;\n align-self: center;\n position: relative;\n bottom: var(--spacing-6);\n padding-bottom: 0;\n margin-inline-end: var(--spacing-8);\n }\n\n :host([appearance=\"inline\"]) .heading {\n grid-column: 2;\n align-self: center;\n margin-bottom: 0;\n }\n\n :host([appearance=\"inline\"]) .title-row {\n gap: var(--spacing-4);\n }\n\n :host([appearance=\"inline\"]) .title {\n padding-block: var(--spacing-10);\n }\n\n :host([appearance=\"inline\"]) .content,\n :host([appearance=\"inline\"]) .actions {\n grid-column: 1 / -1;\n }\n\n @media ${unsafeCSS(below(\"md\"))} {\n :host([appearance=\"inline\"]) .card {\n padding: var(--card-padding-compact);\n }\n }\n\n /* === ALIGNED ROWS: a card in a bd-card-grid, from md ===\n The grid makes this host a subgrid spanning its rows -- icon, title, one\n row per content node, actions (card-grid.css.ts) -- and the card's box\n spans them too, so every part starts on one line across a row of cards\n however the text above it wraps. Row gaps stay 0 and the spacing inside\n the card is the parts' own. A feature card's icon spans every row of its\n own column; an inline card's icon and title share the first two. */\n @media ${unsafeCSS(above(\"md\"))} {\n .in-grid {\n display: grid;\n grid-template-rows: subgrid;\n grid-row: 1 / -1;\n row-gap: 0;\n align-items: start;\n align-content: start;\n }\n\n .in-grid .icon {\n grid-row: 1;\n }\n\n .in-grid .heading {\n grid-row: 2;\n }\n\n .in-grid .content {\n display: grid;\n grid-template-rows: subgrid;\n grid-row: 3 / span var(--bd-card-content-rows, 1);\n row-gap: 0;\n align-items: start;\n }\n\n .in-grid.centred .content {\n justify-items: center;\n }\n\n .in-grid .actions {\n grid-row: -2;\n }\n\n :host([appearance=\"feature\"]) .in-grid .icon {\n grid-row: 1 / -1;\n }\n\n :host([appearance=\"inline\"]) .in-grid .icon,\n :host([appearance=\"inline\"]) .in-grid .heading {\n grid-row: 1 / span 2;\n }\n }\n`;\n"],"mappings":"A,4DAOA,IAAAA,EAAe,CAAG,2jK"}
|
|
1
|
+
{"version":3,"file":"card.css.js","names":["card_css_default"],"sources":["../../../../src/components/card/card.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { above, below, bodyRole, headingRole, ink } from \"#shared/token-scales.ts\";\n\n/* bd-card's five arrangements. fill and outline are bd-card-item's looks,\n feature is bd-card-features-item's and inline bd-light-carousel-item's\n standard one, each carried over from the stylesheet that drew it and\n measured against that render. */\nexport default css`\n /* The icon's frame, which each appearance sizes below: 48 square on fill,\n the step bd-card-item drew. */\n :host {\n display: block;\n --_icon-width: var(--icon-2xl-size);\n --_icon-height: var(--icon-2xl-size);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .card {\n position: relative;\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: start;\n /* The container ground, or what a tinted bd-card-grid hands its cards:\n the default ground and an edge (CLAUDE.md, A card's ground and its\n edge). */\n background: var(--bd-card-bg, var(--color-surface-container));\n border: var(--bd-card-border, none);\n border-radius: var(--card-radius);\n padding: var(--card-padding);\n font-family: var(--typography-fontFamily-sans);\n }\n\n :host([background=\"tint\"]) .card {\n background: var(--status-brand-surface);\n }\n\n /* Each part's box is hidden while its slot is empty; the attribute's\n selector outweighs the display a box sets below. */\n .card [hidden] {\n display: none;\n }\n\n /* === MEDIA ===\n A picture the card draws whole, before the icon. Off the media\n appearance it heads the card at the outline icon frame's height and its\n own width, the cards-with-img column's partner logo (DEX-29440): the\n bd-img's own <img> takes the height through --bd-img-height and its\n width follows the logo's proportions, so no logo is cropped. A card\n heads with a picture or an icon: in a bd-card-grid both take the first\n row. */\n .media {\n display: flex;\n padding-bottom: var(--spacing-16);\n }\n\n ::slotted([slot=\"media\"]) {\n flex: none;\n max-width: 100%;\n height: var(--icon-3xl-size);\n }\n\n ::slotted(bd-img[slot=\"media\"]) {\n --bd-img-height: var(--icon-3xl-size);\n }\n\n /* === ICON ===\n The page writes the atom and the card sizes it, on the slotted element\n itself: 3.x cloned the icon into its shadow root and wrote a size on the\n clone. A bd-icon draws its svg at its own height, so the frame's width is\n the icon's size and the padding centres it in a taller frame; a bd-img\n stretches its image to the frame's width and centres it; a bd-mark keeps\n the size its drawing declares, centred in the frame. */\n .icon {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding-bottom: var(--spacing-8);\n }\n\n ::slotted([slot=\"icon\"]) {\n box-sizing: border-box;\n flex: none;\n width: var(--_icon-width);\n height: var(--_icon-height);\n }\n\n ::slotted(bd-icon[slot=\"icon\"]) {\n --bd-icon-size: var(--_icon-width);\n justify-content: center;\n padding-block: calc((var(--_icon-height) - var(--_icon-width)) / 2);\n }\n\n ::slotted(bd-img[slot=\"icon\"]) {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n /* An icon written fit=\"contain\" is drawn whole inside the frame, whatever\n its proportions: its <img> takes the frame's height through\n --bd-img-height as well as its width, and the fit keeps the drawing's\n shape -- the website's shield icons, 65 by 72 and 64 square, all inside\n 48 (DEX-29440). Without it the image keeps the frame's width alone. */\n ::slotted(bd-img[slot=\"icon\"][fit=\"contain\"]) {\n --bd-img-height: 100%;\n }\n\n ::slotted(bd-mark[slot=\"icon\"]) {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* === TITLE, BADGE, DESCRIPTION ===\n The badge sits beside the title in every appearance, and the description\n under both. */\n .heading {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n width: 100%;\n margin-bottom: var(--spacing-8);\n }\n\n .title-row {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n }\n\n .title {\n min-width: 0;\n }\n\n .badge {\n display: flex;\n flex: none;\n }\n\n /* The card's title: the h5 role in bold, as all three 3.x cards drew it\n (visual-level=\"h5\" font-weight=\"bold\"), at every level the page picks. */\n ::slotted(bd-h[slot=\"title\"]),\n ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(headingRole(\"heading-h5\"))}\n /* no role: the h5 role at 700, which 3.x's font-weight=\"bold\" asked for;\n no heading role carries the h5 size at that weight. */\n --bd-heading-font-weight: var(--typography-fontWeight-bold);\n margin: 0;\n }\n\n /* bd-card-item's subtitle: body-small in muted ink, with no flow margin. */\n ::slotted([slot=\"description\"]) {\n ${unsafeCSS(bodyRole(\"body-small\"))}\n ${unsafeCSS(ink(\"muted\"))}\n --bd-paragraph-margin-bottom: 0;\n }\n\n /* === CONTENT AND ACTIONS === */\n .content {\n flex: 1;\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n\n /* The card's own padding ends it; a closing paragraph's flow margin would\n add 16px inside that padding. Paragraphs before it keep theirs. */\n ::slotted(bd-p:last-child) {\n --bd-paragraph-margin-bottom: 0;\n }\n\n .actions {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: var(--spacing-8);\n width: 100%;\n margin-top: var(--spacing-16);\n padding-top: var(--spacing-8);\n }\n\n .actions-start {\n justify-content: flex-start;\n }\n\n .actions-center {\n justify-content: center;\n }\n\n .actions-end {\n justify-content: flex-end;\n }\n\n /* === CENTRED: align=\"center\", and every outline card === */\n .centred {\n align-items: center;\n text-align: center;\n }\n\n .centred .icon {\n align-items: center;\n width: 100%;\n }\n\n .centred .media {\n justify-content: center;\n width: 100%;\n }\n\n .centred .title-row {\n justify-content: center;\n }\n\n .centred .content {\n align-items: center;\n }\n\n /* === OUTLINE: a brand edge, a wider inset and a taller icon, centred ===\n The title takes the brand ink and the copy the secondary one. 3.x wrote\n the title's colour on the bd-h host, which paints its own ink, so its\n outline titles rendered in the primary ink; the hook is what reaches it. */\n :host([appearance=\"outline\"]) {\n /* no token: the outline icon frame's width, which 3.x wrote in script; the dimension scale stops at 64 */\n --_icon-width: 65px;\n /* no token: the outline icon frame's height, as above */\n --_icon-height: 75px;\n }\n\n :host([appearance=\"outline\"]) .card {\n border: var(--border-width-2) solid var(--color-border-brand);\n border-radius: var(--shape-radius-2xl);\n padding: var(--spacing-40);\n }\n\n :host([appearance=\"outline\"]) .heading {\n margin-top: var(--spacing-64);\n }\n\n :host([appearance=\"outline\"]) ::slotted(bd-h[slot=\"title\"]),\n :host([appearance=\"outline\"]) ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(ink(\"primary\"))}\n }\n\n :host([appearance=\"outline\"]) ::slotted([slot=\"description\"]),\n :host([appearance=\"outline\"]) .content ::slotted(*) {\n --bd-paragraph-color: var(--color-text-secondary);\n text-align: center;\n }\n\n /* === FEATURE: the icon in a column beside everything else ===\n bd-card-features-item's row: a 32 icon, 16 from the title, the badge 8\n beside it. Below md the icon stacks over the title, 16 above it. */\n :host([appearance=\"feature\"]),\n :host([appearance=\"inline\"]) {\n --_icon-width: var(--icon-xl-size);\n --_icon-height: var(--icon-xl-size);\n }\n\n :host([appearance=\"feature\"]) .icon {\n padding-bottom: var(--spacing-16);\n }\n\n @media ${unsafeCSS(above(\"md\"))} {\n :host([appearance=\"feature\"]) .card {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: start;\n align-content: start;\n }\n\n :host([appearance=\"feature\"]) .icon {\n grid-column: 1;\n grid-row: 1 / span 3;\n padding-bottom: 0;\n margin-inline-end: var(--spacing-16);\n }\n\n :host([appearance=\"feature\"]) .heading,\n :host([appearance=\"feature\"]) .content,\n :host([appearance=\"feature\"]) .actions {\n grid-column: 2;\n }\n }\n\n /* === INLINE: the icon in one row with the title and the badge ===\n bd-light-carousel-item's standard header: a 32 icon 8 from the title,\n centred on it and raised 6, the badge 4 beside the title, and 10 above\n and below the title. The copy runs the card's full width under the row,\n and the card takes the compact inset below md, as that item did. */\n :host([appearance=\"inline\"]) .card {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: start;\n align-content: start;\n }\n\n :host([appearance=\"inline\"]) .icon {\n grid-column: 1;\n align-self: center;\n position: relative;\n bottom: var(--spacing-6);\n padding-bottom: 0;\n margin-inline-end: var(--spacing-8);\n }\n\n :host([appearance=\"inline\"]) .heading {\n grid-column: 2;\n align-self: center;\n margin-bottom: 0;\n }\n\n :host([appearance=\"inline\"]) .title-row {\n gap: var(--spacing-4);\n }\n\n :host([appearance=\"inline\"]) .title {\n padding-block: var(--spacing-10);\n }\n\n :host([appearance=\"inline\"]) .content,\n :host([appearance=\"inline\"]) .actions {\n grid-column: 1 / -1;\n }\n\n @media ${unsafeCSS(below(\"md\"))} {\n :host([appearance=\"inline\"]) .card {\n padding: var(--card-padding-compact);\n }\n }\n\n /* === MEDIA: the parts over the picture, which fills the card ===\n The website's text-over-image columns (DEX-29440): the picture is the\n card's ground and the parts stand at its foot on a scrim that runs from\n clear at the top to the media frame's ground behind the words, so their\n on-media ink holds its contrast whatever the picture. The picture shows\n two thirds of the card's width above the words, which in a bd-card-grid\n keep the grid's rows, so the titles and the copy start on one line\n across the row, as the website's cards do; it draws no edge: the\n picture is its edge. Its title is the h3 role, a headline over the\n picture rather than an item's label, and the copy body-large, as the\n website's card drew them (32/600 and 18). */\n :host([appearance=\"media\"]) .card {\n overflow: hidden;\n background: var(--color-surface-media);\n --bd-heading-color: var(--color-text-on-media);\n --bd-paragraph-color: var(--color-text-on-media);\n }\n\n :host([appearance=\"media\"]) .media {\n position: absolute;\n inset: 0;\n padding: 0;\n }\n\n /* positioned after the picture, so they paint over it in source order */\n :host([appearance=\"media\"]) .icon,\n :host([appearance=\"media\"]) .heading,\n :host([appearance=\"media\"]) .content,\n :host([appearance=\"media\"]) .actions {\n position: relative;\n }\n\n /* the picture's share above the words, in the first row, where an icon\n would be: in a grid the words then keep the rows below it */\n :host([appearance=\"media\"]) .card::before {\n content: \"\";\n flex: none;\n grid-row: 1;\n /* A padding percentage is of the card's width, so this is two thirds of\n it without making the host a size container, whose containment would\n take the card out of the grid's subgrid rows.\n no token: the picture shown above the words, two thirds of the card's width, as the website's text-over-image card drew it (273 of 409) */\n padding-block-start: calc(100% * 2 / 3);\n }\n\n :host([appearance=\"media\"]) .media::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(to bottom, transparent, var(--color-surface-media));\n }\n\n :host([appearance=\"media\"]) ::slotted([slot=\"media\"]) {\n width: 100%;\n max-width: none;\n height: 100%;\n }\n\n /* bd-img's own <img> sizes itself from its image, so the cover stretches\n it both ways as a grid item, and its fit (cover by default) keeps the\n picture's proportions (post-card.css.ts) */\n :host([appearance=\"media\"]) ::slotted(bd-img[slot=\"media\"]) {\n --bd-img-height: auto;\n /* the picture's width attribute would hold it at its own width in a\n card wider than that; it fills the card at any width */\n --bd-img-min-width: 100%;\n display: grid;\n grid-template: minmax(0, 1fr) / minmax(0, 1fr);\n align-items: stretch;\n justify-items: stretch;\n }\n\n :host([appearance=\"media\"]) ::slotted(bd-h[slot=\"title\"]),\n :host([appearance=\"media\"]) ::slotted(bd-display[slot=\"title\"]) {\n ${unsafeCSS(headingRole(\"heading-h3\"))}\n }\n\n :host([appearance=\"media\"]) ::slotted([slot=\"description\"]),\n :host([appearance=\"media\"]) .content ::slotted(*) {\n ${unsafeCSS(bodyRole(\"body-large\"))}\n --bd-paragraph-color: var(--color-text-on-media);\n }\n\n /* A bigger title takes the bigger gap: at the heading-h3 role it stands\n 16 over the copy, the section title to content distance\n (Foundations/Spacing/Rhythm), where the h5 card title keeps the item\n distance, 8. */\n :host([appearance=\"media\"]) .heading {\n margin-bottom: var(--spacing-16);\n }\n\n /* the copy keeps its height at the foot */\n :host([appearance=\"media\"]) .content {\n flex: none;\n }\n\n @media ${unsafeCSS(below(\"md\"))} {\n :host([appearance=\"media\"]) .card {\n padding: var(--card-padding-compact);\n }\n }\n\n /* === ALIGNED ROWS: a card in a bd-card-grid, or a bd-grid with\n item-rows, from md ===\n The grid makes this host a subgrid spanning its rows -- icon, title, one\n row per content node, actions (card-grid.css.ts, grid.css.ts) -- and\n the card's box\n spans them too, so every part starts on one line across a row of cards\n however the text above it wraps. Row gaps stay 0 and the spacing inside\n the card is the parts' own. A feature card's icon spans every row of its\n own column; an inline card's icon and title share the first two. */\n @media ${unsafeCSS(above(\"md\"))} {\n .in-grid {\n display: grid;\n grid-template-rows: subgrid;\n grid-row: 1 / -1;\n row-gap: 0;\n align-items: start;\n align-content: start;\n }\n\n .in-grid .media,\n .in-grid .icon {\n grid-row: 1;\n }\n\n .in-grid .heading {\n grid-row: 2;\n }\n\n .in-grid .content {\n display: grid;\n grid-template-rows: subgrid;\n /* every row between the title's and the actions': the content rows\n bd-card-grid counts, or the ones a bd-grid's item-rows leaves */\n grid-row: 3 / -2;\n row-gap: 0;\n align-items: start;\n }\n\n .in-grid.centred .content {\n justify-items: center;\n }\n\n .in-grid .actions {\n grid-row: -2;\n }\n\n :host([appearance=\"feature\"]) .in-grid .icon {\n grid-row: 1 / -1;\n }\n\n :host([appearance=\"inline\"]) .in-grid .icon,\n :host([appearance=\"inline\"]) .in-grid .heading {\n grid-row: 1 / span 2;\n }\n\n /* A media card's picture is positioned over the whole card: placed in\n a row, it would take that row's area for its box and leave the card's\n top inset bare. */\n :host([appearance=\"media\"]) .in-grid .media {\n grid-row: auto;\n }\n }\n`;\n"],"mappings":"A,4DAOA,IAAAA,EAAe,CAAG,m2O"}
|
|
@@ -39,6 +39,14 @@ type ActionsAlign = typeof ACTIONS_ALIGNS[number];
|
|
|
39
39
|
* card
|
|
40
40
|
* inline the icon in one row with the title and badge: the light
|
|
41
41
|
* carousel's standard look
|
|
42
|
+
* media the parts over the picture in `media`, which fills the card,
|
|
43
|
+
* on a scrim of the media frame: the website's text-over-image
|
|
44
|
+
* columns (DEX-29440)
|
|
45
|
+
*
|
|
46
|
+
* `media` is a picture the card draws whole. On media it is the card's
|
|
47
|
+
* ground; on every other appearance it heads the card, above the icon, at
|
|
48
|
+
* the height of the outline icon frame and its own width -- a partner's
|
|
49
|
+
* logo, as the website's cards-with-img columns drew it (DEX-29440).
|
|
42
50
|
*
|
|
43
51
|
* The page writes every part (ADR 0003) and picks the title's level; the card
|
|
44
52
|
* draws the title at the heading-h5 role in bold, and the description at
|
|
@@ -49,12 +57,13 @@ type ActionsAlign = typeof ACTIONS_ALIGNS[number];
|
|
|
49
57
|
*
|
|
50
58
|
* In a bd-card-grid the grid hands its `appearance` to every card whose markup
|
|
51
59
|
* sets none, and from md the card is a subgrid of the grid's rows: icon,
|
|
52
|
-
* title, one row per content node, actions.
|
|
60
|
+
* title, one row per content node, actions. The same holds in a bd-grid
|
|
61
|
+
* with item-rows, where the page counts those rows itself (DEX-29440). Only the default slot's nodes are
|
|
53
62
|
* rows, which _contentNodes() counts for the grid.
|
|
54
63
|
*/
|
|
55
64
|
export declare class BdCard extends LitElement {
|
|
56
65
|
static styles: import("lit").CSSResult[];
|
|
57
|
-
/** The arrangement: fill (default), outline, feature or
|
|
66
|
+
/** The arrangement: fill (default), outline, feature, inline or media. Reflected, for the stylesheet. */
|
|
58
67
|
appearance: CardAppearance;
|
|
59
68
|
/** start, or center: the parts centred in the card. outline is always centred. */
|
|
60
69
|
align: Align;
|
|
@@ -65,7 +74,7 @@ export declare class BdCard extends LitElement {
|
|
|
65
74
|
private _inGrid;
|
|
66
75
|
_ownAppearance: boolean;
|
|
67
76
|
private _ownWrite;
|
|
68
|
-
_slots: SlotController<"" | "title" | "description" | "badge" | "icon" | "actions">;
|
|
77
|
+
_slots: SlotController<"" | "title" | "description" | "badge" | "icon" | "media" | "actions">;
|
|
69
78
|
requestUpdate(...args: Parameters<LitElement["requestUpdate"]>): void;
|
|
70
79
|
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
71
80
|
connectedCallback(): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{isOneOf as t}from"../shared/prop-vocabulary.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../p/p.js";import{SlotController as r}from"../shared/controller.slot.js";import"../h/h.js";import"../link/link.js";import"../badge/badge.js";import"../button/button.js";import"../img/img.js";import{CARD_APPEARANCES as i}from"./card-grid.js";import a from"./card.css.js";import{LitElement as o,html as s}from"lit";import{property as c,state as l}from"lit/decorators.js";var u=[`start`,`center`],d=[`container`,`tint`],f=[``,`start`,`center`,`end`],p=class extends o{constructor(...e){super(...e),this.appearance=`fill`,this.align=`start`,this.background=`container`,this.actionsAlign=``,this._inGrid=!1,this._ownAppearance=this.hasAttribute(`appearance`),this._ownWrite=!1,this._slots=new r(this,{slots:[`icon`,`title`,`badge`,`description`,`actions`,``]})}static{this.styles=[a]}requestUpdate(...e){e[0]===`appearance`&&!this._ownWrite&&this._ownAppearance!==void 0&&(this._ownAppearance=!0),super.requestUpdate(...e)}attributeChangedCallback(e,t,n){e!==`appearance`||this._ownWrite?super.attributeChangedCallback(e,t,n):(this._quietly(()=>super.attributeChangedCallback(e,t,n)),this._ownAppearance=n!==null,n===null&&this._inGrid&&this._takeAppearance(this.parentElement.appearance))}connectedCallback(){super.connectedCallback()
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import{isOneOf as t}from"../shared/prop-vocabulary.js";import n from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../p/p.js";import{SlotController as r}from"../shared/controller.slot.js";import"../h/h.js";import"../link/link.js";import"../badge/badge.js";import"../button/button.js";import"../img/img.js";import{CARD_APPEARANCES as i}from"./card-grid.js";import a from"./card.css.js";import{LitElement as o,html as s}from"lit";import{property as c,state as l}from"lit/decorators.js";var u=[`start`,`center`],d=[`container`,`tint`],f=[``,`start`,`center`,`end`],p=class extends o{constructor(...e){super(...e),this.appearance=`fill`,this.align=`start`,this.background=`container`,this.actionsAlign=``,this._inGrid=!1,this._ownAppearance=this.hasAttribute(`appearance`),this._ownWrite=!1,this._slots=new r(this,{slots:[`media`,`icon`,`title`,`badge`,`description`,`actions`,``]})}static{this.styles=[a]}requestUpdate(...e){e[0]===`appearance`&&!this._ownWrite&&this._ownAppearance!==void 0&&(this._ownAppearance=!0),super.requestUpdate(...e)}attributeChangedCallback(e,t,n){e!==`appearance`||this._ownWrite?super.attributeChangedCallback(e,t,n):(this._quietly(()=>super.attributeChangedCallback(e,t,n)),this._ownAppearance=n!==null,n===null&&this._inGrid&&this._takeAppearance(this.parentElement.appearance))}connectedCallback(){super.connectedCallback();let e=this.parentElement;this._inGrid=e?.localName===`bd-card-grid`||e?.localName===`bd-grid`&&Number(e.getAttribute(`item-rows`))>0}update(e){this._quietly(()=>super.update(e))}_takeAppearance(e){this._ownAppearance||this._quietly(()=>{this.appearance=e})}_quietly(e){let t=this._ownWrite;this._ownWrite=!0;try{e()}finally{this._ownWrite=t}}willUpdate(e){e.has(`appearance`)&&!t(i,this.appearance)&&this._quietly(()=>{this.appearance=`fill`}),e.has(`align`)&&!t(u,this.align)&&(this.align=`start`),e.has(`background`)&&!t(d,this.background)&&(this.background=`container`),e.has(`actionsAlign`)&&!t(f,this.actionsAlign)&&(this.actionsAlign=``)}_contentNodes(){return[...this.childNodes].filter(e=>e.nodeType===Node.ELEMENT_NODE?!e.slot:e.nodeType===Node.TEXT_NODE&&e.data.trim()!==``)}render(){let e=e=>this._slots.has(e),t=this.align===`center`||this.appearance===`outline`,n=this.actionsAlign||(t?`center`:`start`);return s`
|
|
2
2
|
<div class="card ${this._inGrid?`in-grid`:``} ${t?`centred`:``}">
|
|
3
|
+
<div class="media" ?hidden=${!e(`media`)}><slot name="media"></slot></div>
|
|
3
4
|
<div class="icon" ?hidden=${!e(`icon`)}><slot name="icon"></slot></div>
|
|
4
5
|
<div class="heading" ?hidden=${!e(`title`)&&!e(`badge`)&&!e(`description`)}>
|
|
5
6
|
<div class="title-row" ?hidden=${!e(`title`)&&!e(`badge`)}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":["cardCSS","_decorate","__decorate","card_css_default","ALIGNS","BACKGROUNDS","ACTIONS_ALIGNS","BdCard","LitElement","_args","SlotController","args","name","old","value","changed","was","write","isOneOf","CARD_APPEARANCES","node","has","centred","actionsAlign","property","state","defineElement"],"sources":["../../../../src/components/card/card.ts"],"sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\n/* ./card registers the family: the card, and the grid that lines cards up. */\nimport { CARD_APPEARANCES, type BdCardGrid, type CardAppearance } from \"./card-grid.ts\";\n/* The atoms the page writes into the card's slots. The card renders none of\n them now, but 3.x's three card modules registered bd-h, bd-badge and\n bd-button between them, and a page importing only this module still gets\n what it writes. An icon or a mark registers with its drawing. */\nimport \"#components/badge/badge.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/h/h.ts\";\nimport \"#components/img/img.ts\";\nimport \"#components/link/link.ts\";\nimport \"#components/p/p.ts\";\nimport cardCSS from \"./card.css.ts\";\n\nconst ALIGNS = [\"start\", \"center\"] as const;\nconst BACKGROUNDS = [\"container\", \"tint\"] as const;\nconst ACTIONS_ALIGNS = [\"\", \"start\", \"center\", \"end\"] as const;\n\ntype Align = typeof ALIGNS[number];\ntype Background = typeof BACKGROUNDS[number];\ntype ActionsAlign = typeof ACTIONS_ALIGNS[number];\ntype Part = \"icon\" | \"title\" | \"badge\" | \"description\" | \"actions\" | \"\";\n\n/**\n * A card: an icon, a title with a badge beside it, a description, content\n * rows and actions. It stands alone, or in a bd-card-grid, which lines the\n * parts of a row of cards up with each other.\n *\n * <bd-card>\n * <bd-icon slot=\"icon\" name=\"globe\"></bd-icon>\n * <bd-h slot=\"title\" as=\"h3\">VPN Included</bd-h>\n * <bd-badge slot=\"badge\" appearance=\"fill\" variant=\"brand\" size=\"sm\">NEW</bd-badge>\n * <bd-p slot=\"description\">For every device</bd-p>\n * <bd-p>Unlimited encrypted VPN traffic.</bd-p>\n * <bd-button slot=\"actions\" href=\"#\" size=\"sm\">Learn more</bd-button>\n * </bd-card>\n *\n * It replaces bd-card-item, bd-card-features-item and bd-light-carousel-item,\n * which drew these parts in three arrangements; the arrangement is\n * `appearance`:\n *\n * fill the parts stacked on a container ground: bd-card-item's own\n * look, and the light carousel's simple one\n * outline stacked and centred, with a brand edge: bd-card-item's outline\n * feature the icon in a column beside everything else: the card-features\n * card\n * inline the icon in one row with the title and badge: the light\n * carousel's standard look\n *\n * The page writes every part (ADR 0003) and picks the title's level; the card\n * draws the title at the heading-h5 role in bold, and the description at\n * body-small in muted ink. The icon is sized by the card's stylesheet on the\n * slotted atom itself -- 48 square, 65 by 75 on outline, 32 on feature and\n * inline -- so nothing is cloned or measured. Each part's box is hidden while\n * its slot is empty.\n *\n * In a bd-card-grid the grid hands its `appearance` to every card whose markup\n * sets none, and from md the card is a subgrid of the grid's rows: icon,\n * title, one row per content node, actions. Only the default slot's nodes are\n * rows, which _contentNodes() counts for the grid.\n */\n@defineElement(\"bd-card\")\nexport class BdCard extends LitElement {\n static styles = [cardCSS];\n\n /** The arrangement: fill (default), outline, feature or inline. Reflected, for the stylesheet. */\n @property({ type: String, reflect: true })\n appearance: CardAppearance = \"fill\";\n\n /** start, or center: the parts centred in the card. outline is always centred. */\n @property({ type: String, reflect: true })\n align: Align = \"start\";\n\n /** The card's ground: container (default), --color-surface-container, or tint, the brand wash. */\n @property({ type: String, reflect: true })\n background: Background = \"container\";\n\n /** Where the actions sit: start, center or end; unset, they follow `align`. */\n @property({ type: String, attribute: \"actions-align\" })\n actionsAlign: ActionsAlign = \"\";\n\n /* Whether the card's parent is a bd-card-grid, whose subgrid rows it then\n lines its parts up on (from md). Read on connect, so a card moved into or\n out of a grid follows. */\n @state()\n private _inGrid = false;\n\n /* Whether the page chose this card's appearance, which bd-card-grid then\n leaves alone: in its markup, through an attribute a template binds after\n the card was created, or by setting the property, as React 19 and a Lit\n `.appearance=` binding do. Read before Lit's first update reflects the\n default onto the attribute -- after that, hasAttribute() is true of every\n card -- and followed through every later write but the card's own: its\n reflection, the grid's push (_takeAppearance) and willUpdate's repair. */\n _ownAppearance = this.hasAttribute(\"appearance\");\n /* Set while the card writes `appearance` itself, so the write is not taken for the page's. */\n private _ownWrite = false;\n\n _slots = new SlotController(this, { slots: [\"icon\", \"title\", \"badge\", \"description\", \"actions\", \"\"] });\n\n /* Every write of the property reaches here, the page's included. The\n default is written before _ownAppearance is initialised, which is how\n that one write is told apart from the page's. */\n requestUpdate(...args: Parameters<LitElement[\"requestUpdate\"]>) {\n if (args[0] === \"appearance\" && !this._ownWrite && this._ownAppearance !== undefined) this._ownAppearance = true;\n super.requestUpdate(...args);\n }\n\n attributeChangedCallback(name: string, old: string | null, value: string | null) {\n if (name !== \"appearance\" || this._ownWrite) {\n super.attributeChangedCallback(name, old, value);\n return;\n }\n // the page's attribute: the property follows it, and the card is the page's while it is there\n this._quietly(() => super.attributeChangedCallback(name, old, value));\n this._ownAppearance = value !== null;\n // the page took its own away: in a grid, the grid's is the card's again\n if (value === null && this._inGrid) this._takeAppearance((this.parentElement as BdCardGrid).appearance);\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._inGrid = this.parentElement?.localName === \"bd-card-grid\";\n }\n\n /* ReactiveElement reflects properties to attributes inside update(). */\n protected update(changed: PropertyValues<this>) {\n this._quietly(() => super.update(changed));\n }\n\n /** bd-card-grid's appearance, which the card takes unless the page chose its own. */\n _takeAppearance(value: CardAppearance) {\n if (!this._ownAppearance) this._quietly(() => { this.appearance = value; });\n }\n\n private _quietly(write: () => void) {\n const was = this._ownWrite;\n this._ownWrite = true;\n try {\n write();\n } finally {\n this._ownWrite = was;\n }\n }\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") && !isOneOf(CARD_APPEARANCES, this.appearance)) this._quietly(() => { this.appearance = \"fill\"; });\n if (changed.has(\"align\") && !isOneOf(ALIGNS, this.align)) this.align = \"start\";\n if (changed.has(\"background\") && !isOneOf(BACKGROUNDS, this.background)) this.background = \"container\";\n if (changed.has(\"actionsAlign\") && !isOneOf(ACTIONS_ALIGNS, this.actionsAlign)) this.actionsAlign = \"\";\n }\n\n /** The default slot's nodes, each a content row of the grid: elements the page gave no slot, and words. */\n _contentNodes() {\n return [...this.childNodes].filter(node => (node.nodeType === Node.ELEMENT_NODE\n ? !(node as Element).slot\n : node.nodeType === Node.TEXT_NODE && (node as Text).data.trim() !== \"\"));\n }\n\n render() {\n const has = (name: Part) => this._slots.has(name);\n const centred = this.align === \"center\" || this.appearance === \"outline\";\n const actionsAlign = this.actionsAlign || (centred ? \"center\" : \"start\");\n return html`\n <div class=\"card ${this._inGrid ? \"in-grid\" : \"\"} ${centred ? \"centred\" : \"\"}\">\n <div class=\"icon\" ?hidden=${!has(\"icon\")}><slot name=\"icon\"></slot></div>\n <div class=\"heading\" ?hidden=${!has(\"title\") && !has(\"badge\") && !has(\"description\")}>\n <div class=\"title-row\" ?hidden=${!has(\"title\") && !has(\"badge\")}>\n <div class=\"title\" ?hidden=${!has(\"title\")}><slot name=\"title\"></slot></div>\n <div class=\"badge\" ?hidden=${!has(\"badge\")}><slot name=\"badge\"></slot></div>\n </div>\n <div class=\"description\" ?hidden=${!has(\"description\")}><slot name=\"description\"></slot></div>\n </div>\n <div class=\"content\" ?hidden=${!has(\"\")}><slot></slot></div>\n <div class=\"actions actions-${actionsAlign}\" ?hidden=${!has(\"actions\")}><slot name=\"actions\"></slot></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-card\": BdCard;\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"card.js","names":["cardCSS","_decorate","__decorate","card_css_default","ALIGNS","BACKGROUNDS","ACTIONS_ALIGNS","BdCard","LitElement","_args","SlotController","args","name","old","value","parent","changed","was","write","isOneOf","CARD_APPEARANCES","node","has","centred","actionsAlign","property","state","defineElement"],"sources":["../../../../src/components/card/card.ts"],"sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { SlotController } from \"#shared/controller.slot.ts\";\nimport { defineElement } from \"#shared/define-element.ts\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\n// Installs the design tokens into document scope; see src/tokens/tokens.ts\nimport \"#tokens/tokens.ts\";\n/* ./card registers the family: the card, and the grid that lines cards up. */\nimport { CARD_APPEARANCES, type BdCardGrid, type CardAppearance } from \"./card-grid.ts\";\n/* The atoms the page writes into the card's slots. The card renders none of\n them now, but 3.x's three card modules registered bd-h, bd-badge and\n bd-button between them, and a page importing only this module still gets\n what it writes. An icon or a mark registers with its drawing. */\nimport \"#components/badge/badge.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/h/h.ts\";\nimport \"#components/img/img.ts\";\nimport \"#components/link/link.ts\";\nimport \"#components/p/p.ts\";\nimport cardCSS from \"./card.css.ts\";\n\nconst ALIGNS = [\"start\", \"center\"] as const;\nconst BACKGROUNDS = [\"container\", \"tint\"] as const;\nconst ACTIONS_ALIGNS = [\"\", \"start\", \"center\", \"end\"] as const;\n\ntype Align = typeof ALIGNS[number];\ntype Background = typeof BACKGROUNDS[number];\ntype ActionsAlign = typeof ACTIONS_ALIGNS[number];\ntype Part = \"media\" | \"icon\" | \"title\" | \"badge\" | \"description\" | \"actions\" | \"\";\n\n/**\n * A card: an icon, a title with a badge beside it, a description, content\n * rows and actions. It stands alone, or in a bd-card-grid, which lines the\n * parts of a row of cards up with each other.\n *\n * <bd-card>\n * <bd-icon slot=\"icon\" name=\"globe\"></bd-icon>\n * <bd-h slot=\"title\" as=\"h3\">VPN Included</bd-h>\n * <bd-badge slot=\"badge\" appearance=\"fill\" variant=\"brand\" size=\"sm\">NEW</bd-badge>\n * <bd-p slot=\"description\">For every device</bd-p>\n * <bd-p>Unlimited encrypted VPN traffic.</bd-p>\n * <bd-button slot=\"actions\" href=\"#\" size=\"sm\">Learn more</bd-button>\n * </bd-card>\n *\n * It replaces bd-card-item, bd-card-features-item and bd-light-carousel-item,\n * which drew these parts in three arrangements; the arrangement is\n * `appearance`:\n *\n * fill the parts stacked on a container ground: bd-card-item's own\n * look, and the light carousel's simple one\n * outline stacked and centred, with a brand edge: bd-card-item's outline\n * feature the icon in a column beside everything else: the card-features\n * card\n * inline the icon in one row with the title and badge: the light\n * carousel's standard look\n * media the parts over the picture in `media`, which fills the card,\n * on a scrim of the media frame: the website's text-over-image\n * columns (DEX-29440)\n *\n * `media` is a picture the card draws whole. On media it is the card's\n * ground; on every other appearance it heads the card, above the icon, at\n * the height of the outline icon frame and its own width -- a partner's\n * logo, as the website's cards-with-img columns drew it (DEX-29440).\n *\n * The page writes every part (ADR 0003) and picks the title's level; the card\n * draws the title at the heading-h5 role in bold, and the description at\n * body-small in muted ink. The icon is sized by the card's stylesheet on the\n * slotted atom itself -- 48 square, 65 by 75 on outline, 32 on feature and\n * inline -- so nothing is cloned or measured. Each part's box is hidden while\n * its slot is empty.\n *\n * In a bd-card-grid the grid hands its `appearance` to every card whose markup\n * sets none, and from md the card is a subgrid of the grid's rows: icon,\n * title, one row per content node, actions. The same holds in a bd-grid\n * with item-rows, where the page counts those rows itself (DEX-29440). Only the default slot's nodes are\n * rows, which _contentNodes() counts for the grid.\n */\n@defineElement(\"bd-card\")\nexport class BdCard extends LitElement {\n static styles = [cardCSS];\n\n /** The arrangement: fill (default), outline, feature, inline or media. Reflected, for the stylesheet. */\n @property({ type: String, reflect: true })\n appearance: CardAppearance = \"fill\";\n\n /** start, or center: the parts centred in the card. outline is always centred. */\n @property({ type: String, reflect: true })\n align: Align = \"start\";\n\n /** The card's ground: container (default), --color-surface-container, or tint, the brand wash. */\n @property({ type: String, reflect: true })\n background: Background = \"container\";\n\n /** Where the actions sit: start, center or end; unset, they follow `align`. */\n @property({ type: String, attribute: \"actions-align\" })\n actionsAlign: ActionsAlign = \"\";\n\n /* Whether the card's parent lines its items up on shared rows, which the\n card then lines its parts up on (from md): a bd-card-grid, or a bd-grid\n with item-rows, the layout grid a page writes its rows of cards in (the\n homepage's), which makes each item a subgrid of that many rows. There\n the page counts the rows: the icon, the title, one per content node and\n the actions (DEX-29440). Read on connect, so a card moved into or out of\n a grid follows. */\n @state()\n private _inGrid = false;\n\n /* Whether the page chose this card's appearance, which bd-card-grid then\n leaves alone: in its markup, through an attribute a template binds after\n the card was created, or by setting the property, as React 19 and a Lit\n `.appearance=` binding do. Read before Lit's first update reflects the\n default onto the attribute -- after that, hasAttribute() is true of every\n card -- and followed through every later write but the card's own: its\n reflection, the grid's push (_takeAppearance) and willUpdate's repair. */\n _ownAppearance = this.hasAttribute(\"appearance\");\n /* Set while the card writes `appearance` itself, so the write is not taken for the page's. */\n private _ownWrite = false;\n\n _slots = new SlotController(this, { slots: [\"media\", \"icon\", \"title\", \"badge\", \"description\", \"actions\", \"\"] });\n\n /* Every write of the property reaches here, the page's included. The\n default is written before _ownAppearance is initialised, which is how\n that one write is told apart from the page's. */\n requestUpdate(...args: Parameters<LitElement[\"requestUpdate\"]>) {\n if (args[0] === \"appearance\" && !this._ownWrite && this._ownAppearance !== undefined) this._ownAppearance = true;\n super.requestUpdate(...args);\n }\n\n attributeChangedCallback(name: string, old: string | null, value: string | null) {\n if (name !== \"appearance\" || this._ownWrite) {\n super.attributeChangedCallback(name, old, value);\n return;\n }\n // the page's attribute: the property follows it, and the card is the page's while it is there\n this._quietly(() => super.attributeChangedCallback(name, old, value));\n this._ownAppearance = value !== null;\n // the page took its own away: in a grid, the grid's is the card's again\n if (value === null && this._inGrid) this._takeAppearance((this.parentElement as BdCardGrid).appearance);\n }\n\n connectedCallback() {\n super.connectedCallback();\n const parent = this.parentElement;\n this._inGrid = parent?.localName === \"bd-card-grid\"\n || (parent?.localName === \"bd-grid\" && Number(parent.getAttribute(\"item-rows\")) > 0);\n }\n\n /* ReactiveElement reflects properties to attributes inside update(). */\n protected update(changed: PropertyValues<this>) {\n this._quietly(() => super.update(changed));\n }\n\n /** bd-card-grid's appearance, which the card takes unless the page chose its own. */\n _takeAppearance(value: CardAppearance) {\n if (!this._ownAppearance) this._quietly(() => { this.appearance = value; });\n }\n\n private _quietly(write: () => void) {\n const was = this._ownWrite;\n this._ownWrite = true;\n try {\n write();\n } finally {\n this._ownWrite = was;\n }\n }\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") && !isOneOf(CARD_APPEARANCES, this.appearance)) this._quietly(() => { this.appearance = \"fill\"; });\n if (changed.has(\"align\") && !isOneOf(ALIGNS, this.align)) this.align = \"start\";\n if (changed.has(\"background\") && !isOneOf(BACKGROUNDS, this.background)) this.background = \"container\";\n if (changed.has(\"actionsAlign\") && !isOneOf(ACTIONS_ALIGNS, this.actionsAlign)) this.actionsAlign = \"\";\n }\n\n /** The default slot's nodes, each a content row of the grid: elements the page gave no slot, and words. */\n _contentNodes() {\n return [...this.childNodes].filter(node => (node.nodeType === Node.ELEMENT_NODE\n ? !(node as Element).slot\n : node.nodeType === Node.TEXT_NODE && (node as Text).data.trim() !== \"\"));\n }\n\n render() {\n const has = (name: Part) => this._slots.has(name);\n const centred = this.align === \"center\" || this.appearance === \"outline\";\n const actionsAlign = this.actionsAlign || (centred ? \"center\" : \"start\");\n return html`\n <div class=\"card ${this._inGrid ? \"in-grid\" : \"\"} ${centred ? \"centred\" : \"\"}\">\n <div class=\"media\" ?hidden=${!has(\"media\")}><slot name=\"media\"></slot></div>\n <div class=\"icon\" ?hidden=${!has(\"icon\")}><slot name=\"icon\"></slot></div>\n <div class=\"heading\" ?hidden=${!has(\"title\") && !has(\"badge\") && !has(\"description\")}>\n <div class=\"title-row\" ?hidden=${!has(\"title\") && !has(\"badge\")}>\n <div class=\"title\" ?hidden=${!has(\"title\")}><slot name=\"title\"></slot></div>\n <div class=\"badge\" ?hidden=${!has(\"badge\")}><slot name=\"badge\"></slot></div>\n </div>\n <div class=\"description\" ?hidden=${!has(\"description\")}><slot name=\"description\"></slot></div>\n </div>\n <div class=\"content\" ?hidden=${!has(\"\")}><slot></slot></div>\n <div class=\"actions actions-${actionsAlign}\" ?hidden=${!has(\"actions\")}><slot name=\"actions\"></slot></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-card\": BdCard;\n }\n}\n"],"mappings":"A,olBAqBA,IAAMI,EAAS,CAAC,QAAS,QAAQ,EAC3BC,EAAc,CAAC,YAAa,MAAM,EAClCC,EAAiB,CAAC,GAAI,QAAS,SAAU,KAAK,EAuDvCC,EAAN,cAAqBC,CAAW,C,8BAKR,KAAA,WAAA,OAId,KAAA,MAAA,QAIU,KAAA,WAAA,YAII,KAAA,aAAA,GAUX,KAAA,QAAA,GASD,KAAA,eAAA,KAAK,aAAa,YAAY,EAE3B,KAAA,UAAA,GAEX,KAAA,OAAA,IAAIE,EAAe,KAAM,CAAE,MAAO,CAAC,QAAS,OAAQ,QAAS,QAAS,cAAe,UAAW,EAAE,CAAE,CAAC,C,QAvC9F,KAAA,OAAA,CAACV,CAAO,C,CA4CxB,cAAc,GAAGW,EAA+C,CAC1DA,EAAK,KAAO,cAAgB,CAAC,KAAK,WAAa,KAAK,iBAAmB,IAAA,KAAW,KAAK,eAAiB,IAC5G,MAAM,cAAc,GAAGA,CAAI,CAC7B,CAEA,yBAAyB,EAAc,EAAoB,EAAsB,CAC3EC,IAAS,cAAgB,KAAK,UAChC,MAAM,yBAAyBA,EAAMC,EAAKC,CAAK,GAIjD,KAAK,aAAe,MAAM,yBAAyBF,EAAMC,EAAKC,CAAK,CAAC,EACpE,KAAK,eAAiBA,IAAU,KAE5BA,IAAU,MAAQ,KAAK,SAAS,KAAK,gBAAiB,KAAK,cAA6B,UAAU,EACxG,CAEA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,IAAMC,EAAS,KAAK,cACpB,KAAK,QAAUA,GAAQ,YAAc,gBAC/BA,GAAQ,YAAc,WAAa,OAAOA,EAAO,aAAa,WAAW,CAAC,EAAI,CACtF,CAGA,OAAiB,EAA+B,CAC9C,KAAK,aAAe,MAAM,OAAOC,CAAO,CAAC,CAC3C,CAGA,gBAAgB,EAAuB,CAChC,KAAK,gBAAgB,KAAK,aAAe,CAAE,KAAK,WAAaF,CAAO,CAAC,CAC5E,CAEA,SAAiB,EAAmB,CAClC,IAAMG,EAAM,KAAK,UACjB,KAAK,UAAY,GACjB,GAAI,CACFC,EAAM,CACR,QAAU,CACR,KAAK,UAAYD,CACnB,CACF,CAEA,WAAW,EAA+B,CACpCD,EAAQ,IAAI,YAAY,GAAK,CAACG,EAAQC,EAAkB,KAAK,UAAU,GAAG,KAAK,aAAe,CAAE,KAAK,WAAa,MAAQ,CAAC,EAC3HJ,EAAQ,IAAI,OAAO,GAAK,CAACG,EAAQf,EAAQ,KAAK,KAAK,IAAG,KAAK,MAAQ,SACnEY,EAAQ,IAAI,YAAY,GAAK,CAACG,EAAQd,EAAa,KAAK,UAAU,IAAG,KAAK,WAAa,aACvFW,EAAQ,IAAI,cAAc,GAAK,CAACG,EAAQb,EAAgB,KAAK,YAAY,IAAG,KAAK,aAAe,GACtG,CAGA,eAAgB,CACd,MAAO,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC,OAAO,GAASe,EAAK,WAAa,KAAK,aAC/D,CAAEA,EAAiB,KACnBA,EAAK,WAAa,KAAK,WAAcA,EAAc,KAAK,KAAK,IAAM,EAAG,CAC5E,CAEA,QAAS,CACP,IAAMC,EAAO,GAAe,KAAK,OAAO,IAAIV,CAAI,EAC1CW,EAAU,KAAK,QAAU,UAAY,KAAK,aAAe,UACzDC,EAAe,KAAK,eAAiBD,EAAU,SAAW,SAChE,MAAO,EAAI;yBACU,KAAK,QAAU,UAAY,GAAG,GAAGA,EAAU,UAAY,GAAG;qCAC9C,CAACD,EAAI,OAAO,EAAE;oCACf,CAACA,EAAI,MAAM,EAAE;uCACV,CAACA,EAAI,OAAO,GAAK,CAACA,EAAI,OAAO,GAAK,CAACA,EAAI,aAAa,EAAE;2CAClD,CAACA,EAAI,OAAO,GAAK,CAACA,EAAI,OAAO,EAAE;yCACjC,CAACA,EAAI,OAAO,EAAE;yCACd,CAACA,EAAI,OAAO,EAAE;;6CAEV,CAACA,EAAI,aAAa,EAAE;;uCAE1B,CAACA,EAAI,EAAE,EAAE;sCACVE,EAAa,YAAY,CAACF,EAAI,SAAS,EAAE;;KAG7E,CACF,EAvHGrB,EAAA,CAAAwB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAlB,EAAA,UAAA,aAAA,IAAA,EAAA,EAIxCN,EAAA,CAAAwB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAlB,EAAA,UAAA,QAAA,IAAA,EAAA,EAIxCN,EAAA,CAAAwB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAlB,EAAA,UAAA,aAAA,IAAA,EAAA,EAIxCN,EAAA,CAAAwB,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,CAAA,EAAAlB,EAAA,UAAA,eAAA,IAAA,EAAA,EAUrDN,EAAA,CAAAyB,EAAM,CAAA,EAAAnB,EAAA,UAAA,UAAA,IAAA,EAAA,EA3BR,EAAAN,EAAA,CAAA0B,EAAc,SAAS,CAAA,EAAApB,CAAA,E"}
|
|
@@ -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))}.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};
|
|
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);justify-self:stretch;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 /* 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,
|
|
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 /* The items fill their columns too: an item whose parts line up with\n its neighbours' is as wide as they are, where the grid's start would\n leave a card with short words narrower than its column. */\n .grid--rows ::slotted(*) {\n display: grid;\n grid-template-rows: subgrid;\n grid-row: span var(--grid-item-rows);\n justify-self: stretch;\n margin-block-end: var(--grid-gap-active);\n }\n`;\n"],"mappings":"A,4DAyBA,IAAAA,EAAe,CAAG,mhC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{css as e}from"lit";var t=e`@layer bd-components{.bd-img{max-width:100%;height:auto;display:block}.bd-img.cover{object-fit:cover}.bd-img.contain{object-fit:contain}.bd-img.fill{object-fit:fill}.bd-img.none{object-fit:none}.bd-img.scale-down{object-fit:scale-down}.bd-img.radius-none{border-radius:var(--radius-none)}.bd-img.radius-sm{border-radius:var(--shape-radius-sm)}.bd-img.radius-md{border-radius:var(--shape-radius-md)}.bd-img.radius-lg{border-radius:var(--shape-radius-lg)}.bd-img.radius-xl{border-radius:var(--shape-radius-xl)}.bd-img.radius-2xl{border-radius:var(--shape-radius-2xl)}.bd-img.radius-3xl{border-radius:var(--shape-radius-3xl)}.bd-img.radius-full{border-radius:var(--radius-full)}.bd-img.shadow-none{box-shadow:none}.bd-img.shadow-sm{box-shadow:var(--shadow-sm)}.bd-img.shadow-md{box-shadow:var(--shadow-md)}.bd-img.shadow-lg{box-shadow:var(--shadow-lg)}.bd-img.shadow-xl{box-shadow:var(--shadow-xl)}.bd-img{transition:border-radius var(--transition-duration-normal) var(--transition-easing-smooth), box-shadow var(--transition-duration-normal) var(--transition-easing-smooth)}@media (prefers-reduced-motion:reduce){.bd-img{transition:none}}}`;export{t as default};
|
|
1
|
+
import{css as e}from"lit";var t=e`@layer bd-components{.bd-img{min-width:var(--bd-img-min-width,0);max-width:100%;height:var(--bd-img-height,auto);display:block}.bd-img.cover{object-fit:cover}.bd-img.contain{object-fit:contain}.bd-img.fill{object-fit:fill}.bd-img.none{object-fit:none}.bd-img.scale-down{object-fit:scale-down}.bd-img.radius-none{border-radius:var(--radius-none)}.bd-img.radius-sm{border-radius:var(--shape-radius-sm)}.bd-img.radius-md{border-radius:var(--shape-radius-md)}.bd-img.radius-lg{border-radius:var(--shape-radius-lg)}.bd-img.radius-xl{border-radius:var(--shape-radius-xl)}.bd-img.radius-2xl{border-radius:var(--shape-radius-2xl)}.bd-img.radius-3xl{border-radius:var(--shape-radius-3xl)}.bd-img.radius-full{border-radius:var(--radius-full)}.bd-img.shadow-none{box-shadow:none}.bd-img.shadow-sm{box-shadow:var(--shadow-sm)}.bd-img.shadow-md{box-shadow:var(--shadow-md)}.bd-img.shadow-lg{box-shadow:var(--shadow-lg)}.bd-img.shadow-xl{box-shadow:var(--shadow-xl)}.bd-img{transition:border-radius var(--transition-duration-normal) var(--transition-easing-smooth), box-shadow var(--transition-duration-normal) var(--transition-easing-smooth)}@media (prefers-reduced-motion:reduce){.bd-img{transition:none}}}`;export{t as default};
|
|
2
2
|
//# sourceMappingURL=img.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"img.css.js","names":["img_css_default"],"sources":["../../../../src/components/img/img.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\nexport default css`\n @layer bd-components {\n .bd-img {\n display: block;\n max-width: 100%;\n height: auto;\n }\n\n /* Object Fit Variants */\n .bd-img.cover {\n object-fit: cover;\n }\n\n .bd-img.contain {\n object-fit: contain;\n }\n\n .bd-img.fill {\n object-fit: fill;\n }\n\n .bd-img.none {\n object-fit: none;\n }\n\n .bd-img.scale-down {\n object-fit: scale-down;\n }\n\n /* Radius Variants - Updated to match radius prop */\n .bd-img.radius-none {\n border-radius: var(--radius-none);\n }\n\n .bd-img.radius-sm {\n border-radius: var(--shape-radius-sm);\n }\n\n .bd-img.radius-md {\n border-radius: var(--shape-radius-md);\n }\n\n .bd-img.radius-lg {\n border-radius: var(--shape-radius-lg);\n }\n\n .bd-img.radius-xl {\n border-radius: var(--shape-radius-xl);\n }\n\n .bd-img.radius-2xl {\n border-radius: var(--shape-radius-2xl);\n }\n\n .bd-img.radius-3xl {\n border-radius: var(--shape-radius-3xl);\n }\n\n .bd-img.radius-full {\n border-radius: var(--radius-full);\n }\n\n /* Shadow Variants - Updated to match shadow prop */\n .bd-img.shadow-none {\n box-shadow: none;\n }\n\n .bd-img.shadow-sm {\n box-shadow: var(--shadow-sm);\n }\n\n .bd-img.shadow-md {\n box-shadow: var(--shadow-md);\n }\n\n .bd-img.shadow-lg {\n box-shadow: var(--shadow-lg);\n }\n\n /* Shadow XL - Additional variant */\n .bd-img.shadow-xl {\n box-shadow: var(--shadow-xl);\n }\n\n /* Gone from here, because nothing could reach them: bordered,\n bordered-primary and bordered-thick, responsive, aspect-16-9 / 4-3 /\n 1-1, hover-zoom and hover-shadow had no prop, and the only way to set\n one was to pass its name as fit, which now accepts only the five values\n above. :focus-visible styled an <img>, which never takes focus. And the\n :not([src]) loading placeholder could not appear: the template always\n writes a src attribute, and an <img> renders no ::before even without\n one. bd-picture keeps its own placeholder, which does work. */\n\n /* Smooth transitions for radius and shadow changes */\n .bd-img {\n transition: border-radius var(--transition-duration-normal) var(--transition-easing-smooth), box-shadow var(--transition-duration-normal) var(--transition-easing-smooth);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .bd-img {\n transition: none;\n }\n }\n }\n`;"],"mappings":"A,0BAEA,IAAAA,EAAe,CAAG,
|
|
1
|
+
{"version":3,"file":"img.css.js","names":["img_css_default"],"sources":["../../../../src/components/img/img.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\nexport default css`\n @layer bd-components {\n /* --bd-img-height: a height the container asks for, the width then\n following the image's own proportions -- a logo drawn at a height\n (bd-card's media slot). The <img> is out of the container's reach, so\n it reads the property, which inherits into this root. Unset, the image\n is as tall as its width makes it.\n --bd-img-min-width: a width the image may not be narrower than,\n whatever its width attribute says -- 100% fills a frame wider than the\n picture's own width (bd-card's media appearance). Unset it is 0, which\n changes nothing. */\n .bd-img {\n display: block;\n min-width: var(--bd-img-min-width, 0);\n max-width: 100%;\n height: var(--bd-img-height, auto);\n }\n\n /* Object Fit Variants */\n .bd-img.cover {\n object-fit: cover;\n }\n\n .bd-img.contain {\n object-fit: contain;\n }\n\n .bd-img.fill {\n object-fit: fill;\n }\n\n .bd-img.none {\n object-fit: none;\n }\n\n .bd-img.scale-down {\n object-fit: scale-down;\n }\n\n /* Radius Variants - Updated to match radius prop */\n .bd-img.radius-none {\n border-radius: var(--radius-none);\n }\n\n .bd-img.radius-sm {\n border-radius: var(--shape-radius-sm);\n }\n\n .bd-img.radius-md {\n border-radius: var(--shape-radius-md);\n }\n\n .bd-img.radius-lg {\n border-radius: var(--shape-radius-lg);\n }\n\n .bd-img.radius-xl {\n border-radius: var(--shape-radius-xl);\n }\n\n .bd-img.radius-2xl {\n border-radius: var(--shape-radius-2xl);\n }\n\n .bd-img.radius-3xl {\n border-radius: var(--shape-radius-3xl);\n }\n\n .bd-img.radius-full {\n border-radius: var(--radius-full);\n }\n\n /* Shadow Variants - Updated to match shadow prop */\n .bd-img.shadow-none {\n box-shadow: none;\n }\n\n .bd-img.shadow-sm {\n box-shadow: var(--shadow-sm);\n }\n\n .bd-img.shadow-md {\n box-shadow: var(--shadow-md);\n }\n\n .bd-img.shadow-lg {\n box-shadow: var(--shadow-lg);\n }\n\n /* Shadow XL - Additional variant */\n .bd-img.shadow-xl {\n box-shadow: var(--shadow-xl);\n }\n\n /* Gone from here, because nothing could reach them: bordered,\n bordered-primary and bordered-thick, responsive, aspect-16-9 / 4-3 /\n 1-1, hover-zoom and hover-shadow had no prop, and the only way to set\n one was to pass its name as fit, which now accepts only the five values\n above. :focus-visible styled an <img>, which never takes focus. And the\n :not([src]) loading placeholder could not appear: the template always\n writes a src attribute, and an <img> renders no ::before even without\n one. bd-picture keeps its own placeholder, which does work. */\n\n /* Smooth transitions for radius and shadow changes */\n .bd-img {\n transition: border-radius var(--transition-duration-normal) var(--transition-easing-smooth), box-shadow var(--transition-duration-normal) var(--transition-easing-smooth);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .bd-img {\n transition: none;\n }\n }\n }\n`;"],"mappings":"A,0BAEA,IAAAA,EAAe,CAAG,6qC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-system-design",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Design system based on Web Components.",
|
|
5
5
|
"author": "Iordache Matei Cezar <miordache@bitdefender.com>",
|
|
6
6
|
"homepage": "https://github.com/bitdefender/dex-core#readme",
|
|
@@ -490,5 +490,5 @@
|
|
|
490
490
|
"volta": {
|
|
491
491
|
"node": "24.22.1"
|
|
492
492
|
},
|
|
493
|
-
"gitHead": "
|
|
493
|
+
"gitHead": "4f61ac0850a3bb74e80ba4c70753069ee2c8bd1e"
|
|
494
494
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifestVersion": 1,
|
|
3
3
|
"package": "@repobit/dex-system-design",
|
|
4
|
-
"packageVersion": "4.
|
|
4
|
+
"packageVersion": "4.3.0",
|
|
5
5
|
"generatedFrom": [
|
|
6
6
|
"package.json exports",
|
|
7
7
|
"Lit reactive properties (static properties or @property/@state)",
|
|
@@ -2759,7 +2759,8 @@
|
|
|
2759
2759
|
"fill",
|
|
2760
2760
|
"outline",
|
|
2761
2761
|
"feature",
|
|
2762
|
-
"inline"
|
|
2762
|
+
"inline",
|
|
2763
|
+
"media"
|
|
2763
2764
|
],
|
|
2764
2765
|
"default": "fill",
|
|
2765
2766
|
"description": "Handed to every bd-card child whose own markup sets no appearance; a card that writes its own keeps it."
|
|
@@ -2814,6 +2815,10 @@
|
|
|
2814
2815
|
"size"
|
|
2815
2816
|
]
|
|
2816
2817
|
},
|
|
2818
|
+
{
|
|
2819
|
+
"name": "media",
|
|
2820
|
+
"accepts": "atoms"
|
|
2821
|
+
},
|
|
2817
2822
|
{
|
|
2818
2823
|
"name": "title",
|
|
2819
2824
|
"accepts": "heading",
|
|
@@ -2831,10 +2836,11 @@
|
|
|
2831
2836
|
"fill",
|
|
2832
2837
|
"outline",
|
|
2833
2838
|
"feature",
|
|
2834
|
-
"inline"
|
|
2839
|
+
"inline",
|
|
2840
|
+
"media"
|
|
2835
2841
|
],
|
|
2836
2842
|
"default": "fill",
|
|
2837
|
-
"description": "fill: the parts stacked. outline: stacked and centred with a brand edge. feature: the icon in a column beside the rest. inline: the icon in one row with the title and badge. In a bd-card-grid, the grid's appearance unless the card writes its own."
|
|
2843
|
+
"description": "fill: the parts stacked. outline: stacked and centred with a brand edge. feature: the icon in a column beside the rest. inline: the icon in one row with the title and badge. media: the parts over the picture in `media`, which fills the card. In a bd-card-grid, the grid's appearance unless the card writes its own."
|
|
2838
2844
|
},
|
|
2839
2845
|
{
|
|
2840
2846
|
"name": "align",
|
|
@@ -2872,7 +2878,9 @@
|
|
|
2872
2878
|
],
|
|
2873
2879
|
"notes": [
|
|
2874
2880
|
"A card: <bd-icon>, <bd-img> or <bd-mark> in `icon`, <bd-h slot=\"title\" as=\"h3\">, a <bd-badge> in `badge` (beside the title), a <bd-p> in `description` (under the title), content rows in the default slot, and a bd-button or bd-link in `actions`. Each part is left out while its slot is empty.",
|
|
2875
|
-
"The card sizes the slotted icon (48 square; 65x75 on outline; 32 on feature and inline; a bd-mark keeps its own size), draws the title at heading-h5 in bold (brand ink on outline) and the description at body-small in muted ink; the page picks the title's level with `as`. Only default-slot nodes are rows of a bd-card-grid."
|
|
2881
|
+
"The card sizes the slotted icon (48 square; 65x75 on outline; 32 on feature and inline; a bd-mark keeps its own size), draws the title at heading-h5 in bold (brand ink on outline) and the description at body-small in muted ink; the page picks the title's level with `as`. Only default-slot nodes are rows of a bd-card-grid.",
|
|
2882
|
+
"`media` takes a bd-img the card draws whole. On appearance=\"media\" it is the card's ground: the title (h3 role) and copy (body-large), 16 apart, stand at its foot in on-media ink, on a scrim of the media frame, and the card is at least a 2:3 portrait. On every other appearance it heads the card, above the icon, 64 high at its own width -- a partner's logo (DEX-29440). A card heads with a picture or an icon: in a bd-card-grid both take the first row.",
|
|
2883
|
+
"In a bd-grid with item-rows -- the homepage's rows of cards -- the card lines its parts up as in a bd-card-grid, from md: each item is a subgrid of item-rows rows, which the page counts as the icon, the title, one per content node and the actions (DEX-29440)."
|
|
2876
2884
|
]
|
|
2877
2885
|
},
|
|
2878
2886
|
{
|
|
@@ -4500,6 +4508,16 @@
|
|
|
4500
4508
|
}
|
|
4501
4509
|
],
|
|
4502
4510
|
"props": [
|
|
4511
|
+
{
|
|
4512
|
+
"name": "appearance",
|
|
4513
|
+
"type": "string",
|
|
4514
|
+
"enum": [
|
|
4515
|
+
"standard",
|
|
4516
|
+
"outline"
|
|
4517
|
+
],
|
|
4518
|
+
"default": "standard",
|
|
4519
|
+
"description": "standard: the homepage's audience entry, the arrow under the copy (beside it from md to lg) on the accent fill. outline: the Trusted page's anchor card, a brand edge and the arrow a primary button beside the copy, centred down the card, at every width."
|
|
4520
|
+
},
|
|
4503
4521
|
{
|
|
4504
4522
|
"name": "href",
|
|
4505
4523
|
"type": "string",
|