@pega/cosmos-react-cs 2.1.3 → 2.1.6

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 (193) hide show
  1. package/package.json +3 -3
  2. package/lib/components/Article/Article.d.ts +0 -32
  3. package/lib/components/Article/Article.d.ts.map +0 -1
  4. package/lib/components/Article/Article.js +0 -51
  5. package/lib/components/Article/Article.js.map +0 -1
  6. package/lib/components/Article/ArticleFooter.d.ts +0 -19
  7. package/lib/components/Article/ArticleFooter.d.ts.map +0 -1
  8. package/lib/components/Article/ArticleFooter.js +0 -40
  9. package/lib/components/Article/ArticleFooter.js.map +0 -1
  10. package/lib/components/Article/ArticleSkeleton.d.ts +0 -8
  11. package/lib/components/Article/ArticleSkeleton.d.ts.map +0 -1
  12. package/lib/components/Article/ArticleSkeleton.js +0 -15
  13. package/lib/components/Article/ArticleSkeleton.js.map +0 -1
  14. package/lib/components/Article/index.d.ts +0 -6
  15. package/lib/components/Article/index.d.ts.map +0 -1
  16. package/lib/components/Article/index.js +0 -3
  17. package/lib/components/Article/index.js.map +0 -1
  18. package/lib/components/ArticleList/ArticleList.d.ts +0 -17
  19. package/lib/components/ArticleList/ArticleList.d.ts.map +0 -1
  20. package/lib/components/ArticleList/ArticleList.js +0 -65
  21. package/lib/components/ArticleList/ArticleList.js.map +0 -1
  22. package/lib/components/ArticleList/ArticleListHeader.d.ts +0 -20
  23. package/lib/components/ArticleList/ArticleListHeader.d.ts.map +0 -1
  24. package/lib/components/ArticleList/ArticleListHeader.js +0 -68
  25. package/lib/components/ArticleList/ArticleListHeader.js.map +0 -1
  26. package/lib/components/ArticleList/ArticleSummary.d.ts +0 -14
  27. package/lib/components/ArticleList/ArticleSummary.d.ts.map +0 -1
  28. package/lib/components/ArticleList/ArticleSummary.js +0 -30
  29. package/lib/components/ArticleList/ArticleSummary.js.map +0 -1
  30. package/lib/components/ArticleList/SummarySkeleton.d.ts +0 -7
  31. package/lib/components/ArticleList/SummarySkeleton.d.ts.map +0 -1
  32. package/lib/components/ArticleList/SummarySkeleton.js +0 -9
  33. package/lib/components/ArticleList/SummarySkeleton.js.map +0 -1
  34. package/lib/components/ArticleList/index.d.ts +0 -7
  35. package/lib/components/ArticleList/index.d.ts.map +0 -1
  36. package/lib/components/ArticleList/index.js +0 -4
  37. package/lib/components/ArticleList/index.js.map +0 -1
  38. package/lib/components/CSCaseView/CSCaseView.d.ts +0 -9
  39. package/lib/components/CSCaseView/CSCaseView.d.ts.map +0 -1
  40. package/lib/components/CSCaseView/CSCaseView.js +0 -16
  41. package/lib/components/CSCaseView/CSCaseView.js.map +0 -1
  42. package/lib/components/CSCaseView/index.d.ts +0 -3
  43. package/lib/components/CSCaseView/index.d.ts.map +0 -1
  44. package/lib/components/CSCaseView/index.js +0 -2
  45. package/lib/components/CSCaseView/index.js.map +0 -1
  46. package/lib/components/CallControlPanel/Call.d.ts +0 -6
  47. package/lib/components/CallControlPanel/Call.d.ts.map +0 -1
  48. package/lib/components/CallControlPanel/Call.js +0 -142
  49. package/lib/components/CallControlPanel/Call.js.map +0 -1
  50. package/lib/components/CallControlPanel/CallControlPanel.d.ts +0 -6
  51. package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +0 -1
  52. package/lib/components/CallControlPanel/CallControlPanel.js +0 -68
  53. package/lib/components/CallControlPanel/CallControlPanel.js.map +0 -1
  54. package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts +0 -15
  55. package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts.map +0 -1
  56. package/lib/components/CallControlPanel/CallControlPanel.styles.js +0 -118
  57. package/lib/components/CallControlPanel/CallControlPanel.styles.js.map +0 -1
  58. package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +0 -112
  59. package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +0 -1
  60. package/lib/components/CallControlPanel/CallControlPanel.types.js +0 -2
  61. package/lib/components/CallControlPanel/CallControlPanel.types.js.map +0 -1
  62. package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts +0 -19
  63. package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts.map +0 -1
  64. package/lib/components/CallControlPanel/CallControlPanelIcon.js +0 -74
  65. package/lib/components/CallControlPanel/CallControlPanelIcon.js.map +0 -1
  66. package/lib/components/CallControlPanel/CallTransfer.d.ts +0 -19
  67. package/lib/components/CallControlPanel/CallTransfer.d.ts.map +0 -1
  68. package/lib/components/CallControlPanel/CallTransfer.js +0 -121
  69. package/lib/components/CallControlPanel/CallTransfer.js.map +0 -1
  70. package/lib/components/CallControlPanel/CalleePicker.d.ts +0 -20
  71. package/lib/components/CallControlPanel/CalleePicker.d.ts.map +0 -1
  72. package/lib/components/CallControlPanel/CalleePicker.js +0 -61
  73. package/lib/components/CallControlPanel/CalleePicker.js.map +0 -1
  74. package/lib/components/CallControlPanel/ContactsList.d.ts +0 -23
  75. package/lib/components/CallControlPanel/ContactsList.d.ts.map +0 -1
  76. package/lib/components/CallControlPanel/ContactsList.js +0 -88
  77. package/lib/components/CallControlPanel/ContactsList.js.map +0 -1
  78. package/lib/components/CallControlPanel/DTMFKeypad.d.ts +0 -11
  79. package/lib/components/CallControlPanel/DTMFKeypad.d.ts.map +0 -1
  80. package/lib/components/CallControlPanel/DTMFKeypad.js +0 -23
  81. package/lib/components/CallControlPanel/DTMFKeypad.js.map +0 -1
  82. package/lib/components/CallControlPanel/StopWatch.d.ts +0 -9
  83. package/lib/components/CallControlPanel/StopWatch.d.ts.map +0 -1
  84. package/lib/components/CallControlPanel/StopWatch.js +0 -28
  85. package/lib/components/CallControlPanel/StopWatch.js.map +0 -1
  86. package/lib/components/CallControlPanel/index.d.ts +0 -5
  87. package/lib/components/CallControlPanel/index.d.ts.map +0 -1
  88. package/lib/components/CallControlPanel/index.js +0 -4
  89. package/lib/components/CallControlPanel/index.js.map +0 -1
  90. package/lib/components/CallControlPanel/utils.d.ts +0 -7
  91. package/lib/components/CallControlPanel/utils.d.ts.map +0 -1
  92. package/lib/components/CallControlPanel/utils.js +0 -35
  93. package/lib/components/CallControlPanel/utils.js.map +0 -1
  94. package/lib/components/DialPad/DialPad.d.ts +0 -16
  95. package/lib/components/DialPad/DialPad.d.ts.map +0 -1
  96. package/lib/components/DialPad/DialPad.js +0 -33
  97. package/lib/components/DialPad/DialPad.js.map +0 -1
  98. package/lib/components/DialPad/DialPad.types.d.ts +0 -33
  99. package/lib/components/DialPad/DialPad.types.d.ts.map +0 -1
  100. package/lib/components/DialPad/DialPad.types.js +0 -2
  101. package/lib/components/DialPad/DialPad.types.js.map +0 -1
  102. package/lib/components/DialPad/DialPadKeyboard.d.ts +0 -12
  103. package/lib/components/DialPad/DialPadKeyboard.d.ts.map +0 -1
  104. package/lib/components/DialPad/DialPadKeyboard.js +0 -87
  105. package/lib/components/DialPad/DialPadKeyboard.js.map +0 -1
  106. package/lib/components/DialPad/DialPadKeyboard.styles.d.ts +0 -5
  107. package/lib/components/DialPad/DialPadKeyboard.styles.d.ts.map +0 -1
  108. package/lib/components/DialPad/DialPadKeyboard.styles.js +0 -76
  109. package/lib/components/DialPad/DialPadKeyboard.styles.js.map +0 -1
  110. package/lib/components/DialPad/KeyboardNavigation.d.ts +0 -6
  111. package/lib/components/DialPad/KeyboardNavigation.d.ts.map +0 -1
  112. package/lib/components/DialPad/KeyboardNavigation.js +0 -156
  113. package/lib/components/DialPad/KeyboardNavigation.js.map +0 -1
  114. package/lib/components/DialPad/index.d.ts +0 -3
  115. package/lib/components/DialPad/index.d.ts.map +0 -1
  116. package/lib/components/DialPad/index.js +0 -2
  117. package/lib/components/DialPad/index.js.map +0 -1
  118. package/lib/components/DialPad/utils.d.ts +0 -4
  119. package/lib/components/DialPad/utils.d.ts.map +0 -1
  120. package/lib/components/DialPad/utils.js +0 -7
  121. package/lib/components/DialPad/utils.js.map +0 -1
  122. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +0 -6
  123. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +0 -1
  124. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +0 -75
  125. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +0 -1
  126. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +0 -9
  127. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +0 -1
  128. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +0 -142
  129. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +0 -1
  130. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +0 -31
  131. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +0 -1
  132. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +0 -2
  133. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +0 -1
  134. package/lib/components/IntelligentGuidance/index.d.ts +0 -3
  135. package/lib/components/IntelligentGuidance/index.d.ts.map +0 -1
  136. package/lib/components/IntelligentGuidance/index.js +0 -2
  137. package/lib/components/IntelligentGuidance/index.js.map +0 -1
  138. package/lib/components/InteractionNotification/InteractionNotification.d.ts +0 -26
  139. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +0 -1
  140. package/lib/components/InteractionNotification/InteractionNotification.js +0 -78
  141. package/lib/components/InteractionNotification/InteractionNotification.js.map +0 -1
  142. package/lib/components/InteractionNotification/index.d.ts +0 -2
  143. package/lib/components/InteractionNotification/index.d.ts.map +0 -1
  144. package/lib/components/InteractionNotification/index.js +0 -2
  145. package/lib/components/InteractionNotification/index.js.map +0 -1
  146. package/lib/components/InteractionTimer/InteractionTimer.d.ts +0 -29
  147. package/lib/components/InteractionTimer/InteractionTimer.d.ts.map +0 -1
  148. package/lib/components/InteractionTimer/InteractionTimer.js +0 -72
  149. package/lib/components/InteractionTimer/InteractionTimer.js.map +0 -1
  150. package/lib/components/InteractionTimer/index.d.ts +0 -2
  151. package/lib/components/InteractionTimer/index.d.ts.map +0 -1
  152. package/lib/components/InteractionTimer/index.js +0 -2
  153. package/lib/components/InteractionTimer/index.js.map +0 -1
  154. package/lib/components/TaskManager/Picker/Picker.d.ts +0 -6
  155. package/lib/components/TaskManager/Picker/Picker.d.ts.map +0 -1
  156. package/lib/components/TaskManager/Picker/Picker.js +0 -171
  157. package/lib/components/TaskManager/Picker/Picker.js.map +0 -1
  158. package/lib/components/TaskManager/Picker/Picker.types.d.ts +0 -27
  159. package/lib/components/TaskManager/Picker/Picker.types.d.ts.map +0 -1
  160. package/lib/components/TaskManager/Picker/Picker.types.js +0 -2
  161. package/lib/components/TaskManager/Picker/Picker.types.js.map +0 -1
  162. package/lib/components/TaskManager/TaskManager.context.d.ts +0 -5
  163. package/lib/components/TaskManager/TaskManager.context.d.ts.map +0 -1
  164. package/lib/components/TaskManager/TaskManager.context.js +0 -3
  165. package/lib/components/TaskManager/TaskManager.context.js.map +0 -1
  166. package/lib/components/TaskManager/TaskManager.d.ts +0 -6
  167. package/lib/components/TaskManager/TaskManager.d.ts.map +0 -1
  168. package/lib/components/TaskManager/TaskManager.js +0 -76
  169. package/lib/components/TaskManager/TaskManager.js.map +0 -1
  170. package/lib/components/TaskManager/TaskManager.styles.d.ts +0 -20
  171. package/lib/components/TaskManager/TaskManager.styles.d.ts.map +0 -1
  172. package/lib/components/TaskManager/TaskManager.styles.js +0 -232
  173. package/lib/components/TaskManager/TaskManager.styles.js.map +0 -1
  174. package/lib/components/TaskManager/TaskManager.types.d.ts +0 -74
  175. package/lib/components/TaskManager/TaskManager.types.d.ts.map +0 -1
  176. package/lib/components/TaskManager/TaskManager.types.js +0 -2
  177. package/lib/components/TaskManager/TaskManager.types.js.map +0 -1
  178. package/lib/components/TaskManager/TaskManagerTabs.d.ts +0 -6
  179. package/lib/components/TaskManager/TaskManagerTabs.d.ts.map +0 -1
  180. package/lib/components/TaskManager/TaskManagerTabs.js +0 -159
  181. package/lib/components/TaskManager/TaskManagerTabs.js.map +0 -1
  182. package/lib/components/TaskManager/TaskView.d.ts +0 -6
  183. package/lib/components/TaskManager/TaskView.d.ts.map +0 -1
  184. package/lib/components/TaskManager/TaskView.js +0 -10
  185. package/lib/components/TaskManager/TaskView.js.map +0 -1
  186. package/lib/components/TaskManager/index.d.ts +0 -5
  187. package/lib/components/TaskManager/index.d.ts.map +0 -1
  188. package/lib/components/TaskManager/index.js +0 -4
  189. package/lib/components/TaskManager/index.js.map +0 -1
  190. package/lib/index.d.ts +0 -18
  191. package/lib/index.d.ts.map +0 -1
  192. package/lib/index.js +0 -19
  193. package/lib/index.js.map +0 -1
