@elliemae/ds-chat-sidebar 3.70.0-next.1 → 3.70.0-next.11

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.
Files changed (54) hide show
  1. package/dist/cjs/DSChatSidebarDataTestIds.js +2 -1
  2. package/dist/cjs/DSChatSidebarDataTestIds.js.map +2 -2
  3. package/dist/cjs/DSChatSidebarDefinitions.js +2 -2
  4. package/dist/cjs/DSChatSidebarDefinitions.js.map +2 -2
  5. package/dist/cjs/SideBarChat.js +52 -28
  6. package/dist/cjs/SideBarChat.js.map +2 -2
  7. package/dist/cjs/constants/index.js +52 -0
  8. package/dist/cjs/constants/index.js.map +7 -0
  9. package/dist/cjs/index.js +11 -1
  10. package/dist/cjs/index.js.map +2 -2
  11. package/dist/cjs/react-desc-prop-types.js +5 -1
  12. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  13. package/dist/cjs/sidebar-button/SidebarButton.js +26 -6
  14. package/dist/cjs/sidebar-button/SidebarButton.js.map +2 -2
  15. package/dist/cjs/sidebar-button/props.js +6 -2
  16. package/dist/cjs/sidebar-button/props.js.map +2 -2
  17. package/dist/cjs/sidebar-button/styled.js +15 -3
  18. package/dist/cjs/sidebar-button/styled.js.map +2 -2
  19. package/dist/cjs/styled.js +11 -2
  20. package/dist/cjs/styled.js.map +2 -2
  21. package/dist/esm/DSChatSidebarDataTestIds.js +2 -1
  22. package/dist/esm/DSChatSidebarDataTestIds.js.map +2 -2
  23. package/dist/esm/DSChatSidebarDefinitions.js +1 -1
  24. package/dist/esm/DSChatSidebarDefinitions.js.map +2 -2
  25. package/dist/esm/SideBarChat.js +58 -27
  26. package/dist/esm/SideBarChat.js.map +2 -2
  27. package/dist/esm/constants/index.js +22 -0
  28. package/dist/esm/constants/index.js.map +7 -0
  29. package/dist/esm/index.js +12 -2
  30. package/dist/esm/index.js.map +2 -2
  31. package/dist/esm/react-desc-prop-types.js +11 -2
  32. package/dist/esm/react-desc-prop-types.js.map +2 -2
  33. package/dist/esm/sidebar-button/SidebarButton.js +27 -7
  34. package/dist/esm/sidebar-button/SidebarButton.js.map +2 -2
  35. package/dist/esm/sidebar-button/props.js +6 -2
  36. package/dist/esm/sidebar-button/props.js.map +2 -2
  37. package/dist/esm/sidebar-button/styled.js +15 -3
  38. package/dist/esm/sidebar-button/styled.js.map +2 -2
  39. package/dist/esm/styled.js +11 -2
  40. package/dist/esm/styled.js.map +2 -2
  41. package/dist/types/DSChatSidebarDefinitions.d.ts +1 -1
  42. package/dist/types/SideBarChat.d.ts +3 -1
  43. package/dist/types/constants/index.d.ts +15 -0
  44. package/dist/types/index.d.ts +4 -1
  45. package/dist/types/react-desc-prop-types.d.ts +15 -16
  46. package/dist/types/sidebar-button/props.d.ts +2 -0
  47. package/dist/types/tests/DSChatSidebar.a11y.test.d.ts +1 -0
  48. package/dist/types/tests/DSChatSidebar.api.test.d.ts +1 -0
  49. package/dist/types/tests/DSChatSidebar.data-testId.test.d.ts +1 -0
  50. package/dist/types/tests/DSChatSidebar.events.test.d.ts +1 -0
  51. package/dist/types/tests/DSChatSidebar.exports.test.d.ts +1 -0
  52. package/dist/types/tests/DSChatSidebar.get-owner-props-arguments.test.d.ts +1 -0
  53. package/dist/types/tests/DSChatSidebar.keyboard.test.d.ts +1 -0
  54. package/package.json +9 -8
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// Legacy file \u2014 preserved as a shim. Source of truth is now `./constants/index.ts`.\nexport { DSChatSidebarName } from './constants/index.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,yBAAyB;",
6
6
  "names": []
7
7
  }
@@ -1,19 +1,27 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React2 from "react";
4
- import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
4
+ import {
5
+ describe,
6
+ useValidateTypescriptPropTypes,
7
+ useMemoMergePropsWithDefault,
8
+ useOwnerProps,
9
+ useGetGlobalAttributes,
10
+ useGetXstyledProps
11
+ } from "@elliemae/ds-props-helpers";
5
12
  import { MenuCollapse, MenuExpand } from "@elliemae/ds-icons";
6
13
  import { TileButton } from "@elliemae/ds-chat-tile";
7
14
  import { StyledSideBarContainer, StyledSideBarButtonsContainer } from "./styled.js";
8
15
  import { SidebarButton } from "./sidebar-button/SidebarButton.js";
9
16
  import { defaultProps, chatSidebarProps } from "./react-desc-prop-types.js";
10
- import { DSChatSidebarName } from "./DSChatSidebarDefinitions.js";
11
- import { DSChatSidebarDataTestIds } from "./DSChatSidebarDataTestIds.js";
17
+ import { CHAT_SIDEBAR_DATA_TESTID, DSChatSidebarName } from "./constants/index.js";
12
18
  const FooterChat = ({
13
19
  expanded,
14
20
  onFooterClose,
15
21
  onFooterExpand,
16
- footerButtonExtraProps
22
+ footerButtonExtraProps,
23
+ getOwnerProps,
24
+ getOwnerPropsArguments
17
25
  }) => /* @__PURE__ */ jsx(
18
26
  SidebarButton,
19
27
  {
@@ -21,12 +29,18 @@ const FooterChat = ({
21
29
  Icon: !expanded ? MenuCollapse : MenuExpand,
22
30
  onClick: expanded ? onFooterClose : onFooterExpand,
23
31
  "aria-pressed": expanded,
24
- "aria-label": footerButtonExtraProps["aria-label"]
32
+ "aria-label": footerButtonExtraProps["aria-label"],
33
+ getOwnerProps,
34
+ getOwnerPropsArguments
25
35
  }
26
36
  );
27
37
  const SideBarChat = (props) => {
28
38
  const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
29
39
  useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps, DSChatSidebarName);
40
+ const globalAttrs = useGetGlobalAttributes(propsWithDefault);
41
+ const { wrap: wrapStripped, ...globalProps } = globalAttrs;
42
+ const xstyledProps = useGetXstyledProps(propsWithDefault);
43
+ const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);
30
44
  const {
31
45
  sidebarItems,
32
46
  expanded,
@@ -50,33 +64,50 @@ const SideBarChat = (props) => {
50
64
  actionRef.current.listRef = listRef;
51
65
  }
52
66
  }, [sidebarItems, expanded, actionRef, listRef]);
