@coorpacademy/components 11.9.2-alpha.4 → 11.9.3-alpha.23
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/avatar/index.js +1 -0
- package/es/atom/avatar/index.js.map +1 -1
- package/es/atom/avatar/style.css +0 -1
- package/es/atom/card-image-preview/index.d.ts.map +1 -1
- package/es/atom/card-image-preview/index.js +1 -3
- package/es/atom/card-image-preview/index.js.map +1 -1
- package/es/atom/difficulty-level/index.js +8 -4
- package/es/atom/difficulty-level/index.js.map +1 -1
- package/es/atom/difficulty-level/style.css +0 -1
- package/es/atom/drag-and-drop/style.css +14 -9
- package/es/atom/image-upload/index.d.ts +6 -1
- package/es/atom/image-upload/index.d.ts.map +1 -1
- package/es/atom/image-upload/index.js +24 -4
- package/es/atom/image-upload/index.js.map +1 -1
- package/es/atom/image-upload/style.css +7 -0
- package/es/atom/input-html/index.js +2 -6
- package/es/atom/input-html/index.js.map +1 -1
- package/es/atom/life/index.js +3 -9
- package/es/atom/life/index.js.map +1 -1
- package/es/atom/resource-miniature/index.js +1 -3
- package/es/atom/resource-miniature/index.js.map +1 -1
- package/es/atom/review-presentation/index.d.ts.map +1 -1
- package/es/atom/review-presentation/index.js +12 -62
- package/es/atom/review-presentation/index.js.map +1 -1
- package/es/atom/review-presentation/style.css +7 -67
- package/es/atom/title/index.d.ts +1 -0
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +14 -5
- package/es/atom/title/index.js.map +1 -1
- package/es/atom/title/style.css +6 -0
- package/es/atom/tooltip/index.d.ts +22 -0
- package/es/atom/tooltip/index.d.ts.map +1 -0
- package/es/atom/tooltip/index.js +117 -0
- package/es/atom/tooltip/index.js.map +1 -0
- package/es/atom/tooltip/style.css +96 -0
- package/es/molecule/answer/index.d.ts.map +1 -1
- package/es/molecule/answer/index.js +6 -3
- package/es/molecule/answer/index.js.map +1 -1
- package/es/molecule/audio/index.js +1 -3
- package/es/molecule/audio/index.js.map +1 -1
- package/es/molecule/battle-request/index.js +1 -3
- package/es/molecule/battle-request/index.js.map +1 -1
- package/es/molecule/brand-download-box/index.js +1 -3
- package/es/molecule/brand-download-box/index.js.map +1 -1
- package/es/molecule/brand-form-group/index.d.ts +5 -0
- package/es/molecule/brand-form-group/index.d.ts.map +1 -1
- package/es/molecule/brand-form-group/index.js +4 -1
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +9 -10
- package/es/molecule/brand-upload-box/index.js +1 -3
- package/es/molecule/brand-upload-box/index.js.map +1 -1
- package/es/molecule/card/favorite.js +2 -6
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/card/index.d.ts.map +1 -1
- package/es/molecule/card/index.js +2 -6
- package/es/molecule/card/index.js.map +1 -1
- package/es/molecule/card/notification.js +1 -3
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/card-content/index.d.ts.map +1 -1
- package/es/molecule/card-content/index.js +2 -1
- package/es/molecule/card-content/index.js.map +1 -1
- package/es/molecule/card-content/style.css +0 -1
- package/es/molecule/dashboard/cards-list/index.js +3 -9
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/discipline-partners/index.js +1 -3
- package/es/molecule/discipline-partners/index.js.map +1 -1
- package/es/molecule/drag-and-drop/overlay.js +1 -3
- package/es/molecule/drag-and-drop/overlay.js.map +1 -1
- package/es/molecule/drag-and-drop/upload-report.js +1 -3
- package/es/molecule/drag-and-drop/upload-report.js.map +1 -1
- package/es/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/es/molecule/filters/index.js +2 -6
- package/es/molecule/filters/index.js.map +1 -1
- package/es/molecule/pdf/index.js +1 -3
- package/es/molecule/pdf/index.js.map +1 -1
- package/es/molecule/resource-player/index.js +1 -3
- package/es/molecule/resource-player/index.js.map +1 -1
- package/es/molecule/search-form/index.js +1 -3
- package/es/molecule/search-form/index.js.map +1 -1
- package/es/molecule/select-multiple/index.js +2 -6
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/setup-section/index.js +1 -3
- package/es/molecule/setup-section/index.js.map +1 -1
- package/es/molecule/setup-slide/index.d.ts +2 -0
- package/es/molecule/setup-slider/index.d.ts +2 -0
- package/es/molecule/table/index.js +2 -6
- package/es/molecule/table/index.js.map +1 -1
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +3 -0
- package/es/molecule/titled-checkbox/index.js +2 -1
- package/es/molecule/titled-checkbox/index.js.map +1 -1
- package/es/molecule/titled-checkbox/style.css +0 -1
- package/es/organism/accordion/coorp-manager/part/index.d.ts.map +1 -1
- package/es/organism/accordion/coorp-manager/part/index.js +6 -13
- package/es/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/es/organism/accordion/coorp-manager/part/style.css +0 -1
- package/es/organism/accordion/part/index.js +4 -7
- package/es/organism/accordion/part/index.js.map +1 -1
- package/es/organism/accordion/part/style.css +0 -1
- package/es/organism/brand-form/index.d.ts +5 -0
- package/es/organism/brand-form/index.js +1 -3
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/get-the-app/index.js +1 -3
- package/es/organism/get-the-app/index.js.map +1 -1
- package/es/organism/mooc-header/index.d.ts.map +1 -1
- package/es/organism/mooc-header/index.js +7 -21
- package/es/organism/mooc-header/index.js.map +1 -1
- package/es/organism/rewards-form/index.d.ts +3 -0
- package/es/organism/slider/index.js +2 -6
- package/es/organism/slider/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +8 -0
- package/es/template/activity/engine-stars.css +16 -33
- package/es/template/activity/engine-stars.d.ts +15 -17
- package/es/template/activity/engine-stars.d.ts.map +1 -1
- package/es/template/activity/engine-stars.js +129 -122
- package/es/template/activity/engine-stars.js.map +1 -1
- package/es/template/activity/index.d.ts +1 -0
- package/es/template/activity/index.d.ts.map +1 -1
- package/es/template/activity/index.js +18 -9
- package/es/template/activity/index.js.map +1 -1
- package/es/template/activity/progression-item.js +5 -13
- package/es/template/activity/progression-item.js.map +1 -1
- package/es/template/activity/stars-summary.d.ts +1 -0
- package/es/template/activity/stars-summary.d.ts.map +1 -1
- package/es/template/activity/stars-summary.js +13 -14
- package/es/template/activity/stars-summary.js.map +1 -1
- package/es/template/app-player/player/slides/header/learner.css +0 -1
- package/es/template/app-player/player/slides/header/learner.js +2 -1
- package/es/template/app-player/player/slides/header/learner.js.map +1 -1
- package/es/template/app-player/player/slides/header/microlearning.css +0 -1
- package/es/template/app-player/player/slides/header/microlearning.js +2 -1
- package/es/template/app-player/player/slides/header/microlearning.js.map +1 -1
- package/es/template/app-player/popin-correction/index.js +3 -4
- package/es/template/app-player/popin-correction/index.js.map +1 -1
- package/es/template/app-player/popin-correction/style.css +0 -1
- package/es/template/app-player/popin-end/summary.js +1 -3
- package/es/template/app-player/popin-end/summary.js.map +1 -1
- package/es/template/app-player/popin-header/index.js +3 -6
- package/es/template/app-player/popin-header/index.js.map +1 -1
- package/es/template/app-player/popin-header/style.css +0 -1
- package/es/template/back-office/brand-update/index.d.ts +13 -0
- package/lib/atom/avatar/index.js +1 -0
- package/lib/atom/avatar/index.js.map +1 -1
- package/lib/atom/avatar/style.css +0 -1
- package/lib/atom/card-image-preview/index.d.ts.map +1 -1
- package/lib/atom/card-image-preview/index.js +1 -3
- package/lib/atom/card-image-preview/index.js.map +1 -1
- package/lib/atom/difficulty-level/index.js +8 -4
- package/lib/atom/difficulty-level/index.js.map +1 -1
- package/lib/atom/difficulty-level/style.css +0 -1
- package/lib/atom/drag-and-drop/style.css +14 -9
- package/lib/atom/image-upload/index.d.ts +6 -1
- package/lib/atom/image-upload/index.d.ts.map +1 -1
- package/lib/atom/image-upload/index.js +25 -4
- package/lib/atom/image-upload/index.js.map +1 -1
- package/lib/atom/image-upload/style.css +7 -0
- package/lib/atom/input-html/index.js +2 -6
- package/lib/atom/input-html/index.js.map +1 -1
- package/lib/atom/life/index.js +3 -9
- package/lib/atom/life/index.js.map +1 -1
- package/lib/atom/resource-miniature/index.js +1 -3
- package/lib/atom/resource-miniature/index.js.map +1 -1
- package/lib/atom/review-presentation/index.d.ts.map +1 -1
- package/lib/atom/review-presentation/index.js +13 -66
- package/lib/atom/review-presentation/index.js.map +1 -1
- package/lib/atom/review-presentation/style.css +7 -67
- package/lib/atom/title/index.d.ts +1 -0
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +14 -5
- package/lib/atom/title/index.js.map +1 -1
- package/lib/atom/title/style.css +6 -0
- package/lib/atom/tooltip/index.d.ts +22 -0
- package/lib/atom/tooltip/index.d.ts.map +1 -0
- package/lib/atom/tooltip/index.js +137 -0
- package/lib/atom/tooltip/index.js.map +1 -0
- package/lib/atom/tooltip/style.css +96 -0
- package/lib/molecule/answer/index.d.ts.map +1 -1
- package/lib/molecule/answer/index.js +6 -3
- package/lib/molecule/answer/index.js.map +1 -1
- package/lib/molecule/audio/index.js +1 -3
- package/lib/molecule/audio/index.js.map +1 -1
- package/lib/molecule/battle-request/index.js +1 -3
- package/lib/molecule/battle-request/index.js.map +1 -1
- package/lib/molecule/brand-download-box/index.js +1 -3
- package/lib/molecule/brand-download-box/index.js.map +1 -1
- package/lib/molecule/brand-form-group/index.d.ts +5 -0
- package/lib/molecule/brand-form-group/index.d.ts.map +1 -1
- package/lib/molecule/brand-form-group/index.js +4 -1
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +9 -10
- package/lib/molecule/brand-upload-box/index.js +1 -3
- package/lib/molecule/brand-upload-box/index.js.map +1 -1
- package/lib/molecule/card/favorite.js +2 -6
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/card/index.d.ts.map +1 -1
- package/lib/molecule/card/index.js +2 -6
- package/lib/molecule/card/index.js.map +1 -1
- package/lib/molecule/card/notification.js +1 -3
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/card-content/index.d.ts.map +1 -1
- package/lib/molecule/card-content/index.js +2 -1
- package/lib/molecule/card-content/index.js.map +1 -1
- package/lib/molecule/card-content/style.css +0 -1
- package/lib/molecule/dashboard/cards-list/index.js +3 -9
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/discipline-partners/index.js +1 -3
- package/lib/molecule/discipline-partners/index.js.map +1 -1
- package/lib/molecule/drag-and-drop/overlay.js +1 -3
- package/lib/molecule/drag-and-drop/overlay.js.map +1 -1
- package/lib/molecule/drag-and-drop/upload-report.js +1 -3
- package/lib/molecule/drag-and-drop/upload-report.js.map +1 -1
- package/lib/molecule/drag-and-drop-wrapper/index.d.ts +2 -0
- package/lib/molecule/filters/index.js +2 -6
- package/lib/molecule/filters/index.js.map +1 -1
- package/lib/molecule/pdf/index.js +1 -3
- package/lib/molecule/pdf/index.js.map +1 -1
- package/lib/molecule/resource-player/index.js +1 -3
- package/lib/molecule/resource-player/index.js.map +1 -1
- package/lib/molecule/search-form/index.js +1 -3
- package/lib/molecule/search-form/index.js.map +1 -1
- package/lib/molecule/select-multiple/index.js +2 -6
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/setup-section/index.js +1 -3
- package/lib/molecule/setup-section/index.js.map +1 -1
- package/lib/molecule/setup-slide/index.d.ts +2 -0
- package/lib/molecule/setup-slider/index.d.ts +2 -0
- package/lib/molecule/table/index.js +2 -6
- package/lib/molecule/table/index.js.map +1 -1
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +3 -0
- package/lib/molecule/titled-checkbox/index.js +2 -1
- package/lib/molecule/titled-checkbox/index.js.map +1 -1
- package/lib/molecule/titled-checkbox/style.css +0 -1
- package/lib/organism/accordion/coorp-manager/part/index.d.ts.map +1 -1
- package/lib/organism/accordion/coorp-manager/part/index.js +6 -13
- package/lib/organism/accordion/coorp-manager/part/index.js.map +1 -1
- package/lib/organism/accordion/coorp-manager/part/style.css +0 -1
- package/lib/organism/accordion/part/index.js +4 -7
- package/lib/organism/accordion/part/index.js.map +1 -1
- package/lib/organism/accordion/part/style.css +0 -1
- package/lib/organism/brand-form/index.d.ts +5 -0
- package/lib/organism/brand-form/index.js +1 -3
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/get-the-app/index.js +1 -3
- package/lib/organism/get-the-app/index.js.map +1 -1
- package/lib/organism/mooc-header/index.d.ts.map +1 -1
- package/lib/organism/mooc-header/index.js +7 -21
- package/lib/organism/mooc-header/index.js.map +1 -1
- package/lib/organism/rewards-form/index.d.ts +3 -0
- package/lib/organism/slider/index.js +2 -6
- package/lib/organism/slider/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +8 -0
- package/lib/template/activity/engine-stars.css +16 -33
- package/lib/template/activity/engine-stars.d.ts +15 -17
- package/lib/template/activity/engine-stars.d.ts.map +1 -1
- package/lib/template/activity/engine-stars.js +135 -122
- package/lib/template/activity/engine-stars.js.map +1 -1
- package/lib/template/activity/index.d.ts +1 -0
- package/lib/template/activity/index.d.ts.map +1 -1
- package/lib/template/activity/index.js +21 -9
- package/lib/template/activity/index.js.map +1 -1
- package/lib/template/activity/progression-item.js +5 -13
- package/lib/template/activity/progression-item.js.map +1 -1
- package/lib/template/activity/stars-summary.d.ts +1 -0
- package/lib/template/activity/stars-summary.d.ts.map +1 -1
- package/lib/template/activity/stars-summary.js +13 -14
- package/lib/template/activity/stars-summary.js.map +1 -1
- package/lib/template/app-player/player/slides/header/learner.css +0 -1
- package/lib/template/app-player/player/slides/header/learner.js +2 -1
- package/lib/template/app-player/player/slides/header/learner.js.map +1 -1
- package/lib/template/app-player/player/slides/header/microlearning.css +0 -1
- package/lib/template/app-player/player/slides/header/microlearning.js +2 -1
- package/lib/template/app-player/player/slides/header/microlearning.js.map +1 -1
- package/lib/template/app-player/popin-correction/index.js +3 -4
- package/lib/template/app-player/popin-correction/index.js.map +1 -1
- package/lib/template/app-player/popin-correction/style.css +0 -1
- package/lib/template/app-player/popin-end/summary.js +1 -3
- package/lib/template/app-player/popin-end/summary.js.map +1 -1
- package/lib/template/app-player/popin-header/index.js +3 -6
- package/lib/template/app-player/popin-header/index.js.map +1 -1
- package/lib/template/app-player/popin-header/style.css +0 -1
- package/lib/template/back-office/brand-update/index.d.ts +13 -0
- package/locales/cs/global.json +1 -0
- package/locales/de/global.json +1 -0
- package/locales/en/global.json +1 -0
- package/locales/es/global.json +1 -0
- package/locales/et/global.json +1 -0
- package/locales/fr/global.json +1 -0
- package/locales/hr/global.json +1 -0
- package/locales/hu/global.json +1 -0
- package/locales/it/global.json +1 -0
- package/locales/ja/global.json +1 -0
- package/locales/ko/global.json +1 -0
- package/locales/nl/global.json +1 -0
- package/locales/pl/global.json +1 -0
- package/locales/pt/global.json +1 -0
- package/locales/ro/global.json +1 -0
- package/locales/ru/global.json +1 -0
- package/locales/sk/global.json +1 -0
- package/locales/th/global.json +90 -0
- package/locales/tl/global.json +1 -0
- package/locales/zh/global.json +1 -0
- package/locales/zh_TW/global.json +1 -0
- package/package.json +4 -3
package/lib/atom/life/index.js
CHANGED
|
@@ -89,19 +89,13 @@ const Life = (props, context) => {
|
|
|
89
89
|
style: heartCustomStyle
|
|
90
90
|
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyVoteHeartOutline, {
|
|
91
91
|
className: _style.default.heartOutline,
|
|
92
|
-
|
|
93
|
-
color: white
|
|
94
|
-
}
|
|
92
|
+
color: white
|
|
95
93
|
}), /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidVoteRewardsVoteHeart, {
|
|
96
94
|
className: pickStyle(_style.default.heartNormalDefault, _style.default.heartNormalFailed, _style.default.heartNormalAnimatedFailed, _style.default.heartNormalRevival),
|
|
97
|
-
|
|
98
|
-
color: negativeColor
|
|
99
|
-
}
|
|
95
|
+
color: negativeColor
|
|
100
96
|
}), /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyBrokenHeart, {
|
|
101
97
|
className: pickStyle(_style.default.heartBrokenDefault, _style.default.heartBrokenFailed, _style.default.heartBrokenAnimatedFailed, _style.default.heartBrokenRevival),
|
|
102
|
-
|
|
103
|
-
color: negativeColor
|
|
104
|
-
}
|
|
98
|
+
color: negativeColor
|
|
105
99
|
})));
|
|
106
100
|
};
|
|
107
101
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MODES","default","cssStyle","small","BOUNCES","bounce","bounceTwice","bounceAndPause","Life","props","context","skin","heartOnRight","animated","count","failed","mode","operator","revival","className","style","customStyle","negativeColor","white","pickStyle","successStyle","failedStyle","animatedFailedStyle","revivalStyle","heartWrapper","heartWrapperFailed","heartWrapperDefault","bounceClass","type","heartCustomStyle","animationDelay","delay","animationDuration","duration","left","countStyle","livesCounterFailed","livesCounterDefault","classnames","livesCounterWrapper","previousLivesCounterDefault","previousLivesCounterFailed","previousLivesRevival","operatorWrapper","heartOutline","
|
|
1
|
+
{"version":3,"file":"index.js","names":["MODES","default","cssStyle","small","BOUNCES","bounce","bounceTwice","bounceAndPause","Life","props","context","skin","heartOnRight","animated","count","failed","mode","operator","revival","className","style","customStyle","negativeColor","white","pickStyle","successStyle","failedStyle","animatedFailedStyle","revivalStyle","heartWrapper","heartWrapperFailed","heartWrapperDefault","bounceClass","type","heartCustomStyle","animationDelay","delay","animationDuration","duration","left","countStyle","livesCounterFailed","livesCounterDefault","classnames","livesCounterWrapper","previousLivesCounterDefault","previousLivesCounterFailed","previousLivesRevival","operatorWrapper","heartOutline","heartNormalDefault","heartNormalFailed","heartNormalAnimatedFailed","heartNormalRevival","heartBrokenDefault","heartBrokenFailed","heartBrokenAnimatedFailed","heartBrokenRevival","contextTypes","Provider","childContextTypes","propTypes","PropTypes","bool","shape","oneOf","string","number"],"sources":["../../../src/atom/life/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaCompositionCoorpacademyBrokenHeart as HeartBrokenIcon,\n NovaCompositionCoorpacademyVoteHeartOutline as HeartIconOutline\n} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport cssStyle from './style.css';\n\nconst MODES = {\n default: cssStyle.default,\n small: cssStyle.small\n};\n\nconst BOUNCES = {\n bounce: cssStyle.bounce,\n bounceTwice: cssStyle.bounceTwice,\n bounceAndPause: cssStyle.bounceAndPause\n};\n\nconst Life = (props, context) => {\n const {skin} = context;\n const {\n bounce = null,\n heartOnRight = false,\n animated = false,\n count = 3,\n failed = false,\n mode = 'default',\n operator = 'x',\n revival,\n className,\n style: customStyle\n } = props;\n const negativeColor = get('common.negative', skin);\n const white = get('common.white', skin);\n\n if (count === null) {\n return null;\n }\n\n const pickStyle = (successStyle, failedStyle, animatedFailedStyle, revivalStyle) => {\n if (revival) return revivalStyle;\n if (failed && animated) return animatedFailedStyle;\n if (failed) return failedStyle;\n return successStyle;\n };\n\n const heartWrapper =\n failed && animated ? cssStyle.heartWrapperFailed : cssStyle.heartWrapperDefault;\n const bounceClass = bounce ? BOUNCES[bounce.type] : null;\n const heartCustomStyle = {\n animationDelay: bounce && bounce.delay,\n animationDuration: bounce && bounce.duration,\n left: heartOnRight && '70px'\n };\n\n const countStyle = failed ? cssStyle.livesCounterFailed : cssStyle.livesCounterDefault;\n\n return (\n <div data-name=\"life\" className={classnames(MODES[mode], className)} style={customStyle}>\n <div className={cssStyle.livesCounterWrapper}>\n <div\n className={pickStyle(\n cssStyle.previousLivesCounterDefault,\n cssStyle.previousLivesCounterDefault,\n cssStyle.previousLivesCounterFailed,\n cssStyle.previousLivesRevival\n )}\n >\n {count + 1}\n </div>\n <div data-name=\"counter\" className={countStyle}>\n {count}\n </div>\n </div>\n <div className={cssStyle.operatorWrapper}>\n <span className={cssStyle.operator}>{operator}</span>\n </div>\n <div className={classnames(heartWrapper, bounceClass)} style={heartCustomStyle}>\n <HeartIconOutline className={cssStyle.heartOutline} color={white} />\n <HeartIcon\n className={pickStyle(\n cssStyle.heartNormalDefault,\n cssStyle.heartNormalFailed,\n cssStyle.heartNormalAnimatedFailed,\n cssStyle.heartNormalRevival\n )}\n color={negativeColor}\n />\n <HeartBrokenIcon\n className={pickStyle(\n cssStyle.heartBrokenDefault,\n cssStyle.heartBrokenFailed,\n cssStyle.heartBrokenAnimatedFailed,\n cssStyle.heartBrokenRevival\n )}\n color={negativeColor}\n />\n </div>\n </div>\n );\n};\n\nLife.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nLife.propTypes = {\n revival: PropTypes.bool,\n animated: PropTypes.bool,\n bounce: PropTypes.shape({\n type: PropTypes.oneOf(['bounce', 'bounceTwice', 'bounceAndPause']),\n delay: PropTypes.string\n }),\n heartOnRight: PropTypes.bool,\n mode: PropTypes.oneOf(keys(MODES)),\n count: PropTypes.number,\n failed: PropTypes.bool,\n className: PropTypes.string,\n operator: PropTypes.string,\n style: PropTypes.shape({})\n};\n\nexport default Life;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,OAAO,EAAEC,cAAA,CAASD,OADN;EAEZE,KAAK,EAAED,cAAA,CAASC;AAFJ,CAAd;AAKA,MAAMC,OAAO,GAAG;EACdC,MAAM,EAAEH,cAAA,CAASG,MADH;EAEdC,WAAW,EAAEJ,cAAA,CAASI,WAFR;EAGdC,cAAc,EAAEL,cAAA,CAASK;AAHX,CAAhB;;AAMA,MAAMC,IAAI,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;EAC/B,MAAM;IAACC;EAAD,IAASD,OAAf;EACA,MAAM;IACJL,MAAM,GAAG,IADL;IAEJO,YAAY,GAAG,KAFX;IAGJC,QAAQ,GAAG,KAHP;IAIJC,KAAK,GAAG,CAJJ;IAKJC,MAAM,GAAG,KALL;IAMJC,IAAI,GAAG,SANH;IAOJC,QAAQ,GAAG,GAPP;IAQJC,OARI;IASJC,SATI;IAUJC,KAAK,EAAEC;EAVH,IAWFZ,KAXJ;EAYA,MAAMa,aAAa,GAAG,mBAAI,iBAAJ,EAAuBX,IAA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,KAAK,EAAE0B,kBAAA,CAAUI;EAFK,CAAhB,CAHO;EAOftD,YAAY,EAAEkD,kBAAA,CAAUC,IAPT;EAQf/C,IAAI,EAAE8C,kBAAA,CAAUG,KAAV,CAAgB,oBAAKjE,KAAL,CAAhB,CARS;EASfc,KAAK,EAAEgD,kBAAA,CAAUK,MATF;EAUfpD,MAAM,EAAE+C,kBAAA,CAAUC,IAVH;EAWf5C,SAAS,EAAE2C,kBAAA,CAAUI,MAXN;EAYfjD,QAAQ,EAAE6C,kBAAA,CAAUI,MAZL;EAaf9C,KAAK,EAAE0C,kBAAA,CAAUE,KAAV,CAAgB,EAAhB;AAbQ,CAAjB;eAgBexD,I"}
|
|
@@ -67,9 +67,7 @@ const ResourceMiniature = (props, context) => {
|
|
|
67
67
|
backgroundImage: `url(${poster})`
|
|
68
68
|
}
|
|
69
69
|
}), !selected ? /*#__PURE__*/_react.default.createElement(Icon, {
|
|
70
|
-
|
|
71
|
-
color: white
|
|
72
|
-
},
|
|
70
|
+
color: white,
|
|
73
71
|
className: _style.default.icon
|
|
74
72
|
}) : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
75
73
|
className: (0, _classnames.default)(descriptionClassName, _style.default.innerHTML) // eslint-disable-next-line react/no-danger
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TYPES","pdf","style","icon","PDFIcon","audio","PodcastIcon","video","PlayIcon","ResourceMiniature","props","context","skin","type","description","poster","onClick","handleOnClick","selected","descriptionClassName","selectedDescription","white","primary","posterOutlineColor","Icon","posterWrapper","borderColor","backgroundImage","
|
|
1
|
+
{"version":3,"file":"index.js","names":["TYPES","pdf","style","icon","PDFIcon","audio","PodcastIcon","video","PlayIcon","ResourceMiniature","props","context","skin","type","description","poster","onClick","handleOnClick","selected","descriptionClassName","selectedDescription","white","primary","posterOutlineColor","Icon","posterWrapper","borderColor","backgroundImage","classnames","innerHTML","__html","propTypes","PropTypes","oneOf","bool","string","func","contextTypes","Provider","childContextTypes"],"sources":["../../../src/atom/resource-miniature/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {get, keys} from 'lodash/fp';\nimport {\n NovaSolidAudioAudioControlPlay as PlayIcon,\n NovaLineFilesOfficeFileOfficePdf as PDFIcon,\n NovaCompositionCoorpacademyMicrophone as PodcastIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst TYPES = {\n pdf: {style: style.pdf, icon: PDFIcon},\n audio: {style: style.audio, icon: PodcastIcon},\n video: {style: style.video, icon: PlayIcon}\n};\n\nconst ResourceMiniature = (props, context) => {\n const {skin} = context;\n const {type, description, poster, onClick: handleOnClick, selected = false} = props;\n const descriptionClassName = selected ? style.selectedDescription : style.description;\n const white = get('common.white', skin);\n const primary = get('common.primary', skin);\n const posterOutlineColor = selected ? primary : white;\n const Icon = TYPES[type].icon;\n return (\n <div className={TYPES[type].style} onClick={handleOnClick} data-type={type}>\n <div className={style.posterWrapper} style={{borderColor: posterOutlineColor}}>\n <div className={style.poster} style={{backgroundImage: `url(${poster})`}} />\n {!selected ? <Icon color={white} className={style.icon} /> : null}\n </div>\n <div\n className={classnames(descriptionClassName, style.innerHTML)}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: description}}\n />\n </div>\n );\n};\n\nResourceMiniature.propTypes = {\n type: PropTypes.oneOf(keys(TYPES)),\n selected: PropTypes.bool,\n description: PropTypes.string,\n poster: PropTypes.string,\n onClick: PropTypes.func\n};\n\nResourceMiniature.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nexport default ResourceMiniature;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,GAAG,EAAE;IAACC,KAAK,EAAEA,cAAA,CAAMD,GAAd;IAAmBE,IAAI,EAAEC;EAAzB,CADO;EAEZC,KAAK,EAAE;IAACH,KAAK,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WT,oBAAX,EAAiCjB,cAAA,CAAM2B,SAAvC,CADb,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACC,MAAM,EAAEhB;IAAT;EAH3B,EALF,CADF;AAaD,CArBD;;AAuBAL,iBAAiB,CAACsB,SAAlB,2CAA8B;EAC5BlB,IAAI,EAAEmB,kBAAA,CAAUC,KAAV,CAAgB,oBAAKjC,KAAL,CAAhB,CADsB;EAE5BkB,QAAQ,EAAEc,kBAAA,CAAUE,IAFQ;EAG5BpB,WAAW,EAAEkB,kBAAA,CAAUG,MAHK;EAI5BpB,MAAM,EAAEiB,kBAAA,CAAUG,MAJU;EAK5BnB,OAAO,EAAEgB,kBAAA,CAAUI;AALS,CAA9B;AAQA3B,iBAAiB,CAAC4B,YAAlB,GAAiC;EAC/BzB,IAAI,EAAE0B,iBAAA,CAASC,iBAAT,CAA2B3B;AADF,CAAjC;eAIeH,iB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/review-presentation/index.js"],"names":[],"mappings":";AA+CA,6DA+BC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
5
|
|
|
6
|
-
var _react =
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
@@ -13,18 +13,14 @@ var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
|
13
13
|
|
|
14
14
|
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
15
15
|
|
|
16
|
+
var _tooltip = _interopRequireDefault(require("../tooltip"));
|
|
17
|
+
|
|
16
18
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
19
|
|
|
18
20
|
var _propTypes2 = _interopRequireDefault(require("./prop-types"));
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
|
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
-
|
|
26
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
-
|
|
28
24
|
const ICONS = {
|
|
29
25
|
skills: _novaIcons.NovaLineSelectionCursorsCursorArrowTarget,
|
|
30
26
|
questions: _novaIcons.NovaSolidInterfaceFeedbackInterfaceQuestionMark,
|
|
@@ -49,50 +45,6 @@ const ReviewIcon = ({
|
|
|
49
45
|
});
|
|
50
46
|
};
|
|
51
47
|
|
|
52
|
-
const ToolTip = ({
|
|
53
|
-
tooltipText,
|
|
54
|
-
'aria-label': moreDetailsAriaLabel,
|
|
55
|
-
'data-testid': dataTestId,
|
|
56
|
-
closeToolTipInformationTextAriaLabel
|
|
57
|
-
}) => {
|
|
58
|
-
const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
|
|
59
|
-
const handleKeyPress = (0, _react.useCallback)(event => {
|
|
60
|
-
if (event.key === 'Enter') {
|
|
61
|
-
setToolTipIsVisible(!toolTipIsVisible);
|
|
62
|
-
} else if (event.key === 'Tab' || event.key === 'Escape') {
|
|
63
|
-
setToolTipIsVisible(false);
|
|
64
|
-
}
|
|
65
|
-
}, [setToolTipIsVisible, toolTipIsVisible]);
|
|
66
|
-
const handleMouseOver = (0, _react.useCallback)(() => {
|
|
67
|
-
setToolTipIsVisible(true);
|
|
68
|
-
}, [setToolTipIsVisible]);
|
|
69
|
-
const handleMouseLeave = (0, _react.useCallback)(() => {
|
|
70
|
-
setToolTipIsVisible(false);
|
|
71
|
-
}, [setToolTipIsVisible]);
|
|
72
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
-
className: _style.default.tooltipContainer,
|
|
74
|
-
onMouseLeave: handleMouseLeave,
|
|
75
|
-
onMouseOver: handleMouseOver
|
|
76
|
-
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
77
|
-
type: "button",
|
|
78
|
-
className: _style.default.tooltipIconContainer,
|
|
79
|
-
"data-testid": dataTestId,
|
|
80
|
-
onKeyDown: handleKeyPress,
|
|
81
|
-
tabIndex: 0
|
|
82
|
-
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
|
|
83
|
-
className: _style.default.informationIcon,
|
|
84
|
-
width: 12,
|
|
85
|
-
height: 12,
|
|
86
|
-
"aria-label": moreDetailsAriaLabel
|
|
87
|
-
})), toolTipIsVisible ? /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
-
className: _style.default.toolTip,
|
|
89
|
-
"data-testid": "review-presentation-tooltip",
|
|
90
|
-
"aria-label": closeToolTipInformationTextAriaLabel
|
|
91
|
-
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
92
|
-
className: _style.default.tooltipText
|
|
93
|
-
}, tooltipText)) : null);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
48
|
const ReviewListItemWrapper = ({
|
|
97
49
|
iconKey,
|
|
98
50
|
label
|
|
@@ -106,11 +58,11 @@ const ReviewListItemWrapper = ({
|
|
|
106
58
|
className: _style.default.reviewListText
|
|
107
59
|
}, /*#__PURE__*/_react.default.createElement(ReviewIcon, {
|
|
108
60
|
icon: iconKey
|
|
109
|
-
}), " ", label.text), /*#__PURE__*/_react.default.createElement(
|
|
110
|
-
|
|
111
|
-
"aria-label": label.moreDetailsAriaLabel,
|
|
61
|
+
}), " ", label.text), /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
62
|
+
TooltipContent: label.tooltipText,
|
|
112
63
|
closeToolTipInformationTextAriaLabel: label.closeToolTipInformationTextAriaLabel,
|
|
113
|
-
"data-testid": `review-list-item-tooltip-button-${iconKey}
|
|
64
|
+
"data-testid": `review-list-item-tooltip-button-${iconKey}`,
|
|
65
|
+
"aria-label": label.moreDetailsAriaLabel
|
|
114
66
|
}));
|
|
115
67
|
};
|
|
116
68
|
|
|
@@ -153,23 +105,18 @@ const ReviewPresentation = props => {
|
|
|
153
105
|
}, labelsList)));
|
|
154
106
|
};
|
|
155
107
|
|
|
156
|
-
ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
157
|
-
tooltipText: _propTypes.default.string,
|
|
158
|
-
'aria-label': _propTypes.default.string,
|
|
159
|
-
'data-testid': _propTypes.default.string,
|
|
160
|
-
closeToolTipInformationTextAriaLabel: _propTypes.default.string
|
|
161
|
-
} : {};
|
|
162
108
|
ReviewIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
163
109
|
icon: _propTypes.default.string
|
|
164
110
|
} : {};
|
|
165
|
-
ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ?
|
|
111
|
+
ReviewListItemWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
166
112
|
iconKey: _propTypes.default.string,
|
|
167
113
|
label: _propTypes.default.shape({
|
|
168
|
-
tooltipText:
|
|
169
|
-
moreDetailsAriaLabel:
|
|
170
|
-
closeToolTipInformationTextAriaLabel:
|
|
114
|
+
tooltipText: _tooltip.default.propTypes.tooltipText,
|
|
115
|
+
moreDetailsAriaLabel: _tooltip.default.propTypes['aria-label'],
|
|
116
|
+
closeToolTipInformationTextAriaLabel: _tooltip.default.propTypes.closeToolTipInformationTextAriaLabel,
|
|
117
|
+
text: _propTypes.default.string
|
|
171
118
|
})
|
|
172
|
-
}
|
|
119
|
+
} : {};
|
|
173
120
|
ReviewPresentation.propTypes = process.env.NODE_ENV !== "production" ? _propTypes2.default : {};
|
|
174
121
|
var _default = ReviewPresentation;
|
|
175
122
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ICONS","skills","TargetIcon","questions","QuestionIcon","lifes","HeartIcon","allright","CheckIcon","ReviewIcon","icon","Icon","getOr","style","labelIcon","
|
|
1
|
+
{"version":3,"file":"index.js","names":["ICONS","skills","TargetIcon","questions","QuestionIcon","lifes","HeartIcon","allright","CheckIcon","ReviewIcon","icon","Icon","getOr","style","labelIcon","ReviewListItemWrapper","iconKey","label","reviewListItemWrapper","reviewListText","text","tooltipText","closeToolTipInformationTextAriaLabel","moreDetailsAriaLabel","ReviewPresentation","props","ariaLabel","reviewTitle","reviewText","labelsList","reviewWrapper","__html","reviewListWrapper","map","convert","cap","key","reviewList","propTypes","PropTypes","string","shape","ToolTip"],"sources":["../../../src/atom/review-presentation/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport map from 'lodash/fp/map';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidVoteRewardsVoteHeart as HeartIcon,\n NovaSolidInterfaceFeedbackInterfaceQuestionMark as QuestionIcon,\n NovaLineSelectionCursorsCursorArrowTarget as TargetIcon\n} from '@coorpacademy/nova-icons';\nimport ToolTip from '../tooltip';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ICONS = {\n skills: TargetIcon,\n questions: QuestionIcon,\n lifes: HeartIcon,\n allright: CheckIcon\n};\n\nconst ReviewIcon = ({icon}) => {\n const Icon = getOr(null, icon, ICONS);\n\n /* istanbul ignore next */\n if (!Icon) {\n return <div className={style.labelIcon} />;\n }\n return <Icon className={style.labelIcon} />;\n};\n\nconst ReviewListItemWrapper = ({iconKey, label}) => {\n return (\n <div className={style.reviewListItemWrapper} data-tip data-for=\"reviewListItem\" tabIndex={0}>\n <div className={style.reviewListText}>\n <ReviewIcon icon={iconKey} /> {label.text}\n </div>\n <ToolTip\n TooltipContent={label.tooltipText}\n closeToolTipInformationTextAriaLabel={label.closeToolTipInformationTextAriaLabel}\n data-testid={`review-list-item-tooltip-button-${iconKey}`}\n aria-label={label.moreDetailsAriaLabel}\n />\n </div>\n );\n};\n\nconst ReviewPresentation = props => {\n const {'aria-label': ariaLabel, reviewTitle, reviewText, labelsList} = props;\n\n return (\n <div className={style.reviewWrapper} aria-label={ariaLabel}>\n <div\n className={style.reviewTitle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewTitle}}\n />\n <div\n className={style.reviewText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: reviewText}}\n />\n <ul className={style.reviewListWrapper}>\n {map.convert({cap: false})((label, key) => {\n return (\n <li key={`step-${key}`} className={style.reviewList}>\n <ReviewListItemWrapper\n iconKey={key}\n label={label}\n tooltipText={label.tooltipText}\n aria-label={label.moreDetailsAriaLabel}\n />\n </li>\n );\n }, labelsList)}\n </ul>\n </div>\n );\n};\n\nReviewIcon.propTypes = {\n icon: PropTypes.string\n};\n\nReviewListItemWrapper.propTypes = {\n iconKey: PropTypes.string,\n label: PropTypes.shape({\n tooltipText: ToolTip.propTypes.tooltipText,\n moreDetailsAriaLabel: ToolTip.propTypes['aria-label'],\n closeToolTipInformationTextAriaLabel: ToolTip.propTypes.closeToolTipInformationTextAriaLabel,\n text: PropTypes.string\n })\n};\n\nReviewPresentation.propTypes = propTypes;\n\nexport default ReviewPresentation;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AACA;;;;AAEA,MAAMA,KAAK,GAAG;EACZC,MAAM,EAAEC,oDADI;EAEZC,SAAS,EAAEC,0DAFC;EAGZC,KAAK,EAAEC,wCAHK;EAIZC,QAAQ,EAAEC;AAJE,CAAd;;AAOA,MAAMC,UAAU,GAAG,CAAC;EAACC;AAAD,CAAD,KAAY;EAC7B,MAAMC,IAAI,GAAG,IAAAC,cAAA,EAAM,IAAN,EAAYF,IAAZ,EAAkBV,KAAlB,CAAb;EAEA;;EACA,IAAI,CAACW,IAAL,EAAW;IACT,oBAAO;MAAK,SAAS,EAAEE,cAAA,CAAMC;IAAtB,EAAP;EACD;;EACD,oBAAO,6BAAC,IAAD;IAAM,SAAS,EAAED,cAAA,CAAMC;EAAvB,EAAP;AACD,CARD;;AAUA,MAAMC,qBAAqB,GAAG,CAAC;EAACC,OAAD;EAAUC;AAAV,CAAD,KAAsB;EAClD,oBACE;IAAK,SAAS,EAAEJ,cAAA,CAAMK,qBAAtB;IAA6C,gBAA7C;IAAsD,YAAS,gBAA/D;IAAgF,QAAQ,EAAE;EAA1F,gBACE;IAAK,SAAS,EAAEL,cAAA,CAAMM;EAAtB,gBACE,6BAAC,UAAD;IAAY,IAAI,EAAEH;EAAlB,EADF,OACiCC,KAAK,CAACG,IADvC,CADF,eAIE,6BAAC,gBAAD;IACE,cAAc,EAAEH,KAAK,CAACI,WADxB;IAEE,oCAAoC,EAAEJ,KAAK,CAACK,oCAF9C;IAGE,eAAc,mCAAkCN,OAAQ,EAH1D;IAIE,cAAYC,KAAK,CAACM;EAJpB,EAJF,CADF;AAaD,CAdD;;AAgBA,MAAMC,kBAAkB,G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AAEoB,gBAAA,CAAQJ,SAAR,CAAkBhB,oCAHnC;IAIrBF,IAAI,EAAEmB,kBAAA,CAAUC;EAJK,CAAhB;AAFyB,CAAlC;AAUAhB,kBAAkB,CAACc,SAAnB,2CAA+BA,mBAA/B;eAEed,kB"}
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
@value mobile from breakpoints;
|
|
4
4
|
@value colors: "../../variables/colors.css";
|
|
5
5
|
@value xtraLightGrey from colors;
|
|
6
|
-
@value cm_blue_900 from colors;
|
|
7
6
|
@value cm_grey_75 from colors;
|
|
8
|
-
@value cm_grey_500 from colors;
|
|
9
|
-
@value cm_grey_700 from colors;
|
|
10
|
-
@value white from colors;
|
|
11
7
|
|
|
8
|
+
.reviewWrapper {
|
|
9
|
+
width: 100%;
|
|
10
|
+
border-radius: 16px;
|
|
11
|
+
background-color: xtraLightGrey;
|
|
12
|
+
padding-bottom: 40px;
|
|
13
|
+
}
|
|
12
14
|
|
|
13
15
|
.textBase {
|
|
14
16
|
font-family: "Gilroy";
|
|
@@ -17,13 +19,6 @@
|
|
|
17
19
|
user-select: none;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
.reviewWrapper {
|
|
21
|
-
width: 100%;
|
|
22
|
-
border-radius: 16px;
|
|
23
|
-
background-color: xtraLightGrey;
|
|
24
|
-
padding-bottom: 40px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
.reviewTitle {
|
|
28
23
|
composes: textBase;
|
|
29
24
|
font-weight: 700;
|
|
@@ -77,61 +72,6 @@
|
|
|
77
72
|
width: 16px;
|
|
78
73
|
}
|
|
79
74
|
|
|
80
|
-
.informationIcon {
|
|
81
|
-
color: cm_grey_500;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.toolTip {
|
|
85
|
-
transition: opacity 0.8s;
|
|
86
|
-
position: absolute;
|
|
87
|
-
height: auto;
|
|
88
|
-
width: 200px;
|
|
89
|
-
border-radius: 7px;
|
|
90
|
-
background-color: cm_grey_700;
|
|
91
|
-
right: -81px;
|
|
92
|
-
bottom: 32px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.toolTip::before {
|
|
96
|
-
content: '';
|
|
97
|
-
display: inline-block;
|
|
98
|
-
visibility: inherit;
|
|
99
|
-
opacity: inherit;
|
|
100
|
-
width: 15px;
|
|
101
|
-
height: 15px;
|
|
102
|
-
transform: rotate(-45deg);
|
|
103
|
-
background-color: cm_grey_700;
|
|
104
|
-
position: inherit;
|
|
105
|
-
bottom: -5px;
|
|
106
|
-
right: 40%;
|
|
107
|
-
border-radius: 2px;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.tooltipText {
|
|
111
|
-
composes: textBase;
|
|
112
|
-
font-weight: 500;
|
|
113
|
-
font-size: 14px;
|
|
114
|
-
display: inline-block;
|
|
115
|
-
border-radius: 3px;
|
|
116
|
-
word-wrap: break-word;
|
|
117
|
-
color: white;
|
|
118
|
-
padding: 8px 14px;
|
|
119
|
-
text-align: center;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.tooltipContainer {
|
|
123
|
-
overflow: visible;
|
|
124
|
-
position: relative;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.tooltipIconContainer {
|
|
128
|
-
display: flex;
|
|
129
|
-
justify-content: flex-end;
|
|
130
|
-
border: none;
|
|
131
|
-
background: cm_grey_75;
|
|
132
|
-
height: 25px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
75
|
@media tablet {
|
|
136
76
|
.reviewWrapper{
|
|
137
77
|
width: 100%;
|
|
@@ -142,4 +82,4 @@
|
|
|
142
82
|
.reviewWrapper{
|
|
143
83
|
width: 100%;
|
|
144
84
|
}
|
|
145
|
-
}
|
|
85
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";AA2BA,gDAeC"}
|
package/lib/atom/title/index.js
CHANGED
|
@@ -21,13 +21,20 @@ const getTitleStype = type => {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const getSubtitleStype = type => {
|
|
24
|
+
const getSubtitleStype = (type, size) => {
|
|
25
25
|
switch (type) {
|
|
26
26
|
case 'page':
|
|
27
27
|
return _style.default.subtitlePage;
|
|
28
28
|
|
|
29
29
|
case 'form-group':
|
|
30
|
-
|
|
30
|
+
switch (size) {
|
|
31
|
+
case 'standard':
|
|
32
|
+
return _style.default.subtitleFormGroup;
|
|
33
|
+
|
|
34
|
+
case 'small':
|
|
35
|
+
return _style.default.smallSubtitleFormGroup;
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
}
|
|
32
39
|
};
|
|
33
40
|
|
|
@@ -36,10 +43,11 @@ const Title = props => {
|
|
|
36
43
|
title,
|
|
37
44
|
subtitle,
|
|
38
45
|
type,
|
|
39
|
-
'data-name': dataName
|
|
46
|
+
'data-name': dataName,
|
|
47
|
+
subtitleSize = 'standard'
|
|
40
48
|
} = props;
|
|
41
49
|
const titleStyle = getTitleStype(type);
|
|
42
|
-
const subtitleStyle = getSubtitleStype(type);
|
|
50
|
+
const subtitleStyle = getSubtitleStype(type, subtitleSize);
|
|
43
51
|
const subtitleSection = subtitle ? /*#__PURE__*/_react.default.createElement("div", {
|
|
44
52
|
className: subtitleStyle
|
|
45
53
|
}, subtitle) : null;
|
|
@@ -53,7 +61,8 @@ Title.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
53
61
|
title: _propTypes.default.string,
|
|
54
62
|
subtitle: _propTypes.default.string,
|
|
55
63
|
type: _propTypes.default.oneOf(['page', 'form-group']),
|
|
56
|
-
'data-name': _propTypes.default.string
|
|
64
|
+
'data-name': _propTypes.default.string,
|
|
65
|
+
subtitleSize: _propTypes.default.string
|
|
57
66
|
} : {};
|
|
58
67
|
var _default = Title;
|
|
59
68
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["getTitleStype","type","style","titlePage","titleFormGroup","getSubtitleStype","subtitlePage","subtitleFormGroup","Title","props","title","subtitle","dataName","titleStyle","subtitleStyle","subtitleSection","propTypes","PropTypes","string","oneOf"],"sources":["../../../src/atom/title/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport style from './style.css';\n\nconst getTitleStype = type => {\n switch (type) {\n case 'page':\n return style.titlePage;\n case 'form-group':\n return style.titleFormGroup;\n }\n};\n\nconst getSubtitleStype = type => {\n switch (type) {\n case 'page':\n return style.subtitlePage;\n case 'form-group':\n return style.subtitleFormGroup;\n }\n};\n\nconst Title = props => {\n const {title, subtitle, type, 'data-name': dataName} = props;\n const titleStyle = getTitleStype(type);\n const subtitleStyle = getSubtitleStype(type);\n\n const subtitleSection = subtitle ? <div className={subtitleStyle}>{subtitle}</div> : null;\n\n return (\n <div>\n <div className={titleStyle} data-name={dataName}>\n {title}\n </div>\n {subtitleSection}\n </div>\n );\n};\n\nTitle.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n type: PropTypes.oneOf(['page', 'form-group']),\n 'data-name': PropTypes.string\n};\nexport default Title;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEA,MAAMA,aAAa,GAAGC,IAAI,IAAI;EAC5B,QAAQA,IAAR;IACE,KAAK,MAAL;MACE,OAAOC,cAAA,CAAMC,SAAb;;IACF,KAAK,YAAL;MACE,OAAOD,cAAA,CAAME,cAAb;EAJJ;AAMD,CAPD;;AASA,MAAMC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTitleStype","type","style","titlePage","titleFormGroup","getSubtitleStype","size","subtitlePage","subtitleFormGroup","smallSubtitleFormGroup","Title","props","title","subtitle","dataName","subtitleSize","titleStyle","subtitleStyle","subtitleSection","propTypes","PropTypes","string","oneOf"],"sources":["../../../src/atom/title/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport style from './style.css';\n\nconst getTitleStype = type => {\n switch (type) {\n case 'page':\n return style.titlePage;\n case 'form-group':\n return style.titleFormGroup;\n }\n};\n\nconst getSubtitleStype = (type, size) => {\n switch (type) {\n case 'page':\n return style.subtitlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.subtitleFormGroup;\n case 'small':\n return style.smallSubtitleFormGroup;\n }\n }\n};\n\nconst Title = props => {\n const {title, subtitle, type, 'data-name': dataName, subtitleSize = 'standard'} = props;\n const titleStyle = getTitleStype(type);\n const subtitleStyle = getSubtitleStype(type, subtitleSize);\n\n const subtitleSection = subtitle ? <div className={subtitleStyle}>{subtitle}</div> : null;\n\n return (\n <div>\n <div className={titleStyle} data-name={dataName}>\n {title}\n </div>\n {subtitleSection}\n </div>\n );\n};\n\nTitle.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n type: PropTypes.oneOf(['page', 'form-group']),\n 'data-name': PropTypes.string,\n subtitleSize: PropTypes.string\n};\nexport default Title;\n"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEA,MAAMA,aAAa,GAAGC,IAAI,IAAI;EAC5B,QAAQA,IAAR;IACE,KAAK,MAAL;MACE,OAAOC,cAAA,CAAMC,SAAb;;IACF,KAAK,YAAL;MACE,OAAOD,cAAA,CAAME,cAAb;EAJJ;AAMD,CAPD;;AASA,MAAMC,gBAAgB,GAAG,CAACJ,IAAD,EAAOK,IAAP,KAAgB;EACvC,QAAQL,IAAR;IACE,KAAK,MAAL;MACE,OAAOC,cAAA,CAAMK,YAAb;;IACF,KAAK,YAAL;MACE,QAAQD,IAAR;QACE,KAAK,UAAL;UACE,OAAOJ,cAAA,CAAMM,iBAAb;;QACF,KAAK,OAAL;UACE,OAAON,cAAA,CAAMO,sBAAb;MAJJ;;EAJJ;AAWD,CAZD;;AAcA,MAAMC,KAAK,GAAGC,KAAK,IAAI;EACrB,MAAM;IAACC,KAAD;IAAQC,QAAR;IAAkBZ,IAAlB;IAAwB,aAAaa,QAArC;IAA+CC,YAAY,GAAG;EAA9D,IAA4EJ,KAAlF;EACA,MAAMK,UAAU,GAAGhB,aAAa,CAACC,IAAD,CAAhC;EACA,MAAMgB,aAAa,GAAGZ,gBAAgB,CAACJ,IAAD,EAAOc,YAAP,CAAtC;EAEA,MAAMG,eAAe,GAAGL,QAAQ,gBAAG;IAAK,SAAS,EAAEI;EAAhB,GAAgCJ,QAAhC,CAAH,GAAqD,IAArF;EAEA,oBACE,uDACE;IAAK,SAAS,EAAEG,UAAhB;IAA4B,aAAWF;EAAvC,GACGF,KADH,CADF,EAIGM,eAJH,CADF;AAQD,CAfD;;AAiBAR,KAAK,CAACS,SAAN,2CAAkB;EAChBP,KAAK,EAAEQ,kBAAA,CAAUC,MADD;EAEhBR,QAAQ,EAAEO,kBAAA,CAAUC,MAFJ;EAGhBpB,IAAI,EAAEmB,kBAAA,CAAUE,KAAV,CAAgB,CAAC,MAAD,EAAS,YAAT,CAAhB,CAHU;EAIhB,aAAaF,kBAAA,CAAUC,MAJP;EAKhBN,YAAY,EAAEK,kBAAA,CAAUC;AALR,CAAlB;eAOeX,K"}
|
package/lib/atom/title/style.css
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function toggleStateOnKeyPress(state: any, setState: any, ref: any): (event: any) => void;
|
|
2
|
+
export default ToolTip;
|
|
3
|
+
declare function ToolTip({ anchorId, TooltipContent, "aria-label": ariaLabel, "data-testid": dataTestId, closeToolTipInformationTextAriaLabel, toolTipIsVisible: _toolTipIsVisible }: {
|
|
4
|
+
anchorId: any;
|
|
5
|
+
TooltipContent: any;
|
|
6
|
+
"aria-label": any;
|
|
7
|
+
"data-testid": any;
|
|
8
|
+
closeToolTipInformationTextAriaLabel: any;
|
|
9
|
+
toolTipIsVisible: any;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
declare namespace ToolTip {
|
|
12
|
+
const propTypes: {
|
|
13
|
+
TooltipContent: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | PropTypes.ReactNodeLike>>;
|
|
14
|
+
'data-testid': PropTypes.Requireable<string>;
|
|
15
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
16
|
+
closeToolTipInformationTextAriaLabel: PropTypes.Validator<string>;
|
|
17
|
+
anchorId: PropTypes.Requireable<string>;
|
|
18
|
+
toolTipIsVisible: PropTypes.Requireable<boolean>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
import PropTypes from "prop-types";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/tooltip/index.js"],"names":[],"mappings":"AA+CO,iGASN;;AAED;;;;;;;gBA2EC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.toggleStateOnKeyPress = exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _reactTooltip = _interopRequireDefault(require("react-tooltip"));
|
|
11
|
+
|
|
12
|
+
var _isString = _interopRequireDefault(require("lodash/fp/isString"));
|
|
13
|
+
|
|
14
|
+
var _novaIcons = require("@coorpacademy/nova-icons");
|
|
15
|
+
|
|
16
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
const ToolTipWrapper = ({
|
|
25
|
+
toolTipIsVisible,
|
|
26
|
+
anchorId,
|
|
27
|
+
closeToolTipInformationTextAriaLabel,
|
|
28
|
+
content
|
|
29
|
+
}) => {
|
|
30
|
+
if (!toolTipIsVisible) return null;
|
|
31
|
+
|
|
32
|
+
if (anchorId) {
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_reactTooltip.default, {
|
|
34
|
+
id: anchorId,
|
|
35
|
+
className: _style.default.toolTipReact,
|
|
36
|
+
"data-event-off": "click",
|
|
37
|
+
place: "left",
|
|
38
|
+
effect: "solid",
|
|
39
|
+
"aria-label": closeToolTipInformationTextAriaLabel
|
|
40
|
+
}, content);
|
|
41
|
+
} else {
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
+
className: _style.default.toolTip,
|
|
44
|
+
"data-testid": "tooltip",
|
|
45
|
+
"aria-label": closeToolTipInformationTextAriaLabel
|
|
46
|
+
}, content);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
51
|
+
toolTipIsVisible: _propTypes.default.bool,
|
|
52
|
+
anchorId: _propTypes.default.string,
|
|
53
|
+
closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
|
|
54
|
+
content: _propTypes.default.node
|
|
55
|
+
} : {};
|
|
56
|
+
|
|
57
|
+
const toggleStateOnKeyPress = (state, setState, ref) => event => {
|
|
58
|
+
if (event.key === 'Enter') {
|
|
59
|
+
if (ref) ref.current.focus();
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
setState(!state);
|
|
63
|
+
} else if (event.key === 'Tab' || event.key === 'Escape') {
|
|
64
|
+
setState(false);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
exports.toggleStateOnKeyPress = toggleStateOnKeyPress;
|
|
69
|
+
|
|
70
|
+
const ToolTip = ({
|
|
71
|
+
anchorId,
|
|
72
|
+
TooltipContent,
|
|
73
|
+
'aria-label': ariaLabel,
|
|
74
|
+
'data-testid': dataTestId,
|
|
75
|
+
closeToolTipInformationTextAriaLabel,
|
|
76
|
+
toolTipIsVisible: _toolTipIsVisible
|
|
77
|
+
}) => {
|
|
78
|
+
const isComponent = (0, _react.useMemo)(() => !(0, _isString.default)(TooltipContent) && /*#__PURE__*/(0, _react.isValidElement)(TooltipContent()), [TooltipContent]);
|
|
79
|
+
const [toolTipIsVisible, setToolTipIsVisible] = (0, _react.useState)(false);
|
|
80
|
+
const handleKeyPress = (0, _react.useCallback)(event => {
|
|
81
|
+
toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);
|
|
82
|
+
}, [toolTipIsVisible]);
|
|
83
|
+
const handleMouseOver = (0, _react.useCallback)(() => {
|
|
84
|
+
setToolTipIsVisible(true);
|
|
85
|
+
}, []);
|
|
86
|
+
const handleMouseLeave = (0, _react.useCallback)(() => {
|
|
87
|
+
setToolTipIsVisible(false);
|
|
88
|
+
}, []);
|
|
89
|
+
const content = (0, _react.useMemo)(() => {
|
|
90
|
+
return isComponent ? /*#__PURE__*/_react.default.createElement(TooltipContent, null) : /*#__PURE__*/_react.default.createElement("p", {
|
|
91
|
+
className: _style.default.tooltipContent
|
|
92
|
+
}, TooltipContent);
|
|
93
|
+
}, [TooltipContent, isComponent]);
|
|
94
|
+
return anchorId ? /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
|
|
95
|
+
toolTipIsVisible: _toolTipIsVisible,
|
|
96
|
+
anchorId: anchorId,
|
|
97
|
+
closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
|
|
98
|
+
content: content,
|
|
99
|
+
onMouseLeave: handleMouseLeave,
|
|
100
|
+
onMouseOver: handleMouseOver
|
|
101
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
+
className: _style.default.tooltipContainer,
|
|
103
|
+
onMouseLeave: handleMouseLeave,
|
|
104
|
+
onMouseOver: handleMouseOver
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
106
|
+
type: "button",
|
|
107
|
+
className: _style.default.tooltipIconContainer,
|
|
108
|
+
"data-testid": dataTestId,
|
|
109
|
+
onKeyDown: handleKeyPress,
|
|
110
|
+
tabIndex: 0
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyInformationIcon, {
|
|
112
|
+
className: _style.default.informationIcon,
|
|
113
|
+
width: 12,
|
|
114
|
+
height: 12,
|
|
115
|
+
"aria-label": ariaLabel
|
|
116
|
+
})), /*#__PURE__*/_react.default.createElement(ToolTipWrapper, {
|
|
117
|
+
toolTipIsVisible: toolTipIsVisible,
|
|
118
|
+
anchorId: anchorId,
|
|
119
|
+
closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
|
|
120
|
+
content: content
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
125
|
+
TooltipContent: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node, _propTypes.default.string]),
|
|
126
|
+
'data-testid': _propTypes.default.string,
|
|
127
|
+
'aria-label': _propTypes.default.string,
|
|
128
|
+
closeToolTipInformationTextAriaLabel: _propTypes.default.string.isRequired,
|
|
129
|
+
// ---------- externalHandling --------------
|
|
130
|
+
// if passed down, React Tooltip is used instead, due to limitations on
|
|
131
|
+
// parents overflow hidden controls
|
|
132
|
+
anchorId: _propTypes.default.string,
|
|
133
|
+
toolTipIsVisible: _propTypes.default.bool
|
|
134
|
+
} : {};
|
|
135
|
+
var _default = ToolTip;
|
|
136
|
+
exports.default = _default;
|
|
137
|
+
//# sourceMappingURL=index.js.map
|