@altinn/altinn-components 0.56.22 → 0.56.24

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,63 +1,63 @@
1
1
  "use client";
2
- import { jsxs as f, jsx as e } from "react/jsx-runtime";
3
- import { useState as d, useCallback as G, useEffect as L, useMemo as C } from "react";
2
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
3
+ import { useState as d, useCallback as L, useEffect as C, useMemo as G } from "react";
4
4
  import { M as S } from "../../SearchField-QTfebYdU.js";
5
5
  import "../../index-p1eeF8LQ.js";
6
6
  import "../Button/Button.js";
7
7
  import "react-dom";
8
8
  import "../RootProvider/RootProvider.js";
9
- import { LocaleSwitcher as h } from "./LocaleSwitcher.js";
9
+ import { LocaleSwitcher as v } from "./LocaleSwitcher.js";
10
10
  import "../Snackbar/useSnackbar.js";
11
- import { MenuListItem as v } from "../Menu/MenuListItem.js";
12
- import { GlobalMenuBase as u, GlobalMenuHeader as x, GlobalMenuFooter as I } from "./GlobalMenuBase.js";
11
+ import { MenuListItem as x } from "../Menu/MenuListItem.js";
12
+ import { GlobalMenuBase as u, GlobalMenuFooter as I } from "./GlobalMenuBase.js";
13
13
  import { LogoutButton as T } from "./LogoutButton.js";
