@kirbydesign/extensions-angular 3.5.0 → 4.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.
@@ -88,11 +88,11 @@ class ImageBannerComponent {
88
88
  this.imageError.emit($event);
89
89
  }
90
90
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ImageBannerComponent, deps: [{ token: i1.TranslationService }], target: i0.ɵɵFactoryTarget.Component }); }
91
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ImageBannerComponent, isStandalone: true, selector: "kirby-x-image-banner", inputs: { title: "title", imagePath: "imagePath", bodyText: "bodyText", showButtonInNarrowView: "showButtonInNarrowView", actionButtonText: "actionButtonText", externalLink: "externalLink", backgroundBlur: "backgroundBlur" }, outputs: { bannerClick: "bannerClick", dismissClick: "dismissClick", imageError: "imageError" }, host: { properties: { "class.show-button-in-narrow-view": "this.showButtonInNarrowView", "class": "this.backgroundBlur" } }, hostDirectives: [{ directive: ImageBannerHeightDirective }], ngImport: i0, template: "<kirby-card [themeColor]=\"backgroundBlur === 'none' ? 'white' : backgroundBlur\">\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"text-content-layout\">\n <div class=\"main-content-header\">\n @if (title) {\n <p class=\"kirby-text-normal-bold\">\n {{ title }}\n </p>\n } @else {\n <div class=\"title kirby-text-normal-bold\">\n <ng-content select=\"[title]\"></ng-content>\n </div>\n }\n </div>\n\n <div class=\"main-content-body\">\n <p class=\"main-content-body-text kirby-text-small\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </p>\n </div>\n </div>\n @if (externalLink) {\n <!-- Only one of below anchors is displayed at a time -\n we want different behavior on varying screen widths -->\n <a\n kirby-button\n class=\"breakout wide-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <a\n kirby-button\n class=\"breakout narrow-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n }\n\n @if (!externalLink) {\n <!-- Only one of below buttons is displayed at a time -\n we want different behavior on varying screen widths -->\n <button\n kirby-button\n class=\"breakout wide-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n >\n {{ actionButtonText }}\n </button>\n\n <button\n kirby-button\n class=\"breakout narrow-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n >\n <span class=\"kirby-visually-hidden\">\n {{ actionButtonText }}\n </span>\n </button>\n }\n </div>\n </div>\n\n @if (dismissClick.observed) {\n <div class=\"dismiss\">\n <button\n kirby-button\n size=\"xs\"\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n }\n</kirby-card>\n", styles: [":host{display:block}:host(.none) .blur-image{display:none}@container banner (width < 600px){:host(.none) .dismiss{--kirby-inputs-background-color: var(--kirby-white);--kirby-inputs-background-color-hover: var(--kirby-dark-overlay-10);--kirby-inputs-background-color-active: var(--kirby-dark-overlay-20);--kirby-inputs-color: var(--kirby-black)}}:host(.none) .main-content-body-action-link{color:var(--kirby-semi-dark)}:host(.dark) .blur-image{filter:blur(110px)}:host(.light) .blur-image{filter:blur(110px)}:host(.dark) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000052;z-index:1}:host(.light) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffff73;z-index:1}.blur-image-wrapper{position:absolute;inset:-330px;z-index:-1}.blur-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transform:translateZ(0)}kirby-card{container-name:banner;container-type:inline-size;height:100%}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)){transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)) .breakout{box-shadow:none}.main-content-wrapper{width:100%;padding:8px;box-sizing:border-box;display:flex;flex-direction:column}@container banner (width >= 600px){.main-content-wrapper{gap:16px;flex-direction:initial}}.main-content-image-wrapper{display:flex;overflow:hidden;border-radius:8px}@container banner (width >= 600px){.main-content-image-wrapper{flex:1}}.main-content{display:flex;flex-direction:column;justify-content:space-between}@container banner (width < 600px){.main-content{flex-direction:row}}.main-content{min-height:var(--kirby-x-image-banner-min-height, 84px);box-sizing:border-box;padding:12px 0 8px 8px;overflow:hidden}.main-content .main-content-header{padding-inline-end:8px}@container banner (width >= 600px){.main-content .main-content-header{padding-inline-end:40px}}.main-content:has(.main-content-body-action-link) .main-content-header{padding-inline-end:40px}@container banner (width >= 600px){.main-content{flex:1;gap:12px;padding:8px 8px 8px 0}}.main-content-header p{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin:0;padding:0}.main-content-image{width:100%;height:132px;object-fit:cover;object-position:center}@container banner (width >= 600px){.main-content-image{height:164px}}.main-content-body{display:flex;flex:1;justify-content:space-between;height:100%}.main-content-body p{text-wrap-mode:wrap;margin-bottom:0}@container banner (width >= 600px){.main-content-body{flex-direction:column;max-width:324px}}@container banner (width >= 600px){.main-content-body .main-content-body-action-link{display:none}}.main-content-body-text{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;padding-inline-end:8px}@container banner (width >= 600px){.main-content-body-text{padding-inline-end:48px}}@container banner (width < 600px){.main-content-body-text{-webkit-line-clamp:2;line-clamp:2;max-height:3em}}.breakout{position:initial;border-radius:16px;align-self:center}.breakout:before{content:\"\";display:block;position:absolute;inset:0}.wide-view-action{display:none}@container banner (width >= 600px){.wide-view-action{display:inline-flex;align-self:start;margin:0}}.narrow-view-action{display:inline-flex;margin:0}@container banner (width >= 600px){.narrow-view-action{display:none}}.narrow-view-action:is(a){width:24px;min-width:24px}.narrow-view-action:is(a) kirby-icon{font-size:24px}.narrow-view-action:is(button){min-width:1px;width:1px;height:1px}:host(.show-button-in-narrow-view) .wide-view-action{display:inline-flex}:host(.show-button-in-narrow-view) .narrow-view-action{display:none}.dismiss{position:absolute;top:16px;right:16px;height:fit-content}.dismiss button{margin:0}.text-content-layout{display:flex;flex:1;flex-direction:column;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container banner (width >= 600px){.text-content-layout{gap:12px}}.title ::ng-deep>h1,.title ::ng-deep>h2,.title ::ng-deep>h3,.title ::ng-deep>h4,.title ::ng-deep>h5,.title ::ng-deep>h6{margin-bottom:0;font-size:16px;font-weight:700;line-height:24px}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "kirby-card", inputs: ["title", "subtitle", "backgroundImageUrl", "hasPadding", "sizes", "variant"] }, { kind: "component", type: ButtonComponent, selector: "button[kirby-button],Button[kirby-button],a[kirby-button]", inputs: ["attentionLevel", "noDecoration", "themeColor", "expand", "isFloating", "size", "showIconOnly"] }, { kind: "component", type: IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "directive", type: ThemeColorDirective, selector: "kirby-avatar[themeColor], kirby-card[themeColor], kirby-icon[themeColor], kirby-progress-circle-ring[themeColor], kirby-modal-footer[themeColor], kirby-empty-state[themeColor]", inputs: ["themeColor"] }] }); }
91
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ImageBannerComponent, isStandalone: true, selector: "kirby-x-image-banner", inputs: { title: "title", imagePath: "imagePath", bodyText: "bodyText", showButtonInNarrowView: "showButtonInNarrowView", actionButtonText: "actionButtonText", externalLink: "externalLink", backgroundBlur: "backgroundBlur" }, outputs: { bannerClick: "bannerClick", dismissClick: "dismissClick", imageError: "imageError" }, host: { properties: { "class.show-button-in-narrow-view": "this.showButtonInNarrowView", "class": "this.backgroundBlur" } }, hostDirectives: [{ directive: ImageBannerHeightDirective }], ngImport: i0, template: "<kirby-card [themeColor]=\"backgroundBlur === 'none' ? 'white' : backgroundBlur\">\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"text-content-layout\">\n <div class=\"main-content-header\">\n @if (title) {\n <p class=\"kirby-text-normal-bold\">\n {{ title }}\n </p>\n } @else {\n <div class=\"title kirby-text-normal-bold\">\n <ng-content select=\"[title]\"></ng-content>\n </div>\n }\n </div>\n\n <div class=\"main-content-body\">\n <p class=\"main-content-body-text kirby-text-small\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </p>\n </div>\n </div>\n @if (externalLink) {\n <!-- Only one of below anchors is displayed at a time -\n we want different behavior on varying screen widths -->\n <a\n kirby-button\n class=\"breakout wide-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <a\n kirby-button\n class=\"breakout narrow-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n }\n\n @if (!externalLink) {\n <!-- Only one of below buttons is displayed at a time -\n we want different behavior on varying screen widths -->\n <button\n kirby-button\n class=\"breakout wide-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n >\n {{ actionButtonText }}\n </button>\n\n <button\n kirby-button\n class=\"breakout narrow-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n >\n <span class=\"kirby-visually-hidden\">\n {{ actionButtonText }}\n </span>\n </button>\n }\n </div>\n </div>\n\n @if (dismissClick.observed) {\n <div class=\"dismiss\">\n <button\n kirby-button\n size=\"xs\"\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n }\n</kirby-card>\n", styles: [":host{display:block}:host(.none) .blur-image{display:none}@container banner (width < 600px){:host(.none) .dismiss{--kirby-inputs-background-color: var(--kirby-white);--kirby-inputs-background-color-hover: var(--kirby-dark-overlay-10);--kirby-inputs-background-color-active: var(--kirby-dark-overlay-20);--kirby-inputs-color: var(--kirby-black)}}:host(.none) .main-content-body-action-link{color:var(--kirby-semi-dark)}:host(.dark) .blur-image{filter:blur(110px)}:host(.light) .blur-image{filter:blur(110px)}:host(.dark) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000052;z-index:1}:host(.light) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffff73;z-index:1}.blur-image-wrapper{position:absolute;inset:-330px;z-index:-1}.blur-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transform:translateZ(0)}kirby-card{container-name:banner;container-type:inline-size;height:100%}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)){transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)) .breakout{box-shadow:none}.main-content-wrapper{width:100%;padding:8px;box-sizing:border-box;display:flex;flex-direction:column}@container banner (width >= 600px){.main-content-wrapper{gap:16px;flex-direction:initial}}.main-content-image-wrapper{display:flex;overflow:hidden;border-radius:8px}@container banner (width >= 600px){.main-content-image-wrapper{flex:1}}.main-content{display:flex;flex-direction:column;justify-content:space-between;min-height:var(--kirby-x-image-banner-min-height, 84px);box-sizing:border-box;padding:12px 0 8px 8px;overflow:hidden}@container banner (width < 600px){.main-content{flex-direction:row}}.main-content .main-content-header{padding-inline-end:8px}@container banner (width >= 600px){.main-content .main-content-header{padding-inline-end:40px}}.main-content:has(.main-content-body-action-link) .main-content-header{padding-inline-end:40px}@container banner (width >= 600px){.main-content{flex:1;gap:12px;padding:8px 8px 8px 0}}.main-content-header p{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin:0;padding:0}.main-content-image{width:100%;height:132px;object-fit:cover;object-position:center}@container banner (width >= 600px){.main-content-image{height:164px}}.main-content-body{display:flex;flex:1;justify-content:space-between;height:100%}.main-content-body p{text-wrap-mode:wrap;margin-bottom:0}@container banner (width >= 600px){.main-content-body{flex-direction:column;max-width:324px}}@container banner (width >= 600px){.main-content-body .main-content-body-action-link{display:none}}.main-content-body-text{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;padding-inline-end:8px}@container banner (width >= 600px){.main-content-body-text{padding-inline-end:48px}}@container banner (width < 600px){.main-content-body-text{-webkit-line-clamp:2;line-clamp:2;max-height:3em}}.breakout{position:initial;border-radius:16px;align-self:center}.breakout:before{content:\"\";display:block;position:absolute;inset:0}.wide-view-action{display:none}@container banner (width >= 600px){.wide-view-action{display:inline-flex;align-self:start;margin:0}}.narrow-view-action{display:inline-flex;margin:0}@container banner (width >= 600px){.narrow-view-action{display:none}}.narrow-view-action:is(a){width:24px;min-width:24px}.narrow-view-action:is(a) kirby-icon{font-size:24px}.narrow-view-action:is(button){min-width:1px;width:1px;height:1px}:host(.show-button-in-narrow-view) .wide-view-action{display:inline-flex}:host(.show-button-in-narrow-view) .narrow-view-action{display:none}.dismiss{position:absolute;top:16px;right:16px;height:fit-content}.dismiss button{margin:0}.text-content-layout{display:flex;flex:1;flex-direction:column;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container banner (width >= 600px){.text-content-layout{gap:12px}}.title ::ng-deep>h1,.title ::ng-deep>h2,.title ::ng-deep>h3,.title ::ng-deep>h4,.title ::ng-deep>h5,.title ::ng-deep>h6{margin-bottom:0;font-size:16px;font-weight:700;line-height:24px}\n"], dependencies: [{ kind: "component", type: CardComponent, selector: "kirby-card", inputs: ["title", "subtitle", "backgroundImageUrl", "hasPadding", "sizes", "variant"] }, { kind: "component", type: ButtonComponent, selector: "button[kirby-button],Button[kirby-button],a[kirby-button]", inputs: ["attentionLevel", "noDecoration", "themeColor", "expand", "isFloating", "size", "showIconOnly"] }, { kind: "component", type: IconComponent, selector: "kirby-icon", inputs: ["size", "name"] }, { kind: "directive", type: ThemeColorDirective, selector: "kirby-avatar[themeColor], kirby-card[themeColor], kirby-icon[themeColor], kirby-progress-circle-ring[themeColor], kirby-modal-footer[themeColor], kirby-empty-state[themeColor]", inputs: ["themeColor"] }] }); }
92
92
  }
