@pega/cosmos-react-work 2.0.0-dev.12.0 → 2.0.0-dev.14.1

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 (99) hide show
  1. package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
  2. package/lib/components/CaseHeader/CaseHeader.js +2 -1
  3. package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
  4. package/lib/components/CasePreview/CasePreview.js +6 -6
  5. package/lib/components/CasePreview/CasePreview.js.map +1 -1
  6. package/lib/components/CaseSummary/CaseSummary.d.ts +17 -1
  7. package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
  8. package/lib/components/CaseSummary/CaseSummary.js +115 -7
  9. package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
  10. package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
  11. package/lib/components/CaseSummaryFields/CaseSummaryFields.js +12 -9
  12. package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
  13. package/lib/components/CaseView/CaseView.d.ts +6 -25
  14. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  15. package/lib/components/CaseView/CaseView.js +109 -149
  16. package/lib/components/CaseView/CaseView.js.map +1 -1
  17. package/lib/components/CaseView/CaseView.styles.d.ts +26 -0
  18. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
  19. package/lib/components/CaseView/CaseView.styles.js +115 -0
  20. package/lib/components/CaseView/CaseView.styles.js.map +1 -0
  21. package/lib/components/CaseView/index.d.ts +2 -1
  22. package/lib/components/CaseView/index.d.ts.map +1 -1
  23. package/lib/components/CaseView/index.js +1 -1
  24. package/lib/components/CaseView/index.js.map +1 -1
  25. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
  26. package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
  27. package/lib/components/ConfigurableLayout/ConfigurableLayout.js +94 -0
  28. package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
  29. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +46 -0
  30. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
  31. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
  32. package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
  33. package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
  34. package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
  35. package/lib/components/ConfigurableLayout/LayoutCell.js +63 -0
  36. package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
  37. package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
  38. package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
  39. package/lib/components/ConfigurableLayout/defaults.js +4 -0
  40. package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
  41. package/lib/components/ConfigurableLayout/index.d.ts +2 -0
  42. package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
  43. package/lib/components/ConfigurableLayout/index.js +2 -0
  44. package/lib/components/ConfigurableLayout/index.js.map +1 -0
  45. package/lib/components/ConfigurableLayout/options.d.ts +10 -0
  46. package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
  47. package/lib/components/ConfigurableLayout/options.js +10 -0
  48. package/lib/components/ConfigurableLayout/options.js.map +1 -0
  49. package/lib/components/Details/Details.d.ts +13 -0
  50. package/lib/components/Details/Details.d.ts.map +1 -0
  51. package/lib/components/Details/Details.js +38 -0
  52. package/lib/components/Details/Details.js.map +1 -0
  53. package/lib/components/Details/index.d.ts +4 -0
  54. package/lib/components/Details/index.d.ts.map +1 -0
  55. package/lib/components/Details/index.js +3 -0
  56. package/lib/components/Details/index.js.map +1 -0
  57. package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
  58. package/lib/components/SearchResults/SearchResults.js +2 -2
  59. package/lib/components/SearchResults/SearchResults.js.map +1 -1
  60. package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
  61. package/lib/components/Stages/Stages.styles.js +2 -2
  62. package/lib/components/Stages/Stages.styles.js.map +1 -1
  63. package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
  64. package/lib/components/Stages/StepsContainer.js +1 -1
  65. package/lib/components/Stages/StepsContainer.js.map +1 -1
  66. package/lib/components/Stakeholders/StakeholderForm.d.ts +4 -0
  67. package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
  68. package/lib/components/Stakeholders/StakeholderForm.js +37 -0
  69. package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
  70. package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
  71. package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
  72. package/lib/components/Stakeholders/Stakeholders.js +181 -0
  73. package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
  74. package/lib/components/Stakeholders/Stakeholders.types.d.ts +42 -0
  75. package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
  76. package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
  77. package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
  78. package/lib/components/Stakeholders/index.d.ts +3 -0
  79. package/lib/components/Stakeholders/index.d.ts.map +1 -0
  80. package/lib/components/Stakeholders/index.js +2 -0
  81. package/lib/components/Stakeholders/index.js.map +1 -0
  82. package/lib/components/Tags/Tags.js +2 -2
  83. package/lib/components/Tags/Tags.js.map +1 -1
  84. package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
  85. package/lib/components/Timeline/Timeline.styles.js +8 -4
  86. package/lib/components/Timeline/Timeline.styles.js.map +1 -1
  87. package/lib/hooks/index.d.ts +2 -0
  88. package/lib/hooks/index.d.ts.map +1 -0
  89. package/lib/hooks/index.js +3 -0
  90. package/lib/hooks/index.js.map +1 -0
  91. package/lib/hooks/useArrangementContainer.d.ts +6 -0
  92. package/lib/hooks/useArrangementContainer.d.ts.map +1 -0
  93. package/lib/hooks/useArrangementContainer.js +25 -0
  94. package/lib/hooks/useArrangementContainer.js.map +1 -0
  95. package/lib/index.d.ts +6 -0
  96. package/lib/index.d.ts.map +1 -1
  97. package/lib/index.js +6 -0
  98. package/lib/index.js.map +1 -1
  99. package/package.json +11 -10
