@altinn/altinn-components 0.24.1 → 0.24.4

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.
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import * as i from "react";
3
+ import { forwardRef as a } from "react";
4
+ import { u as f } from "./useId-CsCRkvK3.js";
5
+ var d = function(t, n) {
6
+ var r = {};
7
+ for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]);
8
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
9
+ for (var l = 0, e = Object.getOwnPropertySymbols(t); l < e.length; l++)
10
+ n.indexOf(e[l]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[l]) && (r[e[l]] = t[e[l]]);
11
+ return r;
12
+ };
13
+ const p = a((t, n) => {
14
+ var { title: r, titleId: e } = t, l = d(t, ["title", "titleId"]);
15
+ let o = f();
16
+ return o = r ? e || "title-" + o : void 0, i.createElement(
17
+ "svg",
18
+ 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 }, l),
19
+ r ? i.createElement("title", { id: o }, r) : null,
20
+ i.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M18.998 6.94a.75.75 0 0 1 .063 1.058l-8 9a.75.75 0 0 1-1.091.032l-5-5a.75.75 0 1 1 1.06-1.06l4.438 4.437 7.471-8.405A.75.75 0 0 1 19 6.939", clipRule: "evenodd" })
21
+ );
22
+ });
23
+ export {
24
+ p as S
25
+ };
@@ -36,4 +36,9 @@
36
36
  --ds-color-accent-text-default: var(--ds-color-company-text-default);
37
37
  --ds-color-accent-contrast-default: var(--ds-color-company-contrast-default);
38
38
  --ds-color-accent-contrast-subtle: var(--ds-color-company-contrast-subtle);
39
+
40
+ /* Override tokens from designSystem & altinn-components */
41
+ --ds-color-neutral-surface-default: #fff;
42
+ --ds-body-md-font-size: 1rem;
43
+ --ds-color-text-subtle: #10204a;
39
44
  }
@@ -1 +1 @@
1
- ._menu_njba2_1{list-style:none;padding:0;margin:0;text-indent:0;display:flex;flex-direction:column;width:100%}._list_njba2_13,._item_njba2_19{list-style:none;padding:0;margin:0}._item_njba2_19[role=separator]{border-top:1px solid var(--ds-color-border-subtle)}
1
+ ._menu_twp4i_1{list-style:none;padding:0;margin:0;text-indent:0;display:flex;flex-direction:column;width:100%}._list_twp4i_12,._item_twp4i_18{list-style:none;padding:0;margin:0}._item_twp4i_18[role=separator]{border-top:1px solid var(--ds-color-border-subtle)}
@@ -1 +1 @@
1
- ._virtualScrollRef_1kwwy_1{max-height:400px;overflow:auto}._virtualMenuListItem_1kwwy_6{position:absolute;top:0;left:0;width:100%}
1
+ ._virtualScrollRef_12fdc_1{max-height:400px;overflow:auto}._virtualMenuListItem_12fdc_6{position:absolute;top:0;left:0;width:100%}._virtualMenuListItem_12fdc_6>*{margin:0}
@@ -1,41 +1,22 @@
1
- "use client";
2
- import { jsxs as a, jsx as l } from "react/jsx-runtime";
1
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
3
2
  import "../../index-L8X2o7IH.js";
4
- import * as m from "react";
5
- import { forwardRef as f } from "react";
6
- import { Button as p } from "../Button/Button.js";
3
+ import "react";
4
+ import { Button as e } from "../Button/Button.js";
7
5
  import "../RootProvider/RootProvider.js";
8
- import { ListBase as c } from "../List/ListBase.js";
9
- import { Heading as d } from "../Typography/Heading.js";
6
+ import { ListBase as n } from "../List/ListBase.js";
7
+ import { Heading as p } from "../Typography/Heading.js";
10
8
  import "../Search/AutocompleteBase.js";
11
9
  import "../Snackbar/useSnackbar.js";
12
10
  import { Flex as s } from "../Page/Flex.js";
