@telia-ace/knowledge-widget-components-contact-link 1.0.26-next.0 → 1.0.32-next.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Symbol } from '@telia-ace/knowledge-widget-core';
|
|
2
2
|
import { Container } from '@webprovisions/platform';
|
|
3
|
-
export
|
|
3
|
+
export type ContactLinkComponentProps = {
|
|
4
4
|
widget: string;
|
|
5
5
|
route: string;
|
|
6
6
|
mode: 'large' | 'compact';
|
|
@@ -39,51 +39,71 @@ const Y = (n) => {
|
|
|
39
39
|
apiNotificationPriorityBy: "contacts"
|
|
40
40
|
};
|
|
41
41
|
if (u === "compact")
|
|
42
|
-
return /* @__PURE__ */ i.createElement(
|
|
42
|
+
return /* @__PURE__ */ i.createElement(
|
|
43
|
+
F,
|
|
44
|
+
h(g({}, t), {
|
|
45
|
+
className: d(
|
|
46
|
+
e,
|
|
47
|
+
"humany-contact-link",
|
|
48
|
+
"humany-contact-link-compact"
|
|
49
|
+
),
|
|
50
|
+
textAlign: $
|
|
51
|
+
}),
|
|
52
|
+
c && /* @__PURE__ */ i.createElement(p, null, c),
|
|
53
|
+
r ? /* @__PURE__ */ i.createElement(z, { routeName: r }, s) : /* @__PURE__ */ i.createElement(
|
|
54
|
+
M,
|
|
55
|
+
{
|
|
56
|
+
"aria-haspopup": "dialog",
|
|
57
|
+
role: "button",
|
|
58
|
+
activationOptions: k,
|
|
59
|
+
widgetName: l
|
|
60
|
+
},
|
|
61
|
+
s
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
const x = /* @__PURE__ */ i.createElement(i.Fragment, null, f ? /* @__PURE__ */ i.createElement(T, { symbol: f }) : /* @__PURE__ */ i.createElement(
|
|
65
|
+
q,
|
|
66
|
+
{
|
|
67
|
+
width: S,
|
|
68
|
+
viewBox: "0 0 63 37",
|
|
69
|
+
fill: "none",
|
|
70
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
71
|
+
},
|
|
72
|
+
/* @__PURE__ */ i.createElement(
|
|
73
|
+
"path",
|
|
74
|
+
{
|
|
75
|
+
d: "M1 1H62M1 1L24.7579 15.6328M1 1V36M62 1V36M62 1L38.8842 15.5402M1 36H62M1 36L24.7579 15.6328M62 36L38.8842 15.5402M38.8842 15.5402L37.0898 16.6689C33.8642 18.6979 29.7658 18.7172 26.5212 16.7188L24.7579 15.6328",
|
|
76
|
+
stroke: "#990AE3"
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
), s && /* @__PURE__ */ i.createElement(j, null, s), c && /* @__PURE__ */ i.createElement(R, null, c));
|
|
80
|
+
return r ? /* @__PURE__ */ i.createElement(
|
|
81
|
+
O,
|
|
82
|
+
h(g({}, t), {
|
|
43
83
|
className: d(
|
|
44
84
|
e,
|
|
45
85
|
"humany-contact-link",
|
|
46
|
-
"humany-contact-link-
|
|
86
|
+
"humany-contact-link-large"
|
|
47
87
|
),
|
|
48
|
-
textAlign: $
|
|
49
|
-
}), c && /* @__PURE__ */ i.createElement(p, null, c), r ? /* @__PURE__ */ i.createElement(z, {
|
|
50
88
|
routeName: r
|
|
51
|
-
}
|
|
89
|
+
}),
|
|
90
|
+
x
|
|
91
|
+
) : /* @__PURE__ */ i.createElement(
|
|
92
|
+
I,
|
|
93
|
+
h(g({}, t), {
|
|
52
94
|
"aria-haspopup": "dialog",
|
|
53
95
|
role: "button",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
d: "M1 1H62M1 1L24.7579 15.6328M1 1V36M62 1V36M62 1L38.8842 15.5402M1 36H62M1 36L24.7579 15.6328M62 36L38.8842 15.5402M38.8842 15.5402L37.0898 16.6689C33.8642 18.6979 29.7658 18.7172 26.5212 16.7188L24.7579 15.6328",
|
|
66
|
-
stroke: "#990AE3"
|
|
67
|
-
})), s && /* @__PURE__ */ i.createElement(j, null, s), c && /* @__PURE__ */ i.createElement(R, null, c));
|
|
68
|
-
return r ? /* @__PURE__ */ i.createElement(O, h(g({}, t), {
|
|
69
|
-
className: d(
|
|
70
|
-
e,
|
|
71
|
-
"humany-contact-link",
|
|
72
|
-
"humany-contact-link-large"
|
|
73
|
-
),
|
|
74
|
-
routeName: r
|
|
75
|
-
}), x) : /* @__PURE__ */ i.createElement(I, h(g({}, t), {
|
|
76
|
-
"aria-haspopup": "dialog",
|
|
77
|
-
role: "button",
|
|
78
|
-
className: d(
|
|
79
|
-
e,
|
|
80
|
-
"humany-contact-link",
|
|
81
|
-
"humany-contact-link-large"
|
|
82
|
-
),
|
|
83
|
-
textAlign: $,
|
|
84
|
-
widgetName: l,
|
|
85
|
-
activationOptions: k
|
|
86
|
-
}), x);
|
|
96
|
+
className: d(
|
|
97
|
+
e,
|
|
98
|
+
"humany-contact-link",
|
|
99
|
+
"humany-contact-link-large"
|
|
100
|
+
),
|
|
101
|
+
textAlign: $,
|
|
102
|
+
widgetName: l,
|
|
103
|
+
activationOptions: k
|
|
104
|
+
}),
|
|
105
|
+
x
|
|
106
|
+
);
|
|
87
107
|
}, F = a.div`
|
|
88
108
|
text-align: ${(e) => e.textAlign};
|
|
89
109
|
font-weight: 300;
|
|
@@ -174,4 +194,4 @@ const Y = (n) => {
|
|
|
174
194
|
export {
|
|
175
195
|
Y as default
|
|
176
196
|
};
|
|
177
|
-
//# sourceMappingURL=contact-link.
|
|
197
|
+
//# sourceMappingURL=contact-link.a7a02c65.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-link.
|
|
1
|
+
{"version":3,"file":"contact-link.a7a02c65.js","sources":["../src/contact-link.tsx"],"sourcesContent":["import { css, Theme } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport {\n borderTabStyle,\n contentBox,\n Link,\n linkTabStyle,\n SymbolBadge,\n Text,\n useProperties,\n WidgetLink,\n} from '@telia-ace/knowledge-widget-ui';\nimport { appendClassNames } from '@telia-ace/widget-utilities';\nimport React from 'react';\nimport { ContactLinkComponentProps } from './contact-link-component';\n\ntype Props = {\n className: string;\n};\n\nconst ContactLink: React.FC<Props> = ({ className, ...other }) => {\n const {\n widget,\n route,\n mode = 'large',\n iconSize = 'large',\n symbol,\n descriptionLabel,\n label,\n textAlign,\n } = useProperties<ContactLinkComponentProps>();\n\n const align = textAlign ? textAlign : mode === 'large' ? 'center' : 'right';\n const iconSizePx = iconSize === 'large' ? '64' : '48';\n const activationOptions = {\n apiNotificationPriorityBy: 'contacts',\n };\n\n if (mode === 'compact') {\n return (\n <CompactWrapper\n {...other}\n className={appendClassNames(\n className,\n 'humany-contact-link',\n 'humany-contact-link-compact'\n )}\n textAlign={align}\n >\n {descriptionLabel && <Text>{descriptionLabel}</Text>}\n {route ? (\n <Link routeName={route}>{label}</Link>\n ) : (\n <WidgetLink\n aria-haspopup=\"dialog\"\n role=\"button\"\n activationOptions={activationOptions}\n widgetName={widget}\n >\n {label}\n </WidgetLink>\n )}\n </CompactWrapper>\n );\n }\n\n const children = (\n <>\n {symbol ? (\n <SymbolBadge symbol={symbol} />\n ) : (\n <ContactIcon\n width={iconSizePx}\n viewBox=\"0 0 63 37\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 1H62M1 1L24.7579 15.6328M1 1V36M62 1V36M62 1L38.8842 15.5402M1 36H62M1 36L24.7579 15.6328M62 36L38.8842 15.5402M38.8842 15.5402L37.0898 16.6689C33.8642 18.6979 29.7658 18.7172 26.5212 16.7188L24.7579 15.6328\"\n stroke=\"#990AE3\"\n />\n </ContactIcon>\n )}\n {label && <Heading>{label}</Heading>}\n {descriptionLabel && <Description>{descriptionLabel}</Description>}\n </>\n );\n\n return route ? (\n <StyledLink\n {...other}\n className={appendClassNames(\n className,\n 'humany-contact-link',\n 'humany-contact-link-large'\n )}\n routeName={route}\n >\n {children}\n </StyledLink>\n ) : (\n <StyledWidgetLink\n {...other}\n aria-haspopup=\"dialog\"\n role=\"button\"\n className={appendClassNames(\n className,\n 'humany-contact-link',\n 'humany-contact-link-large'\n )}\n textAlign={align}\n widgetName={widget}\n activationOptions={activationOptions}\n >\n {children}\n </StyledWidgetLink>\n );\n};\n\nconst CompactWrapper = styled.div<{ textAlign: string } & any>`\n text-align: ${(p) => p.textAlign};\n font-weight: 300;\n\n span,\n a {\n display: inline-block;\n font-size: ${(p) => p.theme.fonts?.normal};\n }\n\n span {\n margin: 0 ${(p) => p.theme.sizes?.small} 0 0;\n }\n a {\n text-decoration: underline;\n color: ${(p) => p.theme.colors?.primary};\n &:focus-visible {\n ${linkTabStyle}\n padding: ${(p) => `calc(${p.theme.sizes?.small} / 2) ${p.theme.sizes?.small}`};\n }\n }\n`;\n\nconst styling = (p: { theme: Theme }) => css`\n ${contentBox(p)}\n padding: ${p.theme.sizes?.large};\n text-align: center;\n cursor: pointer;\n text-decoration: none;\n i {\n font-size: ${p.theme.fonts?.huge};\n min-width: 1em;\n min-height: 1em;\n color: ${p.theme.colors?.primary};\n }\n span {\n color: ${p.theme.colors?.text};\n }\n &:focus-visible {\n ${borderTabStyle(p)};\n }\n`;\n\nconst StyledWidgetLink = styled(WidgetLink)<any>`\n ${styling}\n text-align: ${(p) => p.textAlign};\n`;\n\nconst StyledLink = styled(Link)<any>`\n ${styling}\n`;\n\nconst Description = styled(Text)`\n line-height: 1.6em;\n font-weight: 300;\n font-size: ${(p) => p.theme.fonts?.normal};\n`;\n\nconst Heading = styled(Text)`\n display: block;\n font-size: ${(p) => p.theme.fonts?.medium};\n margin: ${(p) => p.theme.sizes?.normal} 0;\n`;\n\nconst ContactIcon = styled.svg`\n align-self: center;\n\n path {\n vector-effect: non-scaling-stroke;\n stroke: ${(p) => p.theme.colors?.primary};\n }\n`;\n\nexport default ContactLink;\n"],"names":["ContactLink","_a","_b","className","other","__objRest","widget","route","mode","iconSize","symbol","descriptionLabel","label","textAlign","useProperties","align","iconSizePx","activationOptions","React","CompactWrapper","__spreadProps","__spreadValues","appendClassNames","Text","Link","WidgetLink","children","SymbolBadge","ContactIcon","Heading","Description","StyledLink","StyledWidgetLink","styled","p","linkTabStyle","styling","css","contentBox","_c","_d","borderTabStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAMA,IAA+B,CAACC,MAA4B;AAA5B,MAAAC,IAAAD,GAAE,aAAAE,MAAFD,GAAgBE,IAAAC,EAAhBH,GAAgB,CAAd;AAC9B,QAAA;AAAA,IACF,QAAAI;AAAA,IACA,OAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,QAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,MACAC,EAAyC,GAEvCC,IAAQF,MAAwBL,MAAS,UAAU,WAAW,UAC9DQ,IAAaP,MAAa,UAAU,OAAO,MAC3CQ,IAAoB;AAAA,IACtB,2BAA2B;AAAA,EAAA;AAG/B,MAAIT,MAAS;AAEL,WAAA,gBAAAU,EAAA;AAAA,MAACC;AAAA,MAAAC,EAAAC,EAAA,IACOjB,IADP;AAAA,QAEG,WAAWkB;AAAA,UACPnB;AAAA,UACA;AAAA,UACA;AAAA,QACJ;AAAA,QACA,WAAWY;AAAA,MAAA;AAAA,MAEVJ,KAAqB,gBAAAO,EAAA,cAAAK,GAAA,MAAMZ,CAAiB;AAAA,MAC5CJ,IACI,gBAAAW,EAAA,cAAAM,GAAA,EAAK,WAAWjB,KAAQK,CAAM,IAE/B,gBAAAM,EAAA;AAAA,QAACO;AAAA,QAAA;AAAA,UACG,iBAAc;AAAA,UACd,MAAK;AAAA,UACL,mBAAAR;AAAA,UACA,YAAYX;AAAA,QAAA;AAAA,QAEXM;AAAA,MACL;AAAA,IAAA;AAMhB,QAAMc,IAEG,gBAAAR,EAAA,cAAAA,EAAA,UAAA,MAAAR,IACI,gBAAAQ,EAAA,cAAAS,GAA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AAA;AAAA;AAAA;"}
|
package/dist/contact-link.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createReactComponent as n } from "@telia-ace/knowledge-widget-ui";
|
|
2
|
-
const o = (t) => n(t, "contact-link", import("./contact-link.
|
|
2
|
+
const o = (t) => n(t, "contact-link", import("./contact-link.a7a02c65.js")), c = o;
|
|
3
3
|
export {
|
|
4
4
|
c as default
|
|
5
5
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-components-contact-link",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32-next.0",
|
|
4
4
|
"description": "Contact link component for ACE Knowledge Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@telia-ace/knowledge-widget-core": "^1.0.
|
|
25
|
-
"@telia-ace/knowledge-widget-ui": "^1.0.
|
|
26
|
-
"@telia-ace/widget-utilities": "^1.0.
|
|
24
|
+
"@telia-ace/knowledge-widget-core": "^1.0.30-next.0",
|
|
25
|
+
"@telia-ace/knowledge-widget-ui": "^1.0.36-next.0",
|
|
26
|
+
"@telia-ace/widget-utilities": "^1.0.7-next.7",
|
|
27
27
|
"@webprovisions/platform": "^1.1.2"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
37
37
|
"@emotion/styled": "^11.10.5",
|
|
38
38
|
"@types/react": "^18.0.25",
|
|
39
|
-
"@types/react-dom": "^18.0.
|
|
39
|
+
"@types/react-dom": "^18.0.9",
|
|
40
40
|
"react": "^18.2.0",
|
|
41
41
|
"react-dom": "^18.2.0"
|
|
42
42
|
},
|