@pega/cosmos-react-cs 4.0.0-dev.1.1 → 4.0.0-dev.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/lib/components/Article/Article.d.ts +1 -1
  2. package/lib/components/Article/Article.d.ts.map +1 -1
  3. package/lib/components/Article/Article.js +4 -1
  4. package/lib/components/Article/Article.js.map +1 -1
  5. package/lib/components/CallControlPanel/AttachInteractionDialog.d.ts +9 -4
  6. package/lib/components/CallControlPanel/AttachInteractionDialog.d.ts.map +1 -1
  7. package/lib/components/CallControlPanel/AttachInteractionDialog.js +13 -10
  8. package/lib/components/CallControlPanel/AttachInteractionDialog.js.map +1 -1
  9. package/lib/components/CallControlPanel/Call.d.ts.map +1 -1
  10. package/lib/components/CallControlPanel/Call.js +14 -6
  11. package/lib/components/CallControlPanel/Call.js.map +1 -1
  12. package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +1 -1
  13. package/lib/components/CallControlPanel/CallControlPanel.js +1 -1
  14. package/lib/components/CallControlPanel/CallControlPanel.js.map +1 -1
  15. package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +2 -2
  16. package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +1 -1
  17. package/lib/components/CallControlPanel/CallControlPanel.types.js.map +1 -1
  18. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts +1 -1
  19. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts.map +1 -1
  20. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js +13 -9
  21. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js.map +1 -1
  22. package/lib/components/CallControlPanel/ExternalCTI.d.ts.map +1 -1
  23. package/lib/components/CallControlPanel/ExternalCTI.js +9 -7
  24. package/lib/components/CallControlPanel/ExternalCTI.js.map +1 -1
  25. package/lib/components/CallControlPanel/FloatingPanel.d.ts.map +1 -1
  26. package/lib/components/CallControlPanel/FloatingPanel.js +3 -1
  27. package/lib/components/CallControlPanel/FloatingPanel.js.map +1 -1
  28. package/lib/components/CallControlPanel/StopWatch.d.ts.map +1 -1
  29. package/lib/components/CallControlPanel/StopWatch.js +2 -2
  30. package/lib/components/CallControlPanel/StopWatch.js.map +1 -1
  31. package/lib/components/DialPad/DialPad.types.d.ts +3 -3
  32. package/lib/components/DialPad/DialPad.types.d.ts.map +1 -1
  33. package/lib/components/DialPad/DialPadKeyboard.d.ts +1 -1
  34. package/lib/components/DialPad/DialPadKeyboard.d.ts.map +1 -1
  35. package/lib/components/InteractionNotification/AcceptButton.d.ts +15 -0
  36. package/lib/components/InteractionNotification/AcceptButton.d.ts.map +1 -0
  37. package/lib/components/InteractionNotification/AcceptButton.js +44 -0
  38. package/lib/components/InteractionNotification/AcceptButton.js.map +1 -0
  39. package/lib/components/InteractionNotification/InteractionNotification.d.ts +10 -1
  40. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
  41. package/lib/components/InteractionNotification/InteractionNotification.js +11 -11
  42. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
  43. package/lib/components/TaskManager/Picker/Picker.d.ts.map +1 -1
  44. package/lib/components/TaskManager/Picker/Picker.js +43 -12
  45. package/lib/components/TaskManager/Picker/Picker.js.map +1 -1
  46. package/lib/components/TaskManager/Picker/Picker.types.d.ts +3 -2
  47. package/lib/components/TaskManager/Picker/Picker.types.d.ts.map +1 -1
  48. package/lib/components/TaskManager/Picker/Picker.types.js.map +1 -1
  49. package/lib/components/TaskManager/TaskManager.d.ts.map +1 -1
  50. package/lib/components/TaskManager/TaskManager.js +20 -39
  51. package/lib/components/TaskManager/TaskManager.js.map +1 -1
  52. package/lib/components/TaskManager/TaskManager.styles.d.ts +1 -1
  53. package/lib/components/TaskManager/TaskManager.styles.d.ts.map +1 -1
  54. package/lib/components/TaskManager/TaskManager.styles.js +25 -11
  55. package/lib/components/TaskManager/TaskManager.styles.js.map +1 -1
  56. package/lib/components/TaskManager/TaskManager.types.d.ts +0 -2
  57. package/lib/components/TaskManager/TaskManager.types.d.ts.map +1 -1
  58. package/lib/components/TaskManager/TaskManager.types.js.map +1 -1
  59. package/lib/components/TaskManager/TaskManagerTabs.d.ts.map +1 -1
  60. package/lib/components/TaskManager/TaskManagerTabs.js +10 -10
  61. package/lib/components/TaskManager/TaskManagerTabs.js.map +1 -1
  62. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"CallHandoverDialog.js","sourceRoot":"","sources":["../../../../src/components/CallControlPanel/CallHandover/CallHandoverDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAmBlD,MAAM,kBAAkB,GAA+C,CAAC,EACtE,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,kBAAkB,EACM,EAAE,EAAE;IAC5B,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,aAAa,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;IACnD,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAChC,YAAY,CAAC,UAAU,CAAC,CAAC;IAEzB,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,aAAwB,CAAC;IAC7B,IAAI,aAAqB,CAAC;IAC1B,QAAQ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ACtC,CACH,CAAC;YACF,MAAM;QACR,KAAK,0BAA0B;YAC7B,aAAa,GAAG,CAAC,CAAC,wDAAwD,CAAC,CAAC;YAC5E,aAAa,GAAG,CACd,KAAC,gBAAgB,IACf,gBAAgB,EAAE,CAAC,CAAC,iCAAiC,CAAC,EACtD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAC,kBAAkB,EAC1B,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,GACtC,CACH,CAAC;YACF,MAAM;QACR;YACE,aAAa,GAAG,EAAE,CAAC;YACnB,aAAa,GAAG,IAAI,CAAC;KACxB;IAED,OAAO,CACL,KAAC,OAAO,IACN,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,UAAU,EACf,SAAS,EAAC,SAAS,EACnB,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,kBAAkB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC;iBACpD;aACF;SACF,YAED,MAAC,IAAI,eACH,KAAC,UAAU,IACT,OAAO,EACL,KAAC,MAAM,IAAC,IAAI,QAAC,OAAO,EAAC,QAAQ,gBAAa,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,YACrE,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,YAGX,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,aAAa,GAAQ,GAC9B,EACb,KAAC,WAAW,cAAE,aAAa,GAAe,IACrC,GACC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, useEffect, useRef } from 'react';\n\nimport {\n Text,\n Button,\n Card,\n CardContent,\n CardHeader,\n Icon,\n Popover,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n getFocusables\n} from '@pega/cosmos-react-core';\n\nimport CallHandoverForm from './CallHandoverForm';\nimport type { TransferData, TransferReasonOption } from './CallHandover.types';\n\nexport type HandoverType =\n | 'conference'\n | 'transferWithInteractions'\n | 'transferCallOnly'\n | 'consultWithInteractions'\n | 'consultCallOnly';\n\nexport interface CallHandoverDialogProps {\n target: HTMLElement | null;\n type: HandoverType;\n onCancel: () => void;\n onSubmit: (data: TransferData) => void;\n transferOptions: Readonly<TransferReasonOption[]>;\n interactionOptions?: Readonly<TransferReasonOption[]>;\n}\n\nconst CallHandoverDialog: FunctionComponent<CallHandoverDialogProps> = ({\n target,\n type,\n onSubmit,\n onCancel,\n transferOptions,\n interactionOptions\n}: CallHandoverDialogProps) => {\n const popoverRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n\n useOuterEvent('mousedown', [popoverRef], onCancel);\n useEscape(onCancel, popoverRef);\n useFocusTrap(popoverRef);\n\n useEffect(() => {\n getFocusables(popoverRef)[0]?.focus();\n }, []);\n\n let dialogContent: ReactNode;\n let dialogHeading: string;\n switch (type) {\n case 'conference':\n dialogHeading = t('call_panel_conference_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call'\n submitButtonText={t('call_panel_conference_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'consultCallOnly':\n dialogHeading = t('call_panel_consult_with_call_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call'\n submitButtonText={t('call_panel_consult_call_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'consultWithInteractions':\n dialogHeading = t('call_panel_consult_with_call_and_interactions_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call+interaction'\n submitButtonText={t('call_panel_consult_call_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'transferCallOnly':\n dialogHeading = t('call_panel_transfer_with_call_heading');\n dialogContent = (\n <CallHandoverForm\n submitButtonText={t('call_panel_transfer_call_submit')}\n onCancel={onCancel}\n variant='call'\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'transferWithInteractions':\n dialogHeading = t('call_panel_transfer_with_call_and_interactions_heading');\n dialogContent = (\n <CallHandoverForm\n submitButtonText={t('call_panel_transfer_call_submit')}\n onCancel={onCancel}\n variant='call+interaction'\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n default:\n dialogHeading = '';\n dialogContent = null;\n }\n\n return (\n <Popover\n target={target}\n ref={popoverRef}\n placement='top-end'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['bottom-end', 'left', 'right']\n }\n }\n ]}\n >\n <Card>\n <CardHeader\n actions={\n <Button icon variant='simple' aria-label={t('close')} onClick={onCancel}>\n <Icon name='times' />\n </Button>\n }\n >\n <Text variant='h3'>{dialogHeading}</Text>\n </CardHeader>\n <CardContent>{dialogContent}</CardContent>\n </Card>\n </Popover>\n );\n};\n\nexport default CallHandoverDialog;\n"]}
