@coorpacademy/components 11.42.0 → 11.42.3
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/checkbox-with-title/index.d.ts +1 -0
- package/es/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/es/atom/checkbox-with-title/index.js +6 -3
- package/es/atom/checkbox-with-title/index.js.map +1 -1
- package/es/atom/radio-group/index.d.ts +13 -7
- package/es/atom/radio-group/index.d.ts.map +1 -1
- package/es/atom/radio-group/index.js +51 -0
- package/es/atom/radio-group/index.js.map +1 -1
- package/es/atom/radio-group/style.css +37 -0
- package/es/atom/radio-with-title/index.d.ts +3 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/index.js +23 -5
- package/es/atom/radio-with-title/index.js.map +1 -1
- package/es/atom/radio-with-title/style.css +27 -0
- package/es/atom/radio-with-title/types.d.ts +6 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.js +3 -0
- package/es/atom/radio-with-title/types.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +20 -3
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +17 -0
- package/es/molecule/cm-popin/types.d.ts +36 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +3 -0
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +12 -0
- package/es/molecule/progress-bar/index.d.ts +16 -7
- package/es/molecule/progress-bar/index.d.ts.map +1 -1
- package/es/molecule/progress-bar/index.js +61 -4
- package/es/molecule/progress-bar/index.js.map +1 -1
- package/es/molecule/progress-bar/style.css +56 -0
- package/es/molecule/setup-section/index.d.ts +6 -0
- package/es/molecule/setup-sections/index.d.ts +6 -0
- package/es/molecule/table/index.d.ts +8 -0
- package/es/molecule/table/index.d.ts.map +1 -1
- package/es/molecule/table/index.js +43 -5
- package/es/molecule/table/index.js.map +1 -1
- package/es/molecule/table/style.css +24 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +3 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +3 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/wizard-summary/index.d.ts +3 -0
- package/es/molecule/wizard-summary/index.d.ts.map +1 -1
- package/es/molecule/wizard-summary/index.js +35 -3
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +54 -1
- package/es/organism/assignment-audience/index.d.ts +23 -11
- package/es/organism/assignment-audience/index.d.ts.map +1 -1
- package/es/organism/assignment-audience/index.js +100 -59
- package/es/organism/assignment-audience/index.js.map +1 -1
- package/es/organism/assignment-audience/types.d.ts +39 -15
- package/es/organism/assignment-audience/types.d.ts.map +1 -1
- package/es/organism/assignment-audience/types.js +17 -5
- package/es/organism/assignment-audience/types.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +12 -0
- package/es/organism/brand-table/index.d.ts +8 -0
- package/es/organism/content-selection-list/index.d.ts +95 -0
- package/es/organism/content-selection-list/index.d.ts.map +1 -0
- package/es/organism/content-selection-list/index.js +175 -0
- package/es/organism/content-selection-list/index.js.map +1 -0
- package/es/organism/content-selection-list/style.css +8 -0
- package/es/organism/content-selection-list/types.d.ts +113 -0
- package/es/organism/content-selection-list/types.d.ts.map +1 -0
- package/es/organism/content-selection-list/types.js +58 -0
- package/es/organism/content-selection-list/types.js.map +1 -0
- package/es/organism/content-skill-modal/index.d.ts +7 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +7 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +13 -4
- package/es/organism/header-with-actions/index.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.js +31 -6
- package/es/organism/header-with-actions/index.js.map +1 -1
- package/es/organism/header-with-actions/style.css +42 -0
- package/es/organism/header-with-actions/types.d.ts +24 -6
- package/es/organism/header-with-actions/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/types.js +7 -2
- package/es/organism/header-with-actions/types.js.map +1 -1
- package/es/organism/list-item/index.d.ts +9 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +16 -3
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +15 -0
- package/es/organism/list-items/index.d.ts +7 -0
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/skill-edition/index.d.ts +8 -3
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +3 -168
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/styles.d.ts +10 -0
- package/es/organism/skill-edition/styles.d.ts.map +1 -0
- package/es/organism/skill-edition/styles.js +10 -0
- package/es/organism/skill-edition/styles.js.map +1 -0
- package/es/organism/skill-edition/types.d.ts +10 -54
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +3 -52
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +1 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +1 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -0
- package/es/template/app-player/loading/index.d.ts +33 -0
- package/es/template/app-player/player/index.d.ts +66 -0
- package/es/template/app-player/player/slides/index.d.ts +33 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +33 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +33 -0
- package/es/template/app-review/index.d.ts +33 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +33 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +33 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +120 -7
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +19 -4
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +18 -0
- package/es/template/certification-detail/index.d.ts +33 -0
- package/es/template/common/dashboard/index.d.ts +66 -0
- package/es/template/common/search-page/index.d.ts +33 -0
- package/es/template/external-course/index.d.ts +33 -0
- package/es/template/playlist-detail/index.d.ts +33 -0
- package/lib/atom/checkbox-with-title/index.d.ts +1 -0
- package/lib/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/lib/atom/checkbox-with-title/index.js +6 -3
- package/lib/atom/checkbox-with-title/index.js.map +1 -1
- package/lib/atom/radio-group/index.d.ts +13 -7
- package/lib/atom/radio-group/index.d.ts.map +1 -1
- package/lib/atom/radio-group/index.js +51 -0
- package/lib/atom/radio-group/index.js.map +1 -1
- package/lib/atom/radio-group/style.css +37 -0
- package/lib/atom/radio-with-title/index.d.ts +3 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/index.js +23 -5
- package/lib/atom/radio-with-title/index.js.map +1 -1
- package/lib/atom/radio-with-title/style.css +27 -0
- package/lib/atom/radio-with-title/types.d.ts +6 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.js +3 -0
- package/lib/atom/radio-with-title/types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +20 -3
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +17 -0
- package/lib/molecule/cm-popin/types.d.ts +36 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +3 -0
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +12 -0
- package/lib/molecule/progress-bar/index.d.ts +16 -7
- package/lib/molecule/progress-bar/index.d.ts.map +1 -1
- package/lib/molecule/progress-bar/index.js +61 -4
- package/lib/molecule/progress-bar/index.js.map +1 -1
- package/lib/molecule/progress-bar/style.css +56 -0
- package/lib/molecule/setup-section/index.d.ts +6 -0
- package/lib/molecule/setup-sections/index.d.ts +6 -0
- package/lib/molecule/table/index.d.ts +8 -0
- package/lib/molecule/table/index.d.ts.map +1 -1
- package/lib/molecule/table/index.js +43 -5
- package/lib/molecule/table/index.js.map +1 -1
- package/lib/molecule/table/style.css +24 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +3 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +3 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/wizard-summary/index.d.ts +3 -0
- package/lib/molecule/wizard-summary/index.d.ts.map +1 -1
- package/lib/molecule/wizard-summary/index.js +35 -3
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +54 -1
- package/lib/organism/assignment-audience/index.d.ts +23 -11
- package/lib/organism/assignment-audience/index.d.ts.map +1 -1
- package/lib/organism/assignment-audience/index.js +100 -59
- package/lib/organism/assignment-audience/index.js.map +1 -1
- package/lib/organism/assignment-audience/types.d.ts +39 -15
- package/lib/organism/assignment-audience/types.d.ts.map +1 -1
- package/lib/organism/assignment-audience/types.js +17 -5
- package/lib/organism/assignment-audience/types.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +12 -0
- package/lib/organism/brand-table/index.d.ts +8 -0
- package/lib/organism/content-selection-list/index.d.ts +95 -0
- package/lib/organism/content-selection-list/index.d.ts.map +1 -0
- package/lib/organism/content-selection-list/index.js +181 -0
- package/lib/organism/content-selection-list/index.js.map +1 -0
- package/lib/organism/content-selection-list/style.css +8 -0
- package/lib/organism/content-selection-list/types.d.ts +113 -0
- package/lib/organism/content-selection-list/types.d.ts.map +1 -0
- package/lib/organism/content-selection-list/types.js +63 -0
- package/lib/organism/content-selection-list/types.js.map +1 -0
- package/lib/organism/content-skill-modal/index.d.ts +7 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +7 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +13 -4
- package/lib/organism/header-with-actions/index.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.js +31 -6
- package/lib/organism/header-with-actions/index.js.map +1 -1
- package/lib/organism/header-with-actions/style.css +42 -0
- package/lib/organism/header-with-actions/types.d.ts +24 -6
- package/lib/organism/header-with-actions/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/types.js +7 -2
- package/lib/organism/header-with-actions/types.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +9 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +16 -3
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +15 -0
- package/lib/organism/list-items/index.d.ts +7 -0
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.d.ts +8 -3
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +11 -174
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/styles.d.ts +10 -0
- package/lib/organism/skill-edition/styles.d.ts.map +1 -0
- package/lib/organism/skill-edition/styles.js +15 -0
- package/lib/organism/skill-edition/styles.js.map +1 -0
- package/lib/organism/skill-edition/types.d.ts +10 -54
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +6 -53
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +1 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +1 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -0
- package/lib/template/app-player/loading/index.d.ts +33 -0
- package/lib/template/app-player/player/index.d.ts +66 -0
- package/lib/template/app-player/player/slides/index.d.ts +33 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +33 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +33 -0
- package/lib/template/app-review/index.d.ts +33 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +33 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +33 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +120 -7
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +19 -4
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +18 -0
- package/lib/template/certification-detail/index.d.ts +33 -0
- package/lib/template/common/dashboard/index.d.ts +66 -0
- package/lib/template/common/search-page/index.d.ts +33 -0
- package/lib/template/external-course/index.d.ts +33 -0
- package/lib/template/playlist-detail/index.d.ts +33 -0
- package/locales/bs/global.json +2 -2
- package/locales/cs/global.json +2 -2
- package/locales/de/global.json +2 -2
- package/locales/es/global.json +2 -2
- package/locales/et/global.json +2 -2
- package/locales/fi/global.json +2 -2
- package/locales/fr/global.json +2 -2
- package/locales/hr/global.json +2 -2
- package/locales/hu/global.json +2 -2
- package/locales/hy/global.json +2 -2
- package/locales/it/global.json +2 -2
- package/locales/ja/global.json +2 -2
- package/locales/ko/global.json +2 -2
- package/locales/lt/global.json +2 -2
- package/locales/nl/global.json +2 -2
- package/locales/pl/global.json +2 -2
- package/locales/pt/global.json +2 -2
- package/locales/ro/global.json +2 -2
- package/locales/ru/global.json +2 -2
- package/locales/sk/global.json +2 -2
- package/locales/sl/global.json +2 -2
- package/locales/sv/global.json +2 -2
- package/locales/tl/global.json +2 -2
- package/locales/tr/global.json +2 -2
- package/locales/uk/global.json +2 -2
- package/locales/vi/global.json +2 -2
- package/locales/zh/global.json +2 -2
- package/locales/zh_TW/global.json +2 -2
- package/package.json +2 -2
|
@@ -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","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","handleOnclick","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 ? (\n <div\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : 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 {...firstButton}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n {...secondButton}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n {...thirdButton}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\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,2BAA2B;AACjD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,MAAM,SAAS;;AAE/B;AACA,MAAMC,IAAI,GAAG;EACX7B,YAAY;EACZE,YAAY;EACZI,UAAU;EACVI,YAAY;EACZI;AACF,CAAC;AAED,MAAMgB,QAAQ,GAAG;EACfC,aAAa,eAAEpC,KAAA,CAAAqC,aAAA,CAACxB,QAAQ;IAACyB,SAAS,EAAEN,KAAK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
|
+
{"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","WizardSummary","Notification","style","propTypes","LOGO","IconType","lockedContent","createElement","className","lockIcon","fileZipped","filesListIconContainer","filesListIcon","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","sections","warning","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","items","link","backgroundImageStyle","backgroundImage","backgroundSize","handleCloseButton","nodeRef","closePopin","e","current","contains","target","handleKeyDown","key","document","addEventListener","removeEventListener","hasImpact","Boolean","wrapperPopinStyle","popin","popinImpact","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","handleOnclick","renderImpact","inline","role","background","impactBackground","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 WizardSummary from '../wizard-summary';\nimport Notification from '../../atom/notification';\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 sections,\n warning,\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 hasImpact =\n (mode === 'alert' || mode === 'information') && (!isEmpty(sections) || Boolean(warning));\n const wrapperPopinStyle = classNames(\n style.popin,\n hasImpact && style.popinImpact,\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 ? (\n <div\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : 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 {...firstButton}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n {...secondButton}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <ButtonLink\n {...thirdButton}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n />\n </div>\n ) : null}\n </div>\n );\n };\n\n const renderImpact = () => {\n if (mode !== 'alert' && mode !== 'information') return null;\n return (\n <>\n {!isEmpty(sections) ? <WizardSummary sections={sections} inline /> : null}\n {warning ? (\n <div role=\"alert\">\n <Notification type=\"warning\" message={warning} />\n </div>\n ) : null}\n </>\n );\n };\n\n return (\n <div\n className={\n mode !== 'cookie' ? classNames(style.background, hasImpact && style.impactBackground) : null\n }\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={wrapperPopinStyle} ref={nodeRef}>\n {renderHeader()}\n {renderContent()}\n {renderImpact()}\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,M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,iBAAkB;IAACsE,GAAG,EAAEnF;EAAQ,GAC7CiC,YAAY,CAAC,CAAC,EACd+B,aAAa,CAAC,CAAC,EACfc,YAAY,CAAC,CAAC,EACdtF,iBAAiB,gBAAG5D,KAAA,CAAAuC,aAAA;IAAKC,SAAS,EAAEN,KAAK,CAACsH;EAAe,GAAE5F,iBAAuB,CAAC,GAAG,IAAI,EAC1FoE,WAAW,CAAC,CAAC,EACbd,eAAe,CAAC,CAAC,EACjB2B,aAAa,CAAC,CACZ,CACF,CAAC;AAEV,CAAC;AAEDhG,OAAO,CAACV,SAAS,GAAAsH,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGxH,SAAS;AAC7BU,OAAO,CAAC+G,YAAY,GAAG;EACrBC,SAAS,EAAEtI,QAAQ,CAACuI,iBAAiB,CAACD;AACxC,CAAC;AAED,eAAehH,OAAO","ignoreList":[]}
|
|
@@ -68,6 +68,23 @@
|
|
|
68
68
|
gap: 0;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
.impactBackground {
|
|
72
|
+
padding: 16px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.popin.popinImpact {
|
|
76
|
+
width: 400px;
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
max-height: calc(100vh - 32px);
|
|
79
|
+
overflow-y: auto;
|
|
80
|
+
margin: 0;
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.popinImpact > * {
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
71
88
|
|
|
72
89
|
.message {
|
|
73
90
|
display: flex;
|
|
@@ -4,6 +4,7 @@ import Link from '../../atom/link';
|
|
|
4
4
|
import { TitleProps } from '../../atom/title/types';
|
|
5
5
|
import CardsGrid from '../../organism/cards-grid';
|
|
6
6
|
import ListItems from '../../organism/list-items';
|
|
7
|
+
import WizardSummary from '../wizard-summary';
|
|
7
8
|
import { propTypes as iconPropTypes } from '../../atom/icon';
|
|
8
9
|
declare const propTypes: {
|
|
9
10
|
content: PropTypes.Requireable<string>;
|
|
@@ -136,6 +137,32 @@ declare const propTypes: {
|
|
|
136
137
|
}> | null | undefined>>;
|
|
137
138
|
backgroundImageUrl: PropTypes.Requireable<string>;
|
|
138
139
|
descriptionText: PropTypes.Requireable<string>;
|
|
140
|
+
sections: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
141
|
+
title: PropTypes.Requireable<string>;
|
|
142
|
+
items: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
143
|
+
type: PropTypes.Requireable<string>;
|
|
144
|
+
title: PropTypes.Requireable<string>;
|
|
145
|
+
value: PropTypes.Requireable<string>;
|
|
146
|
+
}> | PropTypes.InferProps<{
|
|
147
|
+
type: PropTypes.Requireable<string>;
|
|
148
|
+
text: PropTypes.Requireable<string>;
|
|
149
|
+
unsaved: PropTypes.Requireable<boolean>;
|
|
150
|
+
diff: PropTypes.Requireable<string>;
|
|
151
|
+
diffLabel: PropTypes.Requireable<string>;
|
|
152
|
+
}> | PropTypes.InferProps<{
|
|
153
|
+
type: PropTypes.Requireable<string>;
|
|
154
|
+
badgeList: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
155
|
+
category: PropTypes.Requireable<string>;
|
|
156
|
+
label: PropTypes.Requireable<string>;
|
|
157
|
+
}> | null | undefined)[]>;
|
|
158
|
+
badgeAriaLabel: PropTypes.Requireable<string>;
|
|
159
|
+
title: PropTypes.Requireable<string>;
|
|
160
|
+
author: PropTypes.Requireable<string>;
|
|
161
|
+
unsaved: PropTypes.Requireable<boolean>;
|
|
162
|
+
}> | null | undefined> | null | undefined)[]>;
|
|
163
|
+
counterText: PropTypes.Requireable<string>;
|
|
164
|
+
}> | null | undefined)[]>;
|
|
165
|
+
warning: PropTypes.Requireable<string>;
|
|
139
166
|
cookieTitle: PropTypes.Requireable<string>;
|
|
140
167
|
headerSubtitle: PropTypes.Requireable<string>;
|
|
141
168
|
descriptionBtnTxt: PropTypes.Requireable<string>;
|
|
@@ -312,6 +339,11 @@ declare const propTypes: {
|
|
|
312
339
|
size: PropTypes.Requireable<number>;
|
|
313
340
|
wrapperSize: PropTypes.Requireable<number>;
|
|
314
341
|
}>>;
|
|
342
|
+
imageOverlay: PropTypes.Requireable<string>;
|
|
343
|
+
contentBadge: PropTypes.Requireable<PropTypes.InferProps<{
|
|
344
|
+
category: PropTypes.Requireable<string>;
|
|
345
|
+
label: PropTypes.Requireable<string>;
|
|
346
|
+
}>>;
|
|
315
347
|
image: PropTypes.Requireable<string>;
|
|
316
348
|
checkbox: PropTypes.Requireable<PropTypes.InferProps<{
|
|
317
349
|
value: PropTypes.Requireable<string>;
|
|
@@ -329,6 +361,7 @@ declare const propTypes: {
|
|
|
329
361
|
customStyle: PropTypes.Requireable<{
|
|
330
362
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
331
363
|
}>;
|
|
364
|
+
className: PropTypes.Requireable<string>;
|
|
332
365
|
}>>;
|
|
333
366
|
}> | null | undefined)[]>;
|
|
334
367
|
type: PropTypes.Requireable<string>;
|
|
@@ -723,6 +756,7 @@ declare const propTypes: {
|
|
|
723
756
|
customStyle: PropTypes.Requireable<{
|
|
724
757
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
725
758
|
}>;
|
|
759
|
+
className: PropTypes.Requireable<string>;
|
|
726
760
|
}>>;
|
|
727
761
|
actionButtons: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
728
762
|
type: PropTypes.Requireable<string>;
|
|
@@ -905,6 +939,8 @@ export declare type CMPopinProps = {
|
|
|
905
939
|
onClose?: () => void;
|
|
906
940
|
popinHeader?: PopinHeaderProps;
|
|
907
941
|
descriptionText: string;
|
|
942
|
+
sections?: PropTypes.InferProps<typeof WizardSummary.propTypes>['sections'];
|
|
943
|
+
warning?: string;
|
|
908
944
|
firstButton?: QuitPopinButton;
|
|
909
945
|
secondButton?: QuitPopinButton;
|
|
910
946
|
items?: {
|
|
@@ -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,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;AAClD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE3D,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -6,6 +6,7 @@ import Title from '../../atom/title';
|
|
|
6
6
|
import Link from '../../atom/link';
|
|
7
7
|
import CardsGrid from '../../organism/cards-grid';
|
|
8
8
|
import ListItems from '../../organism/list-items';
|
|
9
|
+
import WizardSummary from '../wizard-summary';
|
|
9
10
|
import { ICONS } from '../../util/button-icons';
|
|
10
11
|
import { propTypes as iconPropTypes } from '../../atom/icon';
|
|
11
12
|
const propTypes = {
|
|
@@ -48,6 +49,8 @@ const propTypes = {
|
|
|
48
49
|
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.shape(iconPropTypes)]),
|
|
49
50
|
backgroundImageUrl: PropTypes.string,
|
|
50
51
|
descriptionText: PropTypes.string,
|
|
52
|
+
sections: WizardSummary.propTypes.sections,
|
|
53
|
+
warning: PropTypes.string,
|
|
51
54
|
cookieTitle: PropTypes.string,
|
|
52
55
|
headerSubtitle: PropTypes.string,
|
|
53
56
|
descriptionBtnTxt: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ButtonLink","InputSwitch","Title","Link","CardsGrid","ListItems","ICONS","propTypes","iconPropTypes","content","string","mode","oneOf","header","shape","title","headerIcon","backgroundImage","firstButton","label","handleOnclick","func","largeButton","bool","type","customStyle","secondButton","icon","position","_keys","thirdButton","onClose","oneOfType","backgroundImageUrl","descriptionText","cookieTitle","headerSubtitle","descriptionBtnTxt","listBtnSwicth","arrayOf","items","list","link"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport ButtonLink from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport Link from '../../atom/link';\nimport {TitleProps} from '../../atom/title/types';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport {ICONS} from '../../util/button-icons';\nimport {propTypes as iconPropTypes} from '../../atom/icon';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items', 'list']),\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: ButtonLink.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: ButtonLink.propTypes.customStyle,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n })\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: ButtonLink.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.shape(iconPropTypes)]),\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n cookieTitle: PropTypes.string,\n headerSubtitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes)),\n items: PropTypes.shape({\n type: PropTypes.oneOf(['content', 'list']),\n list: PropTypes.oneOfType([\n PropTypes.shape(CardsGrid.propTypes),\n PropTypes.shape(ListItems.propTypes)\n ])\n }),\n link: PropTypes.shape(Link.propTypes)\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 | PropTypes.InferProps<typeof iconPropTypes>;\n mode: 'alert' | 'information' | 'cookie' | 'items' | 'list';\n onClose?: () => void;\n popinHeader?: PopinHeaderProps;\n descriptionText: string;\n firstButton?: QuitPopinButton;\n secondButton?: QuitPopinButton;\n items?: {\n type: 'content' | 'list';\n list:\n | PropTypes.InferProps<typeof CardsGrid.propTypes>\n | PropTypes.InferProps<typeof ListItems.propTypes>;\n };\n link?: PropTypes.InferProps<typeof Link.propTypes>;\n};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,IAAI,MAAM,iBAAiB;AAElC,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,SAAQC,SAAS,IAAIC,aAAa,QAAO,iBAAiB;AAE1D,MAAMD,SAAS,GAAG;EAChBE,OAAO,
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ButtonLink","InputSwitch","Title","Link","CardsGrid","ListItems","WizardSummary","ICONS","propTypes","iconPropTypes","content","string","mode","oneOf","header","shape","title","headerIcon","backgroundImage","firstButton","label","handleOnclick","func","largeButton","bool","type","customStyle","secondButton","icon","position","_keys","thirdButton","onClose","oneOfType","backgroundImageUrl","descriptionText","sections","warning","cookieTitle","headerSubtitle","descriptionBtnTxt","listBtnSwicth","arrayOf","items","list","link"],"sources":["../../../src/molecule/cm-popin/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport ButtonLink from '../../atom/button-link';\nimport InputSwitch from '../../atom/input-switch';\nimport Title from '../../atom/title';\nimport Link from '../../atom/link';\nimport {TitleProps} from '../../atom/title/types';\nimport CardsGrid from '../../organism/cards-grid';\nimport ListItems from '../../organism/list-items';\nimport WizardSummary from '../wizard-summary';\nimport {ICONS} from '../../util/button-icons';\nimport {propTypes as iconPropTypes} from '../../atom/icon';\n\nconst propTypes = {\n content: PropTypes.string,\n mode: PropTypes.oneOf(['alert', 'information', 'cookie', 'items', 'list']),\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: ButtonLink.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: ButtonLink.propTypes.customStyle,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n })\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: ButtonLink.propTypes.customStyle\n }),\n onClose: PropTypes.func,\n icon: PropTypes.oneOfType([PropTypes.string, PropTypes.shape(iconPropTypes)]),\n backgroundImageUrl: PropTypes.string,\n descriptionText: PropTypes.string,\n sections: WizardSummary.propTypes.sections,\n warning: PropTypes.string,\n cookieTitle: PropTypes.string,\n headerSubtitle: PropTypes.string,\n descriptionBtnTxt: PropTypes.string,\n listBtnSwicth: PropTypes.arrayOf(PropTypes.shape(InputSwitch.propTypes)),\n items: PropTypes.shape({\n type: PropTypes.oneOf(['content', 'list']),\n list: PropTypes.oneOfType([\n PropTypes.shape(CardsGrid.propTypes),\n PropTypes.shape(ListItems.propTypes)\n ])\n }),\n link: PropTypes.shape(Link.propTypes)\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 | PropTypes.InferProps<typeof iconPropTypes>;\n mode: 'alert' | 'information' | 'cookie' | 'items' | 'list';\n onClose?: () => void;\n popinHeader?: PopinHeaderProps;\n descriptionText: string;\n sections?: PropTypes.InferProps<typeof WizardSummary.propTypes>['sections'];\n warning?: string;\n firstButton?: QuitPopinButton;\n secondButton?: QuitPopinButton;\n items?: {\n type: 'content' | 'list';\n list:\n | PropTypes.InferProps<typeof CardsGrid.propTypes>\n | PropTypes.InferProps<typeof ListItems.propTypes>;\n };\n link?: PropTypes.InferProps<typeof Link.propTypes>;\n};\n\nexport default propTypes;\n"],"mappings":";AAAA,OAAOA,SAAS,MAAM,YAAY;AAElC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,IAAI,MAAM,iBAAiB;AAElC,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAAQC,KAAK,QAAO,yBAAyB;AAC7C,SAAQC,SAAS,IAAIC,aAAa,QAAO,iBAAiB;AAE1D,MAAMD,SAAS,GAAG;EAChBE,OAAO,EAAEX,SAAS,CAACY,MAAM;EACzBC,IAAI,EAAEb,SAAS,CAACc,KAAK,CAAC,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;EAC1EC,MAAM,EAAEf,SAAS,CAACgB,KAAK,CAAC;IACtBC,KAAK,EAAEjB,SAAS,CAACgB,KAAK,CAACb,KAAK,CAACM,SAAS,CAAC;IACvCS,UAAU,EAAElB,SAAS,CAACY,MAAM;IAC5BO,eAAe,EAAEnB,SAAS,CAACY;EAC7B,CAAC,CAAC;EACFQ,WAAW,EAAEpB,SAAS,CAACgB,KAAK,CAAC;IAC3BK,KAAK,EAAErB,SAAS,CAACY,MAAM;IACvBU,aAAa,EAAEtB,SAAS,CAACuB,IAAI;IAC7B,YAAY,EAAEvB,SAAS,CAACY,MAAM;IAC9BY,WAAW,EAAExB,SAAS,CAACyB,IAAI;IAC3BC,IAAI,EAAE1B,SAAS,CAACc,KAAK,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IACxEa,WAAW,EAAE1B,UAAU,CAACQ,SAAS,CAACkB;EACpC,CAAC,CAAC;EACFC,YAAY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a,CAACE,SAAS,CAAC4B,QAAQ;EAC1CC,OAAO,EAAEtC,SAAS,CAACY,MAAM;EACzB2B,WAAW,EAAEvC,SAAS,CAACY,MAAM;EAC7B4B,cAAc,EAAExC,SAAS,CAACY,MAAM;EAChC6B,iBAAiB,EAAEzC,SAAS,CAACY,MAAM;EACnC8B,aAAa,EAAE1C,SAAS,CAAC2C,OAAO,CAAC3C,SAAS,CAACgB,KAAK,CAACd,WAAW,CAACO,SAAS,CAAC,CAAC;EACxEmC,KAAK,EAAE5C,SAAS,CAACgB,KAAK,CAAC;IACrBU,IAAI,EAAE1B,SAAS,CAACc,KAAK,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C+B,IAAI,EAAE7C,SAAS,CAACkC,SAAS,CAAC,CACxBlC,SAAS,CAACgB,KAAK,CAACX,SAAS,CAACI,SAAS,CAAC,EACpCT,SAAS,CAACgB,KAAK,CAACV,SAAS,CAACG,SAAS,CAAC,CACrC;EACH,CAAC,CAAC;EACFqC,IAAI,EAAE9C,SAAS,CAACgB,KAAK,CAACZ,IAAI,CAACK,SAAS;AACtC,CAAC;AAuCD,eAAeA,SAAS","ignoreList":[]}
|
|
@@ -85,6 +85,11 @@ declare namespace DraggableList {
|
|
|
85
85
|
size: PropTypes.Requireable<number>;
|
|
86
86
|
wrapperSize: PropTypes.Requireable<number>;
|
|
87
87
|
}>>;
|
|
88
|
+
imageOverlay: PropTypes.Requireable<string>;
|
|
89
|
+
contentBadge: PropTypes.Requireable<PropTypes.InferProps<{
|
|
90
|
+
category: PropTypes.Requireable<string>;
|
|
91
|
+
label: PropTypes.Requireable<string>;
|
|
92
|
+
}>>;
|
|
88
93
|
image: PropTypes.Requireable<string>;
|
|
89
94
|
checkbox: PropTypes.Requireable<PropTypes.InferProps<{
|
|
90
95
|
value: PropTypes.Requireable<string>;
|
|
@@ -102,6 +107,7 @@ declare namespace DraggableList {
|
|
|
102
107
|
customStyle: PropTypes.Requireable<{
|
|
103
108
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
104
109
|
}>;
|
|
110
|
+
className: PropTypes.Requireable<string>;
|
|
105
111
|
}>>;
|
|
106
112
|
}> | PropTypes.InferProps<{
|
|
107
113
|
title: PropTypes.Validator<string>;
|
|
@@ -130,6 +136,12 @@ declare namespace DraggableList {
|
|
|
130
136
|
color: PropTypes.Requireable<string>;
|
|
131
137
|
theme: PropTypes.Requireable<string>;
|
|
132
138
|
className: PropTypes.Requireable<string>;
|
|
139
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
140
|
+
label: PropTypes.Validator<string>;
|
|
141
|
+
value: PropTypes.Validator<string>;
|
|
142
|
+
}> | null | undefined)[]>;
|
|
143
|
+
value: PropTypes.Requireable<string>;
|
|
144
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
133
145
|
list: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
134
146
|
color: PropTypes.Requireable<string>;
|
|
135
147
|
value: PropTypes.Validator<string>;
|
|
@@ -2,16 +2,25 @@ export default ProgressBar;
|
|
|
2
2
|
declare function ProgressBar(props: any): JSX.Element;
|
|
3
3
|
declare namespace ProgressBar {
|
|
4
4
|
namespace propTypes {
|
|
5
|
-
const className: PropTypes.Requireable<string>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const desc: PropTypes.Requireable<string>;
|
|
9
|
-
const steps: PropTypes.Requireable<number>;
|
|
10
|
-
const style: PropTypes.Requireable<{
|
|
5
|
+
export const className: PropTypes.Requireable<string>;
|
|
6
|
+
export { numberRequiredWithoutSegments as value };
|
|
7
|
+
export { numberRequiredWithoutSegments as max };
|
|
8
|
+
export const desc: PropTypes.Requireable<string>;
|
|
9
|
+
export const steps: PropTypes.Requireable<number>;
|
|
10
|
+
export const style: PropTypes.Requireable<{
|
|
11
11
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
12
12
|
}>;
|
|
13
|
-
const displayInfo: PropTypes.Requireable<boolean>;
|
|
13
|
+
export const displayInfo: PropTypes.Requireable<boolean>;
|
|
14
|
+
export const segments: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
15
|
+
value: PropTypes.Validator<number>;
|
|
16
|
+
label: PropTypes.Validator<string>;
|
|
17
|
+
color: PropTypes.Validator<string>;
|
|
18
|
+
}> | null | undefined)[]>;
|
|
19
|
+
export const title: PropTypes.Requireable<string>;
|
|
20
|
+
export const subtitle: PropTypes.Requireable<string>;
|
|
21
|
+
export const ariaLabel: PropTypes.Requireable<string>;
|
|
14
22
|
}
|
|
15
23
|
}
|
|
16
24
|
import PropTypes from "prop-types";
|
|
25
|
+
declare function numberRequiredWithoutSegments(props: any, propName: any, ...args: any[]): Error | null;
|
|
17
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-bar/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/progress-bar/index.js"],"names":[],"mappings":";AAeA,sDAsFC;;;;;;;;;;;;;;;;;;;;;;;AA9FD,wGAMC"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import _times from "lodash/fp/times";
|
|
2
|
+
import _sumBy from "lodash/fp/sumBy";
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import PropTypes from 'prop-types';
|
|
4
5
|
import classnames from 'classnames';
|
|
6
|
+
import Title from '../../atom/title';
|
|
5
7
|
import style from './style.css';
|
|
8
|
+
const numberRequiredWithoutSegments = process.env.NODE_ENV !== "production" ? (props, propName, ...args) => {
|
|
9
|
+
const validator = props.segments !== undefined && props.segments !== null ? PropTypes.number : PropTypes.number.isRequired;
|
|
10
|
+
return validator(props, propName, ...args);
|
|
11
|
+
} : {};
|
|
6
12
|
const ProgressBar = props => {
|
|
7
13
|
const {
|
|
8
14
|
className,
|
|
@@ -11,8 +17,51 @@ const ProgressBar = props => {
|
|
|
11
17
|
desc = '',
|
|
12
18
|
steps = 0,
|
|
13
19
|
style: propsStyle,
|
|
14
|
-
displayInfo = true
|
|
20
|
+
displayInfo = true,
|
|
21
|
+
segments,
|
|
22
|
+
title,
|
|
23
|
+
subtitle,
|
|
24
|
+
ariaLabel
|
|
15
25
|
} = props;
|
|
26
|
+
if (segments !== undefined && segments !== null) {
|
|
27
|
+
const total = _sumBy('value', segments);
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: classnames(style.segmented, className)
|
|
30
|
+
}, title || subtitle ? /*#__PURE__*/React.createElement("div", null, title ? /*#__PURE__*/React.createElement(Title, {
|
|
31
|
+
type: "form-group",
|
|
32
|
+
titleSize: "medium",
|
|
33
|
+
title: title
|
|
34
|
+
}) : null, subtitle ? /*#__PURE__*/React.createElement("p", {
|
|
35
|
+
className: style.segmentedSubtitle
|
|
36
|
+
}, subtitle) : null) : null, /*#__PURE__*/React.createElement("div", {
|
|
37
|
+
className: style.segmentedBar,
|
|
38
|
+
"data-name": "progress-bar-segmented-bar",
|
|
39
|
+
role: "img",
|
|
40
|
+
"aria-label": ariaLabel
|
|
41
|
+
}, segments.filter(segment => segment.value > 0).map((segment, index) => /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
key: index,
|
|
43
|
+
className: style.segment,
|
|
44
|
+
"data-name": "progress-bar-segment",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
style: {
|
|
47
|
+
width: `${segment.value / total * 100}%`,
|
|
48
|
+
backgroundColor: segment.color
|
|
49
|
+
}
|
|
50
|
+
}))), /*#__PURE__*/React.createElement("ul", {
|
|
51
|
+
className: style.segmentedLegend
|
|
52
|
+
}, segments.map((segment, index) => /*#__PURE__*/React.createElement("li", {
|
|
53
|
+
key: index,
|
|
54
|
+
className: style.legendItem,
|
|
55
|
+
"data-name": "progress-bar-legend-item"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
className: style.legendSwatch,
|
|
58
|
+
"data-name": "progress-bar-legend-swatch",
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
style: {
|
|
61
|
+
backgroundColor: segment.color
|
|
62
|
+
}
|
|
63
|
+
}), segment.label))));
|
|
64
|
+
}
|
|
16
65
|
const ratio = value / max;
|
|
17
66
|
const percentage = Math.floor(ratio * 100);
|
|
18
67
|
const text = `${percentage}%`;
|
|
@@ -42,12 +91,20 @@ const ProgressBar = props => {
|
|
|
42
91
|
};
|
|
43
92
|
ProgressBar.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
44
93
|
className: PropTypes.string,
|
|
45
|
-
value:
|
|
46
|
-
max:
|
|
94
|
+
value: numberRequiredWithoutSegments,
|
|
95
|
+
max: numberRequiredWithoutSegments,
|
|
47
96
|
desc: PropTypes.string,
|
|
48
97
|
steps: PropTypes.number,
|
|
49
98
|
style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
50
|
-
displayInfo: PropTypes.bool
|
|
99
|
+
displayInfo: PropTypes.bool,
|
|
100
|
+
segments: PropTypes.arrayOf(PropTypes.shape({
|
|
101
|
+
value: PropTypes.number.isRequired,
|
|
102
|
+
label: PropTypes.string.isRequired,
|
|
103
|
+
color: PropTypes.string.isRequired
|
|
104
|
+
})),
|
|
105
|
+
title: PropTypes.string,
|
|
106
|
+
subtitle: PropTypes.string,
|
|
107
|
+
ariaLabel: PropTypes.string
|
|
51
108
|
} : {};
|
|
52
109
|
export default ProgressBar;
|
|
53
110
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","style","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","classnames","Title","style","numberRequiredWithoutSegments","process","env","NODE_ENV","props","propName","args","validator","segments","undefined","number","isRequired","ProgressBar","className","value","max","desc","steps","propsStyle","displayInfo","title","subtitle","ariaLabel","total","_sumBy","createElement","segmented","type","titleSize","segmentedSubtitle","segmentedBar","role","filter","segment","map","index","key","width","backgroundColor","color","segmentedLegend","legendItem","legendSwatch","label","ratio","percentage","Math","floor","text","stepList","_times","step","background","progress","texts","description","propTypes","string","objectOf","oneOfType","bool","arrayOf","shape"],"sources":["../../../src/molecule/progress-bar/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {sumBy, times} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport style from './style.css';\n\nconst numberRequiredWithoutSegments = (props, propName, ...args) => {\n const validator =\n props.segments !== undefined && props.segments !== null\n ? PropTypes.number\n : PropTypes.number.isRequired;\n return validator(props, propName, ...args);\n};\n\nconst ProgressBar = props => {\n const {\n className,\n value,\n max,\n desc = '',\n steps = 0,\n style: propsStyle,\n displayInfo = true,\n segments,\n title,\n subtitle,\n ariaLabel\n } = props;\n\n if (segments !== undefined && segments !== null) {\n const total = sumBy('value', segments);\n return (\n <div className={classnames(style.segmented, className)}>\n {title || subtitle ? (\n <div>\n {title ? <Title type=\"form-group\" titleSize=\"medium\" title={title} /> : null}\n {subtitle ? <p className={style.segmentedSubtitle}>{subtitle}</p> : null}\n </div>\n ) : null}\n <div\n className={style.segmentedBar}\n data-name=\"progress-bar-segmented-bar\"\n role=\"img\"\n aria-label={ariaLabel}\n >\n {segments\n .filter(segment => segment.value > 0)\n .map((segment, index) => (\n <div\n key={index}\n className={style.segment}\n data-name=\"progress-bar-segment\"\n aria-hidden=\"true\"\n style={{width: `${(segment.value / total) * 100}%`, backgroundColor: segment.color}}\n />\n ))}\n </div>\n <ul className={style.segmentedLegend}>\n {segments.map((segment, index) => (\n <li key={index} className={style.legendItem} data-name=\"progress-bar-legend-item\">\n <span\n className={style.legendSwatch}\n data-name=\"progress-bar-legend-swatch\"\n aria-hidden=\"true\"\n style={{backgroundColor: segment.color}}\n />\n {segment.label}\n </li>\n ))}\n </ul>\n </div>\n );\n }\n\n const ratio = value / max;\n const percentage = Math.floor(ratio * 100);\n const text = `${percentage}%`;\n const stepList = times(index => <div className={style.step} key={index} />, steps);\n return (\n <div\n className={classnames(style.background, className)}\n data-name=\"progress-bar-wrapper\"\n data-content={`${text}`}\n >\n <div\n className={style.progress}\n style={{\n ...propsStyle,\n width: `${ratio * 100}%`\n }}\n />\n {displayInfo ? (\n <p className={style.texts}>\n <span className={style.description}>{`${value}/${max} ${desc}`}</span>\n <span className={style.percentage}>{text}</span>\n </p>\n ) : null}\n <div className={style.steps}>{stepList}</div>\n </div>\n );\n};\n\nProgressBar.propTypes = {\n className: PropTypes.string,\n value: numberRequiredWithoutSegments,\n max: numberRequiredWithoutSegments,\n desc: PropTypes.string,\n steps: PropTypes.number,\n style: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n displayInfo: PropTypes.bool,\n segments: PropTypes.arrayOf(\n PropTypes.shape({\n value: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n color: PropTypes.string.isRequired\n })\n ),\n title: PropTypes.string,\n subtitle: PropTypes.string,\n ariaLabel: PropTypes.string\n};\n\nexport default ProgressBar;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,MAAM,kBAAkB;AACpC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,6BAA6B,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG,CAACC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,IAAI,KAAK;EAClE,MAAMC,SAAS,GACbH,KAAK,CAACI,QAAQ,KAAKC,SAAS,IAAIL,KAAK,CAACI,QAAQ,KAAK,IAAI,GACnDZ,SAAS,CAACc,MAAM,GAChBd,SAAS,CAACc,MAAM,CAACC,UAAU;EACjC,OAAOJ,SAAS,CAACH,KAAK,EAAEC,QAAQ,EAAE,GAAGC,IAAI,CAAC;AAC5C,CAAC;AAED,MAAMM,WAAW,GAAGR,KAAK,IAAI;EAC3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ExB,SAAS,CAAC6D,MAAM;EACvBpC,QAAQ,EAAEzB,SAAS,CAAC6D,MAAM;EAC1BnC,SAAS,EAAE1B,SAAS,CAAC6D;AACvB,CAAC;AAED,eAAe7C,WAAW","ignoreList":[]}
|
|
@@ -66,3 +66,59 @@
|
|
|
66
66
|
width: 0;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
@value white, cm_grey_200 from colors;
|
|
71
|
+
|
|
72
|
+
.segmented {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: 12px;
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.segmentedSubtitle {
|
|
80
|
+
composes: subtitleFormGroup from "../../atom/title/style.css";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.segmentedBar {
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: 2px;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 25px;
|
|
88
|
+
background-color: white;
|
|
89
|
+
border-radius: 5px;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.segmentedBar:empty {
|
|
94
|
+
background-color: cm_grey_200;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.segment {
|
|
98
|
+
flex: 0 1 auto;
|
|
99
|
+
min-width: 0;
|
|
100
|
+
height: 100%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.segmentedLegend {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
gap: 8px 16px;
|
|
107
|
+
list-style: none;
|
|
108
|
+
margin: 0;
|
|
109
|
+
padding: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.legendItem {
|
|
113
|
+
composes: subtitleFormGroup from "../../atom/title/style.css";
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: center;
|
|
116
|
+
gap: 8px;
|
|
117
|
+
margin: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.legendSwatch {
|
|
121
|
+
flex: 0 0 12px;
|
|
122
|
+
height: 12px;
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
}
|
|
@@ -85,6 +85,12 @@ declare namespace ContentTypesToggler {
|
|
|
85
85
|
color: PropTypes.Requireable<string>;
|
|
86
86
|
theme: PropTypes.Requireable<string>;
|
|
87
87
|
className: PropTypes.Requireable<string>;
|
|
88
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
89
|
+
label: PropTypes.Validator<string>;
|
|
90
|
+
value: PropTypes.Validator<string>;
|
|
91
|
+
}> | null | undefined)[]>;
|
|
92
|
+
value: PropTypes.Requireable<string>;
|
|
93
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
88
94
|
list: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
89
95
|
color: PropTypes.Requireable<string>;
|
|
90
96
|
value: PropTypes.Validator<string>;
|
|
@@ -33,6 +33,12 @@ declare namespace SetupSections {
|
|
|
33
33
|
color: PropTypes.Requireable<string>;
|
|
34
34
|
theme: PropTypes.Requireable<string>;
|
|
35
35
|
className: PropTypes.Requireable<string>;
|
|
36
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
37
|
+
label: PropTypes.Validator<string>;
|
|
38
|
+
value: PropTypes.Validator<string>;
|
|
39
|
+
}> | null | undefined)[]>;
|
|
40
|
+
value: PropTypes.Requireable<string>;
|
|
41
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
36
42
|
list: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
37
43
|
color: PropTypes.Requireable<string>;
|
|
38
44
|
value: PropTypes.Validator<string>;
|
|
@@ -30,6 +30,12 @@ declare namespace Table {
|
|
|
30
30
|
const rows: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
31
31
|
fields: PropTypes.Requireable<(NonNullable<string | PropTypes.InferProps<{
|
|
32
32
|
icon: PropTypes.Requireable<string>;
|
|
33
|
+
title: PropTypes.Requireable<string>;
|
|
34
|
+
text: PropTypes.Requireable<string>;
|
|
35
|
+
tags: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
36
|
+
status: PropTypes.Requireable<string>;
|
|
37
|
+
label: PropTypes.Validator<string>;
|
|
38
|
+
}> | null | undefined)[]>;
|
|
33
39
|
}> | null | undefined> | null | undefined)[]>;
|
|
34
40
|
editHref: PropTypes.Requireable<string>;
|
|
35
41
|
highlighted: PropTypes.Requireable<boolean>;
|
|
@@ -38,6 +44,8 @@ declare namespace Table {
|
|
|
38
44
|
title: PropTypes.Validator<string>;
|
|
39
45
|
info: PropTypes.Requireable<string>;
|
|
40
46
|
filtered: PropTypes.Requireable<boolean>;
|
|
47
|
+
order: PropTypes.Requireable<string>;
|
|
48
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
41
49
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
42
50
|
title: PropTypes.Validator<string>;
|
|
43
51
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/table/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/table/index.js"],"names":[],"mappings":";AAwEA,8DAiIC"}
|