@coorpacademy/components 10.1.0 → 10.1.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.
- package/es/atom/input-text/index.js +34 -6
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/input-text/style.css +224 -1
- package/es/atom/input-text/test/fixtures/cm-default.js +17 -0
- package/es/atom/input-text/test/fixtures/cm-default.js.map +1 -0
- package/es/molecule/wizard-summary/index.js +160 -0
- package/es/molecule/wizard-summary/index.js.map +1 -0
- package/es/molecule/wizard-summary/style.css +150 -0
- package/es/molecule/wizard-summary/test/fixtures/default.js +117 -0
- package/es/molecule/wizard-summary/test/fixtures/default.js.map +1 -0
- package/es/molecule/wizard-summary/test/fixtures/one-section.js +22 -0
- package/es/molecule/wizard-summary/test/fixtures/one-section.js.map +1 -0
- package/es/molecule/wizard-summary/test/fixtures/three-sections.js +41 -0
- package/es/molecule/wizard-summary/test/fixtures/three-sections.js.map +1 -0
- package/es/molecule/wizard-summary/test/fixtures/two-sections.js +34 -0
- package/es/molecule/wizard-summary/test/fixtures/two-sections.js.map +1 -0
- package/es/organism/user-preferences/style.css +1 -0
- package/es/variables/colors.css +4 -0
- package/lib/atom/input-text/index.js +36 -6
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/input-text/style.css +224 -1
- package/lib/atom/input-text/test/fixtures/cm-default.js +22 -0
- package/lib/atom/input-text/test/fixtures/cm-default.js.map +1 -0
- package/lib/molecule/wizard-summary/index.js +177 -0
- package/lib/molecule/wizard-summary/index.js.map +1 -0
- package/lib/molecule/wizard-summary/style.css +150 -0
- package/lib/molecule/wizard-summary/test/fixtures/default.js +122 -0
- package/lib/molecule/wizard-summary/test/fixtures/default.js.map +1 -0
- package/lib/molecule/wizard-summary/test/fixtures/one-section.js +27 -0
- package/lib/molecule/wizard-summary/test/fixtures/one-section.js.map +1 -0
- package/lib/molecule/wizard-summary/test/fixtures/three-sections.js +46 -0
- package/lib/molecule/wizard-summary/test/fixtures/three-sections.js.map +1 -0
- package/lib/molecule/wizard-summary/test/fixtures/two-sections.js +39 -0
- package/lib/molecule/wizard-summary/test/fixtures/two-sections.js.map +1 -0
- package/lib/organism/user-preferences/style.css +1 -0
- package/lib/variables/colors.css +4 -0
- package/package.json +3 -3
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
@value dark from colors;
|
|
6
6
|
@value grey from colors;
|
|
7
7
|
@value medium from colors;
|
|
8
|
+
@value xtraLightGrey from colors;
|
|
9
|
+
@value cm_positive_100 from colors;
|
|
10
|
+
@value cm_negative_100 from colors;
|
|
11
|
+
@value cm_grey_100 from colors;
|
|
12
|
+
@value cm_grey_150 from colors;
|
|
13
|
+
@value cm_grey_200 from colors;
|
|
14
|
+
@value cm_grey_400 from colors;
|
|
15
|
+
@value cm_grey_500 from colors;
|
|
16
|
+
@value cm_grey_700 from colors;
|
|
8
17
|
|
|
9
18
|
.default {
|
|
10
19
|
display: flex;
|
|
@@ -64,7 +73,7 @@
|
|
|
64
73
|
bottom: 65px;
|
|
65
74
|
left: 20px;
|
|
66
75
|
max-width: 380px;
|
|
67
|
-
transition: opacity 0.
|
|
76
|
+
transition: opacity 0.25s ease-in;
|
|
68
77
|
}
|
|
69
78
|
.cockpit .description:after {
|
|
70
79
|
content: "";
|
|
@@ -168,3 +177,217 @@
|
|
|
168
177
|
color: medium;
|
|
169
178
|
font-style: italic;
|
|
170
179
|
}
|
|
180
|
+
/******************************* coorpmanager theme ***************************************/
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
.coorpmanager {
|
|
184
|
+
width: 300px;
|
|
185
|
+
position: relative;
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
align-items: flex-start;
|
|
189
|
+
flex-wrap: nowrap;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.coorpmanager label {
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
align-items: flex-start;
|
|
196
|
+
height: 0px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.coorpmanager .title {
|
|
200
|
+
flex-grow: 0;
|
|
201
|
+
font-family: Gilroy;
|
|
202
|
+
font-size: 10px;
|
|
203
|
+
font-weight: bold;
|
|
204
|
+
font-stretch: normal;
|
|
205
|
+
font-style: normal;
|
|
206
|
+
line-height: 1.2;
|
|
207
|
+
letter-spacing: normal;
|
|
208
|
+
text-align: left;
|
|
209
|
+
margin: 7px 0px -19px 16px;
|
|
210
|
+
z-index: 1;
|
|
211
|
+
color: cm_grey_400;
|
|
212
|
+
width: auto;
|
|
213
|
+
transition: all 0.25s linear;
|
|
214
|
+
pointer-events: none;
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-direction: row;
|
|
217
|
+
flex-wrap: nowrap;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.coorpmanager .title.noValue .infoIcon {
|
|
221
|
+
height: 10px;
|
|
222
|
+
width: 10px;
|
|
223
|
+
line-height: 12px;
|
|
224
|
+
color: cm_grey_500;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.coorpmanager input {
|
|
228
|
+
width: 300px;
|
|
229
|
+
height: 44px;
|
|
230
|
+
margin: 0px;
|
|
231
|
+
flex-grow: 0;
|
|
232
|
+
display: flex;
|
|
233
|
+
box-sizing: border-box;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
align-items: flex-start;
|
|
237
|
+
padding: 19px 30px 5px 16px;
|
|
238
|
+
border-radius: 7px;
|
|
239
|
+
background-color: cm_grey_100;
|
|
240
|
+
font-family: Gilroy;
|
|
241
|
+
font-size: 14px;
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
font-stretch: normal;
|
|
244
|
+
font-style: normal;
|
|
245
|
+
line-height: 44px;
|
|
246
|
+
letter-spacing: normal;
|
|
247
|
+
text-align: left;
|
|
248
|
+
color: cm_grey_700;
|
|
249
|
+
border: none;
|
|
250
|
+
transition: all 0.25s linear;
|
|
251
|
+
outline: none;
|
|
252
|
+
display: flex;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.coorpmanager .title.noValue{
|
|
256
|
+
font-size: 14px;
|
|
257
|
+
font-weight: 500;
|
|
258
|
+
color: cm_grey_700;
|
|
259
|
+
margin: 14px 0px -30px 16px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.coorpmanager:focus-within .title.noValue {
|
|
263
|
+
font-size: 10px;
|
|
264
|
+
font-weight: bold;
|
|
265
|
+
color: cm_grey_400;
|
|
266
|
+
margin: 7px 0px -19px 16px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.coorpmanager:focus-within input::placeholder {
|
|
270
|
+
color: cm_grey_400;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.coorpmanager:focus-within .title.noValue .infoIcon {
|
|
274
|
+
width: 8px;
|
|
275
|
+
height: 8px;
|
|
276
|
+
line-height: 12px;
|
|
277
|
+
color: cm_grey_400;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.coorpmanager input:hover {
|
|
281
|
+
background-color: cm_grey_150;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.coorpmanager input::placeholder {
|
|
285
|
+
color: transparent;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.coorpmanager .hint {
|
|
289
|
+
flex-grow: 0;
|
|
290
|
+
opacity: 0.5;
|
|
291
|
+
font-family: Gilroy;
|
|
292
|
+
font-size: 10px;
|
|
293
|
+
font-weight: 500;
|
|
294
|
+
font-stretch: normal;
|
|
295
|
+
font-style: normal;
|
|
296
|
+
line-height: 1.2;
|
|
297
|
+
letter-spacing: normal;
|
|
298
|
+
text-align: left;
|
|
299
|
+
padding-top: 8px;
|
|
300
|
+
color: cm_grey_700;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.coorpmanager.error .hint {
|
|
304
|
+
color: cm_negative_100;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.coorpmanager.error .leftIcon {
|
|
308
|
+
background-color: cm_negative_100;
|
|
309
|
+
color: white;
|
|
310
|
+
border-radius: 50%;
|
|
311
|
+
padding: 2px;
|
|
312
|
+
width: 8px;
|
|
313
|
+
height: 8px;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.coorpmanager .leftIcon {
|
|
317
|
+
color: cm_positive_100;
|
|
318
|
+
width: 14px;
|
|
319
|
+
height: 14px;
|
|
320
|
+
position: absolute;
|
|
321
|
+
right: 15px;
|
|
322
|
+
top: 16px;
|
|
323
|
+
line-height: 16px;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.coorpmanager.disabled {
|
|
327
|
+
opacity: 0.5;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.coorpmanager .infoIconWrapper {
|
|
331
|
+
overflow: visible;
|
|
332
|
+
height: 12px;
|
|
333
|
+
margin: 0px 4px;
|
|
334
|
+
cursor: pointer;
|
|
335
|
+
pointer-events: fill;
|
|
336
|
+
position: relative;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.coorpmanager .infoIcon {
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
width: 8px;
|
|
342
|
+
height: 8px;
|
|
343
|
+
line-height: 16px;
|
|
344
|
+
color: cm_grey_400;
|
|
345
|
+
transition: all 0.25s linear;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.coorpmanager .infoIconWrapper:hover .descriptionLabel {
|
|
349
|
+
visibility: visible;
|
|
350
|
+
opacity: 1;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.coorpmanager .descriptionLabel {
|
|
354
|
+
margin: 0 1px 18px 0;
|
|
355
|
+
padding: 8px 16px;
|
|
356
|
+
border-radius: 7px;
|
|
357
|
+
background-color: cm_grey_700;
|
|
358
|
+
flex-grow: 0;
|
|
359
|
+
font-family: Gilroy;
|
|
360
|
+
font-size: 14px;
|
|
361
|
+
font-weight: 500;
|
|
362
|
+
font-stretch: normal;
|
|
363
|
+
font-style: normal;
|
|
364
|
+
line-height: 1.43;
|
|
365
|
+
letter-spacing: normal;
|
|
366
|
+
text-align: center;
|
|
367
|
+
color: white;
|
|
368
|
+
padding: 8px 16px;
|
|
369
|
+
max-width: 200px;
|
|
370
|
+
position: absolute;
|
|
371
|
+
left: -24px;
|
|
372
|
+
z-index: 3;
|
|
373
|
+
bottom: 5px;
|
|
374
|
+
width: max-content;
|
|
375
|
+
visibility: hidden;
|
|
376
|
+
opacity: 0s
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.coorpmanager .descriptionLabel::after{
|
|
380
|
+
content:'';
|
|
381
|
+
border-left: 6px solid transparent;
|
|
382
|
+
border-right: 6px solid transparent;
|
|
383
|
+
border-top: 6px solid cm_grey_700;
|
|
384
|
+
position: absolute;
|
|
385
|
+
bottom: -6px;
|
|
386
|
+
left: 21px;
|
|
387
|
+
}
|
|
388
|
+
.coorpmanager .title.noValue .descriptionLabel::after{
|
|
389
|
+
left: 22px;
|
|
390
|
+
}
|
|
391
|
+
.coorpmanager:focus-within .title.noValue .descriptionLabel::after{
|
|
392
|
+
left: 21px;
|
|
393
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _default = {
|
|
6
|
+
props: {
|
|
7
|
+
type: 'text',
|
|
8
|
+
title: 'Input name',
|
|
9
|
+
hint: 'Hint <span style="color:red;">10<span>/40',
|
|
10
|
+
placeholder: 'This is an input',
|
|
11
|
+
theme: 'coorpmanager',
|
|
12
|
+
description: 'This is the tooltip text',
|
|
13
|
+
value: 'This is an input',
|
|
14
|
+
disabled: false,
|
|
15
|
+
valid: false,
|
|
16
|
+
error: '',
|
|
17
|
+
required: true,
|
|
18
|
+
onChange: value => console.log(value)
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
//# sourceMappingURL=cm-default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/input-text/test/fixtures/cm-default.js"],"names":["props","type","title","hint","placeholder","theme","description","value","disabled","valid","error","required","onChange","console","log"],"mappings":";;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,MADD;AAELC,IAAAA,KAAK,EAAE,YAFF;AAGLC,IAAAA,IAAI,EAAE,2CAHD;AAILC,IAAAA,WAAW,EAAE,kBAJR;AAKLC,IAAAA,KAAK,EAAE,cALF;AAMLC,IAAAA,WAAW,EAAE,0BANR;AAOLC,IAAAA,KAAK,EAAE,kBAPF;AAQLC,IAAAA,QAAQ,EAAE,KARL;AASLC,IAAAA,KAAK,EAAE,KATF;AAULC,IAAAA,KAAK,EAAE,EAVF;AAWLC,IAAAA,QAAQ,EAAE,IAXL;AAYLC,IAAAA,QAAQ,EAAEL,KAAK,IAAIM,OAAO,CAACC,GAAR,CAAYP,KAAZ;AAZd;AADM,C","sourcesContent":["export default {\n props: {\n type: 'text',\n title: 'Input name',\n hint: 'Hint <span style=\"color:red;\">10<span>/40',\n placeholder: 'This is an input',\n theme: 'coorpmanager',\n description: 'This is the tooltip text',\n value: 'This is an input',\n disabled: false,\n valid: false,\n error: '',\n required: true,\n onChange: value => console.log(value)\n }\n};\n"],"file":"cm-default.js"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
11
|
+
|
|
12
|
+
var _link = _interopRequireDefault(require("../../atom/link"));
|
|
13
|
+
|
|
14
|
+
var _contentBadge = _interopRequireDefault(require("../../atom/content-badge"));
|
|
15
|
+
|
|
16
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
const buildItemsOfSection = items => {
|
|
25
|
+
return items.map((item, index) => {
|
|
26
|
+
const {
|
|
27
|
+
type
|
|
28
|
+
} = item;
|
|
29
|
+
|
|
30
|
+
switch (type) {
|
|
31
|
+
case 'mainElement':
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
33
|
+
key: `${item.title}-${index}`
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
+
className: _style.default.title
|
|
36
|
+
}, item.title), /*#__PURE__*/_react.default.createElement("span", {
|
|
37
|
+
className: _style.default.value
|
|
38
|
+
}, item.value));
|
|
39
|
+
|
|
40
|
+
case 'content':
|
|
41
|
+
{
|
|
42
|
+
const {
|
|
43
|
+
category,
|
|
44
|
+
label,
|
|
45
|
+
title,
|
|
46
|
+
author
|
|
47
|
+
} = item;
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
49
|
+
className: _style.default.contentWrapper,
|
|
50
|
+
key: `${title}-${index}`
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
52
|
+
className: _style.default.contentCounter
|
|
53
|
+
}, index + 1), /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
className: _style.default.contentItem
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
56
|
+
className: _style.default.content
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_contentBadge.default, {
|
|
58
|
+
category: category,
|
|
59
|
+
label: label
|
|
60
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
61
|
+
className: _style.default.contentTitle,
|
|
62
|
+
title: title // eslint-disable-next-line react/no-danger
|
|
63
|
+
,
|
|
64
|
+
dangerouslySetInnerHTML: {
|
|
65
|
+
__html: title
|
|
66
|
+
}
|
|
67
|
+
})), author ? /*#__PURE__*/_react.default.createElement("span", {
|
|
68
|
+
className: _style.default.author
|
|
69
|
+
}, author) : null));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
case 'text':
|
|
73
|
+
default:
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
75
|
+
key: `${item.text}-${index}`
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
77
|
+
className: _style.default.valueSimpleText
|
|
78
|
+
}, item.text));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const buildSectionHeader = section => {
|
|
84
|
+
const {
|
|
85
|
+
title,
|
|
86
|
+
counterText
|
|
87
|
+
} = section;
|
|
88
|
+
|
|
89
|
+
if (!title) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
+
className: _style.default.sectionHeader
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
96
|
+
className: _style.default.title
|
|
97
|
+
}, title), counterText ? /*#__PURE__*/_react.default.createElement("span", {
|
|
98
|
+
className: _style.default.counterText
|
|
99
|
+
}, counterText) : null);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const buildSections = sections => {
|
|
103
|
+
return sections.map((section, index) => {
|
|
104
|
+
const sectionHeader = buildSectionHeader(section);
|
|
105
|
+
const itemsView = buildItemsOfSection(section.items);
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
+
key: `summary-section-${index}`,
|
|
108
|
+
"data-step": index,
|
|
109
|
+
className: _style.default.sectionWrapper
|
|
110
|
+
}, sectionHeader, /*#__PURE__*/_react.default.createElement("ul", null, itemsView));
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const buildAction = action => {
|
|
115
|
+
if (!action) return null;
|
|
116
|
+
const {
|
|
117
|
+
onClick,
|
|
118
|
+
text,
|
|
119
|
+
icon
|
|
120
|
+
} = action;
|
|
121
|
+
const handleClick = (0, _react.useMemo)(() => () => onClick(), [onClick]);
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
123
|
+
className: _style.default.actionLink,
|
|
124
|
+
onClick: handleClick
|
|
125
|
+
}, icon === 'draft' ? /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidComputersSdCard, {
|
|
126
|
+
className: _style.default.icon
|
|
127
|
+
}) : null, /*#__PURE__*/_react.default.createElement("span", null, text));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const WizardSummary = props => {
|
|
131
|
+
const {
|
|
132
|
+
title,
|
|
133
|
+
sections,
|
|
134
|
+
action
|
|
135
|
+
} = props;
|
|
136
|
+
const sectionView = buildSections(sections);
|
|
137
|
+
const actionView = buildAction(action);
|
|
138
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
139
|
+
className: _style.default.container
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
141
|
+
className: _style.default.summaryTitle
|
|
142
|
+
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
143
|
+
className: _style.default.summary
|
|
144
|
+
}, sectionView), /*#__PURE__*/_react.default.createElement("div", {
|
|
145
|
+
className: _style.default.actionZone
|
|
146
|
+
}, actionView));
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
WizardSummary.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
150
|
+
title: _propTypes.default.string,
|
|
151
|
+
sections: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
152
|
+
title: _propTypes.default.string,
|
|
153
|
+
items: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
154
|
+
type: _propTypes.default.string,
|
|
155
|
+
title: _propTypes.default.string,
|
|
156
|
+
value: _propTypes.default.string
|
|
157
|
+
}), _propTypes.default.shape({
|
|
158
|
+
type: _propTypes.default.string,
|
|
159
|
+
text: _propTypes.default.string
|
|
160
|
+
}), _propTypes.default.shape({
|
|
161
|
+
type: _propTypes.default.string,
|
|
162
|
+
category: _propTypes.default.oneOf(['base', 'advanced', 'coach', 'chapter', 'scorm', 'video', 'article', 'podcast']),
|
|
163
|
+
title: _propTypes.default.string,
|
|
164
|
+
label: _propTypes.default.string,
|
|
165
|
+
author: _propTypes.default.string
|
|
166
|
+
})])),
|
|
167
|
+
counterText: _propTypes.default.string
|
|
168
|
+
})),
|
|
169
|
+
action: _propTypes.default.shape({
|
|
170
|
+
icon: _propTypes.default.string,
|
|
171
|
+
text: _propTypes.default.string,
|
|
172
|
+
onClick: _propTypes.default.func
|
|
173
|
+
})
|
|
174
|
+
} : {};
|
|
175
|
+
var _default = WizardSummary;
|
|
176
|
+
exports.default = _default;
|
|
177
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/wizard-summary/index.js"],"names":["buildItemsOfSection","items","map","item","index","type","title","style","value","category","label","author","contentWrapper","contentCounter","contentItem","content","contentTitle","__html","text","valueSimpleText","buildSectionHeader","section","counterText","sectionHeader","buildSections","sections","itemsView","sectionWrapper","buildAction","action","onClick","icon","handleClick","actionLink","WizardSummary","props","sectionView","actionView","container","summaryTitle","summary","actionZone","propTypes","PropTypes","string","arrayOf","shape","oneOfType","oneOf","func"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,MAAMA,mBAAmB,GAAGC,KAAK,IAAI;AACnC,SAAOA,KAAK,CAACC,GAAN,CAAU,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAACC,MAAAA;AAAD,QAASF,IAAf;;AACA,YAAQE,IAAR;AACE,WAAK,aAAL;AACE,4BACE;AAAI,UAAA,GAAG,EAAG,GAAEF,IAAI,CAACG,KAAM,IAAGF,KAAM;AAAhC,wBACE;AAAM,UAAA,SAAS,EAAEG,eAAMD;AAAvB,WAA+BH,IAAI,CAACG,KAApC,CADF,eAEE;AAAM,UAAA,SAAS,EAAEC,eAAMC;AAAvB,WAA+BL,IAAI,CAACK,KAApC,CAFF,CADF;;AAMF,WAAK,SAAL;AAAgB;AACd,gBAAM;AAACC,YAAAA,QAAD;AAAWC,YAAAA,KAAX;AAAkBJ,YAAAA,KAAlB;AAAyBK,YAAAA;AAAzB,cAAmCR,IAAzC;AACA,8BACE;AAAI,YAAA,SAAS,EAAEI,eAAMK,cAArB;AAAqC,YAAA,GAAG,EAAG,GAAEN,KAAM,IAAGF,KAAM;AAA5D,0BACE;AAAM,YAAA,SAAS,EAAEG,eAAMM;AAAvB,aAAwCT,KAAK,GAAG,CAAhD,CADF,eAEE;AAAK,YAAA,SAAS,EAAEG,eAAMO;AAAtB,0BACE;AAAK,YAAA,SAAS,EAAEP,eAAMQ;AAAtB,0BACE,6BAAC,qBAAD;AAAc,YAAA,QAAQ,EAAEN,QAAxB;AAAkC,YAAA,KAAK,EAAEC;AAAzC,YADF,eAEE;AACE,YAAA,SAAS,EAAEH,eAAMS,YADnB;AAEE,YAAA,KAAK,EAAEV,KAFT,CAGE;AA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,EAAEqC,mBAAUC,MADH;AAEd3C,IAAAA,KAAK,EAAE0C,mBAAUE,OAAV,CACLF,mBAAUI,SAAV,CAAoB,CAClBJ,mBAAUG,KAAV,CAAgB;AACdzC,MAAAA,IAAI,EAAEsC,mBAAUC,MADF;AAEdtC,MAAAA,KAAK,EAAEqC,mBAAUC,MAFH;AAGdpC,MAAAA,KAAK,EAAEmC,mBAAUC;AAHH,KAAhB,CADkB,EAMlBD,mBAAUG,KAAV,CAAgB;AACdzC,MAAAA,IAAI,EAAEsC,mBAAUC,MADF;AAEd1B,MAAAA,IAAI,EAAEyB,mBAAUC;AAFF,KAAhB,CANkB,EAUlBD,mBAAUG,KAAV,CAAgB;AACdzC,MAAAA,IAAI,EAAEsC,mBAAUC,MADF;AAEdnC,MAAAA,QAAQ,EAAEkC,mBAAUK,KAAV,CAAgB,CACxB,MADwB,EAExB,UAFwB,EAGxB,OAHwB,EAIxB,SAJwB,EAKxB,OALwB,EAMxB,OANwB,EAOxB,SAPwB,EAQxB,SARwB,CAAhB,CAFI;AAYd1C,MAAAA,KAAK,EAAEqC,mBAAUC,MAZH;AAadlC,MAAAA,KAAK,EAAEiC,mBAAUC,MAbH;AAcdjC,MAAAA,MAAM,EAAEgC,mBAAUC;AAdJ,KAAhB,CAVkB,CAApB,CADK,CAFO;AA+BdtB,IAAAA,WAAW,EAAEqB,mBAAUC;AA/BT,GAAhB,CADQ,CAFc;AAqCxBf,EAAAA,MAAM,EAAEc,mBAAUG,KAAV,CAAgB;AACtBf,IAAAA,IAAI,EAAEY,mBAAUC,MADM;AAEtB1B,IAAAA,IAAI,EAAEyB,mBAAUC,MAFM;AAGtBd,IAAAA,OAAO,EAAEa,mBAAUM;AAHG,GAAhB;AArCgB,CAA1B;eA4Cef,a","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {NovaSolidComputersSdCard} from '@coorpacademy/nova-icons';\nimport Link from '../../atom/link';\nimport ContentBagde from '../../atom/content-badge';\nimport style from './style.css';\n\nconst buildItemsOfSection = items => {\n return items.map((item, index) => {\n const {type} = item;\n switch (type) {\n case 'mainElement':\n return (\n <li key={`${item.title}-${index}`}>\n <span className={style.title}>{item.title}</span>\n <span className={style.value}>{item.value}</span>\n </li>\n );\n case 'content': {\n const {category, label, title, author} = item;\n return (\n <li className={style.contentWrapper} key={`${title}-${index}`}>\n <span className={style.contentCounter}>{index + 1}</span>\n <div className={style.contentItem}>\n <div className={style.content}>\n <ContentBagde category={category} label={label} />\n <span\n className={style.contentTitle}\n title={title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n </div>\n {author ? <span className={style.author}>{author}</span> : null}\n </div>\n </li>\n );\n }\n case 'text':\n default:\n return (\n <li key={`${item.text}-${index}`}>\n <span className={style.valueSimpleText}>{item.text}</span>\n </li>\n );\n }\n });\n};\n\nconst buildSectionHeader = section => {\n const {title, counterText} = section;\n if (!title) {\n return null;\n }\n return (\n <div className={style.sectionHeader}>\n <span className={style.title}>{title}</span>\n {counterText ? <span className={style.counterText}>{counterText}</span> : null}\n </div>\n );\n};\n\nconst buildSections = sections => {\n return sections.map((section, index) => {\n const sectionHeader = buildSectionHeader(section);\n const itemsView = buildItemsOfSection(section.items);\n return (\n <div key={`summary-section-${index}`} data-step={index} className={style.sectionWrapper}>\n {sectionHeader}\n <ul>{itemsView}</ul>\n </div>\n );\n });\n};\n\nconst buildAction = action => {\n if (!action) return null;\n\n const {onClick, text, icon} = action;\n const handleClick = useMemo(() => () => onClick(), [onClick]);\n return (\n <Link className={style.actionLink} onClick={handleClick}>\n {icon === 'draft' ? <NovaSolidComputersSdCard className={style.icon} /> : null}\n <span>{text}</span>\n </Link>\n );\n};\n\nconst WizardSummary = props => {\n const {title, sections, action} = props;\n\n const sectionView = buildSections(sections);\n const actionView = buildAction(action);\n\n return (\n <div className={style.container}>\n <span className={style.summaryTitle}>{title}</span>\n <div className={style.summary}>{sectionView}</div>\n <div className={style.actionZone}>{actionView}</div>\n </div>\n );\n};\n\nWizardSummary.propTypes = {\n title: PropTypes.string,\n sections: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n items: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.string,\n title: PropTypes.string,\n value: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n text: PropTypes.string\n }),\n PropTypes.shape({\n type: PropTypes.string,\n category: PropTypes.oneOf([\n 'base',\n 'advanced',\n 'coach',\n 'chapter',\n 'scorm',\n 'video',\n 'article',\n 'podcast'\n ]),\n title: PropTypes.string,\n label: PropTypes.string,\n author: PropTypes.string\n })\n ])\n ),\n counterText: PropTypes.string\n })\n ),\n action: PropTypes.shape({\n icon: PropTypes.string,\n text: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardSummary;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_50 from colors;
|
|
3
|
+
@value cm_grey_300 from colors;
|
|
4
|
+
@value cm_grey_400 from colors;
|
|
5
|
+
@value cm_grey_900 from colors;
|
|
6
|
+
@value cm_green_200 from colors;
|
|
7
|
+
@value cm_purple_200 from colors;
|
|
8
|
+
@value cm_orange_200 from colors;
|
|
9
|
+
@value white from colors;
|
|
10
|
+
@value lightBlack from colors;
|
|
11
|
+
@value cm_yellow_scorm from colors;
|
|
12
|
+
@value cm_bleu_article from colors;
|
|
13
|
+
@value cm_red_video from colors;
|
|
14
|
+
@value cm_violet_podcast from colors;
|
|
15
|
+
|
|
16
|
+
.container {
|
|
17
|
+
font-family: Gilroy;
|
|
18
|
+
width: 245px;
|
|
19
|
+
border-radius: 7px;
|
|
20
|
+
background-color: cm_grey_50;
|
|
21
|
+
padding: 40px 37px 32px 37px;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0px;
|
|
25
|
+
bottom: 0px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.summary {
|
|
29
|
+
height: calc(100% - 90px);
|
|
30
|
+
overflow: hidden auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.actionZone {
|
|
34
|
+
margin: 24px 0px 0px 0px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.actionLink {
|
|
38
|
+
text-align: center;
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: bold;
|
|
42
|
+
display: flex;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon {
|
|
49
|
+
width: 14px;
|
|
50
|
+
height: 14px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.summaryTitle {
|
|
54
|
+
font-family: 'Gilroy';
|
|
55
|
+
font-style: normal;
|
|
56
|
+
font-weight: bold;
|
|
57
|
+
font-size: 20px;
|
|
58
|
+
margin: 0px 0px 24px 0px;
|
|
59
|
+
color: cm_grey_900;
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sectionWrapper {
|
|
64
|
+
margin: 32px 0px 0px 0px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sectionWrapper:first-child {
|
|
68
|
+
margin: 0px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.sectionHeader {
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.counterText {
|
|
77
|
+
font-style: normal;
|
|
78
|
+
font-weight: normal;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.title {
|
|
83
|
+
font-style: normal;
|
|
84
|
+
font-weight: bold;
|
|
85
|
+
font-size: 12px;
|
|
86
|
+
color: cm_grey_400;
|
|
87
|
+
display: block;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.value {
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
font-weight: bold;
|
|
93
|
+
font-stretch: normal;
|
|
94
|
+
font-style: normal;
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.valueSimpleText {
|
|
99
|
+
composes: value;
|
|
100
|
+
margin: 8px 0px 0px 0px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.contentWrapper {
|
|
104
|
+
margin: 8px 0px 0px 0px;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.contentWrapper p {
|
|
110
|
+
margin: 0px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.contentItem {
|
|
114
|
+
display: block;
|
|
115
|
+
max-width: calc(100% -25px);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.content {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.contentCounter {
|
|
124
|
+
margin-right: 8px;
|
|
125
|
+
color: cm_grey_400;
|
|
126
|
+
font-size: 13px;
|
|
127
|
+
min-width: 20px;
|
|
128
|
+
text-align: center;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
ul {
|
|
132
|
+
list-style: none;
|
|
133
|
+
padding: 0px;
|
|
134
|
+
margin: 0px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.contentTitle {
|
|
138
|
+
margin: 0px 0px 0px 4px;
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
text-overflow: ellipsis;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.author {
|
|
146
|
+
font-size: 11px;
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
font-style: normal;
|
|
149
|
+
color: cm_grey_300;
|
|
150
|
+
}
|