@telia-ace/widget-components-image-link 1.0.17 → 1.0.18
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,56 @@
|
|
|
1
|
+
var g = Object.defineProperty, k = Object.defineProperties;
|
|
2
|
+
var y = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var m = Object.getOwnPropertySymbols;
|
|
4
|
+
var p = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var n = (e, a, r) => a in e ? g(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r, d = (e, a) => {
|
|
6
|
+
for (var r in a || (a = {}))
|
|
7
|
+
p.call(a, r) && n(e, r, a[r]);
|
|
8
|
+
if (m)
|
|
9
|
+
for (var r of m(a))
|
|
10
|
+
b.call(a, r) && n(e, r, a[r]);
|
|
11
|
+
return e;
|
|
12
|
+
}, u = (e, a) => k(e, y(a));
|
|
13
|
+
var f = (e, a) => {
|
|
14
|
+
var r = {};
|
|
15
|
+
for (var t in e)
|
|
16
|
+
p.call(e, t) && a.indexOf(t) < 0 && (r[t] = e[t]);
|
|
17
|
+
if (e != null && m)
|
|
18
|
+
for (var t of m(e))
|
|
19
|
+
a.indexOf(t) < 0 && b.call(e, t) && (r[t] = e[t]);
|
|
20
|
+
return r;
|
|
21
|
+
};
|
|
22
|
+
import { useProperties as E, Link as L, borderTabStyle as N } from "@telia-ace/widget-ui";
|
|
23
|
+
import { appendClassNames as h } from "@telia-ace/widget-utilities";
|
|
24
|
+
import l from "react";
|
|
25
|
+
import v from "styled-components";
|
|
26
|
+
const S = (r) => {
|
|
27
|
+
var t = r, { className: e } = t, a = f(t, ["className"]);
|
|
28
|
+
const { route: i, image: o, ariaLabel: s, altLabel: c } = E();
|
|
29
|
+
return /* @__PURE__ */ l.createElement(x, u(d({}, a), {
|
|
30
|
+
className: h(e, "humany-image-link")
|
|
31
|
+
}), i ? /* @__PURE__ */ l.createElement(L, {
|
|
32
|
+
routeName: i,
|
|
33
|
+
"aria-label": s
|
|
34
|
+
}, /* @__PURE__ */ l.createElement("img", {
|
|
35
|
+
src: o,
|
|
36
|
+
alt: c
|
|
37
|
+
})) : /* @__PURE__ */ l.createElement("img", {
|
|
38
|
+
src: o,
|
|
39
|
+
alt: c,
|
|
40
|
+
"aria-label": s
|
|
41
|
+
}));
|
|
42
|
+
}, x = v.div`
|
|
43
|
+
a {
|
|
44
|
+
display: block;
|
|
45
|
+
&:focus-visible {
|
|
46
|
+
${N};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
img {
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
export {
|
|
54
|
+
S as default
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=image-link.05d2515a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-link.
|
|
1
|
+
{"version":3,"file":"image-link.05d2515a.js","sources":["../src/image-link.tsx"],"sourcesContent":["import { borderTabStyle, Link, useProperties } from '@telia-ace/widget-ui';\r\nimport { appendClassNames } from '@telia-ace/widget-utilities';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport { ImageLinkComponentProps } from './image-link-component';\r\n\r\ntype Props = {\r\n className: string;\r\n};\r\n\r\nconst ImageLink: React.SFC<Props> = ({ className, ...other }) => {\r\n const { route, image, ariaLabel, altLabel } = useProperties<ImageLinkComponentProps>();\r\n\r\n // ariaLabel is used as alt text when no link is specified, else\r\n // used for aria-label on the link.\r\n\r\n return (\r\n <Wrapper {...other} className={appendClassNames(className, 'humany-image-link')}>\r\n {route ? (\r\n <Link routeName={route} aria-label={ariaLabel}>\r\n <img src={image} alt={altLabel} />\r\n </Link>\r\n ) : (\r\n <img src={image} alt={altLabel} aria-label={ariaLabel} />\r\n )}\r\n </Wrapper>\r\n );\r\n};\r\n\r\nconst Wrapper = styled.div`\r\n a {\r\n display: block;\r\n &:focus-visible {\r\n ${borderTabStyle};\r\n }\r\n }\r\n img {\r\n max-width: 100%;\r\n }\r\n`;\r\n\r\nexport default ImageLink;\r\n"],"names":["ImageLink","_a","_b","className","other","__objRest","route","image","ariaLabel","altLabel","useProperties","React","Wrapper","__spreadProps","__spreadValues","appendClassNames","Link","styled","borderTabStyle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAMA,IAA8B,CAACC,MAA4B;AAA5B,MAAAC,IAAAD,GAAE,aAAAE,MAAFD,GAAgBE,IAAAC,EAAhBH,GAAgB,CAAd;AACnC,QAAM,EAAE,OAAAI,GAAO,OAAAC,GAAO,WAAAC,GAAW,UAAAC,EAAA,IAAaC;AAK9C,SACK,gBAAAC,EAAA,cAAAC,GAAAC,EAAAC,EAAA,IAAYV,IAAZ;AAAA,IAAmB,WAAWW,EAAiBZ,GAAW,mBAAmB;AAAA,EAAA,IACzEG,IACI,gBAAAK,EAAA,cAAAK,GAAA;AAAA,IAAK,WAAWV;AAAA,IAAO,cAAYE;AAAA,EAAA,GAC/B,gBAAAG,EAAA,cAAA,OAAA;AAAA,IAAI,KAAKJ;AAAA,IAAO,KAAKE;AAAA,EAAU,CAAA,CACpC,IAEC,gBAAAE,EAAA,cAAA,OAAA;AAAA,IAAI,KAAKJ;AAAA,IAAO,KAAKE;AAAA,IAAU,cAAYD;AAAA,EAAW,CAAA,CAE/D;AAER,GAEMI,IAAUK,EAAO;AAAA;AAAA;AAAA;AAAA,cAITC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/image-link-component.ts"],"sourcesContent":["import { createReactComponent } from '@telia-ace/widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\n\r\nexport type ImageLinkComponentProps = {\r\n route: string;\r\n image: string;\r\n ariaLabel: string;\r\n altLabel: string;\r\n};\r\n\r\nconst ImageLinkComponent = (container: Container) => {\r\n return createReactComponent(container, 'image-link', import('./image-link'));\r\n};\r\n\r\nexport default ImageLinkComponent;\r\n"],"names":[],"mappings":";AAUM,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/image-link-component.ts"],"sourcesContent":["import { createReactComponent } from '@telia-ace/widget-ui';\r\nimport { Container } from '@webprovisions/platform';\r\n\r\nexport type ImageLinkComponentProps = {\r\n route: string;\r\n image: string;\r\n ariaLabel: string;\r\n altLabel: string;\r\n};\r\n\r\nconst ImageLinkComponent = (container: Container) => {\r\n return createReactComponent(container, 'image-link', import('./image-link'));\r\n};\r\n\r\nexport default ImageLinkComponent;\r\n"],"names":["ImageLinkComponent","container","createReactComponent"],"mappings":";AAUM,MAAAA,IAAqB,CAACC,MACjBC,EAAqBD,GAAW,cAAc,OAAO,2BAAe;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/widget-components-image-link",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Image link component for ACE Widgets.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"telia"
|
|
9
9
|
],
|
|
10
10
|
"main": "dist/index.js",
|
|
11
|
+
"sourceMain": "src/index.ts",
|
|
11
12
|
"type": "module",
|
|
12
13
|
"types": "dist/index.d.ts",
|
|
13
14
|
"files": [
|
|
@@ -25,8 +26,8 @@
|
|
|
25
26
|
},
|
|
26
27
|
"sideEffects": false,
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@telia-ace/widget-ui": "^1.0.
|
|
29
|
-
"@telia-ace/widget-utilities": "^1.0.
|
|
29
|
+
"@telia-ace/widget-ui": "^1.0.22",
|
|
30
|
+
"@telia-ace/widget-utilities": "^1.0.4",
|
|
30
31
|
"@webprovisions/platform": "^1.1.2"
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
@@ -39,5 +40,5 @@
|
|
|
39
40
|
"@types/react-dom": "^16.8.0",
|
|
40
41
|
"@types/styled-components": "^5.1.7"
|
|
41
42
|
},
|
|
42
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c3045eebac4251ae8ba27333abd9b6aa3ccd5b38"
|
|
43
44
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var f = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
-
var k = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var i = Object.getOwnPropertySymbols;
|
|
4
|
-
var p = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var n = (e, a, t) => a in e ? f(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, d = (e, a) => {
|
|
6
|
-
for (var t in a || (a = {}))
|
|
7
|
-
p.call(a, t) && n(e, t, a[t]);
|
|
8
|
-
if (i)
|
|
9
|
-
for (var t of i(a))
|
|
10
|
-
b.call(a, t) && n(e, t, a[t]);
|
|
11
|
-
return e;
|
|
12
|
-
}, g = (e, a) => y(e, k(a));
|
|
13
|
-
var u = (e, a) => {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var r in e)
|
|
16
|
-
p.call(e, r) && a.indexOf(r) < 0 && (t[r] = e[r]);
|
|
17
|
-
if (e != null && i)
|
|
18
|
-
for (var r of i(e))
|
|
19
|
-
a.indexOf(r) < 0 && b.call(e, r) && (t[r] = e[r]);
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
|
-
import { useProperties as E, Link as L, borderTabStyle as h } from "@telia-ace/widget-ui";
|
|
23
|
-
import { appendClassNames as N } from "@telia-ace/widget-utilities";
|
|
24
|
-
import m from "react";
|
|
25
|
-
import x from "styled-components";
|
|
26
|
-
const R = (t) => {
|
|
27
|
-
var r = t, { className: e } = r, a = u(r, ["className"]);
|
|
28
|
-
const { route: l, image: s, ariaLabel: o, altLabel: c } = E();
|
|
29
|
-
return /* @__PURE__ */ m.createElement(T, g(d({}, a), {
|
|
30
|
-
className: N(e, "humany-image-link")
|
|
31
|
-
}), l ? /* @__PURE__ */ m.createElement(L, {
|
|
32
|
-
routeName: l,
|
|
33
|
-
"aria-label": o
|
|
34
|
-
}, /* @__PURE__ */ m.createElement("img", {
|
|
35
|
-
src: s,
|
|
36
|
-
alt: c
|
|
37
|
-
})) : /* @__PURE__ */ m.createElement("img", {
|
|
38
|
-
src: s,
|
|
39
|
-
alt: c,
|
|
40
|
-
"aria-label": o
|
|
41
|
-
}));
|
|
42
|
-
}, T = x.div`
|
|
43
|
-
a {
|
|
44
|
-
display: block;
|
|
45
|
-
&:focus {
|
|
46
|
-
${(e) => {
|
|
47
|
-
var a;
|
|
48
|
-
return ((a = e.theme.accessibility) == null ? void 0 : a.isTabbing) && h;
|
|
49
|
-
}};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
img {
|
|
53
|
-
max-width: 100%;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
export {
|
|
57
|
-
R as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=image-link.88dbb1e6.js.map
|