@altinn/altinn-components 0.33.7 → 0.34.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,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as e, jsxs as y } from "react/jsx-runtime";
|
|
3
3
|
import { c as C } from "../../index-L8X2o7IH.js";
|
|
4
4
|
import { useState as S } from "react";
|
|
5
5
|
import { Skeleton as j } from "../Skeleton/Skeleton.js";
|
|
@@ -14,7 +14,7 @@ import '../../assets/Avatar.css';const E = "_avatar_1k073_1", I = "_shape_1k073_
|
|
|
14
14
|
size: i,
|
|
15
15
|
name: o = "Avatar",
|
|
16
16
|
outline: n = !1,
|
|
17
|
-
imageUrl:
|
|
17
|
+
imageUrl: t,
|
|
18
18
|
imageUrlAlt: m,
|
|
19
19
|
customLabel: p,
|
|
20
20
|
loading: l,
|
|
@@ -23,12 +23,12 @@ import '../../assets/Avatar.css';const E = "_avatar_1k073_1", I = "_shape_1k073_
|
|
|
23
23
|
innerContainerStyle: h = {},
|
|
24
24
|
avatarImageStyle: u = {}
|
|
25
25
|
}) => {
|
|
26
|
-
const [v, _] = S(!1), f = a === "person" ? "circle" : "square", g = a === "person" ? "light" : "dark", { backgroundColor: k, foregroundColor: b } = A(o, g), N = (o[0] ?? "").toUpperCase(),
|
|
26
|
+
const [v, _] = S(!1), f = a === "person" ? "circle" : "square", g = a === "person" ? "light" : "dark", { backgroundColor: k, foregroundColor: b } = A(o, g), N = (o[0] ?? "").toUpperCase(), s = t && !v, x = !l && !s ? {
|
|
27
27
|
...c,
|
|
28
28
|
backgroundColor: k,
|
|
29
29
|
color: b
|
|
30
30
|
} : c;
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ e(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
className: C(r.avatar, { [r.outline]: n }, d),
|
|
@@ -38,19 +38,19 @@ import '../../assets/Avatar.css';const E = "_avatar_1k073_1", I = "_shape_1k073_
|
|
|
38
38
|
"data-outline": n,
|
|
39
39
|
"aria-hidden": !0,
|
|
40
40
|
children: /* @__PURE__ */ y(j, { loading: l, className: r.shape, variant: "circle", children: [
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ e("div", { className: r.shape, style: s ? h : {}, children: s && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
43
43
|
{
|
|
44
|
-
src:
|
|
44
|
+
src: t,
|
|
45
45
|
className: r.image,
|
|
46
|
-
alt: m ||
|
|
46
|
+
alt: m || t,
|
|
47
47
|
style: u,
|
|
48
48
|
onError: () => {
|
|
49
49
|
_(!0);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
) }),
|
|
53
|
-
!
|
|
53
|
+
!s && /* @__PURE__ */ e("span", { className: r.label, children: p || N })
|
|
54
54
|
] })
|
|
55
55
|
}
|
|
56
56
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, jsx as
|
|
2
|
+
import { jsxs as s, jsx as c } from "react/jsx-runtime";
|
|
3
3
|
import { c as f } from "../../index-L8X2o7IH.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as l from "react";
|
|
5
5
|
import { forwardRef as d } from "react";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
import "../Searchbar/AutocompleteBase.js";
|
|
@@ -9,49 +9,49 @@ import "../Snackbar/useSnackbar.js";
|
|
|
9
9
|
import { IconButton as m } from "../Button/IconButton.js";
|
|
10
10
|
import { u as p } from "../../useId-BVFxCjkq.js";
|
|
11
11
|
import { S as u } from "../../XMark-DIqxCTTQ.js";
|
|
12
|
-
import '../../assets/Banner.css';var v = function(e,
|
|
12
|
+
import '../../assets/Banner.css';var v = function(e, i) {
|
|
13
13
|
var n = {};
|
|
14
|
-
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) &&
|
|
14
|
+
for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && i.indexOf(t) < 0 && (n[t] = e[t]);
|
|
15
15
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
16
|
for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
|
|
17
|
-
|
|
17
|
+
i.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
|
|
18
18
|
return n;
|
|
19
19
|
};
|
|
20
|
-
const h = d((e,
|
|
20
|
+
const h = d((e, i) => {
|
|
21
21
|
var { title: n, titleId: t } = e, r = v(e, ["title", "titleId"]);
|
|
22
22
|
let a = p();
|
|
23
|
-
return a = n ? t || "title-" + a : void 0,
|
|
23
|
+
return a = n ? t || "title-" + a : void 0, l.createElement(
|
|
24
24
|
"svg",
|
|
25
|
-
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref:
|
|
26
|
-
n ?
|
|
27
|
-
|
|
25
|
+
Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: i, "aria-labelledby": a }, r),
|
|
26
|
+
n ? l.createElement("title", { id: a }, n) : null,
|
|
27
|
+
l.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M4 3.25a.75.75 0 0 0-.75.75v16c0 .414.336.75.75.75h16a.75.75 0 0 0 .75-.75V4a.75.75 0 0 0-.75-.75zm.75 16V4.75h14.5v14.5zM11 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0M10.5 10a.75.75 0 0 0 0 1.5h.75v4h-.75a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5h-.75v-4.75A.75.75 0 0 0 12 10z", clipRule: "evenodd" })
|
|
28
28
|
);
|
|
29
|
-
}), _ = "_banner_1of7r_1", b = "_sticky_1of7r_12", g = "_title_1of7r_18", y = "_infoIcon_1of7r_25",
|
|
29
|
+
}), _ = "_banner_1of7r_1", b = "_sticky_1of7r_12", g = "_title_1of7r_18", y = "_infoIcon_1of7r_25", o = {
|
|
30
30
|
banner: _,
|
|
31
31
|
sticky: b,
|
|
32
32
|
title: g,
|
|
33
33
|
infoIcon: y
|
|
34
34
|
};
|
|
35
35
|
var w = /* @__PURE__ */ ((e) => (e.accent = "accent", e.success = "success", e.warning = "warning", e.danger = "danger", e.info = "info", e))(w || {});
|
|
36
|
-
const z = ({ closeTitle: e = "close", onClose:
|
|
36
|
+
const z = ({ closeTitle: e = "close", onClose: i, text: n, color: t, sticky: r = !0 }) => /* @__PURE__ */ s(
|
|
37
37
|
"section",
|
|
38
38
|
{
|
|
39
|
-
className: f(
|
|
39
|
+
className: f(o.banner, { [o.sticky]: r }),
|
|
40
40
|
role: "status",
|
|
41
41
|
"aria-live": "polite",
|
|
42
42
|
"data-color": t,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */ s("div", { className:
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ s("div", { className: o.title, children: [
|
|
45
|
+
/* @__PURE__ */ c(h, { className: o.infoIcon, "aria-hidden": !0 }),
|
|
46
|
+
/* @__PURE__ */ c("span", { children: n })
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
!!i && /* @__PURE__ */ c(
|
|
49
49
|
m,
|
|
50
50
|
{
|
|
51
51
|
icon: u,
|
|
52
52
|
variant: "solid",
|
|
53
|
-
onClick:
|
|
54
|
-
className:
|
|
53
|
+
onClick: i,
|
|
54
|
+
className: o.dismiss,
|
|
55
55
|
iconAltText: e
|
|
56
56
|
}
|
|
57
57
|
)
|
|
@@ -15,4 +15,5 @@ declare const meta: {
|
|
|
15
15
|
export default meta;
|
|
16
16
|
type Story = StoryObj<typeof meta>;
|
|
17
17
|
export declare const Default: Story;
|
|
18
|
+
export declare const WithoutCloseButton: () => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export declare const Colors: (args: BannerProps) => import("react/jsx-runtime").JSX.Element;
|