@altinn/altinn-components 0.61.2 → 0.61.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 +1 @@
1
- ._link_eet0n_1{position:static;padding:0;border:0;margin:0;background-color:transparent;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;text-align:left;appearance:none;-webkit-user-select:none;user-select:none}._link_eet0n_1[aria-disabled=true]{pointer-events:none}._link_eet0n_1[data-interactive=true]{cursor:pointer}._link_eet0n_1:focus-visible{outline:none}._linkFocus_eet0n_26{position:absolute;inset:0}._link_eet0n_1:focus-visible ._linkFocus_eet0n_26{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline));outline-offset:var(--_ds--focus, var(--ds-border-width-focus))}._link_eet0n_1:focus-visible ._linkFocus_eet0n_26 *{--_ds--focus: }
1
+ ._link_1pvv7_1{position:static;padding:0;border:0;margin:0;background-color:transparent;-webkit-font-smoothing:inherit;-moz-osx-font-smoothing:inherit;text-align:left;appearance:none;-webkit-user-select:none;user-select:none}._link_1pvv7_1[aria-disabled=true]{pointer-events:none}._link_1pvv7_1[data-interactive=true]{cursor:pointer}._link_1pvv7_1[data-disabled=true]{opacity:.5}._link_1pvv7_1:focus-visible{outline:none}._linkFocus_1pvv7_30{position:absolute;inset:0}._link_1pvv7_1:focus-visible ._linkFocus_1pvv7_30{box-shadow:var(--_ds--focus, var(--dsc-focus-boxShadow));outline:var(--_ds--focus, var(--dsc-focus-outline));outline-offset:var(--_ds--focus, var(--ds-border-width-focus))}._link_1pvv7_1:focus-visible ._linkFocus_1pvv7_30 *{--_ds--focus: }
@@ -1 +1 @@
1
- ._base_1m3p1_1{position:relative;display:flex;flex-direction:column;min-height:100vh;background-color:var(--altinn-layout-background)}._base_1m3p1_1[data-theme=default]{--altinn-layout-background: var(--ds-color-background-default)}._base_1m3p1_1[data-theme=subtle]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_1m3p1_1[data-theme=neutral]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}._base_1m3p1_1[data-theme=inbox]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_1m3p1_1[data-theme=inbox][data-color=person]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}
1
+ ._base_k5ay7_1{position:relative;display:flex;flex-direction:column;min-height:100vh;background-color:var(--altinn-layout-background)}._base_k5ay7_1[data-theme=default]{--altinn-layout-background: var(--ds-color-background-default)}._base_k5ay7_1[data-theme=subtle]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_k5ay7_1[data-theme=neutral]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}._base_k5ay7_1[data-theme=inbox]{--altinn-layout-background: var(--ds-color-background-tinted)}._base_k5ay7_1[data-theme=inbox][data-color=person],._base_k5ay7_1[data-theme=settings]{--altinn-layout-background: var(--ds-color-neutral-background-tinted)}
@@ -1 +1 @@
1
- ._item_1xpqe_1{position:relative;display:flex;align-items:center;gap:.5rem;padding:.25rem .5rem;margin:0 -.5rem;--dsc-item-background--hover: var(--ds-color-surface-tinted)}._item_1xpqe_1:has(a):hover,._item_1xpqe_1:has(button):hover{background-color:var(--dsc-item-background--hover)}._item_1xpqe_1+[aria-hidden]{margin-block:0}._item_1xpqe_1+._item_1xpqe_1{margin-top:.5em}._media_1xpqe_24{pointer-events:none;position:relative;flex-shrink:0;font-size:2em;display:flex;align-items:center;justify-content:center}._media_1xpqe_24 svg{font-size:1.5rem}._link_1xpqe_38{font-size:1rem;flex-grow:1;display:flex;align-items:center;gap:.5rem;text-decoration:none;color:inherit}._linkIcon_1xpqe_48{font-size:1.5rem;width:1em;height:1em}._label_1xpqe_54{flex-grow:1;min-height:2.5rem;display:flex;flex-direction:column;justify-content:center}._label_1xpqe_54 mark{background-color:transparent;text-decoration:underline}._controls_1xpqe_67{flex-grow:0}
1
+ ._listItem_1p24v_1{padding-top:.375rem;padding-bottom:.375rem}._listItem_1p24v_1+._listItem_1p24v_1{border-top:1px solid var(--ds-color-border-subtle)}._listItem_1p24v_1[data-collapsible=true][data-expanded=true]{margin:0 -1em;padding:1em;background-color:var(--ds-color-background-default);border-radius:1rem;border:1px solid var(--ds-color-border-default);box-shadow:var(--ds-shadow-sm);display:flex;flex-direction:column;gap:1rem}._summary_1p24v_23{padding:.5rem}._item_1p24v_27{position:relative;display:flex;align-items:center;gap:.5rem;padding:.25rem .5rem;--dsc-item-background--hover: var(--ds-color-surface-tinted)}._item_1p24v_27:has(>a):hover,._item_1p24v_27:has(>button):not(disabled):hover{background-color:var(--dsc-item-background--hover)}._item_1p24v_27+[aria-hidden]{margin-block:0}._media_1p24v_45{pointer-events:none;position:relative;flex-shrink:0;font-size:2em;display:flex;align-items:center;justify-content:center}._media_1p24v_45 svg{font-size:1.5rem}._link_1p24v_59{font-size:1rem;flex-grow:1;display:flex;align-items:center;gap:.5rem;text-decoration:none;color:inherit}._linkIcon_1p24v_69{font-size:1.5rem;width:1em;height:1em}._label_1p24v_75{flex-grow:1;min-height:2.5rem;display:flex;flex-direction:column;justify-content:center}._label_1p24v_75 mark{background-color:transparent;text-decoration:underline}._controls_1p24v_88{position:relative;flex-grow:0}._linkIcon_1p24v_69{margin-right:.25rem}
@@ -1 +1 @@
1
- ._section_13ero_1{padding:.5rem 1rem;border-radius:.5rem}
1
+ ._section_1ccux_1{padding:1rem .5rem;border-radius:1rem}
@@ -0,0 +1 @@
1
+ ._section_ncfus_1{display:flex;flex-direction:column}._section_ncfus_1[data-variant=default]{row-gap:1.5rem}._section_ncfus_1[data-variant=menu]{row-gap:.5rem}._group_ncfus_14{background-color:var(--ds-color-surface-default);border-radius:1rem;padding:.375rem .5rem;box-shadow:var(--ds-shadow-xs)}._list_ncfus_21{display:flex;flex-direction:column;list-style:none;padding:0;margin:0}
@@ -1,55 +1,49 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
- import { Fragment as n, createElement as f } from "react";
1
+ import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
+ import { Fragment as h, createElement as f } from "react";
3
3
  import "../../index-p1eeF8LQ.js";
