@coorpacademy/components 11.33.12 → 11.33.13-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/icon/index.d.ts +16 -0
- package/es/atom/icon/index.d.ts.map +1 -1
- package/es/atom/icon/index.js +3 -2
- package/es/atom/icon/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +107 -76
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +16 -22
- package/es/molecule/cm-popin/types.d.ts +17 -2
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +6 -5
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/template/app-player/loading/index.d.ts +15 -1
- package/es/template/app-player/player/index.d.ts +30 -2
- package/es/template/app-player/player/slides/index.d.ts +15 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +15 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +15 -1
- package/es/template/app-review/index.d.ts +15 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +15 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +15 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +15 -1
- package/es/template/common/dashboard/index.d.ts +30 -2
- package/es/template/common/search-page/index.d.ts +15 -1
- package/es/template/external-course/index.d.ts +15 -1
- package/lib/atom/icon/index.d.ts +16 -0
- package/lib/atom/icon/index.d.ts.map +1 -1
- package/lib/atom/icon/index.js +4 -3
- package/lib/atom/icon/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +105 -75
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +16 -22
- package/lib/molecule/cm-popin/types.d.ts +17 -2
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +2 -1
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/template/app-player/loading/index.d.ts +15 -1
- package/lib/template/app-player/player/index.d.ts +30 -2
- package/lib/template/app-player/player/slides/index.d.ts +15 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +15 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +15 -1
- package/lib/template/app-review/index.d.ts +15 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +15 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +15 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +15 -1
- package/lib/template/common/dashboard/index.d.ts +30 -2
- package/lib/template/common/search-page/index.d.ts +15 -1
- package/lib/template/external-course/index.d.ts +15 -1
- package/package.json +2 -2
package/es/atom/icon/index.d.ts
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
export const DEFAULT_ICON_COLOR: "hsl(0, 0%, 32%)";
|
|
2
2
|
export function createGradientBackground(baseColor: any): string;
|
|
3
3
|
export function getForegroundColor(backgroundColor: any): any;
|
|
4
|
+
export namespace iconPropTypes {
|
|
5
|
+
const iconName: PropTypes.Validator<string>;
|
|
6
|
+
const iconColor: PropTypes.Requireable<string>;
|
|
7
|
+
const backgroundColor: PropTypes.Requireable<string>;
|
|
8
|
+
const gradientBackground: PropTypes.Requireable<boolean>;
|
|
9
|
+
const borderRadius: PropTypes.Requireable<string>;
|
|
10
|
+
const preset: PropTypes.Requireable<string>;
|
|
11
|
+
const size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
12
|
+
faSize: PropTypes.Requireable<number>;
|
|
13
|
+
wrapperSize: PropTypes.Requireable<number>;
|
|
14
|
+
}>>;
|
|
15
|
+
const customStyle: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
4
19
|
export default Icon;
|
|
20
|
+
import PropTypes from "prop-types";
|
|
5
21
|
declare const Icon: React.NamedExoticComponent<object>;
|
|
6
22
|
import React from "react";
|
|
7
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,iEAIN;AAEM,8DAC8D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/icon/index.js"],"names":[],"mappings":"AAiBA,mDAAoD;AAiB7C,iEAIN;AAEM,8DAC8D;;;;;;;;;;;;;;;;;;AAGrE,uDAoCG"}
|
package/es/atom/icon/index.js
CHANGED
|
@@ -68,7 +68,7 @@ const Icon = /*#__PURE__*/React.memo(function Icon({
|
|
|
68
68
|
fontSize: effectiveSize.faSize
|
|
69
69
|
}));
|
|
70
70
|
});
|
|
71
|
-
|
|
71
|
+
export const iconPropTypes = {
|
|
72
72
|
iconName: PropTypes.string.isRequired,
|
|
73
73
|
iconColor: PropTypes.string,
|
|
74
74
|
backgroundColor: PropTypes.string,
|
|
@@ -80,6 +80,7 @@ Icon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
80
80
|
wrapperSize: PropTypes.number
|
|
81
81
|
}),
|
|
82
82
|
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
83
|
-
}
|
|
83
|
+
};
|
|
84
|
+
Icon.propTypes = process.env.NODE_ENV !== "production" ? iconPropTypes : {};
|
|
84
85
|
export default Icon;
|
|
85
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","createGradientBackground","baseColor","startColor","endColor","getForegroundColor","backgroundColor","Icon","memo","iconName","iconColor","gradientBackground","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","background","width","height","padding","createElement","className","iconWrapper","icon","color","fontSize","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","number","FontAwesomeIcon","fas","library","toLower","merge","getOr","convert","style","add","DEFAULT_PRESET","ICON_LUMINOSITY","DEFAULT_WRAPPER_SIZE","ICON_PADDING","DEFAULT_ICON_COLOR","SIZE_CONFIGS","s","faSize","wrapperSize","m","xl","createGradientBackground","baseColor","startColor","endColor","getForegroundColor","backgroundColor","Icon","memo","iconName","iconColor","gradientBackground","borderRadius","preset","size","customStyle","effectiveIconColor","effectiveSize","iconWrapperStyle","background","width","height","padding","createElement","className","iconWrapper","icon","color","fontSize","iconPropTypes","string","isRequired","bool","oneOf","shape","objectOf","oneOfType","propTypes","process","env","NODE_ENV"],"sources":["../../../src/atom/icon/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes, {number} from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport toLower from 'lodash/fp/toLower';\nimport merge from 'lodash/fp/merge';\nimport getOr from 'lodash/fp/getOr';\nimport {convert} from 'css-color-function';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst DEFAULT_PRESET = 'm';\nconst ICON_LUMINOSITY = 32;\nconst DEFAULT_WRAPPER_SIZE = 40;\nconst ICON_PADDING = 8;\nexport const DEFAULT_ICON_COLOR = 'hsl(0, 0%, 32%)';\n\nconst SIZE_CONFIGS = {\n s: {\n faSize: 12,\n wrapperSize: 32\n },\n m: {\n faSize: 16,\n wrapperSize: DEFAULT_WRAPPER_SIZE\n },\n xl: {\n faSize: 20,\n wrapperSize: 48\n }\n};\n\nexport const createGradientBackground = baseColor => {\n const startColor = convert(`color(${baseColor} lightness(91%))`);\n const endColor = convert(`color(${baseColor} lightness(81%))`);\n return `linear-gradient(180deg, ${startColor} 0%, ${endColor} 100%)`;\n};\n\nexport const getForegroundColor = backgroundColor =>\n convert(`color(${backgroundColor} lightness(${ICON_LUMINOSITY}%))`);\n// set lightness to 32%\n\nconst Icon = React.memo(function Icon({\n iconName,\n iconColor,\n backgroundColor,\n gradientBackground,\n borderRadius,\n preset = DEFAULT_PRESET,\n size,\n customStyle\n}) {\n const effectiveIconColor =\n iconColor || (backgroundColor ? getForegroundColor(backgroundColor) : DEFAULT_ICON_COLOR);\n\n const effectiveSize = size\n ? merge(SIZE_CONFIGS[DEFAULT_PRESET], size)\n : getOr(SIZE_CONFIGS[DEFAULT_PRESET], toLower(preset), SIZE_CONFIGS);\n\n const wrapperSize = effectiveSize.wrapperSize - ICON_PADDING * 2;\n\n const iconWrapperStyle = {\n background: gradientBackground ? createGradientBackground(effectiveIconColor) : backgroundColor,\n borderRadius,\n width: wrapperSize,\n height: wrapperSize,\n padding: ICON_PADDING\n };\n\n return (\n <div className={style.iconWrapper} style={{...iconWrapperStyle, ...customStyle}}>\n <FontAwesomeIcon\n icon={`fa-${iconName}`}\n color={effectiveIconColor}\n fontSize={effectiveSize.faSize}\n />\n </div>\n );\n});\n\nexport const iconPropTypes = {\n iconName: PropTypes.string.isRequired,\n iconColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n gradientBackground: PropTypes.bool,\n borderRadius: PropTypes.string,\n preset: PropTypes.oneOf(['s', 'm', 'xl']),\n size: PropTypes.shape({\n faSize: number,\n wrapperSize: PropTypes.number\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nIcon.propTypes = iconPropTypes;\n\nexport default Icon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,IAAGC,MAAM,QAAO,YAAY;AAC5C,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,SAAQC,GAAG,QAAO,kCAAkC;AACpD,SAAQC,OAAO,QAAO,mCAAmC;AACzD,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,KAAK,MAAM,iBAAiB;AACnC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,KAAK,MAAM,aAAa;AAE/BL,OAAO,CAACM,GAAG,CAACP,GAAG,CAAC;AAEhB,MAAMQ,cAAc,GAAG,GAAG;AAC1B,MAAMC,eAAe,GAAG,EAAE;AAC1B,MAAMC,oBAAoB,GAAG,EAAE;AAC/B,MAAMC,YAAY,GAAG,CAAC;AACtB,OAAO,MAAMC,kBAAkB,GAAG,iBAAiB;AAEnD,MAAMC,YAAY,GAAG;EACnBC,CAAC,EAAE;IACDC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE;EACf,CAAC;EACDC,CAAC,EAAE;IACDF,MAAM,EAAE,EAAE;IACVC,WAAW,EAAEN;EACf,CAAC;EACDQ,EAAE,EAAE;IACFH,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE;EACf;AACF,CAAC;AAED,OAAO,MAAMG,wBAAwB,GAAGC,SAAS,IAAI;EACnD,MAAMC,UAAU,GAAGhB,OAAO,CAAC,SAASe,SAAS,kBAAkB,CAAC;EAChE,MAAME,QAAQ,GAAGjB,OAAO,CAAC,SAASe,SAAS,kBAAkB,CAAC;EAC9D,OAAO,2BAA2BC,UAAU,QAAQC,QAAQ,QAAQ;AACtE,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAGC,eAAe,IAC/CnB,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Q,EAAE9B,SAAS,CAACmD,MAAM,CAACC,UAAU;EACrCrB,SAAS,EAAE/B,SAAS,CAACmD,MAAM;EAC3BxB,eAAe,EAAE3B,SAAS,CAACmD,MAAM;EACjCnB,kBAAkB,EAAEhC,SAAS,CAACqD,IAAI;EAClCpB,YAAY,EAAEjC,SAAS,CAACmD,MAAM;EAC9BjB,MAAM,EAAElC,SAAS,CAACsD,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;EACzCnB,IAAI,EAAEnC,SAAS,CAACuD,KAAK,CAAC;IACpBrC,MAAM,EAAEjB,MAAM;IACdkB,WAAW,EAAEnB,SAAS,CAACC;EACzB,CAAC,CAAC;EACFmC,WAAW,EAAEpC,SAAS,CAACwD,QAAQ,CAACxD,SAAS,CAACyD,SAAS,CAAC,CAACzD,SAAS,CAACmD,MAAM,EAAEnD,SAAS,CAACC,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED2B,IAAI,CAAC8B,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGX,aAAa;AAE9B,eAAetB,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AA4CA,kDA+RC"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1
2
|
import React, { useRef, useEffect, useMemo } from 'react';
|
|
2
3
|
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaCompositionCoorpacademyPadlock as LockIcon, NovaLineStatusCheckCircle1 as CheckCircle1, NovaSolidFilesBasicFileLines as FileLinesIcon, NovaSolidInterfaceFeedbackInterfaceAlertRounded as AlertIcon } from '@coorpacademy/nova-icons';
|
|
3
4
|
import map from 'lodash/fp/map';
|
|
4
5
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import Provider from '../../atom/provider';
|
|
7
|
-
import
|
|
8
|
+
import ButtonLink from '../../atom/button-link';
|
|
8
9
|
import ButtonLinkIcon from '../../atom/button-link-icon';
|
|
9
10
|
import InputSwitch from '../../atom/input-switch';
|
|
10
11
|
import Title from '../../atom/title';
|
|
11
12
|
import CardsGrid from '../../organism/cards-grid';
|
|
12
13
|
import ListItems from '../../organism/list-items';
|
|
13
14
|
import Link from '../../atom/link';
|
|
15
|
+
import Icon from '../../atom/icon';
|
|
14
16
|
import style from './style.css';
|
|
15
17
|
import propTypes from './types';
|
|
18
|
+
|
|
19
|
+
// DEPRECATED
|
|
20
|
+
const LOGO = {
|
|
21
|
+
AlertDiamond,
|
|
22
|
+
WindowUpload,
|
|
23
|
+
MoonRocket,
|
|
24
|
+
CheckCircle1,
|
|
25
|
+
AlertIcon
|
|
26
|
+
};
|
|
16
27
|
const IconType = {
|
|
17
28
|
lockedContent: /*#__PURE__*/React.createElement(LockIcon, {
|
|
18
29
|
className: style.lockIcon
|
|
@@ -41,14 +52,6 @@ const CMPopin = props => {
|
|
|
41
52
|
items,
|
|
42
53
|
link
|
|
43
54
|
} = props;
|
|
44
|
-
const logo = {
|
|
45
|
-
AlertDiamond,
|
|
46
|
-
WindowUpload,
|
|
47
|
-
MoonRocket,
|
|
48
|
-
CheckCircle1,
|
|
49
|
-
AlertIcon
|
|
50
|
-
};
|
|
51
|
-
const LogoComponent = logo[icon];
|
|
52
55
|
const backgroundImageStyle = backgroundImageUrl ? {
|
|
53
56
|
backgroundImage: `url(${backgroundImageUrl})`,
|
|
54
57
|
backgroundSize: 'cover'
|
|
@@ -77,7 +80,19 @@ const CMPopin = props => {
|
|
|
77
80
|
};
|
|
78
81
|
}
|
|
79
82
|
}, [handleCloseButton, mode, onClose]);
|
|
80
|
-
const
|
|
83
|
+
const wrapperPopinStyle = classNames(style.popin, mode === 'cookie' && style.popinCookie, mode === 'list' && style.popinFilesList, mode === 'items' && style.popinItems);
|
|
84
|
+
const buildIcon = () => {
|
|
85
|
+
if (typeof icon === 'string') {
|
|
86
|
+
const LogoComponent = LOGO[icon];
|
|
87
|
+
return LogoComponent ? /*#__PURE__*/React.createElement(LogoComponent, {
|
|
88
|
+
className: style.icon
|
|
89
|
+
}) : null;
|
|
90
|
+
}
|
|
91
|
+
return !isEmpty(icon) ? /*#__PURE__*/React.createElement(Icon, _extends({}, icon, {
|
|
92
|
+
className: style.icon
|
|
93
|
+
})) : null;
|
|
94
|
+
};
|
|
95
|
+
const buildHeader = () => {
|
|
81
96
|
if (header) {
|
|
82
97
|
const {
|
|
83
98
|
title,
|
|
@@ -101,7 +116,22 @@ const CMPopin = props => {
|
|
|
101
116
|
})), /*#__PURE__*/React.createElement("div", {
|
|
102
117
|
className: style.cookieTitle
|
|
103
118
|
}, cookieTitle));
|
|
104
|
-
|
|
119
|
+
};
|
|
120
|
+
const renderHeader = () => {
|
|
121
|
+
const headerContent = buildHeader();
|
|
122
|
+
const close = onClose ? /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: style.onCloseButton
|
|
124
|
+
}, /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
125
|
+
onClick: handleCloseButton,
|
|
126
|
+
"data-name": 'close-icon',
|
|
127
|
+
"aria-label": 'close-icon',
|
|
128
|
+
size: "small",
|
|
129
|
+
icon: "close"
|
|
130
|
+
})) : null;
|
|
131
|
+
if (isEmpty(headerContent) && isEmpty(close)) return null;
|
|
132
|
+
return /*#__PURE__*/React.createElement("header", {
|
|
133
|
+
className: style.popinHeader
|
|
134
|
+
}, headerContent, close);
|
|
105
135
|
};
|
|
106
136
|
const getClassBtnSwitch = (index, btnList) => {
|
|
107
137
|
switch (index) {
|
|
@@ -149,11 +179,11 @@ const CMPopin = props => {
|
|
|
149
179
|
})(listBtnSwicth);
|
|
150
180
|
};
|
|
151
181
|
const renderItems = () => {
|
|
182
|
+
if (isEmpty(items)) return null;
|
|
152
183
|
const {
|
|
153
184
|
type,
|
|
154
185
|
list
|
|
155
186
|
} = items;
|
|
156
|
-
if (isEmpty(list)) return null;
|
|
157
187
|
if (type === 'content') return /*#__PURE__*/React.createElement("div", {
|
|
158
188
|
className: style.itemsContainer,
|
|
159
189
|
"data-name": 'cm-popin-cards'
|
|
@@ -163,7 +193,69 @@ const CMPopin = props => {
|
|
|
163
193
|
}, /*#__PURE__*/React.createElement(ListItems, list));
|
|
164
194
|
return null;
|
|
165
195
|
};
|
|
166
|
-
const
|
|
196
|
+
const renderContent = () => {
|
|
197
|
+
if (mode === 'items' || mode === 'list') return;
|
|
198
|
+
const isCookieOrInformations = mode === 'cookie' || mode === 'information';
|
|
199
|
+
const renderContentTitle = () => {
|
|
200
|
+
if (!content) return null;
|
|
201
|
+
if (isCookieOrInformations) return /*#__PURE__*/React.createElement("p", {
|
|
202
|
+
className: mode === 'alert' ? style.content : style.message,
|
|
203
|
+
"data-name": 'cm-popin-content'
|
|
204
|
+
// eslint-disable-next-line react/no-danger
|
|
205
|
+
,
|
|
206
|
+
dangerouslySetInnerHTML: {
|
|
207
|
+
__html: content
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
className: mode === 'alert' ? style.content : style.message
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
213
|
+
title: content,
|
|
214
|
+
"data-name": 'cm-popin-content'
|
|
215
|
+
}));
|
|
216
|
+
};
|
|
217
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
className: isCookieOrInformations ? style.cookieTitleContainer : style.titleContainer
|
|
219
|
+
}, buildIcon(), /*#__PURE__*/React.createElement("div", {
|
|
220
|
+
className: style.contentSection
|
|
221
|
+
}, renderContentTitle(), descriptionText ? /*#__PURE__*/React.createElement("div", {
|
|
222
|
+
className: style.descriptionText
|
|
223
|
+
}, descriptionText) : null), link ? /*#__PURE__*/React.createElement(Link, link) : null);
|
|
224
|
+
};
|
|
225
|
+
const renderButtons = () => {
|
|
226
|
+
if (!firstButton && !secondButton && !thirdButton) return null;
|
|
227
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
228
|
+
className: style.buttonContainer
|
|
229
|
+
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
230
|
+
className: firstButton.largeButton ? style.largeButton : style.button
|
|
231
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
232
|
+
label: firstButton.label,
|
|
233
|
+
onClick: firstButton.handleOnclick,
|
|
234
|
+
"data-name": 'cm-popin-cta',
|
|
235
|
+
"aria-label": firstButton['aria-label'],
|
|
236
|
+
type: firstButton.type,
|
|
237
|
+
customStyle: firstButton.customStyle
|
|
238
|
+
})) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: secondButton.largeButton ? style.largeButton : style.button
|
|
240
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
241
|
+
label: secondButton.label,
|
|
242
|
+
onClick: secondButton.handleOnclick,
|
|
243
|
+
"data-name": `cm-popin-cta-${secondButton.type}`,
|
|
244
|
+
"aria-label": secondButton['aria-label'],
|
|
245
|
+
type: secondButton.type,
|
|
246
|
+
customStyle: secondButton.customStyle,
|
|
247
|
+
icon: secondButton.icon
|
|
248
|
+
})) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
|
|
249
|
+
className: thirdButton.largeButton ? style.largeButton : style.button
|
|
250
|
+
}, /*#__PURE__*/React.createElement(ButtonLink, {
|
|
251
|
+
label: thirdButton.label,
|
|
252
|
+
onClick: thirdButton.handleOnclick,
|
|
253
|
+
"data-name": `cm-popin-cta-${thirdButton.type}`,
|
|
254
|
+
"aria-label": thirdButton['aria-label'],
|
|
255
|
+
type: thirdButton.type,
|
|
256
|
+
customStyle: thirdButton.customStyle
|
|
257
|
+
})) : null);
|
|
258
|
+
};
|
|
167
259
|
return /*#__PURE__*/React.createElement("div", {
|
|
168
260
|
className: mode !== 'cookie' ? style.background : null,
|
|
169
261
|
style: backgroundImageStyle,
|
|
@@ -171,70 +263,9 @@ const CMPopin = props => {
|
|
|
171
263
|
}, /*#__PURE__*/React.createElement("div", {
|
|
172
264
|
className: wrapperPopinStyle,
|
|
173
265
|
ref: nodeRef
|
|
174
|
-
}, /*#__PURE__*/React.createElement("
|
|
175
|
-
className: style.popinHeader
|
|
176
|
-
}, renderHeader(), onClose ? /*#__PURE__*/React.createElement("div", {
|
|
177
|
-
className: style.onCloseButton
|
|
178
|
-
}, /*#__PURE__*/React.createElement(ButtonLinkIcon, {
|
|
179
|
-
onClick: handleCloseButton,
|
|
180
|
-
"data-name": 'close-icon',
|
|
181
|
-
"aria-label": 'close-icon',
|
|
182
|
-
size: "small",
|
|
183
|
-
icon: "close"
|
|
184
|
-
})) : null), mode !== 'items' && mode !== 'list' ? /*#__PURE__*/React.createElement("div", {
|
|
185
|
-
className: mode === 'cookie' || mode === 'information' ? style.cookieTitleContainer : style.titleContainer
|
|
186
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
187
|
-
className: style.contentSection
|
|
188
|
-
}, LogoComponent ? /*#__PURE__*/React.createElement(LogoComponent, {
|
|
189
|
-
className: style.icon
|
|
190
|
-
}) : null, content ? /*#__PURE__*/React.createElement("p", {
|
|
191
|
-
className: mode === 'alert' ? style.content : style.message,
|
|
192
|
-
"data-name": 'cm-popin-content'
|
|
193
|
-
// eslint-disable-next-line react/no-danger
|
|
194
|
-
,
|
|
195
|
-
dangerouslySetInnerHTML: {
|
|
196
|
-
__html: content
|
|
197
|
-
}
|
|
198
|
-
}) : null), descriptionText ? /*#__PURE__*/React.createElement("p", {
|
|
199
|
-
className: style.descriptionText
|
|
200
|
-
// eslint-disable-next-line react/no-danger
|
|
201
|
-
,
|
|
202
|
-
dangerouslySetInnerHTML: {
|
|
203
|
-
__html: descriptionText
|
|
204
|
-
}
|
|
205
|
-
}) : null, link ? /*#__PURE__*/React.createElement(Link, link) : null) : null, descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
}, renderHeader(), renderContent(), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
206
267
|
className: style.descriptionBtn
|
|
207
|
-
}, descriptionBtnTxt) : null,
|
|
208
|
-
className: style.buttonContainer
|
|
209
|
-
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
210
|
-
className: firstButton.largeButton ? style.largeButton : style.button
|
|
211
|
-
}, /*#__PURE__*/React.createElement(Cta, {
|
|
212
|
-
label: firstButton.label,
|
|
213
|
-
onClick: firstButton.handleOnclick,
|
|
214
|
-
"data-name": 'cm-popin-cta',
|
|
215
|
-
"aria-label": firstButton['aria-label'],
|
|
216
|
-
type: firstButton.type,
|
|
217
|
-
customStyle: firstButton.customStyle
|
|
218
|
-
})) : null, secondButton ? /*#__PURE__*/React.createElement("div", {
|
|
219
|
-
className: secondButton.largeButton ? style.largeButton : style.button
|
|
220
|
-
}, /*#__PURE__*/React.createElement(Cta, {
|
|
221
|
-
label: secondButton.label,
|
|
222
|
-
onClick: secondButton.handleOnclick,
|
|
223
|
-
"data-name": `cm-popin-cta-${secondButton.type}`,
|
|
224
|
-
"aria-label": secondButton['aria-label'],
|
|
225
|
-
type: secondButton.type,
|
|
226
|
-
customStyle: secondButton.customStyle,
|
|
227
|
-
icon: secondButton.icon
|
|
228
|
-
})) : null, thirdButton ? /*#__PURE__*/React.createElement("div", {
|
|
229
|
-
className: thirdButton.largeButton ? style.largeButton : style.button
|
|
230
|
-
}, /*#__PURE__*/React.createElement(Cta, {
|
|
231
|
-
label: thirdButton.label,
|
|
232
|
-
onClick: thirdButton.handleOnclick,
|
|
233
|
-
"data-name": `cm-popin-cta-${thirdButton.type}`,
|
|
234
|
-
"aria-label": thirdButton['aria-label'],
|
|
235
|
-
type: thirdButton.type,
|
|
236
|
-
customStyle: thirdButton.customStyle
|
|
237
|
-
})) : null) : null));
|
|
268
|
+
}, descriptionBtnTxt) : null, renderItems(), renderBtnSwitch(), renderButtons()));
|
|
238
269
|
};
|
|
239
270
|
CMPopin.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
240
271
|
CMPopin.contextTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useRef","useEffect","useMemo","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaCompositionCoorpacademyPadlock","LockIcon","NovaLineStatusCheckCircle1","CheckCircle1","NovaSolidFilesBasicFileLines","FileLinesIcon","NovaSolidInterfaceFeedbackInterfaceAlertRounded","AlertIcon","map","isEmpty","classNames","Provider","Cta","ButtonLinkIcon","InputSwitch","Title","CardsGrid","ListItems","Link","style","propTypes","IconType","lockedContent","createElement","className","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","link","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","handleCloseButton","nodeRef","closePopin","e","current","contains","target","handleKeyDown","key","document","addEventListener","removeEventListener","renderHeader","title","headerIcon","TopTitleIcon","Fragment","headerContent","headerBackground","src","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","itemsContainer","filesListContainer","wrapperPopinStyle","popinCookie","popinFilesList","popinItems","popin","background","ref","popinHeader","onCloseButton","onClick","size","cookieTitleContainer","titleContainer","contentSection","message","dangerouslySetInnerHTML","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle","process","env","NODE_ENV","contextTypes","translate","childContextTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React, {useRef, useEffect, useMemo} from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1,\n NovaSolidFilesBasicFileLines as FileLinesIcon,\n NovaSolidInterfaceFeedbackInterfaceAlertRounded as AlertIcon\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport classNames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport Link from '../../atom/link';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />,\n fileZipped: (\n <div className={style.filesListIconContainer}>\n <FileLinesIcon className={style.filesListIcon} />\n </div>\n )\n};\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items,\n link\n } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1,\n AlertIcon\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const handleCloseButton = useMemo(() => () => onClose(), [onClose]);\n const nodeRef = useRef(null);\n useEffect(() => {\n if (mode === 'items') {\n const closePopin = e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n handleCloseButton();\n }\n };\n const handleKeyDown = e => {\n if (e?.key === 'Escape') {\n handleCloseButton();\n }\n };\n document.addEventListener('click', closePopin);\n document.addEventListener('touchstart', closePopin);\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('click', closePopin);\n document.removeEventListener('touchstart', closePopin);\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [handleCloseButton, mode, onClose]);\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n\n return (\n <>\n {title ? (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <Title {...title} />\n </div>\n ) : null}\n {backgroundImage ? (\n <img className={style.headerBackground} src={backgroundImage} />\n ) : null}\n </>\n );\n }\n\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n\n return null;\n };\n\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n\n const renderItems = () => {\n const {type, list} = items;\n if (isEmpty(list)) return null;\n\n if (type === 'content')\n return (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n <CardsGrid {...list} />\n </div>\n );\n if (type === 'list')\n return (\n <div className={style.filesListContainer}>\n <ListItems {...list} />\n </div>\n );\n\n return null;\n };\n const wrapperPopinStyle = classNames(\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n mode === 'items' && style.popinItems,\n style.popin\n );\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <div className={style.onCloseButton}>\n <ButtonLinkIcon\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n </div>\n ) : null}\n </header>\n {mode !== 'items' && mode !== 'list' ? (\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n {link ? <Link {...link} /> : null}\n </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {!isEmpty(items) ? renderItems() : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n icon={secondButton.icon}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\nCMPopin.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAO,OAAO;AACvD,SACEC,+CAA+C,IAAIC,YAAY,EAC/DC,kCAAkC,IAAIC,YAAY,EAClDC,sBAAsB,IAAIC,MAAM,EAChCC,wBAAwB,IAAIC,UAAU,EACtCC,kCAAkC,IAAIC,QAAQ,EAC9CC,0BAA0B,IAAIC,YAAY,EAC1CC,4BAA4B,IAAIC,aAAa,EAC7CC,+CAA+C,IAAIC,SAAS,QACvD,0BAA0B;AACjC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,GAAG,MAAM,wBAAwB;AACxC,OAAOC,cAA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,EAAEtF,YAAY,CAACsF,KAAM;IAC1BZ,OAAO,EAAE1E,YAAY,CAACuF,aAAc;IACpC,aAAW,gBAAgBvF,YAAY,CAACmD,IAAI,EAAG;IAC/C,cAAYnD,YAAY,CAAC,YAAY,CAAE;IACvCmD,IAAI,EAAEnD,YAAY,CAACmD,IAAK;IACxBqC,WAAW,EAAExF,YAAY,CAACwF,WAAY;IACtCrF,IAAI,EAAEH,YAAY,CAACG;EAAK,CACzB,CACE,CAAC,GACJ,IAAI,EACPG,WAAW,gBACVpD,KAAA,CAAAmC,aAAA;IAAKC,SAAS,EAAEgB,WAAW,CAAC8E,WAAW,GAAGnG,KAAK,CAACmG,WAAW,GAAGnG,KAAK,CAACoG;EAAO,gBACzEnI,KAAA,CAAAmC,aAAA,CAACX,GAAG;IACF4G,KAAK,EAAEhF,WAAW,CAACgF,KAAM;IACzBZ,OAAO,EAAEpE,WAAW,CAACiF,aAAc;IACnC,aAAW,gBAAgBjF,WAAW,CAAC6C,IAAI,EAAG;IAC9C,cAAY7C,WAAW,CAAC,YAAY,CAAE;IACtC6C,IAAI,EAAE7C,WAAW,CAAC6C,IAAK;IACvBqC,WAAW,EAAElF,WAAW,CAACkF;EAAY,CACtC,CACE,CAAC,GACJ,IACD,CAAC,GACJ,IACD,CACF,CAAC;AAEV,CAAC;AAED7F,OAAO,CAACT,SAAS,GAAAuG,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGzG,SAAS;AAC7BS,OAAO,CAACiG,YAAY,GAAG;EACrBC,SAAS,EAAEpH,QAAQ,CAACqH,iBAAiB,CAACD;AACxC,CAAC;AAED,eAAelG,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useRef","useEffect","useMemo","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaCompositionCoorpacademyPadlock","LockIcon","NovaLineStatusCheckCircle1","CheckCircle1","NovaSolidFilesBasicFileLines","FileLinesIcon","NovaSolidInterfaceFeedbackInterfaceAlertRounded","AlertIcon","map","isEmpty","classNames","Provider","ButtonLink","ButtonLinkIcon","InputSwitch","Title","CardsGrid","ListItems","Link","Icon","style","propTypes","LOGO","IconType","lockedContent","createElement","className","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","link","backgroundImageStyle","backgroundImage","backgroundSize","handleCloseButton","nodeRef","closePopin","e","current","contains","target","handleKeyDown","key","document","addEventListener","removeEventListener","wrapperPopinStyle","popin","popinCookie","popinFilesList","popinItems","buildIcon","LogoComponent","_extends","buildHeader","title","headerIcon","TopTitleIcon","Fragment","headerContent","headerBackground","src","cookieHeader","cookieIconContainer","cookieIcon","renderHeader","close","onCloseButton","onClick","size","popinHeader","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","renderItems","list","itemsContainer","filesListContainer","renderContent","isCookieOrInformations","renderContentTitle","message","dangerouslySetInnerHTML","__html","cookieTitleContainer","titleContainer","contentSection","renderButtons","buttonContainer","largeButton","button","label","handleOnclick","customStyle","background","ref","descriptionBtn","process","env","NODE_ENV","contextTypes","translate","childContextTypes"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React, {useRef, useEffect, useMemo} from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaLineStatusCheckCircle1 as CheckCircle1,\n NovaSolidFilesBasicFileLines as FileLinesIcon,\n NovaSolidInterfaceFeedbackInterfaceAlertRounded as AlertIcon\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport classNames from 'classnames';\nimport Provider from '../../atom/provider';\nimport ButtonLink from '../../atom/button-link';\nimport ButtonLinkIcon from '../../atom/button-link-icon';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport Link from '../../atom/link';\nimport Icon from '../../atom/icon';\nimport style from './style.css';\nimport propTypes from './types';\n\n// DEPRECATED\nconst LOGO = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1,\n AlertIcon\n};\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />,\n fileZipped: (\n <div className={style.filesListIconContainer}>\n <FileLinesIcon className={style.filesListIcon} />\n </div>\n )\n};\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth,\n items,\n link\n } = props;\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const handleCloseButton = useMemo(() => () => onClose(), [onClose]);\n const nodeRef = useRef(null);\n useEffect(() => {\n if (mode === 'items') {\n const closePopin = e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n handleCloseButton();\n }\n };\n const handleKeyDown = e => {\n if (e?.key === 'Escape') {\n handleCloseButton();\n }\n };\n document.addEventListener('click', closePopin);\n document.addEventListener('touchstart', closePopin);\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('click', closePopin);\n document.removeEventListener('touchstart', closePopin);\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [handleCloseButton, mode, onClose]);\n\n const wrapperPopinStyle = classNames(\n style.popin,\n mode === 'cookie' && style.popinCookie,\n mode === 'list' && style.popinFilesList,\n mode === 'items' && style.popinItems\n );\n\n const buildIcon = () => {\n if (typeof icon === 'string') {\n const LogoComponent = LOGO[icon];\n return LogoComponent ? <LogoComponent className={style.icon} /> : null;\n }\n\n return !isEmpty(icon) ? <Icon {...icon} className={style.icon} /> : null;\n };\n\n const buildHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n\n return (\n <>\n {title ? (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <Title {...title} />\n </div>\n ) : null}\n {backgroundImage ? (\n <img className={style.headerBackground} src={backgroundImage} />\n ) : null}\n </>\n );\n }\n\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n };\n\n const renderHeader = () => {\n const headerContent = buildHeader();\n const close = onClose ? (\n <div className={style.onCloseButton}>\n <ButtonLinkIcon\n onClick={handleCloseButton}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n </div>\n ) : null;\n\n if (isEmpty(headerContent) && isEmpty(close)) return null;\n\n return (\n <header className={style.popinHeader}>\n {headerContent}\n {close}\n </header>\n );\n };\n\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n\n const renderItems = () => {\n if (isEmpty(items)) return null;\n const {type, list} = items;\n\n if (type === 'content')\n return (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n <CardsGrid {...list} />\n </div>\n );\n if (type === 'list')\n return (\n <div className={style.filesListContainer}>\n <ListItems {...list} />\n </div>\n );\n\n return null;\n };\n\n const renderContent = () => {\n if (mode === 'items' || mode === 'list') return;\n\n const isCookieOrInformations = mode === 'cookie' || mode === 'information';\n const renderContentTitle = () => {\n if (!content) return null;\n\n if (isCookieOrInformations)\n return (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n );\n\n return (\n <div className={mode === 'alert' ? style.content : style.message}>\n <Title title={content} data-name={'cm-popin-content'} />\n </div>\n );\n };\n\n return (\n <div className={isCookieOrInformations ? style.cookieTitleContainer : style.titleContainer}>\n {buildIcon()}\n <div className={style.contentSection}>\n {renderContentTitle()}\n {descriptionText ? <div className={style.descriptionText}>{descriptionText}</div> : null}\n </div>\n {link ? <Link {...link} /> : null}\n </div>\n );\n };\n\n const renderButtons = () => {\n if (!firstButton && !secondButton && !thirdButton) return null;\n\n return (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n icon={secondButton.icon}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n );\n };\n\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n {renderHeader()}\n {renderContent()}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderItems()}\n {renderBtnSwitch()}\n {renderButtons()}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\nCMPopin.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default CMPopin;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAO,OAAO;AACvD,SACEC,+CAA+C,IAAIC,YAAY,EAC/DC,kCAAkC,IAAIC,YAAY,EAClDC,sBAAsB,IAAIC,MAAM,EAChCC,wBAAwB,IAAIC,UAAU,EACtCC,kCAAkC,IAAIC,QAAQ,EAC9CC,0BAA0B,IAAIC,YAAY,EAC1CC,4BAA4B,IAAIC,aAAa,EAC7CC,+CAA+C,IAAIC,SAAS,QACvD,0BAA0B;AACjC,OAAOC,GAAG,MAAM,eAAe;AAC/B,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,SAAS,MAAM,2BA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C,CACE,CAAC,GACJ,IACD,CAAC;EAEV,CAAC;EAED,oBACE5I,KAAA,CAAAqC,aAAA;IACEC,SAAS,EAAEQ,IAAI,KAAK,QAAQ,GAAGd,KAAK,CAAC6G,UAAU,GAAG,IAAK;IACvD7G,KAAK,EAAE4B,oBAAqB;IAC5B,aAAW;EAAqB,gBAEhC5D,KAAA,CAAAqC,aAAA;IAAKC,SAAS,EAAEqC,iBAAkB;IAACmE,GAAG,EAAE9E;EAAQ,GAC7C8B,YAAY,CAAC,CAAC,EACd+B,aAAa,CAAC,CAAC,EACfrE,iBAAiB,gBAAGxD,KAAA,CAAAqC,aAAA;IAAKC,SAAS,EAAEN,KAAK,CAAC+G;EAAe,GAAEvF,iBAAuB,CAAC,GAAG,IAAI,EAC1FiE,WAAW,CAAC,CAAC,EACbd,eAAe,CAAC,CAAC,EACjB2B,aAAa,CAAC,CACZ,CACF,CAAC;AAEV,CAAC;AAED3F,OAAO,CAACV,SAAS,GAAA+G,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGjH,SAAS;AAC7BU,OAAO,CAACwG,YAAY,GAAG;EACrBC,SAAS,EAAE7H,QAAQ,CAAC8H,iBAAiB,CAACD;AACxC,CAAC;AAED,eAAezG,OAAO","ignoreList":[]}
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.popin {
|
|
50
|
-
width:
|
|
50
|
+
width: 400px;
|
|
51
51
|
flex-grow: 0;
|
|
52
52
|
margin: 16px;
|
|
53
|
-
padding:
|
|
53
|
+
padding: 24px;
|
|
54
54
|
border-radius: 20px;
|
|
55
55
|
background-color: cm_grey_50;
|
|
56
56
|
display: flex;
|
|
@@ -58,10 +58,13 @@
|
|
|
58
58
|
align-items: center;
|
|
59
59
|
justify-content: space-between;
|
|
60
60
|
animation: popup 0.7s;
|
|
61
|
+
gap: 32px;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.popinItems {
|
|
64
65
|
padding: 0;
|
|
66
|
+
width: fit-content;
|
|
67
|
+
gap: 0;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
|
|
@@ -101,18 +104,17 @@
|
|
|
101
104
|
|
|
102
105
|
.content {
|
|
103
106
|
font-family: Gilroy;
|
|
104
|
-
font-size:
|
|
105
|
-
font-weight:
|
|
107
|
+
font-size: 18px;
|
|
108
|
+
font-weight: 700;
|
|
106
109
|
font-stretch: normal;
|
|
107
110
|
font-style: normal;
|
|
108
|
-
line-height:
|
|
111
|
+
line-height: 24px;
|
|
109
112
|
letter-spacing: normal;
|
|
110
113
|
text-align: center;
|
|
111
114
|
color: cm_grey_600;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
.buttonContainer {
|
|
115
|
-
min-height: 80px;
|
|
116
118
|
display: flex;
|
|
117
119
|
width: 100%;
|
|
118
120
|
align-items: center;
|
|
@@ -121,7 +123,7 @@
|
|
|
121
123
|
|
|
122
124
|
.button {
|
|
123
125
|
min-width: max-content;
|
|
124
|
-
width:
|
|
126
|
+
width: 100%;
|
|
125
127
|
padding: 8px;
|
|
126
128
|
}
|
|
127
129
|
|
|
@@ -178,24 +180,20 @@
|
|
|
178
180
|
text-align: center;
|
|
179
181
|
font-family: Gilroy;
|
|
180
182
|
font-weight: 500;
|
|
181
|
-
font-size:
|
|
182
|
-
line-height:
|
|
183
|
+
font-size: 14px;
|
|
184
|
+
line-height: 20px;
|
|
183
185
|
color: cm_grey_500;
|
|
184
186
|
font-style: normal;
|
|
185
187
|
white-space: pre-line;
|
|
186
|
-
margin: 0px 32px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.content {
|
|
190
|
-
margin: 20px 32px;
|
|
191
188
|
}
|
|
192
189
|
|
|
193
190
|
.titleContainer {
|
|
194
|
-
|
|
191
|
+
justify-content: center;
|
|
195
192
|
align-items: center;
|
|
196
193
|
display: flex;
|
|
197
194
|
flex-direction: column;
|
|
198
195
|
width: 100%;
|
|
196
|
+
gap: 24px;
|
|
199
197
|
}
|
|
200
198
|
|
|
201
199
|
.descriptionBtn {
|
|
@@ -258,6 +256,9 @@ a {
|
|
|
258
256
|
bottom: 32px;
|
|
259
257
|
left: 32px;
|
|
260
258
|
z-index: 1000;
|
|
259
|
+
width: fit-content;
|
|
260
|
+
gap: 0;
|
|
261
|
+
padding: 16px;
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
.cookieHeader {
|
|
@@ -411,9 +412,6 @@ a {
|
|
|
411
412
|
.descriptionText {
|
|
412
413
|
margin: 0px 16px;
|
|
413
414
|
}
|
|
414
|
-
.content {
|
|
415
|
-
margin: 20px 16px;
|
|
416
|
-
}
|
|
417
415
|
.message {
|
|
418
416
|
padding: 40px 16px 0px;
|
|
419
417
|
}
|
|
@@ -450,10 +448,6 @@ a {
|
|
|
450
448
|
.descriptionText {
|
|
451
449
|
margin: 0px 16px;
|
|
452
450
|
}
|
|
453
|
-
|
|
454
|
-
.content {
|
|
455
|
-
margin: 16px 32px;
|
|
456
|
-
}
|
|
457
451
|
|
|
458
452
|
.largeButton {
|
|
459
453
|
margin: 0px 32px;
|
|
@@ -3,6 +3,7 @@ import Link from '../../atom/link';
|
|
|
3
3
|
import { TitleProps } from '../../atom/title/types';
|
|
4
4
|
import CardsGrid from '../../organism/cards-grid';
|
|
5
5
|
import ListItems from '../../organism/list-items';
|
|
6
|
+
import { iconPropTypes } from '../../atom/icon';
|
|
6
7
|
declare const propTypes: {
|
|
7
8
|
content: PropTypes.Requireable<string>;
|
|
8
9
|
mode: PropTypes.Requireable<string>;
|
|
@@ -100,7 +101,21 @@ declare const propTypes: {
|
|
|
100
101
|
}>;
|
|
101
102
|
}>>;
|
|
102
103
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
103
|
-
icon: PropTypes.Requireable<string
|
|
104
|
+
icon: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
105
|
+
iconName: PropTypes.Validator<string>;
|
|
106
|
+
iconColor: PropTypes.Requireable<string>;
|
|
107
|
+
backgroundColor: PropTypes.Requireable<string>;
|
|
108
|
+
gradientBackground: PropTypes.Requireable<boolean>;
|
|
109
|
+
borderRadius: PropTypes.Requireable<string>;
|
|
110
|
+
preset: PropTypes.Requireable<string>;
|
|
111
|
+
size: PropTypes.Requireable<PropTypes.InferProps<{
|
|
112
|
+
faSize: PropTypes.Requireable<number>;
|
|
113
|
+
wrapperSize: PropTypes.Requireable<number>;
|
|
114
|
+
}>>;
|
|
115
|
+
customStyle: PropTypes.Requireable<{
|
|
116
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
}> | null | undefined>>;
|
|
104
119
|
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
105
120
|
descriptionText: PropTypes.Requireable<string>;
|
|
106
121
|
cookieTitle: PropTypes.Requireable<string>;
|
|
@@ -440,7 +455,7 @@ export declare type QuitPopinButton = {
|
|
|
440
455
|
};
|
|
441
456
|
export declare type CMPopinProps = {
|
|
442
457
|
content: string;
|
|
443
|
-
icon: string
|
|
458
|
+
icon: string | PropTypes.InferProps<typeof iconPropTypes>;
|
|
444
459
|
mode: 'alert' | 'information' | 'cookie' | 'items' | 'list';
|
|
445
460
|
onClose?: () => void;
|
|
446
461
|
popinHeader?: PopinHeaderProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,C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