@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.
@@ -1 +1 @@
1
- ._header_ffjwj_1{width:100%;display:flex;align-items:center;column-gap:.5rem;min-height:1.5rem}._sidebar_ffjwj_9{flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:.375rem}._content_ffjwj_18{flex-grow:1;display:flex;flex-direction:column}
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 e, jsxs as y } from "react/jsx-runtime";
3
- import { c as C } from "../../index-L8X2o7IH.js";
4
- import { useState as S } from "react";
5
- import { Skeleton as j } from "../Skeleton/Skeleton.js";
6
- import { fromStringToColor as A } from "./color.js";
7
- import '../../assets/Avatar.css';const E = "_avatar_1k073_1", I = "_shape_1k073_20", q = "_label_1k073_27", z = "_image_1k073_37", r = {
8
- avatar: E,
9
- shape: I,
10
- label: q,
11
- image: z
12
- }, D = (a) => typeof a == "object" && a !== null && "name" in a, F = ({
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: t,
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 [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 ? {
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: k,
29
- color: b
26
+ backgroundColor: f,
27
+ color: g
30
28
  } : c;
31
- return /* @__PURE__ */ e(
29
+ return /* @__PURE__ */ s(
32
30
  "div",
33
31
  {
34
- className: C(r.avatar, { [r.outline]: n }, d),
35
- style: x,
36
- "data-variant": f,
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__ */ y(j, { loading: l, className: r.shape, variant: "circle", children: [
41
- /* @__PURE__ */ e("div", { className: r.shape, style: s ? h : {}, children: s && /* @__PURE__ */ e(
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: t,
42
+ src: e,
45
43
  className: r.image,
46
- alt: m || t,
47
- style: u,
44
+ alt: m || e,
48
45
  onError: () => {
49
- _(!0);
46
+ u(!0);
50
47
  }
51
48
  }
52
49
  ) }),
53
- !s && /* @__PURE__ */ e("span", { className: r.label, children: p || N })
50
+ !t && /* @__PURE__ */ s("span", { className: r.label, children: p || k })
54
51
  ] })
55
52
  }
56
53
  );
57
54
  };
58
55
  export {
59
- F as Avatar,
60
- D as isAvatarProps
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 l } from "../Skeleton/Skeleton.js";
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", h = "_avatarGroup_zacbk_11", u = "_label_zacbk_19", t = {
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: h,
13
+ avatarGroup: k,
14
14
  label: u
15
- }, A = ({
16
- loading: n,
17
- color: i = "neutral",
18
- size: e = "xs",
19
- avatar: r,
20
- avatarGroup: o,
21
- datetime: m,
22
- children: c,
23
- as: s,
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(s || "div", { ...p, className: t.byline, "data-color": i, "data-size": e, children: [
26
- (o || r) && /* @__PURE__ */ a(l, { variant: "circle", className: t.avatar, loading: n, children: o ? /* @__PURE__ */ a(v, { ...o, size: e, className: t.avatarGroup }) : r && /* @__PURE__ */ a(
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
- A as Byline
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 e, isIconProps as l } from "../Icon/Icon.js";
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 u } from "../Avatar/AvatarGroup.js";
7
- import { Badge as _ } from "../Badge/Badge.js";
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 d } from "../../XMark-DIqxCTTQ.js";
12
- import '../../assets/ListItemIcon.css';const g = "_wrapper_1q66b_1", N = "_icon_1q66b_8", w = "_avatar_1q66b_16", b = "_avatarGroup_1q66b_20", t = {
13
- wrapper: g,
14
- icon: N,
15
- avatar: w,
16
- avatarGroup: b
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 h(a) {
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: s, badge: p }) => r ? a ? /* @__PURE__ */ o(e, { className: t.wrapper, svgElement: d, loading: !0 }) : /* @__PURE__ */ i("div", { className: t.wrapper, "data-size": m, children: [
22
- c(r) && /* @__PURE__ */ o(
23
- f,
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 f = "_header_ffjwj_1", p = "_sidebar_ffjwj_9", h = "_content_ffjwj_18", r = {
12
- header: f,
13
- sidebar: p,
14
- content: h
15
- }, g = ({ as: t = "li", loading: i, color: o, icon: s, children: n }) => /* @__PURE__ */ m(d, { as: t, className: r.header, color: o, children: [
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
- g as TimelineHeader
20
+ T as TimelineHeader
21
21
  };
@@ -1,27 +1,20 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { isValidElement as n } from "react";
3
- import { Icon as e, isIconProps as p } from "../Icon/Icon.js";
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 g, AvatarGroup as u } from "../Avatar/AvatarGroup.js";
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 c } from "../../XMark-DIqxCTTQ.js";
11
- import '../../assets/TimelineIcon.css';const d = "_icon_13w5g_1", a = {
12
- icon: d
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 h(t) {
15
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null || n(t);
14
+ function v(o) {
15
+ return typeof o == "string" || typeof o == "number" || typeof o == "boolean" || o === null || p(o);
16
16
  }
17
- const _ = ({ loading: t, size: m, color: s, theme: i, icon: r }) => r ? t ? /* @__PURE__ */ o(e, { className: a.icon, svgElement: c, loading: !0 }) : /* @__PURE__ */ o("div", { className: a.icon, "data-color": s, "data-size": m, children: l(r) && /* @__PURE__ */ o(
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
- _ as TimelineIcon
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, innerContainerStyle, avatarImageStyle, }: AvatarProps) => ReactElement;
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, innerContainerStyle, avatarImageStyle, }: AvatarProps) => React.ReactElement;
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;
@@ -43,5 +43,4 @@ export declare const Loading: Story;
43
43
  export declare const Summary: Story;
44
44
  export declare const ExtendedContent: Story;
45
45
  export declare const WithAttachments: Story;
46
- export declare const WithWideLogo: Story;
47
46
  export declare const WithActions: Story;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.35.6",
3
+ "version": "0.35.7",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",