@pega/cosmos-react-work 2.0.0-dev.2.1 → 2.0.0-dev.20.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 (180) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  2. package/lib/components/AppAnnouncement/AppAnnouncement.js +13 -17
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  4. package/lib/components/CaseHeader/CaseHeader.d.ts +5 -1
  5. package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
  6. package/lib/components/CaseHeader/CaseHeader.js +39 -15
  7. package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
  8. package/lib/components/CasePreview/CasePreview.d.ts +5 -5
  9. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  10. package/lib/components/CasePreview/CasePreview.js +17 -16
  11. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  12. package/lib/components/CaseSummary/CaseSummary.d.ts +20 -8
  13. package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
  14. package/lib/components/CaseSummary/CaseSummary.js +121 -14
  15. package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
  16. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  17. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +14 -12
  18. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  19. package/lib/components/CaseView/CaseView.d.ts +6 -19
  20. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  21. package/lib/components/CaseView/CaseView.js +173 -189
  22. package/lib/components/CaseView/CaseView.js.map +1 -1
  23. package/lib/components/CaseView/CaseView.styles.d.ts +24 -0
  24. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  25. package/lib/components/CaseView/CaseView.styles.js +111 -0
  26. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  27. package/lib/components/CaseView/MobileCaseView.d.ts +1 -0
  28. package/lib/components/CaseView/MobileCaseView.d.ts.map +1 -1
  29. package/lib/components/CaseView/MobileCaseView.js +3 -6
  30. package/lib/components/CaseView/MobileCaseView.js.map +1 -1
  31. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  32. package/lib/components/CaseView/UtilitiesSummary.js +8 -10
  33. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  34. package/lib/components/CaseView/index.d.ts +2 -1
  35. package/lib/components/CaseView/index.d.ts.map +1 -1
  36. package/lib/components/CaseView/index.js +1 -1
  37. package/lib/components/CaseView/index.js.map +1 -1
  38. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  39. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  40. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +93 -0
  41. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  42. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +43 -0
  43. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  44. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  45. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  46. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  47. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  48. package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
  49. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  50. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  51. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  52. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  53. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  54. package/lib/components/ConfigurableLayout/index.d.ts +3 -0
  55. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  56. package/lib/components/ConfigurableLayout/index.js +3 -0
  57. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  58. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  59. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  60. package/lib/components/ConfigurableLayout/options.js +10 -0
  61. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  62. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
  63. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
  64. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
  65. package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
  66. package/lib/components/Confirmation/Confirmation.d.ts +19 -0
  67. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
  68. package/lib/components/Confirmation/Confirmation.js +14 -0
  69. package/lib/components/Confirmation/Confirmation.js.map +1 -0
  70. package/lib/components/Confirmation/index.d.ts +3 -0
  71. package/lib/components/Confirmation/index.d.ts.map +1 -0
  72. package/lib/components/Confirmation/index.js +2 -0
  73. package/lib/components/Confirmation/index.js.map +1 -0
  74. package/lib/components/Details/Details.d.ts +13 -0
  75. package/lib/components/Details/Details.d.ts.map +1 -0
  76. package/lib/components/Details/Details.js +38 -0
  77. package/lib/components/Details/Details.js.map +1 -0
  78. package/lib/components/Details/index.d.ts +4 -0
  79. package/lib/components/Details/index.d.ts.map +1 -0
  80. package/lib/components/Details/index.js +3 -0
  81. package/lib/components/Details/index.js.map +1 -0
  82. package/lib/components/Glimpse/Glimpse.d.ts +2 -2
  83. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  84. package/lib/components/Glimpse/Glimpse.js +3 -6
  85. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  86. package/lib/components/SearchResults/Filter.d.ts.map +1 -1
  87. package/lib/components/SearchResults/Filter.js +15 -48
  88. package/lib/components/SearchResults/Filter.js.map +1 -1
  89. package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
  90. package/lib/components/SearchResults/SearchResult.js +2 -8
  91. package/lib/components/SearchResults/SearchResult.js.map +1 -1
  92. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  93. package/lib/components/SearchResults/SearchResults.js +44 -101
  94. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  95. package/lib/components/SearchResults/SearchResults.styles.d.ts +8 -0
  96. package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
  97. package/lib/components/SearchResults/SearchResults.styles.js +67 -0
  98. package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
  99. package/lib/components/SearchResults/SearchResults.types.d.ts +14 -4
  100. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  101. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  102. package/lib/components/Stages/Stages.d.ts.map +1 -1
  103. package/lib/components/Stages/Stages.js +31 -36
  104. package/lib/components/Stages/Stages.js.map +1 -1
  105. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  106. package/lib/components/Stages/Stages.styles.js +22 -28
  107. package/lib/components/Stages/Stages.styles.js.map +1 -1
  108. package/lib/components/Stages/Steps.d.ts.map +1 -1
  109. package/lib/components/Stages/Steps.js +7 -7
  110. package/lib/components/Stages/Steps.js.map +1 -1
  111. package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
  112. package/lib/components/Stages/StepsContainer.js +5 -9
  113. package/lib/components/Stages/StepsContainer.js.map +1 -1
  114. package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
  115. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  116. package/lib/components/Stakeholders/StakeholderForm.js +47 -0
  117. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  118. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  119. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  120. package/lib/components/Stakeholders/Stakeholders.js +215 -0
  121. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  122. package/lib/components/Stakeholders/Stakeholders.types.d.ts +78 -0
  123. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  124. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  125. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  126. package/lib/components/Stakeholders/index.d.ts +3 -0
  127. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  128. package/lib/components/Stakeholders/index.js +2 -0
  129. package/lib/components/Stakeholders/index.js.map +1 -0
  130. package/lib/components/Tags/Tags.d.ts +34 -0
  131. package/lib/components/Tags/Tags.d.ts.map +1 -0
  132. package/lib/components/Tags/Tags.js +227 -0
  133. package/lib/components/Tags/Tags.js.map +1 -0
  134. package/lib/components/Tags/index.d.ts +3 -0
  135. package/lib/components/Tags/index.d.ts.map +1 -0
  136. package/lib/components/Tags/index.js +2 -0
  137. package/lib/components/Tags/index.js.map +1 -0
  138. package/lib/components/Tasks/TaskList.d.ts +25 -0
  139. package/lib/components/Tasks/TaskList.d.ts.map +1 -0
  140. package/lib/components/Tasks/TaskList.js +25 -0
  141. package/lib/components/Tasks/TaskList.js.map +1 -0
  142. package/lib/components/Tasks/Tasks.d.ts +2 -14
  143. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  144. package/lib/components/Tasks/Tasks.js +17 -39
  145. package/lib/components/Tasks/Tasks.js.map +1 -1
  146. package/lib/components/Tasks/index.d.ts +3 -0
  147. package/lib/components/Tasks/index.d.ts.map +1 -1
  148. package/lib/components/Tasks/index.js +1 -0
  149. package/lib/components/Tasks/index.js.map +1 -1
  150. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  151. package/lib/components/Timeline/Timeline.js +13 -29
  152. package/lib/components/Timeline/Timeline.js.map +1 -1
  153. package/lib/components/Timeline/Timeline.styles.d.ts +9 -5
  154. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  155. package/lib/components/Timeline/Timeline.styles.js +107 -50
  156. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  157. package/lib/components/Timeline/Timeline.types.d.ts +18 -5
  158. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  159. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  160. package/lib/components/Timeline/TimelineItem.d.ts +5 -3
  161. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  162. package/lib/components/Timeline/TimelineItem.js +15 -32
  163. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  164. package/lib/components/Timeline/utils.d.ts +11 -3
  165. package/lib/components/Timeline/utils.d.ts.map +1 -1
  166. package/lib/components/Timeline/utils.js +48 -4
  167. package/lib/components/Timeline/utils.js.map +1 -1
  168. package/lib/index.d.ts +10 -2
  169. package/lib/index.d.ts.map +1 -1
  170. package/lib/index.js +10 -2
  171. package/lib/index.js.map +1 -1
  172. package/package.json +14 -14
  173. package/lib/components/CaseActions/CaseActions.d.ts +0 -12
  174. package/lib/components/CaseActions/CaseActions.d.ts.map +0 -1
  175. package/lib/components/CaseActions/CaseActions.js +0 -15
  176. package/lib/components/CaseActions/CaseActions.js.map +0 -1
  177. package/lib/components/CaseActions/index.d.ts +0 -4
  178. package/lib/components/CaseActions/index.d.ts.map +0 -1
  179. package/lib/components/CaseActions/index.js +0 -3
  180. package/lib/components/CaseActions/index.js.map +0 -1
