@altinn/altinn-components 0.51.5 → 0.52.1

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
- ._avatar_1en7r_1{position:relative;overflow:hidden;box-sizing:border-box}._avatar_1en7r_1[data-shape=circle]{border-radius:50%}._avatar_1en7r_1[data-shape=square]{border-radius:5%}._avatar_1en7r_1{outline:1px solid #ffffff;box-sizing:border-box}._shape_1en7r_20{display:block;font-size:1em;width:1em;height:1em}._shape_1en7r_20[data-variant=outline]{border:1px solid}._label_1en7r_31{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;overflow:hidden;font-size:.575em}._image_1en7r_41{display:block;width:100%;height:100%}._deletedIcon_1en7r_47{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}@supports (-webkit-hyphens: none){._avatar_1en7r_1[data-size=lg] ._label_1en7r_31{font-size:1.58rem}._avatar_1en7r_1[data-size=md] ._label_1en7r_31{font-size:1.15rem}._avatar_1en7r_1[data-size=sm] ._label_1en7r_31{font-size:.85rem}}
1
+ ._avatar_bmli3_1{position:relative;overflow:hidden;box-sizing:border-box}._avatar_bmli3_1[data-shape=circle]{border-radius:50%}._avatar_bmli3_1[data-shape=square]{border-radius:5%}._avatar_bmli3_1{outline:1px solid #ffffff;box-sizing:border-box}._shape_bmli3_20{display:block;font-size:1em;width:1em;height:1em}._shape_bmli3_20[data-variant=outline]{border:1px solid}._label_bmli3_31{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;overflow:hidden;font-size:.575em}._icon_bmli3_41{width:100%;height:100%;display:flex;justify-content:center;align-items:center}._svg_bmli3_49{width:75%;height:75%}._image_bmli3_54{display:block;width:100%;height:100%}._deletedIcon_bmli3_60{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}@supports (-webkit-hyphens: none){._avatar_bmli3_1[data-size=lg] ._label_bmli3_31{font-size:1.58rem}._avatar_bmli3_1[data-size=md] ._label_bmli3_31{font-size:1.15rem}._avatar_bmli3_1[data-size=sm] ._label_bmli3_31{font-size:.85rem}}
@@ -1,62 +1,85 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as j } from "react/jsx-runtime";
3
- import { c as y } from "../../index-L8X2o7IH.js";
4
- import { useState as A } from "react";
5
- import { Skeleton as E } from "../Skeleton/Skeleton.js";
6
- import { fromStringToColor as q } from "./color.js";
7
- import '../../assets/Avatar.css';const z = "_avatar_1en7r_1", B = "_shape_1en7r_20", H = "_label_1en7r_31", L = "_image_1en7r_41", M = "_deletedIcon_1en7r_47", r = {
8
- avatar: z,
9
- shape: B,
10
- label: H,
11
- image: L,
12
- deletedIcon: M
13
- }, J = (e) => typeof e == "object" && e !== null && "name" in e, K = ({
2
+ import { jsx as n, jsxs as v } from "react/jsx-runtime";
3
+ import { c as E } from "../../index-L8X2o7IH.js";
4
+ import m, { forwardRef as k, useState as A } from "react";
5
+ import { Skeleton as R } from "../Skeleton/Skeleton.js";
6
+ import { fromStringToColor as M } from "./color.js";
7
+ import { u as P } from "../../useId-BVFxCjkq.js";
8
+ import '../../assets/Avatar.css';var B = function(e, o) {
9
+ var l = {};
10
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (l[t] = e[t]);
11
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
12
+ for (var a = 0, t = Object.getOwnPropertySymbols(e); a < t.length; a++)
13
+ o.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[a]) && (l[t[a]] = e[t[a]]);
14
+ return l;
15
+ };
16
+ const L = k((e, o) => {
17
+ var { title: l, titleId: t } = e, a = B(e, ["title", "titleId"]);
18
+ let s = P();
19
+ return s = l ? t || "title-" + s : void 0, m.createElement(
20
+ "svg",
21
+ 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: o, "aria-labelledby": s }, a),
22
+ l ? m.createElement("title", { id: s }, l) : null,
23
+ m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M8.25 7a3.75 3.75 0 0 0 2.43 3.51l-3.692 4.923a2.75 2.75 0 1 0 1.2.9l3.062-4.083v3.104a2.751 2.751 0 1 0 1.5 0V12.25l3.063 4.083a2.75 2.75 0 1 0 1.2-.9L13.32 10.51A3.751 3.751 0 0 0 12 3.25 3.75 3.75 0 0 0 8.25 7M12 4.75a2.25 2.25 0 0 0-.008 4.5h.015A2.25 2.25 0 0 0 12 4.75m0 12a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5m-6 0a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5m12 0a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5", clipRule: "evenodd" })
24
+ );
25
+ }), T = "_avatar_bmli3_1", V = "_shape_bmli3_20", q = "_label_bmli3_31", z = "_icon_bmli3_41", H = "_svg_bmli3_49", D = "_image_bmli3_54", F = "_deletedIcon_bmli3_60", r = {
26
+ avatar: T,
27
+ shape: V,
28
+ label: q,
29
+ icon: z,
30
+ svg: H,
31
+ image: D,
32
+ deletedIcon: F
33
+ }, X = (e) => typeof e == "object" && e !== null && "name" in e, Y = ({
14
34
  type: e = "person",
15
- isParent: n,
16
- isDeleted: m = !1,
17
- size: h,
18
- name: l = "Avatar",
19
- shape: u,
20
- color: g,
21
- variant: _,
22
- imageUrl: t,
23
- imageUrlAlt: f,
24
- customLabel: v,
25
- loading: c,
26
- className: b,
27
- colorKey: C,
28
- style: i = {}
35
+ isParent: o,
36
+ isDeleted: l = !1,
37
+ size: t,
38
+ name: a = "Avatar",
39
+ shape: s,
40
+ color: b,
41
+ variant: g,
42
+ imageUrl: d,
43
+ imageUrlAlt: _,
44
+ customLabel: w,
45
+ loading: p,
46
+ className: y,
47
+ colorKey: I,
48
+ style: f = {}
29
49
  }) => {
30
- const [I, w] = A(!1), x = u || e === "person" ? "circle" : "square", N = g || e === "person" ? "light" : "dark";
31
- let o = _;
32
- e === "company" && typeof n == "boolean" && (o = n ? "solid" : "outline");
33
- const { backgroundColor: p, foregroundColor: d } = q(C ?? l, N), k = (l[0] ?? "").toUpperCase(), s = t && !I, S = !c && !s ? {
34
- ...i,
35
- backgroundColor: o === "outline" ? d : p,
36
- color: o === "outline" ? p : d
37
- } : i;
38
- return /* @__PURE__ */ a(
50
+ const [x, O] = A(!1), j = s || e === "person" ? "circle" : "square", C = b || e === "person" ? "light" : "dark";
51
+ let i = g;
52
+ e === "company" && typeof o == "boolean" && (i = o ? "solid" : "outline");
53
+ const { backgroundColor: u, foregroundColor: h } = M(I ?? a, C), N = (a[0] ?? "").toUpperCase(), c = d && !x, S = !p && !c ? {
54
+ ...f,
55
+ backgroundColor: i === "outline" ? h : u,
56
+ color: i === "outline" ? u : h
57
+ } : f;
58
+ return /* @__PURE__ */ n(
39
59
  "div",
40
60
  {
41
- className: y(r.avatar, b),
61
+ className: E(r.avatar, y),
42
62
  style: S,
43
- "data-shape": x,
44
- "data-size": h,
63
+ "data-shape": j,
64
+ "data-size": t,
45
65
  "aria-hidden": !0,
46
- children: /* @__PURE__ */ j(E, { loading: c, className: r.shape, variant: "circle", children: [
47
- /* @__PURE__ */ a("div", { className: r.shape, "data-variant": o, children: s && /* @__PURE__ */ a(
48
- "img",
49
- {
50
- src: t,
51
- className: r.image,
52
- alt: f || t,
53
- onError: () => {
54
- w(!0);
66
+ children: /* @__PURE__ */ v(R, { loading: p, className: r.shape, variant: "circle", children: [
67
+ /* @__PURE__ */ v("div", { className: r.shape, "data-variant": i, children: [
68
+ e !== "system" && c && /* @__PURE__ */ n(
69
+ "img",
70
+ {
71
+ src: d,
72
+ className: r.image,
73
+ alt: _ || d,
74
+ onError: () => {
75
+ O(!0);
76
+ }
55
77
  }
56
- }
57
- ) }),
58
- !s && /* @__PURE__ */ a("span", { className: r.label, children: v || k }),
59
- m && /* @__PURE__ */ a(
78
+ ),
79
+ e === "system" && !c && /* @__PURE__ */ n("span", { className: r.icon, children: /* @__PURE__ */ n(L, { className: r.svg }) })
80
+ ] }),
81
+ !c && e !== "system" && /* @__PURE__ */ n("span", { className: r.label, children: w || N }),
82
+ l && /* @__PURE__ */ n(
60
83
  "svg",
61
84
  {
62
85
  "aria-hidden": "true",
@@ -66,7 +89,7 @@ import '../../assets/Avatar.css';const z = "_avatar_1en7r_1", B = "_shape_1en7r_
66
89
  viewBox: "0 0 24 24",
67
90
  fill: "none",
68
91
  xmlns: "http://www.w3.org/2000/svg",
69
- children: /* @__PURE__ */ a("path", { d: "M0 24L24 -1.20156e-06", stroke: "currentColor" })
92
+ children: /* @__PURE__ */ n("path", { d: "M0 24L24 -1.20156e-06", stroke: "currentColor" })
70
93
  }
71
94
  )
72
95
  ] })
@@ -74,6 +97,6 @@ import '../../assets/Avatar.css';const z = "_avatar_1en7r_1", B = "_shape_1en7r_
74
97
  );
75
98
  };
76
99
  export {
77
- K as Avatar,
78
- J as isAvatarProps
100
+ Y as Avatar,
101
+ X as isAvatarProps
79
102
  };
@@ -1,29 +1,30 @@
1
1
  import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- import { Badge as s } from "../Badge/Badge.js";
2
+ import { Badge as l } from "../Badge/Badge.js";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "react";
5
- import { Byline as l } from "../Byline/Byline.js";
5
+ import { Byline as c } from "../Byline/Byline.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
- import { Flex as c } from "../Page/Flex.js";
9
- const j = ({
8
+ import { Flex as d } from "../Page/Flex.js";
9
+ const v = ({
10
10
  name: r,
11
11
  seenAt: i,
12
12
  seenAtLabel: m,
13
13
  isEndUser: n,
14
- endUserLabel: p,
15
- size: a = "sm"
14
+ endUserLabel: a,
15
+ size: p = "sm",
16
+ type: s = "person"
16
17
  }) => {
17
- const t = n && { label: p };
18
- return /* @__PURE__ */ e(c, { align: "center", spacing: 2, as: "li", children: [
19
- /* @__PURE__ */ e(l, { size: a, datetime: i, avatar: { name: r, type: "person" }, children: [
18
+ const t = n && { label: a };
19
+ return /* @__PURE__ */ e(d, { align: "center", spacing: 2, as: "li", children: [
20
+ /* @__PURE__ */ e(c, { size: p, datetime: i, avatar: { name: r, type: s }, children: [
20
21
  /* @__PURE__ */ o("strong", { children: r + "," }),
21
22
  " ",
22
23
  m
23
24
  ] }),
24
- t && /* @__PURE__ */ o(s, { variant: "subtle", ...t })
25
+ t && /* @__PURE__ */ o(l, { variant: "subtle", ...t })
25
26
  ] });
26
27
  };
27
28
  export {
28
- j as SeenByLogItem
29
+ v as SeenByLogItem
29
30
  };
@@ -22,7 +22,7 @@ const h = d((e, n) => {
22
22
  "svg",
23
23
  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: n, "aria-labelledby": i }, l),
24
24
  r ? c.createElement("title", { id: i }, r) : null,
25
- c.createElement("path", { fill: "currentColor", d: "M14.087 6.873a.75.75 0 0 1 .943.097l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H5a.75.75 0 0 1-.75-.74V12a.75.75 0 0 1 .75-.75h12.19l-3.22-3.22a.75.75 0 0 1 .117-1.157" })
25
+ c.createElement("path", { fill: "currentColor", d: "M14.088 6.873a.75.75 0 0 1 .942.097l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H5a.75.75 0 0 1-.75-.74V12a.75.75 0 0 1 .75-.75h12.19l-3.22-3.22a.75.75 0 0 1 .118-1.157" })
26
26
  );
27
27
  }), _ = "_list_tknjf_1", b = "_item_tknjf_12", g = "_icon_tknjf_18", a = {
28
28
  list: _,
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
- export type AvatarType = 'company' | 'person' | 'custom';
2
+ export type AvatarType = 'company' | 'person' | 'system' | 'custom';
3
3
  export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
4
  export type AvatarShape = 'square' | 'circle';
5
5
  export type AvatarColor = 'dark' | 'light';
@@ -44,5 +44,6 @@ export declare const Logo: Story;
44
44
  export declare const Loading: Story;
45
45
  export declare const Sizes: ({ type, name, imageUrl }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
46
46
  export declare const People: () => import("react/jsx-runtime").JSX.Element;
47
+ export declare const SystemUsers: () => import("react/jsx-runtime").JSX.Element;
47
48
  export declare const Companies: () => import("react/jsx-runtime").JSX.Element;
48
49
  export declare const Logos: () => import("react/jsx-runtime").JSX.Element;
@@ -15,6 +15,13 @@ declare const meta: {
15
15
  seenAt: string;
16
16
  seenAtLabel: string;
17
17
  isEndUser?: undefined;
18
+ } | {
19
+ id: string;
20
+ type: "system";
21
+ name: string;
22
+ seenAt: string;
23
+ seenAtLabel: string;
24
+ isEndUser?: undefined;
18
25
  } | {
19
26
  id: string;
20
27
  type: "person";
@@ -7,8 +7,9 @@ export interface SeenByLogItemProps extends AvatarProps {
7
7
  endUserLabel?: string;
8
8
  badge?: BadgeProps;
9
9
  size?: 'sm' | 'md';
10
+ type?: AvatarProps['type'];
10
11
  }
11
12
  /**
12
13
  * SeenByLog item
13
14
  */
14
- export declare const SeenByLogItem: ({ name, seenAt, seenAtLabel, isEndUser, endUserLabel, size, }: SeenByLogItemProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const SeenByLogItem: ({ name, seenAt, seenAtLabel, isEndUser, endUserLabel, size, type, }: SeenByLogItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ name, seenAt, seenAtLabel, isEndUser, endUserLabel, size, }: import('./SeenByLogItem').SeenByLogItemProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: ({ name, seenAt, seenAtLabel, isEndUser, endUserLabel, size, type, }: import('./SeenByLogItem').SeenByLogItemProps) => import("react/jsx-runtime").JSX.Element;
5
5
  tags: string[];
6
6
  parameters: {};
7
7
  args: {
@@ -19,8 +19,8 @@ declare const meta: {
19
19
  endUserLabel?: string | undefined;
20
20
  badge?: import('..').BadgeProps | undefined;
21
21
  size?: "sm" | "md" | undefined;
22
- name: string;
23
22
  type?: import('..').AvatarType | undefined;
23
+ name: string;
24
24
  isParent?: boolean | undefined;
25
25
  isDeleted?: boolean | undefined;
26
26
  shape?: import('..').AvatarColor | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.51.5",
3
+ "version": "0.52.1",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",
@@ -23,7 +23,7 @@
23
23
  "@digdir/designsystemet-css": "^1.0.6",
24
24
  "@digdir/designsystemet-react": "^1.0.6",
25
25
  "@digdir/designsystemet-theme": "^1.0.6",
26
- "@navikt/aksel-icons": "^7.30.1",
26
+ "@navikt/aksel-icons": "^7.37.0",
27
27
  "@tanstack/react-virtual": "^3.13.9",
28
28
  "classnames": "^2.5.1",
29
29
  "react": "^19.1.0",