53
- return /* @__PURE__ */ jsxs(StyledSideBarContainer, { rows: ["1fr", "auto"], "data-testid": DSChatSidebarDataTestIds.ROOT, 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
- {
68
- expanded,
69
- onFooterClose,
70
- onFooterExpand,
71
- footerButtonExtraProps
72
- }
73
- )
74
- ] });
67
+ return /* @__PURE__ */ jsxs(
68
+ StyledSideBarContainer,
69
+ {
70
+ ...globalProps,
71
+ ...xstyledProps,
72
+ rows: ["1fr", "auto"],
73
+ "data-testid": CHAT_SIDEBAR_DATA_TESTID.ROOT,
74
+ getOwnerProps,
75
+ getOwnerPropsArguments,
76
+ children: [
77
+ /* @__PURE__ */ jsx(StyledSideBarButtonsContainer, { getOwnerProps, getOwnerPropsArguments, children: sidebarItems.map((p) => /* @__PURE__ */ jsx(
78
+ TileButton,
79
+ {
80
+ innerRef: registerReference,
81
+ ...p,
82
+ selected: selectedItem === p.dsId,
83
+ tooltipPlacement,
84
+ disableTooltip: enableTooltipWhenIsClosed ? false : !expanded
85
+ },
86
+ p.dsId
87
+ )) }),
88
+ /* @__PURE__ */ jsx(
89
+ FooterChat,
90
+ {
91
+ expanded,
92
+ onFooterClose,
93
+ onFooterExpand,
94
+ footerButtonExtraProps,
95
+ getOwnerProps,
96
+ getOwnerPropsArguments
97
+ }
98
+ )
99
+ ]
100
+ }
101
+ );
75
102
  };
76
103
  SideBarChat.displayName = DSChatSidebarName;
77
104
  const SideBarChatWithSchema = describe(SideBarChat);
78
105
  SideBarChatWithSchema.propTypes = chatSidebarProps;
106
+ const DSChatSidebar = SideBarChat;
107
+ const DSChatSidebarWithSchema = SideBarChatWithSchema;
79
108
  export {
109
+ DSChatSidebar,
110
+ DSChatSidebarWithSchema,
80
111
  SideBarChat,
81
112
  SideBarChatWithSchema
82
113
  };
@@ -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-props-helpers';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TileButton } from '@elliemae/ds-chat-tile';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled.js';\nimport { SidebarButton } from './sidebar-button/SidebarButton.js';\nimport type { DSChatSidebarT } from './react-desc-prop-types.js';\nimport { defaultProps, chatSidebarProps } from './react-desc-prop-types.js';\nimport { DSChatSidebarName } from './DSChatSidebarDefinitions.js';\nimport { DSChatSidebarDataTestIds } from './DSChatSidebarDataTestIds.js';\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.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps, DSChatSidebarName);\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']} data-testid={DSChatSidebarDataTestIds.ROOT}>\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.displayName = DSChatSidebarName;\nconst SideBarChatWithSchema = describe(SideBarChat);\nSideBarChatWithSchema.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\n\nexport { SideBarChat, SideBarChatWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkBrB,cAqCE,YArCF;AAjBF,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;AAClC,SAAS,gCAAgC;AAEzC,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,YAAY;AAAA;AACjD;AAGF,MAAM,cAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA2D,OAAO,YAAY;AACvG,iCAA+B,kBAAkB,kBAAkB,iBAAiB;AACpF,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,IAAK,SAAQ,IAAI,QAAQ,GAAG,IAAI;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,GAAG,eAAa,yBAAyB,MACnF;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,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport {\n describe,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n useOwnerProps,\n useGetGlobalAttributes,\n useGetXstyledProps,\n} from '@elliemae/ds-props-helpers';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { TileButton } from '@elliemae/ds-chat-tile';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled.js';\nimport { SidebarButton } from './sidebar-button/SidebarButton.js';\nimport type { DSChatSidebarT } from './react-desc-prop-types.js';\nimport { defaultProps, chatSidebarProps } from './react-desc-prop-types.js';\nimport { CHAT_SIDEBAR_DATA_TESTID, DSChatSidebarName } from './constants/index.js';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n getOwnerProps,\n getOwnerPropsArguments,\n}: Pick<DSChatSidebarT.DefaultProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'> & {\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}) => (\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 getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n);\n\nconst SideBarChat: React.ComponentType<DSChatSidebarT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSidebarT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, chatSidebarProps, DSChatSidebarName);\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n // strip `wrap` \u2014 Grid uses a strict literal type (`Wrap`) that collides with the generic string from globalAttributes.\n // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars\n const { wrap: wrapStripped, ...globalProps } = globalAttrs as typeof globalAttrs & { wrap?: unknown };\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps<DSChatSidebarT.Props>(propsWithDefault);\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\n {...globalProps}\n {...xstyledProps}\n rows={['1fr', 'auto']}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={CHAT_SIDEBAR_DATA_TESTID.ROOT}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSideBarButtonsContainer getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\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 getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </StyledSideBarContainer>\n );\n};\n\nSideBarChat.displayName = DSChatSidebarName;\nconst SideBarChatWithSchema = describe(SideBarChat);\nSideBarChatWithSchema.propTypes = chatSidebarProps as WeakValidationMap<unknown>;\n\n// DS-prefixed canonical names (modern Dimsum convention) \u2014 SideBarChat kept as alias for backwards compat\nconst DSChatSidebar = SideBarChat;\nconst DSChatSidebarWithSchema = SideBarChatWithSchema;\n\nexport { SideBarChat, SideBarChatWithSchema, DSChatSidebar, DSChatSidebarWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC6BrB,cA+CE,YA/CF;AA5BF,OAAOA,YAAW;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc,kBAAkB;AACzC,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB,qCAAqC;AACtE,SAAS,qBAAqB;AAE9B,SAAS,cAAc,wBAAwB;AAC/C,SAAS,0BAA0B,yBAAyB;AAE5D,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAIE;AAAA,EAAC;AAAA;AAAA,IACC,MAAK;AAAA,IACL,MAAM,CAAC,WAAW,eAAe;AAAA,IACjC,SAAS,WAAW,gBAAgB;AAAA,IACpC,gBAAc;AAAA,IACd,cAAY,uBAAuB,YAAY;AAAA,IAC/C;AAAA,IACA;AAAA;AACF;AAGF,MAAM,cAAyD,CAAC,UAAU;AACxE,QAAM,mBAAmB,6BAA2D,OAAO,YAAY;AACvG,iCAA+B,kBAAkB,kBAAkB,iBAAiB;AAEpF,QAAM,cAAc,uBAAuB,gBAAgB;AAG3D,QAAM,EAAE,MAAM,cAAc,GAAG,YAAY,IAAI;AAC/C,QAAM,eAAe,mBAAmB,gBAAgB;AACxD,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAoC,gBAAgB;AAEtG,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,IAAK,SAAQ,IAAI,QAAQ,GAAG,IAAI;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;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,MAAM,CAAC,OAAO,MAAM;AAAA,MAEpB,eAAa,yBAAyB;AAAA,MACtC;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,iCAA8B,eAA8B,wBAC1D,uBAAa,IAAI,CAAC,MACjB;AAAA,UAAC;AAAA;AAAA,YAEC,UAAU;AAAA,YACT,GAAG;AAAA,YACJ,UAAU,iBAAiB,EAAE;AAAA,YAC7B;AAAA,YACA,gBAAgB,4BAA4B,QAAQ,CAAC;AAAA;AAAA,UALhD,EAAE;AAAA,QAMT,CACD,GACH;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;AAGlC,MAAM,gBAAgB;AACtB,MAAM,0BAA0B;",
6
6
  "names": ["React"]
