@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.
- package/dist/{Autocomplete-BNV2UfH3.js → Autocomplete-hEFuiN2u.js} +66 -63
- package/dist/assets/GlobalMenuBase.css +1 -1
- package/dist/assets/Header.css +1 -1
- package/dist/assets/LayoutBase.css +1 -1
- package/dist/components/Bookmarks/BookmarksList.js +1 -1
- package/dist/components/Bookmarks/BookmarksListItem.js +1 -1
- package/dist/components/Bookmarks/BookmarksListItem.stories.js +1 -1
- package/dist/components/Bookmarks/index.js +1 -1
- package/dist/components/Button/Buttons.stories.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.stories.js +1 -1
- package/dist/components/ContextMenu/ContextMenuBase.js +1 -1
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/components/Dialog/DialogActions.js +1 -1
- package/dist/components/Dialog/DialogGroup.js +1 -1
- package/dist/components/Dialog/DialogList.js +1 -1
- package/dist/components/Dialog/DialogListItem.js +1 -1
- package/dist/components/Dialog/DialogListItem.stories.js +1 -1
- package/dist/components/Dialog/DialogNav.js +1 -1
- package/dist/components/Dialog/Examples.stories.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Dropdown/DrawerButton.js +1 -1
- package/dist/components/Dropdown/DrawerOrDropdown.js +1 -1
- package/dist/components/GlobalMenu/AccountButton.js +1 -1
- package/dist/components/GlobalMenu/AccountMenu.d.ts +5 -2
- package/dist/components/GlobalMenu/AccountMenu.js +35 -27
- package/dist/components/GlobalMenu/AccountMenu.stories.js +19 -2
- package/dist/components/GlobalMenu/BackButton.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
- package/dist/components/GlobalMenu/GlobalMenu.stories.js +6 -12
- package/dist/components/GlobalMenu/GlobalMenuBase.js +9 -9
- package/dist/components/Header/Header.js +13 -13
- package/dist/components/Header/HeaderBase.js +1 -1
- package/dist/components/Layout/Layout.js +1 -1
- package/dist/components/Layout/Layout.stories.js +131 -42
- package/dist/components/Layout/LayoutBase.js +3 -3
- package/dist/components/LayoutAction/ActionMenu.js +1 -1
- package/dist/components/List/List.js +1 -1
- package/dist/components/List/List.stories.js +1 -1
- package/dist/components/List/ListItem.js +1 -1
- package/dist/components/List/ListItem.stories.js +1 -1
- package/dist/components/List/ListItemControls.js +1 -1
- package/dist/components/List/index.js +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Menu/MenuItem.stories.js +1 -1
- package/dist/components/Menu/MenuItems.js +1 -1
- package/dist/components/Menu/MenuItems.stories.js +1 -1
- package/dist/components/Menu/MenuSearch.js +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Page/PageHeader.js +1 -1
- package/dist/components/Searchbar/Autocomplete.js +1 -1
- package/dist/components/Searchbar/Autocomplete.stories.js +1 -1
- package/dist/components/Searchbar/AutocompleteItem.js +1 -1
- package/dist/components/Searchbar/ScopeListItem.js +1 -1
- package/dist/components/Searchbar/Searchbar.js +1 -1
- package/dist/components/Toolbar/ToolbarAdd.js +1 -1
- package/dist/components/Toolbar/ToolbarDaterange.js +1 -1
- package/dist/components/Toolbar/ToolbarFilter.js +1 -1
- package/dist/components/Toolbar/ToolbarMenu.js +1 -1
- package/dist/components/Toolbar/ToolbarOptions.js +1 -1
- package/dist/components/Toolbar/ToolbarSearch.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
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__ */
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
90
|
-
const m = (c == null ? void 0 : c.props) || {}, { title:
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
(t > 0 ||
|
|
93
|
-
|
|
94
|
-
c == null ? void 0 : c.items.
|
|
95
|
-
|
|
96
|
-
return
|
|
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:
|
|
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__ */
|
|
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
|
-
(
|
|
122
|
+
(p || b) && /* @__PURE__ */ e(B, { role: "separator", as: "div" })
|
|
120
123
|
] })
|
|
121
|
-
] },
|
|
124
|
+
] }, l);
|
|
122
125
|
})
|
|
123
|
-
] },
|
|
126
|
+
] }, u);
|
|
124
127
|
}) });
|
|
125
|
-
}, he = "_controls_dduzt_1", _e = "_linkText_dduzt_14",
|
|
128
|
+
}, he = "_controls_dduzt_1", _e = "_linkText_dduzt_14", pe = "_linkIcon_dduzt_19", N = {
|
|
126
129
|
controls: he,
|
|
127
130
|
linkText: _e,
|
|
128
|
-
linkIcon:
|
|
129
|
-
},
|
|
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:
|
|
144
|
+
avatarGroup: d,
|
|
142
145
|
title: c,
|
|
143
|
-
description:
|
|
146
|
+
description: u,
|
|
144
147
|
collapsible: m,
|
|
145
|
-
expanded:
|
|
148
|
+
expanded: f,
|
|
146
149
|
badge: I,
|
|
147
|
-
linkText:
|
|
148
|
-
linkIcon:
|
|
149
|
-
menu:
|
|
150
|
-
select:
|
|
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:
|
|
162
|
-
controls: k || /* @__PURE__ */ e(
|
|
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:
|
|
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",
|
|
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:
|
|
169
|
-
summary:
|
|
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:
|
|
183
|
+
recipient: d,
|
|
181
184
|
grouped: c,
|
|
182
|
-
updatedAt:
|
|
185
|
+
updatedAt: u,
|
|
183
186
|
updatedAtLabel: m,
|
|
184
|
-
archivedAt:
|
|
187
|
+
archivedAt: f,
|
|
185
188
|
archivedAtLabel: I,
|
|
186
|
-
trashedAt:
|
|
187
|
-
trashedAtLabel:
|
|
188
|
-
label:
|
|
189
|
-
dueAt:
|
|
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 =
|
|
200
|
-
return t === "xs" || t === "sm" ? /* @__PURE__ */ e(D, { ...j, loading: o, size: t, className:
|
|
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:
|
|
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:
|
|
210
|
-
controls: s && /* @__PURE__ */ e(Y, { className:
|
|
211
|
-
children: /* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
/* @__PURE__ */ e(W, { loading: o, size: t, variant: A, label:
|
|
214
|
-
/* @__PURE__ */ e(U, { loading: o, size: t, grouped: c, sender: i, recipient:
|
|
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__ */
|
|
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:
|
|
226
|
+
updatedAt: u,
|
|
224
227
|
updatedAtLabel: m,
|
|
225
|
-
archivedAt:
|
|
228
|
+
archivedAt: f,
|
|
226
229
|
archivedAtLabel: I,
|
|
227
|
-
trashedAt:
|
|
228
|
-
trashedAtLabel:
|
|
229
|
-
dueAt:
|
|
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:
|
|
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:
|
|
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,
|
|
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:
|
|
267
|
-
props: { groupId:
|
|
269
|
+
menuIndex: p,
|
|
270
|
+
props: { groupId: h, ...l }
|
|
268
271
|
} = m;
|
|
269
|
-
return /* @__PURE__ */ e("li", { tabIndex: -1, onMouseEnter: () =>
|
|
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
|
-
|
|
281
|
+
Ie as L,
|
|
279
282
|
S as M,
|
|
280
283
|
De as S,
|
|
281
284
|
L as a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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}}
|
package/dist/assets/Header.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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
|
-
.
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
+
import { C as n } from "../../Autocomplete-hEFuiN2u.js";
|
|
6
6
|
import "../RootProvider/RootProvider.js";
|
|
7
7
|
export {
|
|
8
8
|
n as ContextMenu
|
|
@@ -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-
|
|
7
|
+
import { b as s } from "../../Autocomplete-hEFuiN2u.js";
|
|
8
8
|
import "../Dropdown/DropdownBase.js";
|
|
9
9
|
export {
|
|
10
10
|
s as ContextMenuBase
|
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
|
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?:
|
|
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
|
|
3
|
-
import { useState as
|
|
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-
|
|
8
|
-
import { Menu as
|
|
9
|
-
const
|
|
10
|
-
accounts:
|
|
11
|
-
accountGroups:
|
|
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:
|
|
14
|
-
currentAccount:
|
|
13
|
+
onSelectAccount: d,
|
|
14
|
+
currentAccount: m
|
|
15
15
|
}) => {
|
|
16
|
-
var
|
|
17
|
-
const
|
|
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 ?? (
|
|
20
|
+
selected: e.selected ?? (m == null ? void 0 : m.id) === e.id,
|
|
21
21
|
title: e.name,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
...(e == null ? void 0 : e.accountNames) && {
|
|
23
|
+
avatarGroup: {
|
|
24
|
+
items: e.accountNames.map((r) => ({ name: r, type: e.type }))
|
|
25
|
+
}
|
|
25
26
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
})) :
|
|
41
|
+
})) : g, C = i ? {
|
|
34
42
|
search: {
|
|
35
|
-
title: ((
|
|
43
|
+
title: ((f = s == null ? void 0 : s.getResultsLabel) == null ? void 0 : f.call(s, l.length)) ?? M(l.length)
|
|
36
44
|
}
|
|
37
|
-
} :
|
|
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) =>
|
|
42
|
-
onClear: () =>
|
|
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__ */
|
|
47
|
-
|
|
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
|
-
|
|
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-
|
|
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
|