@pega/custom-dx-components 0.23.49 → 0.24.2

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 (94) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +8 -2
  4. package/src/constants.js +5 -0
  5. package/src/tasks/build-jest-assets/index.js +171 -0
  6. package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +3 -13
  7. package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +8 -5
  8. package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -19
  9. package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +1 -1
  10. package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +7 -18
  11. package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +1 -1
  12. package/src/tasks/create/templates/Constellation/Field/DateTime/mock.ts.mustache +1 -0
  13. package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -7
  14. package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -1
  15. package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +1 -0
  16. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +2 -9
  17. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +1 -1
  18. package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +2 -0
  19. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +2 -6
  20. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -1
  21. package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +1 -0
  22. package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +2 -6
  23. package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +1 -1
  24. package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +2 -6
  25. package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +1 -1
  26. package/src/tasks/create/templates/Constellation/Field/Picklist/mock.ts.mustache +1 -0
  27. package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +2 -8
  28. package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +1 -7
  29. package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +0 -3
  30. package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -5
  31. package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +1 -1
  32. package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +3 -9
  33. package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -5
  34. package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +1 -1
  35. package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +1 -0
  36. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -5
  37. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +1 -1
  38. package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +1 -0
  39. package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +2 -5
  40. package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +1 -1
  41. package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +1 -0
  42. package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -5
  43. package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +1 -0
  44. package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +5 -15
  45. package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +1 -1
  46. package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +17 -19
  47. package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +5 -5
  48. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +17 -19
  49. package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +5 -5
  50. package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +5 -3
  51. package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +4 -2
  52. package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -3
  53. package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +3 -2
  54. package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +5 -8
  55. package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +5 -4
  56. package/src/tasks/index.js +1 -0
  57. package/src/tasks/init/template/.storybook/preview.js +3 -0
  58. package/src/tasks/init/template/package.json.mustache +7 -6
  59. package/src/util.js +18 -0
  60. package/tests/assets/components/create/_components.md +1 -0
  61. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +1 -1
  62. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +1 -1
  63. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +1 -1
  64. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +1 -1
  65. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +1 -1
  66. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  67. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +1 -1
  68. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +1 -1
  69. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +1 -1
  70. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +1 -1
  71. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +1 -1
  72. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +1 -1
  73. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  74. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +1 -1
  75. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
  76. package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  77. package/tests/assets/components/createAll/Constellation/_components.md +1 -0
  78. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +1 -1
  79. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +1 -1
  80. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +1 -1
  81. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +1 -1
  82. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +1 -1
  83. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
  84. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +1 -1
  85. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +1 -1
  86. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +1 -1
  87. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +1 -1
  88. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +1 -1
  89. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +1 -1
  90. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
  91. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +1 -1
  92. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
  93. package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
  94. package/tests/assets/components/createAll/Launchpad/_components.md +1 -0
@@ -24,19 +24,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
24
24
 
