@epam/ai-dial-navigation-panel 1.3.0-dev.171 → 1.3.0-dev.176
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
|
-
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../src/components/UserMenu/UserMenu.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAA2B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../../src/components/UserMenu/UserMenu.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAA2B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAyOtC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { buildCssVars as e, mergeClasses as t } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { Avatar as n, BASE_ICON_SIZE as r, Button as i, DIAL_ICON_SIZE as a, DIAL_KIT_ICON_STROKE as o, Dropdown as s, DropdownItemType as c, ElementSize as l, EllipsisTooltip as u, GhostIconButton as d, IconButton as f, MenuItem as p, MenuItemMark as m, Tooltip as h } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { Fragment as g, createContext as _, memo as v, useCallback as y, useContext as b, useEffect as x, useId as
|
|
3
|
+
import { Fragment as g, createContext as _, memo as v, useCallback as y, useContext as b, useEffect as x, useId as S, useMemo as C, useRef as w, useState as ee } from "react";
|
|
4
4
|
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
5
|
-
import { IconCheck as O, IconChevronDown as k, IconChevronRight as A, IconChevronUp as te, IconLayoutSidebar as j, IconLogout as ne, IconSettings as M, IconUser as N, IconX as
|
|
6
|
-
import { BottomSheetShell as
|
|
5
|
+
import { IconCheck as O, IconChevronDown as k, IconChevronRight as A, IconChevronUp as te, IconLayoutSidebar as j, IconLogout as ne, IconSettings as M, IconUser as N, IconX as re } from "@tabler/icons-react";
|
|
6
|
+
import { BottomSheetShell as P } from "@epam/ai-dial-conversation-input";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var F = {
|
|
9
9
|
rail: "dial-navigation-panel-rail",
|
|
10
10
|
item: "dial-navigation-panel-item",
|
|
11
11
|
sidebar: "dial-navigation-panel-sidebar",
|
|
12
12
|
sidebarItem: "dial-navigation-panel-sidebar-item",
|
|
13
13
|
sidebarFooter: "dial-navigation-panel-sidebar-footer"
|
|
14
|
-
},
|
|
14
|
+
}, I = {
|
|
15
15
|
rail: "_rail_1hxk4_1",
|
|
16
16
|
item: "_item_1hxk4_6",
|
|
17
17
|
itemActive: "_itemActive_1hxk4_33",
|
|
18
18
|
itemFilled: "_itemFilled_1hxk4_38",
|
|
19
19
|
itemFilledOutline: "_itemFilledOutline_1hxk4_79"
|
|
20
|
-
},
|
|
20
|
+
}, L = (e, t) => /* @__PURE__ */ E("a", {
|
|
21
21
|
href: e.href,
|
|
22
22
|
className: "contents",
|
|
23
23
|
children: t
|
|
24
|
-
}),
|
|
25
|
-
let { colors: u, typography: d, className: p, cssVars: m } = l ?? {}, h =
|
|
24
|
+
}), R = v(({ items: n, labels: r, logo: i, footer: s, renderLink: c = L, styles: l }) => {
|
|
25
|
+
let { colors: u, typography: d, className: p, cssVars: m } = l ?? {}, h = S().replace(/[^\w-]/g, ""), _ = `np-hover-gradient-${h}`, v = `np-active-gradient-${h}`, y = C(() => e({
|
|
26
26
|
"--np-bg": u?.background,
|
|
27
27
|
"--np-item-text": u?.itemText,
|
|
28
28
|
"--np-item-active-text": u?.itemActiveText,
|
|
@@ -44,7 +44,7 @@ var I = {
|
|
|
44
44
|
...m,
|
|
45
45
|
...y
|
|
46
46
|
},
|
|
47
|
-
className: t(
|
|
47
|
+
className: t(I.rail, "relative z-10 flex h-full w-[60px] flex-col justify-between shadow-sm", d?.fontClassName, p, F.rail),
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ E("svg", {
|
|
50
50
|
"aria-hidden": !0,
|
|
@@ -103,7 +103,7 @@ var I = {
|
|
|
103
103
|
"aria-current": e.isActive ? "page" : void 0,
|
|
104
104
|
tooltipProps: { tooltip: e.label },
|
|
105
105
|
tabIndex: -1,
|
|
106
|
-
className: t(
|
|
106
|
+
className: t(I.item, "rounded-xl", e.isActive && I.itemActive, n && I.itemFilled, e.isActive && !n && I.itemFilledOutline, F.item)
|
|
107
107
|
})) }, e.id);
|
|
108
108
|
})
|
|
109
109
|
})]
|
|
@@ -111,12 +111,12 @@ var I = {
|
|
|
111
111
|
s
|
|
112
112
|
]
|
|
113
113
|
});
|
|
114
|
-
}),
|
|
114
|
+
}), ie = /* @__PURE__ */ function(e) {
|
|
115
115
|
return e.Sidebar = "sidebar", e.Drawer = "drawer", e;
|
|
116
|
-
}({}),
|
|
116
|
+
}({}), z = {
|
|
117
117
|
stopStart: "_stopStart_8i550_1",
|
|
118
118
|
stopEnd: "_stopEnd_8i550_5"
|
|
119
|
-
},
|
|
119
|
+
}, ae = ({ activeGradientId: e }) => /* @__PURE__ */ E("svg", {
|
|
120
120
|
"aria-hidden": !0,
|
|
121
121
|
className: "absolute size-0",
|
|
122
122
|
focusable: "false",
|
|
@@ -129,13 +129,13 @@ var I = {
|
|
|
129
129
|
y2: "20.4",
|
|
130
130
|
children: [/* @__PURE__ */ E("stop", {
|
|
131
131
|
offset: "0",
|
|
132
|
-
className:
|
|
132
|
+
className: z.stopStart
|
|
133
133
|
}), /* @__PURE__ */ E("stop", {
|
|
134
134
|
offset: "1",
|
|
135
|
-
className:
|
|
135
|
+
className: z.stopEnd
|
|
136
136
|
})]
|
|
137
137
|
}) })
|
|
138
|
-
}),
|
|
138
|
+
}), B = {
|
|
139
139
|
sidebar: "_sidebar_1w4pz_1",
|
|
140
140
|
sidebarColumn: "_sidebarColumn_1w4pz_7",
|
|
141
141
|
item: "_item_1w4pz_16",
|
|
@@ -144,19 +144,19 @@ var I = {
|
|
|
144
144
|
itemFilledOutline: "_itemFilledOutline_1w4pz_45",
|
|
145
145
|
itemIcon: "_itemIcon_1w4pz_49",
|
|
146
146
|
footer: "_footer_1w4pz_55"
|
|
147
|
-
},
|
|
147
|
+
}, oe = (e, t, n) => /* @__PURE__ */ E("a", {
|
|
148
148
|
href: e.href,
|
|
149
149
|
...n,
|
|
150
150
|
children: t
|
|
151
|
-
}),
|
|
152
|
-
let { colors: O, typography: k, className: A, cssVars: te } =
|
|
151
|
+
}), se = (e, t) => e ? "w-[320px] max-w-full" : t ? "w-[72px]" : "w-[336px]", ce = (e, n) => e ? t("fixed inset-y-0 start-0 z-50 flex flex-col overflow-hidden shadow-sm outline-none", "transition-[transform,visibility] duration-200 ease-in-out motion-reduce:transition-none", n ? "visible translate-x-0" : "invisible ltr:-translate-x-full rtl:translate-x-full") : t(B.sidebarColumn, "relative z-10 flex h-full shrink-0 flex-col overflow-hidden shadow-sm"), V = v(({ items: n, labels: r, variant: i = ie.Sidebar, isCollapsed: s = !1, onToggleCollapse: c, isOpen: u = !1, onClose: f, id: p, logo: m, renderLink: _ = oe, children: v, userMenu: y, footerActions: b, styles: ee }) => {
|
|
152
|
+
let { colors: O, typography: k, className: A, cssVars: te } = ee ?? {}, ne = k?.fontClassName ?? "dial-small-text", M = i === ie.Drawer, N = !M && s, P = S(), I = p ?? P, L = `np-sidebar-gradient-${P.replace(/[^\w-]/g, "")}`, R = w(null), z = w(null), V = w(u);
|
|
153
153
|
x(() => {
|
|
154
|
-
let e =
|
|
155
|
-
|
|
154
|
+
let e = V.current;
|
|
155
|
+
V.current = u, M && (u && !e ? (z.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, R.current?.focus()) : !u && e && (z.current?.focus(), z.current = null));
|
|
156
156
|
}, [M, u]);
|
|
157
|
-
let
|
|
157
|
+
let H = (e) => {
|
|
158
158
|
e.currentTarget.contains(e.target) && e.key === "Escape" && f?.();
|
|
159
|
-
},
|
|
159
|
+
}, U = C(() => e({
|
|
160
160
|
"--np-sidebar-bg": O?.background,
|
|
161
161
|
"--np-sidebar-item-text": O?.itemText,
|
|
162
162
|
"--np-sidebar-item-hover-bg": O?.itemHoverBackground,
|
|
@@ -164,19 +164,19 @@ var I = {
|
|
|
164
164
|
"--np-sidebar-focus-outline": O?.focusOutline,
|
|
165
165
|
"--np-sidebar-gradient-start": O?.itemActiveGradientStart,
|
|
166
166
|
"--np-sidebar-gradient-end": O?.itemActiveGradientEnd,
|
|
167
|
-
"--np-sidebar-item-active-icon": O?.itemActiveIcon ?? `url(#${
|
|
167
|
+
"--np-sidebar-item-active-icon": O?.itemActiveIcon ?? `url(#${L})`,
|
|
168
168
|
"--np-sidebar-font-family": k?.fontFamily
|
|
169
169
|
}), [
|
|
170
170
|
O,
|
|
171
171
|
k?.fontFamily,
|
|
172
|
-
|
|
173
|
-
]),
|
|
172
|
+
L
|
|
173
|
+
]), W = N ? r.expand ?? "Expand sidebar" : r.collapse ?? "Collapse sidebar", G = r.toggle ?? "Sidebar", K = r.close ?? "Close", q = (e, n) => /* @__PURE__ */ E("span", {
|
|
174
174
|
style: { backgroundImage: `url("${e}")` },
|
|
175
175
|
className: t("bg-contain bg-center bg-no-repeat", n)
|
|
176
|
-
}),
|
|
176
|
+
}), J = () => /* @__PURE__ */ E(d, {
|
|
177
177
|
icon: /* @__PURE__ */ D("span", {
|
|
178
178
|
className: "relative block size-6 shrink-0",
|
|
179
|
-
children: [N && m &&
|
|
179
|
+
children: [N && m && q(m.iconUrl, "absolute inset-0 transition-opacity group-focus-visible/toggle:opacity-0 group-hover/toggle:opacity-0"), /* @__PURE__ */ E(j, {
|
|
180
180
|
size: a.LG,
|
|
181
181
|
stroke: o,
|
|
182
182
|
className: t("absolute inset-0 rtl:scale-x-[-1]", N && m && "opacity-0 group-hover/toggle:opacity-100 group-focus-visible/toggle:opacity-100"),
|
|
@@ -184,34 +184,34 @@ var I = {
|
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
186
|
size: l.Large,
|
|
187
|
-
"aria-label":
|
|
187
|
+
"aria-label": G,
|
|
188
188
|
"aria-expanded": !N,
|
|
189
|
-
"aria-controls":
|
|
190
|
-
tooltipProps: { tooltip:
|
|
189
|
+
"aria-controls": I,
|
|
190
|
+
tooltipProps: { tooltip: W },
|
|
191
191
|
onClick: c,
|
|
192
192
|
className: "group/toggle size-10! min-h-0! min-w-0! shrink-0 rounded-full! p-2!"
|
|
193
|
-
}),
|
|
194
|
-
icon: /* @__PURE__ */ E(
|
|
193
|
+
}), Y = () => /* @__PURE__ */ E(d, {
|
|
194
|
+
icon: /* @__PURE__ */ E(re, {
|
|
195
195
|
size: a.LG,
|
|
196
196
|
stroke: o,
|
|
197
197
|
"aria-hidden": !0
|
|
198
198
|
}),
|
|
199
199
|
size: l.Large,
|
|
200
|
-
"aria-label":
|
|
201
|
-
tooltipProps: { tooltip:
|
|
200
|
+
"aria-label": K,
|
|
201
|
+
tooltipProps: { tooltip: K },
|
|
202
202
|
onClick: f,
|
|
203
203
|
className: "size-10! min-h-0! min-w-0! shrink-0 rounded-full! p-2!"
|
|
204
204
|
}), X = () => m && /* @__PURE__ */ E("a", {
|
|
205
205
|
href: m.href ?? "/",
|
|
206
206
|
"aria-label": m.ariaLabel,
|
|
207
207
|
className: t("flex h-10 items-center", !M && "ps-2"),
|
|
208
|
-
children:
|
|
208
|
+
children: q(N ? m.iconUrl : m.logoUrl ?? m.iconUrl, N ? "size-6" : "h-6 min-w-[116px]")
|
|
209
209
|
}), Z = () => /* @__PURE__ */ D("div", {
|
|
210
210
|
className: "flex shrink-0 items-center justify-between ps-4 pe-2 pt-3 pb-2",
|
|
211
|
-
children: [X(), f &&
|
|
212
|
-
}), Q = () => /* @__PURE__ */ D(T, { children: [!(N && c) && X(), c &&
|
|
211
|
+
children: [X(), f && Y()]
|
|
212
|
+
}), Q = () => /* @__PURE__ */ D(T, { children: [!(N && c) && X(), c && J()] }), $ = (e) => {
|
|
213
213
|
let n = !!e.isActive && !!e.activeIcon, r = n && e.activeIcon || e.icon, i = /* @__PURE__ */ E("span", {
|
|
214
|
-
className: t("flex size-6 shrink-0 items-center justify-center",
|
|
214
|
+
className: t("flex size-6 shrink-0 items-center justify-center", B.itemIcon),
|
|
215
215
|
children: /* @__PURE__ */ E(r, {
|
|
216
216
|
size: a.LG,
|
|
217
217
|
stroke: o
|
|
@@ -220,7 +220,7 @@ var I = {
|
|
|
220
220
|
className: N ? "sr-only" : ne,
|
|
221
221
|
children: e.label
|
|
222
222
|
})] }), {
|
|
223
|
-
className: t("flex items-center rounded-full p-2 no-underline", N ? "size-10 justify-center" : "h-10 w-full gap-2",
|
|
223
|
+
className: t("flex items-center rounded-full p-2 no-underline", N ? "size-10 justify-center" : "h-10 w-full gap-2", B.item, e.isActive && B.itemActive, n && B.itemFilled, e.isActive && !n && B.itemFilledOutline, F.sidebarItem),
|
|
224
224
|
"aria-current": e.isActive ? "page" : void 0
|
|
225
225
|
});
|
|
226
226
|
return /* @__PURE__ */ E("li", { children: N ? /* @__PURE__ */ E(h, {
|
|
@@ -230,19 +230,19 @@ var I = {
|
|
|
230
230
|
}) : s }, e.id);
|
|
231
231
|
}, le = N ? /* @__PURE__ */ D(g, { children: [b, y] }) : /* @__PURE__ */ D(g, { children: [y, b] });
|
|
232
232
|
return /* @__PURE__ */ D("nav", {
|
|
233
|
-
ref:
|
|
234
|
-
id:
|
|
233
|
+
ref: R,
|
|
234
|
+
id: I,
|
|
235
235
|
"aria-label": r.ariaLabel,
|
|
236
236
|
tabIndex: M ? -1 : void 0,
|
|
237
237
|
inert: M && !u,
|
|
238
|
-
onKeyDown: M ?
|
|
238
|
+
onKeyDown: M ? H : void 0,
|
|
239
239
|
style: {
|
|
240
240
|
...te,
|
|
241
|
-
...
|
|
241
|
+
...U
|
|
242
242
|
},
|
|
243
|
-
className: t(
|
|
243
|
+
className: t(B.sidebar, ce(M, u), se(M, N), A, F.sidebar),
|
|
244
244
|
children: [
|
|
245
|
-
!O?.itemActiveIcon && /* @__PURE__ */ E(
|
|
245
|
+
!O?.itemActiveIcon && /* @__PURE__ */ E(ae, { activeGradientId: L }),
|
|
246
246
|
M ? /* @__PURE__ */ D("div", {
|
|
247
247
|
className: "flex shrink-0 flex-col",
|
|
248
248
|
children: [Z(), /* @__PURE__ */ E("ul", {
|
|
@@ -268,20 +268,20 @@ var I = {
|
|
|
268
268
|
})
|
|
269
269
|
}),
|
|
270
270
|
/* @__PURE__ */ E("div", {
|
|
271
|
-
className: t("flex shrink-0 px-4 py-3 shadow-lg",
|
|
271
|
+
className: t("flex shrink-0 px-4 py-3 shadow-lg", B.footer, N ? "flex-col items-start gap-2" : "items-center justify-between gap-2", F.sidebarFooter),
|
|
272
272
|
children: le
|
|
273
273
|
})
|
|
274
274
|
]
|
|
275
275
|
});
|
|
276
|
-
}),
|
|
276
|
+
}), H = /* @__PURE__ */ function(e) {
|
|
277
277
|
return e.Avatar = "avatar", e.Profile = "profile", e.Compact = "compact", e;
|
|
278
|
-
}({}),
|
|
278
|
+
}({}), U = { avatar: "_avatar_4hc9t_4" }, W = v(({ shortName: e, className: r, textClassName: i = "dial-tiny-text" }) => /* @__PURE__ */ E(n, {
|
|
279
279
|
name: e ?? "",
|
|
280
280
|
initials: e ?? "",
|
|
281
281
|
size: 28,
|
|
282
282
|
textClassName: i,
|
|
283
|
-
className: t(
|
|
284
|
-
})),
|
|
283
|
+
className: t(U.avatar, r)
|
|
284
|
+
})), G = v(({ profile: e, alt: t, size: r = 28 }) => {
|
|
285
285
|
let i = e.isFallbackShown || !e.imageUrl;
|
|
286
286
|
return /* @__PURE__ */ E(n, {
|
|
287
287
|
name: e.displayName,
|
|
@@ -290,24 +290,24 @@ var I = {
|
|
|
290
290
|
alt: i ? "" : t,
|
|
291
291
|
size: r,
|
|
292
292
|
textClassName: "dial-tiny-text",
|
|
293
|
-
className:
|
|
293
|
+
className: U.avatar,
|
|
294
294
|
onImageError: e.onImageError
|
|
295
295
|
});
|
|
296
|
-
}),
|
|
296
|
+
}), K = {
|
|
297
297
|
wrapper: "_wrapper_11e9t_1",
|
|
298
298
|
trigger: "_trigger_11e9t_5",
|
|
299
299
|
triggerOpen: "_triggerOpen_11e9t_18",
|
|
300
300
|
identityText: "_identityText_11e9t_22",
|
|
301
301
|
menuLabel: "_menuLabel_11e9t_26"
|
|
302
|
-
},
|
|
303
|
-
let { colors:
|
|
304
|
-
"--np-avatar-bg":
|
|
305
|
-
"--np-avatar-text":
|
|
306
|
-
"--np-menu-text":
|
|
307
|
-
"--np-trigger-hover-bg":
|
|
308
|
-
"--np-trigger-open-bg":
|
|
309
|
-
"--np-font-family":
|
|
310
|
-
}), [
|
|
302
|
+
}, q = v(({ profile: n, labels: r, groups: l, onLogout: d, onSettings: f, triggerVariant: p = H.Avatar, isTooltipHidden: h, isIdentityHidden: g = !1, styles: _ }) => {
|
|
303
|
+
let { colors: v, typography: y, className: b, cssVars: x } = _ ?? {}, [S, w] = ee(!1), O = p === H.Profile, A = p === H.Compact, j = O || A, N = y?.fontClassName ?? "dial-small-text", re = C(() => e({
|
|
304
|
+
"--np-avatar-bg": v?.avatarBackground,
|
|
305
|
+
"--np-avatar-text": v?.avatarText,
|
|
306
|
+
"--np-menu-text": v?.text,
|
|
307
|
+
"--np-trigger-hover-bg": v?.triggerHoverBackground,
|
|
308
|
+
"--np-trigger-open-bg": v?.triggerOpenBackground,
|
|
309
|
+
"--np-font-family": y?.fontFamily
|
|
310
|
+
}), [v, y?.fontFamily]), P = C(() => t(K.menuLabel, N), [N]), F = C(() => {
|
|
311
311
|
let e = (l ?? []).filter(({ options: e }) => e.length > 0).map(({ id: e, label: t, icon: n, options: r }) => ({
|
|
312
312
|
key: e,
|
|
313
313
|
label: /* @__PURE__ */ E("span", {
|
|
@@ -326,24 +326,23 @@ var I = {
|
|
|
326
326
|
checked: e.isActive,
|
|
327
327
|
onClick: e.onSelect
|
|
328
328
|
}))
|
|
329
|
-
}))
|
|
329
|
+
})), i = [...g ? [] : [{
|
|
330
|
+
key: "identity",
|
|
331
|
+
type: c.PlainText,
|
|
332
|
+
label: /* @__PURE__ */ D("div", {
|
|
333
|
+
className: "flex h-[40px] min-w-0 items-center gap-3",
|
|
334
|
+
children: [/* @__PURE__ */ E(W, { shortName: n.shortName }), /* @__PURE__ */ E(u, {
|
|
335
|
+
text: n.displayName,
|
|
336
|
+
className: t(K.identityText, N, "min-w-0 flex-1 truncate")
|
|
337
|
+
})]
|
|
338
|
+
})
|
|
339
|
+
}], ...e];
|
|
330
340
|
return [
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
type: c.PlainText,
|
|
334
|
-
label: /* @__PURE__ */ D("div", {
|
|
335
|
-
className: "flex h-[40px] min-w-0 items-center gap-3",
|
|
336
|
-
children: [/* @__PURE__ */ E(K, { shortName: n.shortName }), /* @__PURE__ */ E(u, {
|
|
337
|
-
text: n.displayName,
|
|
338
|
-
className: t(J.identityText, j, "min-w-0 flex-1 truncate")
|
|
339
|
-
})]
|
|
340
|
-
})
|
|
341
|
-
},
|
|
342
|
-
...e,
|
|
343
|
-
{
|
|
341
|
+
...i,
|
|
342
|
+
...i.length > 0 ? [{
|
|
344
343
|
key: "divider-1",
|
|
345
344
|
type: c.Divider
|
|
346
|
-
},
|
|
345
|
+
}] : [],
|
|
347
346
|
...f ? [{
|
|
348
347
|
key: "settings",
|
|
349
348
|
label: /* @__PURE__ */ E("span", {
|
|
@@ -373,7 +372,8 @@ var I = {
|
|
|
373
372
|
];
|
|
374
373
|
}, [
|
|
375
374
|
l,
|
|
376
|
-
|
|
375
|
+
g,
|
|
376
|
+
N,
|
|
377
377
|
P,
|
|
378
378
|
r.logOut,
|
|
379
379
|
r.settings,
|
|
@@ -382,33 +382,33 @@ var I = {
|
|
|
382
382
|
n.displayName,
|
|
383
383
|
n.shortName
|
|
384
384
|
]), I = () => {
|
|
385
|
-
if (!
|
|
385
|
+
if (!O) return /* @__PURE__ */ E(i, {
|
|
386
386
|
"aria-label": r.trigger,
|
|
387
387
|
tooltipProps: {
|
|
388
388
|
tooltip: n.email,
|
|
389
389
|
hideTooltip: h
|
|
390
390
|
},
|
|
391
|
-
iconBefore: /* @__PURE__ */ E(
|
|
391
|
+
iconBefore: /* @__PURE__ */ E(G, {
|
|
392
392
|
profile: n,
|
|
393
393
|
alt: r.avatarAlt,
|
|
394
|
-
size:
|
|
394
|
+
size: A ? 24 : void 0
|
|
395
395
|
}),
|
|
396
|
-
className: t(
|
|
396
|
+
className: t(A ? "!size-10 !min-h-0 !min-w-0 gap-0 !rounded-full !border-0 !p-2" : "size-[44px] gap-0 !rounded-full p-0", K.trigger, A && S && K.triggerOpen)
|
|
397
397
|
});
|
|
398
|
-
let e =
|
|
398
|
+
let e = S ? te : k;
|
|
399
399
|
return /* @__PURE__ */ E(i, {
|
|
400
400
|
tooltipProps: {
|
|
401
401
|
tooltip: n.email,
|
|
402
402
|
hideTooltip: h
|
|
403
403
|
},
|
|
404
|
-
iconBefore: /* @__PURE__ */ E(
|
|
404
|
+
iconBefore: /* @__PURE__ */ E(G, {
|
|
405
405
|
profile: n,
|
|
406
406
|
alt: "",
|
|
407
407
|
size: 24
|
|
408
408
|
}),
|
|
409
409
|
label: /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(u, {
|
|
410
410
|
text: n.displayName,
|
|
411
|
-
className: t(
|
|
411
|
+
className: t(K.identityText, N, "min-w-0 truncate")
|
|
412
412
|
}), /* @__PURE__ */ E("span", {
|
|
413
413
|
className: "sr-only",
|
|
414
414
|
children: r.trigger
|
|
@@ -419,26 +419,26 @@ var I = {
|
|
|
419
419
|
"aria-hidden": !0
|
|
420
420
|
}),
|
|
421
421
|
textClassName: "min-w-0",
|
|
422
|
-
className: t("!h-10 !min-h-0 max-w-full !min-w-0 gap-2 !rounded-full !border-0 !p-2",
|
|
422
|
+
className: t("!h-10 !min-h-0 max-w-full !min-w-0 gap-2 !rounded-full !border-0 !p-2", K.trigger, S && K.triggerOpen)
|
|
423
423
|
});
|
|
424
424
|
};
|
|
425
425
|
return /* @__PURE__ */ E("div", {
|
|
426
426
|
style: {
|
|
427
|
-
...
|
|
428
|
-
...
|
|
427
|
+
...x,
|
|
428
|
+
...re
|
|
429
429
|
},
|
|
430
|
-
className: t(
|
|
430
|
+
className: t(K.wrapper, j ? "flex min-w-0 items-center" : "flex size-[60px] items-center justify-center", O && "flex-1", b),
|
|
431
431
|
children: /* @__PURE__ */ E(s, {
|
|
432
|
-
className:
|
|
433
|
-
placement:
|
|
432
|
+
className: j ? "max-w-full min-w-0" : void 0,
|
|
433
|
+
placement: j ? "top-start" : "top-end",
|
|
434
434
|
matchReferenceWidth: !1,
|
|
435
435
|
items: F,
|
|
436
|
-
onOpenChange:
|
|
436
|
+
onOpenChange: w,
|
|
437
437
|
children: I()
|
|
438
438
|
})
|
|
439
439
|
});
|
|
440
|
-
}),
|
|
441
|
-
let [c, l] =
|
|
440
|
+
}), J = _(void 0), Y = v(({ isOpen: e, onClose: t, children: n, title: r, closeLabel: i, backLabel: a, className: o, style: s }) => {
|
|
441
|
+
let [c, l] = ee([]);
|
|
442
442
|
x(() => {
|
|
443
443
|
e || l([]);
|
|
444
444
|
}, [e]);
|
|
@@ -448,7 +448,7 @@ var I = {
|
|
|
448
448
|
l((e) => e.slice(0, -1));
|
|
449
449
|
}, []), f = y(() => {
|
|
450
450
|
l([]), t();
|
|
451
|
-
}, [t]), p =
|
|
451
|
+
}, [t]), p = C(() => ({
|
|
452
452
|
push: u,
|
|
453
453
|
pop: d,
|
|
454
454
|
close: f
|
|
@@ -457,9 +457,9 @@ var I = {
|
|
|
457
457
|
d,
|
|
458
458
|
f
|
|
459
459
|
]), m = c[c.length - 1];
|
|
460
|
-
return /* @__PURE__ */ E(
|
|
460
|
+
return /* @__PURE__ */ E(J.Provider, {
|
|
461
461
|
value: p,
|
|
462
|
-
children: /* @__PURE__ */ E(
|
|
462
|
+
children: /* @__PURE__ */ E(P, {
|
|
463
463
|
isOpen: e,
|
|
464
464
|
onClose: f,
|
|
465
465
|
title: m?.title ?? r,
|
|
@@ -472,7 +472,7 @@ var I = {
|
|
|
472
472
|
})
|
|
473
473
|
});
|
|
474
474
|
}), X = () => {
|
|
475
|
-
let e = b(
|
|
475
|
+
let e = b(J);
|
|
476
476
|
if (!e) throw Error("useSheetNavigation must be used within a NavigableBottomSheet");
|
|
477
477
|
return e;
|
|
478
478
|
}, Z = {
|
|
@@ -521,7 +521,7 @@ var I = {
|
|
|
521
521
|
return /* @__PURE__ */ D(T, { children: [
|
|
522
522
|
/* @__PURE__ */ D("div", {
|
|
523
523
|
className: "flex h-[56px] items-center gap-3 px-4 py-2",
|
|
524
|
-
children: [/* @__PURE__ */ E(
|
|
524
|
+
children: [/* @__PURE__ */ E(G, {
|
|
525
525
|
profile: e,
|
|
526
526
|
alt: ""
|
|
527
527
|
}), /* @__PURE__ */ E(u, {
|
|
@@ -621,7 +621,7 @@ var I = {
|
|
|
621
621
|
})]
|
|
622
622
|
}), d] });
|
|
623
623
|
}), de = v(({ isOpen: n, onClose: r, items: i, onSelectItem: a, labels: o, profile: s, groups: c, onLogout: l, onSettings: u, footer: d, styles: f }) => {
|
|
624
|
-
let { colors: p, typography: m, className: h, cssVars: g } = f ?? {}, _ =
|
|
624
|
+
let { colors: p, typography: m, className: h, cssVars: g } = f ?? {}, _ = C(() => e({
|
|
625
625
|
"--np-sheet-text": p?.text,
|
|
626
626
|
"--np-sheet-item-hover": p?.itemHoverBackground,
|
|
627
627
|
"--np-sheet-item-active": p?.itemActiveBackground,
|
|
@@ -635,7 +635,7 @@ var I = {
|
|
|
635
635
|
"--np-menu-active-icon": p?.activeIcon,
|
|
636
636
|
"--np-font-family": m?.fontFamily
|
|
637
637
|
}), [p, m?.fontFamily]);
|
|
638
|
-
return /* @__PURE__ */ E(
|
|
638
|
+
return /* @__PURE__ */ E(Y, {
|
|
639
639
|
isOpen: n,
|
|
640
640
|
onClose: r,
|
|
641
641
|
title: o.title,
|
|
@@ -662,4 +662,4 @@ var I = {
|
|
|
662
662
|
});
|
|
663
663
|
});
|
|
664
664
|
//#endregion
|
|
665
|
-
export {
|
|
665
|
+
export { W as AvatarInitials, F as NAVIGATION_PANEL_CLASS, Y as NavigableBottomSheet, ue as NavigationMenuPage, R as NavigationPanel, de as NavigationSheet, V as NavigationSidebar, ie as NavigationSidebarVariant, $ as OptionListPage, le as ProfilePage, Q as SheetRow, G as UserAvatar, q as UserMenu, H as UserMenuTriggerVariant, X as useSheetNavigation };
|
|
@@ -60,6 +60,8 @@ export interface UserMenuProps {
|
|
|
60
60
|
triggerVariant?: UserMenuTriggerVariant;
|
|
61
61
|
/** Hides the avatar tooltip — set on touch layouts where hover never fires. */
|
|
62
62
|
isTooltipHidden?: boolean;
|
|
63
|
+
/** Omits the identity row — avatar initials and display name — from the top of the dropdown. Defaults to `false`. */
|
|
64
|
+
isIdentityHidden?: boolean;
|
|
63
65
|
/** Style overrides for colors, typography, and class names. */
|
|
64
66
|
styles?: UserMenuStyles;
|
|
65
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-menu-props.d.ts","sourceRoot":"","sources":["../../src/models/user-menu-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,gBA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CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oCAAoC;AACpC,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,OAAO,EAAE,qBAAqB,CAAC;IAC/B,oEAAoE;IACpE,MAAM,EAAE,cAAc,CAAC;IACvB,oFAAoF;IACpF,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC/B,iFAAiF;IACjF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,gFAAgF;IAChF,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC,+EAA+E;IAC/E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qHAAqH;IACrH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-navigation-panel",
|
|
3
3
|
"description": "Primary application navigation — desktop nav rail, user menu, and mobile navigation bottom sheet",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.176",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.44.0",
|
|
21
|
-
"@epam/ai-dial-conversation-input": "1.3.0-dev.
|
|
21
|
+
"@epam/ai-dial-conversation-input": "1.3.0-dev.176"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.176",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.35"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|