@epam/ai-dial-sidebar 1.1.0-dev.297 → 1.1.0-dev.299
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":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarPanel/SidebarPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarPanel/SidebarPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,6GAA6G;AAC7G,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAuM9C,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,108 +1,108 @@
|
|
|
1
1
|
import { PanelEmptyState as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { DIAL_ICON_SIZE as r,
|
|
3
|
-
import { IconFileSad as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
2
|
+
import { DIAL_ICON_SIZE as r, DIAL_KIT_ICON_STROKE as i, DialConditionalResizableContainer as a, EllipsisTooltip as o, GhostIconButton as s, ResizableContainerSide as c } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconFileSad as l, IconMessageCircle as u, IconX as d } from "@tabler/icons-react";
|
|
4
|
+
import { memo as f, useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
5
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
6
6
|
//#region src/types/orientation.ts
|
|
7
|
-
var
|
|
7
|
+
var x = /* @__PURE__ */ function(e) {
|
|
8
8
|
return e.Left = "left", e.Right = "right", e;
|
|
9
|
-
}({}),
|
|
9
|
+
}({}), S = {
|
|
10
10
|
wrapper: "_wrapper_1civp_1",
|
|
11
11
|
header: "_header_1civp_6",
|
|
12
12
|
appear: "_appear_1civp_18",
|
|
13
13
|
fadeIn: "_fadeIn_1civp_1",
|
|
14
14
|
resizeHandler: "_resizeHandler_1civp_22"
|
|
15
|
-
},
|
|
16
|
-
className: n("flex h-12 items-center px-4", i,
|
|
15
|
+
}, C = f(({ title: e, titleClassName: t = "dial-h1-text", leftActions: r, className: i, rightActions: a }) => /* @__PURE__ */ b("div", {
|
|
16
|
+
className: n("flex h-12 items-center px-4", i, S.header),
|
|
17
17
|
children: [
|
|
18
|
-
r && /* @__PURE__ */
|
|
18
|
+
r && /* @__PURE__ */ y("div", {
|
|
19
19
|
className: "flex items-center gap-1",
|
|
20
20
|
children: r
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
22
|
+
/* @__PURE__ */ y(o, {
|
|
23
23
|
text: e,
|
|
24
24
|
className: n("min-w-0 flex-1 truncate", t)
|
|
25
25
|
}),
|
|
26
|
-
|
|
26
|
+
a && /* @__PURE__ */ y("div", {
|
|
27
27
|
className: "flex items-center gap-1",
|
|
28
|
-
children:
|
|
28
|
+
children: a
|
|
29
29
|
})
|
|
30
30
|
]
|
|
31
|
-
})),
|
|
32
|
-
let { colors:
|
|
33
|
-
"--sb-bg":
|
|
34
|
-
"--sb-border":
|
|
35
|
-
"--sb-text":
|
|
36
|
-
"--sb-resize-handler":
|
|
37
|
-
}), [
|
|
38
|
-
|
|
39
|
-
if (!e)
|
|
31
|
+
})), w = ({ isOpen: e, orientation: o, title: l, leftActions: u, rightActions: f, onClose: w, labels: T, children: E, styles: D, resizable: O, defaultWidth: k = 360, minWidth: A = 280, maxWidth: j = 600, onResizeStop: M }) => {
|
|
32
|
+
let { colors: N, typography: P, bodyClassName: F, cssVars: I, titleClassName: L, className: R, headerClassName: z } = D ?? {}, B = h(() => t({
|
|
33
|
+
"--sb-bg": N?.background,
|
|
34
|
+
"--sb-border": N?.border,
|
|
35
|
+
"--sb-text": N?.text,
|
|
36
|
+
"--sb-resize-handler": N?.resizeHandler
|
|
37
|
+
}), [N]), V = g(k), [H, U] = _(e ? k : 0), [W, G] = _(!1), K = g(null);
|
|
38
|
+
m(() => {
|
|
39
|
+
if (!e) U(k), V.current = k, G(!1), K.current = null;
|
|
40
40
|
else {
|
|
41
|
-
let e =
|
|
42
|
-
|
|
41
|
+
let e = K.current, t = e?.forDefault === k ? e.width : k;
|
|
42
|
+
U(t), V.current = t;
|
|
43
43
|
}
|
|
44
|
-
}, [e,
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
}, []),
|
|
48
|
-
|
|
49
|
-
forDefault:
|
|
44
|
+
}, [e, k]);
|
|
45
|
+
let q = p((e) => {
|
|
46
|
+
G(!0), U(e);
|
|
47
|
+
}, []), J = p((e) => {
|
|
48
|
+
K.current = {
|
|
49
|
+
forDefault: k,
|
|
50
50
|
width: e
|
|
51
|
-
},
|
|
52
|
-
}, [
|
|
53
|
-
icon: /* @__PURE__ */
|
|
51
|
+
}, V.current = e, U(e), G(!1), M?.(e);
|
|
52
|
+
}, [k, M]), Y = e ? H || V.current : 0, X = R?.includes("w-full"), Z = o === x.Left && e ? "border-s" : void 0, Q = o === x.Right ? c.Left : c.Right, $ = w ? /* @__PURE__ */ y(s, {
|
|
53
|
+
icon: /* @__PURE__ */ y(d, {
|
|
54
54
|
size: r.LG,
|
|
55
|
-
stroke:
|
|
55
|
+
stroke: i,
|
|
56
56
|
"aria-hidden": !0
|
|
57
57
|
}),
|
|
58
|
-
"aria-label":
|
|
59
|
-
tooltipProps: { tooltip:
|
|
60
|
-
onClick:
|
|
58
|
+
"aria-label": T.closeLabel,
|
|
59
|
+
tooltipProps: { tooltip: T.closeLabel },
|
|
60
|
+
onClick: w
|
|
61
61
|
}) : null;
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
style:
|
|
64
|
-
className: n("h-full flex-shrink-0 gap-3 overflow-hidden shadow-
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
enabled: (
|
|
67
|
-
side:
|
|
68
|
-
width: e ?
|
|
69
|
-
defaultWidth:
|
|
70
|
-
minWidth:
|
|
71
|
-
maxWidth:
|
|
72
|
-
resizeHandlerClassName:
|
|
73
|
-
onResizeStop:
|
|
74
|
-
onResize:
|
|
75
|
-
children: /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ y("div", {
|
|
63
|
+
style: X ? void 0 : { width: Y },
|
|
64
|
+
className: n("h-full flex-shrink-0 gap-3 overflow-hidden shadow-sm", o === x.Left && "[clip-path:inset(-24px_-24px_-24px_0)] rtl:[clip-path:inset(-24px_0_-24px_-24px)]", !W && "transition-[width] duration-200 ease-in-out", e && "relative z-50", R, S.panel),
|
|
65
|
+
children: /* @__PURE__ */ y(a, {
|
|
66
|
+
enabled: (O ?? !1) && e,
|
|
67
|
+
side: Q,
|
|
68
|
+
width: e ? H || V.current : void 0,
|
|
69
|
+
defaultWidth: k,
|
|
70
|
+
minWidth: A,
|
|
71
|
+
maxWidth: j,
|
|
72
|
+
resizeHandlerClassName: S.resizeHandler,
|
|
73
|
+
onResizeStop: J,
|
|
74
|
+
onResize: q,
|
|
75
|
+
children: /* @__PURE__ */ b("aside", {
|
|
76
76
|
role: "complementary",
|
|
77
|
-
"aria-label":
|
|
77
|
+
"aria-label": T.ariaLabel,
|
|
78
78
|
inert: !e,
|
|
79
79
|
style: {
|
|
80
|
-
...
|
|
81
|
-
...
|
|
80
|
+
...I,
|
|
81
|
+
...B
|
|
82
82
|
},
|
|
83
|
-
className: n(
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
title:
|
|
86
|
-
className:
|
|
87
|
-
titleClassName:
|
|
88
|
-
leftActions: e &&
|
|
89
|
-
rightActions: e && /* @__PURE__ */
|
|
90
|
-
}), /* @__PURE__ */
|
|
91
|
-
className: n("flex-1 overflow-y-auto p-4 pt-0",
|
|
92
|
-
children:
|
|
83
|
+
className: n(S.wrapper, "flex h-full w-full flex-col gap-3", e && S.appear, Z, P?.fontClassName),
|
|
84
|
+
children: [/* @__PURE__ */ y(C, {
|
|
85
|
+
title: l,
|
|
86
|
+
className: z,
|
|
87
|
+
titleClassName: L,
|
|
88
|
+
leftActions: e && u,
|
|
89
|
+
rightActions: e && /* @__PURE__ */ b(v, { children: [f, $] })
|
|
90
|
+
}), /* @__PURE__ */ y("div", {
|
|
91
|
+
className: n("flex-1 overflow-y-auto p-4 pt-0", F),
|
|
92
|
+
children: E
|
|
93
93
|
})]
|
|
94
94
|
})
|
|
95
95
|
})
|
|
96
96
|
});
|
|
97
|
-
},
|
|
98
|
-
icon: /* @__PURE__ */
|
|
97
|
+
}, T = f(({ label: t, icon: n = u, iconSize: r = 48 }) => /* @__PURE__ */ y(e, {
|
|
98
|
+
icon: /* @__PURE__ */ y(n, {
|
|
99
99
|
"aria-hidden": !0,
|
|
100
100
|
size: r,
|
|
101
101
|
stroke: 1
|
|
102
102
|
}),
|
|
103
103
|
label: t
|
|
104
|
-
})),
|
|
105
|
-
icon: /* @__PURE__ */
|
|
104
|
+
})), E = f(({ label: t, icon: n = l, iconSize: r = 32 }) => /* @__PURE__ */ y(e, {
|
|
105
|
+
icon: /* @__PURE__ */ y(n, {
|
|
106
106
|
"aria-hidden": !0,
|
|
107
107
|
size: r,
|
|
108
108
|
stroke: 1
|
|
@@ -111,4 +111,4 @@ var b = /* @__PURE__ */ function(e) {
|
|
|
111
111
|
containerClassName: "pt-6"
|
|
112
112
|
}));
|
|
113
113
|
//#endregion
|
|
114
|
-
export {
|
|
114
|
+
export { T as PanelEmpty, E as PanelNoResults, x as SidebarOrientation, w as SidebarPanel };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-sidebar",
|
|
3
3
|
"description": "Resizable sidebar panel shell with header, search, and empty state components",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.299",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.299",
|
|
21
21
|
"@tabler/icons-react": "^3.44.0",
|
|
22
22
|
"react": "^19.0.0",
|
|
23
23
|
"@epam/ai-dial-ui-kit": "*"
|