14
- import { S as j } from "../../Globe-BcPkcH4E.js";
15
- const P = ({
16
- menu: o,
14
+ import { S as h } from "../../Globe-BcPkcH4E.js";
15
+ const N = ({
16
+ menu: e,
17
17
  backLabel: g = "Back",
18
- onClose: l,
18
+ onClose: s,
19
19
  logoutButton: a,
20
20
  ariaLabel: n = "Menu",
21
21
  localeSwitcher: r,
22
22
  isOpen: m = !1
23
23
  }) => {
24
- const [k, c] = d(!1), s = G(() => {
24
+ const [k, c] = d(!1), l = L(() => {
25
25
  c((t) => !t);
26
26
  }, []);
27
- L(() => {
27
+ C(() => {
28
28
  m || c(!1);
29
29
  }, [m]);
30
- const M = C(() => {
31
- const t = (o?.items ?? []).map((i) => ({
30
+ const M = G(() => {
31
+ const t = (e?.items ?? []).map((i) => ({
32
32
  ...i,
33
33
  onClick: () => {
34
- i.onClick?.(), l?.();
34
+ i.onClick?.(), s?.();
35
35
  },
36
36
  items: Array.isArray(i.items) ? i.items.map((p) => ({
37
37
  ...p,
38
38
  onClick: () => {
39
- p.onClick?.(), l?.();
39
+ p.onClick?.(), s?.();
40
40
  }
41
41
  })) : void 0
42
42
  }));
43
43
  if (!r) return t;
44
44
  const b = {
45
45
  title: "Språk/language",
46
- icon: j,
46
+ icon: h,
47
47
  size: "sm",
48
- onClick: s,
48
+ onClick: l,
49
49
  linkIcon: !0
50
50
  };
51
51
  return [...t, b];
52
- }, [o, l, r, s]);
52
+ }, [e, s, r, l]);
53
53
  return k ? /* @__PURE__ */ f(u, { "aria-label": n, children: [
54
- /* @__PURE__ */ e(x, { children: r && /* @__PURE__ */ e(h, { ...r, backLabel: g, onToggle: s }) }),
55
- /* @__PURE__ */ e(v, { as: "div", role: "separator" })
54
+ r && /* @__PURE__ */ o(v, { ...r, backLabel: g, onToggle: l }),
55
+ /* @__PURE__ */ o(x, { as: "div", role: "separator" })
56
56
  ] }) : /* @__PURE__ */ f(u, { "aria-label": n, children: [
57
- o && /* @__PURE__ */ e(S, { ...o, items: M }),
58
- a && /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(T, { ...a }) })
57
+ e && /* @__PURE__ */ o(S, { ...e, items: M }),
58
+ a && /* @__PURE__ */ o(I, { children: /* @__PURE__ */ o(T, { ...a }) })
59
59
  ] });
60
60
  };
61
61
  export {
62
- P as GlobalMenu
62
+ N as GlobalMenu
63
63
  };
@@ -1,10 +1,9 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import '../../assets/GlobalMenuBase.css';const n = "_nav_b7k4e_1", s = "_footer_b7k4e_6", a = {
3
- nav: n,
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import '../../assets/GlobalMenuBase.css';const r = "_nav_b7k4e_1", s = "_footer_b7k4e_6", t = {
3
+ nav: r,
4
4
  footer: s
5
- }, c = ({ color: e, children: r, ...t }) => /* @__PURE__ */ o("nav", { className: a.nav, "data-color": e, ...t, children: r }), f = ({ children: e }) => /* @__PURE__ */ o("header", { className: a.header, children: e }), u = ({ children: e }) => /* @__PURE__ */ o("footer", { className: a.footer, children: e });
5
+ }, l = ({ color: o, children: a, ...n }) => /* @__PURE__ */ e("nav", { className: t.nav, "data-color": o, ...n, children: a }), f = ({ children: o }) => /* @__PURE__ */ e("footer", { className: t.footer, children: o });
6
6
  export {
7
- c as GlobalMenuBase,
8
- u as GlobalMenuFooter,
9
- f as GlobalMenuHeader
7
+ l as GlobalMenuBase,
8
+ f as GlobalMenuFooter
10
9
  };
@@ -10,9 +10,9 @@ import { formatDisplayName as S } from "../functions/name/name.js";
10
10
  import { formatDate as E } from "../functions/date/date.js";
11
11
  import { formatOrgNo as x } from "../functions/orgno/orgno.js";
12
12
  import { S as R, a as Y } from "../HeartFill-CYSrJ_xK.js";
13
- const D = (e) => e === "Organization" ? "company" : "person", st = ({
14
- partyListDTO: e = [],
15
- favoriteAccountUuids: o,
13
+ const D = (o) => o === "Organization" ? "company" : "person", st = ({
14
+ partyListDTO: o = [],
15
+ favoriteAccountUuids: e,
16
16
  currentAccountUuid: c,
17
17
  selfAccountUuid: v,
18
18
  isLoading: d = !1,
@@ -24,12 +24,12 @@ const D = (e) => e === "Organization" ? "company" : "person", st = ({
24
24
  onShowDeletedUnitsChange: n
25
25
  }) => {
26
26
  const a = W(), [z, m, p] = V(() => {
27
- if (d || !e || !v)
27
+ if (d || !o || !v)
28
28
  return [[], {}, void 0];
29
- const s = (t) => o?.includes(t), _ = (t) => !t.isDeleted || f !== !1 || t.partyUuid === c, N = B(i), F = i || "nb", k = (t, u) => t.name.localeCompare(u.name, F, {
29
+ const s = (t) => e?.includes(t), _ = (t) => !t.isDeleted || f !== !1 || t.partyUuid === c, N = B(i), F = i || "nb", k = (t, u) => t.name.localeCompare(u.name, F, {
30
30
  sensitivity: "base",
31
31
  ignorePunctuation: !0
32
- }), j = [...e].sort(k);
32
+ }), j = [...o].sort(k);
33
33
  let P;
34
34
  const O = [], y = [], g = [];
35
35
  for (const t of j)
@@ -110,9 +110,9 @@ const D = (e) => e === "Organization" ? "company" : "person", st = ({
110
110
  };
111
111
  return [A, M, H];
112
112
  }, [
113
- e,
114
- v,
115
113
  o,
114
+ v,
115
+ e,
116
116
  c,
117
117
  d,
118
118
  r,
@@ -120,7 +120,7 @@ const D = (e) => e === "Organization" ? "company" : "person", st = ({
120
120
  a,
121
121
  f
122
122
  ]);
123
- return d || !e || !p ? {
123
+ return d || !o || !p ? {
124
124
  accountMenu: {
125
125
  items: [],
126
126
  groups: {},
@@ -142,9 +142,9 @@ const D = (e) => e === "Organization" ? "company" : "person", st = ({
142
142
  showDeletedUnits: f,
143
143
  onShowDeletedUnitsChange: n
144
144
  };
145
- }, h = (e, o, c, v, d, b, I, r, i) => {
146
- const f = D(o?.type ?? ""), n = B(e), a = S({
147
- fullName: o?.name,
145
+ }, h = (o, e, c, v, d, b, I, r, i) => {
146
+ const f = D(e?.type ?? ""), n = B(o), a = S({
147
+ fullName: e?.name,
148
148
  type: f
149
149
  }), z = r ? S({
150
150
  fullName: r?.name,
@@ -155,33 +155,33 @@ const D = (e) => e === "Organization" ? "company" : "person", st = ({
155
155
  const p = f === "company" && r ? "subunit" : f;
156
156
  switch (p) {
157
157
  case "company":
158
- m = `${n.org_no}. ${x(o.organizationNumber)}`;
158
+ m = `${n.org_no}. ${x(e.organizationNumber)}`;
159
159
  break;
160
160
  case "person":
161
- m = o?.dateOfBirth ? `${n.birthdate}: ${E(o?.dateOfBirth)}` : "";
161
+ m = e?.dateOfBirth ? `${n.birthdate}: ${E(e?.dateOfBirth)}` : "";
162
162
  break;
163
163
  case "subunit":
164
- m = `↳ ${n.org_no}. ${x(o?.organizationNumber)}, ${n.subunit_of} ${z}`;
164
+ m = `↳ ${n.org_no}. ${x(e?.organizationNumber)}, ${n.subunit_of} ${z}`;
165
165
  break;
166
166
  default:
167
167
  m = "";
168
168
  }
169
169
  return {
170
- id: o?.partyUuid,
170
+ id: e?.partyUuid,
171
171
  icon: {
172
172
  name: a,
173
173
  type: f,
174
174
  isParent: !r,
175
- isDeleted: o?.isDeleted
175
+ isDeleted: e?.isDeleted
176
176
  },
177
177
  name: a,
178
178
  description: m,
179
- searchWords: p === "company" ? [a, o?.organizationNumber ?? ""] : [a, o?.dateOfBirth ?? ""],
179
+ searchWords: p === "person" ? [a, e?.dateOfBirth ?? ""] : [a, e?.organizationNumber ?? ""],
180
180
  groupId: c,
181
181
  type: p,
182
- selected: v === o?.partyUuid,
183
- disabled: !!o?.onlyHierarchyElementWithNoAccess,
184
- badge: i ? { label: n.you, color: "person" } : o.isDeleted && I ? { label: n.deleted, color: "neutral" } : void 0,
182
+ selected: v === e?.partyUuid,
183
+ disabled: !!e?.onlyHierarchyElementWithNoAccess,
184
+ badge: i ? { label: n.you, color: "person" } : e.isDeleted && I ? { label: n.deleted, color: "neutral" } : void 0,
185
185
  controls: !i && /* @__PURE__ */ U(
186
186
  G,
187
187
  {
@@ -189,15 +189,15 @@ const D = (e) => e === "Organization" ? "company" : "person", st = ({
189
189
  variant: "ghost",
190
190
  "aria-label": d ? n.remove_from_favorites : n.add_to_favorites,
191
191
  onClick: (s) => {
192
- b && (s.stopPropagation(), b(o?.partyUuid));
192
+ b && (s.stopPropagation(), b(e?.partyUuid));
193
193
  },
194
194
  size: "xs",
195
195
  children: d ? /* @__PURE__ */ U(R, {}) : /* @__PURE__ */ U(Y, {})
196
196
  }
197
197
  )
198
198
  };
199
- }, q = (e) => e === "Organization", w = (e) => e === "Person" || e === "SelfIdentified", B = (e) => {
200
- switch (e) {
199
+ }, q = (o) => o === "Organization", w = (o) => o === "Person" || o === "SelfIdentified", B = (o) => {
200
+ switch (o) {
201
201
  case "nn":
202
202
  return {
203
203
  account_orgs: "Virksemder",
@@ -4,12 +4,8 @@ export type GlobalMenuBaseProps = {
4
4
  color?: Color;
5
5
  children: ReactNode;
6
6
  } & React.HTMLAttributes<HTMLElement>;
7
- export interface GlobalMenuHeaderProps {
8
- children: ReactNode;
9
- }
10
7
  export interface GlobalMenuFooterProps {
11
8
  children: ReactNode;
12
9
  }
13
10
  export declare const GlobalMenuBase: ({ color, children, ...rest }: GlobalMenuBaseProps) => import("react/jsx-runtime").JSX.Element;
14
- export declare const GlobalMenuHeader: ({ children }: GlobalMenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
11
  export declare const GlobalMenuFooter: ({ children }: GlobalMenuFooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -5,10 +5,13 @@ declare const meta: {
5
5
  parameters: {};
6
6
  args: {
7
7
  open: true;
8
- onClose: () => void;
9
8
  };
10
9
  };
11
10
  export default meta;
12
- export declare const Verified: () => import("react/jsx-runtime").JSX.Element;
13
- export declare const Unverified: () => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ProfileReadOnly: () => import("react/jsx-runtime").JSX.Element;
12
+ export declare const ProfileInput: () => import("react/jsx-runtime").JSX.Element;
13
+ export declare const ProfileSelect: () => import("react/jsx-runtime").JSX.Element;
14
+ export declare const AccountVerified: () => import("react/jsx-runtime").JSX.Element;
15
+ export declare const AccountNewEmail: () => import("react/jsx-runtime").JSX.Element;
16
+ export declare const AccountNewEmailAndSms: () => import("react/jsx-runtime").JSX.Element;
14
17
  export declare const VerificationCodeSent: () => 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.56.22",
3
+ "version": "0.56.24",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",
@@ -32,11 +32,11 @@
32
32
  "devDependencies": {
33
33
  "@biomejs/biome": "1.9.4",
34
34
  "@chromatic-com/storybook": "4.1.3",
35
- "@storybook/addon-a11y": "10.1.11",
36
- "@storybook/addon-docs": "10.1.11",
37
- "@storybook/addon-themes": "10.1.11",
38
- "@storybook/addon-vitest": "^10.1.11",
39
- "@storybook/react-vite": "10.1.11",
35
+ "@storybook/addon-a11y": "10.2.10",
36
+ "@storybook/addon-docs": "10.2.10",
37
+ "@storybook/addon-themes": "10.2.10",
38
+ "@storybook/addon-vitest": "10.2.10",
39
+ "@storybook/react-vite": "10.2.10",
40
40
  "@testing-library/react": "^16.3.0",
41
41
  "@types/node": "^25.0.7",
42
42
  "@types/react": "^19.1.5",
@@ -47,11 +47,11 @@
47
47
  "@vitest/coverage-v8": "^4.0.0",
48
48
  "axe-core": "^4.10.3",
49
49
  "axe-playwright": "^2.1.0",
50
- "glob": "^13.0.0",
50
+ "glob": "^13.0.6",
51
51
  "lint-staged": "^15.5.2",
52
52
  "playwright": "^1.57.0",
53
53
  "rollup-preserve-directives": "^1.1.3",
54
- "storybook": "^10.1.11",
54
+ "storybook": "10.2.10",
55
55
  "storybook-addon-tag-badges": "^3.0.4",
56
56
  "storybook-addon-theme-provider": "^0.2.10",
57
57
  "tsx": "^4.21.0",