@altinn/altinn-components 0.35.6 → 0.35.7
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/dist/assets/TimelineHeader.css +1 -1
- package/dist/components/Avatar/Avatar.js +28 -31
- package/dist/components/Byline/Byline.js +16 -25
- package/dist/components/List/ListItemIcon.js +13 -21
- package/dist/components/Timeline/TimelineHeader.js +6 -6
- package/dist/components/Timeline/TimelineIcon.js +11 -18
- package/dist/types/lib/components/Avatar/Avatar.d.ts +1 -5
- package/dist/types/lib/components/Avatar/Avatar.stories.d.ts +1 -1
- package/dist/types/lib/components/Dialog/DialogBody.stories.d.ts +0 -1
- package/dist/types/lib/components/Dialog/SeenByLogItem.stories.d.ts +0 -2
- package/dist/types/lib/components/Transmission/Transmission.stories.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._header_177gq_1{width:100%;display:flex;align-items:center;column-gap:.5rem;min-height:1.5rem}._sidebar_177gq_9{flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:.375rem;width:2.25rem}._content_177gq_19{flex-grow:1;display:flex;flex-direction:column}
|
|
@@ -1,61 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { fromStringToColor as
|
|
7
|
-
import '../../assets/Avatar.css';const
|
|
8
|
-
avatar:
|
|
9
|
-
shape:
|
|
10
|
-
label:
|
|
11
|
-
image:
|
|
12
|
-
},
|
|
2
|
+
import { jsx as s, jsxs as N } from "react/jsx-runtime";
|
|
3
|
+
import { c as x } from "../../index-L8X2o7IH.js";
|
|
4
|
+
import { useState as C } from "react";
|
|
5
|
+
import { Skeleton as S } from "../Skeleton/Skeleton.js";
|
|
6
|
+
import { fromStringToColor as j } from "./color.js";
|
|
7
|
+
import '../../assets/Avatar.css';const A = "_avatar_1k073_1", E = "_shape_1k073_20", I = "_label_1k073_27", y = "_image_1k073_37", r = {
|
|
8
|
+
avatar: A,
|
|
9
|
+
shape: E,
|
|
10
|
+
label: I,
|
|
11
|
+
image: y
|
|
12
|
+
}, w = (a) => typeof a == "object" && a !== null && "name" in a, B = ({
|
|
13
13
|
type: a = "person",
|
|
14
14
|
size: i,
|
|
15
15
|
name: o = "Avatar",
|
|
16
16
|
outline: n = !1,
|
|
17
|
-
imageUrl:
|
|
17
|
+
imageUrl: e,
|
|
18
18
|
imageUrlAlt: m,
|
|
19
19
|
customLabel: p,
|
|
20
20
|
loading: l,
|
|
21
21
|
className: d,
|
|
22
|
-
style: c = {}
|
|
23
|
-
innerContainerStyle: h = {},
|
|
24
|
-
avatarImageStyle: u = {}
|
|
22
|
+
style: c = {}
|
|
25
23
|
}) => {
|
|
26
|
-
const [
|
|
24
|
+
const [h, u] = C(!1), v = a === "person" ? "circle" : "square", _ = a === "person" ? "light" : "dark", { backgroundColor: f, foregroundColor: g } = j(o, _), k = (o[0] ?? "").toUpperCase(), t = e && !h, b = !l && !t ? {
|
|
27
25
|
...c,
|
|
28
|
-
backgroundColor:
|
|
29
|
-
color:
|
|
26
|
+
backgroundColor: f,
|
|
27
|
+
color: g
|
|
30
28
|
} : c;
|
|
31
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ s(
|
|
32
30
|
"div",
|
|
33
31
|
{
|
|
34
|
-
className:
|
|
35
|
-
style:
|
|
36
|
-
"data-variant":
|
|
32
|
+
className: x(r.avatar, { [r.outline]: n }, d),
|
|
33
|
+
style: b,
|
|
34
|
+
"data-variant": v,
|
|
37
35
|
"data-size": i,
|
|
38
36
|
"data-outline": n,
|
|
39
37
|
"aria-hidden": !0,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ N(S, { loading: l, className: r.shape, variant: "circle", children: [
|
|
39
|
+
/* @__PURE__ */ s("div", { className: r.shape, children: t && /* @__PURE__ */ s(
|
|
42
40
|
"img",
|
|
43
41
|
{
|
|
44
|
-
src:
|
|
42
|
+
src: e,
|
|
45
43
|
className: r.image,
|
|
46
|
-
alt: m ||
|
|
47
|
-
style: u,
|
|
44
|
+
alt: m || e,
|
|
48
45
|
onError: () => {
|
|
49
|
-
|
|
46
|
+
u(!0);
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
) }),
|
|
53
|
-
!
|
|
50
|
+
!t && /* @__PURE__ */ s("span", { className: r.label, children: p || k })
|
|
54
51
|
] })
|
|
55
52
|
}
|
|
56
53
|
);
|
|
57
54
|
};
|
|
58
55
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
B as Avatar,
|
|
57
|
+
w as isAvatarProps
|
|
61
58
|
};
|
|
@@ -4,37 +4,28 @@ import "react";
|
|
|
4
4
|
import { Avatar as _ } from "../Avatar/Avatar.js";
|
|
5
5
|
import { AvatarGroup as v } from "../Avatar/AvatarGroup.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
|
-
import { Skeleton as
|
|
7
|
+
import { Skeleton as c } from "../Skeleton/Skeleton.js";
|
|
8
8
|
import "../Searchbar/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import '../../assets/Byline.css';const d = "_byline_zacbk_1", y = "_avatar_zacbk_7",
|
|
10
|
+
import '../../assets/Byline.css';const d = "_byline_zacbk_1", y = "_avatar_zacbk_7", k = "_avatarGroup_zacbk_11", u = "_label_zacbk_19", t = {
|
|
11
11
|
byline: d,
|
|
12
12
|
avatar: y,
|
|
13
|
-
avatarGroup:
|
|
13
|
+
avatarGroup: k,
|
|
14
14
|
label: u
|
|
15
|
-
},
|
|
16
|
-
loading:
|
|
17
|
-
color:
|
|
18
|
-
size:
|
|
19
|
-
avatar:
|
|
20
|
-
avatarGroup:
|
|
21
|
-
datetime:
|
|
22
|
-
children:
|
|
23
|
-
as:
|
|
15
|
+
}, S = ({
|
|
16
|
+
loading: l,
|
|
17
|
+
color: m = "neutral",
|
|
18
|
+
size: r = "xs",
|
|
19
|
+
avatar: o,
|
|
20
|
+
avatarGroup: e,
|
|
21
|
+
datetime: n,
|
|
22
|
+
children: s,
|
|
23
|
+
as: i,
|
|
24
24
|
...p
|
|
25
|
-
}) => /* @__PURE__ */ b(
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
...r,
|
|
30
|
-
size: e,
|
|
31
|
-
className: t.avatar,
|
|
32
|
-
innerContainerStyle: { width: "fit-content" },
|
|
33
|
-
avatarImageStyle: { height: "1em", width: "auto" }
|
|
34
|
-
}
|
|
35
|
-
) }),
|
|
36
|
-
/* @__PURE__ */ a("time", { "data-size": e, dateTime: m, className: t.label, children: /* @__PURE__ */ a(l, { loading: n, children: c }) })
|
|
25
|
+
}) => /* @__PURE__ */ b(i || "div", { ...p, className: t.byline, "data-color": m, "data-size": r, children: [
|
|
26
|
+
(e || o) && /* @__PURE__ */ a(c, { variant: "circle", className: t.avatar, loading: l, children: e ? /* @__PURE__ */ a(v, { ...e, size: r, className: t.avatarGroup }) : o && /* @__PURE__ */ a(_, { ...o, size: r, className: t.avatar }) }),
|
|
27
|
+
/* @__PURE__ */ a("time", { "data-size": r, dateTime: n, className: t.label, children: /* @__PURE__ */ a(c, { loading: l, children: s }) })
|
|
37
28
|
] });
|
|
38
29
|
export {
|
|
39
|
-
|
|
30
|
+
S as Byline
|
|
40
31
|
};
|
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { isValidElement as n } from "react";
|
|
3
|
-
import { Icon as
|
|
3
|
+
import { Icon as s, isIconProps as l } from "../Icon/Icon.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { isAvatarProps as c, Avatar as f } from "../Avatar/Avatar.js";
|
|
6
|
-
import { isAvatarGroupProps as v, AvatarGroup as
|
|
7
|
-
import { Badge as
|
|
6
|
+
import { isAvatarGroupProps as v, AvatarGroup as _ } from "../Avatar/AvatarGroup.js";
|
|
7
|
+
import { Badge as u } from "../Badge/Badge.js";
|
|
8
8
|
import "../RootProvider/RootProvider.js";
|
|
9
9
|
import "../Searchbar/AutocompleteBase.js";
|
|
10
10
|
import "../Snackbar/useSnackbar.js";
|
|
11
|
-
import { S as
|
|
12
|
-
import '../../assets/ListItemIcon.css';const
|
|
13
|
-
wrapper:
|
|
14
|
-
icon:
|
|
15
|
-
avatar:
|
|
16
|
-
avatarGroup:
|
|
11
|
+
import { S as N } from "../../XMark-DIqxCTTQ.js";
|
|
12
|
+
import '../../assets/ListItemIcon.css';const d = "_wrapper_1q66b_1", b = "_icon_1q66b_8", g = "_avatar_1q66b_16", G = "_avatarGroup_1q66b_20", t = {
|
|
13
|
+
wrapper: d,
|
|
14
|
+
icon: b,
|
|
15
|
+
avatar: g,
|
|
16
|
+
avatarGroup: G
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function w(a) {
|
|
19
19
|
return typeof a == "string" || typeof a == "number" || typeof a == "boolean" || a === null || n(a);
|
|
20
20
|
}
|
|
21
|
-
const z = ({ loading: a, size: m, icon: r, theme:
|
|
22
|
-
c(r) && /* @__PURE__ */ o(
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
...r,
|
|
26
|
-
className: t.avatar,
|
|
27
|
-
innerContainerStyle: { width: "fit-content" },
|
|
28
|
-
avatarImageStyle: { height: "1em", width: "auto" }
|
|
29
|
-
}
|
|
30
|
-
) || v(r) && /* @__PURE__ */ o(u, { ...r, className: t.avatarGroup }) || l(r) && /* @__PURE__ */ o(e, { ...r, theme: r.theme || s, className: t.icon }) || h(r) && r || /* @__PURE__ */ o(e, { theme: s, svgElement: r, className: t.icon }),
|
|
31
|
-
p && /* @__PURE__ */ o(_, { ...p, className: t.badge })
|
|
21
|
+
const z = ({ loading: a, size: m, icon: r, theme: e, badge: p }) => r ? a ? /* @__PURE__ */ o(s, { className: t.wrapper, svgElement: N, loading: !0 }) : /* @__PURE__ */ i("div", { className: t.wrapper, "data-size": m, children: [
|
|
22
|
+
c(r) && /* @__PURE__ */ o(f, { ...r, className: t.avatar }) || v(r) && /* @__PURE__ */ o(_, { ...r, className: t.avatarGroup }) || l(r) && /* @__PURE__ */ o(s, { ...r, theme: r.theme || e, className: t.icon }) || w(r) && r || /* @__PURE__ */ o(s, { theme: e, svgElement: r, className: t.icon }),
|
|
23
|
+
p && /* @__PURE__ */ o(u, { ...p, className: t.badge })
|
|
32
24
|
] }) : null;
|
|
33
25
|
export {
|
|
34
26
|
z as ListItemIcon
|
|
@@ -8,14 +8,14 @@ import { TimelineIcon as l } from "./TimelineIcon.js";
|
|
|
8
8
|
import "../Searchbar/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
10
|
import { Flex as d } from "../Page/Flex.js";
|
|
11
|
-
import '../../assets/TimelineHeader.css';const
|
|
12
|
-
header:
|
|
13
|
-
sidebar:
|
|
14
|
-
content:
|
|
15
|
-
},
|
|
11
|
+
import '../../assets/TimelineHeader.css';const p = "_header_177gq_1", h = "_sidebar_177gq_9", _ = "_content_177gq_19", r = {
|
|
12
|
+
header: p,
|
|
13
|
+
sidebar: h,
|
|
14
|
+
content: _
|
|
15
|
+
}, T = ({ as: t = "li", loading: i, color: o, icon: s, children: n }) => /* @__PURE__ */ m(d, { as: t, className: r.header, color: o, children: [
|
|
16
16
|
/* @__PURE__ */ e("aside", { className: r.sidebar, children: /* @__PURE__ */ e(c, { variant: "circle", loading: i, children: /* @__PURE__ */ e(l, { icon: s, theme: "base", size: "lg" }) }) }),
|
|
17
17
|
/* @__PURE__ */ e("div", { className: r.content, children: /* @__PURE__ */ e(a, { loading: i, size: "lg", children: n }) })
|
|
18
18
|
] });
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
T as TimelineHeader
|
|
21
21
|
};
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { isValidElement as
|
|
3
|
-
import { Icon as
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { isValidElement as p } from "react";
|
|
3
|
+
import { Icon as s, isIconProps as n } from "../Icon/Icon.js";
|
|
4
4
|
import "../../index-L8X2o7IH.js";
|
|
5
5
|
import { isAvatarProps as l, Avatar as f } from "../Avatar/Avatar.js";
|
|
6
|
-
import { isAvatarGroupProps as
|
|
6
|
+
import { isAvatarGroupProps as c, AvatarGroup as u } from "../Avatar/AvatarGroup.js";
|
|
7
7
|
import "../RootProvider/RootProvider.js";
|
|
8
8
|
import "../Searchbar/AutocompleteBase.js";
|
|
9
9
|
import "../Snackbar/useSnackbar.js";
|
|
10
|
-
import { S as
|
|
11
|
-
import '../../assets/TimelineIcon.css';const
|
|
12
|
-
icon:
|
|
10
|
+
import { S as d } from "../../XMark-DIqxCTTQ.js";
|
|
11
|
+
import '../../assets/TimelineIcon.css';const g = "_icon_13w5g_1", a = {
|
|
12
|
+
icon: g
|
|
13
13
|
};
|
|
14
|
-
function
|
|
15
|
-
return typeof
|
|
14
|
+
function v(o) {
|
|
15
|
+
return typeof o == "string" || typeof o == "number" || typeof o == "boolean" || o === null || p(o);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
f,
|
|
19
|
-
{
|
|
20
|
-
...r,
|
|
21
|
-
innerContainerStyle: { width: "unset", height: "1em" },
|
|
22
|
-
avatarImageStyle: { height: "1.75rem", width: "auto", marginTop: "0.25rem" }
|
|
23
|
-
}
|
|
24
|
-
) || g(r) && /* @__PURE__ */ o(u, { ...r, className: a.avatarGroup }) || p(r) && /* @__PURE__ */ o(e, { ...r, theme: i }) || h(r) && r || /* @__PURE__ */ o(e, { theme: i, svgElement: r }) }) : null;
|
|
17
|
+
const S = ({ loading: o, size: i, color: e, theme: m, icon: r }) => r ? o ? /* @__PURE__ */ t(s, { className: a.icon, svgElement: d, loading: !0 }) : /* @__PURE__ */ t("div", { className: a.icon, "data-color": e, "data-size": i, children: l(r) && /* @__PURE__ */ t(f, { ...r }) || c(r) && /* @__PURE__ */ t(u, { ...r, className: a.avatarGroup }) || n(r) && /* @__PURE__ */ t(s, { ...r, theme: m }) || v(r) && r || /* @__PURE__ */ t(s, { theme: m, svgElement: r }) }) : null;
|
|
25
18
|
export {
|
|
26
|
-
|
|
19
|
+
S as TimelineIcon
|
|
27
20
|
};
|
|
@@ -25,13 +25,9 @@ export interface AvatarProps {
|
|
|
25
25
|
style?: CSSProperties;
|
|
26
26
|
/** Whether the avatar is loading. */
|
|
27
27
|
loading?: boolean;
|
|
28
|
-
/** Avatar image container styles */
|
|
29
|
-
innerContainerStyle?: CSSProperties;
|
|
30
|
-
/** Avatar image inner styles */
|
|
31
|
-
avatarImageStyle?: CSSProperties;
|
|
32
28
|
}
|
|
33
29
|
export declare const isAvatarProps: (icon: unknown) => icon is AvatarProps;
|
|
34
30
|
/**
|
|
35
31
|
* Avatar component to display user or company avatars with various customization options.
|
|
36
32
|
*/
|
|
37
|
-
export declare const Avatar: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, loading, className, style,
|
|
33
|
+
export declare const Avatar: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, loading, className, style, }: AvatarProps) => ReactElement;
|
|
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { AvatarProps } from '..';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, loading, className, style,
|
|
5
|
+
component: ({ type, size, name, outline, imageUrl, imageUrlAlt, customLabel, loading, className, style, }: AvatarProps) => React.ReactElement;
|
|
6
6
|
tags: string[];
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: string;
|
|
@@ -28,8 +28,6 @@ declare const meta: {
|
|
|
28
28
|
customLabel?: string | undefined;
|
|
29
29
|
style?: React.CSSProperties | undefined;
|
|
30
30
|
loading?: boolean | undefined;
|
|
31
|
-
innerContainerStyle?: React.CSSProperties | undefined;
|
|
32
|
-
avatarImageStyle?: React.CSSProperties | undefined;
|
|
33
31
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
34
32
|
};
|
|
35
33
|
export default meta;
|
|
@@ -51,4 +51,3 @@ declare const meta: {
|
|
|
51
51
|
export default meta;
|
|
52
52
|
export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
|
53
53
|
export declare const UsingBadges: () => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export declare const WithWideLogo: () => import("react/jsx-runtime").JSX.Element;
|