@elliemae/ds-chat 2.2.0 → 2.3.0-alpha.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/cjs/ChatDataTestids.js +54 -26
- package/cjs/ChatDataTestids.js.map +7 -0
- package/cjs/index.d.js +27 -2
- package/cjs/index.d.js.map +7 -0
- package/cjs/index.js +69 -44
- package/cjs/index.js.map +7 -0
- package/cjs/parts/bubble/ChatBubble.js +74 -64
- package/cjs/parts/bubble/ChatBubble.js.map +7 -0
- package/cjs/parts/bubble/ChatBubbleArrow.js +96 -79
- package/cjs/parts/bubble/ChatBubbleArrow.js.map +7 -0
- package/cjs/parts/bubble/config/useValidateProps.js +47 -24
- package/cjs/parts/bubble/config/useValidateProps.js.map +7 -0
- package/cjs/parts/bubble/index.js +38 -12
- package/cjs/parts/bubble/index.js.map +7 -0
- package/cjs/parts/bubble/props.js +60 -48
- package/cjs/parts/bubble/props.js.map +7 -0
- package/cjs/parts/bubble/styled.js +141 -48
- package/cjs/parts/bubble/styled.js.map +7 -0
- package/cjs/parts/chat-card/ChatCard.js +55 -39
- package/cjs/parts/chat-card/ChatCard.js.map +7 -0
- package/cjs/parts/chat-card/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-card/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-card/index.js +36 -10
- package/cjs/parts/chat-card/index.js.map +7 -0
- package/cjs/parts/chat-card/props.js +39 -12
- package/cjs/parts/chat-card/props.js.map +7 -0
- package/cjs/parts/chat-card/styled.js +71 -36
- package/cjs/parts/chat-card/styled.js.map +7 -0
- package/cjs/parts/chat-composer/ChatContainerComposer.js +92 -99
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +7 -0
- package/cjs/parts/chat-composer/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-composer/index.js +36 -10
- package/cjs/parts/chat-composer/index.js.map +7 -0
- package/cjs/parts/chat-composer/props.js +73 -38
- package/cjs/parts/chat-composer/props.js.map +7 -0
- package/cjs/parts/chat-composer/styled.js +102 -34
- package/cjs/parts/chat-composer/styled.js.map +7 -0
- package/cjs/parts/chat-container/ChatContainer.js +122 -140
- package/cjs/parts/chat-container/ChatContainer.js.map +7 -0
- package/cjs/parts/chat-container/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-container/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-container/index.js +36 -10
- package/cjs/parts/chat-container/index.js.map +7 -0
- package/cjs/parts/chat-container/props.js +85 -42
- package/cjs/parts/chat-container/props.js.map +7 -0
- package/cjs/parts/chat-container/styled.js +104 -23
- package/cjs/parts/chat-container/styled.js.map +7 -0
- package/cjs/parts/chat-container-header/ChatContainerHeader.js +48 -30
- package/cjs/parts/chat-container-header/ChatContainerHeader.js.map +7 -0
- package/cjs/parts/chat-container-header/helpers.js +38 -25
- package/cjs/parts/chat-container-header/helpers.js.map +7 -0
- package/cjs/parts/chat-container-header/styled.js +59 -24
- package/cjs/parts/chat-container-header/styled.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +163 -225
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/index.js +36 -10
- package/cjs/parts/chat-container-messages-list/index.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/props.js +62 -24
- package/cjs/parts/chat-container-messages-list/props.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/styled.js +100 -38
- package/cjs/parts/chat-container-messages-list/styled.js.map +7 -0
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +58 -42
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +7 -0
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-empty-state/props.js +39 -12
- package/cjs/parts/chat-empty-state/props.js.map +7 -0
- package/cjs/parts/chat-empty-state/styled.js +47 -21
- package/cjs/parts/chat-empty-state/styled.js.map +7 -0
- package/cjs/parts/chat-sidebar/SideBarChat.js +82 -81
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +7 -0
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-sidebar/index.js +36 -10
- package/cjs/parts/chat-sidebar/index.js.map +7 -0
- package/cjs/parts/chat-sidebar/props.js +72 -30
- package/cjs/parts/chat-sidebar/props.js.map +7 -0
- package/cjs/parts/chat-sidebar/styled.js +56 -20
- package/cjs/parts/chat-sidebar/styled.js.map +7 -0
- package/cjs/parts/floating-button/FloatingButton.js +47 -34
- package/cjs/parts/floating-button/FloatingButton.js.map +7 -0
- package/cjs/parts/floating-button/index.js +28 -9
- package/cjs/parts/floating-button/index.js.map +7 -0
- package/cjs/parts/floating-button/props.js +42 -15
- package/cjs/parts/floating-button/props.js.map +7 -0
- package/cjs/parts/floating-button/styled.js +63 -17
- package/cjs/parts/floating-button/styled.js.map +7 -0
- package/cjs/parts/floating-container/styled.js +47 -17
- package/cjs/parts/floating-container/styled.js.map +7 -0
- package/cjs/parts/grid-influencer/InfluencerContainer.js +41 -21
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +7 -0
- package/cjs/parts/grid-influencer/styled.js +56 -21
- package/cjs/parts/grid-influencer/styled.js.map +7 -0
- package/cjs/parts/message-delimiter/MessageDelimiter.js +53 -39
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +7 -0
- package/cjs/parts/message-delimiter/config/useValidateProps.js +36 -9
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +7 -0
- package/cjs/parts/message-delimiter/index.js +36 -10
- package/cjs/parts/message-delimiter/index.js.map +7 -0
- package/cjs/parts/message-delimiter/props.js +44 -19
- package/cjs/parts/message-delimiter/props.js.map +7 -0
- package/cjs/parts/message-delimiter/styled.js +53 -24
- package/cjs/parts/message-delimiter/styled.js.map +7 -0
- package/cjs/parts/sidebar-button/SidebarButton.js +52 -53
- package/cjs/parts/sidebar-button/SidebarButton.js.map +7 -0
- package/cjs/parts/sidebar-button/index.js +20 -2
- package/cjs/parts/sidebar-button/index.js.map +7 -0
- package/cjs/parts/sidebar-button/props.js +49 -26
- package/cjs/parts/sidebar-button/props.js.map +7 -0
- package/cjs/parts/sidebar-button/styled.js +68 -24
- package/cjs/parts/sidebar-button/styled.js.map +7 -0
- package/cjs/parts/system-message/SystemMessage.js +55 -40
- package/cjs/parts/system-message/SystemMessage.js.map +7 -0
- package/cjs/parts/system-message/config/useValidateProps.js +36 -9
- package/cjs/parts/system-message/config/useValidateProps.js.map +7 -0
- package/cjs/parts/system-message/index.js +36 -10
- package/cjs/parts/system-message/index.js.map +7 -0
- package/cjs/parts/system-message/props.js +42 -15
- package/cjs/parts/system-message/props.js.map +7 -0
- package/cjs/parts/system-message/style.js +75 -32
- package/cjs/parts/system-message/style.js.map +7 -0
- package/cjs/parts/tile-button/TileButton.js +98 -68
- package/cjs/parts/tile-button/TileButton.js.map +7 -0
- package/cjs/parts/tile-button/config/useValidateProps.js +36 -9
- package/cjs/parts/tile-button/config/useValidateProps.js.map +7 -0
- package/cjs/parts/tile-button/index.js +36 -10
- package/cjs/parts/tile-button/index.js.map +7 -0
- package/cjs/parts/tile-button/props.js +83 -45
- package/cjs/parts/tile-button/props.js.map +7 -0
- package/cjs/parts/tile-button/styled.js +229 -77
- package/cjs/parts/tile-button/styled.js.map +7 -0
- package/cjs/prop-types.js +53 -26
- package/cjs/prop-types.js.map +7 -0
- package/cjs/styled.js +42 -14
- package/cjs/styled.js.map +7 -0
- package/cjs/tests/utils.js +66 -0
- package/cjs/tests/utils.js.map +7 -0
- package/esm/ChatDataTestids.js +25 -22
- package/esm/ChatDataTestids.js.map +7 -0
- package/esm/index.d.js +2 -1
- package/esm/index.d.js.map +7 -0
- package/esm/index.js +40 -14
- package/esm/index.js.map +7 -0
- package/esm/parts/bubble/ChatBubble.js +51 -51
- package/esm/parts/bubble/ChatBubble.js.map +7 -0
- package/esm/parts/bubble/ChatBubbleArrow.js +67 -71
- package/esm/parts/bubble/ChatBubbleArrow.js.map +7 -0
- package/esm/parts/bubble/config/useValidateProps.js +17 -19
- package/esm/parts/bubble/config/useValidateProps.js.map +7 -0
- package/esm/parts/bubble/index.js +9 -2
- package/esm/parts/bubble/index.js.map +7 -0
- package/esm/parts/bubble/props.js +30 -36
- package/esm/parts/bubble/props.js.map +7 -0
- package/esm/parts/bubble/styled.js +112 -32
- package/esm/parts/bubble/styled.js.map +7 -0
- package/esm/parts/chat-card/ChatCard.js +23 -27
- package/esm/parts/chat-card/ChatCard.js.map +7 -0
- package/esm/parts/chat-card/config/useValidateProps.js +6 -4
- package/esm/parts/chat-card/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-card/index.js +7 -1
- package/esm/parts/chat-card/index.js.map +7 -0
- package/esm/parts/chat-card/props.js +10 -8
- package/esm/parts/chat-card/props.js.map +7 -0
- package/esm/parts/chat-card/styled.js +42 -23
- package/esm/parts/chat-card/styled.js.map +7 -0
- package/esm/parts/chat-composer/ChatContainerComposer.js +65 -84
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +7 -0
- package/esm/parts/chat-composer/config/useValidateProps.js +6 -4
- package/esm/parts/chat-composer/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-composer/index.js +7 -1
- package/esm/parts/chat-composer/index.js.map +7 -0
- package/esm/parts/chat-composer/props.js +37 -26
- package/esm/parts/chat-composer/props.js.map +7 -0
- package/esm/parts/chat-composer/styled.js +73 -22
- package/esm/parts/chat-composer/styled.js.map +7 -0
- package/esm/parts/chat-container/ChatContainer.js +88 -122
- package/esm/parts/chat-container/ChatContainer.js.map +7 -0
- package/esm/parts/chat-container/config/useValidateProps.js +6 -4
- package/esm/parts/chat-container/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-container/index.js +7 -1
- package/esm/parts/chat-container/index.js.map +7 -0
- package/esm/parts/chat-container/props.js +52 -31
- package/esm/parts/chat-container/props.js.map +7 -0
- package/esm/parts/chat-container/styled.js +79 -16
- package/esm/parts/chat-container/styled.js.map +7 -0
- package/esm/parts/chat-container-header/ChatContainerHeader.js +22 -21
- package/esm/parts/chat-container-header/ChatContainerHeader.js.map +7 -0
- package/esm/parts/chat-container-header/helpers.js +9 -17
- package/esm/parts/chat-container-header/helpers.js.map +7 -0
- package/esm/parts/chat-container-header/styled.js +30 -14
- package/esm/parts/chat-container-header/styled.js.map +7 -0
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +138 -210
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +7 -0
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +6 -4
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-container-messages-list/index.js +10 -1
- package/esm/parts/chat-container-messages-list/index.js.map +7 -0
- package/esm/parts/chat-container-messages-list/props.js +31 -17
- package/esm/parts/chat-container-messages-list/props.js.map +7 -0
- package/esm/parts/chat-container-messages-list/styled.js +71 -25
- package/esm/parts/chat-container-messages-list/styled.js.map +7 -0
- package/esm/parts/chat-empty-state/ChatEmptyState.js +25 -29
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +7 -0
- package/esm/parts/chat-empty-state/config/useValidateProps.js +6 -4
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-empty-state/props.js +10 -7
- package/esm/parts/chat-empty-state/props.js.map +7 -0
- package/esm/parts/chat-empty-state/styled.js +18 -11
- package/esm/parts/chat-empty-state/styled.js.map +7 -0
- package/esm/parts/chat-sidebar/SideBarChat.js +50 -67
- package/esm/parts/chat-sidebar/SideBarChat.js.map +7 -0
- package/esm/parts/chat-sidebar/config/useValidateProps.js +6 -4
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-sidebar/index.js +7 -1
- package/esm/parts/chat-sidebar/index.js.map +7 -0
- package/esm/parts/chat-sidebar/props.js +39 -21
- package/esm/parts/chat-sidebar/props.js.map +7 -0
- package/esm/parts/chat-sidebar/styled.js +27 -11
- package/esm/parts/chat-sidebar/styled.js.map +7 -0
- package/esm/parts/floating-button/FloatingButton.js +18 -26
- package/esm/parts/floating-button/FloatingButton.js.map +7 -0
- package/esm/parts/floating-button/index.js +3 -1
- package/esm/parts/floating-button/index.js.map +7 -0
- package/esm/parts/floating-button/props.js +11 -8
- package/esm/parts/floating-button/props.js.map +7 -0
- package/esm/parts/floating-button/styled.js +34 -9
- package/esm/parts/floating-button/styled.js.map +7 -0
- package/esm/parts/floating-container/styled.js +18 -9
- package/esm/parts/floating-container/styled.js.map +7 -0
- package/esm/parts/grid-influencer/InfluencerContainer.js +12 -12
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +7 -0
- package/esm/parts/grid-influencer/styled.js +27 -12
- package/esm/parts/grid-influencer/styled.js.map +7 -0
- package/esm/parts/message-delimiter/MessageDelimiter.js +20 -26
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +7 -0
- package/esm/parts/message-delimiter/config/useValidateProps.js +6 -4
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +7 -0
- package/esm/parts/message-delimiter/index.js +10 -1
- package/esm/parts/message-delimiter/index.js.map +7 -0
- package/esm/parts/message-delimiter/props.js +15 -14
- package/esm/parts/message-delimiter/props.js.map +7 -0
- package/esm/parts/message-delimiter/styled.js +24 -14
- package/esm/parts/message-delimiter/styled.js.map +7 -0
- package/esm/parts/sidebar-button/SidebarButton.js +22 -41
- package/esm/parts/sidebar-button/SidebarButton.js.map +7 -0
- package/esm/parts/sidebar-button/index.js +2 -1
- package/esm/parts/sidebar-button/index.js.map +7 -0
- package/esm/parts/sidebar-button/props.js +18 -15
- package/esm/parts/sidebar-button/props.js.map +7 -0
- package/esm/parts/sidebar-button/styled.js +39 -14
- package/esm/parts/sidebar-button/styled.js.map +7 -0
- package/esm/parts/system-message/SystemMessage.js +22 -27
- package/esm/parts/system-message/SystemMessage.js.map +7 -0
- package/esm/parts/system-message/config/useValidateProps.js +6 -4
- package/esm/parts/system-message/config/useValidateProps.js.map +7 -0
- package/esm/parts/system-message/index.js +7 -1
- package/esm/parts/system-message/index.js.map +7 -0
- package/esm/parts/system-message/props.js +13 -10
- package/esm/parts/system-message/props.js.map +7 -0
- package/esm/parts/system-message/style.js +46 -20
- package/esm/parts/system-message/style.js.map +7 -0
- package/esm/parts/tile-button/TileButton.js +75 -54
- package/esm/parts/tile-button/TileButton.js.map +7 -0
- package/esm/parts/tile-button/config/useValidateProps.js +6 -4
- package/esm/parts/tile-button/config/useValidateProps.js.map +7 -0
- package/esm/parts/tile-button/index.js +7 -1
- package/esm/parts/tile-button/index.js.map +7 -0
- package/esm/parts/tile-button/props.js +47 -33
- package/esm/parts/tile-button/props.js.map +7 -0
- package/esm/parts/tile-button/styled.js +200 -60
- package/esm/parts/tile-button/styled.js.map +7 -0
- package/esm/prop-types.js +19 -16
- package/esm/prop-types.js.map +7 -0
- package/esm/styled.js +13 -5
- package/esm/styled.js.map +7 -0
- package/esm/tests/utils.js +37 -0
- package/esm/tests/utils.js.map +7 -0
- package/package.json +10 -10
- package/types/parts/chat-composer/ChatContainerComposer.d.ts +0 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-container-messages-list/props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Ref } from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { BubbleProps } from '../bubble/props';\n\ninterface ActionRef {\n scrollToIndex: (n: number, b: { align: 'end' | 'center' | 'start' }) => void;\n getMessagesInView: () => number[];\n}\nexport interface ChatContainerMessagesListProps {\n messages: BubbleProps[];\n actionRef: any;\n onScrollEnds: (indexList: number[]) => number[];\n isLoading?: 'top' | 'bottom';\n hasMoreItems?: 'top' | 'bottom';\n getMoreMessages: PropTypes.func;\n sendingMessages?: Array<string | number>;\n sendingText: string;\n bannerPosition?: 'top' | 'bottom';\n bannerRef: React.MutableRefObject<{\n focusOnWrapper: (...args: any[]) => void;\n focusOnLink: (...args: any[]) => void;\n }>;\n}\n\nexport const defaultProps: ChatContainerMessagesListProps = {\n messages: [],\n actionRef: noop,\n onScrollEnds: () => [],\n getMoreMessages: noop,\n sendingMessages: undefined,\n sendingText: 'Sending',\n bannerPosition: undefined,\n bannerRef: undefined,\n};\n\nexport const listProps = {\n messages: PropTypes.arrayOf(PropTypes.object)\n .description('The array of out-of-the-box items you want to render inside the ChatMessageList')\n .defaultValue(defaultProps.messages),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToIndexWithoutScroll: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultProps.actionRef),\n onScrollEnds: PropTypes.func.description(`Called when the scroll stops.`),\n isLoading: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Keeps the load more space while the loading is in progress',\n ),\n hasMoreItems: PropTypes.oneOf(['top', 'bottom', undefined]).description(\n 'Show Load More button at the `top` or `bottom` of the container',\n ),\n getMoreMessages: PropTypes.func\n .description('Called when the user clicks on load more')\n .defaultValue(defaultProps.getMoreMessages),\n sendingMessages: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.number)])\n .description('Array of ids of sending messages')\n .defaultValue(defaultProps.sendingMessages),\n sendingText: PropTypes.string\n .description('Label description for messages in sending status')\n .defaultValue(defaultProps.sendingText),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AAuBO,MAAM,eAA+C;AAAA,EAC1D,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EACpB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,WAAW;AAAA;AAGN,MAAM,YAAY;AAAA,EACvB,UAAU,UAAU,QAAQ,UAAU,QACnC,YAAY,mFACZ,aAAa,aAAa;AAAA,EAC7B,WAAW,UAAU,OAClB,YACC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAaD,aAAa,aAAa;AAAA,EAC7B,cAAc,UAAU,KAAK,YAAY;AAAA,EACzC,WAAW,UAAU,MAAM,CAAC,OAAO,UAAU,SAAY,YACvD;AAAA,EAEF,cAAc,UAAU,MAAM,CAAC,OAAO,UAAU,SAAY,YAC1D;AAAA,EAEF,iBAAiB,UAAU,KACxB,YAAY,4CACZ,aAAa,aAAa;AAAA,EAC7B,iBAAiB,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SAAS,UAAU,QAAQ,UAAU,UACpG,YAAY,oCACZ,aAAa,aAAa;AAAA,EAC7B,aAAa,UAAU,OACpB,YAAY,oDACZ,aAAa,aAAa;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,25 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { BUBBLE_TYPES } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { BUBBLE_TYPES } from "../bubble/index";
|
|
4
|
+
const StyledWrapper = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 100%;
|
|
7
|
+
`;
|
|
8
|
+
const StyledWrapperListItem = styled.div`
|
|
9
|
+
min-width: 100%;
|
|
10
|
+
${(props) => props.type === BUBBLE_TYPES.SENDER && `padding: ${props.theme.space.xxs} ${props.theme.space.xxs} ${props.theme.space.xxs} 13%
|
|
11
|
+
`};
|
|
12
|
+
${(props) => props.type === BUBBLE_TYPES.RECIPIENT && `padding: ${props.theme.space.xxs} 13% ${props.theme.space.xxs}
|
|
13
|
+
${props.theme.space.xxs}
|
|
14
|
+
`};
|
|
15
|
+
${(props) => props.type === BUBBLE_TYPES.SYSTEM && `padding: ${props.theme.space.xxs} 0px
|
|
16
|
+
`};
|
|
17
|
+
`;
|
|
18
|
+
const StyledChatContainerContentList = styled.div`
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
padding: ${(props) => props.theme.space.xs};
|
|
22
|
+
padding-bottom: 0;
|
|
23
|
+
overflow-y: auto;
|
|
24
|
+
overflow-x: hidden;
|
|
25
|
+
`;
|
|
26
|
+
const StyledChatContainerContentListScroll = styled.div`
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: ${(props) => props.height};
|
|
29
|
+
position: relative;
|
|
30
|
+
`;
|
|
31
|
+
const StyledLoadMoreContainer = styled.div`
|
|
32
|
+
position: absolute;
|
|
33
|
+
width: calc(100% + ${(props) => props.theme.space.xxs});
|
|
34
|
+
padding: ${(props) => props.theme.space.xxs};
|
|
35
|
+
left: -${(props) => props.theme.space.xxs};
|
|
36
|
+
right: -${(props) => props.theme.space.xxs};
|
|
37
|
+
display: grid;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
${(props) => props.hasMoreItems === "top" ? "top: 0;" : ""}
|
|
41
|
+
${(props) => props.hasMoreItems === "bottom" ? "bottom: 0;" : ""}
|
|
42
|
+
`;
|
|
43
|
+
const ListItem = styled.div`
|
|
44
|
+
&:focus,
|
|
45
|
+
&:focus-visible {
|
|
46
|
+
outline: none;
|
|
47
|
+
&:after {
|
|
48
|
+
content: '';
|
|
49
|
+
display: block;
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 0;
|
|
52
|
+
left: -${(props) => props.theme.space.xxs};
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
border-radius: 2px;
|
|
55
|
+
background-color: #ebedf0;
|
|
56
|
+
width: calc(100% + 24px);
|
|
57
|
+
border: 2px solid #1e79c2;
|
|
58
|
+
height: 100%;
|
|
59
|
+
z-index: -1;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
export {
|
|
64
|
+
ListItem,
|
|
65
|
+
StyledChatContainerContentList,
|
|
66
|
+
StyledChatContainerContentListScroll,
|
|
67
|
+
StyledLoadMoreContainer,
|
|
68
|
+
StyledWrapper,
|
|
69
|
+
StyledWrapperListItem
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-container-messages-list/styled.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { BUBBLE_TYPES } from '../bubble/index';\nimport { BubbleProps } from '../bubble/props';\n\nexport const StyledWrapper = styled.div`\n width: 100%;\n height: 100%;\n`;\n\n// list\nexport const StyledWrapperListItem = styled.div<Partial<BubbleProps>>`\n min-width: 100%;\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER &&\n `padding: ${props.theme.space.xxs} ${props.theme.space.xxs} ${props.theme.space.xxs} 13%\n `};\n ${(props) =>\n props.type === BUBBLE_TYPES.RECIPIENT &&\n `padding: ${props.theme.space.xxs} 13% ${props.theme.space.xxs}\n ${props.theme.space.xxs}\n `};\n ${(props) =>\n props.type === BUBBLE_TYPES.SYSTEM &&\n `padding: ${props.theme.space.xxs} 0px\n `};\n`;\n\nexport const StyledChatContainerContentList = styled.div`\n width: 100%;\n height: 100%;\n padding: ${(props) => props.theme.space.xs};\n padding-bottom: 0;\n overflow-y: auto;\n overflow-x: hidden;\n`;\nexport const StyledChatContainerContentListScroll = styled.div<{ height: string }>`\n width: 100%;\n height: ${(props) => props.height};\n position: relative;\n`;\n\nexport const StyledLoadMoreContainer = styled.div<{ hasMoreItems?: 'top' | 'bottom' }>`\n position: absolute;\n width: calc(100% + ${(props) => props.theme.space.xxs});\n padding: ${(props) => props.theme.space.xxs};\n left: -${(props) => props.theme.space.xxs};\n right: -${(props) => props.theme.space.xxs};\n display: grid;\n justify-content: center;\n align-items: center;\n ${(props) => (props.hasMoreItems === 'top' ? 'top: 0;' : '')}\n ${(props) => (props.hasMoreItems === 'bottom' ? 'bottom: 0;' : '')}\n`;\nexport const ListItem = styled.div`\n &:focus,\n &:focus-visible {\n outline: none;\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: -${(props) => props.theme.space.xxs};\n pointer-events: none;\n border-radius: 2px;\n background-color: #ebedf0;\n width: calc(100% + 24px);\n border: 2px solid #1e79c2;\n height: 100%;\n z-index: -1;\n }\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAGO,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAM7B,MAAM,wBAAwB,OAAO;AAAA;AAAA,IAExC,CAAC,UACD,MAAM,SAAS,aAAa,UAC5B,YAAY,MAAM,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM;AAAA;AAAA,IAEhF,CAAC,UACD,MAAM,SAAS,aAAa,aAC5B,YAAY,MAAM,MAAM,MAAM,WAAW,MAAM,MAAM,MAAM;AAAA,MACzD,MAAM,MAAM,MAAM;AAAA;AAAA,IAEpB,CAAC,UACD,MAAM,SAAS,aAAa,UAC5B,YAAY,MAAM,MAAM,MAAM;AAAA;AAAA;AAI3B,MAAM,iCAAiC,OAAO;AAAA;AAAA;AAAA,aAGxC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAKnC,MAAM,uCAAuC,OAAO;AAAA;AAAA,YAE/C,CAAC,UAAU,MAAM;AAAA;AAAA;AAItB,MAAM,0BAA0B,OAAO;AAAA;AAAA,uBAEvB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,aACvC,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WAC/B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,YAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA,IAIrC,CAAC,UAAW,MAAM,iBAAiB,QAAQ,YAAY;AAAA,IACvD,CAAC,UAAW,MAAM,iBAAiB,WAAW,eAAe;AAAA;AAE1D,MAAM,WAAW,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAShB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const ChatEmptyState = props => {
|
|
12
|
-
var _Grid, _Grid2;
|
|
13
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useMemo } from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
5
|
+
import { Communications } from "@elliemae/ds-icons";
|
|
6
|
+
import { emptyStateProps, defaultProps } from "./props";
|
|
7
|
+
import { ChatEmptyStateWrapper, MessageWrapper } from "./styled";
|
|
8
|
+
import { useValidateProps } from "./config/useValidateProps";
|
|
9
|
+
const ChatEmptyState = (props) => {
|
|
14
10
|
useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
action
|
|
18
|
-
} = props;
|
|
19
|
-
const MainContent = useMemo(() => /*#__PURE__*/_jsx(Grid, {
|
|
11
|
+
const { label, action } = props;
|
|
12
|
+
const MainContent = useMemo(() => /* @__PURE__ */ React2.createElement(Grid, {
|
|
20
13
|
alignItems: "center",
|
|
21
14
|
justifyContent: "center"
|
|
22
|
-
},
|
|
15
|
+
}, /* @__PURE__ */ React2.createElement(Grid, {
|
|
23
16
|
alignItems: "center",
|
|
24
17
|
justifyContent: "center"
|
|
25
|
-
},
|
|
18
|
+
}, /* @__PURE__ */ React2.createElement(Communications, {
|
|
26
19
|
size: "xxl",
|
|
27
|
-
color: [
|
|
28
|
-
})),
|
|
20
|
+
color: ["neutral", 400]
|
|
21
|
+
})), /* @__PURE__ */ React2.createElement(Grid, {
|
|
29
22
|
alignItems: "center",
|
|
30
23
|
justifyContent: "center"
|
|
31
|
-
},
|
|
24
|
+
}, /* @__PURE__ */ React2.createElement(MessageWrapper, null, label)), /* @__PURE__ */ React2.createElement(Grid, {
|
|
32
25
|
alignItems: "center",
|
|
33
26
|
justifyContent: "center"
|
|
34
|
-
},
|
|
35
|
-
return
|
|
27
|
+
}, action)), [label, action]);
|
|
28
|
+
return /* @__PURE__ */ React2.createElement(ChatEmptyStateWrapper, {
|
|
36
29
|
alignItems: "center",
|
|
37
30
|
justifyContent: "center"
|
|
38
|
-
},
|
|
31
|
+
}, MainContent);
|
|
39
32
|
};
|
|
40
|
-
|
|
33
|
+
ChatEmptyState.propTypes = emptyStateProps;
|
|
41
34
|
ChatEmptyState.defaultProps = defaultProps;
|
|
42
35
|
const ChatEmptyStateListWithSchema = describe(ChatEmptyState);
|
|
43
36
|
ChatEmptyStateListWithSchema.propTypes = emptyStateProps;
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
export {
|
|
38
|
+
ChatEmptyState,
|
|
39
|
+
ChatEmptyStateListWithSchema
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=ChatEmptyState.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-empty-state/ChatEmptyState.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Communications } from '@elliemae/ds-icons';\nimport { ChatEmptyStateProps, emptyStateProps, defaultProps } from './props';\nimport { ChatEmptyStateWrapper, MessageWrapper } from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst ChatEmptyState = (props: ChatEmptyStateProps): JSX.Element => {\n useValidateProps(props, ChatEmptyStateListWithSchema.toJSON());\n const { label, action } = props;\n const MainContent = useMemo(\n () => (\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <Communications size=\"xxl\" color={['neutral', 400]} />\n </Grid>\n <Grid alignItems=\"center\" justifyContent=\"center\">\n <MessageWrapper>{label}</MessageWrapper>\n </Grid>\n <Grid alignItems=\"center\" justifyContent=\"center\">\n {action}\n </Grid>\n </Grid>\n ),\n [label, action],\n );\n return (\n <ChatEmptyStateWrapper alignItems=\"center\" justifyContent=\"center\">\n {MainContent}\n </ChatEmptyStateWrapper>\n );\n};\n\nChatEmptyState.propTypes = emptyStateProps;\nChatEmptyState.defaultProps = defaultProps;\nconst ChatEmptyStateListWithSchema = describe(ChatEmptyState);\nChatEmptyStateListWithSchema.propTypes = emptyStateProps;\n\nexport { ChatEmptyState, ChatEmptyStateListWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,iBAAiB,CAAC,UAA4C;AAClE,mBAAiB,OAAO,6BAA6B;AACrD,QAAM,EAAE,OAAO,WAAW;AAC1B,QAAM,cAAc,QAClB,MACE,qCAAC,MAAD;AAAA,IAAM,YAAW;AAAA,IAAS,gBAAe;AAAA,KACvC,qCAAC,MAAD;AAAA,IAAM,YAAW;AAAA,IAAS,gBAAe;AAAA,KACvC,qCAAC,gBAAD;AAAA,IAAgB,MAAK;AAAA,IAAM,OAAO,CAAC,WAAW;AAAA,OAEhD,qCAAC,MAAD;AAAA,IAAM,YAAW;AAAA,IAAS,gBAAe;AAAA,KACvC,qCAAC,gBAAD,MAAiB,SAEnB,qCAAC,MAAD;AAAA,IAAM,YAAW;AAAA,IAAS,gBAAe;AAAA,KACtC,UAIP,CAAC,OAAO;AAEV,SACE,qCAAC,uBAAD;AAAA,IAAuB,YAAW;AAAA,IAAS,gBAAe;AAAA,KACvD;AAAA;AAKP,eAAe,YAAY;AAC3B,eAAe,eAAe;AAC9B,MAAM,+BAA+B,SAAS;AAC9C,6BAA6B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidatePropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const useValidateProps = (props, schema) => {
|
|
4
4
|
useValidatePropTypes(props, schema);
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export {
|
|
7
|
+
useValidateProps
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/chat-empty-state/config/useValidateProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatEmptyStateProps } from '../props';\n\nexport const useValidateProps = (props: ChatEmptyStateProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGO,MAAM,mBAAmB,CAAC,OAA4B,WAA0B;AACrF,uBAAqB,OAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
3
|
const defaultProps = {
|
|
4
|
-
label:
|
|
4
|
+
label: "No Messages Yet",
|
|
5
5
|
action: null
|
|
6
6
|
};
|
|
7
7
|
const emptyStateProps = {
|
|
8
|
-
label: PropTypes.arrayOf(PropTypes.string).description(
|
|
9
|
-
action: PropTypes.node.description(
|
|
8
|
+
label: PropTypes.arrayOf(PropTypes.string).description("No Message to show text helper").defaultValue(defaultProps.label),
|
|
9
|
+
action: PropTypes.node.description("action element").defaultValue(defaultProps.action)
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export {
|
|
12
|
+
defaultProps,
|
|
13
|
+
emptyStateProps
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-empty-state/props.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport interface ChatEmptyStateProps {\n label: string;\n action: React.FC;\n}\n\nexport const defaultProps: ChatEmptyStateProps = {\n label: 'No Messages Yet',\n action: null,\n};\n\nexport const emptyStateProps = {\n label: PropTypes.arrayOf(PropTypes.string)\n .description('No Message to show text helper')\n .defaultValue(defaultProps.label),\n action: PropTypes.node.description('action element').defaultValue(defaultProps.action),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAOO,MAAM,eAAoC;AAAA,EAC/C,OAAO;AAAA,EACP,QAAQ;AAAA;AAGH,MAAM,kBAAkB;AAAA,EAC7B,OAAO,UAAU,QAAQ,UAAU,QAChC,YAAY,kCACZ,aAAa,aAAa;AAAA,EAC7B,QAAQ,UAAU,KAAK,YAAY,kBAAkB,aAAa,aAAa;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
4
|
const CONTAINER_WIDTH = 300;
|
|
5
|
-
const ChatEmptyStateWrapper =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const ChatEmptyStateWrapper = styled(Grid)`
|
|
6
|
+
height: 100%;
|
|
7
|
+
min-width: ${CONTAINER_WIDTH}px;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
background: ${(props) => props.theme.colors.neutral["050"]};
|
|
10
|
+
`;
|
|
11
|
+
const MessageWrapper = styled.p`
|
|
12
|
+
font-size: 18px;
|
|
13
|
+
`;
|
|
14
|
+
export {
|
|
15
|
+
CONTAINER_WIDTH,
|
|
16
|
+
ChatEmptyStateWrapper,
|
|
17
|
+
MessageWrapper
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-empty-state/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const CONTAINER_WIDTH = 300;\n\nexport const ChatEmptyStateWrapper = styled(Grid)`\n height: 100%;\n min-width: ${CONTAINER_WIDTH}px;\n overflow: hidden;\n background: ${(props) => props.theme.colors.neutral['050']};\n`;\n\nexport const MessageWrapper = styled.p`\n font-size: 18px;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,kBAAkB;AAExB,MAAM,wBAAwB,OAAO;AAAA;AAAA,eAE7B;AAAA;AAAA,gBAEC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG/C,MAAM,iBAAiB,OAAO;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,45 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const FooterChat = _ref => {
|
|
26
|
-
let {
|
|
27
|
-
expanded,
|
|
28
|
-
onFooterClose,
|
|
29
|
-
onFooterExpand,
|
|
30
|
-
footerButtonExtraProps
|
|
31
|
-
} = _ref;
|
|
32
|
-
return /*#__PURE__*/_jsx(SidebarButton, {
|
|
33
|
-
dsId: "sidebar_footer",
|
|
34
|
-
label: null,
|
|
35
|
-
Icon: !expanded ? MenuCollapse : MenuExpand,
|
|
36
|
-
onClick: expanded ? onFooterClose : onFooterExpand,
|
|
37
|
-
"aria-pressed": expanded,
|
|
38
|
-
"aria-label": footerButtonExtraProps['aria-label']
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const SideBarChat = props => {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import { MenuCollapse, MenuExpand } from "@elliemae/ds-icons";
|
|
5
|
+
import { StyledSideBarContainer, StyledSideBarButtonsContainer } from "./styled";
|
|
6
|
+
import { TileButton } from "../tile-button";
|
|
7
|
+
import { SidebarButton } from "../sidebar-button/SidebarButton";
|
|
8
|
+
import { defaultProps, chatSidebarProps } from "./props";
|
|
9
|
+
import { useValidateProps } from "./config/useValidateProps";
|
|
10
|
+
const FooterChat = ({
|
|
11
|
+
expanded,
|
|
12
|
+
onFooterClose,
|
|
13
|
+
onFooterExpand,
|
|
14
|
+
footerButtonExtraProps
|
|
15
|
+
}) => /* @__PURE__ */ React2.createElement(SidebarButton, {
|
|
16
|
+
dsId: "sidebar_footer",
|
|
17
|
+
label: null,
|
|
18
|
+
Icon: !expanded ? MenuCollapse : MenuExpand,
|
|
19
|
+
onClick: expanded ? onFooterClose : onFooterExpand,
|
|
20
|
+
"aria-pressed": expanded,
|
|
21
|
+
"aria-label": footerButtonExtraProps["aria-label"]
|
|
22
|
+
});
|
|
23
|
+
const SideBarChat = (props) => {
|
|
43
24
|
useValidateProps(props, SideBarChatWithSchema.toJSON());
|
|
44
25
|
const {
|
|
45
26
|
sidebarItems,
|
|
@@ -52,37 +33,39 @@ const SideBarChat = props => {
|
|
|
52
33
|
enableTooltipWhenIsClosed,
|
|
53
34
|
actionRef
|
|
54
35
|
} = props;
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (ref) listRef[ref.dataset.key] = ref;
|
|
36
|
+
const { current: listRef } = React2.useRef({});
|
|
37
|
+
const registerReference = React2.useCallback((ref) => {
|
|
38
|
+
if (ref)
|
|
39
|
+
listRef[ref.dataset.key] = ref;
|
|
60
40
|
}, [listRef]);
|
|
61
|
-
|
|
41
|
+
React2.useEffect(() => {
|
|
62
42
|
if (actionRef.current.listRef) {
|
|
63
43
|
actionRef.current.listRef = listRef;
|
|
64
44
|
}
|
|
65
45
|
}, [sidebarItems, expanded, actionRef, listRef]);
|
|
66
|
-
return
|
|
67
|
-
rows: [1,
|
|
68
|
-
ref: listRef
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
46
|
+
return /* @__PURE__ */ React2.createElement(StyledSideBarContainer, {
|
|
47
|
+
rows: [1, "auto"],
|
|
48
|
+
ref: listRef
|
|
49
|
+
}, /* @__PURE__ */ React2.createElement(StyledSideBarButtonsContainer, null, sidebarItems.map((p) => /* @__PURE__ */ React2.createElement(TileButton, {
|
|
50
|
+
key: p.dsId,
|
|
51
|
+
innerRef: registerReference,
|
|
52
|
+
...p,
|
|
53
|
+
selected: selectedItem === p.dsId,
|
|
54
|
+
tooltipPlacement,
|
|
55
|
+
disableTooltip: enableTooltipWhenIsClosed ? false : !expanded
|
|
56
|
+
}))), /* @__PURE__ */ React2.createElement(FooterChat, {
|
|
57
|
+
expanded,
|
|
58
|
+
onFooterClose,
|
|
59
|
+
onFooterExpand,
|
|
60
|
+
footerButtonExtraProps
|
|
61
|
+
}));
|
|
82
62
|
};
|
|
83
|
-
|
|
63
|
+
SideBarChat.propTypes = chatSidebarProps;
|
|
84
64
|
SideBarChat.defaultProps = defaultProps;
|
|
85
65
|
const SideBarChatWithSchema = describe(SideBarChat);
|
|
86
66
|
SideBarChatWithSchema.propTypes = chatSidebarProps;
|
|
87
|
-
|
|
88
|
-
|
|
67
|
+
export {
|
|
68
|
+
SideBarChat,
|
|
69
|
+
SideBarChatWithSchema
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=SideBarChat.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-sidebar/SideBarChat.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from 'react-desc';\nimport { MenuCollapse, MenuExpand } from '@elliemae/ds-icons';\nimport { StyledSideBarContainer, StyledSideBarButtonsContainer } from './styled';\nimport { TileButton } from '../tile-button';\nimport { SidebarButton } from '../sidebar-button/SidebarButton';\nimport { CharSidebarProps, defaultProps, chatSidebarProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\n\nconst FooterChat = ({\n expanded,\n onFooterClose,\n onFooterExpand,\n footerButtonExtraProps,\n}: Pick<CharSidebarProps, 'expanded' | 'onFooterClose' | 'onFooterExpand' | 'footerButtonExtraProps'>) => (\n <SidebarButton\n dsId=\"sidebar_footer\"\n label={null}\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 = (props: CharSidebarProps): JSX.Element => {\n useValidateProps(props, SideBarChatWithSchema.toJSON());\n const {\n sidebarItems,\n expanded,\n onFooterClose,\n onFooterExpand,\n selectedItem,\n footerButtonExtraProps,\n tooltipPlacement,\n enableTooltipWhenIsClosed,\n actionRef,\n } = props;\n const { current: listRef } = React.useRef({});\n const registerReference = React.useCallback(\n (ref: HTMLElement) => {\n if (ref) 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={[1, 'auto']} ref={listRef}>\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;\nSideBarChat.defaultProps = defaultProps;\nconst SideBarChatWithSchema = describe(SideBarChat);\nSideBarChatWithSchema.propTypes = chatSidebarProps;\n\nexport { SideBarChat, SideBarChatWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,qCAAC,eAAD;AAAA,EACE,MAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM,CAAC,WAAW,eAAe;AAAA,EACjC,SAAS,WAAW,gBAAgB;AAAA,EACpC,gBAAc;AAAA,EACd,cAAY,uBAAuB;AAAA;AAIvC,MAAM,cAAc,CAAC,UAAyC;AAC5D,mBAAiB,OAAO,sBAAsB;AAC9C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,EAAE,SAAS,YAAY,OAAM,OAAO;AAC1C,QAAM,oBAAoB,OAAM,YAC9B,CAAC,QAAqB;AACpB,QAAI;AAAK,cAAQ,IAAI,QAAQ,OAAO;AAAA,KAEtC,CAAC;AAEH,SAAM,UAAU,MAAM;AACpB,QAAI,UAAU,QAAQ,SAAS;AAC7B,gBAAU,QAAQ,UAAU;AAAA;AAAA,KAE7B,CAAC,cAAc,UAAU,WAAW;AAEvC,SACE,qCAAC,wBAAD;AAAA,IAAwB,MAAM,CAAC,GAAG;AAAA,IAAS,KAAK;AAAA,KAC9C,qCAAC,+BAAD,MACG,aAAa,IAAI,CAAC,MACjB,qCAAC,YAAD;AAAA,IACE,KAAK,EAAE;AAAA,IACP,UAAU;AAAA,OACN;AAAA,IACJ,UAAU,iBAAiB,EAAE;AAAA,IAC7B;AAAA,IACA,gBAAgB,4BAA4B,QAAQ,CAAC;AAAA,QAI3D,qCAAC,YAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAMR,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,MAAM,wBAAwB,SAAS;AACvC,sBAAsB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidatePropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
const useValidateProps = (props, schema) => {
|
|
4
4
|
useValidatePropTypes(props, schema);
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
export {
|
|
7
|
+
useValidateProps
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/chat-sidebar/config/useValidateProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { CharSidebarProps } from '../props';\n\nexport const useValidateProps = (props: CharSidebarProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGO,MAAM,mBAAmB,CAAC,OAAyB,WAA0B;AAClF,uBAAqB,OAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-sidebar/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { SideBarChat, SideBarChatWithSchema } from './SideBarChat';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
|
+
import { noop } from "lodash";
|
|
4
4
|
const defaultProps = {
|
|
5
5
|
expanded: false,
|
|
6
|
-
selectedItem:
|
|
6
|
+
selectedItem: void 0,
|
|
7
7
|
sidebarItems: [],
|
|
8
8
|
onFooterExpand: noop,
|
|
9
9
|
onFooterClose: noop,
|
|
10
10
|
onHeaderExpand: noop,
|
|
11
11
|
onHeaderClose: noop,
|
|
12
|
-
footerButtonExtraProps: {
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
tooltipPlacement: 'right',
|
|
12
|
+
footerButtonExtraProps: { "aria-label": "expand or collapse button" },
|
|
13
|
+
tooltipPlacement: "right",
|
|
16
14
|
enableTooltipWhenIsClosed: false,
|
|
17
15
|
actionRef: {
|
|
18
16
|
current: {
|
|
@@ -21,17 +19,37 @@ const defaultProps = {
|
|
|
21
19
|
}
|
|
22
20
|
};
|
|
23
21
|
const chatSidebarProps = {
|
|
24
|
-
sidebarItems: PropTypes.arrayOf(PropTypes.object).description(
|
|
25
|
-
expanded: PropTypes.bool.description(
|
|
26
|
-
selectedItem: PropTypes.string.description(
|
|
27
|
-
tooltipPlacement: PropTypes.oneOf([
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
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),
|
|
23
|
+
expanded: PropTypes.bool.description("Whether to show the chat expanded or collapsed").defaultValue(defaultProps.expanded),
|
|
24
|
+
selectedItem: PropTypes.string.description("The id of the chat item you want to be opened").defaultValue(defaultProps.selectedItem),
|
|
25
|
+
tooltipPlacement: PropTypes.oneOf([
|
|
26
|
+
"top-start",
|
|
27
|
+
"top",
|
|
28
|
+
"top-end",
|
|
29
|
+
"right-start",
|
|
30
|
+
"right",
|
|
31
|
+
"right-end",
|
|
32
|
+
"bottom-end",
|
|
33
|
+
"bottom",
|
|
34
|
+
"bottom-start",
|
|
35
|
+
"left-end",
|
|
36
|
+
"left",
|
|
37
|
+
"left-start"
|
|
38
|
+
]).description("start placement preferences, as per popperjs placement option").defaultValue("'right'"),
|
|
39
|
+
enableTooltipWhenIsClosed: PropTypes.bool.description("Enable tooltip when is closed").defaultValue(defaultProps.onFooterExpand),
|
|
40
|
+
onFooterExpand: PropTypes.func.description("The function to call when the chat is opened via the footer").defaultValue(defaultProps.onFooterExpand),
|
|
41
|
+
onFooterClose: PropTypes.func.description("The function to call when the chat is closed via the footer").defaultValue(defaultProps.onFooterClose),
|
|
42
|
+
onHeaderExpand: PropTypes.func.description("The function to call when the chat is opened via the header").defaultValue(defaultProps.onHeaderExpand),
|
|
43
|
+
onHeaderClose: PropTypes.func.description("The function to call when the chat is closed via the header").defaultValue(defaultProps.onHeaderClose),
|
|
44
|
+
footerButtonExtraProps: PropTypes.object.description("Expand/collapse footer button extra props").defaultValue(defaultProps.footerButtonExtraProps),
|
|
45
|
+
actionRef: PropTypes.object.description(`Action ref for sidebar
|
|
46
|
+
{
|
|
47
|
+
listRef: references to Tiles
|
|
48
|
+
}
|
|
49
|
+
`).defaultValue(defaultProps.actionRef)
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
chatSidebarProps,
|
|
53
|
+
defaultProps
|
|
35
54
|
};
|
|
36
|
-
|
|
37
|
-
export { chatSidebarProps, defaultProps };
|
|
55
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/chat-sidebar/props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport { TileButtonProps } from '../tile-button/props';\n\nexport interface CharSidebarProps {\n sidebarItems: TileButtonProps[];\n expanded: boolean;\n selectedItem: undefined;\n onFooterClose: () => void;\n onFooterExpand: () => void;\n onHeaderExpand: () => void;\n onHeaderClose: () => void;\n footerButtonExtraProps: Record<string, any>;\n tooltipPlacement:\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 enableTooltipWhenIsClosed: boolean;\n actionRef: React.MutableRefObject<any>;\n}\n\nexport const defaultProps: CharSidebarProps = {\n expanded: false,\n selectedItem: undefined,\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 actionRef: {\n current: {\n listRef: [],\n },\n },\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\n .description('The id of the chat item you want to be opened')\n .defaultValue(defaultProps.selectedItem),\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\n .description(\n `Action ref for sidebar\n {\n listRef: references to Tiles\n }\n `,\n )\n .defaultValue(defaultProps.actionRef),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AA6BO,MAAM,eAAiC;AAAA,EAC5C,UAAU;AAAA,EACV,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,wBAAwB,EAAE,cAAc;AAAA,EACxC,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,WAAW;AAAA,IACT,SAAS;AAAA,MACP,SAAS;AAAA;AAAA;AAAA;AAKR,MAAM,mBAAmB;AAAA,EAC9B,cAAc,UAAU,QAAQ,UAAU,QACvC,YAAY,2FACZ,aAAa,aAAa;AAAA,EAC7B,UAAU,UAAU,KACjB,YAAY,kDACZ,aAAa,aAAa;AAAA,EAC7B,cAAc,UAAU,OACrB,YAAY,iDACZ,aAAa,aAAa;AAAA,EAC7B,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,KAEC,YAAY,iEACZ,aAAa;AAAA,EAChB,2BAA2B,UAAU,KAClC,YAAY,iCACZ,aAAa,aAAa;AAAA,EAC7B,gBAAgB,UAAU,KACvB,YAAY,+DACZ,aAAa,aAAa;AAAA,EAC7B,eAAe,UAAU,KACtB,YAAY,+DACZ,aAAa,aAAa;AAAA,EAC7B,gBAAgB,UAAU,KACvB,YAAY,+DACZ,aAAa,aAAa;AAAA,EAC7B,eAAe,UAAU,KACtB,YAAY,+DACZ,aAAa,aAAa;AAAA,EAC7B,wBAAwB,UAAU,OAC/B,YAAY,6CACZ,aAAa,aAAa;AAAA,EAC7B,WAAW,UAAU,OAClB,YACC;AAAA;AAAA;AAAA;AAAA,KAMD,aAAa,aAAa;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|