@altinn/altinn-components 0.50.0 → 0.50.2

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,6 +1,6 @@
1
1
  import { jsxs as e, jsx as C } from "react/jsx-runtime";
2
2
  import { useIsDesktop as r } from "../../hooks/useIsDesktop.js";
3
- const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) => {
3
+ const a = ({ className: i, title: L = "Digdir logo", "aria-hidden": o }) => {
4
4
  const l = r() ? 8.5 : 7, { width: t, height: n } = { width: `${l}em`, height: `${l * 0.34}em` };
5
5
  return /* @__PURE__ */ e(
6
6
  "svg",
@@ -11,10 +11,11 @@ const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) =>
11
11
  height: n,
12
12
  viewBox: "0 0 113.779 38.8565",
13
13
  version: "1.1",
14
- className: L,
14
+ className: i,
15
15
  "aria-hidden": o,
16
+ "aria-labelledby": "digdir-logo-title",
16
17
  children: [
17
- /* @__PURE__ */ C("title", { children: i }),
18
+ /* @__PURE__ */ C("title", { id: "digdir-logo-title", children: L }),
18
19
  /* @__PURE__ */ e("g", { id: "surface1", children: [
19
20
  /* @__PURE__ */ C(
20
21
  "path",
@@ -106,5 +107,5 @@ const p = ({ className: L, title: i = "Digdir logomark", "aria-hidden": o }) =>
106
107
  );
107
108
  };
108
109
  export {
109
- p as DigdirLogomark
110
+ a as DigdirLogomark
110
111
  };
@@ -1,5 +1,5 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
- import { c as n } from "../../index-L8X2o7IH.js";
1
+ import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
+ import { c as a } from "../../index-L8X2o7IH.js";
3
3
  import { Badge as g } from "../Badge/Badge.js";
4
4
  import { ButtonBase as l } from "../Button/ButtonBase.js";
5
5
  import "react";
@@ -13,8 +13,8 @@ import '../../assets/HeaderLogo2.css';const f = "_logo_1d6ig_1", d = {
13
13
  en: "Go to homepage"
14
14
  }, C = ({ className: r, as: m = "a", href: s = "/", badge: o }) => {
15
15
  const { languageCode: e } = c(), i = x[e ?? ""] ?? "Gå til forsiden";
16
- return /* @__PURE__ */ a(l, { as: m, className: n(d.logo, r), href: s, ariaLabel: i, children: [
17
- /* @__PURE__ */ t(p, {}),
16
+ return /* @__PURE__ */ n(l, { as: m, className: a(d.logo, r), href: s, children: [
17
+ /* @__PURE__ */ t(p, { title: i }),
18
18
  o && /* @__PURE__ */ t(g, { ...o })
19
19
  ] });
20
20
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as o, jsx as C } from "react/jsx-runtime";
2
- const e = ({ className: r, title: i = "Digdir logomark" }) => /* @__PURE__ */ o(
2
+ const e = ({ className: r, title: i = "Digdir logo" }) => /* @__PURE__ */ o(
3
3
  "svg",
4
4
  {
5
5
  width: "1em",
@@ -1,12 +1,12 @@
1
- import { jsx as U } from "react/jsx-runtime";
2
- import { useMemo as W } from "react";
1
+ import { jsx as W } from "react/jsx-runtime";
2
+ import { useMemo as Y } from "react";
3
3
  import "../index-L8X2o7IH.js";
4
- import { IconButton as Y } from "../components/Button/IconButton.js";
4
+ import { IconButton as q } from "../components/Button/IconButton.js";
5
5
  import "../components/RootProvider/RootProvider.js";
6
- import { useIsDesktop as q } from "./useIsDesktop.js";
6
+ import { useIsDesktop as J } from "./useIsDesktop.js";
7
7
  import "../components/Snackbar/useSnackbar.js";
8
8
  import { formatDisplayName as S } from "../functions/name/name.js";
9
- import { formatDate as J } from "../functions/date/date.js";
9
+ import { formatDate as K } from "../functions/date/date.js";
10
10
  import { S as Q, a as X } from "../HeartFill-CYSrJ_xK.js";
11
11
  const O = (t) => t === "Organization" ? "company" : "person", ro = ({
12
12
  partyListDTO: t = [],
@@ -14,12 +14,12 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
14
14
  currentAccountUuid: f,
15
15
  selfAccountUuid: m,
16
16
  isLoading: d = !1,
17
- onSelectAccount: _,
17
+ onSelectAccount: v,
18
18
  isVirtualized: h = !1,
19
19
  onToggleFavorite: s,
20
20
  languageCode: r
21
21
  }) => {
22
- const i = q(), [c, b, l] = W(() => {
22
+ const i = J(), [c, _, b] = Y(() => {
23
23
  var A, N;
24
24
  if (d || !t || !m)
25
25
  return [[], {}, void 0];
@@ -46,7 +46,7 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
46
46
  s,
47
47
  i
48
48
  )
49
- ), v = [];
49
+ ), l = [];
50
50
  for (const e of j) {
51
51
  const u = g(
52
52
  r,
@@ -57,10 +57,10 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
57
57
  s,
58
58
  i
59
59
  );
60
- if (v.push(u), e.subunits && e.subunits.length > 0) {
61
- const K = [...e.subunits].sort(z);
62
- for (const $ of K) {
63
- const R = g(
60
+ if (l.push(u), e.subunits && e.subunits.length > 0) {
61
+ const R = [...e.subunits].sort(z);
62
+ for (const $ of R) {
63
+ const U = g(
64
64
  r,
65
65
  $,
66
66
  e.partyUuid,
@@ -70,12 +70,12 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
70
70
  i,
71
71
  e
72
72
  );
73
- v.push(R);
73
+ l.push(U);
74
74
  }
75
75
  }
76
76
  }
77
- const M = k.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), V = v.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), w = [...M, ...V], x = [H, ...w, ...k, ...v], G = x.find((e) => (e == null ? void 0 : e.selected) === !0), E = {
78
- [((A = v[0]) == null ? void 0 : A.groupId) || "company"]: {
77
+ const M = k.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), V = l.reduce((e, u) => (n(u.id) && e.push({ ...u, groupId: "favorites" }), e), []), w = [...M, ...V], x = [H, ...w, ...k, ...l], G = x.find((e) => (e == null ? void 0 : e.selected) === !0), E = {
78
+ [((A = l[0]) == null ? void 0 : A.groupId) || "company"]: {
79
79
  title: a.account_orgs,
80
80
  divider: !0
81
81
  },
@@ -99,7 +99,7 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
99
99
  r,
100
100
  i
101
101
  ]);
102
- return d || !t || !l ? {
102
+ return d || !t || !b ? {
103
103
  accountMenu: {
104
104
  items: [],
105
105
  groups: {},
@@ -112,18 +112,18 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
112
112
  } : {
113
113
  accountMenu: {
114
114
  items: c,
115
- groups: b,
115
+ groups: _,
116
116
  isVirtualized: h,
117
- onSelectAccount: _,
118
- currentAccount: l
117
+ onSelectAccount: v,
118
+ currentAccount: b
119
119
  },
120
120
  loading: !1
121
121
  };
122
- }, g = (t, o, f, m, d, _, h, s, r) => {
123
- const i = O((o == null ? void 0 : o.type) ?? ""), c = F(t), b = S({
122
+ }, g = (t, o, f, m, d, v, h, s, r) => {
123
+ const i = O((o == null ? void 0 : o.type) ?? ""), c = F(t), _ = S({
124
124
  fullName: o == null ? void 0 : o.name,
125
125
  type: i
126
- }), l = s ? S({
126
+ }), b = s ? S({
127
127
  fullName: s == null ? void 0 : s.name,
128
128
  type: O((s == null ? void 0 : s.type) ?? ""),
129
129
  reverseNameOrder: !1
@@ -135,10 +135,10 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
135
135
  n = `${c.org_no}: ${o.organizationNumber}`;
136
136
  break;
137
137
  case "person":
138
- n = o != null && o.dateOfBirth ? `${c.birthdate}: ${J(o == null ? void 0 : o.dateOfBirth)}` : "";
138
+ n = o != null && o.dateOfBirth ? `${c.birthdate}: ${K(o == null ? void 0 : o.dateOfBirth)}` : "";
139
139
  break;
140
140
  case "subunit":
141
- n = `↳ ${c.org_no}: ${o == null ? void 0 : o.organizationNumber}, ${c.subunit_of} ${l}`;
141
+ n = `↳ ${c.org_no}: ${o == null ? void 0 : o.organizationNumber}, ${c.subunit_of} ${b}`;
142
142
  break;
143
143
  default:
144
144
  n = "";
@@ -146,28 +146,27 @@ const O = (t) => t === "Organization" ? "company" : "person", ro = ({
146
146
  return {
147
147
  id: o == null ? void 0 : o.partyUuid,
148
148
  icon: {
149
- name: b,
149
+ name: _,
150
150
  type: i,
151
151
  isParent: !s,
152
- isDeleted: o == null ? void 0 : o.isDeleted,
153
- colorKey: l ?? void 0
152
+ isDeleted: o == null ? void 0 : o.isDeleted
154
153
  },
155
- name: b,
154
+ name: _,
156
155
  description: n,
157
156
  groupId: f,
158
157
  type: a,
159
158
  selected: m === (o == null ? void 0 : o.partyUuid),
160
159
  disabled: !!(o != null && o.onlyHierarchyElementWithNoAccess),
161
160
  badge: r ? { label: c.you, color: "person" } : o.isDeleted && h ? { label: c.deleted, color: "neutral" } : void 0,
162
- controls: !r && /* @__PURE__ */ U(
163
- Y,
161
+ controls: !r && /* @__PURE__ */ W(
162
+ q,
164
163
  {
165
164
  rounded: !0,
166
165
  variant: "text",
167
166
  icon: d ? Q : X,
168
167
  iconAltText: d ? c.remove_from_favorites : c.add_to_favorites,
169
168
  onClick: (I) => {
170
- _ && (I.stopPropagation(), _(o == null ? void 0 : o.partyUuid));
169
+ v && (I.stopPropagation(), v(o == null ? void 0 : o.partyUuid));
171
170
  },
172
171
  size: "xs"
173
172
  }
@@ -1,5 +1,5 @@
1
1
  import { ElementType, MouseEventHandler } from 'react';
2
- import { BadgeProps } from '../Badge/Badge.tsx';
2
+ import { BadgeProps } from '../Badge';
3
3
  export interface HeaderLogoProps {
4
4
  className?: string;
5
5
  as?: ElementType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.50.0",
3
+ "version": "0.50.2",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",