@coorpacademy/components 11.18.10 → 11.19.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/title/types.d.ts +9 -0
- package/es/atom/title/types.d.ts.map +1 -0
- package/es/atom/title/types.js +2 -0
- package/es/atom/title/types.js.map +1 -0
- package/es/molecule/card/index.d.ts +1 -0
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +11 -10
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/style.css +47 -5
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +46 -9
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +32 -0
- package/es/molecule/cm-popin/types.d.ts +31 -1
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +13 -3
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +1 -0
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +45 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.js +15 -3
- package/es/molecule/title-and-checkbox-wrapper/index.js.map +1 -1
- package/es/organism/rewards-form/index.d.ts +45 -0
- package/es/organism/select-opponents/index.d.ts +67 -12
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/index.js +3 -3
- package/es/organism/select-opponents/index.js.map +1 -1
- package/es/organism/select-opponents/style.css +6 -0
- package/es/organism/select-opponents/types.d.ts +75 -14
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/select-opponents/types.js +2 -2
- package/es/organism/select-opponents/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +84 -29
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +84 -29
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +45 -0
- package/es/template/app-player/loading/index.d.ts +19 -1
- package/es/template/app-player/player/index.d.ts +38 -2
- package/es/template/app-player/player/slides/index.d.ts +19 -1
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +19 -1
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +20 -1
- package/es/template/app-player/popin-end/summary.d.ts +1 -0
- package/es/template/app-review/index.d.ts +19 -1
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +19 -1
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +19 -1
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +19 -1
- package/es/template/common/dashboard/index.d.ts +89 -1
- package/es/template/common/dashboard/index.d.ts.map +1 -1
- package/es/template/common/dashboard/index.js +6 -2
- package/es/template/common/dashboard/index.js.map +1 -1
- package/es/template/common/dashboard/style.css +5 -0
- package/es/template/common/search-page/index.d.ts +71 -0
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +8 -3
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/common/search-page/style.css +5 -0
- package/es/template/external-course/index.d.ts +19 -1
- package/es/template/teams-dashboard/index.d.ts +1 -0
- package/es/variables/colors.css +1 -1
- package/lib/atom/title/types.d.ts +9 -0
- package/lib/atom/title/types.d.ts.map +1 -0
- package/lib/atom/title/types.js +2 -0
- package/lib/atom/title/types.js.map +1 -0
- package/lib/molecule/card/index.d.ts +1 -0
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +10 -8
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/style.css +47 -5
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +48 -8
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +32 -0
- package/lib/molecule/cm-popin/types.d.ts +31 -1
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +15 -3
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +1 -0
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +45 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.js +17 -3
- package/lib/molecule/title-and-checkbox-wrapper/index.js.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +45 -0
- package/lib/organism/select-opponents/index.d.ts +67 -12
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/index.js +3 -3
- package/lib/organism/select-opponents/index.js.map +1 -1
- package/lib/organism/select-opponents/style.css +6 -0
- package/lib/organism/select-opponents/types.d.ts +75 -14
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.js +2 -2
- package/lib/organism/select-opponents/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +84 -29
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +84 -29
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +45 -0
- package/lib/template/app-player/loading/index.d.ts +19 -1
- package/lib/template/app-player/player/index.d.ts +38 -2
- package/lib/template/app-player/player/slides/index.d.ts +19 -1
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +19 -1
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +20 -1
- package/lib/template/app-player/popin-end/summary.d.ts +1 -0
- package/lib/template/app-review/index.d.ts +19 -1
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +19 -1
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +19 -1
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +19 -1
- package/lib/template/common/dashboard/index.d.ts +89 -1
- package/lib/template/common/dashboard/index.d.ts.map +1 -1
- package/lib/template/common/dashboard/index.js +6 -2
- package/lib/template/common/dashboard/index.js.map +1 -1
- package/lib/template/common/dashboard/style.css +5 -0
- package/lib/template/common/search-page/index.d.ts +71 -0
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +9 -3
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/common/search-page/style.css +5 -0
- package/lib/template/external-course/index.d.ts +19 -1
- package/lib/template/teams-dashboard/index.d.ts +1 -0
- package/lib/variables/colors.css +1 -1
- package/locales/.mtslconfig.json +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare type TitleProps = {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle: string;
|
|
4
|
+
type: 'page' | 'form-group';
|
|
5
|
+
'data-name'?: string;
|
|
6
|
+
titleSize: 'standard' | 'medium' | 'small';
|
|
7
|
+
subtitleSize: 'standard' | 'small' | 'small-without-margin' | 'extra-small';
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/title/types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC3C,YAAY,EAAE,UAAU,GAAG,OAAO,GAAG,sBAAsB,GAAG,aAAa,CAAC;CAC7E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/atom/title/types.ts"],"sourcesContent":["export type TitleProps = {\n title: string;\n subtitle: string;\n type: 'page' | 'form-group';\n 'data-name'?: string;\n titleSize: 'standard' | 'medium' | 'small';\n subtitleSize: 'standard' | 'small' | 'small-without-margin' | 'extra-small';\n};\n"],"mappings":""}
|
|
@@ -34,6 +34,7 @@ export const cardPropTypes: {
|
|
|
34
34
|
badgeCategory: PropTypes.Requireable<string>;
|
|
35
35
|
badgeLabel: PropTypes.Requireable<string>;
|
|
36
36
|
theme: PropTypes.Requireable<string>;
|
|
37
|
+
disabledContent: PropTypes.Requireable<string>;
|
|
37
38
|
'aria-label': PropTypes.Requireable<string>;
|
|
38
39
|
'background-aria-label': PropTypes.Requireable<string>;
|
|
39
40
|
'favorite-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/card/index.js"],"names":[],"mappings":";;;;;AAuPA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;;;AA9JF,uDA0HG"}
|
|
@@ -9,7 +9,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
9
9
|
import React, { useMemo, memo } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import classnames from 'classnames';
|
|
12
|
-
import {
|
|
12
|
+
import { NovaCompositionCoorpacademyPadlock as LockIcon, NovaCompositionCoorpacademyPictures as PicturesIcon } from '@coorpacademy/nova-icons';
|
|
13
13
|
import { isExternalContent, EXTERNAL_CONTENT_ICONS } from '../../util/external-content';
|
|
14
14
|
import Provider from '../../atom/provider';
|
|
15
15
|
import CardContentInfo, { MODES } from '../card-content';
|
|
@@ -134,6 +134,7 @@ const Card = /*#__PURE__*/memo(function Card(props, context) {
|
|
|
134
134
|
badgeCategory,
|
|
135
135
|
badgeLabel,
|
|
136
136
|
theme = 'default',
|
|
137
|
+
disabledContent,
|
|
137
138
|
'aria-label': cardArialabel,
|
|
138
139
|
'background-aria-label': backgroundAriaLabel,
|
|
139
140
|
'favorite-aria-label': favoriteAriaLabel,
|
|
@@ -148,20 +149,19 @@ const Card = /*#__PURE__*/memo(function Card(props, context) {
|
|
|
148
149
|
|
|
149
150
|
const primaryColor = _get('common.primary', skin);
|
|
150
151
|
|
|
151
|
-
const whiteColor = _get('common.white', skin);
|
|
152
|
-
|
|
153
152
|
const cardStyle = classnames(THEMES[theme], type === 'chapter' ? style.chapter : style.course, title ? null : style.lazy, style.grid, empty ? style.empty : null);
|
|
154
153
|
|
|
155
154
|
const disabled = hidden && (!isSelected || _isUndefined(isSelected));
|
|
156
155
|
|
|
157
|
-
const handleClick = useMemo(() => e =>
|
|
158
|
-
const lock = disabled ? /*#__PURE__*/React.createElement(
|
|
156
|
+
const handleClick = useMemo(() => e => onClick(e), [onClick]);
|
|
157
|
+
const lock = disabled ? /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
className: style.lockContent
|
|
159
|
+
}, /*#__PURE__*/React.createElement(LockIcon, {
|
|
159
160
|
className: style.lockIcon,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}) : null;
|
|
161
|
+
height: 48
|
|
162
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
163
|
+
"aria-label": disabledArialabel
|
|
164
|
+
}, disabledContent)) : null;
|
|
165
165
|
const inlineBadgeStyle = {
|
|
166
166
|
color: primaryColor
|
|
167
167
|
};
|
|
@@ -256,6 +256,7 @@ export const cardPropTypes = {
|
|
|
256
256
|
badgeCategory: CardContentInfo.propTypes.badgeCategory,
|
|
257
257
|
badgeLabel: CardContentInfo.propTypes.badgeLabel,
|
|
258
258
|
theme: PropTypes.oneOf(_keys(THEMES)),
|
|
259
|
+
disabledContent: PropTypes.string,
|
|
259
260
|
'aria-label': PropTypes.string,
|
|
260
261
|
'background-aria-label': PropTypes.string,
|
|
261
262
|
'favorite-aria-label': Favorite.propTypes['aria-label'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaSolidLoginLocked","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","whiteColor","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockIcon","inlineBadgeStyle","getType","contentType","CARD","lockWrapper","cardPropTypes","shape","number","func","oneOf"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaSolidLoginLocked as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => !disabled && onClick(e), [disabled, onClick]);\n const lock = disabled ? (\n <LockIcon className={style.lockIcon} style={{color: whiteColor}} height={40} />\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,IAAxB,QAAmC,OAAnC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,oBAAoB,IAAIC,QAD1B,EAEEC,mCAAmC,IAAIC,YAFzC,QAGO,0BAHP;AAIA,SAAQC,iBAAR,EAA2BC,sBAA3B,QAAwD,6BAAxD;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,eAAP,IAAyBC,KAAzB,QAAqC,iBAArC;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,OAAO,MAAMC,MAAM,GAAG;EACpBC,OAAO,EAAE,IADW;EAEpBC,YAAY,EAAEH,KAAK,CAACG;AAFA,CAAf;;AAKP,MAAMC,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,KAAd;EAAqB,cAAcC;AAAnC,CAAD,EAAgD;EAACC;AAAD,CAAhD,KAA2D;EAChF,MAAMC,eAAe,GAAGnB,iBAAiB,CAACc,IAAD,CAAzC;;EACA,MAAMM,YAAY,GAAG,KAAI,gBAAJ,EAAsBF,IAAtB,CAArB;;EACA,MAAMG,UAAU,GAAG,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AACiD,IAXO;EAY3Bc,kBAAkB,EAAE/D,SAAS,CAACgD,MAZH;EAa3BgB,qBAAqB,EAAEhE,SAAS,CAACgD,MAbN;EAc3BiB,OAAO,EAAEjE,SAAS,CAACiG,IAdQ;EAe3B/B,eAAe,EAAElE,SAAS,CAACiG,IAfA;EAgB3B9B,UAAU,EAAEnE,SAAS,CAACiD,IAhBK;EAiB3BmB,YAAY,EAAEpE,SAAS,CAAC+F,KAAV,CAAgBjF,YAAY,CAACiC,SAA7B,CAjBa;EAkB3BsB,aAAa,EAAE5D,eAAe,CAACsC,SAAhB,CAA0BsB,aAlBd;EAmB3BC,UAAU,EAAE7D,eAAe,CAACsC,SAAhB,CAA0BuB,UAnBX;EAoB3BC,KAAK,EAAEvE,SAAS,CAACkG,KAAV,CAAgB,MAAKlF,MAAL,CAAhB,CApBoB;EAqB3B,cAAchB,SAAS,CAACgD,MArBG;EAsB3B,yBAAyBhD,SAAS,CAACgD,MAtBR;EAuB3B,uBAAuBpC,QAAQ,CAACmC,SAAT,CAAmB,YAAnB,CAvBI;EAwB3B,yBAAyBlC,UAAU,CAACkC,SAAX,CAAqB,YAArB,CAxBE;EAyB3B,uBAAuBpC,QAAQ,CAACoC,SAAT,CAAmB,YAAnB,CAzBI;EA0B3B,oBAAoB/C,SAAS,CAACgD,MA1BH;EA2B3B,uBAAuBhD,SAAS,CAACgD,MA3BN;EA4B3B,2BAA2BvC,eAAe,CAACsC,SAAhB,CAA0B,YAA1B;AA5BA,CAAtB;AA+BPG,IAAI,CAACH,SAAL,2CAAiB+C,aAAjB;AAEA,eAAe5C,IAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","memo","PropTypes","classnames","NovaCompositionCoorpacademyPadlock","LockIcon","NovaCompositionCoorpacademyPictures","PicturesIcon","isExternalContent","EXTERNAL_CONTENT_ICONS","Provider","CardContentInfo","MODES","Customer","Favorite","Selectable","Notification","style","THEMES","default","coorpmanager","CardBackground","type","image","empty","ariaLabel","skin","externalContent","primaryColor","whiteColor","IconType","icon","iconColor","color","backgroundIcon","externalIconCircleWrapper","externalIcon","_backgroundIcon","externalIconCircleWithImageWrapper","backgroundColor","externalIconWithImage","imageWrapper","backgroundImage","externalContentHeader","externalBackground","emptyIcon","chapterImageWrapper","contextTypes","childContextTypes","propTypes","string","bool","Card","props","context","badge","adaptiv","disabled","hidden","title","author","customer","certifiedAuthor","progress","favorite","addFavoriteToolTip","removeFavoriteToolTip","onClick","onFavoriteClick","isSelected","notification","badgeCategory","badgeLabel","theme","disabledContent","cardArialabel","backgroundAriaLabel","favoriteAriaLabel","selectableAriaLabel","customerAriaLabel","badgeAriaLabel","disabledArialabel","cardContentLabelAriaLabel","cardStyle","chapter","course","lazy","grid","handleClick","e","lock","lockContent","lockIcon","inlineBadgeStyle","getType","contentType","CARD","lockWrapper","cardPropTypes","shape","number","func","oneOf"],"sources":["../../../src/molecule/card/index.js"],"sourcesContent":["import React, {useMemo, memo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, isEmpty, isUndefined, pick, keys} from 'lodash/fp';\nimport {\n NovaCompositionCoorpacademyPadlock as LockIcon,\n NovaCompositionCoorpacademyPictures as PicturesIcon\n} from '@coorpacademy/nova-icons';\nimport {isExternalContent, EXTERNAL_CONTENT_ICONS} from '../../util/external-content';\nimport Provider from '../../atom/provider';\nimport CardContentInfo, {MODES} from '../card-content';\nimport Customer from './customer';\nimport Favorite from './favorite';\nimport Selectable from './selectable';\nimport Notification from './notification';\nimport style from './style.css';\n\nexport const THEMES = {\n default: null,\n coorpmanager: style.coorpmanager\n};\n\nconst CardBackground = ({type, image, empty, 'aria-label': ariaLabel}, {skin}) => {\n const externalContent = isExternalContent(type);\n const primaryColor = get('common.primary', skin);\n const whiteColor = get('common.white', skin);\n\n if (externalContent && EXTERNAL_CONTENT_ICONS[type]) {\n const IconType = EXTERNAL_CONTENT_ICONS[type].icon;\n const iconColor = EXTERNAL_CONTENT_ICONS[type].color;\n const backgroundIcon = (\n <div className={style.externalIconCircleWrapper}>\n <IconType className={style.externalIcon} />\n </div>\n );\n\n if (image) {\n const _backgroundIcon = (\n <div\n className={classnames(\n style.externalIconCircleWrapper,\n style.externalIconCircleWithImageWrapper\n )}\n style={{\n backgroundColor: iconColor\n }}\n >\n <IconType className={style.externalIconWithImage} />\n </div>\n );\n\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor,\n backgroundImage: `url('${image}')`\n }}\n className={classnames(style.externalContentHeader, style.externalBackground)}\n >\n {_backgroundIcon}\n </div>\n </div>\n );\n }\n return (\n <div className={style.imageWrapper}>\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n style={{\n backgroundColor: iconColor\n }}\n className={style.externalContentHeader}\n >\n {backgroundIcon}\n </div>\n </div>\n );\n }\n\n const emptyIcon = empty ? (\n <PicturesIcon className={style.emptyIcon} style={{color: whiteColor}} />\n ) : null;\n return (\n <div\n className={classnames(\n style.imageWrapper,\n type === 'chapter' ? style.chapterImageWrapper : null\n )}\n >\n <div\n data-name=\"cover\"\n aria-label={ariaLabel}\n className={style.image}\n style={{\n backgroundColor: primaryColor,\n backgroundImage: image ? `url('${image}')` : 'none'\n }}\n >\n {emptyIcon}\n </div>\n </div>\n );\n};\n\nCardBackground.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCardBackground.propTypes = {\n type: PropTypes.string,\n image: PropTypes.string,\n empty: PropTypes.bool,\n 'aria-label': PropTypes.string\n};\n\nconst Card = memo(function Card(props, context) {\n const {skin} = context;\n const {\n image,\n badge,\n adaptiv,\n disabled: hidden = false,\n type = 'course',\n title,\n author,\n customer,\n certifiedAuthor,\n progress,\n favorite,\n addFavoriteToolTip,\n removeFavoriteToolTip,\n onClick,\n onFavoriteClick,\n isSelected,\n notification,\n badgeCategory,\n badgeLabel,\n theme = 'default',\n disabledContent,\n 'aria-label': cardArialabel,\n 'background-aria-label': backgroundAriaLabel,\n 'favorite-aria-label': favoriteAriaLabel,\n 'selectable-aria-label': selectableAriaLabel,\n 'customer-aria-label': customerAriaLabel,\n 'badge-aria-label': badgeAriaLabel,\n 'disabled-aria-label': disabledArialabel,\n 'card-content-aria-label': cardContentLabelAriaLabel\n } = props;\n const empty = isEmpty(pick(['title', 'type', 'author', 'image'], props));\n const primaryColor = get('common.primary', skin);\n const cardStyle = classnames(\n THEMES[theme],\n type === 'chapter' ? style.chapter : style.course,\n title ? null : style.lazy,\n style.grid,\n empty ? style.empty : null\n );\n const disabled = hidden && (!isSelected || isUndefined(isSelected));\n const handleClick = useMemo(() => e => onClick(e), [onClick]);\n const lock = disabled ? (\n <div className={style.lockContent}>\n <LockIcon className={style.lockIcon} height={48} />\n <span aria-label={disabledArialabel}>{disabledContent}</span>\n </div>\n ) : null;\n const inlineBadgeStyle = {color: primaryColor};\n const getType = contentType => {\n switch (contentType) {\n case 'chapter':\n return 'microlearning';\n case 'course':\n return 'learner';\n default:\n return contentType;\n }\n };\n\n return (\n <div\n className={cardStyle}\n data-name=\"card\"\n data-lock={disabled}\n data-type={getType(type)}\n disabled={disabled}\n onClick={handleClick}\n aria-label={cardArialabel}\n >\n <CardBackground type={type} image={image} empty={empty} aria-label={backgroundAriaLabel} />\n {isUndefined(isSelected) && !isUndefined(favorite) ? (\n <Favorite\n className={style.favorite}\n favorite={favorite}\n disabled={disabled}\n onFavoriteClick={onFavoriteClick}\n addFavoriteToolTip={addFavoriteToolTip}\n removeFavoriteToolTip={removeFavoriteToolTip}\n aria-label={favoriteAriaLabel}\n />\n ) : null}\n <Selectable isSelected={isSelected} hidden={hidden} aria-label={selectableAriaLabel} />\n {notification ? <Notification {...notification} /> : null}\n {customer ? (\n <Customer\n {...customer}\n theme={theme}\n type={type}\n disabled={disabled}\n aria-label={customerAriaLabel}\n />\n ) : null}\n <CardContentInfo\n mode={MODES.CARD}\n adaptiv={adaptiv}\n author={author}\n certifiedAuthor={certifiedAuthor}\n disabled={disabled}\n empty={empty}\n progress={progress}\n title={title}\n type={type}\n badgeCategory={badgeCategory}\n badgeLabel={badgeLabel}\n theme={theme}\n aria-label={cardContentLabelAriaLabel}\n />\n {badge ? (\n <div className={style.badge} style={inlineBadgeStyle} aria-label={badgeAriaLabel}>\n {badge}\n </div>\n ) : null}\n {disabled ? (\n <div className={style.lockWrapper} aria-label={disabledArialabel}>\n {lock}\n </div>\n ) : null}\n </div>\n );\n});\n\nCard.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport const cardPropTypes = {\n badge: PropTypes.string,\n image: PropTypes.string,\n disabled: PropTypes.bool,\n adaptiv: PropTypes.bool,\n type: PropTypes.string,\n title: PropTypes.string,\n author: PropTypes.string,\n certifiedAuthor: PropTypes.bool,\n customer: PropTypes.shape(Customer.propTypes),\n progress: PropTypes.number,\n favorite: PropTypes.bool,\n addFavoriteToolTip: PropTypes.string,\n removeFavoriteToolTip: PropTypes.string,\n onClick: PropTypes.func,\n onFavoriteClick: PropTypes.func,\n isSelected: PropTypes.bool,\n notification: PropTypes.shape(Notification.propTypes),\n badgeCategory: CardContentInfo.propTypes.badgeCategory,\n badgeLabel: CardContentInfo.propTypes.badgeLabel,\n theme: PropTypes.oneOf(keys(THEMES)),\n disabledContent: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'background-aria-label': PropTypes.string,\n 'favorite-aria-label': Favorite.propTypes['aria-label'],\n 'selectable-aria-label': Selectable.propTypes['aria-label'],\n 'customer-aria-label': Customer.propTypes['aria-label'],\n 'badge-aria-label': PropTypes.string,\n 'disabled-aria-label': PropTypes.string,\n 'card-content-aria-label': CardContentInfo.propTypes['aria-label']\n};\n\nCard.propTypes = cardPropTypes;\n\nexport default Card;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,EAAwBC,IAAxB,QAAmC,OAAnC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,kCAAkC,IAAIC,QADxC,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AACgD,MArBA;EAsB3B,cAAchD,SAAS,CAACgD,MAtBG;EAuB3B,yBAAyBhD,SAAS,CAACgD,MAvBR;EAwB3B,uBAAuBpC,QAAQ,CAACmC,SAAT,CAAmB,YAAnB,CAxBI;EAyB3B,yBAAyBlC,UAAU,CAACkC,SAAX,CAAqB,YAArB,CAzBE;EA0B3B,uBAAuBpC,QAAQ,CAACoC,SAAT,CAAmB,YAAnB,CA1BI;EA2B3B,oBAAoB/C,SAAS,CAACgD,MA3BH;EA4B3B,uBAAuBhD,SAAS,CAACgD,MA5BN;EA6B3B,2BAA2BvC,eAAe,CAACsC,SAAhB,CAA0B,YAA1B;AA7BA,CAAtB;AAgCPG,IAAI,CAACH,SAAL,2CAAiBiD,aAAjB;AAEA,eAAe9C,IAAf"}
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
@value dark from colors;
|
|
9
9
|
@value xtraLightGrey from colors;
|
|
10
10
|
@value white from colors;
|
|
11
|
+
@value cm_negative_200 from colors;
|
|
12
|
+
@value negative_100 from colors;
|
|
11
13
|
|
|
12
14
|
.default[disabled] {
|
|
13
|
-
pointer-events: none;
|
|
14
15
|
cursor: inherit;
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
.default[disabled] .imageWrapper {
|
|
166
|
-
opacity: 0.
|
|
167
|
+
opacity: 0.8;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
.lockWrapper {
|
|
@@ -186,12 +187,53 @@
|
|
|
186
187
|
bottom: 0;
|
|
187
188
|
content: '';
|
|
188
189
|
opacity: 0.4;
|
|
189
|
-
background:
|
|
190
|
+
background: linear-gradient(
|
|
191
|
+
to bottom,
|
|
192
|
+
black 50%
|
|
193
|
+
);
|
|
194
|
+
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.2);
|
|
195
|
+
z-index: 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.lockWrapper:hover {
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.lockWrapper:hover .lockIcon {
|
|
203
|
+
background-color: cm_negative_200;
|
|
204
|
+
color: white;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.lockWrapper:hover span {
|
|
208
|
+
font-weight: 600;
|
|
209
|
+
width: 150px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.lockContent {
|
|
213
|
+
display: flex;
|
|
214
|
+
gap: 8px;
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
z-index: 2;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.lockContent span {
|
|
220
|
+
width: 134px;
|
|
221
|
+
height: 40px;
|
|
222
|
+
color: white;
|
|
223
|
+
text-align: center;
|
|
224
|
+
font-family: 'Gilroy';
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
line-height: 20px;
|
|
190
227
|
}
|
|
191
228
|
|
|
192
229
|
.lockIcon {
|
|
193
|
-
|
|
194
|
-
|
|
230
|
+
width: 48px;
|
|
231
|
+
min-width: 48px;
|
|
232
|
+
min-height: 48px;
|
|
233
|
+
background-color: negative_100;
|
|
234
|
+
align-self: center;
|
|
235
|
+
border-radius: 16px;
|
|
236
|
+
color: cm_negative_200;
|
|
195
237
|
}
|
|
196
238
|
|
|
197
239
|
.imageWrapper {
|
|
@@ -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":";AAsBA,kDA6MC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaLineStatusCheckCircle1 as CheckCircle1 } from '@coorpacademy/nova-icons';
|
|
2
|
+
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket, NovaCompositionCoorpacademyPadlock as LockIcon, NovaLineStatusCheckCircle1 as CheckCircle1 } from '@coorpacademy/nova-icons';
|
|
3
3
|
import map from 'lodash/fp/map';
|
|
4
4
|
import Cta from '../../atom/button-link';
|
|
5
5
|
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
6
6
|
import InputSwitch from '../../atom/input-switch';
|
|
7
|
+
import Title from '../../atom/title';
|
|
8
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
7
9
|
import style from './style.css';
|
|
8
10
|
import propTypes from './types';
|
|
11
|
+
const IconType = {
|
|
12
|
+
lockedContent: /*#__PURE__*/React.createElement(LockIcon, {
|
|
13
|
+
className: style.lockIcon
|
|
14
|
+
})
|
|
15
|
+
};
|
|
9
16
|
|
|
10
17
|
const CMPopin = props => {
|
|
11
18
|
const {
|
|
@@ -21,7 +28,8 @@ const CMPopin = props => {
|
|
|
21
28
|
thirdButton,
|
|
22
29
|
cookieTitle,
|
|
23
30
|
descriptionBtnTxt,
|
|
24
|
-
listBtnSwicth
|
|
31
|
+
listBtnSwicth,
|
|
32
|
+
items
|
|
25
33
|
} = props;
|
|
26
34
|
const logo = {
|
|
27
35
|
AlertDiamond,
|
|
@@ -36,10 +44,28 @@ const CMPopin = props => {
|
|
|
36
44
|
} : null;
|
|
37
45
|
|
|
38
46
|
const renderHeader = () => {
|
|
39
|
-
if (header)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
if (header) {
|
|
48
|
+
const {
|
|
49
|
+
title,
|
|
50
|
+
headerIcon,
|
|
51
|
+
backgroundImage
|
|
52
|
+
} = header;
|
|
53
|
+
const TopTitleIcon = IconType[headerIcon];
|
|
54
|
+
|
|
55
|
+
if (title) {
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: style.headerContent
|
|
58
|
+
}, TopTitleIcon, /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: style.headerTitle
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Title, title)));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
64
|
+
className: style.headerBackground,
|
|
65
|
+
src: backgroundImage
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
43
69
|
if (mode === 'cookie') return /*#__PURE__*/React.createElement("div", {
|
|
44
70
|
className: style.cookieHeader
|
|
45
71
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -101,6 +127,14 @@ const CMPopin = props => {
|
|
|
101
127
|
})(listBtnSwicth);
|
|
102
128
|
};
|
|
103
129
|
|
|
130
|
+
const renderItems = () => {
|
|
131
|
+
const {
|
|
132
|
+
type,
|
|
133
|
+
list
|
|
134
|
+
} = items;
|
|
135
|
+
return type === 'content' ? /*#__PURE__*/React.createElement(CardsGrid, list) : null;
|
|
136
|
+
};
|
|
137
|
+
|
|
104
138
|
return /*#__PURE__*/React.createElement("div", {
|
|
105
139
|
className: mode !== 'cookie' ? style.background : null,
|
|
106
140
|
style: backgroundImageStyle,
|
|
@@ -115,7 +149,7 @@ const CMPopin = props => {
|
|
|
115
149
|
"aria-label": 'close-icon',
|
|
116
150
|
size: "small",
|
|
117
151
|
icon: "close"
|
|
118
|
-
}) : null), /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
}) : null), mode !== 'items' ? /*#__PURE__*/React.createElement("div", {
|
|
119
153
|
className: mode === 'cookie' || mode === 'information' ? style.cookieTitleContainer : style.titleContainer
|
|
120
154
|
}, /*#__PURE__*/React.createElement("div", {
|
|
121
155
|
className: style.contentSection
|
|
@@ -134,9 +168,12 @@ const CMPopin = props => {
|
|
|
134
168
|
dangerouslySetInnerHTML: {
|
|
135
169
|
__html: descriptionText
|
|
136
170
|
}
|
|
137
|
-
}) : null), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
171
|
+
}) : null) : null, descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
138
172
|
className: style.descriptionBtn
|
|
139
|
-
}, descriptionBtnTxt) : null,
|
|
173
|
+
}, descriptionBtnTxt) : null, items ? /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: style.itemsContainer,
|
|
175
|
+
"data-name": 'cm-popin-cards'
|
|
176
|
+
}, renderItems()) : null, renderBtnSwitch(), firstButton || secondButton || thirdButton ? /*#__PURE__*/React.createElement("div", {
|
|
140
177
|
className: style.buttonContainer
|
|
141
178
|
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
142
179
|
className: firstButton.largeButton ? style.largeButton : style.button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaLineStatusCheckCircle1","CheckCircle1","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\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 } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\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 return null;\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 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 return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\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 </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : 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 />\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;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,0BAA0B,IAAIC,YALhC,QAMO,0BANP;AAOA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACX9B,YADW;IAEXE,YAFW;IAGXI,UAHW;IAIXE;EAJW,CAAb;EAMA,MAAMuB,aAAa,GAAGD,IAAI,CAACP,IAAD,CAA1B;EAEA,MAAMS,oBAAoB,GAAGR,kBAAkB,GAC3C;IACES,eAAe,EAAG,OAAMT,kBAAmB,GAD7C;IAEEU,cAAc,EAAE;EAFlB,CAD2C,GAK3C,IALJ;;EAMA,MAAMC,YAAY,GAAG,MAAM;IACzB,IAAIb,MAAJ,EAAY,oBAAO;M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AW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAhFN,CALF,CADF;AA0FD,CApLD;;AAsLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaCompositionCoorpacademyPadlock","LockIcon","NovaLineStatusCheckCircle1","CheckCircle1","map","Cta","ButtonLinkIconOnly","InputSwitch","Title","CardsGrid","style","propTypes","IconType","lockedContent","lockIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","title","headerIcon","TopTitleIcon","headerContent","headerTitle","headerBackground","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","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","itemsContainer","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React 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} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport CardsGrid from '../../organism/cards-grid';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst IconType = {\n lockedContent: <LockIcon className={style.lockIcon} />\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 } = props;\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) {\n const {title, headerIcon, backgroundImage} = header;\n const TopTitleIcon = IconType[headerIcon];\n if (title) {\n return (\n <div className={style.headerContent}>\n {TopTitleIcon}\n <div className={style.headerTitle}>\n <Title {...title} />\n </div>\n </div>\n );\n }\n return <img className={style.headerBackground} src={backgroundImage} />;\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 return null;\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 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 const renderItems = () => {\n const {type, list} = items;\n return type === 'content' ? <CardsGrid {...list} /> : null;\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={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n {mode !== 'items' ? (\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 </div>\n ) : null}\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {items ? (\n <div className={style.itemsContainer} data-name={'cm-popin-cards'}>\n {renderItems()}\n </div>\n ) : 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 />\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;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,kCAAkC,IAAIC,QALxC,EAMEC,0BAA0B,IAAIC,YANhC,QAOO,0BAPP;AAQA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,SAAP,MAAsB,2BAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;AAEA,MAAMC,QAAQ,GAAG;EACfC,aAAa,eAAE,oBAAC,QAAD;IAAU,SAAS,EAAEH,KAAK,CAACI;EAA3B;AADA,CAAjB;;AAIA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,k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CADD,GAuCG,IAvFN,CALF,CADF;AAiGD,CA7MD;;AA+MAtE,OAAO,CAACJ,SAAR,2CAAoBA,SAApB;AAEA,eAAeI,OAAf"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
@value mobile from breakpoints;
|
|
23
23
|
@value tablet from breakpoints;
|
|
24
24
|
@value cm_grey_75 from colors;
|
|
25
|
+
@value negative_100 from colors;
|
|
25
26
|
|
|
26
27
|
.background {
|
|
27
28
|
top: 0px;
|
|
@@ -137,6 +138,30 @@
|
|
|
137
138
|
.popinHeader button {
|
|
138
139
|
position: absolute;
|
|
139
140
|
}
|
|
141
|
+
|
|
142
|
+
.headerContent {
|
|
143
|
+
display: flex;
|
|
144
|
+
width: 100%;
|
|
145
|
+
gap: 16px;
|
|
146
|
+
padding: 8px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.headerTitle {
|
|
150
|
+
width: 612px;
|
|
151
|
+
margin-bottom: 16px;
|
|
152
|
+
padding: 2px 0px 2px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.lockIcon {
|
|
156
|
+
height: 48px;
|
|
157
|
+
width: 48px;
|
|
158
|
+
background-color: negative_100;
|
|
159
|
+
border-radius: 16px;
|
|
160
|
+
min-width: 48px;
|
|
161
|
+
min-height: 48px;
|
|
162
|
+
color: cm_negative_200;
|
|
163
|
+
}
|
|
164
|
+
|
|
140
165
|
.descriptionText {
|
|
141
166
|
text-align: center;
|
|
142
167
|
font-family: Gilroy;
|
|
@@ -280,6 +305,13 @@ a {
|
|
|
280
305
|
padding: 0px 8px 0px 0px
|
|
281
306
|
}
|
|
282
307
|
|
|
308
|
+
.itemsContainer {
|
|
309
|
+
max-height: 369px;
|
|
310
|
+
overflow-y: auto;
|
|
311
|
+
width: 100%;
|
|
312
|
+
border-top: 1px solid cm_grey_100;
|
|
313
|
+
}
|
|
314
|
+
|
|
283
315
|
@media tablet {
|
|
284
316
|
.popin {
|
|
285
317
|
width: 80%;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
+
import { TitleProps } from '../../atom/title/types';
|
|
3
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
2
4
|
declare const propTypes: {
|
|
3
5
|
content: PropTypes.Requireable<string>;
|
|
4
6
|
mode: PropTypes.Requireable<string>;
|
|
5
|
-
header: PropTypes.Requireable<
|
|
7
|
+
header: PropTypes.Requireable<PropTypes.InferProps<{
|
|
8
|
+
title: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
|
+
title: PropTypes.Requireable<string>;
|
|
10
|
+
subtitle: PropTypes.Requireable<string>;
|
|
11
|
+
type: PropTypes.Requireable<string>;
|
|
12
|
+
'data-name': PropTypes.Requireable<string>;
|
|
13
|
+
titleSize: PropTypes.Requireable<string>;
|
|
14
|
+
subtitleSize: PropTypes.Requireable<string>;
|
|
15
|
+
}>>;
|
|
16
|
+
headerIcon: PropTypes.Requireable<string>;
|
|
17
|
+
backgroundImage: PropTypes.Requireable<string>;
|
|
18
|
+
}>>;
|
|
6
19
|
firstButton: PropTypes.Requireable<PropTypes.InferProps<{
|
|
7
20
|
label: PropTypes.Requireable<string>;
|
|
8
21
|
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -50,6 +63,18 @@ declare const propTypes: {
|
|
|
50
63
|
'data-name': PropTypes.Requireable<string>;
|
|
51
64
|
requiredSelection: PropTypes.Requireable<boolean>;
|
|
52
65
|
}> | null | undefined)[]>;
|
|
66
|
+
items: PropTypes.Requireable<PropTypes.InferProps<{
|
|
67
|
+
type: PropTypes.Requireable<string>;
|
|
68
|
+
list: PropTypes.Requireable<PropTypes.InferProps<{
|
|
69
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<any> | null | undefined)[]>;
|
|
70
|
+
loading: PropTypes.Requireable<boolean>;
|
|
71
|
+
}>>;
|
|
72
|
+
}>>;
|
|
73
|
+
};
|
|
74
|
+
declare type PopinHeaderProps = {
|
|
75
|
+
title: TitleProps;
|
|
76
|
+
backgroundImage: string;
|
|
77
|
+
headerIcon: string;
|
|
53
78
|
};
|
|
54
79
|
export declare type QuitPopinButton = {
|
|
55
80
|
'aria-label'?: string;
|
|
@@ -65,9 +90,14 @@ export declare type CMPopinProps = {
|
|
|
65
90
|
content: string;
|
|
66
91
|
icon: string;
|
|
67
92
|
mode: string;
|
|
93
|
+
popinHeader?: PopinHeaderProps;
|
|
68
94
|
descriptionText: string;
|
|
69
95
|
firstButton?: QuitPopinButton;
|
|
70
96
|
secondButton?: QuitPopinButton;
|
|
97
|
+
items?: {
|
|
98
|
+
type: string;
|
|
99
|
+
list: PropTypes.InferProps<typeof CardsGrid.propTypes>;
|
|
100
|
+
};
|
|
71
101
|
};
|
|
72
102
|
export default propTypes;
|
|
73
103
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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;AAInC,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAInC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2Cd,CAAC;AAEF,aAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACxD,CAAC;CACH,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import Cta from '../../atom/button-link';
|
|
3
3
|
import InputSwitch from '../../atom/input-switch';
|
|
4
|
+
import Title from '../../atom/title';
|
|
5
|
+
import CardsGrid from '../../organism/cards-grid';
|
|
4
6
|
const propTypes = {
|
|
5
7
|
content: PropTypes.string,
|
|
6
|
-
mode: PropTypes.oneOf(['alert', 'information', 'cookie']),
|
|
7
|
-
header: PropTypes.
|
|
8
|
+
mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items']),
|
|
9
|
+
header: PropTypes.shape({
|
|
10
|
+
title: PropTypes.shape(Title.propTypes),
|
|
11
|
+
headerIcon: PropTypes.string,
|
|
12
|
+
backgroundImage: PropTypes.string
|
|
13
|
+
}),
|
|
8
14
|
firstButton: PropTypes.shape({
|
|
9
15
|
label: PropTypes.string,
|
|
10
16
|
handleOnclick: PropTypes.func,
|
|
@@ -35,7 +41,11 @@ const propTypes = {
|
|
|
35
41
|
descriptionText: PropTypes.string,
|
|
36
42
|
cookieTitle: PropTypes.string,
|
|
37
43
|
descriptionBtnTxt: PropTypes.string,
|
|
38
|
-
listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes))
|
|
44
|
+
listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes)),
|
|
45
|
+
items: PropTypes.shape({
|
|
46
|
+
type: PropTypes.string,
|
|
47
|
+
list: PropTypes.shape(CardsGrid.propTypes)
|
|
48
|
+
})
|
|
39
49
|
};
|
|
40
50
|
export default propTypes;
|
|
41
51
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","Cta","InputSwitch","propTypes","content","string","mode","oneOf","header","
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","Cta","InputSwitch","Title","CardsGrid","propTypes","content","string","mode","oneOf","header","shape","title","headerIcon","backgroundImage","firstButton","label","handleOnclick","func","largeButton","bool","type","customStyle","secondButton","thirdButton","onClose","icon","backgroundImageUrl","descriptionText","cookieTitle","descriptionBtnTxt","listBtnSwicth","arrayOf","items","list"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Cta from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport {TitleProps} from '../../atom/title/types';\nimport CardsGrid from '../../organism/cards-grid';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items']),\n header: PropTypes.shape({\n title: PropTypes.shape(Title.propTypes),\n headerIcon: PropTypes.string,\n backgroundImage: PropTypes.string\n }),\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary', 'tertiary']),\n customStyle: Cta.propTypes.customStyle\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n thirdButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary', 'secondary']),\n 'aria-label': PropTypes.string,\n largeButton: PropTypes.bool,\n customStyle: Cta.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string,\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes)),\n items: PropTypes.shape({\n type: PropTypes.string,\n list: PropTypes.shape(CardsGrid.propTypes)\n })\n};\n\ntype PopinHeaderProps = {\n title: TitleProps;\n backgroundImage: string;\n headerIcon: string;\n};\n\nexport type QuitPopinButton = {\n 'aria-label'?: string;\n label: string;\n type: string;\n customStyle?: {\n backgroundColor?: string;\n color?: string;\n };\n handleOnclick: () => void;\n};\n\nexport type CMPopinProps = {\n content: string;\n icon: string;\n mode: string;\n popinHeader?: PopinHeaderProps;\n descriptionText: string;\n firstButton?: QuitPopinButton;\n secondButton?: QuitPopinButton;\n items?: {\n type: string;\n list: PropTypes.InferProps<typeof CardsGrid.propTypes>;\n };\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AAEA,OAAOC,SAAP,MAAsB,2BAAtB;AAEA,MAAMC,SAAS,GAAG;EAChBC,OAAO,EAAEN,SAAS,CAACO,MADH;EAEhBC,IAAI,EAAER,SAAS,CAACS,KAAV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,EAAc,SAAd,EAAyB,WAAzB,CAAhB,CAHqB;IAI3B,cAAcT,SAAS,CAACO,MAJG;IAK3BY,WAAW,EAAEnB,SAAS,CAACoB,IALI;IAM3BE,WAAW,EAAErB,GAAG,CAACI,SAAJ,CAAciB;EANA,CAAhB,CAxBG;EAgChBG,OAAO,EAAEzB,SAAS,CAACkB,IAhCH;EAiChBQ,IAAI,EAAE1B,SAAS,CAACO,MAjCA;EAkChBoB,kBAAkB,EAAE3B,SAAS,CAACO,MAlCd;EAmChBqB,eAAe,EAAE5B,SAAS,CAACO,MAnCX;EAoChBsB,WAAW,EAAE7B,SAAS,CAACO,MApCP;EAqChBuB,iBAAiB,EAAE9B,SAAS,CAACO,MArCb;EAsChBwB,aAAa,EAAE/B,SAAS,CAACgC,OAAV,CAAkBhC,SAAS,CAACW,KAAV,CAAgBT,WAAW,CAACG,SAA5B,CAAlB,CAtCC;EAuChB4B,KAAK,EAAEjC,SAAS,CAACW,KAAV,CAAgB;IACrBU,IAAI,EAAErB,SAAS,CAACO,MADK;IAErB2B,IAAI,EAAElC,SAAS,CAACW,KAAV,CAAgBP,SAAS,CAACC,SAA1B;EAFe,CAAhB;AAvCS,CAAlB;AA4EA,eAAeA,SAAf"}
|
|
@@ -40,6 +40,7 @@ declare class CardsList extends React.PureComponent<any, any, any> {
|
|
|
40
40
|
badgeCategory: PropTypes.Requireable<string>;
|
|
41
41
|
badgeLabel: PropTypes.Requireable<string>;
|
|
42
42
|
theme: PropTypes.Requireable<string>;
|
|
43
|
+
disabledContent: PropTypes.Requireable<string>;
|
|
43
44
|
'aria-label': PropTypes.Requireable<string>;
|
|
44
45
|
'background-aria-label': PropTypes.Requireable<string>;
|
|
45
46
|
'favorite-aria-label': PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/molecule/dashboard/cards-list/index.js"],"names":[],"mappings":";AAuFA;IACE;;;OAGG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAkCC;IA/BC;;;;;;;;MAQC;IAED,0DAAgE;IAsHlE,qBAiBC;IAED,qBAGC;IAED,sBAGC;IAED,0BASC;IAvJC,uEAA6D;IAyJ/D,mCAIC;IA5DD,oCAMC;IAGD,sCAIC;IA5DD,qBAGC;IAnCD,0BAMC;IAED,2BAYC;IAED,6BAOC;IASD,wCAuCC;IAGC,kBAA2B;IA6D7B,sBAkGC;CACF"}
|