@pega/cosmos-react-work 2.1.6 → 2.1.7

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 (225) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +33 -0
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -0
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +91 -0
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -0
  5. package/lib/components/AppAnnouncement/index.d.ts +3 -0
  6. package/lib/components/AppAnnouncement/index.d.ts.map +1 -0
  7. package/lib/components/AppAnnouncement/index.js +2 -0
  8. package/lib/components/AppAnnouncement/index.js.map +1 -0
  9. package/lib/components/CaseHeader/CaseHeader.d.ts +30 -0
  10. package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -0
  11. package/lib/components/CaseHeader/CaseHeader.js +119 -0
  12. package/lib/components/CaseHeader/CaseHeader.js.map +1 -0
  13. package/lib/components/CaseHeader/index.d.ts +4 -0
  14. package/lib/components/CaseHeader/index.d.ts.map +1 -0
  15. package/lib/components/CaseHeader/index.js +3 -0
  16. package/lib/components/CaseHeader/index.js.map +1 -0
  17. package/lib/components/CasePreview/CasePreview.d.ts +22 -0
  18. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -0
  19. package/lib/components/CasePreview/CasePreview.js +80 -0
  20. package/lib/components/CasePreview/CasePreview.js.map +1 -0
  21. package/lib/components/CasePreview/index.d.ts +3 -0
  22. package/lib/components/CasePreview/index.d.ts.map +1 -0
  23. package/lib/components/CasePreview/index.js +2 -0
  24. package/lib/components/CasePreview/index.js.map +1 -0
  25. package/lib/components/CaseSummary/CaseSummary.d.ts +36 -0
  26. package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -0
  27. package/lib/components/CaseSummary/CaseSummary.js +130 -0
  28. package/lib/components/CaseSummary/CaseSummary.js.map +1 -0
  29. package/lib/components/CaseSummary/index.d.ts +4 -0
  30. package/lib/components/CaseSummary/index.d.ts.map +1 -0
  31. package/lib/components/CaseSummary/index.js +3 -0
  32. package/lib/components/CaseSummary/index.js.map +1 -0
  33. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts +22 -0
  34. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -0
  35. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +25 -0
  36. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -0
  37. package/lib/components/CaseSummaryFields/index.d.ts +4 -0
  38. package/lib/components/CaseSummaryFields/index.d.ts.map +1 -0
  39. package/lib/components/CaseSummaryFields/index.js +3 -0
  40. package/lib/components/CaseSummaryFields/index.js.map +1 -0
  41. package/lib/components/CaseView/CaseView.d.ts +31 -0
  42. package/lib/components/CaseView/CaseView.d.ts.map +1 -0
  43. package/lib/components/CaseView/CaseView.js +259 -0
  44. package/lib/components/CaseView/CaseView.js.map +1 -0
  45. package/lib/components/CaseView/CaseView.styles.d.ts +23 -0
  46. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  47. package/lib/components/CaseView/CaseView.styles.js +106 -0
  48. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  49. package/lib/components/CaseView/MobileCaseView.d.ts +13 -0
  50. package/lib/components/CaseView/MobileCaseView.d.ts.map +1 -0
  51. package/lib/components/CaseView/MobileCaseView.js +25 -0
  52. package/lib/components/CaseView/MobileCaseView.js.map +1 -0
  53. package/lib/components/CaseView/UtilitiesSummary.d.ts +12 -0
  54. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -0
  55. package/lib/components/CaseView/UtilitiesSummary.js +21 -0
  56. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -0
  57. package/lib/components/CaseView/index.d.ts +6 -0
  58. package/lib/components/CaseView/index.d.ts.map +1 -0
  59. package/lib/components/CaseView/index.js +4 -0
  60. package/lib/components/CaseView/index.js.map +1 -0
  61. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  62. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  63. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +93 -0
  64. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  65. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +43 -0
  66. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  67. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  68. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  69. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  70. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  71. package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
  72. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  73. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  74. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  75. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  76. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  77. package/lib/components/ConfigurableLayout/index.d.ts +4 -0
  78. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  79. package/lib/components/ConfigurableLayout/index.js +3 -0
  80. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  81. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  82. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  83. package/lib/components/ConfigurableLayout/options.js +10 -0
  84. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  85. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
  86. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
  87. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
  88. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
  89. package/lib/components/Confirmation/Confirmation.d.ts +19 -0
  90. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
  91. package/lib/components/Confirmation/Confirmation.js +14 -0
  92. package/lib/components/Confirmation/Confirmation.js.map +1 -0
  93. package/lib/components/Confirmation/index.d.ts +3 -0
  94. package/lib/components/Confirmation/index.d.ts.map +1 -0
  95. package/lib/components/Confirmation/index.js +2 -0
  96. package/lib/components/Confirmation/index.js.map +1 -0
  97. package/lib/components/Details/Details.d.ts +13 -0
  98. package/lib/components/Details/Details.d.ts.map +1 -0
  99. package/lib/components/Details/Details.js +38 -0
  100. package/lib/components/Details/Details.js.map +1 -0
  101. package/lib/components/Details/index.d.ts +4 -0
  102. package/lib/components/Details/index.d.ts.map +1 -0
  103. package/lib/components/Details/index.js +3 -0
  104. package/lib/components/Details/index.js.map +1 -0
  105. package/lib/components/Glimpse/Glimpse.d.ts +20 -0
  106. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -0
  107. package/lib/components/Glimpse/Glimpse.js +22 -0
  108. package/lib/components/Glimpse/Glimpse.js.map +1 -0
  109. package/lib/components/Glimpse/index.d.ts +3 -0
  110. package/lib/components/Glimpse/index.d.ts.map +1 -0
  111. package/lib/components/Glimpse/index.js +3 -0
  112. package/lib/components/Glimpse/index.js.map +1 -0
  113. package/lib/components/SearchResults/Filter.d.ts +8 -0
  114. package/lib/components/SearchResults/Filter.d.ts.map +1 -0
  115. package/lib/components/SearchResults/Filter.js +45 -0
  116. package/lib/components/SearchResults/Filter.js.map +1 -0
  117. package/lib/components/SearchResults/SearchResult.d.ts +4 -0
  118. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -0
  119. package/lib/components/SearchResults/SearchResult.js +21 -0
  120. package/lib/components/SearchResults/SearchResult.js.map +1 -0
  121. package/lib/components/SearchResults/SearchResults.d.ts +6 -0
  122. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -0
  123. package/lib/components/SearchResults/SearchResults.js +102 -0
  124. package/lib/components/SearchResults/SearchResults.js.map +1 -0
  125. package/lib/components/SearchResults/SearchResults.styles.d.ts +8 -0
  126. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
  127. package/lib/components/SearchResults/SearchResults.styles.js +67 -0
  128. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
  129. package/lib/components/SearchResults/SearchResults.types.d.ts +96 -0
  130. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -0
  131. package/lib/components/SearchResults/SearchResults.types.js +2 -0
  132. package/lib/components/SearchResults/SearchResults.types.js.map +1 -0
  133. package/lib/components/SearchResults/index.d.ts +3 -0
  134. package/lib/components/SearchResults/index.d.ts.map +1 -0
  135. package/lib/components/SearchResults/index.js +2 -0
  136. package/lib/components/SearchResults/index.js.map +1 -0
  137. package/lib/components/Stages/Stages.d.ts +6 -0
  138. package/lib/components/Stages/Stages.d.ts.map +1 -0
  139. package/lib/components/Stages/Stages.js +129 -0
  140. package/lib/components/Stages/Stages.js.map +1 -0
  141. package/lib/components/Stages/Stages.styles.d.ts +16 -0
  142. package/lib/components/Stages/Stages.styles.d.ts.map +1 -0
  143. package/lib/components/Stages/Stages.styles.js +280 -0
  144. package/lib/components/Stages/Stages.styles.js.map +1 -0
  145. package/lib/components/Stages/Stages.types.d.ts +23 -0
  146. package/lib/components/Stages/Stages.types.d.ts.map +1 -0
  147. package/lib/components/Stages/Stages.types.js +2 -0
  148. package/lib/components/Stages/Stages.types.js.map +1 -0
  149. package/lib/components/Stages/Steps.d.ts +8 -0
  150. package/lib/components/Stages/Steps.d.ts.map +1 -0
  151. package/lib/components/Stages/Steps.js +12 -0
  152. package/lib/components/Stages/Steps.js.map +1 -0
  153. package/lib/components/Stages/StepsContainer.d.ts +8 -0
  154. package/lib/components/Stages/StepsContainer.d.ts.map +1 -0
  155. package/lib/components/Stages/StepsContainer.js +11 -0
  156. package/lib/components/Stages/StepsContainer.js.map +1 -0
  157. package/lib/components/Stages/index.d.ts +3 -0
  158. package/lib/components/Stages/index.d.ts.map +1 -0
  159. package/lib/components/Stages/index.js +2 -0
  160. package/lib/components/Stages/index.js.map +1 -0
  161. package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
  162. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  163. package/lib/components/Stakeholders/StakeholderForm.js +49 -0
  164. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  165. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  166. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  167. package/lib/components/Stakeholders/Stakeholders.js +215 -0
  168. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  169. package/lib/components/Stakeholders/Stakeholders.types.d.ts +83 -0
  170. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  171. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  172. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  173. package/lib/components/Stakeholders/index.d.ts +3 -0
  174. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  175. package/lib/components/Stakeholders/index.js +2 -0
  176. package/lib/components/Stakeholders/index.js.map +1 -0
  177. package/lib/components/Tags/Tags.d.ts +34 -0
  178. package/lib/components/Tags/Tags.d.ts.map +1 -0
  179. package/lib/components/Tags/Tags.js +227 -0
  180. package/lib/components/Tags/Tags.js.map +1 -0
  181. package/lib/components/Tags/index.d.ts +2 -0
  182. package/lib/components/Tags/index.d.ts.map +1 -0
  183. package/lib/components/Tags/index.js +2 -0
  184. package/lib/components/Tags/index.js.map +1 -0
  185. package/lib/components/Tasks/TaskList.d.ts +25 -0
  186. package/lib/components/Tasks/TaskList.d.ts.map +1 -0
  187. package/lib/components/Tasks/TaskList.js +25 -0
  188. package/lib/components/Tasks/TaskList.js.map +1 -0
  189. package/lib/components/Tasks/Tasks.d.ts +22 -0
  190. package/lib/components/Tasks/Tasks.d.ts.map +1 -0
  191. package/lib/components/Tasks/Tasks.js +35 -0
  192. package/lib/components/Tasks/Tasks.js.map +1 -0
  193. package/lib/components/Tasks/index.d.ts +6 -0
  194. package/lib/components/Tasks/index.d.ts.map +1 -0
  195. package/lib/components/Tasks/index.js +3 -0
  196. package/lib/components/Tasks/index.js.map +1 -0
  197. package/lib/components/Timeline/Timeline.d.ts +6 -0
  198. package/lib/components/Timeline/Timeline.d.ts.map +1 -0
  199. package/lib/components/Timeline/Timeline.js +24 -0
  200. package/lib/components/Timeline/Timeline.js.map +1 -0
  201. package/lib/components/Timeline/Timeline.styles.d.ts +22 -0
  202. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -0
  203. package/lib/components/Timeline/Timeline.styles.js +183 -0
  204. package/lib/components/Timeline/Timeline.styles.js.map +1 -0
  205. package/lib/components/Timeline/Timeline.types.d.ts +45 -0
  206. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -0
  207. package/lib/components/Timeline/Timeline.types.js +2 -0
  208. package/lib/components/Timeline/Timeline.types.js.map +1 -0
  209. package/lib/components/Timeline/TimelineItem.d.ts +13 -0
  210. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
  211. package/lib/components/Timeline/TimelineItem.js +21 -0
  212. package/lib/components/Timeline/TimelineItem.js.map +1 -0
  213. package/lib/components/Timeline/index.d.ts +3 -0
  214. package/lib/components/Timeline/index.d.ts.map +1 -0
  215. package/lib/components/Timeline/index.js +2 -0
  216. package/lib/components/Timeline/index.js.map +1 -0
  217. package/lib/components/Timeline/utils.d.ts +14 -0
  218. package/lib/components/Timeline/utils.d.ts.map +1 -0
  219. package/lib/components/Timeline/utils.js +63 -0
  220. package/lib/components/Timeline/utils.js.map +1 -0
  221. package/lib/index.d.ts +33 -0
  222. package/lib/index.d.ts.map +1 -0
  223. package/lib/index.js +34 -0
  224. package/lib/index.js.map +1 -0
  225. package/package.json +2 -2