93
93
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ImageBannerComponent, decorators: [{
94
94
  type: Component,
95
- args: [{ selector: 'kirby-x-image-banner', imports: [CardComponent, ButtonComponent, IconComponent, ThemeColorDirective], hostDirectives: [ImageBannerHeightDirective], template: "<kirby-card [themeColor]=\"backgroundBlur === 'none' ? 'white' : backgroundBlur\">\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"text-content-layout\">\n <div class=\"main-content-header\">\n @if (title) {\n <p class=\"kirby-text-normal-bold\">\n {{ title }}\n </p>\n } @else {\n <div class=\"title kirby-text-normal-bold\">\n <ng-content select=\"[title]\"></ng-content>\n </div>\n }\n </div>\n\n <div class=\"main-content-body\">\n <p class=\"main-content-body-text kirby-text-small\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </p>\n </div>\n </div>\n @if (externalLink) {\n <!-- Only one of below anchors is displayed at a time -\n we want different behavior on varying screen widths -->\n <a\n kirby-button\n class=\"breakout wide-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <a\n kirby-button\n class=\"breakout narrow-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n }\n\n @if (!externalLink) {\n <!-- Only one of below buttons is displayed at a time -\n we want different behavior on varying screen widths -->\n <button\n kirby-button\n class=\"breakout wide-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n >\n {{ actionButtonText }}\n </button>\n\n <button\n kirby-button\n class=\"breakout narrow-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n >\n <span class=\"kirby-visually-hidden\">\n {{ actionButtonText }}\n </span>\n </button>\n }\n </div>\n </div>\n\n @if (dismissClick.observed) {\n <div class=\"dismiss\">\n <button\n kirby-button\n size=\"xs\"\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n }\n</kirby-card>\n", styles: [":host{display:block}:host(.none) .blur-image{display:none}@container banner (width < 600px){:host(.none) .dismiss{--kirby-inputs-background-color: var(--kirby-white);--kirby-inputs-background-color-hover: var(--kirby-dark-overlay-10);--kirby-inputs-background-color-active: var(--kirby-dark-overlay-20);--kirby-inputs-color: var(--kirby-black)}}:host(.none) .main-content-body-action-link{color:var(--kirby-semi-dark)}:host(.dark) .blur-image{filter:blur(110px)}:host(.light) .blur-image{filter:blur(110px)}:host(.dark) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000052;z-index:1}:host(.light) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffff73;z-index:1}.blur-image-wrapper{position:absolute;inset:-330px;z-index:-1}.blur-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transform:translateZ(0)}kirby-card{container-name:banner;container-type:inline-size;height:100%}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)){transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)) .breakout{box-shadow:none}.main-content-wrapper{width:100%;padding:8px;box-sizing:border-box;display:flex;flex-direction:column}@container banner (width >= 600px){.main-content-wrapper{gap:16px;flex-direction:initial}}.main-content-image-wrapper{display:flex;overflow:hidden;border-radius:8px}@container banner (width >= 600px){.main-content-image-wrapper{flex:1}}.main-content{display:flex;flex-direction:column;justify-content:space-between}@container banner (width < 600px){.main-content{flex-direction:row}}.main-content{min-height:var(--kirby-x-image-banner-min-height, 84px);box-sizing:border-box;padding:12px 0 8px 8px;overflow:hidden}.main-content .main-content-header{padding-inline-end:8px}@container banner (width >= 600px){.main-content .main-content-header{padding-inline-end:40px}}.main-content:has(.main-content-body-action-link) .main-content-header{padding-inline-end:40px}@container banner (width >= 600px){.main-content{flex:1;gap:12px;padding:8px 8px 8px 0}}.main-content-header p{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin:0;padding:0}.main-content-image{width:100%;height:132px;object-fit:cover;object-position:center}@container banner (width >= 600px){.main-content-image{height:164px}}.main-content-body{display:flex;flex:1;justify-content:space-between;height:100%}.main-content-body p{text-wrap-mode:wrap;margin-bottom:0}@container banner (width >= 600px){.main-content-body{flex-direction:column;max-width:324px}}@container banner (width >= 600px){.main-content-body .main-content-body-action-link{display:none}}.main-content-body-text{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;padding-inline-end:8px}@container banner (width >= 600px){.main-content-body-text{padding-inline-end:48px}}@container banner (width < 600px){.main-content-body-text{-webkit-line-clamp:2;line-clamp:2;max-height:3em}}.breakout{position:initial;border-radius:16px;align-self:center}.breakout:before{content:\"\";display:block;position:absolute;inset:0}.wide-view-action{display:none}@container banner (width >= 600px){.wide-view-action{display:inline-flex;align-self:start;margin:0}}.narrow-view-action{display:inline-flex;margin:0}@container banner (width >= 600px){.narrow-view-action{display:none}}.narrow-view-action:is(a){width:24px;min-width:24px}.narrow-view-action:is(a) kirby-icon{font-size:24px}.narrow-view-action:is(button){min-width:1px;width:1px;height:1px}:host(.show-button-in-narrow-view) .wide-view-action{display:inline-flex}:host(.show-button-in-narrow-view) .narrow-view-action{display:none}.dismiss{position:absolute;top:16px;right:16px;height:fit-content}.dismiss button{margin:0}.text-content-layout{display:flex;flex:1;flex-direction:column;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container banner (width >= 600px){.text-content-layout{gap:12px}}.title ::ng-deep>h1,.title ::ng-deep>h2,.title ::ng-deep>h3,.title ::ng-deep>h4,.title ::ng-deep>h5,.title ::ng-deep>h6{margin-bottom:0;font-size:16px;font-weight:700;line-height:24px}\n"] }]
95
+ args: [{ selector: 'kirby-x-image-banner', imports: [CardComponent, ButtonComponent, IconComponent, ThemeColorDirective], hostDirectives: [ImageBannerHeightDirective], template: "<kirby-card [themeColor]=\"backgroundBlur === 'none' ? 'white' : backgroundBlur\">\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"text-content-layout\">\n <div class=\"main-content-header\">\n @if (title) {\n <p class=\"kirby-text-normal-bold\">\n {{ title }}\n </p>\n } @else {\n <div class=\"title kirby-text-normal-bold\">\n <ng-content select=\"[title]\"></ng-content>\n </div>\n }\n </div>\n\n <div class=\"main-content-body\">\n <p class=\"main-content-body-text kirby-text-small\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </p>\n </div>\n </div>\n @if (externalLink) {\n <!-- Only one of below anchors is displayed at a time -\n we want different behavior on varying screen widths -->\n <a\n kirby-button\n class=\"breakout wide-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <a\n kirby-button\n class=\"breakout narrow-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n }\n\n @if (!externalLink) {\n <!-- Only one of below buttons is displayed at a time -\n we want different behavior on varying screen widths -->\n <button\n kirby-button\n class=\"breakout wide-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n >\n {{ actionButtonText }}\n </button>\n\n <button\n kirby-button\n class=\"breakout narrow-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n >\n <span class=\"kirby-visually-hidden\">\n {{ actionButtonText }}\n </span>\n </button>\n }\n </div>\n </div>\n\n @if (dismissClick.observed) {\n <div class=\"dismiss\">\n <button\n kirby-button\n size=\"xs\"\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n }\n</kirby-card>\n", styles: [":host{display:block}:host(.none) .blur-image{display:none}@container banner (width < 600px){:host(.none) .dismiss{--kirby-inputs-background-color: var(--kirby-white);--kirby-inputs-background-color-hover: var(--kirby-dark-overlay-10);--kirby-inputs-background-color-active: var(--kirby-dark-overlay-20);--kirby-inputs-color: var(--kirby-black)}}:host(.none) .main-content-body-action-link{color:var(--kirby-semi-dark)}:host(.dark) .blur-image{filter:blur(110px)}:host(.light) .blur-image{filter:blur(110px)}:host(.dark) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000052;z-index:1}:host(.light) .blur-image-wrapper:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;background-color:#ffffff73;z-index:1}.blur-image-wrapper{position:absolute;inset:-330px;z-index:-1}.blur-image{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transform:translateZ(0)}kirby-card{container-name:banner;container-type:inline-size;height:100%}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)){transition:all 80ms linear 0ms;box-shadow:0 1px 24px #1c1c1c0a,0 0 0 2px var(--kirby-background-color),0 0 0 4px #4d90fe}kirby-card:focus-within:has(:focus-visible):not(:has(.dismiss :focus)) .breakout{box-shadow:none}.main-content-wrapper{width:100%;padding:8px;box-sizing:border-box;display:flex;flex-direction:column}@container banner (width >= 600px){.main-content-wrapper{gap:16px;flex-direction:initial}}.main-content-image-wrapper{display:flex;overflow:hidden;border-radius:8px}@container banner (width >= 600px){.main-content-image-wrapper{flex:1}}.main-content{display:flex;flex-direction:column;justify-content:space-between;min-height:var(--kirby-x-image-banner-min-height, 84px);box-sizing:border-box;padding:12px 0 8px 8px;overflow:hidden}@container banner (width < 600px){.main-content{flex-direction:row}}.main-content .main-content-header{padding-inline-end:8px}@container banner (width >= 600px){.main-content .main-content-header{padding-inline-end:40px}}.main-content:has(.main-content-body-action-link) .main-content-header{padding-inline-end:40px}@container banner (width >= 600px){.main-content{flex:1;gap:12px;padding:8px 8px 8px 0}}.main-content-header p{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin:0;padding:0}.main-content-image{width:100%;height:132px;object-fit:cover;object-position:center}@container banner (width >= 600px){.main-content-image{height:164px}}.main-content-body{display:flex;flex:1;justify-content:space-between;height:100%}.main-content-body p{text-wrap-mode:wrap;margin-bottom:0}@container banner (width >= 600px){.main-content-body{flex-direction:column;max-width:324px}}@container banner (width >= 600px){.main-content-body .main-content-body-action-link{display:none}}.main-content-body-text{display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;padding-inline-end:8px}@container banner (width >= 600px){.main-content-body-text{padding-inline-end:48px}}@container banner (width < 600px){.main-content-body-text{-webkit-line-clamp:2;line-clamp:2;max-height:3em}}.breakout{position:initial;border-radius:16px;align-self:center}.breakout:before{content:\"\";display:block;position:absolute;inset:0}.wide-view-action{display:none}@container banner (width >= 600px){.wide-view-action{display:inline-flex;align-self:start;margin:0}}.narrow-view-action{display:inline-flex;margin:0}@container banner (width >= 600px){.narrow-view-action{display:none}}.narrow-view-action:is(a){width:24px;min-width:24px}.narrow-view-action:is(a) kirby-icon{font-size:24px}.narrow-view-action:is(button){min-width:1px;width:1px;height:1px}:host(.show-button-in-narrow-view) .wide-view-action{display:inline-flex}:host(.show-button-in-narrow-view) .narrow-view-action{display:none}.dismiss{position:absolute;top:16px;right:16px;height:fit-content}.dismiss button{margin:0}.text-content-layout{display:flex;flex:1;flex-direction:column;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@container banner (width >= 600px){.text-content-layout{gap:12px}}.title ::ng-deep>h1,.title ::ng-deep>h2,.title ::ng-deep>h3,.title ::ng-deep>h4,.title ::ng-deep>h5,.title ::ng-deep>h6{margin-bottom:0;font-size:16px;font-weight:700;line-height:24px}\n"] }]
96
96
  }], ctorParameters: () => [{ type: i1.TranslationService }], propDecorators: { title: [{
97
97
  type: Input
98
98
  }], imagePath: [{
@@ -1 +1 @@
1
- {"version":3,"file":"kirbydesign-extensions-angular-image-banner.mjs","sources":["../../image-banner/src/image-banner-height.directive.ts","../../image-banner/src/image-banner.component.ts","../../image-banner/src/image-banner.component.html","../../image-banner/src/kirbydesign-extensions-angular-image-banner.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnDestroy, OnInit, Renderer2 } from '@angular/core';\nimport { ResizeObserverService } from '@kirbydesign/designsystem/shared';\n\n/**\n * @Description Temporary directive to ensure correct scroll position behavior on Safari.\n *\n * When navigating between stacked pages, scroll position is not correctly restored on Safari,\n * when the nested kirby-card element uses containment and the host element does not have an explicit height.\n */\n@Directive({\n selector: `[kirbyImageBannerResize]`,\n})\nexport class ImageBannerHeightDirective implements OnInit, OnDestroy {\n private currentHeight: number = 0;\n private host = inject(ElementRef);\n private resizeObserverService = inject(ResizeObserverService);\n private renderer = inject(Renderer2);\n\n ngOnInit() {\n this.resizeObserverService.observe(this.host, (entry) => this.setCardHeightOnHost(entry));\n }\n\n ngOnDestroy() {\n this.resizeObserverService.unobserve(this.host);\n }\n\n private setCardHeightOnHost(entry: ResizeObserverEntry) {\n const hostElement = entry.target as HTMLElement;\n const card = hostElement.querySelector('kirby-card');\n const cardHeight = card?.getBoundingClientRect().height;\n\n if (!hostElement || !cardHeight) return;\n if (cardHeight === this.currentHeight) return;\n\n this.currentHeight = cardHeight;\n this.renderer.setStyle(hostElement, 'min-height', `${cardHeight}px`);\n }\n}\n","import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\nimport { ButtonComponent } from '@kirbydesign/designsystem/button';\nimport { IconComponent } from '@kirbydesign/designsystem/icon';\nimport { ThemeColorDirective, TranslationService } from '@kirbydesign/designsystem/shared';\nimport { CardComponent } from '@kirbydesign/designsystem/card';\nimport { ImageBannerHeightDirective } from './image-banner-height.directive';\n\n@Component({\n selector: 'kirby-x-image-banner',\n imports: [CardComponent, ButtonComponent, IconComponent, ThemeColorDirective],\n hostDirectives: [ImageBannerHeightDirective],\n templateUrl: './image-banner.component.html',\n styleUrl: './image-banner.component.scss',\n})\nexport class ImageBannerComponent {\n /**\n * The title placed inside the image banners header.\n */\n @Input() title: string | undefined;\n\n /**\n * The image shown on the banner, and used for the background blur effect.\n */\n @Input() imagePath: string | undefined;\n\n /**\n * The body text placed below the title.\n */\n @Input() bodyText: string | undefined;\n\n /**\n * Whether the button should be shown in narrow view or not.\n */\n @HostBinding('class.show-button-in-narrow-view')\n @Input()\n showButtonInNarrowView: boolean = false;\n\n /**\n * The text of the button in the content area of the image banner. If left empty, will default to 'Read more' (or equivalent translation for [supported locales](https://cookbook.kirby.design/#/home/localization)).\n */\n @Input() actionButtonText: string | undefined = this.translations.get('readMore');\n\n /**\n * When an external link is supplied the entire banner will be an anchor-tag and navigate when activated.\n */\n @Input() externalLink: string | undefined;\n\n /**\n * The blur-effect used for the background.\n */\n @HostBinding('class')\n @Input()\n backgroundBlur: 'dark' | 'light' | 'none' = 'dark';\n\n /**\n * Emitted every time the banner is activated. The entire banner is interactive, and will be activated by click and keyboard interaction.\n */\n @Output() bannerClick = new EventEmitter<Event>();\n\n /**\n * If subscribed to, a dismiss button will be shown. Emitted every time the dismiss button is activated by click and keyboard interaction.\n */\n @Output() dismissClick = new EventEmitter<Event>();\n\n /**\n * If the input imagePath results in an error, it will be reflected in this output.\n */\n @Output()\n imageError = new EventEmitter<ErrorEvent>();\n\n constructor(public translations: TranslationService) {}\n\n public bannerClicked(event: Event) {\n const eventTarget = event.target as HTMLElement;\n const dismissButtonClicked = eventTarget.closest('.dismiss');\n if (dismissButtonClicked) return;\n this.bannerClick.emit(event);\n }\n\n public dismissClicked(event: Event) {\n this.dismissClick.emit(event);\n }\n\n public onImageError($event: ErrorEvent) {\n this.imageError.emit($event);\n }\n}\n","<kirby-card [themeColor]=\"backgroundBlur === 'none' ? 'white' : backgroundBlur\">\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"text-content-layout\">\n <div class=\"main-content-header\">\n @if (title) {\n <p class=\"kirby-text-normal-bold\">\n {{ title }}\n </p>\n } @else {\n <div class=\"title kirby-text-normal-bold\">\n <ng-content select=\"[title]\"></ng-content>\n </div>\n }\n </div>\n\n <div class=\"main-content-body\">\n <p class=\"main-content-body-text kirby-text-small\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </p>\n </div>\n </div>\n @if (externalLink) {\n <!-- Only one of below anchors is displayed at a time -\n we want different behavior on varying screen widths -->\n <a\n kirby-button\n class=\"breakout wide-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <a\n kirby-button\n class=\"breakout narrow-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n }\n\n @if (!externalLink) {\n <!-- Only one of below buttons is displayed at a time -\n we want different behavior on varying screen widths -->\n <button\n kirby-button\n class=\"breakout wide-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n >\n {{ actionButtonText }}\n </button>\n\n <button\n kirby-button\n class=\"breakout narrow-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n >\n <span class=\"kirby-visually-hidden\">\n {{ actionButtonText }}\n </span>\n </button>\n }\n </div>\n </div>\n\n @if (dismissClick.observed) {\n <div class=\"dismiss\">\n <button\n kirby-button\n size=\"xs\"\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n }\n</kirby-card>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.ImageBannerHeightDirective"],"mappings":";;;;;;;;AAGA;;;;;AAKG;MAIU,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;QAIU,IAAA,CAAA,aAAa,GAAW,CAAC;AACzB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACrD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;AAqBrC,IAAA;IAnBC,QAAQ,GAAA;QACN,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC3F;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;IACjD;AAEQ,IAAA,mBAAmB,CAAC,KAA0B,EAAA;AACpD,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAqB;QAC/C,MAAM,IAAI,GAAG,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC;QACpD,MAAM,UAAU,GAAG,IAAI,EAAE,qBAAqB,EAAE,CAAC,MAAM;AAEvD,QAAA,IAAI,CAAC,WAAW,IAAI,CAAC,UAAU;YAAE;AACjC,QAAA,IAAI,UAAU,KAAK,IAAI,CAAC,aAAa;YAAE;AAEvC,QAAA,IAAI,CAAC,aAAa,GAAG,UAAU;AAC/B,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,YAAY,EAAE,CAAA,EAAG,UAAU,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AA,EAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,6OAAA,EAAA,MAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAKjE,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAPhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAAA,OAAA,EACvB,CAAC,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,CAAC,EAAA,cAAA,EAC7D,CAAC,0BAA0B,CAAC,EAAA,QAAA,EAAA,04GAAA,EAAA,MAAA,EAAA,CAAA,4wIAAA,CAAA,EAAA;;sBAQ3C;;sBAKA;;sBAKA;;sBAKA,WAAW;uBAAC,kCAAkC;;sBAC9C;;sBAMA;;sBAKA;;sBAKA,WAAW;uBAAC,OAAO;;sBACnB;;sBAMA;;sBAKA;;sBAKA;;;AEnEH;;AAEG;;;;"}
1
+ {"version":3,"file":"kirbydesign-extensions-angular-image-banner.mjs","sources":["../../image-banner/src/image-banner-height.directive.ts","../../image-banner/src/image-banner.component.ts","../../image-banner/src/image-banner.component.html","../../image-banner/src/kirbydesign-extensions-angular-image-banner.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnDestroy, OnInit, Renderer2 } from '@angular/core';\nimport { ResizeObserverService } from '@kirbydesign/designsystem/shared';\n\n/**\n * @Description Temporary directive to ensure correct scroll position behavior on Safari.\n *\n * When navigating between stacked pages, scroll position is not correctly restored on Safari,\n * when the nested kirby-card element uses containment and the host element does not have an explicit height.\n */\n@Directive({\n selector: `[kirbyImageBannerResize]`,\n})\nexport class ImageBannerHeightDirective implements OnInit, OnDestroy {\n private currentHeight: number = 0;\n private host = inject(ElementRef);\n private resizeObserverService = inject(ResizeObserverService);\n private renderer = inject(Renderer2);\n\n ngOnInit() {\n this.resizeObserverService.observe(this.host, (entry) => this.setCardHeightOnHost(entry));\n }\n\n ngOnDestroy() {\n this.resizeObserverService.unobserve(this.host);\n }\n\n private setCardHeightOnHost(entry: ResizeObserverEntry) {\n const hostElement = entry.target as HTMLElement;\n const card = hostElement.querySelector('kirby-card');\n const cardHeight = card?.getBoundingClientRect().height;\n\n if (!hostElement || !cardHeight) return;\n if (cardHeight === this.currentHeight) return;\n\n this.currentHeight = cardHeight;\n this.renderer.setStyle(hostElement, 'min-height', `${cardHeight}px`);\n }\n}\n","import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\nimport { ButtonComponent } from '@kirbydesign/designsystem/button';\nimport { IconComponent } from '@kirbydesign/designsystem/icon';\nimport { ThemeColorDirective, TranslationService } from '@kirbydesign/designsystem/shared';\nimport { CardComponent } from '@kirbydesign/designsystem/card';\nimport { ImageBannerHeightDirective } from './image-banner-height.directive';\n\n@Component({\n selector: 'kirby-x-image-banner',\n imports: [CardComponent, ButtonComponent, IconComponent, ThemeColorDirective],\n hostDirectives: [ImageBannerHeightDirective],\n templateUrl: './image-banner.component.html',\n styleUrl: './image-banner.component.scss',\n})\nexport class ImageBannerComponent {\n /**\n * The title placed inside the image banners header.\n */\n @Input() title: string | undefined;\n\n /**\n * The image shown on the banner, and used for the background blur effect.\n */\n @Input() imagePath: string | undefined;\n\n /**\n * The body text placed below the title.\n */\n @Input() bodyText: string | undefined;\n\n /**\n * Whether the button should be shown in narrow view or not.\n */\n @HostBinding('class.show-button-in-narrow-view')\n @Input()\n showButtonInNarrowView: boolean = false;\n\n /**\n * The text of the button in the content area of the image banner. If left empty, will default to 'Read more' (or equivalent translation for [supported locales](https://cookbook.kirby.design/#/home/localization)).\n */\n @Input() actionButtonText: string | undefined = this.translations.get('readMore');\n\n /**\n * When an external link is supplied the entire banner will be an anchor-tag and navigate when activated.\n */\n @Input() externalLink: string | undefined;\n\n /**\n * The blur-effect used for the background.\n */\n @HostBinding('class')\n @Input()\n backgroundBlur: 'dark' | 'light' | 'none' = 'dark';\n\n /**\n * Emitted every time the banner is activated. The entire banner is interactive, and will be activated by click and keyboard interaction.\n */\n @Output() bannerClick = new EventEmitter<Event>();\n\n /**\n * If subscribed to, a dismiss button will be shown. Emitted every time the dismiss button is activated by click and keyboard interaction.\n */\n @Output() dismissClick = new EventEmitter<Event>();\n\n /**\n * If the input imagePath results in an error, it will be reflected in this output.\n */\n @Output()\n imageError = new EventEmitter<ErrorEvent>();\n\n constructor(public translations: TranslationService) {}\n\n public bannerClicked(event: Event) {\n const eventTarget = event.target as HTMLElement;\n const dismissButtonClicked = eventTarget.closest('.dismiss');\n if (dismissButtonClicked) return;\n this.bannerClick.emit(event);\n }\n\n public dismissClicked(event: Event) {\n this.dismissClick.emit(event);\n }\n\n public onImageError($event: ErrorEvent) {\n this.imageError.emit($event);\n }\n}\n","<kirby-card [themeColor]=\"backgroundBlur === 'none' ? 'white' : backgroundBlur\">\n <div class=\"blur-image-wrapper\">\n <img class=\"blur-image\" [src]=\"imagePath\" alt=\"\" />\n </div>\n\n <div class=\"main-content-wrapper\">\n <div class=\"main-content-image-wrapper\">\n <img class=\"main-content-image\" [src]=\"imagePath\" alt=\"\" (error)=\"onImageError($event)\" />\n </div>\n\n <div class=\"main-content\">\n <div class=\"text-content-layout\">\n <div class=\"main-content-header\">\n @if (title) {\n <p class=\"kirby-text-normal-bold\">\n {{ title }}\n </p>\n } @else {\n <div class=\"title kirby-text-normal-bold\">\n <ng-content select=\"[title]\"></ng-content>\n </div>\n }\n </div>\n\n <div class=\"main-content-body\">\n <p class=\"main-content-body-text kirby-text-small\">\n @if (bodyText) {\n {{ bodyText }}\n } @else {\n <ng-content select=\"[bodyText]\"></ng-content>\n }\n </p>\n </div>\n </div>\n @if (externalLink) {\n <!-- Only one of below anchors is displayed at a time -\n we want different behavior on varying screen widths -->\n <a\n kirby-button\n class=\"breakout wide-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n\n <a\n kirby-button\n class=\"breakout narrow-view-action\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [href]=\"externalLink\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n target=\"_blank\"\n size=\"sm\"\n >\n {{ actionButtonText }}\n <kirby-icon name=\"link\"></kirby-icon>\n </a>\n }\n\n @if (!externalLink) {\n <!-- Only one of below buttons is displayed at a time -\n we want different behavior on varying screen widths -->\n <button\n kirby-button\n class=\"breakout wide-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n >\n {{ actionButtonText }}\n </button>\n\n <button\n kirby-button\n class=\"breakout narrow-view-action\"\n size=\"sm\"\n (click)=\"bannerClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [noDecoration]=\"true\"\n [showIconOnly]=\"true\"\n >\n <span class=\"kirby-visually-hidden\">\n {{ actionButtonText }}\n </span>\n </button>\n }\n </div>\n </div>\n\n @if (dismissClick.observed) {\n <div class=\"dismiss\">\n <button\n kirby-button\n size=\"xs\"\n (click)=\"dismissClicked($event)\"\n [attentionLevel]=\"backgroundBlur === 'none' ? '3' : '2'\"\n [showIconOnly]=\"true\"\n [attr.aria-label]=\"translations.get('close') + ' ' + title\"\n >\n <kirby-icon name=\"close\"></kirby-icon>\n </button>\n </div>\n }\n</kirby-card>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2.ImageBannerHeightDirective"],"mappings":";;;;;;;;AAGA;;;;;AAKG;MAIU,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;QAIU,IAAA,CAAA,aAAa,GAAW,CAAC;AACzB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,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