@@ -0,0 +1,115 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { defaultThemeProp, Tabs } from '@pega/cosmos-react-core';
3
+ export const StyledCaseViewContent = styled.div(({ theme, forceMobile, isMediumOrAbove, persistentUtility }) => {
4
+ return css `
5
+ padding: calc(2 * ${theme.base.spacing});
6
+
7
+ ${persistentUtility &&
8
+ isMediumOrAbove &&
9
+ css `
10
+ margin-inline-start: calc(2 * ${theme.base.spacing});
11
+ `}
12
+
13
+ ${!forceMobile &&
14
+ isMediumOrAbove &&
15
+ css `
16
+ padding: calc(2 * ${theme.base.spacing}) 0;
17
+ `}
18
+ `;
19
+ });
20
+ export const StyledMobileTabs = styled(Tabs)(({ theme, fullWidth }) => {
21
+ return css `
22
+ border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
23
+ ${fullWidth &&
24
+ css `
25
+ margin: 0 calc(-2 * ${theme.base.spacing});
26
+ `}
27
+ `;
28
+ });
29
+ StyledMobileTabs.defaultProps = defaultThemeProp;
30
+ export const StyledUtilToggle = styled.button(({ theme }) => {
31
+ return css `
32
+ align-self: flex-end;
33
+ color: ${theme.base.palette['foreground-color']};
34
+ margin-inline-end: 0.375rem;
35
+ `;
36
+ });
37
+ StyledUtilToggle.defaultProps = defaultThemeProp;
38
+ export const StyledCaseViewUtilities = styled.div(({ utilitiesShown, theme }) => {
39
+ return css `
40
+ width: ${utilitiesShown ? '25rem' : 'auto'};
41
+ height: max-content;
42
+ padding: calc(2 * ${theme.base.spacing}) 0 calc(2 * ${theme.base.spacing});
43
+ `;
44
+ });
45
+ StyledCaseViewUtilities.defaultProps = defaultThemeProp;
46
+ export const StyledCaseView = styled.div(({ theme, forceMobile, isMediumOrAbove, summaryOffset }) => {
47
+ return css `
48
+ --case-view-header-offset: calc(var(--appshell-offset, 0rem) + ${summaryOffset}px);
49
+ --case-view-content-height: calc(100vh - var(--case-view-header-offset, 0rem));
50
+ min-height: calc(100vh - var(--appshell-offset, 0rem));
51
+ position: relative;
52
+ background-color: ${theme.base.palette['app-background']};
53
+
54
+ > :last-child {
55
+ ${!forceMobile &&
56
+ isMediumOrAbove &&
57
+ css `
58
+ margin-inline-end: calc(2 * ${theme.base.spacing});
59
+ `}
60
+ }
61
+ `;
62
+ });
63
+ StyledCaseView.defaultProps = defaultThemeProp;
64
+ export const StyledSummaryRegion = styled.div(({ theme, forceMobile, desktop }) => {
65
+ return css `
66
+ position: sticky;
67
+ top: var(--appshell-offset, 0);
68
+ width: 100%;
69
+ background-color: ${theme.base.palette['primary-background']};
70
+ z-index: ${theme.base['z-index'].popover};
71
+
72
+ ${!forceMobile &&
73
+ desktop &&
74
+ css `
75
+ height: var(--case-view-content-height);
76
+ `}
77
+ `;
78
+ });
79
+ StyledSummaryRegion.defaultProps = defaultThemeProp;
80
+ export const StyledCaseDrawer = styled.div(({ theme }) => {
81
+ return css `
82
+ min-width: 21.875rem;
83
+ max-width: 31.25rem;
84
+ width: calc((100vw - 31.25rem) / 10 + 21.875rem);
85
+ background-color: ${theme.base.palette['primary-background']};
86
+ height: calc(100vh - var(--case-view-header-offset, 0));
87
+ top: var(--case-view-header-offset);
88
+ z-index: ${theme.base['z-index'].drawer - 1};
89
+ `;
90
+ });
91
+ StyledCaseDrawer.defaultProps = defaultThemeProp;
92
+ export const StyledCaseDrawerContent = styled.div(({ theme }) => {
93
+ return css `
94
+ background-color: ${theme.base.palette['app-background']};
95
+ padding: calc(2 * ${theme.base.spacing});
96
+ height: 100%;
97
+ overflow: auto;
98
+ `;
99
+ });
100
+ StyledCaseDrawerContent.defaultProps = defaultThemeProp;
101
+ export const StyledPersistentUtility = styled.div(() => {
102
+ return css `
103
+ max-width: 60ch;
104
+ overflow: auto;
105
+ position: sticky;
106
+ height: var(--case-view-content-height);
107
+ top: var(--case-view-header-offset);
108
+ `;
109
+ });
110
+ StyledPersistentUtility.defaultProps = defaultThemeProp;
111
+ export const ScrollStick = styled.div `
112
+ position: sticky;
113
+ top: 0;
114
+ `;
115
+ //# sourceMappingURL=CaseView.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaseView.styles.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAI5C,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,EAAE,EAAE;IAChE,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEpC,iBAAiB;QACnB,eAAe;QACf,GAAG,CAAA;sCAC+B,KAAK,CAAC,IAAI,CAAC,OAAO;KACnD;;MAEC,CAAC,WAAW;QACd,eAAe;QACf,GAAG,CAAA;0BACmB,KAAK,CAAC,IAAI,CAAC,OAAO;KACvC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAyB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;IAC5F,OAAO,GAAG,CAAA;qCACyB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;MAChE,SAAS;QACX,GAAG,CAAA;4BACqB,KAAK,CAAC,IAAI,CAAC,OAAO;KACzC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,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OAAO;;MAEtC,CAAC,WAAW;QACd,OAAO;QACP,GAAG,CAAA;;KAEF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACvD,OAAO,GAAG,CAAA;;;;wBAIY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;;eAGjD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC;GAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;wBACpC,KAAK,CAAC,IAAI,CAAC,OAAO;;;GAGvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IACrD,OAAO,GAAG,CAAA;;;;;;GAMT,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGpC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Tabs } from '@pega/cosmos-react-core';\n\nexport const StyledCaseViewContent = styled.div<{\n forceMobile?: boolean;\n isMediumOrAbove?: boolean;\n persistentUtility?: boolean;\n}>(({ theme, forceMobile, isMediumOrAbove, persistentUtility }) => {\n return css`\n padding: calc(2 * ${theme.base.spacing});\n\n ${persistentUtility &&\n isMediumOrAbove &&\n css`\n margin-inline-start: calc(2 * ${theme.base.spacing});\n `}\n\n ${!forceMobile &&\n isMediumOrAbove &&\n css`\n padding: calc(2 * ${theme.base.spacing}) 0;\n `}\n `;\n});\n\nexport const StyledMobileTabs = styled(Tabs)<{ fullWidth: boolean }>(({ theme, fullWidth }) => {\n return css`\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n ${fullWidth &&\n css`\n margin: 0 calc(-2 * ${theme.base.spacing});\n `}\n `;\n});\n\nStyledMobileTabs.defaultProps = defaultThemeProp;\n\nexport const StyledUtilToggle = styled.button(({ theme }) => {\n return css`\n align-self: flex-end;\n color: ${theme.base.palette['foreground-color']};\n margin-inline-end: 0.375rem;\n `;\n});\n\nStyledUtilToggle.defaultProps = defaultThemeProp;\n\nexport const StyledCaseViewUtilities = styled.div<{ utilitiesShown: boolean }>(\n ({ utilitiesShown, theme }) => {\n return css`\n width: ${utilitiesShown ? '25rem' : 'auto'};\n height: max-content;\n padding: calc(2 * ${theme.base.spacing}) 0 calc(2 * ${theme.base.spacing});\n `;\n }\n);\n\nStyledCaseViewUtilities.defaultProps = defaultThemeProp;\n\nexport const StyledCaseView = styled.div<{\n forceMobile?: boolean;\n isMediumOrAbove?: boolean;\n summaryOffset: number;\n}>(({ theme, forceMobile, isMediumOrAbove, summaryOffset }) => {\n return css`\n --case-view-header-offset: calc(var(--appshell-offset, 0rem) + ${summaryOffset}px);\n --case-view-content-height: calc(100vh - var(--case-view-header-offset, 0rem));\n min-height: calc(100vh - var(--appshell-offset, 0rem));\n position: relative;\n background-color: ${theme.base.palette['app-background']};\n\n > :last-child {\n ${!forceMobile &&\n isMediumOrAbove &&\n css`\n margin-inline-end: calc(2 * ${theme.base.spacing});\n `}\n }\n `;\n});\n\nStyledCaseView.defaultProps = defaultThemeProp;\n\nexport const StyledSummaryRegion = styled.div<{\n forceMobile?: boolean;\n desktop?: boolean;\n}>(({ theme, forceMobile, desktop }) => {\n return css`\n position: sticky;\n top: var(--appshell-offset, 0);\n width: 100%;\n background-color: ${theme.base.palette['primary-background']};\n z-index: ${theme.base['z-index'].popover};\n\n ${!forceMobile &&\n desktop &&\n css`\n height: var(--case-view-content-height);\n `}\n `;\n});\n\nStyledSummaryRegion.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawer = styled.div(({ theme }) => {\n return css`\n min-width: 21.875rem;\n max-width: 31.25rem;\n width: calc((100vw - 31.25rem) / 10 + 21.875rem);\n background-color: ${theme.base.palette['primary-background']};\n height: calc(100vh - var(--case-view-header-offset, 0));\n top: var(--case-view-header-offset);\n z-index: ${theme.base['z-index'].drawer - 1};\n `;\n});\n\nStyledCaseDrawer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseDrawerContent = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['app-background']};\n padding: calc(2 * ${theme.base.spacing});\n height: 100%;\n overflow: auto;\n `;\n});\n\nStyledCaseDrawerContent.defaultProps = defaultThemeProp;\n\nexport const StyledPersistentUtility = styled.div(() => {\n return css`\n max-width: 60ch;\n overflow: auto;\n position: sticky;\n height: var(--case-view-content-height);\n top: var(--case-view-header-offset);\n `;\n});\n\nStyledPersistentUtility.defaultProps = defaultThemeProp;\n\nexport const ScrollStick = styled.div`\n position: sticky;\n top: 0;\n`;\n"]}
@@ -1,5 +1,6 @@
1
1
  export { default } from './CaseView';
