@repobit/dex-system-design 4.4.0 → 5.0.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 +34 -0
- package/dist/src/components/cta-banner/cta-banner.css.js +1 -1
- package/dist/src/components/cta-banner/cta-banner.css.js.map +1 -1
- package/dist/src/components/cta-banner/cta-banner.d.ts +15 -6
- package/dist/src/components/cta-banner/cta-banner.js +14 -11
- package/dist/src/components/cta-banner/cta-banner.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.css.js +1 -1
- package/dist/src/components/features-tab/features-tab.css.js.map +1 -1
- package/dist/src/components/features-tab/features-tab.d.ts +1 -0
- package/dist/src/components/features-tab/features-tab.js +4 -4
- package/dist/src/components/features-tab/features-tab.js.map +1 -1
- package/dist/src/components/{pricing-card/pricing-group.css.d.ts → icon-columns-banner/icon-columns-banner-item.css.d.ts} +0 -1
- package/dist/src/components/icon-columns-banner/icon-columns-banner-item.css.js +2 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner-item.css.js.map +1 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner-item.d.ts +25 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner-item.js +6 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner-item.js.map +1 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner.css.d.ts +2 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner.css.js +2 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner.css.js.map +1 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner.d.ts +36 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner.js +9 -0
- package/dist/src/components/icon-columns-banner/icon-columns-banner.js.map +1 -0
- package/dist/src/components/icons/arrow-back.d.ts +1 -0
- package/dist/src/components/icons/arrow-back.js +6 -0
- package/dist/src/components/icons/arrow-back.js.map +1 -0
- package/dist/src/components/icons/icons.d.ts +1 -0
- package/dist/src/components/icons/icons.js +1 -1
- package/dist/src/components/pricing-card/pricing-card.css.d.ts +1 -0
- package/dist/src/components/pricing-card/pricing-card.css.js +1 -1
- package/dist/src/components/pricing-card/pricing-card.css.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-card.d.ts +65 -49
- package/dist/src/components/pricing-card/pricing-card.js +7 -9
- package/dist/src/components/pricing-card/pricing-card.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-feature-group.css.js +1 -1
- package/dist/src/components/pricing-card/pricing-feature-group.css.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-feature-group.d.ts +7 -1
- package/dist/src/components/pricing-card/pricing-feature-group.js +5 -2
- package/dist/src/components/pricing-card/pricing-feature-group.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-feature.css.js +1 -1
- package/dist/src/components/pricing-card/pricing-feature.css.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-price.css.js +1 -1
- package/dist/src/components/pricing-card/pricing-price.css.js.map +1 -1
- package/dist/src/components/pricing-card/pricing-price.d.ts +31 -2
- package/dist/src/components/pricing-card/pricing-price.js +3 -3
- package/dist/src/components/pricing-card/pricing-price.js.map +1 -1
- package/dist/src/components/shared/prop-vocabulary.js +1 -1
- package/dist/src/components/shared/prop-vocabulary.js.map +1 -1
- package/dist/src/loader/registry.js +1 -1
- package/dist/src/loader/registry.js.map +1 -1
- package/package.json +6 -2
- package/schemas/component-manifest.json +214 -99
- package/schemas/figma-component-map.json +15 -10
- package/dist/src/components/pricing-card/pricing-group.css.js +0 -2
- package/dist/src/components/pricing-card/pricing-group.css.js.map +0 -1
- package/dist/src/components/pricing-card/pricing-group.d.ts +0 -48
- package/dist/src/components/pricing-card/pricing-group.js +0 -6
- package/dist/src/components/pricing-card/pricing-group.js.map +0 -1
|
@@ -2,74 +2,90 @@ import { LitElement } from "lit";
|
|
|
2
2
|
import { SlotController } from "../shared/controller.slot.js";
|
|
3
3
|
import "../../tokens/tokens.js";
|
|
4
4
|
import "./pricing-price.js";
|
|
5
|
-
import "./pricing-group.js";
|
|
6
5
|
import "./pricing-feature-group.js";
|
|
7
6
|
import "./pricing-feature.js";
|
|
8
|
-
import "../accordion/accordion-item.js";
|
|
9
7
|
import "../badge/badge.js";
|
|
10
8
|
import "../button/button.js";
|
|
11
9
|
import "../divider/divider.js";
|
|
10
|
+
import "../grid/grid.js";
|
|
12
11
|
import "../h/h.js";
|
|
12
|
+
import "../icons/arrow-back.js";
|
|
13
13
|
import "../link/link.js";
|
|
14
14
|
import "../p/p.js";
|
|
15
|
-
type Part = "banner" | "
|
|
15
|
+
type Part = "banner" | "badge" | "title" | "description" | "price" | "actions" | "caption" | "";
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* covers, the store's price, the Buy and Learn More buttons,
|
|
17
|
+
* The pricing card's second version: a plan's badge, its name and what it
|
|
18
|
+
* covers, the store's price, the Buy and Learn More buttons, the guarantee
|
|
19
|
+
* under them, and, in the version that has them, the features it adds.
|
|
19
20
|
*
|
|
20
|
-
* <bd-
|
|
21
|
-
* <bd-
|
|
22
|
-
* <bd-
|
|
23
|
-
* <
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
21
|
+
* <bd-grid cols="1" cols-md="2" cols-lg="4" gap="lg" gap-md="md" item-rows="8">
|
|
22
|
+
* <bd-context ignore-events-parent>
|
|
23
|
+
* <bd-product product-id="ps_i">
|
|
24
|
+
* <bd-option devices="5" subscription="1" data-layer-event="info">
|
|
25
|
+
* <bd-pricing-card highlight>
|
|
26
|
+
* <span slot="banner">Recommended</span>
|
|
27
|
+
* <bd-badge slot="badge" variant="brand" size="lg">Scam Protection</bd-badge>
|
|
28
|
+
* <bd-h slot="title" as="h3">Bitdefender<br>Premium Security</bd-h>
|
|
29
|
+
* <bd-p slot="description">1 Account, 5 devices</bd-p>
|
|
30
|
+
* <bd-p slot="description"><strong>Complete</strong> device protection …</bd-p>
|
|
31
|
+
* <bd-pricing-price slot="price" size="lg">…</bd-pricing-price>
|
|
32
|
+
* <bd-button slot="actions" buy-link appearance="accent" full-width label="Buy Now, Bitdefender Premium Security">Buy Now</bd-button>
|
|
33
|
+
* <bd-button slot="actions" href="/premium-security" appearance="ghost" full-width label="Learn more about Bitdefender Premium Security">Learn More</bd-button>
|
|
34
|
+
* <span slot="caption">30 days money back guarantee.</span>
|
|
35
|
+
* <bd-pricing-feature-group>…</bd-pricing-feature-group>
|
|
36
|
+
* </bd-pricing-card>
|
|
37
|
+
* </bd-option>
|
|
38
|
+
* </bd-product>
|
|
39
|
+
* </bd-context>
|
|
40
|
+
* …
|
|
41
|
+
* </bd-grid>
|
|
34
42
|
*
|
|
35
|
-
* It
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* when highlighted.
|
|
43
|
+
* It replaced the first v4 card (3.x's v1, a column of boxes on a brand band
|
|
44
|
+
* bd-pricing-group drew) in place, under the same tag: its parts are laid out
|
|
45
|
+
* as rows a row of cards shares. It kept everything else: the same price
|
|
46
|
+
* zone, the same feature lists with their disclosures, the same store wiring,
|
|
47
|
+
* the same buttons.
|
|
41
48
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* them.
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* the page's bd-product's and bd-option's.
|
|
49
|
+
* EIGHT ROWS, SHARED. The card is a grid of eight rows -- badge, title,
|
|
50
|
+
* description, the rule, price, actions, caption, features -- and its frame a
|
|
51
|
+
* subgrid of them. In a `bd-grid item-rows="8"` the card is in turn a subgrid
|
|
52
|
+
* of the grid's rows (grid.css.ts), so every card's title, rule, price and
|
|
53
|
+
* buttons start on one line across the row however differently the cards'
|
|
54
|
+
* names and descriptions wrap. Each part is placed in its own row, so a part
|
|
55
|
+
* a card leaves out leaves its row at the height the other cards give it,
|
|
56
|
+
* and the rest still line up. The card is no size container, for the same
|
|
57
|
+
* reason bd-audience-card is not: containment makes a grid its own.
|
|
52
58
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
59
|
+
* THE STORE'S NODES ARE THE PAGE'S, as in bd-pricing-card: the price zone's
|
|
60
|
+
* data-store-* nodes and the bd-button buy-link are slotted page markup,
|
|
61
|
+
* inside the bd-context, bd-product and bd-option the page wraps the card in,
|
|
62
|
+
* and nothing store-bound renders in this shadow root. Those wrappers set no
|
|
63
|
+
* display, and between a bd-grid and its card the outermost is the grid's
|
|
64
|
+
* item rather than the card; so the card adopts a sheet into the tree it
|
|
65
|
+
* sits in (pageCSS) under which each wrapper inside that item, and
|
|
66
|
+
* the card, is a subgrid of the one around it. The card's parts then sit in
|
|
67
|
+
* the grid's rows whichever way the page wrote it.
|
|
62
68
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
69
|
+
* The title is drawn at heading-h5 in bold at the level the page picks, a
|
|
70
|
+
* word the page writes in <em> in it -- "Ultimate Security <em>Plus</em>" --
|
|
71
|
+
* upright in the brand's text ink (pageCSS); the
|
|
72
|
+
* description at body-regular, the caption in the caption role, and the features in the
|
|
73
|
+
* card's scale through bd-pricing-feature-group's and bd-pricing-feature's
|
|
74
|
+
* hooks. The price zone is the page's bd-pricing-price at its default
|
|
75
|
+
* `appearance="card"`, whose discount is the success shade, drawn in Figma's
|
|
76
|
+
* type through its hooks: the struck price at label-large, the price bold.
|
|
77
|
+
* No part has a
|
|
78
|
+
* fallback; each part's box is hidden while its slot is empty, the banner is
|
|
79
|
+
* drawn only with `highlight`, and the features take their room only when
|
|
80
|
+
* the page writes them -- the version without the green checks is the same
|
|
81
|
+
* card with nothing in its default slot.
|
|
67
82
|
*/
|
|
68
83
|
export declare class BdPricingCard extends LitElement {
|
|
69
84
|
static styles: import("lit").CSSResult[];
|
|
70
|
-
/** The
|
|
85
|
+
/** The recommended plan: a brand edge, and the `banner` drawn as a tab over the card's top edge. Reflected. */
|
|
71
86
|
highlight: boolean;
|
|
72
87
|
_slots: SlotController<Part>;
|
|
88
|
+
connectedCallback(): void;
|
|
73
89
|
render(): import("lit-html").TemplateResult<1>;
|
|
74
90
|
}
|
|
75
91
|
declare global {
|
|
@@ -1,16 +1,14 @@
|
|
|
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 n}from"../shared/controller.slot.js";import"../h/h.js";import"../link/link.js";import"../badge/badge.js";import"../
|
|
1
|
+
import{defineElement as e}from"../shared/define-element.js";import"../../tokens/tokens.js";import t from"../../_bundled/oxc-project_runtime/helpers/esm/decorate.js";import"../p/p.js";import{SlotController as n}from"../shared/controller.slot.js";import"../h/h.js";import"../link/link.js";import"../badge/badge.js";import"../button/button.js";import{adoptStyles as r}from"../shared/adopt-styles.js";import"../divider/divider.js";import"../grid/grid.js";import"../icons/arrow-back.js";import i,{pageCSS as a}from"./pricing-card.css.js";import"./pricing-price.js";import"./pricing-feature.js";import"./pricing-feature-group.js";import{LitElement as o,html as s}from"lit";import{property as c}from"lit/decorators.js";var l=class extends o{constructor(...e){super(...e),this.highlight=!1,this._slots=new n(this,{slots:[`banner`,`badge`,`title`,`description`,`price`,`actions`,`caption`,``]})}static{this.styles=[i]}connectedCallback(){super.connectedCallback(),r(this,`bd-pricing-card`,a)}render(){let e=e=>this._slots.has(e);return s`
|
|
2
2
|
<div class="card">
|
|
3
3
|
<div class="banner" ?hidden=${!this.highlight||!e(`banner`)}><slot name="banner"></slot></div>
|
|
4
|
-
<div class="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</div>
|
|
9
|
-
<bd-divider class="rule" orientation="horizontal" color="subtle" opacity="0.25"></bd-divider>
|
|
4
|
+
<div class="badge" ?hidden=${!e(`badge`)}><slot name="badge"></slot></div>
|
|
5
|
+
<div class="title" ?hidden=${!e(`title`)}><slot name="title"></slot></div>
|
|
6
|
+
<div class="description" ?hidden=${!e(`description`)}><slot name="description"></slot></div>
|
|
7
|
+
<bd-divider class="rule" orientation="horizontal" color="subtle"></bd-divider>
|
|
10
8
|
<div class="price" ?hidden=${!e(`price`)}><slot name="price"></slot></div>
|
|
11
9
|
<div class="actions" ?hidden=${!e(`actions`)}><slot name="actions"></slot></div>
|
|
12
|
-
<
|
|
10
|
+
<div class="caption" ?hidden=${!e(`caption`)}><slot name="caption"></slot></div>
|
|
13
11
|
<div class="features" ?hidden=${!e(``)}><slot></slot></div>
|
|
14
12
|
</div>
|
|
15
|
-
`}};t([
|
|
13
|
+
`}};t([c({type:Boolean,reflect:!0,attribute:`highlight`})],l.prototype,`highlight`,void 0),l=t([e(`bd-pricing-card`)],l);export{l as BdPricingCard};
|
|
16
14
|
//# sourceMappingURL=pricing-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-card.js","names":["pricingCardCSS","_decorate","__decorate","pricing_card_css_default","BdPricingCard","LitElement","_args","SlotController","has","part","property","defineElement"],"sources":["../../../../src/components/pricing-card/pricing-card.ts"],"sourcesContent":["import { LitElement, html } 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\";\n/*
|
|
1
|
+
{"version":3,"file":"pricing-card.js","names":["pricingCardCSS","_decorate","__decorate","pricing_card_css_default","BdPricingCard","LitElement","_args","SlotController","adoptStyles","pageCSS","has","part","property","defineElement"],"sources":["../../../../src/components/pricing-card/pricing-card.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { adoptStyles } from \"#shared/adopt-styles.ts\";\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\";\n/* The family's parts the page writes into the card: the price zone and the\n feature lists, the same elements bd-pricing-card takes. */\nimport \"./pricing-price.ts\";\nimport \"./pricing-feature-group.ts\";\nimport \"./pricing-feature.ts\";\n/* The atoms the page writes into the slots -- the plan's badge, the title,\n the Buy and Learn More buttons, the back arrow before a list's heading --\n and the rule the card draws; and bd-grid, the row the cards line up in. A\n page importing only this module gets everything it writes. */\nimport \"#components/badge/badge.ts\";\nimport \"#components/button/button.ts\";\nimport \"#components/divider/divider.ts\";\nimport \"#components/grid/grid.ts\";\nimport \"#components/h/h.ts\";\nimport \"#components/icons/arrow-back.ts\";\nimport \"#components/link/link.ts\";\nimport \"#components/p/p.ts\";\nimport pricingCardCSS, { pageCSS } from \"./pricing-card.css.ts\";\n\ntype Part = \"banner\" | \"badge\" | \"title\" | \"description\" | \"price\" | \"actions\" | \"caption\" | \"\";\n\n/**\n * The pricing card's second version: a plan's badge, its name and what it\n * covers, the store's price, the Buy and Learn More buttons, the guarantee\n * under them, and, in the version that has them, the features it adds.\n *\n * <bd-grid cols=\"1\" cols-md=\"2\" cols-lg=\"4\" gap=\"lg\" gap-md=\"md\" item-rows=\"8\">\n * <bd-context ignore-events-parent>\n * <bd-product product-id=\"ps_i\">\n * <bd-option devices=\"5\" subscription=\"1\" data-layer-event=\"info\">\n * <bd-pricing-card highlight>\n * <span slot=\"banner\">Recommended</span>\n * <bd-badge slot=\"badge\" variant=\"brand\" size=\"lg\">Scam Protection</bd-badge>\n * <bd-h slot=\"title\" as=\"h3\">Bitdefender<br>Premium Security</bd-h>\n * <bd-p slot=\"description\">1 Account, 5 devices</bd-p>\n * <bd-p slot=\"description\"><strong>Complete</strong> device protection …</bd-p>\n * <bd-pricing-price slot=\"price\" size=\"lg\">…</bd-pricing-price>\n * <bd-button slot=\"actions\" buy-link appearance=\"accent\" full-width label=\"Buy Now, Bitdefender Premium Security\">Buy Now</bd-button>\n * <bd-button slot=\"actions\" href=\"/premium-security\" appearance=\"ghost\" full-width label=\"Learn more about Bitdefender Premium Security\">Learn More</bd-button>\n * <span slot=\"caption\">30 days money back guarantee.</span>\n * <bd-pricing-feature-group>…</bd-pricing-feature-group>\n * </bd-pricing-card>\n * </bd-option>\n * </bd-product>\n * </bd-context>\n * …\n * </bd-grid>\n *\n * It replaced the first v4 card (3.x's v1, a column of boxes on a brand band\n * bd-pricing-group drew) in place, under the same tag: its parts are laid out\n * as rows a row of cards shares. It kept everything else: the same price\n * zone, the same feature lists with their disclosures, the same store wiring,\n * the same buttons.\n *\n * EIGHT ROWS, SHARED. The card is a grid of eight rows -- badge, title,\n * description, the rule, price, actions, caption, features -- and its frame a\n * subgrid of them. In a `bd-grid item-rows=\"8\"` the card is in turn a subgrid\n * of the grid's rows (grid.css.ts), so every card's title, rule, price and\n * buttons start on one line across the row however differently the cards'\n * names and descriptions wrap. Each part is placed in its own row, so a part\n * a card leaves out leaves its row at the height the other cards give it,\n * and the rest still line up. The card is no size container, for the same\n * reason bd-audience-card is not: containment makes a grid its own.\n *\n * THE STORE'S NODES ARE THE PAGE'S, as in bd-pricing-card: the price zone's\n * data-store-* nodes and the bd-button buy-link are slotted page markup,\n * inside the bd-context, bd-product and bd-option the page wraps the card in,\n * and nothing store-bound renders in this shadow root. Those wrappers set no\n * display, and between a bd-grid and its card the outermost is the grid's\n * item rather than the card; so the card adopts a sheet into the tree it\n * sits in (pageCSS) under which each wrapper inside that item, and\n * the card, is a subgrid of the one around it. The card's parts then sit in\n * the grid's rows whichever way the page wrote it.\n *\n * The title is drawn at heading-h5 in bold at the level the page picks, a\n * word the page writes in <em> in it -- \"Ultimate Security <em>Plus</em>\" --\n * upright in the brand's text ink (pageCSS); the\n * description at body-regular, the caption in the caption role, and the features in the\n * card's scale through bd-pricing-feature-group's and bd-pricing-feature's\n * hooks. The price zone is the page's bd-pricing-price at its default\n * `appearance=\"card\"`, whose discount is the success shade, drawn in Figma's\n * type through its hooks: the struck price at label-large, the price bold.\n * No part has a\n * fallback; each part's box is hidden while its slot is empty, the banner is\n * drawn only with `highlight`, and the features take their room only when\n * the page writes them -- the version without the green checks is the same\n * card with nothing in its default slot.\n */\n@defineElement(\"bd-pricing-card\")\nexport class BdPricingCard extends LitElement {\n static styles = [pricingCardCSS];\n\n /** The recommended plan: a brand edge, and the `banner` drawn as a tab over the card's top edge. Reflected. */\n @property({ type: Boolean, reflect: true, attribute: \"highlight\" })\n highlight = false;\n\n _slots = new SlotController<Part>(this, {\n slots: [\"banner\", \"badge\", \"title\", \"description\", \"price\", \"actions\", \"caption\", \"\"]\n });\n\n connectedCallback() {\n super.connectedCallback();\n adoptStyles(this, \"bd-pricing-card\", pageCSS);\n }\n\n render() {\n const has = (part: Part) => this._slots.has(part);\n return html`\n <div class=\"card\">\n <div class=\"banner\" ?hidden=${!this.highlight || !has(\"banner\")}><slot name=\"banner\"></slot></div>\n <div class=\"badge\" ?hidden=${!has(\"badge\")}><slot name=\"badge\"></slot></div>\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 <bd-divider class=\"rule\" orientation=\"horizontal\" color=\"subtle\"></bd-divider>\n <div class=\"price\" ?hidden=${!has(\"price\")}><slot name=\"price\"></slot></div>\n <div class=\"actions\" ?hidden=${!has(\"actions\")}><slot name=\"actions\"></slot></div>\n <div class=\"caption\" ?hidden=${!has(\"caption\")}><slot name=\"caption\"></slot></div>\n <div class=\"features\" ?hidden=${!has(\"\")}><slot></slot></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-pricing-card\": BdPricingCard;\n }\n}\n"],"mappings":"A,wsBAgGO,IAAMI,EAAN,cAA4BC,CAAW,C,8BAKhC,KAAA,UAAA,GAEH,KAAA,OAAA,IAAIE,EAAqB,KAAM,CACtC,MAAO,CAAC,SAAU,QAAS,QAAS,cAAe,QAAS,UAAW,UAAW,EAAE,CACtF,CAAC,C,QARe,KAAA,OAAA,CAACP,CAAc,C,CAU/B,mBAAoB,CAClB,MAAM,kBAAkB,EACxBQ,EAAY,KAAM,kBAAmBC,CAAO,CAC9C,CAEA,QAAS,CACP,IAAMC,EAAO,GAAe,KAAK,OAAO,IAAIC,CAAI,EAChD,MAAO,EAAI;;sCAEuB,CAAC,KAAK,WAAa,CAACD,EAAI,QAAQ,EAAE;qCACnC,CAACA,EAAI,OAAO,EAAE;qCACd,CAACA,EAAI,OAAO,EAAE;2CACR,CAACA,EAAI,aAAa,EAAE;;qCAE1B,CAACA,EAAI,OAAO,EAAE;uCACZ,CAACA,EAAI,SAAS,EAAE;uCAChB,CAACA,EAAI,SAAS,EAAE;wCACf,CAACA,EAAI,EAAE,EAAE;;KAG/C,CACF,EA5BGT,EAAA,CAAAW,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,WAAY,CAAC,CAAA,EAAAR,EAAA,UAAA,YAAA,IAAA,EAAA,EALnE,EAAAH,EAAA,CAAAY,EAAc,iBAAiB,CAAA,EAAAT,CAAA,E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{css as e}from"lit";var t=e`:host{display:block}:host([hidden]){display:none}.group{padding:var(--bd-pricing-feature-group-inset,var(--spacing-10))}.title[hidden],.icon[hidden]{display:none}.title{align-items:flex-start;gap:var(--spacing-8);padding-bottom:var(--bd-pricing-feature-group-title-gap,var(--spacing-16));text-align:start;display:flex}::slotted(bd-h[slot=title]),::slotted(bd-display[slot=title]){--bd-heading-font-size:var(--bd-pricing-feature-group-title-font-size,var(--typography-heading-h4-fontSize));--bd-heading-font-weight:var(--bd-pricing-feature-group-title-font-weight,var(--typography-heading-h4-fontWeight));--bd-heading-line-height:var(--bd-pricing-feature-group-title-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);margin:0}.icon{height:calc(var(--bd-pricing-feature-group-title-font-size,var(--typography-heading-h4-fontSize)) * var(--bd-pricing-feature-group-title-line-height,var(--typography-heading-h4-lineHeight)));color:var(--color-text-brand);flex-shrink:0;align-items:center;display:inline-flex}.list{padding-top:var(--bd-pricing-feature-group-list-gap,var(--spacing-16));text-align:start}`;export{t as default};
|
|
2
2
|
//# sourceMappingURL=pricing-feature-group.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-feature-group.css.js","names":["pricing_feature_group_css_default"],"sources":["../../../../src/components/pricing-card/pricing-feature-group.css.ts"],"sourcesContent":["import { css
|
|
1
|
+
{"version":3,"file":"pricing-feature-group.css.js","names":["pricing_feature_group_css_default"],"sources":["../../../../src/components/pricing-card/pricing-feature-group.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\n/* bd-pricing-feature-group: 3.x v1's .features block, its heading and its\n list (pricing-card.css.ts), which each of the five feature lists drew in\n its own shadow root.\n\n THE HOOKS. A card that sets its features in its own scale --\n bd-pricing-card, whose lists sit under a guarantee line in a 14px card --\n sets these on the box around its default slot, and they inherit through\n the slot into this shadow root. Unset, each falls back to 3.x v1's value:\n\n --bd-pricing-feature-group-inset the group's padding (10)\n --bd-pricing-feature-group-title-gap under the heading (16)\n --bd-pricing-feature-group-list-gap above the first feature (16)\n --bd-pricing-feature-group-title-font-size / -font-weight / -line-height\n the heading's role (heading-h4)\n\n The heading's tracking and face stay heading-h4's: every heading role\n shares them. */\nexport default css`\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n /* 3.x's .features inset. */\n .group {\n padding: var(--bd-pricing-feature-group-inset, var(--spacing-10));\n }\n\n .title[hidden],\n .icon[hidden] {\n display: none;\n }\n\n /* 3.x's .text-left: the heading start-aligned with 15 under it, 16 now,\n the step on the scale. The icon, when the page gives one, sits before\n the heading on its first line. */\n .title {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-8);\n padding-bottom: var(--bd-pricing-feature-group-title-gap, var(--spacing-16));\n text-align: start;\n }\n\n /* The heading: 3.x's h4, the heading-h4 role, at whatever level the page\n picks, unless the card it is in sets the hooks. */\n ::slotted(bd-h[slot=\"title\"]),\n ::slotted(bd-display[slot=\"title\"]) {\n --bd-heading-font-size: var(--bd-pricing-feature-group-title-font-size, var(--typography-heading-h4-fontSize));\n --bd-heading-font-weight: var(--bd-pricing-feature-group-title-font-weight, var(--typography-heading-h4-fontWeight));\n --bd-heading-line-height: var(--bd-pricing-feature-group-title-line-height, var(--typography-heading-h4-lineHeight));\n --bd-heading-letter-spacing: var(--typography-heading-h4-letterSpacing);\n --bd-heading-font-family: var(--typography-heading-h4-fontFamily);\n margin: 0;\n }\n\n /* The icon before the heading (\"Everything from Total Security and:\"\n points back at the plan before), in the brand's text ink and centred on\n the heading's first line: the box is one line of the heading tall. */\n .icon {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n height: calc(var(--bd-pricing-feature-group-title-font-size, var(--typography-heading-h4-fontSize)) * var(--bd-pricing-feature-group-title-line-height, var(--typography-heading-h4-lineHeight)));\n color: var(--color-text-brand);\n }\n\n /* 3.x's .features ul: 16 above the first row, no indent. */\n .list {\n padding-top: var(--bd-pricing-feature-group-list-gap, var(--spacing-16));\n text-align: start;\n }\n`;\n"],"mappings":"A,0BAmBA,IAAAA,EAAe,CAAG,ytC"}
|
|
@@ -3,7 +3,7 @@ import { SlotController } from "../shared/controller.slot.js";
|
|
|
3
3
|
import "../../tokens/tokens.js";
|
|
4
4
|
import "./pricing-feature.js";
|
|
5
5
|
import "../h/h.js";
|
|
6
|
-
type Part = "" | "title";
|
|
6
|
+
type Part = "" | "title" | "icon";
|
|
7
7
|
/**
|
|
8
8
|
* A titled list of a pricing card's features.
|
|
9
9
|
*
|
|
@@ -27,6 +27,12 @@ type Part = "" | "title";
|
|
|
27
27
|
* -- one list of five, centred beside four start-aligned ones -- so every
|
|
28
28
|
* group draws the same heading now, and there is no attribute for it.
|
|
29
29
|
*
|
|
30
|
+
* An `icon` the page slots -- a bd-icon -- sits before the heading, in the
|
|
31
|
+
* brand's text ink: the back arrow before "Everything from Total Security
|
|
32
|
+
* and:" in bd-pricing-card, pointing at the plan the list builds on. It
|
|
33
|
+
* is drawn only with a title, and it is the page's, so it is named or
|
|
34
|
+
* hidden as the page wrote it; a bd-icon with no label is hidden.
|
|
35
|
+
*
|
|
30
36
|
* ONE DESCRIPTION OPEN AT A TIME. A feature that opens its description sends
|
|
31
37
|
* bd-show; the group closes the others among its own features, as 3.x's
|
|
32
38
|
* FeatureTips kept one open per list.
|
|
@@ -1,6 +1,9 @@
|
|
|
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{SlotController as n}from"../shared/controller.slot.js";import"../h/h.js";import"./pricing-feature.js";import r from"./pricing-feature-group.css.js";import{LitElement as i,html as a,nothing as o}from"lit";var s=class extends i{static{this.styles=[r]}constructor(){super(),this._slots=new n(this,{slots:[`title`,``]}),this._onShow=e=>{let t=e.target;if(t.localName===`bd-pricing-feature`&&t.parentElement===this)for(let e of this.children)e!==t&&e.localName===`bd-pricing-feature`&&e._close()},this.addEventListener(`bd-show`,this._onShow)}render(){let e=this._slots.has(`title`);return a`
|
|
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{SlotController as n}from"../shared/controller.slot.js";import"../h/h.js";import"./pricing-feature.js";import r from"./pricing-feature-group.css.js";import{LitElement as i,html as a,nothing as o}from"lit";var s=class extends i{static{this.styles=[r]}constructor(){super(),this._slots=new n(this,{slots:[`title`,`icon`,``]}),this._onShow=e=>{let t=e.target;if(t.localName===`bd-pricing-feature`&&t.parentElement===this)for(let e of this.children)e!==t&&e.localName===`bd-pricing-feature`&&e._close()},this.addEventListener(`bd-show`,this._onShow)}render(){let e=this._slots.has(`title`);return a`
|
|
2
2
|
<div class="group">
|
|
3
|
-
<div class="title"
|
|
3
|
+
<div class="title" ?hidden=${!e}>
|
|
4
|
+
<span class="icon" ?hidden=${!this._slots.has(`icon`)}><slot name="icon"></slot></span>
|
|
5
|
+
<div id="title"><slot name="title"></slot></div>
|
|
6
|
+
</div>
|
|
4
7
|
<div class="list" role="list" aria-labelledby=${e?`title`:o}><slot></slot></div>
|
|
5
8
|
</div>
|
|
6
9
|
`}};s=t([e(`bd-pricing-feature-group`)],s);export{s as BdPricingFeatureGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-feature-group.js","names":["featureGroupCSS","_decorate","__decorate","pricing_feature_group_css_default","BdPricingFeatureGroup","LitElement","SlotController","opened","event","feature","hasTitle","nothing","defineElement"],"sources":["../../../../src/components/pricing-card/pricing-feature-group.ts"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\";\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 \"./pricing-feature.ts\";\nimport type { BdPricingFeature } from \"./pricing-feature.ts\";\n/* The atom the page writes into the title slot. */\nimport \"#components/h/h.ts\";\nimport featureGroupCSS from \"./pricing-feature-group.css.ts\";\n\ntype Part = \"\" | \"title\";\n\n/**\n * A titled list of a pricing card's features.\n *\n * <bd-pricing-feature-group>\n * <bd-h slot=\"title\" as=\"h5\">Privacy</bd-h>\n * <bd-pricing-feature>Password Manager <bd-badge slot=\"badge\" …>1x</bd-badge> …</bd-pricing-feature>\n * <bd-pricing-feature>…</bd-pricing-feature>\n * </bd-pricing-feature-group>\n *\n * It replaces 3.x's five feature lists -- pricing-card-features, -privacy,\n * -identity, -identity-extended and -parental-control -- which were one\n * list drawn five times, each with its English heading and its items built\n * in. The heading is the page's bd-h now, drawn at 3.x's h4 size (the\n * heading-h4 role) at whatever level the page picks, and the items are\n * bd-pricing-feature children. The 22 features and the five headings 3.x\n * shipped are in the stories.\n *\n * 3.x's Privacy list was the one that looked different: it gave its heading\n * no class, so the heading took the card's centred text and lost the 15px\n * under it the other four had. Measured, that was a slip rather than a look\n * -- one list of five, centred beside four start-aligned ones -- so every\n * group draws the same heading now, and there is no attribute for it.\n *\n * ONE DESCRIPTION OPEN AT A TIME. A feature that opens its description sends\n * bd-show; the group closes the others among its own features, as 3.x's\n * FeatureTips kept one open per list.\n *\n * The features are a list, named by the title while there is one: the box\n * around the slot is role=\"list\" and each bd-pricing-feature a list item\n * through ElementInternals, as 3.x's ul and li were.\n */\n@defineElement(\"bd-pricing-feature-group\")\nexport class BdPricingFeatureGroup extends LitElement {\n static styles = [featureGroupCSS];\n\n _slots = new SlotController<Part>(this, { slots: [\"title\", \"\"] });\n\n constructor() {\n super();\n this.addEventListener(\"bd-show\", this._onShow);\n }\n\n /* One of this group's features opened its description: the others close. */\n private readonly _onShow = (event: Event) => {\n const opened = event.target as Element;\n if (opened.localName !== \"bd-pricing-feature\" || opened.parentElement !== this) return;\n for (const feature of this.children) {\n if (feature !== opened && feature.localName === \"bd-pricing-feature\") (feature as BdPricingFeature)._close();\n }\n };\n\n render() {\n const hasTitle = this._slots.has(\"title\");\n return html`\n <div class=\"group\">\n <div class=\"title\"
|
|
1
|
+
{"version":3,"file":"pricing-feature-group.js","names":["featureGroupCSS","_decorate","__decorate","pricing_feature_group_css_default","BdPricingFeatureGroup","LitElement","SlotController","opened","event","feature","hasTitle","nothing","defineElement"],"sources":["../../../../src/components/pricing-card/pricing-feature-group.ts"],"sourcesContent":["import { LitElement, html, nothing } from \"lit\";\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 \"./pricing-feature.ts\";\nimport type { BdPricingFeature } from \"./pricing-feature.ts\";\n/* The atom the page writes into the title slot. */\nimport \"#components/h/h.ts\";\nimport featureGroupCSS from \"./pricing-feature-group.css.ts\";\n\ntype Part = \"\" | \"title\" | \"icon\";\n\n/**\n * A titled list of a pricing card's features.\n *\n * <bd-pricing-feature-group>\n * <bd-h slot=\"title\" as=\"h5\">Privacy</bd-h>\n * <bd-pricing-feature>Password Manager <bd-badge slot=\"badge\" …>1x</bd-badge> …</bd-pricing-feature>\n * <bd-pricing-feature>…</bd-pricing-feature>\n * </bd-pricing-feature-group>\n *\n * It replaces 3.x's five feature lists -- pricing-card-features, -privacy,\n * -identity, -identity-extended and -parental-control -- which were one\n * list drawn five times, each with its English heading and its items built\n * in. The heading is the page's bd-h now, drawn at 3.x's h4 size (the\n * heading-h4 role) at whatever level the page picks, and the items are\n * bd-pricing-feature children. The 22 features and the five headings 3.x\n * shipped are in the stories.\n *\n * 3.x's Privacy list was the one that looked different: it gave its heading\n * no class, so the heading took the card's centred text and lost the 15px\n * under it the other four had. Measured, that was a slip rather than a look\n * -- one list of five, centred beside four start-aligned ones -- so every\n * group draws the same heading now, and there is no attribute for it.\n *\n * An `icon` the page slots -- a bd-icon -- sits before the heading, in the\n * brand's text ink: the back arrow before \"Everything from Total Security\n * and:\" in bd-pricing-card, pointing at the plan the list builds on. It\n * is drawn only with a title, and it is the page's, so it is named or\n * hidden as the page wrote it; a bd-icon with no label is hidden.\n *\n * ONE DESCRIPTION OPEN AT A TIME. A feature that opens its description sends\n * bd-show; the group closes the others among its own features, as 3.x's\n * FeatureTips kept one open per list.\n *\n * The features are a list, named by the title while there is one: the box\n * around the slot is role=\"list\" and each bd-pricing-feature a list item\n * through ElementInternals, as 3.x's ul and li were.\n */\n@defineElement(\"bd-pricing-feature-group\")\nexport class BdPricingFeatureGroup extends LitElement {\n static styles = [featureGroupCSS];\n\n _slots = new SlotController<Part>(this, { slots: [\"title\", \"icon\", \"\"] });\n\n constructor() {\n super();\n this.addEventListener(\"bd-show\", this._onShow);\n }\n\n /* One of this group's features opened its description: the others close. */\n private readonly _onShow = (event: Event) => {\n const opened = event.target as Element;\n if (opened.localName !== \"bd-pricing-feature\" || opened.parentElement !== this) return;\n for (const feature of this.children) {\n if (feature !== opened && feature.localName === \"bd-pricing-feature\") (feature as BdPricingFeature)._close();\n }\n };\n\n render() {\n const hasTitle = this._slots.has(\"title\");\n return html`\n <div class=\"group\">\n <div class=\"title\" ?hidden=${!hasTitle}>\n <span class=\"icon\" ?hidden=${!this._slots.has(\"icon\")}><slot name=\"icon\"></slot></span>\n <div id=\"title\"><slot name=\"title\"></slot></div>\n </div>\n <div class=\"list\" role=\"list\" aria-labelledby=${hasTitle ? \"title\" : nothing}><slot></slot></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-pricing-feature-group\": BdPricingFeatureGroup;\n }\n}\n"],"mappings":"A,wXAmDO,IAAMI,EAAN,cAAoCC,CAAW,C,OACpC,KAAA,OAAA,CAACL,CAAe,C,CAIhC,aAAc,CACZ,MAAM,EAHC,KAAA,OAAA,IAAIM,EAAqB,KAAM,CAAE,MAAO,CAAC,QAAS,OAAQ,EAAE,CAAE,CAAC,EAQ5C,KAAA,QAAA,GAAiB,CAC3C,IAAMC,EAASC,EAAM,OACrB,GAAID,EAAO,YAAc,sBAAwBA,EAAO,gBAAkB,KAC1E,IAAK,IAAME,KAAW,KAAK,SACrBA,IAAYF,GAAUE,EAAQ,YAAc,sBAAsBA,EAA8B,OAAO,CAE/G,EAVE,KAAK,iBAAiB,UAAW,KAAK,OAAO,CAC/C,CAWA,QAAS,CACP,IAAMC,EAAW,KAAK,OAAO,IAAI,OAAO,EACxC,MAAO,EAAI;;qCAEsB,CAACA,EAAS;uCACR,CAAC,KAAK,OAAO,IAAI,MAAM,EAAE;;;wDAGRA,EAAW,QAAUC,EAAQ;;KAGnF,CACF,EAhCC,EAAAV,EAAA,CAAAW,EAAc,0BAA0B,CAAA,EAAAR,CAAA,E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{css as e}from"lit";var t=e`:host{font-family:var(--typography-fontFamily-sans);display:block}:host([hidden]),[hidden]{display:none}.row{align-items:flex-start;gap:var(--spacing-8);margin-bottom:var(--spacing-10);display:flex;position:relative}.check{color:var(--status-success-accent);flex-shrink:0;margin-block-start:var(--
|
|
1
|
+
import{css as e}from"lit";var t=e`:host{font-family:var(--typography-fontFamily-sans);display:block}:host([hidden]),[hidden]{display:none}.row{align-items:flex-start;gap:var(--spacing-8);margin-bottom:var(--bd-pricing-feature-row-gap,var(--spacing-10));display:flex;position:relative}.check{color:var(--status-success-accent);flex-shrink:0;margin-block-start:calc((var(--bd-pricing-feature-font-size,var(--typography-body-regular-fontSize)) * var(--bd-pricing-feature-line-height,var(--typography-body-regular-lineHeight)) - var(--icon-sm-size)) / 2);margin-inline-end:var(--spacing-8)}.name{min-width:0;margin-bottom:var(--bd-pricing-feature-name-gap,var(--spacing-16));font-size:var(--bd-pricing-feature-font-size,var(--typography-body-regular-fontSize));font-weight:var(--bd-pricing-feature-font-weight,var(--typography-body-regular-fontWeight));line-height:var(--bd-pricing-feature-line-height,var(--typography-body-regular-lineHeight));letter-spacing:var(--typography-body-regular-letterSpacing);font-family:var(--typography-body-regular-fontFamily);color:var(--color-text-primary)}.badge{flex-shrink:0}.toggle{font:inherit;letter-spacing:inherit;color:inherit;text-align:inherit;cursor:pointer;border-radius:var(--focus-outline-radius);outline:var(--border-width-2) solid transparent;background:0 0;border:0;margin:0;padding:0}.toggle:focus-visible{outline-offset:var(--focus-outline-offset);box-shadow:var(--focus-outline-primary)}.toggle:after{content:"";position:absolute;inset:0}.description{bottom:calc(100% + var(--spacing-8));box-sizing:border-box;max-width:274px;padding:var(--spacing-8) var(--spacing-12);background-color:var(--color-surface-container);border:var(--border-width-1) solid var(--color-border-subtle);border-radius:var(--shape-radius-sm);box-shadow:var(--shadow-md);font-size:var(--typography-body-small-fontSize);font-weight:var(--typography-body-small-fontWeight);line-height:var(--typography-body-small-lineHeight);letter-spacing:var(--typography-body-small-letterSpacing);font-family:var(--typography-body-small-fontFamily);color:var(--color-text-primary);z-index:var(--z-tooltip);display:none;position:absolute;inset-inline-start:0}.description:after{content:"";bottom:calc(-1 * var(--border-width-8));border-inline:var(--border-width-8) solid transparent;border-top:var(--border-width-8) solid var(--color-border-subtle);position:absolute;inset-inline-start:calc(20% - var(--border-width-8))}.description.open{display:block}@media (hover:hover){.row:hover .description:not([hidden]){display:block}}`;export{t as default};
|
|
2
2
|
//# sourceMappingURL=pricing-feature.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-feature.css.js","names":["pricing_feature_css_default"],"sources":["../../../../src/components/pricing-card/pricing-feature.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\n/* bd-pricing-feature: 3.x v1's feature row (pricing-card.css.ts's\n .feature-item and .tooltip), which the five feature lists drew in their\n shadow roots. v2's pricing-feature-item drew a 12px row of its own; the\n v1 row is the one that shipped. */\nexport default css`\n :host {\n display: block;\n font-family: var(--typography-fontFamily-sans);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n [hidden] {\n display: none;\n }\n\n /* The row: the check, the name and the badge on one line, 10 apart from\n the next row. The 16 under the name is the bottom margin 3.x's name\n paragraph carried inside the row (a bd-p in a flex row keeps its\n margin), so rows stand 26 apart as they did. Position relative: the\n description is drawn over the row above it. */\n .row {\n position: relative;\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-8);\n margin-bottom: var(--spacing-10);\n }\n\n /* The check, centred on the name's first line: a 16 icon on a 24 line.\n 3.x centred its 16px PNG on the whole row, the name's 16 bottom margin\n included, which put it 8 below a one-line name's middle. The green is\n the success accent v2's check already took: a mark, green on white at\n 4.75:1. */\n .check {\n flex-shrink: 0;\n margin-block-start: var(--
|
|
1
|
+
{"version":3,"file":"pricing-feature.css.js","names":["pricing_feature_css_default"],"sources":["../../../../src/components/pricing-card/pricing-feature.css.ts"],"sourcesContent":["import { css } from \"lit\";\n\n/* bd-pricing-feature: 3.x v1's feature row (pricing-card.css.ts's\n .feature-item and .tooltip), which the five feature lists drew in their\n shadow roots. v2's pricing-feature-item drew a 12px row of its own; the\n v1 row is the one that shipped.\n\n THE HOOKS, as bd-pricing-feature-group has them: a card that sets its\n features in its own scale sets these around its default slot, and they\n inherit into this shadow root. Unset, each is 3.x v1's:\n\n --bd-pricing-feature-row-gap under each row (10)\n --bd-pricing-feature-name-gap under the name, inside the row (16)\n --bd-pricing-feature-font-size / -font-weight / -line-height\n the name's role (body-regular)\n\n The check is centred on the name's first line from the same hooks, so it\n follows whichever role the name is in. */\nexport default css`\n :host {\n display: block;\n font-family: var(--typography-fontFamily-sans);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n [hidden] {\n display: none;\n }\n\n /* The row: the check, the name and the badge on one line, 10 apart from\n the next row. The 16 under the name is the bottom margin 3.x's name\n paragraph carried inside the row (a bd-p in a flex row keeps its\n margin), so rows stand 26 apart as they did. Position relative: the\n description is drawn over the row above it. */\n .row {\n position: relative;\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-8);\n margin-bottom: var(--bd-pricing-feature-row-gap, var(--spacing-10));\n }\n\n /* The check, centred on the name's first line: a 16 icon on a 24 line,\n half of the line less the icon above it, read from the name's role.\n 3.x centred its 16px PNG on the whole row, the name's 16 bottom margin\n included, which put it 8 below a one-line name's middle. The green is\n the success accent v2's check already took: a mark, green on white at\n 4.75:1. */\n .check {\n flex-shrink: 0;\n margin-block-start: calc((var(--bd-pricing-feature-font-size, var(--typography-body-regular-fontSize)) * var(--bd-pricing-feature-line-height, var(--typography-body-regular-lineHeight)) - var(--icon-sm-size)) / 2);\n margin-inline-end: var(--spacing-8);\n color: var(--status-success-accent);\n }\n\n /* The name, at body-regular in primary ink, as 3.x's bd-p regular drew it. */\n .name {\n min-width: 0;\n margin-bottom: var(--bd-pricing-feature-name-gap, var(--spacing-16));\n font-size: var(--bd-pricing-feature-font-size, var(--typography-body-regular-fontSize));\n font-weight: var(--bd-pricing-feature-font-weight, var(--typography-body-regular-fontWeight));\n line-height: var(--bd-pricing-feature-line-height, var(--typography-body-regular-lineHeight));\n letter-spacing: var(--typography-body-regular-letterSpacing);\n font-family: var(--typography-body-regular-fontFamily);\n color: var(--color-text-primary);\n }\n\n .badge {\n flex-shrink: 0;\n }\n\n /* The name as the button that opens its description: it reads as the text\n it is, and draws the one focus ring. */\n .toggle {\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n text-align: inherit;\n cursor: pointer;\n border-radius: var(--focus-outline-radius);\n outline: var(--border-width-2) solid transparent;\n }\n\n .toggle:focus-visible {\n /* the one focus ring -- see Design Tokens/Focus. Forced-colors mode does\n not paint box-shadow; it paints the transparent outline above, in a\n system colour, on the ring's outer band. */\n outline-offset: var(--focus-outline-offset);\n box-shadow: var(--focus-outline-primary);\n }\n\n /* The whole row is the button's target, as the whole row was the hover's. */\n .toggle::after {\n content: \"\";\n position: absolute;\n inset: 0;\n }\n\n /* The description, over the row above it, its arrow ending on the row's\n top edge. 3.x's tooltip: the container ground, a subtle hairline, the\n small radius, and the body-small role its bd-p drew in primary ink. */\n .description {\n display: none;\n position: absolute;\n bottom: calc(100% + var(--spacing-8));\n inset-inline-start: 0;\n box-sizing: border-box;\n /* no token: 3.x's tooltip measure (250 plus its inset), narrower than any\n width on the scale; the row caps it below that */\n max-width: 274px;\n padding: var(--spacing-8) var(--spacing-12);\n background-color: var(--color-surface-container);\n border: var(--border-width-1) solid var(--color-border-subtle);\n border-radius: var(--shape-radius-sm);\n box-shadow: var(--shadow-md);\n font-size: var(--typography-body-small-fontSize);\n font-weight: var(--typography-body-small-fontWeight);\n line-height: var(--typography-body-small-lineHeight);\n letter-spacing: var(--typography-body-small-letterSpacing);\n font-family: var(--typography-body-small-fontFamily);\n color: var(--color-text-primary);\n /* A tooltip is the role, not a number: it clears the cards it overhangs,\n the highlight banner included. */\n z-index: var(--z-tooltip);\n }\n\n .description::after {\n content: \"\";\n position: absolute;\n bottom: calc(-1 * var(--border-width-8));\n /* centred on 20% from the start: half the arrow's width is one of the\n two borders that draw it, which a translate could not flip */\n inset-inline-start: calc(20% - var(--border-width-8));\n /* an 8px triangle drawn by three borders, 3.x's --spacing-8 spelled as\n the border widths they are */\n border-inline: var(--border-width-8) solid transparent;\n /* the arrow, the same role as the box: they are one shape */\n border-top: var(--border-width-8) solid var(--color-border-subtle);\n }\n\n /* Open from the button, and previewed on hover where there is a hover. A\n touch screen's emulated hover sticks after a tap, so without the query\n the tap that closes the description would leave it showing. */\n .description.open {\n display: block;\n }\n\n @media (hover: hover) {\n .row:hover .description:not([hidden]) {\n display: block;\n }\n }\n`;\n"],"mappings":"A,0BAkBA,IAAAA,EAAe,CAAG,s8E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{font-family:var(--typography-fontFamily-sans);text-align:start;display:block}:host([hidden]){display:none}.zone{flex-direction:column;align-items:flex-start;display:flex}.reference{align-items:center;gap:var(--spacing-8);display:inline-flex}.full,.discount{display:contents}::slotted([slot=full]),::slotted([slot=discount]){margin-bottom:var(--spacing-16)}.full{font-size:var(--typography-body-small-fontSize);font-weight:var(--typography-body-small-fontWeight);line-height:var(--typography-body-small-lineHeight);letter-spacing:var(--typography-body-small-letterSpacing);font-family:var(--typography-body-small-fontFamily);color:var(--color-text-primary)}.amount{font-size:var(--typography-heading-h3-fontSize);font-weight:var(--typography-heading-h3-fontWeight);line-height:var(--typography-heading-h3-lineHeight);letter-spacing:var(--typography-heading-h3-letterSpacing);font-family:var(--typography-heading-h3-fontFamily);color:var(--color-text-primary);margin:0}.caption{margin-top:var(--spacing-16);max-width:80%;font-size:var(--typography-body-small-fontSize);font-weight:var(--typography-body-small-fontWeight);line-height:var(--typography-body-small-lineHeight);letter-spacing:var(--typography-body-small-letterSpacing);font-family:var(--typography-body-small-fontFamily);color:var(--color-text-primary)}.zone [hidden]{display:none}@media (width<768px){.reference{gap:var(--spacing-4)
|
|
1
|
+
import"../shared/token-scales.js";import{css as e}from"lit";var t=e`:host{font-family:var(--typography-fontFamily-sans);text-align:start;display:block}:host([hidden]){display:none}.zone{flex-direction:column;align-items:flex-start;display:flex}.reference{align-items:center;gap:var(--spacing-8);display:inline-flex}.full,.discount{display:contents}::slotted([slot=full]),::slotted([slot=discount]){margin-bottom:var(--bd-pricing-price-reference-gap,var(--spacing-16))}.full{font-size:var(--bd-pricing-price-full-font-size,var(--typography-body-small-fontSize));font-weight:var(--bd-pricing-price-full-font-weight,var(--typography-body-small-fontWeight));line-height:var(--bd-pricing-price-full-line-height,var(--typography-body-small-lineHeight));letter-spacing:var(--bd-pricing-price-full-letter-spacing,var(--typography-body-small-letterSpacing));font-family:var(--typography-body-small-fontFamily);color:var(--color-text-primary)}.amount{font-size:var(--typography-heading-h3-fontSize);font-weight:var(--bd-pricing-price-amount-font-weight,var(--typography-heading-h3-fontWeight));line-height:var(--typography-heading-h3-lineHeight);letter-spacing:var(--typography-heading-h3-letterSpacing);font-family:var(--typography-heading-h3-fontFamily);color:var(--color-text-primary);margin:0}.caption{margin-top:var(--bd-pricing-price-caption-gap,var(--spacing-16));max-width:80%;font-size:var(--typography-body-small-fontSize);font-weight:var(--typography-body-small-fontWeight);line-height:var(--typography-body-small-lineHeight);letter-spacing:var(--typography-body-small-letterSpacing);font-family:var(--typography-body-small-fontFamily);color:var(--color-text-primary)}.zone [hidden]{display:none}@media (width<768px){.reference{flex-direction:var(--bd-pricing-price-reference-direction-narrow,column);gap:var(--bd-pricing-price-reference-spacing-narrow,var(--spacing-4))}}`;export{t as default};
|
|
2
2
|
//# sourceMappingURL=pricing-price.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-price.css.js","names":["pricing_price_css_default"],"sources":["../../../../src/components/pricing-card/pricing-price.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { below } from \"#shared/token-scales.ts\";\n\n/* bd-pricing-price: 3.x v1's price zone (pricing-card.css.ts's .pricing,\n .pricing-info, .original-price, .price and .terms), at its type roles. */\nexport default css`\n :host {\n display: block;\n font-family: var(--typography-fontFamily-sans);\n text-align: start;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .zone {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n /* The full price and the discount, side by side and centred on each other\n as 3.x's .pricing-info row was; stacked below md, 4 apart. The wrappers\n draw no box, so the page's nodes are the row's items: the store hides a\n node with display: none, and a row whose nodes are both hidden takes no\n room. */\n .reference {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-8);\n }\n\n .full,\n .discount {\n display: contents;\n }\n\n /* The 16 under the row was the bottom margin of the bd-p 3.x wrapped each\n node in; it is the nodes' own here, so it goes with them when the store\n hides them. */\n ::slotted([slot=\"full\"]),\n ::slotted([slot=\"discount\"]) {\n margin-bottom: var(--spacing-16);\n }\n\n /* The struck full price: 3.x's bd-p small, body-small in primary ink. The\n page's <s> draws the strike. */\n .full {\n font-size: var(--typography-body-small-fontSize);\n font-weight: var(--typography-body-small-fontWeight);\n line-height: var(--typography-body-small-lineHeight);\n letter-spacing: var(--typography-body-small-letterSpacing);\n font-family: var(--typography-body-small-fontFamily);\n color: var(--color-text-primary);\n }\n\n /* The price and its unit, one line in the heading-h3 role, as 3.x's\n .price paragraph read it. */\n .amount {\n margin: 0;\n font-size: var(--typography-heading-h3-fontSize);\n font-weight: var(--typography-heading-h3-fontWeight);\n line-height: var(--typography-heading-h3-lineHeight);\n letter-spacing: var(--typography-heading-h3-letterSpacing);\n font-family: var(--typography-heading-h3-fontFamily);\n color: var(--color-text-primary);\n }\n\n /* The small print: 3.x's bd-p small, 15 under the price (16, the step on\n the scale) and four-fifths of the card wide. */\n .caption {\n margin-top: var(--spacing-16);\n max-width: 80%;\n font-size: var(--typography-body-small-fontSize);\n font-weight: var(--typography-body-small-fontWeight);\n line-height: var(--typography-body-small-lineHeight);\n letter-spacing: var(--typography-body-small-letterSpacing);\n font-family: var(--typography-body-small-fontFamily);\n color: var(--color-text-primary);\n }\n\n /* A part's box is hidden while its slot is empty; this outweighs the\n display each box sets above. */\n .zone [hidden] {\n display: none;\n }\n\n @media ${unsafeCSS(below(\"md\"))} {\n .reference {\n flex-direction: column;\n gap: var(--spacing-4);\n }\n }\n`;\n"],"mappings":"A,
|
|
1
|
+
{"version":3,"file":"pricing-price.css.js","names":["pricing_price_css_default"],"sources":["../../../../src/components/pricing-card/pricing-price.css.ts"],"sourcesContent":["import { css, unsafeCSS } from \"lit\";\nimport { below } from \"#shared/token-scales.ts\";\n\n/* bd-pricing-price: 3.x v1's price zone (pricing-card.css.ts's .pricing,\n .pricing-info, .original-price, .price and .terms), at its type roles.\n\n THE HOOKS, as bd-pricing-feature-group has them: a card that sets its\n price in its own type -- bd-pricing-card, whose struck price is Figma's\n price/was and whose price is bold -- sets these around its price slot,\n and they inherit into this shadow root. Unset, each is 3.x v1's:\n\n --bd-pricing-price-full-font-size / -font-weight / -line-height /\n -letter-spacing the struck full price's role (body-small)\n --bd-pricing-price-amount-font-weight\n the price's weight (heading-h3's, 600)\n --bd-pricing-price-reference-gap\n under the full price and the discount (16)\n --bd-pricing-price-reference-direction-narrow\n the row below md: column, stacked as 3.x's,\n or row, side by side as at every width\n --bd-pricing-price-reference-spacing-narrow\n between them below md (4)\n --bd-pricing-price-caption-gap above the small print (16) */\nexport default css`\n :host {\n display: block;\n font-family: var(--typography-fontFamily-sans);\n text-align: start;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .zone {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n /* The full price and the discount, side by side and centred on each other\n as 3.x's .pricing-info row was; stacked below md, 4 apart. The wrappers\n draw no box, so the page's nodes are the row's items: the store hides a\n node with display: none, and a row whose nodes are both hidden takes no\n room. */\n .reference {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-8);\n }\n\n .full,\n .discount {\n display: contents;\n }\n\n /* The 16 under the row was the bottom margin of the bd-p 3.x wrapped each\n node in; it is the nodes' own here, so it goes with them when the store\n hides them. */\n ::slotted([slot=\"full\"]),\n ::slotted([slot=\"discount\"]) {\n margin-bottom: var(--bd-pricing-price-reference-gap, var(--spacing-16));\n }\n\n /* The struck full price: 3.x's bd-p small, body-small in primary ink. The\n page's <s> draws the strike. */\n .full {\n font-size: var(--bd-pricing-price-full-font-size, var(--typography-body-small-fontSize));\n font-weight: var(--bd-pricing-price-full-font-weight, var(--typography-body-small-fontWeight));\n line-height: var(--bd-pricing-price-full-line-height, var(--typography-body-small-lineHeight));\n letter-spacing: var(--bd-pricing-price-full-letter-spacing, var(--typography-body-small-letterSpacing));\n font-family: var(--typography-body-small-fontFamily);\n color: var(--color-text-primary);\n }\n\n /* The price and its unit, one line in the heading-h3 role, as 3.x's\n .price paragraph read it. */\n .amount {\n margin: 0;\n font-size: var(--typography-heading-h3-fontSize);\n font-weight: var(--bd-pricing-price-amount-font-weight, var(--typography-heading-h3-fontWeight));\n line-height: var(--typography-heading-h3-lineHeight);\n letter-spacing: var(--typography-heading-h3-letterSpacing);\n font-family: var(--typography-heading-h3-fontFamily);\n color: var(--color-text-primary);\n }\n\n /* The small print: 3.x's bd-p small, 15 under the price (16, the step on\n the scale) and four-fifths of the card wide. */\n .caption {\n margin-top: var(--bd-pricing-price-caption-gap, var(--spacing-16));\n max-width: 80%;\n font-size: var(--typography-body-small-fontSize);\n font-weight: var(--typography-body-small-fontWeight);\n line-height: var(--typography-body-small-lineHeight);\n letter-spacing: var(--typography-body-small-letterSpacing);\n font-family: var(--typography-body-small-fontFamily);\n color: var(--color-text-primary);\n }\n\n /* A part's box is hidden while its slot is empty; this outweighs the\n display each box sets above. */\n .zone [hidden] {\n display: none;\n }\n\n @media ${unsafeCSS(below(\"md\"))} {\n .reference {\n flex-direction: var(--bd-pricing-price-reference-direction-narrow, column);\n gap: var(--bd-pricing-price-reference-spacing-narrow, var(--spacing-4));\n }\n }\n`;\n"],"mappings":"A,4DAuBA,IAAAA,EAAe,CAAG,gxD"}
|
|
@@ -1,16 +1,20 @@
|
|
|
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 "../badge/badge.js";
|
|
5
5
|
import "../link/link.js";
|
|
6
6
|
type Part = "" | "full" | "discount" | "period" | "caption";
|
|
7
|
+
export declare const PRICE_APPEARANCES: readonly ["card", "hero"];
|
|
8
|
+
export type PriceAppearance = typeof PRICE_APPEARANCES[number];
|
|
9
|
+
export declare const PRICE_SIZES: readonly ["md", "lg"];
|
|
10
|
+
export type PriceSize = typeof PRICE_SIZES[number];
|
|
7
11
|
/**
|
|
8
12
|
* A pricing card's price zone: the struck full price and the discount, the
|
|
9
13
|
* price itself with its billing unit, and the line under it.
|
|
10
14
|
*
|
|
11
15
|
* <bd-pricing-price slot="price">
|
|
12
16
|
* <s slot="full" data-store-render data-store-price="full" data-store-hide="!it.option.price.discounted"></s>
|
|
13
|
-
* <bd-badge slot="discount"
|
|
17
|
+
* <bd-badge slot="discount" data-store-hide="!it.option.price.discounted">
|
|
14
18
|
* Save <span data-store-render data-store-discount="percentage"></span>
|
|
15
19
|
* </bd-badge>
|
|
16
20
|
* <span data-store-render data-store-price="discounted||full"></span>
|
|
@@ -42,10 +46,35 @@ type Part = "" | "full" | "discount" | "period" | "caption";
|
|
|
42
46
|
* page's. The monthly and yearly prices of a billing toggle are two of these,
|
|
43
47
|
* one in each panel of a bd-tab-group the page writes into the card's price
|
|
44
48
|
* slot.
|
|
49
|
+
*
|
|
50
|
+
* TWO LOOKS, ONE ZONE. `appearance` says where the zone stands: `card` (the
|
|
51
|
+
* default) in a pricing card, `hero` in a hero banner. They differ in the
|
|
52
|
+
* discount pill only, and the zone owns it. A row of cards sets several
|
|
53
|
+
* pills side by side, and a solid green one in each turns the row into a
|
|
54
|
+
* Christmas tree, so a card's pill is the success shade; a hero states one
|
|
55
|
+
* price, and its pill is the solid success fill at the large size, as
|
|
56
|
+
* bd-product-hero draws its own.
|
|
57
|
+
*
|
|
58
|
+
* `size` is how big a card's pill is: `md` (the default), 3.x v1's, or
|
|
59
|
+
* `lg`, bd-pricing-card's, as Figma's Badge tone=success size=lg draws it
|
|
60
|
+
* (8/12 padding, 14px words). A hero's pill is large whatever it says.
|
|
61
|
+
*
|
|
62
|
+
* The zone hands the look to each bd-badge the page slots into `discount` --
|
|
63
|
+
* variant, appearance and size, attributes the badge observes anyway
|
|
64
|
+
* (CLAUDE.md, Parent to child) -- on every slotchange and every change of
|
|
65
|
+
* `appearance` or `size`, so the page writes a bare
|
|
66
|
+
* `<bd-badge slot="discount">` and one zone cannot draw two looks.
|
|
45
67
|
*/
|
|
46
68
|
export declare class BdPricingPrice extends LitElement {
|
|
47
69
|
static styles: import("lit").CSSResult[];
|
|
70
|
+
/** Where the zone stands: card (the discount in the success shade) or hero (the solid success fill, large). Reflected. */
|
|
71
|
+
appearance: PriceAppearance;
|
|
72
|
+
/** How big a card's discount pill is: md (3.x v1's) or lg (bd-pricing-card's). A hero's is always lg. Reflected. */
|
|
73
|
+
size: PriceSize;
|
|
48
74
|
_slots: SlotController<Part>;
|
|
75
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
76
|
+
updated(changed: PropertyValues<this>): void;
|
|
77
|
+
private _pushDiscountLook;
|
|
49
78
|
render(): import("lit-html").TemplateResult<1>;
|
|
50
79
|
}
|
|
51
80
|
declare global {
|
|
@@ -1,11 +1,11 @@
|
|
|
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{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{SlotController as r}from"../shared/controller.slot.js";import"../link/link.js";import"../badge/badge.js";import i from"./pricing-price.css.js";import{LitElement as a,html as o}from"lit";import{property as s}from"lit/decorators.js";var c=[`card`,`hero`],l=[`md`,`lg`],u=(e,t)=>e===`hero`?{appearance:`fill`,size:`lg`}:{appearance:`shade`,size:t},d=class extends a{constructor(...e){super(...e),this.appearance=`card`,this.size=`md`,this._slots=new r(this,{slots:[`full`,`discount`,``,`period`,`caption`]})}static{this.styles=[i]}willUpdate(e){e.has(`appearance`)&&!t(c,this.appearance)&&(this.appearance=`card`),e.has(`size`)&&!t(l,this.size)&&(this.size=`md`)}updated(e){(e.has(`appearance`)||e.has(`size`))&&this._pushDiscountLook()}_pushDiscountLook(){let e=u(this.appearance,this.size);for(let t of this.querySelectorAll(`:scope > bd-badge[slot="discount"]`))t.setAttribute(`variant`,`success`),t.setAttribute(`appearance`,e.appearance),t.setAttribute(`size`,e.size)}render(){let e=e=>this._slots.has(e);return o`
|
|
2
2
|
<div class="zone">
|
|
3
3
|
<div class="reference" ?hidden=${!e(`full`)&&!e(`discount`)}>
|
|
4
4
|
<span class="full" ?hidden=${!e(`full`)}><slot name="full"></slot></span>
|
|
5
|
-
<span class="discount" ?hidden=${!e(`discount`)}><slot name="discount"></slot></span>
|
|
5
|
+
<span class="discount" ?hidden=${!e(`discount`)}><slot name="discount" @slotchange=${this._pushDiscountLook}></slot></span>
|
|
6
6
|
</div>
|
|
7
7
|
<p class="amount" ?hidden=${!e(``)&&!e(`period`)}><slot></slot><span class="period"><slot name="period"></slot></span></p>
|
|
8
8
|
<div class="caption" ?hidden=${!e(`caption`)}><slot name="caption"></slot></div>
|
|
9
9
|
</div>
|
|
10
|
-
`}};
|
|
10
|
+
`}};n([s({type:String,reflect:!0})],d.prototype,`appearance`,void 0),n([s({type:String,reflect:!0})],d.prototype,`size`,void 0),d=n([e(`bd-pricing-price`)],d);export{d as BdPricingPrice,c as PRICE_APPEARANCES,l as PRICE_SIZES};
|
|
11
11
|
//# sourceMappingURL=pricing-price.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pricing-price.js","names":["priceCSS","_decorate","__decorate","pricing_price_css_default","BdPricingPrice","LitElement","_args","SlotController","has","part","defineElement"],"sources":["../../../../src/components/pricing-card/pricing-price.ts"],"sourcesContent":["import { LitElement, html } from \"lit\";\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\";\n/* The atoms the page writes into the slots: the discount's bd-badge and the\n caption's terms bd-link. */\nimport \"#components/badge/badge.ts\";\nimport \"#components/link/link.ts\";\nimport priceCSS from \"./pricing-price.css.ts\";\n\ntype Part = \"\" | \"full\" | \"discount\" | \"period\" | \"caption\";\n\n/**\n * A pricing card's price zone: the struck full price and the discount, the\n * price itself with its billing unit, and the line under it.\n *\n * <bd-pricing-price slot=\"price\">\n * <s slot=\"full\" data-store-render data-store-price=\"full\" data-store-hide=\"!it.option.price.discounted\"></s>\n * <bd-badge slot=\"discount\"
|
|
1
|
+
{"version":3,"file":"pricing-price.js","names":["priceCSS","_decorate","__decorate","pricing_price_css_default","PRICE_APPEARANCES","PRICE_SIZES","discountLook","appearance","BdPricingPrice","LitElement","_args","SlotController","changed","isOneOf","look","badge","has","part","property","defineElement"],"sources":["../../../../src/components/pricing-card/pricing-price.ts"],"sourcesContent":["import { LitElement, html, type PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { isOneOf } from \"#shared/prop-vocabulary.ts\";\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\";\n/* The atoms the page writes into the slots: the discount's bd-badge and the\n caption's terms bd-link. */\nimport \"#components/badge/badge.ts\";\nimport \"#components/link/link.ts\";\nimport priceCSS from \"./pricing-price.css.ts\";\n\ntype Part = \"\" | \"full\" | \"discount\" | \"period\" | \"caption\";\n\n/* Where the zone stands, which decides the discount's look. */\nexport const PRICE_APPEARANCES = [\"card\", \"hero\"] as const;\nexport type PriceAppearance = typeof PRICE_APPEARANCES[number];\n\n/* How big the discount pill is in a card: md, 3.x v1's, or lg, bd-pricing-card's. */\nexport const PRICE_SIZES = [\"md\", \"lg\"] as const;\nexport type PriceSize = typeof PRICE_SIZES[number];\n\n/* The discount bd-badge each appearance draws, always the success meaning:\n the shade wash in a card, at the zone's size, and the solid fill in a hero,\n always large (bd-product-hero's own discount badge). */\nconst discountLook = (appearance: PriceAppearance, size: PriceSize) =>\n appearance === \"hero\" ? { appearance: \"fill\", size: \"lg\" } : { appearance: \"shade\", size };\n\n/**\n * A pricing card's price zone: the struck full price and the discount, the\n * price itself with its billing unit, and the line under it.\n *\n * <bd-pricing-price slot=\"price\">\n * <s slot=\"full\" data-store-render data-store-price=\"full\" data-store-hide=\"!it.option.price.discounted\"></s>\n * <bd-badge slot=\"discount\" data-store-hide=\"!it.option.price.discounted\">\n * Save <span data-store-render data-store-discount=\"percentage\"></span>\n * </bd-badge>\n * <span data-store-render data-store-price=\"discounted||full\"></span>\n * <span slot=\"period\">/year</span>\n * <span slot=\"caption\">First year price. Plus applicable sales tax. See <bd-link href=\"#terms\" inline underline>terms of use</bd-link> below.</span>\n * </bd-pricing-price>\n *\n * EVERY NODE THE STORE FILLS IS THE PAGE'S. 3.x's v1 card rendered this zone\n * itself, into the light DOM so the store and anything reading the page\n * found it, and v2's pricing-card-pricing did the same inside a\n * bd-context/bd-product/bd-option of its own. Here the page writes each\n * node, with its data-store-* attributes, inside the bd-product and\n * bd-option it wraps the card in; @repobit/dex-store-elements finds them in\n * the document, and each node's request for the store's scope bubbles from\n * the page's node, through this element's slot and the card's, to that\n * bd-option. Nothing store-bound is in a shadow root, so neither element\n * needs the store's `shadow` opt-in.\n *\n * 3.x hid the full price and the discount together, on their row, with\n * data-store-hide=\"!it.option.price.discounted\"; the page writes it on both\n * nodes now. The store hides a node with display: none, and the 16 under the\n * row is the nodes' own margin, so a price with no discount closes the row\n * up as 3.x's did.\n *\n * 3.x's type, at 3.x's roles: the full price at body-small, the price and\n * its unit at heading-h3 (it is a figure the card states, not a heading of\n * anything, so it is a paragraph), the caption at body-small in 80% of the\n * card. The words -- \"Save\", \"/year\", \"First year price…\" -- are the\n * page's. The monthly and yearly prices of a billing toggle are two of these,\n * one in each panel of a bd-tab-group the page writes into the card's price\n * slot.\n *\n * TWO LOOKS, ONE ZONE. `appearance` says where the zone stands: `card` (the\n * default) in a pricing card, `hero` in a hero banner. They differ in the\n * discount pill only, and the zone owns it. A row of cards sets several\n * pills side by side, and a solid green one in each turns the row into a\n * Christmas tree, so a card's pill is the success shade; a hero states one\n * price, and its pill is the solid success fill at the large size, as\n * bd-product-hero draws its own.\n *\n * `size` is how big a card's pill is: `md` (the default), 3.x v1's, or\n * `lg`, bd-pricing-card's, as Figma's Badge tone=success size=lg draws it\n * (8/12 padding, 14px words). A hero's pill is large whatever it says.\n *\n * The zone hands the look to each bd-badge the page slots into `discount` --\n * variant, appearance and size, attributes the badge observes anyway\n * (CLAUDE.md, Parent to child) -- on every slotchange and every change of\n * `appearance` or `size`, so the page writes a bare\n * `<bd-badge slot=\"discount\">` and one zone cannot draw two looks.\n */\n@defineElement(\"bd-pricing-price\")\nexport class BdPricingPrice extends LitElement {\n static styles = [priceCSS];\n\n /** Where the zone stands: card (the discount in the success shade) or hero (the solid success fill, large). Reflected. */\n @property({ type: String, reflect: true })\n appearance: PriceAppearance = \"card\";\n\n /** How big a card's discount pill is: md (3.x v1's) or lg (bd-pricing-card's). A hero's is always lg. Reflected. */\n @property({ type: String, reflect: true })\n size: PriceSize = \"md\";\n\n _slots = new SlotController<Part>(this, { slots: [\"full\", \"discount\", \"\", \"period\", \"caption\"] });\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") && !isOneOf(PRICE_APPEARANCES, this.appearance)) this.appearance = \"card\";\n if (changed.has(\"size\") && !isOneOf(PRICE_SIZES, this.size)) this.size = \"md\";\n }\n\n updated(changed: PropertyValues<this>) {\n if (changed.has(\"appearance\") || changed.has(\"size\")) this._pushDiscountLook();\n }\n\n /* The discount's look, onto each bd-badge the page slotted into\n `discount`; its words and data-store-* attributes stay the page's. */\n private _pushDiscountLook() {\n const look = discountLook(this.appearance, this.size);\n for (const badge of this.querySelectorAll(':scope > bd-badge[slot=\"discount\"]')) {\n badge.setAttribute(\"variant\", \"success\");\n badge.setAttribute(\"appearance\", look.appearance);\n badge.setAttribute(\"size\", look.size);\n }\n }\n\n render() {\n const has = (part: Part) => this._slots.has(part);\n return html`\n <div class=\"zone\">\n <div class=\"reference\" ?hidden=${!has(\"full\") && !has(\"discount\")}>\n <span class=\"full\" ?hidden=${!has(\"full\")}><slot name=\"full\"></slot></span>\n <span class=\"discount\" ?hidden=${!has(\"discount\")}><slot name=\"discount\" @slotchange=${this._pushDiscountLook}></slot></span>\n </div>\n <p class=\"amount\" ?hidden=${!has(\"\") && !has(\"period\")}><slot></slot><span class=\"period\"><slot name=\"period\"></slot></span></p>\n <div class=\"caption\" ?hidden=${!has(\"caption\")}><slot name=\"caption\"></slot></div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bd-pricing-price\": BdPricingPrice;\n }\n}\n"],"mappings":"A,0cAgBA,IAAaI,EAAoB,CAAC,OAAQ,MAAM,EAInCC,EAAc,CAAC,KAAM,IAAI,EAMhCC,GAAgB,EAA6B,IACjDC,IAAe,OAAS,CAAE,WAAY,OAAQ,KAAM,IAAK,EAAI,CAAE,WAAY,QAAS,MAAK,EA4D9EC,EAAN,cAA6BC,CAAW,C,8BAKf,KAAA,WAAA,OAIZ,KAAA,KAAA,KAET,KAAA,OAAA,IAAIE,EAAqB,KAAM,CAAE,MAAO,CAAC,OAAQ,WAAY,GAAI,SAAU,SAAS,CAAE,CAAC,C,QAVhF,KAAA,OAAA,CAACX,CAAQ,C,CAYzB,WAAW,EAA+B,CACpCY,EAAQ,IAAI,YAAY,GAAK,CAACC,EAAQT,EAAmB,KAAK,UAAU,IAAG,KAAK,WAAa,QAC7FQ,EAAQ,IAAI,MAAM,GAAK,CAACC,EAAQR,EAAa,KAAK,IAAI,IAAG,KAAK,KAAO,KAC3E,CAEA,QAAQ,EAA+B,EACjCO,EAAQ,IAAI,YAAY,GAAKA,EAAQ,IAAI,MAAM,IAAG,KAAK,kBAAkB,CAC/E,CAIA,mBAA4B,CAC1B,IAAME,EAAOR,EAAa,KAAK,WAAY,KAAK,IAAI,EACpD,IAAK,IAAMS,KAAS,KAAK,iBAAiB,oCAAoC,EAC5EA,EAAM,aAAa,UAAW,SAAS,EACvCA,EAAM,aAAa,aAAcD,EAAK,UAAU,EAChDC,EAAM,aAAa,OAAQD,EAAK,IAAI,CAExC,CAEA,QAAS,CACP,IAAME,EAAO,GAAe,KAAK,OAAO,IAAIC,CAAI,EAChD,MAAO,EAAI;;yCAE0B,CAACD,EAAI,MAAM,GAAK,CAACA,EAAI,UAAU,EAAE;uCACnC,CAACA,EAAI,MAAM,EAAE;2CACT,CAACA,EAAI,UAAU,EAAE,qCAAqC,KAAK,kBAAkB;;oCAEpF,CAACA,EAAI,EAAE,GAAK,CAACA,EAAI,QAAQ,EAAE;uCACxB,CAACA,EAAI,SAAS,EAAE;;KAGrD,CACF,EA1CGf,EAAA,CAAAiB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAV,EAAA,UAAA,aAAA,IAAA,EAAA,EAIxCP,EAAA,CAAAiB,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAAAV,EAAA,UAAA,OAAA,IAAA,EAAA,EAT1C,EAAAP,EAAA,CAAAkB,EAAc,kBAAkB,CAAA,EAAAX,CAAA,E"}
|