7
7
  }
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { slotObjectToDataTestIds } from "@elliemae/ds-system";
3
+ const DSChatSidebarName = "DSChatsidebar";
4
+ const CHAT_SIDEBAR_SLOTS = {
5
+ ROOT: "root",
6
+ // legacy ones...
7
+ BUTTONS_CONTAINER: "buttons-container",
8
+ SIDEBAR_BUTTON: "sidebar-button",
9
+ SIDEBAR_BUTTON_ICON: "sidebar-button-icon",
10
+ SIDEBAR_BUTTON_LABEL: "sidebar-button-label"
11
+ };
12
+ const CHAT_SIDEBAR_DATA_TESTID = {
13
+ ...slotObjectToDataTestIds(DSChatSidebarName, CHAT_SIDEBAR_SLOTS),
14
+ ROOT: "ds-chat-sidebar"
15
+ // legacy value — breaking change if removed
16
+ };
17
+ export {
18
+ CHAT_SIDEBAR_DATA_TESTID,
19
+ CHAT_SIDEBAR_SLOTS,
20
+ DSChatSidebarName
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSChatSidebarName = 'DSChatsidebar';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const CHAT_SIDEBAR_SLOTS = {\n ROOT: 'root', // legacy ones...\n BUTTONS_CONTAINER: 'buttons-container',\n SIDEBAR_BUTTON: 'sidebar-button',\n SIDEBAR_BUTTON_ICON: 'sidebar-button-icon',\n SIDEBAR_BUTTON_LABEL: 'sidebar-button-label',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\n// Note: ROOT legacy value is `ds-chat-sidebar` \u2014 preserved at three layers (constants + preserveLegacyDataTestId + inline JSX) \u2014 breaking change if removed.\n// Note: the dynamic `sidebar-button-${dsId}` testid rendered by SidebarButton.tsx is preserved inline at the JSX level only; it cannot be expressed in this static map.\nexport const CHAT_SIDEBAR_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSChatSidebarName, CHAT_SIDEBAR_SLOTS),\n ROOT: 'ds-chat-sidebar', // legacy value \u2014 breaking change if removed\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,oBAAoB;AAG1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA;AAAA,EACN,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,sBAAsB;AACxB;AAKO,MAAM,2BAA2B;AAAA,EACtC,GAAG,wBAAwB,mBAAmB,kBAAkB;AAAA,EAChE,MAAM;AAAA;AACR;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -1,7 +1,17 @@
1
1
  import * as React from "react";
2
- import { SideBarChat, SideBarChatWithSchema } from "./SideBarChat.js";
2
+ import { SideBarChat, SideBarChatWithSchema, DSChatSidebar, DSChatSidebarWithSchema } from "./SideBarChat.js";
3
+ import { DSChatSidebarDataTestIds } from "./DSChatSidebarDataTestIds.js";
4
+ import { chatSidebarProps } from "./react-desc-prop-types.js";
5
+ import { CHAT_SIDEBAR_DATA_TESTID, CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from "./constants/index.js";
3
6
  export {
7
+ CHAT_SIDEBAR_DATA_TESTID,
8
+ CHAT_SIDEBAR_SLOTS,
9
+ DSChatSidebar,
10
+ DSChatSidebarDataTestIds,
11
+ DSChatSidebarName,
12
+ DSChatSidebarWithSchema,
4
13
  SideBarChat,
5
- SideBarChatWithSchema
14
+ SideBarChatWithSchema,
15
+ chatSidebarProps
6
16
  };
7
17
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { SideBarChat, SideBarChatWithSchema } from './SideBarChat.js';\nexport type { DSChatSidebarT } from './react-desc-prop-types.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,6BAA6B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { SideBarChat, SideBarChatWithSchema, DSChatSidebar, DSChatSidebarWithSchema } from './SideBarChat.js';\nexport { DSChatSidebarDataTestIds } from './DSChatSidebarDataTestIds.js'; // LEGACY EXPORT\nexport type { DSChatSidebarT } from './react-desc-prop-types.js';\nexport { chatSidebarProps } from './react-desc-prop-types.js';\nexport { CHAT_SIDEBAR_DATA_TESTID, CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from './constants/index.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,uBAAuB,eAAe,+BAA+B;AAC3F,SAAS,gCAAgC;AAEzC,SAAS,wBAAwB;AACjC,SAAS,0BAA0B,oBAAoB,yBAAyB;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,12 @@
1
1
  import * as React from "react";
2
- import { PropTypes } from "@elliemae/ds-props-helpers";
2
+ import {
3
+ PropTypes,
4
+ getPropsPerSlotPropTypes,
5
+ globalAttributesPropTypes,
6
+ xstyledPropTypes
7
+ } from "@elliemae/ds-props-helpers";
3
8
  import { noop } from "lodash-es";
9
+ import { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from "./constants/index.js";
4
10
  const defaultProps = {
5
11
  expanded: false,
6
12
  sidebarItems: [],
@@ -13,6 +19,9 @@ const defaultProps = {
13
19
  enableTooltipWhenIsClosed: false
14
20
  };
15
21
  const chatSidebarProps = {
22
+ ...getPropsPerSlotPropTypes(DSChatSidebarName, CHAT_SIDEBAR_SLOTS),
23
+ ...globalAttributesPropTypes,
24
+ ...xstyledPropTypes,
16
25
  sidebarItems: PropTypes.arrayOf(PropTypes.object).description("The array of out-of-the-box items you want to render inside the sidebar nav of the chat").defaultValue(defaultProps.sidebarItems),
17
26
  expanded: PropTypes.bool.description("Whether to show the chat expanded or collapsed").defaultValue(defaultProps.expanded),
18
27
  selectedItem: PropTypes.string.description("The id of the chat item you want to be opened"),
@@ -30,7 +39,7 @@ const chatSidebarProps = {
30
39
  "left",
31
40
  "left-start"
32
41
  ]).description("start placement preferences, as per popperjs placement option").defaultValue("'right'"),
33
- enableTooltipWhenIsClosed: PropTypes.bool.description("Enable tooltip when is closed").defaultValue(defaultProps.onFooterExpand),
42
+ enableTooltipWhenIsClosed: PropTypes.bool.description("Enable tooltip when is closed").defaultValue(defaultProps.enableTooltipWhenIsClosed),
34
43
  onFooterExpand: PropTypes.func.description("The function to call when the chat is opened via the footer").defaultValue(defaultProps.onFooterExpand),
35
44
  onFooterClose: PropTypes.func.description("The function to call when the chat is closed via the footer").defaultValue(defaultProps.onFooterClose),
36
45
  onHeaderExpand: PropTypes.func.description("The function to call when the chat is opened via the header").defaultValue(defaultProps.onHeaderExpand),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSChatTileT } from '@elliemae/ds-chat-tile';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { noop } from 'lodash-es';\n\nexport declare namespace DSChatSidebarT {\n type TooltipPlacementT =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n sidebarItems: DSChatTileT.Props[];\n expanded: boolean;\n onFooterClose: () => void;\n onFooterExpand: () => void;\n onHeaderExpand: () => void;\n onHeaderClose: () => void;\n footerButtonExtraProps: Record<string, string>;\n tooltipPlacement: TooltipPlacementT;\n enableTooltipWhenIsClosed: boolean;\n }\n\n export interface OptionalProps {\n selectedItem?: string | number;\n actionRef?: React.MutableRefObject<{\n listRef: { [key: string]: HTMLElement };\n }>;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {}\n}\n\nexport const defaultProps: DSChatSidebarT.DefaultProps = {\n expanded: false,\n sidebarItems: [],\n onFooterExpand: noop,\n onFooterClose: noop,\n onHeaderExpand: noop,\n onHeaderClose: noop,\n footerButtonExtraProps: { 'aria-label': 'expand or collapse button' },\n tooltipPlacement: 'right',\n enableTooltipWhenIsClosed: false,\n};\n\nexport const chatSidebarProps = {\n sidebarItems: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the sidebar nav of the chat')\n .defaultValue(defaultProps.sidebarItems),\n expanded: PropTypes.bool\n .description('Whether to show the chat expanded or collapsed')\n .defaultValue(defaultProps.expanded),\n selectedItem: PropTypes.string.description('The id of the chat item you want to be opened'),\n tooltipPlacement: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'right'\"),\n enableTooltipWhenIsClosed: PropTypes.bool\n .description('Enable tooltip when is closed')\n .defaultValue(defaultProps.onFooterExpand),\n onFooterExpand: PropTypes.func\n .description('The function to call when the chat is opened via the footer')\n .defaultValue(defaultProps.onFooterExpand),\n onFooterClose: PropTypes.func\n .description('The function to call when the chat is closed via the footer')\n .defaultValue(defaultProps.onFooterClose),\n onHeaderExpand: PropTypes.func\n .description('The function to call when the chat is opened via the header')\n .defaultValue(defaultProps.onHeaderExpand),\n onHeaderClose: PropTypes.func\n .description('The function to call when the chat is closed via the header')\n .defaultValue(defaultProps.onHeaderClose),\n footerButtonExtraProps: PropTypes.object\n .description('Expand/collapse footer button extra props')\n .defaultValue(defaultProps.footerButtonExtraProps),\n actionRef: PropTypes.object.description(\n `Action ref for sidebar\n {\n listRef: references to Tiles\n }\n `,\n ),\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AA2Cd,MAAM,eAA4C;AAAA,EACvD,UAAU;AAAA,EACV,cAAc,CAAC;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,wBAAwB,EAAE,cAAc,4BAA4B;AAAA,EACpE,kBAAkB;AAAA,EAClB,2BAA2B;AAC7B;AAEO,MAAM,mBAAmB;AAAA,EAC9B,cAAc,UAAU,QAAQ,UAAU,MAAM,EAC7C,YAAY,yFAAyF,EACrG,aAAa,aAAa,YAAY;AAAA,EACzC,UAAU,UAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,aAAa,QAAQ;AAAA,EACrC,cAAc,UAAU,OAAO,YAAY,+CAA+C;AAAA,EAC1F,kBAAkB,UAAU,MAAM;AAAA,IAChC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,+DAA+D,EAC3E,aAAa,SAAS;AAAA,EACzB,2BAA2B,UAAU,KAClC,YAAY,+BAA+B,EAC3C,aAAa,aAAa,cAAc;AAAA,EAC3C,gBAAgB,UAAU,KACvB,YAAY,6DAA6D,EACzE,aAAa,aAAa,cAAc;AAAA,EAC3C,eAAe,UAAU,KACtB,YAAY,6DAA6D,EACzE,aAAa,aAAa,aAAa;AAAA,EAC1C,gBAAgB,UAAU,KACvB,YAAY,6DAA6D,EACzE,aAAa,aAAa,cAAc;AAAA,EAC3C,eAAe,UAAU,KACtB,YAAY,6DAA6D,EACzE,aAAa,aAAa,aAAa;AAAA,EAC1C,wBAAwB,UAAU,OAC/B,YAAY,2CAA2C,EACvD,aAAa,aAAa,sBAAsB;AAAA,EACnD,WAAW,UAAU,OAAO;AAAA,IAC1B;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type React from 'react';\nimport type { DSChatTileT } from '@elliemae/ds-chat-tile';\nimport type { DSPropTypesSchema, GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { noop } from 'lodash-es';\nimport { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from './constants/index.js';\n\nexport declare namespace DSChatSidebarT {\n type TooltipPlacementT =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-end'\n | 'bottom'\n | 'bottom-start'\n | 'left-end'\n | 'left'\n | 'left-start';\n\n // hand-written per-slot function argument map \u2014 one entry per slot in CHAT_SIDEBAR_SLOTS\n export type SlotFunctionArguments = {\n dsChatsidebarRoot: () => object;\n dsChatsidebarButtonsContainer: () => object;\n dsChatsidebarSidebarButton: () => object;\n dsChatsidebarSidebarButtonIcon: () => object;\n dsChatsidebarSidebarButtonLabel: () => object;\n };\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n sidebarItems: DSChatTileT.Props[];\n expanded: boolean;\n onFooterClose: () => void;\n onFooterExpand: () => void;\n onHeaderExpand: () => void;\n onHeaderClose: () => void;\n footerButtonExtraProps: Record<string, string>;\n tooltipPlacement: TooltipPlacementT;\n enableTooltipWhenIsClosed: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSChatSidebarName, typeof CHAT_SIDEBAR_SLOTS> {\n selectedItem?: string | number;\n actionRef?: React.MutableRefObject<{\n listRef: { [key: string]: HTMLElement };\n }>;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSChatSidebarT.DefaultProps = {\n expanded: false,\n sidebarItems: [],\n onFooterExpand: noop,\n onFooterClose: noop,\n onHeaderExpand: noop,\n onHeaderClose: noop,\n footerButtonExtraProps: { 'aria-label': 'expand or collapse button' },\n tooltipPlacement: 'right',\n enableTooltipWhenIsClosed: false,\n};\n\nexport const chatSidebarProps: DSPropTypesSchema<DSChatSidebarT.Props> = {\n ...getPropsPerSlotPropTypes(DSChatSidebarName, CHAT_SIDEBAR_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n sidebarItems: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the sidebar nav of the chat')\n .defaultValue(defaultProps.sidebarItems),\n expanded: PropTypes.bool\n .description('Whether to show the chat expanded or collapsed')\n .defaultValue(defaultProps.expanded),\n selectedItem: PropTypes.string.description('The id of the chat item you want to be opened'),\n tooltipPlacement: PropTypes.oneOf([\n 'top-start',\n 'top',\n 'top-end',\n 'right-start',\n 'right',\n 'right-end',\n 'bottom-end',\n 'bottom',\n 'bottom-start',\n 'left-end',\n 'left',\n 'left-start',\n ])\n .description('start placement preferences, as per popperjs placement option')\n .defaultValue(\"'right'\"),\n enableTooltipWhenIsClosed: PropTypes.bool\n .description('Enable tooltip when is closed')\n .defaultValue(defaultProps.enableTooltipWhenIsClosed),\n onFooterExpand: PropTypes.func\n .description('The function to call when the chat is opened via the footer')\n .defaultValue(defaultProps.onFooterExpand),\n onFooterClose: PropTypes.func\n .description('The function to call when the chat is closed via the footer')\n .defaultValue(defaultProps.onFooterClose),\n onHeaderExpand: PropTypes.func\n .description('The function to call when the chat is opened via the header')\n .defaultValue(defaultProps.onHeaderExpand),\n onHeaderClose: PropTypes.func\n .description('The function to call when the chat is closed via the header')\n .defaultValue(defaultProps.onHeaderClose),\n footerButtonExtraProps: PropTypes.object\n .description('Expand/collapse footer button extra props')\n .defaultValue(defaultProps.footerButtonExtraProps),\n actionRef: PropTypes.object.description(\n `Action ref for sidebar\n {\n listRef: references to Tiles\n }\n `,\n ),\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,YAAY;AACrB,SAAS,oBAAoB,yBAAyB;AA+D/C,MAAM,eAA4C;AAAA,EACvD,UAAU;AAAA,EACV,cAAc,CAAC;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,wBAAwB,EAAE,cAAc,4BAA4B;AAAA,EACpE,kBAAkB;AAAA,EAClB,2BAA2B;AAC7B;AAEO,MAAM,mBAA4D;AAAA,EACvE,GAAG,yBAAyB,mBAAmB,kBAAkB;AAAA,EACjE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,cAAc,UAAU,QAAQ,UAAU,MAAM,EAC7C,YAAY,yFAAyF,EACrG,aAAa,aAAa,YAAY;AAAA,EACzC,UAAU,UAAU,KACjB,YAAY,gDAAgD,EAC5D,aAAa,aAAa,QAAQ;AAAA,EACrC,cAAc,UAAU,OAAO,YAAY,+CAA+C;AAAA,EAC1F,kBAAkB,UAAU,MAAM;AAAA,IAChC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,EACE,YAAY,+DAA+D,EAC3E,aAAa,SAAS;AAAA,EACzB,2BAA2B,UAAU,KAClC,YAAY,+BAA+B,EAC3C,aAAa,aAAa,yBAAyB;AAAA,EACtD,gBAAgB,UAAU,KACvB,YAAY,6DAA6D,EACzE,aAAa,aAAa,cAAc;AAAA,EAC3C,eAAe,UAAU,KACtB,YAAY,6DAA6D,EACzE,aAAa,aAAa,aAAa;AAAA,EAC1C,gBAAgB,UAAU,KACvB,YAAY,6DAA6D,EACzE,aAAa,aAAa,cAAc;AAAA,EAC3C,eAAe,UAAU,KACtB,YAAY,6DAA6D,EACzE,aAAa,aAAa,aAAa;AAAA,EAC1C,wBAAwB,UAAU,OAC/B,YAAY,2CAA2C,EACvD,aAAa,aAAa,sBAAsB;AAAA,EACnD,WAAW,UAAU,OAAO;AAAA,IAC1B;AAAA;AAAA;AAAA;AAAA;AAAA,EAKF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,19 +1,39 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React2 from "react";
4
- import { describe } from "@elliemae/ds-props-helpers";
4
+ import { describe, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
5
5
  import { StyledSidebarButton, StyledSidebarButtonLabel, StyledSidebarButtonIcon } from "./styled.js";
6
6
  import { sidebarButtonPropsSchema, defaultSidebarButton } from "./props.js";
7
7
  const SidebarButton = (props) => {
8
- const propsWithDefaultsTemporary = { ...defaultSidebarButton, ...props };
9
- const { dsId, onClick, Icon, label, ...rest } = propsWithDefaultsTemporary;
8
+ const propsWithDefault = useMemoMergePropsWithDefault(props, defaultSidebarButton);
9
+ const { dsId, onClick, Icon, label, getOwnerProps, getOwnerPropsArguments, ...rest } = propsWithDefault;
10
10
  const handleClick = React2.useCallback(() => {
11
11
  if (dsId) onClick(dsId);
12
12
  }, [onClick, dsId]);
13
- return /* @__PURE__ */ jsxs(StyledSidebarButton, { "data-testid": `sidebar-button-${dsId}`, onClick: handleClick, ...rest, children: [
14
- /* @__PURE__ */ jsx(StyledSidebarButtonIcon, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx(Icon, { size: "m" }) }),
15
- label && /* @__PURE__ */ jsx(StyledSidebarButtonLabel, { children: label })
16
- ] }, dsId);
13
+ return /* @__PURE__ */ jsxs(
14
+ StyledSidebarButton,
15
+ {
16
+ "data-testid": `sidebar-button-${dsId}`,
17
+ onClick: handleClick,
18
+ getOwnerProps,
19
+ getOwnerPropsArguments,
20
+ ...rest,
21
+ children: [
22
+ /* @__PURE__ */ jsx(
23
+ StyledSidebarButtonIcon,
24
+ {
25
+ alignItems: "center",
26
+ justifyContent: "center",
27
+ getOwnerProps,
28
+ getOwnerPropsArguments,
29
+ children: /* @__PURE__ */ jsx(Icon, { size: "m" })
30
+ }
31
+ ),
32
+ label && /* @__PURE__ */ jsx(StyledSidebarButtonLabel, { getOwnerProps, getOwnerPropsArguments, children: label })
33
+ ]
34
+ },
35
+ dsId
36
+ );
17
37
  };
18
38
  SidebarButton.displayName = "SidebarButton";
19
39
  const SidebarButtonWithSchema = describe(SidebarButton);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/sidebar-button/SidebarButton.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { StyledSidebarButton, StyledSidebarButtonLabel, StyledSidebarButtonIcon } from './styled.js';\nimport type { SidebarButtonProps } from './props.js';\nimport { sidebarButtonPropsSchema, defaultSidebarButton } from './props.js';\n\nconst SidebarButton = (props: SidebarButtonProps): JSX.Element => {\n const propsWithDefaultsTemporary = { ...defaultSidebarButton, ...props };\n const { dsId, onClick, Icon, label, ...rest } = propsWithDefaultsTemporary;\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.displayName = 'SidebarButton';\nconst SidebarButtonWithSchema = describe(SidebarButton);\nSidebarButtonWithSchema.propTypes = sidebarButtonPropsSchema;\n\nexport { SidebarButtonWithSchema as SidebarButton };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACcnB,SAEI,KAFJ;AAdJ,OAAOA,YAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB,0BAA0B,+BAA+B;AAEvF,SAAS,0BAA0B,4BAA4B;AAE/D,MAAM,gBAAgB,CAAC,UAA2C;AAChE,QAAM,6BAA6B,EAAE,GAAG,sBAAsB,GAAG,MAAM;AACvE,QAAM,EAAE,MAAM,SAAS,MAAM,OAAO,GAAG,KAAK,IAAI;AAChD,QAAM,cAAcA,OAAM,YAAY,MAAM;AAC1C,QAAI,KAAM,SAAQ,IAAI;AAAA,EACxB,GAAG,CAAC,SAAS,IAAI,CAAC;AAElB,SACE,qBAAC,uBAA+B,eAAa,kBAAkB,IAAI,IAAI,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,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { StyledSidebarButton, StyledSidebarButtonLabel, StyledSidebarButtonIcon } from './styled.js';\nimport type { SidebarButtonProps } from './props.js';\nimport { sidebarButtonPropsSchema, defaultSidebarButton } from './props.js';\n\n// Internal sub-component \u2014 not consumer-facing. Schema validation is deliberately skipped here\n// because SidebarButton intentionally accepts forwarded `...rest` (aria-pressed, aria-label, etc.)\n// from its parent SideBarChat. Validation would reject those passthrough props.\nconst SidebarButton = (props: SidebarButtonProps): JSX.Element => {\n const propsWithDefault = useMemoMergePropsWithDefault<SidebarButtonProps>(props, defaultSidebarButton);\n\n const { dsId, onClick, Icon, label, getOwnerProps, getOwnerPropsArguments, ...rest } = propsWithDefault;\n const handleClick = React.useCallback(() => {\n if (dsId) onClick(dsId);\n }, [onClick, dsId]);\n\n return (\n <StyledSidebarButton\n key={dsId}\n // legacy dynamic data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={`sidebar-button-${dsId}`}\n onClick={handleClick}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...rest}\n >\n <StyledSidebarButtonIcon\n alignItems=\"center\"\n justifyContent=\"center\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Icon size=\"m\" />\n </StyledSidebarButtonIcon>\n {label && (\n <StyledSidebarButtonLabel getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {label}\n </StyledSidebarButtonLabel>\n )}\n </StyledSidebarButton>\n );\n};\n\nSidebarButton.displayName = 'SidebarButton';\nconst SidebarButtonWithSchema = describe(SidebarButton);\nSidebarButtonWithSchema.propTypes = sidebarButtonPropsSchema;\n\nexport { SidebarButtonWithSchema as SidebarButton };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkBnB,SAeI,KAfJ;AAlBJ,OAAOA,YAAW;AAClB,SAAS,UAAU,oCAAoC;AACvD,SAAS,qBAAqB,0BAA0B,+BAA+B;AAEvF,SAAS,0BAA0B,4BAA4B;AAK/D,MAAM,gBAAgB,CAAC,UAA2C;AAChE,QAAM,mBAAmB,6BAAiD,OAAO,oBAAoB;AAErG,QAAM,EAAE,MAAM,SAAS,MAAM,OAAO,eAAe,wBAAwB,GAAG,KAAK,IAAI;AACvF,QAAM,cAAcA,OAAM,YAAY,MAAM;AAC1C,QAAI,KAAM,SAAQ,IAAI;AAAA,EACxB,GAAG,CAAC,SAAS,IAAI,CAAC;AAElB,SACE;AAAA,IAAC;AAAA;AAAA,MAGC,eAAa,kBAAkB,IAAI;AAAA,MACnC,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,gBAAe;AAAA,YACf;AAAA,YACA;AAAA,YAEA,8BAAC,QAAK,MAAK,KAAI;AAAA;AAAA,QACjB;AAAA,QACC,SACC,oBAAC,4BAAyB,eAA8B,wBACrD,iBACH;AAAA;AAAA;AAAA,IAnBG;AAAA,EAqBP;AAEJ;AAEA,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
6
6
  "names": ["React"]
7
7
  }
@@ -10,11 +10,15 @@ const defaultSidebarButton = {
10
10
  title: ""
11
11
  };
12
12
  const propsSidebarButton = {
13
- Icon: PropTypes.element.description("Icon component").defaultValue(defaultSidebarButton.Icon),
13
+ Icon: PropTypes.func.description("Icon component").defaultValue(defaultSidebarButton.Icon),
14
14
  dsId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Unique id for the button").defaultValue(defaultSidebarButton.dsId),
15
15
  label: PropTypes.string.description("It will display under the icon").defaultValue(defaultSidebarButton.label),
16
16
  title: PropTypes.string.description("Tooltip").defaultValue(defaultSidebarButton.title),
17
- onClick: PropTypes.func.description("The function to call when the is clicked").defaultValue(defaultSidebarButton.onClick)
17
+ onClick: PropTypes.func.description("The function to call when the is clicked").defaultValue(defaultSidebarButton.onClick),
18
+ getOwnerProps: PropTypes.func.description("Slot system getter \u2014 forwarded from the parent SideBarChat"),
19
+ getOwnerPropsArguments: PropTypes.func.description(
20
+ "Slot system getOwnerPropsArguments \u2014 forwarded from the parent SideBarChat"
21
+ )
18
22
  };
19
23
  const sidebarButtonPropsSchema = propsSidebarButton;
20
24
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/sidebar-button/props.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { SvgIconT } from '@elliemae/ds-icons';\nimport { Comments } from '@elliemae/ds-icons';\nimport type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { noop } from 'lodash-es';\nimport type React from 'react';\n\nexport interface SidebarButtonProps {\n Icon: React.FC<SvgIconT.Props>;\n dsId: string | number;\n onClick: (dsId: string | number) => void;\n label?: string;\n title?: string;\n}\n\nexport const defaultSidebarButton: SidebarButtonProps = {\n Icon: Comments,\n dsId: '',\n label: '',\n onClick: noop,\n title: '',\n};\n\nexport const propsSidebarButton: DSPropTypesSchema<SidebarButtonProps> = {\n Icon: PropTypes.element.description('Icon component').defaultValue(defaultSidebarButton.Icon),\n dsId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Unique id for the button')\n .defaultValue(defaultSidebarButton.dsId),\n label: PropTypes.string.description('It will display under the icon').defaultValue(defaultSidebarButton.label),\n title: PropTypes.string.description('Tooltip').defaultValue(defaultSidebarButton.title),\n onClick: PropTypes.func\n .description('The function to call when the is clicked')\n .defaultValue(defaultSidebarButton.onClick),\n};\n\nexport const sidebarButtonPropsSchema = propsSidebarButton as unknown as ValidationMap<SidebarButtonProps>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAWd,MAAM,uBAA2C;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACT;AAEO,MAAM,qBAA4D;AAAA,EACvE,MAAM,UAAU,QAAQ,YAAY,gBAAgB,EAAE,aAAa,qBAAqB,IAAI;AAAA,EAC5F,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAC3D,YAAY,0BAA0B,EACtC,aAAa,qBAAqB,IAAI;AAAA,EACzC,OAAO,UAAU,OAAO,YAAY,gCAAgC,EAAE,aAAa,qBAAqB,KAAK;AAAA,EAC7G,OAAO,UAAU,OAAO,YAAY,SAAS,EAAE,aAAa,qBAAqB,KAAK;AAAA,EACtF,SAAS,UAAU,KAChB,YAAY,0CAA0C,EACtD,aAAa,qBAAqB,OAAO;AAC9C;AAEO,MAAM,2BAA2B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { SvgIconT } from '@elliemae/ds-icons';\nimport { Comments } from '@elliemae/ds-icons';\nimport type { DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport { noop } from 'lodash-es';\nimport type React from 'react';\n\nexport interface SidebarButtonProps {\n Icon: React.FC<SvgIconT.Props>;\n dsId: string | number;\n onClick: (dsId: string | number) => void;\n label?: string;\n title?: string;\n // forwarded from SideBarChat so the styled children participate in the slot system; optional for backwards compat.\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nexport const defaultSidebarButton: SidebarButtonProps = {\n Icon: Comments,\n dsId: '',\n label: '',\n onClick: noop,\n title: '',\n};\n\nexport const propsSidebarButton: DSPropTypesSchema<SidebarButtonProps> = {\n Icon: PropTypes.func.description('Icon component').defaultValue(defaultSidebarButton.Icon),\n dsId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Unique id for the button')\n .defaultValue(defaultSidebarButton.dsId),\n label: PropTypes.string.description('It will display under the icon').defaultValue(defaultSidebarButton.label),\n title: PropTypes.string.description('Tooltip').defaultValue(defaultSidebarButton.title),\n onClick: PropTypes.func\n .description('The function to call when the is clicked')\n .defaultValue(defaultSidebarButton.onClick),\n getOwnerProps: PropTypes.func.description('Slot system getter \u2014 forwarded from the parent SideBarChat'),\n getOwnerPropsArguments: PropTypes.func.description(\n 'Slot system getOwnerPropsArguments \u2014 forwarded from the parent SideBarChat',\n ),\n};\n\nexport const sidebarButtonPropsSchema = propsSidebarButton as unknown as ValidationMap<SidebarButtonProps>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,gBAAgB;AAEzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAcd,MAAM,uBAA2C;AAAA,EACtD,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AACT;AAEO,MAAM,qBAA4D;AAAA,EACvE,MAAM,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,qBAAqB,IAAI;AAAA,EACzF,MAAM,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAC3D,YAAY,0BAA0B,EACtC,aAAa,qBAAqB,IAAI;AAAA,EACzC,OAAO,UAAU,OAAO,YAAY,gCAAgC,EAAE,aAAa,qBAAqB,KAAK;AAAA,EAC7G,OAAO,UAAU,OAAO,YAAY,SAAS,EAAE,aAAa,qBAAqB,KAAK;AAAA,EACtF,SAAS,UAAU,KAChB,YAAY,0CAA0C,EACtD,aAAa,qBAAqB,OAAO;AAAA,EAC5C,eAAe,UAAU,KAAK,YAAY,iEAA4D;AAAA,EACtG,wBAAwB,UAAU,KAAK;AAAA,IACrC;AAAA,EACF;AACF;AAEO,MAAM,2BAA2B;",
6
6
  "names": []
7
7
  }
@@ -1,9 +1,15 @@
1
1
  import * as React from "react";
2
2
  import { styled } from "@elliemae/ds-system";
3
3
  import { Grid } from "@elliemae/ds-grid";
4
+ import { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from "../constants/index.js";
4
5
  const MIN_WIDTH_SIDEBAR = 48;
5
6
  const BUTTON_SIDEBAR_HEIGHT = 48;
6
- const StyledSidebarButton = styled.button`
7
+ const StyledSidebarButton = styled("button", {
8
+ name: DSChatSidebarName,
9
+ slot: CHAT_SIDEBAR_SLOTS.SIDEBAR_BUTTON,
10
+ // legacy dynamic data-testid `sidebar-button-${dsId}` is preserved via inline JSX data-testid
11
+ preserveLegacyDataTestId: true
12
+ })`
7
13
  display: flex;
8
14
  align-items: center;
9
15
  justify-content: center;
@@ -24,10 +30,16 @@ const StyledSidebarButton = styled.button`
24
30
  fill: ${(props) => props.theme.colors.neutral[500]};
25
31
  }
26
32
  `;
27
- const StyledSidebarButtonIcon = styled(Grid)`
33
+ const StyledSidebarButtonIcon = styled(Grid, {
34
+ name: DSChatSidebarName,
35
+ slot: CHAT_SIDEBAR_SLOTS.SIDEBAR_BUTTON_ICON
36
+ })`
28
37
  position: relative;
29
38
  `;
30
- const StyledSidebarButtonLabel = styled.div`
39
+ const StyledSidebarButtonLabel = styled("div", {
40
+ name: DSChatSidebarName,
41
+ slot: CHAT_SIDEBAR_SLOTS.SIDEBAR_BUTTON_LABEL
42
+ })`
31
43
  width: 30px;
32
44
  text-transform: uppercase;
33
45
  overflow: hidden;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/sidebar-button/styled.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n// Buttons\nexport const StyledSidebarButton = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n outline: none;\n height: ${BUTTON_SIDEBAR_HEIGHT}px;\n width: ${MIN_WIDTH_SIDEBAR}px;\n position: relative;\n border: 0;\n background: transparent;\n &:focus,\n &:hover {\n background: ${(props) => props.theme.colors.neutral['080']};\n }\n cursor: pointer;\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['200']};\n\n svg {\n fill: ${(props) => props.theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledSidebarButtonIcon = styled(Grid)`\n position: relative;\n`;\n\nexport const StyledSidebarButtonLabel = styled.div`\n width: 30px;\n text-transform: uppercase;\n overflow: hidden;\n text-align: center;\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAEvB,MAAM,sBAAsB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,YAK9B,qBAAqB;AAAA,WACtB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMV,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,6BAGjC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,YAG7D,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAI/C,MAAM,0BAA0B,OAAO,IAAI;AAAA;AAAA;AAI3C,MAAM,2BAA2B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from '../constants/index.js';\n\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n// Buttons\nexport const StyledSidebarButton = styled('button', {\n name: DSChatSidebarName,\n slot: CHAT_SIDEBAR_SLOTS.SIDEBAR_BUTTON,\n // legacy dynamic data-testid `sidebar-button-${dsId}` is preserved via inline JSX data-testid\n preserveLegacyDataTestId: true,\n})`\n display: flex;\n align-items: center;\n justify-content: center;\n outline: none;\n height: ${BUTTON_SIDEBAR_HEIGHT}px;\n width: ${MIN_WIDTH_SIDEBAR}px;\n position: relative;\n border: 0;\n background: transparent;\n &:focus,\n &:hover {\n background: ${(props) => props.theme.colors.neutral['080']};\n }\n cursor: pointer;\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['200']};\n\n svg {\n fill: ${(props) => props.theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledSidebarButtonIcon = styled(Grid, {\n name: DSChatSidebarName,\n slot: CHAT_SIDEBAR_SLOTS.SIDEBAR_BUTTON_ICON,\n})`\n position: relative;\n`;\n\nexport const StyledSidebarButtonLabel = styled('div', {\n name: DSChatSidebarName,\n slot: CHAT_SIDEBAR_SLOTS.SIDEBAR_BUTTON_LABEL,\n})`\n width: 30px;\n text-transform: uppercase;\n overflow: hidden;\n text-align: center;\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,oBAAoB,yBAAyB;AAEtD,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAEvB,MAAM,sBAAsB,OAAO,UAAU;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,mBAAmB;AAAA;AAAA,EAEzB,0BAA0B;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,YAKW,qBAAqB;AAAA,WACtB,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAMV,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,6BAGjC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA,YAG7D,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAI/C,MAAM,0BAA0B,OAAO,MAAM;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,mBAAmB;AAC3B,CAAC;AAAA;AAAA;AAIM,MAAM,2BAA2B,OAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,mBAAmB;AAC3B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,16 +1,25 @@
1
1
  import * as React from "react";
2
2
  import { styled } from "@elliemae/ds-system";
3
3
  import { Grid } from "@elliemae/ds-grid";
4
+ import { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from "./constants/index.js";
4
5
  const MIN_WIDTH_SIDEBAR = 48;
5
6
  const BUTTON_SIDEBAR_HEIGHT = 48;
6
- const StyledSideBarContainer = styled(Grid)`
7
+ const StyledSideBarContainer = styled(Grid, {
8
+ name: DSChatSidebarName,
9
+ slot: CHAT_SIDEBAR_SLOTS.ROOT,
10
+ // legacy data-testid `ds-chat-sidebar` is preserved via inline JSX data-testid
11
+ preserveLegacyDataTestId: true
12
+ })`
7
13
  height: 100%;
8
14
  width: ${MIN_WIDTH_SIDEBAR}px;
9
15
  background: ${(props) => props.theme.colors.neutral["050"]};
10
16
  border-right: 1px solid ${(props) => props.theme.colors.neutral["100"]};
11
17
  overflow: hidden;
12
18
  `;
13
- const StyledSideBarButtonsContainer = styled(Grid)`
19
+ const StyledSideBarButtonsContainer = styled(Grid, {
20
+ name: DSChatSidebarName,
21
+ slot: CHAT_SIDEBAR_SLOTS.BUTTONS_CONTAINER
22
+ })`
14
23
  overflow-y: auto;
15
24
  align-items: flex-start;
16
25
  justify-content: flex-start;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n// Sidebar\nexport const StyledSideBarContainer = styled(Grid)`\n height: 100%;\n width: ${MIN_WIDTH_SIDEBAR}px;\n background: ${(props) => props.theme.colors.neutral['050']};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['100']};\n overflow: hidden;\n`;\n\nexport const StyledSideBarButtonsContainer = styled(Grid)`\n overflow-y: auto;\n align-items: flex-start;\n justify-content: flex-start;\n grid-template-rows: repeat(auto-fill, ${BUTTON_SIDEBAR_HEIGHT}px);\n overflow-x: hidden;\n\n scrollbar-width: thin;\n &::-webkit-scrollbar {\n width: 6px;\n }\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAEvB,MAAM,yBAAyB,OAAO,IAAI;AAAA;AAAA,WAEtC,iBAAiB;AAAA,gBACZ,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,4BAChC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAIjE,MAAM,gCAAgC,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA,0CAId,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from './constants/index.js';\n\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n// Sidebar\nexport const StyledSideBarContainer = styled(Grid, {\n name: DSChatSidebarName,\n slot: CHAT_SIDEBAR_SLOTS.ROOT,\n // legacy data-testid `ds-chat-sidebar` is preserved via inline JSX data-testid\n preserveLegacyDataTestId: true,\n})`\n height: 100%;\n width: ${MIN_WIDTH_SIDEBAR}px;\n background: ${(props) => props.theme.colors.neutral['050']};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['100']};\n overflow: hidden;\n`;\n\nexport const StyledSideBarButtonsContainer = styled(Grid, {\n name: DSChatSidebarName,\n slot: CHAT_SIDEBAR_SLOTS.BUTTONS_CONTAINER,\n})`\n overflow-y: auto;\n align-items: flex-start;\n justify-content: flex-start;\n grid-template-rows: repeat(auto-fill, ${BUTTON_SIDEBAR_HEIGHT}px);\n overflow-x: hidden;\n\n scrollbar-width: thin;\n &::-webkit-scrollbar {\n width: 6px;\n }\n`;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,oBAAoB,yBAAyB;AAEtD,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAEvB,MAAM,yBAAyB,OAAO,MAAM;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,mBAAmB;AAAA;AAAA,EAEzB,0BAA0B;AAC5B,CAAC;AAAA;AAAA,WAEU,iBAAiB;AAAA,gBACZ,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA,4BAChC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAIjE,MAAM,gCAAgC,OAAO,MAAM;AAAA,EACxD,MAAM;AAAA,EACN,MAAM,mBAAmB;AAC3B,CAAC;AAAA;AAAA;AAAA;AAAA,0CAIyC,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- export declare const DSChatSidebarName = "DSChatsidebar";
1
+ export { DSChatSidebarName } from './constants/index.js';
@@ -2,4 +2,6 @@ import React from 'react';
2
2
  import type { DSChatSidebarT } from './react-desc-prop-types.js';
3
3
  declare const SideBarChat: React.ComponentType<DSChatSidebarT.Props>;
4
4
  declare const SideBarChatWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSChatSidebarT.Props>;
5
- export { SideBarChat, SideBarChatWithSchema };
5
+ declare const DSChatSidebar: React.FunctionComponent<DSChatSidebarT.Props>;
6
+ declare const DSChatSidebarWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSChatSidebarT.Props>;
7
+ export { SideBarChat, SideBarChatWithSchema, DSChatSidebar, DSChatSidebarWithSchema };
@@ -0,0 +1,15 @@
1
+ export declare const DSChatSidebarName = "DSChatsidebar";
2
+ export declare const CHAT_SIDEBAR_SLOTS: {
3
+ readonly ROOT: "root";
4
+ readonly BUTTONS_CONTAINER: "buttons-container";
5
+ readonly SIDEBAR_BUTTON: "sidebar-button";
6
+ readonly SIDEBAR_BUTTON_ICON: "sidebar-button-icon";
7
+ readonly SIDEBAR_BUTTON_LABEL: "sidebar-button-label";
8
+ };
9
+ export declare const CHAT_SIDEBAR_DATA_TESTID: {
10
+ ROOT: string;
11
+ BUTTONS_CONTAINER: "ds-chatsidebar-buttons-container";
12
+ SIDEBAR_BUTTON: "ds-chatsidebar-sidebar-button";
13
+ SIDEBAR_BUTTON_ICON: "ds-chatsidebar-sidebar-button-icon";
14
+ SIDEBAR_BUTTON_LABEL: "ds-chatsidebar-sidebar-button-label";
15
+ };
@@ -1,2 +1,5 @@
1
- export { SideBarChat, SideBarChatWithSchema } from './SideBarChat.js';
1
+ export { SideBarChat, SideBarChatWithSchema, DSChatSidebar, DSChatSidebarWithSchema } from './SideBarChat.js';
2
+ export { DSChatSidebarDataTestIds } from './DSChatSidebarDataTestIds.js';
2
3
  export type { DSChatSidebarT } from './react-desc-prop-types.js';
4
+ export { chatSidebarProps } from './react-desc-prop-types.js';
5
+ export { CHAT_SIDEBAR_DATA_TESTID, CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from './constants/index.js';
@@ -1,6 +1,17 @@
1
+ import type React from 'react';
1
2
  import type { DSChatTileT } from '@elliemae/ds-chat-tile';
3
+ import type { DSPropTypesSchema, GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
4
+ import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
5
+ import { CHAT_SIDEBAR_SLOTS, DSChatSidebarName } from './constants/index.js';
2
6
  export declare namespace DSChatSidebarT {
3
7
  type TooltipPlacementT = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
8
+ type SlotFunctionArguments = {
9
+ dsChatsidebarRoot: () => object;
10
+ dsChatsidebarButtonsContainer: () => object;
11
+ dsChatsidebarSidebarButton: () => object;
12
+ dsChatsidebarSidebarButtonIcon: () => object;
13
+ dsChatsidebarSidebarButtonLabel: () => object;
14
+ };
4
15
  interface RequiredProps {
5
16
  }
6
17
  interface DefaultProps {
@@ -14,7 +25,7 @@ export declare namespace DSChatSidebarT {
14
25
  tooltipPlacement: TooltipPlacementT;
15
26
  enableTooltipWhenIsClosed: boolean;
16
27
  }
17
- interface OptionalProps {
28
+ interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSChatSidebarName, typeof CHAT_SIDEBAR_SLOTS> {
18
29
  selectedItem?: string | number;
19
30
  actionRef?: React.MutableRefObject<{
20
31
  listRef: {
@@ -22,22 +33,10 @@ export declare namespace DSChatSidebarT {
22
33
  };
23
34
  }>;
24
35
  }
25
- interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
36
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>, XstyledProps, RequiredProps {
26
37
  }
27
- interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
38
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps>, XstyledProps, RequiredProps {
28
39
  }
29
40
  }
30
41
  export declare const defaultProps: DSChatSidebarT.DefaultProps;
31
- export declare const chatSidebarProps: {
32
- sidebarItems: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
33
- expanded: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
34
- selectedItem: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
35
- tooltipPlacement: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
36
- enableTooltipWhenIsClosed: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
37
- onFooterExpand: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
38
- onFooterClose: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
39
- onHeaderExpand: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
40
- onHeaderClose: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
41
- footerButtonExtraProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
42
- actionRef: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
43
- };
42
+ export declare const chatSidebarProps: DSPropTypesSchema<DSChatSidebarT.Props>;