@telia-ace/widget-components-image-link 0.0.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.
- package/image-link-31e91045.mjs +28 -0
- package/image-link-850d4a3c.js +11 -0
- package/image-link-component.d.ts +10 -0
- package/image-link.d.ts +7 -0
- package/index.d.ts +3 -0
- package/index.js +1 -0
- package/index.mjs +5 -0
- package/package.json +23 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import o from "@emotion/styled";
|
|
3
|
+
import { useProperties as s, Link as n, borderTabStyle as p } from "@telia-ace/widget-ui";
|
|
4
|
+
import { appendClassNames as c } from "@telia-ace/widget-utilities";
|
|
5
|
+
const h = ({ className: m, ...t }) => {
|
|
6
|
+
const { route: e, image: r, ariaLabel: i, altLabel: l } = s();
|
|
7
|
+
return /* @__PURE__ */ a(
|
|
8
|
+
d,
|
|
9
|
+
{
|
|
10
|
+
...t,
|
|
11
|
+
className: c(m, "humany-image-link"),
|
|
12
|
+
children: e ? /* @__PURE__ */ a(n, { routeName: e, "aria-label": i, children: /* @__PURE__ */ a("img", { src: r, alt: l }) }) : /* @__PURE__ */ a("img", { src: r, alt: l, "aria-label": i })
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}, d = o.div`
|
|
16
|
+
a {
|
|
17
|
+
display: block;
|
|
18
|
+
&:focus-visible {
|
|
19
|
+
${p};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
img {
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
export {
|
|
27
|
+
h as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@emotion/styled"),i=require("@telia-ace/widget-ui"),c=require("@telia-ace/widget-utilities"),u=({className:l,...n})=>{const{route:a,image:r,ariaLabel:t,altLabel:s}=i.useProperties();return e.jsx(d,{...n,className:c.appendClassNames(l,"humany-image-link"),children:a?e.jsx(i.Link,{routeName:a,"aria-label":t,children:e.jsx("img",{src:r,alt:s})}):e.jsx("img",{src:r,alt:s,"aria-label":t})})},d=o.div`
|
|
2
|
+
a {
|
|
3
|
+
display: block;
|
|
4
|
+
&:focus-visible {
|
|
5
|
+
${i.borderTabStyle};
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
img {
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
}
|
|
11
|
+
`;exports.default=u;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Container } from '@webprovisions/platform';
|
|
2
|
+
|
|
3
|
+
export type ImageLinkComponentProps = {
|
|
4
|
+
route: string;
|
|
5
|
+
image: string;
|
|
6
|
+
ariaLabel: string;
|
|
7
|
+
altLabel: string;
|
|
8
|
+
};
|
|
9
|
+
declare const ImageLinkComponent: (container: Container) => Promise<void>;
|
|
10
|
+
export default ImageLinkComponent;
|
package/image-link.d.ts
ADDED
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("@telia-ace/widget-ui"),r=e=>t.createReactComponent(e,"image-link",Promise.resolve().then(()=>require("./image-link-850d4a3c.js")));module.exports=r;
|
package/index.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@telia-ace/widget-components-image-link",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./index.js",
|
|
5
|
+
"types": "./index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./index.mjs",
|
|
9
|
+
"require": "./index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@telia-ace/widget-core": "*",
|
|
14
|
+
"@telia-ace/widget-ui": "*",
|
|
15
|
+
"@telia-ace/widget-utilities": "*",
|
|
16
|
+
"@webprovisions/platform": "^1.1.4"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@emotion/react": "11.11.1",
|
|
20
|
+
"@emotion/styled": "11.11.0",
|
|
21
|
+
"react": "18.2.0"
|
|
22
|
+
}
|
|
23
|
+
}
|