25
25
  const props = {
26
26
  value,
27
- placeholder: configProps.placeholder,
28
- label: configProps.label,
29
- helperText: configProps.helperText,
30
- datasource: configProps.datasource,
31
- testId: configProps.testId,
32
27
  hasSuggestions: configProps.hasSuggestions,
33
28
  columns: [],
34
- isTableFormatter: false,
35
29
  listType: 'associated',
36
- parameters: {},
37
30
  datasourceMetadata,
38
31
  fieldMetadata,
39
- validatemessage: '',
40
32
  getPConnect: () => {
41
33
  return {
42
34
  getConfigProps: () => {
@@ -93,9 +85,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
93
85
  };
94
86
 
95
87
  Base{{COMPONENT_CLASS_NAME}}.args = {
88
+ datasource: configProps.datasource,
96
89
  label: configProps.label,
97
90
  helperText: configProps.helperText,
98
91
  placeholder: configProps.placeholder,
92
+ parameters: {},
99
93
  isTableFormatter: false,
100
94
  testId: configProps.testId,
101
95
  readOnly: configProps.readOnly,
@@ -23,15 +23,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
23
23
 
24
24
  const props = {
25
25
  value,
26
- placeholder: configProps.placeholder,
27
- label: configProps.label,
28
- helperText: configProps.helperText,
29
- datasource: configProps.datasource,
30
- inline: configProps.inline,
31
- testId: configProps.testId,
32
26
  hasSuggestions: configProps.hasSuggestions,
33
27
  fieldMetadata,
34
- validatemessage: '',
35
28
  getPConnect: () => {
36
29
  return {
37
30
  getConfigProps: () => {
@@ -88,6 +81,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
88
81
  };
89
82
 
90
83
  Base{{COMPONENT_CLASS_NAME}}.args = {
84
+ datasource: configProps.datasource,
91
85
  label: configProps.label,
92
86
  helperText: configProps.helperText,
93
87
  placeholder: configProps.placeholder,
@@ -23,9 +23,6 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
23
23
 
24
24
  const props = {
25
25
  value,
26
- placeholder: configProps.placeholder,
27
- label: configProps.label,
28
- testId: configProps.testId,
29
26
  hasSuggestions: configProps.hasSuggestions,
30
27
 
31
28
  getPConnect: () => {
@@ -20,13 +20,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
20
20
 
21
21
  const props = {
22
22
  value: configProps.value,
23
- label: configProps.label,
24
- placeholder: configProps.placeholder,
25
- helperText: configProps.helperText,
26
- testId: configProps.testId,
27
23
  hasSuggestions: configProps.hasSuggestions,
28
24
  fieldMetadata,
29
- validatemessage: '',
30
25
  getPConnect: () => {
31
26
  return {
32
27
  getStateProps: () => {
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
64
59
  status: configProps.status,
65
60
  hideLabel: configProps.hideLabel,
66
61
  displayMode: configProps.displayMode,
62
+ variant: configProps.variant,
67
63
  validatemessage: configProps.validatemessage
68
64
  };
@@ -128,7 +128,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
128
128
  }
129
129
  return displayMode === 'DISPLAY_ONLY' ? (
130
130
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
131
- displayComp
131
+ {displayComp}
132
132
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
133
133
  ) : (
134
134
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
@@ -2,9 +2,9 @@
2
2
  import React from 'react';
3
3
  import { Status } from '@pega/cosmos-react-core';
4
4
 
5
- export default function StatusWorkRenderer({ value } : any) {
5
+ export default function StatusWorkRenderer({ value }: any) {
6
6
  // need to cast variant
7
- let variant : 'success' | 'urgent' | 'warn' | 'pending' | 'info';
7
+ let variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';
8
8
  variant = 'info';
9
9
 
10
10
  const warnStrings = ['fail', 'cancel', 'reject', 'revoke', 'stopped', 'warn'];
@@ -22,11 +22,5 @@ export default function StatusWorkRenderer({ value } : any) {
22
22
  variant = 'pending';
23
23
  }
24
24
 
25
-
26
-
27
- return (
28
- <Status type='rectangle' variant={variant} >
29
- {value}
30
- </Status>
31
- );
25
+ return <Status variant={variant}>{value}</Status>;
32
26
  }
@@ -20,13 +20,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
20
20
 
21
21
  const props = {
22
22
  value: configProps.value,
23
- placeholder: configProps.placeholder,
24
- label: configProps.label,
25
- helperText: configProps.helperText,
26
- testId: configProps.testId,
27
23
  hasSuggestions: configProps.hasSuggestions,
28
24
  fieldMetadata,
29
- validatemessage: '',
30
25
  getPConnect: () => {
31
26
  return {
32
27
  getStateProps: () => {
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
64
59
  status: configProps.status,
65
60
  hideLabel: configProps.hideLabel,
66
61
  displayMode: configProps.displayMode,
62
+ variant: configProps.variant,
67
63
  validatemessage: configProps.validatemessage
68
64
  };
@@ -143,7 +143,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
143
143
  displayComp = textFormatter(formatter, value);
144
144
  }
145
145
  return displayMode === 'DISPLAY_ONLY' ? (
146
- <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
146
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
147
147
  ) : (
148
148
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
149
149
  <FieldValueList
@@ -8,6 +8,7 @@ export const configProps = {
8
8
  testId: 'TextInput-12345678',
9
9
  hasSuggestions: false,
10
10
  displayMode: '',
11
+ variant: '',
11
12
  hideLabel: false,
12
13
  readOnly: false,
13
14
  required: false,
@@ -20,13 +20,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
20
20
 
21
21
  const props = {
22
22
  value: configProps.value,
23
- placeholder: configProps.placeholder,
24
- label: configProps.label,
25
- helperText: configProps.helperText,
26
- testId: configProps.testId,
27
23
  hasSuggestions: configProps.hasSuggestions,
28
24
  fieldMetadata,
29
- validatemessage: '',
30
25
  getPConnect: () => {
31
26
  return {
32
27
  getStateProps: () => {
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
64
59
  status: configProps.status,
65
60
  hideLabel: configProps.hideLabel,
66
61
  displayMode: configProps.displayMode,
62
+ variant: configProps.variant,
67
63
  validatemessage: configProps.validatemessage
68
64
  };
@@ -126,7 +126,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
126
126
  }
127
127
  return displayMode === 'DISPLAY_ONLY' ? (
128
128
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
129
- displayComp
129
+ {displayComp}
130
130
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
131
131
  ) : (
132
132
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
@@ -8,6 +8,7 @@ export const configProps = {
8
8
  testId: 'paragraph-12345678',
9
9
  hasSuggestions: false,
10
10
  displayMode: '',
11
+ variant: '',
11
12
  hideLabel: false,
12
13
  readOnly: false,
13
14
  required: false,
@@ -19,12 +19,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
19
19
 
20
20
  const props = {
21
21
  value: configProps.value,
22
- placeholder: configProps.placeholder,
23
- label: configProps.label,
24
- testId: configProps.testId,
25
22
  hasSuggestions: configProps.hasSuggestions,
26
- datasource: configProps.datasource,
27
- validatemessage: '',
28
23
  getPConnect: () => {
29
24
  return {
30
25
  getStateProps: () => {
@@ -52,6 +47,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
52
47
  };
53
48
 
54
49
  Base{{COMPONENT_CLASS_NAME}}.args = {
50
+ datasource: configProps.datasource,
55
51
  label: configProps.label,
56
52
  helperText: configProps.helperText,
57
53
  placeholder: configProps.placeholder,
@@ -62,5 +58,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
62
58
  status: configProps.status,
63
59
  hideLabel: configProps.hideLabel,
64
60
  displayMode: configProps.displayMode,
61
+ variant: configProps.variant,
65
62
  validatemessage: configProps.validatemessage
66
63
  };
@@ -164,7 +164,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
164
164
  }
165
165
  return displayMode === 'DISPLAY_ONLY' ? (
166
166
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
167
- displayComp
167
+ {displayComp}
168
168
  </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
169
169
  ) : (
170
170
  <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
@@ -26,6 +26,7 @@ export const configProps = {
26
26
  testId: 'phone-12345678',
27
27
  hasSuggestions: false,
28
28
  displayMode: '',
29
+ variant: '',
29
30
  hideLabel: false,
30
31
  readOnly: false,
31
32
  required: false,
@@ -19,12 +19,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
19
19
 
20
20
  const props = {
21
21
  value: configProps.value,
22
- placeholder: configProps.placeholder,
23
- label: configProps.label,
24
- helperText: configProps.helperText,
25
- testId: configProps.testId,
26
22
  hasSuggestions: configProps.hasSuggestions,
27
- validatemessage: '',
28
23
  getPConnect: () => {
29
24
  return {
30
25
  getStateProps: () => {
@@ -62,5 +57,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
62
57
  status: configProps.status,
63
58
  hideLabel: configProps.hideLabel,
64
59
  displayMode: configProps.displayMode,
60
+ variant: configProps.variant,
65
61
  validatemessage: configProps.validatemessage
66
62
  };
@@ -8,6 +8,7 @@ export const configProps = {
8
8
  testId: 'url-12345678',
9
9
  hasSuggestions: false,
10
10
  displayMode: '',
11
+ variant: '',
11
12
  hideLabel: false,
12
13
  readOnly: false,
13
14
  required: false,
@@ -15,6 +15,9 @@ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
15
15
 
16
16
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
17
17
  const props = {
18
+ value: configProps.value,
19
+ additionalProps: configProps.additionalProps,
20
+ hasSuggestions: configProps.hasSuggestions,
18
21
  getPConnect: () => {
19
22
  return {
20
23
  getActionsApi: () => {
@@ -37,21 +40,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
37
40
  ignoreSuggestion: () => {/* nothing */},
38
41
  clearErrorMessages: () => {/* nothing */}
39
42
  };
40
- },
41
- value: configProps.value,
42
- validatemessage: configProps.validatemessage,
43
- label: configProps.label,
44
- hideLabel: configProps.hideLabel,
45
- helperText: configProps.helperText,
46
- withSeconds: configProps.withSeconds,
47
- testId: configProps.testId,
48
- additionalProps: configProps.additionalProps,
49
- displayMode: configProps.displayMode,
50
- variant: configProps.variant,
51
- hasSuggestions: configProps.hasSuggestions,
52
- disabled: configProps.disabled,
53
- readOnly: configProps.readOnly,
54
- required: configProps.required
43
+ }
55
44
  };
56
45
 
57
46
  return (
@@ -72,5 +61,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
72
61
  status: configProps.status,
73
62
  hideLabel: configProps.hideLabel,
74
63
  displayMode: configProps.displayMode,
64
+ variant: configProps.variant,
75
65
  validatemessage: configProps.validatemessage
76
66
  };
@@ -140,7 +140,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
140
140
  );
141
141
  switch (displayMode) {
142
142
  case 'DISPLAY_ONLY': {
143
- return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
143
+ return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
144
144
  }
145
145
  case 'LABELS_LEFT': {
146
146
  return (
@@ -1,28 +1,26 @@
1
1
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
2
  import React from 'react';
3
- import { Status } from "@pega/cosmos-react-core";
3
+ import { Status } from '@pega/cosmos-react-core';
4
4
 
5
5
  export default function StatusWorkRenderer({ value }: any) {
6
- let variant: "pending" | "success" | "info" | "warn" | "urgent" = "info";
6
+ // need to cast variant
7
+ let variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';
8
+ variant = 'info';
7
9
 
8
- const warnStrings = ["fail", "cancel", "reject", "revoke", "stopped", "warn"];
9
- const infoStrings = ["open", "hold", "info", "new"];
10
- const successStrings = ["resolved", "completed", "success"];
11
- const pendingStrings = ["pending"];
10
+ const warnStrings = ['fail', 'cancel', 'reject', 'revoke', 'stopped', 'warn'];
11
+ const infoStrings = ['open', 'hold', 'info', 'new'];
12
+ const successStrings = ['resolved', 'completed', 'success'];
13
+ const pendingStrings = ['pending'];
12
14
 
13
- if (new RegExp(warnStrings.join("|"), "i").test(value)) {
14
- variant = "warn";
15
- } else if (new RegExp(infoStrings.join("|"), "i").test(value)) {
16
- variant = "info";
17
- } else if (new RegExp(successStrings.join("|"), "i").test(value)) {
18
- variant = "success";
19
- } else if (new RegExp(pendingStrings.join("|"), "i").test(value)) {
20
- variant = "pending";
15
+ if (new RegExp(warnStrings.join('|'), 'i').test(value)) {
16
+ variant = 'warn';
17
+ } else if (new RegExp(infoStrings.join('|'), 'i').test(value)) {
18
+ variant = 'info';
19
+ } else if (new RegExp(successStrings.join('|'), 'i').test(value)) {
20
+ variant = 'success';
21
+ } else if (new RegExp(pendingStrings.join('|'), 'i').test(value)) {
22
+ variant = 'pending';
21
23
  }
22
24
 
23
- return (
24
- <Status type="rectangle" variant={variant}>
25
- {value}
26
- </Status>
27
- );
25
+ return <Status variant={variant}>{value}</Status>;
28
26
  }
@@ -88,10 +88,6 @@ const renderField = resolvedProps => {
88
88
 
89
89
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
90
90
  const props = {
91
- template: 'MyCo_MyComponents_NewDetailsTemplate',
92
- showHighlightedData: true,
93
- label: 'Test Details',
94
- showLabel: true,
95
91
  getPConnect: () => {
96
92
  return {
97
93
  getChildren: () => {
@@ -146,4 +142,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
146
142
  );
147
143
  };
148
144
 
149
- Base{{COMPONENT_CLASS_NAME}}.args = {};
145
+ Base{{COMPONENT_CLASS_NAME}}.args = {
146
+ showLabel: true,
147
+ label: 'Details template',
148
+ showHighlightedData: true
149
+ };
@@ -1,28 +1,26 @@
1
1
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
2
  import React from 'react';
3
- import { Status } from "@pega/cosmos-react-core";
3
+ import { Status } from '@pega/cosmos-react-core';
4
4
 
5
5
  export default function StatusWorkRenderer({ value }: any) {
6
- let variant: "pending" | "success" | "info" | "warn" | "urgent" = "info";
6
+ // need to cast variant
7
+ let variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';
8
+ variant = 'info';
7
9
 
8
- const warnStrings = ["fail", "cancel", "reject", "revoke", "stopped", "warn"];
9
- const infoStrings = ["open", "hold", "info", "new"];
10
- const successStrings = ["resolved", "completed", "success"];
11
- const pendingStrings = ["pending"];
10
+ const warnStrings = ['fail', 'cancel', 'reject', 'revoke', 'stopped', 'warn'];
11
+ const infoStrings = ['open', 'hold', 'info', 'new'];
12
+ const successStrings = ['resolved', 'completed', 'success'];
13
+ const pendingStrings = ['pending'];
12
14
 
13
- if (new RegExp(warnStrings.join("|"), "i").test(value)) {
14
- variant = "warn";
15
- } else if (new RegExp(infoStrings.join("|"), "i").test(value)) {
16
- variant = "info";
17
- } else if (new RegExp(successStrings.join("|"), "i").test(value)) {
18
- variant = "success";
19
- } else if (new RegExp(pendingStrings.join("|"), "i").test(value)) {
20
- variant = "pending";
15
+ if (new RegExp(warnStrings.join('|'), 'i').test(value)) {
16
+ variant = 'warn';
17
+ } else if (new RegExp(infoStrings.join('|'), 'i').test(value)) {
18
+ variant = 'info';
19
+ } else if (new RegExp(successStrings.join('|'), 'i').test(value)) {
20
+ variant = 'success';
21
+ } else if (new RegExp(pendingStrings.join('|'), 'i').test(value)) {
22
+ variant = 'pending';
21
23
  }
22
24
 
23
- return (
24
- <Status type="rectangle" variant={variant}>
25
- {value}
26
- </Status>
27
- );
25
+ return <Status variant={variant}>{value}</Status>;
28
26
  }
@@ -86,10 +86,6 @@ const renderField = resolvedProps => {
86
86
 
87
87
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
88
88
  const props = {
89
- template: 'MyCo_MyComponents_NewDetailsTemplate',
90
- showHighlightedData: true,
91
- label: 'Test Details',
92
- showLabel: true,
93
89
  getPConnect: () => {
94
90
  return {
95
91
  getChildren: () => {
@@ -148,4 +144,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
148
144
  );
149
145
  };
150
146
 
151
- Base{{COMPONENT_CLASS_NAME}}.args = {};
147
+ Base{{COMPONENT_CLASS_NAME}}.args = {
148
+ showLabel: true,
149
+ label: 'Details Region template',
150
+ showHighlightedData: true
151
+ };
@@ -142,8 +142,6 @@ const renderField = resolvedProps => {
142
142
 
143
143
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
144
144
  const props = {
145
- NumCols: 1,
146
- template: 'DefaultForm',
147
145
  getPConnect: () => {
148
146
  return {
149
147
  getChildren: () => {
@@ -184,4 +182,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
184
182
  );
185
183
  };
186
184
 
187
- Base{{COMPONENT_CLASS_NAME}}.args = {};
185
+ Base{{COMPONENT_CLASS_NAME}}.args = {
186
+ showLabel: true,
187
+ label: 'Form template',
188
+ NumCols: 1,
189
+ };
@@ -145,7 +145,6 @@ const renderField = resolvedProps => {
145
145
 
146
146
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
147
147
  const props = {
148
- template: 'DefaultForm',
149
148
  getPConnect: () => {
150
149
  return {
151
150
  getChildren: () => {
@@ -190,4 +189,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
190
189
  );
191
190
  };
192
191
 
193
- Base{{COMPONENT_CLASS_NAME}}.args = {};
192
+ Base{{COMPONENT_CLASS_NAME}}.args = {
193
+ showLabel: true,
194
+ label: 'Form Region template',
195
+ };
@@ -35,9 +35,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
35
35
 
36
36
  const props = {
37
37
  useConfigurableLayout: false,
38
- enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
39
38
  icon: pyHome1Raw.config.icon,
40
- title: 'Page Template',
41
39
 
42
40
  getPConnect: () => {
43
41
  return {
@@ -108,4 +106,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
108
106
  );
109
107
  };
110
108
 
111
- Base{{COMPONENT_CLASS_NAME}}.args = {};
109
+ Base{{COMPONENT_CLASS_NAME}}.args = {
110
+ title: 'Page Template',
111
+ enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
112
+ };
@@ -49,7 +49,6 @@ window.PCore.getDataApiUtils = () => {
49
49
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
50
50
 
51
51
  const props = {
52
- label: 'Case history',
53
52
 
54
53
  getPConnect: () => {
55
54
  return {
@@ -83,4 +82,6 @@ return (
83
82
  );
84
83
  };
85
84
 
86
- Base{{COMPONENT_CLASS_NAME}}.args = {};
85
+ Base{{COMPONENT_CLASS_NAME}}.args = {
86
+ label: 'Case history',
87
+ };
@@ -20,13 +20,8 @@ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
20
20
  export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
21
21
 
22
22
  const props = {
23
- label: configProps.label,
24
- header: configProps.header,
25
- description: configProps.description,
26
- image: configProps.image,
27
- datasource: configProps.datasource,
28
- whatsnewlink: configProps.whatsnewlink
29
- };
23
+ image: configProps.image
24
+ };
30
25
 
31
26
  return (
32
27
  <>
@@ -37,5 +32,7 @@ return (
37
32
 
38
33
  Base{{COMPONENT_CLASS_NAME}}.args = {
39
34
  header: configProps.header,
40
- description: configProps.description
35
+ description: configProps.description,
36
+ whatsnewlink: configProps.whatsnewlink,
37
+ datasource: configProps.datasource,
41
38
  };
@@ -41,13 +41,10 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
41
41
 
42
42
  const props = {
43
43
  label: configProps.label,
44
- createLabel: configProps.createLabel,
45
- updateLabel: configProps.updateLabel,
46
44
  createOperator: configProps.createOperator,
47
45
  updateOperator: configProps.updateOperator,
48
46
  createDateTime: configProps.createDateTime,
49
47
  updateDateTime: configProps.updateDateTime,
50
- hideLabel: configProps.hideLabel,
51
48
 
52
49
  getPConnect: () => {
53
50
  return {
@@ -72,4 +69,8 @@ return (
72
69
  );
73
70
  };
74
71
 
75
- Base{{COMPONENT_CLASS_NAME}}.args = {};
72
+ Base{{COMPONENT_CLASS_NAME}}.args = {
73
+ createLabel: configProps.createLabel,
74
+ updateLabel: configProps.updateLabel,
75
+ hideLabel: configProps.hideLabel
76
+ };
@@ -15,3 +15,4 @@ export { default as authenticate } from './authenticate/index.js';
15
15
  export { default as upgrade } from './upgrade/index.js';
16
16
  export { default as buildComponent } from './build-comp/index.js';
17
17
  export { default as buildAllComponents } from './build-all/index.js';
18
+ export { default as buildJestAssets } from './build-jest-assets/index.js';
@@ -7,6 +7,9 @@ const preview = {
7
7
  color: /(background|color)$/i,
8
8
  date: /Date$/i
9
9
  }
10
+ },
11
+ docs: {
12
+ source: { type: 'code' }
10
13
  }
11
14
  }
12
15
  };
@@ -28,6 +28,7 @@
28
28
  "_internal-test-full": "npm run _internal-test-functional && npm run _internal-test-unit",
29
29
  "_internal-test-functional": "npm run test:functional:local --prefix node_modules/@pega/custom-dx-components",
30
30
  "_internal-test-unit": "npm run test:unit:local --prefix node_modules/@pega/custom-dx-components",
31
+ "_internal-build-jest-assets": "custom-dx-components buildJestAssets",
31
32
  "_lint:styles": "stylelint \"./**/*.@(js|jsx|ts|tsx)\"",
32
33
  "_lint:format": "prettier -c .",
33
34
  "_lint:spelling": "cspell --no-progress **/*",
@@ -50,16 +51,16 @@
50
51
  "license": "Enter License",
51
52
  "sideEffects": false,
52
53
  "dependencies": {
53
- "@pega/cosmos-react-condition-builder": "^4.2.0",
54
- "@pega/cosmos-react-core": "^4.2.0",
55
- "@pega/cosmos-react-work": "^4.2.0",
54
+ "@pega/cosmos-react-condition-builder": "^6.0.3",
55
+ "@pega/cosmos-react-core": "^6.0.3",
56
+ "@pega/cosmos-react-work": "^6.0.3",
56
57
  "dayjs": "^1.11.10",
57
58
  "lodash.get": "^4.4.2",
58
59
  "polished": "^4.2.2",
59
60
  "prop-types": "^15.8.1",
60
- "react": "^17.0.2",
61
+ "react": "^18.2.0",
61
62
  "react-autosuggest": "^10.1.0",
62
- "react-dom": "^17.0.2",
63
+ "react-dom": "^18.2.0",
63
64
  "react-is": "^18.2.0",
64
65
  "react-player": "^2.10.1",
65
66
  "react-redux": "^7.2.6",
@@ -68,7 +69,7 @@
68
69
  },
69
70
  "devDependencies": {
70
71
  "@pega/configs": "^0.6.0",
71
- "@pega/custom-dx-components": "0.23.49",
72
+ "@pega/custom-dx-components": "0.24.2",
72
73
  "@pega/pcore-pconnect-typedefs": "~2.1.1",
73
74
  "@storybook/addon-actions": "^7.6.7",
74
75
  "@storybook/addon-essentials": "^7.6.7",