2
- export { CaseViewProps, StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummaryRegion } from './CaseView';
2
+ export { CaseViewProps } from './CaseView';
3
+ export { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummaryRegion } from './CaseView.styles';
3
4
  export { default as MobileCaseView } from './MobileCaseView';
4
5
  export { MobileCaseViewProps } from './MobileCaseView';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export { default } from './CaseView';
2
- export { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummaryRegion } from './CaseView';
2
+ export { StyledCaseView, StyledCaseViewContent, StyledCaseDrawer, StyledCaseDrawerContent, StyledSummaryRegion } from './CaseView.styles';
3
3
  export { default as MobileCaseView } from './MobileCaseView';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAEL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './CaseView';\nexport {\n CaseViewProps,\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledSummaryRegion\n} from './CaseView';\nexport { default as MobileCaseView } from './MobileCaseView';\nexport { MobileCaseViewProps } from './MobileCaseView';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CaseView/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { default } from './CaseView';\nexport { CaseViewProps } from './CaseView';\nexport {\n StyledCaseView,\n StyledCaseViewContent,\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledSummaryRegion\n} from './CaseView.styles';\nexport { default as MobileCaseView } from './MobileCaseView';\nexport { MobileCaseViewProps } from './MobileCaseView';\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ConfigurableLayoutProps } from './ConfigurableLayout.types';
