@carbon/ibmdotcom-web-components 2.22.0 → 2.23.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.
Files changed (69) hide show
  1. package/custom-elements.json +24 -0
  2. package/dist/dotcom-shell.js +2 -2
  3. package/dist/dotcom-shell.min.js +1 -1
  4. package/dist/ibmdotcom-web-components-dotcom-shell.js +2 -2
  5. package/dist/ibmdotcom-web-components-dotcom-shell.min.js +1 -1
  6. package/dist/{index-d1d84c2f.js → index-4a2b99e5.js} +8 -8
  7. package/dist/{index-fe85c5e6.js → index-90537714.js} +5 -5
  8. package/dist/{left-nav-menu-497c9169.js → left-nav-menu-a22a1a6e.js} +2 -2
  9. package/dist/{left-nav-menu-category-heading-8ccb4ce7.js → left-nav-menu-category-heading-3016e990.js} +1 -1
  10. package/dist/{left-nav-menu-category-heading-14bacdd1.js → left-nav-menu-category-heading-cb17a84f.js} +2 -2
  11. package/dist/{left-nav-menu-cd889d8d.js → left-nav-menu-ccf3a6ec.js} +1 -1
  12. package/dist/{left-nav-menu-item-803e8924.js → left-nav-menu-item-18d051bc.js} +1 -1
  13. package/dist/{left-nav-menu-item-2a3c9eb0.js → left-nav-menu-item-85006ef1.js} +2 -2
  14. package/dist/{left-nav-menu-section-462064ef.js → left-nav-menu-section-027d6043.js} +1 -1
  15. package/dist/{left-nav-menu-section-024ec574.js → left-nav-menu-section-cee5e8b9.js} +2 -2
  16. package/dist/{left-nav-overlay-9ec9772c.js → left-nav-overlay-225f893f.js} +1 -1
  17. package/dist/{left-nav-overlay-38b81f2f.js → left-nav-overlay-e559d687.js} +2 -2
  18. package/dist/{megamenu-category-group-f874016c.js → megamenu-category-group-75dd0587.js} +1 -1
  19. package/dist/{megamenu-category-group-4229cc92.js → megamenu-category-group-89eb9dd2.js} +2 -2
  20. package/dist/{megamenu-category-group-copy-18d5977c.js → megamenu-category-group-copy-533d77ca.js} +1 -1
  21. package/dist/{megamenu-category-group-copy-7525e13d.js → megamenu-category-group-copy-94e321c8.js} +2 -2
  22. package/dist/{megamenu-category-heading-05c91ceb.js → megamenu-category-heading-370cb6dc.js} +1 -1
  23. package/dist/{megamenu-category-heading-6c437eed.js → megamenu-category-heading-5c562696.js} +2 -2
  24. package/dist/{megamenu-category-link-09ed50a1.js → megamenu-category-link-6060a359.js} +5 -5
  25. package/dist/{megamenu-category-link-8d5476f0.js → megamenu-category-link-66573e4b.js} +2 -2
  26. package/dist/{megamenu-category-link-group-fc4af18d.js → megamenu-category-link-group-4f9fcb1a.js} +1 -1
  27. package/dist/{megamenu-category-link-group-a1418c5c.js → megamenu-category-link-group-83d39e8b.js} +2 -2
  28. package/dist/{megamenu-left-navigation-f972fc38.js → megamenu-left-navigation-35cca50a.js} +1 -1
  29. package/dist/{megamenu-left-navigation-cb55e7c7.js → megamenu-left-navigation-ab38535c.js} +2 -2
  30. package/dist/{megamenu-overlay-720be39f.js → megamenu-overlay-977e9e98.js} +1 -1
  31. package/dist/{megamenu-overlay-6e2c8d97.js → megamenu-overlay-9b73f118.js} +2 -2
  32. package/dist/{megamenu-tab-de78d556.js → megamenu-tab-69382393.js} +1 -1
  33. package/dist/{megamenu-tab-d96128cd.js → megamenu-tab-e4488ebd.js} +2 -2
  34. package/es/components/callout-quote/callout-quote.css.js +1 -1
  35. package/es/components/card-group/card-group.css.js +1 -1
  36. package/es/components/card-group/card-group.d.ts +1 -1
  37. package/es/components/card-group/card-group.js +6 -1
  38. package/es/components/card-group/card-group.js.map +1 -1
  39. package/es/components/content-block/content-block.css.js +1 -1
  40. package/es/components/content-item/content-item.d.ts +6 -2
  41. package/es/components/content-item/content-item.js +16 -1
  42. package/es/components/content-item/content-item.js.map +1 -1
  43. package/es/components/cta-block/cta-block-item-row.d.ts +3 -1
  44. package/es/components/cta-block/cta-block-item-row.js +38 -6
  45. package/es/components/cta-block/cta-block-item-row.js.map +1 -1
  46. package/es/components/cta-block/cta-block-item.d.ts +2 -2
  47. package/es/components/cta-block/cta-block-item.js +5 -1
  48. package/es/components/cta-block/cta-block-item.js.map +1 -1
  49. package/es/components/cta-block/cta-block.css.js +1 -1
  50. package/es/components/dotcom-shell/dotcom-shell.css.js +1 -1
  51. package/es/components/masthead/masthead-l1.css.js +1 -1
  52. package/es/components/masthead/masthead.css.js +1 -1
  53. package/es/components/pricing-table/pricing-table.css.js +1 -1
  54. package/es/components/quote/defs.d.ts +6 -2
  55. package/es/components/quote/defs.js +2 -1
  56. package/es/components/quote/defs.js.map +1 -1
  57. package/es/components/quote/quote.css.js +1 -1
  58. package/es/components/quote/quote.d.ts +4 -1
  59. package/es/components/quote/quote.js +45 -6
  60. package/es/components/quote/quote.js.map +1 -1
  61. package/es/components/structured-list/structured-list.css.js +1 -1
  62. package/es/components-react/quote/quote.d.ts +3 -0
  63. package/es/internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings.js +2 -2
  64. package/lib/components/quote/defs.js +2 -1
  65. package/lib/components/quote/defs.js.map +1 -1
  66. package/lib/internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings.js +2 -2
  67. package/package.json +5 -5
  68. package/scss/components/cta-block/cta-block.scss +37 -2
  69. package/scss/components/masthead/masthead-l1.scss +3 -2
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2020, 2024
4
+ * Copyright IBM Corp. 2020, 2025
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -369,7 +369,11 @@ declare class C4DContentItem extends C4DContentItem_base {
369
369
  /**
370
370
  * `true` if there are CTA media in the content item area.
371
371
  */
372
- protected _hasMedia: boolean;
372
+ _hasMedia: boolean;
373
+ /**
374
+ * `true` if there is a pictogram in the content
375
+ */
376
+ _hasPictogram: boolean;
373
377
  /**
374
378
  * `true` if there are CTA statistic in the content item area.
375
379
  */
@@ -8,7 +8,7 @@ let _ = t => t,
8
8
  /**
9
9
  * @license
10
10
  *
11
- * Copyright IBM Corp. 2020, 2024
11
+ * Copyright IBM Corp. 2020, 2025
12
12
  *
13
13
  * This source code is licensed under the Apache-2.0 license found in the
14
14
  * LICENSE file in the root directory of this source tree.
@@ -71,6 +71,13 @@ let C4DContentItem = _decorate([customElement(`${c4dPrefix}-content-item`)], fun
71
71
  value() {
72
72
  return false;
73
73
  }
74
+ }, {
75
+ kind: "field",
76
+ decorators: [state()],
77
+ key: "_hasPictogram",
78
+ value() {
79
+ return false;
80
+ }
74
81
  }, {
75
82
  kind: "field",
76
83
  decorators: [state()],
@@ -106,6 +113,10 @@ let C4DContentItem = _decorate([customElement(`${c4dPrefix}-content-item`)], fun
106
113
  * `true` if there are CTA media in the content item area.
107
114
  */
108
115
 
116
+ /**
117
+ * `true` if there is a pictogram in the content
118
+ */
119
+
109
120
  /**
110
121
  * `true` if there are CTA statistic in the content item area.
111
122
  */
@@ -134,6 +145,10 @@ let C4DContentItem = _decorate([customElement(`${c4dPrefix}-content-item`)], fun
134
145
  } else {
135
146
  this._hasLogo = false;
136
147
  }
148
+ if (target.getAttribute('name') == 'media') {
149
+ const hasPictogram = target.assignedNodes().some(node => node.tagName.toLowerCase() == 'svg');
150
+ this._hasPictogram = hasPictogram;
151
+ }
137
152
  }
