@telia-ace/knowledge-widget-components-contact-link 1.0.45 → 1.1.1-rc.1

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 i=require("react/jsx-runtime"),n=require("./index-4f51e43f.js"),y=require("react");require("react-dom");const $=()=>y.useContext(n.ComponentPropertyContext),f=({className:e,...t})=>{const{widget:o,route:s,mode:a="large",iconSize:x="large",symbol:c,descriptionLabel:l,label:r,textAlign:m}=$(),d=m||(a==="large"?"center":"right"),u=x==="large"?"64":"48",g={apiNotificationPriorityBy:"contacts"};if(a==="compact")return i.jsxs(k,{...t,className:n.appendClassNames(e,"humany-contact-link","humany-contact-link-compact"),textAlign:d,children:[l&&i.jsx(n.Text,{children:l}),s?i.jsx(n.Link,{routeName:s,children:r}):i.jsx(n.WidgetLink,{"aria-haspopup":"dialog",role:"button",activationOptions:g,widgetName:o,children:r})]});const h=i.jsxs(i.Fragment,{children:[c?i.jsx(n.SymbolBadge,{symbol:c}):i.jsx(L,{width:u,viewBox:"0 0 63 37",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.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&&i.jsx(j,{children:r}),l&&i.jsx(S,{children:l})]});return s?i.jsx(b,{...t,className:n.appendClassNames(e,"humany-contact-link","humany-contact-link-large"),routeName:s,children:h}):i.jsx(w,{...t,"aria-haspopup":"dialog",role:"button",className:n.appendClassNames(e,"humany-contact-link","humany-contact-link-large"),textAlign:d,widgetName:o,activationOptions:g,children:h})},k=n.newStyled.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
+ ${n.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
+ `,p=e=>{var t,o,s,a;return n.css`
23
+ ${n.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
+ ${n.borderTabStyle(e)};
39
+ }
40
+ `},w=n.newStyled(n.WidgetLink)`
41
+ ${p}
42
+ text-align: ${e=>e.textAlign};
43
+ `,b=n.newStyled(n.Link)`
44
+ ${p}
45
+ `,S=n.newStyled(n.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
+ `,j=n.newStyled(n.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
+ `,L=n.newStyled.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=f;
@@ -0,0 +1,182 @@
1
+ import { jsxs as f, jsx as n, Fragment as w } from "react/jsx-runtime";
2
+ import { C as L, a as c, T as m, L as y, W as x, S as z, n as a, l as C, c as M, b as S, d as v } from "./index-252b1674.mjs";
3
+ import { useContext as N } from "react";
4
+ import "react-dom";
5
+ const A = () => N(L), I = ({ className: t, ...e }) => {
6
+ const {
7
+ widget: o,
8
+ route: i,
9
+ mode: s = "large",
10
+ iconSize: k = "large",
11
+ symbol: g,
12
+ descriptionLabel: r,
13
+ label: l,
14
+ textAlign: d
15
+ } = A(), h = d || (s === "large" ? "center" : "right"), b = k === "large" ? "64" : "48", p = {
16
+ apiNotificationPriorityBy: "contacts"
17
+ };
18
+ if (s === "compact")
19
+ return /* @__PURE__ */ f(
20
+ B,
21
+ {
22
+ ...e,
23
+ className: c(
24
+ t,
25
+ "humany-contact-link",
26
+ "humany-contact-link-compact"
27
+ ),
28
+ textAlign: h,
29
+ children: [
30
+ r && /* @__PURE__ */ n(m, { children: r }),
31
+ i ? /* @__PURE__ */ n(y, { routeName: i, children: l }) : /* @__PURE__ */ n(
32
+ x,
33
+ {
34
+ "aria-haspopup": "dialog",
35
+ role: "button",
36
+ activationOptions: p,
37
+ widgetName: o,
38
+ children: l
39
+ }
40
+ )
41
+ ]
42
+ }
43
+ );
44
+ const u = /* @__PURE__ */ f(w, { children: [
45
+ g ? /* @__PURE__ */ n(z, { symbol: g }) : /* @__PURE__ */ n(
46
+ j,
47
+ {
48
+ width: b,
49
+ viewBox: "0 0 63 37",
50
+ fill: "none",
51
+ xmlns: "http://www.w3.org/2000/svg",
52
+ children: /* @__PURE__ */ n(
53
+ "path",
54
+ {
55
+ 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",
56
+ stroke: "#990AE3"
57
+ }
58
+ )
59
+ }
60
+ ),
61
+ l && /* @__PURE__ */ n(H, { children: l }),
62
+ r && /* @__PURE__ */ n(W, { children: r })
63
+ ] });
64
+ return i ? /* @__PURE__ */ n(
65
+ T,
66
+ {
67
+ ...e,
68
+ className: c(
69
+ t,
70
+ "humany-contact-link",
71
+ "humany-contact-link-large"
72
+ ),
73
+ routeName: i,
74
+ children: u
75
+ }
76
+ ) : /* @__PURE__ */ n(
77
+ P,
78
+ {
79
+ ...e,
80
+ "aria-haspopup": "dialog",
81
+ role: "button",
82
+ className: c(
83
+ t,
84
+ "humany-contact-link",
85
+ "humany-contact-link-large"
86
+ ),
87
+ textAlign: h,
88
+ widgetName: o,
89
+ activationOptions: p,
90
+ children: u
91
+ }
92
+ );
93
+ }, B = a.div`
94
+ text-align: ${(t) => t.textAlign};
95
+ font-weight: 300;
96
+
97
+ span,
98
+ a {
99
+ display: inline-block;
100
+ font-size: ${(t) => {
101
+ var e;
102
+ return (e = t.theme.fonts) == null ? void 0 : e.normal;
103
+ }};
104
+ }
105
+
106
+ span {
107
+ margin: 0 ${(t) => {
108
+ var e;
109
+ return (e = t.theme.sizes) == null ? void 0 : e.small;
110
+ }} 0 0;
111
+ }
112
+ a {
113
+ text-decoration: underline;
114
+ color: ${(t) => {
115
+ var e;
116
+ return (e = t.theme.colors) == null ? void 0 : e.primary;
117
+ }};
118
+ &:focus-visible {
119
+ ${C}
120
+ padding: ${(t) => {
121
+ var e, o;
122
+ return `calc(${(e = t.theme.sizes) == null ? void 0 : e.small} / 2) ${(o = t.theme.sizes) == null ? void 0 : o.small}`;
123
+ }};
124
+ }
125
+ }
126
+ `, $ = (t) => {
127
+ var e, o, i, s;
128
+ return M`
129
+ ${S(t)}
130
+ padding: ${(e = t.theme.sizes) == null ? void 0 : e.large};
131
+ text-align: center;
132
+ cursor: pointer;
133
+ text-decoration: none;
134
+ i {
135
+ font-size: ${(o = t.theme.fonts) == null ? void 0 : o.huge};
136
+ min-width: 1em;
137
+ min-height: 1em;
138
+ color: ${(i = t.theme.colors) == null ? void 0 : i.primary};
139
+ }
140
+ span {
141
+ color: ${(s = t.theme.colors) == null ? void 0 : s.text};
142
+ }
143
+ &:focus-visible {
144
+ ${v(t)};
145
+ }
146
+ `;
147
+ }, P = a(x)`
148
+ ${$}
149
+ text-align: ${(t) => t.textAlign};
150
+ `, T = a(y)`
151
+ ${$}
152
+ `, W = a(m)`
153
+ line-height: 1.6em;
154
+ font-weight: 300;
155
+ font-size: ${(t) => {
156
+ var e;
157
+ return (e = t.theme.fonts) == null ? void 0 : e.normal;
158
+ }};
159
+ `, H = a(m)`
160
+ display: block;
161
+ font-size: ${(t) => {
162
+ var e;
163
+ return (e = t.theme.fonts) == null ? void 0 : e.medium;
164
+ }};
165
+ margin: ${(t) => {
166
+ var e;
167
+ return (e = t.theme.sizes) == null ? void 0 : e.normal;
168
+ }} 0;
169
+ `, j = a.svg`
170
+ align-self: center;
171
+
172
+ path {
173
+ vector-effect: non-scaling-stroke;
174
+ stroke: ${(t) => {
175
+ var e;
176
+ return (e = t.theme.colors) == null ? void 0 : e.primary;
177
+ }};
178
+ }
179
+ `;
180
+ export {
181
+ I as default
182
+ };