@epam/ai-dial-sidebar 0.0.0-dev.0
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 +23 -0
- package/components/Header/Header.d.ts.map +1 -0
- package/components/PanelEmptyState/PanelEmpty.d.ts +14 -0
- package/components/PanelEmptyState/PanelEmpty.d.ts.map +1 -0
- package/components/PanelEmptyState/PanelNoResults.d.ts +14 -0
- package/components/PanelEmptyState/PanelNoResults.d.ts.map +1 -0
- package/components/SearchInput/SearchInput.d.ts +17 -0
- package/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/components/SidebarPanel/SidebarPanel.d.ts +4 -0
- package/components/SidebarPanel/SidebarPanel.d.ts.map +1 -0
- package/index.css +2 -0
- package/index.d.ts +10 -0
- package/index.d.ts.map +1 -0
- package/index.js +138 -0
- package/models/panel-props.d.ts +99 -0
- package/models/panel-props.d.ts.map +1 -0
- package/package.json +24 -0
- package/test-setup.d.ts +1 -0
- package/test-setup.d.ts.map +1 -0
- package/types/orientation.d.ts +8 -0
- package/types/orientation.d.ts.map +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** Props for the `Header` component. */
|
|
3
|
+
export interface HeaderProps {
|
|
4
|
+
/**
|
|
5
|
+
* Title text rendered between the two action groups.
|
|
6
|
+
* Truncated with an ellipsis when the panel is too narrow.
|
|
7
|
+
*/
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* CSS class applied to the title element.
|
|
11
|
+
* Defaults to `'dial-body-semi-bold-text'`.
|
|
12
|
+
*/
|
|
13
|
+
titleClassName?: string;
|
|
14
|
+
/** CSS class applied to the root element. */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Content rendered in the start (left) group of the header bar. */
|
|
17
|
+
leftActions?: ReactNode;
|
|
18
|
+
/** Content rendered in the end (right) group of the header bar. */
|
|
19
|
+
rightActions?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** 48 px header bar with a title and optional start/end action slots. */
|
|
22
|
+
export declare const Header: FC<HeaderProps>;
|
|
23
|
+
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -0,0 +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;AAGtD,wCAAwC;AACxC,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,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,CA6BlC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconMessageCircle } from '@tabler/icons-react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
/** Props for `PanelEmpty`. */
|
|
4
|
+
export interface PanelEmptyProps {
|
|
5
|
+
/** Primary message shown beneath the icon. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Icon component rendered above the label. Defaults to `IconMessageCircle`. */
|
|
8
|
+
icon?: typeof IconMessageCircle;
|
|
9
|
+
/** Icon size in px. Defaults to `48`. */
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
}
|
|
12
|
+
/** Empty-state block rendered when a panel has no items at all. */
|
|
13
|
+
export declare const PanelEmpty: FC<PanelEmptyProps>;
|
|
14
|
+
//# sourceMappingURL=PanelEmpty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelEmpty.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelEmpty.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEtC,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,IAAI,CAAC,EAAE,OAAO,iBAAiB,CAAC;IAChC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,mEAAmE;AACnE,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAO1C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconZoomCancel } from '@tabler/icons-react';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
/** Props for `PanelNoResults`. */
|
|
4
|
+
export interface PanelNoResultsProps {
|
|
5
|
+
/** Primary message shown beneath the icon. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Icon component rendered above the label. Defaults to `IconZoomCancel`. */
|
|
8
|
+
icon?: typeof IconZoomCancel;
|
|
9
|
+
/** Icon size in px. Defaults to `45`. */
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
}
|
|
12
|
+
/** Empty-state block rendered when a search or filter produces no matches. */
|
|
13
|
+
export declare const PanelNoResults: FC<PanelNoResultsProps>;
|
|
14
|
+
//# sourceMappingURL=PanelNoResults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelNoResults.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelNoResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEtC,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,CAAC,EAAE,OAAO,cAAc,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,8EAA8E;AAC9E,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAOlD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/** Props for `SearchInput`. */
|
|
3
|
+
export interface SearchInputProps {
|
|
4
|
+
/** Placeholder text (e.g. `"Search chat…"`). */
|
|
5
|
+
placeholder: string;
|
|
6
|
+
/** Current search query value. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Called whenever the query changes. */
|
|
9
|
+
onChange: (value: string) => void;
|
|
10
|
+
/** Accessible label for the clear-search button. */
|
|
11
|
+
clearLabel: string;
|
|
12
|
+
/** CSS class applied to the search icon. Defaults to `'text-secondary'`. */
|
|
13
|
+
iconClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Minimal search input with icon positioned to align with sibling action buttons. */
|
|
16
|
+
export declare const SearchInput: FC<SearchInputProps>;
|
|
17
|
+
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAAQ,MAAM,OAAO,CAAC;AAGtC,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,sFAAsF;AACtF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA8C5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SidebarPanel/SidebarPanel.tsx"],"names":[],"mappings":"AAQA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAKlE,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA8J9C,CAAC"}
|
package/index.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
._wrapper_x6z5j_1{background:var(--sb-bg,var(--bg-layer-3,#fcfcfc));border-color:var(--sb-border,var(--stroke-tertiary,#e0e6f0))}._header_x6z5j_6{color:var(--sb-text,var(--text-primary,#161b2d))}._divider_x6z5j_10{border-color:var(--sb-border,var(--stroke-tertiary,#e0e6f0))}._panel_x6z5j_14{border-color:var(--sb-border,var(--stroke-tertiary,#e0e6f0));border-inline-end-color:var(--sb-border-inline-end,var(--sb-border,var(--stroke-tertiary,#e0e6f0)))}@keyframes _fadeIn_x6z5j_1{0%{opacity:0}to{opacity:1}}._appear_x6z5j_27{animation:.2s ease-out forwards _fadeIn_x6z5j_1}._resizeHandler_x6z5j_31{background:var(--sb-bg-resize-handler,var(--text-success,#007274));width:4px!important;color:var(--sb-resize-handler,var(--text-success,#007274))!important}._row_14w80_1{background:0 0;border-color:#0000000d}._row_14w80_1 input{color:var(--cp-text,var(--text-primary,#161b2d))}._row_14w80_1 input::placeholder{color:var(--cp-text-secondary,var(--text-secondary,#575f73))}@media (hover:hover){._row_14w80_1:hover:not(:focus-within){border-color:#0000001f}}._row_14w80_1:focus-within{border-color:color-mix(in srgb, var(--controls-text-accent-primary-active,#7da4ff) 50%, transparent)}._input_14w80_20{font-family:inherit;font-size:14px;font-weight:400;line-height:20px}
|
|
2
|
+
/*$vite$:1*/
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { SidebarPanel } from './components/SidebarPanel/SidebarPanel';
|
|
2
|
+
export { SearchInput } from './components/SearchInput/SearchInput';
|
|
3
|
+
export { PanelEmpty } from './components/PanelEmptyState/PanelEmpty';
|
|
4
|
+
export { PanelNoResults } from './components/PanelEmptyState/PanelNoResults';
|
|
5
|
+
export { SidebarOrientation } from './types/orientation';
|
|
6
|
+
export type { SearchInputProps } from './components/SearchInput/SearchInput';
|
|
7
|
+
export type { PanelEmptyProps } from './components/PanelEmptyState/PanelEmpty';
|
|
8
|
+
export type { PanelNoResultsProps } from './components/PanelEmptyState/PanelNoResults';
|
|
9
|
+
export type { SidebarPanelProps, SidebarPanelStyles, SidebarPanelColors, SidebarPanelTypography, } from './models/panel-props';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +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,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,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,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,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,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
package/index.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { PanelEmptyState as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { DIAL_ICON_SIZE as r, DialConditionalResizableContainer as i, DialEllipsisTooltip as a, DialGhostIconButton as o, ResizableContainerSide as s } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconMessageCircle as c, IconSearch as l, IconX as u, IconZoomCancel 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
|
+
//#region src/types/orientation.ts
|
|
7
|
+
var x = /* @__PURE__ */ function(e) {
|
|
8
|
+
return e.Left = "left", e.Right = "right", e;
|
|
9
|
+
}({}), S = {
|
|
10
|
+
wrapper: "_wrapper_x6z5j_1",
|
|
11
|
+
header: "_header_x6z5j_6",
|
|
12
|
+
divider: "_divider_x6z5j_10",
|
|
13
|
+
panel: "_panel_x6z5j_14",
|
|
14
|
+
appear: "_appear_x6z5j_27",
|
|
15
|
+
fadeIn: "_fadeIn_x6z5j_1",
|
|
16
|
+
resizeHandler: "_resizeHandler_x6z5j_31"
|
|
17
|
+
}, C = f(({ title: e, titleClassName: t = "dial-h1-text", leftActions: r, className: i, rightActions: o }) => /* @__PURE__ */ b("div", {
|
|
18
|
+
className: n("flex h-12 shrink-0 items-center gap-2 px-4", i, S.header),
|
|
19
|
+
children: [
|
|
20
|
+
r && /* @__PURE__ */ y("div", {
|
|
21
|
+
className: "flex items-center gap-1",
|
|
22
|
+
children: r
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ y(a, {
|
|
25
|
+
text: e,
|
|
26
|
+
className: n("min-w-0 flex-1 truncate", t)
|
|
27
|
+
}),
|
|
28
|
+
o && /* @__PURE__ */ y("div", {
|
|
29
|
+
className: "flex items-center gap-1",
|
|
30
|
+
children: o
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
})), w = ({ isOpen: e, orientation: a, title: c, leftActions: l, rightActions: d, onClose: f, ariaLabel: w, closeLabel: T, children: E, className: D, styles: O, resizable: k, defaultWidth: A = 360, minWidth: j = 280, maxWidth: M = 600, headerClassName: N, onResizeStop: P }) => {
|
|
34
|
+
let { colors: F, typography: I, bodyClassName: L, cssVars: R, titleClassName: z } = O ?? {}, B = h(() => t({
|
|
35
|
+
"--sb-bg": F?.background,
|
|
36
|
+
"--sb-border": F?.border
|
|
37
|
+
}), [F]), V = g(A), [H, U] = _(e ? A : 0), [W, G] = _(!1);
|
|
38
|
+
m(() => {
|
|
39
|
+
e || (U(A), V.current = A, G(!1));
|
|
40
|
+
}, [e, A]);
|
|
41
|
+
let K = p(() => {
|
|
42
|
+
G(!0);
|
|
43
|
+
}, []), q = p((e) => {
|
|
44
|
+
V.current = e, U(e), G(!1), P?.(e);
|
|
45
|
+
}, [P]), J;
|
|
46
|
+
J = W ? "auto" : e ? H || V.current : 0;
|
|
47
|
+
let Y = a === x.Right ? "border-s" : "border-e", X = a === x.Right ? s.Left : s.Right, Z = f ? /* @__PURE__ */ y(o, {
|
|
48
|
+
icon: /* @__PURE__ */ y(u, {
|
|
49
|
+
size: r.LG,
|
|
50
|
+
stroke: 1.5
|
|
51
|
+
}),
|
|
52
|
+
"aria-label": T,
|
|
53
|
+
tooltipProps: { tooltip: T },
|
|
54
|
+
onClick: f
|
|
55
|
+
}) : null;
|
|
56
|
+
return /* @__PURE__ */ y("div", {
|
|
57
|
+
style: { width: J },
|
|
58
|
+
className: n("h-full flex-shrink-0 overflow-hidden", !W && "transition-[width] duration-200 ease-in-out", e && "relative z-50", D, S.panel),
|
|
59
|
+
children: /* @__PURE__ */ y(i, {
|
|
60
|
+
enabled: (k ?? !1) && e,
|
|
61
|
+
side: X,
|
|
62
|
+
defaultWidth: A,
|
|
63
|
+
minWidth: j,
|
|
64
|
+
maxWidth: M,
|
|
65
|
+
resizeHandlerClassName: S.resizeHandler,
|
|
66
|
+
onResizeStop: q,
|
|
67
|
+
onResize: K,
|
|
68
|
+
children: /* @__PURE__ */ b("aside", {
|
|
69
|
+
role: "complementary",
|
|
70
|
+
"aria-label": w,
|
|
71
|
+
"aria-hidden": !e,
|
|
72
|
+
style: {
|
|
73
|
+
...R,
|
|
74
|
+
...B
|
|
75
|
+
},
|
|
76
|
+
className: n(S.wrapper, "flex h-full w-full flex-col", e && S.appear, Y, I?.fontClassName),
|
|
77
|
+
children: [/* @__PURE__ */ y(C, {
|
|
78
|
+
title: c,
|
|
79
|
+
className: N,
|
|
80
|
+
titleClassName: z,
|
|
81
|
+
leftActions: e && l,
|
|
82
|
+
rightActions: e && /* @__PURE__ */ b(v, { children: [d, Z] })
|
|
83
|
+
}), /* @__PURE__ */ y("div", {
|
|
84
|
+
className: n("flex-1 overflow-y-auto p-4", L),
|
|
85
|
+
children: E
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}, T = {
|
|
91
|
+
row: "_row_14w80_1",
|
|
92
|
+
input: "_input_14w80_20"
|
|
93
|
+
}, E = f(({ placeholder: e, value: t, onChange: i, clearLabel: a, iconClassName: o = "text-secondary" }) => /* @__PURE__ */ y("div", {
|
|
94
|
+
className: "px-3 py-2",
|
|
95
|
+
children: /* @__PURE__ */ b("div", {
|
|
96
|
+
className: n("flex min-h-11 w-full items-center gap-2 rounded-full border pe-3 ps-3 desktop:min-h-9", T.row),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ y(l, {
|
|
99
|
+
size: r.SM,
|
|
100
|
+
stroke: 1.5,
|
|
101
|
+
className: n("shrink-0", o)
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ y("input", {
|
|
104
|
+
type: "text",
|
|
105
|
+
value: t,
|
|
106
|
+
placeholder: e,
|
|
107
|
+
onChange: (e) => i(e.target.value),
|
|
108
|
+
className: n("flex-1 bg-transparent outline-none", T.input)
|
|
109
|
+
}),
|
|
110
|
+
t && /* @__PURE__ */ y("button", {
|
|
111
|
+
type: "button",
|
|
112
|
+
onClick: () => i(""),
|
|
113
|
+
className: n("flex size-11 shrink-0 items-center justify-center desktop:size-6", o),
|
|
114
|
+
"aria-label": a,
|
|
115
|
+
children: /* @__PURE__ */ y(u, {
|
|
116
|
+
size: 14,
|
|
117
|
+
stroke: 1.5
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
})), D = f(({ label: t, icon: n = c, iconSize: r = 48 }) => /* @__PURE__ */ y(e, {
|
|
123
|
+
icon: /* @__PURE__ */ y(n, {
|
|
124
|
+
"aria-hidden": !0,
|
|
125
|
+
size: r,
|
|
126
|
+
stroke: 1
|
|
127
|
+
}),
|
|
128
|
+
label: t
|
|
129
|
+
})), O = f(({ label: t, icon: n = d, iconSize: r = 45 }) => /* @__PURE__ */ y(e, {
|
|
130
|
+
icon: /* @__PURE__ */ y(n, {
|
|
131
|
+
"aria-hidden": !0,
|
|
132
|
+
size: r,
|
|
133
|
+
stroke: 1
|
|
134
|
+
}),
|
|
135
|
+
label: t
|
|
136
|
+
}));
|
|
137
|
+
//#endregion
|
|
138
|
+
export { D as PanelEmpty, O as PanelNoResults, E as SearchInput, x as SidebarOrientation, w as SidebarPanel };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { SidebarOrientation } from '../types/orientation';
|
|
3
|
+
/** CSS custom-property overrides for the `SidebarPanel` component. */
|
|
4
|
+
export interface SidebarPanelColors {
|
|
5
|
+
/** Panel background color. */
|
|
6
|
+
background?: string;
|
|
7
|
+
/** Divider border color on the inner edge. */
|
|
8
|
+
border?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Typography overrides for the `SidebarPanel` component. */
|
|
11
|
+
export interface SidebarPanelTypography {
|
|
12
|
+
/**
|
|
13
|
+
* A Tailwind font utility class applied to the panel root.
|
|
14
|
+
* When provided, individual `fontFamily` / `fontSize` vars are skipped.
|
|
15
|
+
*/
|
|
16
|
+
fontClassName?: string;
|
|
17
|
+
/** Font family applied to the panel root via CSS custom property. */
|
|
18
|
+
fontFamily?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Combined style overrides (colors and typography) for the `SidebarPanel` component. */
|
|
21
|
+
export interface SidebarPanelStyles {
|
|
22
|
+
/** Color overrides applied as CSS custom properties. */
|
|
23
|
+
colors?: SidebarPanelColors;
|
|
24
|
+
/** Typography overrides applied via CSS custom properties. */
|
|
25
|
+
typography?: SidebarPanelTypography;
|
|
26
|
+
/**
|
|
27
|
+
* CSS class applied to the title element.
|
|
28
|
+
* Defaults to `'dial-body-semi-bold-text'`.
|
|
29
|
+
*/
|
|
30
|
+
titleClassName?: string;
|
|
31
|
+
/** Extra class name(s) merged onto the scrollable body `<div>`. */
|
|
32
|
+
bodyClassName?: string;
|
|
33
|
+
/** CSS custom properties applied to the panel `<aside>` element. */
|
|
34
|
+
cssVars?: CSSProperties;
|
|
35
|
+
}
|
|
36
|
+
/** Props accepted by the `SidebarPanel` component. */
|
|
37
|
+
export interface SidebarPanelProps {
|
|
38
|
+
/**
|
|
39
|
+
* Whether the panel is currently open.
|
|
40
|
+
* When provided, the wrapper adds a slide-in width animation and
|
|
41
|
+
* `aria-hidden` is set on the panel when closed.
|
|
42
|
+
*/
|
|
43
|
+
isOpen: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Which edge the panel anchors to.
|
|
46
|
+
* Controls the divider side (`border-l` vs `border-r`) and
|
|
47
|
+
* the close-button placement (outer edge of the panel).
|
|
48
|
+
* `leftActions` / `rightActions` are header-bar positions and are
|
|
49
|
+
* independent of this prop.
|
|
50
|
+
*/
|
|
51
|
+
orientation: SidebarOrientation;
|
|
52
|
+
/**
|
|
53
|
+
* Title text rendered in the header bar between the action groups.
|
|
54
|
+
* Truncated with an ellipsis when the panel is too narrow.
|
|
55
|
+
*/
|
|
56
|
+
title?: ReactNode;
|
|
57
|
+
/** Rendered in the left group of the 48 px header bar. */
|
|
58
|
+
leftActions?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* Rendered in the right group of the 48 px header bar, immediately
|
|
61
|
+
* before the built-in close button when `orientation === SidebarOrientation.Right`.
|
|
62
|
+
*/
|
|
63
|
+
rightActions?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Called when the user activates the built-in close button.
|
|
66
|
+
* When omitted the close button is not rendered.
|
|
67
|
+
*/
|
|
68
|
+
onClose?: () => void;
|
|
69
|
+
/** Accessible label for the panel region. Caller supplies the localised string. */
|
|
70
|
+
ariaLabel: string;
|
|
71
|
+
/**
|
|
72
|
+
* Accessible label and tooltip for the built-in close button.
|
|
73
|
+
* Required when `onClose` is provided.
|
|
74
|
+
*/
|
|
75
|
+
closeLabel?: string;
|
|
76
|
+
/** Body content rendered below the header bar in the scrollable region. */
|
|
77
|
+
children: ReactNode;
|
|
78
|
+
/** Extra class name(s) merged onto the panel width wrapper `<div>`. */
|
|
79
|
+
className?: string;
|
|
80
|
+
/** CSS class applied to the header element. */
|
|
81
|
+
headerClassName?: string;
|
|
82
|
+
/** Style overrides for colors, typography, and element class names. */
|
|
83
|
+
styles?: SidebarPanelStyles;
|
|
84
|
+
/**
|
|
85
|
+
* Enables drag-to-resize on the panel edge opposite to `orientation`.
|
|
86
|
+
* When false (default) the panel renders at a width determined by `className`.
|
|
87
|
+
* Automatically disabled when `isOpen` is false.
|
|
88
|
+
*/
|
|
89
|
+
resizable?: boolean;
|
|
90
|
+
/** Initial panel width in px used when `resizable` is true. */
|
|
91
|
+
defaultWidth?: number;
|
|
92
|
+
/** Minimum panel width in px used when `resizable` is true. */
|
|
93
|
+
minWidth?: number;
|
|
94
|
+
/** Maximum panel width in px used when `resizable` is true. */
|
|
95
|
+
maxWidth?: number;
|
|
96
|
+
/** Called with the new width in px when the user finishes a resize drag. */
|
|
97
|
+
onResizeStop?: (width: number) => void;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=panel-props.d.ts.map
|
|
@@ -0,0 +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;CACjB;AAED,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,yFAAyF;AACzF,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,8DAA8D;IAC9D,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,sDAAsD;AACtD,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;;OAMG;IACH,WAAW,EAAE,kBAAkB,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@epam/ai-dial-sidebar",
|
|
3
|
+
"version": "0.0.0-dev.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./index.js",
|
|
7
|
+
"module": "./index.js",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./styles.css": "./style.css",
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./index.d.ts",
|
|
14
|
+
"import": "./index.js",
|
|
15
|
+
"default": "./index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@epam/ai-dial-chat-shared": "0.0.0-dev.0",
|
|
20
|
+
"@epam/ai-dial-ui-kit": "0.12.0-dev.21",
|
|
21
|
+
"@tabler/icons-react": "^3.44.0",
|
|
22
|
+
"react": "^19.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/test-setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=test-setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-setup.d.ts","sourceRoot":"","sources":["../src/test-setup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orientation.d.ts","sourceRoot":"","sources":["../../src/types/orientation.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,oBAAY,kBAAkB;IAC5B,sCAAsC;IACtC,IAAI,SAAS;IACb,uCAAuC;IACvC,KAAK,UAAU;CAChB"}
|