@pega/cosmos-react-work 4.0.0-dev.2.0 → 4.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 (174) hide show
  1. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +7 -21
  2. package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
  3. package/lib/components/AppAnnouncement/AppAnnouncement.js +2 -1
  4. package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
  5. package/lib/components/Assignments/Assignments.d.ts +21 -0
  6. package/lib/components/Assignments/Assignments.d.ts.map +1 -0
  7. package/lib/components/Assignments/Assignments.js +20 -0
  8. package/lib/components/Assignments/Assignments.js.map +1 -0
  9. package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
  10. package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
  11. package/lib/components/Assignments/Assignments.styles.js +41 -0
  12. package/lib/components/Assignments/Assignments.styles.js.map +1 -0
  13. package/lib/components/Assignments/index.d.ts +2 -0
  14. package/lib/components/Assignments/index.d.ts.map +1 -0
  15. package/lib/components/Assignments/index.js +2 -0
  16. package/lib/components/Assignments/index.js.map +1 -0
  17. package/lib/components/CasePreview/CasePreview.d.ts +9 -4
  18. package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
  19. package/lib/components/CasePreview/CasePreview.js +6 -9
  20. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  21. package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
  22. package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
  23. package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
  24. package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
  25. package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
  26. package/lib/components/CaseView/CaseHeader/CaseHeader.js +119 -0
  27. package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
  28. package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
  29. package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
  30. package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
  31. package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
  32. package/lib/components/CaseView/CaseSummary.d.ts.map +1 -1
  33. package/lib/components/CaseView/CaseSummary.js +9 -4
  34. package/lib/components/CaseView/CaseSummary.js.map +1 -1
  35. package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -1
  36. package/lib/components/CaseView/CaseSummaryFields.js +14 -4
  37. package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
  38. package/lib/components/CaseView/CaseView.d.ts +4 -2
  39. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  40. package/lib/components/CaseView/CaseView.js +183 -68
  41. package/lib/components/CaseView/CaseView.js.map +1 -1
  42. package/lib/components/CaseView/CaseView.styles.d.ts +45 -19
  43. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  44. package/lib/components/CaseView/CaseView.styles.js +324 -66
  45. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  46. package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
  47. package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
  48. package/lib/components/CaseView/CaseView.test-ids.js +17 -0
  49. package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
  50. package/lib/components/CaseView/CaseView.types.d.ts +27 -34
  51. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  52. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  53. package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -1
  54. package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
  55. package/lib/components/CaseView/UtilitiesSummary.js +4 -8
  56. package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
  57. package/lib/components/CaseView/index.d.ts +0 -5
  58. package/lib/components/CaseView/index.d.ts.map +1 -1
  59. package/lib/components/CaseView/index.js +0 -4
  60. package/lib/components/CaseView/index.js.map +1 -1
  61. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +1 -3
  62. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
  63. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -1
  64. package/lib/components/Confirmation/Confirmation.d.ts +1 -1
  65. package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
  66. package/lib/components/Confirmation/Confirmation.js +2 -2
  67. package/lib/components/Confirmation/Confirmation.js.map +1 -1
  68. package/lib/components/Details/Details.d.ts.map +1 -1
  69. package/lib/components/Details/Details.js +25 -16
  70. package/lib/components/Details/Details.js.map +1 -1
  71. package/lib/components/Details/Details.styles.d.ts +6 -4
  72. package/lib/components/Details/Details.styles.d.ts.map +1 -1
  73. package/lib/components/Details/Details.styles.js +38 -101
  74. package/lib/components/Details/Details.styles.js.map +1 -1
  75. package/lib/components/Glimpse/Glimpse.d.ts +10 -10
  76. package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
  77. package/lib/components/Glimpse/Glimpse.js +7 -17
  78. package/lib/components/Glimpse/Glimpse.js.map +1 -1
  79. package/lib/components/Glimpse/index.d.ts +1 -1
  80. package/lib/components/Glimpse/index.d.ts.map +1 -1
  81. package/lib/components/Glimpse/index.js +0 -1
  82. package/lib/components/Glimpse/index.js.map +1 -1
  83. package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
  84. package/lib/components/IntelligentGuidance/IntelligentGuidance.js +39 -43
  85. package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
  86. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +3 -2
  87. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
  88. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +137 -81
  89. package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
  90. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +13 -9
  91. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -1
  92. package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -1
  93. package/lib/components/Predictions/Predictions.d.ts +6 -0
  94. package/lib/components/Predictions/Predictions.d.ts.map +1 -0
  95. package/lib/components/Predictions/Predictions.js +60 -0
  96. package/lib/components/Predictions/Predictions.js.map +1 -0
  97. package/lib/components/Predictions/Predictions.types.d.ts +23 -0
  98. package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
  99. package/lib/components/Predictions/Predictions.types.js +2 -0
  100. package/lib/components/Predictions/Predictions.types.js.map +1 -0
  101. package/lib/components/Predictions/index.d.ts +3 -0
  102. package/lib/components/Predictions/index.d.ts.map +1 -0
  103. package/lib/components/Predictions/index.js +2 -0
  104. package/lib/components/Predictions/index.js.map +1 -0
  105. package/lib/components/SearchResults/SearchResults.types.d.ts +5 -5
  106. package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
  107. package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
  108. package/lib/components/Stages/StageGlimpse.d.ts +0 -2
  109. package/lib/components/Stages/StageGlimpse.d.ts.map +1 -1
  110. package/lib/components/Stages/StageGlimpse.js +4 -4
  111. package/lib/components/Stages/StageGlimpse.js.map +1 -1
  112. package/lib/components/Stages/Stages.d.ts.map +1 -1
  113. package/lib/components/Stages/Stages.js +39 -58
  114. package/lib/components/Stages/Stages.js.map +1 -1
  115. package/lib/components/Stages/Stages.styles.d.ts +0 -2
  116. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  117. package/lib/components/Stages/Stages.styles.js +10 -18
  118. package/lib/components/Stages/Stages.styles.js.map +1 -1
  119. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
  120. package/lib/components/Stakeholders/Stakeholders.js +2 -2
  121. package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
  122. package/lib/components/Stakeholders/Stakeholders.types.d.ts +5 -13
  123. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -1
  124. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -1
  125. package/lib/components/Tags/Tags.d.ts +1 -1
  126. package/lib/components/Tags/Tags.d.ts.map +1 -1
  127. package/lib/components/Tags/Tags.js +5 -20
  128. package/lib/components/Tags/Tags.js.map +1 -1
  129. package/lib/components/Tasks/TaskList.d.ts +18 -7
  130. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  131. package/lib/components/Tasks/TaskList.js +48 -10
  132. package/lib/components/Tasks/TaskList.js.map +1 -1
  133. package/lib/components/Tasks/Tasks.d.ts +21 -15
  134. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  135. package/lib/components/Tasks/Tasks.js +9 -9
  136. package/lib/components/Tasks/Tasks.js.map +1 -1
  137. package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
  138. package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
  139. package/lib/components/Tasks/Tasks.test-ids.js +5 -0
  140. package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
  141. package/lib/components/Tasks/index.d.ts +3 -5
  142. package/lib/components/Tasks/index.d.ts.map +1 -1
  143. package/lib/components/Tasks/index.js +1 -0
  144. package/lib/components/Tasks/index.js.map +1 -1
  145. package/lib/components/Timeline/Timeline.d.ts.map +1 -1
  146. package/lib/components/Timeline/Timeline.js +14 -12
  147. package/lib/components/Timeline/Timeline.js.map +1 -1
  148. package/lib/components/Timeline/Timeline.styles.d.ts +4 -5
  149. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  150. package/lib/components/Timeline/Timeline.styles.js +34 -55
  151. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  152. package/lib/components/Timeline/Timeline.types.d.ts +8 -8
  153. package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
  154. package/lib/components/Timeline/Timeline.types.js.map +1 -1
  155. package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
  156. package/lib/components/Timeline/TimelineItem.js +19 -7
  157. package/lib/components/Timeline/TimelineItem.js.map +1 -1
  158. package/lib/components/Timeline/utils.d.ts +1 -0
  159. package/lib/components/Timeline/utils.d.ts.map +1 -1
  160. package/lib/components/Timeline/utils.js +12 -0
  161. package/lib/components/Timeline/utils.js.map +1 -1
  162. package/lib/index.d.ts +4 -0
  163. package/lib/index.d.ts.map +1 -1
  164. package/lib/index.js +4 -0
  165. package/lib/index.js.map +1 -1
  166. package/package.json +8 -6
  167. package/lib/components/CaseView/CaseHeader.d.ts.map +0 -1
  168. package/lib/components/CaseView/CaseHeader.js +0 -49
  169. package/lib/components/CaseView/CaseHeader.js.map +0 -1
  170. package/lib/components/CaseView/MobileCaseView.d.ts +0 -13
  171. package/lib/components/CaseView/MobileCaseView.d.ts.map +0 -1
  172. package/lib/components/CaseView/MobileCaseView.js +0 -25
  173. package/lib/components/CaseView/MobileCaseView.js.map +0 -1
  174. /package/lib/components/CaseView/{CaseHeader.d.ts → CaseHeader/CaseHeader.d.ts} +0 -0
