@altinn/altinn-components 0.41.2 → 0.41.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.
Files changed (31) hide show
  1. package/dist/assets/AccountOrganization.css +1 -0
  2. package/dist/components/Account/AccountListItem.js +29 -28
  3. package/dist/components/Account/AccountListItemDetails.js +33 -0
  4. package/dist/components/Account/AccountOrganization.js +27 -0
  5. package/dist/components/Account/index.js +8 -4
  6. package/dist/components/Settings/AddressSettingsModal.js +69 -0
  7. package/dist/components/Settings/SettingsList.js +1 -1
  8. package/dist/components/Settings/UsedByLog.js +35 -0
  9. package/dist/components/Settings/UsedByLogItem.js +32 -0
  10. package/dist/components/Settings/index.js +12 -8
  11. package/dist/components/index.js +452 -444
  12. package/dist/index.js +462 -454
  13. package/dist/types/lib/components/Account/AccountList.stories.d.ts +3 -5
  14. package/dist/types/lib/components/Account/AccountListItem.d.ts +1 -1
  15. package/dist/types/lib/components/Account/AccountListItem.stories.d.ts +1 -1
  16. package/dist/types/lib/components/Account/AccountListItemDetails.d.ts +10 -0
  17. package/dist/types/lib/components/Account/AccountListItemDetails.stories.d.ts +19 -0
  18. package/dist/types/lib/components/Account/AccountOrganization.d.ts +16 -0
  19. package/dist/types/lib/components/Account/AccountOrganization.stories.d.ts +32 -0
  20. package/dist/types/lib/components/Account/index.d.ts +3 -0
  21. package/dist/types/lib/components/Modal/Modal.stories.d.ts +1 -0
  22. package/dist/types/lib/components/Settings/AddressSettingsModal.d.ts +5 -0
  23. package/dist/types/lib/components/Settings/SettingsItem.stories.d.ts +2 -4
  24. package/dist/types/lib/components/Settings/SettingsModal.stories.d.ts +51 -0
  25. package/dist/types/lib/components/Settings/UsedByLog.d.ts +13 -0
  26. package/dist/types/lib/components/Settings/UsedByLogItem.d.ts +13 -0
  27. package/dist/types/lib/components/Settings/index.d.ts +2 -0
  28. package/package.json +1 -1
  29. package/dist/types/lib/components/Settings/Settings.stories.d.ts +0 -13
  30. package/dist/types/lib/stories/Settings/Settings.stories.d.ts +0 -39
  31. /package/dist/types/lib/{stories → components}/Dashboard/Dashboard.stories.d.ts +0 -0
@@ -0,0 +1 @@
1
+ ._list_hvcdj_1{display:flex;flex-direction:column;row-gap:.25rem;list-style:none;padding:.25rem 0;margin:0;border-left:2px solid;border-color:var(--ds-color-border-subtle);margin-left:1rem}._list_hvcdj_1[data-level="1"]{border-left:none;margin-left:0}._node_hvcdj_19{display:flex;align-items:center}._node_hvcdj_19:before{content:"";display:flex;width:100%;height:2px;width:1.5rem;background-color:var(--ds-color-border-subtle)}._node_hvcdj_19[data-level="1"]:before{display:none}._link_hvcdj_37{padding:.375rem .5rem;width:100%;display:flex;align-items:center;text-decoration:none}._link_hvcdj_37:not([data-selected=true]):hover{background-color:var(--ds-color-background-tinted)}._link_hvcdj_37[data-selected=true]{background-color:var(--ds-color-surface-tinted)}
@@ -2,58 +2,59 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
4
  import "../RootProvider/RootProvider.js";
5
- import { ListItem as C } from "../List/ListItem.js";
5
+ import { ListItem as M } from "../List/ListItem.js";
6
6
  import "../Snackbar/useSnackbar.js";