@@ -1,9 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- interface StopWatchProps {
3
- startTime: number | Date;
4
- timeout?: number | Date;
5
- }
6
- export declare const StyledStopWatch: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("@pega/cosmos-react-core").OmitStrict<import("@pega/cosmos-react-core").TextProps, "variant"> & Required<Pick<import("@pega/cosmos-react-core").TextProps, "variant">>, never>;
7
- declare const StopWatch: FunctionComponent<StopWatchProps>;
8
- export default StopWatch;
9
- //# sourceMappingURL=StopWatch.d.ts.map
@@ -1 +0,0 @@
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,28 +0,0 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, useRef, useLayoutEffect } from 'react';
3
- import styled from 'styled-components';
4
- import { StyledText, Text } from '@pega/cosmos-react-core';
5
- import { formatDuration } from './utils';
6
- export const StyledStopWatch = styled(StyledText) `
7
- min-width: 8ch;
8
- text-align: end;
9
- `;
10
- const StopWatch = memo(({ startTime, timeout }) => {
11
- const clockRef = useRef(null);
12
- const millis = startTime instanceof Date ? startTime.getUTCMilliseconds() : startTime;
13
- const timeoutMillis = timeout instanceof Date ? timeout.getUTCMilliseconds() : timeout;
14
- useLayoutEffect(() => {
15
- const timer = setInterval(() => {
16
- if (clockRef.current) {
17
- let content = formatDuration(Date.now() - millis);
18
- if (timeoutMillis)
19
- content += ` / ${formatDuration(timeoutMillis)}`;
20
- clockRef.current.textContent = content;
21
- }
22
- }, 1000);
23
- return () => clearInterval(timer);
24
- }, [startTime, timeoutMillis]);
25
- return (_jsxs(Text, { as: StyledStopWatch, ref: clockRef, children: [formatDuration(Date.now() - millis), timeoutMillis && ` / ${formatDuration(timeoutMillis)}`] }, void 0));
26
- });
27
- export default StopWatch;
28
- //# sourceMappingURL=StopWatch.js.map
@@ -1 +0,0 @@
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,YAClD,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,5 +0,0 @@
1
- export { default } from './CallControlPanel';
2
- export { CallProps, CallControlPanelProps, UserAvailabilityStatusOption } from './CallControlPanel.types';
3
- export { default as CallControlPanelIcon } from './CallControlPanelIcon';
4
- export { default as CalleePicker } from './CalleePicker';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,4 +0,0 @@
1
- export { default } from './CallControlPanel';
2
- export { default as CallControlPanelIcon } from './CallControlPanelIcon';
3
- export { default as CalleePicker } from './CalleePicker';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAM7C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default } from './CallControlPanel';\nexport {\n CallProps,\n CallControlPanelProps,\n UserAvailabilityStatusOption\n} from './CallControlPanel.types';\nexport { default as CallControlPanelIcon } from './CallControlPanelIcon';\nexport { default as CalleePicker } from './CalleePicker';\n"]}
@@ -1,7 +0,0 @@
1
- export declare const formatDuration: (millis: number) => string;
2
- export declare const calculateSla: (callDuration: number, slaConfig?: number[] | undefined) => {
3
- slaTimeout?: number;
4
- slaDuration?: number;
5
- currentSlaLevel?: number;
6
- };
7
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/CallControlPanel/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,WAAY,MAAM,KAAG,MAG/C,CAAC;AAEF,eAAO,MAAM,YAAY,iBACT,MAAM,uCAEnB;IACD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CA6B1B,CAAC"}
@@ -1,35 +0,0 @@
1
- import { triple } from '@pega/cosmos-react-core';
2
- export const formatDuration = (millis) => {
3
- const seconds = Math.round(millis / 1000);
4
- return `${Math.floor(seconds / 60)}:${(seconds % 60).toString().padStart(2, '0')}`;
5
- };
6
- export const calculateSla = (callDuration, slaConfig) => {
7
- let slaLevel = 0;
8
- let lastSlaTimeout = 0;
9
- if (!slaConfig) {
10
- return {
11
- slaTimeout: undefined,
12
- slaDuration: undefined,
13
- currentSlaLevel: undefined
14
- };
15
- }
16
- // eslint-disable-next-line no-restricted-syntax
17
- for (const { prev: prevSlaTimeout = 0, current: slaTimeoutInSeconds } of triple(slaConfig)) {
18
- const slaInMillis = slaTimeoutInSeconds * 1000;
19
- if (callDuration < slaInMillis) {
20
- return {
21
- slaTimeout: slaInMillis,
22
- slaDuration: slaTimeoutInSeconds - prevSlaTimeout,
23
- currentSlaLevel: slaLevel
24
- };
25
- }
26
- slaLevel += 1;
27
- lastSlaTimeout = slaInMillis;
28
- }
29
- return {
30
- slaTimeout: lastSlaTimeout,
31
- slaDuration: 0,
32
- currentSlaLevel: slaLevel
33
- };
34
- };
35
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/CallControlPanel/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAU,EAAE;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACrF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,YAAoB,EACpB,SAAoB,EAKpB,EAAE;IACF,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,CAAC,SAAS,EAAE;QACd,OAAO;YACL,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,SAAS;YACtB,eAAe,EAAE,SAAS;SAC3B,CAAC;KACH;IACD,gDAAgD;IAChD,KAAK,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,EAAE;QAC1F,MAAM,WAAW,GAAG,mBAAmB,GAAG,IAAI,CAAC;QAC/C,IAAI,YAAY,GAAG,WAAW,EAAE;YAC9B,OAAO;gBACL,UAAU,EAAE,WAAW;gBACvB,WAAW,EAAE,mBAAmB,GAAG,cAAc;gBACjD,eAAe,EAAE,QAAQ;aAC1B,CAAC;SACH;QACD,QAAQ,IAAI,CAAC,CAAC;QACd,cAAc,GAAG,WAAW,CAAC;KAC9B;IACD,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,WAAW,EAAE,CAAC;QACd,eAAe,EAAE,QAAQ;KAC1B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { triple } from '@pega/cosmos-react-core';\n\nexport const formatDuration = (millis: number): string => {\n const seconds = Math.round(millis / 1000);\n return `${Math.floor(seconds / 60)}:${(seconds % 60).toString().padStart(2, '0')}`;\n};\n\nexport const calculateSla = (\n callDuration: number,\n slaConfig?: number[]\n): {\n slaTimeout?: number;\n slaDuration?: number;\n currentSlaLevel?: number;\n} => {\n let slaLevel = 0;\n let lastSlaTimeout = 0;\n if (!slaConfig) {\n return {\n slaTimeout: undefined,\n slaDuration: undefined,\n currentSlaLevel: undefined\n };\n }\n // eslint-disable-next-line no-restricted-syntax\n for (const { prev: prevSlaTimeout = 0, current: slaTimeoutInSeconds } of triple(slaConfig)) {\n const slaInMillis = slaTimeoutInSeconds * 1000;\n if (callDuration < slaInMillis) {\n return {\n slaTimeout: slaInMillis,\n slaDuration: slaTimeoutInSeconds - prevSlaTimeout,\n currentSlaLevel: slaLevel\n };\n }\n slaLevel += 1;\n lastSlaTimeout = slaInMillis;\n }\n return {\n slaTimeout: lastSlaTimeout,\n slaDuration: 0,\n currentSlaLevel: slaLevel\n };\n};\n"]}
@@ -1,16 +0,0 @@
1
- import { FunctionComponent, Ref } from 'react';
2
- import { ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
- import { DialPadKeyboardProps } from './DialPadKeyboard';
4
- export interface DialPadProps extends NoChildrenProp {
5
- /** Callback fired on call button click */
6
- onCallButtonClick?: (phoneNumber: string) => void;
7
- /** On keypad button press callback */
8
- onDialButtonClick?: (charCode: number) => void;
9
- /** Keypad mode, regular or DTMF. */
10
- mode: DialPadKeyboardProps['mode'];
11
- /** Ref for the wrapping element. */
12
- ref?: Ref<HTMLDivElement>;
13
- }
14
- declare const DialPad: FunctionComponent<DialPadProps & ForwardProps>;
15
- export default DialPad;
16
- //# sourceMappingURL=DialPad.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialPad.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/DialPad.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAEjB,GAAG,EAGJ,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,YAAY,EAQZ,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,oCAAoC;IACpC,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACnC,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAiBD,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CA+C3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useState } from 'react';
3
- import styled, { css } from 'styled-components';
4
- import { defaultThemeProp, Input, Button, useI18n, Flex, StyledIcon, StyledFlex } from '@pega/cosmos-react-core';
5
- import DialPadKeyboard from './DialPadKeyboard';
6
- const StyledDialPad = styled.div(({ theme: { base } }) => {
7
- return css `
8
- ${StyledFlex} {
9
- margin: 0 auto ${base.spacing} auto;
10
- padding: ${base.spacing} 0;
11
- }
12
-
13
- ${StyledFlex} ${StyledIcon} {
14
- color: ${base.palette.interactive};
15
- }
16
- `;
17
- });
18
- StyledDialPad.defaultProps = defaultThemeProp;
19
- const DialPad = forwardRef(({ onCallButtonClick, onDialButtonClick: onDialButtonClickProp, mode }, ref) => {
20
- const t = useI18n();
21
- const [number, setNumber] = useState('');
22
- const onDialButtonClick = useCallback((charCode) => {
23
- setNumber((prevNumber) => {
24
- if (charCode === 127)
25
- return prevNumber.slice(0, -1);
26
- return prevNumber + String.fromCharCode(charCode);
27
- });
28
- onDialButtonClickProp?.(charCode);
29
- }, [onDialButtonClickProp]);
30
- return (_jsxs(StyledDialPad, { ref: ref, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'center', itemGap: 1 }, children: [_jsx(Input, { value: number, onChange: (e) => setNumber(e.target.value), "aria-label": t('dial_pad_phone_number_input_label'), readOnly: mode === 'DTMF' }, void 0), mode !== 'DTMF' && (_jsx(Button, { variant: 'primary', onClick: () => onCallButtonClick?.(number), "aria-label": t('dial_pad_call_button_label', [number]), disabled: number.length === 0, children: t('dial_pad_call_button_label') }, void 0))] }, void 0), _jsx(DialPadKeyboard, { onDialButtonClick: onDialButtonClick, mode: mode }, void 0)] }, void 0));
31
- });
32
- export default DialPad;
33
- //# sourceMappingURL=DialPad.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialPad.js","sourceRoot":"","sources":["../../../src/components/DialPad/DialPad.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,WAAW,EACX,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,gBAAgB,EAChB,KAAK,EACL,MAAM,EACN,OAAO,EACP,IAAI,EACJ,UAAU,EACV,UAAU,EAEX,MAAM,yBAAyB,CAAC;AAE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MAAM,EACb,QAAQ,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gBAC7D,CAAC,CAAC,mCAAmC,CAAC,EAClD,QAAQ,EAAE,IAAI,KAAK,MAAM,WACzB,EACD,IAAI,KAAK,MAAM,IAAI,CAClB,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC,MAAM,CAAC,gBAC9B,CAAC,CAAC,4BAA4B,EAAE,CAAC,MAAM,CAAC,CAAC,EACrD,QAAQ,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,YAE5B,CAAC,CAAC,4BAA4B,CAAC,WACzB,CACV,YACI,EACP,KAAC,eAAe,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,WAAI,YACvD,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import {\n ChangeEvent,\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useCallback,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n ForwardProps,\n defaultThemeProp,\n Input,\n Button,\n useI18n,\n Flex,\n StyledIcon,\n StyledFlex,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport DialPadKeyboard, { DialPadKeyboardProps } from './DialPadKeyboard';\n\nexport interface DialPadProps extends NoChildrenProp {\n /** Callback fired on call button click */\n onCallButtonClick?: (phoneNumber: string) => void;\n /** On keypad button press callback */\n onDialButtonClick?: (charCode: number) => void;\n /** Keypad mode, regular or DTMF. */\n mode: DialPadKeyboardProps['mode'];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledDialPad = styled.div(({ theme: { base } }) => {\n return css`\n ${StyledFlex} {\n margin: 0 auto ${base.spacing} auto;\n padding: ${base.spacing} 0;\n }\n\n ${StyledFlex} ${StyledIcon} {\n color: ${base.palette.interactive};\n }\n `;\n});\n\nStyledDialPad.defaultProps = defaultThemeProp;\n\nconst DialPad: FunctionComponent<DialPadProps & ForwardProps> = forwardRef(\n (\n {\n onCallButtonClick,\n onDialButtonClick: onDialButtonClickProp,\n mode\n }: PropsWithoutRef<DialPadProps>,\n ref: Ref<HTMLDivElement>\n ) => {\n const t = useI18n();\n const [number, setNumber] = useState('');\n\n const onDialButtonClick = useCallback(\n (charCode: number) => {\n setNumber((prevNumber: string) => {\n if (charCode === 127) return prevNumber.slice(0, -1);\n return prevNumber + String.fromCharCode(charCode);\n });\n onDialButtonClickProp?.(charCode);\n },\n [onDialButtonClickProp]\n );\n\n return (\n <StyledDialPad ref={ref}>\n <Flex container={{ alignItems: 'center', justify: 'center', itemGap: 1 }}>\n <Input\n value={number}\n onChange={(e: ChangeEvent<HTMLInputElement>) => setNumber(e.target.value)}\n aria-label={t('dial_pad_phone_number_input_label')}\n readOnly={mode === 'DTMF'}\n />\n {mode !== 'DTMF' && (\n <Button\n variant='primary'\n onClick={() => onCallButtonClick?.(number)}\n aria-label={t('dial_pad_call_button_label', [number])}\n disabled={number.length === 0}\n >\n {t('dial_pad_call_button_label')}\n </Button>\n )}\n </Flex>\n <DialPadKeyboard onDialButtonClick={onDialButtonClick} mode={mode} />\n </StyledDialPad>\n );\n }\n);\n\nexport default DialPad;\n"]}
@@ -1,33 +0,0 @@
1
- import { RefObject } from 'react';
2
- export interface DialButton {
3
- id: number;
4
- digit?: number;
5
- subdigit?: string;
6
- special?: string;
7
- icon?: string;
8
- }
9
- export interface DialButtonRow {
10
- rowId: number;
11
- dialButtons: DialButton[];
12
- }
13
- export declare type KeyDownNavigateOptions = {
14
- [key: string]: (previousId: number) => number;
15
- };
16
- export declare type KeyDownDialButtonOptions = {
17
- [key: string]: DialButton;
18
- };
19
- export declare type Index = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
20
- export interface NavigationGraphElement {
21
- sign?: string;
22
- alt?: string;
23
- special?: string;
24
- keyCode: number;
25
- altKeyCode?: number;
26
- ref?: RefObject<HTMLButtonElement>;
27
- icon?: string;
28
- up?: Index;
29
- left?: Index;
30
- down?: Index;
31
- right?: Index;
32
- }
33
- //# sourceMappingURL=DialPad.types.d.ts.map
@@ -1 +0,0 @@
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;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,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DialPad.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialPad.types.js","sourceRoot":"","sources":["../../../src/components/DialPad/DialPad.types.ts"],"names":[],"mappings":"","sourcesContent":["import { RefObject } from 'react';\n\nexport interface DialButton {\n id: number;\n digit?: number;\n subdigit?: string;\n special?: string;\n icon?: string;\n}\n\nexport interface DialButtonRow {\n rowId: number;\n dialButtons: DialButton[];\n}\n\nexport type KeyDownNavigateOptions = {\n [key: string]: (previousId: number) => number;\n};\n\nexport type KeyDownDialButtonOptions = {\n [key: string]: DialButton;\n};\n\nexport type Index = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport interface NavigationGraphElement {\n sign?: string;\n alt?: string;\n special?: string;\n keyCode: number;\n altKeyCode?: number;\n ref?: RefObject<HTMLButtonElement>;\n icon?: string;\n up?: Index;\n left?: Index;\n down?: Index;\n right?: Index;\n}\n"]}
@@ -1,12 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
- export declare type DialPadKeyboardMode = 'default' | 'DTMF';
4
- export interface DialPadKeyboardProps extends NoChildrenProp {
5
- /** Callback fired on dial button click */
6
- onDialButtonClick: (charCode: number) => void;
7
- /** Dial Pad Keyboard mode */
8
- mode?: DialPadKeyboardMode;
9
- }
10
- declare const DialPadKeyboard: FunctionComponent<DialPadKeyboardProps & ForwardProps>;
11
- export default DialPadKeyboard;
12
- //# sourceMappingURL=DialPadKeyboard.d.ts.map
@@ -1 +0,0 @@
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,EAAE,YAAY,EAAQ,cAAc,EAAyB,MAAM,yBAAyB,CAAC;AAOpG,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,CAgJ3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,87 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useRef, useCallback } from 'react';
3
- import { Icon, useI18n, useLongPress } from '@pega/cosmos-react-core';
4
- import { StyledDialButton, StyledDialPadKeyboard, StyledSpecial } from './DialPadKeyboard.styles';
5
- import { dtmfGraph, defaultGraph, defaultButtonGrid, dtmfButtonGrid } from './KeyboardNavigation';
6
- import { getDialButtonIndex, isNavigationEvent } from './utils';
7
- const DialPadKeyboard = forwardRef(({ onDialButtonClick, mode = 'default' }, ref) => {
8
- const buttonNavGraph = mode === 'DTMF' ? dtmfGraph : defaultGraph;
9
- const buttonGrid = mode === 'DTMF' ? dtmfButtonGrid : defaultButtonGrid;
10
- const t = useI18n();
11
- const zeroButtonLongPress = useLongPress(() => onDialButtonClick(buttonNavGraph[10].altKeyCode || 43), () => onDialButtonClick(buttonNavGraph[10].keyCode));
12
- // This is not a violation of the rules, as the array length is constant and order the always the same.
13
- buttonNavGraph.forEach(element => {
14
- // eslint-disable-next-line react-hooks/rules-of-hooks
15
- element.ref = useRef(null);
16
- });
17
- const handleDialButtonEvent = (e, index) => {
18
- e.preventDefault();
19
- e.stopPropagation();
20
- const buttonEl = buttonNavGraph[index];
21
- if (!buttonEl || (mode === 'DTMF' && index === 12))
22
- return;
23
- buttonEl.ref?.current?.focus();
24
- onDialButtonClick(buttonEl.keyCode);
25
- };
26
- const handlePlusDialButton = (e) => {
27
- e.preventDefault();
28
- e.stopPropagation();
29
- const buttonEl = buttonNavGraph[10];
30
- if (!buttonEl || !buttonEl.altKeyCode)
31
- return;
32
- buttonEl.ref?.current?.focus();
33
- onDialButtonClick(buttonEl.altKeyCode);
34
- };
35
- const handleEnterEvent = useCallback((e) => {
36
- if (e.key === 'Enter') {
37
- e.preventDefault();
38
- onDialButtonClick(Number(e.target.value));
39
- }
40
- }, [onDialButtonClick]);
41
- const findButtonInGraph = (e) => {
42
- return buttonNavGraph.find(el => el.keyCode === Number(e.target.value));
43
- };
44
- const getTargetIndexOnNavigationEvent = (btnEl, e) => {
45
- return {
46
- ArrowUp: btnEl.up,
47
- ArrowLeft: btnEl.left,
48
- ArrowDown: btnEl.down,
49
- ArrowRight: btnEl.right
50
- }[e.key];
51
- };
52
- const handleNavigationEvent = (e) => {
53
- e.preventDefault();
54
- const btnEl = findButtonInGraph(e);
55
- if (!btnEl)
56
- return;
57
- const targetIndex = getTargetIndexOnNavigationEvent(btnEl, e);
58
- if (targetIndex !== undefined)
59
- buttonNavGraph[targetIndex].ref?.current?.focus();
60
- };
61
- const handleKeyboardNavigation = useCallback((e) => {
62
- const index = getDialButtonIndex(e);
63
- if (index !== -1) {
64
- handleDialButtonEvent(e, index);
65
- }
66
- else if (e.key === '+') {
67
- handlePlusDialButton(e);
68
- }
69
- else if (isNavigationEvent(e)) {
70
- handleNavigationEvent(e);
71
- }
72
- }, [onDialButtonClick]);
73
- return (_jsx(StyledDialPadKeyboard, { ref: ref, onKeyDown: handleKeyboardNavigation, dir: 'ltr', role: 'grid', "aria-label": t('dial_pad_keyboard'), container: {
74
- cols: '1fr',
75
- rowGap: 1,
76
- justifyItems: 'center'
77
- }, children: buttonGrid.map((row, index) => {
78
- if (mode === 'default' || (mode === 'DTMF' && index < 4)) {
79
- return (
80
- // eslint-disable-next-line react/no-array-index-key
81
- _jsx("div", { role: 'row', children: row.map((dialButton) => dialButton.alt === '+' ? (_jsxs(StyledDialButton, { role: 'gridcell', tabIndex: -1, ref: dialButton.ref, value: dialButton.keyCode, ...zeroButtonLongPress, children: [dialButton.sign && _jsx("span", { children: dialButton.sign }, void 0), dialButton.alt && _jsx("span", { children: dialButton.alt }, void 0)] }, dialButton.keyCode)) : (_jsxs(StyledDialButton, { role: 'gridcell', onClick: () => onDialButtonClick(dialButton.keyCode), onKeyDown: handleEnterEvent, tabIndex: dialButton.sign === '1' ? 0 : -1, "aria-label": dialButton.icon ? dialButton.icon : undefined, ref: dialButton.ref, value: dialButton.keyCode, children: [dialButton.sign && _jsx("span", { children: dialButton.sign }, void 0), dialButton.alt && _jsx("span", { children: dialButton.alt }, void 0), dialButton.special && _jsx(StyledSpecial, { children: dialButton.special }, void 0), dialButton.icon && _jsx(Icon, { name: dialButton.icon }, void 0)] }, dialButton.keyCode))) }, `row-${index}`));
82
- }
83
- return undefined;
84
- }) }, void 0));
85
- });
86
- export default DialPadKeyboard;
87
- //# sourceMappingURL=DialPadKeyboard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialPadKeyboard.js","sourceRoot":"","sources":["../../../src/components/DialPad/DialPadKeyboard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAKL,UAAU,EACV,MAAM,EACN,WAAW,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,EAAgB,IAAI,EAAkB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAA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AAO,KAAK,EAAE,CAgC7B,CACP,CAAC;aACH;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CAAC,WACoB,CACzB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n KeyboardEvent,\n forwardRef,\n useRef,\n useCallback\n} from 'react';\n\nimport { ForwardProps, Icon, NoChildrenProp, useI18n, useLongPress } from '@pega/cosmos-react-core';\n\nimport { StyledDialButton, StyledDialPadKeyboard, StyledSpecial } from './DialPadKeyboard.styles';\nimport { dtmfGraph, defaultGraph, defaultButtonGrid, dtmfButtonGrid } from './KeyboardNavigation';\nimport { Index, NavigationGraphElement } from './DialPad.types';\nimport { getDialButtonIndex, isNavigationEvent } from './utils';\n\nexport type DialPadKeyboardMode = 'default' | 'DTMF';\n\nexport interface DialPadKeyboardProps extends NoChildrenProp {\n /** Callback fired on dial button click */\n onDialButtonClick: (charCode: number) => void;\n /** Dial Pad Keyboard mode */\n mode?: DialPadKeyboardMode;\n}\n\nconst DialPadKeyboard: FunctionComponent<DialPadKeyboardProps & ForwardProps> = forwardRef(\n (\n { onDialButtonClick, mode = 'default' }: PropsWithoutRef<DialPadKeyboardProps>,\n ref: Ref<HTMLElement>\n ) => {\n const buttonNavGraph = mode === 'DTMF' ? dtmfGraph : defaultGraph;\n const buttonGrid = mode === 'DTMF' ? dtmfButtonGrid : defaultButtonGrid;\n\n const t = useI18n();\n const zeroButtonLongPress = useLongPress<HTMLButtonElement>(\n () => onDialButtonClick(buttonNavGraph[10].altKeyCode || 43),\n () => onDialButtonClick(buttonNavGraph[10].keyCode)\n );\n // This is not a violation of the rules, as the array length is constant and order the always the same.\n buttonNavGraph.forEach(element => {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n element.ref = useRef<HTMLButtonElement>(null);\n });\n\n const handleDialButtonEvent = (e: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n e.preventDefault();\n e.stopPropagation();\n const buttonEl = buttonNavGraph[index];\n if (!buttonEl || (mode === 'DTMF' && index === 12)) return;\n buttonEl.ref?.current?.focus();\n onDialButtonClick(buttonEl.keyCode);\n };\n\n const handlePlusDialButton = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n const buttonEl = buttonNavGraph[10];\n if (!buttonEl || !buttonEl.altKeyCode) return;\n buttonEl.ref?.current?.focus();\n onDialButtonClick(buttonEl.altKeyCode);\n };\n\n const handleEnterEvent = useCallback(\n (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n onDialButtonClick(Number((e.target as HTMLButtonElement).value));\n }\n },\n [onDialButtonClick]\n );\n\n const findButtonInGraph = (e: React.KeyboardEvent<HTMLElement>) => {\n return buttonNavGraph.find(\n el => el.keyCode === Number((e.target as HTMLButtonElement).value)\n );\n };\n\n const getTargetIndexOnNavigationEvent = (\n btnEl: NavigationGraphElement,\n e: React.KeyboardEvent<HTMLButtonElement>\n ): Index | undefined => {\n return {\n ArrowUp: btnEl.up,\n ArrowLeft: btnEl.left,\n ArrowDown: btnEl.down,\n ArrowRight: btnEl.right\n }[e.key];\n };\n\n const handleNavigationEvent = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n e.preventDefault();\n const btnEl = findButtonInGraph(e);\n if (!btnEl) return;\n const targetIndex = getTargetIndexOnNavigationEvent(btnEl, e);\n if (targetIndex !== undefined) buttonNavGraph[targetIndex].ref?.current?.focus();\n };\n\n const handleKeyboardNavigation = useCallback(\n (e: KeyboardEvent<HTMLButtonElement>) => {\n const index = getDialButtonIndex(e);\n if (index !== -1) {\n handleDialButtonEvent(e, index);\n } else if (e.key === '+') {\n handlePlusDialButton(e);\n } else if (isNavigationEvent(e)) {\n handleNavigationEvent(e);\n }\n },\n [onDialButtonClick]\n );\n\n return (\n <StyledDialPadKeyboard\n ref={ref}\n onKeyDown={handleKeyboardNavigation}\n dir='ltr'\n role='grid'\n aria-label={t('dial_pad_keyboard')}\n container={{\n cols: '1fr',\n rowGap: 1,\n justifyItems: 'center'\n }}\n >\n {buttonGrid.map((row: NavigationGraphElement[], index: number) => {\n if (mode === 'default' || (mode === 'DTMF' && index < 4)) {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <div role='row' key={`row-${index}`}>\n {row.map((dialButton: NavigationGraphElement) =>\n dialButton.alt === '+' ? (\n <StyledDialButton\n key={dialButton.keyCode}\n role='gridcell'\n tabIndex={-1}\n ref={dialButton.ref}\n value={dialButton.keyCode}\n {...zeroButtonLongPress}\n >\n {dialButton.sign && <span>{dialButton.sign}</span>}\n {dialButton.alt && <span>{dialButton.alt}</span>}\n </StyledDialButton>\n ) : (\n <StyledDialButton\n key={dialButton.keyCode}\n role='gridcell'\n onClick={() => onDialButtonClick(dialButton.keyCode)}\n onKeyDown={handleEnterEvent}\n tabIndex={dialButton.sign === '1' ? 0 : -1}\n aria-label={dialButton.icon ? dialButton.icon : undefined}\n ref={dialButton.ref}\n value={dialButton.keyCode}\n >\n {dialButton.sign && <span>{dialButton.sign}</span>}\n {dialButton.alt && <span>{dialButton.alt}</span>}\n {dialButton.special && <StyledSpecial>{dialButton.special}</StyledSpecial>}\n {dialButton.icon && <Icon name={dialButton.icon} />}\n </StyledDialButton>\n )\n )}\n </div>\n );\n }\n return undefined;\n })}\n </StyledDialPadKeyboard>\n );\n }\n);\n\nexport default DialPadKeyboard;\n"]}
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledDialPadKeyboard: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").GridProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
3
- export declare const StyledSpecial: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
4
- export declare const StyledDialButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
5
- //# sourceMappingURL=DialPadKeyboard.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialPadKeyboard.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/DialPadKeyboard.styles.ts"],"names":[],"mappings":";AAWA,eAAO,MAAM,qBAAqB,mOAYjC,CAAC;AAIF,eAAO,MAAM,aAAa,0GAAgB,CAAC;AAE3C,eAAO,MAAM,gBAAgB,4GAqE5B,CAAC"}
@@ -1,76 +0,0 @@
1
- import { mix, readableColor } from 'polished';
2
- import styled, { css } from 'styled-components';
3
- import { calculateFontSize, defaultThemeProp, Grid, StyledIcon, tryCatch } from '@pega/cosmos-react-core';
4
- export const StyledDialPadKeyboard = styled(Grid)(({ theme: { base: { spacing } } }) => {
5
- return css `
6
- max-width: calc(25 * ${spacing});
7
- margin: auto;
8
- padding: ${spacing};
9
- `;
10
- });
11
- StyledDialPadKeyboard.defaultProps = defaultThemeProp;
12
- export const StyledSpecial = styled.span ``;
13
- export const StyledDialButton = styled.button(({ theme: { base, components: { button, input } } }) => {
14
- const secondaryHoverColor = tryCatch(() => mix(0.85, button['secondary-color'], button.color));
15
- const fontSize = calculateFontSize(base['font-size'], base['font-scale']);
16
- const color = tryCatch(() => readableColor(button['secondary-color']));
17
- return css `
18
- background: transparent;
19
- width: calc(7 * ${base.spacing});
20
- height: calc(7 * ${base.spacing});
21
- cursor: pointer;
22
- color: ${color};
23
- border: 0.0625rem solid ${input['border-color']};
24
- border-radius: calc(${base['border-radius']} * ${button['border-radius']});
25
- position: relative;
26
- outline: none;
27
- margin-inline-end: ${base.spacing};
28
-
29
- &:last-child {
30
- grid-column-end: 3;
31
- margin-inline-end: 0;
32
- }
33
-
34
- &:hover {
35
- background-color: ${secondaryHoverColor};
36
- border-color: ${base.palette.dark};
37
- text-decoration: none;
38
- }
39
-
40
- &:not([disabled]):focus,
41
- &:enabled:focus {
42
- box-shadow: 0 0 0.5rem ${base.palette.interactive};
43
- }
44
-
45
- ${StyledIcon} {
46
- width: 1.5rem;
47
- height: 1.5rem;
48
- }
49
-
50
- span {
51
- font-size: ${fontSize.l};
52
- transform: translateY(-125%);
53
- line-height: 1;
54
- position: absolute;
55
- left: 0;
56
- right: 0;
57
- }
58
-
59
- span,
60
- ${StyledIcon} {
61
- color: ${color};
62
- }
63
-
64
- span + span {
65
- font-size: ${fontSize.xxs};
66
- transform: translateY(-30%);
67
- }
68
-
69
- ${StyledSpecial} {
70
- font-size: ${fontSize.l};
71
- transform: translateY(-50%);
72
- }
73
- `;
74
- });
75
- StyledDialButton.defaultProps = defaultThemeProp;
76
- //# sourceMappingURL=DialPadKeyboard.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialPadKeyboard.styles.js","sourceRoot":"","sources":["../../../src/components/DialPad/DialPadKeyboard.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAC/C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;6BACe,OAAO;;iBAEnB,OAAO;KACnB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAC3C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EACJ,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAC9B,EACF,EAAE,EAAE;IACH,MAAM,mBAAmB,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/F,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAEvE,OAAO,GAAG,CAAA;;wBAEU,IAAI,CAAC,OAAO;yBACX,IAAI,CAAC,OAAO;;eAEtB,KAAK;gCACY,KAAK,CAAC,cAAc,CAAC;4BACzB,IAAI,CAAC,eAAe,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC;;;2BAGnD,IAAI,CAAC,OAAO;;;;;;;;4BAQX,mBAAmB;wBACvB,IAAI,CAAC,OAAO,CAAC,IAAI;;;;;;iCAMR,IAAI,CAAC,OAAO,CAAC,WAAW;;;QAGjD,UAAU;;;;;;qBAMG,QAAQ,CAAC,CAAC;;;;;;;;;QASvB,UAAU;iBACD,KAAK;;;;qBAID,QAAQ,CAAC,GAAG;;;;QAIzB,aAAa;qBACA,QAAQ,CAAC,CAAC;;;KAG1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import { mix, readableColor } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n Grid,\n StyledIcon,\n tryCatch\n} from '@pega/cosmos-react-core';\n\nexport const StyledDialPadKeyboard = styled(Grid)(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n max-width: calc(25 * ${spacing});\n margin: auto;\n padding: ${spacing};\n `;\n }\n);\n\nStyledDialPadKeyboard.defaultProps = defaultThemeProp;\n\nexport const StyledSpecial = styled.span``;\n\nexport const StyledDialButton = styled.button(\n ({\n theme: {\n base,\n components: { button, input }\n }\n }) => {\n const secondaryHoverColor = tryCatch(() => mix(0.85, button['secondary-color'], button.color));\n const fontSize = calculateFontSize(base['font-size'], base['font-scale']);\n const color = tryCatch(() => readableColor(button['secondary-color']));\n\n return css`\n background: transparent;\n width: calc(7 * ${base.spacing});\n height: calc(7 * ${base.spacing});\n cursor: pointer;\n color: ${color};\n border: 0.0625rem solid ${input['border-color']};\n border-radius: calc(${base['border-radius']} * ${button['border-radius']});\n position: relative;\n outline: none;\n margin-inline-end: ${base.spacing};\n\n &:last-child {\n grid-column-end: 3;\n margin-inline-end: 0;\n }\n\n &:hover {\n background-color: ${secondaryHoverColor};\n border-color: ${base.palette.dark};\n text-decoration: none;\n }\n\n &:not([disabled]):focus,\n &:enabled:focus {\n box-shadow: 0 0 0.5rem ${base.palette.interactive};\n }\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n span {\n font-size: ${fontSize.l};\n transform: translateY(-125%);\n line-height: 1;\n position: absolute;\n left: 0;\n right: 0;\n }\n\n span,\n ${StyledIcon} {\n color: ${color};\n }\n\n span + span {\n font-size: ${fontSize.xxs};\n transform: translateY(-30%);\n }\n\n ${StyledSpecial} {\n font-size: ${fontSize.l};\n transform: translateY(-50%);\n }\n `;\n }\n);\n\nStyledDialButton.defaultProps = defaultThemeProp;\n"]}
@@ -1,6 +0,0 @@
1
- import { NavigationGraphElement } from './DialPad.types';
2
- export declare const dtmfGraph: NavigationGraphElement[];
3
- export declare const defaultGraph: NavigationGraphElement[];
4
- export declare const defaultButtonGrid: NavigationGraphElement[][];
5
- export declare const dtmfButtonGrid: NavigationGraphElement[][];
6
- //# sourceMappingURL=KeyboardNavigation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/KeyboardNavigation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AA6FzD,eAAO,MAAM,SAAS,0BAwBpB,CAAC;AAEH,eAAO,MAAM,YAAY,0BA0BvB,CAAC;AAEH,eAAO,MAAM,iBAAiB,4BAM7B,CAAC;AAEF,eAAO,MAAM,cAAc,4BAK1B,CAAC"}