@altinn/altinn-components 0.41.4 → 0.41.5

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
- ._label_16xuy_1{flex-grow:1;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 .125rem;font-size:1rem;column-gap:.5em;pointer-events:none}._title_16xuy_13{display:inline-flex;align-items:center;column-gap:.5em}._radio_16xuy_19,._checkbox_16xuy_20{flex-shrink:0;flex-grow:0;position:relative;width:1.25em;height:1.25em;display:flex;align-items:center;justify-content:center;color:transparent}._radio_16xuy_19{border:1px solid;border-color:var(--ds-color-border-subtle);outline:var(--ds-color-border-subtle) solid 1px;border-radius:50%}._checkbox_16xuy_20{border:2px solid;border-color:var(--ds-color-border-subtle);border-radius:2px}._radio_16xuy_19[data-checked=true],._checkbox_16xuy_20[data-checked=true]{background-color:var(--ds-color-base-default);border:none;outline-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._icon_16xuy_53{font-size:1.25em}@supports (-webkit-hyphens: none){._icon_16xuy_53{font-size:unset;width:1.25em;height:1.25em}._icon_16xuy_53 svg,._icon_16xuy_53 img{width:100%;height:100%}}
1
+ ._label_sfsij_1{flex-grow:1;display:flex;flex-direction:row;align-items:center;justify-content:center;padding:0 .125rem;font-size:1rem;column-gap:.5em;pointer-events:none}._title_sfsij_13{color:var(--ds-color-text-default);display:inline-flex;align-items:center;column-gap:.5em}._count_sfsij_20{vertical-align:super;font-size:smaller}._radio_sfsij_25,._checkbox_sfsij_26{flex-shrink:0;flex-grow:0;position:relative;width:1.25em;height:1.25em;display:flex;align-items:center;justify-content:center;color:transparent}._radio_sfsij_25{border:1px solid;border-color:var(--ds-color-border-subtle);outline:var(--ds-color-border-subtle) solid 1px;border-radius:50%}._checkbox_sfsij_26{border:2px solid;border-color:var(--ds-color-border-subtle);border-radius:2px}._radio_sfsij_25[data-checked=true],._checkbox_sfsij_26[data-checked=true]{background-color:var(--ds-color-base-default);border:none;outline-color:var(--ds-color-base-default);color:var(--ds-color-base-contrast-default)}._icon_sfsij_59{font-size:1.25em}@supports (-webkit-hyphens: none){._icon_sfsij_59{font-size:unset;width:1.25em;height:1.25em}._icon_sfsij_59 svg,._icon_sfsij_59 img{width:100%;height:100%}}
@@ -1,70 +1,71 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { Icon as w } from "../Icon/Icon.js";
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { isValidElement as C } from "react";
3
+ import { Icon as N } from "../Icon/Icon.js";
3
4
  import "../../index-L8X2o7IH.js";
4
- import "react";
5
+ import { Badge as d } from "../Badge/Badge.js";
5
6
  import "../RootProvider/RootProvider.js";
6
- import { MenuItemBase as y } from "./MenuItemBase.js";
7
- import { MenuItemLabel as C } from "./MenuItemLabel.js";
8
- import { MenuItemIcon as j } from "./MenuItemIcon.js";
7
+ import { MenuItemBase as q } from "./MenuItemBase.js";
8
+ import { MenuItemLabel as x } from "./MenuItemLabel.js";
9
+ import { MenuItemIcon as E } from "./MenuItemIcon.js";
9
10
  import "../Snackbar/useSnackbar.js";
10
- import { S as q, a as x } from "../../ChevronUp-_BBfEirx.js";
11
- import { S as L } from "../../ChevronRight-ANFWmIs1.js";
12
- import '../../assets/MenuItem.css';const N = "_controls_w98qm_46", B = "_linkIcon_w98qm_59", s = {
13
- controls: N,
14
- linkIcon: B
15
- }, P = ({
16
- as: i = "a",
11
+ import { S as L, a as b } from "../../ChevronUp-_BBfEirx.js";
12
+ import { S as D } from "../../ChevronRight-ANFWmIs1.js";
13
+ import '../../assets/MenuItem.css';const R = "_controls_w98qm_46", U = "_linkIcon_w98qm_59", m = {
14
+ controls: R,
15
+ linkIcon: U
16
+ }, X = ({
17
+ as: l = "a",
17
18
  size: t = "md",
18
19
  color: p,
19
- variant: l,
20
+ variant: f,
20
21
  collapsible: a,
21
- expanded: m,
22
+ expanded: c,
22
23
  icon: I,
23
- iconTheme: f,
24
- iconBadge: h,
24
+ iconTheme: h,
25
+ iconBadge: u,
25
26
  title: v,
26
- description: u,
27
- highlightWords: S,
28
- badge: _,
29
- controls: d,
30
- loading: o,
31
- linkIcon: k,
32
- label: r,
27
+ description: S,
28
+ highlightWords: _,
29
+ badge: o,
30
+ controls: k,
31
+ loading: r,
32
+ linkIcon: y,
33
+ label: e,
33
34
  ariaLabel: M,
34
- ...b
35
+ ...j
35
36
  }) => {
36
- const g = typeof r == "function" ? r() : r, e = a ? m ? q : x : k ? L : void 0;
37
- return /* @__PURE__ */ c(
38
- y,
37
+ const w = typeof e == "function" ? e() : e, s = a ? c ? L : b : y ? D : void 0, B = () => o && !r && typeof o == "object" && "label" in o ? /* @__PURE__ */ n(d, { ...o, className: m.badge }) : C(o) ? o : null;
38
+ return /* @__PURE__ */ i(
39
+ q,
39
40
  {
40
- as: i,
41
+ as: l,
41
42
  size: t,
42
- variant: l,
43
+ variant: f,
43
44
  color: p,
44
- expanded: m,
45
+ expanded: c,
45
46
  ariaLabel: M,
46
- hidden: o,
47
- ...b,
47
+ hidden: r,
48
+ ...j,
48
49
  children: [
49
- /* @__PURE__ */ n(j, { loading: o, size: t, icon: I, theme: f, badge: h }),
50
+ /* @__PURE__ */ n(E, { loading: r, size: t, icon: I, theme: h, badge: u }),
50
51
  /* @__PURE__ */ n(
51
- C,
52
+ x,
52
53
  {
53
- loading: o,
54
+ loading: r,
54
55
  title: v,
55
- description: u,
56
- highlightWords: S,
56
+ description: S,
57
+ highlightWords: _,
57
58
  size: t,
58
- badge: _,
59
- children: g
59
+ children: w
60
60
  }
61
61
  ),
62
- /* @__PURE__ */ c("span", { className: s.controls, children: [
63
- !o && d,
64
- e && /* @__PURE__ */ n("span", { className: s.linkIcon, children: /* @__PURE__ */ n(
65
- w,
62
+ /* @__PURE__ */ i("span", { className: m.controls, children: [
63
+ !r && k,
64
+ !r && B(),
65
+ s && /* @__PURE__ */ n("span", { className: m.linkIcon, children: /* @__PURE__ */ n(
66
+ N,
66
67
  {
67
- svgElement: e,
68
+ svgElement: s,
68
69
  style: {
69
70
  fontSize: "1.5rem"
70
71
  }
@@ -76,5 +77,5 @@ import '../../assets/MenuItem.css';const N = "_controls_w98qm_46", B = "_linkIco
76
77
  );
77
78
  };
78
79
  export {
79
- P as MenuItem
80
+ X as MenuItem
80
81
  };
@@ -1,81 +1,75 @@
1
- import { jsx as t, jsxs as p, Fragment as h } from "react/jsx-runtime";
2
- import { c as b } from "../../index-L8X2o7IH.js";
1
+ import { jsx as s, jsxs as g, Fragment as b } from "react/jsx-runtime";
2
+ import { c as d } from "../../index-L8X2o7IH.js";
3
3
  import { isValidElement as x } from "react";
4
- import { Heading as u } from "../Typography/Heading.js";
5
- import { Badge as _ } from "../Badge/Badge.js";
4
+ import { Heading as c } from "../Typography/Heading.js";
6
5
  import "../RootProvider/RootProvider.js";
7
- import { isHeadingProps as s } from "../List/ListItemLabel.js";
6
+ import { isHeadingProps as o } from "../List/ListItemLabel.js";
8
7
  import "../Snackbar/useSnackbar.js";
9
- import '../../assets/MenuItemLabel.css';const y = "_label_1gf5h_1", P = "_title_1gf5h_22", g = {
10
- label: y,
11
- title: P
8
+ import '../../assets/MenuItemLabel.css';const h = "_label_1gf5h_1", _ = "_title_1gf5h_22", p = {
9
+ label: h,
10
+ title: _
12
11
  };
13
- function d(r) {
12
+ function u(r) {
14
13
  return typeof r == "string" || typeof r == "number" || typeof r == "boolean" || r === null || x(r);
15
14
  }
16
- const w = (r) => {
15
+ const y = (r) => {
17
16
  const n = {
18
17
  as: "span"
19
18
  };
20
- return s(r) ? { ...n, ...r } : d(r) ? {
19
+ return o(r) ? { ...n, ...r } : u(r) ? {
21
20
  ...n,
22
21
  children: r
23
22
  } : null;
24
- }, N = (r) => {
23
+ }, P = (r) => {
25
24
  const n = {
26
25
  as: "span",
27
26
  weight: "normal",
28
27
  variant: "subtle"
29
28
  };
30
- return s(r) ? { ...n, ...r } : d(r) ? {
29
+ return o(r) ? { ...n, ...r } : u(r) ? {
31
30
  ...n,
32
31
  children: r
33
32
  } : null;
34
33
  };
35
- function D(r) {
34
+ function z(r) {
36
35
  if (typeof r == "string")
37
36
  return r;
38
- if (s(r))
37
+ if (o(r))
39
38
  return r.children;
40
39
  }
41
- const E = ({
40
+ const A = ({
42
41
  className: r,
43
42
  size: n = "sm",
44
- title: i,
45
- badge: l,
46
- description: a,
47
- highlightWords: m,
48
- loading: c,
43
+ title: a,
44
+ description: i,
45
+ highlightWords: l,
46
+ loading: m,
49
47
  children: f
50
48
  }) => {
51
- const e = i && w(i), o = a && N(a);
52
- return /* @__PURE__ */ t("span", { className: b(g.label, r), "data-size": n, children: f || /* @__PURE__ */ p(h, { children: [
53
- e && /* @__PURE__ */ p(
54
- u,
49
+ const t = a && y(a), e = i && P(i);
50
+ return /* @__PURE__ */ s("span", { className: d(p.label, r), "data-size": n, children: f || /* @__PURE__ */ g(b, { children: [
51
+ t && /* @__PURE__ */ s(
52
+ c,
55
53
  {
56
- ...e,
57
- loading: c,
58
- highlightWords: m,
59
- className: g.title,
60
- weight: e != null && e.weight || n === "lg" ? "medium" : "normal",
61
- children: [
62
- /* @__PURE__ */ t("span", { children: e.children }),
63
- l && /* @__PURE__ */ t(_, { ...l })
64
- ]
54
+ ...t,
55
+ loading: m,
56
+ highlightWords: l,
57
+ className: p.title,
58
+ weight: t != null && t.weight || n === "lg" ? "medium" : "normal"
65
59
  }
66
60
  ),
67
- o && /* @__PURE__ */ t(
68
- u,
61
+ e && /* @__PURE__ */ s(
62
+ c,
69
63
  {
70
- ...o,
71
- loading: c,
72
- highlightWords: m,
73
- size: o.size || n === "lg" ? "xs" : "xxs"
64
+ ...e,
65
+ loading: m,
66
+ highlightWords: l,
67
+ size: e.size || n === "lg" ? "xs" : "xxs"
74
68
  }
75
69
  )
76
70
  ] }) });
77
71
  };
78
72
  export {
79
- E as MenuItemLabel,
80
- D as getAriaLabelFromTitle
73
+ A as MenuItemLabel,
74
+ z as getAriaLabelFromTitle
81
75
  };
@@ -1,83 +1,83 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as d } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "react";
4
- import { Badge as p } from "../Badge/Badge.js";
5
4
  import "../RootProvider/RootProvider.js";
6
- import { MenuItem as u } from "./MenuItem.js";
5
+ import { MenuItem as _ } from "./MenuItem.js";
7
6
  import "../Snackbar/useSnackbar.js";
8
- import { S as x } from "../../Checkmark-Byz_C9x4.js";
9
- import '../../assets/MenuOption.css';const y = "_label_16xuy_1", k = "_title_16xuy_13", v = "_radio_16xuy_19", I = "_checkbox_16xuy_20", M = "_icon_16xuy_53", a = {
10
- label: y,
11
- title: k,
7
+ import { S as p } from "../../Checkmark-Byz_C9x4.js";
8
+ import '../../assets/MenuOption.css';const N = "_label_sfsij_1", j = "_title_sfsij_13", k = "_count_sfsij_20", v = "_radio_sfsij_25", I = "_checkbox_sfsij_26", M = "_icon_sfsij_59", a = {
9
+ label: N,
10
+ title: j,
11
+ count: k,
12
12
  radio: v,
13
13
  checkbox: I,
14
14
  icon: M
15
- }, F = ({
16
- size: o = "md",
17
- type: _,
18
- name: j,
19
- active: n,
20
- value: S,
21
- label: c,
22
- title: h,
15
+ }, C = ({
16
+ size: t = "md",
17
+ type: h,
18
+ name: S,
19
+ active: i,
20
+ value: g,
21
+ label: n,
22
+ title: u,
23
23
  description: b,
24
- icon: N,
25
- badge: s,
26
- checked: t = !1,
27
- disabled: r,
24
+ icon: f,
25
+ count: e = 0,
26
+ checked: c = !1,
27
+ disabled: o,
28
28
  onMouseEnter: w,
29
- onClick: i,
29
+ onClick: r,
30
30
  role: l,
31
31
  ...m
32
32
  }) => {
33
- const f = () => {
34
- switch (_) {
33
+ const x = () => {
34
+ switch (h) {
35
35
  case "checkbox":
36
36
  return /* @__PURE__ */ d("span", { className: a.label, children: [
37
- /* @__PURE__ */ e("span", { className: a.checkbox, "data-checked": t, children: /* @__PURE__ */ e(x, { className: a.icon, "aria-hidden": !0 }) }),
38
- /* @__PURE__ */ e("span", { className: a.title, children: c })
37
+ /* @__PURE__ */ s("span", { className: a.checkbox, "data-checked": c, children: /* @__PURE__ */ s(p, { className: a.icon, "aria-hidden": !0 }) }),
38
+ /* @__PURE__ */ s("span", { className: a.title, children: n }),
39
+ e > 0 && /* @__PURE__ */ s("span", { className: a.count, children: e })
39
40
  ] });
40
41
  case "radio":
41
42
  return /* @__PURE__ */ d("span", { className: a.label, children: [
42
- /* @__PURE__ */ e("span", { className: a.radio, "data-checked": t, children: /* @__PURE__ */ e(x, { className: a.icon, "aria-hidden": !0 }) }),
43
- /* @__PURE__ */ e("span", { className: a.title, children: c })
43
+ /* @__PURE__ */ s("span", { className: a.radio, "data-checked": c, children: /* @__PURE__ */ s(p, { className: a.icon, "aria-hidden": !0 }) }),
44
+ /* @__PURE__ */ s("span", { className: a.title, children: n }),
45
+ e > 0 && /* @__PURE__ */ s("span", { className: a.count, children: e })
44
46
  ] });
45
47
  }
46
48
  };
47
- return c ? /* @__PURE__ */ e(
48
- u,
49
+ return n ? /* @__PURE__ */ s(
50
+ _,
49
51
  {
50
- disabled: r,
51
- selected: t,
52
- size: o,
52
+ disabled: o,
53
+ selected: c,
54
+ size: t,
53
55
  as: "div",
54
- active: n,
56
+ active: i,
55
57
  tabIndex: -1,
56
- onClick: i,
58
+ onClick: r,
57
59
  role: l,
58
- label: /* @__PURE__ */ e(f, {}),
59
- controls: s && /* @__PURE__ */ e(p, { ...s }),
60
+ label: /* @__PURE__ */ s(x, {}),
60
61
  ...m
61
62
  }
62
- ) : /* @__PURE__ */ e(
63
- u,
63
+ ) : /* @__PURE__ */ s(
64
+ _,
64
65
  {
65
- disabled: r,
66
- selected: t,
67
- size: o,
66
+ disabled: o,
67
+ selected: c,
68
+ size: t,
68
69
  as: "div",
69
- active: n,
70
+ active: i,
70
71
  tabIndex: -1,
71
- onClick: i,
72
+ onClick: r,
72
73
  role: l,
73
- icon: N,
74
- title: h,
74
+ icon: f,
75
+ title: u,
75
76
  description: b,
76
- controls: s && /* @__PURE__ */ e(p, { ...s }),
77
77
  ...m
78
78
  }
79
79
  );
80
80
  };
81
81
  export {
82
- F as MenuOption
82
+ C as MenuOption
83
83
  };
@@ -1,54 +1,71 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as i } from "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
- import { useState as h } from "react";
3
+ import { useState as b } from "react";
4
4
  import "../RootProvider/RootProvider.js";
5
5
  import "../Snackbar/useSnackbar.js";
6
- import { Input as v } from "../Forms/Input.js";
7
- import { SettingsItemBase as i } from "./SettingsItemBase.js";
8
- import { SettingsModal as b } from "./SettingsModal.js";
9
- const B = ({
10
- loading: a,
11
- variant: c = "default",
12
- id: m = "settings",
13
- name: u,
14
- checked: f,
15
- onChange: d,
16
- children: g,
6
+ import { Input as x } from "../Forms/Input.js";
7
+ import { SettingsItemBase as n } from "./SettingsItemBase.js";
8
+ import { SettingsModal as I } from "./SettingsModal.js";
9
+ const M = ({
10
+ loading: u,
11
+ variant: f = "default",
12
+ id: c = "settings",
13
+ name: m,
14
+ checked: g,
15
+ onChange: h,
16
+ modalProps: e,
17
+ children: v,
17
18
  ...t
18
19
  }) => {
19
- const [n, l] = h(!1);
20
- if (a)
21
- return /* @__PURE__ */ e(i, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, loading: !0 });
22
- switch (c) {
20
+ const [l, a] = b(!1);
21
+ if (u)
22
+ return /* @__PURE__ */ i(n, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, loading: !0 });
23
+ switch (f) {
23
24
  case "switch":
24
- return /* @__PURE__ */ e(
25
- i,
25
+ return /* @__PURE__ */ i(
26
+ n,
26
27
  {
27
28
  ...t,
28
- title: [t == null ? void 0 : t.title, t == null ? void 0 : t.value].join(": "),
29
+ title: {
30
+ id: c,
31
+ as: "label",
32
+ children: [t == null ? void 0 : t.title, t == null ? void 0 : t.value].join(": ")
33
+ },
29
34
  value: void 0,
30
35
  interactive: !1,
31
- controls: /* @__PURE__ */ e(
32
- v,
36
+ controls: /* @__PURE__ */ i(
37
+ x,
33
38
  {
34
39
  type: "checkbox",
35
40
  role: "switch",
36
- "aria-labelledby": m,
37
- name: u,
41
+ "aria-labelledby": c,
42
+ name: m,
38
43
  value: t == null ? void 0 : t.value,
39
- checked: f,
40
- onChange: d,
44
+ checked: g,
45
+ onChange: h,
41
46
  style: { marginRight: "0.5em" }
42
47
  }
43
48
  )
44
49
  }
45
50
  );
46
51
  case "modal":
47
- return /* @__PURE__ */ e(i, { ...t, as: "button", linkIcon: !0, onClick: () => l(!0), expanded: n, children: n && /* @__PURE__ */ e(b, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, open: n, onClose: () => l(!1), children: g }) });
52
+ return /* @__PURE__ */ i(
53
+ n,
54
+ {
55
+ ...t,
56
+ title: (e == null ? void 0 : e.title) || (t == null ? void 0 : t.title),
57
+ description: e == null ? void 0 : e.description,
58
+ as: "button",
59
+ linkIcon: !0,
60
+ onClick: () => a(!0),
61
+ expanded: l,
62
+ children: l && /* @__PURE__ */ i(I, { icon: t == null ? void 0 : t.icon, title: t == null ? void 0 : t.title, open: l, onClose: () => a(!1), children: v })
63
+ }
64
+ );
48
65
  default:
49
- return /* @__PURE__ */ e(i, { ...t });
66
+ return /* @__PURE__ */ i(n, { ...t });
50
67
  }
51
68
  };
52
69
  export {
53
- B as SettingsItem
70
+ M as SettingsItem
54
71
  };
@@ -10,23 +10,23 @@ import { MenuHeader as w } from "../Menu/MenuHeader.js";
10
10
  import { MenuBase as z, MenuList as D, MenuListItem as m } from "../Menu/MenuBase.js";
11
11
  const G = ({
12
12
  name: k,
13
- search: s,
14
- optionGroups: a = {},
13
+ search: c,
14
+ optionGroups: s = {},
15
15
  options: I,
16
16
  onChange: n,
17
17
  optionType: L,
18
18
  keyboardEvents: p,
19
19
  onBlurCapture: T
20
20
  }) => {
21
- const c = K(null), { menu: j, setActiveIndex: B } = R({
21
+ const a = K(null), { menu: j, setActiveIndex: B } = R({
22
22
  items: I,
23
- groups: a,
23
+ groups: s,
24
24
  groupByKey: "groupId",
25
25
  keyboardEvents: p,
26
- ref: c
26
+ ref: a
27
27
  });
28
- return /* @__PURE__ */ v(z, { variant: "default", ref: c, children: [
29
- s && /* @__PURE__ */ e(q, { ...s }),
28
+ return /* @__PURE__ */ v(z, { variant: "default", ref: a, children: [
29
+ c && /* @__PURE__ */ e(q, { ...c }),
30
30
  /* @__PURE__ */ e(D, { role: "menu", onBlurCapture: T, children: j.map((t, l) => {
31
31
  const O = (t == null ? void 0 : t.props) || {}, { title: d, divider: P = !0 } = O;
32
32
  return /* @__PURE__ */ v(N, { children: [
@@ -37,7 +37,7 @@ const G = ({
37
37
  return !((i = o.props) != null && i.hidden);
38
38
  }).map((o, i) => {
39
39
  var h;
40
- const { active: A, onMouseEnter: F } = o, { groupId: u, onClick: E, value: f, checked: M, type: b, ...r } = o.props || {}, { expanded: H } = r, x = r.name || k, y = b || u && ((h = a[u]) == null ? void 0 : h.optionType) || L;
40
+ const { active: A, onMouseEnter: F } = o, { groupId: u, onClick: E, value: f, checked: M, type: b, ...r } = o.props || {}, { expanded: H } = r, x = r.name || k, y = b || u && ((h = s[u]) == null ? void 0 : h.optionType) || L;
41
41
  return /* @__PURE__ */ e(
42
42
  m,
43
43
  {
@@ -53,7 +53,7 @@ const G = ({
53
53
  active: A,
54
54
  tabIndex: p ? -1 : 0,
55
55
  label: r.label,
56
- badge: r.badge,
56
+ count: r.count,
57
57
  name: x,
58
58
  type: y,
59
59
  value: f,
@@ -1,43 +1,45 @@
1
1
  "use client";
2
2
  import { jsx as a } from "react/jsx-runtime";
3
- import { c as x } from "../../index-L8X2o7IH.js";
3
+ import { c as f } from "../../index-L8X2o7IH.js";
4
4
  import "react";
5
- import { Skeleton as f } from "../Skeleton/Skeleton.js";
6
- import { useHighlightedText as u } from "./useHighlightedText.js";
5
+ import { Skeleton as u } from "../Skeleton/Skeleton.js";
6
+ import { useHighlightedText as H } from "./useHighlightedText.js";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  import "../Snackbar/useSnackbar.js";
9
- import '../../assets/Heading.css';const H = "_heading_1dyne_1", _ = {
10
- heading: H
11
- }, T = ({
12
- loading: e,
13
- highlightWords: i = [],
14
- as: o = "h2",
9
+ import '../../assets/Heading.css';const _ = "_heading_1dyne_1", w = {
10
+ heading: _
11
+ }, b = ({
12
+ id: e,
13
+ loading: i,
14
+ highlightWords: o = [],
15
+ as: n = "h2",
15
16
  size: t,
16
- leading: n = "tight",
17
- weight: r = "medium",
18
- color: d,
19
- variant: m,
20
- maxRows: s,
21
- className: c,
22
- style: h,
23
- children: g
17
+ leading: r = "tight",
18
+ weight: d = "medium",
19
+ color: m,
20
+ variant: s,
21
+ maxRows: c,
22
+ className: h,
23
+ style: g,
24
+ children: l
24
25
  }) => {
25
- const l = o, p = u(g, i || []);
26
+ const p = n, x = H(l, o || []);
26
27
  return /* @__PURE__ */ a(
27
- l,
28
+ p,
28
29
  {
29
- className: x(_.heading, c),
30
- style: h,
30
+ id: e,
31
+ className: f(w.heading, h),
32
+ style: g,
31
33
  "data-size": t,
32
- "data-leading": n,
33
- "data-weight": r,
34
- "data-color": d,
35
- "data-variant": t === "xxs" && "default" || m,
36
- "data-max-rows": s,
37
- children: /* @__PURE__ */ a(f, { loading: e, children: p })
34
+ "data-leading": r,
35
+ "data-weight": d,
36
+ "data-color": m,
37
+ "data-variant": t === "xxs" && "default" || s,
38
+ "data-max-rows": c,
39
+ children: /* @__PURE__ */ a(u, { loading: i, children: x })
38
40
  }
39
41
  );
40
42
  };
41
43
  export {
42
- T as Heading
44
+ b as Heading
43
45
  };
@@ -15,7 +15,7 @@ export interface MenuItemProps extends MenuItemBaseProps {
15
15
  icon?: MenuItemIconProps['icon'];
16
16
  iconTheme?: MenuItemIconProps['theme'];
17
17
  iconBadge?: MenuItemIconProps['badge'];
18
- badge?: BadgeProps | undefined;
18
+ badge?: BadgeProps | ReactNode | undefined;
19
19
  /** Custom controls */
20
20
  controls?: ReactNode;
21
21
  linkIcon?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { BadgeProps, HeadingProps } from '..';
2
+ import { HeadingProps } from '..';
3
3
  import { MenuItemSize } from './MenuItemBase';
4
4
  export interface MenuItemLabelProps {
5
5
  className?: string;
@@ -9,8 +9,7 @@ export interface MenuItemLabelProps {
9
9
  highlightWords?: string[];
10
10
  title?: HeadingProps | ReactNode | string;
11
11
  description?: HeadingProps | ReactNode | string;
12
- badge?: BadgeProps;
13
12
  children?: ReactNode;
14
13
  }
15
14
  export declare function getAriaLabelFromTitle(title: HeadingProps | ReactNode | string): string | undefined;
16
- export declare const MenuItemLabel: ({ className, size, title, badge, description, highlightWords, loading, children, }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const MenuItemLabel: ({ className, size, title, description, highlightWords, loading, children, }: MenuItemLabelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { BadgeProps, MenuItemProps } from '..';
1
+ import { MenuItemProps } from '..';
2
2
  import { MenuItemBaseProps, MenuItemSize } from './MenuItemBase';
3
3
  export type MenuOptionType = 'checkbox' | 'radio';
4
4
  export interface MenuOptionProps extends MenuItemBaseProps {
@@ -10,11 +10,11 @@ export interface MenuOptionProps extends MenuItemBaseProps {
10
10
  groupId?: string;
11
11
  size?: MenuItemSize;
12
12
  name?: string;
13
- badge?: BadgeProps | undefined;
13
+ count?: number;
14
14
  checked?: boolean;
15
15
  disabled?: boolean;
16
16
  type?: MenuOptionType;
17
17
  hidden?: boolean;
18
18
  role?: string;
19
19
  }
20
- export declare const MenuOption: ({ size, type, name, active, value, label, title, description, icon, badge, checked, disabled, onMouseEnter, onClick, role, ...rest }: MenuOptionProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const MenuOption: ({ size, type, name, active, value, label, title, description, icon, count, checked, disabled, onMouseEnter, onClick, role, ...rest }: MenuOptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,10 @@
1
1
  import { InputProps, SettingsItemBaseProps } from '..';
2
2
  import { ReactNode } from 'react';
3
3
  export type SettingsItemVariant = 'default' | 'modal' | 'switch';
4
+ export interface SettingsItemModalProps {
5
+ title?: string;
6
+ description?: string;
7
+ }
4
8
  export interface SettingsItemProps extends SettingsItemBaseProps {
5
9
  variant?: SettingsItemVariant;
6
10
  id: string;
@@ -10,6 +14,7 @@ export interface SettingsItemProps extends SettingsItemBaseProps {
10
14
  name?: InputProps['name'];
11
15
  checked?: InputProps['checked'];
12
16
  onChange?: InputProps['onChange'];
17
+ modalProps?: SettingsItemModalProps;
13
18
  children?: ReactNode;
14
19
  }
15
- export declare const SettingsItem: ({ loading, variant, id, name, checked, onChange, children, ...props }: SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const SettingsItem: ({ loading, variant, id, name, checked, onChange, modalProps, children, ...props }: SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ loading, variant, id, name, checked, onChange, children, ...props }: import('./SettingsItem').SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: ({ loading, variant, id, name, checked, onChange, modalProps, children, ...props }: import('./SettingsItem').SettingsItemProps) => import("react/jsx-runtime").JSX.Element;
5
5
  tags: string[];
6
6
  parameters: {};
7
7
  args: {
@@ -19,6 +19,7 @@ declare const meta: {
19
19
  name?: string | undefined;
20
20
  checked?: boolean | undefined;
21
21
  onChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
22
+ modalProps?: import('./SettingsItem').SettingsItemModalProps | undefined;
22
23
  children?: React.ReactNode;
23
24
  groupId?: string | undefined;
24
25
  collapsible?: boolean | undefined;
@@ -28,9 +28,17 @@ export interface AccountAlertsModalProps extends SettingsModalProps {
28
28
  emailLabel?: string;
29
29
  smsAlerts?: boolean;
30
30
  emailAlerts?: boolean;
31
+ readOnly?: boolean;
31
32
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
32
33
  }
33
- export declare const AccountAlertsModal: ({ open, onClose, icon, title, description, phone, phoneLabel, email, emailLabel, smsAlerts, emailAlerts, onChange, }: AccountAlertsModalProps) => import("react/jsx-runtime").JSX.Element;
34
+ export declare const AccountAlertsModal: ({ open, onClose, icon, title, description, phone, phoneLabel, email, emailLabel, smsAlerts, emailAlerts, readOnly, onChange, }: AccountAlertsModalProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const UserAccountAlertsModal: ({ open, onClose, phone, email, ...props }: {
36
+ [x: string]: any;
37
+ open?: boolean | undefined;
38
+ onClose?: (() => void) | undefined;
39
+ phone?: string | undefined;
40
+ email?: string | undefined;
41
+ }) => import("react/jsx-runtime").JSX.Element;
34
42
  interface AccountGroupsModalProps extends SettingsModalProps {
35
43
  items?: AccountListItemProps[];
36
44
  }
@@ -9,9 +9,7 @@ declare const meta: {
9
9
  options: {
10
10
  label: string;
11
11
  value: string;
12
- badge: {
13
- label: string;
14
- };
12
+ count: number;
15
13
  }[];
16
14
  };
17
15
  };
@@ -3,8 +3,9 @@ import { TypographyProps } from '..';
3
3
  export type HeadingSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'inherit';
4
4
  export type HeadingWeight = 'normal' | 'medium' | 'bold';
5
5
  export type HeadingLeading = 'none' | 'tight' | 'normal';
6
- export type HeadingComponent = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
6
+ export type HeadingComponent = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span' | 'label';
7
7
  export interface HeadingProps {
8
+ id?: string;
8
9
  loading?: boolean;
9
10
  highlightWords?: string[];
10
11
  as?: HeadingComponent;
@@ -18,4 +19,4 @@ export interface HeadingProps {
18
19
  style?: CSSProperties;
19
20
  children?: ReactNode;
20
21
  }
21
- export declare const Heading: ({ loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const Heading: ({ id, loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: import('./Heading').HeadingProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: ({ id, loading, highlightWords, as, size, leading, weight, color, variant, maxRows, className, style, children, }: import('./Heading').HeadingProps) => import("react/jsx-runtime").JSX.Element;
5
5
  tags: string[];
6
6
  parameters: {};
7
7
  args: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altinn/altinn-components",
3
- "version": "0.41.4",
3
+ "version": "0.41.5",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/",