@@ -1,11 +1,12 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { Button, calculateFontSize, Card, CardContent, defaultThemeProp, Flex, Grid, StyledText } from '@pega/cosmos-react-core';
2
+ import { Button, calculateFontSize, Card, CardContent, DateTimeDisplay, defaultThemeProp, Flex, Grid, StyledIcon, useDirection } from '@pega/cosmos-react-core';
3
3
  export const StyledCard = styled(Card)(({ theme }) => {
4
4
  return css `
5
5
  border-top: 0.0625rem solid ${theme.base.colors.slate.light};
6
- padding: calc(1 * ${theme.base.spacing}) 0;
6
+ padding: ${theme.base.spacing} 0;
7
7
  &:not(& &) {
8
8
  border-radius: 0;
9
+ background-color: transparent;
9
10
  }
10
11
  `;
11
12
  });
@@ -14,18 +15,14 @@ export const StyledCardContent = styled(CardContent)(({ theme }) => {
14
15
  return css `
15
16
  &:not(${StyledCard} ${StyledCard} > &) {
16
17
  padding: ${theme.base.spacing} 0;
17
- padding-inline-start: ${theme.base.sizes['touch-mouse']};
18
+ padding-inline-start: ${theme.base['hit-area']['mouse-min']};
18
19
  @media (pointer: coarse) {
19
- padding-inline-start: ${theme.base.sizes['touch-finger']};
20
+ padding-inline-start: ${theme.base['hit-area']['finger-min']};
20
21
  }
21
22
  }
22
23
  `;
23
24
  });
24
25
  StyledCardContent.defaultProps = defaultThemeProp;
25
- export const StyledCardHeader = styled(Grid) `
26
- padding: 0;
27
- min-height: 2rem;
28
- `;
29
26
  export const StyledToggleButton = styled(Button)(({ theme, collapsed }) => {
30
27
  return css `
31
28
  transition: transform calc(2 * ${theme.base.animation.speed})
@@ -35,83 +32,143 @@ export const StyledToggleButton = styled(Button)(({ theme, collapsed }) => {
35
32
  `;
36
33
  });
37
34
  StyledToggleButton.defaultProps = defaultThemeProp;
35
+ export const StyledCardHeader = styled(Grid) `
36
+ padding: 0;
37
+ min-height: 2rem;
38
+ ${StyledToggleButton} {
39
+ align-self: start;
40
+ }
41
+ `;
38
42
  StyledCardHeader.defaultProps = defaultThemeProp;
39
43
  export const StyledTimelineIcon = styled(Flex)(({ theme }) => {
40
44
  return css `
41
45
  border-radius: 50%;
42
- color: ${theme.base.colors.slate.dark};
43
- background: ${theme.base.colors.slate['extra-light']};
44
- width: 1.5rem;
45
- height: 1.5rem;
46
+ color: ${theme.base.palette.light};
47
+ background: ${theme.base.palette.info};
48
+ & > ${StyledIcon} {
49
+ height: 1em;
50
+ width: 1em;
51
+ }
46
52
  `;
47
53
  });
48
54
  StyledTimelineIcon.defaultProps = defaultThemeProp;