2
+ declare const ConfigurableLayout: ({ items, arrangement }: ConfigurableLayoutProps) => JSX.Element;
3
+ export default ConfigurableLayout;
4
+ //# sourceMappingURL=ConfigurableLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurableLayout.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAwB1E,QAAA,MAAM,kBAAkB,2BAA4B,uBAAuB,gBA+F1E,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { Flex, defaultThemeProp } from '@pega/cosmos-react-core';
5
+ import { containerMinWidth, cellGap } from './defaults';
6
+ import LayoutCell from './LayoutCell';
7
+ const StyledCellGrid = styled.div(({ theme }) => {
8
+ return css `
9
+ /* Note: inset position used to negate "column" inline margin on items */
10
+ position: relative;
11
+ inset-inline: calc(-${cellGap} * ${theme.base.spacing});
12
+ width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});
13
+ max-width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});
14
+ `;
15
+ });
16
+ StyledCellGrid.defaultProps = defaultThemeProp;
17
+ const StyledContainerRuler = styled.div(({ theme }) => {
18
+ return css `
19
+ margin-inline: calc(${cellGap} * ${theme.base.spacing});
20
+ width: calc(100% - ${cellGap * 2} * ${theme.base.spacing});
21
+ `;
22
+ });
23
+ StyledContainerRuler.defaultProps = defaultThemeProp;
24
+ const ConfigurableLayout = ({ items, arrangement }) => {
25
+ const [renderMode, setRenderMode] = useState('direct');
26
+ const containerRulerRef = useRef(null);
27
+ const setModeByWidth = useCallback((width) => {
28
+ const activeArrangement = arrangement?.containerWidth !== undefined &&
29
+ width !== undefined &&
30
+ width < arrangement?.containerWidth;
31
+ // Set mode by arrangement
32
+ if (activeArrangement) {
33
+ switch (arrangement.size) {
34
+ case 'main':
35
+ setRenderMode('direct');
36
+ break;
37
+ case 'half':
38
+ setRenderMode('double');
39
+ break;
40
+ case 'narrow':
41
+ setRenderMode('full');
42
+ break;
43
+ default:
44
+ setRenderMode('direct');
45
+ break;
46
+ }
47
+ return;
48
+ }
49
+ // Use direct by default
50
+ setRenderMode('direct');
51
+ }, [arrangement?.containerWidth]);
52
+ useEffect(() => {
53
+ if (containerRulerRef.current) {
54
+ setModeByWidth(containerRulerRef.current.getBoundingClientRect().width);
55
+ }
56
+ }, [containerRulerRef, arrangement?.containerWidth]);
57
+ const content = useMemo(() => {
58
+ if (items && !!items.length) {
59
+ return items.map(itemConfig => {
60
+ const config = {
61
+ ...itemConfig,
62
+ layoutConfig: { ...itemConfig.layoutConfig }
63
+ };
64
+ if (renderMode !== 'direct') {
65
+ switch (renderMode) {
66
+ case 'double': {
67
+ const doubleWidth = {
68
+ '1/4': '1/2',
69
+ '1/3': '2/3',
70
+ '1/2': 'full',
71
+ '2/3': 'full',
72
+ '3/4': 'full',
73
+ full: 'full'
74
+ };
75
+ config.layoutConfig.width = doubleWidth[config.layoutConfig.width];
76
+ break;
77
+ }
78
+ case 'full':
79
+ config.layoutConfig.width = 'full';
80
+ break;
81
+ default:
82
+ config.layoutConfig.width = 'full';
83
+ break;
84
+ }
85
+ }
86
+ return _jsx(LayoutCell, { config: config }, `${itemConfig.id}--${renderMode}`);
87
+ });
88
+ }
89
+ return null;
90
+ }, [items, renderMode]);
91
+ return (_jsx(_Fragment, { children: _jsxs(Flex, Object.assign({ as: StyledCellGrid, container: { wrap: 'wrap', justify: 'stretch', alignItems: 'stretch' }, item: { basis: containerMinWidth, grow: 1 } }, { children: [_jsx(StyledContainerRuler, { ref: containerRulerRef }, void 0), content] }), void 0) }, void 0));
92
+ };
93
+ export default ConfigurableLayout;
94
+ //# sourceMappingURL=ConfigurableLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurableLayout.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,OAAO,EAAE,iBAAiB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AAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;4BAEnE,MAAM;yBACP;wBACD,KAAK,MAAM;4BACT,MAAM,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC;4BACnC,MAAM;wBACR;4BACE,MAAM,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC;4BACnC,MAAM;qBACT;iBACF;gBAED,OAAO,KAAC,UAAU,IAAyC,MAAM,EAAE,MAAM,IAAjD,GAAG,UAAU,CAAC,EAAE,KAAK,UAAU,EAAE,CAAoB,CAAC;YAChF,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IAExB,OAAO,CACL,4BACE,MAAC,IAAI,kBACH,EAAE,EAAE,cAAc,EAClB,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,EACtE,IAAI,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,EAAE,iBAE3C,KAAC,oBAAoB,IAAC,GAAG,EAAE,iBAAiB,WAAI,EAC/C,OAAO,aACH,WACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { useState, useEffect, useRef, useMemo, useCallback } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Flex, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport type { ConfigurableLayoutProps } from './ConfigurableLayout.types';\nimport { containerMinWidth, cellGap } from './defaults';\nimport widthConfigOptions from './options';\nimport LayoutCell from './LayoutCell';\n\nconst StyledCellGrid = styled.div(({ theme }) => {\n return css`\n /* Note: inset position used to negate \"column\" inline margin on items */\n position: relative;\n inset-inline: calc(-${cellGap} * ${theme.base.spacing});\n width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});\n max-width: calc(100% + ${cellGap * 2} * ${theme.base.spacing});\n `;\n});\nStyledCellGrid.defaultProps = defaultThemeProp;\n\nconst StyledContainerRuler = styled.div(({ theme }) => {\n return css`\n margin-inline: calc(${cellGap} * ${theme.base.spacing});\n width: calc(100% - ${cellGap * 2} * ${theme.base.spacing});\n `;\n});\nStyledContainerRuler.defaultProps = defaultThemeProp;\n\nconst ConfigurableLayout = ({ items, arrangement }: ConfigurableLayoutProps) => {\n const [renderMode, setRenderMode] = useState<'direct' | 'double' | 'full'>('direct');\n const containerRulerRef = useRef<HTMLDivElement>(null);\n\n const setModeByWidth = useCallback(\n (width: number) => {\n const activeArrangement =\n arrangement?.containerWidth !== undefined &&\n width !== undefined &&\n width! < arrangement?.containerWidth;\n\n // Set mode by arrangement\n if (activeArrangement) {\n switch (arrangement.size) {\n case 'main':\n setRenderMode('direct');\n break;\n case 'half':\n setRenderMode('double');\n break;\n case 'narrow':\n setRenderMode('full');\n break;\n default:\n setRenderMode('direct');\n break;\n }\n\n return;\n }\n\n // Use direct by default\n setRenderMode('direct');\n },\n [arrangement?.containerWidth]\n );\n\n useEffect(() => {\n if (containerRulerRef.current) {\n setModeByWidth(containerRulerRef.current.getBoundingClientRect().width);\n }\n }, [containerRulerRef, arrangement?.containerWidth]);\n\n const content = useMemo(() => {\n if (items && !!items.length) {\n return items.map(itemConfig => {\n const config = {\n ...itemConfig,\n layoutConfig: { ...itemConfig.layoutConfig }\n };\n\n if (renderMode !== 'direct') {\n switch (renderMode) {\n case 'double': {\n const doubleWidth: { [key: string]: keyof typeof widthConfigOptions } = {\n '1/4': '1/2',\n '1/3': '2/3',\n '1/2': 'full',\n '2/3': 'full',\n '3/4': 'full',\n full: 'full'\n };\n\n config.layoutConfig.width = doubleWidth[config.layoutConfig.width];\n\n break;\n }\n case 'full':\n config.layoutConfig.width = 'full';\n break;\n default:\n config.layoutConfig.width = 'full';\n break;\n }\n }\n\n return <LayoutCell key={`${itemConfig.id}--${renderMode}`} config={config} />;\n });\n }\n\n return null;\n }, [items, renderMode]);\n\n return (\n <>\n <Flex\n as={StyledCellGrid}\n container={{ wrap: 'wrap', justify: 'stretch', alignItems: 'stretch' }}\n item={{ basis: containerMinWidth, grow: 1 }}\n >\n <StyledContainerRuler ref={containerRulerRef} />\n {content}\n </Flex>\n </>\n );\n};\n\nexport default ConfigurableLayout;\n"]}
@@ -0,0 +1,46 @@
1
+ import type widthConfigOptions from './options';
2
+ /**
3
+ * Type for config of a single ConfigurableLayout item.
4
+ */
5
+ export interface Config {
6
+ /** Unique identifier in render region */
7
+ id: string;
8
+ /** Element to render */
9
+ content: JSX.Element;
10
+ /** Config for element */
11
+ layoutConfig: {
12
+ /** Responsive width option */
13
+ width: keyof typeof widthConfigOptions;
14
+ /**
15
+ * Fills remaining space if true, else does not grow beyond `width` value.
16
+ * @default true
17
+ */
18
+ fillAvailable?: boolean;
19
+ /** Flex basis (minimum fixed width) of element as:
20
+ * - a numeric value to be applied in __pixels__
21
+ * - a tuple of a numeric value and string unit
22
+ */
23
+ minWidth?: number | [number, 'px' | 'ch' | 'rem' | 'em'];
24
+ };
25
+ }
26
+ export interface ConfigurableLayoutProps {
27
+ /** Array of configs for individual layout cells */
28
+ items: Config[];
29
+ /** Arrangement properties */
30
+ arrangement?: {
31
+ /** Defines the arrangement size of the given ConfigurableLayout.
32
+ * Used to determine what width to apply to the given item when the arrangement is applied,
33
+ * with the following mapping:
34
+ * - 'narrow' --> applies 'full' width
35
+ * - 'main' --> applies configured width
36
+ * - 'half' --> applies double the configured width, or 'full' width (whichever is smaller)
37
+ */
38
+ size: 'narrow' | 'main' | 'half';
39
+ /** Defines the __live__ width of the arrangement's container element. Used to actively
40
+ * determine whether the arrangement is applied.
41
+ * - Requires a resize observer OR `useArrangementContainer` hook to update the value as it changes.
42
+ */
43
+ containerWidth: number | undefined;
44
+ };
45
+ }
46
+ //# sourceMappingURL=ConfigurableLayout.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurableLayout.types.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,WAAW,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;IACrB,yBAAyB;IACzB,YAAY,EAAE;QACZ,8BAA8B;QAC9B,KAAK,EAAE,MAAM,OAAO,kBAAkB,CAAC;QACvC;;;WAGG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;KAC1D,CAAC;CACH;AAED,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,6BAA6B;IAC7B,WAAW,CAAC,EAAE;QACZ;;;;;;WAMG;QACH,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;QACjC;;;WAGG;QACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;KACpC,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ConfigurableLayout.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigurableLayout.types.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/ConfigurableLayout.types.ts"],"names":[],"mappings":"","sourcesContent":["import type widthConfigOptions from './options';\n\n/**\n * Type for config of a single ConfigurableLayout item.\n */\nexport interface Config {\n /** Unique identifier in render region */\n id: string;\n /** Element to render */\n content: JSX.Element;\n /** Config for element */\n layoutConfig: {\n /** Responsive width option */\n width: keyof typeof widthConfigOptions;\n /**\n * Fills remaining space if true, else does not grow beyond `width` value.\n * @default true\n */\n fillAvailable?: boolean;\n /** Flex basis (minimum fixed width) of element as:\n * - a numeric value to be applied in __pixels__\n * - a tuple of a numeric value and string unit\n */\n minWidth?: number | [number, 'px' | 'ch' | 'rem' | 'em'];\n };\n}\n\nexport interface ConfigurableLayoutProps {\n /** Array of configs for individual layout cells */\n items: Config[];\n /** Arrangement properties */\n arrangement?: {\n /** Defines the arrangement size of the given ConfigurableLayout.\n * Used to determine what width to apply to the given item when the arrangement is applied,\n * with the following mapping:\n * - 'narrow' --> applies 'full' width\n * - 'main' --> applies configured width\n * - 'half' --> applies double the configured width, or 'full' width (whichever is smaller)\n */\n size: 'narrow' | 'main' | 'half';\n /** Defines the __live__ width of the arrangement's container element. Used to actively\n * determine whether the arrangement is applied.\n * - Requires a resize observer OR `useArrangementContainer` hook to update the value as it changes.\n */\n containerWidth: number | undefined;\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { Config } from './ConfigurableLayout.types';
2
+ declare const LayoutCell: ({ config }: {
3
+ config: Config;
4
+ }) => JSX.Element | null;
5
+ export default LayoutCell;
6
+ //# sourceMappingURL=LayoutCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutCell.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/LayoutCell.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAmDzD,QAAA,MAAM,UAAU;YAA0B,MAAM;wBAoC/C,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { Flex, defaultThemeProp } from '@pega/cosmos-react-core';
5
+ import { StyledAppAnnouncement } from '../AppAnnouncement/AppAnnouncement';
6
+ import widthConfigOptions from './options';
7
+ import { itemMinWidth, cellGap } from './defaults';
8
+ const StyledCell = styled.div(({ fillAvailable = true, percentageWidth, minWidth, theme }) => {
9
+ return css `
10
+ /* variables */
11
+ --marginGap: calc(${cellGap} * ${theme.base.spacing});
12
+ --totalMargin: calc(2 * var(--marginGap));
13
+ --percentageBasis: calc(${percentageWidth} - var(--totalMargin));
14
+ --maxWidth: calc(100% - var(--totalMargin));
15
+
16
+ /* styles */
17
+ flex-basis: var(--percentageBasis);
18
+ min-width: min(var(--maxWidth), ${minWidth || itemMinWidth});
19
+ max-width: var(--maxWidth);
20
+ margin-block-end: calc(var(--totalMargin));
21
+ margin-inline: var(--marginGap);
22
+
23
+ ${!fillAvailable &&
24
+ css `
25
+ flex-grow: 0;
26
+ `}
27
+
28
+ ${StyledAppAnnouncement} {
29
+ align-self: stretch;
30
+ }
31
+
32
+ > * {
33
+ width: 100%;
34
+ height: auto;
35
+ overflow-x: auto;
36
+ }
37
+ `;
38
+ });
39
+ StyledCell.defaultProps = defaultThemeProp;
40
+ const validWidthUnits = ['px', 'ch', 'rem', 'em'];
41
+ const LayoutCell = ({ config }) => {
42
+ const layoutConfig = useMemo(() => config.layoutConfig, [config]);
43
+ const percentageWidth = useMemo(() => {
44
+ return widthConfigOptions[layoutConfig.width] || '100%';
45
+ }, [layoutConfig.width]);
46
+ const minWidth = useMemo(() => {
47
+ const value = layoutConfig.minWidth;
48
+ if (typeof value === 'number') {
49
+ return `${value}px`;
50
+ }
51
+ if (Array.isArray(value) &&
52
+ value.length >= 2 &&
53
+ typeof value[0] === 'number' &&
54
+ validWidthUnits.includes(value[1])) {
55
+ return `${value[0]}${value[1]}`;
56
+ }
57
+ }, [layoutConfig.minWidth]);
58
+ return config?.content ? (_jsx(Flex, Object.assign({ as: StyledCell, item: {
59
+ grow: 1
60
+ }, container: { justify: 'stretch', alignItems: 'start' }, fillAvailable: layoutConfig.fillAvailable, percentageWidth: percentageWidth, minWidth: minWidth }, { children: config.content }), void 0)) : null;
61
+ };
62
+ export default LayoutCell;
63
+ //# sourceMappingURL=LayoutCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutCell.js","sourceRoot":"","sources":["../../../src/components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,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;QAEpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,GAAG,KAAK,IAAI,CAAC;SACrB;QAED,IACE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACpB,KAAK,CAAC,MAAM,IAAI,CAAC;YACjB,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ;YAC5B,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClC;YACA,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;SACjC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CACvB,KAAC,IAAI,kBACH,EAAE,EAAE,UAAU,EACd,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR,EACD,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,EACtD,aAAa,EAAE,YAAY,CAAC,aAAa,EACzC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,gBAEjB,MAAM,CAAC,OAAO,YACV,CACR,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport styled, { css, DefaultTheme } from 'styled-components';\n\nimport { Flex, defaultThemeProp } from '@pega/cosmos-react-core';\n\nimport { StyledAppAnnouncement } from '../AppAnnouncement/AppAnnouncement';\n\nimport type { Config } from './ConfigurableLayout.types';\nimport widthConfigOptions from './options';\nimport { itemMinWidth, cellGap } from './defaults';\n\nconst StyledCell = styled.div(\n ({\n fillAvailable = true,\n percentageWidth,\n minWidth,\n theme\n }: {\n fillAvailable: boolean;\n percentageWidth?: string;\n minWidth?: string | undefined;\n theme: DefaultTheme;\n }) => {\n return css`\n /* variables */\n --marginGap: calc(${cellGap} * ${theme.base.spacing});\n --totalMargin: calc(2 * var(--marginGap));\n --percentageBasis: calc(${percentageWidth} - var(--totalMargin));\n --maxWidth: calc(100% - var(--totalMargin));\n\n /* styles */\n flex-basis: var(--percentageBasis);\n min-width: min(var(--maxWidth), ${minWidth || itemMinWidth});\n max-width: var(--maxWidth);\n margin-block-end: calc(var(--totalMargin));\n margin-inline: var(--marginGap);\n\n ${!fillAvailable &&\n css`\n flex-grow: 0;\n `}\n\n ${StyledAppAnnouncement} {\n align-self: stretch;\n }\n\n > * {\n width: 100%;\n height: auto;\n overflow-x: auto;\n }\n `;\n }\n);\nStyledCell.defaultProps = defaultThemeProp;\n\nconst validWidthUnits = ['px', 'ch', 'rem', 'em'];\n\nconst LayoutCell = ({ config }: { config: Config }) => {\n const layoutConfig = useMemo(() => config.layoutConfig, [config]);\n const percentageWidth = useMemo(() => {\n return widthConfigOptions[layoutConfig.width as keyof typeof widthConfigOptions] || '100%';\n }, [layoutConfig.width]);\n const minWidth = useMemo(() => {\n const value = layoutConfig.minWidth;\n\n if (typeof value === 'number') {\n return `${value}px`;\n }\n\n if (\n Array.isArray(value) &&\n value.length >= 2 &&\n typeof value[0] === 'number' &&\n validWidthUnits.includes(value[1])\n ) {\n return `${value[0]}${value[1]}`;\n }\n }, [layoutConfig.minWidth]);\n\n return config?.content ? (\n <Flex\n as={StyledCell}\n item={{\n grow: 1\n }}\n container={{ justify: 'stretch', alignItems: 'start' }}\n fillAvailable={layoutConfig.fillAvailable}\n percentageWidth={percentageWidth}\n minWidth={minWidth}\n >\n {config.content}\n </Flex>\n ) : null;\n};\n\nexport default LayoutCell;\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const cellGap = 1;
2
+ export declare const containerMinWidth = "450px";
3
+ export declare const itemMinWidth = "225px";
4
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,eAAO,MAAM,YAAY,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ export const cellGap = 1;
2
+ export const containerMinWidth = '450px';
3
+ export const itemMinWidth = '225px';
4
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/defaults.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC","sourcesContent":["export const cellGap = 1;\nexport const containerMinWidth = '450px';\nexport const itemMinWidth = '225px';\n"]}
@@ -0,0 +1,2 @@
1
+ export { default } from './ConfigurableLayout';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './ConfigurableLayout';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { default } from './ConfigurableLayout';\n"]}
@@ -0,0 +1,10 @@
1
+ declare const widthConfigOptions: {
2
+ readonly '1/4': "25%";
3
+ readonly '1/3': "33.3%";
4
+ readonly '1/2': "50%";
5
+ readonly '2/3': "66.6%";
6
+ readonly '3/4': "75%";
7
+ readonly full: "100%";
8
+ };
9
+ export default widthConfigOptions;
10
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/options.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,kBAAkB;;;;;;;CAOd,CAAC;AAEX,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ const widthConfigOptions = {
2
+ '1/4': '25%',
3
+ '1/3': '33.3%',
4
+ '1/2': '50%',
5
+ '2/3': '66.6%',
6
+ '3/4': '75%',
7
+ full: '100%'
8
+ };
9
+ export default widthConfigOptions;
10
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/components/ConfigurableLayout/options.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG;IACzB,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,eAAe,kBAAkB,CAAC","sourcesContent":["const widthConfigOptions = {\n '1/4': '25%',\n '1/3': '33.3%',\n '1/2': '50%',\n '2/3': '66.6%',\n '3/4': '75%',\n full: '100%'\n} as const;\n\nexport default widthConfigOptions;\n"]}
@@ -0,0 +1,13 @@
1
+ import { FunctionComponent, ReactNode } from 'react';
2
+ import { FieldValueListProps, ForwardProps, BaseProps } from '@pega/cosmos-react-core';
3
+ export interface DetailsProps extends BaseProps {
4
+ /** The set of field values to render in the Highlighted Data list. */
5
+ highlightedFields?: FieldValueListProps['fields'];
6
+ /** List of React components below the highlighted data and line seperation. */
7
+ regions?: [ReactNode] | [ReactNode, ReactNode] | [ReactNode, ReactNode, ReactNode];
8
+ }
9
+ export declare const StyledDetails: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
+ export declare const StyledHighlightedFields: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
11
+ declare const Details: FunctionComponent<DetailsProps & ForwardProps>;
12
+ export default Details;
13
+ //# sourceMappingURL=Details.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,EAKL,mBAAmB,EACnB,YAAY,EACZ,SAAS,EAGV,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,sEAAsE;IACtE,iBAAiB,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAClD,+EAA+E;IAC/E,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;CACpF;AAED,eAAO,MAAM,aAAa,yGAAe,CAAC;AAE1C,eAAO,MAAM,uBAAuB,yGAmBlC,CAAC;AAIH,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CA4B3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from 'styled-components';
3
+ import { Grid, defaultThemeProp, FieldValueList, StyledFieldValueList, calculateFontSize } from '@pega/cosmos-react-core';
4
+ export const StyledDetails = styled.div ``;
5
+ export const StyledHighlightedFields = styled.div(({ theme }) => {
6
+ const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
7
+ return css `
8
+ ${StyledFieldValueList} {
9
+ display: grid;
10
+ grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr));
11
+ padding-block-end: calc(1.5 * ${theme.base.spacing});
12
+ border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
13
+ column-gap: calc(5 * ${theme.base.spacing});
14
+ dd {
15
+ font-size: ${fontSize[theme.components.text.h1['font-size']]};
16
+ font-weight: ${theme.components.text.h1['font-weight']};
17
+ }
18
+ }
19
+
20
+ & + div {
21
+ padding-block-start: calc(1.5 * ${theme.base.spacing});
22
+ }
23
+ `;
24
+ });
25
+ StyledHighlightedFields.defaultProps = defaultThemeProp;
26
+ const Details = ({ highlightedFields, regions }) => {
27
+ return (_jsxs(StyledDetails, { children: [highlightedFields && (_jsx(StyledHighlightedFields, { children: _jsx(FieldValueList, { variant: 'stacked', fields: highlightedFields }, void 0) }, void 0)), regions && regions.length > 0 && (_jsx(Grid, Object.assign({ container: {
28
+ cols: 'repeat(auto-fit, minmax(30ch, 1fr))',
29
+ alignItems: 'start',
30
+ alignContent: 'start',
31
+ gap: 2
32
+ } }, { children: regions?.map((colItem, i) => {
33
+ // eslint-disable-next-line react/no-array-index-key
34
+ return _jsx("div", { children: colItem }, i);
35
+ }) }), void 0))] }, void 0));
36
+ };
37
+ export default Details;
38
+ //# sourceMappingURL=Details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Details.js","sourceRoot":"","sources":["../../../src/components/Details/Details.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EAIpB,iBAAiB,EAElB,MAAM,yBAAyB,CAAC;AASjC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WA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n\nimport {\n Grid,\n defaultThemeProp,\n FieldValueList,\n StyledFieldValueList,\n FieldValueListProps,\n ForwardProps,\n BaseProps,\n calculateFontSize,\n FontSize\n} from '@pega/cosmos-react-core';\n\nexport interface DetailsProps extends BaseProps {\n /** The set of field values to render in the Highlighted Data list. */\n highlightedFields?: FieldValueListProps['fields'];\n /** List of React components below the highlighted data and line seperation. */\n regions?: [ReactNode] | [ReactNode, ReactNode] | [ReactNode, ReactNode, ReactNode];\n}\n\nexport const StyledDetails = styled.div``;\n\nexport const StyledHighlightedFields = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n return css`\n ${StyledFieldValueList} {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(20ch, 1fr));\n padding-block-end: calc(1.5 * ${theme.base.spacing});\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n column-gap: calc(5 * ${theme.base.spacing});\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n }\n\n & + div {\n padding-block-start: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledHighlightedFields.defaultProps = defaultThemeProp;\n\nconst Details: FunctionComponent<DetailsProps & ForwardProps> = ({\n highlightedFields,\n regions\n}: DetailsProps) => {\n return (\n <StyledDetails>\n {highlightedFields && (\n <StyledHighlightedFields>\n <FieldValueList variant='stacked' fields={highlightedFields} />\n </StyledHighlightedFields>\n )}\n {regions && regions.length > 0 && (\n <Grid\n container={{\n cols: 'repeat(auto-fit, minmax(30ch, 1fr))',\n alignItems: 'start',\n alignContent: 'start',\n gap: 2\n }}\n >\n {regions?.map((colItem, i) => {\n // eslint-disable-next-line react/no-array-index-key\n return <div key={i}>{colItem}</div>;\n })}\n </Grid>\n )}\n </StyledDetails>\n );\n};\n\nexport default Details;\n"]}
@@ -0,0 +1,4 @@
1
+ export { default } from './Details';
2
+ export { DetailsProps } from './Details';
3
+ export { StyledDetails, StyledHighlightedFields } from './Details';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default } from './Details';
2
+ export { StyledDetails, StyledHighlightedFields } from './Details';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Details/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Details';\nexport { DetailsProps } from './Details';\nexport { StyledDetails, StyledHighlightedFields } from './Details';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAG3F,OAAO,EAOL,YAAY,EAab,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAoH/B,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAgNvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"SearchResults.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResults/SearchResults.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAGlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAOL,YAAY,EAab,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAoH/B,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAgMvE,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useContext, useRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
- import { Button, Card, CardContent, Count, defaultThemeProp, Flex, Grid, Icon, Modal, ModalManagerContext, NoItems, SearchInput, Selectable, Text, useI18n, useBreakpoint, useAfterInitialEffect } from '@pega/cosmos-react-core';
4
+ import { Button, Card, CardContent, Count, defaultThemeProp, Flex, Grid, Icon, Modal, ModalManagerContext, EmptyState, SearchInput, Selectable, Text, useI18n, useBreakpoint, useAfterInitialEffect } from '@pega/cosmos-react-core';
5
5
  import SearchResult from './SearchResult';
