@postnord/pn-marketweb-components 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-b02670c2.js +4 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pn-chat-message_2.cjs.entry.js +2 -1
- package/dist/cjs/pn-chat-message_2.cjs.entry.js.map +1 -1
- package/dist/cjs/pn-chat.cjs.entry.js +1 -1
- package/dist/cjs/{pn-chat.service-eaf6ed50.js → pn-chat.service-5a8d89b9.js} +2 -4
- package/dist/cjs/pn-chat.service-5a8d89b9.js.map +1 -0
- package/dist/cjs/pn-market-web-components.cjs.js +1 -1
- package/dist/cjs/pn-marketweb-table.cjs.entry.js +37 -29
- package/dist/cjs/pn-marketweb-table.cjs.entry.js.map +1 -1
- package/dist/cjs/pn-usp-promoter.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -3
- package/dist/collection/components/widgets/pn-chat/pn-chat-message/pn-chat-message.js +2 -1
- package/dist/collection/components/widgets/pn-chat/pn-chat-message/pn-chat-message.js.map +1 -1
- package/dist/collection/components/widgets/pn-chat/pn-chat-stories-constants.js +23 -163
- package/dist/collection/components/widgets/pn-chat/pn-chat-stories-constants.js.map +1 -1
- package/dist/collection/components/widgets/pn-chat/pn-chat.service.js +1 -3
- package/dist/collection/components/widgets/pn-chat/pn-chat.service.js.map +1 -1
- package/dist/collection/components/widgets/pn-chat/pn-chat.stories.js +4 -4
- package/dist/collection/components/widgets/pn-chat/pn-chat.stories.js.map +1 -1
- package/dist/collection/components/widgets/pn-marketweb-table/pn-marketweb-table.css +10 -1
- package/dist/collection/components/widgets/pn-marketweb-table/pn-marketweb-table.js +2 -2
- package/dist/collection/components/widgets/pn-marketweb-table/pn-marketweb-table.js.map +1 -1
- package/dist/collection/components/widgets/pn-marketweb-table/pn-marketweb-table.stories.js +37 -1
- package/dist/collection/components/widgets/pn-marketweb-table/pn-marketweb-table.stories.js.map +1 -1
- package/dist/collection/components/widgets/pn-marketweb-table/translations.js +33 -25
- package/dist/collection/components/widgets/pn-marketweb-table/translations.js.map +1 -1
- package/dist/collection/components/widgets/pn-usp-promoter/pn-usp-promoter.js +1 -1
- package/dist/collection/globals/types.js.map +1 -1
- package/dist/components/pn-chat-message2.js +2 -1
- package/dist/components/pn-chat-message2.js.map +1 -1
- package/dist/components/pn-chat.service.js +1 -3
- package/dist/components/pn-chat.service.js.map +1 -1
- package/dist/components/pn-marketweb-search.js +126 -1
- package/dist/components/pn-marketweb-search.js.map +1 -1
- package/dist/components/pn-marketweb-table.js +36 -28
- package/dist/components/pn-marketweb-table.js.map +1 -1
- package/dist/components/pn-usp-promoter.js +1 -1
- package/dist/esm/index-c311acd6.js +4 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pn-chat-message_2.entry.js +2 -1
- package/dist/esm/pn-chat-message_2.entry.js.map +1 -1
- package/dist/esm/pn-chat.entry.js +1 -1
- package/dist/esm/{pn-chat.service-f4037d6f.js → pn-chat.service-0def5c4e.js} +2 -4
- package/dist/esm/pn-chat.service-0def5c4e.js.map +1 -0
- package/dist/esm/pn-market-web-components.js +1 -1
- package/dist/esm/pn-marketweb-table.entry.js +37 -29
- package/dist/esm/pn-marketweb-table.entry.js.map +1 -1
- package/dist/esm/pn-usp-promoter.entry.js +1 -1
- package/dist/package.json +1 -1
- package/dist/pn-market-web-components/p-3a936c5d.entry.js +2 -0
- package/dist/pn-market-web-components/p-3a936c5d.entry.js.map +1 -0
- package/dist/pn-market-web-components/p-6bec8d72.js +2 -0
- package/dist/pn-market-web-components/p-6bec8d72.js.map +1 -0
- package/dist/pn-market-web-components/p-923aa6d2.entry.js +2 -0
- package/dist/pn-market-web-components/p-923aa6d2.entry.js.map +1 -0
- package/dist/pn-market-web-components/{p-cc7c596e.entry.js → p-a298a263.entry.js} +2 -2
- package/dist/pn-market-web-components/{p-f21311ad.entry.js → p-da56370b.entry.js} +2 -2
- package/dist/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/dist/pn-market-web-components/pn-market-web-components.esm.js.map +1 -1
- package/dist/types/components/widgets/pn-chat/pn-chat-message/pn-chat-message.d.ts +1 -0
- package/dist/types/components/widgets/pn-chat/pn-chat-stories-constants.d.ts +6 -127
- package/dist/types/components/widgets/pn-marketweb-table/translations.d.ts +8 -0
- package/dist/types/components.d.ts +0 -100
- package/dist/types/globals/types.d.ts +2 -0
- package/dist/vscode-data.json +0 -142
- package/package.json +1 -1
- package/dist/cjs/pn-chat.service-eaf6ed50.js.map +0 -1
- package/dist/cjs/pn-search.cjs.entry.js +0 -54
- package/dist/cjs/pn-search.cjs.entry.js.map +0 -1
- package/dist/cjs/pn-usp-simple.cjs.entry.js +0 -56
- package/dist/cjs/pn-usp-simple.cjs.entry.js.map +0 -1
- package/dist/collection/components/widgets/pn-search/pn-search.css +0 -140
- package/dist/collection/components/widgets/pn-search/pn-search.js +0 -368
- package/dist/collection/components/widgets/pn-search/pn-search.js.map +0 -1
- package/dist/collection/components/widgets/pn-search/pn-search.stories.js +0 -54
- package/dist/collection/components/widgets/pn-search/pn-search.stories.js.map +0 -1
- package/dist/collection/components/widgets/pn-usp-simple/pn-usp-simple.css +0 -116
- package/dist/collection/components/widgets/pn-usp-simple/pn-usp-simple.js +0 -269
- package/dist/collection/components/widgets/pn-usp-simple/pn-usp-simple.js.map +0 -1
- package/dist/collection/components/widgets/pn-usp-simple/pn-usp-simple.stories.js +0 -63
- package/dist/collection/components/widgets/pn-usp-simple/pn-usp-simple.stories.js.map +0 -1
- package/dist/components/pn-marketweb-search2.js +0 -130
- package/dist/components/pn-marketweb-search2.js.map +0 -1
- package/dist/components/pn-search.d.ts +0 -11
- package/dist/components/pn-search.js +0 -91
- package/dist/components/pn-search.js.map +0 -1
- package/dist/components/pn-usp-simple.d.ts +0 -11
- package/dist/components/pn-usp-simple.js +0 -82
- package/dist/components/pn-usp-simple.js.map +0 -1
- package/dist/esm/pn-chat.service-f4037d6f.js.map +0 -1
- package/dist/esm/pn-search.entry.js +0 -50
- package/dist/esm/pn-search.entry.js.map +0 -1
- package/dist/esm/pn-usp-simple.entry.js +0 -52
- package/dist/esm/pn-usp-simple.entry.js.map +0 -1
- package/dist/pn-market-web-components/p-04107723.entry.js +0 -2
- package/dist/pn-market-web-components/p-04107723.entry.js.map +0 -1
- package/dist/pn-market-web-components/p-10776075.entry.js +0 -2
- package/dist/pn-market-web-components/p-10776075.entry.js.map +0 -1
- package/dist/pn-market-web-components/p-2fd60147.entry.js +0 -2
- package/dist/pn-market-web-components/p-2fd60147.entry.js.map +0 -1
- package/dist/pn-market-web-components/p-a079c496.js +0 -2
- package/dist/pn-market-web-components/p-a079c496.js.map +0 -1
- package/dist/pn-market-web-components/p-e733f44f.entry.js +0 -2
- package/dist/pn-market-web-components/p-e733f44f.entry.js.map +0 -1
- package/dist/types/components/widgets/pn-search/pn-search.d.ts +0 -29
- package/dist/types/components/widgets/pn-search/pn-search.stories.d.ts +0 -7
- package/dist/types/components/widgets/pn-usp-simple/pn-usp-simple.d.ts +0 -19
- package/dist/types/components/widgets/pn-usp-simple/pn-usp-simple.stories.d.ts +0 -7
- /package/dist/pn-market-web-components/{p-cc7c596e.entry.js.map → p-a298a263.entry.js.map} +0 -0
- /package/dist/pn-market-web-components/{p-f21311ad.entry.js.map → p-da56370b.entry.js.map} +0 -0
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-b02670c2.js');
|
|
6
|
-
const HeadingTag = require('./HeadingTag-19376e1f.js');
|
|
7
|
-
|
|
8
|
-
const pnUspSimpleCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}:root{--usp-preamble-margin:clamp(1.5rem, 3vw, 1.8rem)}.pn-usp-simple{background:linear-gradient(90deg, #ffffff 0%, #effbff 17.44%);color:#2d2013;display:flex;flex-direction:column-reverse;max-width:100%;padding:clamp(2rem, 5vw, 5rem)}.pn-usp-simple .heading{font-size:clamp(2rem, 4vw, 3rem);font-weight:700;margin-bottom:1rem}.pn-usp-simple .preamble{font-size:clamp(1rem, 4vw, 1.6rem);margin-top:var(--usp-preamble-margin);margin-bottom:var(--usp-preamble-margin)}.pn-usp-simple .cta{display:flex;font-size:clamp(1rem, 4vw, 1.6rem);flex-direction:column;gap:clamp(1rem, 4vw, 1.2rem);padding:0 6rem}.pn-usp-simple .image-container{display:flex;align-items:center;justify-content:center;margin-bottom:2rem}.pn-usp-simple .image-container .graphics{--pn-width:12rem !important;--pn-height:12rem !important}.pn-usp-simple .image-container .image{border-radius:50%}@media (min-width: 768px){.pn-usp-simple{flex-direction:row;align-items:center}.pn-usp-simple .content{max-width:60%}.pn-usp-simple .cta{flex-direction:row;gap:clamp(2rem, 3vw, 3rem);padding:0}.pn-usp-simple .image-container{flex:clamp(15rem, 3vw, 20rem);margin-bottom:0}.pn-usp-simple .image-container .graphics{--pn-width:15rem;--pn-height:15rem}}@media (min-width: 1200px){.pn-usp-simple{max-width:1140px;margin:0 auto}.pn-usp-simple .content{max-width:50%}.pn-usp-simple .image-container .graphics{--pn-width:18rem;--pn-height:18rem}}@media (min-width: 1640px){.pn-usp-simple{max-width:1400px}.pn-usp-simple .image-container .graphics{--pn-width:20rem;--pn-height:20rem}}";
|
|
9
|
-
const PnUspSimpleStyle0 = pnUspSimpleCss;
|
|
10
|
-
|
|
11
|
-
const PnUspSimple = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.heading = undefined;
|
|
15
|
-
this.headingLevel = 'h2';
|
|
16
|
-
this.preamble = undefined;
|
|
17
|
-
this.ctaButtonsLabel = undefined;
|
|
18
|
-
this.primaryButtonText = undefined;
|
|
19
|
-
this.primaryButtonUrl = undefined;
|
|
20
|
-
this.primaryButtonIconSvg = undefined;
|
|
21
|
-
this.secondaryButtonText = undefined;
|
|
22
|
-
this.secondaryButtonUrl = undefined;
|
|
23
|
-
this.pnIllustrationSvg = undefined;
|
|
24
|
-
this.imageUrl = undefined;
|
|
25
|
-
this.imageAltText = undefined;
|
|
26
|
-
}
|
|
27
|
-
get hasPrimaryButton() {
|
|
28
|
-
return Boolean(this.primaryButtonText && this.primaryButtonUrl);
|
|
29
|
-
}
|
|
30
|
-
get hasSecondaryButton() {
|
|
31
|
-
return Boolean(this.secondaryButtonText && this.secondaryButtonUrl);
|
|
32
|
-
}
|
|
33
|
-
renderButton(props, isPrimary) {
|
|
34
|
-
const buttonType = isPrimary ? 'primary' : 'secondary';
|
|
35
|
-
return (index.h("pn-button", { icon: props.iconSvg, "left-icon": Boolean(props.iconSvg), href: props.url, class: "btn", "data-button-type": buttonType, appearance: isPrimary ? 'default' : 'light' }, props.text));
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
const hasButtons = this.hasPrimaryButton || this.hasSecondaryButton;
|
|
39
|
-
const headingId = 'usp-heading';
|
|
40
|
-
return (index.h(index.Host, { key: '86a81876d75377462d4a94cc9ca0d8a7b8150791' }, index.h("div", { key: '59568c012efdb309dc7e9b3ed64a0a344ab28360', class: "pn-usp-simple", role: "region", "aria-labelledby": this.heading ? headingId : undefined }, index.h("div", { key: '54685035dc6a2eba2130693961b87fe315023f27', class: "content" }, this.heading && (index.h(HeadingTag.HeadingTag, { key: '1f0b464103fdcbf3b18ab6adf4f82b454e5c81eb', id: headingId, level: this.headingLevel, cssClass: "heading" }, this.heading)), this.preamble && (index.h("div", { key: 'd143480b02ecb45130ac2a825e392dbe7c0f3128', class: "preamble" }, this.preamble)), hasButtons && (index.h("div", { key: 'f618b4b041cf79eac3b67dd6d3c26697e29a72c6', class: "cta", role: "group", "aria-label": this.ctaButtonsLabel }, this.hasPrimaryButton &&
|
|
41
|
-
this.renderButton({
|
|
42
|
-
text: this.primaryButtonText,
|
|
43
|
-
url: this.primaryButtonUrl,
|
|
44
|
-
iconSvg: this.primaryButtonIconSvg,
|
|
45
|
-
}, true), this.hasSecondaryButton &&
|
|
46
|
-
this.renderButton({
|
|
47
|
-
text: this.secondaryButtonText,
|
|
48
|
-
url: this.secondaryButtonUrl,
|
|
49
|
-
}, false)))), index.h("div", { key: 'cb22f2bd663e90bd009fac12d4662c729bffdd68', class: "image-container", "aria-hidden": !this.imageAltText }, this.imageUrl && index.h("img", { key: 'f76f0a6cbdb0cdc8847f062410f7c20c847d8a47', class: "image graphics", src: this.imageUrl, alt: this.imageAltText || '', loading: "lazy" }), !this.imageUrl && this.pnIllustrationSvg && index.h("pn-illustration", { key: '5653434436d33c04820f3ee201fd1e2853008e1b', class: "illustration graphics", illustration: this.pnIllustrationSvg, role: "presentation" })))));
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
PnUspSimple.style = PnUspSimpleStyle0;
|
|
53
|
-
|
|
54
|
-
exports.pn_usp_simple = PnUspSimple;
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=pn-usp-simple.cjs.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"pn-usp-simple.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,cAAc,GAAG,25DAA25D,CAAC;AACn7D,0BAAe,cAAc;;MCahB,WAAW;;;;4BAEe,IAAI;;;;;;;;;;;;IAYzC,IAAY,gBAAgB;QAC1B,OAAO,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;KACjE;IAED,IAAY,kBAAkB;QAC5B,OAAO,OAAO,CAAC,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC;KACrE;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AY,CACf;gBACE,IAAI,EAAE,IAAI,CAAC,mBAAoB;gBAC/B,GAAG,EAAE,IAAI,CAAC,kBAAmB;aAC9B,EACD,KAAK,CACN,CACC,CACP,CACG,EACNA,kEAAK,KAAK,EAAC,iBAAiB,iBAAc,CAAC,IAAI,CAAC,YAAY,IACzD,IAAI,CAAC,QAAQ,IAAIA,kEAAK,KAAK,EAAC,gBAAgB,EAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE,OAAO,EAAC,MAAM,GAAG,EAChH,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,iBAAiB,IAAIA,8EAAiB,KAAK,EAAC,uBAAuB,EAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,EAAC,cAAc,GAAG,CACpJ,CACF,CACD,EACP;KACH;;;;;;","names":["h","Host","HeadingTag"],"sources":["src/components/widgets/pn-usp-simple/pn-usp-simple.scss?tag=pn-usp-simple","src/components/widgets/pn-usp-simple/pn-usp-simple.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\n:root {\n --usp-preamble-margin: clamp(1.5rem, 3vw, 1.8rem);\n}\n\n.pn-usp-simple {\n background: linear-gradient(90deg, $white 0%, $blue25 17.44%);\n color: $gray900;\n display: flex;\n flex-direction: column-reverse;\n max-width: 100%;\n padding: clamp(2rem, 5vw, 5rem);\n\n .heading {\n font-size: clamp(2rem, 4vw, 3rem);\n font-weight: 700;\n margin-bottom: 1rem;\n }\n\n .preamble {\n font-size: clamp(1rem, 4vw, 1.6rem);\n margin-top: var(--usp-preamble-margin);\n margin-bottom: var(--usp-preamble-margin);\n }\n\n .cta {\n display: flex;\n font-size: clamp(1rem, 4vw, 1.6rem);\n flex-direction: column;\n gap: clamp(1rem, 4vw, 1.2rem);\n padding: 0 6rem;\n }\n\n .image-container {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 2rem;\n\n .graphics {\n --pn-width: #{$graphicsWidth} !important;\n --pn-height: #{$graphicsWidth} !important;\n }\n\n .image {\n border-radius: 50%;\n }\n }\n}\n\n@media (min-width: 768px) {\n .pn-usp-simple {\n flex-direction: row;\n align-items: center;\n\n .content {\n max-width: 60%;\n }\n\n .cta {\n flex-direction: row;\n gap: clamp(2rem, 3vw, 3rem);\n padding: 0;\n }\n\n .image-container {\n flex: clamp(15rem, 3vw, 20rem);\n margin-bottom: 0;\n\n .graphics {\n --pn-width: #{$graphicsWidthMd};\n --pn-height: #{$graphicsWidthMd};\n }\n }\n }\n}\n\n@media (min-width: 992px) {\n}\n\n@media (min-width: 1200px) {\n .pn-usp-simple {\n max-width: 1140px;\n margin: 0 auto;\n\n .content {\n max-width: 50%;\n }\n\n .image-container {\n .graphics {\n --pn-width: #{$graphicsWidthXl};\n --pn-height: #{$graphicsWidthXl};\n }\n }\n }\n}\n\n@media (min-width: 1640px) {\n .pn-usp-simple {\n max-width: 1400px;\n\n .image-container {\n .graphics {\n --pn-width: #{$graphicsWidthXxl};\n --pn-height: #{$graphicsWidthXxl};\n }\n }\n }\n}\n","import { HeadingLevel } from '@/components';\nimport { HeadingTag } from '@/globals/HeadingTag';\nimport { Component, Host, Prop, h } from '@stencil/core';\n\ninterface ButtonProps {\n text: string;\n url: string;\n iconSvg?: string;\n}\n\n@Component({\n tag: 'pn-usp-simple',\n styleUrl: 'pn-usp-simple.scss',\n})\nexport class PnUspSimple {\n @Prop() heading?: string;\n @Prop() headingLevel: HeadingLevel = 'h2';\n @Prop() preamble?: string;\n @Prop() ctaButtonsLabel?: string;\n @Prop() primaryButtonText?: string;\n @Prop() primaryButtonUrl?: string;\n @Prop() primaryButtonIconSvg?: string;\n @Prop() secondaryButtonText?: string;\n @Prop() secondaryButtonUrl?: string;\n @Prop() pnIllustrationSvg?: string;\n @Prop() imageUrl?: string;\n @Prop() imageAltText?: string;\n\n private get hasPrimaryButton(): boolean {\n return Boolean(this.primaryButtonText && this.primaryButtonUrl);\n }\n\n private get hasSecondaryButton(): boolean {\n return Boolean(this.secondaryButtonText && this.secondaryButtonUrl);\n }\n\n private renderButton(props: ButtonProps, isPrimary: boolean) {\n const buttonType = isPrimary ? 'primary' : 'secondary';\n return (\n <pn-button\n icon={props.iconSvg}\n left-icon={Boolean(props.iconSvg)}\n href={props.url}\n class=\"btn\"\n data-button-type={buttonType}\n appearance={isPrimary ? 'default' : 'light'}\n >\n {props.text}\n </pn-button>\n );\n }\n\n render() {\n const hasButtons = this.hasPrimaryButton || this.hasSecondaryButton;\n const headingId = 'usp-heading';\n\n return (\n <Host>\n <div class=\"pn-usp-simple\" role=\"region\" aria-labelledby={this.heading ? headingId : undefined}>\n <div class=\"content\">\n {this.heading && (\n <HeadingTag id={headingId} level={this.headingLevel} cssClass=\"heading\">\n {this.heading}\n </HeadingTag>\n )}\n\n {this.preamble && (\n <div class=\"preamble\">\n {this.preamble}\n </div>\n )}\n\n {hasButtons && (\n <div class=\"cta\" role=\"group\" aria-label={this.ctaButtonsLabel}>\n {this.hasPrimaryButton &&\n this.renderButton(\n {\n text: this.primaryButtonText!,\n url: this.primaryButtonUrl!,\n iconSvg: this.primaryButtonIconSvg,\n },\n true,\n )}\n {this.hasSecondaryButton &&\n this.renderButton(\n {\n text: this.secondaryButtonText!,\n url: this.secondaryButtonUrl!,\n },\n false,\n )}\n </div>\n )}\n </div>\n <div class=\"image-container\" aria-hidden={!this.imageAltText}>\n {this.imageUrl && <img class=\"image graphics\" src={this.imageUrl} alt={this.imageAltText || ''} loading=\"lazy\" />}\n {!this.imageUrl && this.pnIllustrationSvg && <pn-illustration class=\"illustration graphics\" illustration={this.pnIllustrationSvg} role=\"presentation\" />}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
pn-button-dropdown .pn-button-dropdown > pn-button > .pn-button {
|
|
2
|
-
min-height: initial;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.sr-only {
|
|
6
|
-
position: absolute;
|
|
7
|
-
width: 1px;
|
|
8
|
-
height: 1px;
|
|
9
|
-
padding: 0;
|
|
10
|
-
margin: -1px;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
clip: rect(0, 0, 0, 0);
|
|
13
|
-
white-space: nowrap;
|
|
14
|
-
border-width: 0;
|
|
15
|
-
}
|
|
16
|
-
@media screen and (max-width: 767px) {
|
|
17
|
-
.sr-only-mobile {
|
|
18
|
-
position: absolute;
|
|
19
|
-
width: 1px;
|
|
20
|
-
height: 1px;
|
|
21
|
-
padding: 0;
|
|
22
|
-
margin: -1px;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
clip: rect(0, 0, 0, 0);
|
|
25
|
-
white-space: nowrap;
|
|
26
|
-
border-width: 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.pn-search {
|
|
31
|
-
background-color: transparent;
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
align-items: center;
|
|
35
|
-
}
|
|
36
|
-
.pn-search .graphics-container {
|
|
37
|
-
padding-bottom: 1rem;
|
|
38
|
-
}
|
|
39
|
-
.pn-search .graphics {
|
|
40
|
-
border-radius: 50%;
|
|
41
|
-
height: clamp(12rem, 14vw, 16rem);
|
|
42
|
-
width: clamp(12rem, 14vw, 16rem);
|
|
43
|
-
aspect-ratio: 1/1;
|
|
44
|
-
object-fit: cover;
|
|
45
|
-
}
|
|
46
|
-
.pn-search .illustration {
|
|
47
|
-
--pn-width: 12rem;
|
|
48
|
-
--pn-height: 12rem;
|
|
49
|
-
}
|
|
50
|
-
.pn-search .search-container {
|
|
51
|
-
margin: clamp(1rem, 3vh, 1.5rem) 0;
|
|
52
|
-
}
|
|
53
|
-
.pn-search .search-container ::placeholder {
|
|
54
|
-
color: #5e554a;
|
|
55
|
-
}
|
|
56
|
-
.pn-search .main {
|
|
57
|
-
text-align: center;
|
|
58
|
-
width: 100%;
|
|
59
|
-
}
|
|
60
|
-
.pn-search .heading {
|
|
61
|
-
color: #000000;
|
|
62
|
-
font-size: clamp(2rem, 4vw, 3.2rem);
|
|
63
|
-
line-height: 1;
|
|
64
|
-
margin: 0;
|
|
65
|
-
}
|
|
66
|
-
.pn-search .search-container {
|
|
67
|
-
display: flex;
|
|
68
|
-
width: 100%;
|
|
69
|
-
}
|
|
70
|
-
.pn-search .search-container .search-component input,
|
|
71
|
-
.pn-search .search-container .search-component button {
|
|
72
|
-
font-size: 1.6rem;
|
|
73
|
-
}
|
|
74
|
-
.pn-search .cta {
|
|
75
|
-
display: flex;
|
|
76
|
-
flex-direction: row;
|
|
77
|
-
justify-content: flex-start;
|
|
78
|
-
align-items: center;
|
|
79
|
-
margin-top: 2rem;
|
|
80
|
-
gap: 1.2rem;
|
|
81
|
-
width: 100%;
|
|
82
|
-
}
|
|
83
|
-
.pn-search .btn-mw[data-secondary] {
|
|
84
|
-
color: #005d92;
|
|
85
|
-
font-weight: 500;
|
|
86
|
-
text-decoration: underline;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
@media (min-width: 768px) {
|
|
90
|
-
.pn-search {
|
|
91
|
-
flex-direction: row;
|
|
92
|
-
align-items: flex-start;
|
|
93
|
-
}
|
|
94
|
-
.pn-search .graphics-container {
|
|
95
|
-
padding-right: clamp(2rem, 3vw, 4rem);
|
|
96
|
-
padding-bottom: 0;
|
|
97
|
-
}
|
|
98
|
-
.pn-search .illustration {
|
|
99
|
-
--pn-width: 15rem;
|
|
100
|
-
--pn-height: 15rem;
|
|
101
|
-
}
|
|
102
|
-
.pn-search .main {
|
|
103
|
-
text-align: left;
|
|
104
|
-
}
|
|
105
|
-
.pn-search pn-marketweb-search {
|
|
106
|
-
width: 40rem;
|
|
107
|
-
}
|
|
108
|
-
.pn-search .cta {
|
|
109
|
-
gap: 1.6rem;
|
|
110
|
-
}
|
|
111
|
-
.pn-search .btn-mw[data-primary] {
|
|
112
|
-
width: auto;
|
|
113
|
-
margin-bottom: 0;
|
|
114
|
-
}
|
|
115
|
-
.pn-search .btn-mw[data-secondary] {
|
|
116
|
-
margin-top: 0;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
@media (min-width: 1200px) {
|
|
120
|
-
.pn-search {
|
|
121
|
-
padding: 2.4rem;
|
|
122
|
-
}
|
|
123
|
-
.pn-search .search-container {
|
|
124
|
-
max-width: 400px;
|
|
125
|
-
}
|
|
126
|
-
.pn-search .illustration {
|
|
127
|
-
--pn-width: 16rem;
|
|
128
|
-
--pn-height: 16rem;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
@media (min-width: 1600px) {
|
|
132
|
-
.pn-search {
|
|
133
|
-
max-width: 1400px;
|
|
134
|
-
margin: 0 auto;
|
|
135
|
-
padding: 3.2rem;
|
|
136
|
-
}
|
|
137
|
-
.pn-search .search-container {
|
|
138
|
-
max-width: 500px;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
2
|
-
export class PNSearch {
|
|
3
|
-
constructor() {
|
|
4
|
-
this.componentAriaLabel = undefined;
|
|
5
|
-
this.heading = undefined;
|
|
6
|
-
this.pnIllustrationSvg = undefined;
|
|
7
|
-
this.imageUrl = undefined;
|
|
8
|
-
this.imageAltText = undefined;
|
|
9
|
-
this.searchPlaceholder = undefined;
|
|
10
|
-
this.searchButtonText = undefined;
|
|
11
|
-
this.searchButtonLabel = undefined;
|
|
12
|
-
this.searchUrl = undefined;
|
|
13
|
-
this.primaryButtonText = undefined;
|
|
14
|
-
this.primaryButtonUrl = undefined;
|
|
15
|
-
this.primaryButtonIconSvg = undefined;
|
|
16
|
-
this.secondaryButtonText = undefined;
|
|
17
|
-
this.secondaryButtonUrl = undefined;
|
|
18
|
-
this.searchDescriptionAria = undefined;
|
|
19
|
-
this.ctaActionsLabel = undefined;
|
|
20
|
-
this.searchType = undefined;
|
|
21
|
-
}
|
|
22
|
-
hostElement;
|
|
23
|
-
pnSearch;
|
|
24
|
-
doSearch = (e) => {
|
|
25
|
-
if (!this.searchUrl) {
|
|
26
|
-
console.warn('Search URL is not defined');
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const searchDetail = {
|
|
30
|
-
query: e.detail,
|
|
31
|
-
timestamp: Date.now(),
|
|
32
|
-
};
|
|
33
|
-
this.pnSearch.emit(searchDetail);
|
|
34
|
-
};
|
|
35
|
-
render() {
|
|
36
|
-
const hasButtons = this.primaryButtonUrl || this.secondaryButtonUrl;
|
|
37
|
-
return (h(Host, { key: 'fd8fdc6f6bc5d4743ff328d914a6b2b55d840503' }, h("div", { key: 'fb4be66b1a38fde9e5b0b0e3fc4abbdf0f1b2f38', class: "pn-search", role: "search", "aria-label": this.componentAriaLabel }, h("div", { key: 'b07dbfb4dcdf54e88ac790d4da6aa97a00356d04', class: "graphics-container", "aria-hidden": !this.imageAltText }, !this.pnIllustrationSvg && this.imageUrl && h("img", { key: '50ad3338cf3912ff74a50a6b72102e6d5e61f4f6', class: "graphics", src: this.imageUrl, alt: this.imageAltText || '', loading: "lazy" }), this.pnIllustrationSvg && h("pn-illustration", { key: '3956261bb79fbac47239f2091e3d50344e94d555', class: "illustration", illustration: this.pnIllustrationSvg, role: "presentation" })), h("div", { key: '17c6d2c2d1cd812f583f072b17adc3747562ae85', class: "main" }, h("h2", { key: '9214e9895160ee1d316f1ee09f4ddacb7c81f452', class: "heading", id: "search-section-heading" }, this.heading), h("div", { key: '1db65a02236162c22210981d11d3567e6cc27f58', class: "search-container", "aria-labelledby": "search-section-heading" }, h("pn-marketweb-search", { key: 'a560d93bb4747643a5c81610c2e55d0af0825559', class: "search-component", label: this.searchButtonLabel, name: "search", inputid: "search-field", autocomplete: "off", placeholder: this.searchPlaceholder, button: this.searchButtonText, disabled: false, loading: false, light: false, list: null, onSearch: this.doSearch, "data-search-url": this.searchUrl, "aria-describedby": "search-description" }), this.searchDescriptionAria && (h("div", { key: '3d59bd65947e1ecbdcfb75667135dc40e2482955', id: "search-description", class: "sr-only" }, this.searchDescriptionAria))), hasButtons && (h("div", { key: '1d9a2bd31084ae806879e6bc9e820591e3bd4b29', class: "cta", role: "group", "aria-label": this.ctaActionsLabel }, this.primaryButtonUrl && (h("pn-button", { key: '5ddda20fd6846f75e301272e52fc3c200e2c71bb', appearance: "light", variant: "outlined", small: true, icon: this.primaryButtonIconSvg, "left-icon": Boolean(this.primaryButtonIconSvg), class: "btn-mw", href: this.primaryButtonUrl, "data-primary": true }, this.primaryButtonText)), this.secondaryButtonUrl && (h("a", { key: 'a82cf19405f6144f9b5fd789ffa1242128a4c8f1', href: this.secondaryButtonUrl, class: "btn-mw", "data-secondary": true, role: "button" }, this.secondaryButtonText))))))));
|
|
38
|
-
}
|
|
39
|
-
static get is() { return "pn-search"; }
|
|
40
|
-
static get originalStyleUrls() {
|
|
41
|
-
return {
|
|
42
|
-
"$": ["pn-search.scss"]
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
static get styleUrls() {
|
|
46
|
-
return {
|
|
47
|
-
"$": ["pn-search.css"]
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
static get properties() {
|
|
51
|
-
return {
|
|
52
|
-
"componentAriaLabel": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"mutable": false,
|
|
55
|
-
"complexType": {
|
|
56
|
-
"original": "string",
|
|
57
|
-
"resolved": "string",
|
|
58
|
-
"references": {}
|
|
59
|
-
},
|
|
60
|
-
"required": true,
|
|
61
|
-
"optional": false,
|
|
62
|
-
"docs": {
|
|
63
|
-
"tags": [],
|
|
64
|
-
"text": ""
|
|
65
|
-
},
|
|
66
|
-
"attribute": "component-aria-label",
|
|
67
|
-
"reflect": false
|
|
68
|
-
},
|
|
69
|
-
"heading": {
|
|
70
|
-
"type": "string",
|
|
71
|
-
"mutable": false,
|
|
72
|
-
"complexType": {
|
|
73
|
-
"original": "string",
|
|
74
|
-
"resolved": "string",
|
|
75
|
-
"references": {}
|
|
76
|
-
},
|
|
77
|
-
"required": true,
|
|
78
|
-
"optional": false,
|
|
79
|
-
"docs": {
|
|
80
|
-
"tags": [],
|
|
81
|
-
"text": ""
|
|
82
|
-
},
|
|
83
|
-
"attribute": "heading",
|
|
84
|
-
"reflect": false
|
|
85
|
-
},
|
|
86
|
-
"pnIllustrationSvg": {
|
|
87
|
-
"type": "string",
|
|
88
|
-
"mutable": false,
|
|
89
|
-
"complexType": {
|
|
90
|
-
"original": "string",
|
|
91
|
-
"resolved": "string",
|
|
92
|
-
"references": {}
|
|
93
|
-
},
|
|
94
|
-
"required": false,
|
|
95
|
-
"optional": true,
|
|
96
|
-
"docs": {
|
|
97
|
-
"tags": [],
|
|
98
|
-
"text": ""
|
|
99
|
-
},
|
|
100
|
-
"attribute": "pn-illustration-svg",
|
|
101
|
-
"reflect": false
|
|
102
|
-
},
|
|
103
|
-
"imageUrl": {
|
|
104
|
-
"type": "string",
|
|
105
|
-
"mutable": false,
|
|
106
|
-
"complexType": {
|
|
107
|
-
"original": "string",
|
|
108
|
-
"resolved": "string",
|
|
109
|
-
"references": {}
|
|
110
|
-
},
|
|
111
|
-
"required": false,
|
|
112
|
-
"optional": true,
|
|
113
|
-
"docs": {
|
|
114
|
-
"tags": [],
|
|
115
|
-
"text": ""
|
|
116
|
-
},
|
|
117
|
-
"attribute": "image-url",
|
|
118
|
-
"reflect": false
|
|
119
|
-
},
|
|
120
|
-
"imageAltText": {
|
|
121
|
-
"type": "string",
|
|
122
|
-
"mutable": false,
|
|
123
|
-
"complexType": {
|
|
124
|
-
"original": "string",
|
|
125
|
-
"resolved": "string",
|
|
126
|
-
"references": {}
|
|
127
|
-
},
|
|
128
|
-
"required": false,
|
|
129
|
-
"optional": true,
|
|
130
|
-
"docs": {
|
|
131
|
-
"tags": [],
|
|
132
|
-
"text": ""
|
|
133
|
-
},
|
|
134
|
-
"attribute": "image-alt-text",
|
|
135
|
-
"reflect": false
|
|
136
|
-
},
|
|
137
|
-
"searchPlaceholder": {
|
|
138
|
-
"type": "string",
|
|
139
|
-
"mutable": false,
|
|
140
|
-
"complexType": {
|
|
141
|
-
"original": "string",
|
|
142
|
-
"resolved": "string",
|
|
143
|
-
"references": {}
|
|
144
|
-
},
|
|
145
|
-
"required": false,
|
|
146
|
-
"optional": true,
|
|
147
|
-
"docs": {
|
|
148
|
-
"tags": [],
|
|
149
|
-
"text": ""
|
|
150
|
-
},
|
|
151
|
-
"attribute": "search-placeholder",
|
|
152
|
-
"reflect": false
|
|
153
|
-
},
|
|
154
|
-
"searchButtonText": {
|
|
155
|
-
"type": "string",
|
|
156
|
-
"mutable": false,
|
|
157
|
-
"complexType": {
|
|
158
|
-
"original": "string",
|
|
159
|
-
"resolved": "string",
|
|
160
|
-
"references": {}
|
|
161
|
-
},
|
|
162
|
-
"required": false,
|
|
163
|
-
"optional": true,
|
|
164
|
-
"docs": {
|
|
165
|
-
"tags": [],
|
|
166
|
-
"text": ""
|
|
167
|
-
},
|
|
168
|
-
"attribute": "search-button-text",
|
|
169
|
-
"reflect": false
|
|
170
|
-
},
|
|
171
|
-
"searchButtonLabel": {
|
|
172
|
-
"type": "string",
|
|
173
|
-
"mutable": false,
|
|
174
|
-
"complexType": {
|
|
175
|
-
"original": "string",
|
|
176
|
-
"resolved": "string",
|
|
177
|
-
"references": {}
|
|
178
|
-
},
|
|
179
|
-
"required": false,
|
|
180
|
-
"optional": true,
|
|
181
|
-
"docs": {
|
|
182
|
-
"tags": [],
|
|
183
|
-
"text": ""
|
|
184
|
-
},
|
|
185
|
-
"attribute": "search-button-label",
|
|
186
|
-
"reflect": false
|
|
187
|
-
},
|
|
188
|
-
"searchUrl": {
|
|
189
|
-
"type": "string",
|
|
190
|
-
"mutable": false,
|
|
191
|
-
"complexType": {
|
|
192
|
-
"original": "string",
|
|
193
|
-
"resolved": "string",
|
|
194
|
-
"references": {}
|
|
195
|
-
},
|
|
196
|
-
"required": false,
|
|
197
|
-
"optional": true,
|
|
198
|
-
"docs": {
|
|
199
|
-
"tags": [],
|
|
200
|
-
"text": ""
|
|
201
|
-
},
|
|
202
|
-
"attribute": "search-url",
|
|
203
|
-
"reflect": false
|
|
204
|
-
},
|
|
205
|
-
"primaryButtonText": {
|
|
206
|
-
"type": "string",
|
|
207
|
-
"mutable": false,
|
|
208
|
-
"complexType": {
|
|
209
|
-
"original": "string",
|
|
210
|
-
"resolved": "string",
|
|
211
|
-
"references": {}
|
|
212
|
-
},
|
|
213
|
-
"required": false,
|
|
214
|
-
"optional": true,
|
|
215
|
-
"docs": {
|
|
216
|
-
"tags": [],
|
|
217
|
-
"text": ""
|
|
218
|
-
},
|
|
219
|
-
"attribute": "primary-button-text",
|
|
220
|
-
"reflect": false
|
|
221
|
-
},
|
|
222
|
-
"primaryButtonUrl": {
|
|
223
|
-
"type": "string",
|
|
224
|
-
"mutable": false,
|
|
225
|
-
"complexType": {
|
|
226
|
-
"original": "string",
|
|
227
|
-
"resolved": "string",
|
|
228
|
-
"references": {}
|
|
229
|
-
},
|
|
230
|
-
"required": false,
|
|
231
|
-
"optional": true,
|
|
232
|
-
"docs": {
|
|
233
|
-
"tags": [],
|
|
234
|
-
"text": ""
|
|
235
|
-
},
|
|
236
|
-
"attribute": "primary-button-url",
|
|
237
|
-
"reflect": false
|
|
238
|
-
},
|
|
239
|
-
"primaryButtonIconSvg": {
|
|
240
|
-
"type": "string",
|
|
241
|
-
"mutable": false,
|
|
242
|
-
"complexType": {
|
|
243
|
-
"original": "string",
|
|
244
|
-
"resolved": "string",
|
|
245
|
-
"references": {}
|
|
246
|
-
},
|
|
247
|
-
"required": false,
|
|
248
|
-
"optional": true,
|
|
249
|
-
"docs": {
|
|
250
|
-
"tags": [],
|
|
251
|
-
"text": ""
|
|
252
|
-
},
|
|
253
|
-
"attribute": "primary-button-icon-svg",
|
|
254
|
-
"reflect": false
|
|
255
|
-
},
|
|
256
|
-
"secondaryButtonText": {
|
|
257
|
-
"type": "string",
|
|
258
|
-
"mutable": false,
|
|
259
|
-
"complexType": {
|
|
260
|
-
"original": "string",
|
|
261
|
-
"resolved": "string",
|
|
262
|
-
"references": {}
|
|
263
|
-
},
|
|
264
|
-
"required": false,
|
|
265
|
-
"optional": true,
|
|
266
|
-
"docs": {
|
|
267
|
-
"tags": [],
|
|
268
|
-
"text": ""
|
|
269
|
-
},
|
|
270
|
-
"attribute": "secondary-button-text",
|
|
271
|
-
"reflect": false
|
|
272
|
-
},
|
|
273
|
-
"secondaryButtonUrl": {
|
|
274
|
-
"type": "string",
|
|
275
|
-
"mutable": false,
|
|
276
|
-
"complexType": {
|
|
277
|
-
"original": "string",
|
|
278
|
-
"resolved": "string",
|
|
279
|
-
"references": {}
|
|
280
|
-
},
|
|
281
|
-
"required": false,
|
|
282
|
-
"optional": true,
|
|
283
|
-
"docs": {
|
|
284
|
-
"tags": [],
|
|
285
|
-
"text": ""
|
|
286
|
-
},
|
|
287
|
-
"attribute": "secondary-button-url",
|
|
288
|
-
"reflect": false
|
|
289
|
-
},
|
|
290
|
-
"searchDescriptionAria": {
|
|
291
|
-
"type": "string",
|
|
292
|
-
"mutable": false,
|
|
293
|
-
"complexType": {
|
|
294
|
-
"original": "string",
|
|
295
|
-
"resolved": "string",
|
|
296
|
-
"references": {}
|
|
297
|
-
},
|
|
298
|
-
"required": false,
|
|
299
|
-
"optional": true,
|
|
300
|
-
"docs": {
|
|
301
|
-
"tags": [],
|
|
302
|
-
"text": ""
|
|
303
|
-
},
|
|
304
|
-
"attribute": "search-description-aria",
|
|
305
|
-
"reflect": false
|
|
306
|
-
},
|
|
307
|
-
"ctaActionsLabel": {
|
|
308
|
-
"type": "string",
|
|
309
|
-
"mutable": false,
|
|
310
|
-
"complexType": {
|
|
311
|
-
"original": "string",
|
|
312
|
-
"resolved": "string",
|
|
313
|
-
"references": {}
|
|
314
|
-
},
|
|
315
|
-
"required": false,
|
|
316
|
-
"optional": true,
|
|
317
|
-
"docs": {
|
|
318
|
-
"tags": [],
|
|
319
|
-
"text": ""
|
|
320
|
-
},
|
|
321
|
-
"attribute": "cta-actions-label",
|
|
322
|
-
"reflect": false
|
|
323
|
-
},
|
|
324
|
-
"searchType": {
|
|
325
|
-
"type": "string",
|
|
326
|
-
"mutable": false,
|
|
327
|
-
"complexType": {
|
|
328
|
-
"original": "'shipments' | 'episearch'",
|
|
329
|
-
"resolved": "\"episearch\" | \"shipments\"",
|
|
330
|
-
"references": {}
|
|
331
|
-
},
|
|
332
|
-
"required": false,
|
|
333
|
-
"optional": false,
|
|
334
|
-
"docs": {
|
|
335
|
-
"tags": [],
|
|
336
|
-
"text": ""
|
|
337
|
-
},
|
|
338
|
-
"attribute": "search-type",
|
|
339
|
-
"reflect": false
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
static get events() {
|
|
344
|
-
return [{
|
|
345
|
-
"method": "pnSearch",
|
|
346
|
-
"name": "pnSearch",
|
|
347
|
-
"bubbles": true,
|
|
348
|
-
"cancelable": true,
|
|
349
|
-
"composed": true,
|
|
350
|
-
"docs": {
|
|
351
|
-
"tags": [],
|
|
352
|
-
"text": ""
|
|
353
|
-
},
|
|
354
|
-
"complexType": {
|
|
355
|
-
"original": "SearchEventDetail",
|
|
356
|
-
"resolved": "SearchEventDetail",
|
|
357
|
-
"references": {
|
|
358
|
-
"SearchEventDetail": {
|
|
359
|
-
"location": "global",
|
|
360
|
-
"id": "global::SearchEventDetail"
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}];
|
|
365
|
-
}
|
|
366
|
-
static get elementRef() { return "hostElement"; }
|
|
367
|
-
}
|
|
368
|
-
//# sourceMappingURL=pn-search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pn-search.js","sourceRoot":"","sources":["../../../../src/components/widgets/pn-search/pn-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAWvF,MAAM,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Element, Prop, h, Event, EventEmitter } from '@stencil/core';\n\ninterface SearchEventDetail {\n query: string;\n timestamp: number;\n}\n\n@Component({\n tag: 'pn-search',\n styleUrl: 'pn-search.scss',\n})\nexport class PNSearch {\n @Element() hostElement!: HTMLElement;\n\n @Prop() componentAriaLabel!: string;\n @Prop() heading!: string;\n @Prop() pnIllustrationSvg?: string;\n @Prop() imageUrl?: string;\n @Prop() imageAltText?: string;\n @Prop() searchPlaceholder?: string;\n @Prop() searchButtonText?: string;\n @Prop() searchButtonLabel?: string;\n @Prop() searchUrl?: string;\n @Prop() primaryButtonText?: string;\n @Prop() primaryButtonUrl?: string;\n @Prop() primaryButtonIconSvg?: string;\n @Prop() secondaryButtonText?: string;\n @Prop() secondaryButtonUrl?: string;\n @Prop() searchDescriptionAria?: string;\n @Prop() ctaActionsLabel?: string;\n @Prop() searchType: 'shipments' | 'episearch';\n\n @Event() pnSearch!: EventEmitter<SearchEventDetail>;\n\n private doSearch = (e: CustomEvent): void => {\n if (!this.searchUrl) {\n console.warn('Search URL is not defined');\n return;\n }\n\n const searchDetail: SearchEventDetail = {\n query: e.detail,\n timestamp: Date.now(),\n };\n\n this.pnSearch.emit(searchDetail);\n };\n\n render() {\n const hasButtons = this.primaryButtonUrl || this.secondaryButtonUrl;\n\n return (\n <Host>\n <div class=\"pn-search\" role=\"search\" aria-label={this.componentAriaLabel}>\n <div class=\"graphics-container\" aria-hidden={!this.imageAltText}>\n {!this.pnIllustrationSvg && this.imageUrl && <img class=\"graphics\" src={this.imageUrl} alt={this.imageAltText || ''} loading=\"lazy\" />}\n {this.pnIllustrationSvg && <pn-illustration class=\"illustration\" illustration={this.pnIllustrationSvg} role=\"presentation\" />}\n </div>\n\n <div class=\"main\">\n <h2 class=\"heading\" id=\"search-section-heading\">\n {this.heading}\n </h2>\n\n <div class=\"search-container\" aria-labelledby=\"search-section-heading\">\n <pn-marketweb-search\n class=\"search-component\"\n label={this.searchButtonLabel}\n name=\"search\"\n inputid=\"search-field\"\n autocomplete=\"off\"\n placeholder={this.searchPlaceholder}\n button={this.searchButtonText}\n disabled={false}\n loading={false}\n light={false}\n list={null}\n onSearch={this.doSearch}\n data-search-url={this.searchUrl}\n aria-describedby=\"search-description\"\n />\n {this.searchDescriptionAria && (\n <div id=\"search-description\" class=\"sr-only\">\n {this.searchDescriptionAria}\n </div>\n )}\n </div>\n\n {hasButtons && (\n <div class=\"cta\" role=\"group\" aria-label={this.ctaActionsLabel}>\n {this.primaryButtonUrl && (\n <pn-button\n appearance=\"light\"\n variant=\"outlined\"\n small={true}\n icon={this.primaryButtonIconSvg}\n left-icon={Boolean(this.primaryButtonIconSvg)}\n class=\"btn-mw\"\n href={this.primaryButtonUrl}\n data-primary\n >\n {this.primaryButtonText}\n </pn-button>\n )}\n {this.secondaryButtonUrl && (\n <a href={this.secondaryButtonUrl} class=\"btn-mw\" data-secondary role=\"button\">\n {this.secondaryButtonText}\n </a>\n )}\n </div>\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { createDocumentation, createComponent } from "../../../globals/documentation/story";
|
|
2
|
-
import docs from "./pn-search-docs.json";
|
|
3
|
-
const { argTypes, textContent } = createDocumentation(docs);
|
|
4
|
-
const meta = {
|
|
5
|
-
title: 'Components/Widgets/Search',
|
|
6
|
-
parameters: {
|
|
7
|
-
actions: {},
|
|
8
|
-
docs: {
|
|
9
|
-
description: {
|
|
10
|
-
story: textContent,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
componentAriaLabel: 'Component Search Interface',
|
|
16
|
-
heading: 'Lena Ohlsson',
|
|
17
|
-
imageUrl: '',
|
|
18
|
-
searchPlaceholder: 'Track / add shipment',
|
|
19
|
-
searchButtonLabel: 'Search',
|
|
20
|
-
searchDescriptionAria: 'Enter your search terms and press enter or click the search button',
|
|
21
|
-
ctaActionsLabel: 'Additional actions',
|
|
22
|
-
},
|
|
23
|
-
argTypes,
|
|
24
|
-
};
|
|
25
|
-
export default meta;
|
|
26
|
-
export const Search = {
|
|
27
|
-
name: 'pn-search',
|
|
28
|
-
render: args => createComponent('pn-search', args),
|
|
29
|
-
};
|
|
30
|
-
export const SearchWithImageUrl = {
|
|
31
|
-
name: 'Image Url',
|
|
32
|
-
render: Search.render,
|
|
33
|
-
args: {
|
|
34
|
-
heading: 'Lena Ohlsson',
|
|
35
|
-
imageUrl: 'https://picsum.photos/id/64/140/140',
|
|
36
|
-
searchPlaceholder: 'Track / add shipment',
|
|
37
|
-
primaryButtonText: 'Start New Chat',
|
|
38
|
-
primaryButtonUrl: '#',
|
|
39
|
-
primaryButtonIconSvg: '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M12.388 2c5.522 0 10 4.477 10 10s-4.478 10-10 10H2l1.355-4.064-.798-3.987a8.8 8.8 0 0 1-.17-1.717V12c0-5.523 4.478-10 10-10m8 10a8 8 0 0 0-16 0v.232q0 .67.13 1.325l.902 4.507L4.775 20h7.612a8 8 0 0 0 8-8m-12.5-1.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m6 1.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0m3-1.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3" clip-rule="evenodd"/></svg>',
|
|
40
|
-
secondaryButtonText: 'Show Chat History',
|
|
41
|
-
secondaryButtonUrl: '#',
|
|
42
|
-
searchUrl: 'https://www.postnord.se/vara-verktyg/spara-brev-paket-och-pall/?shipmentId=',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
export const SearchWithIllustration = {
|
|
46
|
-
name: 'Illustration',
|
|
47
|
-
render: Search.render,
|
|
48
|
-
args: {
|
|
49
|
-
heading: 'Lena Ohlsson',
|
|
50
|
-
pnIllustrationSvg: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 120 120"><g clip-path="url(#birthday_svg__a)"><path fill="#5EC584" d="M72.627 27.856H47.812c-21.895 0-39.703 17.622-39.703 39.288v15.311h104.367V67.29c-.146-21.811-17.954-39.433-39.85-39.433"/><path fill="#ABE3BB" d="M31.754 82.6c1.898-6.933 1.752-15.166-.583-22.533-1.752-5.633-4.963-11.7-8.029-17.622l-2.19-4.334c-.437.29-.729.723-1.167 1.011.584 1.3 1.314 2.6 1.898 3.9 3.065 5.923 6.13 11.99 7.882 17.478 2.481 7.656 2.19 15.6.438 22.1zM34.234 32.767c3.649 9.533 7.736 20.366 19.851 19.066 6.569-.722 12.407-4.333 16.786-10.544 2.774-3.756 4.817-8.378 5.985-13.145-.438 0-1.022-.144-1.46-.144-1.167 4.478-3.21 8.956-5.692 12.422-2.92 4.045-8.028 9.1-15.765 9.822-10.947 1.156-14.742-8.666-18.246-18.2l-.875-2.166-1.314.433c.146 1.011.438 1.733.73 2.456M54.378 82.312c.438-10.256 17.662-24.845 32.988-37.845 3.357-2.889 6.715-5.633 9.634-8.233-.438-.289-.73-.578-1.168-.867-2.92 2.6-6.13 5.345-9.342 8.09-15.472 13-32.988 27.877-33.572 38.855v.433h1.46zM112.326 65.7c0-.722-.146-1.3-.146-2.022-6.568 6.355-15.034 13.578-23.5 19.066h2.773c7.444-5.2 14.889-11.266 20.873-17.044"/><path fill="#FDEFEE" d="M54.816 18.756h10.948v-1.878c0-1.011-.876-1.878-1.898-1.878h-7.152c-1.022 0-1.898.867-1.898 1.878z"/><path fill="#005E41" d="M85.616 23.378c-14.013-5.489-15.764 8.667-15.764 8.667s12.115 6.5 15.764-8.667M50.585 31.467c-14.013 5.49-15.765-8.666-15.765-8.666s12.115-6.5 15.765 8.666"/><path fill="#FBC2C1" d="M65.618 23.521H54.816a2.757 2.757 0 0 1-2.773-2.744c0-1.589 1.314-2.745 2.773-2.745h10.802c1.606-.144 2.92 1.156 2.92 2.745s-1.314 2.744-2.92 2.744"/><path fill="#F06365" d="M70.144 22.945c0 5.345-4.379 9.822-9.925 9.822s-9.926-4.333-9.926-9.822z"/><path fill="#ABE3BB" d="M28.985 82.6c0-5.633-4.67-10.255-10.363-10.255S8.258 76.967 8.258 82.6z"/><path fill="#ABE3BB" d="M49.712 82.6c0-5.633-4.671-10.255-10.364-10.255S28.984 76.967 28.984 82.6z"/><path fill="#ABE3BB" d="M70.584 82.6c0-5.633-4.67-10.255-10.364-10.255-5.692 0-10.51 4.622-10.51 10.255zM91.458 82.6c0-5.633-4.671-10.255-10.364-10.255S70.731 76.967 70.731 82.6zM112.333 82.6c0-5.633-4.671-10.255-10.364-10.255S91.606 76.967 91.606 82.6z"/><path fill="#FFC8A3" d="M73.938 106h-27.88L59.78 85.056z"/><path fill="#FFC8A3" d="M117 88.955H3v-1.733c0-2.456 2.044-4.478 4.525-4.478h104.95c2.481 0 4.525 2.022 4.525 4.478z"/><path fill="#4F1600" d="m57.152 88.956-2.336 3.611h10.072l-2.481-3.61z"/></g><defs><clipPath id="birthday_svg__a"><path fill="#fff" d="M3 15h114v91H3z"/></clipPath></defs></svg>',
|
|
51
|
-
searchPlaceholder: 'Track / add shipment',
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=pn-search.stories.js.map
|