7
- import { AccountListItemControls as M } from "./AccountListItemControls.js";
8
- const B = ({
7
+ import { AccountListItemControls as b } from "./AccountListItemControls.js";
8
+ const D = ({
9
9
  id: i,
10
10
  type: m,
11
11
  size: c,
12
12
  expanded: t,
13
13
  icon: s,
14
- title: e,
15
- description: n,
16
- isCurrentEndUser: p,
17
- isDeleted: u,
18
- badge: f,
14
+ name: e,
15
+ title: n,
16
+ description: p,
17
+ isCurrentEndUser: u,
18
+ isDeleted: f,
19
+ badge: l,
19
20
  favourite: I = !1,
20
- favouriteLabel: l,
21
- onToggleFavourite: L,
22
- contextMenu: v,
23
- children: A,
24
- interactive: j,
21
+ favouriteLabel: L,
22
+ onToggleFavourite: v,
23
+ contextMenu: A,
24
+ children: j,
25
+ interactive: k,
25
26
  loading: o,
26
- ...k
27
+ ...C
27
28
  }) => /* @__PURE__ */ r(
28
- C,
29
+ M,
29
30
  {
30
- ...k,
31
+ ...C,
31
32
  loading: o,
32
33
  size: c,
33
34
  icon: s,
34
- title: e,
35
- description: t ? void 0 : n,
35
+ title: n || e,
36
+ description: t ? void 0 : p,
36
37
  expanded: t,
37
38
  selected: t,
38
39
  controls: !o && /* @__PURE__ */ r(
39
- M,
40
+ b,
40
41
  {
41
42
  id: i,
42
43
  type: m,
43
44
  favourite: I,
44
- favouriteLabel: l,
45
- badge: f,
46
- isCurrentEndUser: p,
47
- isDeleted: u,
48
- onToggleFavourite: L,
49
- contextMenu: t ? void 0 : v
45
+ favouriteLabel: L,
46
+ badge: l,
47
+ isCurrentEndUser: u,
48
+ isDeleted: f,
49
+ onToggleFavourite: v,
50
+ contextMenu: t ? void 0 : A
50
51
  }
51
52
  ),
52
53
  linkIcon: !o && !0,
53
- interactive: j,
54
- children: A
54
+ interactive: k,
55
+ children: j
55
56
  }
56
57
  );
57
58
  export {
58
- B as AccountListItem
59
+ D as AccountListItem
59
60
  };
@@ -0,0 +1,33 @@
1
+ import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
+ import { createElement as g, Fragment as h } from "react";
3
+ import "../../index-L8X2o7IH.js";
4
+ import { AccountOrganization as v } from "./AccountOrganization.js";
5
+ import { Button as p } from "../Button/Button.js";
6
+ import { ButtonGroup as L } from "../Button/ButtonGroup.js";
7
+ import "../RootProvider/RootProvider.js";
8
+ import { Divider as j } from "../Divider/Divider.js";
9
+ import { List as x } from "../List/List.js";
10
+ import "../Snackbar/useSnackbar.js";
11
+ import { Section as a } from "../Page/Section.js";
12
+ import { SettingsItem as z } from "../Settings/SettingsItem.js";
13
+ const P = ({
14
+ color: c,
15
+ loading: s,
16
+ loadingText: l = "Loading...",
17
+ buttons: o,
18
+ settings: m,
19
+ organization: n
20
+ }) => s ? /* @__PURE__ */ r(a, { padding: 6, spacing: 4, children: /* @__PURE__ */ r(p, { variant: "outline", loading: !0, children: l }) }) : /* @__PURE__ */ e(a, { padding: 6, spacing: 4, color: c, children: [
21
+ o && /* @__PURE__ */ r(L, { size: "sm", children: o.map((i, t) => {
22
+ const { label: d, variant: u, ...f } = i;
23
+ return /* @__PURE__ */ g(p, { ...f, variant: u || "outline", key: t }, d);
24
+ }) }),
25
+ m && /* @__PURE__ */ r(x, { size: "sm", children: m.map((i, t) => /* @__PURE__ */ e(h, { children: [
26
+ t > 0 && /* @__PURE__ */ r(j, { as: "li" }),
27
+ /* @__PURE__ */ r(z, { ...i })
28
+ ] }, t)) }),
29
+ n && /* @__PURE__ */ r(v, { items: n })
30
+ ] });
31
+ export {
32
+ P as AccountListItemDetails
33
+ };
@@ -0,0 +1,27 @@
1
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import { Byline as d } from "../Byline/Byline.js";
5
+ import "../RootProvider/RootProvider.js";
6
+ import "../Snackbar/useSnackbar.js";
7
+ import '../../assets/AccountOrganization.css';const m = "_list_hvcdj_1", p = "_node_hvcdj_19", h = "_link_hvcdj_37", i = {
8
+ list: m,
9
+ node: p,
10
+ link: h
11
+ }, a = ({
12
+ avatar: t,
13
+ title: l,
14
+ as: o,
15
+ description: s,
16
+ selected: c,
17
+ ...e
18
+ }) => /* @__PURE__ */ n(c ? "span" : o || "a", { ...e, className: i.link, "data-selected": c, children: /* @__PURE__ */ r(d, { size: "sm", avatar: t, children: [
19
+ /* @__PURE__ */ n("strong", { children: l }),
20
+ s && `, ${s}`
21
+ ] }) }), u = ({ items: t, level: l }) => /* @__PURE__ */ n("ul", { "data-level": l, className: i.list, children: t.map((o, s) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n("span", { className: i.node, "data-level": l, children: /* @__PURE__ */ n(a, { ...o }) }) }, s)) }), x = ({ items: t, level: l = 1 }) => /* @__PURE__ */ n("ul", { "data-level": l, className: i.list, children: t == null ? void 0 : t.map((o, s) => /* @__PURE__ */ r("li", { children: [
22
+ /* @__PURE__ */ n(a, { ...o }),
23
+ o.items && /* @__PURE__ */ n(u, { items: o.items, level: l + 1 })
24
+ ] }, s)) });
25
+ export {
26
+ x as AccountOrganization
27
+ };
@@ -1,10 +1,14 @@
1
1
  import { AccountMenu as c } from "./AccountMenu.js";
