@coorpacademy/components 11.10.3 → 11.10.4-alpha.7
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-switch/index.js +2 -1
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/link/index.d.ts +7 -15
- package/es/atom/link/index.d.ts.map +1 -1
- package/es/atom/link/index.js +71 -97
- package/es/atom/link/index.js.map +1 -1
- package/es/atom/provider/web-context.d.ts +2 -2
- package/es/atom/provider/web-context.d.ts.map +1 -1
- package/es/atom/provider/web-context.js +1 -4
- package/es/atom/provider/web-context.js.map +1 -1
- package/es/atom/review-header-step-item/index.d.ts.map +1 -1
- package/es/atom/review-header-step-item/index.js +8 -3
- package/es/atom/review-header-step-item/index.js.map +1 -1
- package/es/atom/tooltip/index.d.ts +7 -1
- package/es/atom/tooltip/index.d.ts.map +1 -1
- package/es/atom/tooltip/index.js +39 -14
- package/es/atom/tooltip/index.js.map +1 -1
- package/es/atom/tooltip/style.css +9 -0
- package/es/molecule/answer/index.d.ts +3 -0
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +9 -3
- package/es/molecule/answer/index.js.map +1 -1
- package/es/organism/review-header/index.d.ts +23 -0
- package/es/organism/review-header/index.d.ts.map +1 -1
- package/es/organism/review-header/index.js +4 -0
- package/es/organism/review-header/index.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +20 -19
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/organism/user-preferences/style.css +5 -56
- package/es/organism/wizard-contents/index.d.ts +2 -2
- package/es/organism/wizard-contents/index.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.js +32 -13
- package/es/organism/wizard-contents/index.js.map +1 -1
- package/es/organism/wizard-contents/style.css +46 -6
- package/es/template/activity/engine-stars.d.ts +1 -0
- package/es/template/activity/engine-stars.js +2 -1
- package/es/template/activity/engine-stars.js.map +1 -1
- package/es/template/activity/index.d.ts +1 -0
- package/es/template/activity/index.js +2 -1
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/progression-item.d.ts +1 -1
- package/es/template/activity/progression-item.d.ts.map +1 -1
- package/es/template/activity/progression-item.js +3 -5
- package/es/template/activity/progression-item.js.map +1 -1
- package/es/template/activity/stars-summary.d.ts +1 -0
- package/es/template/activity/stars-summary.js +2 -1
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +2 -2
- package/es/util/render-with-context.d.ts.map +1 -1
- package/es/util/render-with-context.js +13 -6
- package/es/util/render-with-context.js.map +1 -1
- package/lib/atom/input-switch/index.js +2 -1
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/link/index.d.ts +7 -15
- package/lib/atom/link/index.d.ts.map +1 -1
- package/lib/atom/link/index.js +75 -97
- package/lib/atom/link/index.js.map +1 -1
- package/lib/atom/provider/web-context.d.ts +2 -2
- package/lib/atom/provider/web-context.d.ts.map +1 -1
- package/lib/atom/provider/web-context.js +1 -5
- package/lib/atom/provider/web-context.js.map +1 -1
- package/lib/atom/review-header-step-item/index.d.ts.map +1 -1
- package/lib/atom/review-header-step-item/index.js +12 -3
- package/lib/atom/review-header-step-item/index.js.map +1 -1
- package/lib/atom/tooltip/index.d.ts +7 -1
- package/lib/atom/tooltip/index.d.ts.map +1 -1
- package/lib/atom/tooltip/index.js +41 -14
- package/lib/atom/tooltip/index.js.map +1 -1
- package/lib/atom/tooltip/style.css +9 -0
- package/lib/molecule/answer/index.d.ts +3 -0
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +9 -3
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/organism/review-header/index.d.ts +23 -0
- package/lib/organism/review-header/index.d.ts.map +1 -1
- package/lib/organism/review-header/index.js +5 -0
- package/lib/organism/review-header/index.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +23 -21
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/organism/user-preferences/style.css +5 -56
- package/lib/organism/wizard-contents/index.d.ts +2 -2
- package/lib/organism/wizard-contents/index.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.js +34 -13
- package/lib/organism/wizard-contents/index.js.map +1 -1
- package/lib/organism/wizard-contents/style.css +46 -6
- package/lib/template/activity/engine-stars.d.ts +1 -0
- package/lib/template/activity/engine-stars.js +2 -1
- package/lib/template/activity/engine-stars.js.map +1 -1
- package/lib/template/activity/index.d.ts +1 -0
- package/lib/template/activity/index.js +2 -1
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/progression-item.d.ts +1 -1
- package/lib/template/activity/progression-item.d.ts.map +1 -1
- package/lib/template/activity/progression-item.js +3 -5
- package/lib/template/activity/progression-item.js.map +1 -1
- package/lib/template/activity/stars-summary.d.ts +1 -0
- package/lib/template/activity/stars-summary.js +2 -1
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +2 -2
- package/lib/util/render-with-context.d.ts.map +1 -1
- package/lib/util/render-with-context.js +18 -6
- package/lib/util/render-with-context.js.map +1 -1
- package/package.json +2 -2
|
@@ -25,7 +25,7 @@ var _template = _interopRequireDefault(require("../questions/template"));
|
|
|
25
25
|
|
|
26
26
|
var _audio = _interopRequireDefault(require("../audio"));
|
|
27
27
|
|
|
28
|
-
var _provider = require("../../atom/provider");
|
|
28
|
+
var _provider = _interopRequireWildcard(require("../../atom/provider"));
|
|
29
29
|
|
|
30
30
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
31
31
|
|
|
@@ -88,11 +88,11 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.MediaVi
|
|
|
88
88
|
const Switch = ({
|
|
89
89
|
model,
|
|
90
90
|
help
|
|
91
|
-
}) => {
|
|
91
|
+
}, legacyContext) => {
|
|
92
92
|
const {
|
|
93
93
|
type
|
|
94
94
|
} = model;
|
|
95
|
-
const translate = (0, _provider.GetTranslateFromContext)();
|
|
95
|
+
const translate = (0, _provider.GetTranslateFromContext)(legacyContext);
|
|
96
96
|
|
|
97
97
|
switch (type) {
|
|
98
98
|
case 'qcmDrag':
|
|
@@ -135,6 +135,9 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
135
135
|
model: _propTypes.default.model,
|
|
136
136
|
help: _propTypes.default.help
|
|
137
137
|
} : {};
|
|
138
|
+
Switch.contextTypes = {
|
|
139
|
+
translate: _provider.default.childContextTypes.translate
|
|
140
|
+
};
|
|
138
141
|
|
|
139
142
|
const Answer = props => {
|
|
140
143
|
const {
|
|
@@ -154,6 +157,9 @@ const Answer = props => {
|
|
|
154
157
|
};
|
|
155
158
|
|
|
156
159
|
Answer.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
160
|
+
Answer.contextTypes = {
|
|
161
|
+
translate: _provider.default.childContextTypes.translate
|
|
162
|
+
};
|
|
157
163
|
var _default = Answer;
|
|
158
164
|
exports.default = _default;
|
|
159
165
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","translate","GetTranslateFromContext","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}) => {\n const {type} = model;\n const translate = GetTranslateFromContext();\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <form>\n <Switch model={model} help={help} />\n </form>\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,SAAS,GAAG,CAAC;EAACC;AAAD,CAAD,KAAa;EAC7B,MAAM;IAACC,OAAD;IAAUC;EAAV,IAAiCF,KAAvC;EAAA,MAAyBG,UAAzB,iCAAuCH,KAAvC;;EACA,QAAQE,IAAR;IACE,KAAKE,qBAAL;MACE,oBACE;QACE,SAAS,EAAEC,cAAA,CAAML,KADnB;QAEE,KAAK,EAAE;UACLM,eAAe,EAAG,OAAMN,KAAK,CAACO,GAAI;QAD7B;MAFT,EADF;;IAQF,KAAKC,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEH,cAAA,CAAMI;MAAtB,gBACE,6BAAC,oBAAD,eAAiB,oBAAK,IAAL,EAAWN,UAAX,CAAjB;QAAyC,EAAE,EAAEF,OAA7C;QAAsD,MAAM,EAAC,MAA7D;QAAoE,KAAK,EAAC;MAA1E,GADF,CADF;;IAKF,KAAKS,qBAAL;MACE,oBACE;QAAK,SAAS,EAAEL,cAAA,CAAMM;MAAtB,gBACE,6BAAC,cAAD,eAAW,oBAAK,IAAL,EAAWR,UAAX,CAAX;QAAmC,MAAM,EAAC,MAA1C;QAAiD,KAAK,EAAC;MAAvD,GADF,CADF;;IAKF;MACE,OAAO,IAAP;EAvBJ;AAyBD,CA3BD;;AA6BAJ,SAAS,CAACa,SAAV,2CAAsBC,6BAAtB;;AAEA,MAAMC,MAAM,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,
|
|
1
|
+
{"version":3,"file":"index.js","names":["MediaView","media","videoId","type","childProps","TYPE_IMAGE","style","backgroundImage","url","TYPE_VIDEO","video","TYPE_AUDIO","audio","propTypes","MediaViewPropTypes","Switch","model","help","legacyContext","translate","GetTranslateFromContext","contextTypes","Provider","childContextTypes","Answer","props","wrapper"],"sources":["../../../src/molecule/answer/index.js"],"sourcesContent":["import React from 'react';\nimport {omit} from 'lodash/fp';\nimport VideoPlayer from '../video-player';\nimport DropDown from '../questions/drop-down';\nimport FreeText from '../questions/free-text';\nimport QcmDrag from '../questions/qcm-drag';\nimport Qcm from '../questions/qcm';\nimport QcmGraphic from '../questions/qcm-graphic';\nimport QuestionRange from '../questions/question-range';\nimport Template from '../questions/template';\nimport Audio from '../audio';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport propTypes, {MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO} from './prop-types';\n\nconst MediaView = ({media}) => {\n const {videoId, type, ...childProps} = media;\n switch (type) {\n case TYPE_IMAGE:\n return (\n <div\n className={style.media}\n style={{\n backgroundImage: `url(${media.url})`\n }}\n />\n );\n case TYPE_VIDEO:\n return (\n <div className={style.video}>\n <VideoPlayer {...omit('id', childProps)} id={videoId} height=\"100%\" width=\"100%\" />\n </div>\n );\n case TYPE_AUDIO:\n return (\n <div className={style.audio}>\n <Audio {...omit('id', childProps)} height=\"100%\" width=\"100%\" />\n </div>\n );\n default:\n return null;\n }\n};\n\nMediaView.propTypes = MediaViewPropTypes;\n\nconst Switch = ({model, help}, legacyContext) => {\n const {type} = model;\n const translate = GetTranslateFromContext(legacyContext);\n switch (type) {\n case 'qcmDrag':\n return <QcmDrag {...model} help={help} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcm':\n return <Qcm {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'qcmGraphic':\n return <QcmGraphic {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'freeText':\n return <FreeText {...model} />;\n case 'dropDown':\n return <DropDown {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'slider':\n return <QuestionRange {...model} groupAriaLabel={translate('answer_the_question')} />;\n case 'template':\n return <Template {...model} groupAriaLabel={translate('answer_the_question')} />;\n }\n};\n\nSwitch.propTypes = {\n model: propTypes.model,\n help: propTypes.help\n};\n\nSwitch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst Answer = props => {\n const {model, media, help} = props;\n\n return (\n <div data-name=\"answer\" className={style.wrapper}>\n {media ? <MediaView media={media} /> : null}\n <form>\n <Switch model={model} help={help} />\n </form>\n </div>\n );\n};\n\nAnswer.propTypes = propTypes;\n\nAnswer.contextTypes = {\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D;IAAQ,KAAK,EAAEe,KAAf;IAAsB,IAAI,EAAEC;EAA5B,EADF,CAFF,CADF;AAQD,CAXD;;AAaAO,MAAM,CAACX,SAAP,2CAAmBA,kBAAnB;AAEAW,MAAM,CAACH,YAAP,GAAsB;EACpBF,SAAS,EAAEG,iBAAA,CAASC,iBAAT,CAA2BJ;AADlB,CAAtB;eAIeK,M"}
|
|
@@ -2,6 +2,29 @@ export default ReviewHeader;
|
|
|
2
2
|
declare function ReviewHeader(props: any, context: any): JSX.Element;
|
|
3
3
|
declare namespace ReviewHeader {
|
|
4
4
|
export { propTypes };
|
|
5
|
+
export namespace contextTypes {
|
|
6
|
+
const skin: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
7
|
+
common: import("prop-types").Requireable<{
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
}>;
|
|
10
|
+
images: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
11
|
+
'logo-mobile': import("prop-types").Requireable<any>;
|
|
12
|
+
logo: import("prop-types").Requireable<any>;
|
|
13
|
+
'logo-email': import("prop-types").Requireable<any>;
|
|
14
|
+
login: import("prop-types").Requireable<any>;
|
|
15
|
+
}>>;
|
|
16
|
+
icons: import("prop-types").Requireable<{
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
}>;
|
|
19
|
+
mod: import("prop-types").Requireable<{
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
}>;
|
|
22
|
+
courses: import("prop-types").Requireable<any[]>;
|
|
23
|
+
texts: import("prop-types").Requireable<{
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
}>;
|
|
26
|
+
}>>;
|
|
27
|
+
}
|
|
5
28
|
}
|
|
6
29
|
import propTypes from "./types";
|
|
7
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/index.js"],"names":[],"mappings":";AASA,qEAuDC"}
|
|
@@ -9,6 +9,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
9
9
|
|
|
10
10
|
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
11
11
|
|
|
12
|
+
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
13
|
+
|
|
12
14
|
var _buttonLinkIconOnly = _interopRequireDefault(require("../../atom/button-link-icon-only"));
|
|
13
15
|
|
|
14
16
|
var _reviewHeaderSteps = _interopRequireDefault(require("../../molecule/review-header-steps"));
|
|
@@ -73,6 +75,9 @@ const ReviewHeader = (props, context) => {
|
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
ReviewHeader.propTypes = process.env.NODE_ENV !== "production" ? _types.default : {};
|
|
78
|
+
ReviewHeader.contextTypes = {
|
|
79
|
+
skin: _provider.default.childContextTypes.skin
|
|
80
|
+
};
|
|
76
81
|
var _default = ReviewHeader;
|
|
77
82
|
exports.default = _default;
|
|
78
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","getOr","buttonProps","icon","onClick","size","className","style","review","stepsWrapper","classnames","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper","propTypes"],"sources":["../../../src/organism/review-header/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport getOr from 'lodash/fp/getOr';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderSteps from '../../molecule/review-header-steps';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick,\n hiddenSteps\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n const stepsWrapper = classnames(\n style.stepsWrapper,\n hiddenSteps ? style.stepsWrapperAnimation : null\n );\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={stepsWrapper}>\n <ReviewHeaderSteps steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-testid=\"review-header-close-button-wrapper\">\n <ButtonLinkIconOnly {...buttonProps} />\n </div>\n </div>\n );\n};\n\nReviewHeader.propTypes = propTypes;\n\nexport default ReviewHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IACJC,KADI;IAEJC,IAFI;IAGJC,SAHI;IAIJ,cAAcC,SAJV;IAKJC,oBALI;IAMJC,WANI;IAOJC;EAPI,IAQFR,KARJ;EASA,MAAM;IAACS;EAAD,IAASR,OAAf;EACA,MAAMS,gBAAgB,GAAG,IAAAC,cAAA,EAAM,SAAN,EAAiB,gBAAjB,EAAmCF,IAAnC,CAAzB;EAEA,MAAMG,WAAW,GAAG;IAClBC,IAAI,EAAE,OADY;IAElB,aAAa,4BAFK;IAGlB,cAAcP,oBAHI;IAIlBQ,OAAO,EAAEP,WAJS;IAKlBQ,IAAI,EAAE,YALY;IAMlBC,SAAS,EAAEC,cAAA,CAAMC;EANC,CAApB;EASA,MAAMC,YAAY,GAAG,IAAAC,mBAAA,EACnBH,cAAA,CAAME,YADa,EAEnBX,WAAW,GAAGS,cAAA,CAAMI,qBAAT,GAAiC,IAFzB,CAArB;EAKA,oBACE;IAAK,SAAS,EAAEJ,cAAA,CAAMK,aAAtB;IAAqC,aAAU,eAA/C;IAA+D,cAAYjB;EAA3E,gBACE;IAAK,SAAS,EAAEY,cAAA,CAAMM;EAAtB,gBACE;IAAK,SAAS,EAAEN,cAAA,CAAMO,KAAtB;IAA6B,KAAK,EAAErB,IAApC;IAA0C,cAAYA,IAAtD;IAA4D,aAAU;EAAtE,GACGA,IADH,CADF,eAIE;IACE,SAAS,EAAEc,cAAA,CAAMb,SADnB;IAEE,KAAK,EAAE;MACLqB,KAAK,EAAEf;IADF,CAFT;IAKE,KAAK,EAAEN,SALT;IAME,cAAYA,SANd;IAOE,aAAU;EAPZ,GASGA,SATH,CAJF,CADF,eAkBE;IAAK,SAAS,EAAEe;EAAhB,gBACE,6BAAC,0BAAD;IAAmB,KAAK,EAAEjB,KAA1B;IAAiC,GAAG,EAAE;EAAtC,EADF,CAlBF,eAsBE;IAAK,SAAS,EAAEe,cAAA,CAAMS,iBAAtB;IAAyC,eAAY;EAArD,gBACE,6BAAC,2BAAD,EAAwBd,WAAxB,CADF,CAtBF,CADF;AA4BD,CAvDD;;AAyDAb,YAAY,CAAC4B,SAAb,2CAAyBA,cAAzB;
|
|
1
|
+
{"version":3,"file":"index.js","names":["ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","getOr","buttonProps","icon","onClick","size","className","style","review","stepsWrapper","classnames","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper","propTypes","contextTypes","Provider","childContextTypes"],"sources":["../../../src/organism/review-header/index.js"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport getOr from 'lodash/fp/getOr';\nimport Provider from '../../atom/provider';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ReviewHeaderSteps from '../../molecule/review-header-steps';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst ReviewHeader = (props, context) => {\n const {\n steps,\n mode,\n skillName,\n 'aria-label': ariaLabel,\n closeButtonAriaLabel,\n onQuitClick,\n hiddenSteps\n } = props;\n const {skin} = context;\n const primarySkinColor = getOr('#00B0FF', 'common.primary', skin);\n\n const buttonProps = {\n icon: 'close',\n 'data-name': 'review-header-close-button',\n 'aria-label': closeButtonAriaLabel,\n onClick: onQuitClick,\n size: 'responsive',\n className: style.review\n };\n\n const stepsWrapper = classnames(\n style.stepsWrapper,\n hiddenSteps ? style.stepsWrapperAnimation : null\n );\n\n return (\n <div className={style.headerWrapper} data-name=\"review-header\" aria-label={ariaLabel}>\n <div className={style.titlesWrapper}>\n <div className={style.title} title={mode} aria-label={mode} data-name=\"review-header-mode\">\n {mode}\n </div>\n <div\n className={style.skillName}\n style={{\n color: primarySkinColor\n }}\n title={skillName}\n aria-label={skillName}\n data-name=\"review-header-skill-name\"\n >\n {skillName}\n </div>\n </div>\n\n <div className={stepsWrapper}>\n <ReviewHeaderSteps steps={steps} key={'review-header-steps'} />\n </div>\n\n <div className={style.iconButtonWrapper} data-testid=\"review-header-close-button-wrapper\">\n <ButtonLinkIconOnly {...buttonProps} />\n </div>\n </div>\n );\n};\n\nReviewHeader.propTypes = propTypes;\n\nReviewHeader.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ReviewHeader;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,YAAY,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EACvC,MAAM;IACJC,KADI;IAEJC,IAFI;IAGJC,SAHI;IAIJ,cAAcC,SAJV;IAKJC,oBALI;IAMJC,WANI;IAOJC;EAPI,IAQFR,KARJ;EASA,MAAM;IAACS;EAAD,IAASR,OAAf;EACA,MAAMS,gBAAgB,GAAG,IA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IeV,Y"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AAwCA,0DAeC"}
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
7
|
-
|
|
8
|
-
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
9
|
-
|
|
10
6
|
var _react = _interopRequireDefault(require("react"));
|
|
11
7
|
|
|
12
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
9
|
|
|
14
|
-
var
|
|
10
|
+
var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
11
|
+
|
|
12
|
+
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
13
|
+
|
|
14
|
+
var _provider = require("../../atom/provider");
|
|
15
|
+
|
|
16
|
+
var _tooltip = _interopRequireDefault(require("../../atom/tooltip"));
|
|
15
17
|
|
|
16
18
|
var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
|
|
17
19
|
|
|
@@ -26,6 +28,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
26
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
29
|
|
|
28
30
|
const Settings = props => {
|
|
31
|
+
const translate = (0, _provider.GetTranslateFromContext)();
|
|
32
|
+
|
|
29
33
|
const {
|
|
30
34
|
label,
|
|
31
35
|
description,
|
|
@@ -36,19 +40,16 @@ const Settings = props => {
|
|
|
36
40
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
41
|
className: _style.default.settings
|
|
38
42
|
}, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, settings), /*#__PURE__*/_react.default.createElement("span", {
|
|
39
|
-
className: _style.default.label
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
|
-
className: _style.default.descriptionLabel
|
|
51
|
-
}, description))));
|
|
43
|
+
className: _style.default.label,
|
|
44
|
+
tabIndex: 0
|
|
45
|
+
}, label), (0, _isEmpty.default)(description) ? null : /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
46
|
+
TooltipContent: description,
|
|
47
|
+
closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text'),
|
|
48
|
+
"data-testid": "user-preferences-tooltip",
|
|
49
|
+
"aria-label": moreInfoAriaLabel,
|
|
50
|
+
iconContainerClassName: _style.default.infoIconTooltip,
|
|
51
|
+
fontSize: 12
|
|
52
|
+
}));
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _inputSwitch.default.propTypes, {
|
|
@@ -58,15 +59,16 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, _input
|
|
|
58
59
|
|
|
59
60
|
const UserPreferences = props => {
|
|
60
61
|
const {
|
|
61
|
-
preferences
|
|
62
|
+
preferences,
|
|
62
63
|
moreInfoAriaLabel,
|
|
63
64
|
groupAriaLabel
|
|
64
65
|
} = props;
|
|
65
66
|
return /*#__PURE__*/_react.default.createElement("form", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
66
67
|
className: _style.default.preferences,
|
|
67
68
|
role: "group",
|
|
68
|
-
"aria-label": groupAriaLabel
|
|
69
|
-
|
|
69
|
+
"aria-label": groupAriaLabel,
|
|
70
|
+
tabIndex: 0
|
|
71
|
+
}, (0, _map.default)(settings => /*#__PURE__*/_react.default.createElement(Settings, _extends({}, settings, {
|
|
70
72
|
key: settings.label,
|
|
71
73
|
moreInfoAriaLabel: moreInfoAriaLabel
|
|
72
74
|
})), preferences)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Settings","props","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Settings","props","translate","GetTranslateFromContext","label","description","moreInfoAriaLabel","settings","style","isEmpty","infoIconTooltip","propTypes","InputSwitch","PropTypes","string","isRequired","UserPreferences","preferences","groupAriaLabel","map","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const translate = GetTranslateFromContext();\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,MAAMA,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAMC,SAAS,GAAG,IAAAC,iCAAA,GAAlB;;EACA,MAAM;IAACC,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDL,KAA7D;EAAA,MAAiDM,QAAjD,iCAA6DN,KAA7D;;EACA,oBACE;IAAK,SAAS,EAAEO,cAAA,CAAMD;EAAtB,gBACE,6BAAC,oBAAD,EAAiBA,QAAjB,CADF,eAEE;IAAM,SAAS,EAAEC,cAAA,CAAMJ,KAAvB;IAA8B,QAAQ,EAAE;EAAxC,GACGA,KADH,CAFF,EAKG,IAAAK,gBAAA,EAAQJ,WAAR,IAAuB,IAAvB,gBACC,6BAAC,gBAAD;IACE,cAAc,EAAEA,WADlB;IAEE,oCAAoC,EAAEH,SAAS,CAC7C,oDAD6C,CAFjD;IAKE,eAAY,0BALd;IAME,cAAYI,iBANd;IAOE,sBAAsB,EAAEE,cAAA,CAAME,eAPhC;IAQE,QAAQ,EAAE;EARZ,EANJ,CADF;AAoBD,CAvBD;;AAyBAV,QAAQ,CAACW,SAAT,wDACKC,oBAAA,CAAYD,SADjB;EAEEP,KAAK,EAAES,kBAAA,CAAUC,MAAV,CAAiBC,UAF1B;EAGEV,WAAW,EAAEQ,kBAAA,CAAUC;AAHzB;;AAMA,MAAME,eAAe,GAAGf,KAAK,IAAI;EAC/B,MAAM;IAACgB,WAAD;IAAcX,iBAAd;IAAiCY;EAAjC,IAAmDjB,KAAzD;EAEA,oBACE,wDACE;IAAK,SAAS,EAAEO,cAAA,CAAMS,WAAtB;IAAmC,IAAI,EAAC,OAAxC;IAAgD,cAAYC,cAA5D;IAA4E,QAAQ,EAAE;EAAtF,GACG,IAAAC,YAAA,EACCZ,QAAQ,iBACN,6BAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFH,EAICW,WAJD,CADH,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACL,SAAhB,2CAA4B;EAC1BM,WAAW,EAAEJ,kBAAA,CAAUO,OAAV,CAAkBP,kBAAA,CAAUQ,KAAV,CAAgBrB,QAAQ,CAACW,SAAzB,CAAlB,CADa;EAE1BL,iBAAiB,EAAEO,kBAAA,CAAUC,MAFH;EAG1BI,cAAc,EAAEL,kBAAA,CAAUC;AAHA,CAA5B;eAMeE,e"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@value colors: "../../variables/colors.css";
|
|
2
2
|
@value dark from colors;
|
|
3
3
|
@value light from colors;
|
|
4
|
+
@value transparent from colors;
|
|
4
5
|
|
|
5
6
|
.preferences {
|
|
6
7
|
display: flex;
|
|
@@ -25,64 +26,12 @@
|
|
|
25
26
|
|
|
26
27
|
.label {
|
|
27
28
|
composes: fontBase;
|
|
29
|
+
position: relative;
|
|
30
|
+
top: 1px;
|
|
28
31
|
margin-left: 15px;
|
|
29
32
|
min-height: 18px;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
align-items: center;
|
|
35
|
-
overflow: visible;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.showToolTip {
|
|
39
|
-
margin-top: 5px;
|
|
40
|
-
text-align: center;
|
|
41
|
-
visibility: hidden;
|
|
42
|
-
opacity: 0;
|
|
43
|
-
transition: opacity 0.8s;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.infoIcon {
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
padding-left: 10px;
|
|
49
|
-
padding-right: 4px;
|
|
50
|
-
color: dark;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.showToolTip::before {
|
|
54
|
-
content: '';
|
|
55
|
-
display: inline-block;
|
|
56
|
-
visibility: hidden;
|
|
57
|
-
opacity: 0;
|
|
58
|
-
width: 7px;
|
|
59
|
-
height: 8px;
|
|
60
|
-
margin: 7.5px -4px 7.5px 0;
|
|
61
|
-
transform: rotate(-45deg);
|
|
62
|
-
transition: opacity 0.8s;
|
|
63
|
-
background-color: light;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.infoIcon:hover ~ .showToolTip {
|
|
67
|
-
visibility: visible;
|
|
68
|
-
opacity: 1;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.infoIcon:hover ~ .showToolTip::before {
|
|
72
|
-
visibility: visible;
|
|
73
|
-
opacity: 1;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.descriptionLabel {
|
|
77
|
-
composes: fontBase;
|
|
78
|
-
display: inline-block;
|
|
79
|
-
background-color: light;
|
|
80
|
-
padding: 4px 8px;
|
|
81
|
-
border-radius: 3px;
|
|
82
|
-
word-wrap: break-word;
|
|
83
|
-
color: dark;
|
|
84
|
-
max-width: 220px;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
text-align: left;
|
|
87
|
-
position: absolute;
|
|
35
|
+
.infoIconTooltip {
|
|
36
|
+
background: transparent;
|
|
88
37
|
}
|
|
@@ -12,7 +12,7 @@ declare namespace WizardContents {
|
|
|
12
12
|
done: PropTypes.Requireable<boolean>;
|
|
13
13
|
current: PropTypes.Requireable<boolean>;
|
|
14
14
|
}> | null | undefined)[]>;
|
|
15
|
-
const summary: PropTypes.
|
|
15
|
+
const summary: PropTypes.Requireable<PropTypes.InferProps<{
|
|
16
16
|
title: PropTypes.Requireable<string>;
|
|
17
17
|
side: PropTypes.Requireable<string>;
|
|
18
18
|
sections: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
@@ -45,7 +45,7 @@ declare namespace WizardContents {
|
|
|
45
45
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
46
|
'aria-label': PropTypes.Requireable<string>;
|
|
47
47
|
}>>;
|
|
48
|
-
}
|
|
48
|
+
}>>;
|
|
49
49
|
const content: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
50
50
|
type: PropTypes.Requireable<string>;
|
|
51
51
|
groups: PropTypes.Validator<(PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/wizard-contents/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/wizard-contents/index.js"],"names":[],"mappings":";AAmHA,yDAoCC"}
|
|
@@ -126,6 +126,23 @@ const buildActionZone = (previousStep, nextStep, side) => {
|
|
|
126
126
|
}, nextButton));
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
+
const THEMES = {
|
|
130
|
+
'no-summary': {
|
|
131
|
+
container: _style.default.containerWithoutSummary,
|
|
132
|
+
footer: _style.default.footerWithoutSummary,
|
|
133
|
+
actionFooter: _style.default.actionFooterWithoutSummary,
|
|
134
|
+
leftSection: _style.default.leftSectionWithoutSummary
|
|
135
|
+
},
|
|
136
|
+
summary: {
|
|
137
|
+
container: _style.default.container,
|
|
138
|
+
footer: _style.default.footer,
|
|
139
|
+
actionFooter: _style.default.actionFooter,
|
|
140
|
+
leftSection: _style.default.leftSection
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const getTheme = summary => summary ? 'summary' : 'no-summary';
|
|
145
|
+
|
|
129
146
|
const WizardContents = props => {
|
|
130
147
|
const {
|
|
131
148
|
isLoading,
|
|
@@ -142,14 +159,9 @@ const WizardContents = props => {
|
|
|
142
159
|
}));
|
|
143
160
|
const rightActionView = buildActionZone(previousStep, nextStep, 'right');
|
|
144
161
|
const footerActionView = buildActionZone(previousStep, nextStep, 'footer');
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
-
className: _style.default.leftSection
|
|
150
|
-
}, headerView, /*#__PURE__*/_react.default.createElement("div", {
|
|
151
|
-
className: _style.default.form
|
|
152
|
-
}, formView)), /*#__PURE__*/_react.default.createElement("div", {
|
|
162
|
+
const currentStyle = THEMES[getTheme(summary)];
|
|
163
|
+
|
|
164
|
+
const summaryWrapper = /*#__PURE__*/_react.default.createElement("div", {
|
|
153
165
|
className: _style.default.rightSection,
|
|
154
166
|
"data-name": "summary-right-section"
|
|
155
167
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -159,14 +171,23 @@ const WizardContents = props => {
|
|
|
159
171
|
"data-name": "summary-zone"
|
|
160
172
|
}, /*#__PURE__*/_react.default.createElement(_wizardSummary.default, _extends({}, summary, {
|
|
161
173
|
side: 'right'
|
|
162
|
-
}))), rightActionView))
|
|
163
|
-
|
|
164
|
-
|
|
174
|
+
}))), rightActionView));
|
|
175
|
+
|
|
176
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
177
|
+
className: currentStyle.container,
|
|
178
|
+
"data-name": "content-summary"
|
|
165
179
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
180
|
+
className: currentStyle.leftSection
|
|
181
|
+
}, headerView, /*#__PURE__*/_react.default.createElement("div", {
|
|
182
|
+
className: _style.default.form
|
|
183
|
+
}, formView)), summary ? summaryWrapper : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
184
|
+
className: currentStyle.footer,
|
|
185
|
+
"data-name": "footer-section"
|
|
186
|
+
}, summary ? /*#__PURE__*/_react.default.createElement("div", {
|
|
166
187
|
className: _style.default.summaryFooter
|
|
167
188
|
}, /*#__PURE__*/_react.default.createElement(_wizardSummary.default, _extends({}, summary, {
|
|
168
189
|
side: 'footer'
|
|
169
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
190
|
+
}))) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
170
191
|
className: _style.default.actionFooter
|
|
171
192
|
}, footerActionView)));
|
|
172
193
|
};
|
|
@@ -178,7 +199,7 @@ WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
178
199
|
onClick: _propTypes.default.func
|
|
179
200
|
}).isRequired,
|
|
180
201
|
steps: _wizardSteps.default.propTypes.steps,
|
|
181
|
-
summary: _propTypes.default.shape(_extends({}, _wizardSummary.default.propTypes))
|
|
202
|
+
summary: _propTypes.default.shape(_extends({}, _wizardSummary.default.propTypes)),
|
|
182
203
|
content: _propTypes.default.oneOfType([_propTypes.default.shape(_extends({}, _brandForm.default.propTypes, {
|
|
183
204
|
type: _propTypes.default.oneOf(['form'])
|
|
184
205
|
})), _propTypes.default.shape(_extends({}, _contentTranslation.default.propTypes, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","getOr","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","PropTypes","bool","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","RewardsForm"],"sources":["../../../src/organism/wizard-contents/index.js"],"sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport CourseSections from '../../molecule/course-sections';\nimport RewardsForm from '../rewards-form';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'content-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n case 'organize-courses':\n return <CourseSections {...content} />;\n case 'rewards':\n return <RewardsForm {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n\n return (\n <div className={style.container} data-name=\"content-summary\">\n <div className={style.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n <div className={style.footer} data-name=\"summary-footer-section\">\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }).isRequired,\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n }),\n PropTypes.shape({\n ...CourseSections.propTypes,\n type: PropTypes.oneOf(['organize-courses'])\n }),\n PropTypes.shape({\n ...RewardsForm.propTypes,\n type: PropTypes.oneOf(['rewards'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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BAAA,CAAUG,MADW;IAE5BlD,OAAO,EAAE+C,kBAAA,CAAUI;EAFS,CAAhB,CApCW;EAwCzB7B,QAAQ,EAAEyB,kBAAA,CAAUE,KAAV,CAAgB;IACxBxC,IAAI,EAAEsC,kBAAA,CAAUU,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;IAExBvC,KAAK,EAAE6B,kBAAA,CAAUG,MAFO;IAGxBlD,OAAO,EAAE+C,kBAAA,CAAUI;EAHK,CAAhB;AAxCe,CAA3B;eA+CetB,c"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","style","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","getOr","nextButton","actionZone","button","THEMES","container","containerWithoutSummary","footer","footerWithoutSummary","actionFooter","actionFooterWithoutSummary","leftSection","leftSectionWithoutSummary","summary","getTheme","WizardContents","props","isLoading","headerView","formView","rightActionView","footerActionView","currentStyle","summaryWrapper","rightSection","stickySection","summaryZone","form","summaryFooter","propTypes","PropTypes","bool","shape","string","func","isRequired","WizardSteps","WizardSummary","oneOfType","BrandForm","oneOf","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","RewardsForm"],"sources":["../../../src/organism/wizard-contents/index.js"],"sourcesContent":["import React from 'react';\nimport getOr from 'lodash/fp/getOr';\nimport PropTypes from 'prop-types';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport WizardSteps from '../../atom/wizard-steps';\nimport WizardSummary from '../../molecule/wizard-summary';\nimport BrandForm from '../brand-form';\nimport ContentTranslate from '../content-translation';\nimport OrganismSearchAndChipsResults from '../search-and-chips-results';\nimport CourseSelection from '../course-selection';\nimport CourseSections from '../../molecule/course-sections';\nimport RewardsForm from '../rewards-form';\nimport style from './style.css';\n\nconst buildHeader = (wizardHeader, steps) => {\n const {title, onClick} = wizardHeader;\n\n const buttonCloseIcon = {\n size: 'small',\n 'data-name': 'close-button',\n 'aria-label': 'close button',\n icon: 'close',\n onClick\n };\n\n return (\n <div>\n <div className={style.header}>\n <ButtonLinkIconOnly {...buttonCloseIcon} />\n <div className={style.headerTitle} data-name={'content-title'}>\n {title}\n </div>\n </div>\n <WizardSteps steps={steps} />\n </div>\n );\n};\n\nconst buildForm = content => {\n const {type} = content;\n switch (type) {\n case 'form':\n return <BrandForm {...content} />;\n case 'translate':\n return <ContentTranslate {...content} />;\n case 'populations':\n return <OrganismSearchAndChipsResults {...content} />;\n case 'courses':\n return <CourseSelection {...content} />;\n case 'organize-courses':\n return <CourseSections {...content} />;\n case 'rewards':\n return <RewardsForm {...content} />;\n }\n};\n\nconst buildButton = (type, step, side) => {\n const ICONS = {\n previous: {\n position: 'left',\n type: 'chevron-left'\n },\n next: {\n position: 'right',\n type: 'chevron-right'\n },\n publish: {\n position: 'left',\n type: 'publish'\n }\n };\n\n const {label, onClick} = step;\n const buttonProps = {\n type: type === 'previous' ? 'secondary' : 'primary',\n 'aria-label': `${type} step button`,\n 'data-name': `${type}-step-button-${side}`,\n icon: ICONS[type],\n label,\n onClick\n };\n\n return <ButtonLink {...buttonProps} />;\n};\n\nconst buildActionZone = (previousStep, nextStep, side) => {\n const previousButton = previousStep ? buildButton('previous', previousStep, side) : null;\n const nextStepType = getOr('next', 'type', nextStep);\n const nextButton = nextStep ? buildButton(nextStepType, nextStep, side) : null;\n return (\n <div className={style.actionZone}>\n <div className={style.button}>{previousButton}</div>\n <div className={style.button}>{nextButton}</div>\n </div>\n );\n};\n\nconst THEMES = {\n 'no-summary': {\n container: style.containerWithoutSummary,\n footer: style.footerWithoutSummary,\n actionFooter: style.actionFooterWithoutSummary,\n leftSection: style.leftSectionWithoutSummary\n },\n summary: {\n container: style.container,\n footer: style.footer,\n actionFooter: style.actionFooter,\n leftSection: style.leftSection\n }\n};\n\nconst getTheme = summary => (summary ? 'summary' : 'no-summary');\n\nconst WizardContents = props => {\n const {isLoading, wizardHeader, steps, summary, content, nextStep, previousStep} = props;\n const headerView = buildHeader(wizardHeader, steps);\n const formView = buildForm({...content, isLoading});\n const rightActionView = buildActionZone(previousStep, nextStep, 'right');\n const footerActionView = buildActionZone(previousStep, nextStep, 'footer');\n const currentStyle = THEMES[getTheme(summary)];\n\n const summaryWrapper = (\n <div className={style.rightSection} data-name=\"summary-right-section\">\n <div className={style.stickySection}>\n <div className={style.summaryZone} data-name=\"summary-zone\">\n <WizardSummary {...summary} side={'right'} />\n </div>\n {rightActionView}\n </div>\n </div>\n );\n\n return (\n <div className={currentStyle.container} data-name=\"content-summary\">\n <div className={currentStyle.leftSection}>\n {headerView}\n <div className={style.form}>{formView}</div>\n </div>\n {summary ? summaryWrapper : null}\n <div className={currentStyle.footer} data-name=\"footer-section\">\n {summary ? (\n <div className={style.summaryFooter}>\n <WizardSummary {...summary} side={'footer'} />\n </div>\n ) : null}\n <div className={style.actionFooter}>{footerActionView}</div>\n </div>\n </div>\n );\n};\n\nWizardContents.propTypes = {\n isLoading: PropTypes.bool,\n wizardHeader: PropTypes.shape({\n title: PropTypes.string,\n onClick: PropTypes.func\n }).isRequired,\n steps: WizardSteps.propTypes.steps,\n summary: PropTypes.shape({\n ...WizardSummary.propTypes\n }),\n content: PropTypes.oneOfType([\n PropTypes.shape({\n ...BrandForm.propTypes,\n type: PropTypes.oneOf(['form'])\n }),\n PropTypes.shape({\n ...ContentTranslate.propTypes,\n type: PropTypes.oneOf(['translate'])\n }),\n PropTypes.shape({\n ...OrganismSearchAndChipsResults.propTypes,\n type: PropTypes.oneOf(['populations'])\n }),\n PropTypes.shape({\n ...CourseSelection.propTypes,\n type: PropTypes.oneOf(['courses'])\n }),\n PropTypes.shape({\n ...CourseSections.propTypes,\n type: PropTypes.oneOf(['organize-courses'])\n }),\n PropTypes.shape({\n ...RewardsForm.propTypes,\n type: PropTypes.oneOf(['rewards'])\n })\n ]),\n previousStep: PropTypes.shape({\n label: PropTypes.string,\n onClick: PropTypes.func\n }),\n nextStep: PropTypes.shape({\n type: PropTypes.oneOf(['next', 'publish']),\n label: PropTypes.string,\n onClick: PropTypes.func\n })\n};\n\nexport default WizardContents;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,WAAW,GAAG,CAACC,YAAD,EAAeC,KAAf,KAAyB;EAC3C,MAAM;IAACC,KAAD;IAAQC;EAAR,IAAmBH,YAAzB;EAEA,MAAMI,eAAe,GAAG;IACtBC,IAAI,EAAE,OADgB;IAEtB,aAAa,cAFS;IAGtB,cAAc,cAHQ;IAItBC,IAAI,EAAE,OAJgB;IAKtBH;EALsB,CAAxB;EAQA,oBACE,uDACE;IAAK,SAAS,EAAEI,cAAA,CAAMC;EAAtB,gBACE,6BAAC,2BAAD,EAAwBJ,eAAxB,CADF,eAEE;IAAK,SAAS,EAAEG,cAAA,CAAME,WAAtB;IAAmC,aAAW;EAA9C,GACGP,KADH,CAFF,CADF,eAOE,6BAAC,oBAAD;IAAa,KAAK,EAAED;EAApB,EAPF,CADF;AAWD,CAtBD;;AAwBA,MAAMS,SAAS,GAAGC,OAAO,IAAI;EAC3B,MAAM;IAACC;EAAD,IAASD,OAAf;;EACA,QAAQC,IAAR;IACE,KAAK,MAAL;MACE,oBAAO,6BAAC,kBAAD,EAAeD,OAAf,CAAP;;IACF,KAAK,WAAL;MACE,oBAAO,6BAAC,2BAAD,EAAsBA,OAAtB,CAAP;;IACF,KAAK,aAAL;MACE,oBAAO,6BAAC,8BAAD,EAAmCA,OAAnC,CAAP;;IACF,KAAK,SAAL;MACE,oBAAO,6BAAC,wBAAD,EAAqBA,OAArB,CAAP;;IACF,KAAK,kBAAL;MACE,oBAAO,6BAAC,uBAAD,EAAoBA,OAApB,CAAP;;IACF,KAAK,SAAL;MACE,oBAAO,6BAAC,oBAAD,EAAiB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8
8
|
align-items: stretch;
|
|
9
9
|
justify-content: flex-start;
|
|
10
|
-
flex-wrap: wrap;
|
|
11
10
|
overflow: auto;
|
|
12
11
|
height: calc(100vh - 124px);
|
|
13
12
|
width: 100%;
|
|
14
13
|
}
|
|
15
14
|
|
|
15
|
+
.containerWithoutSummary {
|
|
16
|
+
composes: container;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.leftSection {
|
|
17
|
-
display:
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
18
23
|
overflow: auto;
|
|
19
24
|
box-sizing: border-box;
|
|
20
25
|
width: calc(100% - 320px);
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.leftSectionWithoutSummary {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
overflow: auto;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
width: 100%;
|
|
21
35
|
height: 100%;
|
|
22
36
|
position: relative;
|
|
23
37
|
}
|
|
@@ -69,12 +83,23 @@
|
|
|
69
83
|
.actionZone {
|
|
70
84
|
width: 100%;
|
|
71
85
|
display: flex;
|
|
72
|
-
|
|
86
|
+
flex-direction: row;
|
|
87
|
+
justify-content: flex-end;
|
|
73
88
|
margin: 16px 0;
|
|
74
89
|
}
|
|
75
90
|
|
|
76
91
|
.button {
|
|
77
|
-
width:
|
|
92
|
+
width: 100%;
|
|
93
|
+
max-width: 184px;
|
|
94
|
+
margin: 10px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.footerWithoutSummary {
|
|
98
|
+
width: 100%;
|
|
99
|
+
bottom: 0px;
|
|
100
|
+
position: inherit;
|
|
101
|
+
display: flex;
|
|
102
|
+
justify-content: flex-end;
|
|
78
103
|
}
|
|
79
104
|
|
|
80
105
|
.footer {
|
|
@@ -84,23 +109,37 @@
|
|
|
84
109
|
position: inherit;
|
|
85
110
|
}
|
|
86
111
|
|
|
112
|
+
.actionFooterWithoutSummary {
|
|
113
|
+
width: 100%;
|
|
114
|
+
display: flex;
|
|
115
|
+
right: 0;
|
|
116
|
+
bottom: -10px;
|
|
117
|
+
position: sticky;
|
|
118
|
+
}
|
|
119
|
+
|
|
87
120
|
@media desktop, tablet {
|
|
88
121
|
.leftSection {
|
|
89
122
|
width: 100%;
|
|
90
123
|
min-height: 500px;
|
|
91
124
|
}
|
|
92
125
|
|
|
126
|
+
.container {
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
}
|
|
130
|
+
|
|
93
131
|
.rightSection {
|
|
94
132
|
display: none;
|
|
95
133
|
}
|
|
96
134
|
|
|
97
|
-
.footer
|
|
135
|
+
.footer {
|
|
98
136
|
display: flex;
|
|
99
137
|
align-items: flex-end;
|
|
100
138
|
bottom: 10px;
|
|
101
139
|
position: sticky;
|
|
102
140
|
z-index: 1;
|
|
103
141
|
}
|
|
142
|
+
|
|
104
143
|
.footer::before {
|
|
105
144
|
content: '';
|
|
106
145
|
background: linear-gradient(to top,white 64px, #ffffff00 );
|
|
@@ -118,8 +157,9 @@
|
|
|
118
157
|
}
|
|
119
158
|
|
|
120
159
|
.actionFooter {
|
|
121
|
-
width:
|
|
160
|
+
width: 100%;
|
|
122
161
|
}
|
|
162
|
+
|
|
123
163
|
.actionZone {
|
|
124
164
|
margin: 0;
|
|
125
165
|
}
|
|
@@ -188,7 +188,8 @@ EngineStars.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
188
188
|
})
|
|
189
189
|
} : {};
|
|
190
190
|
EngineStars.contextTypes = {
|
|
191
|
-
skin: _provider.default.childContextTypes.skin
|
|
191
|
+
skin: _provider.default.childContextTypes.skin,
|
|
192
|
+
translate: _provider.default.childContextTypes.translate
|
|
192
193
|
};
|
|
193
194
|
var _default = EngineStars;
|
|
194
195
|
exports.default = _default;
|