138
153
 
139
154
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"content-item.js","names":["html","LitElement","classMap","property","state","settings","StableSelectorMixin","styles","carbonElement","customElement","prefix","stablePrefix","c4dPrefix","slotExistencePropertyNames","media","statistic","footer","C4DContentItem","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","decorators","key","value","type","Boolean","_handleSlotChange","target","_assignedNodes$","_assignedNodes$$match","name","hasContent","assignedNodes","some","node","nodeType","Node","TEXT_NODE","textContent","trim","matches","call","selectorImageLogo","_hasLogo","_renderStatistic","_hasStatistic","hasStatistic","handleSlotChange","_t","_","_renderMedia","_hasMedia","hasMedia","_t2","_renderBody","_t3","_renderFooter","_hasFooter","hasFooter","_t4","updated","_this$querySelector","querySelector","setAttribute","_this$querySelector2","removeAttribute","render","horizontal","hasLogo","horizontalClass","_t5","static"],"sources":["components/content-item/content-item.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 { html, LitElement, TemplateResult } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { property, state } from 'lit/decorators.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport styles from './content-item.scss';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { prefix, stablePrefix: c4dPrefix } = settings;\n\n/**\n * The table mapping slot name with the private property name that indicates the existence of the slot content.\n */\nconst slotExistencePropertyNames = {\n media: '_hasMedia',\n statistic: '_hasStatistic',\n footer: '_hasFooter',\n};\n\n/**\n * Content item.\n *\n * @element c4d-content-item\n * @slot media - The media content.\n * @slot heading - The heading content.\n * @slot footer - The footer (CTA) content.\n * @csspart statistics - The element. Usage: `c4d-content-item::part(statistics)`\n * @csspart media - The media content. Usage: `c4d-content-item::part(media)`\n * @csspart cta - The footer CTA. Usage: `c4d-content-item::part(cta)`\n * @csspart heading - The heading content. Usage: `c4d-content-item::part(heading)`\n * @csspart body - The body content. Usage: `c4d-content-item::part(body)`\n */\n@customElement(`${c4dPrefix}-content-item`)\nclass C4DContentItem extends StableSelectorMixin(LitElement) {\n /**\n * `true` if there are CTA statistic in the content item area.\n */\n @state()\n protected _hasLogo = false;\n /**\n * `true` if there are CTA media in the content item area.\n */\n @state()\n protected _hasMedia = false;\n\n /**\n * `true` if there are CTA statistic in the content item area.\n */\n @state()\n protected _hasStatistic = false;\n\n /**\n * `true` if there is a footer content.\n */\n @state()\n _hasFooter = false;\n\n @property({ type: Boolean })\n horizontal = false;\n\n /**\n * Handles `slotchange` event.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[slotExistencePropertyNames[name] || '_hasStatistic'] = hasContent;\n if (\n (\n (target as HTMLSlotElement).assignedNodes()[0] as HTMLElement\n )?.matches?.(\n (this.constructor as typeof C4DContentItem).selectorImageLogo\n )\n ) {\n this._hasLogo = true;\n } else {\n this._hasLogo = false;\n }\n }\n\n /**\n * @returns The statistic content items\n */\n protected _renderStatistic(): TemplateResult | string | void {\n const { _hasStatistic: hasStatistic, _handleSlotChange: handleSlotChange } =\n this;\n return html`\n <div\n ?hidden=\"${!hasStatistic}\"\n class=\"${c4dPrefix}--content-item__statitics\"\n part=\"statistics\">\n <slot name=\"statistics\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The media content items\n */\n protected _renderMedia(): TemplateResult | string | void {\n const { _hasMedia: hasMedia, _handleSlotChange: handleSlotChange } = this;\n\n return html`\n <div\n ?hidden=\"${!hasMedia}\"\n class=\"${c4dPrefix}--content-item__media\"\n part=\"media\">\n <slot name=\"media\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The body content.\n */\n // eslint-disable-next-line class-methods-use-this\n protected _renderBody(): TemplateResult | string | void {\n return html` <slot></slot> `;\n }\n\n /**\n * @returns The footer content.\n */\n protected _renderFooter(): TemplateResult | string | void {\n const { _hasFooter: hasFooter } = this;\n return html`\n <div\n ?hidden=\"${!hasFooter}\"\n class=\"${prefix}--content-item__cta\"\n part=\"cta\">\n <slot name=\"footer\" @slotchange=\"${this._handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n updated() {\n if (this._hasFooter) {\n this.querySelector(`${c4dPrefix}-content-item-copy`)?.setAttribute(\n 'has-cta',\n ''\n );\n } else {\n this.querySelector(`${c4dPrefix}-content-item-copy`)?.removeAttribute(\n 'has-cta'\n );\n }\n }\n\n render() {\n const { horizontal, _hasStatistic: hasStatistic, _hasLogo: hasLogo } = this;\n const horizontalClass = classMap({\n [`${c4dPrefix}--content-item__horizontal`]:\n horizontal && !hasStatistic && !hasLogo,\n });\n\n return html`\n <div class=\"${horizontalClass}\" part=\"heading\">\n ${this._renderStatistic()} ${this._renderMedia()}\n <div part=\"body\">\n <slot name=\"heading\"></slot>\n ${this._renderBody()}${this._renderFooter()}\n </div>\n </div>\n `;\n }\n\n static get stableSelector() {\n return `${c4dPrefix}--content-item`;\n }\n\n static get selectorImageLogo() {\n return `${c4dPrefix}-image-logo`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DContentItem;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAwB,KAAK;AACtD,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,QAAQ,EAAEC,KAAK,QAAQ,mBAAmB;AACnD,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,MAAM,MAAM,yBAAqB;AACxC,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAE/G,MAAM;EAAEC,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGP,QAAQ;;AAEpD;AACA;AACA;AACA,MAAMQ,0BAA0B,GAAG;EACjCC,KAAK,EAAE,WAAW;EAClBC,SAAS,EAAE,eAAe;EAC1BC,MAAM,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA,IAcMC,cAAc,GAAAC,SAAA,EADnBT,aAAa,CAAC,GAAGG,SAAS,eAAe,CAAC,aAAAO,WAAA,EAAAC,oBAAA;EAA3C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AAA,KAAAA,GAAA,GAAArB,CAAA;AACf,oBADe;AACf,UADe;AACf;AACA;AACA,YAHe;AACf;AACA;AACA,KAHe,GACKoB,eAAe,EACzB,IAAI,CAACzB,gBAAgB,CAAC,CAAC,EAAI,IAAI,CAACM,YAAY,CAAC,CAAC,EAG5C,IAAI,CAACI,WAAW,CAAC,CAAC,EAAG,IAAI,CAACE,aAAa,CAAC,CAAC;MAInD;IAAC;MAAApC,IAAA;MAAAmD,MAAA;MAAAjD,GAAA;MAAAC,KAAA,EAED,SAAAA,CAAA,EAA4B;QAC1B,OAAO,GAAGhB,SAAS,gBAAgB;MACrC;IAAC;MAAAa,IAAA;MAAAmD,MAAA;MAAAjD,GAAA;MAAAC,KAAA,EAED,SAAAA,CAAA,EAA+B;QAC7B,OAAO,GAAGhB,SAAS,aAAa;MAClC;IAAC;MAAAa,IAAA;MAAAmD,MAAA;MAAAjD,GAAA;MAAAC,MAAA;QAAA,OAEerB,MAAM;MAAA;IAAA;EAAA;AAAA,GApJKD,mBAAmB,CAACL,UAAU,CAAC;AAuJ5D;AACA,eAAegB,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"content-item.js","names":["html","LitElement","classMap","property","state","settings","StableSelectorMixin","styles","carbonElement","customElement","prefix","stablePrefix","c4dPrefix","slotExistencePropertyNames","media","statistic","footer","C4DContentItem","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","decorators","key","value","type","Boolean","_handleSlotChange","target","_assignedNodes$","_assignedNodes$$match","name","hasContent","assignedNodes","some","node","nodeType","Node","TEXT_NODE","textContent","trim","matches","call","selectorImageLogo","_hasLogo","getAttribute","hasPictogram","tagName","toLowerCase","_hasPictogram","_renderStatistic","_hasStatistic","hasStatistic","handleSlotChange","_t","_","_renderMedia","_hasMedia","hasMedia","_t2","_renderBody","_t3","_renderFooter","_hasFooter","hasFooter","_t4","updated","_this$querySelector","querySelector","setAttribute","_this$querySelector2","removeAttribute","render","horizontal","hasLogo","horizontalClass","_t5","static"],"sources":["components/content-item/content-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2025\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, LitElement, TemplateResult } from 'lit';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { property, state } from 'lit/decorators.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport styles from './content-item.scss';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { prefix, stablePrefix: c4dPrefix } = settings;\n\n/**\n * The table mapping slot name with the private property name that indicates the existence of the slot content.\n */\nconst slotExistencePropertyNames = {\n media: '_hasMedia',\n statistic: '_hasStatistic',\n footer: '_hasFooter',\n};\n\n/**\n * Content item.\n *\n * @element c4d-content-item\n * @slot media - The media content.\n * @slot heading - The heading content.\n * @slot footer - The footer (CTA) content.\n * @csspart statistics - The element. Usage: `c4d-content-item::part(statistics)`\n * @csspart media - The media content. Usage: `c4d-content-item::part(media)`\n * @csspart cta - The footer CTA. Usage: `c4d-content-item::part(cta)`\n * @csspart heading - The heading content. Usage: `c4d-content-item::part(heading)`\n * @csspart body - The body content. Usage: `c4d-content-item::part(body)`\n */\n@customElement(`${c4dPrefix}-content-item`)\nclass C4DContentItem extends StableSelectorMixin(LitElement) {\n /**\n * `true` if there are CTA statistic in the content item area.\n */\n @state()\n protected _hasLogo = false;\n /**\n * `true` if there are CTA media in the content item area.\n */\n @state()\n _hasMedia = false;\n /**\n * `true` if there is a pictogram in the content\n */\n @state()\n _hasPictogram = false;\n /**\n * `true` if there are CTA statistic in the content item area.\n */\n @state()\n protected _hasStatistic = false;\n\n /**\n * `true` if there is a footer content.\n */\n @state()\n _hasFooter = false;\n\n @property({ type: Boolean })\n horizontal = false;\n\n /**\n * Handles `slotchange` event.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[slotExistencePropertyNames[name] || '_hasStatistic'] = hasContent;\n if (\n (\n (target as HTMLSlotElement).assignedNodes()[0] as HTMLElement\n )?.matches?.(\n (this.constructor as typeof C4DContentItem).selectorImageLogo\n )\n ) {\n this._hasLogo = true;\n } else {\n this._hasLogo = false;\n }\n if ((target as HTMLElement).getAttribute('name') == 'media') {\n const hasPictogram = (target as HTMLSlotElement)\n .assignedNodes()\n .some((node) => (node as HTMLElement).tagName.toLowerCase() == 'svg');\n this._hasPictogram = hasPictogram;\n }\n }\n\n /**\n * @returns The statistic content items\n */\n protected _renderStatistic(): TemplateResult | string | void {\n const { _hasStatistic: hasStatistic, _handleSlotChange: handleSlotChange } =\n this;\n return html`\n <div\n ?hidden=\"${!hasStatistic}\"\n class=\"${c4dPrefix}--content-item__statitics\"\n part=\"statistics\">\n <slot name=\"statistics\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The media content items\n */\n protected _renderMedia(): TemplateResult | string | void {\n const { _hasMedia: hasMedia, _handleSlotChange: handleSlotChange } = this;\n\n return html`\n <div\n ?hidden=\"${!hasMedia}\"\n class=\"${c4dPrefix}--content-item__media\"\n part=\"media\">\n <slot name=\"media\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The body content.\n */\n // eslint-disable-next-line class-methods-use-this\n protected _renderBody(): TemplateResult | string | void {\n return html` <slot></slot> `;\n }\n\n /**\n * @returns The footer content.\n */\n protected _renderFooter(): TemplateResult | string | void {\n const { _hasFooter: hasFooter } = this;\n return html`\n <div\n ?hidden=\"${!hasFooter}\"\n class=\"${prefix}--content-item__cta\"\n part=\"cta\">\n <slot name=\"footer\" @slotchange=\"${this._handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n updated() {\n if (this._hasFooter) {\n this.querySelector(`${c4dPrefix}-content-item-copy`)?.setAttribute(\n 'has-cta',\n ''\n );\n } else {\n this.querySelector(`${c4dPrefix}-content-item-copy`)?.removeAttribute(\n 'has-cta'\n );\n }\n }\n\n render() {\n const { horizontal, _hasStatistic: hasStatistic, _hasLogo: hasLogo } = this;\n const horizontalClass = classMap({\n [`${c4dPrefix}--content-item__horizontal`]:\n horizontal && !hasStatistic && !hasLogo,\n });\n\n return html`\n <div class=\"${horizontalClass}\" part=\"heading\">\n ${this._renderStatistic()} ${this._renderMedia()}\n <div part=\"body\">\n <slot name=\"heading\"></slot>\n ${this._renderBody()}${this._renderFooter()}\n </div>\n </div>\n `;\n }\n\n static get stableSelector() {\n return `${c4dPrefix}--content-item`;\n }\n\n static get selectorImageLogo() {\n return `${c4dPrefix}-image-logo`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DContentItem;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAwB,KAAK;AACtD,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,QAAQ,EAAEC,KAAK,QAAQ,mBAAmB;AACnD,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,MAAM,MAAM,yBAAqB;AACxC,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAE/G,MAAM;EAAEC,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGP,QAAQ;;AAEpD;AACA;AACA;AACA,MAAMQ,0BAA0B,GAAG;EACjCC,KAAK,EAAE,WAAW;EAClBC,SAAS,EAAE,eAAe;EAC1BC,MAAM,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2020, 2024
4
+ * Copyright IBM Corp. 2020, 2025
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -357,6 +357,8 @@ declare const C4DCTABlockItemRow_base: {
357
357
  declare class C4DCTABlockItemRow extends C4DCTABlockItemRow_base {
358
358
  /** Defines if the bottom border is rendered */
359
359
  _noBorder: boolean;
360
+ _hasChildWithMedia: boolean;
361
+ checkForMedia(): void;
360
362
  render(): import("lit-html").TemplateResult<1>;
361
363
  /**
362
364
  * Checks if the no-border attribute has changed and applies the border class accordingly
@@ -1,21 +1,23 @@
1
1
  import _decorate from "@babel/runtime/helpers/esm/decorate";
2
2
  let _ = t => t,
3
- _t;
3
+ _t,
4
+ _t2;
4
5
  /**
5
6
  * @license
6
7
  *
7
- * Copyright IBM Corp. 2020, 2024
8
+ * Copyright IBM Corp. 2020, 2025
8
9
  *
9
10
  * This source code is licensed under the Apache-2.0 license found in the
10
11
  * LICENSE file in the root directory of this source tree.
11
12
  */
12
13
 
13
14
  import { LitElement, html } from 'lit';
14
- import { property } from 'lit/decorators.js';
15
+ import { property, state } from 'lit/decorators.js';
15
16
  import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
16
17
  import StableSelectorMixin from "../../globals/mixins/stable-selector.js";
17
18
  import styles from "././cta-block.css.js";
18
19
  import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';
20
+ import C4DContentItem from "../content-item/content-item.js";
19
21
  const {
20
22
  prefix,
21
23
  stablePrefix: c4dPrefix
@@ -47,13 +49,40 @@ let C4DCTABlockItemRow = _decorate([customElement(`${c4dPrefix}-cta-block-item-r
47
49
  value() {
48
50
  return false;
49
51
  }
52
+ }, {
53
+ kind: "field",
54
+ decorators: [state()],
55
+ key: "_hasChildWithMedia",
56
+ value() {
57
+ return false;
58
+ }
50
59
  }, {
51
60
  kind: "method",
52
- key: "render",
61
+ key: "checkForMedia",
53
62
  value: /** Defines if the bottom border is rendered */
54
63
 
55
- function render() {
56
- return html(_t || (_t = _`<slot></slot>`));
64
+ function checkForMedia() {
65
+ const childrenWithMedia = Array.from(this.children).filter(elem => {
66
+ if (elem instanceof C4DContentItem) {
67
+ return (elem === null || elem === void 0 ? void 0 : elem._hasMedia) && !(elem !== null && elem !== void 0 && elem._hasPictogram);
68
+ }
69
+ return false;
70
+ });
71
+ this._hasChildWithMedia = childrenWithMedia.length > 0;
72
+ this.render();
73
+ }
74
+ }, {
75
+ kind: "method",
76
+ key: "render",
77
+ value: function render() {
78
+ const {
79
+ _hasChildWithMedia: hasChildWithMedia
80
+ } = this;
81
+ if (hasChildWithMedia) {
82
+ return html(_t || (_t = _`<div class="scroll-container"><slot></slot></div>`));
83
+ } else {
84
+ return html(_t2 || (_t2 = _`<slot></slot>`));
85
+ }
57
86
  }
58
87
 
59
88
  /**
@@ -66,6 +95,9 @@ let C4DCTABlockItemRow = _decorate([customElement(`${c4dPrefix}-cta-block-item-r
66
95
  if (changedProperties.has('_noBorder')) {
67
96
  this.classList.toggle(`${prefix}--cta-block-item-row__border`, !this._noBorder);
68
97
  }
98
+ this.updateComplete.then(() => {
99
+ this.checkForMedia();
100
+ });
69
101
  }
70
102
  }, {
71
103
  kind: "get",
@@ -1 +1 @@
1
- {"version":3,"file":"cta-block-item-row.js","names":["LitElement","html","property","settings","StableSelectorMixin","styles","carbonElement","customElement","prefix","stablePrefix","c4dPrefix","C4DCTABlockItemRow","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","decorators","type","Boolean","reflect","attribute","key","value","render","_t","_","updated","changedProperties","has","classList","toggle","_noBorder","static","console","warn"],"sources":["components/cta-block/cta-block-item-row.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 { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport styles from './cta-block.scss';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { prefix, stablePrefix: c4dPrefix } = settings;\n\n/**\n * The CTA BLOCK ITEM ROW component\n *\n * @element c4d-cta-block-item-row\n * @slot .\n */\n@customElement(`${c4dPrefix}-cta-block-item-row`)\nclass C4DCTABlockItemRow extends StableSelectorMixin(LitElement) {\n /** Defines if the bottom border is rendered */\n @property({ type: Boolean, reflect: true, attribute: 'no-border' })\n _noBorder = false;\n\n render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Checks if the no-border attribute has changed and applies the border class accordingly\n */\n updated(changedProperties) {\n if (changedProperties.has('_noBorder')) {\n this.classList.toggle(\n `${prefix}--cta-block-item-row__border`,\n !this._noBorder\n );\n }\n }\n\n static get stableSelector() {\n return `${c4dPrefix}--cta-block-item-row`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nconsole.warn(\n 'The cta-block-item-row component has been deprecated in favor of the content-section/block and content-item components. ' +\n 'See content-section/block and content-items documentation for more information.'\n);\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DCTABlockItemRow;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,MAAM,MAAM,sBAAkB;AACrC,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAE/G,MAAM;EAAEC,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGP,QAAQ;;AAEpD;AACA;AACA;AACA;AACA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AACA,eAAe3B,kBAAkB","ignoreList":[]}
1
+ {"version":3,"file":"cta-block-item-row.js","names":["LitElement","html","property","state","settings","StableSelectorMixin","styles","carbonElement","customElement","C4DContentItem","prefix","stablePrefix","c4dPrefix","C4DCTABlockItemRow","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","decorators","type","Boolean","reflect","attribute","key","value","checkForMedia","childrenWithMedia","Array","from","children","filter","elem","_hasMedia","_hasPictogram","_hasChildWithMedia","length","render","hasChildWithMedia","_t","_","_t2","updated","changedProperties","has","classList","toggle","_noBorder","updateComplete","then","static","console","warn"],"sources":["components/cta-block/cta-block-item-row.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2025\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 } from 'lit/decorators.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport styles from './cta-block.scss';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\nimport C4DContentItem from '../content-item/content-item';\n\nconst { prefix, stablePrefix: c4dPrefix } = settings;\n\n/**\n * The CTA BLOCK ITEM ROW component\n *\n * @element c4d-cta-block-item-row\n * @slot .\n */\n@customElement(`${c4dPrefix}-cta-block-item-row`)\nclass C4DCTABlockItemRow extends StableSelectorMixin(LitElement) {\n /** Defines if the bottom border is rendered */\n @property({ type: Boolean, reflect: true, attribute: 'no-border' })\n _noBorder = false;\n @state()\n _hasChildWithMedia = false;\n checkForMedia() {\n const childrenWithMedia = Array.from(this.children).filter((elem) => {\n if (elem instanceof C4DContentItem) {\n return (\n (elem as C4DContentItem)?._hasMedia &&\n !(elem as C4DContentItem)?._hasPictogram\n );\n }\n return false;\n });\n this._hasChildWithMedia = childrenWithMedia.length > 0;\n this.render();\n }\n\n render() {\n const { _hasChildWithMedia: hasChildWithMedia } = this;\n if (hasChildWithMedia) {\n return html`<div class=\"scroll-container\"><slot></slot></div>`;\n } else {\n return html`<slot></slot>`;\n }\n }\n\n /**\n * Checks if the no-border attribute has changed and applies the border class accordingly\n */\n updated(changedProperties) {\n if (changedProperties.has('_noBorder')) {\n this.classList.toggle(\n `${prefix}--cta-block-item-row__border`,\n !this._noBorder\n );\n }\n this.updateComplete.then(() => {\n this.checkForMedia();\n });\n }\n\n static get stableSelector() {\n return `${c4dPrefix}--cta-block-item-row`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nconsole.warn(\n 'The cta-block-item-row component has been deprecated in favor of the content-section/block and content-item components. ' +\n 'See content-section/block and content-items documentation for more information.'\n);\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DCTABlockItemRow;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,KAAK,QAAQ,mBAAmB;AACnD,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,MAAM,MAAM,sBAAkB;AACrC,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAC/G,OAAOC,cAAc,MAAM,iCAA8B;AAEzD,MAAM;EAAEC,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGR,QAAQ;;AAEpD;AACA;AACA;AACA;AACA;AACA;AALA,IAOMS,kBAAkB,GAAAC,SAAA,EADvBN,aAAa,CAAC,GAAGI,SAAS,qBAAqB,CAAC,aAAAG,WAAA,EAAAC,oBAAA;EAAjD,MACMH,kBAAkB,SAAAG,oBAAA,CAAyC;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAiDjE;EAAC;IAAAI,CAAA,EAjDKN,kBAAkB;IA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AAE;QACzB,IAAIA,iBAAiB,CAACC,GAAG,CAAC,WAAW,CAAC,EAAE;UACtC,IAAI,CAACC,SAAS,CAACC,MAAM,CACnB,GAAGvC,MAAM,8BAA8B,EACvC,CAAC,IAAI,CAACwC,SACR,CAAC;QACH;QACA,IAAI,CAACC,cAAc,CAACC,IAAI,CAAC,MAAM;UAC7B,IAAI,CAACvB,aAAa,CAAC,CAAC;QACtB,CAAC,CAAC;MACJ;IAAC;MAAAR,IAAA;MAAAgC,MAAA;MAAA1B,GAAA;MAAAC,KAAA,EAED,SAAAA,CAAA,EAA4B;QAC1B,OAAO,GAAGhB,SAAS,sBAAsB;MAC3C;IAAC;MAAAS,IAAA;MAAAgC,MAAA;MAAA1B,GAAA;MAAAC,MAAA;QAAA,OAEetB,MAAM;MAAA;IAAA;EAAA;AAAA,GAhDSD,mBAAmB,CAACL,UAAU,CAAC;AAmDhEsD,OAAO,CAACC,IAAI,CACV,0HAA0H,GACxH,iFACJ,CAAC;;AAED;AACA,eAAe1C,kBAAkB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2020, 2024
4
+ * Copyright IBM Corp. 2020, 2025
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -365,7 +365,7 @@ declare class C4DCTABlockItem extends C4DCTABlockItem_base {
365
365
  /**
366
366
  * `true` if there are CTA media in the content item area.
367
367
  */
368
- protected _hasMedia: boolean;
368
+ _hasMedia: boolean;
369
369
  /**
370
370
  * `true` if there are CTA statistic in the content item area.
371
371
  */
@@ -10,7 +10,7 @@ function _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prot
10
10
  /**
11
11
  * @license
12
12
  *
13
- * Copyright IBM Corp. 2020, 2024
13
+ * Copyright IBM Corp. 2020, 2025
14
14
  *
15
15
  * This source code is licensed under the Apache-2.0 license found in the
16
16
  * LICENSE file in the root directory of this source tree.
@@ -98,6 +98,10 @@ let C4DCTABlockItem = _decorate([customElement(`${c4dPrefix}-cta-block-item`)],
98
98
  } = target;
99
99
  const hasContent = target.assignedNodes().some(node => node.nodeType !== Node.TEXT_NODE || node.textContent.trim());
100
100
  this[slotExistencePropertyNames[name] || '_hasStatistic'] = hasContent;
101
+ if (target.getAttribute('name') == 'media') {
102
+ const hasPictogram = target.assignedNodes().some(node => node.tagName.toLowerCase() == 'svg');
103
+ this._hasPictogram = hasPictogram;
104
+ }
101
105
  }
102
106
 
103
107
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cta-block-item.js","names":["css","html","state","settings","StableSelectorMixin","C4DContentItem","styles","carbonElement","customElement","prefix","stablePrefix","c4dPrefix","slotExistencePropertyNames","media","statistic","footer","C4DCTABlockItem","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","decorators","key","value","_handleSlotChange","target","name","hasContent","assignedNodes","some","node","nodeType","Node","TEXT_NODE","textContent","trim","_renderStatistic","_hasStatistic","hasStatistic","handleSlotChange","_t","_","_renderMedia","_hasMedia","hasMedia","_t2","render","_t3","_superPropGet","static","_t4","console","warn"],"sources":["components/cta-block/cta-block-item.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 { css, html, TemplateResult } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport C4DContentItem from '../content-item/content-item';\n\nimport styles from './cta-block.scss';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { prefix, stablePrefix: c4dPrefix } = settings;\n\n/**\n * The table mapping slot name with the private property name that indicates the existence of the slot content.\n */\nconst slotExistencePropertyNames = {\n media: '_hasMedia',\n statistic: '_hasStatistic',\n footer: '_hasFooter',\n};\n\n/**\n * The CTA BLOCK ITEM component\n *\n * @element c4d-cta-block-item\n * @slot statistics\n * @slot media\n * @slot heading\n * @slot .\n * @slot footer\n * @csspart statistics - The statistics. Usage: `c4d-cta-block-item::part(statistics)`\n * @csspart media - The media. Usage: `c4d-cta-block-item::part(media)`\n */\n@customElement(`${c4dPrefix}-cta-block-item`)\nclass C4DCTABlockItem extends StableSelectorMixin(C4DContentItem) {\n /**\n * `true` if there are CTA media in the content item area.\n */\n @state()\n protected _hasMedia = false;\n\n /**\n * `true` if there are CTA statistic in the content item area.\n */\n @state()\n protected _hasStatistic = false;\n\n /**\n * Handles `slotchange` event.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[slotExistencePropertyNames[name] || '_hasStatistic'] = hasContent;\n }\n\n /**\n * @returns The statistic content items\n */\n protected _renderStatistic(): TemplateResult | string | void {\n const { _hasStatistic: hasStatistic, _handleSlotChange: handleSlotChange } =\n this;\n return html`\n <div\n ?hidden=\"${!hasStatistic}\"\n class=\"${prefix}--cta-block-item__statitics\"\n part=\"statistics\">\n <slot name=\"statistics\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The media content items\n */\n protected _renderMedia(): TemplateResult | string | void {\n const { _hasMedia: hasMedia, _handleSlotChange: handleSlotChange } = this;\n\n return html`\n <div\n ?hidden=\"${!hasMedia}\"\n class=\"${prefix}--cta-block-item__media\"\n part=\"media\">\n <slot name=\"media\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n render() {\n return html`\n ${this._renderStatistic()} ${this._renderMedia()}\n <slot name=\"heading\"></slot>\n ${super._renderBody()}${super._renderFooter()}\n `;\n }\n\n static get stableSelector() {\n return `${c4dPrefix}--cta-block-item`;\n }\n\n // `styles` here is a `CSSResult` generated by custom WebPack loader\n static get styles() {\n return css`\n ${super.styles}${styles}\n `;\n }\n}\n\nconsole.warn(\n 'The cta-block-item component has been deprecated in favor of the content-section/block and content-item components. ' +\n 'See content-section/block and content-items documentation for more information.'\n);\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DCTABlockItem;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,IAAI,QAAwB,KAAK;AAC/C,SAASC,KAAK,QAAQ,mBAAmB;AACzC,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,cAAc,MAAM,iCAA8B;AAEzD,OAAOC,MAAM,MAAM,sBAAkB;AACrC,SAASC,aAAa,IAAIC,aAAa,QAAQ,gEAAgE;AAE/G,MAAM;EAAEC,MAAM;EAAEC,YAAY,EAAEC;AAAU,CAAC,GAAGR,QAAQ;;AAEpD;AACA;AACA;AACA,MAAMS,0BAA0B,GAAG;EACjCC,KAAK,EAAE,WAAW;EAClBC,SAAS,EAAE,eAAe;EAC1BC,MAAM,EAAE;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,IAaMC,eAAe,GAAAC,SAAA,EADpBT,aAAa,CAAC,GAAGG,SAAS,iBAAiB,CAAC,aAAAO,WAAA,EAAAC,oBAAA;EAA7C,MACMH,eAAe,SAAAG,oBAAA,CAA6C;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA+ElE;EAAC;IAAAI,CAAA,EA/EKN,eAAe;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIlBvB,KAAK,CAAC,CAAC;MAAAwB,GAAA;MAAAC,MAAA;QAAA,OACc,KAAK;MAAA;IAAA;MAAAH,IAAA;MAAAC,UAAA,GAK1Bv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,GAEI,CAACG,QAAQ,EACXvC,MAAM,EAEmBkC,gBAAgB;MAGxD;IAAC;MAAAnB,IAAA;MAAAE,GAAA;MAAAC,KAAA,EAED,SAAAuB,MAAMA,CAAA,EAAG;QACP,OAAOjD,IAAI,CAAAkD,GAAA,KAAAA,GAAA,GAAAN,CAAA;AACf,QADe;AACf;AACA,QAFe;AACf,KADe,GACP,IAAI,CAACL,gBAAgB,CAAC,CAAC,EAAI,IAAI,CAACM,YAAY,CAAC,CAAC,EAAAM,aAAA,CA/DhDpC,eAAe,+BAAAoC,aAAA,CAAfpC,eAAe;MAmEnB;IAAC;MAAAQ,IAAA;MAAA6B,MAAA;MAAA3B,GAAA;MAAAC,KAAA,EAED,SAAAA,CAAA,EAA4B;QAC1B,OAAO,GAAGhB,SAAS,kBAAkB;MACvC;;MAEA;IAAA;MAAAa,IAAA;MAAA6B,MAAA;MAAA3B,GAAA;MAAAC,KAAA,EACA,SAAAA,CAAA,EAAoB;QAClB,OAAO3B,GAAG,CAAAsD,GAAA,KAAAA,GAAA,GAAAT,CAAA;AACd,QADc;AACd,KADc,GAAAO,aAAA,CA3ERpC,eAAe,mBA4EEV,MAAM;MAE3B;IAAC;EAAA;AAAA,GA9E2BF,mBAAmB,CAACC,cAAc,CAAC;AAiFjEkD,OAAO,CAACC,IAAI,CACV,sHAAsH,GACpH,iFACJ,CAAC;;AAED;AACA,eAAexC,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"cta-block-item.js","names":["css","html","state","settings","StableSelectorMixin","C4DContentItem","styles","carbonElement","customElement","prefix","stablePrefix","c4dPrefix","slotExistencePropertyNames","media","statistic","footer","C4DCTABlockItem","_decorate","_initialize","_StableSelectorMixin","constructor","args","F","d","kind","decorators","key","value","_handleSlotChange","target","name","hasContent","assignedNodes","some","node","nodeType","Node","TEXT_NODE","textContent","trim","getAttribute","hasPictogram","tagName","toLowerCase","_hasPictogram","_renderStatistic","_hasStatistic","hasStatistic","handleSlotChange","_t","_","_renderMedia","_hasMedia","hasMedia","_t2","render","_t3","_superPropGet","static","_t4","console","warn"],"sources":["components/cta-block/cta-block-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2025\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 { css, html, TemplateResult } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';\nimport StableSelectorMixin from '../../globals/mixins/stable-selector';\nimport C4DContentItem from '../content-item/content-item';\n\nimport styles from './cta-block.scss';\nimport { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';\n\nconst { prefix, stablePrefix: c4dPrefix } = settings;\n\n/**\n * The table mapping slot name with the private property name that indicates the existence of the slot content.\n */\nconst slotExistencePropertyNames = {\n media: '_hasMedia',\n statistic: '_hasStatistic',\n footer: '_hasFooter',\n};\n\n/**\n * The CTA BLOCK ITEM component\n *\n * @element c4d-cta-block-item\n * @slot statistics\n * @slot media\n * @slot heading\n * @slot .\n * @slot footer\n * @csspart statistics - The statistics. Usage: `c4d-cta-block-item::part(statistics)`\n * @csspart media - The media. Usage: `c4d-cta-block-item::part(media)`\n */\n@customElement(`${c4dPrefix}-cta-block-item`)\nclass C4DCTABlockItem extends StableSelectorMixin(C4DContentItem) {\n /**\n * `true` if there are CTA media in the content item area.\n */\n @state()\n _hasMedia = false;\n\n /**\n * `true` if there are CTA statistic in the content item area.\n */\n @state()\n protected _hasStatistic = false;\n\n /**\n * Handles `slotchange` event.\n *\n * @param event The event.\n * @param event.target The event target.\n */\n protected _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[slotExistencePropertyNames[name] || '_hasStatistic'] = hasContent;\n if ((target as HTMLElement).getAttribute('name') == 'media') {\n const hasPictogram = (target as HTMLSlotElement)\n .assignedNodes()\n .some((node) => (node as HTMLElement).tagName.toLowerCase() == 'svg');\n this._hasPictogram = hasPictogram;\n }\n }\n\n /**\n * @returns The statistic content items\n */\n protected _renderStatistic(): TemplateResult | string | void {\n const { _hasStatistic: hasStatistic, _handleSlotChange: handleSlotChange } =\n this;\n return html`\n <div\n ?hidden=\"${!hasStatistic}\"\n class=\"${prefix}--cta-block-item__statitics\"\n part=\"statistics\">\n <slot name=\"statistics\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The media content items\n */\n protected _renderMedia(): TemplateResult | string | void {\n const { _hasMedia: hasMedia, _handleSlotChange: handleSlotChange } = this;\n\n return html`\n <div\n ?hidden=\"${!hasMedia}\"\n class=\"${prefix}--cta-block-item__media\"\n part=\"media\">\n <slot name=\"media\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n render() {\n return html`\n ${this._renderStatistic()} ${this._renderMedia()}\n <slot name=\"heading\"></slot>\n ${super._renderBody()}${super._renderFooter()}\n `;\n }\n\n static get stableSelector() {\n return `${c4dPrefix}--cta-block-item`;\n }\n\n // `styles` here is a `CSSResult` generated by custom WebPack loader\n static get styles() {\n return css`\n ${super.styles}${styles}\n `;\n }\n}\n\nconsole.warn(\n 'The cta-block-item component has been deprecated in favor of the content-section/block and content-item components. ' +\n 'See content-section/block and content-items documentation for more information.'\n);\n\n/* @__GENERATE_REACT_CUSTOM_ELEMENT_TYPE__ */\nexport default C4DCTABlockItem;\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,EAAEC,IAAI,QAAwB,KAAK;AAC/C,SAASC,KAAK,QAAQ,mBAAmB;AACzC,OAAOC,QAAQ,MAAM,+DAA+D;AACpF,OAAOC,mBAAmB,MAAM,yCAAsC;AACtE,OAAOC,cAAc,MAAM,iCAA8B;AAEzD,OAAOC,MAAM,MAAM,sBAAkB;AACrC,SAASC,a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