@ukhomeoffice/cop-react-form-renderer 5.28.1 → 5.32.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 (61) hide show
  1. package/dist/components/CheckYourAnswers/CheckYourAnswers.js +2 -2
  2. package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +2 -2
  3. package/dist/components/CollectionPage/CollectionPage.js +2 -2
  4. package/dist/components/CollectionPage/CollectionPage.test.js +2 -2
  5. package/dist/components/CollectionSummary/BannerStrip.js +59 -0
  6. package/dist/components/CollectionSummary/BannerStrip.scss +47 -0
  7. package/dist/components/CollectionSummary/BannerStrip.test.js +111 -0
  8. package/dist/components/CollectionSummary/CollectionSummary.js +183 -0
  9. package/dist/components/CollectionSummary/CollectionSummary.scss +21 -0
  10. package/dist/components/CollectionSummary/CollectionSummary.test.js +170 -0
  11. package/dist/components/CollectionSummary/Confirmation.js +60 -0
  12. package/dist/components/CollectionSummary/Confirmation.scss +14 -0
  13. package/dist/components/CollectionSummary/Confirmation.test.js +102 -0
  14. package/dist/components/CollectionSummary/SummaryCard.js +274 -0
  15. package/dist/components/CollectionSummary/SummaryCard.scss +248 -0
  16. package/dist/components/CollectionSummary/SummaryCard.test.js +1164 -0
  17. package/dist/components/CollectionSummary/index.js +10 -0
  18. package/dist/components/FormComponent/Collection.js +2 -2
  19. package/dist/components/FormComponent/FormComponent.js +23 -6
  20. package/dist/components/FormComponent/FormComponent.test.js +66 -34
  21. package/dist/components/FormPage/FormPage.js +12 -5
  22. package/dist/components/FormPage/FormPage.test.js +2 -2
  23. package/dist/components/FormRenderer/FormRenderer.js +10 -5
  24. package/dist/components/FormRenderer/FormRenderer.test.js +218 -133
  25. package/dist/components/FormRenderer/onCYAAction.js +20 -9
  26. package/dist/components/FormRenderer/onCYAAction.test.js +8 -1
  27. package/dist/components/FormRenderer/onPageAction.js +12 -16
  28. package/dist/components/FormRenderer/onPageAction.test.js +11 -7
  29. package/dist/components/PageActions/ActionButton.test.js +2 -2
  30. package/dist/components/SummaryList/GroupAction.js +2 -2
  31. package/dist/components/SummaryList/RowAction.js +2 -2
  32. package/dist/components/SummaryList/SummaryList.test.js +2 -2
  33. package/dist/components/TaskList/Task.js +2 -2
  34. package/dist/components/TaskList/TaskList.js +2 -2
  35. package/dist/components/TaskList/TaskList.test.js +2 -2
  36. package/dist/context/HooksContext/HooksContext.js +2 -2
  37. package/dist/context/HooksContext/HooksContext.test.js +2 -2
  38. package/dist/context/HooksContext/index.js +2 -2
  39. package/dist/context/ValidationContext/ValidationContext.js +2 -2
  40. package/dist/context/ValidationContext/ValidationContext.test.js +2 -2
  41. package/dist/context/ValidationContext/index.js +2 -2
  42. package/dist/hooks/index.js +2 -2
  43. package/dist/hooks/useRefData.js +2 -2
  44. package/dist/index.js +2 -2
  45. package/dist/models/ComponentTypes.js +2 -0
  46. package/dist/utils/CheckYourAnswers/showComponentCYA.js +1 -1
  47. package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +4 -21
  48. package/dist/utils/CollectionPage/duplicateCollectionPageEntry.js +32 -0
  49. package/dist/utils/CollectionPage/duplicateCollectionPageEntry.test.js +68 -0
  50. package/dist/utils/CollectionPage/getQuickEditPage.js +74 -0
  51. package/dist/utils/CollectionPage/getQuickEditPage.test.js +109 -0
  52. package/dist/utils/CollectionPage/index.js +4 -0
  53. package/dist/utils/CollectionPage/removeCollectionPageEntry.js +36 -0
  54. package/dist/utils/CollectionPage/removeCollectionPageEntry.test.js +61 -0
  55. package/dist/utils/Component/cleanAttributes.test.js +2 -2
  56. package/dist/utils/Component/isEditable.test.js +2 -2
  57. package/dist/utils/Format/formatDataForComponent.test.js +2 -2
  58. package/dist/utils/Format/formatDataForPage.test.js +2 -2
  59. package/dist/utils/Validate/validateDate.test.js +2 -2
  60. package/dist/utils/Validate/validateMultifile.test.js +2 -2
  61. package/package.json +1 -1
