@telia-ace/widget-components-image-link 1.0.13 → 1.0.16

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,59 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-link.88dbb1e6.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 {\r\n ${(p: any) => p.theme.accessibility?.isTabbing && 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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,IAA8B,CAAC,MAA4B;AAA5B,aAAE,mBAAF,GAAgB,MAAhB,GAAgB,CAAd;AACnC,QAAM,EAAE,UAAO,UAAO,cAAW,gBAAa;AAK9C,SACK,kBAAA,cAAA,GAAA,QAAY,IAAZ;AAAA,IAAmB,WAAW,EAAiB,GAAW,mBAAmB;AAAA,EAAA,IACzE,IACI,kBAAA,cAAA,GAAA;AAAA,IAAK,WAAW;AAAA,IAAO,cAAY;AAAA,EAAA,GAC/B,kBAAA,cAAA,OAAA;AAAA,IAAI,KAAK;AAAA,IAAO,KAAK;AAAA,EAAU,CAAA,CACpC,IAEC,kBAAA,cAAA,OAAA;AAAA,IAAI,KAAK;AAAA,IAAO,KAAK;AAAA,IAAU,cAAY;AAAA,EAAW,CAAA,CAE/D;AAER,GAEM,IAAU,EAAO;AAAA;AAAA;AAAA;AAAA,cAIT,CAAC,MAAA;;AAAW,iBAAE,MAAM,kBAAR,kBAAuB,cAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createReactComponent } from "@telia-ace/widget-ui";
2
- const ImageLinkComponent = (container) => {
3
- return createReactComponent(container, "image-link", import("./image-link.js"));
1
+ import { createReactComponent as t } from "@telia-ace/widget-ui";
2
+ const n = (e) => t(e, "image-link", import("./image-link.88dbb1e6.js"));
3
+ export {
4
+ n as default
4
5
  };
5
- export { ImageLinkComponent as default };
6
6
  //# sourceMappingURL=index.js.map
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,MAAA,qBAAqB,CAAC,cAAyB;AACjD,SAAO,qBAAqB,WAAW,cAAc,OAAO,kBAAe;AAC/E;;"}
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,MAAA,IAAqB,CAAC,MACjB,EAAqB,GAAW,cAAc,OAAO,2BAAe;"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-components-image-link",
3
- "version": "1.0.13",
3
+ "version": "1.0.16",
4
4
  "description": "Image link component for ACE Widgets.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
7
7
  "keywords": [
8
8
  "telia"
9
9
  ],
10
- "source": "src/index.ts",
11
- "module": "dist/index.js",
10
+ "main": "dist/index.js",
11
+ "type": "module",
12
12
  "types": "dist/index.d.ts",
13
13
  "files": [
14
14
  "LICENSE.txt",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@telia-ace/widget-ui": "^1.0.17",
28
+ "@telia-ace/widget-ui": "^1.0.20",
29
29
  "@telia-ace/widget-utilities": "^1.0.2",
30
30
  "@webprovisions/platform": "^1.1.2"
31
31
  },
@@ -39,5 +39,5 @@
39
39
  "@types/react-dom": "^16.8.0",
40
40
  "@types/styled-components": "^5.1.7"
41
41
  },
42
- "gitHead": "b6c2eb6fec7cd0c8e4334ab7a8e0087422fe1964"
42
+ "gitHead": "3884b26fc8ea8cafc93d37709cceb66742671918"
43
43
  }
@@ -1,68 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
- import { useProperties, Link, borderTabStyle } from "@telia-ace/widget-ui";
33
- import { appendClassNames } from "@telia-ace/widget-utilities";
34
- import React from "react";
35
- import styled from "styled-components";
36
- const ImageLink = (_a) => {
37
- var _b = _a, { className } = _b, other = __objRest(_b, ["className"]);
38
- const { route, image, ariaLabel, altLabel } = useProperties();
39
- return /* @__PURE__ */ React.createElement(Wrapper, __spreadProps(__spreadValues({}, other), {
40
- className: appendClassNames(className, "humany-image-link")
41
- }), route ? /* @__PURE__ */ React.createElement(Link, {
42
- routeName: route,
43
- "aria-label": ariaLabel
44
- }, /* @__PURE__ */ React.createElement("img", {
45
- src: image,
46
- alt: altLabel
47
- })) : /* @__PURE__ */ React.createElement("img", {
48
- src: image,
49
- alt: altLabel,
50
- "aria-label": ariaLabel
51
- }));
52
- };
53
- const Wrapper = styled.div`
54
- a {
55
- display: block;
56
- &:focus {
57
- ${(p) => {
58
- var _a;
59
- return ((_a = p.theme.accessibility) == null ? void 0 : _a.isTabbing) && borderTabStyle;
60
- }};
61
- }
62
- }
63
- img {
64
- max-width: 100%;
65
- }
66
- `;
67
- export { ImageLink as default };
68
- //# sourceMappingURL=image-link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-link.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 {\r\n ${(p: any) => p.theme.accessibility?.isTabbing && 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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,YAA8B,CAAC,OAA4B;AAA5B,eAAE,gBAAF,IAAgB,kBAAhB,IAAgB,CAAd;AACnC,QAAM,EAAE,OAAO,OAAO,WAAW,aAAa;AAK9C,SACK,sBAAA,cAAA,SAAA,iCAAY,QAAZ;AAAA,IAAmB,WAAW,iBAAiB,WAAW,mBAAmB;AAAA,EAAA,IACzE,QACI,sBAAA,cAAA,MAAA;AAAA,IAAK,WAAW;AAAA,IAAO,cAAY;AAAA,EAAA,GAC/B,sBAAA,cAAA,OAAA;AAAA,IAAI,KAAK;AAAA,IAAO,KAAK;AAAA,EAAU,CAAA,CACpC,IAEC,sBAAA,cAAA,OAAA;AAAA,IAAI,KAAK;AAAA,IAAO,KAAK;AAAA,IAAU,cAAY;AAAA,EAAW,CAAA,CAE/D;AAER;AAEA,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA,cAIT,CAAC,MAAA;;AAAW,kBAAE,MAAM,kBAAR,mBAAuB,cAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;"}