@carbon/ibmdotcom-web-components 2.15.1 → 2.16.0-rc.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/custom-elements.json +275 -9
- package/dist/dotcom-shell.js +1 -1
- package/dist/dotcom-shell.min.js +1 -1
- package/dist/ibmdotcom-web-components-dotcom-shell.js +1 -1
- package/dist/ibmdotcom-web-components-dotcom-shell.min.js +1 -1
- package/dist/{index-99142b40.js → index-6ab416ae.js} +5 -5
- package/dist/{index-03c48f1e.js → index-6f798488.js} +20 -9
- package/dist/{left-nav-menu-2e404c03.js → left-nav-menu-40ebffa9.js} +1 -1
- package/dist/{left-nav-menu-992dba4e.js → left-nav-menu-629e7752.js} +1 -1
- package/dist/{left-nav-menu-category-heading-49bdf0ea.js → left-nav-menu-category-heading-1886967e.js} +1 -1
- package/dist/{left-nav-menu-category-heading-7a46e8b6.js → left-nav-menu-category-heading-1d965e0a.js} +1 -1
- package/dist/{left-nav-menu-item-b5f3022a.js → left-nav-menu-item-03cf8244.js} +1 -1
- package/dist/{left-nav-menu-item-85504de0.js → left-nav-menu-item-a9c7113f.js} +1 -1
- package/dist/{left-nav-menu-section-16fe3a87.js → left-nav-menu-section-c39512a8.js} +1 -1
- package/dist/{left-nav-menu-section-d0d11510.js → left-nav-menu-section-e9526c5a.js} +1 -1
- package/dist/{left-nav-overlay-43be2e0f.js → left-nav-overlay-59e8851e.js} +1 -1
- package/dist/{left-nav-overlay-e8435b5c.js → left-nav-overlay-60a5eead.js} +1 -1
- package/dist/{megamenu-category-group-0f365f5a.js → megamenu-category-group-60d3805b.js} +1 -1
- package/dist/{megamenu-category-group-copy-f600eb27.js → megamenu-category-group-copy-46df540c.js} +1 -1
- package/dist/{megamenu-category-group-copy-bd0e2529.js → megamenu-category-group-copy-6ae3dfe8.js} +1 -1
- package/dist/{megamenu-category-group-ed0148e2.js → megamenu-category-group-e191e806.js} +1 -1
- package/dist/{megamenu-category-heading-9e4184d9.js → megamenu-category-heading-420838f8.js} +1 -1
- package/dist/{megamenu-category-heading-e73a6d5b.js → megamenu-category-heading-4b2d5ba1.js} +1 -1
- package/dist/{megamenu-category-link-4c1ca891.js → megamenu-category-link-e5f8c975.js} +1 -1
- package/dist/{megamenu-category-link-fc55652f.js → megamenu-category-link-ef739901.js} +1 -1
- package/dist/{megamenu-category-link-group-d22c6c1b.js → megamenu-category-link-group-90b667c2.js} +1 -1
- package/dist/{megamenu-category-link-group-ace0e779.js → megamenu-category-link-group-a85ef70e.js} +1 -1
- package/dist/{megamenu-left-navigation-eead91f9.js → megamenu-left-navigation-0a188f17.js} +1 -1
- package/dist/{megamenu-left-navigation-3b2e1168.js → megamenu-left-navigation-d3619fc8.js} +1 -1
- package/dist/{megamenu-overlay-8b3ba0fb.js → megamenu-overlay-73bf0741.js} +1 -1
- package/dist/{megamenu-overlay-08bd8a36.js → megamenu-overlay-98b82923.js} +1 -1
- package/dist/{megamenu-tab-15629cd2.js → megamenu-tab-320d3677.js} +6 -6
- package/dist/{megamenu-tab-c2aa1eac.js → megamenu-tab-63b4d4a8.js} +14 -19
- package/es/components/back-to-top/__stories__/back-to-top.stories.css.js +1 -1
- package/es/components/countdown/countdown.d.ts +406 -0
- package/es/components/countdown/countdown.js +269 -0
- package/es/components/countdown/countdown.js.map +1 -0
- package/es/components/countdown/index.d.ts +11 -0
- package/es/components/countdown/index.js +18 -0
- package/es/components/countdown/index.js.map +1 -0
- package/es/components/leadspace/leadspace.css.js +1 -1
- package/es/components/masthead/masthead-cart.js +1 -1
- package/es/components/masthead/masthead-cart.js.map +1 -1
- package/es/components/masthead/masthead-l1.js +11 -1
- package/es/components/masthead/masthead-l1.js.map +1 -1
- package/es/components/masthead/megamenu-tab.d.ts +1 -5
- package/es/components/masthead/megamenu-tab.js +10 -16
- package/es/components/masthead/megamenu-tab.js.map +1 -1
- package/es/components/promo-banner/index.d.ts +11 -0
- package/es/components/promo-banner/index.js +18 -0
- package/es/components/promo-banner/index.js.map +1 -0
- package/es/components/promo-banner/promo-banner.css.js +12 -0
- package/es/components/promo-banner/promo-banner.d.ts +385 -0
- package/es/components/promo-banner/promo-banner.js +216 -0
- package/es/components/promo-banner/promo-banner.js.map +1 -0
- package/es/components/star-rating/index.d.ts +11 -0
- package/es/components/star-rating/index.js +18 -0
- package/es/components/star-rating/index.js.map +1 -0
- package/es/components/star-rating/star-rating.css.js +12 -0
- package/es/components/star-rating/star-rating.d.ts +427 -0
- package/es/components/star-rating/star-rating.js +320 -0
- package/es/components/star-rating/star-rating.js.map +1 -0
- package/es/components/structured-list/structured-list-cell.js +1 -1
- package/es/components/structured-list/structured-list-cell.js.map +1 -1
- package/es/components/table-of-contents/table-of-contents-cdn.css.js +1 -1
- package/es/components/table-of-contents/table-of-contents.css.js +1 -1
- package/es/components/tile/index.d.ts +12 -0
- package/es/components/tile/index.js +19 -0
- package/es/components/tile/index.js.map +1 -0
- package/es/components/tile/tile-group.d.ts +21 -0
- package/es/components/tile/tile-group.js +56 -0
- package/es/components/tile/tile-group.js.map +1 -0
- package/es/components/tile/tile.css.js +12 -0
- package/es/components/tile/tile.d.ts +737 -0
- package/es/components/tile/tile.js +225 -0
- package/es/components/tile/tile.js.map +1 -0
- package/es/globals/internal/storybook-decorators.d.ts +31 -0
- package/es/globals/internal/storybook-decorators.js +43 -0
- package/es/globals/internal/storybook-decorators.js.map +1 -0
- package/es/globals/mixins/throttled-input.js +5 -4
- package/es/globals/mixins/throttled-input.js.map +1 -1
- package/es/internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings.js +2 -2
- package/lib/internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings.js +2 -2
- package/package.json +7 -6
- package/scss/components/promo-banner/promo-banner.scss +163 -0
- package/scss/components/star-rating/star-rating.scss +76 -0
- package/scss/components/tile/tile.scss +290 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import _decorate from "@babel/runtime/helpers/esm/decorate";
|
|
2
|
+
let _ = t => t,
|
|
3
|
+
_t,
|
|
4
|
+
_t2;
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
*
|
|
8
|
+
* Copyright IBM Corp. 2024
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { LitElement, html } from 'lit';
|
|
15
|
+
import { property, state, query } from 'lit/decorators.js';
|
|
16
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
17
|
+
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';
|
|
18
|
+
import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
|
|
19
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
20
|
+
import CTAMixin from "../../component-mixins/cta/cta.js";
|
|
21
|
+
import VideoCTAMixin from "../../component-mixins/cta/video.js";
|
|
22
|
+
import { CTA_TYPE } from "../cta/defs.js";
|
|
23
|
+
import styles from "././tile.css.js";
|
|
24
|
+
const {
|
|
25
|
+
stablePrefix: c4dPrefix
|
|
26
|
+
} = settings;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The Tile component.
|
|
30
|
+
*
|
|
31
|
+
* @element c4d-tile
|
|
32
|
+
*/
|
|
33
|
+
let C4DTile = _decorate([customElement(`${c4dPrefix}-tile`)], function (_initialize, _VideoCTAMixin) {
|
|
34
|
+
class C4DTile extends _VideoCTAMixin {
|
|
35
|
+
constructor(...args) {
|
|
36
|
+
super(...args);
|
|
37
|
+
_initialize(this);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
F: C4DTile,
|
|
42
|
+
d: [{
|
|
43
|
+
kind: "field",
|
|
44
|
+
decorators: [property({
|
|
45
|
+
attribute: 'label'
|
|
46
|
+
})],
|
|
47
|
+
key: "label",
|
|
48
|
+
value: void 0
|
|
49
|
+
}, {
|
|
50
|
+
kind: "field",
|
|
51
|
+
decorators: [property({
|
|
52
|
+
attribute: 'cta-type',
|
|
53
|
+
reflect: true
|
|
54
|
+
})],
|
|
55
|
+
key: "ctaType",
|
|
56
|
+
value() {
|
|
57
|
+
return CTA_TYPE['LOCAL'];
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
kind: "field",
|
|
61
|
+
decorators: [property({
|
|
62
|
+
attribute: 'href'
|
|
63
|
+
})],
|
|
64
|
+
key: "href",
|
|
65
|
+
value: void 0
|
|
66
|
+
}, {
|
|
67
|
+
kind: "field",
|
|
68
|
+
decorators: [state()],
|
|
69
|
+
key: "slottedImages",
|
|
70
|
+
value() {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
kind: "field",
|
|
75
|
+
decorators: [state()],
|
|
76
|
+
key: "slottedPictogram",
|
|
77
|
+
value() {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
kind: "field",
|
|
82
|
+
decorators: [state()],
|
|
83
|
+
key: "slotName",
|
|
84
|
+
value() {
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
kind: "field",
|
|
89
|
+
decorators: [state()],
|
|
90
|
+
key: "slotContent",
|
|
91
|
+
value() {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
kind: "field",
|
|
96
|
+
decorators: [property({
|
|
97
|
+
type: Boolean,
|
|
98
|
+
reflect: true,
|
|
99
|
+
attribute: 'align-with-content'
|
|
100
|
+
})],
|
|
101
|
+
key: "alignWithContent",
|
|
102
|
+
value() {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
kind: "field",
|
|
107
|
+
decorators: [property({
|
|
108
|
+
type: Boolean,
|
|
109
|
+
reflect: true,
|
|
110
|
+
attribute: 'double-tile'
|
|
111
|
+
})],
|
|
112
|
+
key: "doubleTile",
|
|
113
|
+
value() {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
kind: "field",
|
|
118
|
+
decorators: [property({
|
|
119
|
+
attribute: 'target',
|
|
120
|
+
reflect: true
|
|
121
|
+
})],
|
|
122
|
+
key: "target",
|
|
123
|
+
value: void 0
|
|
124
|
+
}, {
|
|
125
|
+
kind: "field",
|
|
126
|
+
decorators: [query(`.${c4dPrefix}-tile__action`)],
|
|
127
|
+
key: "_linkNode",
|
|
128
|
+
value: void 0
|
|
129
|
+
}, {
|
|
130
|
+
kind: "method",
|
|
131
|
+
key: "_handleSlotChange",
|
|
132
|
+
value:
|
|
133
|
+
/**
|
|
134
|
+
* The label text.
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
function _handleSlotChange(event) {
|
|
138
|
+
const {
|
|
139
|
+
target
|
|
140
|
+
} = event;
|
|
141
|
+
this.slotName = target.name;
|
|
142
|
+
this.slotContent = target.assignedElements();
|
|
143
|
+
if (this.slotName === 'image' && this.slotContent.length === 1) {
|
|
144
|
+
this.slottedImages = true;
|
|
145
|
+
} else if (this.slotName === 'image' && this.slotContent.length === 0) {
|
|
146
|
+
this.slottedImages = false;
|
|
147
|
+
}
|
|
148
|
+
if (this.slotName === 'pictogram' && this.slotContent.length === 1) {
|
|
149
|
+
this.slottedPictogram = true;
|
|
150
|
+
} else if (this.slotName === 'pictogram' && this.slotContent.length === 0) {
|
|
151
|
+
this.slottedPictogram = false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
kind: "method",
|
|
156
|
+
key: "render",
|
|
157
|
+
value: function render() {
|
|
158
|
+
const {
|
|
159
|
+
label,
|
|
160
|
+
href,
|
|
161
|
+
_handleSlotChange: handleSlotChange,
|
|
162
|
+
_handleClick: handleClick,
|
|
163
|
+
slottedPictogram,
|
|
164
|
+
slottedImages,
|
|
165
|
+
alignWithContent,
|
|
166
|
+
doubleTile
|
|
167
|
+
} = this;
|
|
168
|
+
const ctaClasses = classMap({
|
|
169
|
+
[`${c4dPrefix}-tile__footer-placement`]: alignWithContent,
|
|
170
|
+
[`${c4dPrefix}-tile__action`]: true
|
|
171
|
+
});
|
|
172
|
+
const imgClasses = classMap({
|
|
173
|
+
[`${c4dPrefix}-tile__image-double`]: doubleTile,
|
|
174
|
+
[`${c4dPrefix}-tile__image`]: true
|
|
175
|
+
});
|
|
176
|
+
return html(_t || (_t = _`
|
|
177
|
+
<div class="${0}-tile__outer" part="outer">
|
|
178
|
+
<div class="${0}-tile__wrapper" part="wrapper">
|
|
179
|
+
<div class="${0}" part="image" ?hidden=${0}>
|
|
180
|
+
<slot name="image" @slotchange=${0}></slot>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="${0}-tile__content" part="content">
|
|
184
|
+
<div
|
|
185
|
+
class="${0}-tile__pictogram"
|
|
186
|
+
part="pictogram"
|
|
187
|
+
?hidden=${0}>
|
|
188
|
+
<slot name="pictogram" @slotchange="${0}"></slot>
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
${0}
|
|
192
|
+
|
|
193
|
+
<div class="${0}-tile__text" part="text">
|
|
194
|
+
<slot></slot>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<a
|
|
198
|
+
href=${0}
|
|
199
|
+
@click="${0}"
|
|
200
|
+
class="${0} cds--link cds--link--lg cds--link-with-icon cds--link-with-icon__icon-right cds--link-with-icon--inline-icon"
|
|
201
|
+
part="cta">
|
|
202
|
+
<slot name="cta"></slot>
|
|
203
|
+
${0}
|
|
204
|
+
</a>
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
`), c4dPrefix, c4dPrefix, imgClasses, !slottedImages, handleSlotChange, c4dPrefix, c4dPrefix, !slottedPictogram, handleSlotChange, label ? html(_t2 || (_t2 = _`
|
|
209
|
+
<span class="${0}-tile__label" part="label"
|
|
210
|
+
>${0}</span
|
|
211
|
+
>
|
|
212
|
+
`), c4dPrefix, label) : '', c4dPrefix, ifDefined(href), handleClick, ctaClasses, this._renderIcon());
|
|
213
|
+
}
|
|
214
|
+
}, {
|
|
215
|
+
kind: "field",
|
|
216
|
+
static: true,
|
|
217
|
+
key: "styles",
|
|
218
|
+
value() {
|
|
219
|
+
return styles;
|
|
220
|
+
}
|
|
221
|
+
}]
|
|
222
|
+
};
|
|
223
|
+
}, VideoCTAMixin(CTAMixin(LitElement)));
|
|
224
|
+
export default C4DTile;
|
|
225
|
+
//# sourceMappingURL=tile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.js","names":["LitElement","html","property","state","query","classMap","carbonElement","customElement","settings","ifDefined","CTAMixin","VideoCTAMixin","CTA_TYPE","styles","stablePrefix","c4dPrefix","C4DTile","_decorate","_initialize","_VideoCTAMixin","constructor","args","F","d","kind","decorators","attribute","key","value","reflect","type","Boolean","_handleSlotChange","event","target","slotName","name","slotContent","assignedElements","length","slottedImages","slottedPictogram","render","label","href","handleSlotChange","_handleClick","handleClick","alignWithContent","doubleTile","ctaClasses","imgClasses","_t","_","_t2","_renderIcon","static"],"sources":["components/tile/tile.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport CTAMixin from '../../component-mixins/cta/cta';\nimport VideoCTAMixin from '../../component-mixins/cta/video';\nimport { CTA_TYPE } from '../cta/defs';\n\nimport styles from './tile.scss';\n\nconst { stablePrefix: c4dPrefix } = settings;\n\n/**\n * The Tile component.\n *\n * @element c4d-tile\n */\n@customElement(`${c4dPrefix}-tile`)\nclass C4DTile extends VideoCTAMixin(CTAMixin(LitElement)) {\n /**\n * The label text.\n */\n @property({ attribute: 'label' })\n label?: string;\n\n @property({ attribute: 'cta-type', reflect: true })\n ctaType = CTA_TYPE['LOCAL'];\n\n @property({ attribute: 'href' })\n href?: string;\n\n @state()\n slottedImages = false;\n\n @state()\n slottedPictogram = false;\n\n @state()\n slotName = '';\n\n @state()\n slotContent: Element[] = [];\n\n @property({ type: Boolean, reflect: true, attribute: 'align-with-content' })\n alignWithContent = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'double-tile' })\n doubleTile = false;\n\n @property({ attribute: 'target', reflect: true })\n target?: string | undefined;\n\n @query(`.${c4dPrefix}-tile__action`)\n _linkNode!: HTMLAnchorElement;\n\n _handleSlotChange(event: Event) {\n const { target } = event;\n this.slotName = (target as HTMLSlotElement).name;\n this.slotContent = (target as HTMLSlotElement).assignedElements();\n\n if (this.slotName === 'image' && this.slotContent.length === 1) {\n this.slottedImages = true;\n } else if (this.slotName === 'image' && this.slotContent.length === 0) {\n this.slottedImages = false;\n }\n\n if (this.slotName === 'pictogram' && this.slotContent.length === 1) {\n this.slottedPictogram = true;\n } else if (this.slotName === 'pictogram' && this.slotContent.length === 0) {\n this.slottedPictogram = false;\n }\n }\n\n render() {\n const {\n label,\n href,\n _handleSlotChange: handleSlotChange,\n _handleClick: handleClick,\n slottedPictogram,\n slottedImages,\n alignWithContent,\n doubleTile,\n } = this;\n\n const ctaClasses = classMap({\n [`${c4dPrefix}-tile__footer-placement`]: alignWithContent,\n [`${c4dPrefix}-tile__action`]: true,\n });\n\n const imgClasses = classMap({\n [`${c4dPrefix}-tile__image-double`]: doubleTile,\n [`${c4dPrefix}-tile__image`]: true,\n });\n\n return html`\n <div class=\"${c4dPrefix}-tile__outer\" part=\"outer\">\n <div class=\"${c4dPrefix}-tile__wrapper\" part=\"wrapper\">\n <div class=\"${imgClasses}\" part=\"image\" ?hidden=${!slottedImages}>\n <slot name=\"image\" @slotchange=${handleSlotChange}></slot>\n </div>\n\n <div class=\"${c4dPrefix}-tile__content\" part=\"content\">\n <div\n class=\"${c4dPrefix}-tile__pictogram\"\n part=\"pictogram\"\n ?hidden=${!slottedPictogram}>\n <slot name=\"pictogram\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n\n ${label\n ? html`\n <span class=\"${c4dPrefix}-tile__label\" part=\"label\"\n >${label}</span\n >\n `\n : ''}\n\n <div class=\"${c4dPrefix}-tile__text\" part=\"text\">\n <slot></slot>\n </div>\n\n <a\n href=${ifDefined(href)}\n @click=\"${handleClick}\"\n class=\"${ctaClasses} cds--link cds--link--lg cds--link-with-icon cds--link-with-icon__icon-right cds--link-with-icon--inline-icon\"\n part=\"cta\">\n <slot name=\"cta\"></slot>\n ${this._renderIcon()}\n </a>\n </div>\n </div>\n </div>\n `;\n }\n static styles = styles;\n}\n\nexport default C4DTile;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,QAAQ,mBAAmB;AAC1D,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAC/G,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,SAASC,SAAS,QAAQ,8BAA8B;AACxD,OAAOC,QAAQ,MAAM,mCAAgC;AACrD,OAAOC,aAAa,MAAM,qCAAkC;AAC5D,SAASC,QAAQ,QAAQ,gBAAa;AAEtC,OAAOC,MAAM,MAAM,iBAAa;AAEhC,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGP,QAAQ;;AAE5C;AACA;AACA;AACA;AACA;AAJA,IAMMQ,OAAO,GAAAC,SAAA,EADZV,aAAa,CAAC,GAAGQ,SAAS,OAAO,CAAC,aAAAG,WAAA,EAAAC,cAAA;EAAnC,MACMH,OAAO,SAAAG,cAAA,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AI,CAAC,EACZG,WAAW,EACZG,UAAU,EAGjB,IAAI,CAACK,WAAW,CAAC,CAAC;MAMhC;IAAC;MAAA/B,IAAA;MAAAgC,MAAA;MAAA7B,GAAA;MAAAC,MAAA;QAAA,OACef,MAAM;MAAA;IAAA;EAAA;AAAA,GArHFF,aAAa,CAACD,QAAQ,CAACV,UAAU,CAAC,CAAC;AAwHzD,eAAegB,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2024
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Wraps provided Storybook story in Carbon grid with no columns.
|
|
11
|
+
*
|
|
12
|
+
* @param story Storybook story
|
|
13
|
+
* @returns {TemplateResult}
|
|
14
|
+
*/
|
|
15
|
+
export declare const gridNoCol: (story: any) => import("lit-html").TemplateResult<1>;
|
|
16
|
+
/**
|
|
17
|
+
* Wraps provided Storybook story in Carbon grid with a single full-width column.
|
|
18
|
+
*
|
|
19
|
+
* @param story Storybook story
|
|
20
|
+
* @returns {TemplateResult}
|
|
21
|
+
*/
|
|
22
|
+
export declare const grid16Col: (story: any) => import("lit-html").TemplateResult<1>;
|
|
23
|
+
/**
|
|
24
|
+
* Wraps provided Storybook story in Carbon grid with a half-width, centered column.
|
|
25
|
+
*
|
|
26
|
+
* @param story Storybook story
|
|
27
|
+
* @returns {TemplateResult}
|
|
28
|
+
*/
|
|
29
|
+
export declare const grid8ColCentered: (story: any) => import("lit-html").TemplateResult<1>;
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=storybook-decorators.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
let _ = t => t,
|
|
2
|
+
_t,
|
|
3
|
+
_t2,
|
|
4
|
+
_t3;
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
*
|
|
8
|
+
* Copyright IBM Corp. 2024
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { html } from 'lit';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Wraps provided Storybook story in Carbon grid with no columns.
|
|
18
|
+
*
|
|
19
|
+
* @param story Storybook story
|
|
20
|
+
* @returns {TemplateResult}
|
|
21
|
+
*/
|
|
22
|
+
export const gridNoCol = story => html(_t || (_t = _`
|
|
23
|
+
<div class="cds--grid c4d-story-padding">
|
|
24
|
+
<div class="cds--row">${0}</div>
|
|
25
|
+
</div>
|
|
26
|
+
`), story instanceof Function ? story() : story);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Wraps provided Storybook story in Carbon grid with a single full-width column.
|
|
30
|
+
*
|
|
31
|
+
* @param story Storybook story
|
|
32
|
+
* @returns {TemplateResult}
|
|
33
|
+
*/
|
|
34
|
+
export const grid16Col = story => gridNoCol(html(_t2 || (_t2 = _` <div class="cds--col-lg-16">${0}</div> `), story()));
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Wraps provided Storybook story in Carbon grid with a half-width, centered column.
|
|
38
|
+
*
|
|
39
|
+
* @param story Storybook story
|
|
40
|
+
* @returns {TemplateResult}
|
|
41
|
+
*/
|
|
42
|
+
export const grid8ColCentered = story => gridNoCol(html(_t3 || (_t3 = _` <div class="cds--offset-lg-4 cds--col-lg-8">${0}</div> `), story()));
|
|
43
|
+
//# sourceMappingURL=storybook-decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storybook-decorators.js","names":["html","gridNoCol","story","_t","_","Function","grid16Col","_t2","grid8ColCentered","_t3"],"sources":["globals/internal/storybook-decorators.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html } from 'lit';\n\n/**\n * Wraps provided Storybook story in Carbon grid with no columns.\n *\n * @param story Storybook story\n * @returns {TemplateResult}\n */\nexport const gridNoCol = (story) => html`\n <div class=\"cds--grid c4d-story-padding\">\n <div class=\"cds--row\">${story instanceof Function ? story() : story}</div>\n </div>\n`;\n\n/**\n * Wraps provided Storybook story in Carbon grid with a single full-width column.\n *\n * @param story Storybook story\n * @returns {TemplateResult}\n */\nexport const grid16Col = (story) =>\n gridNoCol(html` <div class=\"cds--col-lg-16\">${story()}</div> `);\n\n/**\n * Wraps provided Storybook story in Carbon grid with a half-width, centered column.\n *\n * @param story Storybook story\n * @returns {TemplateResult}\n */\nexport const grid8ColCentered = (story) =>\n gridNoCol(\n html` <div class=\"cds--offset-lg-4 cds--col-lg-8\">${story()}</div> `\n );\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,KAAK;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GAAIC,KAAK,IAAKF,IAAI,CAAAG,EAAA,KAAAA,EAAA,GAAAC,CAAA;AACxC;AACA,4BAFwC;AACxC;AACA,CAFwC,GAEZF,KAAK,YAAYG,QAAQ,GAAGH,KAAK,CAAC,CAAC,GAAGA,KAAK,CAEtE;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,SAAS,GAAIJ,KAAK,IAC7BD,SAAS,CAACD,IAAI,CAAAO,GAAA,KAAAA,GAAA,GAAAH,CAAA,6CAAgCF,KAAK,CAAC,CAAC,CAAS,CAAC;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,gBAAgB,GAAIN,KAAK,IACpCD,SAAS,CACPD,IAAI,CAAAS,GAAA,KAAAA,GAAA,GAAAL,CAAA,6DAAgDF,KAAK,CAAC,CAAC,CAC7D,CAAC","ignoreList":[]}
|
|
@@ -30,10 +30,6 @@ const ThrottledInputMixin = Base => {
|
|
|
30
30
|
* @private
|
|
31
31
|
*/
|
|
32
32
|
_defineProperty(this, "_throttledHandleInput", null);
|
|
33
|
-
/**
|
|
34
|
-
* The throttle timeout to run query upon user input.
|
|
35
|
-
*/
|
|
36
|
-
_defineProperty(this, "inputTimeout", 200);
|
|
37
33
|
}
|
|
38
34
|
/**
|
|
39
35
|
* Handles the throttled `input` event.
|
|
@@ -64,6 +60,11 @@ const ThrottledInputMixin = Base => {
|
|
|
64
60
|
}
|
|
65
61
|
this._throttledHandleInput = throttle(this._handleThrottledInput, this.inputTimeout);
|
|
66
62
|
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The throttle timeout to run query upon user input.
|
|
66
|
+
*/
|
|
67
|
+
|
|
67
68
|
connectedCallback() {
|
|
68
69
|
// TS seems to miss `HTMLElement.prototype.connectedCallback()` definition
|
|
69
70
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"throttled-input.js","names":["throttle","on","ThrottledInputMixin","Base","ThrottledInputMixinImpl","constructor","args","_defineProperty","_invokeHandleThrottledInput","event","_this$_throttledHandl","_throttledHandleInput","call","_updateThrottledHandleInput","cancel","_handleThrottledInput","inputTimeout","connectedCallback","eventInput","_hInputToBeThrottled","disconnectedCallback","release","updated","changedProperties","has"],"sources":["globals/mixins/throttled-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport throttle from 'lodash-es/throttle';\nimport on from '@carbon/web-components/es/globals/mixins/on.js';\nimport Handle from '../internal/handle';\n\nimport { Constructor } from '../defs';\n\n/**\n * @param Base The base class.\n * @returns A mix-in that handles `input` event and makes throtted calls to `_handleThrottledInput`.\n */\nconst ThrottledInputMixin = <T extends Constructor<HTMLElement>>(Base: T) => {\n abstract class ThrottledInputMixinImpl extends Base {\n /**\n * Handles the throttled `input` event.\n *\n * @param event The event.\n * @protected\n */\n abstract _handleThrottledInput(event: InputEvent): void;\n\n /**\n * The handle for the listener of `input` event.\n *\n * @private\n */\n _hInputToBeThrottled: Handle | null = null;\n\n /**\n * The throttled listener of `input` event.\n *\n * @private\n */\n _throttledHandleInput:\n | (((event: InputEvent) => void) & { cancel(): void })\n | null = null;\n\n /**\n * Handles `input` event on the search box.\n *\n * @param event The event.\n * @private\n */\n _invokeHandleThrottledInput(event: InputEvent) {\n this._throttledHandleInput?.(event);\n }\n\n /**\n * Updates the throttled listener of `input` event upon change in `inputTimeout`.\n *\n * @private\n */\n _updateThrottledHandleInput() {\n if (this._throttledHandleInput) {\n this._throttledHandleInput.cancel();\n this._throttledHandleInput = null;\n }\n this._throttledHandleInput = throttle(\n this._handleThrottledInput,\n this.inputTimeout\n );\n }\n\n /**\n * The throttle timeout to run query upon user input.\n */\n inputTimeout
|
|
1
|
+
{"version":3,"file":"throttled-input.js","names":["throttle","on","ThrottledInputMixin","Base","ThrottledInputMixinImpl","constructor","args","_defineProperty","_invokeHandleThrottledInput","event","_this$_throttledHandl","_throttledHandleInput","call","_updateThrottledHandleInput","cancel","_handleThrottledInput","inputTimeout","connectedCallback","eventInput","_hInputToBeThrottled","disconnectedCallback","release","updated","changedProperties","has"],"sources":["globals/mixins/throttled-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport throttle from 'lodash-es/throttle';\nimport on from '@carbon/web-components/es/globals/mixins/on.js';\nimport Handle from '../internal/handle';\n\nimport { Constructor } from '../defs';\n\n/**\n * @param Base The base class.\n * @returns A mix-in that handles `input` event and makes throtted calls to `_handleThrottledInput`.\n */\nconst ThrottledInputMixin = <T extends Constructor<HTMLElement>>(Base: T) => {\n abstract class ThrottledInputMixinImpl extends Base {\n /**\n * Handles the throttled `input` event.\n *\n * @param event The event.\n * @protected\n */\n abstract _handleThrottledInput(event: InputEvent): void;\n\n /**\n * The handle for the listener of `input` event.\n *\n * @private\n */\n _hInputToBeThrottled: Handle | null = null;\n\n /**\n * The throttled listener of `input` event.\n *\n * @private\n */\n _throttledHandleInput:\n | (((event: InputEvent) => void) & { cancel(): void })\n | null = null;\n\n /**\n * Handles `input` event on the search box.\n *\n * @param event The event.\n * @private\n */\n _invokeHandleThrottledInput(event: InputEvent) {\n this._throttledHandleInput?.(event);\n }\n\n /**\n * Updates the throttled listener of `input` event upon change in `inputTimeout`.\n *\n * @private\n */\n _updateThrottledHandleInput() {\n if (this._throttledHandleInput) {\n this._throttledHandleInput.cancel();\n this._throttledHandleInput = null;\n }\n this._throttledHandleInput = throttle(\n this._handleThrottledInput,\n this.inputTimeout\n );\n }\n\n /**\n * The throttle timeout to run query upon user input.\n */\n abstract inputTimeout: number;\n\n connectedCallback() {\n // TS seems to miss `HTMLElement.prototype.connectedCallback()` definition\n // @ts-ignore\n super.connectedCallback();\n const { eventInput } = this.constructor as typeof ThrottledInputMixinImpl;\n this._hInputToBeThrottled = on(\n this,\n eventInput,\n this._invokeHandleThrottledInput as EventListener\n );\n this._updateThrottledHandleInput();\n }\n\n disconnectedCallback() {\n if (this._throttledHandleInput) {\n this._throttledHandleInput.cancel();\n this._throttledHandleInput = null;\n }\n if (this._hInputToBeThrottled) {\n this._hInputToBeThrottled = this._hInputToBeThrottled.release();\n }\n // TS seems to miss `HTMLElement.prototype.disconnectedCallback()` definition\n // @ts-ignore\n super.disconnectedCallback();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('inputTimeout')) {\n this._updateThrottledHandleInput();\n }\n }\n\n /**\n * The event that represents the user input gesture.\n */\n static eventInput = 'input';\n }\n return ThrottledInputMixinImpl;\n};\n\nexport default ThrottledInputMixin;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM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AM,CAAC,CAAC;QACnC,IAAI,CAACH,qBAAqB,GAAG,IAAI;MACnC;MACA,IAAI,IAAI,CAACQ,oBAAoB,EAAE;QAC7B,IAAI,CAACA,oBAAoB,GAAG,IAAI,CAACA,oBAAoB,CAACE,OAAO,CAAC,CAAC;MACjE;MACA;MACA;MACA,KAAK,CAACD,oBAAoB,CAAC,CAAC;IAC9B;IAEAE,OAAOA,CAACC,iBAAiB,EAAE;MACzB,IAAIA,iBAAiB,CAACC,GAAG,CAAC,cAAc,CAAC,EAAE;QACzC,IAAI,CAACX,2BAA2B,CAAC,CAAC;MACpC;IACF;;IAEA;AACJ;AACA;EAEE;EAACN,eAAA,CA5FcH,uBAAuB,gBA2FhB,OAAO;EAE7B,OAAOA,uBAAuB;AAChC,CAAC;AAED,eAAeF,mBAAmB","ignoreList":[]}
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* @type {object} Settings object
|
|
13
13
|
* @property {string} [stablePrefix=c4d] stable prefix
|
|
14
14
|
* @property {string} [prefix=cds] core Carbon prefix
|
|
15
|
-
* Carbon for IBM.com v2.
|
|
15
|
+
* Carbon for IBM.com v2.16.0',
|
|
16
16
|
*/
|
|
17
17
|
var settings = {
|
|
18
|
-
version: 'Carbon for IBM.com v2.
|
|
18
|
+
version: 'Carbon for IBM.com v2.16.0',
|
|
19
19
|
stablePrefix: 'c4d',
|
|
20
20
|
prefix: 'cds'
|
|
21
21
|
};
|
|
@@ -18,10 +18,10 @@ exports.default = void 0;
|
|
|
18
18
|
* @type {object} Settings object
|
|
19
19
|
* @property {string} [stablePrefix=c4d] stable prefix
|
|
20
20
|
* @property {string} [prefix=cds] core Carbon prefix
|
|
21
|
-
* Carbon for IBM.com v2.
|
|
21
|
+
* Carbon for IBM.com v2.16.0',
|
|
22
22
|
*/
|
|
23
23
|
var settings = {
|
|
24
|
-
version: 'Carbon for IBM.com v2.
|
|
24
|
+
version: 'Carbon for IBM.com v2.16.0',
|
|
25
25
|
stablePrefix: 'c4d',
|
|
26
26
|
prefix: 'cds'
|
|
27
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/ibmdotcom-web-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0-rc.0",
|
|
4
4
|
"description": "Carbon for IBM.com Web Components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"exports": {
|
|
@@ -88,12 +88,13 @@
|
|
|
88
88
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
89
89
|
"upgrade-carbon": "yarn upgrade-interactive @carbon/web-components @carbon/icon-helpers @carbon/icons --latest --exact",
|
|
90
90
|
"visual-snapshot": "yarn percy storybook:start ./storybook-static",
|
|
91
|
-
"wca": "web-component-analyzer analyze src --outFile custom-elements.json"
|
|
91
|
+
"wca": "web-component-analyzer analyze src --outFile custom-elements.json",
|
|
92
|
+
"cypress:verify": "cypress verify"
|
|
92
93
|
},
|
|
93
94
|
"dependencies": {
|
|
94
|
-
"@carbon/ibmdotcom-services": "2.
|
|
95
|
-
"@carbon/ibmdotcom-styles": "2.
|
|
96
|
-
"@carbon/ibmdotcom-utilities": "2.
|
|
95
|
+
"@carbon/ibmdotcom-services": "2.16.0-rc.0",
|
|
96
|
+
"@carbon/ibmdotcom-styles": "2.16.0-rc.0",
|
|
97
|
+
"@carbon/ibmdotcom-utilities": "2.16.0-rc.0",
|
|
97
98
|
"@carbon/layout": "11.27.0",
|
|
98
99
|
"@carbon/motion": "11.22.0",
|
|
99
100
|
"@carbon/styles": "1.65.0",
|
|
@@ -242,5 +243,5 @@
|
|
|
242
243
|
"web-component-analyzer": "1.2.0-next.0",
|
|
243
244
|
"webpack": "^4.46.0"
|
|
244
245
|
},
|
|
245
|
-
"gitHead": "
|
|
246
|
+
"gitHead": "850b531f80c907c8818579e78dbf318ba2769b64"
|
|
246
247
|
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2024
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@use '@carbon/ibmdotcom-styles/scss/globals/vars' as *;
|
|
11
|
+
@use '@carbon/styles/scss/utilities';
|
|
12
|
+
@use '@carbon/styles/scss/spacing' as *;
|
|
13
|
+
@use '@carbon/styles/scss/theme' as *;
|
|
14
|
+
@use '@carbon/styles/scss/type' as *;
|
|
15
|
+
@use '@carbon/grid' as *;
|
|
16
|
+
@use '@carbon/ibmdotcom-styles/scss/globals/utils/flex-grid' as *;
|
|
17
|
+
|
|
18
|
+
$css--plex: true !default;
|
|
19
|
+
$half-gutter: $grid-gutter / 2;
|
|
20
|
+
|
|
21
|
+
$md-breakpoint-width: map-get(map-get($grid-breakpoints, md), width);
|
|
22
|
+
$lg-breakpoint-width: map-get(map-get($grid-breakpoints, lg), width);
|
|
23
|
+
$xlg-breakpoint-width: map-get(map-get($grid-breakpoints, xlg), width);
|
|
24
|
+
$max-breakpoint-width: map-get(map-get($grid-breakpoints, max), width);
|
|
25
|
+
|
|
26
|
+
// TODO: Move these calculations to a single importable file.
|
|
27
|
+
//
|
|
28
|
+
// We need lower and upper bounds for a container occupying 12 / 16 columns at
|
|
29
|
+
// the lg and xlg breakpoints. For the lower bound we take the breakpoint
|
|
30
|
+
// size, less the 2rem of outer padding, multiplied by 12 / 16, less 2rem of
|
|
31
|
+
// column padding. For the upper bound we take the next breakpoint size and
|
|
32
|
+
// do a similar calculation with a slight tweak of subtracting 0.02 from the
|
|
33
|
+
// breakpoint size as a starting point, similar to how the
|
|
34
|
+
// breakpoint-between mixin works. Note that this approach my not work
|
|
35
|
+
// cleanly for the narrow or condensed grid due to the necessary assumptions
|
|
36
|
+
// made for padding widths.
|
|
37
|
+
$lg-12-column-lower-bound: ($lg-breakpoint-width * (12 / 16)) - 2rem;
|
|
38
|
+
$lg-12-column-upper-bound: ($xlg-breakpoint-width - 0.02) * (12 / 16);
|
|
39
|
+
$xlg-12-column-lower-bound: $xlg-breakpoint-width * (12 / 16);
|
|
40
|
+
$xlg-12-column-upper-bound: ($max-breakpoint-width - 0.02) * (12 / 16);
|
|
41
|
+
|
|
42
|
+
:host(#{$c4d-prefix}-promo-banner) {
|
|
43
|
+
display: block;
|
|
44
|
+
/* stylelint-disable-next-line property-no-unknown */
|
|
45
|
+
container: promo-banner / inline-size;
|
|
46
|
+
|
|
47
|
+
[hidden] {
|
|
48
|
+
/* stylelint-disable-next-line declaration-no-important */
|
|
49
|
+
display: none !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.banner-wrapper {
|
|
53
|
+
position: relative;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-wrap: nowrap;
|
|
56
|
+
align-items: flex-start;
|
|
57
|
+
background-color: $layer;
|
|
58
|
+
color: $text-primary;
|
|
59
|
+
|
|
60
|
+
@include breakpoint-down(lg) {
|
|
61
|
+
&:not(.no-cta) {
|
|
62
|
+
/* stylelint-disable-next-line c4d/require-color-with-bg */
|
|
63
|
+
&:hover {
|
|
64
|
+
background-color: $layer-hover;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:focus-within {
|
|
68
|
+
outline: $spacing-01 solid $focus;
|
|
69
|
+
outline-offset: calc(-1 * #{$spacing-01});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.banner-image {
|
|
76
|
+
position: relative;
|
|
77
|
+
align-self: stretch;
|
|
78
|
+
|
|
79
|
+
@include make-col(4, 16);
|
|
80
|
+
@include breakpoint(lg) {
|
|
81
|
+
/* stylelint-disable-next-line scss/at-rule-no-unknown */
|
|
82
|
+
@container promo-banner (inline-size <= #{$lg-12-column-upper-bound}) {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@include breakpoint(xlg) {
|
|
88
|
+
/* stylelint-disable-next-line scss/at-rule-no-unknown */
|
|
89
|
+
@container promo-banner (inline-size <= #{$xlg-12-column-upper-bound}) {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
::slotted([slot='image']) {
|
|
96
|
+
/* stylelint-disable-next-line property-no-unknown */
|
|
97
|
+
position: absolute;
|
|
98
|
+
aspect-ratio: auto;
|
|
99
|
+
block-size: 100%;
|
|
100
|
+
inline-size: 100%;
|
|
101
|
+
padding-block: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.banner-content {
|
|
105
|
+
flex-grow: 1;
|
|
106
|
+
padding-block: $spacing-05;
|
|
107
|
+
padding-inline: $half-gutter;
|
|
108
|
+
|
|
109
|
+
@include breakpoint(md) {
|
|
110
|
+
padding-block: $spacing-07;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.banner-cta {
|
|
115
|
+
padding-block: $spacing-05;
|
|
116
|
+
padding-inline: $half-gutter;
|
|
117
|
+
text-align: end;
|
|
118
|
+
|
|
119
|
+
@include make-col(1, 4);
|
|
120
|
+
|
|
121
|
+
@include breakpoint-down(lg) {
|
|
122
|
+
&:focus {
|
|
123
|
+
outline: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&::after {
|
|
127
|
+
position: absolute;
|
|
128
|
+
display: block;
|
|
129
|
+
content: '';
|
|
130
|
+
inset: 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@include breakpoint(md) {
|
|
135
|
+
@include make-col(1, 8);
|
|
136
|
+
|
|
137
|
+
padding-block: $spacing-07;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@include breakpoint(lg) {
|
|
141
|
+
text-align: start;
|
|
142
|
+
|
|
143
|
+
@include make-col(4, 16);
|
|
144
|
+
@include make-col-offset(2, 16);
|
|
145
|
+
|
|
146
|
+
/* stylelint-disable-next-line scss/at-rule-no-unknown */
|
|
147
|
+
@container promo-banner (inline-size <= #{$lg-12-column-upper-bound}) {
|
|
148
|
+
@include make-col(4, 12);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@include breakpoint(xlg) {
|
|
153
|
+
/* stylelint-disable-next-line scss/at-rule-no-unknown */
|
|
154
|
+
@container promo-banner (inline-size <= #{$xlg-12-column-upper-bound}) {
|
|
155
|
+
@include make-col(4, 12);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
::slotted([slot='cta']) {
|
|
161
|
+
inline-size: 100%;
|
|
162
|
+
}
|
|
163
|
+
}
|