@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","PropTypes","ReactTooltip","isString","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","toolTipReact","toolTip","propTypes","bool","string","isRequired","node","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","isComponent","setToolTipIsVisible","handleKeyPress","handleMouseOver","handleMouseLeave","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","func"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleMouseOver = useCallback(() => {\n setToolTipIsVisible(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setToolTipIsVisible(false);\n }, []);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={style.tooltipContent}>{TooltipContent}</p>\n );\n }, [TooltipContent, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={style.tooltipIconContainer}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- externalHandling --------------\n // if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EA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P;IAEE,SAAS,EAAE/B,KAAK,CAACmC,oBAFnB;IAGE,eAAaT,UAHf;IAIE,SAAS,EAAEI,cAJb;IAKE,QAAQ,EAAE;EALZ,gBAOE,oBAAC,eAAD;IACE,SAAS,EAAE9B,KAAK,CAACoC,eADnB;IAEE,KAAK,EAAE,EAFT;IAGE,MAAM,EAAE,EAHV;IAIE,cAAYX;EAJd,EAPF,CALF,eAmBE,oBAAC,cAAD;IACE,gBAAgB,EAAEvB,gBADpB;IAEE,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC;EAJX,EAnBF,CAVF;AAqCD,CA3ED;;AA6EAkB,OAAO,CAACf,SAAR,2CAAoB;EAClBgB,cAAc,EAAE7B,SAAS,CAAC0C,SAAV,CAAoB,CAAC1C,SAAS,CAAC2C,IAAX,EAAiB3C,SAAS,CAACiB,IAA3B,EAAiCjB,SAAS,CAACe,MAA3C,CAApB,CADE;EAElB,eAAef,SAAS,CAACe,MAFP;EAGlB,cAAcf,SAAS,CAACe,MAHN;EAIlBN,oCAAoC,EAAET,SAAS,CAACe,MAAV,CAAiBC,UAJrC;EAKlB;EACA;EACA;EACAR,QAAQ,EAAER,SAAS,CAACe,MARF;EASlBR,gBAAgB,EAAEP,SAAS,CAACc;AATV,CAApB;AAYA,eAAec,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","classnames","PropTypes","ReactTooltip","isString","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","FontSizes","tooltipContentFontSize12","tooltipContentFontSize14","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","toolTipReact","toolTip","propTypes","bool","string","isRequired","node","func","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number","oneOf"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,SAAS,GAAG;EAChB,IAAID,KAAK,CAACE,wBADM;EAEhB,IAAIF,KAAK,CAACG;AAFM,CAAlB;;AAKA,MAAMC,cAAc,GAAG,CAAC;EACtBC,gBADsB;EAEtBC,QAFsB;EAGtBC,oCAHsB;EAItBC,OAJsB;EAKtBC;AALsB,CAAD,KAMjB;EACJ,IAAI,CAACJ,gBAAL,EAAuB,OAAO,IAAP;;EACvB,IAAIC,QAAJ,EAAc;IACZ,oBACE,oBAAC,YAAD;MACE,EAAE,EAAEA,QADN;MAEE,SAAS,EAAEN,KAAK,CAACU,YAFnB;MAGE,kBAAe,OAHjB;MAIE,KAAK,EAAC,MAJR;MAKE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oB,SAAS,EAAEvC,SAAS,CAACwD,MAPH;EAQlBhB,QAAQ,EAAExC,SAAS,CAACyD,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlB;EACA;EACA;EACA9C,QAAQ,EAAEX,SAAS,CAACmB,MAZF;EAalBT,gBAAgB,EAAEV,SAAS,CAACkB;AAbV,CAApB;AAgBA,eAAee,OAAf"}
|
|
@@ -2,6 +2,9 @@ export default Answer;
|
|
|
2
2
|
declare function Answer(props: any): JSX.Element;
|
|
3
3
|
declare namespace Answer {
|
|
4
4
|
export { propTypes };
|
|
5
|
+
export namespace contextTypes {
|
|
6
|
+
const translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
7
|
+
}
|
|
5
8
|
}
|
|
6
9
|
import propTypes from "./prop-types";
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/answer/index.js"],"names":[],"mappings":";AA4EA,iDAWC"}
|
|
@@ -15,7 +15,7 @@ import QcmGraphic from '../questions/qcm-graphic';
|
|
|
15
15
|
import QuestionRange from '../questions/question-range';
|
|
16
16
|
import Template from '../questions/template';
|
|
17
17
|
import Audio from '../audio';
|
|
18
|
-
import { GetTranslateFromContext } from '../../atom/provider';
|
|
18
|
+
import Provider, { GetTranslateFromContext } from '../../atom/provider';
|
|
19
19
|
import style from './style.css';
|
|
20
20
|
import propTypes, { MediaViewPropTypes, TYPE_AUDIO, TYPE_IMAGE, TYPE_VIDEO } from './prop-types';
|
|
21
21
|
|
|
@@ -64,11 +64,11 @@ MediaView.propTypes = process.env.NODE_ENV !== "production" ? MediaViewPropTypes
|
|
|
64
64
|
const Switch = ({
|
|
65
65
|
model,
|
|
66
66
|
help
|
|
67
|
-
}) => {
|
|
67
|
+
}, legacyContext) => {
|
|
68
68
|
const {
|
|
69
69
|
type
|
|
70
70
|
} = model;
|
|
71
|
-
const translate = GetTranslateFromContext();
|
|
71
|
+
const translate = GetTranslateFromContext(legacyContext);
|
|
72
72
|
|
|
73
73
|
switch (type) {
|
|
74
74
|
case 'qcmDrag':
|
|
@@ -111,6 +111,9 @@ Switch.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
111
111
|
model: propTypes.model,
|
|
112
112
|
help: propTypes.help
|
|
113
113
|
} : {};
|
|
114
|
+
Switch.contextTypes = {
|
|
115
|
+
translate: Provider.childContextTypes.translate
|
|
116
|
+
};
|
|
114
117
|
|
|
115
118
|
const Answer = props => {
|
|
116
119
|
const {
|
|
@@ -130,5 +133,8 @@ const Answer = props => {
|
|
|
130
133
|
};
|
|
131
134
|
|
|
132
135
|
Answer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
136
|
+
Answer.contextTypes = {
|
|
137
|
+
translate: Provider.childContextTypes.translate
|
|
138
|
+
};
|
|
133
139
|
export default Answer;
|
|
134
140
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","GetTranslateFromContext","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","translate","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,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,OAAOC,QAAP,MAAqB,uBAArB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","VideoPlayer","DropDown","FreeText","QcmDrag","Qcm","QcmGraphic","QuestionRange","Template","Audio","Provider","GetTranslateFromContext","style","propTypes","MediaViewPropTypes","TYPE_AUDIO","TYPE_IMAGE","TYPE_VIDEO","MediaView","media","videoId","type","childProps","backgroundImage","url","video","audio","Switch","model","help","legacyContext","translate","contextTypes","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 = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default Answer;\n"],"mappings":";;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,QAAP,MAAqB,wBAArB;AACA,OAAOC,OAAP,MAAoB,uBAApB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;AACA,OAAOC,QAAP,MAAqB,uBAArB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,QAAP,IAAkBC,uBAAlB,QAAgD,qBAAhD;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,IAAmBC,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AAP,2CAAmBA,SAAnB;AAEAqB,MAAM,CAACF,YAAP,GAAsB;EACpBD,SAAS,EAAErB,QAAQ,CAACuB,iBAAT,CAA2BF;AADlB,CAAtB;AAIA,eAAeG,MAAf"}
|
|
@@ -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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import getOr from 'lodash/fp/getOr';
|
|
4
|
+
import Provider from '../../atom/provider';
|
|
4
5
|
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
5
6
|
import ReviewHeaderSteps from '../../molecule/review-header-steps';
|
|
6
7
|
import style from './style.css';
|
|
@@ -60,5 +61,8 @@ const ReviewHeader = (props, context) => {
|
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
ReviewHeader.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
64
|
+
ReviewHeader.contextTypes = {
|
|
65
|
+
skin: Provider.childContextTypes.skin
|
|
66
|
+
};
|
|
63
67
|
export default ReviewHeader;
|
|
64
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","getOr","ButtonLinkIconOnly","ReviewHeaderSteps","style","propTypes","ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","buttonProps","icon","onClick","size","className","review","stepsWrapper","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,iBAAP,MAA8B,oCAA9B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,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,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","getOr","Provider","ButtonLinkIconOnly","ReviewHeaderSteps","style","propTypes","ReviewHeader","props","context","steps","mode","skillName","ariaLabel","closeButtonAriaLabel","onQuitClick","hiddenSteps","skin","primarySkinColor","buttonProps","icon","onClick","size","className","review","stepsWrapper","stepsWrapperAnimation","headerWrapper","titlesWrapper","title","color","iconButtonWrapper","contextTypes","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAA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AD;IAAmB,KAAK,EAAEf,KAA1B;IAAiC,GAAG,EAAE;EAAtC,EADF,CAlBF,eAsBE;IAAK,SAAS,EAAEL,KAAK,CAAC0B,iBAAtB;IAAyC,eAAY;EAArD,gBACE,oBAAC,kBAAD,EAAwBZ,WAAxB,CADF,CAtBF,CADF;AA4BD,CAvDD;;AAyDAZ,YAAY,CAACD,SAAb,2CAAyBA,SAAzB;AAEAC,YAAY,CAACyB,YAAb,GAA4B;EAC1Bf,IAAI,EAAEf,QAAQ,CAAC+B,iBAAT,CAA2BhB;AADP,CAA5B;AAIA,eAAeV,YAAf"}
|
|
@@ -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"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _isEmpty from "lodash/fp/isEmpty";
|
|
2
|
-
import _map from "lodash/fp/map";
|
|
3
1
|
const _excluded = ["label", "description", "moreInfoAriaLabel"];
|
|
4
2
|
|
|
5
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -8,11 +6,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
8
6
|
|
|
9
7
|
import React from 'react';
|
|
10
8
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
9
|
+
import isEmpty from 'lodash/fp/isEmpty';
|
|
10
|
+
import map from 'lodash/fp/map';
|
|
11
|
+
import { GetTranslateFromContext } from '../../atom/provider';
|
|
12
|
+
import ToolTip from '../../atom/tooltip';
|
|
12
13
|
import InputSwitch from '../../atom/input-switch';
|
|
13
14
|
import style from './style.css';
|
|
14
15
|
|
|
15
16
|
const Settings = props => {
|
|
17
|
+
const translate = GetTranslateFromContext();
|
|
18
|
+
|
|
16
19
|
const {
|
|
17
20
|
label,
|
|
18
21
|
description,
|
|
@@ -23,19 +26,16 @@ const Settings = props => {
|
|
|
23
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
24
27
|
className: style.settings
|
|
25
28
|
}, /*#__PURE__*/React.createElement(InputSwitch, settings), /*#__PURE__*/React.createElement("span", {
|
|
26
|
-
className: style.label
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
37
|
-
className: style.descriptionLabel
|
|
38
|
-
}, description))));
|
|
29
|
+
className: style.label,
|
|
30
|
+
tabIndex: 0
|
|
31
|
+
}, label), isEmpty(description) ? null : /*#__PURE__*/React.createElement(ToolTip, {
|
|
32
|
+
TooltipContent: description,
|
|
33
|
+
closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text'),
|
|
34
|
+
"data-testid": "user-preferences-tooltip",
|
|
35
|
+
"aria-label": moreInfoAriaLabel,
|
|
36
|
+
iconContainerClassName: style.infoIconTooltip,
|
|
37
|
+
fontSize: 12
|
|
38
|
+
}));
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, InputSwitch.propTypes, {
|
|
@@ -45,15 +45,16 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, InputS
|
|
|
45
45
|
|
|
46
46
|
const UserPreferences = props => {
|
|
47
47
|
const {
|
|
48
|
-
preferences
|
|
48
|
+
preferences,
|
|
49
49
|
moreInfoAriaLabel,
|
|
50
50
|
groupAriaLabel
|
|
51
51
|
} = props;
|
|
52
52
|
return /*#__PURE__*/React.createElement("form", null, /*#__PURE__*/React.createElement("div", {
|
|
53
53
|
className: style.preferences,
|
|
54
54
|
role: "group",
|
|
55
|
-
"aria-label": groupAriaLabel
|
|
56
|
-
|
|
55
|
+
"aria-label": groupAriaLabel,
|
|
56
|
+
tabIndex: 0
|
|
57
|
+
}, map(settings => /*#__PURE__*/React.createElement(Settings, _extends({}, settings, {
|
|
57
58
|
key: settings.label,
|
|
58
59
|
moreInfoAriaLabel: moreInfoAriaLabel
|
|
59
60
|
})), preferences)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","isEmpty","map","GetTranslateFromContext","ToolTip","InputSwitch","style","Settings","props","translate","label","description","moreInfoAriaLabel","settings","infoIconTooltip","propTypes","string","isRequired","UserPreferences","preferences","groupAriaLabel","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SAAQC,uBAAR,QAAsC,qBAAtC;AACA,OAAOC,OAAP,MAAoB,oBAApB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,QAAQ,GAAGC,KAAK,IAAI;EACxB,MAAMC,SAAS,GAAGN,uBAAuB,EAAzC;;EACA,MAAM;IAACO,KAAD;IAAQC,WAAR;IAAqBC;EAArB,IAAuDJ,KAA7D;EAAA,MAAiDK,QAAjD,iCAA6DL,KAA7D;;EACA,oBACE;IAAK,SAAS,EAAEF,KAAK,CAACO;EAAtB,gBACE,oBAAC,WAAD,EAAiBA,QAAjB,CADF,eAEE;IAAM,SAAS,EAAEP,KAAK,CAACI,KAAvB;IAA8B,QAAQ,EAAE;EAAxC,GACGA,KADH,CAFF,EAKGT,OAAO,CAACU,WAAD,CAAP,GAAuB,IAAvB,gBACC,oBAAC,OAAD;IACE,cAAc,EAAEA,WADlB;IAEE,oCAAoC,EAAEF,SAAS,CAC7C,oDAD6C,CAFjD;IAKE,eAAY,0BALd;IAME,cAAYG,iBANd;IAOE,sBAAsB,EAAEN,KAAK,CAACQ,eAPhC;IAQE,QAAQ,EAAE;EARZ,EANJ,CADF;AAoBD,CAvBD;;AAyBAP,QAAQ,CAACQ,SAAT,wDACKV,WAAW,CAACU,SADjB;EAEEL,KAAK,EAAEV,SAAS,CAACgB,MAAV,CAAiBC,UAF1B;EAGEN,WAAW,EAAEX,SAAS,CAACgB;AAHzB;;AAMA,MAAME,eAAe,GAAGV,KAAK,IAAI;EAC/B,MAAM;IAACW,WAAD;IAAcP,iBAAd;IAAiCQ;EAAjC,IAAmDZ,KAAzD;EAEA,oBACE,+CACE;IAAK,SAAS,EAAEF,KAAK,CAACa,WAAtB;IAAmC,IAAI,EAAC,OAAxC;IAAgD,cAAYC,cAA5D;IAA4E,QAAQ,EAAE;EAAtF,GACGlB,GAAG,CACFW,QAAQ,iBACN,oBAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFA,EAIFO,WAJE,CADN,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACH,SAAhB,2CAA4B;EAC1BI,WAAW,EAAEnB,SAAS,CAACqB,OAAV,CAAkBrB,SAAS,CAACsB,KAAV,CAAgBf,QAAQ,CAACQ,SAAzB,CAAlB,CADa;EAE1BH,iBAAiB,EAAEZ,SAAS,CAACgB,MAFH;EAG1BI,cAAc,EAAEpB,SAAS,CAACgB;AAHA,CAA5B;AAMA,eAAeE,eAAf"}
|
|
@@ -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"}
|
|
@@ -106,6 +106,23 @@ const buildActionZone = (previousStep, nextStep, side) => {
|
|
|
106
106
|
}, nextButton));
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
+
const THEMES = {
|
|
110
|
+
'no-summary': {
|
|
111
|
+
container: style.containerWithoutSummary,
|
|
112
|
+
footer: style.footerWithoutSummary,
|
|
113
|
+
actionFooter: style.actionFooterWithoutSummary,
|
|
114
|
+
leftSection: style.leftSectionWithoutSummary
|
|
115
|
+
},
|
|
116
|
+
summary: {
|
|
117
|
+
container: style.container,
|
|
118
|
+
footer: style.footer,
|
|
119
|
+
actionFooter: style.actionFooter,
|
|
120
|
+
leftSection: style.leftSection
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const getTheme = summary => summary ? 'summary' : 'no-summary';
|
|
125
|
+
|
|
109
126
|
const WizardContents = props => {
|
|
110
127
|
const {
|
|
111
128
|
isLoading,
|
|
@@ -122,14 +139,8 @@ const WizardContents = props => {
|
|
|
122
139
|
}));
|
|
123
140
|
const rightActionView = buildActionZone(previousStep, nextStep, 'right');
|
|
124
141
|
const footerActionView = buildActionZone(previousStep, nextStep, 'footer');
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"data-name": "content-summary"
|
|
128
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className: style.leftSection
|
|
130
|
-
}, headerView, /*#__PURE__*/React.createElement("div", {
|
|
131
|
-
className: style.form
|
|
132
|
-
}, formView)), /*#__PURE__*/React.createElement("div", {
|
|
142
|
+
const currentStyle = THEMES[getTheme(summary)];
|
|
143
|
+
const summaryWrapper = /*#__PURE__*/React.createElement("div", {
|
|
133
144
|
className: style.rightSection,
|
|
134
145
|
"data-name": "summary-right-section"
|
|
135
146
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -139,14 +150,22 @@ const WizardContents = props => {
|
|
|
139
150
|
"data-name": "summary-zone"
|
|
140
151
|
}, /*#__PURE__*/React.createElement(WizardSummary, _extends({}, summary, {
|
|
141
152
|
side: 'right'
|
|
142
|
-
}))), rightActionView))
|
|
143
|
-
|
|
144
|
-
|
|
153
|
+
}))), rightActionView));
|
|
154
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
className: currentStyle.container,
|
|
156
|
+
"data-name": "content-summary"
|
|
145
157
|
}, /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: currentStyle.leftSection
|
|
159
|
+
}, headerView, /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
className: style.form
|
|
161
|
+
}, formView)), summary ? summaryWrapper : null, /*#__PURE__*/React.createElement("div", {
|
|
162
|
+
className: currentStyle.footer,
|
|
163
|
+
"data-name": "footer-section"
|
|
164
|
+
}, summary ? /*#__PURE__*/React.createElement("div", {
|
|
146
165
|
className: style.summaryFooter
|
|
147
166
|
}, /*#__PURE__*/React.createElement(WizardSummary, _extends({}, summary, {
|
|
148
167
|
side: 'footer'
|
|
149
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
150
169
|
className: style.actionFooter
|
|
151
170
|
}, footerActionView)));
|
|
152
171
|
};
|
|
@@ -158,7 +177,7 @@ WizardContents.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
158
177
|
onClick: PropTypes.func
|
|
159
178
|
}).isRequired,
|
|
160
179
|
steps: WizardSteps.propTypes.steps,
|
|
161
|
-
summary: PropTypes.shape(_extends({}, WizardSummary.propTypes))
|
|
180
|
+
summary: PropTypes.shape(_extends({}, WizardSummary.propTypes)),
|
|
162
181
|
content: PropTypes.oneOfType([PropTypes.shape(_extends({}, BrandForm.propTypes, {
|
|
163
182
|
type: PropTypes.oneOf(['form'])
|
|
164
183
|
})), PropTypes.shape(_extends({}, ContentTranslate.propTypes, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","getOr","PropTypes","ButtonLink","ButtonLinkIconOnly","WizardSteps","WizardSummary","BrandForm","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","RewardsForm","style","buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","nextButton","actionZone","button","WizardContents","props","isLoading","summary","headerView","formView","rightActionView","footerActionView","container","leftSection","form","rightSection","stickySection","summaryZone","footer","summaryFooter","actionFooter","propTypes","bool","shape","string","func","isRequired","oneOfType","oneOf"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,gBAAP,MAA6B,wBAA7B;AACA,OAAOC,6BAAP,MAA0C,6BAA1C;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,gCAA3B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,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,8CACE;IAAK,SAAS,EAAEL,KAAK,CAACS;EAAtB,gBACE,oBAAC,kBAAD,EAAwBH,eAAxB,CADF,eAEE;IAAK,SAAS,EAAEN,KAAK,CAACU,WAAtB;IAAmC,aAAW;EAA9C,GACGN,KADH,CAFF,CADF,eAOE,oBAAC,WAAD;IAAa,KAAK,EAAED;EAApB,EAPF,CADF;AAWD,CAtBD;;AAwBA,MAAMQ,SAAS,GAAGC,OAAO,IAAI;EAC3B,MAAM;IAACC;EAAD,IAASD,OAAf;;EACA,QAAQC,IAAR;IACE,KAAK,MAAL;MACE,oBAAO,oBAAC,SA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D,CAAhB;EAFR,GAT2B,EAa3BnE,SAAS,CAAC8D,KAAV,cACKtD,eAAe,CAACoD,SADrB;IAEEpC,IAAI,EAAExB,SAAS,CAACmE,KAAV,CAAgB,CAAC,SAAD,CAAhB;EAFR,GAb2B,EAiB3BnE,SAAS,CAAC8D,KAAV,cACKrD,cAAc,CAACmD,SADpB;IAEEpC,IAAI,EAAExB,SAAS,CAACmE,KAAV,CAAgB,CAAC,kBAAD,CAAhB;EAFR,GAjB2B,EAqB3BnE,SAAS,CAAC8D,KAAV,cACKpD,WAAW,CAACkD,SADjB;IAEEpC,IAAI,EAAExB,SAAS,CAACmE,KAAV,CAAgB,CAAC,SAAD,CAAhB;EAFR,GArB2B,CAApB,CAVgB;EAoCzB/B,YAAY,EAAEpC,SAAS,CAAC8D,KAAV,CAAgB;IAC5B7B,KAAK,EAAEjC,SAAS,CAAC+D,MADW;IAE5B/C,OAAO,EAAEhB,SAAS,CAACgE;EAFS,CAAhB,CApCW;EAwCzB3B,QAAQ,EAAErC,SAAS,CAAC8D,KAAV,CAAgB;IACxBtC,IAAI,EAAExB,SAAS,CAACmE,KAAV,CAAgB,CAAC,MAAD,EAAS,SAAT,CAAhB,CADkB;IAExBlC,KAAK,EAAEjC,SAAS,CAAC+D,MAFO;IAGxB/C,OAAO,EAAEhB,SAAS,CAACgE;EAHK,CAAhB;AAxCe,CAA3B;AA+CA,eAAerB,cAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","getOr","PropTypes","ButtonLink","ButtonLinkIconOnly","WizardSteps","WizardSummary","BrandForm","ContentTranslate","OrganismSearchAndChipsResults","CourseSelection","CourseSections","RewardsForm","style","buildHeader","wizardHeader","steps","title","onClick","buttonCloseIcon","size","icon","header","headerTitle","buildForm","content","type","buildButton","step","side","ICONS","previous","position","next","publish","label","buttonProps","buildActionZone","previousStep","nextStep","previousButton","nextStepType","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","bool","shape","string","func","isRequired","oneOfType","oneOf"],"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,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,gBAAP,MAA6B,wBAA7B;AACA,OAAOC,6BAAP,MAA0C,6BAA1C;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,gCAA3B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,WAAW,GAAG,CAACC,YAAD,EA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