@@ -0,0 +1,248 @@
1
+ $govuk-font-family: 'Roboto', arial, sans-serif;
2
+
3
+ @import "node_modules/govuk-frontend/govuk/_base";
4
+
5
+ .govuk-grid-column-two-thirds:has(.hods-form-summary-card) {
6
+ width: 100% !important;
7
+ }
8
+
9
+ .govuk-form-group:has(.hods-form-summary-card) {
10
+ .govuk-form-group:last-of-type {
11
+ margin-left: govuk-spacing(3);
12
+ }
13
+ }
14
+
15
+ .hods-form-summary-card {
16
+ box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
17
+ border: 1px solid #E5E4E2;
18
+ margin: 1rem 0;
19
+ padding: 0.75rem;
20
+ display: block;
21
+
22
+ &--deleting-summary-card {
23
+ background-color: #FCF0EE;
24
+ }
25
+
26
+ &__header {
27
+ width: auto;
28
+ display: flex;
29
+ flex-direction: row;
30
+ color: #0b0c0c;
31
+ padding: govuk-spacing(3) govuk-spacing(4) 0;
32
+
33
+ &-content,
34
+ &-actions {
35
+ display: block;
36
+ }
37
+
38
+ &-content {
39
+ width: 65%;
40
+ @include govuk-font($size: 24, $weight: bold);
41
+
42
+ &-title,
43
+ &-detail {
44
+ display: inline-block;
45
+ margin-bottom: govuk-spacing(1);
46
+ margin-right: govuk-spacing(2);
47
+ }
48
+
49
+ &-detail {
50
+ font-weight: normal;
51
+ }
52
+ }
53
+
54
+ &-actions {
55
+ width: 35%;
56
+
57
+ .hods-button--primary {
58
+ @extend .hods-button--primary;
59
+ margin-right: govuk-spacing(2);
60
+ }
61
+
62
+ .hods-button--secondary {
63
+ @extend .hods-button--secondary;
64
+ margin-right: govuk-spacing(2);
65
+ }
66
+ }
67
+ }
68
+
69
+ &__editpage {
70
+ margin: 0 govuk-spacing(4)
71
+ }
72
+
73
+ &__body {
74
+ display: block;
75
+ padding: 0 0 0 govuk-spacing(4);
76
+ margin-top: govuk-spacing(1);
77
+
78
+ .hods-details__summary {
79
+ text-decoration: underline;
80
+ }
81
+
82
+ .details.hods-details {
83
+ margin-bottom: 0;
84
+ }
85
+ }
86
+
87
+ &__section {
88
+ border-bottom: 2px solid #A9A9A9;
89
+
90
+ &-title {
91
+ font-weight: bold;
92
+ margin: govuk-spacing(2) 0 govuk-spacing(6) 0;
93
+ }
94
+
95
+ &-content {
96
+ display: flex;
97
+ flex-wrap: wrap;
98
+ gap: govuk-spacing(2);
99
+
100
+ .hods-form-summary-card__field {
101
+ box-sizing: border-box;
102
+ margin-bottom: govuk-spacing(4);
103
+
104
+ .govuk-label,
105
+ .govuk-fieldset__legend {
106
+ font-weight: bold;
107
+ margin-bottom: govuk-spacing(1) !important;
108
+
109
+ &::after {
110
+ content: " :";
111
+ }
112
+ }
113
+
114
+ div.govuk-form-group div:has(img){
115
+ display: flex;
116
+ flex-wrap: wrap;
117
+
118
+ .hods-readonly.hods-readonly--success {
119
+ font-size: 0;
120
+ line-height: 0;
121
+
122
+ .cop-upload-preview__thumb {
123
+ display: inline-block;
124
+ margin-right: govuk-spacing(1);
125
+ }
126
+ }
127
+
128
+ }
129
+ }
130
+
131
+ &--columns-1,
132
+ &--columns-2,
133
+ &--columns-3 {
134
+ position: relative;
135
+ margin-bottom: govuk-spacing(1);
136
+
137
+ &::before {
138
+ content: "";
139
+ position: absolute;
140
+ top: 0;
141
+ width: 2px;
142
+ height: 100%;
143
+ background-color: #A9A9A9;
144
+ left: 0;
145
+ }
146
+ }
147
+
148
+ &--columns-2 {
149
+ &::after {
150
+ content: "";
151
+ position: absolute;
152
+ top: 0;
153
+ width: 2px;
154
+ height: 100%;
155
+ background-color: #A9A9A9;
156
+ left: 50%;
157
+ }
158
+
159
+ .hods-form-summary-card__field {
160
+ flex: 0 0 calc(50% - 10px);
161
+ }
162
+ }
163
+
164
+ &--columns-3 {
165
+ &::after {
166
+ content: "";
167
+ position: absolute;
168
+ top: 0;
169
+ left: 33.333%;
170
+ width: 2px;
171
+ height: 100%;
172
+ background-color: #A9A9A9;
173
+ }
174
+
175
+ .hods-form-summary-card__field {
176
+ flex: 0 0 calc(33.333% - 10px);
177
+
178
+ &:nth-child(2)::after {
179
+ content: "";
180
+ position: absolute;
181
+ top: 0;
182
+ right: 33.333%;
183
+ width: 2px;
184
+ height: 100%;
185
+ background-color: #A9A9A9;
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ @media (max-width: 640px) {
194
+ .hods-form-summary-card {
195
+ &__header {
196
+ flex-direction: column;
197
+
198
+ &-content {
199
+ width: 100%;
200
+ }
201
+
202
+ &-actions {
203
+ width: 100%;
204
+ margin-top: govuk-spacing(2);
205
+ }
206
+ }
207
+
208
+ &__section {
209
+ &-content {
210
+ display: block;
211
+
212
+ .hods-form-summary-card__field {
213
+ width: 100%;
214
+ }
215
+
216
+ .hods-form-summary-card__field:nth-child(2)::after {
217
+ display: none;
218
+ }
219
+
220
+ &--columns-2,
221
+ &--columns-3 {
222
+ position: relative;
223
+ margin-bottom: govuk-spacing(1);
224
+
225
+ &::before {
226
+ content: '';
227
+ position: absolute;
228
+ top: 0;
229
+ width: 2px;
230
+ height: 100%;
231
+ background-color: #A9A9A9;
232
+ left: 0;
233
+ }
234
+
235
+ &::after {
236
+ display: none;
237
+ }
238
+ }
239
+
240
+ &--columns-3 {
241
+ .hods-form-summary-card__field:nth-child(2)::after {
242
+ content: none;
243
+ }
244
+ }
245
+ }
246
+ }
247
+ }
248
+ }