@altinn/altinn-components 0.35.5 → 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,10 +1,10 @@
1
1
  "use client";
2
- import { jsxs as g, jsx as e } from "react/jsx-runtime";
3
- import { useState as f, createElement as u } from "react";
2
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
3
+ import { useState as f, createElement as m } from "react";
4
4
  import "../../index-L8X2o7IH.js";
5
- import { Button as h } from "../Button/Button.js";
5
+ import { Button as u } from "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { Timeline as m } from "../Timeline/Timeline.js";
7
+ import { Timeline as h } from "../Timeline/Timeline.js";
8
8
  import "../Searchbar/AutocompleteBase.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
10
  import { Section as y } from "../Page/Section.js";
@@ -17,12 +17,12 @@ const b = ({
17
17
  }) => {
18
18
  if (!(o != null && o.length))
19
19
  return null;
20
- const [n, p] = f(!1), c = () => {
21
- p((r) => !r);
22
- }, d = t ? o.slice(0, t) : o, s = n ? o : d, a = t && o.length > t;
23
- return /* @__PURE__ */ g(y, { spacing: 4, children: [
24
- /* @__PURE__ */ e(m, { children: s.map((r) => /* @__PURE__ */ u(v, { ...r, key: r.id })) }),
25
- a && /* @__PURE__ */ e(h, { variant: "outline", onClick: c, children: n ? l : i })
20
+ const [r, c] = f(!1), p = () => {
21
+ c((n) => !n);
22
+ }, d = t ? o.slice(0, t) : o, g = r ? o : d, s = t && o.length > t;
23
+ return /* @__PURE__ */ a(y, { spacing: 4, children: [
24
+ /* @__PURE__ */ e(h, { children: g.map((n) => /* @__PURE__ */ m(v, { ...n, key: "activitylog-segment-" + n.id })) }),
25
+ s && /* @__PURE__ */ e(u, { variant: "outline", onClick: p, children: r ? l : i })
26
26
  ] });
27
27
  };
28
28
  export {
@@ -7,10 +7,10 @@ import { Typography as l } from "../Typography/Typography.js";
7
7
  import "../Searchbar/AutocompleteBase.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
9
  import { ActivityLogItem as y } from "./ActivityLogItem.js";
10
- const T = ({ id: i, items: r, datetime: p, byline: m, children: e, summary: o }) => /* @__PURE__ */ n(f, { datetime: p, byline: m, spacing: 2, id: i, children: [
11
- o && /* @__PURE__ */ c(l, { children: o }),
10
+ const T = ({ id: i, items: o, datetime: m, byline: p, children: e, summary: r }) => /* @__PURE__ */ n(f, { datetime: m, byline: p, spacing: 2, id: i, children: [
11
+ r && /* @__PURE__ */ c(l, { children: r }),
12
12
  e,
13
- r == null ? void 0 : r.map((t) => /* @__PURE__ */ g(y, { ...t, key: t.id }))
13
+ o == null ? void 0 : o.map((t) => /* @__PURE__ */ g(y, { ...t, key: "activity-log-item" + t.id }))
14
14
  ] });
15
15
  export {
16
16
  T as ActivityLogSegment
@@ -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,14 +1,14 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { createElement as t } from "react";
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { createElement as r } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import { useMenu as y } from "../../hooks/useMenu.js";
5
5
  import "../RootProvider/RootProvider.js";
6
- import { DialogListGroup as u } from "./DialogListGroup.js";
7
- import { DialogListItem as d } from "./DialogListItem.js";
6
+ import { DialogListGroup as d } from "./DialogListGroup.js";
7
+ import { DialogListItem as g } from "./DialogListItem.js";
8
8
  import "../Searchbar/AutocompleteBase.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
- import { Section as g } from "../Page/Section.js";
11
- const v = ({ items: i, groups: m = {}, sortGroupBy: e, isLoading: p }) => {
10
+ import { Section as u } from "../Page/Section.js";
11
+ const v = ({ items: i, groups: m = {}, sortGroupBy: e, isLoading: s }) => {
12
12
  const { menu: o } = y({
13
13
  items: i,
14
14
  groups: m,
@@ -16,11 +16,11 @@ const v = ({ items: i, groups: m = {}, sortGroupBy: e, isLoading: p }) => {
16
16
  keyboardEvents: !1,
17
17
  sortGroupBy: e
18
18
  });
19
- return /* @__PURE__ */ l(g, { spacing: 3, margin: "section", "aria-busy": p, children: o == null ? void 0 : o.map((r, s) => {
20
- const n = r.props || {};
21
- return /* @__PURE__ */ t(u, { ...n, key: s }, r == null ? void 0 : r.items.map((a, c) => {
22
- const f = a.props || {};
23
- return /* @__PURE__ */ t(d, { ...f, key: c });
19
+ return /* @__PURE__ */ f(u, { spacing: 3, margin: "section", "aria-busy": s, children: o == null ? void 0 : o.map((t, p) => {
20
+ const a = t.props || {};
21
+ return /* @__PURE__ */ r(d, { ...a, key: "dialog-list-item" + p }, t == null ? void 0 : t.items.map((n, l) => {
22
+ const c = n.props || {};
23
+ return /* @__PURE__ */ r(g, { ...c, key: "dialog-list-item" + l });
24
24
  }));
25
25
  }) });
26
26
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.35.5",
3
+ "version": "0.35.7",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",