@@ -1,65 +1,93 @@
1
- import styled, { css, keyframes } from 'styled-components';
2
- import { lighten } from 'polished';
3
- import { Button, defaultThemeProp, StyledButton, StyledCard, StyledFlex, StyledIcon, StyledEmptyState, SummaryList, StyledText, tryCatch, StyledSummaryItem, StyledVisual } from '@pega/cosmos-react-core';
4
- import { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';
1
+ import styled, { css } from 'styled-components';
2
+ import { lighten, readableColor, rgba, transparentize } from 'polished';
3
+ import { defaultThemeProp, StyledButton, StyledCard, StyledFlex, StyledIcon, StyledEmptyState, SummaryList, StyledText, tryCatch, StyledSummaryItem, StyledVisual, readableHue, Text, calculateFontSize, StyledSecondary } from '@pega/cosmos-react-core';
5
4
  import { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';
6
- import { StyledSummaryListContent } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';
5
+ import { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs';
6
+ import { StyledTab } from '@pega/cosmos-react-core/lib/components/Tabs/Tab';
7
+ import { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';
7
8
  const itemIconSize = '2rem';
9
+ export const StyledNew = styled(Text)(({ theme }) => {
10
+ const readableBackground = readableHue(theme.base.palette['brand-primary'], theme.base.palette['primary-background']);
11
+ const readableTextColor = readableColor(readableBackground);
12
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
13
+ return css `
14
+ position: absolute;
15
+ inset-block-start: 0;
16
+ inset-inline-start: 0;
17
+ text-transform: uppercase;
18
+ background-color: ${readableBackground};
19
+ color: ${readableTextColor};
20
+ padding-inline: calc(0.75 * ${theme.base.spacing});
21
+ font-size: ${fontSize.xxs};
22
+ font-weight: ${theme.base['font-weight']['semi-bold']};
23
+ `;
24
+ });
25
+ StyledNew.defaultProps = defaultThemeProp;
26
+ export const StyledBorderLine = styled.span(({ theme }) => {
27
+ const readableBackground = readableHue(theme.base.palette['brand-primary'], theme.base.palette['primary-background']);
28
+ return css `
29
+ position: absolute;
30
+ inset-block-start: 0;
31
+ inset-inline-start: 0;
32
+ content: '';
33
+ background-color: ${readableBackground};
34
+ height: 100%;
35
+ width: 0.125rem;
36
+ `;
37
+ });
38
+ StyledBorderLine.defaultProps = defaultThemeProp;
8
39
  export const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) => {
40
+ const color = theme.base.palette.light;
9
41
  const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
10
42
  const hoverColor = tryCatch(() => lighten(0.05, theme.components['app-shell'].nav['background-color']));
43
+ const secondaryColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-2']));
44
+ const scrollbarColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-3']));
11
45
  return css `
12
- min-width: 20rem;
13
- max-width: 20rem;
14
- color: ${theme.base.palette.light};
15
- overflow: hidden;
16
- box-shadow: ${theme.base.shadow.low};
17
- @media (min-width: ${theme.base.breakpoints.lg}) {
18
- min-width: 23rem;
19
- max-width: 23rem;
20
- }
21
- &:not(& &) {
22
- background-color: ${theme.components['app-shell'].nav['background-color']};
23
- }
24
- ${StyledCardHeader} {
25
- &:not(${StyledCard} ${StyledCard} > &) {
26
- padding: ${theme.base.spacing};
27
- }
28
- ${StyledFlex} > ${StyledIcon} {
29
- width: ${itemIconSize};
30
- height: ${itemIconSize};
31
- padding: calc(0.75 * ${theme.base.spacing});
32
- border-radius: calc(3 * ${theme.base['border-radius']});
33
- background-color: ${theme.base.palette.success};
34
- }
35
- }
36
- ${StyledSummaryListContent} {
37
- &:not(${StyledCard} ${StyledCard} > &) {
38
- padding: 0;
39
- }
46
+ max-height: min(calc(100vh - var(--headerHeight) - 4ch), 21ch);
47
+ overflow: auto;
48
+
49
+ ::-webkit-scrollbar-thumb {
50
+ box-shadow: inset 0 0 0.125rem 0.25rem ${scrollbarColor};
40
51
  }
41
- ${StyledButton}:enabled:focus {
42
- box-shadow: ${theme.base.shadow.focus};
52
+
53
+ ::-webkit-scrollbar-thumb:hover {
54
+ box-shadow: inset 0 0 0.125rem 0.25rem ${secondaryColor};
43
55
  }
56
+
57
+ ${theme.base.animation.timing.ease};
58
+
44
59
  ${StyledSummaryItem} {
60
+ position: relative;
45
61
  padding: ${theme.base.spacing};
46
- border-top: ${theme.components.button['border-width']} solid ${borderColor};
47
62
  outline: none;
63
+
64
+ &:not(:first-of-type) {
65
+ border-top: ${theme.components.button['border-width']} solid ${borderColor};
66
+ }
67
+
48
68
  ${StyledVisual} ${StyledIcon} {
49
69
  width: ${itemIconSize};
50
70
  height: ${itemIconSize};
51
71
  padding: calc(0.75 * ${theme.base.spacing});
52
72
  }
73
+
53
74
  ${StyledButton} {
54
75
  visibility: hidden;
55
76
  }
77
+
78
+ ${StyledSecondary} ${StyledText} {
79
+ color: ${secondaryColor};
80
+ }
81
+
56
82
  &:not(:last-child) {
57
83
  border-bottom: none;
58
84
  }
85
+
59
86
  &:hover {
60
87
  background-color: ${hoverColor};
61
88
  cursor: pointer;
62
89
  }
90
+
63
91
  &:hover,
64
92
  &:focus,
65
93
  &:focus-within {
@@ -72,70 +100,98 @@ export const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) =>
72
100
  box-shadow: ${theme.base.shadow['focus-inset']};
73
101
  }
74
102
  }
103
+
75
104
  ${StyledEmptyState} {
76
- padding-bottom: ${theme.base.spacing};
105
+ padding-block: ${theme.base.spacing};
77
106
  ${StyledIcon}, ${StyledText} {
78
- color: ${theme.base.palette.light};
107
+ color: ${color};
79
108
  }
80
109
  }
81
110
  `;
82
111
  });
83
112
  StyledIntelligentGuidanceList.defaultProps = defaultThemeProp;
84
- export const StyledIntelligentGuidanceButton = styled(Button)(({ theme }) => {
85
- return css `
86
- box-shadow: ${theme.base.shadow.low};
87
- color: ${theme.base.palette.light};
88
- background-color: ${theme.base.palette.success};
89
- width: 4rem;
90
- height: 4rem;
91
- svg {
92
- width: 2.25rem;
93
- height: 2.25rem;
94
- }
95
- ${StyledCount} {
96
- position: absolute;
97
- right: 0;
98
- top: 0;
99
- }
100
- `;
101
- });
102
- StyledIntelligentGuidanceButton.defaultProps = defaultThemeProp;
103
- const slideIn = keyframes `
104
- 0% {
105
- transform: translateY(100%);
106
- }
107
- 100% {
108
- transform: translateY(0);
109
- }
110
- `;
111
- export const StyledIntelligentGuidance = styled.div(({ theme, isCollapsed }) => {
113
+ export const StyledIntelligentGuidance = styled(StyledCard)(({ theme, isCollapsed }) => {
114
+ const color = theme.base.palette.light;
115
+ const borderColor = tryCatch(() => lighten(0.1, theme.components['app-shell'].nav['background-color']));
116
+ const tabPrimaryColor = theme.base.colors.blue.light;
117
+ const lightenedTabColor = tryCatch(() => transparentize(0.3, tabPrimaryColor)) ?? '';
112
118
  return css `
113
119
  position: fixed;
114
120
  inset-inline-start: calc(2 * ${theme.base.spacing} + var(--appshell-horizontal-offset, 0rem));
115
121
  transition: inset-inline-start ${theme.base.animation.speed}
116
- ${theme.base.animation.timing.ease};
117
- bottom: ${isCollapsed ? `calc(2 * ${theme.base.spacing}) ` : 0};
118
- @media (min-width: ${theme.base.breakpoints.md}) {
119
- bottom: 0;
120
- }
122
+ ${theme.base.animation.timing.ease},
123
+ transform calc(4 * ${theme.base.animation.speed}) ${theme.base.animation.timing.ease};
124
+ bottom: 0;
121
125
  z-index: ${theme.base['z-index'].popover};
122
- ${StyledIntelligentGuidanceList}:not(${StyledIntelligentGuidanceList} ${StyledIntelligentGuidanceList}) {
126
+ min-width: 20rem;
127
+ max-width: 20rem;
128
+ color: ${color};
129
+ overflow: hidden;
130
+ box-shadow: ${theme.base.shadow.low};
131
+
132
+ @media (min-width: ${theme.base.breakpoints.lg}) {
133
+ min-width: 23rem;
134
+ max-width: 23rem;
135
+ }
136
+
137
+ ${isCollapsed &&
138
+ css `
139
+ transform: translateY(calc(100% - var(--headerHeight)));
140
+ `}
141
+
142
+ &:not(& &) {
143
+ background-color: ${theme.components['app-shell'].nav['background-color']};
123
144
  border-bottom-left-radius: 0;
124
145
  border-bottom-right-radius: 0;
125
- transition: transform calc(4 * ${theme.base.animation.speed})
126
- ${theme.base.animation.timing.ease};
127
- ${isCollapsed &&
128
- css `
129
- transform: translateY(calc(100% - var(--headerHeight)));
130
- `}
131
- ${StyledCardHeader} ${StyledButton} {
146
+ }
147
+ ${StyledCardHeader} {
148
+ & ${StyledButton} {
132
149
  transition: transform calc(2 * ${theme.base.animation.speed})
133
150
  ${theme.base.animation.timing.ease};
134
151
  transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};
135
152
  }
153
+
154
+ &:not(${StyledCard} ${StyledCard} > &) {
155
+ padding: ${theme.base.spacing};
156
+ }
157
+
158
+ ${StyledFlex} > ${StyledIcon} {
159
+ width: ${itemIconSize};
160
+ height: ${itemIconSize};
161
+ padding: calc(0.75 * ${theme.base.spacing});
162
+ border-radius: calc(3 * ${theme.base['border-radius']});
163
+ background-color: ${theme.base.palette.success};
164
+ }
165
+ }
166
+
167
+ ${StyledTabs} {
168
+ padding-inline: ${theme.base.spacing};
169
+ border-block: 0.0625rem solid ${borderColor};
170
+ ${StyledTab} {
171
+ flex: 1;
172
+ justify-content: center;
173
+ ${StyledCount} {
174
+ background-color: ${theme.base.palette.urgent};
175
+ }
176
+ span {
177
+ color: ${color};
178
+ }
179
+ ::after {
180
+ background-color: ${lightenedTabColor};
181
+ }
182
+ &[aria-selected='true'] {
183
+ span:not(${StyledCount}) {
184
+ color: ${tabPrimaryColor};
185
+ }
186
+ ::after {
187
+ background-color: ${tabPrimaryColor};
188
+ }
189
+ }
190
+ }
136
191
  }
137
- ${StyledIntelligentGuidanceButton} {
138
- animation: ${slideIn} calc(4 * ${theme.base.animation.speed});
192
+
193
+ ${StyledButton}:enabled:focus {
194
+ box-shadow: ${theme.base.shadow.focus};
139
195
  }
140
196
  `;
141
197
  });
@@ -1 +1 @@
1
- {"version":3,"file":"IntelligentGuidance.styles.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,gEAAgE,CAAC;AAE1G,MAAM,YAAY,GAAG,MAAM,CAAC;AAE5B,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,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,6BAA6B,IAAI,6BAA6B;;;yCAGlE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;YACvD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;UAClC,WAAW;QACb,GAAG,CAAA;;SAEF;UACC,gBAAgB,IAAI,YAAY;2CACC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;cACvD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;uBACvB,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW;;;QAG5D,+BAA+B;qBAClB,OAAO,aAAa,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;;KAE9D,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css, keyframes } from 'styled-components';\nimport { lighten } from 'polished';\n\nimport {\n Button,\n defaultThemeProp,\n StyledButton,\n StyledCard,\n StyledFlex,\n StyledIcon,\n StyledEmptyState,\n SummaryList,\n StyledText,\n tryCatch,\n StyledSummaryItem,\n StyledVisual\n} from '@pega/cosmos-react-core';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledSummaryListContent } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';\n\nconst itemIconSize = '2rem';\n\nexport const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) => {\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const hoverColor = tryCatch(() =>\n lighten(0.05, theme.components['app-shell'].nav['background-color'])\n );\n return css`\n min-width: 20rem;\n max-width: 20rem;\n color: ${theme.base.palette.light};\n overflow: hidden;\n box-shadow: ${theme.base.shadow.low};\n @media (min-width: ${theme.base.breakpoints.lg}) {\n min-width: 23rem;\n max-width: 23rem;\n }\n &:not(& &) {\n background-color: ${theme.components['app-shell'].nav['background-color']};\n }\n ${StyledCardHeader} {\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing};\n }\n ${StyledFlex} > ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n border-radius: calc(3 * ${theme.base['border-radius']});\n background-color: ${theme.base.palette.success};\n }\n }\n ${StyledSummaryListContent} {\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: 0;\n }\n }\n ${StyledButton}:enabled:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n ${StyledSummaryItem} {\n padding: ${theme.base.spacing};\n border-top: ${theme.components.button['border-width']} solid ${borderColor};\n outline: none;\n ${StyledVisual} ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n }\n ${StyledButton} {\n visibility: hidden;\n }\n &:not(:last-child) {\n border-bottom: none;\n }\n &:hover {\n background-color: ${hoverColor};\n cursor: pointer;\n }\n &:hover,\n &:focus,\n &:focus-within {\n ${StyledButton} {\n visibility: visible;\n }\n }\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n ${StyledEmptyState} {\n padding-bottom: ${theme.base.spacing};\n ${StyledIcon}, ${StyledText} {\n color: ${theme.base.palette.light};\n }\n }\n `;\n});\n\nStyledIntelligentGuidanceList.defaultProps = defaultThemeProp;\n\nexport const StyledIntelligentGuidanceButton = styled(Button)(({ theme }) => {\n return css`\n box-shadow: ${theme.base.shadow.low};\n color: ${theme.base.palette.light};\n background-color: ${theme.base.palette.success};\n width: 4rem;\n height: 4rem;\n svg {\n width: 2.25rem;\n height: 2.25rem;\n }\n ${StyledCount} {\n position: absolute;\n right: 0;\n top: 0;\n }\n `;\n});\n\nStyledIntelligentGuidanceButton.defaultProps = defaultThemeProp;\n\nconst slideIn = keyframes`\n 0% {\n transform: translateY(100%);\n }\n 100% {\n transform: translateY(0);\n }\n`;\n\nexport interface StyledIntelligentGuidanceProps {\n isCollapsed: boolean;\n hasItems: boolean;\n}\n\nexport const StyledIntelligentGuidance = styled.div<StyledIntelligentGuidanceProps>(\n ({ theme, isCollapsed }) => {\n return css`\n position: fixed;\n inset-inline-start: calc(2 * ${theme.base.spacing} + var(--appshell-horizontal-offset, 0rem));\n transition: inset-inline-start ${theme.base.animation.speed}\n ${theme.base.animation.timing.ease};\n bottom: ${isCollapsed ? `calc(2 * ${theme.base.spacing}) ` : 0};\n @media (min-width: ${theme.base.breakpoints.md}) {\n bottom: 0;\n }\n z-index: ${theme.base['z-index'].popover};\n ${StyledIntelligentGuidanceList}:not(${StyledIntelligentGuidanceList} ${StyledIntelligentGuidanceList}) {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n transition: transform calc(4 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n ${isCollapsed &&\n css`\n transform: translateY(calc(100% - var(--headerHeight)));\n `}\n ${StyledCardHeader} ${StyledButton} {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};\n }\n }\n ${StyledIntelligentGuidanceButton} {\n animation: ${slideIn} calc(4 * ${theme.base.animation.speed});\n }\n `;\n }\n);\n\nStyledIntelligentGuidance.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"IntelligentGuidance.styles.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExE,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,WAA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from 'styled-components';\nimport { lighten, readableColor, rgba, transparentize } from 'polished';\n\nimport {\n defaultThemeProp,\n StyledButton,\n StyledCard,\n StyledFlex,\n StyledIcon,\n StyledEmptyState,\n SummaryList,\n StyledText,\n tryCatch,\n StyledSummaryItem,\n StyledVisual,\n readableHue,\n Text,\n calculateFontSize,\n StyledSecondary\n} from '@pega/cosmos-react-core';\nimport { StyledCardHeader } from '@pega/cosmos-react-core/lib/components/Card/CardHeader';\nimport { StyledTabs } from '@pega/cosmos-react-core/lib/components/Tabs/Tabs';\nimport { StyledTab } from '@pega/cosmos-react-core/lib/components/Tabs/Tab';\nimport { StyledCount } from '@pega/cosmos-react-core/lib/components/Badges/Count';\n\nconst itemIconSize = '2rem';\n\nexport const StyledNew = styled(Text)(({ theme }) => {\n const readableBackground = readableHue(\n theme.base.palette['brand-primary'],\n theme.base.palette['primary-background']\n );\n const readableTextColor = readableColor(readableBackground);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n text-transform: uppercase;\n background-color: ${readableBackground};\n color: ${readableTextColor};\n padding-inline: calc(0.75 * ${theme.base.spacing});\n font-size: ${fontSize.xxs};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledNew.defaultProps = defaultThemeProp;\n\nexport const StyledBorderLine = styled.span(({ theme }) => {\n const readableBackground = readableHue(\n theme.base.palette['brand-primary'],\n theme.base.palette['primary-background']\n );\n\n return css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n content: '';\n background-color: ${readableBackground};\n height: 100%;\n width: 0.125rem;\n `;\n});\n\nStyledBorderLine.defaultProps = defaultThemeProp;\n\nexport const StyledIntelligentGuidanceList = styled(SummaryList)(({ theme }) => {\n const color = theme.base.palette.light;\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const hoverColor = tryCatch(() =>\n lighten(0.05, theme.components['app-shell'].nav['background-color'])\n );\n const secondaryColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-2']));\n const scrollbarColor = tryCatch(() => rgba(color, theme.base.transparency['transparent-3']));\n\n return css`\n max-height: min(calc(100vh - var(--headerHeight) - 4ch), 21ch);\n overflow: auto;\n\n ::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 0.125rem 0.25rem ${scrollbarColor};\n }\n\n ::-webkit-scrollbar-thumb:hover {\n box-shadow: inset 0 0 0.125rem 0.25rem ${secondaryColor};\n }\n\n ${theme.base.animation.timing.ease};\n\n ${StyledSummaryItem} {\n position: relative;\n padding: ${theme.base.spacing};\n outline: none;\n\n &:not(:first-of-type) {\n border-top: ${theme.components.button['border-width']} solid ${borderColor};\n }\n\n ${StyledVisual} ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n }\n\n ${StyledButton} {\n visibility: hidden;\n }\n\n ${StyledSecondary} ${StyledText} {\n color: ${secondaryColor};\n }\n\n &:not(:last-child) {\n border-bottom: none;\n }\n\n &:hover {\n background-color: ${hoverColor};\n cursor: pointer;\n }\n\n &:hover,\n &:focus,\n &:focus-within {\n ${StyledButton} {\n visibility: visible;\n }\n }\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${theme.base.shadow['focus-inset']};\n }\n }\n\n ${StyledEmptyState} {\n padding-block: ${theme.base.spacing};\n ${StyledIcon}, ${StyledText} {\n color: ${color};\n }\n }\n `;\n});\n\nStyledIntelligentGuidanceList.defaultProps = defaultThemeProp;\n\nexport interface StyledIntelligentGuidanceProps {\n isCollapsed: boolean;\n hasItems: boolean;\n}\n\nexport const StyledIntelligentGuidance = styled(StyledCard)<StyledIntelligentGuidanceProps>(\n ({ theme, isCollapsed }) => {\n const color = theme.base.palette.light;\n const borderColor = tryCatch(() =>\n lighten(0.1, theme.components['app-shell'].nav['background-color'])\n );\n const tabPrimaryColor = theme.base.colors.blue.light;\n const lightenedTabColor = tryCatch(() => transparentize(0.3, tabPrimaryColor)) ?? '';\n\n return css`\n position: fixed;\n inset-inline-start: calc(2 * ${theme.base.spacing} + var(--appshell-horizontal-offset, 0rem));\n transition: inset-inline-start ${theme.base.animation.speed}\n ${theme.base.animation.timing.ease},\n transform calc(4 * ${theme.base.animation.speed}) ${theme.base.animation.timing.ease};\n bottom: 0;\n z-index: ${theme.base['z-index'].popover};\n min-width: 20rem;\n max-width: 20rem;\n color: ${color};\n overflow: hidden;\n box-shadow: ${theme.base.shadow.low};\n\n @media (min-width: ${theme.base.breakpoints.lg}) {\n min-width: 23rem;\n max-width: 23rem;\n }\n\n ${isCollapsed &&\n css`\n transform: translateY(calc(100% - var(--headerHeight)));\n `}\n\n &:not(& &) {\n background-color: ${theme.components['app-shell'].nav['background-color']};\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n ${StyledCardHeader} {\n & ${StyledButton} {\n transition: transform calc(2 * ${theme.base.animation.speed})\n ${theme.base.animation.timing.ease};\n transform: ${isCollapsed ? 'rotate(-180deg)' : 'rotate(0)'};\n }\n\n &:not(${StyledCard} ${StyledCard} > &) {\n padding: ${theme.base.spacing};\n }\n\n ${StyledFlex} > ${StyledIcon} {\n width: ${itemIconSize};\n height: ${itemIconSize};\n padding: calc(0.75 * ${theme.base.spacing});\n border-radius: calc(3 * ${theme.base['border-radius']});\n background-color: ${theme.base.palette.success};\n }\n }\n\n ${StyledTabs} {\n padding-inline: ${theme.base.spacing};\n border-block: 0.0625rem solid ${borderColor};\n ${StyledTab} {\n flex: 1;\n justify-content: center;\n ${StyledCount} {\n background-color: ${theme.base.palette.urgent};\n }\n span {\n color: ${color};\n }\n ::after {\n background-color: ${lightenedTabColor};\n }\n &[aria-selected='true'] {\n span:not(${StyledCount}) {\n color: ${tabPrimaryColor};\n }\n ::after {\n background-color: ${tabPrimaryColor};\n }\n }\n }\n }\n\n ${StyledButton}:enabled:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n }\n);\n\nStyledIntelligentGuidance.defaultProps = defaultThemeProp;\n"]}
@@ -5,26 +5,30 @@ export interface IntelligentGuidanceItemProps {
5
5
  id: string;
6
6
  /** The label text of the item. */
7
7
  label: string;
8
- /**
9
- * Name of the icon (to be selected from default Pega icon set)
10
- */
8
+ /** Name of the icon (to be selected from default Pega icon set) */
11
9
  icon: IconProps['name'];
12
10
  /** Represents the type of task */
13
11
  type: string;
14
- /**
15
- * Click handler for the action button.
16
- */
12
+ /** Click handler for the action button. */
17
13
  onClick: (e: MouseEvent | KeyboardEvent) => void;
18
- /**
19
- * Dismiss handler for the action button.
20
- */
14
+ /** Dismiss handler for the action button. */
21
15
  onDismiss?: (id: IntelligentGuidanceItemProps['id'], e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>) => void;
16
+ /** Flag that indicates if item is new
17
+ * @default false
18
+ */
19
+ new?: boolean;
22
20
  }
23
21
  export default interface IntelligentGuidanceProps extends BaseProps, NoChildrenProp {
24
22
  /** List of guidance items. */
25
23
  items: IntelligentGuidanceItemProps[];
24
+ /** List of guidance previous items. */
25
+ previousItems?: IntelligentGuidanceItemProps[];
26
26
  /** Header text. */
27
27
  heading: string;
28
+ /** Flag that indicates if intelligent guidance is collapsed */
29
+ isCollapsed: boolean;
30
+ /** Callback when expand/collapse button is clicked */
31
+ onExpandCollapse: () => void;
28
32
  /** Ref for the wrapping element. */
29
33
  ref?: Ref<HTMLDivElement>;
30
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IntelligentGuidance.types.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC3C,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;IACjD;;OAEG;IACH,SAAS,CAAC,EAAE,CACV,EAAE,EAAE,4BAA4B,CAAC,IAAI,CAAC,EACtC,CAAC,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC,KACpE,IAAI,CAAC;CACX;AAED,MAAM,CAAC,OAAO,WAAW,wBAAyB,SAAQ,SAAS,EAAE,cAAc;IACjF,8BAA8B;IAC9B,KAAK,EAAE,4BAA4B,EAAE,CAAC;IACtC,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
1
+ {"version":3,"file":"IntelligentGuidance.types.d.ts","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IAC3C,yBAAyB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACxB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,aAAa,KAAK,IAAI,CAAC;IACjD,6CAA6C;IAC7C,SAAS,CAAC,EAAE,CACV,EAAE,EAAE,4BAA4B,CAAC,IAAI,CAAC,EACtC,CAAC,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC,KACpE,IAAI,CAAC;IACV;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,CAAC,OAAO,WAAW,wBAAyB,SAAQ,SAAS,EAAE,cAAc;IACjF,8BAA8B;IAC9B,KAAK,EAAE,4BAA4B,EAAE,CAAC;IACtC,uCAAuC;IACvC,aAAa,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC/C,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"IntelligentGuidance.types.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, KeyboardEvent, Ref } from 'react';\n\nimport { BaseProps, IconProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface IntelligentGuidanceItemProps {\n /** Unique id for item */\n id: string;\n /** The label text of the item. */\n label: string;\n /**\n * Name of the icon (to be selected from default Pega icon set)\n */\n icon: IconProps['name'];\n /** Represents the type of task */\n type: string;\n /**\n * Click handler for the action button.\n */\n onClick: (e: MouseEvent | KeyboardEvent) => void;\n /**\n * Dismiss handler for the action button.\n */\n onDismiss?: (\n id: IntelligentGuidanceItemProps['id'],\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n}\n\nexport default interface IntelligentGuidanceProps extends BaseProps, NoChildrenProp {\n /** List of guidance items. */\n items: IntelligentGuidanceItemProps[];\n /** Header text. */\n heading: string;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
1
+ {"version":3,"file":"IntelligentGuidance.types.js","sourceRoot":"","sources":["../../../src/components/IntelligentGuidance/IntelligentGuidance.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, KeyboardEvent, Ref } from 'react';\n\nimport { BaseProps, IconProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface IntelligentGuidanceItemProps {\n /** Unique id for item */\n id: string;\n /** The label text of the item. */\n label: string;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon: IconProps['name'];\n /** Represents the type of task */\n type: string;\n /** Click handler for the action button. */\n onClick: (e: MouseEvent | KeyboardEvent) => void;\n /** Dismiss handler for the action button. */\n onDismiss?: (\n id: IntelligentGuidanceItemProps['id'],\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n /** Flag that indicates if item is new\n * @default false\n */\n new?: boolean;\n}\n\nexport default interface IntelligentGuidanceProps extends BaseProps, NoChildrenProp {\n /** List of guidance items. */\n items: IntelligentGuidanceItemProps[];\n /** List of guidance previous items. */\n previousItems?: IntelligentGuidanceItemProps[];\n /** Header text. */\n heading: string;\n /** Flag that indicates if intelligent guidance is collapsed */\n isCollapsed: boolean;\n /** Callback when expand/collapse button is clicked */\n onExpandCollapse: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import PredictionsProps from './Predictions.types';
4
+ declare const Predictions: FunctionComponent<PredictionsProps & ForwardProps>;
5
+ export default Predictions;
6
+ //# sourceMappingURL=Predictions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Predictions.d.ts","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,YAAY,EAYb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,gBAAoC,MAAM,qBAAqB,CAAC;AAsFvE,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAqCnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
3
+ import { registerIcon, useI18n, Modal, useModalManager, InfoDialog, StyledLabel, Text, SummaryList } from '@pega/cosmos-react-core';
4
+ import * as polarisIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris.icon';
5
+ import * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';
6
+ registerIcon(polarisIcon, informationIcon);
7
+ const PredictionsList = forwardRef(({ items: itemsProp, progress, ...restProps }, ref) => {
8
+ const t = useI18n();
9
+ const [currentItemIdTarget, setCurrentItemIdTarget] = useState();
10
+ const currentItem = itemsProp?.find(({ id }) => id === currentItemIdTarget?.id);
11
+ const items = useMemo(() => (itemsProp ?? []).map(item => ({
12
+ id: item.id,
13
+ primary: _jsx(StyledLabel, { forwardedAs: 'span', children: item.label }),
14
+ secondary: (_jsx(Text, { variant: 'h1', as: 'span', children: item.value })),
15
+ overflowStrategy: 'ellipsis',
16
+ actions: item.additionalInfo
17
+ ? [
18
+ {
19
+ id: item.id,
20
+ text: t('learn_more'),
21
+ icon: 'information',
22
+ onClick: (id, e) => {
23
+ setCurrentItemIdTarget({
24
+ id: item.id,
25
+ target: e.currentTarget
26
+ });
27
+ }
28
+ }
29
+ ]
30
+ : undefined
31
+ })), [itemsProp]);
32
+ return (_jsxs(_Fragment, { children: [_jsx(SummaryList, { ...restProps, loading: progress, ref: ref, items: items }), currentItemIdTarget && currentItem?.additionalInfo && (_jsx(InfoDialog, { heading: currentItem.label, target: currentItemIdTarget.target, onDismiss: () => {
33
+ setCurrentItemIdTarget(undefined);
34
+ }, children: currentItem.additionalInfo }))] }));
35
+ });
36
+ const PredictionsViewAllModal = ({ count, progress, ...restProps }) => {
37
+ const t = useI18n();
38
+ return (_jsx(Modal, { heading: t('all_predictions'), count: count, progress: progress, children: _jsx(PredictionsList, { ...restProps }) }));
39
+ };
40
+ const Predictions = forwardRef(({ count, items, progress, ...restProps }, ref) => {
41
+ const t = useI18n();
42
+ const { create } = useModalManager();
43
+ const viewAllModalRef = useRef();
44
+ useEffect(() => {
45
+ viewAllModalRef.current?.update({
46
+ items,
47
+ progress,
48
+ count
49
+ });
50
+ }, [items, progress, count]);
51
+ return (_jsx(PredictionsList, { ...restProps, ref: ref, name: t('predictions'), headingTag: 'h3', icon: 'polaris', count: count, items: items?.slice(0, 3), progress: progress, onViewAll: () => {
52
+ viewAllModalRef.current = create(PredictionsViewAllModal, {
53
+ items,
54
+ progress,
55
+ count
56
+ });
57
+ } }));
58
+ });
59
+ export default Predictions;
60
+ //# sourceMappingURL=Predictions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Predictions.js","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAIV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,YAAY,EACZ,OAAO,EACP,KAAK,EAEL,eAAe,EAEf,UAAU,EAEV,WAAW,EACX,IAAI,EACJ,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,WAAW,MAAM,gEAAgE,CAAC;AAC9F,OAAO,KAAK,eAAe,MAAM,oEAAoE,CAAC;AAItG,YAAY,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AAE3C,MAAM,eAAe,GAEjB,UAAU,CACZ,CACE,EACE,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,GAAG,SAAS,EAC8E,EAC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C,SAAS,EACd,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EACzB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,EAAE;YACd,eAAe,CAAC,OAAO,GAAG,MAAM,CAAC,uBAAuB,EAAE;gBACxD,KAAK;gBACL,QAAQ;gBACR,KAAK;aACN,CAAC,CAAC;QACL,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n FunctionComponent,\n MouseEvent,\n PropsWithoutRef,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\n\nimport {\n ForwardProps,\n registerIcon,\n useI18n,\n Modal,\n SummaryListProps,\n useModalManager,\n SummaryListItem,\n InfoDialog,\n ModalMethods,\n StyledLabel,\n Text,\n SummaryList\n} from '@pega/cosmos-react-core';\nimport * as polarisIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris.icon';\nimport * as informationIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/information.icon';\n\nimport PredictionsProps, { PredictionItem } from './Predictions.types';\n\nregisterIcon(polarisIcon, informationIcon);\n\nconst PredictionsList: FC<\n PredictionsProps & Pick<SummaryListProps, 'onViewAll' | 'name' | 'icon'> & ForwardProps\n> = forwardRef(\n (\n {\n items: itemsProp,\n progress,\n ...restProps\n }: PropsWithoutRef<PredictionsProps & Pick<SummaryListProps, 'onViewAll' | 'name' | 'icon'>>,\n ref: PredictionsProps['ref']\n ) => {\n const t = useI18n();\n const [currentItemIdTarget, setCurrentItemIdTarget] = useState<\n | {\n id: PredictionItem['id'];\n target: HTMLButtonElement | HTMLAnchorElement | HTMLInputElement;\n }\n | undefined\n >();\n const currentItem = itemsProp?.find(({ id }) => id === currentItemIdTarget?.id);\n\n const items: SummaryListItem[] = useMemo(\n () =>\n (itemsProp ?? []).map(item => ({\n id: item.id,\n primary: <StyledLabel forwardedAs='span'>{item.label}</StyledLabel>,\n secondary: (\n <Text variant='h1' as='span'>\n {item.value}\n </Text>\n ),\n overflowStrategy: 'ellipsis',\n actions: item.additionalInfo\n ? [\n {\n id: item.id,\n text: t('learn_more'),\n icon: 'information',\n onClick: (\n id: string,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => {\n setCurrentItemIdTarget({\n id: item.id,\n target: e.currentTarget\n });\n }\n }\n ]\n : undefined\n })),\n [itemsProp]\n );\n\n return (\n <>\n <SummaryList {...restProps} loading={progress} ref={ref} items={items} />\n {currentItemIdTarget && currentItem?.additionalInfo && (\n <InfoDialog\n heading={currentItem.label}\n target={currentItemIdTarget.target}\n onDismiss={() => {\n setCurrentItemIdTarget(undefined);\n }}\n >\n {currentItem.additionalInfo}\n </InfoDialog>\n )}\n </>\n );\n }\n);\n\nconst PredictionsViewAllModal = ({ count, progress, ...restProps }: PredictionsProps) => {\n const t = useI18n();\n return (\n <Modal heading={t('all_predictions')} count={count} progress={progress}>\n <PredictionsList {...restProps} />\n </Modal>\n );\n};\n\nconst Predictions: FunctionComponent<PredictionsProps & ForwardProps> = forwardRef(\n (\n { count, items, progress, ...restProps }: PropsWithoutRef<PredictionsProps>,\n ref: PredictionsProps['ref']\n ) => {\n const t = useI18n();\n const { create } = useModalManager();\n const viewAllModalRef = useRef<ModalMethods<PredictionsProps>>();\n\n useEffect(() => {\n viewAllModalRef.current?.update({\n items,\n progress,\n count\n });\n }, [items, progress, count]);\n\n return (\n <PredictionsList\n {...restProps}\n ref={ref}\n name={t('predictions')}\n headingTag='h3'\n icon='polaris'\n count={count}\n items={items?.slice(0, 3)}\n progress={progress}\n onViewAll={() => {\n viewAllModalRef.current = create(PredictionsViewAllModal, {\n items,\n progress,\n count\n });\n }}\n />\n );\n }\n);\n\nexport default Predictions;\n"]}
@@ -0,0 +1,23 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ import { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';
3
+ export interface PredictionItem {
4
+ /** A unique id to represent the item. */
5
+ id: string;
6
+ /** Label for the prediction item. */
7
+ label: string;
8
+ /** Value for the prediction item. */
9
+ value: string;
10
+ /** Additional prediction information rendered in a dialog. */
11
+ additionalInfo?: ReactNode;
12
+ }
13
+ export default interface PredictionsProps extends BaseProps, NoChildrenProp {
14
+ /** Integer representing the total count of items. */
15
+ count?: number;
16
+ /** An array of PredictionItem objects to render. Pass an appropriately limited length array with a desired sort order based on design system defaults or config. */
17
+ items?: PredictionItem[];
18
+ /** Show a progress indicator when initially fetching list data. */
19
+ progress?: boolean;
20
+ /** Ref for the wrapping element. */
21
+ ref?: Ref<HTMLDivElement>;
22
+ }
23
+ //# sourceMappingURL=Predictions.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Predictions.types.d.ts","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,cAAc,CAAC,EAAE,SAAS,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACzE,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oKAAoK;IACpK,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Predictions.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Predictions.types.js","sourceRoot":"","sources":["../../../src/components/Predictions/Predictions.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref } from 'react';\n\nimport { BaseProps, NoChildrenProp } from '@pega/cosmos-react-core';\n\nexport interface PredictionItem {\n /** A unique id to represent the item. */\n id: string;\n /** Label for the prediction item. */\n label: string;\n /** Value for the prediction item. */\n value: string;\n /** Additional prediction information rendered in a dialog. */\n additionalInfo?: ReactNode;\n}\n\nexport default interface PredictionsProps extends BaseProps, NoChildrenProp {\n /** Integer representing the total count of items. */\n count?: number;\n /** An array of PredictionItem objects to render. Pass an appropriately limited length array with a desired sort order based on design system defaults or config. */\n items?: PredictionItem[];\n /** Show a progress indicator when initially fetching list data. */\n progress?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './Predictions';
2
+ export { default as PredictionsProps } from './Predictions.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Predictions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './Predictions';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Predictions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { default } from './Predictions';\nexport { default as PredictionsProps } from './Predictions.types';\n"]}
@@ -26,7 +26,7 @@ export interface SelectFilterProps extends BaseFilterProps {
26
26
  items: SelectFilterItemProps[];
27
27
  /**
28
28
  * Determines if the filter will render as a RadioButtonGroup or CheckboxGroup.
29
- * @default "multi-select"
29
+ * @default 'multi-select'
30
30
  */
31
31
  selectType?: 'single-select' | 'multi-select';
32
32
  }
@@ -46,12 +46,12 @@ export interface TextFilterProps extends BaseFilterProps {
46
46
  value?: string;
47
47
  /**
48
48
  * Placeholder text. The default value is a locale translation of 'Search…'
49
- * @default "Search…"
49
+ * @default 'Search…'
50
50
  */
51
51
  placeholder?: string;
52
52
  }
53
- export declare type FilterProps = SelectFilterProps;
54
- export declare type ActiveFilters = ActiveSelectFilter;
53
+ export type FilterProps = SelectFilterProps;
54
+ export type ActiveFilters = ActiveSelectFilter;
55
55
  export interface SearchResultProps {
56
56
  /** The id of the search result to be displayed. */
57
57
  id: string;
@@ -73,7 +73,7 @@ interface SelectFilterEvent extends BaseFilterEvent {
73
73
  type: 'select';
74
74
  value: SelectFilterItemProps;
75
75
  }
76
- export declare type FilterEvent = SelectFilterEvent;
76
+ export type FilterEvent = SelectFilterEvent;
77
77
  export interface SearchResultsProps extends NoChildrenProp {
78
78
  /** A set of results to render for a given search. */
79
79
  results: SearchResultProps[];
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResults.types.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,UAAU,eAAe;IACvB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,EAAE,EAAE,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IACvC,uCAAuC;IACvC,KAAK,EAAE,eAAe,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AmF;IACnF,IAAI,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9B,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,UAAU,iBAAkB,SAAQ,eAAe;IACjD,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,qBAAqB,CAAC;CAC9B;AAGD,oBAAY,WAAW,GAAG,iBAAiB,CAAC;AAE5C,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,qDAAqD;IACrD,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,wCAAwC;IACxC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,0HAA0H;IAC1H,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
1
+ {"version":3,"file":"SearchResults.types.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,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C,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResults.types.js","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\n\nimport {\n LinkProps,\n MetaListProps,\n NoChildrenProp,\n OmitStrict,\n RadioCheckProps,\n SearchInputProps\n} from '@pega/cosmos-react-core';\n\ninterface BaseFilterProps {\n /** The name of the filter. */\n name: string;\n /**\n * Determines if the filter will start in an expanded state.\n * @default true\n */\n expanded?: boolean;\n}\n\nexport interface SelectFilterItemProps {\n /** The id for the filter option. */\n id: NonNullable<RadioCheckProps['id']>;\n /** The label for the filter option. */\n label: RadioCheckProps['label'];\n /** Determines if the filter option is active or not. */\n checked: RadioCheckProps['checked'];\n /** The name for the filter item that will show in the selected filters section */\n name: NonNullable<RadioCheckProps['name']>;\n}\n\nexport interface SelectFilterProps extends BaseFilterProps {\n /** Internal prop designating this object as a select filter. */\n type: 'select';\n /** The set of options for the filter. */\n items: SelectFilterItemProps[];\n /**\n * Determines if the filter will render as a RadioButtonGroup or CheckboxGroup.\n * @default \"multi-select\"\n */\n selectType?: 'single-select' | 'multi-select';\n}\n\nexport interface ActiveSelectFilter {\n id: SelectFilterItemProps['id'];\n name: SelectFilterItemProps['name'];\n resetValue: SelectFilterItemProps & { checked: false };\n groupName: SelectFilterProps['name'];\n type: SelectFilterProps['type'];\n}\n\nexport interface TextFilterProps extends BaseFilterProps {\n /** Internal prop designating this object as a text filter. */\n type: 'text';\n /** The value of the filter. */\n value?: string;\n /**\n * Placeholder text. The default value is a locale translation of 'Search…'\n * @default \"Search…\"\n */\n placeholder?: string;\n}\n\n// For use later: export type FilterProps = TextFilterProps | SelectFilterProps;\nexport type FilterProps = SelectFilterProps;\n\nexport type ActiveFilters = ActiveSelectFilter;\n\nexport interface SearchResultProps {\n /** The id of the search result to be displayed. */\n id: string;\n /** The title of the search result. */\n title: string;\n /** LinkProps to be passed to . */\n link: OmitStrict<LinkProps, 'children' | 'variant' | 'icon'>;\n /** A description for the search result. */\n description?: string;\n /** A list of elements to be rendered within a MetaList categorizing the result. */\n meta?: MetaListProps['items'];\n /** Accents the search results with text that matches the regex */\n accent?: RegExp;\n}\n\ninterface BaseFilterEvent {\n name: string;\n}\ninterface SelectFilterEvent extends BaseFilterEvent {\n type: 'select';\n value: SelectFilterItemProps;\n}\n\n// For use later: export type FilterEvent = SelectFilterEvent | TextFilterEvent;\nexport type FilterEvent = SelectFilterEvent;\n\nexport interface SearchResultsProps extends NoChildrenProp {\n /** A set of results to render for a given search. */\n results: SearchResultProps[];\n /** Props related to the SearchInput. */\n searchInputProps: SearchInputProps;\n /** The number of total results related to a given search. */\n count: number;\n /** A set of filters and their current states for a given search. */\n filters: FilterProps[];\n /** Callback that is fired when the value of a filter changes. */\n onFilterChange?: (filter: FilterEvent) => void;\n /** Callback that is fired when the Clear all button is clicked. */\n onClearAllFilters?: () => void;\n /** Callback that is fired when the Clear button is clicked within a filter. */\n onClearFilter?: (name: BaseFilterProps['name']) => void;\n /** Callback that will render a Show more button at the bottom of the results and is fired when that button is clicked. */\n onShowMore?: () => void;\n /** Sets a loading indicator if true */\n loading?: boolean;\n /** A ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
1
+ {"version":3,"file":"SearchResults.types.js","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\n\nimport {\n LinkProps,\n MetaListProps,\n NoChildrenProp,\n OmitStrict,\n RadioCheckProps,\n SearchInputProps\n} from '@pega/cosmos-react-core';\n\ninterface BaseFilterProps {\n /** The name of the filter. */\n name: string;\n /**\n * Determines if the filter will start in an expanded state.\n * @default true\n */\n expanded?: boolean;\n}\n\nexport interface SelectFilterItemProps {\n /** The id for the filter option. */\n id: NonNullable<RadioCheckProps['id']>;\n /** The label for the filter option. */\n label: RadioCheckProps['label'];\n /** Determines if the filter option is active or not. */\n checked: RadioCheckProps['checked'];\n /** The name for the filter item that will show in the selected filters section */\n name: NonNullable<RadioCheckProps['name']>;\n}\n\nexport interface SelectFilterProps extends BaseFilterProps {\n /** Internal prop designating this object as a select filter. */\n type: 'select';\n /** The set of options for the filter. */\n items: SelectFilterItemProps[];\n /**\n * Determines if the filter will render as a RadioButtonGroup or CheckboxGroup.\n * @default 'multi-select'\n */\n selectType?: 'single-select' | 'multi-select';\n}\n\nexport interface ActiveSelectFilter {\n id: SelectFilterItemProps['id'];\n name: SelectFilterItemProps['name'];\n resetValue: SelectFilterItemProps & { checked: false };\n groupName: SelectFilterProps['name'];\n type: SelectFilterProps['type'];\n}\n\nexport interface TextFilterProps extends BaseFilterProps {\n /** Internal prop designating this object as a text filter. */\n type: 'text';\n /** The value of the filter. */\n value?: string;\n /**\n * Placeholder text. The default value is a locale translation of 'Search…'\n * @default 'Search…'\n */\n placeholder?: string;\n}\n\n// For use later: export type FilterProps = TextFilterProps | SelectFilterProps;\nexport type FilterProps = SelectFilterProps;\n\nexport type ActiveFilters = ActiveSelectFilter;\n\nexport interface SearchResultProps {\n /** The id of the search result to be displayed. */\n id: string;\n /** The title of the search result. */\n title: string;\n /** LinkProps to be passed to . */\n link: OmitStrict<LinkProps, 'children' | 'variant' | 'icon'>;\n /** A description for the search result. */\n description?: string;\n /** A list of elements to be rendered within a MetaList categorizing the result. */\n meta?: MetaListProps['items'];\n /** Accents the search results with text that matches the regex */\n accent?: RegExp;\n}\n\ninterface BaseFilterEvent {\n name: string;\n}\ninterface SelectFilterEvent extends BaseFilterEvent {\n type: 'select';\n value: SelectFilterItemProps;\n}\n\n// For use later: export type FilterEvent = SelectFilterEvent | TextFilterEvent;\nexport type FilterEvent = SelectFilterEvent;\n\nexport interface SearchResultsProps extends NoChildrenProp {\n /** A set of results to render for a given search. */\n results: SearchResultProps[];\n /** Props related to the SearchInput. */\n searchInputProps: SearchInputProps;\n /** The number of total results related to a given search. */\n count: number;\n /** A set of filters and their current states for a given search. */\n filters: FilterProps[];\n /** Callback that is fired when the value of a filter changes. */\n onFilterChange?: (filter: FilterEvent) => void;\n /** Callback that is fired when the Clear all button is clicked. */\n onClearAllFilters?: () => void;\n /** Callback that is fired when the Clear button is clicked within a filter. */\n onClearFilter?: (name: BaseFilterProps['name']) => void;\n /** Callback that will render a Show more button at the bottom of the results and is fired when that button is clicked. */\n onShowMore?: () => void;\n /** Sets a loading indicator if true */\n loading?: boolean;\n /** A ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -1,9 +1,7 @@
1
1
  import { FunctionComponent } from 'react';
2
- import { Action } from '@pega/cosmos-react-core';
3
2
  import { StageProps } from './Stages.types';
4
3
  export interface StageGlimpseProps {
5
4
  stage: StageProps;
6
- actions?: Action[];
7
5
  }
8
6
  declare const StageGlimpse: FunctionComponent<StageGlimpseProps>;
9
7
  export default StageGlimpse;
@@ -1 +1 @@
1
- {"version":3,"file":"StageGlimpse.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StageGlimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAEL,MAAM,EAOP,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAU5C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CAoCtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"StageGlimpse.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/StageGlimpse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA6BtD,CAAC;AAEF,eAAe,YAAY,CAAC"}