@pega/cosmos-react-cs 5.0.0-dev.4.8 → 5.0.0-dev.5.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 (201) hide show
  1. package/lib/components/CTIPanel/CTIPanel.d.ts +13 -0
  2. package/lib/components/CTIPanel/CTIPanel.d.ts.map +1 -0
  3. package/lib/components/CTIPanel/CTIPanel.js +12 -0
  4. package/lib/components/CTIPanel/CTIPanel.js.map +1 -0
  5. package/lib/components/CTIPanel/index.d.ts +2 -0
  6. package/lib/components/CTIPanel/index.d.ts.map +1 -0
  7. package/lib/components/CTIPanel/index.js +2 -0
  8. package/lib/components/CTIPanel/index.js.map +1 -0
  9. package/lib/components/CallControlPanel/AttachInteractionDialog.d.ts +47 -0
  10. package/lib/components/CallControlPanel/AttachInteractionDialog.d.ts.map +1 -0
  11. package/lib/components/CallControlPanel/AttachInteractionDialog.js +54 -0
  12. package/lib/components/CallControlPanel/AttachInteractionDialog.js.map +1 -0
  13. package/lib/components/CallControlPanel/Call.d.ts +6 -0
  14. package/lib/components/CallControlPanel/Call.d.ts.map +1 -0
  15. package/lib/components/CallControlPanel/Call.js +145 -0
  16. package/lib/components/CallControlPanel/Call.js.map +1 -0
  17. package/lib/components/CallControlPanel/CallControlPanel.d.ts +6 -0
  18. package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +1 -0
  19. package/lib/components/CallControlPanel/CallControlPanel.js +61 -0
  20. package/lib/components/CallControlPanel/CallControlPanel.js.map +1 -0
  21. package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts +16 -0
  22. package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts.map +1 -0
  23. package/lib/components/CallControlPanel/CallControlPanel.styles.js +105 -0
  24. package/lib/components/CallControlPanel/CallControlPanel.styles.js.map +1 -0
  25. package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +120 -0
  26. package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +1 -0
  27. package/lib/components/CallControlPanel/CallControlPanel.types.js +2 -0
  28. package/lib/components/CallControlPanel/CallControlPanel.types.js.map +1 -0
  29. package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts +15 -0
  30. package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts.map +1 -0
  31. package/lib/components/CallControlPanel/CallControlPanelIcon.js +81 -0
  32. package/lib/components/CallControlPanel/CallControlPanelIcon.js.map +1 -0
  33. package/lib/components/CallControlPanel/CallHandover/CallHandover.types.d.ts +17 -0
  34. package/lib/components/CallControlPanel/CallHandover/CallHandover.types.d.ts.map +1 -0
  35. package/lib/components/CallControlPanel/CallHandover/CallHandover.types.js +2 -0
  36. package/lib/components/CallControlPanel/CallHandover/CallHandover.types.js.map +1 -0
  37. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts +16 -0
  38. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.d.ts.map +1 -0
  39. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js +56 -0
  40. package/lib/components/CallControlPanel/CallHandover/CallHandoverDialog.js.map +1 -0
  41. package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.d.ts +31 -0
  42. package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.d.ts.map +1 -0
  43. package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.js +60 -0
  44. package/lib/components/CallControlPanel/CallHandover/CallHandoverForm.js.map +1 -0
  45. package/lib/components/CallControlPanel/CallHandover/index.d.ts +4 -0
  46. package/lib/components/CallControlPanel/CallHandover/index.d.ts.map +1 -0
  47. package/lib/components/CallControlPanel/CallHandover/index.js +4 -0
  48. package/lib/components/CallControlPanel/CallHandover/index.js.map +1 -0
  49. package/lib/components/CallControlPanel/ContactList/CalleePicker.d.ts +18 -0
  50. package/lib/components/CallControlPanel/ContactList/CalleePicker.d.ts.map +1 -0
  51. package/lib/components/CallControlPanel/ContactList/CalleePicker.js +54 -0
  52. package/lib/components/CallControlPanel/ContactList/CalleePicker.js.map +1 -0
  53. package/lib/components/CallControlPanel/ContactList/ContactList.d.ts +10 -0
  54. package/lib/components/CallControlPanel/ContactList/ContactList.d.ts.map +1 -0
  55. package/lib/components/CallControlPanel/ContactList/ContactList.js +129 -0
  56. package/lib/components/CallControlPanel/ContactList/ContactList.js.map +1 -0
  57. package/lib/components/CallControlPanel/ContactList/ContactList.types.d.ts +30 -0
  58. package/lib/components/CallControlPanel/ContactList/ContactList.types.d.ts.map +1 -0
  59. package/lib/components/CallControlPanel/ContactList/ContactList.types.js +2 -0
  60. package/lib/components/CallControlPanel/ContactList/ContactList.types.js.map +1 -0
  61. package/lib/components/CallControlPanel/ContactList/index.d.ts +3 -0
  62. package/lib/components/CallControlPanel/ContactList/index.d.ts.map +1 -0
  63. package/lib/components/CallControlPanel/ContactList/index.js +2 -0
  64. package/lib/components/CallControlPanel/ContactList/index.js.map +1 -0
  65. package/lib/components/CallControlPanel/ExternalCTI.d.ts +24 -0
  66. package/lib/components/CallControlPanel/ExternalCTI.d.ts.map +1 -0
  67. package/lib/components/CallControlPanel/ExternalCTI.js +48 -0
  68. package/lib/components/CallControlPanel/ExternalCTI.js.map +1 -0
  69. package/lib/components/CallControlPanel/FloatingPanel.d.ts +36 -0
  70. package/lib/components/CallControlPanel/FloatingPanel.d.ts.map +1 -0
  71. package/lib/components/CallControlPanel/FloatingPanel.js +72 -0
  72. package/lib/components/CallControlPanel/FloatingPanel.js.map +1 -0
  73. package/lib/components/CallControlPanel/IncomingCall.d.ts +6 -0
  74. package/lib/components/CallControlPanel/IncomingCall.d.ts.map +1 -0
  75. package/lib/components/CallControlPanel/IncomingCall.js +18 -0
  76. package/lib/components/CallControlPanel/IncomingCall.js.map +1 -0
  77. package/lib/components/CallControlPanel/StopWatch.d.ts +11 -0
  78. package/lib/components/CallControlPanel/StopWatch.d.ts.map +1 -0
  79. package/lib/components/CallControlPanel/StopWatch.js +28 -0
  80. package/lib/components/CallControlPanel/StopWatch.js.map +1 -0
  81. package/lib/components/CallControlPanel/index.d.ts +5 -0
  82. package/lib/components/CallControlPanel/index.d.ts.map +1 -0
  83. package/lib/components/CallControlPanel/index.js +3 -0
  84. package/lib/components/CallControlPanel/index.js.map +1 -0
  85. package/lib/components/CallControlPanel/utils.d.ts +7 -0
  86. package/lib/components/CallControlPanel/utils.d.ts.map +1 -0
  87. package/lib/components/CallControlPanel/utils.js +34 -0
  88. package/lib/components/CallControlPanel/utils.js.map +1 -0
  89. package/lib/components/DialPad/DialPad.d.ts +18 -0
  90. package/lib/components/DialPad/DialPad.d.ts.map +1 -0
  91. package/lib/components/DialPad/DialPad.js +30 -0
  92. package/lib/components/DialPad/DialPad.js.map +1 -0
  93. package/lib/components/DialPad/DialPad.types.d.ts +33 -0
  94. package/lib/components/DialPad/DialPad.types.d.ts.map +1 -0
  95. package/lib/components/DialPad/DialPad.types.js +2 -0
  96. package/lib/components/DialPad/DialPad.types.js.map +1 -0
  97. package/lib/components/DialPad/DialPadDialog.d.ts +9 -0
  98. package/lib/components/DialPad/DialPadDialog.d.ts.map +1 -0
  99. package/lib/components/DialPad/DialPadDialog.js +35 -0
  100. package/lib/components/DialPad/DialPadDialog.js.map +1 -0
  101. package/lib/components/DialPad/DialPadKeyboard.d.ts +12 -0
  102. package/lib/components/DialPad/DialPadKeyboard.d.ts.map +1 -0
  103. package/lib/components/DialPad/DialPadKeyboard.js +89 -0
  104. package/lib/components/DialPad/DialPadKeyboard.js.map +1 -0
  105. package/lib/components/DialPad/DialPadKeyboard.styles.d.ts +5 -0
  106. package/lib/components/DialPad/DialPadKeyboard.styles.d.ts.map +1 -0
  107. package/lib/components/DialPad/DialPadKeyboard.styles.js +76 -0
  108. package/lib/components/DialPad/DialPadKeyboard.styles.js.map +1 -0
  109. package/lib/components/DialPad/KeyboardNavigation.d.ts +6 -0
  110. package/lib/components/DialPad/KeyboardNavigation.d.ts.map +1 -0
  111. package/lib/components/DialPad/KeyboardNavigation.js +156 -0
  112. package/lib/components/DialPad/KeyboardNavigation.js.map +1 -0
  113. package/lib/components/DialPad/index.d.ts +4 -0
  114. package/lib/components/DialPad/index.d.ts.map +1 -0
  115. package/lib/components/DialPad/index.js +3 -0
  116. package/lib/components/DialPad/index.js.map +1 -0
  117. package/lib/components/DialPad/utils.d.ts +4 -0
  118. package/lib/components/DialPad/utils.d.ts.map +1 -0
  119. package/lib/components/DialPad/utils.js +7 -0
  120. package/lib/components/DialPad/utils.js.map +1 -0
  121. package/lib/components/InteractionNotification/CountdownButton.d.ts +15 -0
  122. package/lib/components/InteractionNotification/CountdownButton.d.ts.map +1 -0
  123. package/lib/components/InteractionNotification/CountdownButton.js +42 -0
  124. package/lib/components/InteractionNotification/CountdownButton.js.map +1 -0
  125. package/lib/components/InteractionNotification/InteractionNotification.d.ts +35 -0
  126. package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -0
  127. package/lib/components/InteractionNotification/InteractionNotification.js +110 -0
  128. package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -0
  129. package/lib/components/InteractionNotification/index.d.ts +2 -0
  130. package/lib/components/InteractionNotification/index.d.ts.map +1 -0
  131. package/lib/components/InteractionNotification/index.js +2 -0
  132. package/lib/components/InteractionNotification/index.js.map +1 -0
  133. package/lib/components/InteractionTimer/InteractionTimer.d.ts +29 -0
  134. package/lib/components/InteractionTimer/InteractionTimer.d.ts.map +1 -0
  135. package/lib/components/InteractionTimer/InteractionTimer.js +90 -0
  136. package/lib/components/InteractionTimer/InteractionTimer.js.map +1 -0
  137. package/lib/components/InteractionTimer/index.d.ts +3 -0
  138. package/lib/components/InteractionTimer/index.d.ts.map +1 -0
  139. package/lib/components/InteractionTimer/index.js +2 -0
  140. package/lib/components/InteractionTimer/index.js.map +1 -0
  141. package/lib/components/Picker/Picker.d.ts +6 -0
  142. package/lib/components/Picker/Picker.d.ts.map +1 -0
  143. package/lib/components/Picker/Picker.js +109 -0
  144. package/lib/components/Picker/Picker.js.map +1 -0
  145. package/lib/components/Picker/Picker.styles.d.ts +12 -0
  146. package/lib/components/Picker/Picker.styles.d.ts.map +1 -0
  147. package/lib/components/Picker/Picker.styles.js +59 -0
  148. package/lib/components/Picker/Picker.styles.js.map +1 -0
  149. package/lib/components/Picker/Picker.types.d.ts +35 -0
  150. package/lib/components/Picker/Picker.types.d.ts.map +1 -0
  151. package/lib/components/Picker/Picker.types.js +2 -0
  152. package/lib/components/Picker/Picker.types.js.map +1 -0
  153. package/lib/components/Picker/index.d.ts +2 -0
  154. package/lib/components/Picker/index.d.ts.map +1 -0
  155. package/lib/components/Picker/index.js +2 -0
  156. package/lib/components/Picker/index.js.map +1 -0
  157. package/lib/components/TaskManager/ConversationAI.d.ts +6 -0
  158. package/lib/components/TaskManager/ConversationAI.d.ts.map +1 -0
  159. package/lib/components/TaskManager/ConversationAI.js +29 -0
  160. package/lib/components/TaskManager/ConversationAI.js.map +1 -0
  161. package/lib/components/TaskManager/Dialogue.d.ts +6 -0
  162. package/lib/components/TaskManager/Dialogue.d.ts.map +1 -0
  163. package/lib/components/TaskManager/Dialogue.js +30 -0
  164. package/lib/components/TaskManager/Dialogue.js.map +1 -0
  165. package/lib/components/TaskManager/TaskManager.context.d.ts +5 -0
  166. package/lib/components/TaskManager/TaskManager.context.d.ts.map +1 -0
  167. package/lib/components/TaskManager/TaskManager.context.js +3 -0
  168. package/lib/components/TaskManager/TaskManager.context.js.map +1 -0
  169. package/lib/components/TaskManager/TaskManager.d.ts +6 -0
  170. package/lib/components/TaskManager/TaskManager.d.ts.map +1 -0
  171. package/lib/components/TaskManager/TaskManager.js +68 -0
  172. package/lib/components/TaskManager/TaskManager.js.map +1 -0
  173. package/lib/components/TaskManager/TaskManager.styles.d.ts +37 -0
  174. package/lib/components/TaskManager/TaskManager.styles.d.ts.map +1 -0
  175. package/lib/components/TaskManager/TaskManager.styles.js +325 -0
  176. package/lib/components/TaskManager/TaskManager.styles.js.map +1 -0
  177. package/lib/components/TaskManager/TaskManager.types.d.ts +98 -0
  178. package/lib/components/TaskManager/TaskManager.types.d.ts.map +1 -0
  179. package/lib/components/TaskManager/TaskManager.types.js +2 -0
  180. package/lib/components/TaskManager/TaskManager.types.js.map +1 -0
  181. package/lib/components/TaskManager/TaskManagerTabs.d.ts +6 -0
  182. package/lib/components/TaskManager/TaskManagerTabs.d.ts.map +1 -0
  183. package/lib/components/TaskManager/TaskManagerTabs.js +186 -0
  184. package/lib/components/TaskManager/TaskManagerTabs.js.map +1 -0
  185. package/lib/components/TaskManager/TaskPicker.d.ts +19 -0
  186. package/lib/components/TaskManager/TaskPicker.d.ts.map +1 -0
  187. package/lib/components/TaskManager/TaskPicker.js +89 -0
  188. package/lib/components/TaskManager/TaskPicker.js.map +1 -0
  189. package/lib/components/TaskManager/TaskView.d.ts +6 -0
  190. package/lib/components/TaskManager/TaskView.d.ts.map +1 -0
  191. package/lib/components/TaskManager/TaskView.js +10 -0
  192. package/lib/components/TaskManager/TaskView.js.map +1 -0
  193. package/lib/components/TaskManager/index.d.ts +5 -0
  194. package/lib/components/TaskManager/index.d.ts.map +1 -0
  195. package/lib/components/TaskManager/index.js +4 -0
  196. package/lib/components/TaskManager/index.js.map +1 -0
  197. package/lib/index.d.ts +13 -0
  198. package/lib/index.d.ts.map +1 -0
  199. package/lib/index.js +14 -0
  200. package/lib/index.js.map +1 -0
  201. package/package.json +3 -3
