@altinn/altinn-components 0.7.4 → 0.7.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.
Files changed (64) hide show
  1. package/dist/{Autocomplete-BNV2UfH3.js → Autocomplete-hEFuiN2u.js} +66 -63
  2. package/dist/assets/GlobalMenuBase.css +1 -1
  3. package/dist/assets/Header.css +1 -1
  4. package/dist/assets/LayoutBase.css +1 -1
  5. package/dist/components/Bookmarks/BookmarksList.js +1 -1
  6. package/dist/components/Bookmarks/BookmarksListItem.js +1 -1
  7. package/dist/components/Bookmarks/BookmarksListItem.stories.js +1 -1
  8. package/dist/components/Bookmarks/index.js +1 -1
  9. package/dist/components/Button/Buttons.stories.js +1 -1
  10. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  11. package/dist/components/ContextMenu/ContextMenu.stories.js +1 -1
  12. package/dist/components/ContextMenu/ContextMenuBase.js +1 -1
  13. package/dist/components/ContextMenu/index.js +1 -1
  14. package/dist/components/Dialog/DialogActions.js +1 -1
  15. package/dist/components/Dialog/DialogGroup.js +1 -1
  16. package/dist/components/Dialog/DialogList.js +1 -1
  17. package/dist/components/Dialog/DialogListItem.js +1 -1
  18. package/dist/components/Dialog/DialogListItem.stories.js +1 -1
  19. package/dist/components/Dialog/DialogNav.js +1 -1
  20. package/dist/components/Dialog/Examples.stories.js +1 -1
  21. package/dist/components/Dialog/index.js +1 -1
  22. package/dist/components/Dropdown/DrawerButton.js +1 -1
  23. package/dist/components/Dropdown/DrawerOrDropdown.js +1 -1
  24. package/dist/components/GlobalMenu/AccountButton.js +1 -1
  25. package/dist/components/GlobalMenu/AccountMenu.d.ts +5 -2
  26. package/dist/components/GlobalMenu/AccountMenu.js +35 -27
  27. package/dist/components/GlobalMenu/AccountMenu.stories.js +19 -2
  28. package/dist/components/GlobalMenu/BackButton.js +1 -1
  29. package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
  30. package/dist/components/GlobalMenu/GlobalMenu.stories.js +6 -12
  31. package/dist/components/GlobalMenu/GlobalMenuBase.js +9 -9
  32. package/dist/components/Header/Header.js +13 -13
  33. package/dist/components/Header/HeaderBase.js +1 -1
  34. package/dist/components/Layout/Layout.js +1 -1
  35. package/dist/components/Layout/Layout.stories.js +131 -42
  36. package/dist/components/Layout/LayoutBase.js +3 -3
  37. package/dist/components/LayoutAction/ActionMenu.js +1 -1
  38. package/dist/components/List/List.js +1 -1
  39. package/dist/components/List/List.stories.js +1 -1
  40. package/dist/components/List/ListItem.js +1 -1
  41. package/dist/components/List/ListItem.stories.js +1 -1
  42. package/dist/components/List/ListItemControls.js +1 -1
  43. package/dist/components/List/index.js +1 -1
  44. package/dist/components/Menu/Menu.js +1 -1
  45. package/dist/components/Menu/MenuItem.stories.js +1 -1
  46. package/dist/components/Menu/MenuItems.js +1 -1
  47. package/dist/components/Menu/MenuItems.stories.js +1 -1
  48. package/dist/components/Menu/MenuSearch.js +1 -1
  49. package/dist/components/Menu/index.js +1 -1
  50. package/dist/components/Page/PageHeader.js +1 -1
  51. package/dist/components/Searchbar/Autocomplete.js +1 -1
  52. package/dist/components/Searchbar/Autocomplete.stories.js +1 -1
  53. package/dist/components/Searchbar/AutocompleteItem.js +1 -1
  54. package/dist/components/Searchbar/ScopeListItem.js +1 -1
  55. package/dist/components/Searchbar/Searchbar.js +1 -1
  56. package/dist/components/Toolbar/ToolbarAdd.js +1 -1
  57. package/dist/components/Toolbar/ToolbarDaterange.js +1 -1
  58. package/dist/components/Toolbar/ToolbarFilter.js +1 -1
  59. package/dist/components/Toolbar/ToolbarMenu.js +1 -1
  60. package/dist/components/Toolbar/ToolbarOptions.js +1 -1
  61. package/dist/components/Toolbar/ToolbarSearch.js +1 -1
  62. package/dist/components/index.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as f, Fragment as $ } from "react/jsx-runtime";
2
+ import { jsx as e, jsxs as _, Fragment as $ } from "react/jsx-runtime";
3
3
  import { Fragment as G, forwardRef as K, createElement as R } from "react";
4
4
  import { useMenu as E } from "./hooks/useMenu.js";
