@arkitektbedriftene/fe-lib 2.0.8 → 2.2.0
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type CSS } from "@ui";
|
|
3
|
-
export declare const CompanyLogo: ({
|
|
3
|
+
export declare const CompanyLogo: import("react").ForwardRefExoticComponent<{
|
|
4
4
|
companyId: number | string;
|
|
5
5
|
maxWidth: string;
|
|
6
6
|
fallback?: string | undefined;
|
|
@@ -11,9 +11,13 @@ export declare const CompanyLogo: ({ companyId, maxWidth, fallback, width, css,
|
|
|
11
11
|
themeMap: {};
|
|
12
12
|
utils: {};
|
|
13
13
|
}> | undefined;
|
|
14
|
-
}
|
|
14
|
+
} & import("react").RefAttributes<HTMLImageElement>>;
|
|
15
15
|
export declare const createCompanyLogoElement: ({ companyId, maxWidth, width, }: {
|
|
16
16
|
companyId: string | number;
|
|
17
17
|
maxWidth: string;
|
|
18
18
|
width?: number | undefined;
|
|
19
19
|
}) => HTMLImageElement;
|
|
20
|
+
export declare const getCompanyLogoUrl: ({ companyId, width, }: {
|
|
21
|
+
companyId: string | number;
|
|
22
|
+
width?: number | undefined;
|
|
23
|
+
}) => string;
|
package/dist/elements.es.js
CHANGED
|
@@ -1,46 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Box as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p, useState as u } from "react";
|
|
3
|
+
import { Box as d } from "./ui.es.js";
|
|
4
|
+
const E = p(
|
|
5
|
+
({
|
|
6
|
+
companyId: r,
|
|
7
|
+
maxWidth: o,
|
|
8
|
+
fallback: t = void 0,
|
|
9
|
+
width: e = 500,
|
|
10
|
+
css: c
|
|
11
|
+
}, m) => {
|
|
12
|
+
const [n, a] = u(
|
|
13
|
+
s({ companyId: r, width: e })
|
|
14
|
+
), i = () => {
|
|
15
|
+
a(t);
|
|
16
|
+
};
|
|
17
|
+
return n ? /* @__PURE__ */ g(
|
|
18
|
+
d,
|
|
19
|
+
{
|
|
20
|
+
ref: m,
|
|
21
|
+
as: "img",
|
|
22
|
+
src: n,
|
|
23
|
+
onError: n !== t ? i : void 0,
|
|
24
|
+
css: {
|
|
25
|
+
maxWidth: o,
|
|
26
|
+
maxHeight: `calc(${o} / 2)`,
|
|
27
|
+
...c
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
) : null;
|
|
31
|
+
}
|
|
32
|
+
), L = ({
|
|
30
33
|
companyId: r,
|
|
31
|
-
maxWidth:
|
|
32
|
-
width:
|
|
34
|
+
maxWidth: o,
|
|
35
|
+
width: t = 500
|
|
33
36
|
}) => {
|
|
34
|
-
const
|
|
35
|
-
return
|
|
37
|
+
const e = document.createElement("img");
|
|
38
|
+
return e.style.maxWidth = o, e.style.maxHeight = `calc(${o} / 2)`, e.addEventListener(
|
|
36
39
|
"error",
|
|
37
40
|
() => {
|
|
38
|
-
|
|
41
|
+
e.remove();
|
|
39
42
|
},
|
|
40
43
|
{ once: !0 }
|
|
41
|
-
),
|
|
42
|
-
}
|
|
44
|
+
), e.src = s({ companyId: r, width: t }), e;
|
|
45
|
+
}, s = ({
|
|
46
|
+
companyId: r,
|
|
47
|
+
width: o = 500
|
|
48
|
+
}) => `https://prod-content-ab.azurewebsites.net/api/Logo/${r}?width=${o}`;
|
|
43
49
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
50
|
+
E as CompanyLogo,
|
|
51
|
+
L as createCompanyLogoElement,
|
|
52
|
+
s as getCompanyLogoUrl
|
|
46
53
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! modern-normalize v2.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */*,:before,:after{box-sizing:border-box}html{font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";line-height:1.15;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4}body{margin:0}hr{height:0;color:inherit}abbr[title]{text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}[role=button]{cursor:pointer}button:not(:disabled),[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled){cursor:pointer}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}table{text-indent:0;border-color:inherit;border-collapse:collapse}hr{height:0;color:inherit;border-top-width:1px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui/normalize.css'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkitektbedriftene/fe-lib",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"import": "./dist/ui.es.js",
|
|
36
36
|
"types": "./dist/ui.d.ts"
|
|
37
37
|
},
|
|
38
|
+
"./ui/normalize.css": {
|
|
39
|
+
"import": "./dist/normalize.css"
|
|
40
|
+
},
|
|
38
41
|
"./ui/ui.css": {
|
|
39
42
|
"import": "./dist/ui.css"
|
|
40
43
|
}
|