@@ -0,0 +1,280 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { calculateFontSize, defaultThemeProp, StyledIcon, StyledText, useDirection } from '@pega/cosmos-react-core';
3
+ export const StyledStages = styled.div(props => {
4
+ return css `
5
+ background-color: ${props.theme.base.palette['primary-background']};
6
+ border-radius: ${props.theme.base['border-radius']};
7
+ width: 100%;
8
+ `;
9
+ });
10
+ StyledStages.defaultProps = defaultThemeProp;
11
+ export const StyledInnerStage = styled.span(props => {
12
+ return css `
13
+ display: inline-block;
14
+ text-align: center;
15
+ white-space: nowrap;
16
+ ${props.ellipsis &&
17
+ css `
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
20
+ `}
21
+ `;
22
+ });
23
+ export const StyledStage = styled.button(({ theme: { base: { spacing, palette, 'hit-area': hitArea, shadow, transparency, 'border-radius': borderRadius } } }) => {
24
+ const activeColor = palette.interactive;
25
+ const baseBorderColor = palette['border-line'];
26
+ const thinBorderWidth = '0.0625rem';
27
+ const thickBorderWidth = '0.125rem';
28
+ const baseTransparency = transparency['transparent-2'];
29
+ const { rtl, start, end } = useDirection();
30
+ return css `
31
+ /* stylelint-disable no-descending-specificity */
32
+ background-color: inherit;
33
+ color: ${palette['foreground-color']};
34
+ outline: none;
35
+ border-color: transparent;
36
+ border-width: ${thinBorderWidth} 0;
37
+ border-style: solid;
38
+ position: relative;
39
+ height: calc(4 * ${spacing});
40
+ min-width: calc(5.25 * ${spacing});
41
+ padding-inline-start: calc(2 * ${spacing});
42
+ padding-inline-end: ${spacing};
43
+
44
+ @media (pointer: coarse) {
45
+ height: ${hitArea['finger-min']};
46
+ padding-inline-start: calc(2.25 * ${spacing});
47
+ }
48
+
49
+ ${StyledIcon} {
50
+ margin-inline-end: 0.25rem;
51
+ color: ${palette.success};
52
+
53
+ &:last-child {
54
+ margin-inline-end: 0;
55
+ }
56
+ }
57
+
58
+ ${StyledInnerStage} {
59
+ opacity: ${baseTransparency};
60
+ }
61
+
62
+ &:first-child {
63
+ border-top-${start}-radius: ${borderRadius};
64
+ border-bottom-${start}-radius: ${borderRadius};
65
+ border-inline-start-width: ${thinBorderWidth};
66
+ padding-inline-start: calc(${spacing});
67
+ }
68
+
69
+ &:last-child {
70
+ border-top-${end}-radius: ${borderRadius};
71
+ border-bottom-${end}-radius: ${borderRadius};
72
+ border-inline-end-width: ${thinBorderWidth};
73
+ padding-inline-end: calc(${spacing});
74
+ min-width: calc(6.25 * ${spacing});
75
+ }
76
+
77
+ &:not(:first-child)::before {
78
+ content: '';
79
+ position: absolute;
80
+ display: block;
81
+ width: calc(2.25 * ${spacing});
82
+ height: calc(2.25 * ${spacing});
83
+ left: calc(-1.125 * ${spacing});
84
+ right: calc(-1.125 * ${spacing});
85
+ background-color: transparent;
86
+ border-style: solid;
87
+ border-color: ${baseBorderColor};
88
+ border-inline-end-width: ${thinBorderWidth};
89
+ border-inline-start-width: 0;
90
+ border-top-width: ${rtl ? 0 : thinBorderWidth};
91
+ border-bottom-width: ${rtl ? thinBorderWidth : 0};
92
+ transform: rotateZ(45deg) skew(15deg, 15deg);
93
+
94
+ @media (pointer: coarse) {
95
+ width: calc(2.875 * ${spacing});
96
+ height: calc(2.875 * ${spacing});
97
+ left: calc(-1.375 * ${spacing});
98
+ right: calc(-1.375 * ${spacing});
99
+ transform: rotateZ(45deg) skew(20deg, 20deg);
100
+ }
101
+ }
102
+
103
+ &:hover,
104
+ &:hover::before {
105
+ border-color: ${baseBorderColor};
106
+ }
107
+
108
+ &:hover {
109
+ ${StyledInnerStage} {
110
+ opacity: 1;
111
+ }
112
+ }
113
+
114
+ &:focus,
115
+ &:active,
116
+ &:focus::before,
117
+ &:active::before,
118
+ &:focus + &::before,
119
+ &:active + &::before {
120
+ border-color: ${activeColor};
121
+ }
122
+
123
+ &:focus {
124
+ border-width: ${thickBorderWidth} 0;
125
+ }
126
+
127
+ &:focus::before,
128
+ &:focus + &::before {
129
+ border-inline-end-width: ${thickBorderWidth};
130
+ border-top-width: ${rtl ? 0 : thickBorderWidth};
131
+ border-bottom-width: ${rtl ? thickBorderWidth : 0};
132
+ }
133
+
134
+ &:first-child:focus {
135
+ border-inline-start-width: ${thickBorderWidth};
136
+ padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});
137
+ }
138
+
139
+ &:last-child:focus {
140
+ border-inline-end-width: ${thickBorderWidth};
141
+ padding-inline-end: calc(${spacing} - ${thinBorderWidth});
142
+ }
143
+
144
+ &:active {
145
+ border-width: ${thinBorderWidth} 0;
146
+
147
+ ${StyledInnerStage} {
148
+ opacity: ${transparency['transparent-3']};
149
+ }
150
+ }
151
+
152
+ &:active::before,
153
+ &:active + &::before {
154
+ border-inline-end-width: ${thinBorderWidth};
155
+ border-top-width: ${rtl ? 0 : thinBorderWidth};
156
+ border-bottom-width: ${rtl ? thinBorderWidth : 0};
157
+ }
158
+
159
+ &:first-child:active {
160
+ border-inline-start-width: ${thinBorderWidth};
161
+ padding-inline-start: calc(${spacing});
162
+ }
163
+
164
+ &:last-child:active {
165
+ border-inline-end-width: ${thinBorderWidth};
166
+ padding-inline-end: calc(${spacing});
167
+ }
168
+
169
+ &[aria-current] {
170
+ z-index: 2;
171
+
172
+ ${StyledInnerStage} {
173
+ font-weight: bold;
174
+ opacity: 1;
175
+ }
176
+
177
+ &:hover {
178
+ ${StyledInnerStage} {
179
+ opacity: ${baseTransparency};
180
+ }
181
+ }
182
+ &:active {
183
+ ${StyledInnerStage} {
184
+ opacity: ${transparency['transparent-3']};
185
+ }
186
+ }
187
+ }
188
+
189
+ &[aria-current] + &::before {
190
+ box-shadow: ${shadow.low};
191
+ }
192
+
193
+ &[aria-current] + &:focus::before {
194
+ box-shadow: none;
195
+ }
196
+ `;
197
+ });
198
+ StyledStage.defaultProps = defaultThemeProp;
199
+ export const StyledStagePopover = styled.div(({ theme }) => {
200
+ return css `
201
+ padding: calc(2 * ${theme.base.spacing});
202
+ white-space: pre-line;
203
+ width: 18rem;
204
+ `;
205
+ });
206
+ StyledStagePopover.defaultProps = defaultThemeProp;
207
+ export const StyledStepsContainer = styled.ol(({ theme }) => {
208
+ return css `
209
+ list-style-type: none;
210
+ margin-top: calc(1.5 * ${theme.base.spacing});
211
+ margin-bottom: calc(2.5 * ${theme.base.spacing});
212
+
213
+ &:empty {
214
+ margin-bottom: 0;
215
+ }
216
+ `;
217
+ });
218
+ StyledStepsContainer.defaultProps = defaultThemeProp;
219
+ export const StyledStep = styled.li(({ complete, theme }) => {
220
+ const iconColor = complete ? theme.base.palette.success : theme.base.palette['foreground-color'];
221
+ const iconWidth = complete ? '1.125rem' : '0.3rem';
222
+ const iconMargin = complete ? 0 : '0.3rem';
223
+ const textOpacity = complete ? theme.base.transparency['transparent-3'] : 1;
224
+ return css `
225
+ border-radius: 0;
226
+ margin-bottom: calc(${theme.base.spacing});
227
+ color: ${theme.base.palette['foreground-color']};
228
+
229
+ &:last-child {
230
+ margin-bottom: 0;
231
+ }
232
+
233
+ ${StyledIcon} {
234
+ margin-inline-end: calc(${theme.base.spacing});
235
+ color: ${iconColor};
236
+ width: ${iconWidth};
237
+ margin-inline-start: ${iconMargin};
238
+ }
239
+
240
+ ${StyledText} {
241
+ opacity: ${textOpacity};
242
+ }
243
+ `;
244
+ });
245
+ StyledStep.defaultProps = defaultThemeProp;
246
+ export const StyledSteps = styled.div `
247
+ background-color: ${props => props.theme.components.card.background};
248
+ position: relative;
249
+ `;
250
+ StyledSteps.defaultProps = defaultThemeProp;
251
+ export const StyledInnerStep = styled.span(({ complete, theme }) => {
252
+ const textOpacity = complete ? theme.base.transparency['transparent-2'] : 1;
253
+ return css `
254
+ display: flex;
255
+ width: 100%;
256
+ text-align: start;
257
+ overflow: hidden;
258
+ white-space: nowrap;
259
+ text-overflow: ellipsis;
260
+
261
+ ${StyledIcon} {
262
+ color: ${theme.base.palette.success};
263
+ margin-inline-end: ${theme.base.spacing};
264
+ }
265
+
266
+ ${StyledText} {
267
+ opacity: ${textOpacity};
268
+ }
269
+ `;
270
+ });
271
+ StyledInnerStep.defaultProps = defaultThemeProp;
272
+ export const StyledDateTimeDisplay = styled.span(({ theme }) => {
273
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
274
+ return css `
275
+ font-size: ${fontSize.xs};
276
+ opacity: ${theme.base.transparency['transparent-2']};
277
+ `;
278
+ });
279
+ StyledDateTimeDisplay.defaultProps = defaultThemeProp;
280
+ //# sourceMappingURL=Stages.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stages.styles.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;IAC7C,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBACjD,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;GAEnD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAyB,KAAK,CAAC,EAAE;IAC1E,OAAO,GAAG,CAAA;;;;MAIN,KAAK,CAAC,QAAQ;QAChB,GAAG,CAAA;;;KAGF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CACtC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EACP,OAAO,EACP,UAAU,EAAE,OAAO,EACnB,MAAM,EACN,YAAY,EACZ,eAAe,EAAE,YAAY,EAC9B,EACF,EACF,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/C,MAAM,eAAe,GAAG,WAAW,CAAC;IAC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OAAO;;;MAGvC,UAAU;iBACC,WAAW;;GAEzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACtF,OAAO,GAAG,CAAA;iBACK,QAAQ,CAAC,EAAE;eACb,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledIcon,\n StyledText,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledStages = styled.div(props => {\n return css`\n background-color: ${props.theme.base.palette['primary-background']};\n border-radius: ${props.theme.base['border-radius']};\n width: 100%;\n `;\n});\n\nStyledStages.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStage = styled.span<{ ellipsis?: boolean }>(props => {\n return css`\n display: inline-block;\n text-align: center;\n white-space: nowrap;\n ${props.ellipsis &&\n css`\n overflow: hidden;\n text-overflow: ellipsis;\n `}\n `;\n});\n\nexport const StyledStage = styled.button(\n ({\n theme: {\n base: {\n spacing,\n palette,\n 'hit-area': hitArea,\n shadow,\n transparency,\n 'border-radius': borderRadius\n }\n }\n }) => {\n const activeColor = palette.interactive;\n const baseBorderColor = palette['border-line'];\n const thinBorderWidth = '0.0625rem';\n const thickBorderWidth = '0.125rem';\n const baseTransparency = transparency['transparent-2'];\n const { rtl, start, end } = useDirection();\n\n return css`\n /* stylelint-disable no-descending-specificity */\n background-color: inherit;\n color: ${palette['foreground-color']};\n outline: none;\n border-color: transparent;\n border-width: ${thinBorderWidth} 0;\n border-style: solid;\n position: relative;\n height: calc(4 * ${spacing});\n min-width: calc(5.25 * ${spacing});\n padding-inline-start: calc(2 * ${spacing});\n padding-inline-end: ${spacing};\n\n @media (pointer: coarse) {\n height: ${hitArea['finger-min']};\n padding-inline-start: calc(2.25 * ${spacing});\n }\n\n ${StyledIcon} {\n margin-inline-end: 0.25rem;\n color: ${palette.success};\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n\n &:first-child {\n border-top-${start}-radius: ${borderRadius};\n border-bottom-${start}-radius: ${borderRadius};\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child {\n border-top-${end}-radius: ${borderRadius};\n border-bottom-${end}-radius: ${borderRadius};\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n min-width: calc(6.25 * ${spacing});\n }\n\n &:not(:first-child)::before {\n content: '';\n position: absolute;\n display: block;\n width: calc(2.25 * ${spacing});\n height: calc(2.25 * ${spacing});\n left: calc(-1.125 * ${spacing});\n right: calc(-1.125 * ${spacing});\n background-color: transparent;\n border-style: solid;\n border-color: ${baseBorderColor};\n border-inline-end-width: ${thinBorderWidth};\n border-inline-start-width: 0;\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n\n @media (pointer: coarse) {\n width: calc(2.875 * ${spacing});\n height: calc(2.875 * ${spacing});\n left: calc(-1.375 * ${spacing});\n right: calc(-1.375 * ${spacing});\n transform: rotateZ(45deg) skew(20deg, 20deg);\n }\n }\n\n &:hover,\n &:hover::before {\n border-color: ${baseBorderColor};\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: 1;\n }\n }\n\n &:focus,\n &:active,\n &:focus::before,\n &:active::before,\n &:focus + &::before,\n &:active + &::before {\n border-color: ${activeColor};\n }\n\n &:focus {\n border-width: ${thickBorderWidth} 0;\n }\n\n &:focus::before,\n &:focus + &::before {\n border-inline-end-width: ${thickBorderWidth};\n border-top-width: ${rtl ? 0 : thickBorderWidth};\n border-bottom-width: ${rtl ? thickBorderWidth : 0};\n }\n\n &:first-child:focus {\n border-inline-start-width: ${thickBorderWidth};\n padding-inline-start: calc(${spacing} - ${thickBorderWidth} + ${thinBorderWidth});\n }\n\n &:last-child:focus {\n border-inline-end-width: ${thickBorderWidth};\n padding-inline-end: calc(${spacing} - ${thinBorderWidth});\n }\n\n &:active {\n border-width: ${thinBorderWidth} 0;\n\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n\n &:active::before,\n &:active + &::before {\n border-inline-end-width: ${thinBorderWidth};\n border-top-width: ${rtl ? 0 : thinBorderWidth};\n border-bottom-width: ${rtl ? thinBorderWidth : 0};\n }\n\n &:first-child:active {\n border-inline-start-width: ${thinBorderWidth};\n padding-inline-start: calc(${spacing});\n }\n\n &:last-child:active {\n border-inline-end-width: ${thinBorderWidth};\n padding-inline-end: calc(${spacing});\n }\n\n &[aria-current] {\n z-index: 2;\n\n ${StyledInnerStage} {\n font-weight: bold;\n opacity: 1;\n }\n\n &:hover {\n ${StyledInnerStage} {\n opacity: ${baseTransparency};\n }\n }\n &:active {\n ${StyledInnerStage} {\n opacity: ${transparency['transparent-3']};\n }\n }\n }\n\n &[aria-current] + &::before {\n box-shadow: ${shadow.low};\n }\n\n &[aria-current] + &:focus::before {\n box-shadow: none;\n }\n `;\n }\n);\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledStagePopover = styled.div(({ theme }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n white-space: pre-line;\n width: 18rem;\n `;\n});\n\nStyledStagePopover.defaultProps = defaultThemeProp;\n\nexport const StyledStepsContainer = styled.ol(({ theme }) => {\n return css`\n list-style-type: none;\n margin-top: calc(1.5 * ${theme.base.spacing});\n margin-bottom: calc(2.5 * ${theme.base.spacing});\n\n &:empty {\n margin-bottom: 0;\n }\n `;\n});\n\nStyledStepsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledStep = styled.li<{ complete: boolean }>(({ complete, theme }) => {\n const iconColor = complete ? theme.base.palette.success : theme.base.palette['foreground-color'];\n const iconWidth = complete ? '1.125rem' : '0.3rem';\n const iconMargin = complete ? 0 : '0.3rem';\n const textOpacity = complete ? theme.base.transparency['transparent-3'] : 1;\n\n return css`\n border-radius: 0;\n margin-bottom: calc(${theme.base.spacing});\n color: ${theme.base.palette['foreground-color']};\n\n &:last-child {\n margin-bottom: 0;\n }\n\n ${StyledIcon} {\n margin-inline-end: calc(${theme.base.spacing});\n color: ${iconColor};\n width: ${iconWidth};\n margin-inline-start: ${iconMargin};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nexport const StyledSteps = styled.div`\n background-color: ${props => props.theme.components.card.background};\n position: relative;\n`;\n\nStyledSteps.defaultProps = defaultThemeProp;\n\nexport const StyledInnerStep = styled.span<{ complete: boolean }>(({ complete, theme }) => {\n const textOpacity = complete ? theme.base.transparency['transparent-2'] : 1;\n return css`\n display: flex;\n width: 100%;\n text-align: start;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n ${StyledIcon} {\n color: ${theme.base.palette.success};\n margin-inline-end: ${theme.base.spacing};\n }\n\n ${StyledText} {\n opacity: ${textOpacity};\n }\n `;\n});\n\nStyledInnerStep.defaultProps = defaultThemeProp;\n\nexport const StyledDateTimeDisplay = styled.span(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n font-size: ${fontSize.xs};\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledDateTimeDisplay.defaultProps = defaultThemeProp;\n"]}
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ import { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ export interface StepProps {
4
+ name: ReactNode;
5
+ complete: boolean;
6
+ id: string;
7
+ }
8
+ export interface StageProps {
9
+ name: string;
10
+ id: string;
11
+ date?: Date | string | number;
12
+ required: boolean;
13
+ complete: boolean;
14
+ steps?: StepProps[];
15
+ }
16
+ export interface StagesProps extends BaseProps, NoChildrenProp {
17
+ /** List of objects describing each stage and their state. */
18
+ stages: StageProps[];
19
+ /** Current stage id. */
20
+ current: string;
21
+ caseTitle?: string;
22
+ }
23
+ //# sourceMappingURL=Stages.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stages.types.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D,6DAA6D;IAC7D,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Stages.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stages.types.js","sourceRoot":"","sources":["../../../src/components/Stages/Stages.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode } from 'react';\n\nimport { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface StepProps {\n name: ReactNode;\n complete: boolean;\n id: string;\n}\n\nexport interface StageProps {\n name: string;\n id: string;\n date?: Date | string | number;\n required: boolean;\n complete: boolean;\n steps?: StepProps[];\n}\n\nexport interface StagesProps extends BaseProps, NoChildrenProp {\n /** List of objects describing each stage and their state. */\n stages: StageProps[];\n /** Current stage id. */\n current: string;\n caseTitle?: string;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { StepProps } from './Stages.types';
3
+ interface StepsProps {
4
+ steps?: StepProps[];
5
+ }
6
+ declare const Steps: FunctionComponent<StepsProps>;
7
+ export default Steps;
8
+ //# sourceMappingURL=Steps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAcxC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon, registerIcon, Text, Grid } from '@pega/cosmos-react-core';
3
+ import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
4
+ import * as circleSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/circle-solid.icon';
5
+ import { StyledStep, StyledStepsContainer } from './Stages.styles';
6
+ registerIcon(checkIcon, circleSolidIcon);
7
+ const Steps = ({ steps }) => {
8
+ return (_jsx(StyledStepsContainer, { children: steps &&
9
+ steps.map(({ id, name, complete }) => (_jsx(StyledStep, { complete: complete, children: _jsxs(Grid, { container: { cols: '1.625rem 1fr' }, children: [_jsx(Icon, { name: complete ? 'check' : 'circle-solid' }, void 0), _jsx(Text, { children: name }, void 0)] }, void 0) }, id))) }, void 0));
10
+ };
11
+ export default Steps;
12
+ //# sourceMappingURL=Steps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../../src/components/Stages/Steps.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAC1F,OAAO,KAAK,eAAe,MAAM,qEAAqE,CAAC;AAGvG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,YAAY,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;AAMzC,MAAM,KAAK,GAAkC,CAAC,EAAE,KAAK,EAA+B,EAAE,EAAE;IACtF,OAAO,CACL,KAAC,oBAAoB,cAClB,KAAK;YACJ,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACpC,KAAC,UAAU,IAAU,QAAQ,EAAE,QAAQ,YACrC,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,aACvC,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,WAAI,EACnD,KAAC,IAAI,cAAE,IAAI,WAAQ,YACd,IAJQ,EAAE,CAKN,CACd,CAAC,WACiB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { PropsWithoutRef, FunctionComponent } from 'react';\n\nimport { Icon, registerIcon, Text, Grid } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\nimport * as circleSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/circle-solid.icon';\n\nimport { StepProps } from './Stages.types';\nimport { StyledStep, StyledStepsContainer } from './Stages.styles';\n\nregisterIcon(checkIcon, circleSolidIcon);\n\ninterface StepsProps {\n steps?: StepProps[];\n}\n\nconst Steps: FunctionComponent<StepsProps> = ({ steps }: PropsWithoutRef<StepsProps>) => {\n return (\n <StyledStepsContainer>\n {steps &&\n steps.map(({ id, name, complete }) => (\n <StyledStep key={id} complete={complete}>\n <Grid container={{ cols: '1.625rem 1fr' }}>\n <Icon name={complete ? 'check' : 'circle-solid'} />\n <Text>{name}</Text>\n </Grid>\n </StyledStep>\n ))}\n </StyledStepsContainer>\n );\n};\n\nexport default Steps;\n"]}
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { StagesProps } from './Stages.types';
3
+ export interface StepsContainerProps {
4
+ currentStage: StagesProps['stages'];
5
+ }
6
+ declare const StepsContainer: FunctionComponent<StepsContainerProps>;
7
+ export default StepsContainer;
8
+ //# sourceMappingURL=StepsContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepsContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAM3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CACrC;AAED,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,CAqB1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flex, Icon, registerIcon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';
3
+ import * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';
4
+ import Steps from './Steps';
5
+ import { StyledDateTimeDisplay, StyledInnerStep, StyledSteps } from './Stages.styles';
6
+ registerIcon(checkIcon);
7
+ const StepsContainer = ({ currentStage }) => {
8
+ return (_jsxs(Flex, { as: StyledSteps, container: { direction: 'column' }, item: { grow: 1 }, children: [_jsxs(StyledInnerStep, { complete: currentStage[0]?.complete, children: [currentStage[0]?.complete && _jsx(Icon, { name: 'check' }, void 0), _jsx(Text, { variant: 'h2', children: currentStage[0]?.name }, void 0)] }, void 0), currentStage[0]?.date && (_jsx(DateTimeDisplay, { as: StyledDateTimeDisplay, value: currentStage[0]?.date, variant: 'relative', format: 'short' }, void 0)), _jsx(Steps, { steps: currentStage[0].steps }, void 0)] }, void 0));
9
+ };
10
+ export default StepsContainer;
11
+ //# sourceMappingURL=StepsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepsContainer.js","sourceRoot":"","sources":["../../../src/components/Stages/StepsContainer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEtF,YAAY,CAAC,SAAS,CAAC,CAAC;AAMxB,MAAM,cAAc,GAA2C,CAAC,EAC9D,YAAY,EACyB,EAAE,EAAE;IACzC,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,aAC1E,MAAC,eAAe,IAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,aACjD,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,EACnD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,YAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,WAAQ,YACjC,EACjB,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CACxB,KAAC,eAAe,IACd,EAAE,EAAE,qBAAqB,EACzB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,EAC5B,OAAO,EAAC,UAAU,EAClB,MAAM,EAAC,OAAO,WACd,CACH,EAED,KAAC,KAAK,IAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,WAAI,YAClC,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { Flex, Icon, registerIcon, DateTimeDisplay, Text } from '@pega/cosmos-react-core';\nimport * as checkIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/check.icon';\n\nimport Steps from './Steps';\nimport { StagesProps } from './Stages.types';\nimport { StyledDateTimeDisplay, StyledInnerStep, StyledSteps } from './Stages.styles';\n\nregisterIcon(checkIcon);\n\nexport interface StepsContainerProps {\n currentStage: StagesProps['stages'];\n}\n\nconst StepsContainer: FunctionComponent<StepsContainerProps> = ({\n currentStage\n}: PropsWithoutRef<StepsContainerProps>) => {\n return (\n <Flex as={StyledSteps} container={{ direction: 'column' }} item={{ grow: 1 }}>\n <StyledInnerStep complete={currentStage[0]?.complete}>\n {currentStage[0]?.complete && <Icon name='check' />}\n <Text variant='h2'>{currentStage[0]?.name}</Text>\n </StyledInnerStep>\n {currentStage[0]?.date && (\n <DateTimeDisplay\n as={StyledDateTimeDisplay}\n value={currentStage[0]?.date}\n variant='relative'\n format='short'\n />\n )}\n\n <Steps steps={currentStage[0].steps} />\n </Flex>\n );\n};\n\nexport default StepsContainer;\n"]}
@@ -0,0 +1,3 @@
1
+ export { StagesProps } from './Stages.types';
2
+ export { default } from './Stages';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Stages';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Stages/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { StagesProps } from './Stages.types';\nexport { default } from './Stages';\n"]}
@@ -0,0 +1,7 @@
1
+ import type { StakeholdersProps } from './Stakeholders.types';
2
+ interface FormProps extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer' | 'rendererProps'> {
3
+ setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;
4
+ }
5
+ declare const _default: ({ roles, currentRole, renderer: Renderer, rendererProps, setSelectedRoleNameRef }: FormProps) => JSX.Element;
6
+ export default _default;
7
+ //# sourceMappingURL=StakeholderForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StakeholderForm.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/StakeholderForm.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,UAAU,SACR,SAAQ,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,eAAe,CAAC;IAC/F,sBAAsB,EAAE,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACzE;4GAQE,SAAS;AANZ,wBA0FE"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import { ComboBox, RadioButtonGroup, RadioButton, Flex, useI18n, Input, getFocusables } from '@pega/cosmos-react-core';
4
+ export default ({ roles, currentRole, renderer: Renderer, rendererProps, setSelectedRoleNameRef }) => {
5
+ const contentRef = useRef(null);
6
+ const t = useI18n();
7
+ const [selectedRoleName, setSelectedRoleName] = useState(() => {
8
+ if (roles) {
9
+ return (currentRole ? roles.find(role => role.name === currentRole.name) : roles[0])?.name;
10
+ }
11
+ });
12
+ let control = null;
13
+ if (roles) {
14
+ const label = t('stakeholders_role');
15
+ if (roles.length > 3) {
16
+ const items = roles.map(role => {
17
+ return {
18
+ id: role.name,
19
+ primary: role.name,
20
+ selected: role.name === selectedRoleName
21
+ };
22
+ });
23
+ const selected = items.find(item => item.selected);
24
+ control = (_jsx(ComboBox, { label: label, selected: selected ? { items: { id: selected.id, text: selected.primary } } : undefined, menu: {
25
+ mode: 'single-select',
26
+ items,
27
+ onItemClick: setSelectedRoleName
28
+ } }, void 0));
29
+ }
30
+ else {
31
+ control = (_jsx(RadioButtonGroup, { label: label, name: 'role', inline: true, onChange: e => {
32
+ setSelectedRoleName(e.target.value);
33
+ }, children: roles.map(role => (_jsx(RadioButton, { label: role.name, value: role.name, checked: role.name === selectedRoleName }, role.name))) }, void 0));
34
+ }
35
+ }
36
+ else if (currentRole) {
37
+ control = (_jsx(Input, { readOnly: true, label: t('stakeholders_role'), value: currentRole.name, info: currentRole.description }, void 0));
38
+ }
39
+ useEffect(() => {
40
+ getFocusables(contentRef)[0]?.focus();
41
+ }, []);
42
+ useEffect(() => {
43
+ if (!roles)
44
+ return;
45
+ setSelectedRoleNameRef(selectedRoleName);
46
+ }, [selectedRoleName]);
47
+ return (_jsxs(Flex, { container: { direction: 'column', gap: 2 }, ref: contentRef, children: [control, _jsx(Renderer, { ...rendererProps, selectedRoleName: selectedRoleName }, void 0)] }, void 0));
48
+ };
49
+ //# sourceMappingURL=StakeholderForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StakeholderForm.js","sourceRoot":"","sources":["../../../src/components/Stakeholders/StakeholderForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,IAAI,EACJ,OAAO,EACP,KAAK,EACL,aAAa,EACd,MAAM,yBAAyB,CAAC;AASjC,eAAe,CAAC,EACd,KAAK,EACL,WAAW,EACX,QAAQ,EAAE,QAAQ,EAClB,aAAa,EACb,sBAAsB,EACZ,EAAE,EAAE;IACd,MAAM,UAAU,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAA2B,GAAG,EAAE;QACtF,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;SAC5F;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,OAAO,GAAuB,IAAI,CAAC;IAEvC,IAAI,KAAK,EAAE;QACT,MAAM,KAAK,GAAG,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAErC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,E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K,EAAE,WAAW,CAAC,IAAI,EACvB,IAAI,EAAE,WAAW,CAAC,WAAW,WAC7B,CACH,CAAC;KACH;IAED,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,CACL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,aAC9D,OAAO,EACR,KAAC,QAAQ,OAAK,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,WAAI,YAC9D,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport {\n ComboBox,\n RadioButtonGroup,\n RadioButton,\n Flex,\n useI18n,\n Input,\n getFocusables\n} from '@pega/cosmos-react-core';\n\nimport type { Role, StakeholdersProps } from './Stakeholders.types';\n\ninterface FormProps\n extends Pick<StakeholdersProps['form'], 'roles' | 'currentRole' | 'renderer' | 'rendererProps'> {\n setSelectedRoleNameRef: (selectedRoleName?: string | undefined) => void;\n}\n\nexport default ({\n roles,\n currentRole,\n renderer: Renderer,\n rendererProps,\n setSelectedRoleNameRef\n}: FormProps) => {\n const contentRef = useRef<HTMLElement>(null);\n const t = useI18n();\n\n const [selectedRoleName, setSelectedRoleName] = useState<Role['name'] | undefined>(() => {\n if (roles) {\n return (currentRole ? roles.find(role => role.name === currentRole.name) : roles[0])?.name;\n }\n });\n\n let control: JSX.Element | null = null;\n\n if (roles) {\n const label = t('stakeholders_role');\n\n if (roles.length > 3) {\n const items = roles.map(role => {\n return {\n id: role.name,\n primary: role.name,\n selected: role.name === selectedRoleName\n };\n });\n\n const selected = items.find(item => item.selected);\n\n control = (\n <ComboBox\n label={label}\n selected={selected ? { items: { id: selected.id, text: selected.primary } } : undefined}\n menu={{\n mode: 'single-select',\n items,\n onItemClick: setSelectedRoleName\n }}\n />\n );\n } else {\n control = (\n <RadioButtonGroup\n label={label}\n name='role'\n inline\n onChange={e => {\n setSelectedRoleName(e.target.value);\n }}\n >\n {roles.map(role => (\n <RadioButton\n key={role.name}\n label={role.name}\n value={role.name}\n checked={role.name === selectedRoleName}\n />\n ))}\n </RadioButtonGroup>\n );\n }\n } else if (currentRole) {\n control = (\n <Input\n readOnly\n label={t('stakeholders_role')}\n value={currentRole.name}\n info={currentRole.description}\n />\n );\n }\n\n useEffect(() => {\n getFocusables(contentRef)[0]?.focus();\n }, []);\n\n useEffect(() => {\n if (!roles) return;\n setSelectedRoleNameRef(selectedRoleName);\n }, [selectedRoleName]);\n\n return (\n <Flex container={{ direction: 'column', gap: 2 }} ref={contentRef}>\n {control}\n <Renderer {...rendererProps} selectedRoleName={selectedRoleName} />\n </Flex>\n );\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from 'react';
2
+ import type { ForwardProps } from '@pega/cosmos-react-core';
3
+ import type { StakeholdersProps } from './Stakeholders.types';
4
+ declare const Stakeholders: FunctionComponent<StakeholdersProps & ForwardProps>;
5
+ export default Stakeholders;
6
+ //# sourceMappingURL=Stakeholders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stakeholders.d.ts","sourceRoot":"","sources":["../../../src/components/Stakeholders/Stakeholders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAmBf,OAAO,KAAK,EAAU,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAQ,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmBpE,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CA8TrE,CAAC;AAEF,eAAe,YAAY,CAAC"}