5
5
  import { AutocompleteBase as Q } from "./components/Searchbar/AutocompleteBase.js";
@@ -38,7 +38,7 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
38
38
  className: s,
39
39
  onToggle: a,
40
40
  children: i
41
- }) => /* @__PURE__ */ f("div", { className: q(w.toggle, s), "data-theme": "neutral", children: [
41
+ }) => /* @__PURE__ */ _("div", { className: q(w.toggle, s), "data-theme": "neutral", children: [
42
42
  /* @__PURE__ */ e(
43
43
  oe,
44
44
  {
@@ -60,14 +60,14 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
60
60
  className: a,
61
61
  items: i
62
62
  }) => {
63
- const { currentId: l, toggleId: c } = J();
63
+ const { currentId: d, toggleId: c } = J();
64
64
  return /* @__PURE__ */ e(
65
65
  ue,
66
66
  {
67
67
  size: o,
68
68
  placement: n,
69
69
  className: a,
70
- expanded: l === t,
70
+ expanded: d === t,
71
71
  onToggle: () => c(t),
72
72
  children: /* @__PURE__ */ e(S, { groups: s, items: i })
73
73
  }
@@ -80,31 +80,34 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
80
80
  defaultItemColor: a,
81
81
  defaultItemSize: i
82
82
  }) => {
83
- const { menu: l } = E({
83
+ const { menu: d } = E({
84
84
  items: o,
85
85
  groups: s,
86
86
  groupByKey: "groupId",
87
87
  keyboardEvents: !1
88
88
  });
89
- return /* @__PURE__ */ e(te, { expanded: n, children: l.map((c, d) => {
90
- const m = (c == null ? void 0 : c.props) || {}, { title: u, divider: I = !0 } = m, h = l[d + 1];
91
- return /* @__PURE__ */ f(G, { children: [
92
- (t > 0 || d) && I ? /* @__PURE__ */ e(B, { role: "separator" }) : "",
93
- u && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(ee, { title: u }) }),
94
- c == null ? void 0 : c.items.map((p, _) => {
95
- const { active: v } = p, { groupId: k, ...r } = p.props || {}, { expanded: y } = r, b = c == null ? void 0 : c.items[_ + 1];
96
- return /* @__PURE__ */ f(B, { role: "presentation", expanded: y, children: [
89
+ return /* @__PURE__ */ e(te, { expanded: n, children: d.map((c, u) => {
90
+ const m = (c == null ? void 0 : c.props) || {}, { title: f, divider: I = !0 } = m, p = d[u + 1];
91
+ return /* @__PURE__ */ _(G, { children: [
92
+ (t > 0 || u) && I ? /* @__PURE__ */ e(B, { role: "separator" }) : "",
93
+ f && /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(ee, { title: f }) }),
94
+ c == null ? void 0 : c.items.filter((h) => {
95
+ var l;
96
+ return !((l = h.props) != null && l.hidden);
97
+ }).map((h, l) => {
98
+ const { active: x } = h, { groupId: k, ...r } = h.props || {}, { expanded: y } = r, b = c == null ? void 0 : c.items[l + 1];
99
+ return /* @__PURE__ */ _(B, { role: "presentation", expanded: y, children: [
97
100
  /* @__PURE__ */ e(
98
101
  P,
99
102
  {
100
103
  ...r,
101
104
  color: (r == null ? void 0 : r.color) || (m == null ? void 0 : m.defaultItemColor) || a,
102
105
  size: (r == null ? void 0 : r.size) || (m == null ? void 0 : m.defaultItemSize) || i,
103
- active: v,
106
+ active: x,
104
107
  tabIndex: r != null && r.disabled ? -1 : 0
105
108
  }
106
109
  ),
107
- y && (r == null ? void 0 : r.items) && /* @__PURE__ */ f($, { children: [
110
+ y && (r == null ? void 0 : r.items) && /* @__PURE__ */ _($, { children: [
108
111
  /* @__PURE__ */ e(
109
112
  S,
110
113
  {
@@ -116,17 +119,17 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
116
119
  defaultItemSize: i
117
120
  }
118
121
  ),
119
- (h || b) && /* @__PURE__ */ e(B, { role: "separator" })
122
+ (p || b) && /* @__PURE__ */ e(B, { role: "separator", as: "div" })
120
123
  ] })
121
- ] }, _);
124
+ ] }, l);
122
125
  })
123
- ] }, d);
126
+ ] }, u);
124
127
  }) });
125
- }, he = "_controls_dduzt_1", _e = "_linkText_dduzt_14", Ie = "_linkIcon_dduzt_19", N = {
128
+ }, he = "_controls_dduzt_1", _e = "_linkText_dduzt_14", pe = "_linkIcon_dduzt_19", N = {
126
129
  controls: he,
127
130
  linkText: _e,
128
- linkIcon: Ie
129
- }, pe = ({ badge: t, linkText: n, linkIcon: o, menu: s, children: a }) => /* @__PURE__ */ e("div", { className: N.controls, "data-menu": s && !0, children: a || /* @__PURE__ */ f($, { children: [
131
+ linkIcon: pe
132
+ }, Ie = ({ badge: t, linkText: n, linkIcon: o, menu: s, children: a }) => /* @__PURE__ */ e("div", { className: N.controls, "data-menu": s && !0, children: a || /* @__PURE__ */ _($, { children: [
130
133
  t && /* @__PURE__ */ e(z, { ...t }),
131
134
  n && /* @__PURE__ */ e("span", { className: N.linkText, children: n }),
132
135
  o && /* @__PURE__ */ e(re, { name: o, className: N.linkIcon }),
@@ -138,16 +141,16 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
138
141
  size: s = "sm",
139
142
  icon: a,
140
143
  avatar: i,
141
- avatarGroup: l,
144
+ avatarGroup: d,
142
145
  title: c,
143
- description: d,
146
+ description: u,
144
147
  collapsible: m,
145
- expanded: u,
148
+ expanded: f,
146
149
  badge: I,
147
- linkText: h,
148
- linkIcon: p,
149
- menu: _,
150
- select: v,
150
+ linkText: p,
151
+ linkIcon: h,
152
+ menu: l,
153
+ select: x,
151
154
  controls: k,
152
155
  children: r,
153
156
  ...y
@@ -158,15 +161,15 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
158
161
  size: s,
159
162
  color: n,
160
163
  loading: o,
161
- select: v,
162
- controls: k || /* @__PURE__ */ e(pe, { linkIcon: m && u ? "chevron-up" : m ? "chevron-down" : p, linkText: h, menu: _, badge: I }),
164
+ select: x,
165
+ controls: k || /* @__PURE__ */ e(Ie, { linkIcon: m && f ? "chevron-up" : m ? "chevron-down" : h, linkText: p, menu: l, badge: I }),
163
166
  ...y,
164
- children: /* @__PURE__ */ e(se, { loading: o, size: s, icon: a, avatar: i, avatarGroup: l, children: /* @__PURE__ */ e(H, { loading: o, title: c, description: d, size: s, children: r }) })
167
+ children: /* @__PURE__ */ e(se, { loading: o, size: s, icon: a, avatar: i, avatarGroup: d, children: /* @__PURE__ */ e(H, { loading: o, title: c, description: u, size: s, children: r }) })
165
168
  }
166
- ), ye = "_item_v64fv_1", xe = "_select_v64fv_16", ve = "_summary_v64fv_23", be = "_footer_v64fv_44", ke = "_touchedBy_v64fv_52", Be = "_border_v64fv_61", x = {
169
+ ), ye = "_item_v64fv_1", ve = "_select_v64fv_16", xe = "_summary_v64fv_23", be = "_footer_v64fv_44", ke = "_touchedBy_v64fv_52", Be = "_border_v64fv_61", v = {
167
170
  item: ye,
168
- select: xe,
169
- summary: ve,
171
+ select: ve,
172
+ summary: xe,
170
173
  footer: be,
171
174
  touchedBy: ke,
172
175
  border: Be
@@ -177,16 +180,16 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
177
180
  select: s,
178
181
  status: a,
179
182
  sender: i,
180
- recipient: l,
183
+ recipient: d,
181
184
  grouped: c,
182
- updatedAt: d,
185
+ updatedAt: u,
183
186
  updatedAtLabel: m,
184
- archivedAt: u,
187
+ archivedAt: f,
185
188
  archivedAtLabel: I,
186
- trashedAt: h,
187
- trashedAtLabel: p,
188
- label: _,
189
- dueAt: v,
189
+ trashedAt: p,
190
+ trashedAtLabel: h,
191
+ label: l,
192
+ dueAt: x,
190
193
  dueAtLabel: k,
191
194
  seen: r = !1,
192
195
  seenBy: y,
@@ -196,43 +199,43 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
196
199
  description: g,
197
200
  ...j
198
201
  }) => {
199
- const A = h ? "trashed" : u ? "archived" : n;
200
- return t === "xs" || t === "sm" ? /* @__PURE__ */ e(D, { ...j, loading: o, size: t, className: x.item, children: /* @__PURE__ */ f(C, { className: x.border, size: t, seen: r, loading: o, children: [
202
+ const A = p ? "trashed" : f ? "archived" : n;
203
+ return t === "xs" || t === "sm" ? /* @__PURE__ */ e(D, { ...j, loading: o, size: t, className: v.item, children: /* @__PURE__ */ _(C, { className: v.border, size: t, seen: r, loading: o, children: [
201
204
  /* @__PURE__ */ e(H, { loading: o, size: t, title: M, description: g }),
202
- /* @__PURE__ */ e(T, { loading: o, updatedAt: d, updatedAtLabel: m })
205
+ /* @__PURE__ */ e(T, { loading: o, updatedAt: u, updatedAtLabel: m })
203
206
  ] }) }) : /* @__PURE__ */ e(
204
207
  D,
205
208
  {
206
209
  ...j,
207
210
  loading: o,
208
211
  size: t,
209
- className: x.item,
210
- controls: s && /* @__PURE__ */ e(Y, { className: x.select, ...s }),
211
- children: /* @__PURE__ */ f(C, { className: x.border, size: t, seen: r, loading: o, children: [
212
- /* @__PURE__ */ f(O, { size: t, children: [
213
- /* @__PURE__ */ e(W, { loading: o, size: t, variant: A, label: _, seen: r, children: M }),
214
- /* @__PURE__ */ e(U, { loading: o, size: t, grouped: c, sender: i, recipient: l })
212
+ className: v.item,
213
+ controls: s && /* @__PURE__ */ e(Y, { className: v.select, ...s }),
214
+ children: /* @__PURE__ */ _(C, { className: v.border, size: t, seen: r, loading: o, children: [
215
+ /* @__PURE__ */ _(O, { size: t, children: [
216
+ /* @__PURE__ */ e(W, { loading: o, size: t, variant: A, label: l, seen: r, children: M }),
217
+ /* @__PURE__ */ e(U, { loading: o, size: t, grouped: c, sender: i, recipient: d })
215
218
  ] }),
216
219
  /* @__PURE__ */ e(Z, { loading: o, size: t, children: g }),
217
- /* @__PURE__ */ f("footer", { "data-size": t, className: x.footer, children: [
220
+ /* @__PURE__ */ _("footer", { "data-size": t, className: v.footer, children: [
218
221
  /* @__PURE__ */ e(
219
222
  T,
220
223
  {
221
224
  loading: o,
222
225
  status: a,
223
- updatedAt: d,
226
+ updatedAt: u,
224
227
  updatedAtLabel: m,
225
- archivedAt: u,
228
+ archivedAt: f,
226
229
  archivedAtLabel: I,
227
- trashedAt: h,
228
- trashedAtLabel: p,
229
- dueAt: v,
230
+ trashedAt: p,
231
+ trashedAtLabel: h,
232
+ dueAt: x,
230
233
  dueAtLabel: k,
231
234
  seenBy: y,
232
235
  attachmentsCount: F
233
236
  }
234
237
  ),
235
- b && /* @__PURE__ */ e(X, { loading: o, size: "xs", touchedBy: b, className: x.touchedBy })
238
+ b && /* @__PURE__ */ e(X, { loading: o, size: "xs", touchedBy: b, className: v.touchedBy })
236
239
  ] })
237
240
  ] })
238
241
  }
@@ -254,19 +257,19 @@ import './assets/Autocomplete.css';const ae = ({ size: t = "sm", title: n, descr
254
257
  }
255
258
  }, ot = K(
256
259
  ({ className: t, items: n, groups: o = {}, expanded: s }, a) => {
257
- const { menu: i, setActiveIndex: l } = E({
260
+ const { menu: i, setActiveIndex: d } = E({
258
261
  items: n,
259
262
  groups: o,
260
263
  groupByKey: "groupId",
261
264
  keyboardEvents: !0
262
265
  });
263
- return /* @__PURE__ */ e(Q, { className: t, expanded: s, ref: a, children: i.map((c, d) => /* @__PURE__ */ R(V, { ...c.props, key: d }, /* @__PURE__ */ e("ul", { children: c.items.map((m, u) => {
266
+ return /* @__PURE__ */ e(Q, { className: t, expanded: s, ref: a, children: i.map((c, u) => /* @__PURE__ */ R(V, { ...c.props, key: u }, /* @__PURE__ */ e("ul", { children: c.items.map((m, f) => {
264
267
  const {
265
268
  active: I,
266
- menuIndex: h,
267
- props: { groupId: p, ..._ }
269
+ menuIndex: p,
270
+ props: { groupId: h, ...l }
268
271
  } = m;
269
- return /* @__PURE__ */ e("li", { tabIndex: -1, onMouseEnter: () => l(h), children: /* @__PURE__ */ e(Me, { ..._, active: I }) }, u);
272
+ return /* @__PURE__ */ e("li", { tabIndex: -1, onMouseEnter: () => d(p), children: /* @__PURE__ */ e(Me, { ...l, active: I }) }, f);
270
273
  }) }))) });
271
274
  }
272
275
  );
@@ -275,7 +278,7 @@ export {
275
278
  ae as B,
276
279
  fe as C,
277
280
  Ne as D,
278
- pe as L,
281
+ Ie as L,
279
282
  S as M,
280
283
  De as S,
281
284
  L as a,
@@ -1 +1 @@
1
- ._nav_1mnmu_1{background-color:#fff;display:flex;flex-direction:column;padding:0 .5rem}._footer_1mnmu_8{padding:1rem .5rem;display:flex;width:100%;flex-direction:column;align-items:stretch}._drawer_1mnmu_16[aria-expanded=true]{display:block;padding:.5rem;z-index:2}._dropdown_1mnmu_22[aria-expanded=true]{display:none}@media (min-width: 1024px){._drawer_1mnmu_16[aria-expanded=true]{display:none}._dropdown_1mnmu_22[aria-expanded=true]{display:block;z-index:2}}
1
+ ._nav_ratd2_1{background-color:#fff;display:flex;flex-direction:column}._footer_ratd2_7{padding:1rem .5rem;display:flex;width:100%;flex-direction:column;align-items:stretch}._drawer_ratd2_15[aria-expanded=true]{display:block;padding:.5rem;z-index:2}._dropdown_ratd2_21[aria-expanded=true]{display:none}@media (min-width: 1024px){._drawer_ratd2_15[aria-expanded=true]{display:none}._dropdown_ratd2_21[aria-expanded=true]{display:block;z-index:2}}
@@ -1 +1 @@
1
- ._drawer_1wgf5_1[aria-expanded=true]{display:block}._dropdown_1wgf5_5[aria-expanded=true]{width:320px;display:none}@media (min-width: 1024px){._dropdown_1wgf5_5[aria-expanded=true]{display:block}}@media (min-width: 1024px){._drawer_1wgf5_1[aria-expanded=true]{display:none}._dropdown_1wgf5_5[aria-expanded=true]{display:block}}
1
+ ._drawer_ft5v3_1[aria-expanded=true]{display:block}._dropdown_ft5v3_5[aria-expanded=true]{display:none}@media (min-width: 1024px){._dropdown_ft5v3_5[aria-expanded=true]{width:320px;display:block}._drawer_ft5v3_1[aria-expanded=true]{display:none}}
@@ -1 +1 @@
1
- ._base_1401f_1{position:relative;display:flex;flex-direction:column;min-height:100vh;overflow:hidden}._base_1401f_1[data-theme]{background-color:var(--theme-background-subtle)}._base_1401f_1[data-current-id=menu]{background-color:var(--theme-background-default)}@media (max-width: 1024px){._base_1401f_1[data-current-id=menu] header+*,._base_1401f_1[data-current-id=menu] footer{display:none}}
1
+ ._base_wqztk_1{position:relative;display:flex;flex-direction:column;min-height:100vh;overflow:hidden}._base_wqztk_1[data-theme]{background-color:var(--theme-background-subtle)}._base_wqztk_1[data-current-id=menu]{background-color:var(--theme-background-default)}
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import { createElement as p } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
- import { B as i } from "../../Autocomplete-BNV2UfH3.js";
5
+ import { B as i } from "../../Autocomplete-hEFuiN2u.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import { ListBase as a } from "../List/ListBase.js";
8
8
  const L = ({ items: r, spacing: m }) => /* @__PURE__ */ t(a, { spacing: m, children: r == null ? void 0 : r.map((o) => /* @__PURE__ */ p(i, { ...o, key: o.id })) });
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "../Icon/SvgIcon.js";
4
4
  import "react";
5
- import { B as e } from "../../Autocomplete-BNV2UfH3.js";
5
+ import { B as e } from "../../Autocomplete-hEFuiN2u.js";
6
6
  import "./QueryLabel.js";
7
7
  import "../RootProvider/RootProvider.js";
8
8
  export {
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
2
  import { Fragment as s } from "react";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
- import { B as m } from "../../Autocomplete-BNV2UfH3.js";
5
+ import { B as m } from "../../Autocomplete-hEFuiN2u.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import { MetaItem as l } from "../Meta/MetaItem.js";
8
8
  import { ListBase as i } from "../List/ListBase.js";
@@ -1,5 +1,5 @@
1
1
  import { BookmarksList as e } from "./BookmarksList.js";
2
- import { B as t } from "../../Autocomplete-BNV2UfH3.js";
2
+ import { B as t } from "../../Autocomplete-hEFuiN2u.js";
3
3
  import { QueryItem as a, QueryLabel as k } from "./QueryLabel.js";
4
4
  export {
5
5
  e as BookmarksList,
@@ -7,7 +7,7 @@ import { ComboButton as d } from "./ComboButton.js";
7
7
  import { IconButton as p } from "./IconButton.js";
8
8
  import "../RootProvider/RootProvider.js";
9
9
  import { MetaItem as c } from "../Meta/MetaItem.js";
10
- import "../../Autocomplete-BNV2UfH3.js";
10
+ import "../../Autocomplete-hEFuiN2u.js";
11
11
  const I = {
12
12
  title: "Atoms/Button/Buttons",
13
13
  tags: ["autodocs"],
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-L8X2o7IH.js";
3
3
  import "../Icon/SvgIcon.js";
4
4
  import "react";
5
- import { C as n } from "../../Autocomplete-BNV2UfH3.js";
5
+ import { C as n } from "../../Autocomplete-hEFuiN2u.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  export {
8
8
  n as ContextMenu
@@ -1,4 +1,4 @@
1
- import { C as t } from "../../Autocomplete-BNV2UfH3.js";
1
+ import { C as t } from "../../Autocomplete-hEFuiN2u.js";
2
2
  const o = {
3
3
  title: "ContextMenu/ContextMenu",
4
4
  component: t,
@@ -4,7 +4,7 @@ import "../Icon/SvgIcon.js";
4
4
  import "react";
5
5
  import "../Button/IconButton.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import { b as s } from "../../Autocomplete-BNV2UfH3.js";
7
+ import { b as s } from "../../Autocomplete-hEFuiN2u.js";
8
8
  import "../Dropdown/DropdownBase.js";
9
9
  export {
10
10
  s as ContextMenuBase
@@ -1,4 +1,4 @@
1
- import { C as t } from "../../Autocomplete-BNV2UfH3.js";
1
+ import { C as t } from "../../Autocomplete-hEFuiN2u.js";
2
2
  export {
3
3
  t as ContextMenu
4
4
  };
@@ -6,7 +6,7 @@ import "../Icon/SvgIcon.js";
6
6
  import { Button as u } from "../Button/Button.js";
7
7
  import { ComboButton as f } from "../Button/ComboButton.js";
8
8
  import "../RootProvider/RootProvider.js";
9
- import "../../Autocomplete-BNV2UfH3.js";
9
+ import "../../Autocomplete-hEFuiN2u.js";
10
10
  import { Menu as y } from "../Menu/Menu.js";
11
11
  import '../../assets/DialogActions.css';const g = "_action_1lkfe_1", h = "_comboButton_1lkfe_7", _ = "_dropdown_1lkfe_11", i = {
12
12
  action: g,
@@ -6,7 +6,7 @@ import { Button as t } from "../Button/Button.js";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import { Heading as e } from "../Typography/Heading.js";
8
8
  import { ListBase as n } from "../List/ListBase.js";
9
- import "../../Autocomplete-BNV2UfH3.js";
9
+ import "../../Autocomplete-hEFuiN2u.js";
10
10
  import { SectionBase as p } from "../Page/SectionBase.js";
11
11
  import { SectionHeader as a } from "../Page/SectionHeader.js";
12
12
  const k = ({ title: i, children: m }) => /* @__PURE__ */ o(p, { spacing: "md", children: [
@@ -4,7 +4,7 @@ import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
5
  import "../RootProvider/RootProvider.js";
6
6
  import { useMenu as f } from "../../hooks/useMenu.js";
7
- import { D as l } from "../../Autocomplete-BNV2UfH3.js";
7
+ import { D as l } from "../../Autocomplete-hEFuiN2u.js";
8
8
  import { SectionBase as y } from "../Page/SectionBase.js";
9
9
  import { DialogGroup as d } from "./DialogGroup.js";
10
10
  const P = ({ items: e, groups: m = {} }) => {
@@ -10,7 +10,7 @@ import "./DialogHeaderBase.js";
10
10
  import "./DialogHeadings.js";
11
11
  import "./DialogTitle.js";
12
12
  import "./DialogTouchedBy.js";
13
- import { D as c } from "../../Autocomplete-BNV2UfH3.js";
13
+ import { D as c } from "../../Autocomplete-hEFuiN2u.js";
14
14
  import "./DialogSelect.js";
15
15
  import "../RootProvider/RootProvider.js";
16
16
  import "./DialogDescription.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import { withThemeByDataAttribute as y } from "@storybook/addon-themes";
3
3
  import { Fragment as u, useState as v } from "react";
4
- import { D as n } from "../../Autocomplete-BNV2UfH3.js";
4
+ import { D as n } from "../../Autocomplete-hEFuiN2u.js";
5
5
  import { DialogStatusEnum as g } from "./DialogStatus.js";
6
6
  import "../../index-L8X2o7IH.js";
7
7
  import "../Icon/SvgIcon.js";
@@ -3,7 +3,7 @@ import { jsxs as m, jsx as o } from "react/jsx-runtime";
3
3
  import "../../index-L8X2o7IH.js";
4
4
  import "../Icon/SvgIcon.js";
5
5
  import { Button as c } from "../Button/Button.js";
6
- import { C as l } from "../../Autocomplete-BNV2UfH3.js";
6
+ import { C as l } from "../../Autocomplete-hEFuiN2u.js";
7
7
  import { MetaTimestamp as p } from "../Meta/MetaTimestamp.js";
8
8
  import { DialogStatus as d } from "./DialogStatus.js";
9
9
  import { DialogTouchedBy as v } from "./DialogTouchedBy.js";
@@ -5,7 +5,7 @@ import "../Icon/SvgIcon.js";
5
5
  import "react";
6
6
  import "../RootProvider/RootProvider.js";
7
7
  import { MetaItem as s } from "../Meta/MetaItem.js";
8
- import { D as o } from "../../Autocomplete-BNV2UfH3.js";
8
+ import { D as o } from "../../Autocomplete-hEFuiN2u.js";
9
9
  import { ListBase as a } from "../List/ListBase.js";
10
10
  const y = {
11
11
  title: "Dialog/Examples",
@@ -1,7 +1,7 @@
1
1
  import { Dialog as e } from "./Dialog.js";
2
2
  import { DialogList as a } from "./DialogList.js";
3
3
  import { DialogMetadata as l } from "./DialogMetadata.js";
4
- import { D as m } from "../../Autocomplete-BNV2UfH3.js";
4
+ import { D as m } from "../../Autocomplete-hEFuiN2u.js";
5
5
  import { DialogActions as f } from "./DialogActions.js";
6
6
  import { DialogActivityLog as x } from "./DialogActivityLog.js";
7
7
  import { DialogArticleBase as B } from "./DialogArticleBase.js";
@@ -5,7 +5,7 @@ import "react";
5
5
  import { ButtonBase as m } from "../Button/ButtonBase.js";
6
6
  import { ButtonLabel as n } from "../Button/ButtonLabel.js";
7
7
  import "../RootProvider/RootProvider.js";
8
- import "../../Autocomplete-BNV2UfH3.js";
8
+ import "../../Autocomplete-hEFuiN2u.js";
9
9
  import '../../assets/DrawerButton.css';const s = "_button_19v2d_1", e = {
10
10
  button: s
11
11
  }, f = ({ label: o, children: r, onClick: i }) => /* @__PURE__ */ t(m, { variant: "solid", size: "md", className: e.button, onClick: i, children: /* @__PURE__ */ t(n, { size: "md", children: r || o }) });
@@ -10,7 +10,7 @@ import { DrawerHeader as f } from "./DrawerHeader.js";
10
10
  import { DrawerFooter as n } from "./DrawerFooter.js";
11
11
  import { DrawerButton as t } from "./DrawerButton.js";
12
12
  import { DrawerBody as D } from "./DrawerBody.js";
13
- import "../../Autocomplete-BNV2UfH3.js";
13
+ import "../../Autocomplete-hEFuiN2u.js";
14
14
  import '../../assets/DrawerOrDropdown.css';const _ = "_dropdown_1mzzo_1", B = "_drawer_1mzzo_5", i = {
15
15
  dropdown: _,
16
16
  drawer: B
@@ -6,7 +6,7 @@ import "../../index-L8X2o7IH.js";
6
6
  import "../Icon/SvgIcon.js";
7
7
  import "react";
8
8
  import "../RootProvider/RootProvider.js";
9
- import "../../Autocomplete-BNV2UfH3.js";
9
+ import "../../Autocomplete-hEFuiN2u.js";
10
10
  const b = ({ account: e, linkText: t, onClick: l, multipleAccounts: d }) => d ? /* @__PURE__ */ r(m, { size: "lg", onClick: l, linkText: t, linkIcon: "chevron-right", as: "button", children: [
11
11
  /* @__PURE__ */ i(
12
12
  s,
@@ -1,5 +1,6 @@
1
+ import { BadgeProps } from '../Badge';
1
2
  import { MenuItemGroups, MenuSearchProps } from '../Menu';
2
- export interface AccountSearch extends MenuSearchProps {
3
+ export interface AccountSearchProps extends MenuSearchProps {
3
4
  getResultsLabel?: (hits: number) => string;
4
5
  hidden?: boolean;
5
6
  }
@@ -9,11 +10,13 @@ export interface AccountMenuItem {
9
10
  id: string;
10
11
  groupId?: string;
11
12
  selected?: boolean;
13
+ accountNames?: string[];
14
+ badge?: BadgeProps;
12
15
  }
13
16
  export interface AccountMenuProps {
14
17
  accounts?: AccountMenuItem[];
15
18
  accountGroups?: MenuItemGroups;
16
- accountSearch?: AccountSearch;
19
+ accountSearch?: AccountSearchProps;
17
20
  currentAccount?: AccountMenuItem;
18
21
  onSelectAccount?: (id: string) => void;
19
22
  }
@@ -1,50 +1,58 @@
1
1
  "use client";
2
- import { jsx as L } from "react/jsx-runtime";
3
- import { useState as M } from "react";
2
+ import { jsx as v } from "react/jsx-runtime";
3
+ import { useState as y } from "react";
4
4
  import "../../index-L8X2o7IH.js";
5
5
  import "../Icon/SvgIcon.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import "../../Autocomplete-BNV2UfH3.js";
8
- import { Menu as b } from "../Menu/Menu.js";
9
- const v = (r) => `${r} hits`, j = ({
10
- accounts: r = [],
11
- accountGroups: o = {},
7
+ import "../../Autocomplete-hEFuiN2u.js";
8
+ import { Menu as L } from "../Menu/Menu.js";
9
+ const M = (p) => `${p} hits`, k = ({
10
+ accounts: p = [],
11
+ accountGroups: b = {},
12
12
  accountSearch: s,
13
- onSelectAccount: t,
14
- currentAccount: d
13
+ onSelectAccount: d,
14
+ currentAccount: m
15
15
  }) => {
16
- var g;
17
- const p = r.map((e) => ({
16
+ var f;
17
+ const g = p.map((e) => ({
18
18
  id: e.id || e.name,
19
19
  groupId: e.groupId || "search",
20
- selected: e.selected ?? (d == null ? void 0 : d.id) === e.id,
20
+ selected: e.selected ?? (m == null ? void 0 : m.id) === e.id,
21
21
  title: e.name,
22
- avatar: {
23
- type: e.type,
24
- name: e.name
22
+ ...(e == null ? void 0 : e.accountNames) && {
23
+ avatarGroup: {
24
+ items: e.accountNames.map((r) => ({ name: r, type: e.type }))
25
+ }
25
26
  },
26
- onClick: () => t == null ? void 0 : t(e.id || e.name)
27
- })), [i, m] = M(""), l = i ? p.filter((e) => {
28
- var f;
29
- return (f = e == null ? void 0 : e.title) == null ? void 0 : f.toLowerCase().includes(i.toLowerCase());
27
+ ...!(e != null && e.accountNames) && {
28
+ avatar: {
29
+ type: e.type,
30
+ name: e.name
31
+ }
32
+ },
33
+ badge: e.badge,
34
+ onClick: () => d == null ? void 0 : d(e.id || e.name)
35
+ })), [i, t] = y(""), l = i ? g.filter((e) => {
36
+ var r;
37
+ return (r = e == null ? void 0 : e.title) == null ? void 0 : r.toLowerCase().includes(i.toLowerCase());
30
38
  }).map((e) => ({
31
39
  ...e,
32
40
  groupId: "search"
33
- })) : p, C = i ? {
41
+ })) : g, C = i ? {
34
42
  search: {
35
- title: ((g = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : g.call(s, l.length)) ?? v(l.length)
43
+ title: ((f = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : f.call(s, l.length)) ?? M(l.length)
36
44
  }
37
- } : o, I = {
45
+ } : b, I = {
38
46
  name: "account-search",
39
47
  value: i,
40
48
  placeholder: (s == null ? void 0 : s.placeholder) ?? "Find account",
41
- onChange: (e) => m(e.target.value),
42
- onClear: () => m("")
49
+ onChange: (e) => t(e.target.value),
50
+ onClear: () => t("")
43
51
  }, h = [
44
52
  ...l.length > 0 ? l : [{ id: "search", groupId: "search", hidden: !0 }]
45
53
  ];
46
- return /* @__PURE__ */ L(
47
- b,
54
+ return /* @__PURE__ */ v(
55
+ L,
48
56
  {
49
57
  theme: "global",
50
58
  search: s && I,
@@ -54,5 +62,5 @@ const v = (r) => `${r} hits`, j = ({
54
62
  );
55
63
  };
56
64
  export {
57
- j as AccountMenu
65
+ k as AccountMenu
58
66
  };
@@ -19,14 +19,31 @@ const r = {
19
19
  groupId: "primary",
20
20
  type: "person",
21
21
  name: "Aurora Mikalsen",
22
- selected: !0
22
+ selected: !0,
23
+ badge: {
24
+ label: "2"
25
+ }
23
26
  },
24
27
  {
25
28
  id: "bergen-bar",
26
29
  groupId: "favourites",
27
30
  type: "company",
28
31
  name: "Bergen Bar",
29
- selected: !1
32
+ selected: !1,
33
+ badge: {
34
+ label: "19"
35
+ }
36
+ },
37
+ {
38
+ id: "allAccounts",
39
+ groupId: "groups",
40
+ type: "company",
41
+ name: "Alle virksomheter",
42
+ accountNames: ["Keeperhansker AS", "Stadion drift AS", "Landslaget"],
43
+ selected: !1,
44
+ badge: {
45
+ label: "19"
46
+ }
30
47
  },
31
48
  {
32
49
  id: "keeper",
@@ -4,7 +4,7 @@ import "../Icon/SvgIcon.js";
4
4
  import "react";
5
5
  import { MenuItem as i } from "../Menu/MenuItem.js";
6
6
  import "../RootProvider/RootProvider.js";
7
- import "../../Autocomplete-BNV2UfH3.js";
7
+ import "../../Autocomplete-hEFuiN2u.js";
8
8
  const u = ({ label: t, onClick: o }) => /* @__PURE__ */ r(i, { id: "back", icon: "arrow-left", title: t, onClick: o });
9
9
  export {
10
10
  u as BackButton