@altinn/altinn-components 0.52.2 → 0.52.3

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,71 +1,42 @@
1
- "use client";
2
- import { jsx as n, jsxs as u } from "react/jsx-runtime";
3
- import { Badge as y } from "../Badge/Badge.js";
1
+ import { jsx as e, jsxs as _ } from "react/jsx-runtime";
2
+ import { Badge as h } from "../Badge/Badge.js";
4
3
  import "../../index-L8X2o7IH.js";
5
- import m, { forwardRef as v } from "react";
4
+ import "react";
6
5
  import "../RootProvider/RootProvider.js";
7
6
  import "../Snackbar/useSnackbar.js";
8
- import { ListItemLabel as g } from "../List/ListItemLabel.js";
9
- import { ListItem as h } from "../List/ListItem.js";
10
- import { u as _ } from "../../useId-BVFxCjkq.js";
11
- import '../../assets/UserListItem.css';var w = function(e, r) {
12
- var l = {};
13
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && r.indexOf(t) < 0 && (l[t] = e[t]);
14
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
15
- for (var a = 0, t = Object.getOwnPropertySymbols(e); a < t.length; a++)
16
- r.indexOf(t[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[a]) && (l[t[a]] = e[t[a]]);
17
- return l;
18
- };
19
- const O = v((e, r) => {
20
- var { title: l, titleId: t } = e, a = w(e, ["title", "titleId"]);
21
- let i = _();
22
- return i = l ? t || "title-" + i : void 0, m.createElement(
23
- "svg",
24
- 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: r, "aria-labelledby": i }, a),
25
- l ? m.createElement("title", { id: i }, l) : null,
26
- m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.625 2.35a.75.75 0 0 1 .75 0l7.794 4.5a.75.75 0 0 1 .375.65v9a.75.75 0 0 1-.375.65l-7.779 4.49a.75.75 0 0 1-.39.11h-.006a.76.76 0 0 1-.373-.103L3.83 17.15a.75.75 0 0 1-.375-.65V7.494a.75.75 0 0 1 .382-.648zm-.375 17.351-6.294-3.634V8.799l3.486 2.013a3.751 3.751 0 0 0 2.808 4.863zM15.75 12a3.75 3.75 0 0 1-3 3.675v4.026l6.294-3.634V8.799l-3.486 2.013c.124.373.192.773.192 1.188m-1.79-1.105a2.25 2.25 0 1 1-3.919-.003l.01-.017.01-.016a2.249 2.249 0 0 1 3.9.036m.847-1.382L18.294 7.5 12 3.866 5.706 7.5l3.487 2.013A3.74 3.74 0 0 1 12 8.25a3.74 3.74 0 0 1 2.807 1.263", clipRule: "evenodd" })
27
- );
28
- }), I = "_badges_1csip_1", j = "_label_1csip_11", f = {
29
- badges: I,
30
- label: j
31
- }, B = ({
32
- name: e,
33
- type: r,
34
- description: l,
35
- roleNames: t,
36
- titleAs: a = "h3",
37
- subUnit: i = !1,
38
- loading: c = !1,
7
+ import { ListItemLabel as p } from "../List/ListItemLabel.js";
8
+ import { ListItem as L } from "../List/ListItem.js";
9
+ import '../../assets/UserListItem.css';const g = "_badges_1csip_1", z = "_label_1csip_11", r = {
10
+ badges: g,
11
+ label: z
12
+ }, P = ({
13
+ name: t,
14
+ type: l,
15
+ description: c,
16
+ roleNames: o,
17
+ titleAs: m = "h3",
18
+ subUnit: b = !1,
19
+ loading: i = !1,
39
20
  ...s
40
21
  }) => {
41
- let o;
42
- switch (r) {
43
- case "person":
44
- o = { name: e, type: "person" };
45
- break;
46
- case "company":
47
- o = { name: e, type: "company", isParent: !i };
48
- break;
49
- case "system":
50
- o = O;
51
- break;
52
- default:
53
- o = { name: e, type: "person" };
54
- }
55
- const b = !c && t ? /* @__PURE__ */ n("div", { className: f.badges, children: t.map((d) => /* @__PURE__ */ n(y, { label: d, color: s.color, children: d }, d)) }) : void 0, p = /* @__PURE__ */ u("div", { className: f.label, "data-size": s.size, children: [
56
- /* @__PURE__ */ n(
57
- g,
22
+ const d = {
23
+ name: t,
24
+ type: l,
25
+ isParent: l === "company" && !b
26
+ }, n = !i && o ? /* @__PURE__ */ e("div", { className: r.badges, children: o.map((a) => /* @__PURE__ */ e(h, { label: a, color: s.color, children: a }, a)) }) : void 0, f = /* @__PURE__ */ _("div", { className: r.label, "data-size": s.size, children: [
27
+ /* @__PURE__ */ e(
28
+ p,
58
29
  {
59
- title: { children: e, as: a },
60
- description: l,
30
+ title: { children: t, as: m },
31
+ description: c,
61
32
  size: s.size,
62
- loading: c
33
+ loading: i
63
34
  }
64
35
  ),
65
- b
36
+ n
66
37
  ] });
67
- return /* @__PURE__ */ n(h, { icon: o, ariaLabel: e, label: p, description: l, loading: c, ...s });
38
+ return /* @__PURE__ */ e(L, { icon: d, ariaLabel: t, label: f, description: c, loading: i, ...s });
68
39
  };
69
40
  export {
70
- B as UserListItem
41
+ P as UserListItem
71
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.52.2",
3
+ "version": "0.52.3",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",