@epam/ai-dial-sidebar 1.3.0-dev.35 → 1.3.0-dev.354
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/PanelEmptyState/PanelEmpty.d.ts +6 -2
- package/components/PanelEmptyState/PanelEmpty.d.ts.map +1 -1
- package/components/PanelEmptyState/PanelNoResults.d.ts +3 -1
- package/components/PanelEmptyState/PanelNoResults.d.ts.map +1 -1
- package/components/SidebarPanel/SidebarPanel.d.ts.map +1 -1
- package/index.css +2 -1
- package/index.js +132 -65
- package/models/panel-props.d.ts +2 -0
- package/models/panel-props.d.ts.map +1 -1
- package/package.json +4 -4
- package/utils/panel-width.d.ts +7 -0
- package/utils/panel-width.d.ts.map +1 -0
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
/** Props for `PanelEmpty`. */
|
|
3
3
|
export interface PanelEmptyProps {
|
|
4
|
-
/** Primary message of the empty state. */
|
|
4
|
+
/** Primary message of the empty state, e.g. "No chats yet". */
|
|
5
5
|
label: string;
|
|
6
|
+
/** Secondary line, e.g. "Chats will appear here once you start one." */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Optional way forward, such as a button, rendered under the text. */
|
|
9
|
+
action?: ReactNode;
|
|
6
10
|
}
|
|
7
11
|
/** Empty-state block rendered when a panel has no items at all. */
|
|
8
12
|
export declare const PanelEmpty: FC<PanelEmptyProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelEmpty.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelEmpty.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PanelEmpty.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelEmpty.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,mEAAmE;AACnE,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAI1C,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
/** Props for `PanelNoResults`. */
|
|
3
3
|
export interface PanelNoResultsProps {
|
|
4
|
-
/** Primary message of the empty state. */
|
|
4
|
+
/** Primary message of the empty state, e.g. "No chats found". */
|
|
5
5
|
label: string;
|
|
6
|
+
/** Secondary line, e.g. "Try a different search term or check your filters." */
|
|
7
|
+
description?: string;
|
|
6
8
|
}
|
|
7
9
|
/** Empty-state block rendered when a search or filter produces no matches. */
|
|
8
10
|
export declare const PanelNoResults: FC<PanelNoResultsProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelNoResults.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelNoResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEtC,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,
|
|
1
|
+
{"version":3,"file":"PanelNoResults.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelNoResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEtC,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAQlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarPanel/SidebarPanel.tsx"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarPanel/SidebarPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EAOL,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,6GAA6G;AAC7G,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA+V9C,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
._wrapper_1fadt_1{background:var(--sb-bg,var(--bg-layer-raised,#fcfcfc));border-color:var(--sb-border,var(--stroke-tertiary,#e0e6f0))}._header_1fadt_6{color:var(--sb-text,var(--text-primary,#161b2d))}._resizeHandler_1fadt_10{background:var(--sb-resize-handler,var(--text-accent,#1d4ed8));width:4px!important;color:var(--sb-resize-handler,var(--text-accent,#1d4ed8))!important}
|
|
2
|
-
/*$vite$:1
|
|
2
|
+
/*$vite$:1*//*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial}}}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-y-0{inset-block:0}.inset-e-0{inset-inline-end:0}.z-50{z-index:50}.me-2{margin-inline-end:.5rem}.block{display:block}.flex{display:flex}.inline{display:inline}.h-12{height:3rem}.h-full{height:100%}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.gap-1{gap:.25rem}.gap-3{gap:.75rem}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.border{border-style:var(--tw-border-style);border-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.p-4{padding:1rem}.ps-6{padding-inline-start:1.5rem}.pe-3{padding-inline-end:.75rem}.pt-0{padding-top:0}.pt-6{padding-top:1.5rem}.shadow-sm{--tw-shadow:4px 9px 16px 1px var(--tw-shadow-color,var(--shadow-sm-2,var(--shadow-sm,#2764d90f))), 0 -2px 4px 2px var(--tw-shadow-color,var(--shadow-sm-1,#2764d90a));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,cubic-bezier(.4, 0, .2, 1));transition-duration:var(--tw-duration,.15s)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,cubic-bezier(.4, 0, .2, 1));transition-duration:var(--tw-duration,.15s)}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,cubic-bezier(.4, 0, .2, 1));transition-duration:var(--tw-duration,.15s)}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:cubic-bezier(.4, 0, .2, 1);transition-timing-function:cubic-bezier(.4,0,.2,1)}.\[clip-path\:inset\(-24px_-24px_-24px_0\)\]{clip-path:inset(-24px -24px -24px 0)}@media (prefers-reduced-motion:reduce){.motion-reduce\:transition-none{transition-property:none}}.ltr\:-translate-x-full:where(:dir(ltr),[dir=ltr],[dir=ltr] *){--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.ltr\:translate-x-full:where(:dir(ltr),[dir=ltr],[dir=ltr] *){--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rtl\:-translate-x-full:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rtl\:translate-x-full:where(:dir(rtl),[dir=rtl],[dir=rtl] *){--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.rtl\:\[clip-path\:inset\(-24px_0_-24px_-24px\)\]:where(:dir(rtl),[dir=rtl],[dir=rtl] *){clip-path:inset(-24px 0 -24px -24px)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
|
package/index.js
CHANGED
|
@@ -1,108 +1,175 @@
|
|
|
1
1
|
import { PanelEmptyState as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { ConditionalResizableContainer as r, DIAL_ICON_SIZE as i, DIAL_KIT_ICON_STROKE as a, EllipsisTooltip as o, GhostIconButton as s, ResizableContainerSide as c } from "@epam/ai-dial-ui-kit";
|
|
3
3
|
import { IconX as l } from "@tabler/icons-react";
|
|
4
|
-
import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
5
|
-
import { Fragment as
|
|
4
|
+
import { memo as u, useCallback as d, useEffect as f, useLayoutEffect as ee, useMemo as p, useRef as m, useState as h } from "react";
|
|
5
|
+
import { Fragment as te, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
6
6
|
//#region src/constants/public-class-names.ts
|
|
7
|
-
var
|
|
7
|
+
var v = {
|
|
8
8
|
aside: "dial-sb-aside",
|
|
9
9
|
header: "dial-sb-header"
|
|
10
|
-
},
|
|
10
|
+
}, y = /* @__PURE__ */ function(e) {
|
|
11
11
|
return e.Left = "left", e.Right = "right", e;
|
|
12
|
-
}({}),
|
|
12
|
+
}({}), b = (e, t, n, r) => {
|
|
13
|
+
let i = Math.max(0, Math.min(n, r - 32)), a = Math.max(0, Math.min(t, i));
|
|
14
|
+
return {
|
|
15
|
+
width: Math.min(i, Math.max(a, e)),
|
|
16
|
+
minWidth: a,
|
|
17
|
+
maxWidth: i
|
|
18
|
+
};
|
|
19
|
+
}, x = {
|
|
13
20
|
wrapper: "_wrapper_1fadt_1",
|
|
14
21
|
header: "_header_1fadt_6",
|
|
15
22
|
resizeHandler: "_resizeHandler_1fadt_10"
|
|
16
|
-
},
|
|
17
|
-
className: n("flex h-12 items-center pe-3
|
|
23
|
+
}, ne = u(({ title: e, titleClassName: t = "dial-h1-text", leftActions: r, className: i, actionsClassName: a, rightActions: s }) => /* @__PURE__ */ _("div", {
|
|
24
|
+
className: n("flex h-12 items-center ps-6 pe-3", i, x.header, v.header),
|
|
18
25
|
children: [
|
|
19
|
-
r && /* @__PURE__ */
|
|
26
|
+
r && /* @__PURE__ */ g("div", {
|
|
20
27
|
className: "me-2 flex items-center gap-1",
|
|
21
28
|
children: r
|
|
22
29
|
}),
|
|
23
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ g(o, {
|
|
24
31
|
text: e,
|
|
25
32
|
className: n("min-w-0 flex-1 truncate", t)
|
|
26
33
|
}),
|
|
27
|
-
s && /* @__PURE__ */
|
|
34
|
+
s && /* @__PURE__ */ g("div", {
|
|
28
35
|
className: n("flex items-center gap-1", a),
|
|
29
36
|
children: s
|
|
30
37
|
})
|
|
31
38
|
]
|
|
32
|
-
})),
|
|
33
|
-
let
|
|
34
|
-
"--sb-bg": F?.background,
|
|
35
|
-
"--sb-border": F?.border,
|
|
36
|
-
"--sb-text": F?.text,
|
|
37
|
-
"--sb-resize-handler": F?.resizeHandler
|
|
38
|
-
}), [F]), W = m(j), [G, K] = h(e ? j : 0), [q, J] = h(!1), Y = m(null);
|
|
39
|
+
})), S = ({ isOpen: e, orientation: o, title: u, leftActions: S, rightActions: C, onClose: w, labels: T, children: re, styles: ie, resizable: E, isOverlay: D = !1, isBoundedOverlay: O = !1, defaultWidth: k = 360, minWidth: A = 280, maxWidth: j = 600, onResizeStop: M }) => {
|
|
40
|
+
let N = m(null), P = m(null), [F, ae] = h(0), [oe, se] = h(!1);
|
|
39
41
|
f(() => {
|
|
40
|
-
if (!
|
|
42
|
+
if (!O) return;
|
|
43
|
+
let e = N.current?.parentElement, t = () => {
|
|
44
|
+
let t = document.documentElement.clientWidth;
|
|
45
|
+
N.current && se(getComputedStyle(N.current).direction === "rtl"), ae(Math.min(e?.clientWidth || t, t));
|
|
46
|
+
};
|
|
47
|
+
t();
|
|
48
|
+
let n = typeof ResizeObserver < "u" ? new ResizeObserver(t) : void 0;
|
|
49
|
+
e && n?.observe(e);
|
|
50
|
+
let r = new MutationObserver(t), i = e ?? null;
|
|
51
|
+
for (; i;) r.observe(i, {
|
|
52
|
+
attributes: !0,
|
|
53
|
+
attributeFilter: [
|
|
54
|
+
"dir",
|
|
55
|
+
"class",
|
|
56
|
+
"style"
|
|
57
|
+
]
|
|
58
|
+
}), i = i.parentElement;
|
|
59
|
+
return window.addEventListener("resize", t), () => {
|
|
60
|
+
n?.disconnect(), r.disconnect(), window.removeEventListener("resize", t);
|
|
61
|
+
};
|
|
62
|
+
}, [O]), ee(() => {
|
|
63
|
+
if (!e) return;
|
|
64
|
+
let t = N.current;
|
|
65
|
+
return document.activeElement instanceof HTMLElement && !t?.contains(document.activeElement) && document.activeElement !== document.body && (P.current = document.activeElement), () => {
|
|
66
|
+
O && (t?.contains(document.activeElement) || document.activeElement === document.body) && P.current?.focus();
|
|
67
|
+
};
|
|
68
|
+
}, [e, O]);
|
|
69
|
+
let I = d(() => {
|
|
70
|
+
O && P.current?.focus(), w?.();
|
|
71
|
+
}, [O, w]);
|
|
72
|
+
f(() => {
|
|
73
|
+
if (!O || !e) return;
|
|
74
|
+
let t = N.current, n = (e) => {
|
|
75
|
+
e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(), I());
|
|
76
|
+
};
|
|
77
|
+
return t?.addEventListener("keydown", n), () => t?.removeEventListener("keydown", n);
|
|
78
|
+
}, [
|
|
79
|
+
O,
|
|
80
|
+
e,
|
|
81
|
+
I
|
|
82
|
+
]);
|
|
83
|
+
let { colors: L, typography: R, bodyClassName: z, cssVars: B, titleClassName: V, className: H, headerClassName: U, headerActionsClassName: W } = ie ?? {}, G = p(() => t({
|
|
84
|
+
"--sb-bg": L?.background,
|
|
85
|
+
"--sb-border": L?.border,
|
|
86
|
+
"--sb-text": L?.text,
|
|
87
|
+
"--sb-resize-handler": L?.resizeHandler
|
|
88
|
+
}), [L]), K = m(k), [q, J] = h(e ? k : 0), [ce, Y] = h(!1), X = m(null);
|
|
89
|
+
f(() => {
|
|
90
|
+
if (!e) J(k), K.current = k, Y(!1), X.current = null;
|
|
41
91
|
else {
|
|
42
|
-
let e =
|
|
43
|
-
|
|
92
|
+
let e = X.current, t = e?.forDefault === k ? e.width : k;
|
|
93
|
+
J(t), K.current = t;
|
|
44
94
|
}
|
|
45
|
-
}, [e,
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
}, [e, k]);
|
|
96
|
+
let Z = d((e) => O ? b(e, A, j, F).width : e, [
|
|
97
|
+
O,
|
|
98
|
+
A,
|
|
99
|
+
j,
|
|
100
|
+
F
|
|
101
|
+
]), le = d((e) => {
|
|
102
|
+
Y(!0), J(Z(e));
|
|
103
|
+
}, [Z]), ue = d((e) => {
|
|
104
|
+
let t = Z(e);
|
|
105
|
+
X.current = {
|
|
106
|
+
forDefault: k,
|
|
107
|
+
width: t
|
|
108
|
+
}, K.current = t, J(t), Y(!1), M?.(t);
|
|
109
|
+
}, [
|
|
110
|
+
k,
|
|
111
|
+
M,
|
|
112
|
+
Z
|
|
113
|
+
]), de = e ? q || K.current : 0, Q = b(q || K.current, A, j, F), fe = H?.includes("w-full"), pe = !D && !fe, $ = () => e ? "translate-x-0" : o === y.Left ? "ltr:-translate-x-full rtl:translate-x-full" : "ltr:translate-x-full rtl:-translate-x-full", me = () => {
|
|
114
|
+
if (D || O) return "transition-transform duration-200 ease-in-out motion-reduce:transition-none";
|
|
115
|
+
if (!ce) return "transition-[width] duration-200 ease-in-out motion-reduce:transition-none";
|
|
116
|
+
}, he = o === y.Left && e ? "border-s" : void 0, ge = o === y.Right === (O && oe) ? c.Right : c.Left, _e = w ? /* @__PURE__ */ g(s, {
|
|
117
|
+
icon: /* @__PURE__ */ g(l, {
|
|
58
118
|
size: i.LG,
|
|
59
119
|
stroke: a,
|
|
60
120
|
"aria-hidden": !0
|
|
61
121
|
}),
|
|
62
|
-
"aria-label":
|
|
63
|
-
tooltipProps: { tooltip:
|
|
64
|
-
onClick:
|
|
122
|
+
"aria-label": T.closeLabel,
|
|
123
|
+
tooltipProps: { tooltip: T.closeLabel },
|
|
124
|
+
onClick: I
|
|
65
125
|
}) : null;
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
126
|
+
return /* @__PURE__ */ g("div", {
|
|
127
|
+
ref: N,
|
|
128
|
+
inert: O && !e,
|
|
129
|
+
style: O ? { width: Q.width } : pe ? { width: de } : void 0,
|
|
130
|
+
className: n("h-full shrink-0 gap-3 overflow-hidden shadow-sm", o === y.Left && "[clip-path:inset(-24px_-24px_-24px_0)] rtl:[clip-path:inset(-24px_0_-24px_-24px)]", me(), "relative z-50", H, D && n("w-full", $()), O && n("absolute inset-y-0 inset-e-0 overflow-visible", $(), !e && "pointer-events-none"), x.panel),
|
|
131
|
+
children: /* @__PURE__ */ g(r, {
|
|
132
|
+
enabled: (E ?? !1) && e,
|
|
133
|
+
side: ge,
|
|
134
|
+
ariaLabel: T.resizeLabel ?? "Resize panel",
|
|
135
|
+
width: O ? Q.width : e ? q || K.current : void 0,
|
|
136
|
+
defaultWidth: O ? Q.width : k,
|
|
137
|
+
minWidth: O ? Q.minWidth : A,
|
|
138
|
+
maxWidth: O ? Q.maxWidth : j,
|
|
77
139
|
resizeHandlerClassName: x.resizeHandler,
|
|
78
|
-
onResizeStop:
|
|
79
|
-
onResize:
|
|
80
|
-
children: /* @__PURE__ */
|
|
140
|
+
onResizeStop: ue,
|
|
141
|
+
onResize: le,
|
|
142
|
+
children: /* @__PURE__ */ _("aside", {
|
|
81
143
|
role: "complementary",
|
|
82
|
-
"aria-label":
|
|
144
|
+
"aria-label": T.ariaLabel,
|
|
83
145
|
inert: !e,
|
|
84
146
|
style: {
|
|
85
|
-
...
|
|
86
|
-
...
|
|
147
|
+
...B,
|
|
148
|
+
...G
|
|
87
149
|
},
|
|
88
|
-
className: n(x.wrapper, "flex h-full w-full flex-col gap-3",
|
|
89
|
-
children: [/* @__PURE__ */
|
|
150
|
+
className: n(x.wrapper, "flex h-full w-full flex-col gap-3", he, R?.fontClassName, v.aside),
|
|
151
|
+
children: [/* @__PURE__ */ g(ne, {
|
|
90
152
|
title: u,
|
|
91
|
-
className:
|
|
92
|
-
actionsClassName:
|
|
93
|
-
titleClassName:
|
|
94
|
-
leftActions:
|
|
95
|
-
rightActions: /* @__PURE__ */
|
|
96
|
-
}), /* @__PURE__ */
|
|
97
|
-
className: n("flex-1 overflow-y-auto p-4 pt-0",
|
|
98
|
-
children:
|
|
153
|
+
className: U,
|
|
154
|
+
actionsClassName: W,
|
|
155
|
+
titleClassName: V,
|
|
156
|
+
leftActions: S,
|
|
157
|
+
rightActions: /* @__PURE__ */ _(te, { children: [C, _e] })
|
|
158
|
+
}), /* @__PURE__ */ g("div", {
|
|
159
|
+
className: n("flex-1 overflow-y-auto p-4 pt-0", z),
|
|
160
|
+
children: re
|
|
99
161
|
})]
|
|
100
162
|
})
|
|
101
163
|
})
|
|
102
164
|
});
|
|
103
|
-
},
|
|
165
|
+
}, C = u(({ label: t, description: n, action: r }) => /* @__PURE__ */ g(e, {
|
|
166
|
+
label: t,
|
|
167
|
+
description: n,
|
|
168
|
+
action: r
|
|
169
|
+
})), w = u(({ label: t, description: n }) => /* @__PURE__ */ g(e, {
|
|
104
170
|
label: t,
|
|
171
|
+
description: n,
|
|
105
172
|
containerClassName: "pt-6"
|
|
106
173
|
}));
|
|
107
174
|
//#endregion
|
|
108
|
-
export {
|
|
175
|
+
export { C as PanelEmpty, w as PanelNoResults, v as SIDEBAR_CLASS, y as SidebarOrientation, S as SidebarPanel };
|
package/models/panel-props.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export interface SidebarPanelProps {
|
|
|
75
75
|
* still owns the positioning itself. Defaults to `false`.
|
|
76
76
|
*/
|
|
77
77
|
isOverlay?: boolean;
|
|
78
|
+
/** Opt into an inline-end overlay bounded by its containing block, leaving 32px visible. */
|
|
79
|
+
isBoundedOverlay?: boolean;
|
|
78
80
|
/** Initial panel width in px used when `resizable` is true. Defaults to `360`. */
|
|
79
81
|
defaultWidth?: number;
|
|
80
82
|
/** Minimum panel width in px used when `resizable` is true. Defaults to `280`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-props.d.ts","sourceRoot":"","sources":["../../src/models/panel-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mHAAmH;IACnH,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AsB,CAAC,EAAE,MAAM,CAAC;IAChC,oEAAoE;IACpE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IAChC,mHAAmH;IACnH,MAAM,EAAE,OAAO,CAAC;IAChB,qFAAqF;IACrF,WAAW,EAAE,kBAAkB,CAAC;IAChC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yEAAyE;IACzE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,2EAA2E;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB,uEAAuE;IACvE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,+FAA+F;IAC/F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4FAA4F;IAC5F,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC"}
|
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.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.354",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@tabler/icons-react": "^3.
|
|
20
|
+
"@tabler/icons-react": "^3.50.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
23
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.354",
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
25
|
+
"@epam/ai-dial-ui-kit": "^0.16.0"
|
|
26
26
|
},
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Bounds all overlay sizing paths without replacing the user's preferred width. */
|
|
2
|
+
export declare const resolvePanelWidth: (preferredWidth: number, minWidth: number, maxWidth: number, availableWidth: number) => {
|
|
3
|
+
width: number;
|
|
4
|
+
minWidth: number;
|
|
5
|
+
maxWidth: number;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=panel-width.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-width.d.ts","sourceRoot":"","sources":["../../src/utils/panel-width.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,eAAO,MAAM,iBAAiB,GAC5B,gBAAgB,MAAM,EACtB,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,gBAAgB,MAAM;;;;CASvB,CAAC"}
|