@telia-ace/knowledge-widget-components-contact-link 1.1.5 → 1.1.6

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.
@@ -0,0 +1,60 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("@telia-ace/widget-ui"),b=require("@emotion/react"),c=require("@emotion/styled"),i=require("@telia-ace/knowledge-widget-ui"),m=require("@telia-ace/widget-utilities"),j=({className:e,...t})=>{const{widget:o,route:s,mode:a="large",iconSize:y="large",symbol:g,descriptionLabel:l,label:r,textAlign:h}=i.useProperties(),$=w.useContainer(),{events:d}=$.get("$widget"),p=h||(a==="large"?"center":"right"),f=y==="large"?"64":"48",u={apiNotificationPriorityBy:"contacts"};if(a==="compact")return n.jsxs(L,{...t,className:m.appendClassNames(e,"humany-contact-link","humany-contact-link-compact"),onClick:()=>{d.dispatch("tracking:contact-link-clicked",{})},textAlign:p,children:[l&&n.jsx(i.Text,{children:l}),s?n.jsx(i.Link,{routeName:s,children:r}):n.jsx(i.WidgetLink,{"aria-haspopup":"dialog",role:"button",activationOptions:u,widgetName:o,children:r})]});const k=n.jsxs(n.Fragment,{children:[g?n.jsx(i.SymbolBadge,{symbol:g}):n.jsx(N,{width:f,viewBox:"0 0 63 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{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",stroke:"#990AE3"})}),r&&n.jsx(M,{children:r}),l&&n.jsx(v,{children:l})]});return s?n.jsx(C,{...t,className:m.appendClassNames(e,"humany-contact-link","humany-contact-link-large"),onClick:()=>{d.dispatch("tracking:contact-link-clicked",{})},routeName:s,children:k}):n.jsx(z,{...t,"aria-haspopup":"dialog",role:"button",className:m.appendClassNames(e,"humany-contact-link","humany-contact-link-large"),onClick:()=>{d.dispatch("tracking:contact-link-clicked",{})},textAlign:p,widgetName:o,activationOptions:u,children:k})},L=c.div`
2
+ text-align: ${e=>e.textAlign};
3
+ font-weight: 300;
4
+
5
+ span,
6
+ a {
7
+ display: inline-block;
8
+ font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
9
+ }
10
+
11
+ span {
12
+ margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
13
+ }
14
+ a {
15
+ text-decoration: underline;
16
+ color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
17
+ &:focus-visible {
18
+ ${i.linkTabStyle}
19
+ padding: ${e=>{var t,o;return`calc(${(t=e.theme.sizes)==null?void 0:t.small} / 2) ${(o=e.theme.sizes)==null?void 0:o.small}`}};
20
+ }
21
+ }
22
+ `,x=e=>{var t,o,s,a;return b.css`
23
+ ${i.contentBox(e)}
24
+ padding: ${(t=e.theme.sizes)==null?void 0:t.large};
25
+ text-align: center;
26
+ cursor: pointer;
27
+ text-decoration: none;
28
+ i {
29
+ font-size: ${(o=e.theme.fonts)==null?void 0:o.huge};
30
+ min-width: 1em;
31
+ min-height: 1em;
32
+ color: ${(s=e.theme.colors)==null?void 0:s.primary};
33
+ }
34
+ span {
35
+ color: ${(a=e.theme.colors)==null?void 0:a.text};
36
+ }
37
+ &:focus-visible {
38
+ ${i.borderTabStyle(e)};
39
+ }
40
+ `},z=c(i.WidgetLink)`
41
+ ${x}
42
+ text-align: ${e=>e.textAlign};
43
+ `,C=c(i.Link)`
44
+ ${x}
45
+ `,v=c(i.Text)`
46
+ line-height: 1.6em;
47
+ font-weight: 300;
48
+ font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
49
+ `,M=c(i.Text)`
50
+ display: block;
51
+ font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.medium}};
52
+ margin: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}} 0;
53
+ `,N=c.svg`
54
+ align-self: center;
55
+
56
+ path {
57
+ vector-effect: non-scaling-stroke;
58
+ stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
59
+ }
60
+ `;exports.default=j;
@@ -1,52 +1,56 @@
1
- import { jsxs as u, jsx as n, Fragment as w } from "react/jsx-runtime";
2
- import { css as L } from "@emotion/react";
3
- import a from "@emotion/styled";
4
- import { useProperties as z, Text as m, Link as y, WidgetLink as $, SymbolBadge as M, linkTabStyle as v, contentBox as N, borderTabStyle as S } from "@telia-ace/knowledge-widget-ui";
5
- import { appendClassNames as c } from "@telia-ace/widget-utilities";
6
- const F = ({ className: t, ...e }) => {
1
+ import { jsxs as u, jsx as n, Fragment as z } from "react/jsx-runtime";
2
+ import { useContainer as v } from "@telia-ace/widget-ui";
3
+ import { css as C } from "@emotion/react";
4
+ import c from "@emotion/styled";
5
+ import { useProperties as M, Text as d, Link as $, WidgetLink as y, SymbolBadge as N, linkTabStyle as S, contentBox as A, borderTabStyle as B } from "@telia-ace/knowledge-widget-ui";
6
+ import { appendClassNames as m } from "@telia-ace/widget-utilities";
7
+ const G = ({ className: t, ...e }) => {
7
8
  const {
8
9
  widget: i,
9
10
  route: o,
10
- mode: l = "large",
11
- iconSize: k = "large",
11
+ mode: a = "large",
12
+ iconSize: b = "large",
12
13
  symbol: g,
13
- descriptionLabel: r,
14
- label: s,
14
+ descriptionLabel: l,
15
+ label: r,
15
16
  textAlign: h
16
- } = z(), d = h || (l === "large" ? "center" : "right"), b = k === "large" ? "64" : "48", p = {
17
+ } = M(), w = v(), { events: s } = w.get("$widget"), p = h || (a === "large" ? "center" : "right"), L = b === "large" ? "64" : "48", k = {
17
18
  apiNotificationPriorityBy: "contacts"
18
19
  };
19
- if (l === "compact")
20
+ if (a === "compact")
20
21
  return /* @__PURE__ */ u(
21
- A,
22
+ H,
22
23
  {
23
24
  ...e,
24
- className: c(
25
+ className: m(
25
26
  t,
26
27
  "humany-contact-link",
27
28
  "humany-contact-link-compact"
28
29
  ),
29
- textAlign: d,
30
+ onClick: () => {
31
+ s.dispatch("tracking:contact-link-clicked", {});
32
+ },
33
+ textAlign: p,
30
34
  children: [
31
- r && /* @__PURE__ */ n(m, { children: r }),
32
- o ? /* @__PURE__ */ n(y, { routeName: o, children: s }) : /* @__PURE__ */ n(
33
- $,
35
+ l && /* @__PURE__ */ n(d, { children: l }),
36
+ o ? /* @__PURE__ */ n($, { routeName: o, children: r }) : /* @__PURE__ */ n(
37
+ y,
34
38
  {
35
39
  "aria-haspopup": "dialog",
36
40
  role: "button",
37
- activationOptions: p,
41
+ activationOptions: k,
38
42
  widgetName: i,
39
- children: s
43
+ children: r
40
44
  }
41
45
  )
42
46
  ]
43
47
  }
44
48
  );
45
- const f = /* @__PURE__ */ u(w, { children: [
46
- g ? /* @__PURE__ */ n(M, { symbol: g }) : /* @__PURE__ */ n(
47
- T,
49
+ const f = /* @__PURE__ */ u(z, { children: [
50
+ g ? /* @__PURE__ */ n(N, { symbol: g }) : /* @__PURE__ */ n(
51
+ V,
48
52
  {
49
- width: b,
53
+ width: L,
50
54
  viewBox: "0 0 63 37",
51
55
  fill: "none",
52
56
  xmlns: "http://www.w3.org/2000/svg",
@@ -59,39 +63,45 @@ const F = ({ className: t, ...e }) => {
59
63
  )
60
64
  }
61
65
  ),
62
- s && /* @__PURE__ */ n(P, { children: s }),
63
- r && /* @__PURE__ */ n(H, { children: r })
66
+ r && /* @__PURE__ */ n(j, { children: r }),
67
+ l && /* @__PURE__ */ n(W, { children: l })
64
68
  ] });
65
69
  return o ? /* @__PURE__ */ n(
66
- B,
70
+ T,
67
71
  {
68
72
  ...e,
69
- className: c(
73
+ className: m(
70
74
  t,
71
75
  "humany-contact-link",
72
76
  "humany-contact-link-large"
73
77
  ),
78
+ onClick: () => {
79
+ s.dispatch("tracking:contact-link-clicked", {});
80
+ },
74
81
  routeName: o,
75
82
  children: f
76
83
  }
77
84
  ) : /* @__PURE__ */ n(
78
- C,
85
+ P,
79
86
  {
80
87
  ...e,
81
88
  "aria-haspopup": "dialog",
82
89
  role: "button",
83
- className: c(
90
+ className: m(
84
91
  t,
85
92
  "humany-contact-link",
86
93
  "humany-contact-link-large"
87
94
  ),
88
- textAlign: d,
95
+ onClick: () => {
96
+ s.dispatch("tracking:contact-link-clicked", {});
97
+ },
98
+ textAlign: p,
89
99
  widgetName: i,
90
- activationOptions: p,
100
+ activationOptions: k,
91
101
  children: f
92
102
  }
93
103
  );
94
- }, A = a.div`
104
+ }, H = c.div`
95
105
  text-align: ${(t) => t.textAlign};
96
106
  font-weight: 300;
97
107
 
@@ -117,7 +127,7 @@ const F = ({ className: t, ...e }) => {
117
127
  return (e = t.theme.colors) == null ? void 0 : e.primary;
118
128
  }};
119
129
  &:focus-visible {
120
- ${v}
130
+ ${S}
121
131
  padding: ${(t) => {
122
132
  var e, i;
123
133
  return `calc(${(e = t.theme.sizes) == null ? void 0 : e.small} / 2) ${(i = t.theme.sizes) == null ? void 0 : i.small}`;
@@ -125,9 +135,9 @@ const F = ({ className: t, ...e }) => {
125
135
  }
126
136
  }
127
137
  `, x = (t) => {
128
- var e, i, o, l;
129
- return L`
130
- ${N(t)}
138
+ var e, i, o, a;
139
+ return C`
140
+ ${A(t)}
131
141
  padding: ${(e = t.theme.sizes) == null ? void 0 : e.large};
132
142
  text-align: center;
133
143
  cursor: pointer;
@@ -139,25 +149,25 @@ const F = ({ className: t, ...e }) => {
139
149
  color: ${(o = t.theme.colors) == null ? void 0 : o.primary};
140
150
  }
141
151
  span {
142
- color: ${(l = t.theme.colors) == null ? void 0 : l.text};
152
+ color: ${(a = t.theme.colors) == null ? void 0 : a.text};
143
153
  }
144
154
  &:focus-visible {
145
- ${S(t)};
155
+ ${B(t)};
146
156
  }
147
157
  `;
148
- }, C = a($)`
158
+ }, P = c(y)`
149
159
  ${x}
150
160
  text-align: ${(t) => t.textAlign};
151
- `, B = a(y)`
161
+ `, T = c($)`
152
162
  ${x}
153
- `, H = a(m)`
163
+ `, W = c(d)`
154
164
  line-height: 1.6em;
155
165
  font-weight: 300;
156
166
  font-size: ${(t) => {
157
167
  var e;
158
168
  return (e = t.theme.fonts) == null ? void 0 : e.normal;
159
169
  }};
160
- `, P = a(m)`
170
+ `, j = c(d)`
161
171
  display: block;
162
172
  font-size: ${(t) => {
163
173
  var e;
@@ -167,7 +177,7 @@ const F = ({ className: t, ...e }) => {
167
177
  var e;
168
178
  return (e = t.theme.sizes) == null ? void 0 : e.normal;
169
179
  }} 0;
170
- `, T = a.svg`
180
+ `, V = c.svg`
171
181
  align-self: center;
172
182
 
173
183
  path {
@@ -179,5 +189,5 @@ const F = ({ className: t, ...e }) => {
179
189
  }
180
190
  `;
181
191
  export {
182
- F as default
192
+ G as default
183
193
  };
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";const t=require("@telia-ace/knowledge-widget-ui"),n=e=>t.createReactComponent(e,"contact-link",Promise.resolve().then(()=>require("./contact-link-af9e3354.js")));module.exports=n;
1
+ "use strict";const t=require("@telia-ace/knowledge-widget-ui"),n=e=>t.createReactComponent(e,"contact-link",Promise.resolve().then(()=>require("./contact-link-44666ccd.js")));module.exports=n;
package/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { createReactComponent as o } from "@telia-ace/knowledge-widget-ui";
2
2
  const e = (t) => o(
3
3
  t,
4
4
  "contact-link",
5
- import("./contact-link-442e49a1.mjs")
5
+ import("./contact-link-bf35f02f.mjs")
6
6
  );
7
7
  export {
8
8
  e as default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/knowledge-widget-components-contact-link",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -10,10 +10,11 @@
10
10
  }
11
11
  },
12
12
  "dependencies": {
13
- "@telia-ace/knowledge-widget-core": "^1.1.5",
14
- "@telia-ace/knowledge-widget-ui": "^1.1.5",
15
- "@telia-ace/widget-utilities": "^1.1.5",
16
- "@webprovisions/platform": "^1.1.4"
13
+ "@telia-ace/knowledge-widget-core": "^1.1.6",
14
+ "@telia-ace/knowledge-widget-ui": "^1.1.6",
15
+ "@telia-ace/widget-utilities": "^1.1.6",
16
+ "@webprovisions/platform": "^1.1.4",
17
+ "@telia-ace/widget-ui": "^1.1.6"
17
18
  },
18
19
  "peerDependencies": {
19
20
  "@emotion/react": "11.11.1",
@@ -1,60 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),f=require("@emotion/react"),a=require("@emotion/styled"),i=require("@telia-ace/knowledge-widget-ui"),m=require("@telia-ace/widget-utilities"),k=({className:e,...t})=>{const{widget:o,route:s,mode:l="large",iconSize:y="large",symbol:d,descriptionLabel:r,label:c,textAlign:g}=i.useProperties(),h=g||(l==="large"?"center":"right"),$=y==="large"?"64":"48",u={apiNotificationPriorityBy:"contacts"};if(l==="compact")return n.jsxs(b,{...t,className:m.appendClassNames(e,"humany-contact-link","humany-contact-link-compact"),textAlign:h,children:[r&&n.jsx(i.Text,{children:r}),s?n.jsx(i.Link,{routeName:s,children:c}):n.jsx(i.WidgetLink,{"aria-haspopup":"dialog",role:"button",activationOptions:u,widgetName:o,children:c})]});const p=n.jsxs(n.Fragment,{children:[d?n.jsx(i.SymbolBadge,{symbol:d}):n.jsx(M,{width:$,viewBox:"0 0 63 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{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",stroke:"#990AE3"})}),c&&n.jsx(z,{children:c}),r&&n.jsx(L,{children:r})]});return s?n.jsx(w,{...t,className:m.appendClassNames(e,"humany-contact-link","humany-contact-link-large"),routeName:s,children:p}):n.jsx(j,{...t,"aria-haspopup":"dialog",role:"button",className:m.appendClassNames(e,"humany-contact-link","humany-contact-link-large"),textAlign:h,widgetName:o,activationOptions:u,children:p})},b=a.div`
2
- text-align: ${e=>e.textAlign};
3
- font-weight: 300;
4
-
5
- span,
6
- a {
7
- display: inline-block;
8
- font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
9
- }
10
-
11
- span {
12
- margin: 0 ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.small}} 0 0;
13
- }
14
- a {
15
- text-decoration: underline;
16
- color: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
17
- &:focus-visible {
18
- ${i.linkTabStyle}
19
- padding: ${e=>{var t,o;return`calc(${(t=e.theme.sizes)==null?void 0:t.small} / 2) ${(o=e.theme.sizes)==null?void 0:o.small}`}};
20
- }
21
- }
22
- `,x=e=>{var t,o,s,l;return f.css`
23
- ${i.contentBox(e)}
24
- padding: ${(t=e.theme.sizes)==null?void 0:t.large};
25
- text-align: center;
26
- cursor: pointer;
27
- text-decoration: none;
28
- i {
29
- font-size: ${(o=e.theme.fonts)==null?void 0:o.huge};
30
- min-width: 1em;
31
- min-height: 1em;
32
- color: ${(s=e.theme.colors)==null?void 0:s.primary};
33
- }
34
- span {
35
- color: ${(l=e.theme.colors)==null?void 0:l.text};
36
- }
37
- &:focus-visible {
38
- ${i.borderTabStyle(e)};
39
- }
40
- `},j=a(i.WidgetLink)`
41
- ${x}
42
- text-align: ${e=>e.textAlign};
43
- `,w=a(i.Link)`
44
- ${x}
45
- `,L=a(i.Text)`
46
- line-height: 1.6em;
47
- font-weight: 300;
48
- font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.normal}};
49
- `,z=a(i.Text)`
50
- display: block;
51
- font-size: ${e=>{var t;return(t=e.theme.fonts)==null?void 0:t.medium}};
52
- margin: ${e=>{var t;return(t=e.theme.sizes)==null?void 0:t.normal}} 0;
53
- `,M=a.svg`
54
- align-self: center;
55
-
56
- path {
57
- vector-effect: non-scaling-stroke;
58
- stroke: ${e=>{var t;return(t=e.theme.colors)==null?void 0:t.primary}};
59
- }
60
- `;exports.default=k;