@altinn/altinn-components 0.53.0 → 0.53.1

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
- ._accountSelector_1f74n_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_1f74n_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_1f74n_17{width:100%;padding:0 var(--horizontal-padding)}._searchField_1f74n_22{width:50%}._accountMenu_1f74n_26{height:40vh;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_1f74n_26._fullScreen_1f74n_34{height:fit-content}._accountMenu_1f74n_26._virtualized_1f74n_38{overflow-y:hidden}._btnIcon_1f74n_42{font-size:1.5rem}._spinner_1f74n_46{margin:auto;width:100%;overflow:hidden}@media(max-width:1023px){._accountSelector_1f74n_1{--horizontal-padding: .1rem}._searchField_1f74n_22{width:100%}}
1
+ ._accountSelector_qwjt5_1{display:flex;flex-direction:column;align-items:center;padding:1rem 0;max-width:1000px;margin:0 auto;--horizontal-padding: .7rem}._heading_qwjt5_11{margin-bottom:1rem;width:100%;padding:.3rem var(--horizontal-padding)}._searchSection_qwjt5_17{width:100%;padding:0 var(--horizontal-padding);display:flex;align-items:center;gap:1rem}._searchField_qwjt5_25{width:50%}._accountMenu_qwjt5_29{height:40vh;width:100%;overflow-y:auto;margin-bottom:1rem;padding:0 var(--horizontal-padding)}._accountMenu_qwjt5_29._fullScreen_qwjt5_37{height:fit-content}._accountMenu_qwjt5_29._virtualized_qwjt5_41{overflow-y:hidden}._btnIcon_qwjt5_45{font-size:1.5rem}._spinner_qwjt5_49{margin:auto;width:100%;overflow:hidden}@media(max-width:1023px){._accountSelector_qwjt5_1{--horizontal-padding: .1rem}._searchField_qwjt5_25{width:100%}._searchSection_qwjt5_17{flex-direction:column;align-items:stretch;gap:.5rem}}
@@ -1,33 +1,33 @@
1
1
  import { A as o } from "../../alert-BzifOfXl.js";
2
- import { B as D, C as r, a as t, b as i, D as n, L as p, c as x, d as f, P as m, e as g, f as d, S, g as l, T as P, u as b } from "../../textfield-C_c2H05R.js";
3
- import { B as c, S as B } from "../../button-BB5sYVKY.js";
4
- import { D as L } from "../../index-Q0EA2XB0.js";
5
- import { H as u } from "../../heading-C_XYsUfi.js";
2
+ import { B as D, C as r, a as t, b as i, D as n, L as p, c as x, d as f, P as m, e as S, S as d, f as g, T as l, u as P } from "../../textfield-DAuYWtUj.js";
3
+ import { B as h, S as c } from "../../button-BB5sYVKY.js";
4
+ import { H as C, S as L } from "../../switch-Cemfhx0H.js";
5
+ import { D as u } from "../../index-Q0EA2XB0.js";
6
6
  import { P as A } from "../../paragraph-BRiIBpbY.js";
7
7
  import { S as V } from "../../index-DttADHE1.js";
8
8
  import { V as w } from "../../index-z82sbSVU.js";
9
9
  export {
10
10
  o as DsAlert,
11
11
  D as DsBadge,
12
- c as DsButton,
12
+ h as DsButton,
13
13
  r as DsCheckbox,
14
14
  t as DsChip,
15
15
  i as DsCombobox,
16
- L as DsDetails,
16
+ u as DsDetails,
17
17
  n as DsDialog,
18
- u as DsHeading,
18
+ C as DsHeading,
19
19
  p as DsLink,
20
20
  x as DsListItem,
21
21
  f as DsListUnordered,
22
22
  m as DsPagination,
23
23
  A as DsParagraph,
24
- g as DsPopover,
24
+ S as DsPopover,
25
25
  V as DsSearch,
26
26
  d as DsSkeleton,
27
- B as DsSpinner,
28
- S as DsSwitch,
29
- l as DsTabs,
30
- P as DsTextfield,
27
+ c as DsSpinner,
28
+ L as DsSwitch,
29
+ g as DsTabs,
30
+ l as DsTextfield,
31
31
  w as DsValidationMessage,
32
- b as useDsPagination
32
+ P as useDsPagination
33
33
  };
@@ -1,149 +1,169 @@
1
1
  "use client";
2
- import { jsx as a, jsxs as k } from "react/jsx-runtime";
3
- import { c as _ } from "../../index-p1eeF8LQ.js";
4
- import s, { forwardRef as y, useState as b, useEffect as w } from "react";
5
- import { useIsDesktop as C } from "../../hooks/useIsDesktop.js";
6
- import { AccountMenu as F } from "../Account/AccountMenu.js";
7
- import { Button as M } from "../Button/Button.js";
8
- import { useRootContext as N } from "../RootProvider/RootProvider.js";
2
+ import { jsx as o, jsxs as b } from "react/jsx-runtime";
3
+ import { c as y } from "../../index-p1eeF8LQ.js";
4
+ import u, { forwardRef as I, useState as j, useEffect as x } from "react";
5
+ import { useIsDesktop as N } from "../../hooks/useIsDesktop.js";
6
+ import { AccountMenu as q } from "../Account/AccountMenu.js";
7
+ import { Button as R } from "../Button/Button.js";
8
+ import { useRootContext as L } from "../RootProvider/RootProvider.js";
9
9
  import "../Snackbar/useSnackbar.js";
10
- import { SearchField as R } from "../Forms/SearchField.js";
11
- import { S as A } from "../../button-BB5sYVKY.js";
12
- import { H as P } from "../../heading-C_XYsUfi.js";
13
- import { u as x } from "../../useId-BVFxCjkq.js";
14
- import '../../assets/AccountSelector.css';var H = function(e, l) {
15
- var r = {};
16
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (r[t] = e[t]);
10
+ import { SearchField as A } from "../Forms/SearchField.js";
11
+ import { S as P } from "../../button-BB5sYVKY.js";
12
+ import { H as V, S as H } from "../../switch-Cemfhx0H.js";
13
+ import { u as O } from "../../useId-BVFxCjkq.js";
14
+ import '../../assets/AccountSelector.css';var T = function(e, l) {
15
+ var n = {};
16
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (n[t] = e[t]);
17
17
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
18
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
19
- l.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
20
- return r;
18
+ for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
19
+ l.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
20
+ return n;
21
21
  };
22
- const T = y((e, l) => {
23
- var { title: r, titleId: t } = e, n = H(e, ["title", "titleId"]);
24
- let i = x();
25
- return i = r ? t || "title-" + i : void 0, s.createElement(
22
+ const B = I((e, l) => {
23
+ var { title: n, titleId: t } = e, r = T(e, ["title", "titleId"]);
24
+ let i = O();
25
+ return i = n ? t || "title-" + i : void 0, u.createElement(
26
26
  "svg",
27
- 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: l, "aria-labelledby": i }, n),
28
- r ? s.createElement("title", { id: i }, r) : null,
29
- s.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m4.03 9.28-3.5 3.5a.75.75 0 0 1-1.06 0l-3.5-3.5a.75.75 0 0 1 .53-1.28h7a.75.75 0 0 1 .53 1.28m-2.34.22h-3.38L12 13.44z", clipRule: "evenodd" })
27
+ 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: l, "aria-labelledby": i }, r),
28
+ n ? u.createElement("title", { id: i }, n) : null,
29
+ u.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m4.03 9.28-3.5 3.5a.75.75 0 0 1-1.06 0l-3.5-3.5a.75.75 0 0 1 .53-1.28h7a.75.75 0 0 1 .53 1.28m-2.34.22h-3.38L12 13.44z", clipRule: "evenodd" })
30
30
  );
31
31
  });
32
- var V = function(e, l) {
33
- var r = {};
34
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (r[t] = e[t]);
32
+ var $ = function(e, l) {
33
+ var n = {};
34
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && l.indexOf(t) < 0 && (n[t] = e[t]);
35
35
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
36
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
37
- l.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
38
- return r;
36
+ for (var r = 0, t = Object.getOwnPropertySymbols(e); r < t.length; r++)
37
+ l.indexOf(t[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[r]) && (n[t[r]] = e[t[r]]);
38
+ return n;
39
39
  };
40
- const B = y((e, l) => {
41
- var { title: r, titleId: t } = e, n = V(e, ["title", "titleId"]);
42
- let i = x();
43
- return i = r ? t || "title-" + i : void 0, s.createElement(
40
+ const D = I((e, l) => {
41
+ var { title: n, titleId: t } = e, r = $(e, ["title", "titleId"]);
42
+ let i = O();
43
+ return i = n ? t || "title-" + i : void 0, u.createElement(
44
44
  "svg",
45
- 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: l, "aria-labelledby": i }, n),
46
- r ? s.createElement("title", { id: i }, r) : null,
47
- s.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m.53 6.72a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 .53 1.28h7a.75.75 0 0 0 .53-1.28zM12 10.56l1.69 1.69h-3.38z", clipRule: "evenodd" })
45
+ 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: l, "aria-labelledby": i }, r),
46
+ n ? u.createElement("title", { id: i }, n) : null,
47
+ u.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M3.75 12a8.25 8.25 0 1 1 16.5 0 8.25 8.25 0 0 1-16.5 0M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25m.53 6.72a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 .53 1.28h7a.75.75 0 0 0 .53-1.28zM12 10.56l1.69 1.69h-3.38z", clipRule: "evenodd" })
48
48
  );
49
- }), D = "_accountSelector_1f74n_1", L = "_heading_1f74n_11", $ = "_searchSection_1f74n_17", K = "_searchField_1f74n_22", U = "_accountMenu_1f74n_26", W = "_fullScreen_1f74n_34", q = "_virtualized_1f74n_38", G = "_btnIcon_1f74n_42", J = "_spinner_1f74n_46", c = {
50
- accountSelector: D,
51
- heading: L,
52
- searchSection: $,
53
- searchField: K,
54
- accountMenu: U,
55
- fullScreen: W,
56
- virtualized: q,
57
- btnIcon: G,
58
- spinner: J
59
- }, ue = ({ accountMenu: e, forceOpenFullScreen: l, className: r, loading: t }) => {
60
- const { currentId: n, openId: i, closeAll: m, languageCode: h } = N(), f = C(), o = n === "accountFullscreen", [p, g] = b(""), [d, v] = b(l);
61
- w(() => {
62
- !l && d && o && m(), v(l);
63
- }, [l]), w(() => {
64
- (d === !0 && !o || !f && n === "account") && i("accountFullscreen");
65
- }, [d, o, f, n, i]);
66
- const { minimize: I, fullscreen: O, searchText: S, heading: z } = Q(h), j = () => {
67
- i(o ? "account" : "accountFullscreen");
68
- }, E = (u) => {
69
- e.onSelectAccount?.(u), m(), v(!1);
49
+ }), K = "_accountSelector_qwjt5_1", W = "_heading_qwjt5_11", G = "_searchSection_qwjt5_17", J = "_searchField_qwjt5_25", Q = "_accountMenu_qwjt5_29", U = "_fullScreen_qwjt5_37", X = "_virtualized_qwjt5_41", Y = "_btnIcon_qwjt5_45", Z = "_spinner_qwjt5_49", c = {
50
+ accountSelector: K,
51
+ heading: W,
52
+ searchSection: G,
53
+ searchField: J,
54
+ accountMenu: Q,
55
+ fullScreen: U,
56
+ virtualized: X,
57
+ btnIcon: Y,
58
+ spinner: Z
59
+ }, he = ({
60
+ accountMenu: e,
61
+ forceOpenFullScreen: l,
62
+ className: n,
63
+ loading: t,
64
+ showDeletedUnits: r,
65
+ onShowDeletedUnitsChange: i
66
+ }) => {
67
+ const { currentId: m, openId: d, closeAll: p, languageCode: g } = L(), h = N(), a = m === "accountFullscreen", [v, S] = j(""), [f, w] = j(l);
68
+ x(() => {
69
+ !l && f && a && p(), w(l);
70
+ }, [l]), x(() => {
71
+ (f === !0 && !a || !h && m === "account") && d("accountFullscreen");
72
+ }, [f, a, h, m, d]);
73
+ const { minimize: z, fullscreen: k, searchText: _, heading: C, switchLabel: E } = ee(g), F = () => {
74
+ d(a ? "account" : "accountFullscreen");
75
+ }, M = (s) => {
76
+ e.onSelectAccount?.(s), p(), w(!1);
70
77
  };
71
- return t ? /* @__PURE__ */ a(A, { "aria-hidden": !0, "data-color": "neutral", className: c.spinner }) : /* @__PURE__ */ k("div", { className: _(r, c.accountSelector), children: [
72
- o && /* @__PURE__ */ a(P, { "data-size": "md", level: 2, className: c.heading, children: z }),
73
- /* @__PURE__ */ a("div", { className: c.searchSection, children: /* @__PURE__ */ a(
74
- R,
75
- {
76
- name: S,
77
- placeholder: S,
78
- value: p,
79
- onChange: (u) => g(u.target.value),
80
- onClear: () => g(""),
81
- className: c.searchField
82
- }
83
- ) }),
84
- /* @__PURE__ */ a(
78
+ return t ? /* @__PURE__ */ o(P, { "aria-hidden": !0, "data-color": "neutral", className: c.spinner }) : /* @__PURE__ */ b("div", { className: y(n, c.accountSelector), children: [
79
+ /* @__PURE__ */ o(V, { "data-size": "sm", level: 2, className: c.heading, children: C }),
80
+ /* @__PURE__ */ b("div", { className: c.searchSection, children: [
81
+ /* @__PURE__ */ o(
82
+ A,
83
+ {
84
+ name: _,
85
+ placeholder: _,
86
+ value: v,
87
+ onChange: (s) => S(s.target.value),
88
+ onClear: () => S(""),
89
+ className: c.searchField
90
+ }
91
+ ),
92
+ r !== void 0 && /* @__PURE__ */ o(
93
+ H,
94
+ {
95
+ checked: r,
96
+ onChange: (s) => i?.(s.target.checked),
97
+ label: E
98
+ }
99
+ )
100
+ ] }),
101
+ /* @__PURE__ */ o(
85
102
  "div",
86
103
  {
87
- className: _(
104
+ className: y(
88
105
  c.accountMenu,
89
- o && c.fullScreen,
106
+ a && c.fullScreen,
90
107
  e.isVirtualized && c.virtualized
91
108
  ),
92
- children: /* @__PURE__ */ a(
93
- F,
109
+ children: /* @__PURE__ */ o(
110
+ q,
94
111
  {
95
112
  ...e,
96
- onSelectAccount: E,
113
+ onSelectAccount: M,
97
114
  keyboardEvents: !1,
98
115
  search: {
99
116
  hidden: !0,
100
117
  name: "",
101
- value: p,
102
- getResultsLabel: (u) => X(u, h)
118
+ value: v,
119
+ getResultsLabel: (s) => te(s, g)
103
120
  },
104
- scrollRefStyles: !o && e.isVirtualized ? { maxHeight: "calc(40vh)" } : void 0
121
+ scrollRefStyles: !a && e.isVirtualized ? { maxHeight: "calc(40vh)" } : void 0
105
122
  }
106
123
  )
107
124
  }
108
125
  ),
109
- d !== !0 && f && /* @__PURE__ */ a(
110
- M,
126
+ f !== !0 && h && /* @__PURE__ */ o(
127
+ R,
111
128
  {
112
- icon: o ? /* @__PURE__ */ a(B, { className: c.btnIcon, "aria-hidden": "true" }) : /* @__PURE__ */ a(T, { className: c.btnIcon, "aria-hidden": "true" }),
129
+ icon: a ? /* @__PURE__ */ o(D, { className: c.btnIcon, "aria-hidden": "true" }) : /* @__PURE__ */ o(B, { className: c.btnIcon, "aria-hidden": "true" }),
113
130
  variant: "ghost",
114
- onClick: j,
115
- children: o ? I : O
131
+ onClick: F,
132
+ children: a ? z : k
116
133
  }
117
134
  )
118
135
  ] });
119
- }, Q = (e) => {
136
+ }, ee = (e) => {
120
137
  switch (e) {
121
138
  case "nn":
122
139
  return {
123
140
  minimize: "Minimer",
124
141
  fullscreen: "Vis i fullskjerm",
125
142
  searchText: "Søk i aktørar",
126
- heading: "Kven vil du representere?"
143
+ heading: "Kven vil du representere?",
144
+ switchLabel: "Vis slettede"
127
145
  };
128
146
  case "en":
129
147
  return {
130
148
  minimize: "Minimize",
131
149
  fullscreen: "Show in fullscreen",
132
150
  searchText: "Search in actors",
133
- heading: "Who do you want to represent?"
151
+ heading: "Who do you want to represent?",
152
+ switchLabel: "Show deleted"
134
153
  };
135
154
  default:
136
155
  return {
137
156
  minimize: "Minimer",
138
157
  fullscreen: "Vis i fullskjerm",
139
158
  searchText: "Søk i aktører",
140
- heading: "Hvem vil du representere?"
159
+ heading: "Hvem vil du representere?",
160
+ switchLabel: "Vis slettede"
141
161
  };
142
162
  }
143
- }, X = (e, l) => {
144
- const r = l === "nb" || l === "nn";
145
- return e === 0 ? r ? "Ingen treff" : "No hits" : r ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
163
+ }, te = (e, l) => {
164
+ const n = l === "nb" || l === "nn";
165
+ return e === 0 ? n ? "Ingen treff" : "No hits" : n ? `${e} treff` : e === 1 ? "1 hit" : `${e} hits`;
146
166
  };
147
167
  export {
148
- ue as AccountSelector
168
+ he as AccountSelector
149
169
  };
@@ -211,10 +211,10 @@ import { ModalIcon as px } from "./Modal/ModalIcon.js";
211
211
  import { ModalBody as xx } from "./Modal/ModalBody.js";
212
212
  import { Modal as ix } from "./Modal/Modal.js";
213
213
  import { A as sx } from "../alert-BzifOfXl.js";
214
- import { B as lx, C as ux, a as dx, b as gx, D as Dx, L as Bx, c as Lx, d as Ix, P as Sx, e as bx, f as Ax, S as Mx, g as yx, T as Tx, u as hx } from "../textfield-C_c2H05R.js";
215
- import { B as Hx, S as Cx } from "../button-BB5sYVKY.js";
216
- import { D as Px } from "../index-Q0EA2XB0.js";
217
- import { H as wx } from "../heading-C_XYsUfi.js";
214
+ import { B as lx, C as ux, a as dx, b as gx, D as Dx, L as Bx, c as Lx, d as Ix, P as Sx, e as bx, S as Ax, f as Mx, T as yx, u as Tx } from "../textfield-DAuYWtUj.js";
215
+ import { B as kx, S as Hx } from "../button-BB5sYVKY.js";
216
+ import { H as Fx, S as Px } from "../switch-Cemfhx0H.js";
217
+ import { D as wx } from "../index-Q0EA2XB0.js";
218
218
  import { P as Ox } from "../paragraph-BRiIBpbY.js";
219
219
  import { S as Nx } from "../index-DttADHE1.js";
220
220
  import { V as Ux } from "../index-z82sbSVU.js";
@@ -303,13 +303,13 @@ export {
303
303
  Yo as DropdownBase,
304
304
  sx as DsAlert,
305
305
  lx as DsBadge,
306
- Hx as DsButton,
306
+ kx as DsButton,
307
307
  ux as DsCheckbox,
308
308
  dx as DsChip,
309
309
  gx as DsCombobox,
310
- Px as DsDetails,
310
+ wx as DsDetails,
311
311
  Dx as DsDialog,
312
- wx as DsHeading,
312
+ Fx as DsHeading,
313
313
  Bx as DsLink,
314
314
  Lx as DsListItem,
315
315
  Ix as DsListUnordered,
@@ -318,10 +318,10 @@ export {
318
318
  bx as DsPopover,
319
319
  Nx as DsSearch,
320
320
  Ax as DsSkeleton,
321
- Cx as DsSpinner,
322
- Mx as DsSwitch,
323
- yx as DsTabs,
324
- Tx as DsTextfield,
321
+ Hx as DsSpinner,
322
+ Px as DsSwitch,
323
+ Mx as DsTabs,
324
+ yx as DsTextfield,
325
325
  Ux as DsValidationMessage,
326
326
  Ar as EndUserLabel,
327
327
  vp as Field,
@@ -467,7 +467,7 @@ export {
467
467
  i as isAvatarProps,
468
468
  ye as isHeadingProps,
469
469
  qr as isIconProps,
470
- hx as useDsPagination,
470
+ Tx as useDsPagination,
471
471
  wt as useRootContext,
472
472
  fm as useSnackbar
473
473
  };