13
- import { Section as u } from "../Page/Section.js";
14
- import { u as g } from "../../useId-CsCRkvK3.js";
15
- var v = function(e, i) {
16
- var r = {};
17
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && i.indexOf(t) < 0 && (r[t] = e[t]);
18
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
19
- for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
20
- i.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (r[t[o]] = e[t[o]]);
21
- return r;
22
- };
23
- const w = f((e, i) => {
24
- var { title: r, titleId: t } = e, o = v(e, ["title", "titleId"]);
25
- let n = g();
26
- return n = r ? t || "title-" + n : void 0, m.createElement(
27
- "svg",
28
- 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: i, "aria-labelledby": n }, o),
29
- r ? m.createElement("title", { id: n }, r) : null,
30
- m.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M18.998 6.94a.75.75 0 0 1 .063 1.058l-8 9a.75.75 0 0 1-1.091.032l-5-5a.75.75 0 1 1 1.06-1.06l4.438 4.437 7.471-8.405A.75.75 0 0 1 19 6.939", clipRule: "evenodd" })
31
- );
32
- }), P = ({ title: e, children: i, checkAllLabel: r }) => /* @__PURE__ */ a(u, { spacing: 3, children: [
33
- e && /* @__PURE__ */ a(s, { direction: "row", align: "center", justify: "between", children: [
34
- /* @__PURE__ */ l(d, { size: "lg", children: e }),
35
- r && /* @__PURE__ */ l(p, { variant: "text", icon: w, size: "sm", children: r })
11
+ import { Section as c } from "../Page/Section.js";
12
+ import { S as a } from "../../Checkmark-RgzvRNxP.js";
13
+ const B = ({ title: i, children: m, checkAllLabel: o }) => /* @__PURE__ */ t(c, { spacing: 3, children: [
14
+ i && /* @__PURE__ */ t(s, { direction: "row", align: "center", justify: "between", children: [
15
+ /* @__PURE__ */ r(p, { size: "lg", children: i }),
16
+ o && /* @__PURE__ */ r(e, { variant: "text", icon: a, size: "sm", children: o })
36
17
  ] }),
37
- /* @__PURE__ */ l(c, { spacing: 3, children: i })
18
+ /* @__PURE__ */ r(n, { spacing: 3, children: m })
38
19
  ] });
39
20
  export {
40
- P as DialogListGroup
21
+ B as DialogListGroup
41
22
  };
@@ -0,0 +1,23 @@
1
+ import { A as D, B as e, a as o, C as i, b as n, c as t, D as r, d as g, H as b, L as d, e as h, f as p, P, g as l, h as C, S as L, i as S, j as c, T as k, u as m } from "../../usePagination-CBMPUKt_.js";
2
+ export {
3
+ D as DsAlert,
4
+ e as DsBadge,
5
+ o as DsButton,
6
+ i as DsCheckbox,
7
+ n as DsChip,
8
+ t as DsCombobox,
9
+ r as DsDetails,
10
+ g as DsDialog,
11
+ b as DsHeading,
12
+ d as DsLink,
13
+ h as DsListItem,
14
+ p as DsListUnordered,
15
+ P as DsPagination,
16
+ l as DsParagraph,
17
+ C as DsPopover,
18
+ L as DsSearch,
19
+ S as DsSkeleton,
20
+ c as DsSpinner,
21
+ k as DsTabs,
22
+ m as useDsPagination
23
+ };
@@ -1,18 +1,18 @@
1
1
  "use client";
2
- import { jsx as y } from "react/jsx-runtime";
2
+ import { jsx as v } from "react/jsx-runtime";
3
3
  import { useState as L } from "react";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../RootProvider/RootProvider.js";
6
6
  import "../Search/AutocompleteBase.js";
7
7
  import "../Snackbar/useSnackbar.js";
8
8
  import { Menu as M } from "../Menu/Menu.js";
9
- const a = (d) => `${d} hits`, R = ({
9
+ const w = (d) => `${d} hits`, k = ({
10
10
  accounts: d = [],
11
- accountGroups: C = {},
11
+ accountGroups: y = {},
12
12
  accountSearch: s,
13
13
  onSelectAccount: m,
14
14
  currentAccount: p,
15
- isVirtualized: I
15
+ isVirtualized: C
16
16
  }) => {
17
17
  var f;
18
18
  const t = d.map((e) => ({
@@ -20,16 +20,16 @@ const a = (d) => `${d} hits`, R = ({
20
20
  groupId: e.groupId || "search",
21
21
  selected: e.selected ?? (p == null ? void 0 : p.id) === e.id,
22
22
  title: e.name,
23
- ...(e == null ? void 0 : e.accountNames) && {
23
+ ...(e == null ? void 0 : e.items) && {
24
24
  avatarGroup: {
25
25
  size: "sm",
26
- items: e.accountNames.map((r) => ({
27
- name: r,
28
- type: e.type
26
+ items: e.items.map((i) => ({
27
+ name: i.name,
28
+ type: i.type || e.type
29
29
  }))
30
30
  }
31
31
  },
32
- ...!(e != null && e.accountNames) && {
32
+ ...!(e != null && e.items) && {
33
33
  avatar: {
34
34
  size: "md",
35
35
  type: e.type,
@@ -39,36 +39,36 @@ const a = (d) => `${d} hits`, R = ({
39
39
  badge: e.badge,
40
40
  alertBadge: e.alertBadge,
41
41
  onClick: () => m == null ? void 0 : m(e.id || e.name)
42
- })), [i, g] = L(""), l = i ? t.filter((e) => {
43
- var r;
44
- return (r = e == null ? void 0 : e.title) == null ? void 0 : r.toLowerCase().includes(i.toLowerCase());
42
+ })), [l, g] = L(""), r = l ? t.filter((e) => {
43
+ var i;
44
+ return (i = e == null ? void 0 : e.title) == null ? void 0 : i.toLowerCase().includes(l.toLowerCase());
45
45
  }).map((e) => ({
46
46
  ...e,
47
47
  groupId: "search"
48
- })) : t, b = i ? {
48
+ })) : t, I = l ? {
49
49
  search: {
50
- title: ((f = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : f.call(s, l.length)) ?? a(l.length)
50
+ title: ((f = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : f.call(s, r.length)) ?? w(r.length)
51
51
  }
52
- } : C, h = {
52
+ } : y, b = {
53
53
  name: "account-search",
54
- value: i,
54
+ value: l,
55
55
  placeholder: (s == null ? void 0 : s.placeholder) ?? "Find account",
56
56
  onChange: (e) => g(e.target.value),
57
57
  onClear: () => g("")
58
- }, v = [
59
- ...l.length > 0 ? l : [{ id: "search", groupId: "search", hidden: !0 }]
58
+ }, h = [
59
+ ...r.length > 0 ? r : [{ id: "search", groupId: "search", hidden: !0 }]
60
60
  ];
61
- return /* @__PURE__ */ y(
61
+ return /* @__PURE__ */ v(
62
62
  M,
63
63
  {
64
64
  theme: "default",
65
- search: s && h,
66
- groups: b,
67
- items: v,
68
- isVirtualized: I
65
+ search: s && b,
66
+ groups: I,
67
+ items: h,
68
+ isVirtualized: C
69
69
  }
70
70
  );
71
71
  };
72
72
  export {
73
- R as AccountMenu
73
+ k as AccountMenu
74
74
  };
@@ -1,75 +1,76 @@
1
- import { jsxs as q, jsx as v } from "react/jsx-runtime";
2
- import { ListItemBase as w } from "./ListItemBase.js";
3
- import { ListItemHeader as z } from "./ListItemHeader.js";
4
- const E = ({
5
- className: f,
6
- variant: e = "solid",
1
+ import { jsxs as q, jsx as w } from "react/jsx-runtime";
2
+ import { ListItemBase as z } from "./ListItemBase.js";
3
+ import { ListItemHeader as A } from "./ListItemHeader.js";
4
+ const F = ({
5
+ className: p,
6
+ variant: c = "solid",
7
7
  color: r,
8
- theme: i = "default",
9
- shadow: c = "xs",
10
- loading: m,
8
+ theme: m = "default",
9
+ shadow: e = "xs",
10
+ loading: o,
11
11
  collapsible: n,
12
12
  expanded: s,
13
- size: p = "sm",
14
- icon: u,
15
- avatar: L,
16
- avatarGroup: l,
17
- title: o,
18
- titleAs: I,
19
- description: a,
20
- badge: j,
21
- linkIcon: x = !1,
13
+ size: u = "sm",
14
+ icon: L,
15
+ avatar: l,
16
+ avatarGroup: I,
17
+ title: f,
18
+ titleAs: j,
19
+ description: x,
20
+ badge: a,
21
+ linkIcon: h = !1,
22
22
  label: t,
23
- select: h,
24
- selected: y,
25
- controls: B,
26
- children: H,
27
- interactive: b,
23
+ select: y,
24
+ selected: B,
25
+ controls: H,
26
+ children: b,
27
+ interactive: i,
28
28
  ...d
29
29
  }) => {
30
30
  const k = typeof t == "function" ? t() : t;
31
31
  return /* @__PURE__ */ q(
32
- w,
32
+ z,
33
33
  {
34
- variant: e,
34
+ variant: c,
35
35
  color: r,
36
- theme: i,
37
- shadow: c,
38
- selected: y,
36
+ theme: m,
37
+ shadow: e,
38
+ selected: B,
39
39
  expanded: s,
40
- title: o,
41
- loading: m,
42
- interactive: b,
40
+ title: f,
41
+ loading: o,
42
+ interactive: i,
43
43
  children: [
44
- /* @__PURE__ */ v(
45
- z,
44
+ /* @__PURE__ */ w(
45
+ A,
46
46
  {
47
- className: f,
47
+ className: p,
48
48
  color: r,
49
- theme: i,
50
- loading: m,
51
- linkIcon: x,
49
+ theme: m,
50
+ loading: o,
51
+ linkIcon: h,
52
52
  collapsible: n,
53
53
  expanded: s,
54
- select: h,
55
- size: p,
56
- title: o,
57
- description: a,
58
- icon: u,
59
- avatar: L,
60
- avatarGroup: l,
61
- badge: j,
62
- controls: B,
63
- titleAs: I,
54
+ select: y,
55
+ size: u,
56
+ title: f,
57
+ description: x,
58
+ icon: L,
59
+ avatar: l,
60
+ avatarGroup: I,
61
+ badge: a,
62
+ controls: H,
63
+ titleAs: j,
64
+ interactive: i,
64
65
  ...d,
65
66
  children: k
66
67
  }
67
68
  ),
68
- s ? H : null
69
+ s ? b : null
69
70
  ]
70
71
  }
71
72
  );
72
73
  };
73
74
  export {
74
- E as ListItem
75
+ F as ListItem
75
76
  };
@@ -1,19 +1,19 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { c as a } from "../../index-L8X2o7IH.js";
3
- import '../../assets/MenuBase.css';const r = "_menu_njba2_1", u = "_list_njba2_13", l = "_item_njba2_19", c = {
4
- menu: r,
5
- list: u,
6
- item: l
7
- }, d = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ m(t, { className: a(c.menu, o), "data-color": n, "data-theme": e, children: s }), j = ({ as: t = "ul", role: n = "group", className: e, children: o }) => /* @__PURE__ */ m(t, { className: a(c.list, e), role: n, children: o }), x = ({
2
+ import { c as i } from "../../index-L8X2o7IH.js";
3
+ import '../../assets/MenuBase.css';const p = "_menu_twp4i_1", r = "_list_twp4i_12", u = "_item_twp4i_18", a = {
4
+ menu: p,
5
+ list: r,
6
+ item: u
7
+ }, d = ({ as: t = "nav", color: n, theme: e, className: o, children: s }) => /* @__PURE__ */ m(t, { className: i(a.menu, o), "data-color": n, "data-theme": e, children: s }), x = ({ as: t = "ul", role: n = "group", className: e, children: o }) => /* @__PURE__ */ m(t, { className: i(a.list, e), role: n, children: o }), w = ({
8
8
  as: t = "li",
9
9
  role: n = "presentation",
10
10
  className: e,
11
11
  children: o,
12
12
  style: s,
13
- dataIndex: i
14
- }) => /* @__PURE__ */ m(t, { className: a(c.item, e), role: n, style: s, "data-index": i, children: o });
13
+ dataIndex: c
14
+ }) => /* @__PURE__ */ m(t, { className: i(a.item, e), role: n, style: s, "data-index": c, children: o });
15
15
  export {
16
16
  d as MenuBase,
17
- j as MenuList,
18
- x as MenuListItem
17
+ x as MenuList,
18
+ w as MenuListItem
19
19
  };