1
+ {"version":3,"file":"CallHandoverDialog.js","sourceRoot":"","sources":["../../../../src/components/CallControlPanel/CallHandover/CallHandoverDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,IAAI,EACJ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAoBlD,MAAM,kBAAkB,GAA+C,CAAC,EACtE,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,kBAAkB,EACM,EAAE,EAAE;IAC5B,MAAM,UAAU,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AE,UAAU,EACf,SAAS,EAAC,SAAS,EACnB,SAAS,EAAE;YACT;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,kBAAkB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC;iBACpD;aACF;SACF,YAED,MAAC,IAAI,eACH,KAAC,UAAU,IACT,OAAO,EACL,KAAC,MAAM,IAAC,IAAI,QAAC,OAAO,EAAC,QAAQ,gBAAa,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,YACrE,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,YAGX,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,aAAa,GAAQ,GAC9B,EACb,KAAC,WAAW,cAAE,aAAa,GAAe,IACrC,GACC,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, useEffect, useRef } from 'react';\n\nimport {\n Text,\n Button,\n Card,\n CardContent,\n CardHeader,\n Icon,\n Popover,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n getFocusables\n} from '@pega/cosmos-react-core';\n\nimport CallHandoverForm from './CallHandoverForm';\nimport type { TransferData, TransferReasonOption } from './CallHandover.types';\n\nexport type HandoverType =\n | 'conferenceWithInteractions'\n | 'conferenceCallOnly'\n | 'transferWithInteractions'\n | 'transferCallOnly'\n | 'consultWithInteractions'\n | 'consultCallOnly';\n\nexport interface CallHandoverDialogProps {\n target: HTMLElement | null;\n type: HandoverType;\n onCancel: () => void;\n onSubmit: (data: TransferData) => void;\n transferOptions: Readonly<TransferReasonOption[]>;\n interactionOptions?: Readonly<TransferReasonOption[]>;\n}\n\nconst CallHandoverDialog: FunctionComponent<CallHandoverDialogProps> = ({\n target,\n type,\n onSubmit,\n onCancel,\n transferOptions,\n interactionOptions\n}: CallHandoverDialogProps) => {\n const popoverRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n\n useOuterEvent('mousedown', [popoverRef], onCancel);\n useEscape(onCancel, popoverRef);\n useFocusTrap(popoverRef);\n\n useEffect(() => {\n getFocusables(popoverRef)[0]?.focus();\n }, []);\n\n let dialogContent: ReactNode;\n let dialogHeading: string;\n switch (type) {\n case 'conferenceCallOnly':\n dialogHeading = t('call_panel_conference_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call'\n submitButtonText={t('call_panel_conference_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'conferenceWithInteractions':\n dialogHeading = t('call_panel_conference_call_and_interactions_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call+interaction'\n submitButtonText={t('call_panel_conference_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'consultCallOnly':\n dialogHeading = t('call_panel_consult_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call'\n submitButtonText={t('call_panel_consult_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'consultWithInteractions':\n dialogHeading = t('call_panel_consult_call_and_interactions_heading');\n dialogContent = (\n <CallHandoverForm\n onCancel={onCancel}\n variant='call+interaction'\n submitButtonText={t('call_panel_consult_submit')}\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'transferCallOnly':\n dialogHeading = t('call_panel_transfer_heading');\n dialogContent = (\n <CallHandoverForm\n submitButtonText={t('call_panel_transfer_submit')}\n onCancel={onCancel}\n variant='call'\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n case 'transferWithInteractions':\n dialogHeading = t('call_panel_transfer_call_and_interactions_heading');\n dialogContent = (\n <CallHandoverForm\n submitButtonText={t('call_panel_transfer_submit')}\n onCancel={onCancel}\n variant='call+interaction'\n onSubmit={onSubmit}\n transferOptions={transferOptions}\n interactionOptions={interactionOptions}\n />\n );\n break;\n default:\n dialogHeading = '';\n dialogContent = null;\n }\n\n return (\n <Popover\n target={target}\n ref={popoverRef}\n placement='top-end'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['bottom-end', 'left', 'right']\n }\n }\n ]}\n >\n <Card>\n <CardHeader\n actions={\n <Button icon variant='simple' aria-label={t('close')} onClick={onCancel}>\n <Icon name='times' />\n </Button>\n }\n >\n <Text variant='h3'>{dialogHeading}</Text>\n </CardHeader>\n <CardContent>{dialogContent}</CardContent>\n </Card>\n </Popover>\n );\n};\n\nexport default CallHandoverDialog;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalCTI.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/ExternalCTI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,iBAAiB,EAAmB,GAAG,EAAU,MAAM,OAAO,CAAC;AAGnG,OAAO,EAAoB,YAAY,EAAa,MAAM,yBAAyB,CAAC;AAEpF,OAAgC,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACxC,oCAAoC;IACpC,IAAI,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,kCAAkC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAgCD,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAkDnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ExternalCTI.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/ExternalCTI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAEjB,GAAG,EAEJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAqC,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE1F,OAAgC,EAAE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACjG,OAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACxC,oCAAoC;IACpC,IAAI,CAAC,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,kCAAkC;IAClC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B;;OAEG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CACjD;AAgCD,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAwDnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useRef } from 'react';
2
+ import { forwardRef, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { defaultThemeProp, useDialog } from '@pega/cosmos-react-core';
4
+ import { defaultThemeProp } from '@pega/cosmos-react-core';
5
5
  import AttachInteractionDialog from './AttachInteractionDialog';
6
6
  import FloatingPanel from './FloatingPanel';
7
7
  const StyledExternalCTIPanel = styled(FloatingPanel)(({ theme: { components: { card: { 'border-radius': borderRadius } } } }) => {
@@ -23,16 +23,16 @@ const StyledCTIContainer = styled.div `
23
23
  `;
24
24
  StyledCTIContainer.defaultProps = defaultThemeProp;
25
25
  const ExternalCTI = forwardRef(({ heading, draggable = false, visible = true, size, attachInteractionProps }, ref) => {
26
- const interactionButtonRef = useRef(null);
27
- const { events, target } = useDialog();
26
+ const [dialogTarget, setDialogTarget] = useState(null);
28
27
  return (_jsxs(StyledExternalCTIPanel, { heading: heading, draggable: draggable, visible: visible, actions: attachInteractionProps
29
28
  ? [
30
29
  {
31
30
  id: 'add-interaction',
32
31
  text: attachInteractionProps.heading,
33
32
  icon: 'paper-clip',
34
- ref: interactionButtonRef,
35
- ...events
33
+ onClick: (id, e) => {
34
+ setDialogTarget(e.currentTarget);
35
+ }
36
36
  }
37
37
  ]
38
38
  : undefined, children: [_jsx(StyledCTIContainer, { style: size
@@ -40,7 +40,9 @@ const ExternalCTI = forwardRef(({ heading, draggable = false, visible = true, si
40
40
  '--cti-container-width': `${size.width}px`,
41
41
  '--cti-container-height': `${size.height}px`
42
42
  }
43
- : undefined, ref: ref }), attachInteractionProps && (_jsx(AttachInteractionDialog, { ...attachInteractionProps, target: target }))] }));
43
+ : undefined, ref: ref }), attachInteractionProps && dialogTarget && (_jsx(AttachInteractionDialog, { ...attachInteractionProps, close: () => {
44
+ setDialogTarget(null);
45
+ }, target: dialogTarget }))] }));
44
46
  });
45
47
  export default ExternalCTI;
46
48
  //# sourceMappingURL=ExternalCTI.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalCTI.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/ExternalCTI.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAiB,UAAU,EAA2C,MAAM,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,O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AE;wBACC,uBAAuB,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI;wBAC1C,wBAAwB,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI;qBAC3B;oBACrB,CAAC,CAAC,SAAS,EAEf,GAAG,EAAE,GAAG,GACR,EACD,sBAAsB,IAAI,CACzB,KAAC,uBAAuB,OAAK,sBAAsB,EAAE,MAAM,EAAE,MAAM,GAAI,CACxE,IACsB,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { CSSProperties, forwardRef, FunctionComponent, PropsWithoutRef, Ref, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, ForwardProps, useDialog } from '@pega/cosmos-react-core';\n\nimport AttachInteractionDialog, { type AttachInteractionProps } from './AttachInteractionDialog';\nimport FloatingPanel, { FloatingPanelProps } from './FloatingPanel';\n\nexport interface ExternalCTIProps {\n /** The heading rendered. */\n heading: string;\n /** If true, the component will be draggable. */\n draggable?: boolean;\n /** If true, the component will be visible. */\n visible?: FloatingPanelProps['visible'];\n /** Container element size in px. */\n size?: {\n width: number;\n height: number;\n };\n /** Reference to the container. */\n ref?: Ref<HTMLDivElement>;\n /**\n * Attach intraction popup options.\n */\n attachInteractionProps?: AttachInteractionProps;\n}\n\nconst StyledExternalCTIPanel = styled(FloatingPanel)(\n ({\n theme: {\n components: {\n card: { 'border-radius': borderRadius }\n }\n }\n }) => {\n return css`\n width: auto;\n iframe {\n border: transparent;\n display: block;\n border-end-start-radius: ${borderRadius};\n border-end-end-radius: ${borderRadius};\n }\n `;\n }\n);\n\nStyledExternalCTIPanel.defaultProps = defaultThemeProp;\n\nconst StyledCTIContainer = styled.div`\n width: var(--cti-container-width, auto);\n height: var(--cti-container-height, auto);\n overflow-y: auto;\n`;\n\nStyledCTIContainer.defaultProps = defaultThemeProp;\n\nconst ExternalCTI: FunctionComponent<ExternalCTIProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n draggable = false,\n visible = true,\n size,\n attachInteractionProps\n }: PropsWithoutRef<ExternalCTIProps>,\n ref: ExternalCTIProps['ref']\n ) => {\n const interactionButtonRef = useRef<HTMLButtonElement>(null);\n const { events, target } = useDialog();\n\n return (\n <StyledExternalCTIPanel\n heading={heading}\n draggable={draggable}\n visible={visible}\n actions={\n attachInteractionProps\n ? [\n {\n id: 'add-interaction',\n text: attachInteractionProps.heading,\n icon: 'paper-clip',\n ref: interactionButtonRef,\n ...events\n }\n ]\n : undefined\n }\n >\n <StyledCTIContainer\n style={\n size\n ? ({\n '--cti-container-width': `${size.width}px`,\n '--cti-container-height': `${size.height}px`\n } as CSSProperties)\n : undefined\n }\n ref={ref}\n />\n {attachInteractionProps && (\n <AttachInteractionDialog {...attachInteractionProps} target={target} />\n )}\n </StyledExternalCTIPanel>\n );\n }\n);\n\nexport default ExternalCTI;\n"]}
1
+ {"version":3,"file":"ExternalCTI.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/ExternalCTI.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAiC,MAAM,yBAAyB,CAAC;AAE1F,OAAO,uBAAwD,MAAM,2BAA2B,CAAC;AACjG,OAAO,aAAqC,MAAM,iBAAiB,CAAC;AAsBpE,MAAM,sBAAsB,GAAyB,MAAM,CAAC,aAAa,CAAC,CACxE,CAAC,EACC,KAAK,EAAE,EACL,UAAU,EAAE,EACV,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,EACxC,EACF,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;;;mCAKqB,YAAY;iCACd,YAAY;;KAExC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEvD,MAAM,kBAAkB,GAAG,M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ctionComponent,\n PropsWithoutRef,\n Ref,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, FormDialogProps, ForwardProps } from '@pega/cosmos-react-core';\n\nimport AttachInteractionDialog, { type AttachInteractionProps } from './AttachInteractionDialog';\nimport FloatingPanel, { FloatingPanelProps } from './FloatingPanel';\n\nexport interface ExternalCTIProps {\n /** The heading rendered. */\n heading: string;\n /** If true, the component will be draggable. */\n draggable?: boolean;\n /** If true, the component will be visible. */\n visible?: FloatingPanelProps['visible'];\n /** Container element size in px. */\n size?: {\n width: number;\n height: number;\n };\n /** Reference to the container. */\n ref?: Ref<HTMLDivElement>;\n /**\n * Attach intraction popup options.\n */\n attachInteractionProps?: AttachInteractionProps;\n}\n\nconst StyledExternalCTIPanel: typeof FloatingPanel = styled(FloatingPanel)(\n ({\n theme: {\n components: {\n card: { 'border-radius': borderRadius }\n }\n }\n }) => {\n return css`\n width: auto;\n iframe {\n border: transparent;\n display: block;\n border-end-start-radius: ${borderRadius};\n border-end-end-radius: ${borderRadius};\n }\n `;\n }\n);\n\nStyledExternalCTIPanel.defaultProps = defaultThemeProp;\n\nconst StyledCTIContainer = styled.div`\n width: var(--cti-container-width, auto);\n height: var(--cti-container-height, auto);\n overflow-y: auto;\n`;\n\nStyledCTIContainer.defaultProps = defaultThemeProp;\n\nconst ExternalCTI: FunctionComponent<ExternalCTIProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n draggable = false,\n visible = true,\n size,\n attachInteractionProps\n }: PropsWithoutRef<ExternalCTIProps>,\n ref: ExternalCTIProps['ref']\n ) => {\n const [dialogTarget, setDialogTarget] = useState<FormDialogProps['target'] | null>(null);\n\n return (\n <StyledExternalCTIPanel\n heading={heading}\n draggable={draggable}\n visible={visible}\n actions={\n attachInteractionProps\n ? [\n {\n id: 'add-interaction',\n text: attachInteractionProps.heading,\n icon: 'paper-clip',\n onClick: (id, e) => {\n setDialogTarget(e.currentTarget);\n }\n }\n ]\n : undefined\n }\n >\n <StyledCTIContainer\n style={\n size\n ? ({\n '--cti-container-width': `${size.width}px`,\n '--cti-container-height': `${size.height}px`\n } as CSSProperties)\n : undefined\n }\n ref={ref}\n />\n {attachInteractionProps && dialogTarget && (\n <AttachInteractionDialog\n {...attachInteractionProps}\n close={() => {\n setDialogTarget(null);\n }}\n target={dialogTarget}\n />\n )}\n </StyledExternalCTIPanel>\n );\n }\n);\n\nexport default ExternalCTI;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingPanel.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/FloatingPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAEjB,SAAS,EACT,GAAG,EAKJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAQL,YAAY,EAGZ,MAAM,EACN,QAAQ,EAIT,MAAM,yBAAyB,CAAC;AAYjC,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACjB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,4CAA4C;IAC5C,IAAI,EAAE,QAAQ,CAAC;IACf,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,yCAAyC;IACzC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACrC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,GAAG,CAAC,EAAE,GAAG,C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,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CA6EvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -60,7 +60,9 @@ const FloatingPanel = forwardRef(({ heading, actions = [], draggable, children,
60
60
  setHeaderHeight(containerRef.current.querySelector('header')?.offsetHeight || 0);
61
61
  }
62
62
  }, [collapsed]);
