@elliemae/ds-chat 1.53.4-rc.3 → 1.53.5
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/index.js +14 -1
- package/cjs/index.js.map +1 -1
- package/cjs/parts/bubble/ChatBubble.js +8 -1
- package/cjs/parts/bubble/ChatBubble.js.map +1 -1
- package/cjs/parts/bubble/config/useValidateProps.js +32 -0
- package/cjs/parts/bubble/config/useValidateProps.js.map +1 -0
- package/cjs/parts/bubble/index.js +4 -1
- package/cjs/parts/bubble/index.js.map +1 -1
- package/cjs/parts/bubble/props.js +4 -4
- package/cjs/parts/bubble/props.js.map +1 -1
- package/cjs/parts/bubble/styled.js +1 -1
- package/cjs/parts/bubble/styled.js.map +1 -1
- package/cjs/parts/chat-card/ChatCard.js +9 -6
- package/cjs/parts/chat-card/ChatCard.js.map +1 -1
- package/cjs/parts/chat-card/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-card/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-card/index.js +3 -1
- package/cjs/parts/chat-card/index.js.map +1 -1
- package/cjs/parts/chat-card/props.js +1 -1
- package/cjs/parts/chat-card/props.js.map +1 -1
- package/cjs/parts/chat-composer/ChatContainerComposer.js +19 -2
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/cjs/parts/chat-composer/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-composer/index.js +2 -0
- package/cjs/parts/chat-composer/index.js.map +1 -1
- package/cjs/parts/chat-composer/props.js +6 -4
- package/cjs/parts/chat-composer/props.js.map +1 -1
- package/cjs/parts/chat-composer/styled.js +2 -2
- package/cjs/parts/chat-composer/styled.js.map +1 -1
- package/cjs/parts/chat-container/ChatContainer.js +10 -1
- package/cjs/parts/chat-container/ChatContainer.js.map +1 -1
- package/cjs/parts/chat-container/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-container/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-container/index.js +7 -0
- package/cjs/parts/chat-container/index.js.map +1 -1
- package/cjs/parts/chat-container/props.js +3 -2
- package/cjs/parts/chat-container/props.js.map +1 -1
- package/cjs/parts/chat-container/styled.js +3 -1
- package/cjs/parts/chat-container/styled.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +70 -11
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-container-messages-list/index.js +5 -0
- package/cjs/parts/chat-container-messages-list/index.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/props.js +1 -1
- package/cjs/parts/chat-container-messages-list/props.js.map +1 -1
- package/cjs/parts/chat-container-messages-list/styled.js +9 -1
- package/cjs/parts/chat-container-messages-list/styled.js.map +1 -1
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +14 -3
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-empty-state/props.js +2 -1
- package/cjs/parts/chat-empty-state/props.js.map +1 -1
- package/cjs/parts/chat-sidebar/SideBarChat.js +12 -8
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +12 -0
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +1 -0
- package/cjs/parts/chat-sidebar/index.js +4 -1
- package/cjs/parts/chat-sidebar/index.js.map +1 -1
- package/cjs/parts/floating-button/FloatingButton.js.map +1 -1
- package/cjs/parts/grid-influencer/InfluencerContainer.js +9 -0
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/cjs/parts/message-delimiter/MessageDelimiter.js +8 -5
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +1 -1
- package/cjs/parts/message-delimiter/config/useValidateProps.js +12 -0
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +1 -0
- package/cjs/parts/message-delimiter/index.js +2 -0
- package/cjs/parts/message-delimiter/index.js.map +1 -1
- package/cjs/parts/message-delimiter/props.js +1 -1
- package/cjs/parts/message-delimiter/props.js.map +1 -1
- package/cjs/parts/sidebar-button/SidebarButton.js.map +1 -1
- package/cjs/parts/sidebar-button/styled.js +3 -1
- package/cjs/parts/sidebar-button/styled.js.map +1 -1
- package/cjs/parts/system-message/SystemMessage.js +7 -4
- package/cjs/parts/system-message/SystemMessage.js.map +1 -1
- package/cjs/parts/system-message/config/useValidateProps.js +12 -0
- package/cjs/parts/system-message/config/useValidateProps.js.map +1 -0
- package/cjs/parts/system-message/index.js +2 -0
- package/cjs/parts/system-message/index.js.map +1 -1
- package/cjs/parts/tile-button/TileButton.js +3 -1
- package/cjs/parts/tile-button/TileButton.js.map +1 -1
- package/cjs/parts/tile-button/config/useValidateProps.js +12 -0
- package/cjs/parts/tile-button/config/useValidateProps.js.map +1 -0
- package/cjs/parts/tile-button/index.js +2 -1
- package/cjs/parts/tile-button/index.js.map +1 -1
- package/cjs/parts/tile-button/props.js +3 -5
- package/cjs/parts/tile-button/props.js.map +1 -1
- package/cjs/parts/tile-button/styled.js +9 -5
- package/cjs/parts/tile-button/styled.js.map +1 -1
- package/esm/index.js +14 -2
- package/esm/index.js.map +1 -1
- package/esm/parts/bubble/ChatBubble.js +8 -2
- package/esm/parts/bubble/ChatBubble.js.map +1 -1
- package/esm/parts/bubble/config/useValidateProps.js +28 -0
- package/esm/parts/bubble/config/useValidateProps.js.map +1 -0
- package/esm/parts/bubble/index.js +4 -2
- package/esm/parts/bubble/index.js.map +1 -1
- package/esm/parts/bubble/props.js +4 -4
- package/esm/parts/bubble/props.js.map +1 -1
- package/esm/parts/bubble/styled.js +1 -1
- package/esm/parts/bubble/styled.js.map +1 -1
- package/esm/parts/chat-card/ChatCard.js +9 -6
- package/esm/parts/chat-card/ChatCard.js.map +1 -1
- package/esm/parts/chat-card/config/useValidateProps.js +8 -0
- package/esm/parts/chat-card/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-card/index.js +3 -1
- package/esm/parts/chat-card/index.js.map +1 -1
- package/esm/parts/chat-card/props.js +1 -1
- package/esm/parts/chat-card/props.js.map +1 -1
- package/esm/parts/chat-composer/ChatContainerComposer.js +19 -2
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +1 -1
- package/esm/parts/chat-composer/config/useValidateProps.js +8 -0
- package/esm/parts/chat-composer/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-composer/index.js +2 -0
- package/esm/parts/chat-composer/index.js.map +1 -1
- package/esm/parts/chat-composer/props.js +6 -4
- package/esm/parts/chat-composer/props.js.map +1 -1
- package/esm/parts/chat-composer/styled.js +2 -2
- package/esm/parts/chat-composer/styled.js.map +1 -1
- package/esm/parts/chat-container/ChatContainer.js +10 -1
- package/esm/parts/chat-container/ChatContainer.js.map +1 -1
- package/esm/parts/chat-container/config/useValidateProps.js +8 -0
- package/esm/parts/chat-container/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-container/index.js +7 -0
- package/esm/parts/chat-container/index.js.map +1 -1
- package/esm/parts/chat-container/props.js +3 -2
- package/esm/parts/chat-container/props.js.map +1 -1
- package/esm/parts/chat-container/styled.js +3 -1
- package/esm/parts/chat-container/styled.js.map +1 -1
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +71 -12
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +1 -1
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +8 -0
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-container-messages-list/index.js +5 -0
- package/esm/parts/chat-container-messages-list/index.js.map +1 -1
- package/esm/parts/chat-container-messages-list/props.js +1 -1
- package/esm/parts/chat-container-messages-list/props.js.map +1 -1
- package/esm/parts/chat-container-messages-list/styled.js +9 -2
- package/esm/parts/chat-container-messages-list/styled.js.map +1 -1
- package/esm/parts/chat-empty-state/ChatEmptyState.js +14 -4
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +1 -1
- package/esm/parts/chat-empty-state/config/useValidateProps.js +8 -0
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-empty-state/props.js +2 -1
- package/esm/parts/chat-empty-state/props.js.map +1 -1
- package/esm/parts/chat-sidebar/SideBarChat.js +12 -8
- package/esm/parts/chat-sidebar/SideBarChat.js.map +1 -1
- package/esm/parts/chat-sidebar/config/useValidateProps.js +8 -0
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +1 -0
- package/esm/parts/chat-sidebar/index.js +4 -1
- package/esm/parts/chat-sidebar/index.js.map +1 -1
- package/esm/parts/floating-button/FloatingButton.js.map +1 -1
- package/esm/parts/grid-influencer/InfluencerContainer.js +9 -0
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +1 -1
- package/esm/parts/message-delimiter/MessageDelimiter.js +8 -5
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +1 -1
- package/esm/parts/message-delimiter/config/useValidateProps.js +8 -0
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +1 -0
- package/esm/parts/message-delimiter/index.js +2 -0
- package/esm/parts/message-delimiter/index.js.map +1 -1
- package/esm/parts/message-delimiter/props.js +1 -1
- package/esm/parts/message-delimiter/props.js.map +1 -1
- package/esm/parts/sidebar-button/SidebarButton.js.map +1 -1
- package/esm/parts/sidebar-button/styled.js +3 -1
- package/esm/parts/sidebar-button/styled.js.map +1 -1
- package/esm/parts/system-message/SystemMessage.js +7 -4
- package/esm/parts/system-message/SystemMessage.js.map +1 -1
- package/esm/parts/system-message/config/useValidateProps.js +8 -0
- package/esm/parts/system-message/config/useValidateProps.js.map +1 -0
- package/esm/parts/system-message/index.js +2 -0
- package/esm/parts/system-message/index.js.map +1 -1
- package/esm/parts/tile-button/TileButton.js +3 -1
- package/esm/parts/tile-button/TileButton.js.map +1 -1
- package/esm/parts/tile-button/config/useValidateProps.js +8 -0
- package/esm/parts/tile-button/config/useValidateProps.js.map +1 -0
- package/esm/parts/tile-button/index.js +2 -1
- package/esm/parts/tile-button/index.js.map +1 -1
- package/esm/parts/tile-button/props.js +3 -4
- package/esm/parts/tile-button/props.js.map +1 -1
- package/esm/parts/tile-button/styled.js +9 -5
- package/esm/parts/tile-button/styled.js.map +1 -1
- package/package.json +5 -5
- package/parts/bubble/config/useValidateProps/package.json +10 -0
- package/parts/chat-card/config/useValidateProps/package.json +10 -0
- package/parts/chat-composer/config/useValidateProps/package.json +10 -0
- package/parts/chat-container/config/useValidateProps/package.json +10 -0
- package/parts/chat-container-messages-list/config/useValidateProps/package.json +10 -0
- package/parts/chat-empty-state/config/useValidateProps/package.json +10 -0
- package/parts/chat-sidebar/config/useValidateProps/package.json +10 -0
- package/parts/message-delimiter/config/useValidateProps/package.json +10 -0
- package/parts/system-message/config/useValidateProps/package.json +10 -0
- package/parts/tile-button/config/useValidateProps/package.json +10 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/parts/tile-button/styled.ts"],"sourcesContent":["/* eslint-disable indent */\n/* eslint-disable max-lines */\nimport styled, { css } from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { TileButtonProps } from './props';\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n\n// Buttons\nexport const StyledWrapperLeftBorder = styled(Grid)`\n height: 100%;\n width: 4px;\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nexport const StyledStatusBadge = styled.div<Partial<TileButtonProps>>`\n height: 8px;\n width: 8px;\n position: absolute;\n top: 0;\n background: ${(props) => {\n switch (props.badgeColor) {\n case 'blue':\n return props.theme.colors.brand[600];\n case 'green':\n return props.theme.colors.success[900];\n default:\n return props.theme.colors.brand[600];\n }\n }};\n ${(props) => {\n switch (props.badgePosition) {\n case 'left':\n return 'left: -4px;';\n case 'right':\n return 'right: -4px;';\n default:\n return 'left: -4px;';\n }\n }};\n border-radius: 50%;\n box-sizing: content-box;\n`;\n\nexport const StyledWrapperCentralContent = styled(Grid)`\n width: 24px;\n height: 40px;\n`;\n\nexport const StyledTileButtonIcon = styled(Grid)`\n position: relative;\n height: 24px;\n width: 24px;\n }\n`;\n\nexport const StyledTileButtonLabel = styled.div`\n width: 24px;\n height: ${(props) => props.theme.space.xs};\n text-transform: uppercase;\n overflow: hidden;\n text-align: center;\n font-size: 13px;\n color: ${(props) => props.theme.colors.neutral[600]};\n line-height: 17px;\n`;\n\nexport const CloseButton = styled.button<any>`\n outline: none;\n background: none;\n height: 9px;\n width: 9px;\n position: absolute;\n top: 1px;\n right: 1px;\n overflow: hidden;\n padding: 0;\n border: none;\n span {\n position: absolute;\n left: -3px;\n top: -4px;\n }\n\n &:focus,\n &:hover {\n svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n &:after {\n display: block;\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: solid 1px ${(props) => props.theme.colors.brand[600]};\n border-radius: 2px;\n }\n }\n cursor: pointer;\n`;\n\n// MAIN WRAPPER\nexport const StyledTileButton = styled.button<Partial<TileButtonProps>>`\n outline: none;\n background: transparent;\n height: ${BUTTON_SIDEBAR_HEIGHT}px;\n width: ${MIN_WIDTH_SIDEBAR}px;\n position: relative;\n padding: 0;\n border: none;\n cursor: pointer;\n border-bottom: ${(props) => (props.isHeader ? `1px solid ${props.theme.colors.neutral['200']}` : 'none')};\n &:focus,\n &:hover,\n &:active,\n &:disabled {\n background: ${(props) => props.theme.colors.neutral['080']};\n & ${StyledStatusBadge} {\n border: 2px solid ${(props) => props.theme.colors.neutral['080']};\n margin-top: -2px;\n ${(props) => {\n switch (props.badgePosition) {\n case 'left':\n return 'margin-left: -2px;';\n case 'right':\n return 'margin-right: -2px;';\n default:\n return 'margin-left: -2px;';\n }\n }};\n }\n }\n\n &:focus,\n &:hover {\n & ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.brand[800]};\n }\n & ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[600]};\n }\n }\n\n &:active:not(:disabled) {\n background: ${(props) => props.theme.colors.neutral['050']};\n & ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.brand[600]};\n }\n & ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[600]};\n font-weight: 600;\n }\n & svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n & ${StyledStatusBadge} {\n border: 2px solid ${(props) => props.theme.colors.neutral['050']};\n }\n }\n\n &:disabled {\n background: ${(props) => props.theme.colors.neutral['080']};\n ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.neutral['400']};\n }\n & ${StyledStatusBadge} {\n background: ${(props) => props.theme.colors.neutral['500']};\n border: 2px solid ${(props) => props.theme.colors.neutral['080']};\n }\n ${StyledTileButtonIcon} {\n svg {\n fill: ${(props) => props.theme.colors.neutral[400]};\n }\n }\n ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[400]};\n }\n }\n\n ${(props) => {\n if (props.selected) {\n return css`\n & ${StyledWrapperLeftBorder} {\n background: ${(nestedProps) => nestedProps.theme.colors.brand[600]};\n }\n `;\n }\n return '';\n }}\n`;\n\nexport const StyledWrapper = styled(Grid)`\n height: 100%;\n width: 100%;\n position: relative;\n
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../src/parts/tile-button/styled.ts"],"sourcesContent":["/* eslint-disable indent */\n/* eslint-disable max-lines */\nimport styled, { css } from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { TileButtonProps } from './props';\nconst MIN_WIDTH_SIDEBAR = 48;\nconst BUTTON_SIDEBAR_HEIGHT = 48;\n\n// Buttons\nexport const StyledWrapperLeftBorder = styled(Grid)`\n height: 100%;\n width: 4px;\n position: absolute;\n top: 0;\n left: 0;\n`;\n\nexport const StyledStatusBadge = styled.div<Partial<TileButtonProps>>`\n height: 8px;\n width: 8px;\n position: absolute;\n top: 0;\n background: ${(props) => {\n switch (props.badgeColor) {\n case 'blue':\n return props.theme.colors.brand[600];\n case 'green':\n return props.theme.colors.success[900];\n default:\n return props.theme.colors.brand[600];\n }\n }};\n ${(props) => {\n switch (props.badgePosition) {\n case 'left':\n return 'left: -4px;';\n case 'right':\n return 'right: -4px;';\n default:\n return 'left: -4px;';\n }\n }};\n border-radius: 50%;\n box-sizing: content-box;\n`;\n\nexport const StyledWrapperCentralContent = styled(Grid)`\n width: 24px;\n height: 40px;\n`;\n\nexport const StyledTileButtonIcon = styled(Grid)`\n position: relative;\n height: 24px;\n width: 24px;\n svg {\n fill: ${(props) => props.theme.colors.neutral[500]};\n }\n\n &:focus {\n svg {\n fill: ${(props) => props.theme.colors.brand[800]};\n }\n }\n`;\n\nexport const StyledTileButtonLabel = styled.div`\n width: 24px;\n height: ${(props) => props.theme.space.xs};\n text-transform: uppercase;\n overflow: hidden;\n text-align: center;\n font-size: 13px;\n color: ${(props) => props.theme.colors.neutral[600]};\n line-height: 17px;\n`;\n\nexport const CloseButton = styled.button<any>`\n outline: none;\n background: none;\n height: 9px;\n width: 9px;\n position: absolute;\n top: 1px;\n right: 1px;\n overflow: hidden;\n padding: 0;\n border: none;\n span {\n position: absolute;\n left: -3px;\n top: -4px;\n }\n\n &:focus,\n &:hover {\n svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n &:after {\n display: block;\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: solid 1px ${(props) => props.theme.colors.brand[600]};\n border-radius: 2px;\n }\n }\n cursor: pointer;\n`;\n\n// MAIN WRAPPER\nexport const StyledTileButton = styled.button<Partial<TileButtonProps>>`\n outline: none;\n background: transparent;\n height: ${BUTTON_SIDEBAR_HEIGHT}px;\n width: ${MIN_WIDTH_SIDEBAR}px;\n position: relative;\n padding: 0;\n border: none;\n cursor: pointer;\n border-bottom: ${(props) => (props.isHeader ? `1px solid ${props.theme.colors.neutral['200']}` : 'none')};\n &:focus,\n &:hover,\n &:active,\n &:disabled {\n background: ${(props) => props.theme.colors.neutral['080']};\n & ${StyledStatusBadge} {\n border: 2px solid ${(props) => props.theme.colors.neutral['080']};\n margin-top: -2px;\n ${(props) => {\n switch (props.badgePosition) {\n case 'left':\n return 'margin-left: -2px;';\n case 'right':\n return 'margin-right: -2px;';\n default:\n return 'margin-left: -2px;';\n }\n }};\n }\n }\n\n &:focus,\n &:hover {\n & ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.brand[800]};\n }\n & ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[600]};\n }\n\n & svg {\n fill: ${(props) => props.theme.colors.brand[800]};\n }\n }\n\n &:active:not(:disabled) {\n background: ${(props) => props.theme.colors.neutral['050']};\n & ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.brand[600]};\n }\n & ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[600]};\n font-weight: 600;\n }\n & svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n & ${StyledStatusBadge} {\n border: 2px solid ${(props) => props.theme.colors.neutral['050']};\n }\n }\n\n &:disabled {\n background: ${(props) => props.theme.colors.neutral['080']};\n ${StyledWrapperLeftBorder} {\n background: ${(props) => props.theme.colors.neutral['400']};\n }\n & ${StyledStatusBadge} {\n background: ${(props) => props.theme.colors.neutral['500']};\n border: 2px solid ${(props) => props.theme.colors.neutral['080']};\n }\n ${StyledTileButtonIcon} {\n svg {\n fill: ${(props) => props.theme.colors.neutral[400]};\n }\n }\n ${StyledTileButtonLabel} {\n color: ${(props) => props.theme.colors.neutral[400]};\n }\n }\n\n ${(props) => {\n if (props.selected) {\n return css`\n & ${StyledWrapperLeftBorder} {\n background: ${(nestedProps) => nestedProps.theme.colors.brand[600]};\n }\n `;\n }\n return '';\n }}\n`;\n\nexport const StyledWrapper = styled(Grid)`\n height: 100%;\n width: 100%;\n position: relative;\n`;\n"],"names":["MIN_WIDTH_SIDEBAR","BUTTON_SIDEBAR_HEIGHT","StyledWrapperLeftBorder","styled","Grid","StyledStatusBadge","div","props","badgeColor","theme","colors","brand","success","badgePosition","StyledWrapperCentralContent","StyledTileButtonIcon","neutral","StyledTileButtonLabel","space","xs","CloseButton","button","StyledTileButton","isHeader","selected","css","nestedProps","StyledWrapper"],"mappings":";;;;;;;;;;;AAAA;AAKA,IAAMA,iBAAiB,GAAG,EAA1B;AACA,IAAMC,qBAAqB,GAAG,EAA9B;;IAGaC,uBAAuB,gBAAGC,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA;IAQvBC,iBAAiB,gBAAGF,0BAAM,CAACG,GAAV;AAAA;AAAA,oHAKd,UAACC,KAAD,EAAW;AACvB,UAAQA,KAAK,CAACC,UAAd;AACE,SAAK,MAAL;AACE,aAAOD,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBC,KAAnB,CAAyB,GAAzB,CAAP;;AACF,SAAK,OAAL;AACE,aAAOJ,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBE,OAAnB,CAA2B,GAA3B,CAAP;;AACF;AACE,aAAOL,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBC,KAAnB,CAAyB,GAAzB,CAAP;AANJ;AAQD,CAd2B,EAe1B,UAACJ,KAAD,EAAW;AACX,UAAQA,KAAK,CAACM,aAAd;AACE,SAAK,MAAL;AACE,aAAO,aAAP;;AACF,SAAK,OAAL;AACE,aAAO,cAAP;;AACF;AACE,aAAO,aAAP;AANJ;AAQD,CAxB2B;IA6BjBC,2BAA2B,gBAAGX,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA;IAK3BW,oBAAoB,gBAAGZ,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA,yFAKrB,UAACG,KAAD;AAAA,SAAWA,KAAK,CAACE,KAAN,CAAYC,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AmBM,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CA/DW,EAgEvBd,uBAhEuB,EAiET,UAACK,KAAD;AAAA,SAAWA,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBM,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CAjES,EAmErBX,iBAnEqB,EAoET,UAACE,KAAD;AAAA,SAAWA,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBM,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CApES,EAqEH,UAACT,KAAD;AAAA,SAAWA,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBM,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CArEG,EAuEvBD,oBAvEuB,EAyEb,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBM,OAAnB,CAA2B,GAA3B,CAAX;AAAA,CAzEa,EA4EvBC,qBA5EuB,EA6Ed,UAACV,KAAD;AAAA,SAAWA,KAAK,CAACE,KAAN,CAAYC,MAAZ,CAAmBM,OAAnB,CAA2B,GAA3B,CAAX;AAAA,CA7Ec,EAiFzB,UAACT,KAAD,EAAW;AACX,MAAIA,KAAK,CAACiB,QAAV,EAAoB;AAClB,WAAOC,UAAP,+BACMvB,uBADN,EAEkB,UAACwB,WAAD;AAAA,aAAiBA,WAAW,CAACjB,KAAZ,CAAkBC,MAAlB,CAAyBC,KAAzB,CAA+B,GAA/B,CAAjB;AAAA,KAFlB;AAKD;;AACD,SAAO,EAAP;AACD,CA1F0B;IA6FhBgB,aAAa,gBAAGxB,0BAAM,CAACC,WAAD,CAAT;AAAA;AAAA;;;;;;;;;;;"}
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ChatBubble } from './parts/bubble/ChatBubble.js';
|
|
1
|
+
export { ChatBubble, ChatBubbleWithSchema } from './parts/bubble/ChatBubble.js';
|
|
2
2
|
export { BUBBLE_TYPES } from './parts/bubble/props.js';
|
|
3
3
|
export { FloatingButton } from './parts/floating-button/FloatingButton.js';
|
|
4
4
|
export { StyledFloatingContainer } from './parts/floating-container/styled.js';
|
|
@@ -13,13 +13,15 @@ export { MessageDelimiter, MessageDelimiterWithSchema } from './parts/message-de
|
|
|
13
13
|
export { SystemMessage, SystemMessageWithSchema } from './parts/system-message/SystemMessage.js';
|
|
14
14
|
export { ChatCard, ChatCardWithSchema } from './parts/chat-card/ChatCard.js';
|
|
15
15
|
import 'react';
|
|
16
|
+
import 'react-desc';
|
|
16
17
|
import '@elliemae/ds-icons/WarningCircleFill';
|
|
17
18
|
import './parts/bubble/styled.js';
|
|
18
19
|
import 'styled-components';
|
|
19
20
|
import '@elliemae/ds-grid';
|
|
20
21
|
import 'prop-types';
|
|
21
|
-
import 'react-desc';
|
|
22
22
|
import 'lodash';
|
|
23
|
+
import './parts/bubble/config/useValidateProps.js';
|
|
24
|
+
import '@elliemae/ds-props-helpers';
|
|
23
25
|
import './parts/bubble/ChatBubbleArrow.js';
|
|
24
26
|
import '@elliemae/ds-icons/Comments';
|
|
25
27
|
import './parts/floating-button/styled.js';
|
|
@@ -28,21 +30,27 @@ import './styled.js';
|
|
|
28
30
|
import '@elliemae/ds-truncated-tooltip-text';
|
|
29
31
|
import './parts/chat-container-header/styled.js';
|
|
30
32
|
import '@elliemae/ds-icons/Communications';
|
|
33
|
+
import './parts/chat-empty-state/props.js';
|
|
31
34
|
import './parts/chat-empty-state/styled.js';
|
|
35
|
+
import './parts/chat-empty-state/config/useValidateProps.js';
|
|
32
36
|
import '@babel/runtime/helpers/esm/extends';
|
|
33
37
|
import '@babel/runtime/helpers/esm/defineProperty';
|
|
34
38
|
import 'react-virtual';
|
|
35
39
|
import '@elliemae/ds-basic/Button';
|
|
36
40
|
import './parts/chat-container-messages-list/styled.js';
|
|
37
41
|
import './parts/chat-container-messages-list/props.js';
|
|
42
|
+
import './parts/chat-container-messages-list/config/useValidateProps.js';
|
|
38
43
|
import './parts/message-delimiter/styled.js';
|
|
39
44
|
import './parts/message-delimiter/props.js';
|
|
45
|
+
import './parts/message-delimiter/config/useValidateProps.js';
|
|
40
46
|
import './parts/system-message/style.js';
|
|
41
47
|
import './parts/system-message/props.js';
|
|
48
|
+
import './parts/system-message/config/useValidateProps.js';
|
|
42
49
|
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
43
50
|
import '@elliemae/ds-icons/PaperAirplane';
|
|
44
51
|
import './parts/chat-composer/styled.js';
|
|
45
52
|
import '@elliemae/ds-button';
|
|
53
|
+
import './parts/chat-composer/config/useValidateProps.js';
|
|
46
54
|
import './parts/chat-composer/props.js';
|
|
47
55
|
import '@elliemae/ds-icons/MenuExpand';
|
|
48
56
|
import '@elliemae/ds-icons/MenuCollapse';
|
|
@@ -52,14 +60,18 @@ import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
|
52
60
|
import './parts/sidebar-button/styled.js';
|
|
53
61
|
import './parts/sidebar-button/props.js';
|
|
54
62
|
import './parts/chat-sidebar/props.js';
|
|
63
|
+
import './parts/chat-sidebar/config/useValidateProps.js';
|
|
55
64
|
import '@elliemae/ds-tooltip';
|
|
56
65
|
import '@elliemae/ds-icons/CloseXsmall';
|
|
57
66
|
import './parts/tile-button/styled.js';
|
|
58
67
|
import './parts/tile-button/props.js';
|
|
68
|
+
import './parts/tile-button/config/useValidateProps.js';
|
|
59
69
|
import '@elliemae/ds-basic/IndeterminateProgressIndicator';
|
|
60
70
|
import '@elliemae/ds-banner';
|
|
61
71
|
import './parts/chat-container/props.js';
|
|
62
72
|
import './parts/chat-container/styled.js';
|
|
73
|
+
import './parts/chat-container/config/useValidateProps.js';
|
|
63
74
|
import './parts/chat-card/props.js';
|
|
75
|
+
import './parts/chat-card/config/useValidateProps.js';
|
|
64
76
|
import './parts/chat-card/styled.js';
|
|
65
77
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { describe } from 'react-desc';
|
|
2
3
|
import Warning from '@elliemae/ds-icons/WarningCircleFill';
|
|
3
4
|
import { StyledWrapper, StyledColoredBubble, StyledTitleBubble, StyledTitleLeftBubble, StyledTitleRightBubble, StyleBodyWrapper, StyleErrorMessage, StyleHelpMessage } from './styled.js';
|
|
4
5
|
import { propsBubbles } from './props.js';
|
|
6
|
+
import { useValidateProps } from './config/useValidateProps.js';
|
|
5
7
|
import { ChatBubbleArrow } from './ChatBubbleArrow.js';
|
|
6
8
|
import 'styled-components';
|
|
7
9
|
import '@elliemae/ds-grid';
|
|
8
10
|
import 'prop-types';
|
|
9
|
-
import 'react-desc';
|
|
10
11
|
import 'lodash';
|
|
12
|
+
import '@elliemae/ds-props-helpers';
|
|
11
13
|
|
|
12
14
|
var ChatBubble = function ChatBubble(props) {
|
|
15
|
+
useValidateProps(props, ChatBubbleWithSchema.toJSON());
|
|
13
16
|
var dsId = props.dsId,
|
|
14
17
|
type = props.type,
|
|
15
18
|
title = props.title,
|
|
@@ -50,7 +53,10 @@ var ChatBubble = function ChatBubble(props) {
|
|
|
50
53
|
cols: [1, 'auto']
|
|
51
54
|
}, /*#__PURE__*/React.createElement("span", null, helpMessage)) : null);
|
|
52
55
|
};
|
|
56
|
+
|
|
53
57
|
ChatBubble.propTypes = propsBubbles;
|
|
58
|
+
var ChatBubbleWithSchema = describe(ChatBubble);
|
|
59
|
+
ChatBubbleWithSchema.propTypes = propsBubbles;
|
|
54
60
|
|
|
55
|
-
export { ChatBubble };
|
|
61
|
+
export { ChatBubble, ChatBubbleWithSchema };
|
|
56
62
|
//# sourceMappingURL=ChatBubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\
|
|
1
|
+
{"version":3,"file":"ChatBubble.js","sources":["../../../../src/parts/bubble/ChatBubble.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport Warning from '@elliemae/ds-icons/WarningCircleFill';\nimport {\n StyledWrapper,\n StyledColoredBubble,\n StyledTitleBubble,\n StyledTitleLeftBubble,\n StyledTitleRightBubble,\n StyleBodyWrapper,\n StyleErrorMessage,\n StyleHelpMessage,\n} from './styled';\nimport { propsBubbles, BubbleProps } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { ChatBubbleArrow } from './ChatBubbleArrow';\n\nconst ChatBubble = (props: BubbleProps): JSX.Element => {\n useValidateProps(props, ChatBubbleWithSchema.toJSON());\n\n const { dsId, type, title, time, body, errorMessage, helpMessage } = props;\n return (\n <StyledWrapper data-testid={`ds-chat-bubble-${dsId}`} type={type}>\n <StyledColoredBubble type={type}>\n <StyledTitleBubble cols={[1, 'auto']} gutter=\"xs\" alignItems=\"flex-end\" className=\"sr-only\">\n <StyledTitleLeftBubble alignItems=\"center\" data-testid={`chat-bubble-title-${dsId}`}>\n {title}\n </StyledTitleLeftBubble>\n <StyledTitleRightBubble alignItems=\"center\" type={type} data-testid={`chat-bubble-time-${dsId}`}>\n {time}\n </StyledTitleRightBubble>\n </StyledTitleBubble>\n <StyleBodyWrapper data-testid={`chat-bubble-body-${dsId}`}>{body}</StyleBodyWrapper>\n <ChatBubbleArrow type={type} />\n </StyledColoredBubble>\n {errorMessage ? (\n <StyleErrorMessage data-testid={`chat-bubble-error-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{errorMessage}</span>\n <Warning />\n </StyleErrorMessage>\n ) : null}\n {helpMessage ? (\n <StyleHelpMessage data-testid={`chat-bubble-help-message-${dsId}`} p=\"xxs\" gutter=\"xxs\" cols={[1, 'auto']}>\n <span>{helpMessage}</span>\n </StyleHelpMessage>\n ) : null}\n </StyledWrapper>\n );\n};\nChatBubble.propTypes = propsBubbles;\n\nconst ChatBubbleWithSchema = describe(ChatBubble);\nChatBubbleWithSchema.propTypes = propsBubbles;\n\nexport { ChatBubble, ChatBubbleWithSchema };\n"],"names":["ChatBubble","props","useValidateProps","ChatBubbleWithSchema","toJSON","dsId","type","title","time","body","errorMessage","helpMessage","propTypes","propsBubbles","describe"],"mappings":";;;;;;;;;;;;;IAiBMA,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAqC;AACtDC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,oBAAoB,CAACC,MAArB,EAAR,CAAhB;AAEA,MAAQC,IAAR,GAAqEJ,KAArE,CAAQI,IAAR;AAAA,MAAcC,IAAd,GAAqEL,KAArE,CAAcK,IAAd;AAAA,MAAoBC,KAApB,GAAqEN,KAArE,CAAoBM,KAApB;AAAA,MAA2BC,IAA3B,GAAqEP,KAArE,CAA2BO,IAA3B;AAAA,MAAiCC,IAAjC,GAAqER,KAArE,CAAiCQ,IAAjC;AAAA,MAAuCC,YAAvC,GAAqET,KAArE,CAAuCS,YAAvC;AAAA,MAAqDC,WAArD,GAAqEV,KAArE,CAAqDU,WAArD;AACA,sBACE,oBAAC,aAAD;AAAe,4CAA+BN,IAA/B,CAAf;AAAsD,IAAA,IAAI,EAAEC;AAA5D,kBACE,oBAAC,mBAAD;AAAqB,IAAA,IAAI,EAAEA;AAA3B,kBACE,oBAAC,iBAAD;AAAmB,IAAA,IAAI,EAA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
+
var throwError = function throwError(message) {
|
|
4
|
+
throw new Error("Bubble:: ".concat(message, "\n "));
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
var useValidateProps = function useValidateProps(props, schema) {
|
|
8
|
+
useValidatePropTypes(props, schema);
|
|
9
|
+
|
|
10
|
+
if (typeof props.title === 'undefined') {
|
|
11
|
+
throwError("Please provide a title property to use this component.");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (typeof props.time === 'undefined') {
|
|
15
|
+
throwError("Please provide a time property to use this component.");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof props.body === 'undefined') {
|
|
19
|
+
throwError("Please provide a body property to use this component.");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (typeof props.type === 'undefined') {
|
|
23
|
+
throwError("Please provide a type property to use this component.");
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { useValidateProps };
|
|
28
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/bubble/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { BubbleProps } from '../props';\n\nconst throwError = (message: string): void => {\n throw new Error(\n `Bubble:: ${message}\n `,\n );\n};\n\nexport const useValidateProps = (props: BubbleProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n if (typeof props.title === 'undefined') {\n throwError(`Please provide a title property to use this component.`);\n }\n if (typeof props.time === 'undefined') {\n throwError(`Please provide a time property to use this component.`);\n }\n if (typeof props.body === 'undefined') {\n throwError(`Please provide a body property to use this component.`);\n }\n if (typeof props.type === 'undefined') {\n throwError(`Please provide a type property to use this component.`);\n }\n};\n"],"names":["throwError","message","Error","useValidateProps","props","schema","useValidatePropTypes","title","time","body","type"],"mappings":";;AAGA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAACC,OAAD,EAA2B;AAC5C,QAAM,IAAIC,KAAJ,oBACQD,OADR,UAAN;AAID,CALD;;IAOaE,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAqBC,MAArB,EAA+C;AAC7EC,EAAAA,oBAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;;AACA,MAAI,OAAOD,KAAK,CAACG,KAAb,KAAuB,WAA3B,EAAwC;AACtCP,IAAAA,UAAU,0DAAV;AACD;;AACD,MAAI,OAAOI,KAAK,CAACI,IAAb,KAAsB,WAA1B,EAAuC;AACrCR,IAAAA,UAAU,yDAAV;AACD;;AACD,MAAI,OAAOI,KAAK,CAACK,IAAb,KAAsB,WAA1B,EAAuC;AACrCT,IAAAA,UAAU,yDAAV;AACD;;AACD,MAAI,OAAOI,KAAK,CAACM,IAAb,KAAsB,WAA1B,EAAuC;AACrCV,IAAAA,UAAU,yDAAV;AACD;AACF;;;;"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
export { ChatBubble } from './ChatBubble.js';
|
|
1
|
+
export { ChatBubble, ChatBubbleWithSchema } from './ChatBubble.js';
|
|
2
2
|
export { BUBBLE_TYPES } from './props.js';
|
|
3
3
|
import 'react';
|
|
4
|
+
import 'react-desc';
|
|
4
5
|
import '@elliemae/ds-icons/WarningCircleFill';
|
|
5
6
|
import './styled.js';
|
|
6
7
|
import 'styled-components';
|
|
7
8
|
import '@elliemae/ds-grid';
|
|
8
9
|
import 'prop-types';
|
|
9
|
-
import 'react-desc';
|
|
10
10
|
import 'lodash';
|
|
11
|
+
import './config/useValidateProps.js';
|
|
12
|
+
import '@elliemae/ds-props-helpers';
|
|
11
13
|
import './ChatBubbleArrow.js';
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -25,10 +25,10 @@ var defaultBubbleProps = {
|
|
|
25
25
|
};
|
|
26
26
|
var propsBubbles = {
|
|
27
27
|
dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Unique id for bubble').defaultValue(defaultBubbleProps.dsId),
|
|
28
|
-
type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).description('Define bubble type ').defaultValue(defaultBubbleProps.type),
|
|
29
|
-
title: PropTypes.string.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
|
|
30
|
-
time: PropTypes.string.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
|
|
31
|
-
body: PropTypes.string.description('Bubble content').defaultValue(defaultBubbleProps.body),
|
|
28
|
+
type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]).isRequired.description('Define bubble type ').defaultValue(defaultBubbleProps.type),
|
|
29
|
+
title: PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),
|
|
30
|
+
time: PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),
|
|
31
|
+
body: PropTypes.oneOf(['string', 'element']).isRequired.description('Bubble content').defaultValue(defaultBubbleProps.body),
|
|
32
32
|
onClick: PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),
|
|
33
33
|
errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Error message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick),
|
|
34
34
|
helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).description('Help message to display at bottom of the bubble').defaultValue(defaultBubbleProps.onClick)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/bubble/props.ts"],"sourcesContent":["import propTypes from 'prop-types';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport React from 'react';\n\n/**\n *\n * BUBBLE\n *\n */\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n};\n\nexport type BubbleTypesKeys = keyof typeof BUBBLE_TYPES;\nexport type BubbleTypesValues = typeof BUBBLE_TYPES[BubbleTypesKeys];\n\nexport interface BubbleProps {\n dsId: string | number;\n type: BubbleTypesValues;\n title: string;\n body: string;\n time: string;\n errorMessage: string | React.ReactChild;\n helpMessage: string | React.ReactChild;\n onClick: (id: string | number) => void;\n}\n\nexport const defaultBubbleProps: BubbleProps = {\n dsId: undefined,\n type: BUBBLE_TYPES.SENDER,\n title: undefined,\n time: undefined,\n body: undefined,\n onClick: noop,\n errorMessage: undefined,\n helpMessage: undefined,\n};\n\nexport const propsBubbles = {\n dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .description('Unique id for bubble')\n .defaultValue(defaultBubbleProps.dsId),\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER])\n .description('Define bubble type ')\n .defaultValue(defaultBubbleProps.type),\n title: PropTypes.string.description('Title of the bubble').defaultValue(defaultBubbleProps.title),\n time: PropTypes.string.description('Time of the bubble').defaultValue(defaultBubbleProps.title),\n body: PropTypes.string.description('Bubble content').defaultValue(defaultBubbleProps.body),\n onClick: PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),\n errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Error message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Help message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n};\n\n/**\n *\n * BUBBLE ARROW\n *\n */\nexport const propsArrowBubble = {\n type: propTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]),\n};\n"],"names":["BUBBLE_TYPES","SENDER","RECIPIENT","DELIMITER","SYSTEM","defaultBubbleProps","dsId","undefined","type","title","time","body","onClick","noop","errorMessage","helpMessage","propsBubbles","PropTypes","oneOfType","string","number","description","defaultValue","oneOf","element","propsArrowBubble","propTypes"],"mappings":";;;;AAKA;AACA;AACA;AACA;AACA;IACaA,YAAY,GAAG;AAC1BC,EAAAA,MAAM,EAAE,QADkB;AAE1BC,EAAAA,SAAS,EAAE,WAFe;AAG1BC,EAAAA,SAAS,EAAE,WAHe;AAI1BC,EAAAA,MAAM,EAAE;AAJkB;IAqBfC,kBAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAEC,SADuC;AAE7CC,EAAAA,IAAI,EAAER,YAAY,CAACC,MAF0B;AAG7CQ,EAAAA,KAAK,EAAEF,SAHsC;AAI7CG,EAAAA,IAAI,EAAEH,SAJuC;AAK7CI,EAAAA,IAAI,EAAEJ,SALuC;AAM7CK,EAAAA,OAAO,EAAEC,IANoC;AAO7CC,EAAAA,YAAY,EAAEP,SAP+B;AAQ7CQ,EAAAA,WAAW,EAAER;AARgC;IAWlCS,YAAY,GAAG;AAC1BV,EAAAA,IAAI,EAAEW,SAAS,CAACC,SAAV,CAAoB,CAACD,SAAS,CAACE,MAAX,EAAmBF,SAAS,CAACG,MAA7B,CAApB,EACHC,WADG,CACS,sBADT,EAEHC,YAFG,CAEUjB,kBAAkB,CAACC,IAF7B,CADoB;AAI1BE,EAAAA,IAAI,EAAES,SAAS,CAACM,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB,
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/bubble/props.ts"],"sourcesContent":["import propTypes from 'prop-types';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\nimport React from 'react';\n\n/**\n *\n * BUBBLE\n *\n */\nexport const BUBBLE_TYPES = {\n SENDER: 'SENDER',\n RECIPIENT: 'RECIPIENT',\n DELIMITER: 'DELIMITER',\n SYSTEM: 'SYSTEM',\n};\n\nexport type BubbleTypesKeys = keyof typeof BUBBLE_TYPES;\nexport type BubbleTypesValues = typeof BUBBLE_TYPES[BubbleTypesKeys];\n\nexport interface BubbleProps {\n dsId: string | number;\n type: BubbleTypesValues;\n title: string;\n body: string;\n time: string;\n errorMessage: string | React.ReactChild;\n helpMessage: string | React.ReactChild;\n onClick: (id: string | number) => void;\n}\n\nexport const defaultBubbleProps: BubbleProps = {\n dsId: undefined,\n type: BUBBLE_TYPES.SENDER,\n title: undefined,\n time: undefined,\n body: undefined,\n onClick: noop,\n errorMessage: undefined,\n helpMessage: undefined,\n};\n\nexport const propsBubbles = {\n dsId: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n .description('Unique id for bubble')\n .defaultValue(defaultBubbleProps.dsId),\n type: PropTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER])\n .isRequired.description('Define bubble type ')\n .defaultValue(defaultBubbleProps.type),\n title: PropTypes.string.isRequired.description('Title of the bubble').defaultValue(defaultBubbleProps.title),\n time: PropTypes.string.isRequired.description('Time of the bubble').defaultValue(defaultBubbleProps.title),\n body: PropTypes.oneOf(['string', 'element'])\n .isRequired.description('Bubble content')\n .defaultValue(defaultBubbleProps.body),\n onClick: PropTypes.string.description('Callback when the bubble is tapped').defaultValue(defaultBubbleProps.onClick),\n errorMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Error message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n helpMessage: PropTypes.oneOfType([PropTypes.string, PropTypes.element])\n .description('Help message to display at bottom of the bubble')\n .defaultValue(defaultBubbleProps.onClick),\n};\n\n/**\n *\n * BUBBLE ARROW\n *\n */\nexport const propsArrowBubble = {\n type: propTypes.oneOf([BUBBLE_TYPES.RECIPIENT, BUBBLE_TYPES.SENDER]),\n};\n"],"names":["BUBBLE_TYPES","SENDER","RECIPIENT","DELIMITER","SYSTEM","defaultBubbleProps","dsId","undefined","type","title","time","body","onClick","noop","errorMessage","helpMessage","propsBubbles","PropTypes","oneOfType","string","number","description","defaultValue","oneOf","isRequired","element","propsArrowBubble","propTypes"],"mappings":";;;;AAKA;AACA;AACA;AACA;AACA;IACaA,YAAY,GAAG;AAC1BC,EAAAA,MAAM,EAAE,QADkB;AAE1BC,EAAAA,SAAS,EAAE,WAFe;AAG1BC,EAAAA,SAAS,EAAE,WAHe;AAI1BC,EAAAA,MAAM,EAAE;AAJkB;IAqBfC,kBAA+B,GAAG;AAC7CC,EAAAA,IAAI,EAAEC,SADuC;AAE7CC,EAAAA,IAAI,EAAER,YAAY,CAACC,MAF0B;AAG7CQ,EAAAA,KAAK,EAAEF,SAHsC;AAI7CG,EAAAA,IAAI,EAAEH,SAJuC;AAK7CI,EAAAA,IAAI,EAAEJ,SALuC;AAM7CK,EAAAA,OAAO,EAAEC,IANoC;AAO7CC,EAAAA,YAAY,EAAEP,SAP+B;AAQ7CQ,EAAAA,WAAW,EAAER;AARgC;IAWlCS,YAAY,GAAG;AAC1BV,EAAAA,IAAI,EAAEW,SAAS,CAACC,SAAV,CAAoB,CAACD,SAAS,CAACE,MAAX,EAAmBF,SAAS,CAACG,MAA7B,CAApB,EACHC,WADG,CACS,sBADT,EAEHC,YAFG,CAEUjB,kBAAkB,CAACC,IAF7B,CADoB;AAI1BE,EAAAA,IAAI,EAAES,SAAS,CAACM,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB,EACHuB,UADG,CACQH,WADR,CACoB,qBADpB,EAEHC,YAFG,CAEUjB,kBAAkB,CAACG,IAF7B,CAJoB;AAO1BC,EAAAA,KAAK,EAAEQ,SAAS,CAACE,MAAV,CAAiBK,UAAjB,CAA4BH,WAA5B,CAAwC,qBAAxC,EAA+DC,YAA/D,CAA4EjB,kBAAkB,CAACI,KAA/F,CAPmB;AAQ1BC,EAAAA,IAAI,EAAEO,SAAS,CAACE,MAAV,CAAiBK,UAAjB,CAA4BH,WAA5B,CAAwC,oBAAxC,EAA8DC,YAA9D,CAA2EjB,kBAAkB,CAACI,KAA9F,CARoB;AAS1BE,EAAAA,IAAI,EAAEM,SAAS,CAACM,KAAV,CAAgB,CAAC,QAAD,EAAW,SAAX,CAAhB,EACHC,UADG,CACQH,WADR,CACoB,gBADpB,EAEHC,YAFG,CAEUjB,kBAAkB,CAACM,IAF7B,CAToB;AAY1BC,EAAAA,OAAO,EAAEK,SAAS,CAACE,MAAV,CAAiBE,WAAjB,CAA6B,oCAA7B,EAAmEC,YAAnE,CAAgFjB,kBAAkB,CAACO,OAAnG,CAZiB;AAa1BE,EAAAA,YAAY,EAAEG,SAAS,CAACC,SAAV,CAAoB,CAACD,SAAS,CAACE,MAAX,EAAmBF,SAAS,CAACQ,OAA7B,CAApB,EACXJ,WADW,CACC,kDADD,EAEXC,YAFW,CAEEjB,kBAAkB,CAACO,OAFrB,CAbY;AAgB1BG,EAAAA,WAAW,EAAEE,SAAS,CAACC,SAAV,CAAoB,CAACD,SAAS,CAACE,MAAX,EAAmBF,SAAS,CAACQ,OAA7B,CAApB,EACVJ,WADU,CACE,iDADF,EAEVC,YAFU,CAEGjB,kBAAkB,CAACO,OAFtB;AAhBa;AAqB5B;AACA;AACA;AACA;AACA;;IACac,gBAAgB,GAAG;AAC9BlB,EAAAA,IAAI,EAAEmB,UAAS,CAACJ,KAAV,CAAgB,CAACvB,YAAY,CAACE,SAAd,EAAyBF,YAAY,CAACC,MAAtC,CAAhB;AADwB;;;;"}
|
|
@@ -54,7 +54,7 @@ var StyledBubbleArrow = /*#__PURE__*/styled.div.withConfig({
|
|
|
54
54
|
var StyledColoredBubble = /*#__PURE__*/styled.div.withConfig({
|
|
55
55
|
componentId: "sc-fe8e9o-8"
|
|
56
56
|
})(["min-width:224px;border-radius:10px;position:relative;", ""], function (props) {
|
|
57
|
-
return props.type === BUBBLE_TYPES.SENDER ? "\n border: 1px solid ".concat(props.theme.colors.brand['700'], ";\n background: ").concat(props.theme.colors.brand[600], ";\n color: ").concat(props.theme.colors.neutral['000'], ";\n ").concat(StyledBubbleArrow, "{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ").concat(props.theme.colors.brand[600], ";\n }\n }\n\n ") : "\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ".concat(props.theme.colors.neutral['000'], ";\n color: ").concat(props.theme.colors.neutral[700], ";\n\n ").concat(StyledBubbleArrow, "{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ").concat(props.theme.colors.neutral['000'], ";\n }\n }\n\n ");
|
|
57
|
+
return props.type === BUBBLE_TYPES.SENDER ? "\n border: 1px solid ".concat(props.theme.colors.brand['700'], ";\n background: ").concat(props.theme.colors.brand[600], ";\n color: ").concat(props.theme.colors.neutral['000'], ";\n ").concat(StyledBubbleArrow, "{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ").concat(props.theme.colors.brand[600], ";\n }\n }\n\n a {\n color: #FFF;\n }\n\n ") : "\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ".concat(props.theme.colors.neutral['000'], ";\n color: ").concat(props.theme.colors.neutral[700], ";\n\n ").concat(StyledBubbleArrow, "{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ").concat(props.theme.colors.neutral['000'], ";\n }\n }\n\n ");
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
export { StyleBodyWrapper, StyleErrorMessage, StyleHelpMessage, StyledBubbleArrow, StyledColoredBubble, StyledTitleBubble, StyledTitleLeftBubble, StyledTitleRightBubble, StyledWrapper };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/parts/bubble/styled.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES } from './props';\n\n// Bubble WRAPPER\nexport const StyledWrapper = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n`;\n\n// Bubble HEADER\nexport const StyledTitleBubble = styled(Grid)`\n padding-top: 6px;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 4px;\n`;\n\nexport const StyledTitleLeftBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 600;\n`;\nexport const StyledTitleRightBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 400;\n color: ${(props) => (props.type === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489')};\n`;\n\nexport const StyleBodyWrapper = styled.div<any>`\n font-size: 13px;\n font-weight: 400;\n line-height: 15px;\n min-height: 32px;\n padding: 0px 10px 8px 10px;\n`;\n\nexport const StyleErrorMessage = styled.div<any>`\n font-size: 12px;\n font-weight: 400;\n padding-top: ${(props) => props.theme.space.xxxs};\n padding-bottom: ${(props) => props.theme.space.xxxs};\n color: ${(props) => props.theme.colors.danger[900]};\n align-items: flex-end;\n justify-content: center;\n text-align: right;\n line-height: 15px;\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n .em-ds-icon {\n margin-left: 8px;\n }\n`;\n\nexport const StyleHelpMessage = styled(StyleErrorMessage)`\n font-size: 12px;\n line-height: 15px;\n color: ${(props) => props.theme.colors.neutral[500]};\n svg {\n fill: ${(props) => props.theme.colors.danger[500]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[500]};\n }\n`;\n\n// bubble sender/ recipient\nexport const StyledBubbleArrow = styled.div<any>`\n display: block;\n content: '';\n position: absolute;\n bottom: 10px;\n height: 15px;\n`;\n\nexport const StyledColoredBubble = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n position: relative;\n\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER\n ? `\n border: 1px solid ${props.theme.colors.brand['700']};\n background: ${props.theme.colors.brand[600]};\n color: ${props.theme.colors.neutral['000']};\n ${StyledBubbleArrow}{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.brand[600]};\n }\n }\n\n `\n : `\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ${props.theme.colors.neutral['000']};\n color: ${props.theme.colors.neutral[700]};\n\n ${StyledBubbleArrow}{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.neutral['000']};\n }\n }\n\n `}\n`;\n"],"names":["StyledWrapper","styled","div","StyledTitleBubble","Grid","StyledTitleLeftBubble","StyledTitleRightBubble","props","type","BUBBLE_TYPES","SENDER","StyleBodyWrapper","StyleErrorMessage","theme","space","xxxs","colors","danger","StyleHelpMessage","neutral","StyledBubbleArrow","StyledColoredBubble","brand"],"mappings":";;;;;;;AAAA;;IAMaA,aAAa,gBAAGC,MAAM,CAACC,GAAV;AAAA;AAAA;;IAMbC,iBAAiB,gBAAGF,MAAM,CAACG,IAAD,CAAT;AAAA;AAAA;IAOjBC,qBAAqB,gBAAGJ,MAAM,CAACG,IAAD,CAAT;AAAA;AAAA;IAIrBE,sBAAsB,gBAAGL,MAAM,CAACG,IAAD,CAAT;AAAA;AAAA,mDAGxB,UAACG,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeC,YAAY,CAACC,MAA5B,GAAqC,MAArC,GAA8C,SAA1D;AAAA,CAHwB;IAMtBC,gBAAgB,gBAAGV,MAAM,CAACC,GAAV;AAAA;AAAA;IAQhBU,iBAAiB,gBAAGX,MAAM,CAACC,GAAV;AAAA;AAAA,+OAGb,UAACK,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,IAA7B;AAAA,CAHa,EAIV,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,IAA7B;AAAA,CAJU,EAKnB,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBC,MAAnB,CAA0B,GAA1B,CAAX;AAAA,CALmB,EAWlB,UAACV,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBC,MAAnB,CAA0B,GAA1B,CAAX;AAAA,CAXkB,EAejB,UAACV,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBC,MAAnB,CAA0B,GAA1B,CAAX;AAAA,CAfiB;IAsBjBC,gBAAgB,gBAAGjB,MAAM,CAACW,iBAAD,CAAT;AAAA;AAAA,gGAGlB,UAACL,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,GAA3B,CAAX;AAAA,CAHkB,EAKjB,UAACZ,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBC,MAAnB,CAA0B,GAA1B,CAAX;AAAA,CALiB,EAShB,UAACV,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBC,MAAnB,CAA0B,GAA1B,CAAX;AAAA,CATgB;;IAchBG,iBAAiB,gBAAGnB,MAAM,CAACC,GAAV;AAAA;AAAA;IAQjBmB,mBAAmB,gBAAGpB,MAAM,CAACC,GAAV;AAAA;AAAA,kEAK5B,UAACK,KAAD;AAAA,SACAA,KAAK,CAACC,IAAN,KAAeC,YAAY,CAACC,MAA5B,yCAEwBH,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBM,KAAnB,CAAyB,KAAzB,CAFxB,oCAGkBf,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBM,KAAnB,CAAyB,GAAzB,CAHlB,+BAIaf,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CAJb,wBAKMC,iBALN,wHASoBb,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBM,KAAnB,CAAyB,GAAzB,CATpB,
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../src/parts/bubble/styled.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { BUBBLE_TYPES } from './props';\n\n// Bubble WRAPPER\nexport const StyledWrapper = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n`;\n\n// Bubble HEADER\nexport const StyledTitleBubble = styled(Grid)`\n padding-top: 6px;\n padding-left: 10px;\n padding-right: 10px;\n padding-bottom: 4px;\n`;\n\nexport const StyledTitleLeftBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 600;\n`;\nexport const StyledTitleRightBubble = styled(Grid)`\n font-size: 13px;\n font-weight: 400;\n color: ${(props) => (props.type === BUBBLE_TYPES.SENDER ? '#FFF' : '#657489')};\n`;\n\nexport const StyleBodyWrapper = styled.div<any>`\n font-size: 13px;\n font-weight: 400;\n line-height: 15px;\n min-height: 32px;\n padding: 0px 10px 8px 10px;\n`;\n\nexport const StyleErrorMessage = styled.div<any>`\n font-size: 12px;\n font-weight: 400;\n padding-top: ${(props) => props.theme.space.xxxs};\n padding-bottom: ${(props) => props.theme.space.xxxs};\n color: ${(props) => props.theme.colors.danger[900]};\n align-items: flex-end;\n justify-content: center;\n text-align: right;\n line-height: 15px;\n svg {\n fill: ${(props) => props.theme.colors.danger[900]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[900]};\n }\n .em-ds-icon {\n margin-left: 8px;\n }\n`;\n\nexport const StyleHelpMessage = styled(StyleErrorMessage)`\n font-size: 12px;\n line-height: 15px;\n color: ${(props) => props.theme.colors.neutral[500]};\n svg {\n fill: ${(props) => props.theme.colors.danger[500]};\n }\n a {\n font-size: 12px;\n color: ${(props) => props.theme.colors.danger[500]};\n }\n`;\n\n// bubble sender/ recipient\nexport const StyledBubbleArrow = styled.div<any>`\n display: block;\n content: '';\n position: absolute;\n bottom: 10px;\n height: 15px;\n`;\n\nexport const StyledColoredBubble = styled.div<any>`\n min-width: 224px;\n border-radius: 10px;\n position: relative;\n\n ${(props) =>\n props.type === BUBBLE_TYPES.SENDER\n ? `\n border: 1px solid ${props.theme.colors.brand['700']};\n background: ${props.theme.colors.brand[600]};\n color: ${props.theme.colors.neutral['000']};\n ${StyledBubbleArrow}{ \n right: -9px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.brand[600]};\n }\n }\n\n a {\n color: #FFF;\n }\n\n `\n : `\n box-shadow: 0 1px 3px 0 rgba(53,60,70,0.80);\n background: ${props.theme.colors.neutral['000']};\n color: ${props.theme.colors.neutral[700]};\n\n ${StyledBubbleArrow}{ \n left: -11px;\n bottom: 6px;\n svg{\n fill: ${props.theme.colors.neutral['000']};\n }\n }\n\n `}\n`;\n"],"names":["StyledWrapper","styled","div","StyledTitleBubble","Grid","StyledTitleLeftBubble","StyledTitleRightBubble","props","type","BUBBLE_TYPES","SENDER","StyleBodyWrapper","StyleErrorMessage","theme","space","xxxs","colors","danger","StyleHelpMessage","neutral","StyledBubbleArrow","StyledColoredBubble","brand"],"mappings":";;;;;;;AAAA;;IAMaA,aAAa,gBAAGC,MAAM,CAACC,GAAV;AAAA;AAAA;;IAMbC,iBAAiB,gBAAGF,MAAM,CAACG,IAAD,CAAT;AAAA;AAAA;IAOjBC,qBAAqB,gBAAGJ,MAAM,CAACG,IAAD,CAAT;AAAA;AAAA;IAIrBE,sBAAsB,gBAAGL,MAAM,CAACG,IAAD,CAAT;AAAA;AAAA,mDAGxB,UAACG,KAAD;AAAA,SAAYA,KAAK,CAACC,IAAN,KAAeC,YAAY,CAACC,MAA5B,GAAqC,MAArC,GAA8C,SAA1D;AAAA,CAHwB;IAMtBC,gBAAgB,gBAAGV,MAAM,CAACC,GAAV;AAAA;AAAA;IAQhBU,iBAAiB,gBAAGX,MAAM,CAACC,GAAV;AAAA;AAAA,+OAGb,UAACK,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,IAA7B;AAAA,CAHa,EAIV,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,CAAYC,KAAZ,CAAkBC,IAA7B;AAAA,CAJU,EAKnB,UAACR,KAAD;AAAA,SAAWA,KAAK,CAACM,KAAN,C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AACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CApBlB,+BAqBaZ,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,GAA3B,CArBb,0BAuBMC,iBAvBN,wHA2BoBb,KAAK,CAACM,KAAN,CAAYG,MAAZ,CAAmBG,OAAnB,CAA2B,KAA3B,CA3BpB,wCADA;AAAA,CAL4B;;;;"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { describe } from 'react-desc';
|
|
3
|
-
import { propTypes } from './props.js';
|
|
4
3
|
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
4
|
+
import { propTypes } from './props.js';
|
|
5
|
+
import { useValidateProps } from './config/useValidateProps.js';
|
|
5
6
|
import { Wrapper, MainContent, Title, Content, Time, RightAddon } from './styled.js';
|
|
7
|
+
import '@elliemae/ds-props-helpers';
|
|
6
8
|
import 'styled-components';
|
|
7
9
|
import '@elliemae/ds-grid';
|
|
8
10
|
|
|
9
|
-
var ChatCard = function ChatCard(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var ChatCard = function ChatCard(props) {
|
|
12
|
+
useValidateProps(props, ChatCardWithSchema.toJSON());
|
|
13
|
+
var title = props.title,
|
|
14
|
+
content = props.content,
|
|
15
|
+
time = props.time,
|
|
16
|
+
rightAddon = props.rightAddon;
|
|
14
17
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
15
18
|
cols: ['1fr', 'auto'],
|
|
16
19
|
"data-testid": "chat-card-wrapper"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatCard.js","sources":["../../../../src/parts/chat-card/ChatCard.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\nimport { propTypes, CardPropTypes } from './props';\nimport {
|
|
1
|
+
{"version":3,"file":"ChatCard.js","sources":["../../../../src/parts/chat-card/ChatCard.tsx"],"sourcesContent":["import React from 'react';\nimport { describe } from 'react-desc';\n\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { propTypes, CardPropTypes } from './props';\nimport { useValidateProps } from './config/useValidateProps';\nimport { Wrapper, MainContent, Title, Content, Time, RightAddon } from './styled';\n\nconst ChatCard = (props: CardPropTypes): JSX.Element => {\n useValidateProps(props, ChatCardWithSchema.toJSON());\n const { title, content, time, rightAddon } = props;\n return (\n <Wrapper cols={['1fr', 'auto']} data-testid=\"chat-card-wrapper\">\n <MainContent>\n <Title data-testid=\"chat-card-title\">{title}</Title>\n <Content data-testid=\"chat-card-content\">\n <SimpleTruncatedTooltipText value={content} />\n </Content>\n {time && <Time data-testid=\"chat-card-time\">{time}</Time>}\n </MainContent>\n {rightAddon && <RightAddon data-testid=\"chat-card-right-addon\">{rightAddon}</RightAddon>}\n </Wrapper>\n );\n};\n\nChatCard.propTypes = propTypes;\nconst ChatCardWithSchema = describe(ChatCard);\nChatCardWithSchema.propTypes = propTypes;\n\nexport { ChatCard, ChatCardWithSchema };\n"],"names":["ChatCard","props","useValidateProps","ChatCardWithSchema","toJSON","title","content","time","rightAddon","propTypes","describe"],"mappings":";;;;;;;;;;IAQMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAuC;AACtDC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,kBAAkB,CAACC,MAAnB,EAAR,CAAhB;AACA,MAAQC,KAAR,GAA6CJ,KAA7C,CAAQI,KAAR;AAAA,MAAeC,OAAf,GAA6CL,KAA7C,CAAeK,OAAf;AAAA,MAAwBC,IAAxB,GAA6CN,KAA7C,CAAwBM,IAAxB;AAAA,MAA8BC,UAA9B,GAA6CP,KAA7C,CAA8BO,UAA9B;AACA,sBACE,oBAAC,OAAD;AAAS,IAAA,IAAI,EAAE,CAAC,KAAD,EAAQ,MAAR,CAAf;AAAgC,mBAAY;AAA5C,kBACE,oBAAC,WAAD,qBACE,oBAAC,KAAD;AAAO,mBAAY;AAAnB,KAAsCH,KAAtC,CADF,eAEE,oBAAC,OAAD;AAAS,mBAAY;AAArB,kBACE,oBAAC,0BAAD;AAA4B,IAAA,KAAK,EAAEC;AAAnC,IADF,CAFF,EAKGC,IAAI,iBAAI,oBAAC,IAAD;AAAM,mBAAY;AAAlB,KAAoCA,IAApC,CALX,CADF,EAQGC,UAAU,iBAAI,oBAAC,UAAD;AAAY,mBAAY;AAAxB,KAAiDA,UAAjD,CARjB,CADF;AAYD;;AAEDR,QAAQ,CAACS,SAAT,GAAqBA,SAArB;IACMN,kBAAkB,GAAGO,QAAQ,CAACV,QAAD;AACnCG,kBAAkB,CAACM,SAAnB,GAA+BA,SAA/B;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-card/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { CardPropTypes } from '../props';\n\nexport const useValidateProps = (props: CardPropTypes, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAAuBC,MAAvB,EAAiD;AAC/EC,EAAAA,oBAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { ChatCard, ChatCardWithSchema } from './ChatCard.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'react-desc';
|
|
4
|
-
import './props.js';
|
|
5
4
|
import '@elliemae/ds-truncated-tooltip-text';
|
|
5
|
+
import './props.js';
|
|
6
|
+
import './config/useValidateProps.js';
|
|
7
|
+
import '@elliemae/ds-props-helpers';
|
|
6
8
|
import './styled.js';
|
|
7
9
|
import 'styled-components';
|
|
8
10
|
import '@elliemae/ds-grid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ var propTypes = {
|
|
|
4
4
|
title: PropTypes.string.isRequired.description("Card's title"),
|
|
5
5
|
content: PropTypes.string.description("Card's content"),
|
|
6
6
|
time: PropTypes.string.description('Time'),
|
|
7
|
-
rightAddon: PropTypes.
|
|
7
|
+
rightAddon: PropTypes.element.description('Right addon, badge or icon')
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { propTypes };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-card/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n title: PropTypes.string.isRequired.description(`Card's title`),\n content: PropTypes.string.description(`Card's content`),\n time: PropTypes.string.description('Time'),\n rightAddon: PropTypes.
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-card/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n title: PropTypes.string.isRequired.description(`Card's title`),\n content: PropTypes.string.description(`Card's content`),\n time: PropTypes.string.description('Time'),\n rightAddon: PropTypes.element.description('Right addon, badge or icon'),\n};\n\nexport interface CardPropTypes {\n title: string;\n content: string;\n time: string;\n rightAddon: JSX.Element;\n}\n"],"names":["propTypes","title","PropTypes","string","isRequired","description","content","time","rightAddon","element"],"mappings":";;IAEaA,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAEC,SAAS,CAACC,MAAV,CAAiBC,UAAjB,CAA4BC,WAA5B,gBADgB;AAEvBC,EAAAA,OAAO,EAAEJ,SAAS,CAACC,MAAV,CAAiBE,WAAjB,kBAFc;AAGvBE,EAAAA,IAAI,EAAEL,SAAS,CAACC,MAAV,CAAiBE,WAAjB,CAA6B,MAA7B,CAHiB;AAIvBG,EAAAA,UAAU,EAAEN,SAAS,CAACO,OAAV,CAAkBJ,WAAlB,CAA8B,4BAA9B;AAJW;;;;"}
|
|
@@ -5,9 +5,11 @@ import { Grid } from '@elliemae/ds-grid';
|
|
|
5
5
|
import { describe } from 'react-desc';
|
|
6
6
|
import PaperAirplane from '@elliemae/ds-icons/PaperAirplane';
|
|
7
7
|
import { StyledChatContainerContentComposer, StyledComposerInput, StyledComposerButton, StyledCounterArea, StyledCounterErrorA11y } from './styled.js';
|
|
8
|
+
import { useValidateProps } from './config/useValidateProps.js';
|
|
8
9
|
import { composerProps, defaultComposerPros } from './props.js';
|
|
9
10
|
import 'styled-components';
|
|
10
11
|
import '@elliemae/ds-button';
|
|
12
|
+
import '@elliemae/ds-props-helpers';
|
|
11
13
|
import 'lodash';
|
|
12
14
|
|
|
13
15
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -17,6 +19,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
19
|
var ChatComposer = function ChatComposer(props) {
|
|
18
20
|
var _input$current;
|
|
19
21
|
|
|
22
|
+
useValidateProps(props, ChatComposerWithSchema.toJSON());
|
|
20
23
|
var inputValue = props.inputValue,
|
|
21
24
|
onChange = props.onChange,
|
|
22
25
|
onResize = props.onResize,
|
|
@@ -28,9 +31,11 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
28
31
|
placeholder = props.placeholder,
|
|
29
32
|
inputMaxLength = props.inputMaxLength,
|
|
30
33
|
buttonDisabled = props.buttonDisabled,
|
|
31
|
-
dataTestid = props.dataTestid
|
|
34
|
+
dataTestid = props.dataTestid,
|
|
35
|
+
actionRef = props.actionRef;
|
|
32
36
|
var input = React.useRef();
|
|
33
37
|
var inputSize = React.useRef();
|
|
38
|
+
var inputSend = React.useRef();
|
|
34
39
|
|
|
35
40
|
var _React$useState = React.useState(32),
|
|
36
41
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -54,6 +59,17 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
54
59
|
setHeight(newHeight);
|
|
55
60
|
setShowScroll(((_inputSize$current3 = inputSize.current) === null || _inputSize$current3 === void 0 ? void 0 : _inputSize$current3.scrollHeight) - ((_inputSize$current4 = inputSize.current) === null || _inputSize$current4 === void 0 ? void 0 : _inputSize$current4.clientHeight) > 5);
|
|
56
61
|
}, [inputValue, internalMaxHeight]);
|
|
62
|
+
React.useEffect(function () {
|
|
63
|
+
if (actionRef && actionRef.current) {
|
|
64
|
+
actionRef.current.focusToComposer = function () {
|
|
65
|
+
input.current.focus();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
actionRef.current.focusToSend = function () {
|
|
69
|
+
inputSend.current.focus();
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}, [actionRef.current]);
|
|
57
73
|
var handleChange = React.useCallback(function (e) {
|
|
58
74
|
onChange(e.target.value);
|
|
59
75
|
}, [onChange]);
|
|
@@ -97,7 +113,8 @@ var ChatComposer = function ChatComposer(props) {
|
|
|
97
113
|
size: "s",
|
|
98
114
|
disabled: !inputValue || buttonDisabled || hasError,
|
|
99
115
|
"data-testid": "chat-composer-send-button",
|
|
100
|
-
"aria-label": "Send"
|
|
116
|
+
"aria-label": "Send",
|
|
117
|
+
innerRef: inputSend
|
|
101
118
|
}))), /*#__PURE__*/React.createElement(StyledComposerInput, {
|
|
102
119
|
ref: inputSize,
|
|
103
120
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ChatContainerComposer.js","sources":["../../../../src/parts/chat-composer/ChatContainerComposer.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport PaperAirplane from '@elliemae/ds-icons/PaperAirplane';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef.current]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid cols={['1fr', '24px']} justifyContent=\"center\" alignItems=\"flex-end\" gutter=\"xxs\">\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n // maxLength={inputMaxLength}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n You have exceeded the character limit by {inputLength - inputMaxLength}\n </StyledCounterErrorA11y>\n Please limit to less than {inputMaxLength} characters.{' '}\n </>\n ) : (\n ''\n )}\n {inputMaxLength ? `${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n"],"names":["ChatComposer","props","useValidateProps","ChatComposerWithSchema","toJSON","inputValue","onChange","onResize","onSend","onFocus","onBlur","maxHeight","placeholder","inputMaxLength","buttonDisabled","dataTestid","actionRef","input","React","useRef","inputSize","inputSend","useState","height","setHeight","internalMaxHeight","useMemo","showScroll","setShowScroll","useEffect","newHeight","current","scrollHeight","clientHeight","focusToComposer","focus","focusToSend","handleChange","useCallback","e","target","value","heightProps","overflow","inputLength","String","length","hasError","visibility","pointerEvents","position","top","width","clientWidth","propTypes","composerProps","defaultProps","defaultComposerPros","describe"],"mappings":";;;;;;;;;;;;;;;;;;IAgBMA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAA2C;AAAA;;AAC9DC,EAAAA,gBAAgB,CAACD,KAAD,EAAQE,sBAAsB,CAACC,MAAvB,EAAR,CAAhB;AAEA,MACEC,UADF,GAaIJ,KAbJ,CACEI,UADF;AAAA,MAEEC,QAFF,GAaIL,KAbJ,CAEEK,QAFF;AAAA,MAGEC,QAHF,GAaIN,KAbJ,CAGEM,QAHF;AAAA,MAIEC,MAJF,GAaIP,KAbJ,CAIEO,MAJF;AAAA,MAKEC,OALF,GAaIR,KAbJ,CAKEQ,OALF;AAAA,MAMEC,MANF,GAaIT,KAbJ,CAMES,MANF;AAAA,yBAaIT,KAbJ,CAOEU,SAPF;AAAA,MAOEA,SAPF,iCAOc,GAPd;AAAA,MAQEC,WARF,GAaIX,KAbJ,CAQEW,WARF;AAAA,MASEC,cATF,GAaIZ,KAbJ,CASEY,cATF;AAAA,MAUEC,cAVF,GAaIb,KAbJ,CAUEa,cAVF;AAAA,MAWEC,UAXF,GAaId,KAbJ,CAWEc,UAXF;AAAA,MAYEC,SAZF,GAaIf,KAbJ,CAYEe,SAZF;AAeA,MAAMC,KAAK,GAAGC,KAAK,CAACC,MAAN,EAAd;AACA,MAAMC,SAAS,GAAGF,KAAK,CAACC,MAAN,EAAlB;AACA,MAAME,SAAS,GAAGH,KAAK,CAACC,MAAN,EAAlB;;AACA,wBAA4BD,KAAK,CAACI,QAAN,CAAe,EAAf,CAA5B;AAAA;AAAA,MAAOC,MAAP;AAAA,MAAeC,SAAf;;AACA,MA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,YAAY,CAACwD,YAAb,GAA4BC,mBAA5B;IACMtD,sBAAsB,GAAGuD,QAAQ,CAAC1D,YAAD;AACvCG,sBAAsB,CAACmD,SAAvB,GAAmCC,aAAnC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidateProps.js","sources":["../../../../../src/parts/chat-composer/config/useValidateProps.tsx"],"sourcesContent":["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { ChatComposerProps } from '../props';\n\nexport const useValidateProps = (props: ChatComposerProps, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n"],"names":["useValidateProps","props","schema","useValidatePropTypes"],"mappings":";;IAGaA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,KAAD,EAA2BC,MAA3B,EAAqD;AACnFC,EAAAA,oBAAoB,CAACF,KAAD,EAAQC,MAAR,CAApB;AACD;;;;"}
|
|
@@ -8,6 +8,8 @@ import '@elliemae/ds-icons/PaperAirplane';
|
|
|
8
8
|
import './styled.js';
|
|
9
9
|
import 'styled-components';
|
|
10
10
|
import '@elliemae/ds-button';
|
|
11
|
+
import './config/useValidateProps.js';
|
|
12
|
+
import '@elliemae/ds-props-helpers';
|
|
11
13
|
import './props.js';
|
|
12
14
|
import 'lodash';
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -12,7 +12,8 @@ var defaultComposerPros = {
|
|
|
12
12
|
maxHeight: 0,
|
|
13
13
|
inputMaxLength: undefined,
|
|
14
14
|
buttonDisabled: false,
|
|
15
|
-
dataTestid: 'ds-chat-composer'
|
|
15
|
+
dataTestid: 'ds-chat-composer',
|
|
16
|
+
actionRef: noop
|
|
16
17
|
};
|
|
17
18
|
var composerProps = {
|
|
18
19
|
placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),
|
|
@@ -21,11 +22,12 @@ var composerProps = {
|
|
|
21
22
|
onResize: PropTypes.func.description('Called the input changes his height').defaultValue(defaultComposerPros.onResize),
|
|
22
23
|
onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),
|
|
23
24
|
onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),
|
|
24
|
-
onBlur: PropTypes.
|
|
25
|
+
onBlur: PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),
|
|
25
26
|
maxHeight: PropTypes.number.description('Max height of the composer. Use 0 for no limit').defaultValue(defaultComposerPros.onBlur),
|
|
26
27
|
inputMaxLength: PropTypes.number.description('Max length of the composer. `undefined` for no limit').defaultValue(defaultComposerPros.inputMaxLength),
|
|
27
|
-
buttonDisabled: PropTypes.
|
|
28
|
-
dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder)
|
|
28
|
+
buttonDisabled: PropTypes.bool.description('Control the disabled for the send button').defaultValue(defaultComposerPros.buttonDisabled),
|
|
29
|
+
dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),
|
|
30
|
+
actionRef: PropTypes.object.description("Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n ").defaultValue(defaultComposerPros.actionRef)
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export { composerProps, defaultComposerPros };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n};\n\nexport interface ChatComposerProps {\n placeholder: 'Type your message';\n inputValue: '';\n onChange: (value: string) => void;\n onResize: (value: number) => void;\n onSend: (value: string) => void;\n onFocus: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n maxHeight: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n}\n\nexport const composerProps = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultComposerPros.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),\n onBlur: PropTypes.
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../../src/parts/chat-composer/props.tsx"],"sourcesContent":["import React from 'react';\nimport { PropTypes } from 'react-desc';\nimport { noop } from 'lodash';\n\nexport interface TextAreaProps {\n height: string | number;\n style: React.CSSProperties;\n}\n\nexport const defaultComposerPros: ChatComposerProps = {\n placeholder: 'Type your message',\n inputValue: '',\n onChange: noop,\n onResize: noop,\n onSend: noop,\n onFocus: noop,\n onBlur: noop,\n maxHeight: 0,\n inputMaxLength: undefined,\n buttonDisabled: false,\n dataTestid: 'ds-chat-composer',\n actionRef: noop,\n};\n\nexport interface ChatComposerProps {\n placeholder: 'Type your message';\n inputValue: '';\n onChange: (value: string) => void;\n onResize: (value: number) => void;\n onSend: (value: string) => void;\n onFocus: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n onBlur: (e: React.ChangeEvent<HTMLTextAreaElement>, value: string) => void;\n maxHeight: number;\n inputMaxLength: number | undefined;\n buttonDisabled: boolean;\n dataTestid?: string;\n actionRef: PropTypes.func;\n}\n\nexport const composerProps = {\n placeholder: PropTypes.string.description('Input Placeholder').defaultValue(defaultComposerPros.placeholder),\n inputValue: PropTypes.string.description('Input value').defaultValue(defaultComposerPros.inputValue),\n onChange: PropTypes.func.description('Called when the user types').defaultValue(defaultComposerPros.onChange),\n onResize: PropTypes.func\n .description('Called the input changes his height')\n .defaultValue(defaultComposerPros.onResize),\n onSend: PropTypes.func.description('Called when the click send').defaultValue(defaultComposerPros.onSend),\n onFocus: PropTypes.func.description('Input focus').defaultValue(defaultComposerPros.onFocus),\n onBlur: PropTypes.func.description('Input blur').defaultValue(defaultComposerPros.onBlur),\n maxHeight: PropTypes.number\n .description('Max height of the composer. Use 0 for no limit')\n .defaultValue(defaultComposerPros.onBlur),\n inputMaxLength: PropTypes.number\n .description('Max length of the composer. `undefined` for no limit')\n .defaultValue(defaultComposerPros.inputMaxLength),\n buttonDisabled: PropTypes.bool\n .description('Control the disabled for the send button')\n .defaultValue(defaultComposerPros.buttonDisabled),\n dataTestid: PropTypes.string.description('Data testid').defaultValue(defaultComposerPros.placeholder),\n actionRef: PropTypes.object\n .description(\n `Reference: \n { \n scrollToIndex: (n: number) => void,\n getMessagesInView: () => number[],\n focusToIndex: (n: number) => void,\n focusToList: () => void,\n focusToComposer: () => void,\n focusToSend: () => void,\n }\n \n `,\n )\n .defaultValue(defaultComposerPros.actionRef),\n};\n"],"names":["defaultComposerPros","placeholder","inputValue","onChange","noop","onResize","onSend","onFocus","onBlur","maxHeight","inputMaxLength","undefined","buttonDisabled","dataTestid","actionRef","composerProps","PropTypes","string","description","defaultValue","func","number","bool","object"],"mappings":";;;IASaA,mBAAsC,GAAG;AACpDC,EAAAA,WAAW,EAAE,mBADuC;AAEpDC,EAAAA,UA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2B,YAA3B,EAAyCC,YAAzC,CAAsDnB,mBAAmB,CAACQ,MAA1E,CATmB;AAU3BC,EAAAA,SAAS,EAAEO,SAAS,CAACK,MAAV,CACRH,WADQ,CACI,gDADJ,EAERC,YAFQ,CAEKnB,mBAAmB,CAACQ,MAFzB,CAVgB;AAa3BE,EAAAA,cAAc,EAAEM,SAAS,CAACK,MAAV,CACbH,WADa,CACD,sDADC,EAEbC,YAFa,CAEAnB,mBAAmB,CAACU,cAFpB,CAbW;AAgB3BE,EAAAA,cAAc,EAAEI,SAAS,CAACM,IAAV,CACbJ,WADa,CACD,0CADC,EAEbC,YAFa,CAEAnB,mBAAmB,CAACY,cAFpB,CAhBW;AAmB3BC,EAAAA,UAAU,EAAEG,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,aAA7B,EAA4CC,YAA5C,CAAyDnB,mBAAmB,CAACC,WAA7E,CAnBe;AAoB3Ba,EAAAA,SAAS,EAAEE,SAAS,CAACO,MAAV,CACRL,WADQ,oTAcRC,YAdQ,CAcKnB,mBAAmB,CAACc,SAdzB;AApBgB;;;;"}
|
|
@@ -16,7 +16,7 @@ var StyledChatContainerContentComposer = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
16
16
|
});
|
|
17
17
|
var StyledComposerInput = /*#__PURE__*/styled.textarea.withConfig({
|
|
18
18
|
componentId: "sc-1ahwpce-1"
|
|
19
|
-
})(["padding:", ";resize:none;min-height:32px;border-radius:2px;border:solid 1px #cbcfd7;color:#25292f;height:", ";min-width:244px;overflow-y:auto;font-size:
|
|
19
|
+
})(["padding:", ";resize:none;min-height:32px;border-radius:2px;border:solid 1px #cbcfd7;color:#25292f;height:", ";min-width:244px;overflow-y:auto;font-size:13px;font-weight:400;line-height:1;transition:height 0.3s;&:focus{outline:none;border:1px solid ", ";box-shadow:inset 0 0 0 1px #8cc2ed;border-radius:2px;}"], function (props) {
|
|
20
20
|
return props.theme.space.xxs;
|
|
21
21
|
}, function (props) {
|
|
22
22
|
return typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
|
|
@@ -25,7 +25,7 @@ var StyledComposerInput = /*#__PURE__*/styled.textarea.withConfig({
|
|
|
25
25
|
});
|
|
26
26
|
var StyledComposerButton = /*#__PURE__*/styled(DSButton).withConfig({
|
|
27
27
|
componentId: "sc-1ahwpce-2"
|
|
28
|
-
})(["background:none
|
|
28
|
+
})(["&:disabled{background:none;svg{fill:#5d6775;}}svg{fill:", ";}&:focus{background:", ";}"], function (props) {
|
|
29
29
|
return props.theme.colors.brand[600];
|
|
30
30
|
}, function (props) {
|
|
31
31
|
return props.theme.colors.brand[200];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-composer/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-button';\nimport { TextAreaProps } from './props';\n\n// Composer\nexport const StyledChatContainerContentComposer = styled(Grid)`\n width: 100%;\n min-height: 56px;\n background: ${(props) => props.theme.colors.neutral['050']};\n padding: ${(props) => props.theme.space.xxs};\n padding-bottom: 3px;\n padding-top: 6px;\n padding-left: ${(props) => props.theme.space.xs};\n max-height: ${(props) => props.maxHeight};\n border-top: 1px solid #cbcfd7;\n`;\n\nexport const StyledComposerInput = styled.textarea<any>`\n padding: ${(props) => props.theme.space.xxs};\n resize: none;\n min-height: 32px;\n border-radius: 2px;\n border: solid 1px #cbcfd7;\n color: #25292f;\n height: ${(props: TextAreaProps) => (typeof props.height === 'number' ? `${props.height}px` : props.height)};\n min-width: 244px;\n overflow-y: auto;\n font-size:
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../src/parts/chat-composer/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButton } from '@elliemae/ds-button';\nimport { TextAreaProps } from './props';\n\n// Composer\nexport const StyledChatContainerContentComposer = styled(Grid)`\n width: 100%;\n min-height: 56px;\n background: ${(props) => props.theme.colors.neutral['050']};\n padding: ${(props) => props.theme.space.xxs};\n padding-bottom: 3px;\n padding-top: 6px;\n padding-left: ${(props) => props.theme.space.xs};\n max-height: ${(props) => props.maxHeight};\n border-top: 1px solid #cbcfd7;\n`;\n\nexport const StyledComposerInput = styled.textarea<any>`\n padding: ${(props) => props.theme.space.xxs};\n resize: none;\n min-height: 32px;\n border-radius: 2px;\n border: solid 1px #cbcfd7;\n color: #25292f;\n height: ${(props: TextAreaProps) => (typeof props.height === 'number' ? `${props.height}px` : props.height)};\n min-width: 244px;\n overflow-y: auto;\n font-size: 13px;\n font-weight: 400;\n line-height: 1;\n transition: height 0.3s;\n &:focus {\n outline: none;\n border: 1px solid ${(props) => props.theme.colors.brand[600]};\n box-shadow: inset 0 0 0 1px #8cc2ed;\n border-radius: 2px;\n }\n`;\nexport const StyledComposerButton = styled(DSButton)`\n &:disabled {\n background: none;\n svg {\n fill: #5d6775;\n }\n }\n svg {\n fill: ${(props) => props.theme.colors.brand[600]};\n }\n &:focus {\n background: ${(props) => props.theme.colors.brand[200]};\n }\n`;\n\nexport const StyledCounterArea = styled(Grid)`\n text-align: right;\n font-size: 11px;\n height: 15px;\n align-items: center;\n font-style: italic;\n ${(props) => (props.hasError ? `color:${props.theme.colors.danger[900]};` : '')}\n position:relative;\n`;\n\nexport const StyledCounterErrorA11y = styled.span`\n width: 1px;\n height: 1px;\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n`;\n"],"names":["StyledChatContainerContentComposer","styled","Grid","props","theme","colors","neutral","space","xxs","xs","maxHeight","StyledComposerInput","textarea","height","brand","StyledComposerButton","DSButton","StyledCounterArea","hasError","danger","StyledCounterErrorA11y","span"],"mappings":";;;;AAKA;IACaA,kCAAkC,gBAAGC,MAAM,CAACC,IAAD,CAAT;AAAA;AAAA,mKAG/B,UAACC,KAAD;AAAA,SAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAA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AA;AAAA;;;;"}
|
|
@@ -8,6 +8,7 @@ import { ChatComposer } from '../chat-composer/ChatContainerComposer.js';
|
|
|
8
8
|
import { ChatContainerMessagesList } from '../chat-container-messages-list/ChatContainerMessagesList.js';
|
|
9
9
|
import { containerProps, defaultProps } from './props.js';
|
|
10
10
|
import { StyledIndicatorContainer, StyledChatContainerContent, MobileStyledChatContainerContent } from './styled.js';
|
|
11
|
+
import { useValidateProps } from './config/useValidateProps.js';
|
|
11
12
|
import '@babel/runtime/helpers/esm/defineProperty';
|
|
12
13
|
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
13
14
|
import '@elliemae/ds-grid';
|
|
@@ -15,6 +16,8 @@ import '@elliemae/ds-icons/PaperAirplane';
|
|
|
15
16
|
import '../chat-composer/styled.js';
|
|
16
17
|
import 'styled-components';
|
|
17
18
|
import '@elliemae/ds-button';
|
|
19
|
+
import '../chat-composer/config/useValidateProps.js';
|
|
20
|
+
import '@elliemae/ds-props-helpers';
|
|
18
21
|
import '../chat-composer/props.js';
|
|
19
22
|
import 'react-virtual';
|
|
20
23
|
import '@elliemae/ds-basic/Button';
|
|
@@ -23,19 +26,24 @@ import '@elliemae/ds-icons/WarningCircleFill';
|
|
|
23
26
|
import '../bubble/styled.js';
|
|
24
27
|
import '../bubble/props.js';
|
|
25
28
|
import 'prop-types';
|
|
29
|
+
import '../bubble/config/useValidateProps.js';
|
|
26
30
|
import '../bubble/ChatBubbleArrow.js';
|
|
27
31
|
import '../message-delimiter/MessageDelimiter.js';
|
|
28
32
|
import '../message-delimiter/styled.js';
|
|
29
33
|
import '../message-delimiter/props.js';
|
|
34
|
+
import '../message-delimiter/config/useValidateProps.js';
|
|
30
35
|
import '../system-message/SystemMessage.js';
|
|
31
36
|
import '../system-message/style.js';
|
|
32
37
|
import '../system-message/props.js';
|
|
38
|
+
import '../system-message/config/useValidateProps.js';
|
|
33
39
|
import '../chat-container-messages-list/styled.js';
|
|
34
40
|
import '../chat-container-messages-list/props.js';
|
|
41
|
+
import '../chat-container-messages-list/config/useValidateProps.js';
|
|
35
42
|
|
|
36
43
|
var ChatContainer = function ChatContainer(props) {
|
|
37
44
|
var _containerRef$current;
|
|
38
45
|
|
|
46
|
+
useValidateProps(props, ChatContainerWithSchema.toJSON());
|
|
39
47
|
var sendingText = props.sendingText,
|
|
40
48
|
sendingMessages = props.sendingMessages,
|
|
41
49
|
bannerPosition = props.bannerPosition,
|
|
@@ -108,7 +116,8 @@ var ChatContainer = function ChatContainer(props) {
|
|
|
108
116
|
lineOnly: true
|
|
109
117
|
})) : null), /*#__PURE__*/React.createElement(ChatComposer, _extends({}, composerProps, {
|
|
110
118
|
onResize: onResize,
|
|
111
|
-
maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2
|
|
119
|
+
maxHeight: (((_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.clientHeight) || 0) / 2,
|
|
120
|
+
actionRef: actionRef || listRef
|
|
112
121
|
})));
|
|
113
122
|
};
|
|
114
123
|
|