@@ -0,0 +1,156 @@
1
+ const baseGraph = [
2
+ {
3
+ sign: '1',
4
+ keyCode: 49,
5
+ ref: undefined,
6
+ right: 1,
7
+ down: 3
8
+ },
9
+ {
10
+ sign: '2',
11
+ alt: 'ABC',
12
+ keyCode: 50,
13
+ ref: undefined,
14
+ right: 2,
15
+ down: 4,
16
+ left: 0
17
+ },
18
+ {
19
+ sign: '3',
20
+ alt: 'DEF',
21
+ keyCode: 51,
22
+ ref: undefined,
23
+ down: 5,
24
+ left: 1
25
+ },
26
+ {
27
+ sign: '4',
28
+ alt: 'GHI',
29
+ keyCode: 52,
30
+ ref: undefined,
31
+ up: 0,
32
+ right: 4,
33
+ down: 6
34
+ },
35
+ {
36
+ sign: '5',
37
+ alt: 'JKL',
38
+ keyCode: 53,
39
+ ref: undefined,
40
+ up: 1,
41
+ right: 5,
42
+ down: 7,
43
+ left: 3
44
+ },
45
+ {
46
+ sign: '6',
47
+ alt: 'MNO',
48
+ keyCode: 54,
49
+ ref: undefined,
50
+ up: 2,
51
+ down: 8,
52
+ left: 4
53
+ },
54
+ {
55
+ sign: '7',
56
+ alt: 'PQRS',
57
+ keyCode: 55,
58
+ ref: undefined,
59
+ up: 3,
60
+ right: 7,
61
+ down: 9
62
+ },
63
+ {
64
+ sign: '8',
65
+ alt: 'TUV',
66
+ keyCode: 56,
67
+ ref: undefined,
68
+ up: 4,
69
+ right: 8,
70
+ down: 10,
71
+ left: 6
72
+ },
73
+ {
74
+ sign: '9',
75
+ alt: 'WXYZ',
76
+ keyCode: 57,
77
+ ref: undefined,
78
+ up: 5,
79
+ down: 11,
80
+ left: 7
81
+ },
82
+ {
83
+ special: '*',
84
+ keyCode: 42,
85
+ ref: undefined,
86
+ up: 6,
87
+ right: 10,
88
+ down: 12
89
+ }
90
+ ];
91
+ export const dtmfGraph = baseGraph.concat([
92
+ {
93
+ sign: '0',
94
+ alt: '+',
95
+ keyCode: 48,
96
+ altKeyCode: 43,
97
+ ref: undefined,
98
+ up: 7,
99
+ right: 11,
100
+ left: 9
101
+ },
102
+ {
103
+ special: '#',
104
+ keyCode: 35,
105
+ ref: undefined,
106
+ up: 8,
107
+ left: 10
108
+ },
109
+ {
110
+ icon: 'backspace',
111
+ keyCode: 127,
112
+ ref: undefined,
113
+ up: 10
114
+ }
115
+ ]);
116
+ export const defaultGraph = baseGraph.concat([
117
+ {
118
+ sign: '0',
119
+ alt: '+',
120
+ keyCode: 48,
121
+ altKeyCode: 43,
122
+ ref: undefined,
123
+ up: 7,
124
+ right: 11,
125
+ down: 12,
126
+ left: 9
127
+ },
128
+ {
129
+ special: '#',
130
+ keyCode: 35,
131
+ ref: undefined,
132
+ up: 8,
133
+ down: 12,
134
+ left: 10
135
+ },
136
+ {
137
+ icon: 'backspace',
138
+ keyCode: 127,
139
+ ref: undefined,
140
+ up: 10
141
+ }
142
+ ]);
143
+ export const defaultButtonGrid = [
144
+ [defaultGraph[0], defaultGraph[1], defaultGraph[2]],
145
+ [defaultGraph[3], defaultGraph[4], defaultGraph[5]],
146
+ [defaultGraph[6], defaultGraph[7], defaultGraph[8]],
147
+ [defaultGraph[9], defaultGraph[10], defaultGraph[11]],
148
+ [defaultGraph[12]]
149
+ ];
150
+ export const dtmfButtonGrid = [
151
+ [dtmfGraph[0], dtmfGraph[1], dtmfGraph[2]],
152
+ [dtmfGraph[3], dtmfGraph[4], dtmfGraph[5]],
153
+ [dtmfGraph[6], dtmfGraph[7], dtmfGraph[8]],
154
+ [dtmfGraph[9], dtmfGraph[10], dtmfGraph[11]]
155
+ ];
156
+ //# sourceMappingURL=KeyboardNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyboardNavigation.js","sourceRoot":"","sources":["../../../src/components/DialPad/KeyboardNavigation.ts"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAA6B;IAC1C;QACE,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,CAAC;KACR;IACD;QACE,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,SAAS;QACd,KAAK,EAAE,CAAC;QACR,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;KACR;IACD;QACE,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;KACR;IACD;QACE,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,EAAE;QACX,GAAG,EAAE,SAAS;QACd,EAAE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C,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;CAC7C,CAAC","sourcesContent":["// cspell:words PQRS WXYZ\nimport { NavigationGraphElement } from './DialPad.types';\n\nconst baseGraph: NavigationGraphElement[] = [\n {\n sign: '1',\n keyCode: 49,\n ref: undefined,\n right: 1,\n down: 3\n },\n {\n sign: '2',\n alt: 'ABC',\n keyCode: 50,\n ref: undefined,\n right: 2,\n down: 4,\n left: 0\n },\n {\n sign: '3',\n alt: 'DEF',\n keyCode: 51,\n ref: undefined,\n down: 5,\n left: 1\n },\n {\n sign: '4',\n alt: 'GHI',\n keyCode: 52,\n ref: undefined,\n up: 0,\n right: 4,\n down: 6\n },\n {\n sign: '5',\n alt: 'JKL',\n keyCode: 53,\n ref: undefined,\n up: 1,\n right: 5,\n down: 7,\n left: 3\n },\n {\n sign: '6',\n alt: 'MNO',\n keyCode: 54,\n ref: undefined,\n up: 2,\n down: 8,\n left: 4\n },\n {\n sign: '7',\n alt: 'PQRS',\n keyCode: 55,\n ref: undefined,\n up: 3,\n right: 7,\n down: 9\n },\n {\n sign: '8',\n alt: 'TUV',\n keyCode: 56,\n ref: undefined,\n up: 4,\n right: 8,\n down: 10,\n left: 6\n },\n {\n sign: '9',\n alt: 'WXYZ',\n keyCode: 57,\n ref: undefined,\n up: 5,\n down: 11,\n left: 7\n },\n {\n special: '*',\n keyCode: 42,\n ref: undefined,\n up: 6,\n right: 10,\n down: 12\n }\n];\n\nexport const dtmfGraph = baseGraph.concat([\n {\n sign: '0',\n alt: '+',\n keyCode: 48,\n altKeyCode: 43,\n ref: undefined,\n up: 7,\n right: 11,\n left: 9\n },\n {\n special: '#',\n keyCode: 35,\n ref: undefined,\n up: 8,\n left: 10\n },\n {\n icon: 'backspace',\n keyCode: 127,\n ref: undefined,\n up: 10\n }\n]);\n\nexport const defaultGraph = baseGraph.concat([\n {\n sign: '0',\n alt: '+',\n keyCode: 48,\n altKeyCode: 43,\n ref: undefined,\n up: 7,\n right: 11,\n down: 12,\n left: 9\n },\n {\n special: '#',\n keyCode: 35,\n ref: undefined,\n up: 8,\n down: 12,\n left: 10\n },\n {\n icon: 'backspace',\n keyCode: 127,\n ref: undefined,\n up: 10\n }\n]);\n\nexport const defaultButtonGrid = [\n [defaultGraph[0], defaultGraph[1], defaultGraph[2]],\n [defaultGraph[3], defaultGraph[4], defaultGraph[5]],\n [defaultGraph[6], defaultGraph[7], defaultGraph[8]],\n [defaultGraph[9], defaultGraph[10], defaultGraph[11]],\n [defaultGraph[12]]\n];\n\nexport const dtmfButtonGrid = [\n [dtmfGraph[0], dtmfGraph[1], dtmfGraph[2]],\n [dtmfGraph[3], dtmfGraph[4], dtmfGraph[5]],\n [dtmfGraph[6], dtmfGraph[7], dtmfGraph[8]],\n [dtmfGraph[9], dtmfGraph[10], dtmfGraph[11]]\n];\n"]}
@@ -0,0 +1,4 @@
1
+ export { default } from './DialPad';
2
+ export { default as DialPadDialog } from './DialPadDialog';
3
+ export type { DialPadKeyboardProps } from './DialPadKeyboard';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './DialPad';
2
+ export { default as DialPadDialog } from './DialPadDialog';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DialPad/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { default } from './DialPad';\nexport { default as DialPadDialog } from './DialPadDialog';\nexport type { DialPadKeyboardProps } from './DialPadKeyboard';\n"]}
@@ -0,0 +1,4 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export declare const getDialButtonIndex: (e: KeyboardEvent) => number;
3
+ export declare const isNavigationEvent: (e: KeyboardEvent) => boolean;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/DialPad/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,kBAAkB,MAAO,aAAa,KAAG,MAIrD,CAAC;AAEF,eAAO,MAAM,iBAAiB,MAAO,aAAa,YAEjD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const getDialButtonIndex = (e) => {
2
+ return ['1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#', 'Backspace'].findIndex(key => key === e.key);
3
+ };
4
+ export const isNavigationEvent = (e) => {
5
+ return ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key);
6
+ };
7
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/DialPad/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAgB,EAAU,EAAE;IAC7D,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,SAAS,CACxF,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAgB,EAAE,EAAE;IACpD,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC,CAAC","sourcesContent":["import { KeyboardEvent } from 'react';\n\nexport const getDialButtonIndex = (e: KeyboardEvent): number => {\n return ['1', '2', '3', '4', '5', '6', '7', '8', '9', '*', '0', '#', 'Backspace'].findIndex(\n key => key === e.key\n );\n};\n\nexport const isNavigationEvent = (e: KeyboardEvent) => {\n return ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(e.key);\n};\n"]}
@@ -0,0 +1,15 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { ButtonProps, ForwardProps } from '@pega/cosmos-react-core';
3
+ export interface CountdownButtonProps extends ButtonProps {
4
+ /** Text or content for the Button. */
5
+ children: ReactNode;
6
+ /** Start time of incoming Interaction. */
7
+ startTime: Date | number;
8
+ /** The time the user has to accept the call in seconds. */
9
+ timeout: number;
10
+ /** Callback invoked when timeout ends. */
11
+ onTimerEnd?: () => void;
12
+ }
13
+ declare const CountdownButton: FunctionComponent<CountdownButtonProps & ForwardProps>;
14
+ export default CountdownButton;
15
+ //# sourceMappingURL=CountdownButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountdownButton.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/CountdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAC;AAG3F,OAAO,EAOL,WAAW,EACX,YAAY,EACb,MAAM,yBAAyB,CAAC;AAIjC,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,0CAA0C;IAC1C,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IACzB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAUD,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAqD3E,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, 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 CountdownButton = forwardRef(function CountdownButton({ startTime, timeout, onTimerEnd, children, ...restProps }, ref) {
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
+ // Omitting onTimerEnd as an effect trigger on purpose.
31
+ // An unstable function definition in the prop causes the effect to run more than necessary.
32
+ // The proper definition will be captured and used with any changes to msRemaining.
33
+ [msRemaining]);
34
+ const timer = msRemaining > 0 ? formatDuration(msRemaining) : '0:00';
35
+ return (_jsxs(_Fragment, { children: [_jsxs(StyledAcceptButton, { ...restProps, "aria-describedby": descriptionId, ref: ref, children: [children, _jsx(Text, { "aria-hidden": 'true', children: timer })] }), _jsx(VisuallyHiddenText, { "aria-hidden": 'true', id: descriptionId, children: msRemaining > 0
36
+ ? t('interaction_time_remaining', [secondsRemaining], {
37
+ count: secondsRemaining
38
+ })
39
+ : t('interaction_time_expired') })] }));
40
+ });
41
+ export default CountdownButton;
42
+ //# sourceMappingURL=CountdownButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CountdownButton.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/CountdownButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAqC,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,OAAO,EACP,IAAI,EACJ,kBAAkB,EAClB,MAAM,EACN,MAAM,EACN,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAa3D,MAAM,kBAAkB,GAAG,MAAM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GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAErE,OAAO,CACL,8BACE,MAAC,kBAAkB,OAAK,SAAS,sBAAoB,aAAa,EAAE,GAAG,EAAE,GAAG,aACzE,QAAQ,EACT,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,eAAe,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, ReactNode, Ref, 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 ButtonProps,\n ForwardProps\n} from '@pega/cosmos-react-core';\n\nimport { formatDuration } from '../CallControlPanel/utils';\n\nexport interface CountdownButtonProps extends ButtonProps {\n /** Text or content for the Button. */\n children: ReactNode;\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}\n\nconst StyledAcceptButton = styled(Button)(\n ({ theme }) => css`\n gap: ${theme.base.spacing};\n `\n);\n\nStyledAcceptButton.defaultProps = defaultThemeProp;\n\nconst CountdownButton: FunctionComponent<CountdownButtonProps & ForwardProps> = forwardRef(\n function CountdownButton(\n { startTime, timeout, onTimerEnd, children, ...restProps }: CountdownButtonProps & ForwardProps,\n ref: Ref<HTMLButtonElement>\n ) {\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 // 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 [msRemaining]\n );\n\n const timer = msRemaining > 0 ? formatDuration(msRemaining) : '0:00';\n\n return (\n <>\n <StyledAcceptButton {...restProps} aria-describedby={descriptionId} ref={ref}>\n {children}\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 CountdownButton;\n"]}
@@ -0,0 +1,35 @@
1
+ import { FunctionComponent, Ref } from 'react';
2
+ import { StatusProps, ForwardProps, FieldValueListProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ import { CountdownButtonProps } from './CountdownButton';
4
+ export interface InteractionNotificationProps extends NoChildrenProp {
5
+ /** Ref to Component. */
6
+ ref?: Ref<HTMLDivElement>;
7
+ /** Name of the icon used in header. */
8
+ icon: string;
9
+ /** Interaction title. */
10
+ title: string;
11
+ /** Primary information of the notification. For example caller name . */
12
+ primaryText: string;
13
+ /** Secondary information of the notification. For example phone number of the caller */
14
+ secondaryText?: string;
15
+ /** Represents the current status of interaction. */
16
+ status: {
17
+ variant: StatusProps['variant'];
18
+ text: string;
19
+ };
20
+ /** Information structured as field values to be displayed below main section. */
21
+ fields?: FieldValueListProps['fields'];
22
+ /** Timeout definition */
23
+ incomingNotificationTimeout?: {
24
+ startTime: CountdownButtonProps['startTime'];
25
+ answerTimeout: CountdownButtonProps['timeout'];
26
+ onTimerEnd?: CountdownButtonProps['onTimerEnd'];
27
+ };
28
+ /** Callback when accept button is clicked. */
29
+ onAccept: () => void;
30
+ /** Callback when decline button is clicked. */
31
+ onDecline?: () => void;
32
+ }
33
+ declare const InteractionNotification: FunctionComponent<InteractionNotificationProps & ForwardProps>;
34
+ export default InteractionNotification;
35
+ //# sourceMappingURL=InteractionNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionNotification.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/InteractionNotification.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAqB,MAAM,OAAO,CAAC;AAG/F,OAAO,EAOL,WAAW,EACX,YAAY,EAOZ,mBAAmB,EAEnB,cAAc,EASf,MAAM,yBAAyB,CAAC;AAGjC,OAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,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,oBAAoB,CAAC,WAAW,CAAC,CAAC;QAC7C,aAAa,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAC/C,UAAU,CAAC,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;KACjD,CAAC;IACF,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAgFD,QAAA,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,4BAA4B,GAAG,YAAY,CAmGxF,CAAC;AAEL,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,110 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useRef } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { Button, Card, CardContent, CardHeader, Status, Text, defaultThemeProp, Flex, StyledText, FieldValueList, StyledFieldValueList, useI18n, useDirection, Icon, StyledLabel, useLiveLog, registerAction, useShortcut, useConsolidatedRef, useEscape, CardFooter } from '@pega/cosmos-react-core';
5
+ import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
6
+ import CountdownButton from './CountdownButton';
7
+ const StyledInteractionNotification = styled(Card)(({ theme: { base } }) => {
8
+ const { rtl } = useDirection();
9
+ return css `
10
+ position: fixed;
11
+ inset-block-start: calc(2 * ${base.spacing});
12
+ inset-inline-end: calc(2 * ${base.spacing});
13
+ width: min(calc(100% - 2rem), ${base['content-width'].md});
14
+ max-height: calc(100vh - 2rem);
15
+ z-index: ${base['z-index'].modal};
16
+ color: ${base.colors.white};
17
+ animation: SlideIn calc(4 * ${base.animation.speed});
18
+ padding: calc(0.75 * ${base.spacing}) 0;
19
+ box-shadow: ${base.shadow.low};
20
+
21
+ &&& {
22
+ background-color: ${base.colors.slate['extra-dark']};
23
+ }
24
+
25
+ @keyframes SlideIn {
26
+ 0% {
27
+ ${rtl
28
+ ? css `
29
+ transform: translateX(calc(-100% - 1rem));
30
+ `
31
+ : css `
32
+ transform: translateX(calc(100% + 1rem));
33
+ `}
34
+ }
35
+
36
+ 100% {
37
+ transform: translateX(0);
38
+ }
39
+ }
40
+
41
+ ${StyledCardContent} {
42
+ margin: calc(2 * ${base.spacing}) 0;
43
+ overflow: auto;
44
+
45
+ ${StyledText} {
46
+ color: ${base.colors.white};
47
+ white-space: nowrap;
48
+ overflow: hidden;
49
+ text-overflow: ellipsis;
50
+ width: 100%;
51
+ text-align: center;
52
+ }
53
+ }
54
+
55
+ ${StyledFieldValueList} {
56
+ border-block-start: solid 0.0625rem ${base.palette['border-line']};
57
+ padding-block-start: calc(2 * ${base.spacing});
58
+ color: ${base.colors.white};
59
+
60
+ ${StyledLabel} {
61
+ color: ${base.colors.white};
62
+ }
63
+ }
64
+
65
+ @media (min-width: calc(${base.breakpoints.md})) {
66
+ inset-block-start: calc(8 * ${base.spacing});
67
+ max-height: initial;
68
+ }
69
+ `;
70
+ });
71
+ StyledInteractionNotification.defaultProps = defaultThemeProp;
72
+ registerAction({
73
+ id: 'GoToIncomingInteraction',
74
+ defaultKeyBinding: 'Alt+Enter'
75
+ }, {
76
+ id: 'DismissIncomingInteraction',
77
+ defaultKeyBinding: 'Alt+Q'
78
+ });
79
+ const InteractionNotification = forwardRef(function InteractionNotification({ icon, title, primaryText, secondaryText, status, fields, incomingNotificationTimeout, onAccept, onDecline }, ref) {
80
+ const t = useI18n();
81
+ const { announceAssertive } = useLiveLog();
82
+ const containerRef = useConsolidatedRef(ref);
83
+ const returnRef = useRef();
84
+ const acceptButtonRef = useRef(null);
85
+ const { binding: goToBinding } = useShortcut('GoToIncomingInteraction', () => {
86
+ if (containerRef.current) {
87
+ returnRef.current = document.activeElement ?? undefined;
88
+ acceptButtonRef.current?.focus();
89
+ }
90
+ });
91
+ const { binding: dismissBinding } = useShortcut('DismissIncomingInteraction', () => {
92
+ onDecline?.();
93
+ });
94
+ useEscape(() => {
95
+ returnRef.current?.focus();
96
+ onDecline?.();
97
+ }, containerRef.current, [onDecline]);
98
+ useEffect(() => {
99
+ announceAssertive({
100
+ message: `${title} ${primaryText} ${t('status')} ${status.text}. ${goToBinding ? t('interaction_shortcut_goto_info', [goToBinding]) : ''}${dismissBinding && onDecline
101
+ ? t('interaction_shortcut_dismiss_info', [dismissBinding])
102
+ : ''}`,
103
+ type: 'alert'
104
+ });
105
+ }, []);
106
+ const acceptButton = incomingNotificationTimeout ? (_jsx(CountdownButton, { variant: 'primary', onClick: onAccept, startTime: incomingNotificationTimeout.startTime, timeout: incomingNotificationTimeout.answerTimeout, onTimerEnd: incomingNotificationTimeout.onTimerEnd ?? onDecline, ref: acceptButtonRef, children: t('accept') })) : (_jsx(Button, { variant: 'primary', onClick: onAccept, ref: acceptButtonRef, children: t('accept') }));
107
+ return (_jsxs(StyledInteractionNotification, { ref: containerRef, "data-app-region": true, children: [_jsx(CardHeader, { children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsx(Icon, { name: icon }), _jsx(Text, { variant: 'h2', children: title })] }) }), _jsxs(CardContent, { container: { gap: 2 }, 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(FieldValueList, { variant: 'inline', fields: fields })] }), _jsxs(CardFooter, { justify: onDecline ? 'between' : 'end', children: [onDecline && _jsx(Button, { onClick: onDecline, children: t('decline') }), acceptButton] })] }));
108
+ });
109
+ export default InteractionNotification;
110
+ //# sourceMappingURL=InteractionNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionNotification.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/InteractionNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,MAAM,EAAE,EAAE,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AQ,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,MAAC,WAAW,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,aAChC,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,CAChB,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,MAAM,YACzB,aAAa,GACT,CACR,EACD,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YAAG,MAAM,CAAC,IAAI,GAAU,IAClD,EACN,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,KAAC,cAAc,IAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,EAAE,MAAM,GAAI,IACzE,EAEd,MAAC,UAAU,IAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,aAC/C,SAAS,IAAI,KAAC,MAAM,IAAC,OAAO,EAAE,SAAS,YAAG,CAAC,CAAC,SAAS,CAAC,GAAU,EAChE,YAAY,IACF,IACiB,CACjC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,eAAe,uBAAuB,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref, useEffect, useRef } 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 StyledFieldValueList,\n useI18n,\n FieldValueListProps,\n useDirection,\n NoChildrenProp,\n Icon,\n StyledLabel,\n useLiveLog,\n registerAction,\n useShortcut,\n useConsolidatedRef,\n useEscape,\n CardFooter\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\n\nimport CountdownButton, { CountdownButtonProps } from './CountdownButton';\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: CountdownButtonProps['startTime'];\n answerTimeout: CountdownButtonProps['timeout'];\n onTimerEnd?: CountdownButtonProps['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-block-start: calc(2 * ${base.spacing});\n inset-inline-end: calc(2 * ${base.spacing});\n width: min(calc(100% - 2rem), ${base['content-width'].md});\n max-height: calc(100vh - 2rem);\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 box-shadow: ${base.shadow.low};\n\n &&& {\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 ${StyledCardContent} {\n margin: calc(2 * ${base.spacing}) 0;\n overflow: auto;\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-block-start: solid 0.0625rem ${base.palette['border-line']};\n padding-block-start: calc(2 * ${base.spacing});\n color: ${base.colors.white};\n\n ${StyledLabel} {\n color: ${base.colors.white};\n }\n }\n\n @media (min-width: calc(${base.breakpoints.md})) {\n inset-block-start: calc(8 * ${base.spacing});\n max-height: initial;\n }\n `;\n});\n\nStyledInteractionNotification.defaultProps = defaultThemeProp;\n\nregisterAction(\n {\n id: 'GoToIncomingInteraction',\n defaultKeyBinding: 'Alt+Enter'\n },\n {\n id: 'DismissIncomingInteraction',\n defaultKeyBinding: 'Alt+Q'\n }\n);\n\nconst InteractionNotification: FunctionComponent<InteractionNotificationProps & ForwardProps> =\n forwardRef(function InteractionNotification(\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 const { announceAssertive } = useLiveLog();\n const containerRef = useConsolidatedRef(ref);\n const returnRef = useRef<HTMLElement>();\n const acceptButtonRef = useRef<HTMLButtonElement>(null);\n\n const { binding: goToBinding } = useShortcut('GoToIncomingInteraction', () => {\n if (containerRef.current) {\n returnRef.current = (document.activeElement as HTMLElement) ?? undefined;\n acceptButtonRef.current?.focus();\n }\n });\n const { binding: dismissBinding } = useShortcut('DismissIncomingInteraction', () => {\n onDecline?.();\n });\n\n useEscape(\n () => {\n returnRef.current?.focus();\n onDecline?.();\n },\n containerRef.current,\n [onDecline]\n );\n\n useEffect(() => {\n announceAssertive({\n message: `${title} ${primaryText} ${t('status')} ${status.text}. ${\n goToBinding ? t('interaction_shortcut_goto_info', [goToBinding]) : ''\n }${\n dismissBinding && onDecline\n ? t('interaction_shortcut_dismiss_info', [dismissBinding])\n : ''\n }`,\n type: 'alert'\n });\n }, []);\n\n const acceptButton = incomingNotificationTimeout ? (\n <CountdownButton\n variant='primary'\n onClick={onAccept}\n startTime={incomingNotificationTimeout.startTime}\n timeout={incomingNotificationTimeout.answerTimeout}\n onTimerEnd={incomingNotificationTimeout.onTimerEnd ?? onDecline}\n ref={acceptButtonRef}\n >\n {t('accept')}\n </CountdownButton>\n ) : (\n <Button variant='primary' onClick={onAccept} ref={acceptButtonRef}>\n {t('accept')}\n </Button>\n );\n\n return (\n <StyledInteractionNotification ref={containerRef} data-app-region>\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 container={{ gap: 2 }}>\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 {fields && fields.length !== 0 && <FieldValueList variant='inline' fields={fields} />}\n </CardContent>\n\n <CardFooter justify={onDecline ? 'between' : 'end'}>\n {onDecline && <Button onClick={onDecline}>{t('decline')}</Button>}\n {acceptButton}\n </CardFooter>\n </StyledInteractionNotification>\n );\n });\n\nexport default InteractionNotification;\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './InteractionNotification';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionNotification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './InteractionNotification';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/InteractionNotification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export { default } from './InteractionNotification';\n"]}
@@ -0,0 +1,29 @@
1
+ import { FunctionComponent, Ref } from 'react';
2
+ import { BaseProps, AsProp, ForwardProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ export interface InteractionTimerProps extends BaseProps, AsProp, NoChildrenProp {
4
+ /** Name of the icon */
5
+ icon: string;
6
+ /** Ref to Component */
7
+ ref?: Ref<HTMLDivElement>;
8
+ /** Current Sla. This is used to display progress ring color. */
9
+ sla?: 'goal' | 'deadline' | 'past-deadline';
10
+ /** Progress % of the current stage
11
+ * @default 0
12
+ */
13
+ progress?: number;
14
+ /** Indicates if there are any unread notifications
15
+ * @default false
16
+ */
17
+ hasNotifications?: boolean;
18
+ /** Meta info */
19
+ meta?: string;
20
+ /** Aria label for screen readers. */
21
+ ariaLabel?: string;
22
+ }
23
+ export declare const StyledInteractionTimerIconWrapper: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
24
+ export declare const StyledInteractionTimerIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {}, never>;
25
+ export declare const StyledInteractionTimerMetaText: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
26
+ export declare const StyledInteractionTimer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<InteractionTimerProps, "progress" | "icon" | "meta" | "children" | "ref" | "as" | "className" | "forwardedAs" | "ariaLabel" | "hasNotifications"> & Required<Pick<InteractionTimerProps, "sla">>, never>;
27
+ declare const InteractionTimer: FunctionComponent<InteractionTimerProps & ForwardProps>;
28
+ export default InteractionTimer;
29
+ //# sourceMappingURL=InteractionTimer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionTimer.d.ts","sourceRoot":"","sources":["../../../src/components/InteractionTimer/InteractionTimer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,SAAS,EACT,MAAM,EAKN,YAAY,EAIZ,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,qBAAsB,SAAQ,SAAS,EAAE,MAAM,EAAE,cAAc;IAC9E,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,eAAe,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,iCAAiC,0GAAgB,CAAC;AAC/D,eAAO,MAAM,0BAA0B,0LAAiB,CAAC;AACzD,eAAO,MAAM,8BAA8B,0GAAgB,CAAC;AAI5D,eAAO,MAAM,sBAAsB,4SAgElC,CAAC;AAIF,QAAA,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,GAAG,YAAY,CAmE7E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useRef, useState } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { Flex, Icon, Text, Progress, defaultThemeProp, StyledProgressRing, useConsolidatedRef } from '@pega/cosmos-react-core';
5
+ export const StyledInteractionTimerIconWrapper = styled.span ``;
6
+ export const StyledInteractionTimerIcon = styled(Icon) ``;
7
+ export const StyledInteractionTimerMetaText = styled.span ``;
8
+ export const StyledInteractionTimer = styled.div(({ sla, hasNotifications, theme: { components: { 'interaction-timer': InteractionTimerTheme } }, theme }) => {
9
+ return css `
10
+ width: calc(8 * ${theme.base.spacing});
11
+ flex-shrink: 0;
12
+
13
+ ${StyledInteractionTimerIconWrapper} {
14
+ font-size: 2.2rem;
15
+ position: relative;
16
+ display: inline-flex;
17
+ padding: calc(0.3 * ${theme.base.spacing});
18
+ ${hasNotifications &&
19
+ css `
20
+ &::after {
21
+ position: absolute;
22
+ background-color: ${InteractionTimerTheme['notification-indicator']};
23
+ border-radius: 50%;
24
+ content: '';
25
+ top: 0;
26
+ right: 0;
27
+ width: 0.3rem;
28
+ height: 0.3rem;
29
+ }
30
+ `}
31
+ }
32
+
33
+ ${StyledProgressRing} {
34
+ circle {
35
+ stroke-width: 1;
36
+ stroke: ${sla
37
+ ? InteractionTimerTheme.sla[sla].progress['secondary-color']
38
+ : 'currentcolor'};
39
+ }
40
+ circle + circle {
41
+ stroke: ${sla
42
+ ? InteractionTimerTheme.sla[sla].progress['primary-color']
43
+ : 'currentcolor'};
44
+ }
45
+ }
46
+ ${StyledInteractionTimerIcon} {
47
+ font-size: 1.5rem;
48
+ margin: auto;
49
+ position: absolute;
50
+ display: inline-flex;
51
+ top: 0;
52
+ left: 0;
53
+ bottom: 0;
54
+ right: 0;
55
+ width: 100%;
56
+ align-items: center;
57
+ justify-content: center;
58
+ }
59
+ ${StyledInteractionTimerMetaText} {
60
+ color: inherit;
61
+ }
62
+ `;
63
+ });
64
+ StyledInteractionTimer.defaultProps = defaultThemeProp;
65
+ const InteractionTimer = forwardRef(function InteractionTimer({ icon, progress = 0, hasNotifications = false, meta, sla, ariaLabel, ...restProps }, ref) {
66
+ const [currentTimeLabel, setCurrentTimeLabel] = useState('');
67
+ const containerRef = useConsolidatedRef(ref);
68
+ const labelRef = useRef('');
69
+ useEffect(() => {
70
+ if (ariaLabel)
71
+ labelRef.current = ariaLabel;
72
+ }, [ariaLabel]);
73
+ useEffect(() => {
74
+ const onFocus = () => {
75
+ if (document.activeElement?.contains(containerRef.current) && labelRef.current) {
76
+ setCurrentTimeLabel(labelRef.current);
77
+ }
78
+ };
79
+ document.addEventListener('focusin', onFocus);
80
+ return () => {
81
+ document.removeEventListener('focusin', onFocus);
82
+ };
83
+ }, []);
84
+ return (_jsxs(Flex, { ...restProps, ref: containerRef, container: {
85
+ direction: 'column',
86
+ alignItems: 'center'
87
+ }, sla: sla, hasNotifications: hasNotifications, as: StyledInteractionTimer, "aria-label": currentTimeLabel, role: 'timer', children: [_jsxs(StyledInteractionTimerIconWrapper, { children: [_jsx(StyledInteractionTimerIcon, { name: icon }), _jsx(Progress, { variant: 'ring', minValue: 0, maxValue: 100, value: progress, placement: 'inline', "aria-hidden": 'true' })] }), meta && (_jsx(Text, { variant: 'secondary', as: StyledInteractionTimerMetaText, "aria-hidden": 'true', children: meta }))] }));
88
+ });
89
+ export default InteractionTimer;
90
+ //# sourceMappingURL=InteractionTimer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionTimer.js","sourceRoot":"","sources":["../../../src/components/InteractionTimer/InteractionTimer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAIV,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAGL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,QAAQ,EAER,gBAAgB,EAChB,kBAAkB,EAGlB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAuBjC,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAC/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA,EAAE,CAAC;AACzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC,IAAI,CAAA,EAAE,CAAC;AAI5D,MAAM,CAAC,MAAM,sBAAsB,GA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ef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n BaseProps,\n AsProp,\n Flex,\n Icon,\n Text,\n Progress,\n ForwardProps,\n defaultThemeProp,\n StyledProgressRing,\n PropsWithDefaults,\n NoChildrenProp,\n useConsolidatedRef\n} from '@pega/cosmos-react-core';\n\nexport interface InteractionTimerProps extends BaseProps, AsProp, NoChildrenProp {\n /** Name of the icon */\n icon: string;\n /** Ref to Component */\n ref?: Ref<HTMLDivElement>;\n /** Current Sla. This is used to display progress ring color. */\n sla?: 'goal' | 'deadline' | 'past-deadline';\n /** Progress % of the current stage\n * @default 0\n */\n progress?: number;\n /** Indicates if there are any unread notifications\n * @default false\n */\n hasNotifications?: boolean;\n /** Meta info */\n meta?: string;\n /** Aria label for screen readers. */\n ariaLabel?: string;\n}\n\nexport const StyledInteractionTimerIconWrapper = styled.span``;\nexport const StyledInteractionTimerIcon = styled(Icon)``;\nexport const StyledInteractionTimerMetaText = styled.span``;\n\ntype InteractionTimerPropsWithDefaults = PropsWithDefaults<InteractionTimerProps, 'sla'>;\n\nexport const StyledInteractionTimer = styled.div<InteractionTimerPropsWithDefaults>(\n ({\n sla,\n hasNotifications,\n theme: {\n components: { 'interaction-timer': InteractionTimerTheme }\n },\n theme\n }) => {\n return css`\n width: calc(8 * ${theme.base.spacing});\n flex-shrink: 0;\n\n ${StyledInteractionTimerIconWrapper} {\n font-size: 2.2rem;\n position: relative;\n display: inline-flex;\n padding: calc(0.3 * ${theme.base.spacing});\n ${hasNotifications &&\n css`\n &::after {\n position: absolute;\n background-color: ${InteractionTimerTheme['notification-indicator']};\n border-radius: 50%;\n content: '';\n top: 0;\n right: 0;\n width: 0.3rem;\n height: 0.3rem;\n }\n `}\n }\n\n ${StyledProgressRing} {\n circle {\n stroke-width: 1;\n stroke: ${sla\n ? InteractionTimerTheme.sla[sla].progress['secondary-color']\n : 'currentcolor'};\n }\n circle + circle {\n stroke: ${sla\n ? InteractionTimerTheme.sla[sla].progress['primary-color']\n : 'currentcolor'};\n }\n }\n ${StyledInteractionTimerIcon} {\n font-size: 1.5rem;\n margin: auto;\n position: absolute;\n display: inline-flex;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n align-items: center;\n justify-content: center;\n }\n ${StyledInteractionTimerMetaText} {\n color: inherit;\n }\n `;\n }\n);\n\nStyledInteractionTimer.defaultProps = defaultThemeProp;\n\nconst InteractionTimer: FunctionComponent<InteractionTimerProps & ForwardProps> = forwardRef(\n function InteractionTimer(\n {\n icon,\n progress = 0,\n hasNotifications = false,\n meta,\n sla,\n ariaLabel,\n ...restProps\n }: PropsWithoutRef<InteractionTimerProps>,\n ref: InteractionTimerProps['ref']\n ) {\n const [currentTimeLabel, setCurrentTimeLabel] = useState('');\n const containerRef = useConsolidatedRef(ref);\n const labelRef = useRef('');\n\n useEffect(() => {\n if (ariaLabel) labelRef.current = ariaLabel;\n }, [ariaLabel]);\n\n useEffect(() => {\n const onFocus = () => {\n if (document.activeElement?.contains(containerRef.current) && labelRef.current) {\n setCurrentTimeLabel(labelRef.current);\n }\n };\n\n document.addEventListener('focusin', onFocus);\n return () => {\n document.removeEventListener('focusin', onFocus);\n };\n }, []);\n\n return (\n <Flex\n {...restProps}\n ref={containerRef}\n container={{\n direction: 'column',\n alignItems: 'center'\n }}\n sla={sla}\n hasNotifications={hasNotifications}\n as={StyledInteractionTimer}\n aria-label={currentTimeLabel}\n role='timer'\n >\n <StyledInteractionTimerIconWrapper>\n <StyledInteractionTimerIcon name={icon} />\n <Progress\n variant='ring'\n minValue={0}\n maxValue={100}\n value={progress}\n placement='inline'\n aria-hidden='true'\n />\n </StyledInteractionTimerIconWrapper>\n {meta && (\n <Text variant='secondary' as={StyledInteractionTimerMetaText} aria-hidden='true'>\n {meta}\n </Text>\n )}\n </Flex>\n );\n }\n);\n\nexport default InteractionTimer;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './InteractionTimer';
2
+ export type { InteractionTimerProps } from './InteractionTimer';
3
+ //# sourceMappingURL=index.d.ts.map