63
- return (_jsxs(StyledFloatingPanel, { ...restProps, ref: containerRef, isCollapsed: collapsed, isDraggable: draggable, isVisible: visible, style: { '--headerHeight': `${headerHeight}px` }, children: [_jsx(CardHeader, { ref: dragRef, actions: _jsxs(_Fragment, { children: [actions.map(({ id, icon, text, ...restAction }) => (_createElement(Button, { ...restAction, icon: true, variant: 'simple', key: id, label: text },
63
+ return (_jsxs(StyledFloatingPanel, { ...restProps, ref: containerRef, isCollapsed: collapsed, isDraggable: draggable, isVisible: visible, style: { '--headerHeight': `${headerHeight}px` }, children: [_jsx(CardHeader, { ref: dragRef, actions: _jsxs(_Fragment, { children: [actions.map(({ id, icon, text, onClick, ...restAction }) => (_createElement(Button, { ...restAction, icon: true, variant: 'simple', key: id, label: text, onClick: (e) => {
64
+ onClick?.(id, e);
65
+ } },
64
66
  _jsx(Icon, { name: icon })))), _jsx(Button, { icon: true, variant: 'simple', label: t(collapsed ? 'call_panel_expand' : 'call_panel_collapse'), onClick: () => {
65
67
  resetPopoverToDefaultPosition(containerRef);
66
68
  setCollapsed(state => !state);
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingPanel.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/FloatingPanel.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAMV,eAAe,EACf,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,UAAU,EACV,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,E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E,CAAC,CAClD,eAAC,MAAM,OAAK,UAAU,EAAE,IAAI,QAAC,OAAO,EAAC,QAAQ,EAAC,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI;4BAChE,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,CACb,CACV,CAAC,EACF,KAAC,MAAM,IACL,IAAI,QACJ,OAAO,EAAC,QAAQ,EAEhB,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,qBAAqB,CAAC,EACjE,OAAO,EAAE,GAAG,EAAE;gCACZ,6BAA6B,CAAC,YAAY,CAAC,CAAC;gCAC5C,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;4BAChC,CAAC,YAED,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,IAPtB,iBAAiB,CAQd,IACR,YAGL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,aACnD,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,GAAG,EACvB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,OAAO,GAAQ,IAC9B,GACI,EACZ,QAAQ,IACW,CACvB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n CSSProperties,\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n Ref,\n RefObject,\n useLayoutEffect,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n CardHeader,\n Button,\n useI18n,\n Icon,\n registerIcon,\n Flex,\n Text,\n ForwardProps,\n useConsolidatedRef,\n useDraggable,\n Action,\n IconName,\n defaultThemeProp,\n StyledButton,\n StyledCard\n} from '@pega/cosmos-react-core';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport * as headsetIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/headset.icon';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\n\nregisterIcon(caretDownIcon, headsetIcon);\n\nconst resetPopoverToDefaultPosition = (containerRef: RefObject<HTMLDivElement>): void => {\n if (containerRef && containerRef.current)\n containerRef.current.style.transform = 'translate(0px, 0px)';\n};\n\nexport interface FloatingPanelActionProps extends ForwardProps {\n /** A string to uniquely identify this Action within the onClick handler. */\n id: Action['id'];\n /** The text content of the Action. */\n text: Action['text'];\n /** Name of the icon from the cosmos set. */\n icon: IconName;\n /** Determines if the Action will be disabled. */\n disabled?: Action['disabled'];\n /** Called when the Action is clicked. */\n onClick: NonNullable<Action['onClick']>;\n}\n\nexport interface FloatingPanelProps {\n /** The heading rendered. */\n heading: string;\n /** Content of the panel */\n children: ReactNode;\n /** Action button to be rendered in header */\n actions?: FloatingPanelActionProps[];\n /** If true, the component will be draggable */\n draggable?: boolean;\n /** If true, the panel is visible. */\n visible?: boolean;\n /** Reference to the root component. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledFloatingPanel = styled(StyledCard)<{\n isCollapsed: boolean;\n isDraggable?: boolean;\n isVisible?: boolean;\n}>(({ theme, isCollapsed, isDraggable, isVisible = true }) => {\n return css`\n max-height: calc(100% - 2rem);\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n width: 25rem;\n right: calc(2 * ${theme.base.spacing});\n bottom: calc(2 * ${theme.base.spacing});\n box-shadow: ${theme.base.shadow.high};\n\n ${!isVisible &&\n css`\n display: none;\n `}\n\n ${isCollapsed &&\n css`\n transform: translateY(\n calc(100% - var(--headerHeight) + calc(2 * ${theme.base.spacing}))\n ) !important;\n `}\n\n ${StyledCardHeader} {\n ${!isCollapsed &&\n isDraggable &&\n css`\n cursor: all-scroll;\n `}\n }\n ${StyledCardHeader} ${StyledButton}:last-child {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};\n }\n `;\n});\n\nStyledFloatingPanel.defaultProps = defaultThemeProp;\n\nconst FloatingPanel: FunctionComponent<FloatingPanelProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n actions = [],\n draggable,\n children,\n visible = true,\n ...restProps\n }: PropsWithoutRef<FloatingPanelProps>,\n ref: FloatingPanelProps['ref']\n ) => {\n const t = useI18n();\n const [collapsed, setCollapsed] = useState(false);\n const containerRef = useConsolidatedRef(ref);\n const dragRef = useRef<HTMLDivElement>(null);\n useDraggable(containerRef, dragRef, !collapsed && draggable);\n\n const [headerHeight, setHeaderHeight] = useState(0);\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setHeaderHeight(containerRef.current.querySelector('header')?.offsetHeight || 0);\n }\n }, [collapsed]);\n\n return (\n <StyledFloatingPanel\n {...restProps}\n ref={containerRef}\n isCollapsed={collapsed}\n isDraggable={draggable}\n isVisible={visible}\n style={{ '--headerHeight': `${headerHeight}px` } as CSSProperties}\n >\n <CardHeader\n ref={dragRef}\n actions={\n <>\n {actions.map(({ id, icon, text, ...restAction }) => (\n <Button {...restAction} icon variant='simple' key={id} label={text}>\n <Icon name={icon} />\n </Button>\n ))}\n <Button\n icon\n variant='simple'\n key='expand-collapse'\n label={t(collapsed ? 'call_panel_expand' : 'call_panel_collapse')}\n onClick={() => {\n resetPopoverToDefaultPosition(containerRef);\n setCollapsed(state => !state);\n }}\n >\n <Icon name='caret-down' />\n </Button>\n </>\n }\n >\n <Flex container={{ alignItems: 'center', itemGap: 1 }}>\n <Icon name='headset' />\n <Text variant='h3'>{heading}</Text>\n </Flex>\n </CardHeader>\n {children}\n </StyledFloatingPanel>\n );\n }\n);\n\nexport default FloatingPanel;\n"]}
1
+ {"version":3,"file":"FloatingPanel.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/FloatingPanel.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAOV,eAAe,EACf,MAAM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ef,\n ReactNode,\n Ref,\n RefObject,\n useLayoutEffect,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n CardHeader,\n Button,\n useI18n,\n Icon,\n registerIcon,\n Flex,\n Text,\n ForwardProps,\n useConsolidatedRef,\n useDraggable,\n Action,\n IconName,\n defaultThemeProp,\n StyledButton,\n StyledCard\n} from '@pega/cosmos-react-core';\nimport * as caretDownIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-down.icon';\nimport * as headsetIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/headset.icon';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\n\nregisterIcon(caretDownIcon, headsetIcon);\n\nconst resetPopoverToDefaultPosition = (containerRef: RefObject<HTMLDivElement>): void => {\n if (containerRef && containerRef.current)\n containerRef.current.style.transform = 'translate(0px, 0px)';\n};\n\nexport interface FloatingPanelActionProps extends ForwardProps {\n /** A string to uniquely identify this Action within the onClick handler. */\n id: Action['id'];\n /** The text content of the Action. */\n text: Action['text'];\n /** Name of the icon from the cosmos set. */\n icon: IconName;\n /** Determines if the Action will be disabled. */\n disabled?: Action['disabled'];\n /** Called when the Action is clicked. */\n onClick: NonNullable<Action['onClick']>;\n}\n\nexport interface FloatingPanelProps {\n /** The heading rendered. */\n heading: string;\n /** Content of the panel */\n children: ReactNode;\n /** Action button to be rendered in header */\n actions?: FloatingPanelActionProps[];\n /** If true, the component will be draggable */\n draggable?: boolean;\n /** If true, the panel is visible. */\n visible?: boolean;\n /** Reference to the root component. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledFloatingPanel = styled(StyledCard)<{\n isCollapsed: boolean;\n isDraggable?: boolean;\n isVisible?: boolean;\n}>(({ theme, isCollapsed, isDraggable, isVisible = true }) => {\n return css`\n max-height: calc(100% - 2rem);\n position: fixed;\n z-index: calc(${theme.base['z-index'].backdrop} - 1);\n width: 25rem;\n right: calc(2 * ${theme.base.spacing});\n bottom: calc(2 * ${theme.base.spacing});\n box-shadow: ${theme.base.shadow.high};\n\n ${!isVisible &&\n css`\n display: none;\n `}\n\n ${isCollapsed &&\n css`\n transform: translateY(\n calc(100% - var(--headerHeight) + calc(2 * ${theme.base.spacing}))\n ) !important;\n `}\n\n ${StyledCardHeader} {\n ${!isCollapsed &&\n isDraggable &&\n css`\n cursor: all-scroll;\n `}\n }\n ${StyledCardHeader} ${StyledButton}:last-child {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};\n }\n `;\n});\n\nStyledFloatingPanel.defaultProps = defaultThemeProp;\n\nconst FloatingPanel: FunctionComponent<FloatingPanelProps & ForwardProps> = forwardRef(\n (\n {\n heading,\n actions = [],\n draggable,\n children,\n visible = true,\n ...restProps\n }: PropsWithoutRef<FloatingPanelProps>,\n ref: FloatingPanelProps['ref']\n ) => {\n const t = useI18n();\n const [collapsed, setCollapsed] = useState(false);\n const containerRef = useConsolidatedRef(ref);\n const dragRef = useRef<HTMLDivElement>(null);\n useDraggable(containerRef, dragRef, !collapsed && draggable);\n\n const [headerHeight, setHeaderHeight] = useState(0);\n\n useLayoutEffect(() => {\n if (containerRef.current) {\n setHeaderHeight(containerRef.current.querySelector('header')?.offsetHeight || 0);\n }\n }, [collapsed]);\n\n return (\n <StyledFloatingPanel\n {...restProps}\n ref={containerRef}\n isCollapsed={collapsed}\n isDraggable={draggable}\n isVisible={visible}\n style={{ '--headerHeight': `${headerHeight}px` } as CSSProperties}\n >\n <CardHeader\n ref={dragRef}\n actions={\n <>\n {actions.map(({ id, icon, text, onClick, ...restAction }) => (\n <Button\n {...restAction}\n icon\n variant='simple'\n key={id}\n label={text}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onClick?.(id, e);\n }}\n >\n <Icon name={icon} />\n </Button>\n ))}\n <Button\n icon\n variant='simple'\n key='expand-collapse'\n label={t(collapsed ? 'call_panel_expand' : 'call_panel_collapse')}\n onClick={() => {\n resetPopoverToDefaultPosition(containerRef);\n setCollapsed(state => !state);\n }}\n >\n <Icon name='caret-down' />\n </Button>\n </>\n }\n >\n <Flex container={{ alignItems: 'center', itemGap: 1 }}>\n <Icon name='headset' />\n <Text variant='h3'>{heading}</Text>\n </Flex>\n </CardHeader>\n {children}\n </StyledFloatingPanel>\n );\n }\n);\n\nexport default FloatingPanel;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StopWatch.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/StopWatch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAOzE,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,qRAG3B,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAwBhD,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"StopWatch.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/StopWatch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAOzE,UAAU,cAAc;IAEtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,qRAG3B,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAwBhD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -9,8 +9,8 @@ export const StyledStopWatch = styled(StyledText) `
9
9
  `;
10
10
  const StopWatch = memo(({ startTime, timeout }) => {
11
11
  const clockRef = useRef(null);
12
- const millis = startTime instanceof Date ? startTime.getUTCMilliseconds() : startTime;
13
- const timeoutMillis = timeout instanceof Date ? timeout.getUTCMilliseconds() : timeout;
12
+ const millis = Number(startTime);
13
+ const timeoutMillis = Number(timeout);
14
14
  useLayoutEffect(() => {
15
15
  const timer = setInterval(() => {
16
16
  if (clockRef.current) {
@@ -1 +1 @@
1
- {"version":3,"file":"StopWatch.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/StopWatch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAOzC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;;;CAGhD,CAAC;AAEF,MAAM,SAAS,GAAsC,IAAI,CACvD,CAAC,EAAE,SAAS,EAAE,OAAO,EAAkB,EAAE,EAAE;IACzC,MAAM,QAAQ,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,SAAS,YAAY,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,MAAM,aAAa,GAAG,OAAO,YAAY,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAEvF,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;YAC7B,IAAI,QAAQ,CAAC,OAAO,EAAE;gBACpB,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;gBAClD,IAAI,aAAa;oBAAE,OAAO,IAAI,MAAM,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;gBACpE,QAAQ,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;aACxC;QACH,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;IAE/B,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,QAAQ,aACrC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,EACnC,aAAa,IAAI,MAAM,cAAc,CAAC,aAAa,CAAC,EAAE,IAClD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { FunctionComponent, memo, useRef, useLayoutEffect } from 'react';\nimport styled from 'styled-components';\n\nimport { StyledText, Text } from '@pega/cosmos-react-core';\n\nimport { formatDuration } from './utils';\n\ninterface StopWatchProps {\n startTime: number | Date;\n timeout?: number | Date;\n}\n\nexport const StyledStopWatch = styled(StyledText)`\n min-width: 8ch;\n text-align: end;\n`;\n\nconst StopWatch: FunctionComponent<StopWatchProps> = memo(\n ({ startTime, timeout }: StopWatchProps) => {\n const clockRef = useRef<HTMLSpanElement>(null);\n const millis = startTime instanceof Date ? startTime.getUTCMilliseconds() : startTime;\n const timeoutMillis = timeout instanceof Date ? timeout.getUTCMilliseconds() : timeout;\n\n useLayoutEffect(() => {\n const timer = setInterval(() => {\n if (clockRef.current) {\n let content = formatDuration(Date.now() - millis);\n if (timeoutMillis) content += ` / ${formatDuration(timeoutMillis)}`;\n clockRef.current.textContent = content;\n }\n }, 1000);\n return () => clearInterval(timer);\n }, [startTime, timeoutMillis]);\n\n return (\n <Text as={StyledStopWatch} ref={clockRef}>\n {formatDuration(Date.now() - millis)}\n {timeoutMillis && ` / ${formatDuration(timeoutMillis)}`}\n </Text>\n );\n }\n);\n\nexport default StopWatch;\n"]}
1
+ {"version":3,"file":"StopWatch.js","sourceRoot":"","sources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G,MAAM,CAAC,EACnC,aAAa,IAAI,MAAM,cAAc,CAAC,aAAa,CAAC,EAAE,IAClD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { FunctionComponent, memo, useRef, useLayoutEffect } from 'react';\nimport styled from 'styled-components';\n\nimport { StyledText, Text } from '@pega/cosmos-react-core';\n\nimport { formatDuration } from './utils';\n\ninterface StopWatchProps {\n /* Defines the Date or Epoch time as a starting point of the stop watch. */\n startTime: number | Date;\n /* Defines the Date or Epoch time of the timeout. */\n timeout?: number | Date;\n}\n\nexport const StyledStopWatch = styled(StyledText)`\n min-width: 8ch;\n text-align: end;\n`;\n\nconst StopWatch: FunctionComponent<StopWatchProps> = memo(\n ({ startTime, timeout }: StopWatchProps) => {\n const clockRef = useRef<HTMLSpanElement>(null);\n const millis = Number(startTime);\n const timeoutMillis = Number(timeout);\n\n useLayoutEffect(() => {\n const timer = setInterval(() => {\n if (clockRef.current) {\n let content = formatDuration(Date.now() - millis);\n if (timeoutMillis) content += ` / ${formatDuration(timeoutMillis)}`;\n clockRef.current.textContent = content;\n }\n }, 1000);\n return () => clearInterval(timer);\n }, [startTime, timeoutMillis]);\n\n return (\n <Text as={StyledStopWatch} ref={clockRef}>\n {formatDuration(Date.now() - millis)}\n {timeoutMillis && ` / ${formatDuration(timeoutMillis)}`}\n </Text>\n );\n }\n);\n\nexport default StopWatch;\n"]}
@@ -10,13 +10,13 @@ export interface DialButtonRow {
10
10
  rowId: number;
11
11
  dialButtons: DialButton[];
12
12
  }
13
- export declare type KeyDownNavigateOptions = {
13
+ export type KeyDownNavigateOptions = {
14
14
  [key: string]: (previousId: number) => number;
15
15
  };
16
- export declare type KeyDownDialButtonOptions = {
16
+ export type KeyDownDialButtonOptions = {
17
17
  [key: string]: DialButton;
18
18
  };
19
- export declare type Index = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
19
+ export type Index = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
20
20
  export interface NavigationGraphElement {
21
21
  sign?: string;
22
22
  alt?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"DialPad.types.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/DialPad.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,oBAAY,sBAAsB,GAAG;IACnC,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B,CAAC;AAEF,oBAAY,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEzE,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;I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,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,KAAK,CAAC;IACX,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
@@ -1,6 +1,6 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
- export declare type DialPadKeyboardMode = 'default' | 'DTMF';
3
+ export type DialPadKeyboardMode = 'default' | 'DTMF';
4
4
  export interface DialPadKeyboardProps extends NoChildrenProp {
5
5
  /** Callback fired on dial button click */
6
6
  onDialButtonClick: (charCode: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"DialPadKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/DialPadKeyboard.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAEZ,cAAc,EAIf,MAAM,yBAAyB,CAAC;AAUjC,oBAAY,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,0CAA0C;IAC1C,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,6BAA6B;IAC7B,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAkJ3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"DialPadKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/DialPadKeyboard.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAEZ,cAAc,EAIf,MAAM,yBAAyB,CAAC;AAUjC,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,0CAA0C;IAC1C,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,6BAA6B;IAC7B,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAkJ3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { FunctionComponent, MouseEventHandler } from 'react';
2
+ import { NoChildrenProp } from '@pega/cosmos-react-core';
3
+ export interface AcceptButtonProps extends NoChildrenProp {
4
+ /** Start time of incoming Interaction. */
5
+ startTime: Date | number;
6
+ /** The time the user has to accept the call in seconds. */
7
+ timeout: number;
8
+ /** Callback invoked when timeout ends. */
9
+ onTimerEnd?: () => void;
10
+ /** Callback invoked when user clicks the button. */
11
+ onClick: MouseEventHandler;
12
+ }
13
+ declare const AcceptButton: FunctionComponent<AcceptButtonProps>;
14
+ export default AcceptButton;
15
+ //# sourceMappingURL=AcceptButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcceptButton.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/AcceptButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAQ,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAGxF,OAAO,EAOL,cAAc,EACf,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,0CAA0C;IAC1C,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,oDAAoD;IACpD,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAUD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAoDtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { memo, useEffect, useState } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { useI18n, Text, VisuallyHiddenText, useUID, Button, defaultThemeProp } from '@pega/cosmos-react-core';
5
+ import { formatDuration } from '../CallControlPanel/utils';
6
+ const StyledAcceptButton = styled(Button)(({ theme }) => css `
7
+ gap: ${theme.base.spacing};
8
+ `);
9
+ StyledAcceptButton.defaultProps = defaultThemeProp;
10
+ const AcceptButton = memo(({ startTime, timeout, onTimerEnd, onClick }) => {
11
+ const timeoutMs = timeout * 1000;
12
+ const start = Number(startTime);
13
+ const endTime = start + timeoutMs;
14
+ const [msRemaining, setMsRemaining] = useState(() => endTime - Date.now());
15
+ const secondsRemaining = Math.round(msRemaining / 1000);
16
+ const t = useI18n();
17
+ const descriptionId = useUID();
18
+ useEffect(() => {
19
+ let timeoutId;
20
+ if (msRemaining > 0) {
21
+ timeoutId = window.setTimeout(() => {
22
+ setMsRemaining(endTime - Date.now());
23
+ }, 1000);
24
+ }
25
+ else {
26
+ onTimerEnd?.();
27
+ }
28
+ return () => clearTimeout(timeoutId);
29
+ },
30
+ /*
31
+ * Omitting onTimerEnd as an effect trigger on purpose.
32
+ * An unstable function definition in the prop causes the effect to run more than necessary.
33
+ * The proper definition will be captured and used with any changes to msRemaining.
34
+ */
35
+ [msRemaining]);
36
+ const timer = msRemaining > 0 ? formatDuration(msRemaining) : '0:00';
37
+ return (_jsxs(_Fragment, { children: [_jsxs(StyledAcceptButton, { variant: 'primary', "aria-describedby": descriptionId, onClick: onClick, children: [t('accept'), _jsx(Text, { "aria-hidden": 'true', children: timer })] }), _jsx(VisuallyHiddenText, { "aria-hidden": 'true', id: descriptionId, children: msRemaining > 0
38
+ ? t('interaction_time_remaining', [secondsRemaining], {
39
+ count: secondsRemaining
40
+ })
41
+ : t('interaction_time_expired') })] }));
42
+ });
43
+ export default AcceptButton;
44
+ //# sourceMappingURL=AcceptButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcceptButton.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/AcceptButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,IAAI,EAAqB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,OAAO,EACP,IAAI,EACJ,kBAAkB,EAClB,MAAM,EACN,MAAM,EACN,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CACvC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;WACT,KAAK,CAAC,IAAI,CAAC,OAAO;GAC1B,CACF,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,YAAY,GAAyC,IAAI,CAC7D,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAqB,EAAE,EAAE;IACjE,MAAM,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAE3E,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAExD,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC;IAE/B,SAAS,CACP,GAAG,EAAE;QACH,IAAI,SAAiB,CAAC;QAEtB,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACjC,cAAc,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACvC,CAAC,EAAE,IAAI,CAAC,CAAC;SACV;aAAM;YACL,UAAU,EAAE,EAAE,CAAC;SAChB;QAED,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IACD;;;;OAIG;IACH,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,MAAM,KAAK,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAErE,OAAO,CACL,8BACE,MAAC,kBAAkB,IAAC,OAAO,EAAC,SAAS,sBAAmB,aAAa,EAAE,OAAO,EAAE,OAAO,aACpF,CAAC,CAAC,QAAQ,CAAC,EACZ,KAAC,IAAI,mBAAa,MAAM,YAAE,KAAK,GAAQ,IACpB,EACrB,KAAC,kBAAkB,mBAAa,MAAM,EAAC,EAAE,EAAE,aAAa,YACrD,WAAW,GAAG,CAAC;oBACd,CAAC,CAAC,CAAC,CAAC,4BAA4B,EAAE,CAAC,gBAAgB,CAAC,EAAE;wBAClD,KAAK,EAAE,gBAAgB;qBACxB,CAAC;oBACJ,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,GACd,IACpB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent, memo, MouseEventHandler, useEffect, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useI18n,\n Text,\n VisuallyHiddenText,\n useUID,\n Button,\n defaultThemeProp,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport { formatDuration } from '../CallControlPanel/utils';\n\nexport interface AcceptButtonProps extends NoChildrenProp {\n /** Start time of incoming Interaction. */\n startTime: Date | number;\n /** The time the user has to accept the call in seconds. */\n timeout: number;\n /** Callback invoked when timeout ends. */\n onTimerEnd?: () => void;\n /** Callback invoked when user clicks the button. */\n onClick: MouseEventHandler;\n}\n\nconst StyledAcceptButton = styled(Button)(\n ({ theme }) => css`\n gap: ${theme.base.spacing};\n `\n);\n\nStyledAcceptButton.defaultProps = defaultThemeProp;\n\nconst AcceptButton: FunctionComponent<AcceptButtonProps> = memo(\n ({ startTime, timeout, onTimerEnd, onClick }: AcceptButtonProps) => {\n const timeoutMs = timeout * 1000;\n const start = Number(startTime);\n const endTime = start + timeoutMs;\n const [msRemaining, setMsRemaining] = useState(() => endTime - Date.now());\n\n const secondsRemaining = Math.round(msRemaining / 1000);\n\n const t = useI18n();\n const descriptionId = useUID();\n\n useEffect(\n () => {\n let timeoutId: number;\n\n if (msRemaining > 0) {\n timeoutId = window.setTimeout(() => {\n setMsRemaining(endTime - Date.now());\n }, 1000);\n } else {\n onTimerEnd?.();\n }\n\n return () => clearTimeout(timeoutId);\n },\n /*\n * Omitting onTimerEnd as an effect trigger on purpose.\n * An unstable function definition in the prop causes the effect to run more than necessary.\n * The proper definition will be captured and used with any changes to msRemaining.\n */\n [msRemaining]\n );\n\n const timer = msRemaining > 0 ? formatDuration(msRemaining) : '0:00';\n\n return (\n <>\n <StyledAcceptButton variant='primary' aria-describedby={descriptionId} onClick={onClick}>\n {t('accept')}\n <Text aria-hidden='true'>{timer}</Text>\n </StyledAcceptButton>\n <VisuallyHiddenText aria-hidden='true' id={descriptionId}>\n {msRemaining > 0\n ? t('interaction_time_remaining', [secondsRemaining], {\n count: secondsRemaining\n })\n : t('interaction_time_expired')}\n </VisuallyHiddenText>\n </>\n );\n }\n);\n\nexport default AcceptButton;\n"]}
@@ -1,5 +1,6 @@
1
1
  import { FunctionComponent, Ref } from 'react';
2
2
  import { StatusProps, ForwardProps, FieldValueListProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import { AcceptButtonProps } from './AcceptButton';
3
4
  export interface InteractionNotificationProps extends NoChildrenProp {
4
5
  /** Ref to Component. */
5
6
  ref?: Ref<HTMLDivElement>;
@@ -18,8 +19,16 @@ export interface InteractionNotificationProps extends NoChildrenProp {
18
19
  };
19
20
  /** Information structured as field values to be displayed below main section. */
20
21
  fields?: FieldValueListProps['fields'];
22
+ /** Timeout definition */
23
+ incomingNotificationTimeout?: {
24
+ startTime: AcceptButtonProps['startTime'];
25
+ answerTimeout: AcceptButtonProps['timeout'];
26
+ onTimerEnd?: AcceptButtonProps['onTimerEnd'];
27
+ };
21
28
  /** Callback when accept button is clicked. */
22
- onAccept?: () => void;
29
+ onAccept: () => void;
30
+ /** Callback when decline button is clicked. */
31
+ onDecline?: () => void;
23
32
  }
24
33
  declare const InteractionNotification: FunctionComponent<InteractionNotificationProps & ForwardProps>;
25
34
  export default InteractionNotification;
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionNotification.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/InteractionNotification.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAOL,WAAW,EACX,YAAY,EAUZ,mBAAmB,EAEnB,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAKjC,MAAM,WAAW,4BAA6B,SAAQ,cAAc;IAClE,wBAAwB;IACxB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,MAAM,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,iFAAiF;IACjF,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAqED,QAAA,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,4BAA4B,GAAG,YAAY,CAiDzF,CAAC;AAEJ,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"InteractionNotification.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/InteractionNotification.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5E,OAAO,EAOL,WAAW,EACX,YAAY,EASZ,mBAAmB,EAEnB,cAAc,EAGf,MAAM,yBAAyB,CAAC;AAKjC,OAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,MAAM,WAAW,4BAA6B,SAAQ,cAAc;IAClE,wBAAwB;IACxB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,MAAM,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,iFAAiF;IACjF,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,yBAAyB;IACzB,2BAA2B,CAAC,EAAE;QAC5B,SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC1C,aAAa,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC5C,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;KAC9C,CAAC;IACF,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAmED,QAAA,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,4BAA4B,GAAG,YAAY,CAsEzF,CAAC;AAEJ,eAAe,uBAAuB,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Button, Card, CardContent, CardHeader, Status, Text, defaultThemeProp, Flex, StyledText, FieldValueList, StyledFieldName, CardFooter, StyledFieldValueList, StyledButton, useI18n, useDirection, Icon } from '@pega/cosmos-react-core';
4
+ import { Button, Card, CardContent, CardHeader, Status, Text, defaultThemeProp, Flex, StyledText, FieldValueList, CardFooter, StyledFieldValueList, StyledButton, useI18n, useDirection, Icon, StyledLabel } from '@pega/cosmos-react-core';
5
5
  import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
6
6
  import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
7
7
  import { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';
8
+ import AcceptButton from './AcceptButton';
8
9
  const StyledInteractionNotification = styled(Card)(({ theme: { base } }) => {
9
10
  const { rtl } = useDirection();
10
11
  return css `
@@ -56,23 +57,22 @@ const StyledInteractionNotification = styled(Card)(({ theme: { base } }) => {
56
57
  }
57
58
  }
58
59
 
59
- ${StyledCardFooter} {
60
- ${StyledFieldValueList} {
61
- border-top: solid 0.0625rem ${base.colors.gray.medium};
62
- padding-top: calc(2 * ${base.spacing});
63
- color: ${base.colors.white};
60
+ ${StyledFieldValueList} {
61
+ border-top: solid 0.0625rem ${base.colors.gray.medium};
62
+ padding-top: calc(2 * ${base.spacing});
63
+ color: ${base.colors.white};
64
64
 
65
- ${StyledFieldName} {
66
- color: ${base.colors.white};
67
- }
65
+ ${StyledLabel} {
66
+ color: ${base.colors.white};
68
67
  }
69
68
  }
70
69
  `;
71
70
  });
72
71
  StyledInteractionNotification.defaultProps = defaultThemeProp;
73
- const InteractionNotification = forwardRef(({ icon, title, primaryText, secondaryText, status, fields, onAccept }, ref) => {
72
+ const InteractionNotification = forwardRef(({ icon, title, primaryText, secondaryText, status, fields, incomingNotificationTimeout, onAccept, onDecline }, ref) => {
74
73
  const t = useI18n();
75
- return (_jsxs(StyledInteractionNotification, { ref: ref, children: [_jsx(CardHeader, { actions: onAccept ? (_jsx(Button, { variant: 'primary', onClick: onAccept, children: t('accept') })) : undefined, children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: icon }), _jsx(Text, { variant: 'h2', children: title })] }) }), _jsx(CardContent, { children: _jsxs(Flex, { container: { direction: 'column', alignItems: 'center', gap: 1 }, children: [_jsx(Text, { variant: 'h1', as: 'span', children: primaryText }), secondaryText && _jsx(Text, { variant: 'secondary', children: secondaryText }), _jsx(Status, { variant: status.variant, children: status.text })] }) }), fields && fields.length !== 0 && (_jsx(CardFooter, { children: _jsx(FieldValueList, { variant: 'inline', fields: fields }) }))] }));
74
+ const acceptButton = incomingNotificationTimeout ? (_jsx(AcceptButton, { startTime: incomingNotificationTimeout.startTime, timeout: incomingNotificationTimeout.answerTimeout, onTimerEnd: incomingNotificationTimeout.onTimerEnd ?? onDecline, onClick: onAccept })) : (_jsx(Button, { variant: 'primary', onClick: onAccept, children: t('accept') }));
75
+ return (_jsxs(StyledInteractionNotification, { ref: ref, children: [_jsx(CardHeader, { children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: icon }), _jsx(Text, { variant: 'h2', children: title })] }) }), _jsx(CardContent, { children: _jsxs(Flex, { container: { direction: 'column', alignItems: 'center', gap: 1 }, children: [_jsx(Text, { variant: 'h1', as: 'span', children: primaryText }), secondaryText && (_jsx(Text, { variant: 'h5', as: 'span', children: secondaryText })), _jsx(Status, { variant: status.variant, children: status.text })] }) }), fields && fields.length !== 0 && (_jsx(CardFooter, { justify: 'between', children: _jsx(FieldValueList, { variant: 'inline', fields: fields }) })), onDecline ? (_jsxs(Flex, { as: StyledCardFooter, container: { direction: 'row', justify: 'between' }, children: [_jsx(Button, { onClick: onDecline, children: t('decline') }), acceptButton] })) : (_jsx(Flex, { as: StyledCardFooter, container: { direction: 'row-reverse' }, children: acceptButton }))] }));
76
76
  });
77
77
  export default InteractionNotification;
78
78
  //# sourceMappingURL=InteractionNotification.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionNotification.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/InteractionNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,MAAM,EACN,IAAI,EAGJ,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,cAAc,EACd,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,YAAY,EACZ,OAAO,EAEP,YAAY,EAEZ,IAAI,EACL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAqB1F,MAAM,6BAA6B,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;IACzE,MAAM,EAAE,GAAG,EAAE,GAAG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,IAAI,IAAC,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC/C,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,EACpB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,KAAK,GAAQ,IAC5B,GACI,EACb,KAAC,WAAW,cACV,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aACpE,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,MAAM,YACzB,WAAW,GACP,EACN,aAAa,IAAI,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,aAAa,GAAQ,EAClE,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YAAG,MAAM,CAAC,IAAI,GAAU,IAClD,GACK,EACb,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,CAChC,KAAC,UAAU,cACT,KAAC,cAAc,IAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,EAAE,MAAM,GAAI,GACxC,CACd,IAC6B,CACjC,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,eAAe,uBAAuB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n Status,\n Text,\n StatusProps,\n ForwardProps,\n defaultThemeProp,\n Flex,\n StyledText,\n FieldValueList,\n StyledFieldName,\n CardFooter,\n StyledFieldValueList,\n StyledButton,\n useI18n,\n FieldValueListProps,\n useDirection,\n NoChildrenProp,\n Icon\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';\n\nexport interface InteractionNotificationProps extends NoChildrenProp {\n /** Ref to Component. */\n ref?: Ref<HTMLDivElement>;\n /** Name of the icon used in header. */\n icon: string;\n /** Interaction title. */\n title: string;\n /** Primary information of the notification. For example caller name . */\n primaryText: string;\n /** Secondary information of the notification. For example phone number of the caller */\n secondaryText?: string;\n /** Represents the current status of interaction. */\n status: { variant: StatusProps['variant']; text: string };\n /** Information structured as field values to be displayed below main section. */\n fields?: FieldValueListProps['fields'];\n /** Callback when accept button is clicked. */\n onAccept?: () => void;\n}\n\nconst StyledInteractionNotification = styled(Card)(({ theme: { base } }) => {\n const { rtl } = useDirection();\n return css`\n position: fixed;\n inset-inline-end: 1rem;\n inset-block-start: 4rem;\n width: clamp(21.5rem, calc(100% - 2rem), 25rem);\n z-index: ${base['z-index'].modal};\n color: ${base.colors.white};\n animation: SlideIn calc(4 * ${base.animation.speed});\n padding: calc(0.75 * ${base.spacing}) 0;\n\n &:not(& &) {\n background-color: ${base.colors.slate['extra-dark']};\n }\n\n @keyframes SlideIn {\n 0% {\n ${rtl\n ? css`\n transform: translateX(calc(-100% - 1rem));\n `\n : css`\n transform: translateX(calc(100% + 1rem));\n `}\n }\n\n 100% {\n transform: translateX(0);\n }\n }\n\n ${StyledCardHeader} {\n ${StyledButton} {\n margin-inline-start: calc(2 * ${base.spacing});\n }\n }\n\n ${StyledCardContent} {\n margin: calc(2 * ${base.spacing}) 0;\n\n ${StyledText} {\n color: ${base.colors.white};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n text-align: center;\n }\n }\n\n ${StyledCardFooter} {\n ${StyledFieldValueList} {\n border-top: solid 0.0625rem ${base.colors.gray.medium};\n padding-top: calc(2 * ${base.spacing});\n color: ${base.colors.white};\n\n ${StyledFieldName} {\n color: ${base.colors.white};\n }\n }\n }\n `;\n});\n\nStyledInteractionNotification.defaultProps = defaultThemeProp;\n\nconst InteractionNotification: FunctionComponent<InteractionNotificationProps & ForwardProps> =\n forwardRef(\n (\n {\n icon,\n title,\n primaryText,\n secondaryText,\n status,\n fields,\n onAccept\n }: PropsWithoutRef<InteractionNotificationProps>,\n ref: InteractionNotificationProps['ref']\n ) => {\n const t = useI18n();\n\n return (\n <StyledInteractionNotification ref={ref}>\n <CardHeader\n actions={\n onAccept ? (\n <Button variant='primary' onClick={onAccept}>\n {t('accept')}\n </Button>\n ) : undefined\n }\n >\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Icon name={icon} />\n <Text variant='h2'>{title}</Text>\n </Flex>\n </CardHeader>\n <CardContent>\n <Flex container={{ direction: 'column', alignItems: 'center', gap: 1 }}>\n <Text variant='h1' as='span'>\n {primaryText}\n </Text>\n {secondaryText && <Text variant='secondary'>{secondaryText}</Text>}\n <Status variant={status.variant}>{status.text}</Status>\n </Flex>\n </CardContent>\n {fields && fields.length !== 0 && (\n <CardFooter>\n <FieldValueList variant='inline' fields={fields} />\n </CardFooter>\n )}\n </StyledInteractionNotification>\n );\n }\n );\n\nexport default InteractionNotification;\n"]}
1
+ {"version":3,"file":"InteractionNotification.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/InteractionNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,UAAU,EACV,MAAM,EACN,IAAI,EAGJ,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,YAAY,EACZ,OAAO,EAEP,YAAY,EAEZ,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,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d,EACA,SAAS,CAAC,CAAC,CAAC,CACX,MAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,aAC7E,KAAC,MAAM,IAAC,OAAO,EAAE,SAAS,YAAG,CAAC,CAAC,SAAS,CAAC,GAAU,EAClD,YAAY,IACR,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,YAChE,YAAY,GACR,CACR,IAC6B,CACjC,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,eAAe,uBAAuB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Card,\n CardContent,\n CardHeader,\n Status,\n Text,\n StatusProps,\n ForwardProps,\n defaultThemeProp,\n Flex,\n StyledText,\n FieldValueList,\n CardFooter,\n StyledFieldValueList,\n StyledButton,\n useI18n,\n FieldValueListProps,\n useDirection,\n NoChildrenProp,\n Icon,\n StyledLabel\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledCardFooter } from '@pega/cosmos-react-core/lib/components/Card/CardFooter';\n\nimport AcceptButton, { AcceptButtonProps } from './AcceptButton';\n\nexport interface InteractionNotificationProps extends NoChildrenProp {\n /** Ref to Component. */\n ref?: Ref<HTMLDivElement>;\n /** Name of the icon used in header. */\n icon: string;\n /** Interaction title. */\n title: string;\n /** Primary information of the notification. For example caller name . */\n primaryText: string;\n /** Secondary information of the notification. For example phone number of the caller */\n secondaryText?: string;\n /** Represents the current status of interaction. */\n status: { variant: StatusProps['variant']; text: string };\n /** Information structured as field values to be displayed below main section. */\n fields?: FieldValueListProps['fields'];\n /** Timeout definition */\n incomingNotificationTimeout?: {\n startTime: AcceptButtonProps['startTime'];\n answerTimeout: AcceptButtonProps['timeout'];\n onTimerEnd?: AcceptButtonProps['onTimerEnd'];\n };\n /** Callback when accept button is clicked. */\n onAccept: () => void;\n /** Callback when decline button is clicked. */\n onDecline?: () => void;\n}\n\nconst StyledInteractionNotification = styled(Card)(({ theme: { base } }) => {\n const { rtl } = useDirection();\n return css`\n position: fixed;\n inset-inline-end: 1rem;\n inset-block-start: 4rem;\n width: clamp(21.5rem, calc(100% - 2rem), 25rem);\n z-index: ${base['z-index'].modal};\n color: ${base.colors.white};\n animation: SlideIn calc(4 * ${base.animation.speed});\n padding: calc(0.75 * ${base.spacing}) 0;\n\n &:not(& &) {\n background-color: ${base.colors.slate['extra-dark']};\n }\n\n @keyframes SlideIn {\n 0% {\n ${rtl\n ? css`\n transform: translateX(calc(-100% - 1rem));\n `\n : css`\n transform: translateX(calc(100% + 1rem));\n `}\n }\n\n 100% {\n transform: translateX(0);\n }\n }\n\n ${StyledCardHeader} {\n ${StyledButton} {\n margin-inline-start: calc(2 * ${base.spacing});\n }\n }\n\n ${StyledCardContent} {\n margin: calc(2 * ${base.spacing}) 0;\n\n ${StyledText} {\n color: ${base.colors.white};\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n width: 100%;\n text-align: center;\n }\n }\n\n ${StyledFieldValueList} {\n border-top: solid 0.0625rem ${base.colors.gray.medium};\n padding-top: calc(2 * ${base.spacing});\n color: ${base.colors.white};\n\n ${StyledLabel} {\n color: ${base.colors.white};\n }\n }\n `;\n});\n\nStyledInteractionNotification.defaultProps = defaultThemeProp;\n\nconst InteractionNotification: FunctionComponent<InteractionNotificationProps & ForwardProps> =\n forwardRef(\n (\n {\n icon,\n title,\n primaryText,\n secondaryText,\n status,\n fields,\n incomingNotificationTimeout,\n onAccept,\n onDecline\n }: PropsWithoutRef<InteractionNotificationProps>,\n ref: InteractionNotificationProps['ref']\n ) => {\n const t = useI18n();\n\n const acceptButton = incomingNotificationTimeout ? (\n <AcceptButton\n startTime={incomingNotificationTimeout.startTime}\n timeout={incomingNotificationTimeout.answerTimeout}\n onTimerEnd={incomingNotificationTimeout.onTimerEnd ?? onDecline}\n onClick={onAccept}\n />\n ) : (\n <Button variant='primary' onClick={onAccept}>\n {t('accept')}\n </Button>\n );\n\n return (\n <StyledInteractionNotification ref={ref}>\n <CardHeader>\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Icon name={icon} />\n <Text variant='h2'>{title}</Text>\n </Flex>\n </CardHeader>\n <CardContent>\n <Flex container={{ direction: 'column', alignItems: 'center', gap: 1 }}>\n <Text variant='h1' as='span'>\n {primaryText}\n </Text>\n {secondaryText && (\n <Text variant='h5' as='span'>\n {secondaryText}\n </Text>\n )}\n <Status variant={status.variant}>{status.text}</Status>\n </Flex>\n </CardContent>\n {fields && fields.length !== 0 && (\n <CardFooter justify='between'>\n <FieldValueList variant='inline' fields={fields} />\n </CardFooter>\n )}\n {onDecline ? (\n <Flex as={StyledCardFooter} container={{ direction: 'row', justify: 'between' }}>\n <Button onClick={onDecline}>{t('decline')}</Button>\n {acceptButton}\n </Flex>\n ) : (\n <Flex as={StyledCardFooter} container={{ direction: 'row-reverse' }}>\n {acceptButton}\n </Flex>\n )}\n </StyledInteractionNotification>\n );\n }\n );\n\nexport default InteractionNotification;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../src/components/TaskManager/Picker/Picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAKL,YAAY,EAeb,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAA8B,WAAW,EAAqB,MAAM,gBAAgB,CAAC;AAG5F,eAAO,MAAM,kBAAkB,yGAK7B,CAAC;AAGH,eAAO,MAAM,cAAc,yGAO1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,yGAU9B,CAAC;AAGH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