6
6
  import Filter from './Filter';
7
7
  const StyledSearchResults = styled.div ``;
@@ -121,7 +121,7 @@ const SearchResults = forwardRef(({ results, searchInputProps, count, filters, o
121
121
  }) }, { children: `${filter.groupName}: ${filter.name}` }), filter.id));
122
122
  }) }), void 0))] }), void 0), _jsx(Grid, Object.assign({ item: { area: 'items', alignSelf: results.length ? 'start' : 'center' }, container: { rowGap: 4 } }, { children: results.length ? (results.map((result) => {
123
123
  return _jsx(SearchResult, Object.assign({}, result), result.id);
124
- })) : (_jsx(Grid, Object.assign({ item: { alignSelf: 'stretch' } }, { children: _jsx(NoItems, { message: searchInputProps.value === '' ? t('empty_search') : undefined }, void 0) }), void 0)) }), void 0), onShowMore && (_jsx(Flex, Object.assign({ container: { justify: 'center' } }, { children: _jsx(Button, Object.assign({ variant: 'link', onClick: onShowMore }, { children: t('show_more') }), void 0) }), void 0))] }), void 0)] }), void 0) }, void 0) }, void 0));
124
+ })) : (_jsx(Grid, Object.assign({ item: { alignSelf: 'stretch' } }, { children: _jsx(EmptyState, { message: searchInputProps.value === '' ? t('empty_search') : undefined }, void 0) }), void 0)) }), void 0), onShowMore && (_jsx(Flex, Object.assign({ container: { justify: 'center' } }, { children: _jsx(Button, Object.assign({ variant: 'link', onClick: onShowMore }, { children: t('show_more') }), void 0) }), void 0))] }), void 0)] }), void 0) }, void 0) }, void 0));
125
125
  });
126
126
  export default SearchResults;
127
127
  //# sourceMappingURL=SearchResults.js.map