49
- export const StyledBulletWrapper = styled(Grid)(({ theme, isPrevFuture, isNextFuture }) => {
55
+ export const StyledBulletWrapper = styled.td(({ theme, hasPrev, hasNext, isPrevFuture, isNextFuture, hasIcon }) => {
56
+ const { rtl } = useDirection();
50
57
  return css `
51
58
  position: relative;
52
- height: 100%;
53
- align-items: center;
59
+ text-align: center;
60
+ padding-top: calc(2.25 * ${theme.base.spacing} + 0.0625rem);
61
+
62
+ ${hasPrev &&
63
+ css `
64
+ &::before {
65
+ content: '';
66
+ display: block;
67
+ position: absolute;
68
+ top: 0;
69
+ inset-inline-start: 50%;
70
+ transform: translateX(${rtl ? '50%' : '-50%'});
71
+ width: 0.0625rem;
72
+ height: calc(2.25 * ${theme.base.spacing} + 0.75rem);
73
+ border-inline-start: 0.0625rem ${isPrevFuture ? 'dashed' : 'solid'}
74
+ ${theme.base.palette.info};
75
+ }
76
+ `}
77
+
78
+ ${hasNext &&
79
+ css `
80
+ &::after {
81
+ content: '';
82
+ display: block;
83
+ position: absolute;
84
+ top: calc(2.25 * ${theme.base.spacing} + 0.75rem);
85
+ inset-inline-start: 50%;
86
+ transform: translateX(${rtl ? '50%' : '-50%'});
87
+ width: 0.0625rem;
88
+ height: calc(100% - 2.25 * ${theme.base.spacing} - 0.75rem);
89
+ border-inline-start: 0.0625rem ${isNextFuture ? 'dashed' : 'solid'}
90
+ ${theme.base.palette.info};
91
+ }
92
+ `}
54
93
 
55
94
  & > ${StyledTimelineIcon} {
95
+ position: relative;
56
96
  margin: 0;
57
97
  z-index: 1;
98
+ width: ${hasIcon ? '1.5rem' : '0.5rem'};
99
+ height: ${hasIcon ? '1.5rem' : '0.5rem'};
58
100
  }
59
101
 
60
- &:not(:first-of-type)::before {
61
- content: '';
62
- display: block;
63
- position: absolute;
64
- top: 0;
65
- left: 50%;
66
- transform: translateX(-50%);
67
- width: 0.0625rem;
68
- height: 30%;
69
- border-left: 0.0625rem ${isPrevFuture ? 'dashed' : 'solid'} ${theme.base.colors.slate.light};
70
- }
71
-
72
- &:not(:last-of-type)::after {
73
- content: '';
74
- display: block;
75
- position: absolute;
76
- top: 30%;
77
- left: 50%;
78
- transform: translateX(-50%);
79
- width: 0.0625rem;
80
- height: 70%;
81
- border-left: 0.0625rem ${isNextFuture ? 'dashed' : 'solid'} ${theme.base.colors.slate.light};
102
+ @media (min-width: ${theme.base.breakpoints.sm}) {
103
+ padding-top: calc(${theme.base.spacing} + 0.0625rem);
104
+ &::before {
105
+ height: calc(${theme.base.spacing} + 0.75rem);
106
+ }
107
+ &::after {
108
+ top: calc(${theme.base.spacing} + 0.75rem);
109
+ height: calc(100% - ${theme.base.spacing} - 0.75rem);
110
+ }
82
111
  }
83
112
  `;
84
113
  });
85
114
  StyledBulletWrapper.defaultProps = defaultThemeProp;
86
- export const StyledGrid = styled(Grid)(({ theme }) => {
115
+ export const StyledTimelineTable = styled.table(({ theme }) => {
87
116
  return css `
88
- grid-auto-rows: auto;
89
- background-color: ${theme.base.palette['primary-background']};
90
- padding: calc(2 * ${theme.base.spacing});
117
+ tr {
118
+ td {
119
+ border-inline-start: ${theme.base.spacing} solid transparent;
120
+ border-inline-end: ${theme.base.spacing} solid transparent;
121
+ vertical-align: top;
122
+ }
123
+ td:first-child {
124
+ border-inline-start: none;
125
+ }
126
+
127
+ td:last-child {
128
+ border-inline-end: none;
129
+ }
130
+ }
131
+ border-collapse: collapse;
132
+ width: 100%;
91
133
  @media (min-width: ${theme.base.breakpoints.sm}) {
134
+ column-gap: ${theme.base.spacing};
135
+ tr {
136
+ td {
137
+ border-inline-start: calc(0.5 * ${theme.base.spacing}) solid transparent;
138
+ border-inline-end: calc(0.5 * ${theme.base.spacing}) solid transparent;
139
+ }
140
+ }
92
141
  ${StyledCard} {
93
142
  padding: calc(0.5 * ${theme.base.spacing}) 0;
94
143
  }
95
144
  }
96
145
  `;
97
146
  });
98
- StyledGrid.defaultProps = defaultThemeProp;
99
- export const StyledDate = styled.header(({ theme: { base: { 'font-size': fontSize, 'font-scale': fontScale, spacing }, components: { text } } }) => {
147
+ StyledTimelineTable.defaultProps = defaultThemeProp;
148
+ export const StyledDate = styled(DateTimeDisplay)(({ theme: { base: { 'font-size': fontSize, 'font-scale': fontScale, spacing }, components: { text } } }) => {
100
149
  const fontSizes = calculateFontSize(fontSize, fontScale);
101
150
  return css `
102
- height: 100%;
151
+ display: block;
103
152
  padding: calc(3 * ${spacing}) 0 calc(1.25 * ${spacing});
104
-
105
- & ${StyledText} {
106
- font-size: ${fontSizes[text.h2['font-size']]};
107
- font-weight: ${text.h2['font-weight']};
108
- }
153
+ font-size: ${fontSizes[text.h2['font-size']]};
154
+ font-weight: ${text.h2['font-weight']};
109
155
  `;
110
156
  });
111
157
  StyledDate.defaultProps = defaultThemeProp;
112
- export const StyledTime = styled(StyledText)(({ theme }) => {
158
+ export const StyledTimeWrapper = styled.td(({ theme }) => {
159
+ return css `
160
+ @media (min-width: ${theme.base.breakpoints.sm}) {
161
+ text-align: end;
162
+ line-height: ${theme.base['hit-area']['mouse-min']};
163
+ padding-top: calc(0.5 * ${theme.base.spacing} + 0.0625rem);
164
+ }
165
+ `;
166
+ });
167
+ StyledTimeWrapper.defaultProps = defaultThemeProp;
168
+ export const StyledTime = styled(DateTimeDisplay)(({ theme }) => {
113
169
  return css `
114
170
  opacity: ${theme.base.transparency['transparent-2']};
171
+ white-space: nowrap;
115
172
  `;
116
173
  });
117
174
  StyledTime.defaultProps = defaultThemeProp;
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.styles.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,IAAI,EAEJ,IAAI,EACJ,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;kCACsB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;wBACvC,KAAK,CAAC,IAAI,CAAC,OAAO;;;;GAI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E,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,EACjE,UAAU,EAAE,EAAE,IAAI,EAAE,EACrB,EACF,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzD,OAAO,GAAG,CAAA;;0BAEY,OAAO,mBAAmB,OAAO;;UAEjD,UAAU;qBACC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAa,CAAC;uBACzC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;;KAExC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n Button,\n calculateFontSize,\n Card,\n CardContent,\n defaultThemeProp,\n Flex,\n FontSize,\n Grid,\n StyledText\n} from '@pega/cosmos-react-core';\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n border-top: 0.0625rem solid ${theme.base.colors.slate.light};\n padding: calc(1 * ${theme.base.spacing}) 0;\n &:not(& &) {\n border-radius: 0;\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled(CardContent)(({ theme }) => {\n return css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing} 0;\n padding-inline-start: ${theme.base.sizes['touch-mouse']};\n @media (pointer: coarse) {\n padding-inline-start: ${theme.base.sizes['touch-finger']};\n }\n }\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled(Grid)`\n padding: 0;\n min-height: 2rem;\n`;\n\nexport const StyledToggleButton = styled(Button)<{ collapsed: boolean }>(({ theme, collapsed }) => {\n return css`\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${collapsed ? 'rotate(-90deg)' : 'rotate(0)'};\n color: ${theme.components.button.color};\n `;\n});\n\nStyledToggleButton.defaultProps = defaultThemeProp;\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineIcon = styled(Flex)(({ theme }) => {\n return css`\n border-radius: 50%;\n color: ${theme.base.colors.slate.dark};\n background: ${theme.base.colors.slate['extra-light']};\n width: 1.5rem;\n height: 1.5rem;\n `;\n});\n\nStyledTimelineIcon.defaultProps = defaultThemeProp;\n\ninterface StyledBulletWrapperProps {\n isPrevFuture: boolean;\n isNextFuture: boolean;\n}\n\nexport const StyledBulletWrapper = styled(Grid)<StyledBulletWrapperProps>(\n ({ theme, isPrevFuture, isNextFuture }) => {\n return css`\n position: relative;\n height: 100%;\n align-items: center;\n\n & > ${StyledTimelineIcon} {\n margin: 0;\n z-index: 1;\n }\n\n &:not(:first-of-type)::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n width: 0.0625rem;\n height: 30%;\n border-left: 0.0625rem ${isPrevFuture ? 'dashed' : 'solid'} ${theme.base.colors.slate.light};\n }\n\n &:not(:last-of-type)::after {\n content: '';\n display: block;\n position: absolute;\n top: 30%;\n left: 50%;\n transform: translateX(-50%);\n width: 0.0625rem;\n height: 70%;\n border-left: 0.0625rem ${isNextFuture ? 'dashed' : 'solid'} ${theme.base.colors.slate.light};\n }\n `;\n }\n);\n\nStyledBulletWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledGrid = styled(Grid)(({ theme }) => {\n return css`\n grid-auto-rows: auto;\n background-color: ${theme.base.palette['primary-background']};\n padding: calc(2 * ${theme.base.spacing});\n @media (min-width: ${theme.base.breakpoints.sm}) {\n ${StyledCard} {\n padding: calc(0.5 * ${theme.base.spacing}) 0;\n }\n }\n `;\n});\n\nStyledGrid.defaultProps = defaultThemeProp;\n\nexport const StyledDate = styled.header(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing },\n components: { text }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n height: 100%;\n padding: calc(3 * ${spacing}) 0 calc(1.25 * ${spacing});\n\n & ${StyledText} {\n font-size: ${fontSizes[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n }\n `;\n }\n);\n\nStyledDate.defaultProps = defaultThemeProp;\n\nexport const StyledTime = styled(StyledText)(({ theme }) => {\n return css`\n opacity: ${theme.base.transparency['transparent-2']};\n `;\n});\n\nStyledTime.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"Timeline.styles.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,iBAAiB,EACjB,IAAI,EACJ,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,IAAI,EAEJ,IAAI,EACJ,UAAU,EACV,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;kCACsB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;eAChD,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;GAK9B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAA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,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;;qBAE7B,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;gCACxB,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC;;GAEpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n Button,\n calculateFontSize,\n Card,\n CardContent,\n DateTimeDisplay,\n defaultThemeProp,\n Flex,\n FontSize,\n Grid,\n StyledIcon,\n useDirection\n} from '@pega/cosmos-react-core';\n\nexport const StyledCard = styled(Card)(({ theme }) => {\n return css`\n border-top: 0.0625rem solid ${theme.base.colors.slate.light};\n padding: ${theme.base.spacing} 0;\n &:not(& &) {\n border-radius: 0;\n background-color: transparent;\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled(CardContent)(({ theme }) => {\n return css`\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing} 0;\n padding-inline-start: ${theme.base['hit-area']['mouse-min']};\n @media (pointer: coarse) {\n padding-inline-start: ${theme.base['hit-area']['finger-min']};\n }\n }\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledToggleButton = styled(Button)<{ collapsed: boolean }>(({ theme, collapsed }) => {\n return css`\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${collapsed ? 'rotate(-90deg)' : 'rotate(0)'};\n color: ${theme.components.button.color};\n `;\n});\n\nStyledToggleButton.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled(Grid)`\n padding: 0;\n min-height: 2rem;\n ${StyledToggleButton} {\n align-self: start;\n }\n`;\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineIcon = styled(Flex)(({ theme }) => {\n return css`\n border-radius: 50%;\n color: ${theme.base.palette.light};\n background: ${theme.base.palette.info};\n & > ${StyledIcon} {\n height: 1em;\n width: 1em;\n }\n `;\n});\n\nStyledTimelineIcon.defaultProps = defaultThemeProp;\n\ninterface StyledBulletWrapperProps {\n hasPrev: boolean;\n hasNext: boolean;\n isPrevFuture: boolean;\n isNextFuture: boolean;\n hasIcon: boolean;\n}\n\nexport const StyledBulletWrapper = styled.td<StyledBulletWrapperProps>(\n ({ theme, hasPrev, hasNext, isPrevFuture, isNextFuture, hasIcon }) => {\n const { rtl } = useDirection();\n return css`\n position: relative;\n text-align: center;\n padding-top: calc(2.25 * ${theme.base.spacing} + 0.0625rem);\n\n ${hasPrev &&\n css`\n &::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n width: 0.0625rem;\n height: calc(2.25 * ${theme.base.spacing} + 0.75rem);\n border-inline-start: 0.0625rem ${isPrevFuture ? 'dashed' : 'solid'}\n ${theme.base.palette.info};\n }\n `}\n\n ${hasNext &&\n css`\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: calc(2.25 * ${theme.base.spacing} + 0.75rem);\n inset-inline-start: 50%;\n transform: translateX(${rtl ? '50%' : '-50%'});\n width: 0.0625rem;\n height: calc(100% - 2.25 * ${theme.base.spacing} - 0.75rem);\n border-inline-start: 0.0625rem ${isNextFuture ? 'dashed' : 'solid'}\n ${theme.base.palette.info};\n }\n `}\n\n & > ${StyledTimelineIcon} {\n position: relative;\n margin: 0;\n z-index: 1;\n width: ${hasIcon ? '1.5rem' : '0.5rem'};\n height: ${hasIcon ? '1.5rem' : '0.5rem'};\n }\n\n @media (min-width: ${theme.base.breakpoints.sm}) {\n padding-top: calc(${theme.base.spacing} + 0.0625rem);\n &::before {\n height: calc(${theme.base.spacing} + 0.75rem);\n }\n &::after {\n top: calc(${theme.base.spacing} + 0.75rem);\n height: calc(100% - ${theme.base.spacing} - 0.75rem);\n }\n }\n `;\n }\n);\n\nStyledBulletWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledTimelineTable = styled.table(({ theme }) => {\n return css`\n tr {\n td {\n border-inline-start: ${theme.base.spacing} solid transparent;\n border-inline-end: ${theme.base.spacing} solid transparent;\n vertical-align: top;\n }\n td:first-child {\n border-inline-start: none;\n }\n\n td:last-child {\n border-inline-end: none;\n }\n }\n border-collapse: collapse;\n width: 100%;\n @media (min-width: ${theme.base.breakpoints.sm}) {\n column-gap: ${theme.base.spacing};\n tr {\n td {\n border-inline-start: calc(0.5 * ${theme.base.spacing}) solid transparent;\n border-inline-end: calc(0.5 * ${theme.base.spacing}) solid transparent;\n }\n }\n ${StyledCard} {\n padding: calc(0.5 * ${theme.base.spacing}) 0;\n }\n }\n `;\n});\n\nStyledTimelineTable.defaultProps = defaultThemeProp;\n\nexport const StyledDate = styled(DateTimeDisplay)(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing },\n components: { text }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n display: block;\n padding: calc(3 * ${spacing}) 0 calc(1.25 * ${spacing});\n font-size: ${fontSizes[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n `;\n }\n);\n\nStyledDate.defaultProps = defaultThemeProp;\n\nexport const StyledTimeWrapper = styled.td(({ theme }) => {\n return css`\n @media (min-width: ${theme.base.breakpoints.sm}) {\n text-align: end;\n line-height: ${theme.base['hit-area']['mouse-min']};\n padding-top: calc(0.5 * ${theme.base.spacing} + 0.0625rem);\n }\n `;\n});\n\nStyledTimeWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledTime = styled(DateTimeDisplay)(({ theme }) => {\n return css`\n opacity: ${theme.base.transparency['transparent-2']};\n white-space: nowrap;\n `;\n});\n\nStyledTime.defaultProps = defaultThemeProp;\n"]}
@@ -1,12 +1,13 @@
1
- import { ReactElement, ReactNode, Ref } from 'react';
2
- import { BaseProps, FieldValueListProps, IconProps, Link, StatusProps } from '@pega/cosmos-react-core';
1
+ import { ReactNode, Ref } from 'react';
2
+ import { BaseProps, FieldValueListProps, IconProps, StatusProps } from '@pega/cosmos-react-core';
3
+ import { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTimeDisplay';
3
4
  export interface ActivityObject {
4
5
  /** Unique id for activity */
5
6
  id: string;
6
7
  /** Date as ISO8601 string, timestamp or native Date object. */
7
8
  date: string | number | Date;
8
- /** Header text of the activity or Link */
9
- title: string | ReactElement<typeof Link>;
9
+ /** Header region for rendering text and links. */
10
+ title: ReactNode;
10
11
  /** Name of the icon (to be selected from default Pega icon set) */
11
12
  icon?: IconProps['name'];
12
13
  /** Represents the current status of activity */
@@ -14,12 +15,24 @@ export interface ActivityObject {
14
15
  /** The set of field values to render in the list. */
15
16
  content?: FieldValueListProps['fields'] | ReactNode;
16
17
  }
18
+ export declare type TimelineSortOrder = 'ascending' | 'descending';
19
+ export declare type TimelineGroupBy = Extract<DateTimeVariant, 'date' | 'monthyear' | 'quarteryear' | 'year'> | 'none';
17
20
  export default interface TimelineProps extends BaseProps {
18
21
  /** List of activity */
19
22
  activity: ActivityObject[];
20
23
  /** Current time as Date */
21
24
  currentTime: Date;
25
+ /**
26
+ * List of activity sorted in ascending or descending order.
27
+ * @default "descending"
28
+ */
29
+ sortOrder?: TimelineSortOrder;
30
+ /**
31
+ * List of activity grouped by day, month, quarter or year.
32
+ * @default "date"
33
+ */
34
+ groupBy?: TimelineGroupBy;
22
35
  /** Ref for the wrapping element. */
23
- ref?: Ref<HTMLDivElement>;
36
+ ref?: Ref<HTMLTableElement>;
24
37
  }
25
38
  //# sourceMappingURL=Timeline.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.types.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IAC1C,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qDAAqD;IACrD,OAAO,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;CACrD;AAED,MAAM,CAAC,OAAO,WAAW,aAAc,SAAQ,SAAS;IACtD,uBAAuB;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,2BAA2B;IAC3B,WAAW,EAAE,IAAI,CAAC;IAClB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
1
+ {"version":3,"file":"Timeline.types.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,iEAAiE,CAAC;AAElG,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,kDAAkD;IAClD,KAAK,EAAE,SAAS,CAAC;IACjB,mEAAmE;IACnE,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,gDAAgD;IAChD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qDAAqD;IACrD,OAAO,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;CACrD;AAED,oBAAY,iBAAiB,GAAG,WAAW,GAAG,YAAY,CAAC;AAC3D,oBAAY,eAAe,GACvB,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,MAAM,CAAC,GACvE,MAAM,CAAC;AAEX,MAAM,CAAC,OAAO,WAAW,aAAc,SAAQ,SAAS;IACtD,uBAAuB;IACvB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,2BAA2B;IAC3B,WAAW,EAAE,IAAI,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.types.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactElement, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n FieldValueListProps,\n IconProps,\n Link,\n StatusProps\n} from '@pega/cosmos-react-core';\n\nexport interface ActivityObject {\n /** Unique id for activity */\n id: string;\n /** Date as ISO8601 string, timestamp or native Date object. */\n date: string | number | Date;\n /** Header text of the activity or Link */\n title: string | ReactElement<typeof Link>;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon?: IconProps['name'];\n /** Represents the current status of activity */\n status?: StatusProps;\n /** The set of field values to render in the list. */\n content?: FieldValueListProps['fields'] | ReactNode;\n}\n\nexport default interface TimelineProps extends BaseProps {\n /** List of activity */\n activity: ActivityObject[];\n /** Current time as Date */\n currentTime: Date;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
1
+ {"version":3,"file":"Timeline.types.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref } from 'react';\n\nimport { BaseProps, FieldValueListProps, IconProps, StatusProps } from '@pega/cosmos-react-core';\nimport { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTimeDisplay';\n\nexport interface ActivityObject {\n /** Unique id for activity */\n id: string;\n /** Date as ISO8601 string, timestamp or native Date object. */\n date: string | number | Date;\n /** Header region for rendering text and links. */\n title: ReactNode;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon?: IconProps['name'];\n /** Represents the current status of activity */\n status?: StatusProps;\n /** The set of field values to render in the list. */\n content?: FieldValueListProps['fields'] | ReactNode;\n}\n\nexport type TimelineSortOrder = 'ascending' | 'descending';\nexport type TimelineGroupBy =\n | Extract<DateTimeVariant, 'date' | 'monthyear' | 'quarteryear' | 'year'>\n | 'none';\n\nexport default interface TimelineProps extends BaseProps {\n /** List of activity */\n activity: ActivityObject[];\n /** Current time as Date */\n currentTime: Date;\n /**\n * List of activity sorted in ascending or descending order.\n * @default \"descending\"\n */\n sortOrder?: TimelineSortOrder;\n /**\n * List of activity grouped by day, month, quarter or year.\n * @default \"date\"\n */\n groupBy?: TimelineGroupBy;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTableElement>;\n}\n"]}
@@ -1,10 +1,12 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
2
+ import { ForwardProps, DateTimeDisplayProps } from '@pega/cosmos-react-core';
3
3
  import type { ActivityObject } from './Timeline.types';
4
4
  interface TimelineItemProps {
5
5
  item: ActivityObject;
6
- isPrevFuture: boolean;
7
- isNextFuture: boolean;
6
+ timeFormat: DateTimeDisplayProps['variant'];
7
+ prevItemDate: ActivityObject['date'] | undefined;
8
+ nextItemDate: ActivityObject['date'] | undefined;
9
+ currentTime: Date;
8
10
  }
9
11
  declare const TimelineItem: FunctionComponent<TimelineItemProps & ForwardProps>;
10
12
  export default TimelineItem;
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAyC,MAAM,OAAO,CAAC;AAExF,OAAO,EAIL,YAAY,EAMb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAWvD,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAkGrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyC,MAAM,OAAO,CAAC;AAEjF,OAAO,EAGL,YAAY,EAOZ,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAavD,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC5C,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,WAAW,EAAE,IAAI,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CA4FrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,38 +1,21 @@
1
- import React, { isValidElement, useCallback, useState } from 'react';
2
- import { DateTimeDisplay, ExpandCollapse, Grid, Icon, Status, useBreakpoint, FieldValueList } from '@pega/cosmos-react-core';
3
- import { StyledCard, StyledCardHeader, StyledTime, StyledTimelineIcon, StyledCardContent, StyledBulletWrapper, StyledToggleButton } from './Timeline.styles';
4
- const TimelineItem = ({ item: { id, date, title, icon, status, content }, isPrevFuture, isNextFuture }) => {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { isValidElement, useCallback, useState } from 'react';
3
+ import { ExpandCollapse, Grid, Icon, Status, useBreakpoint, FieldValueList, Flex } from '@pega/cosmos-react-core';
4
+ import { StyledCard, StyledCardHeader, StyledTimeWrapper, StyledTimelineIcon, StyledCardContent, StyledBulletWrapper, StyledToggleButton, StyledTime } from './Timeline.styles';
5
+ import { isFutureDate } from './utils';
6
+ const TimelineItem = ({ item: { date, title, icon, status, content }, timeFormat, prevItemDate, nextItemDate, currentTime }) => {
5
7
  const [collapsed, setCollapsed] = useState(true);
6
8
  const isSmallOrAbove = useBreakpoint('sm');
7
9
  const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);
8
- return (React.createElement(React.Fragment, null,
9
- isSmallOrAbove && React.createElement(DateTimeDisplay, { variant: 'time', value: date, as: StyledTime }),
10
- React.createElement(StyledBulletWrapper, { container: { alignItems: 'start' }, isPrevFuture: isPrevFuture, isNextFuture: isNextFuture },
11
- React.createElement(StyledTimelineIcon, { container: { inline: true, alignItems: 'center', justify: 'center' } }, icon && React.createElement(Icon, { name: icon }))),
12
- React.createElement(StyledCard, null,
13
- React.createElement(StyledCardHeader, { container: {
14
- cols: 'auto 1fr',
15
- alignContent: 'evenly',
16
- alignItems: 'center'
17
- }, sm: { container: { cols: 'auto 1fr auto' } } },
18
- content && (React.createElement(StyledToggleButton, { icon: true, variant: 'simple', onClick: toggleCollapse, collapsed: collapsed, "aria-expanded": !collapsed },
19
- React.createElement(Icon, { name: 'caret-down' }))),
20
- React.createElement(Grid, { item: { colStart: '2', colEnd: '2' }, container: { rowGap: 0.25 }, id: `timeline-item-heading${id}` },
21
- title,
22
- !isSmallOrAbove && (React.createElement(Grid, { container: {
23
- cols: '1fr auto',
24
- alignContent: 'evenly',
25
- alignItems: 'center'
26
- } },
27
- React.createElement(DateTimeDisplay, { variant: 'time', value: date, as: StyledTime }),
28
- status && React.createElement(Status, { variant: status.variant }, status.children)))),
29
- isSmallOrAbove && status && (React.createElement(Grid, { sm: { item: { colStart: '3', colEnd: '3' } } },
30
- React.createElement(Status, { variant: status.variant }, status.children))))),
31
- content && (React.createElement(React.Fragment, null,
32
- React.createElement(StyledBulletWrapper, { item: { colStart: '1', colEnd: '1' }, sm: { item: { colStart: '2', colEnd: '2' } }, isPrevFuture: isNextFuture, isNextFuture: isNextFuture }),
33
- React.createElement(Grid, { item: { colStart: '2', colEnd: '-1' }, sm: { item: { colStart: '3', colEnd: '-1' } }, "aria-labelledby": `timeline-item-heading${id}` },
34
- React.createElement(ExpandCollapse, { dimension: 'height', collapsed: collapsed, nullWhenCollapsed: true },
35
- React.createElement(StyledCardContent, null, isValidElement(content) ? (content) : (React.createElement(FieldValueList, { fields: content, variant: isSmallOrAbove ? 'inline' : 'stacked' })))))))));
10
+ return (_jsxs("tr", { children: [isSmallOrAbove && (_jsx(StyledTimeWrapper, { children: _jsx(StyledTime, { variant: timeFormat, value: date }, void 0) }, void 0)), _jsx(StyledBulletWrapper, { hasIcon: !!icon, hasPrev: !!prevItemDate, hasNext: !!nextItemDate, isPrevFuture: isFutureDate(prevItemDate, currentTime), isNextFuture: isFutureDate(nextItemDate, currentTime), children: _jsx(StyledTimelineIcon, { container: { inline: true, alignItems: 'center', justify: 'center' }, children: icon && _jsx(Icon, { name: icon }, void 0) }, void 0) }, void 0), _jsxs("td", { style: { width: '100%' }, children: [_jsx(Flex, { children: _jsx(StyledCard, { children: _jsxs(StyledCardHeader, { container: {
11
+ cols: 'auto 1fr',
12
+ alignContent: 'evenly',
13
+ alignItems: 'center'
14
+ }, sm: { container: { cols: 'auto 1fr auto' } }, children: [content && (_jsx(StyledToggleButton, { icon: true, variant: 'simple', onClick: toggleCollapse, collapsed: collapsed, "aria-expanded": !collapsed, children: _jsx(Icon, { name: 'caret-down' }, void 0) }, void 0)), _jsxs(Grid, { item: { colStart: '2', colEnd: '2' }, container: { rowGap: 0.25 }, children: [title, !isSmallOrAbove && (_jsxs(Grid, { container: {
15
+ cols: '1fr auto',
16
+ alignContent: 'evenly',
17
+ alignItems: 'center'
18
+ }, children: [_jsx(StyledTime, { variant: 'time', value: date }, void 0), status && _jsx(Status, { variant: status.variant, children: status.children }, void 0)] }, void 0))] }, void 0), isSmallOrAbove && status && (_jsx(Grid, { sm: { item: { colStart: '3', colEnd: '3' } }, children: _jsx(Status, { variant: status.variant, children: status.children }, void 0) }, void 0))] }, void 0) }, void 0) }, void 0), content && (_jsx(ExpandCollapse, { dimension: 'height', collapsed: collapsed, nullWhenCollapsed: true, children: _jsx(StyledCardContent, { children: isValidElement(content) ? (content) : (_jsx(FieldValueList, { fields: content, variant: isSmallOrAbove ? 'inline' : 'stacked' }, void 0)) }, void 0) }, void 0))] }, void 0)] }, void 0));
36
19
  };
37
20
  export default TimelineItem;
38
21
  //# sourceMappingURL=TimelineItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExF,OAA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pC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAC5C,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,GAC1B;YACF,oBAAC,IAAI,IACH,IAAI,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EACrC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,qBAC5B,wBAAwB,EAAE,EAAE;gBAE7C,oBAAC,cAAc,IAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB;oBACxE,oBAAC,iBAAiB,QACf,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACzB,OAAO,CACR,CAAC,CAAC,CAAC,CACF,oBAAC,cAAc,IACb,MAAM,EAAE,OAAwC,EAChD,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC9C,CACH,CACiB,CACL,CACZ,CACN,CACJ,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { FunctionComponent, isValidElement, useCallback, useState } from 'react';\n\nimport {\n DateTimeDisplay,\n ExpandCollapse,\n FieldValueListProps,\n ForwardProps,\n Grid,\n Icon,\n Status,\n useBreakpoint,\n FieldValueList\n} from '@pega/cosmos-react-core';\n\nimport type { ActivityObject } from './Timeline.types';\nimport {\n StyledCard,\n StyledCardHeader,\n StyledTime,\n StyledTimelineIcon,\n StyledCardContent,\n StyledBulletWrapper,\n StyledToggleButton\n} from './Timeline.styles';\n\ninterface TimelineItemProps {\n item: ActivityObject;\n isPrevFuture: boolean;\n isNextFuture: boolean;\n}\n\nconst TimelineItem: FunctionComponent<TimelineItemProps & ForwardProps> = ({\n item: { id, date, title, icon, status, content },\n isPrevFuture,\n isNextFuture\n}: TimelineItemProps & ForwardProps) => {\n const [collapsed, setCollapsed] = useState(true);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);\n\n return (\n <>\n {isSmallOrAbove && <DateTimeDisplay variant='time' value={date} as={StyledTime} />}\n <StyledBulletWrapper\n container={{ alignItems: 'start' }}\n isPrevFuture={isPrevFuture}\n isNextFuture={isNextFuture}\n >\n <StyledTimelineIcon container={{ inline: true, alignItems: 'center', justify: 'center' }}>\n {icon && <Icon name={icon} />}\n </StyledTimelineIcon>\n </StyledBulletWrapper>\n <StyledCard>\n <StyledCardHeader\n container={{\n cols: 'auto 1fr',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n sm={{ container: { cols: 'auto 1fr auto' } }}\n >\n {content && (\n <StyledToggleButton\n icon\n variant='simple'\n onClick={toggleCollapse}\n collapsed={collapsed}\n aria-expanded={!collapsed}\n >\n <Icon name='caret-down' />\n </StyledToggleButton>\n )}\n <Grid\n item={{ colStart: '2', colEnd: '2' }}\n container={{ rowGap: 0.25 }}\n id={`timeline-item-heading${id}`}\n >\n {title}\n {!isSmallOrAbove && (\n <Grid\n container={{\n cols: '1fr auto',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n >\n <DateTimeDisplay variant='time' value={date} as={StyledTime} />\n {status && <Status variant={status.variant}>{status.children}</Status>}\n </Grid>\n )}\n </Grid>\n {isSmallOrAbove && status && (\n <Grid sm={{ item: { colStart: '3', colEnd: '3' } }}>\n <Status variant={status.variant}>{status.children}</Status>\n </Grid>\n )}\n </StyledCardHeader>\n </StyledCard>\n {content && (\n <>\n <StyledBulletWrapper\n item={{ colStart: '1', colEnd: '1' }}\n sm={{ item: { colStart: '2', colEnd: '2' } }}\n isPrevFuture={isNextFuture}\n isNextFuture={isNextFuture}\n />\n <Grid\n item={{ colStart: '2', colEnd: '-1' }}\n sm={{ item: { colStart: '3', colEnd: '-1' } }}\n aria-labelledby={`timeline-item-heading${id}`}\n >\n <ExpandCollapse dimension='height' collapsed={collapsed} nullWhenCollapsed>\n <StyledCardContent>\n {isValidElement(content) ? (\n content\n ) : (\n <FieldValueList\n fields={content as FieldValueListProps['fields']}\n variant={isSmallOrAbove ? 'inline' : 'stacked'}\n />\n )}\n </StyledCardContent>\n </ExpandCollapse>\n </Grid>\n </>\n )}\n </>\n );\n};\n\nexport default TimelineItem;\n"]}
1
+ {"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EACL,cAAc,EAGd,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,aAAa,EACb,cAAc,EACd,IAAI,EAEL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC,MAAM,YAAY,GAAwD,CAAC,EACzE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAC5C,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACsB,EAAE,EAAE;IACrC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAE3C,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;IAEpF,OAAO,CACL,yBACG,cAAc,IAAI,CACjB,KA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AAU;oDAChB,YAAY,EAAE,QAAQ;oDACtB,UAAU,EAAE,QAAQ;iDACrB,aAED,KAAC,UAAU,IAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,WAAI,EACzC,MAAM,IAAI,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YAAG,MAAM,CAAC,QAAQ,WAAU,YACjE,CACR,YACI,EACN,cAAc,IAAI,MAAM,IAAI,CAC3B,KAAC,IAAI,IAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,YAChD,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YAAG,MAAM,CAAC,QAAQ,WAAU,WACtD,CACR,YACgB,WACR,WACR,EACN,OAAO,IAAI,CACV,KAAC,cAAc,IAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,kBACxE,KAAC,iBAAiB,cACf,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACzB,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,cAAc,IACb,MAAM,EAAE,OAAwC,EAChD,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,WAC9C,CACH,WACiB,WACL,CAClB,YACE,YACF,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent, isValidElement, useCallback, useState } from 'react';\n\nimport {\n ExpandCollapse,\n FieldValueListProps,\n ForwardProps,\n Grid,\n Icon,\n Status,\n useBreakpoint,\n FieldValueList,\n Flex,\n DateTimeDisplayProps\n} from '@pega/cosmos-react-core';\n\nimport type { ActivityObject } from './Timeline.types';\nimport {\n StyledCard,\n StyledCardHeader,\n StyledTimeWrapper,\n StyledTimelineIcon,\n StyledCardContent,\n StyledBulletWrapper,\n StyledToggleButton,\n StyledTime\n} from './Timeline.styles';\nimport { isFutureDate } from './utils';\n\ninterface TimelineItemProps {\n item: ActivityObject;\n timeFormat: DateTimeDisplayProps['variant'];\n prevItemDate: ActivityObject['date'] | undefined;\n nextItemDate: ActivityObject['date'] | undefined;\n currentTime: Date;\n}\n\nconst TimelineItem: FunctionComponent<TimelineItemProps & ForwardProps> = ({\n item: { date, title, icon, status, content },\n timeFormat,\n prevItemDate,\n nextItemDate,\n currentTime\n}: TimelineItemProps & ForwardProps) => {\n const [collapsed, setCollapsed] = useState(true);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);\n\n return (\n <tr>\n {isSmallOrAbove && (\n <StyledTimeWrapper>\n <StyledTime variant={timeFormat} value={date} />\n </StyledTimeWrapper>\n )}\n <StyledBulletWrapper\n hasIcon={!!icon}\n hasPrev={!!prevItemDate}\n hasNext={!!nextItemDate}\n isPrevFuture={isFutureDate(prevItemDate, currentTime)}\n isNextFuture={isFutureDate(nextItemDate, currentTime)}\n >\n <StyledTimelineIcon container={{ inline: true, alignItems: 'center', justify: 'center' }}>\n {icon && <Icon name={icon} />}\n </StyledTimelineIcon>\n </StyledBulletWrapper>\n <td style={{ width: '100%' }}>\n <Flex>\n <StyledCard>\n <StyledCardHeader\n container={{\n cols: 'auto 1fr',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n sm={{ container: { cols: 'auto 1fr auto' } }}\n >\n {content && (\n <StyledToggleButton\n icon\n variant='simple'\n onClick={toggleCollapse}\n collapsed={collapsed}\n aria-expanded={!collapsed}\n >\n <Icon name='caret-down' />\n </StyledToggleButton>\n )}\n <Grid item={{ colStart: '2', colEnd: '2' }} container={{ rowGap: 0.25 }}>\n {title}\n {!isSmallOrAbove && (\n <Grid\n container={{\n cols: '1fr auto',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n >\n <StyledTime variant='time' value={date} />\n {status && <Status variant={status.variant}>{status.children}</Status>}\n </Grid>\n )}\n </Grid>\n {isSmallOrAbove && status && (\n <Grid sm={{ item: { colStart: '3', colEnd: '3' } }}>\n <Status variant={status.variant}>{status.children}</Status>\n </Grid>\n )}\n </StyledCardHeader>\n </StyledCard>\n </Flex>\n {content && (\n <ExpandCollapse dimension='height' collapsed={collapsed} nullWhenCollapsed>\n <StyledCardContent>\n {isValidElement(content) ? (\n content\n ) : (\n <FieldValueList\n fields={content as FieldValueListProps['fields']}\n variant={isSmallOrAbove ? 'inline' : 'stacked'}\n />\n )}\n </StyledCardContent>\n </ExpandCollapse>\n )}\n </td>\n </tr>\n );\n};\n\nexport default TimelineItem;\n"]}
@@ -1,6 +1,14 @@
1
- import type { ActivityObject } from './Timeline.types';
1
+ import type { ActivityObject, TimelineGroupBy, TimelineSortOrder } from './Timeline.types';
2
+ export declare function sortByDateAscending(dates: ActivityObject[]): ActivityObject[];
3
+ export declare function sortByDateDescending(dates: ActivityObject[]): ActivityObject[];
4
+ export declare function sortByDate(activity: ActivityObject[], sortOrder: TimelineSortOrder): ActivityObject[];
2
5
  export declare function getDatePartAsDate(date: string | number | Date): Date;
3
- export declare function sortByDate(dates: ActivityObject[]): ActivityObject[];
4
- export declare function isSameDate(firstDate: string | number | Date | undefined, secondDate: string | number | Date | undefined): boolean;
6
+ export declare function getMonthYearPartAsDate(date: string | number | Date): Date;
7
+ export declare function getYearPartAsDate(date: string | number | Date): Date;
8
+ export declare function isSameDate(firstDate: string | number | Date, secondDate: string | number | Date): boolean;
9
+ export declare function isSameMonthYear(firstDate: string | number | Date, secondDate: string | number | Date): boolean;
10
+ export declare function isSameYear(firstDate: string | number | Date, secondDate: string | number | Date): boolean;
11
+ export declare function isSameQuarterYear(firstDate: string | number | Date, secondDate: string | number | Date): boolean;
12
+ export declare function isSameGroup(firstDate: string | number | Date | undefined, secondDate: string | number | Date | undefined, groupBy: TimelineGroupBy): boolean;
5
13
  export declare function isFutureDate(date: string | number | Date | undefined, current: Date): boolean;
6
14
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGpE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAEpE;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAC7C,OAAO,CAGT;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAG7F"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE3F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAE7E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAE9E;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,cAAc,EAAE,EAC1B,SAAS,EAAE,iBAAiB,GAC3B,cAAc,EAAE,CAElB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGpE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGzE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGpE;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EACjC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GACjC,OAAO,CAET;AAED,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EACjC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GACjC,OAAO,CAIT;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EACjC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GACjC,OAAO,CAET;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EACjC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GACjC,OAAO,CAET;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9C,OAAO,EAAE,eAAe,GACvB,OAAO,CAqBT;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAG7F"}
@@ -1,15 +1,59 @@
1
- import { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';
1
+ import { getQuarter, parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';
2
+ export function sortByDateAscending(dates) {
3
+ return [...dates].sort((a, b) => parseToDate(a.date).getTime() - parseToDate(b.date).getTime());
4
+ }
5
+ export function sortByDateDescending(dates) {
6
+ return [...dates].sort((a, b) => parseToDate(b.date).getTime() - parseToDate(a.date).getTime());
7
+ }
8
+ export function sortByDate(activity, sortOrder) {
9
+ return sortOrder === 'ascending' ? sortByDateAscending(activity) : sortByDateDescending(activity);
10
+ }
2
11
  export function getDatePartAsDate(date) {
3
12
  const parsedDate = parseToDate(date);
4
13
  return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());
5
14
  }
6
- export function sortByDate(dates) {
7
- return [...dates].sort((a, b) => parseToDate(b.date).getTime() - parseToDate(a.date).getTime());
15
+ export function getMonthYearPartAsDate(date) {
16
+ const parsedDate = parseToDate(date);
17
+ return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth());
18
+ }
19
+ export function getYearPartAsDate(date) {
20
+ const parsedDate = parseToDate(date);
21
+ return new Date(parsedDate.getUTCFullYear());
8
22
  }
9
23
  export function isSameDate(firstDate, secondDate) {
24
+ return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();
25
+ }
26
+ export function isSameMonthYear(firstDate, secondDate) {
27
+ return (getMonthYearPartAsDate(firstDate).getTime() === getMonthYearPartAsDate(secondDate).getTime());
28
+ }
29
+ export function isSameYear(firstDate, secondDate) {
30
+ return getYearPartAsDate(firstDate).getTime() === getYearPartAsDate(secondDate).getTime();
31
+ }
32
+ export function isSameQuarterYear(firstDate, secondDate) {
33
+ return isSameYear(firstDate, secondDate) && getQuarter(firstDate) === getQuarter(secondDate);
34
+ }
35
+ export function isSameGroup(firstDate, secondDate, groupBy) {
10
36
  if (!firstDate || !secondDate)
11
37
  return false;
12
- return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();
38
+ switch (groupBy) {
39
+ case 'none': {
40
+ return true;
41
+ }
42
+ case 'date': {
43
+ return isSameDate(firstDate, secondDate);
44
+ }
45
+ case 'monthyear': {
46
+ return isSameMonthYear(firstDate, secondDate);
47
+ }
48
+ case 'quarteryear': {
49
+ return isSameQuarterYear(firstDate, secondDate);
50
+ }
51
+ case 'year': {
52
+ return isSameYear(firstDate, secondDate);
53
+ }
54
+ default:
55
+ return false;
56
+ }
13
57
  }
14
58
  export function isFutureDate(date, current) {
15
59
  if (!date || !current)
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6DAA6D,CAAC;AAI1F,MAAM,UAAU,iBAAiB,CAAC,IAA4B;IAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAuB;IAChD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,SAA6C,EAC7C,UAA8C;IAE9C,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,KAAK,iBAAiB,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwC,EAAE,OAAa;IAClF,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import { parseToDate } from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\n\nimport type { ActivityObject } from './Timeline.types';\n\nexport function getDatePartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());\n}\n\nexport function sortByDate(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(b.date).getTime() - parseToDate(a.date).getTime());\n}\n\nexport function isSameDate(\n firstDate: string | number | Date | undefined,\n secondDate: string | number | Date | undefined\n): boolean {\n if (!firstDate || !secondDate) return false;\n return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();\n}\n\nexport function isFutureDate(date: string | number | Date | undefined, current: Date): boolean {\n if (!date || !current) return false;\n return parseToDate(date).getTime() > current.getTime();\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACZ,MAAM,6DAA6D,CAAC;AAIrE,MAAM,UAAU,mBAAmB,CAAC,KAAuB;IACzD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAuB;IAC1D,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,QAA0B,EAC1B,SAA4B;IAE5B,OAAO,SAAS,KAA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OAAO,EAAE,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,SAAiC,EACjC,UAAkC;IAElC,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/F,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,SAA6C,EAC7C,UAA8C,EAC9C,OAAwB;IAExB,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC5C,QAAQ,OAAO,EAAE;QACf,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,IAAI,CAAC;SACb;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC1C;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC/C;QACD,KAAK,aAAa,CAAC,CAAC;YAClB,OAAO,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SACjD;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC1C;QACD;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwC,EAAE,OAAa;IAClF,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import {\n getQuarter,\n parseToDate\n} from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\n\nimport type { ActivityObject, TimelineGroupBy, TimelineSortOrder } from './Timeline.types';\n\nexport function sortByDateAscending(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(a.date).getTime() - parseToDate(b.date).getTime());\n}\n\nexport function sortByDateDescending(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(b.date).getTime() - parseToDate(a.date).getTime());\n}\n\nexport function sortByDate(\n activity: ActivityObject[],\n sortOrder: TimelineSortOrder\n): ActivityObject[] {\n return sortOrder === 'ascending' ? sortByDateAscending(activity) : sortByDateDescending(activity);\n}\n\nexport function getDatePartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());\n}\n\nexport function getMonthYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth());\n}\n\nexport function getYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear());\n}\n\nexport function isSameDate(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();\n}\n\nexport function isSameMonthYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return (\n getMonthYearPartAsDate(firstDate).getTime() === getMonthYearPartAsDate(secondDate).getTime()\n );\n}\n\nexport function isSameYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getYearPartAsDate(firstDate).getTime() === getYearPartAsDate(secondDate).getTime();\n}\n\nexport function isSameQuarterYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return isSameYear(firstDate, secondDate) && getQuarter(firstDate) === getQuarter(secondDate);\n}\n\nexport function isSameGroup(\n firstDate: string | number | Date | undefined,\n secondDate: string | number | Date | undefined,\n groupBy: TimelineGroupBy\n): boolean {\n if (!firstDate || !secondDate) return false;\n switch (groupBy) {\n case 'none': {\n return true;\n }\n case 'date': {\n return isSameDate(firstDate, secondDate);\n }\n case 'monthyear': {\n return isSameMonthYear(firstDate, secondDate);\n }\n case 'quarteryear': {\n return isSameQuarterYear(firstDate, secondDate);\n }\n case 'year': {\n return isSameYear(firstDate, secondDate);\n }\n default:\n return false;\n }\n}\n\nexport function isFutureDate(date: string | number | Date | undefined, current: Date): boolean {\n if (!date || !current) return false;\n return parseToDate(date).getTime() > current.getTime();\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  export { default as AppAnnouncement } from './components/AppAnnouncement';
2
2
  export * from './components/AppAnnouncement';
3
- export { default as CaseActions } from './components/CaseActions';
4
- export * from './components/CaseActions';
5
3
  export { default as CaseHeader } from './components/CaseHeader';
6
4
  export * from './components/CaseHeader';
7
5
  export { default as CasePreview } from './components/CasePreview';
@@ -12,12 +10,22 @@ export { default as CaseSummaryFields } from './components/CaseSummaryFields';
12
10
  export * from './components/CaseSummaryFields';
13
11
  export { default as CaseView } from './components/CaseView';
14
12
  export * from './components/CaseView';
13
+ export { default as ConfigurableLayout } from './components/ConfigurableLayout';
14
+ export * from './components/ConfigurableLayout';
15
+ export { default as Confirmation } from './components/Confirmation';
16
+ export * from './components/Confirmation';
17
+ export { default as Details } from './components/Details';
18
+ export * from './components/Details';
15
19
  export { default as Glimpse } from './components/Glimpse';
16
20
  export * from './components/Glimpse';
17
21
  export { default as SearchResults } from './components/SearchResults';
18
22
  export * from './components/SearchResults';
19
23
  export { default as Stages } from './components/Stages';
20
24
  export * from './components/Stages';
25
+ export { default as Stakeholders } from './components/Stakeholders';
26
+ export * from './components/Stakeholders';
27
+ export { default as Tags } from './components/Tags';
28
+ export * from './components/Tags';
21
29
  export { default as Tasks } from './components/Tasks';
22
30
  export * from './components/Tasks';
23
31
  export { default as Timeline } from './components/Timeline';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,cAA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