4
- import { useMenu as u } from "../../hooks/useMenu.js";
5
- import { H as k } from "../../ToolbarSearch-56Sm2j7P.js";
4
+ import { useMenu as k } from "../../hooks/useMenu.js";
5
+ import { H as y } from "../../ToolbarSearch-56Sm2j7P.js";
6
6
  import "../Typography/Link.js";
7
7
  import "../Button/Button.js";
8
- import { BookmarkSettingsItem as y } from "./BookmarkSettingsItem.js";
8
+ import { BookmarkSettingsItem as v } from "./BookmarkSettingsItem.js";
9
9
  import "react-dom";
10
- import { Divider as S } from "../Divider/Divider.js";
11
- import { List as v } from "../List/List.js";
12
10
  import "../Snackbar/useSnackbar.js";
13
- import { Flex as B } from "../Page/Flex.js";
14
- import { SettingsSection as j } from "../Settings/SettingsSection.js";
15
- const w = ({
16
- loading: p,
17
- highlightWords: l,
18
- items: t,
19
- groups: g = {},
11
+ import { s as o } from "../../settlingsList.module-So3_AYgj.js";
12
+ const z = ({
13
+ loading: m,
14
+ highlightWords: n,
15
+ items: r,
16
+ groups: l = {},
20
17
  sortGroupBy: a
21
18
  }) => {
22
- if (!t || t.length < 1)
19
+ if (!r || r.length < 1)
23
20
  return null;
24
- const { menu: c } = u({
25
- items: t,
26
- groups: g,
21
+ const { menu: p } = k({
22
+ items: r,
23
+ groups: l,
27
24
  groupByKey: "groupId",
28
25
  keyboardEvents: !1,
29
26
  sortGroupBy: a
30
27
  });
31
- return /* @__PURE__ */ r(B, { as: "div", spacing: "page", direction: "col", children: c?.map((e, d) => {
32
- const m = e.props || {};
33
- return /* @__PURE__ */ s(n, { children: [
34
- m?.title && /* @__PURE__ */ r(k, { size: "lg", children: m.title }),
35
- /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(v, { size: "sm", children: e?.items.map((h, i) => {
36
- const o = h.props || {};
37
- return /* @__PURE__ */ s(n, { children: [
38
- i > 0 && /* @__PURE__ */ r(S, { as: "li" }),
39
- /* @__PURE__ */ f(
40
- y,
41
- {
42
- ...o,
43
- key: "settings-list-item" + i,
44
- highlightWords: l || o?.highlightWords,
45
- loading: p || o?.loading
46
- }
47
- )
48
- ] }, i);
28
+ return /* @__PURE__ */ t("div", { className: o.section, "data-variant": "default", children: p?.map((i, g) => {
29
+ const s = i.props || {};
30
+ return /* @__PURE__ */ u(h, { children: [
31
+ s?.title && /* @__PURE__ */ t(y, { size: "lg", children: s.title }),
32
+ /* @__PURE__ */ t("section", { className: o.group, children: /* @__PURE__ */ t("ul", { className: o.list, children: i?.items.map((c, d) => {
33
+ const e = c.props || {};
34
+ return /* @__PURE__ */ f(
35
+ v,
36
+ {
37
+ ...e,
38
+ key: "settings-list-item" + d,
39
+ highlightWords: n || e?.highlightWords,
40
+ loading: m || e?.loading
41
+ }
42
+ );
49
43
  }) }) })
50
- ] }, d);
44
+ ] }, g);
51
45
  }) });
52
46
  };
53
47
  export {
54
- w as BookmarkSettingsList
48
+ z as BookmarkSettingsList
55
49
  };
@@ -1,49 +1,49 @@
1
- import { jsx as k, jsxs as f } from "react/jsx-runtime";
1
+ import { jsx as k, jsxs as j } from "react/jsx-runtime";
2
2
  import { c as u } from "../../index-p1eeF8LQ.js";
3
- import '../../assets/ItemLink.css';const j = "_link_eet0n_1", A = "_linkFocus_eet0n_26", e = {
4
- link: j,
5
- linkFocus: A
3
+ import '../../assets/ItemLink.css';const A = "_link_1pvv7_1", I = "_linkFocus_1pvv7_30", a = {
4
+ link: A,
5
+ linkFocus: I
6
6
  }, h = ({
7
- as: m,
7
+ as: d,
8
8
  loading: t,
9
- disabled: n,
10
- selected: v,
11
- href: s,
12
- onClick: a,
9
+ disabled: s,
10
+ selected: m,
11
+ href: n,
12
+ onClick: e,
13
13
  onKeyPress: p,
14
- className: o,
14
+ className: r,
15
15
  active: _,
16
- ariaLabel: r,
16
+ ariaLabel: o,
17
17
  children: c,
18
18
  tabIndex: x = 0,
19
19
  expanded: l,
20
20
  collapsible: y,
21
21
  ariaControlsId: F
22
22
  }) => {
23
- const i = m || "div";
24
- if (i === "div")
25
- return /* @__PURE__ */ k("div", { className: u(e.link, o), children: c });
26
- const b = !t && s || i !== "a" && r;
27
- return /* @__PURE__ */ f(
23
+ const i = d || "div";
24
+ if (i === "div" || s || t)
25
+ return /* @__PURE__ */ k("div", { className: u(a.link, r), "data-disabled": s || t, children: c });
26
+ const f = !t && n || i !== "a" && o;
27
+ return /* @__PURE__ */ j(
28
28
  i,
29
29
  {
30
- className: u(e.link, o),
31
- href: s,
32
- onKeyPress: (d) => {
33
- d.key === "Enter" && a?.(), p?.(d);
30
+ className: u(a.link, r),
31
+ href: n,
32
+ onKeyPress: (v) => {
33
+ v.key === "Enter" && e?.(), p?.(v);
34
34
  },
35
- onClick: a,
35
+ onClick: e,
36
36
  "data-interactive": "true",
37
- "aria-disabled": t || n,
38
- "aria-selected": v,
37
+ "aria-disabled": t || s,
38
+ "aria-selected": m,
39
39
  "aria-expanded": y ? l : void 0,
40
40
  "aria-controls": l ? F : void 0,
41
- ...b && { "aria-label": r },
41
+ ...f && { "aria-label": o },
42
42
  "data-active": _,
43
- tabIndex: t || n ? -1 : x,
43
+ tabIndex: t || s ? -1 : x,
44
44
  children: [
45
45
  c,
46
- /* @__PURE__ */ k("div", { className: e.linkFocus, "aria-hidden": "true" })
46
+ /* @__PURE__ */ k("div", { className: a.linkFocus, "aria-hidden": "true" })
47
47
  ]
48
48
  }
49
49
  );
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import '../../assets/LayoutBase.css';const r = "_base_1m3p1_1", c = {
2
+ import '../../assets/LayoutBase.css';const r = "_base_k5ay7_1", c = {
3
3
  base: r
4
- }, m = ({ currentId: a, color: s, theme: t, children: e }) => /* @__PURE__ */ o("div", { className: c.base, "data-color": s, "data-theme": t, "data-current-id": a, children: e });
4
+ }, n = ({ currentId: a, color: s, theme: t, children: e }) => /* @__PURE__ */ o("div", { className: c.base, "data-color": s, "data-theme": t, "data-current-id": a, children: e });
5
5
  export {
6
- m as LayoutBase
6
+ n as LayoutBase
7
7
  };
@@ -1,38 +1,40 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import "../../index-p1eeF8LQ.js";
3
- import { useState as g } from "react";
4
- import { Input as b } from "../Forms/Input.js";
3
+ import { useState as b } from "react";
4
+ import { Input as P } from "../Forms/Input.js";
5
5
  import "../../ToolbarSearch-56Sm2j7P.js";
6
6
  import "../Typography/Link.js";
7
7
  import "../Button/Button.js";
8
8
  import "react-dom";
9
9
  import "../Snackbar/useSnackbar.js";
10
- import { SettingsItemBase as n } from "./SettingsItemBase.js";
11
- import { SettingsModal as x } from "./SettingsModal.js";
12
- const M = ({
13
- loading: c,
14
- variant: m = "default",
15
- id: d = "settings",
16
- name: h,
10
+ import { SettingsItemBase as r } from "./SettingsItemBase.js";
11
+ import { SettingsModal as w } from "./SettingsModal.js";
12
+ const O = ({
13
+ loading: d,
14
+ variant: h = "default",
15
+ id: u = "settings",
16
+ name: p,
17
17
  title: e,
18
- value: r,
18
+ value: n,
19
19
  description: s,
20
- checked: p,
21
- onChange: u,
20
+ checked: f,
21
+ onChange: g,
22
22
  modalProps: o,
23
- children: f,
23
+ expanded: a,
24
+ children: c,
24
25
  ...i
25
26
  }) => {
26
- const [l, a] = g(!1);
27
- if (c)
28
- return /* @__PURE__ */ t(n, { icon: i?.icon, titleProps: { children: e }, loading: !0 });
29
- switch (m) {
27
+ const [l, m] = b(!1);
28
+ if (d)
29
+ return /* @__PURE__ */ t(r, { icon: i?.icon, titleProps: { children: e }, loading: !0 });
30
+ switch (h) {
30
31
  case "link":
31
32
  return /* @__PURE__ */ t(
32
- n,
33
+ r,
33
34
  {
34
35
  ...i,
35
36
  titleProps: {
37
+ size: "md",
36
38
  children: e
37
39
  },
38
40
  descriptionProps: {
@@ -45,7 +47,7 @@ const M = ({
45
47
  );
46
48
  case "switch":
47
49
  return /* @__PURE__ */ t(
48
- n,
50
+ r,
49
51
  {
50
52
  ...i,
51
53
  as: "div",
@@ -59,27 +61,48 @@ const M = ({
59
61
  children: s
60
62
  },
61
63
  controls: /* @__PURE__ */ t(
62
- b,
64
+ P,
63
65
  {
64
66
  type: "checkbox",
65
67
  role: "switch",
66
- "aria-labelledby": d,
67
- name: h,
68
- value: r,
69
- checked: p,
70
- onChange: u,
68
+ "aria-labelledby": u,
69
+ name: p,
70
+ value: n,
71
+ checked: f,
72
+ onChange: g,
71
73
  style: { marginRight: "0.5em" }
72
74
  }
73
75
  )
74
76
  }
75
77
  );
78
+ case "accordion":
79
+ return /* @__PURE__ */ t(
80
+ r,
81
+ {
82
+ ...i,
83
+ as: "button",
84
+ linkIcon: !0,
85
+ collapsible: !0,
86
+ expanded: a,
87
+ titleProps: {
88
+ children: e
89
+ },
90
+ descriptionProps: {
91
+ size: "xs",
92
+ weight: "normal",
93
+ variant: "subtle",
94
+ children: s
95
+ },
96
+ children: a && /* @__PURE__ */ t("div", { children: c })
97
+ }
98
+ );
76
99
  case "modal":
77
100
  return /* @__PURE__ */ t(
78
- n,
101
+ r,
79
102
  {
80
103
  ...i,
81
104
  titleProps: {
82
- size: r ? "xs" : "sm",
105
+ size: n ? "xs" : "sm",
83
106
  variant: "subtle",
84
107
  weight: "normal",
85
108
  children: e
@@ -87,32 +110,32 @@ const M = ({
87
110
  descriptionProps: {
88
111
  size: "sm",
89
112
  variant: "default",
90
- children: s || r
113
+ children: s || n
91
114
  },
92
115
  as: "button",
93
116
  linkIcon: !0,
94
- onClick: () => a(!0),
117
+ onClick: () => m(!0),
95
118
  expanded: l,
96
119
  children: l && /* @__PURE__ */ t(
97
- x,
120
+ w,
98
121
  {
99
122
  ...o,
100
123
  icon: o?.icon || i?.icon,
101
124
  title: o?.title || e,
102
125
  open: l,
103
- onClose: () => a(!1),
104
- children: f
126
+ onClose: () => m(!1),
127
+ children: c
105
128
  }
106
129
  )
107
130
  }
108
131
  );
109
132
  default:
110
133
  return /* @__PURE__ */ t(
111
- n,
134
+ r,
112
135
  {
113
136
  ...i,
114
137
  titleProps: {
115
- size: r ? "xs" : "sm",
138
+ size: n ? "xs" : "sm",
116
139
  variant: "subtle",
117
140
  weight: "normal",
118
141
  children: e
@@ -120,12 +143,12 @@ const M = ({
120
143
  descriptionProps: {
121
144
  size: "sm",
122
145
  variant: "default",
123
- children: s || r
146
+ children: s || n
124
147
  }
125
148
  }
126
149
  );
127
150
  }
128
151
  };
129
152
  export {
130
- M as SettingsItem
153
+ O as SettingsItem
131
154
  };
@@ -1,73 +1,84 @@
1
- import { jsxs as a, jsx as s } from "react/jsx-runtime";
2
- import { h as f, H as m, B as h, v as B } from "../../ToolbarSearch-56Sm2j7P.js";
1
+ import { jsxs as m, jsx as a, Fragment as g } from "react/jsx-runtime";
2
+ import { h as u, H as c, B, v as C } from "../../ToolbarSearch-56Sm2j7P.js";
3
3
  import "../../index-p1eeF8LQ.js";
4
4
  import "react";
5
+ import { Typography as b } from "../Typography/Typography.js";
5
6
  import "../Typography/Link.js";
6
- import { ItemControls as b } from "../Item/ItemControls.js";
7
- import { ItemBase as v } from "../Item/ItemBase.js";
8
- import { ItemLink as R } from "../Item/ItemLink.js";
7
+ import { ItemControls as w } from "../Item/ItemControls.js";
8
+ import { ItemBase as R } from "../Item/ItemBase.js";
9
+ import { ItemLink as j } from "../Item/ItemLink.js";
9
10
  import "../Button/Button.js";
10
11
  import "react-dom";
11
12
  import "../Snackbar/useSnackbar.js";
12
- import '../../assets/SettingsItemBase.css';const j = "_item_1xpqe_1", w = "_media_1xpqe_24", C = "_link_1xpqe_38", H = "_linkIcon_1xpqe_48", S = "_label_1xpqe_54", g = "_controls_1xpqe_67", e = {
13
- item: j,
14
- media: w,
15
- link: C,
16
- linkIcon: H,
17
- label: S,
18
- controls: g
19
- }, O = ({
20
- as: n,
21
- ref: l,
22
- hidden: r,
13
+ import { S as H } from "../../ChevronUp-hn05LboH.js";
14
+ import { S as z } from "../../ChevronDown-D_a7nb-G.js";
15
+ import '../../assets/SettingsItemBase.css';const D = "_listItem_1p24v_1", F = "_summary_1p24v_23", L = "_item_1p24v_27", M = "_media_1p24v_45", T = "_link_1p24v_59", U = "_linkIcon_1p24v_69", q = "_label_1p24v_75", A = "_controls_1p24v_88", s = {
16
+ listItem: D,
17
+ summary: F,
18
+ item: L,
19
+ media: M,
20
+ link: T,
21
+ linkIcon: U,
22
+ label: q,
23
+ controls: A
24
+ }, as = ({
25
+ as: p,
26
+ ref: _,
27
+ hidden: v,
28
+ disabled: e,
23
29
  loading: t,
24
- color: c,
25
- expanded: u,
26
- icon: p,
27
- label: _,
28
- titleProps: d = {},
29
- descriptionProps: x = {},
30
- children: k,
31
- highlightWords: o,
32
- badge: i,
33
- linkIcon: I,
34
- controls: N,
35
- ...q
36
- }) => /* @__PURE__ */ a(v, { as: "li", ref: l, className: e.item, color: c, "aria-hidden": r, "data-loading": t, children: [
37
- /* @__PURE__ */ a(R, { ...q, className: e.link, as: n, children: [
38
- /* @__PURE__ */ s(f, { icon: p, className: e.media }),
39
- _ || /* @__PURE__ */ a("span", { className: e.label, children: [
40
- /* @__PURE__ */ s(
41
- m,
42
- {
43
- ...d,
44
- as: "span",
45
- highlightWords: o,
46
- loading: t,
47
- maxRows: 2,
48
- className: e.title
49
- }
50
- ),
51
- /* @__PURE__ */ s(
52
- m,
53
- {
54
- ...x,
55
- as: "span",
56
- highlightWords: o,
57
- loading: t,
58
- maxRows: 2,
59
- className: e.description
60
- }
61
- )
30
+ color: d,
31
+ collapsible: o,
32
+ expanded: i,
33
+ icon: I,
34
+ label: N,
35
+ titleProps: h = {},
36
+ descriptionProps: k = {},
37
+ summary: n,
38
+ children: f,
39
+ highlightWords: l,
40
+ badge: r,
41
+ linkIcon: x,
42
+ controls: y,
43
+ ...S
44
+ }) => /* @__PURE__ */ m("li", { className: s.listItem, "data-collapsible": o, "data-expanded": i, children: [
45
+ /* @__PURE__ */ m(R, { ref: _, as: "div", className: s.item, color: d, "aria-hidden": v, "data-loading": t, children: [
46
+ /* @__PURE__ */ m(j, { ...S, className: s.link, disabled: e, as: p, children: [
47
+ /* @__PURE__ */ a(u, { icon: I, className: s.media }),
48
+ N || /* @__PURE__ */ m("span", { className: s.label, children: [
49
+ /* @__PURE__ */ a(
50
+ c,
51
+ {
52
+ ...h,
53
+ as: "span",
54
+ highlightWords: l,
55
+ loading: t,
56
+ maxRows: 2,
57
+ className: s.title
58
+ }
59
+ ),
60
+ /* @__PURE__ */ a(
61
+ c,
62
+ {
63
+ ...k,
64
+ as: "span",
65
+ highlightWords: l,
66
+ loading: t,
67
+ maxRows: 2,
68
+ className: s.description
69
+ }
70
+ )
71
+ ] })
72
+ ] }),
73
+ !e && /* @__PURE__ */ m(g, { children: [
74
+ /* @__PURE__ */ a(w, { className: s.controls, children: y }),
75
+ r && /* @__PURE__ */ a(B, { ...r }),
76
+ o && (i ? /* @__PURE__ */ a(H, { className: s.linkIcon }) : /* @__PURE__ */ a(z, { className: s.linkIcon })) || x && /* @__PURE__ */ a(C, { className: s.linkIcon })
62
77
  ] })
63
78
  ] }),
64
- /* @__PURE__ */ a(b, { className: e.controls, children: [
65
- N,
66
- i && /* @__PURE__ */ s(h, { ...i }),
67
- I && /* @__PURE__ */ s(B, { className: e.linkIcon })
68
- ] }),
69
- k
79
+ n && /* @__PURE__ */ a(b, { className: s.summary, size: "xs", variant: "subtle", children: n }),
80
+ f
70
81
  ] });
71
82
  export {
72
- O as SettingsItemBase
83
+ as as SettingsItemBase
73
84
  };
@@ -1,39 +1,42 @@
1
- import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
- import { Fragment as m, createElement as d } from "react";
1
+ import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
+ import { Fragment as c, createElement as d } from "react";
3
3
  import "../../index-p1eeF8LQ.js";
4
- import { useMenu as f } from "../../hooks/useMenu.js";
4
+ import { useMenu as N } from "../../hooks/useMenu.js";
5
5
  import { H as u } from "../../ToolbarSearch-56Sm2j7P.js";
6
6
  import "../Typography/Link.js";
7
7
  import "../Button/Button.js";
8
+ import { s } from "../../settlingsList.module-So3_AYgj.js";
8
9
  import "react-dom";
9
- import { Divider as h } from "../Divider/Divider.js";
10
- import { List as y } from "../List/List.js";
11
10
  import "../Snackbar/useSnackbar.js";
12
- import { Flex as S } from "../Page/Flex.js";
13
- import { SettingsItem as v } from "./SettingsItem.js";
14
- import { SettingsSection as j } from "./SettingsSection.js";
15
- const q = ({ items: s, groups: p = {}, sortGroupBy: n }) => {
16
- const { menu: c } = f({
17
- items: s,
18
- groups: p,
11
+ import { SettingsItem as g } from "./SettingsItem.js";
12
+ const w = ({ items: h, variant: i = "default", groups: f = {}, sortGroupBy: y }) => {
13
+ const { menu: p } = N({
14
+ items: h,
15
+ groups: f,
19
16
  groupByKey: "groupId",
20
17
  keyboardEvents: !1,
21
- sortGroupBy: n
18
+ sortGroupBy: y
22
19
  });
23
- return /* @__PURE__ */ r(S, { as: "div", spacing: "page", direction: "col", children: c?.map((i, l) => {
24
- const e = i.props || {};
25
- return /* @__PURE__ */ o(m, { children: [
26
- e?.title && /* @__PURE__ */ r(u, { size: "lg", children: e.title }),
27
- /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(y, { size: "sm", children: i?.items.map((a, t) => {
28
- const g = a.props || {};
29
- return /* @__PURE__ */ o(m, { children: [
30
- t > 0 && /* @__PURE__ */ r(h, { as: "li" }),
31
- /* @__PURE__ */ d(v, { ...g, key: "settings-list-item" + t })
32
- ] }, t);
20
+ return i === "menu" ? /* @__PURE__ */ t("div", { className: s.section, "data-variant": i, children: p?.map((e, o) => {
21
+ const r = e.props || {};
22
+ return /* @__PURE__ */ a(c, { children: [
23
+ r?.title && /* @__PURE__ */ t(u, { size: "xs", weight: "normal", variant: "subtle", children: r.title }),
24
+ /* @__PURE__ */ t("ul", { className: s.list, children: e?.items.map((m, n) => {
25
+ const l = m.props || {};
26
+ return /* @__PURE__ */ d(g, { ...l, key: "settings-list-item" + n });
27
+ }) })
28
+ ] }, o);
29
+ }) }) : /* @__PURE__ */ t("div", { className: s.section, "data-variant": i, children: p?.map((e, o) => {
30
+ const r = e.props || {};
31
+ return /* @__PURE__ */ a(c, { children: [
32
+ r?.title && /* @__PURE__ */ t(u, { size: "lg", children: r.title }),
33
+ /* @__PURE__ */ t("section", { className: s.group, children: /* @__PURE__ */ t("ul", { className: s.list, children: e?.items.map((m, n) => {
34
+ const l = m.props || {};
35
+ return /* @__PURE__ */ d(g, { ...l, key: "settings-list-item" + n });
33
36
  }) }) })
34
- ] }, l);
37
+ ] }, o);
35
38
  }) });
36
39
  };
37
40
  export {
38
- q as SettingsList
41
+ w as SettingsList
39
42
  };
@@ -6,17 +6,17 @@ import "../Typography/Link.js";
6
6
  import "../Button/Button.js";
7
7
  import "react-dom";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import { Section as n } from "../Page/Section.js";
10
- import '../../assets/SettingsSection.css';const c = "_section_13ero_1", p = {
11
- section: c
9
+ import { Section as e } from "../Page/Section.js";
10
+ import '../../assets/SettingsSection.css';const n = "_section_1ccux_1", p = {
11
+ section: n
12
12
  }, j = ({
13
13
  size: t = "sm",
14
14
  theme: o = "default",
15
15
  shadow: i = "xs",
16
16
  as: s,
17
17
  color: r,
18
- children: e
19
- }) => /* @__PURE__ */ m(n, { as: s, size: t, color: r, theme: o, shadow: i, className: p.section, spacing: 2, children: e });
18
+ children: c
19
+ }) => /* @__PURE__ */ m(e, { as: s, size: t, color: r, theme: o, shadow: i, className: p.section, spacing: 2, children: c });
20
20
  export {
21
21
  j as SettingsSection
22
22
  };
@@ -0,0 +1,8 @@
1
+ import './assets/settlingsList.css';const s = "_section_ncfus_1", t = "_group_ncfus_14", o = "_list_ncfus_21", c = {
2
+ section: s,
3
+ group: t,
4
+ list: o
5
+ };
6
+ export {
7
+ c as s
8
+ };
@@ -1,5 +1,5 @@
1
1
  import { ChangeEvent } from 'react';
2
- import { AccountListItemProps, AccountListProps } from '..';
2
+ import { AccountListItemProps, AccountListProps, LayoutProps } from '..';
3
3
  import { UseAccountsProps } from '../../../examples';
4
4
  declare const meta: {
5
5
  title: string;
@@ -13,18 +13,26 @@ declare const meta: {
13
13
  export default meta;
14
14
  export declare const Default: ({ includeGroups }: UseAccountsProps) => import("react/jsx-runtime").JSX.Element;
15
15
  export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
16
- interface ControlledProps {
16
+ interface ControlledPageQuery {
17
+ q?: string;
18
+ }
19
+ interface ControlledPageProps {
20
+ layout?: LayoutProps;
21
+ title?: string;
17
22
  includeGroups?: boolean;
18
23
  contextMenu?: boolean;
19
24
  collapsible?: boolean;
20
25
  color?: 'neutral';
21
26
  variant?: 'subtle' | 'tinted' | 'default';
22
27
  virtualized?: boolean;
28
+ query?: ControlledPageQuery;
23
29
  }
24
- export declare const Controlled: ({ includeGroups, collapsible, contextMenu, variant, color, virtualized, }: ControlledProps) => import("react/jsx-runtime").JSX.Element;
25
- export declare const ControlledTinted: () => import("react/jsx-runtime").JSX.Element;
26
- export declare const Collapsible: () => import("react/jsx-runtime").JSX.Element;
27
- export declare const CollapsibleWithGroups: () => import("react/jsx-runtime").JSX.Element;
30
+ export declare const ControlledPage: ({ layout, title, includeGroups, collapsible, contextMenu, variant, virtualized, query, }: ControlledPageProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const CollapsiblePage: () => import("react/jsx-runtime").JSX.Element;
32
+ export declare const AccountSelector: () => import("react/jsx-runtime").JSX.Element;
33
+ export declare const AccountSettings: () => import("react/jsx-runtime").JSX.Element;
34
+ export declare const AccountUserSettings: () => import("react/jsx-runtime").JSX.Element;
35
+ export declare const AccountCompanySettings: () => import("react/jsx-runtime").JSX.Element;
28
36
  interface AccountDetailsProps extends AccountListItemProps {
29
37
  smsAlerts?: boolean;
30
38
  emailAlerts?: boolean;
@@ -1,11 +1,14 @@
1
1
  declare const meta: {
2
2
  title: string;
3
3
  tags: string[];
4
- parameters: {};
4
+ parameters: {
5
+ layout: string;
6
+ };
5
7
  args: {};
6
8
  };
7
9
  export default meta;
8
10
  export declare const Default: () => import("react/jsx-runtime").JSX.Element;
9
11
  export declare const Controlled: () => import("react/jsx-runtime").JSX.Element;
12
+ export declare const ProfileActivityLog: () => import("react/jsx-runtime").JSX.Element;
10
13
  export declare const ActivityLogModal: () => import("react/jsx-runtime").JSX.Element;
11
14
  export declare const ActivityLogModalAdvanced: () => import("react/jsx-runtime").JSX.Element;
@@ -2,11 +2,11 @@ import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
2
2
  import { Color } from '..';
3
3
  export type ItemSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4
4
  export type ItemColor = Color;
5
- export type ItemBaseProps<T extends ElementType = 'li'> = {
5
+ export type ItemBaseProps = {
6
6
  /** The element type to render as. */
7
- as?: T;
7
+ as?: ElementType;
8
8
  /** Optional ref */
9
- ref?: React.Ref<T>;
9
+ ref?: React.Ref<ElementType>;
10
10
  /** The tab index of the list item. */
11
11
  tabIndex?: number;
12
12
  /** The size of item. */
@@ -25,5 +25,5 @@ export type ItemBaseProps<T extends ElementType = 'li'> = {
25
25
  children?: ReactNode;
26
26
  /** Id of list item. */
27
27
  id?: string;
28
- } & Omit<ComponentPropsWithRef<T>, 'color' | 'size'>;
28
+ } & Omit<ComponentPropsWithRef<ElementType>, 'color' | 'size'>;
29
29
  export declare const ItemBase: ({ id, ref, as, size, color, variant, hidden, disabled, className, children, ...rest }: ItemBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type LayoutColor = 'neutral' | 'company' | 'person';
3
- export type LayoutTheme = 'default' | 'subtle' | 'neutral' | 'inbox';
3
+ export type LayoutTheme = 'default' | 'subtle' | 'neutral' | 'inbox' | 'settings';
4
4
  export interface LayoutBaseProps {
5
5
  color?: LayoutColor;
6
6
  theme?: LayoutTheme /** TODO: Should be renamed to variant */;
@@ -1,6 +1,6 @@
1
1
  import { InputProps, SettingsItemBaseProps, SettingsModalProps } from '..';
2
2
  import { ReactNode } from 'react';
3
- export type SettingsItemVariant = 'default' | 'link' | 'modal' | 'switch';
3
+ export type SettingsItemVariant = 'default' | 'link' | 'modal' | 'accordion' | 'switch';
4
4
  export interface SettingsItemModalProps {
5
5
  icon?: SettingsModalProps['icon'];
6
6
  title?: SettingsModalProps['title'];
@@ -19,4 +19,4 @@ export interface SettingsItemProps extends SettingsItemBaseProps {
19
19
  modalProps?: SettingsItemModalProps;
20
20
  children?: ReactNode;
21
21
  }
22
- export declare const SettingsItem: ({ loading, variant, id, name, title, value, description, checked, onChange, modalProps, children, ...props }: SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const SettingsItem: ({ loading, variant, id, name, title, value, description, checked, onChange, modalProps, expanded, children, ...props }: SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,65 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ loading, variant, id, name, title, value, description, checked, onChange, modalProps, expanded, children, ...props }: import('./SettingsItem').SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ parameters: {};
7
+ args: {
8
+ id: string;
9
+ variant: "default";
10
+ ariaLabel: string;
11
+ title: string;
12
+ };
13
+ decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react-vite').ReactRenderer, {
14
+ variant?: import('./SettingsItem').SettingsItemVariant | undefined;
15
+ id: string;
16
+ title?: string | undefined;
17
+ value?: string | undefined;
18
+ description?: string | undefined;
19
+ name?: string | undefined;
20
+ checked?: boolean | undefined;
21
+ onChange?: import('react').ChangeEventHandler<HTMLInputElement> | undefined;
22
+ modalProps?: import('./SettingsItem').SettingsItemModalProps | undefined;
23
+ children?: import('react').ReactNode;
24
+ groupId?: string | undefined;
25
+ hidden?: boolean | undefined;
26
+ disabled?: boolean | undefined;
27
+ ref?: import('react').Ref<import('react').ElementType> | undefined;
28
+ color?: import('..').Color | undefined;
29
+ icon?: import('react').ReactNode | import('..').SvgElement | import('..').AvatarProps | import('..').AvatarGroupProps;
30
+ label?: import('react').ReactNode;
31
+ titleProps?: import('..').HeadingProps | undefined;
32
+ descriptionProps?: import('..').HeadingProps | undefined;
33
+ highlightWords?: string[] | undefined;
34
+ badge?: import('..').BadgeProps | undefined;
35
+ colllapsible?: boolean | undefined;
36
+ expanded?: boolean | undefined;
37
+ linkIcon?: boolean | undefined;
38
+ controls?: import('react').ReactNode;
39
+ summary?: import('react').ReactNode;
40
+ as?: import('react').ElementType | undefined;
41
+ href?: string | undefined;
42
+ onClick?: (() => void) | undefined;
43
+ onKeyPress?: import('react').KeyboardEventHandler | undefined;
44
+ ariaLabel?: string | undefined;
45
+ tabIndex?: number | undefined;
46
+ loading?: boolean | undefined;
47
+ selected?: boolean | undefined;
48
+ className?: string | undefined;
49
+ active?: boolean | undefined;
50
+ collapsible?: boolean | undefined;
51
+ ariaControlsId?: string | undefined;
52
+ }>) => import("react/jsx-runtime").JSX.Element)[];
53
+ };
54
+ export default meta;
55
+ type Story = StoryObj<typeof meta>;
56
+ export declare const Default: Story;
57
+ export declare const Value: Story;
58
+ export declare const Loading: Story;
59
+ export declare const Switch: Story;
60
+ export declare const Modal: Story;
61
+ export declare const ModalProps: Story;
62
+ export declare const Company: Story;
63
+ export declare const Person: Story;
64
+ export declare const Bookmark: () => import("react/jsx-runtime").JSX.Element;
65
+ export declare const BookmarkContextMenu: () => import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,7 @@ export interface SettingsItemBaseProps extends ItemLinkProps {
4
4
  id?: string;
5
5
  groupId?: string;
6
6
  hidden?: boolean;
7
+ disabled?: boolean;
7
8
  ref?: ItemBaseProps['ref'];
8
9
  color?: ItemBaseProps['color'];
9
10
  icon?: ItemMediaProps['icon'];
@@ -12,8 +13,11 @@ export interface SettingsItemBaseProps extends ItemLinkProps {
12
13
  descriptionProps?: HeadingProps;
13
14
  highlightWords?: string[];
14
15
  badge?: BadgeProps;
16
+ colllapsible?: boolean;
17
+ expanded?: boolean;
15
18
  linkIcon?: boolean;
16
19
  controls?: ReactNode;
17
20
  children?: ReactNode;
21
+ summary?: ReactNode;
18
22
  }
19
- export declare const SettingsItemBase: ({ as, ref, hidden, loading, color, expanded, icon, label, titleProps, descriptionProps, children, highlightWords, badge, linkIcon, controls, ...rest }: SettingsItemBaseProps) => import("react/jsx-runtime").JSX.Element;
23
+ export declare const SettingsItemBase: ({ as, ref, hidden, disabled, loading, color, collapsible, expanded, icon, label, titleProps, descriptionProps, summary, children, highlightWords, badge, linkIcon, controls, ...rest }: SettingsItemBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,8 +4,9 @@ export interface SettingsGroupProps {
4
4
  title?: string | ReactNode;
5
5
  }
6
6
  export interface SettingsListProps {
7
+ variant?: 'default' | 'menu';
7
8
  items: SettingsItemProps[];
8
9
  groups?: Record<string, SettingsGroupProps>;
9
10
  sortGroupBy?: (a: [string, SettingsItemProps[]], b: [string, SettingsItemProps[]]) => number;
10
11
  }
11
- export declare const SettingsList: ({ items, groups, sortGroupBy }: SettingsListProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const SettingsList: ({ items, variant, groups, sortGroupBy }: SettingsListProps) => import("react/jsx-runtime").JSX.Element;
@@ -11,6 +11,8 @@ export default meta;
11
11
  export declare const ProfileReadOnly: () => import("react/jsx-runtime").JSX.Element;
12
12
  export declare const ProfileInput: () => import("react/jsx-runtime").JSX.Element;
13
13
  export declare const ProfileSelect: () => import("react/jsx-runtime").JSX.Element;
14
+ export declare const AccountSingleInput: () => import("react/jsx-runtime").JSX.Element;
15
+ export declare const AccountSingleSelect: () => import("react/jsx-runtime").JSX.Element;
14
16
  export declare const AccountVerified: () => import("react/jsx-runtime").JSX.Element;
15
17
  export declare const AccountNewEmail: () => import("react/jsx-runtime").JSX.Element;
16
18
  export declare const AccountNewEmailAndSms: () => import("react/jsx-runtime").JSX.Element;
@@ -7,12 +7,12 @@ declare const meta: {
7
7
  args: {};
8
8
  };
9
9
  export default meta;
10
+ export declare const ProfilePage: () => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const DashboardPage: () => import("react/jsx-runtime").JSX.Element;
11
12
  export declare const AccountsPage: () => import("react/jsx-runtime").JSX.Element;
12
13
  export declare const AccountsPageVirtualized: () => import("react/jsx-runtime").JSX.Element;
13
14
  export declare const AlertsPage: () => import("react/jsx-runtime").JSX.Element;
14
15
  export declare const BookmarksPage: () => import("react/jsx-runtime").JSX.Element;
15
- export declare const SettingsPage: () => import("react/jsx-runtime").JSX.Element;
16
16
  export declare const ActivityLogPage: () => import("react/jsx-runtime").JSX.Element;
17
17
  export declare const UsersPage: () => import("react/jsx-runtime").JSX.Element;
18
18
  export declare const AccessPage: () => 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.61.2",
3
+ "version": "0.61.3",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",