2
2
  import { AccountListItem as e } from "./AccountListItem.js";
3
- import { AccountList as i } from "./AccountList.js";
4
- import { AccountNotificationSettings as m } from "./AccountNotificationSettings.js";
3
+ import { AccountListItemDetails as i } from "./AccountListItemDetails.js";
4
+ import { AccountList as f } from "./AccountList.js";
5
+ import { AccountNotificationSettings as p } from "./AccountNotificationSettings.js";
6
+ import { AccountOrganization as A } from "./AccountOrganization.js";
5
7
  export {
6
- i as AccountList,
8
+ f as AccountList,
7
9
  e as AccountListItem,
10
+ i as AccountListItemDetails,
8
11
  c as AccountMenu,
9
- m as AccountNotificationSettings
12
+ p as AccountNotificationSettings,
13
+ A as AccountOrganization
10
14
  };
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
3
+ import "../../index-L8X2o7IH.js";
4
+ import i, { forwardRef as f } from "react";
5
+ import { Typography as c } from "../Typography/Typography.js";
6
+ import { Button as m } from "../Button/Button.js";
7
+ import { ButtonGroup as p } from "../Button/ButtonGroup.js";
8
+ import "../RootProvider/RootProvider.js";
9
+ import "../Snackbar/useSnackbar.js";
10
+ import { TextareaField as u } from "../Forms/TextareaField.js";
11
+ import { SettingsModal as v } from "./SettingsModal.js";
12
+ import { u as s } from "../../useId-BVFxCjkq.js";
13
+ var h = function(t, n) {
14
+ var l = {};
15
+ for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (l[e] = t[e]);
16
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
17
+ for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
18
+ n.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (l[e[r]] = t[e[r]]);
19
+ return l;
20
+ };
21
+ const g = f((t, n) => {
22
+ var { title: l, titleId: e } = t, r = h(t, ["title", "titleId"]);
23
+ let o = s();
24
+ return o = l ? e || "title-" + o : void 0, i.createElement(
25
+ "svg",
26
+ 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": o }, r),
27
+ l ? i.createElement("title", { id: o }, l) : null,
28
+ i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M20.532 3.471A.75.75 0 0 1 20.75 4v7.5a.75.75 0 0 1-1.5 0V5.81l-8.72 8.72a.75.75 0 1 1-1.06-1.06l8.72-8.72H12.5a.75.75 0 0 1 0-1.5H20c.206 0 .393.083.529.218l.001.002zM4.75 9A.25.25 0 0 1 5 8.75h7a.75.75 0 0 0 0-1.5H5A1.75 1.75 0 0 0 3.25 9v10c0 .966.784 1.75 1.75 1.75h10A1.75 1.75 0 0 0 16.75 19v-7a.75.75 0 0 0-1.5 0v7a.25.25 0 0 1-.25.25H5a.25.25 0 0 1-.25-.25z", clipRule: "evenodd" })
29
+ );
30
+ });
31
+ var b = function(t, n) {
32
+ var l = {};
33
+ for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (l[e] = t[e]);
34
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
35
+ for (var r = 0, e = Object.getOwnPropertySymbols(t); r < e.length; r++)
36
+ n.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[r]) && (l[e[r]] = t[e[r]]);
37
+ return l;
38
+ };
39
+ const y = f((t, n) => {
40
+ var { title: l, titleId: e } = t, r = b(t, ["title", "titleId"]);
41
+ let o = s();
42
+ return o = l ? e || "title-" + o : void 0, i.createElement(
43
+ "svg",
44
+ 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": o }, r),
45
+ l ? i.createElement("title", { id: o }, l) : null,
46
+ i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12.53 2.47a.75.75 0 0 0-1.06 0l-7 7a.75.75 0 0 0-.22.53v11c0 .414.336.75.75.75h14a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.22-.53zM5.75 20.25v-9.94L12 4.06l6.25 6.25v9.94zm4.28-7.22c.26-.26.68-.26.94 0l.5.5a.75.75 0 0 0 1.06 0l.5-.5a.664.664 0 1 1 .94.94L12 15.94l-1.97-1.97a.664.664 0 0 1 0-.94M12 11.94a2.164 2.164 0 0 0-3.03 3.09l2.5 2.5a.75.75 0 0 0 1.06 0l2.5-2.5A2.164 2.164 0 0 0 12 11.94", clipRule: "evenodd" })
47
+ );
48
+ }), H = ({
49
+ title: t = "Endre adresse",
50
+ icon: n = y,
51
+ valueField: l = {
52
+ label: "Adresse",
53
+ value: "Idrettsveien 1, 5025 Bergen",
54
+ readOnly: !0
55
+ },
56
+ open: e,
57
+ onClose: r
58
+ }) => /* @__PURE__ */ d(v, { icon: n, title: t, open: e, onClose: r, children: [
59
+ /* @__PURE__ */ a(u, { ...l, size: "sm", readOnly: !0 }),
60
+ /* @__PURE__ */ a(c, { size: "sm", children: /* @__PURE__ */ d("p", { children: [
61
+ "Altinn bruker adressen din fra ",
62
+ /* @__PURE__ */ a("a", { href: "https://skatteetaten.no/", children: "Folkeregisteret" }),
63
+ "."
64
+ ] }) }),
65
+ /* @__PURE__ */ a(p, { size: "md", children: /* @__PURE__ */ a(m, { variant: "outline", icon: g, reverse: !0, children: "Endre adresse" }) })
66
+ ] });
67
+ export {
68
+ H as AddressSettingsModal
69
+ };
@@ -25,7 +25,7 @@ const q = ({ items: n, groups: p = {}, sortGroupBy: c }) => {
25
25
  /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(S, { size: "sm", children: i == null ? void 0 : i.items.map((a, m) => {
26
26
  const d = a.props || {};
27
27
  return /* @__PURE__ */ o(s, { children: [
28
- m > 0 && /* @__PURE__ */ t(y, {}),
28
+ m > 0 && /* @__PURE__ */ t(y, { as: "li" }),
29
29
  /* @__PURE__ */ f(k, { ...d, key: "settings-list-item" + m })
30
30
  ] }, m);
31
31
  }) }) })
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx as o, jsxs as e } from "react/jsx-runtime";
3
+ import { useState as B, createElement as L, Fragment as S } from "react";
4
+ import "../../index-L8X2o7IH.js";
5
+ import "../RootProvider/RootProvider.js";
6
+ import { SeenByLogButton as i } from "../Dialog/SeenByLogButton.js";
7
+ import { Divider as u } from "../Divider/Divider.js";
8
+ import { List as a } from "../List/List.js";
9
+ import "../Snackbar/useSnackbar.js";
10
+ import { Flex as j } from "../Page/Flex.js";
11
+ import { Section as f } from "../Page/Section.js";
12
+ import { UsedByLogItem as h } from "./UsedByLogItem.js";
13
+ const w = ({
14
+ collapsible: d = !0,
15
+ expanded: l,
16
+ title: c,
17
+ items: r,
18
+ size: p = "sm",
19
+ endUserLabel: t
20
+ }) => {
21
+ const [g, m] = B(l || !d && !0), x = () => {
22
+ m((n) => !n);
23
+ };
24
+ return (r == null ? void 0 : r.length) === 1 ? /* @__PURE__ */ o(f, { spacing: 1, children: /* @__PURE__ */ o(a, { size: p, spacing: 1, children: r == null ? void 0 : r.map((n) => /* @__PURE__ */ L(h, { ...n, key: n.id, size: p, endUserLabel: t })) }) }) : /* @__PURE__ */ e(f, { spacing: 1, children: [
25
+ c && /* @__PURE__ */ o(j, { children: d ? /* @__PURE__ */ o(i, { icon: { items: r }, as: "button", onClick: x, children: c }) : /* @__PURE__ */ o(i, { icon: { items: r }, as: "div", children: c }) }),
26
+ c && g && /* @__PURE__ */ o(u, {}),
27
+ g && /* @__PURE__ */ o(a, { size: p, spacing: 1, children: r == null ? void 0 : r.map((n, y) => /* @__PURE__ */ e(S, { children: [
28
+ y > 0 && /* @__PURE__ */ o(u, {}),
29
+ /* @__PURE__ */ o(h, { ...n, size: p, endUserLabel: t })
30
+ ] }, n.id)) })
31
+ ] });
32
+ };
33
+ export {
34
+ w as UsedByLog
35
+ };
@@ -0,0 +1,32 @@
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
+ import "../../index-L8X2o7IH.js";
3
+ import "react";
4
+ import { Badge as s } from "../Badge/Badge.js";
5
+ import { Byline as p } from "../Byline/Byline.js";
6
+ import "../RootProvider/RootProvider.js";
7
+ import "../Snackbar/useSnackbar.js";
8
+ import { Flex as c } from "../Page/Flex.js";
9
+ const u = ({
10
+ type: e,
11
+ name: t,
12
+ description: o,
13
+ isEndUser: m,
14
+ endUserLabel: a,
15
+ size: l = "sm"
16
+ }) => {
17
+ const i = m && { label: a };
18
+ return /* @__PURE__ */ r(c, { align: "center", spacing: 2, as: "li", children: [
19
+ /* @__PURE__ */ r(p, { size: l, avatar: { name: t, type: e }, children: [
20
+ /* @__PURE__ */ r("strong", { children: [
21
+ t,
22
+ o && NaN
23
+ ] }),
24
+ " ",
25
+ o
26
+ ] }),
27
+ i && /* @__PURE__ */ n(s, { variant: "subtle", ...i })
28
+ ] });
29
+ };
30
+ export {
31
+ u as UsedByLogItem
32
+ };
@@ -1,10 +1,14 @@
1
- import { SettingsSection as o } from "./SettingsSection.js";
2
- import { SettingsItem as i } from "./SettingsItem.js";
3
- import { SettingsList as n } from "./SettingsList.js";
4
- import { SettingsModal as S } from "./SettingsModal.js";
1
+ import { SettingsSection as e } from "./SettingsSection.js";
2
+ import { SettingsItem as m } from "./SettingsItem.js";
3
+ import { SettingsList as f } from "./SettingsList.js";
4
+ import { SettingsModal as i } from "./SettingsModal.js";
5
+ import { UsedByLog as x } from "./UsedByLog.js";
6
+ import { UsedByLogItem as S } from "./UsedByLogItem.js";
5
7
  export {
6
- i as SettingsItem,
7
- n as SettingsList,
8
- S as SettingsModal,
9
- o as SettingsSection
8
+ m as SettingsItem,
9
+ f as SettingsList,
10
+ i as SettingsModal,
11
+ e as SettingsSection,
12
+ x as UsedByLog,
13
+ S as UsedByLogItem
10
14
  };