@epam/ai-dial-sidebar 1.2.0-dev.48 → 1.2.0-dev.58
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/components/Header/Header.d.ts.map +1 -1
- package/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +16 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +57 -54
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAItD,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mEAAmE;IACnE,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,yEAAyE;AACzE,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA8BlC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAEf,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,6GAA6G;AAC7G,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAiP9C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const SIDEBAR_CLASS: {
|
|
2
|
+
/**
|
|
3
|
+
* The panel's `<aside role="complementary">` element — the region itself,
|
|
4
|
+
* not the wrapper around it. The wrapper is where `styles.className` lands,
|
|
5
|
+
* which is how the libs built on this panel mark themselves:
|
|
6
|
+
* `@epam/ai-dial-attachment-canvas` puts `dial-attachment-canvas-panel`
|
|
7
|
+
* there and `@epam/ai-dial-source-panel` puts `dial-source-panel-panel`. A
|
|
8
|
+
* host targeting one of those panels therefore descends from its class to
|
|
9
|
+
* this one (`.dial-attachment-canvas-panel .dial-sb-aside`), and sizes or
|
|
10
|
+
* positions the wrapper rather than the region.
|
|
11
|
+
*/
|
|
12
|
+
readonly aside: "dial-sb-aside";
|
|
13
|
+
/** The 48 px header bar rendered by `Header`. */
|
|
14
|
+
readonly header: "dial-sb-header";
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa;IACxB;;;;;;;;;OASG;;IAEH,iDAAiD;;CAEzC,CAAC"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { SIDEBAR_CLASS } from './constants/public-class-names';
|
|
1
2
|
export { SidebarPanel } from './components/SidebarPanel/SidebarPanel';
|
|
2
3
|
export { PanelEmpty } from './components/PanelEmptyState/PanelEmpty';
|
|
3
4
|
export { PanelNoResults } from './components/PanelEmptyState/PanelNoResults';
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,YAAY,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
package/index.js
CHANGED
|
@@ -3,15 +3,18 @@ import { ConditionalResizableContainer as r, DIAL_ICON_SIZE as i, DIAL_KIT_ICON_
|
|
|
3
3
|
import { IconX as l } from "@tabler/icons-react";
|
|
4
4
|
import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
5
5
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
6
|
-
//#region src/
|
|
7
|
-
var y =
|
|
6
|
+
//#region src/constants/public-class-names.ts
|
|
7
|
+
var y = {
|
|
8
|
+
aside: "dial-sb-aside",
|
|
9
|
+
header: "dial-sb-header"
|
|
10
|
+
}, b = /* @__PURE__ */ function(e) {
|
|
8
11
|
return e.Left = "left", e.Right = "right", e;
|
|
9
|
-
}({}),
|
|
12
|
+
}({}), x = {
|
|
10
13
|
wrapper: "_wrapper_1fadt_1",
|
|
11
14
|
header: "_header_1fadt_6",
|
|
12
15
|
resizeHandler: "_resizeHandler_1fadt_10"
|
|
13
|
-
},
|
|
14
|
-
className: n("flex h-12 items-center pe-3 ps-6", i,
|
|
16
|
+
}, S = u(({ title: e, titleClassName: t = "dial-h1-text", leftActions: r, className: i, rightActions: a }) => /* @__PURE__ */ v("div", {
|
|
17
|
+
className: n("flex h-12 items-center pe-3 ps-6", i, x.header, y.header),
|
|
15
18
|
children: [
|
|
16
19
|
r && /* @__PURE__ */ _("div", {
|
|
17
20
|
className: "flex items-center gap-1",
|
|
@@ -26,79 +29,79 @@ var y = /* @__PURE__ */ function(e) {
|
|
|
26
29
|
children: a
|
|
27
30
|
})
|
|
28
31
|
]
|
|
29
|
-
})),
|
|
30
|
-
let { colors:
|
|
31
|
-
"--sb-bg":
|
|
32
|
-
"--sb-border":
|
|
33
|
-
"--sb-text":
|
|
34
|
-
"--sb-resize-handler":
|
|
35
|
-
}), [
|
|
32
|
+
})), C = ({ isOpen: e, orientation: o, title: u, leftActions: C, rightActions: w, onClose: T, labels: E, children: D, styles: O, resizable: k, isOverlay: A = !1, defaultWidth: j = 360, minWidth: M = 280, maxWidth: N = 600, onResizeStop: P }) => {
|
|
33
|
+
let { colors: F, typography: I, bodyClassName: L, cssVars: R, titleClassName: z, className: B, headerClassName: V } = O ?? {}, H = p(() => t({
|
|
34
|
+
"--sb-bg": F?.background,
|
|
35
|
+
"--sb-border": F?.border,
|
|
36
|
+
"--sb-text": F?.text,
|
|
37
|
+
"--sb-resize-handler": F?.resizeHandler
|
|
38
|
+
}), [F]), U = m(j), [W, G] = h(e ? j : 0), [K, q] = h(!1), J = m(null);
|
|
36
39
|
f(() => {
|
|
37
|
-
if (!e)
|
|
40
|
+
if (!e) G(j), U.current = j, q(!1), J.current = null;
|
|
38
41
|
else {
|
|
39
|
-
let e =
|
|
40
|
-
|
|
42
|
+
let e = J.current, t = e?.forDefault === j ? e.width : j;
|
|
43
|
+
G(t), U.current = t;
|
|
41
44
|
}
|
|
42
|
-
}, [e,
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
}, []),
|
|
46
|
-
|
|
47
|
-
forDefault:
|
|
45
|
+
}, [e, j]);
|
|
46
|
+
let Y = d((e) => {
|
|
47
|
+
q(!0), G(e);
|
|
48
|
+
}, []), X = d((e) => {
|
|
49
|
+
J.current = {
|
|
50
|
+
forDefault: j,
|
|
48
51
|
width: e
|
|
49
|
-
},
|
|
50
|
-
}, [
|
|
51
|
-
if (
|
|
52
|
-
if (!
|
|
53
|
-
},
|
|
52
|
+
}, U.current = e, G(e), q(!1), P?.(e);
|
|
53
|
+
}, [j, P]), Z = e ? W || U.current : 0, Q = B?.includes("w-full"), $ = !A && !Q, ee = () => e ? "translate-x-0" : o === b.Left ? "ltr:-translate-x-full rtl:translate-x-full" : "ltr:translate-x-full rtl:-translate-x-full", te = () => {
|
|
54
|
+
if (A) return "transition-transform duration-200 ease-in-out motion-reduce:transition-none";
|
|
55
|
+
if (!K) return "transition-[width] duration-200 ease-in-out motion-reduce:transition-none";
|
|
56
|
+
}, ne = o === b.Left && e ? "border-s" : void 0, re = o === b.Right ? c.Left : c.Right, ie = T ? /* @__PURE__ */ _(s, {
|
|
54
57
|
icon: /* @__PURE__ */ _(l, {
|
|
55
58
|
size: i.LG,
|
|
56
59
|
stroke: a,
|
|
57
60
|
"aria-hidden": !0
|
|
58
61
|
}),
|
|
59
|
-
"aria-label":
|
|
60
|
-
tooltipProps: { tooltip:
|
|
61
|
-
onClick:
|
|
62
|
+
"aria-label": E.closeLabel,
|
|
63
|
+
tooltipProps: { tooltip: E.closeLabel },
|
|
64
|
+
onClick: T
|
|
62
65
|
}) : null;
|
|
63
66
|
return /* @__PURE__ */ _("div", {
|
|
64
|
-
style:
|
|
65
|
-
className: n("h-full flex-shrink-0 gap-3 overflow-hidden shadow-sm", o ===
|
|
67
|
+
style: $ ? { width: Z } : void 0,
|
|
68
|
+
className: n("h-full flex-shrink-0 gap-3 overflow-hidden shadow-sm", o === b.Left && "[clip-path:inset(-24px_-24px_-24px_0)] rtl:[clip-path:inset(-24px_0_-24px_-24px)]", te(), "relative z-50", B, A && n("w-full", ee()), x.panel),
|
|
66
69
|
children: /* @__PURE__ */ _(r, {
|
|
67
|
-
enabled: (
|
|
68
|
-
side:
|
|
69
|
-
ariaLabel:
|
|
70
|
-
width: e ?
|
|
71
|
-
defaultWidth:
|
|
72
|
-
minWidth:
|
|
73
|
-
maxWidth:
|
|
74
|
-
resizeHandlerClassName:
|
|
75
|
-
onResizeStop:
|
|
76
|
-
onResize:
|
|
70
|
+
enabled: (k ?? !1) && e,
|
|
71
|
+
side: re,
|
|
72
|
+
ariaLabel: E.resizeLabel ?? "Resize panel",
|
|
73
|
+
width: e ? W || U.current : void 0,
|
|
74
|
+
defaultWidth: j,
|
|
75
|
+
minWidth: M,
|
|
76
|
+
maxWidth: N,
|
|
77
|
+
resizeHandlerClassName: x.resizeHandler,
|
|
78
|
+
onResizeStop: X,
|
|
79
|
+
onResize: Y,
|
|
77
80
|
children: /* @__PURE__ */ v("aside", {
|
|
78
81
|
role: "complementary",
|
|
79
|
-
"aria-label":
|
|
82
|
+
"aria-label": E.ariaLabel,
|
|
80
83
|
inert: !e,
|
|
81
84
|
style: {
|
|
82
|
-
...
|
|
83
|
-
...
|
|
85
|
+
...R,
|
|
86
|
+
...H
|
|
84
87
|
},
|
|
85
|
-
className: n(
|
|
86
|
-
children: [/* @__PURE__ */ _(
|
|
88
|
+
className: n(x.wrapper, "flex h-full w-full flex-col gap-3", ne, I?.fontClassName, y.aside),
|
|
89
|
+
children: [/* @__PURE__ */ _(S, {
|
|
87
90
|
title: u,
|
|
88
|
-
className:
|
|
89
|
-
titleClassName:
|
|
90
|
-
leftActions:
|
|
91
|
-
rightActions: /* @__PURE__ */ v(g, { children: [
|
|
91
|
+
className: V,
|
|
92
|
+
titleClassName: z,
|
|
93
|
+
leftActions: C,
|
|
94
|
+
rightActions: /* @__PURE__ */ v(g, { children: [w, ie] })
|
|
92
95
|
}), /* @__PURE__ */ _("div", {
|
|
93
|
-
className: n("flex-1 overflow-y-auto p-4 pt-0",
|
|
94
|
-
children:
|
|
96
|
+
className: n("flex-1 overflow-y-auto p-4 pt-0", L),
|
|
97
|
+
children: D
|
|
95
98
|
})]
|
|
96
99
|
})
|
|
97
100
|
})
|
|
98
101
|
});
|
|
99
|
-
},
|
|
102
|
+
}, w = u(({ label: t }) => /* @__PURE__ */ _(e, { label: t })), T = u(({ label: t }) => /* @__PURE__ */ _(e, {
|
|
100
103
|
label: t,
|
|
101
104
|
containerClassName: "pt-6"
|
|
102
105
|
}));
|
|
103
106
|
//#endregion
|
|
104
|
-
export {
|
|
107
|
+
export { w as PanelEmpty, T as PanelNoResults, y as SIDEBAR_CLASS, b as SidebarOrientation, C 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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.58",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"@tabler/icons-react": "^3.44.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.58",
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.9"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|