@elliemae/ds-chat-sidebar 3.12.0-rc.2 → 3.12.0-rc.3
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/dist/cjs/DSChatSidebarDefinitions.js +32 -0
- package/dist/cjs/DSChatSidebarDefinitions.js.map +7 -0
- package/dist/cjs/SideBarChat.js +31 -25
- package/dist/cjs/SideBarChat.js.map +2 -2
- package/dist/cjs/sidebar-button/SidebarButton.js +4 -17
- package/dist/cjs/sidebar-button/SidebarButton.js.map +1 -1
- package/dist/esm/DSChatSidebarDefinitions.js +6 -0
- package/dist/esm/DSChatSidebarDefinitions.js.map +7 -0
- package/dist/esm/SideBarChat.js +31 -25
- package/dist/esm/SideBarChat.js.map +2 -2
- package/dist/esm/sidebar-button/SidebarButton.js +4 -17
- package/dist/esm/sidebar-button/SidebarButton.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var DSChatSidebarDefinitions_exports = {};
|
|
26
|
+
__export(DSChatSidebarDefinitions_exports, {
|
|
27
|
+
DSChatSidebarName: () => DSChatSidebarName
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(DSChatSidebarDefinitions_exports);
|
|
30
|
+
var React = __toESM(require("react"));
|
|
31
|
+
const DSChatSidebarName = "DSChatSidebar";
|
|
32
|
+
//# sourceMappingURL=DSChatSidebarDefinitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSChatSidebarDefinitions.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DSChatSidebarName = 'DSChatSidebar';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,oBAAoB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/SideBarChat.js
CHANGED
|
@@ -37,21 +37,25 @@ var import_ds_chat_tile = require("@elliemae/ds-chat-tile");
|
|
|
37
37
|
var import_styled = require("./styled");
|
|
38
38
|
var import_SidebarButton = require("./sidebar-button/SidebarButton");
|
|
39
39
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
40
|
+
var import_DSChatSidebarDefinitions = require("./DSChatSidebarDefinitions");
|
|
40
41
|
const FooterChat = ({
|
|
41
42
|
expanded,
|
|
42
43
|
onFooterClose,
|
|
43
44
|
onFooterExpand,
|
|
44
45
|
footerButtonExtraProps
|
|
45
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
import_SidebarButton.SidebarButton,
|
|
48
|
+
{
|
|
49
|
+
dsId: "sidebar_footer",
|
|
50
|
+
Icon: !expanded ? import_ds_icons.MenuCollapse : import_ds_icons.MenuExpand,
|
|
51
|
+
onClick: expanded ? onFooterClose : onFooterExpand,
|
|
52
|
+
"aria-pressed": expanded,
|
|
53
|
+
"aria-label": footerButtonExtraProps["aria-label"]
|
|
54
|
+
}
|
|
55
|
+
);
|
|
52
56
|
const SideBarChat = (props) => {
|
|
53
57
|
const propsWithDefault = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
54
|
-
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.chatSidebarProps);
|
|
58
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.chatSidebarProps, import_DSChatSidebarDefinitions.DSChatSidebarName);
|
|
55
59
|
const {
|
|
56
60
|
sidebarItems,
|
|
57
61
|
expanded,
|
|
@@ -76,29 +80,31 @@ const SideBarChat = (props) => {
|
|
|
76
80
|
actionRef.current.listRef = listRef;
|
|
77
81
|
}
|
|
78
82
|
}, [sidebarItems, expanded, actionRef, listRef]);
|
|
79
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledSideBarContainer, {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledSideBarContainer, { rows: ["1fr", "auto"], children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSideBarButtonsContainer, { children: sidebarItems.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
import_ds_chat_tile.TileButton,
|
|
86
|
+
{
|
|
87
|
+
innerRef: registerReference,
|
|
88
|
+
...p,
|
|
89
|
+
selected: selectedItem === p.dsId,
|
|
90
|
+
tooltipPlacement,
|
|
91
|
+
disableTooltip: enableTooltipWhenIsClosed ? false : !expanded
|
|
92
|
+
},
|
|
93
|
+
p.dsId
|
|
94
|
+
)) }),
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
FooterChat,
|
|
97
|
+
{
|
|
92
98
|
expanded,
|
|
93
99
|
onFooterClose,
|
|
94
100
|
onFooterExpand,
|
|
95
101
|
footerButtonExtraProps
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
});
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
] });
|
|
99
105
|
};
|
|
100
106
|
SideBarChat.propTypes = import_react_desc_prop_types.chatSidebarProps;
|
|
101
|
-
SideBarChat.displayName =
|
|
107
|
+
SideBarChat.displayName = import_DSChatSidebarDefinitions.DSChatSidebarName;
|
|
102
108
|
const SideBarChatWithSchema = (0, import_ds_utilities.describe)(SideBarChat);
|
|
103
109
|
SideBarChatWithSchema.propTypes = import_react_desc_prop_types.chatSidebarProps;
|
|
104
110
|
//# sourceMappingURL=SideBarChat.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SideBarChat.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TileButton } from '@elliemae/ds-chat-tile';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled';\nimport { SidebarButton } from './sidebar-button/SidebarButton';\nimport type { DSChatSidebarT } from './react-desc-prop-types';\nimport { defaultProps, chatSidebarProps } from './react-desc-prop-types';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n}: Pick<DSChatSidebarT.DefaultProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'>) => (\n <SidebarButton\n dsId=\"sidebar_footer\"\n Icon={!expanded ? MenuCollapse : MenuExpand}\n onClick={expanded ? onFooterClose : onFooterExpand}\n aria-pressed={expanded}\n aria-label={footerButtonExtraProps['aria-label']}\n />\n);\n\nconst SideBarChat: React.ComponentType<DSChatSidebarT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSidebarT.Props>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps);\n\n const {\n sidebarItems,\n expanded,\n onFooterClose,\n onFooterExpand,\n selectedItem,\n footerButtonExtraProps,\n tooltipPlacement,\n enableTooltipWhenIsClosed,\n actionRef,\n } = propsWithDefault;\n const { current: listRef } = React.useRef<{ [key: string]: HTMLElement }>({});\n const registerReference = React.useCallback(\n (ref: HTMLElement) => {\n if (ref?.dataset?.key) listRef[ref.dataset.key] = ref;\n },\n [listRef],\n );\n React.useEffect(() => {\n if (actionRef?.current?.listRef) {\n actionRef.current.listRef = listRef;\n }\n }, [sidebarItems, expanded, actionRef, listRef]);\n\n return (\n <StyledSideBarContainer rows={['1fr', 'auto']}>\n <StyledSideBarButtonsContainer>\n {sidebarItems.map((p) => (\n <TileButton\n key={p.dsId}\n innerRef={registerReference}\n {...p}\n selected={selectedItem === p.dsId}\n tooltipPlacement={tooltipPlacement}\n disableTooltip={enableTooltipWhenIsClosed ? false : !expanded}\n />\n ))}\n </StyledSideBarButtonsContainer>\n <FooterChat\n expanded={expanded}\n onFooterClose={onFooterClose}\n onFooterExpand={onFooterExpand}\n footerButtonExtraProps={footerButtonExtraProps}\n />\n </StyledSideBarContainer>\n );\n};\n\nSideBarChat.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\nSideBarChat.displayName =
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TileButton } from '@elliemae/ds-chat-tile';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled';\nimport { SidebarButton } from './sidebar-button/SidebarButton';\nimport type { DSChatSidebarT } from './react-desc-prop-types';\nimport { defaultProps, chatSidebarProps } from './react-desc-prop-types';\nimport { DSChatSidebarName } from './DSChatSidebarDefinitions';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n}: Pick<DSChatSidebarT.DefaultProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'>) => (\n <SidebarButton\n dsId=\"sidebar_footer\"\n Icon={!expanded ? MenuCollapse : MenuExpand}\n onClick={expanded ? onFooterClose : onFooterExpand}\n aria-pressed={expanded}\n aria-label={footerButtonExtraProps['aria-label']}\n />\n);\n\nconst SideBarChat: React.ComponentType<DSChatSidebarT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSidebarT.Props>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps, DSChatSidebarName);\n\n const {\n sidebarItems,\n expanded,\n onFooterClose,\n onFooterExpand,\n selectedItem,\n footerButtonExtraProps,\n tooltipPlacement,\n enableTooltipWhenIsClosed,\n actionRef,\n } = propsWithDefault;\n const { current: listRef } = React.useRef<{ [key: string]: HTMLElement }>({});\n const registerReference = React.useCallback(\n (ref: HTMLElement) => {\n if (ref?.dataset?.key) listRef[ref.dataset.key] = ref;\n },\n [listRef],\n );\n React.useEffect(() => {\n if (actionRef?.current?.listRef) {\n actionRef.current.listRef = listRef;\n }\n }, [sidebarItems, expanded, actionRef, listRef]);\n\n return (\n <StyledSideBarContainer rows={['1fr', 'auto']}>\n <StyledSideBarButtonsContainer>\n {sidebarItems.map((p) => (\n <TileButton\n key={p.dsId}\n innerRef={registerReference}\n {...p}\n selected={selectedItem === p.dsId}\n tooltipPlacement={tooltipPlacement}\n disableTooltip={enableTooltipWhenIsClosed ? false : !expanded}\n />\n ))}\n </StyledSideBarButtonsContainer>\n <FooterChat\n expanded={expanded}\n onFooterClose={onFooterClose}\n onFooterExpand={onFooterExpand}\n footerButtonExtraProps={footerButtonExtraProps}\n />\n </StyledSideBarContainer>\n );\n};\n\nSideBarChat.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\nSideBarChat.displayName = DSChatSidebarName;\nconst SideBarChatWithSchema = describe(SideBarChat);\nSideBarChatWithSchema.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\n\nexport { SideBarChat, SideBarChatWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBrB;AAhBF,mBAAkB;AAClB,0BAAuF;AACvF,sBAAyC;AACzC,0BAA2B;AAC3B,oBAAsE;AACtE,2BAA8B;AAE9B,mCAA+C;AAC/C,sCAAkC;AAElC,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,MAAK;AAAA,IACL,MAAM,CAAC,WAAW,+BAAe;AAAA,IACjC,SAAS,WAAW,gBAAgB;AAAA,IACpC,gBAAc;AAAA,IACd,cAAY,uBAAuB;AAAA;AACrC;AAGF,MAAM,cAAyD,CAAC,UAAU;AACxE,QAAM,uBAAmB,kDAAmD,OAAO,yCAAY;AAC/F,0DAA+B,kBAAkB,+CAAkB,iDAAiB;AAEpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,SAAS,QAAQ,IAAI,aAAAA,QAAM,OAAuC,CAAC,CAAC;AAC5E,QAAM,oBAAoB,aAAAA,QAAM;AAAA,IAC9B,CAAC,QAAqB;AACpB,UAAI,KAAK,SAAS;AAAK,gBAAQ,IAAI,QAAQ,OAAO;AAAA,IACpD;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AACA,eAAAA,QAAM,UAAU,MAAM;AACpB,QAAI,WAAW,SAAS,SAAS;AAC/B,gBAAU,QAAQ,UAAU;AAAA,IAC9B;AAAA,EACF,GAAG,CAAC,cAAc,UAAU,WAAW,OAAO,CAAC;AAE/C,SACE,6CAAC,wCAAuB,MAAM,CAAC,OAAO,MAAM,GAC1C;AAAA,gDAAC,+CACE,uBAAa,IAAI,CAAC,MACjB;AAAA,MAAC;AAAA;AAAA,QAEC,UAAU;AAAA,QACT,GAAG;AAAA,QACJ,UAAU,iBAAiB,EAAE;AAAA,QAC7B;AAAA,QACA,gBAAgB,4BAA4B,QAAQ,CAAC;AAAA;AAAA,MALhD,EAAE;AAAA,IAMT,CACD,GACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,4BAAwB,8BAAS,WAAW;AAClD,sBAAsB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -37,23 +37,10 @@ const SidebarButton = ({ label, dsId, onClick, Icon, ...rest }) => {
|
|
|
37
37
|
if (dsId)
|
|
38
38
|
onClick(dsId);
|
|
39
39
|
}, [onClick, dsId]);
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledSidebarButton, {
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSidebarButtonIcon, {
|
|
46
|
-
alignItems: "center",
|
|
47
|
-
justifyContent: "center",
|
|
48
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
|
|
49
|
-
size: "m"
|
|
50
|
-
})
|
|
51
|
-
}),
|
|
52
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSidebarButtonLabel, {
|
|
53
|
-
children: label
|
|
54
|
-
})
|
|
55
|
-
]
|
|
56
|
-
}, dsId);
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledSidebarButton, { "data-testid": `sidebar-button-${dsId}`, onClick: handleClick, ...rest, children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSidebarButtonIcon, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { size: "m" }) }),
|
|
42
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSidebarButtonLabel, { children: label })
|
|
43
|
+
] }, dsId);
|
|
57
44
|
};
|
|
58
45
|
SidebarButton.propTypes = import_props.propsSidebarButton;
|
|
59
46
|
SidebarButton.defaultProps = import_props.defaultSidebarButton;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/sidebar-button/SidebarButton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { StyledSidebarButton, StyledSidebarButtonLabel, StyledSidebarButtonIcon } from './styled';\nimport type { SidebarButtonProps } from './props';\nimport { propsSidebarButton, defaultSidebarButton } from './props';\n\nexport const SidebarButton = ({ label, dsId, onClick, Icon, ...rest }: SidebarButtonProps): JSX.Element => {\n const handleClick = React.useCallback(() => {\n if (dsId) onClick(dsId);\n }, [onClick, dsId]);\n\n return (\n <StyledSidebarButton key={dsId} data-testid={`sidebar-button-${dsId}`} onClick={handleClick} {...rest}>\n <StyledSidebarButtonIcon alignItems=\"center\" justifyContent=\"center\">\n <Icon size=\"m\" />\n </StyledSidebarButtonIcon>\n {label && <StyledSidebarButtonLabel>{label}</StyledSidebarButtonLabel>}\n </StyledSidebarButton>\n );\n};\n\nSidebarButton.propTypes = propsSidebarButton;\nSidebarButton.defaultProps = defaultSidebarButton;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWnB;AAXJ,mBAAkB;AAClB,oBAAuF;AAEvF,mBAAyD;AAElD,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,SAAS,SAAS,KAAK,MAAuC;AACzG,QAAM,cAAc,aAAAA,QAAM,YAAY,MAAM;AAC1C,QAAI;AAAM,cAAQ,IAAI;AAAA,EACxB,GAAG,CAAC,SAAS,IAAI,CAAC;AAElB,SACE,6CAAC
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWnB;AAXJ,mBAAkB;AAClB,oBAAuF;AAEvF,mBAAyD;AAElD,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,SAAS,SAAS,KAAK,MAAuC;AACzG,QAAM,cAAc,aAAAA,QAAM,YAAY,MAAM;AAC1C,QAAI;AAAM,cAAQ,IAAI;AAAA,EACxB,GAAG,CAAC,SAAS,IAAI,CAAC;AAElB,SACE,6CAAC,qCAA+B,eAAa,kBAAkB,QAAQ,SAAS,aAAc,GAAG,MAC/F;AAAA,gDAAC,yCAAwB,YAAW,UAAS,gBAAe,UAC1D,sDAAC,QAAK,MAAK,KAAI,GACjB;AAAA,IACC,SAAS,4CAAC,0CAA0B,iBAAM;AAAA,OAJnB,IAK1B;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,eAAe;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSChatSidebarDefinitions.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSChatSidebarName = 'DSChatSidebar';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,oBAAoB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/SideBarChat.js
CHANGED
|
@@ -7,21 +7,25 @@ import { TileButton } from "@elliemae/ds-chat-tile";
|
|
|
7
7
|
import { StyledSideBarContainer, StyledSideBarButtonsContainer } from "./styled";
|
|
8
8
|
import { SidebarButton } from "./sidebar-button/SidebarButton";
|
|
9
9
|
import { defaultProps, chatSidebarProps } from "./react-desc-prop-types";
|
|
10
|
+
import { DSChatSidebarName } from "./DSChatSidebarDefinitions";
|
|
10
11
|
const FooterChat = ({
|
|
11
12
|
expanded,
|
|
12
13
|
onFooterClose,
|
|
13
14
|
onFooterExpand,
|
|
14
15
|
footerButtonExtraProps
|
|
15
|
-
}) => /* @__PURE__ */ jsx(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
}) => /* @__PURE__ */ jsx(
|
|
17
|
+
SidebarButton,
|
|
18
|
+
{
|
|
19
|
+
dsId: "sidebar_footer",
|
|
20
|
+
Icon: !expanded ? MenuCollapse : MenuExpand,
|
|
21
|
+
onClick: expanded ? onFooterClose : onFooterExpand,
|
|
22
|
+
"aria-pressed": expanded,
|
|
23
|
+
"aria-label": footerButtonExtraProps["aria-label"]
|
|
24
|
+
}
|
|
25
|
+
);
|
|
22
26
|
const SideBarChat = (props) => {
|
|
23
27
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
24
|
-
useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps);
|
|
28
|
+
useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps, DSChatSidebarName);
|
|
25
29
|
const {
|
|
26
30
|
sidebarItems,
|
|
27
31
|
expanded,
|
|
@@ -46,29 +50,31 @@ const SideBarChat = (props) => {
|
|
|
46
50
|
actionRef.current.listRef = listRef;
|
|
47
51
|
}
|
|
48
52
|
}, [sidebarItems, expanded, actionRef, listRef]);
|
|
49
|
-
return /* @__PURE__ */ jsxs(StyledSideBarContainer, {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
return /* @__PURE__ */ jsxs(StyledSideBarContainer, { rows: ["1fr", "auto"], children: [
|
|
54
|
+
/* @__PURE__ */ jsx(StyledSideBarButtonsContainer, { children: sidebarItems.map((p) => /* @__PURE__ */ jsx(
|
|
55
|
+
TileButton,
|
|
56
|
+
{
|
|
57
|
+
innerRef: registerReference,
|
|
58
|
+
...p,
|
|
59
|
+
selected: selectedItem === p.dsId,
|
|
60
|
+
tooltipPlacement,
|
|
61
|
+
disableTooltip: enableTooltipWhenIsClosed ? false : !expanded
|
|
62
|
+
},
|
|
63
|
+
p.dsId
|
|
64
|
+
)) }),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
FooterChat,
|
|
67
|
+
{
|
|
62
68
|
expanded,
|
|
63
69
|
onFooterClose,
|
|
64
70
|
onFooterExpand,
|
|
65
71
|
footerButtonExtraProps
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
});
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] });
|
|
69
75
|
};
|
|
70
76
|
SideBarChat.propTypes = chatSidebarProps;
|
|
71
|
-
SideBarChat.displayName =
|
|
77
|
+
SideBarChat.displayName = DSChatSidebarName;
|
|
72
78
|
const SideBarChatWithSchema = describe(SideBarChat);
|
|
73
79
|
SideBarChatWithSchema.propTypes = chatSidebarProps;
|
|
74
80
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/SideBarChat.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TileButton } from '@elliemae/ds-chat-tile';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled';\nimport { SidebarButton } from './sidebar-button/SidebarButton';\nimport type { DSChatSidebarT } from './react-desc-prop-types';\nimport { defaultProps, chatSidebarProps } from './react-desc-prop-types';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n}: Pick<DSChatSidebarT.DefaultProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'>) => (\n <SidebarButton\n dsId=\"sidebar_footer\"\n Icon={!expanded ? MenuCollapse : MenuExpand}\n onClick={expanded ? onFooterClose : onFooterExpand}\n aria-pressed={expanded}\n aria-label={footerButtonExtraProps['aria-label']}\n />\n);\n\nconst SideBarChat: React.ComponentType<DSChatSidebarT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSidebarT.Props>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps);\n\n const {\n sidebarItems,\n expanded,\n onFooterClose,\n onFooterExpand,\n selectedItem,\n footerButtonExtraProps,\n tooltipPlacement,\n enableTooltipWhenIsClosed,\n actionRef,\n } = propsWithDefault;\n const { current: listRef } = React.useRef<{ [key: string]: HTMLElement }>({});\n const registerReference = React.useCallback(\n (ref: HTMLElement) => {\n if (ref?.dataset?.key) listRef[ref.dataset.key] = ref;\n },\n [listRef],\n );\n React.useEffect(() => {\n if (actionRef?.current?.listRef) {\n actionRef.current.listRef = listRef;\n }\n }, [sidebarItems, expanded, actionRef, listRef]);\n\n return (\n <StyledSideBarContainer rows={['1fr', 'auto']}>\n <StyledSideBarButtonsContainer>\n {sidebarItems.map((p) => (\n <TileButton\n key={p.dsId}\n innerRef={registerReference}\n {...p}\n selected={selectedItem === p.dsId}\n tooltipPlacement={tooltipPlacement}\n disableTooltip={enableTooltipWhenIsClosed ? false : !expanded}\n />\n ))}\n </StyledSideBarButtonsContainer>\n <FooterChat\n expanded={expanded}\n onFooterClose={onFooterClose}\n onFooterExpand={onFooterExpand}\n footerButtonExtraProps={footerButtonExtraProps}\n />\n </StyledSideBarContainer>\n );\n};\n\nSideBarChat.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\nSideBarChat.displayName =
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TileButton } from '@elliemae/ds-chat-tile';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled';\nimport { SidebarButton } from './sidebar-button/SidebarButton';\nimport type { DSChatSidebarT } from './react-desc-prop-types';\nimport { defaultProps, chatSidebarProps } from './react-desc-prop-types';\nimport { DSChatSidebarName } from './DSChatSidebarDefinitions';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n}: Pick<DSChatSidebarT.DefaultProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'>) => (\n <SidebarButton\n dsId=\"sidebar_footer\"\n Icon={!expanded ? MenuCollapse : MenuExpand}\n onClick={expanded ? onFooterClose : onFooterExpand}\n aria-pressed={expanded}\n aria-label={footerButtonExtraProps['aria-label']}\n />\n);\n\nconst SideBarChat: React.ComponentType<DSChatSidebarT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSidebarT.Props>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps, DSChatSidebarName);\n\n const {\n sidebarItems,\n expanded,\n onFooterClose,\n onFooterExpand,\n selectedItem,\n footerButtonExtraProps,\n tooltipPlacement,\n enableTooltipWhenIsClosed,\n actionRef,\n } = propsWithDefault;\n const { current: listRef } = React.useRef<{ [key: string]: HTMLElement }>({});\n const registerReference = React.useCallback(\n (ref: HTMLElement) => {\n if (ref?.dataset?.key) listRef[ref.dataset.key] = ref;\n },\n [listRef],\n );\n React.useEffect(() => {\n if (actionRef?.current?.listRef) {\n actionRef.current.listRef = listRef;\n }\n }, [sidebarItems, expanded, actionRef, listRef]);\n\n return (\n <StyledSideBarContainer rows={['1fr', 'auto']}>\n <StyledSideBarButtonsContainer>\n {sidebarItems.map((p) => (\n <TileButton\n key={p.dsId}\n innerRef={registerReference}\n {...p}\n selected={selectedItem === p.dsId}\n tooltipPlacement={tooltipPlacement}\n disableTooltip={enableTooltipWhenIsClosed ? false : !expanded}\n />\n ))}\n </StyledSideBarButtonsContainer>\n <FooterChat\n expanded={expanded}\n onFooterClose={onFooterClose}\n onFooterExpand={onFooterExpand}\n footerButtonExtraProps={footerButtonExtraProps}\n />\n </StyledSideBarContainer>\n );\n};\n\nSideBarChat.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\nSideBarChat.displayName = DSChatSidebarName;\nconst SideBarChatWithSchema = describe(SideBarChat);\nSideBarChatWithSchema.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\n\nexport { SideBarChat, SideBarChatWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACiBrB,cAsCE,YAtCF;AAhBF,OAAOA,YAAW;AAClB,SAAS,UAAU,gCAAgC,oCAAoC;AACvF,SAAS,cAAc,kBAAkB;AACzC,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB,qCAAqC;AACtE,SAAS,qBAAqB;AAE9B,SAAS,cAAc,wBAAwB;AAC/C,SAAS,yBAAyB;AAElC,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MACE;AAAA,EAAC;AAAA;AAAA,IACC,MAAK;AAAA,IACL,MAAM,CAAC,WAAW,eAAe;AAAA,IACjC,SAAS,WAAW,gBAAgB;AAAA,IACpC,gBAAc;AAAA,IACd,cAAY,uBAAuB;AAAA;AACrC;AAGF,MAAM,cAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAAmD,OAAO,YAAY;AAC/F,iCAA+B,kBAAkB,kBAAkB,iBAAiB;AAEpF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,SAAS,QAAQ,IAAIA,OAAM,OAAuC,CAAC,CAAC;AAC5E,QAAM,oBAAoBA,OAAM;AAAA,IAC9B,CAAC,QAAqB;AACpB,UAAI,KAAK,SAAS;AAAK,gBAAQ,IAAI,QAAQ,OAAO;AAAA,IACpD;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AACA,EAAAA,OAAM,UAAU,MAAM;AACpB,QAAI,WAAW,SAAS,SAAS;AAC/B,gBAAU,QAAQ,UAAU;AAAA,IAC9B;AAAA,EACF,GAAG,CAAC,cAAc,UAAU,WAAW,OAAO,CAAC;AAE/C,SACE,qBAAC,0BAAuB,MAAM,CAAC,OAAO,MAAM,GAC1C;AAAA,wBAAC,iCACE,uBAAa,IAAI,CAAC,MACjB;AAAA,MAAC;AAAA;AAAA,QAEC,UAAU;AAAA,QACT,GAAG;AAAA,QACJ,UAAU,iBAAiB,EAAE;AAAA,QAC7B;AAAA,QACA,gBAAgB,4BAA4B,QAAQ,CAAC;AAAA;AAAA,MALhD,EAAE;AAAA,IAMT,CACD,GACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -8,23 +8,10 @@ const SidebarButton = ({ label, dsId, onClick, Icon, ...rest }) => {
|
|
|
8
8
|
if (dsId)
|
|
9
9
|
onClick(dsId);
|
|
10
10
|
}, [onClick, dsId]);
|
|
11
|
-
return /* @__PURE__ */ jsxs(StyledSidebarButton, {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
children: [
|
|
16
|
-
/* @__PURE__ */ jsx(StyledSidebarButtonIcon, {
|
|
17
|
-
alignItems: "center",
|
|
18
|
-
justifyContent: "center",
|
|
19
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
20
|
-
size: "m"
|
|
21
|
-
})
|
|
22
|
-
}),
|
|
23
|
-
label && /* @__PURE__ */ jsx(StyledSidebarButtonLabel, {
|
|
24
|
-
children: label
|
|
25
|
-
})
|
|
26
|
-
]
|
|
27
|
-
}, dsId);
|
|
11
|
+
return /* @__PURE__ */ jsxs(StyledSidebarButton, { "data-testid": `sidebar-button-${dsId}`, onClick: handleClick, ...rest, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(StyledSidebarButtonIcon, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx(Icon, { size: "m" }) }),
|
|
13
|
+
label && /* @__PURE__ */ jsx(StyledSidebarButtonLabel, { children: label })
|
|
14
|
+
] }, dsId);
|
|
28
15
|
};
|
|
29
16
|
SidebarButton.propTypes = propsSidebarButton;
|
|
30
17
|
SidebarButton.defaultProps = defaultSidebarButton;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/sidebar-button/SidebarButton.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { StyledSidebarButton, StyledSidebarButtonLabel, StyledSidebarButtonIcon } from './styled';\nimport type { SidebarButtonProps } from './props';\nimport { propsSidebarButton, defaultSidebarButton } from './props';\n\nexport const SidebarButton = ({ label, dsId, onClick, Icon, ...rest }: SidebarButtonProps): JSX.Element => {\n const handleClick = React.useCallback(() => {\n if (dsId) onClick(dsId);\n }, [onClick, dsId]);\n\n return (\n <StyledSidebarButton key={dsId} data-testid={`sidebar-button-${dsId}`} onClick={handleClick} {...rest}>\n <StyledSidebarButtonIcon alignItems=\"center\" justifyContent=\"center\">\n <Icon size=\"m\" />\n </StyledSidebarButtonIcon>\n {label && <StyledSidebarButtonLabel>{label}</StyledSidebarButtonLabel>}\n </StyledSidebarButton>\n );\n};\n\nSidebarButton.propTypes = propsSidebarButton;\nSidebarButton.defaultProps = defaultSidebarButton;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACWnB,SAEI,KAFJ;AAXJ,OAAOA,YAAW;AAClB,SAAS,qBAAqB,0BAA0B,+BAA+B;AAEvF,SAAS,oBAAoB,4BAA4B;AAElD,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,SAAS,SAAS,KAAK,MAAuC;AACzG,QAAM,cAAcA,OAAM,YAAY,MAAM;AAC1C,QAAI;AAAM,cAAQ,IAAI;AAAA,EACxB,GAAG,CAAC,SAAS,IAAI,CAAC;AAElB,SACE,qBAAC
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACWnB,SAEI,KAFJ;AAXJ,OAAOA,YAAW;AAClB,SAAS,qBAAqB,0BAA0B,+BAA+B;AAEvF,SAAS,oBAAoB,4BAA4B;AAElD,MAAM,gBAAgB,CAAC,EAAE,OAAO,MAAM,SAAS,SAAS,KAAK,MAAuC;AACzG,QAAM,cAAcA,OAAM,YAAY,MAAM;AAC1C,QAAI;AAAM,cAAQ,IAAI;AAAA,EACxB,GAAG,CAAC,SAAS,IAAI,CAAC;AAElB,SACE,qBAAC,uBAA+B,eAAa,kBAAkB,QAAQ,SAAS,aAAc,GAAG,MAC/F;AAAA,wBAAC,2BAAwB,YAAW,UAAS,gBAAe,UAC1D,8BAAC,QAAK,MAAK,KAAI,GACjB;AAAA,IACC,SAAS,oBAAC,4BAA0B,iBAAM;AAAA,OAJnB,IAK1B;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,eAAe;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chat-sidebar",
|
|
3
|
-
"version": "3.12.0-rc.
|
|
3
|
+
"version": "3.12.0-rc.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chat Sidebar",
|
|
6
6
|
"files": [
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
"typeSafety": true
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@elliemae/ds-chat-tile": "3.12.0-rc.
|
|
67
|
-
"@elliemae/ds-grid": "3.12.0-rc.
|
|
68
|
-
"@elliemae/ds-icons": "3.12.0-rc.
|
|
69
|
-
"@elliemae/ds-system": "3.12.0-rc.
|
|
70
|
-
"@elliemae/ds-utilities": "3.12.0-rc.
|
|
66
|
+
"@elliemae/ds-chat-tile": "3.12.0-rc.3",
|
|
67
|
+
"@elliemae/ds-grid": "3.12.0-rc.3",
|
|
68
|
+
"@elliemae/ds-icons": "3.12.0-rc.3",
|
|
69
|
+
"@elliemae/ds-system": "3.12.0-rc.3",
|
|
70
|
+
"@elliemae/ds-utilities": "3.12.0-rc.3"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"styled-components": "~5.3.6"
|