@coorpacademy/components 11.11.4 → 11.11.5

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.
Files changed (162) hide show
  1. package/es/atom/battle-opponent/index.d.ts +20 -0
  2. package/es/atom/battle-opponent/index.d.ts.map +1 -0
  3. package/es/atom/battle-opponent/index.js +104 -0
  4. package/es/atom/battle-opponent/index.js.map +1 -0
  5. package/es/atom/battle-opponent/prop-types.d.ts +21 -0
  6. package/es/atom/battle-opponent/prop-types.d.ts.map +1 -0
  7. package/es/atom/battle-opponent/prop-types.js +12 -0
  8. package/es/atom/battle-opponent/prop-types.js.map +1 -0
  9. package/es/atom/battle-opponent/style.css +133 -0
  10. package/es/atom/button-link-icon-only/index.d.ts.map +1 -1
  11. package/es/atom/button-link-icon-only/index.js +3 -2
  12. package/es/atom/button-link-icon-only/index.js.map +1 -1
  13. package/es/atom/button-link-icon-only/style.css +23 -0
  14. package/es/atom/{review-header-step-item → status-item}/index.d.ts +4 -4
  15. package/es/atom/status-item/index.d.ts.map +1 -0
  16. package/es/atom/status-item/index.js +104 -0
  17. package/es/atom/status-item/index.js.map +1 -0
  18. package/es/atom/status-item/index.native.d.ts +5 -0
  19. package/es/atom/status-item/index.native.d.ts.map +1 -0
  20. package/es/atom/{review-header-step-item → status-item}/index.native.js +2 -2
  21. package/es/atom/status-item/index.native.js.map +1 -0
  22. package/es/atom/{review-header-step-item → status-item}/style.css +47 -0
  23. package/es/atom/{review-header-step-item → status-item}/types.d.ts +5 -5
  24. package/es/atom/status-item/types.d.ts.map +1 -0
  25. package/es/atom/{review-header-step-item → status-item}/types.js +1 -1
  26. package/es/atom/status-item/types.js.map +1 -0
  27. package/es/atom/tooltip/index.d.ts +3 -1
  28. package/es/atom/tooltip/index.d.ts.map +1 -1
  29. package/es/atom/tooltip/index.js +18 -7
  30. package/es/atom/tooltip/index.js.map +1 -1
  31. package/es/atom/tooltip/style.css +11 -2
  32. package/es/globals.d.js.map +1 -1
  33. package/es/molecule/battle-opponent-list/index.d.ts +18 -0
  34. package/es/molecule/battle-opponent-list/index.d.ts.map +1 -0
  35. package/es/molecule/battle-opponent-list/index.js +25 -0
  36. package/es/molecule/battle-opponent-list/index.js.map +1 -0
  37. package/es/molecule/battle-opponent-list/prop-types.d.ts +26 -0
  38. package/es/molecule/battle-opponent-list/prop-types.d.ts.map +1 -0
  39. package/es/molecule/battle-opponent-list/prop-types.js +14 -0
  40. package/es/molecule/battle-opponent-list/prop-types.js.map +1 -0
  41. package/es/molecule/battle-opponent-list/style.css +5 -0
  42. package/es/molecule/review-header-steps/index.js +2 -2
  43. package/es/molecule/review-header-steps/index.js.map +1 -1
  44. package/es/molecule/review-header-steps/prop-types.d.ts +2 -2
  45. package/es/molecule/review-header-steps/prop-types.d.ts.map +1 -1
  46. package/es/molecule/review-header-steps/prop-types.js +1 -1
  47. package/es/molecule/review-header-steps/prop-types.js.map +1 -1
  48. package/es/organism/review-header/index.native.js +1 -1
  49. package/es/organism/review-header/index.native.js.map +1 -1
  50. package/es/organism/review-header/types.d.ts +2 -2
  51. package/es/organism/review-header/types.d.ts.map +1 -1
  52. package/es/organism/review-header/types.js.map +1 -1
  53. package/es/organism/user-preferences/index.d.ts.map +1 -1
  54. package/es/organism/user-preferences/index.js +6 -3
  55. package/es/organism/user-preferences/index.js.map +1 -1
  56. package/es/util/button-icons.d.ts +1 -0
  57. package/es/util/button-icons.d.ts.map +1 -1
  58. package/es/util/button-icons.js +3 -2
  59. package/es/util/button-icons.js.map +1 -1
  60. package/es/variables/colors.css +2 -0
  61. package/lib/atom/battle-opponent/index.d.ts +20 -0
  62. package/lib/atom/battle-opponent/index.d.ts.map +1 -0
  63. package/lib/atom/battle-opponent/index.js +124 -0
  64. package/lib/atom/battle-opponent/index.js.map +1 -0
  65. package/lib/atom/battle-opponent/prop-types.d.ts +21 -0
  66. package/lib/atom/battle-opponent/prop-types.d.ts.map +1 -0
  67. package/lib/atom/battle-opponent/prop-types.js +21 -0
  68. package/lib/atom/battle-opponent/prop-types.js.map +1 -0
  69. package/lib/atom/battle-opponent/style.css +133 -0
  70. package/lib/atom/button-link-icon-only/index.d.ts.map +1 -1
  71. package/lib/atom/button-link-icon-only/index.js +1 -1
  72. package/lib/atom/button-link-icon-only/index.js.map +1 -1
  73. package/lib/atom/button-link-icon-only/style.css +23 -0
  74. package/lib/atom/{review-header-step-item → status-item}/index.d.ts +4 -4
  75. package/lib/atom/status-item/index.d.ts.map +1 -0
  76. package/lib/atom/{review-header-step-item → status-item}/index.js +50 -23
  77. package/lib/atom/status-item/index.js.map +1 -0
  78. package/lib/atom/status-item/index.native.d.ts +5 -0
  79. package/lib/atom/status-item/index.native.d.ts.map +1 -0
  80. package/lib/atom/{review-header-step-item → status-item}/index.native.js +2 -2
  81. package/lib/atom/status-item/index.native.js.map +1 -0
  82. package/lib/atom/{review-header-step-item → status-item}/style.css +47 -0
  83. package/lib/atom/{review-header-step-item → status-item}/types.d.ts +5 -5
  84. package/lib/atom/status-item/types.d.ts.map +1 -0
  85. package/lib/atom/{review-header-step-item → status-item}/types.js +1 -1
  86. package/lib/atom/status-item/types.js.map +1 -0
  87. package/lib/atom/tooltip/index.d.ts +3 -1
  88. package/lib/atom/tooltip/index.d.ts.map +1 -1
  89. package/lib/atom/tooltip/index.js +19 -7
  90. package/lib/atom/tooltip/index.js.map +1 -1
  91. package/lib/atom/tooltip/style.css +11 -2
  92. package/lib/globals.d.js.map +1 -1
  93. package/lib/molecule/battle-opponent-list/index.d.ts +18 -0
  94. package/lib/molecule/battle-opponent-list/index.d.ts.map +1 -0
  95. package/lib/molecule/battle-opponent-list/index.js +43 -0
  96. package/lib/molecule/battle-opponent-list/index.js.map +1 -0
  97. package/lib/molecule/battle-opponent-list/prop-types.d.ts +26 -0
  98. package/lib/molecule/battle-opponent-list/prop-types.d.ts.map +1 -0
  99. package/lib/molecule/battle-opponent-list/prop-types.js +23 -0
  100. package/lib/molecule/battle-opponent-list/prop-types.js.map +1 -0
  101. package/lib/molecule/battle-opponent-list/style.css +5 -0
  102. package/lib/molecule/review-header-steps/index.js +2 -2
  103. package/lib/molecule/review-header-steps/index.js.map +1 -1
  104. package/lib/molecule/review-header-steps/prop-types.d.ts +2 -2
  105. package/lib/molecule/review-header-steps/prop-types.d.ts.map +1 -1
  106. package/lib/molecule/review-header-steps/prop-types.js +1 -1
  107. package/lib/molecule/review-header-steps/prop-types.js.map +1 -1
  108. package/lib/organism/review-header/index.native.js +1 -1
  109. package/lib/organism/review-header/index.native.js.map +1 -1
  110. package/lib/organism/review-header/types.d.ts +2 -2
  111. package/lib/organism/review-header/types.d.ts.map +1 -1
  112. package/lib/organism/review-header/types.js.map +1 -1
  113. package/lib/organism/user-preferences/index.d.ts.map +1 -1
  114. package/lib/organism/user-preferences/index.js +10 -3
  115. package/lib/organism/user-preferences/index.js.map +1 -1
  116. package/lib/util/button-icons.d.ts +1 -0
  117. package/lib/util/button-icons.d.ts.map +1 -1
  118. package/lib/util/button-icons.js +2 -1
  119. package/lib/util/button-icons.js.map +1 -1
  120. package/lib/variables/colors.css +2 -0
  121. package/locales/bs/global.json +0 -2
  122. package/locales/cs/global.json +0 -2
  123. package/locales/de/global.json +0 -2
  124. package/locales/en/global.json +8 -5
  125. package/locales/es/global.json +0 -2
  126. package/locales/et/global.json +0 -2
  127. package/locales/fr/global.json +0 -2
  128. package/locales/hr/global.json +0 -2
  129. package/locales/hu/global.json +0 -2
  130. package/locales/hy/global.json +0 -2
  131. package/locales/it/global.json +0 -2
  132. package/locales/ja/global.json +0 -2
  133. package/locales/ko/global.json +0 -2
  134. package/locales/nl/global.json +0 -2
  135. package/locales/pl/global.json +0 -2
  136. package/locales/pt/global.json +0 -2
  137. package/locales/ro/global.json +0 -2
  138. package/locales/ru/global.json +0 -2
  139. package/locales/sk/global.json +0 -2
  140. package/locales/th/global.json +0 -2
  141. package/locales/tl/global.json +0 -2
  142. package/locales/tr/global.json +0 -2
  143. package/locales/uk/global.json +0 -2
  144. package/locales/vi/global.json +0 -2
  145. package/locales/zh/global.json +0 -2
  146. package/locales/zh_TW/global.json +0 -2
  147. package/package.json +3 -2
  148. package/es/atom/review-header-step-item/index.d.ts.map +0 -1
  149. package/es/atom/review-header-step-item/index.js +0 -77
  150. package/es/atom/review-header-step-item/index.js.map +0 -1
  151. package/es/atom/review-header-step-item/index.native.d.ts +0 -5
  152. package/es/atom/review-header-step-item/index.native.d.ts.map +0 -1
  153. package/es/atom/review-header-step-item/index.native.js.map +0 -1
  154. package/es/atom/review-header-step-item/types.d.ts.map +0 -1
  155. package/es/atom/review-header-step-item/types.js.map +0 -1
  156. package/lib/atom/review-header-step-item/index.d.ts.map +0 -1
  157. package/lib/atom/review-header-step-item/index.js.map +0 -1
  158. package/lib/atom/review-header-step-item/index.native.d.ts +0 -5
  159. package/lib/atom/review-header-step-item/index.native.d.ts.map +0 -1
  160. package/lib/atom/review-header-step-item/index.native.js.map +0 -1
  161. package/lib/atom/review-header-step-item/types.d.ts.map +0 -1
  162. package/lib/atom/review-header-step-item/types.js.map +0 -1
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { WebContextValues } from '../provider/web-context';
3
+ import { BattleOpponentProps } from './prop-types';
4
+ declare const BattleOpponent: {
5
+ ({ isAlreadyEngaged, isRandom, userAvatarSrc, onClick, displayName, tooltipText, "aria-label": ariaLabel }: BattleOpponentProps, legacyContext: WebContextValues): JSX.Element;
6
+ propTypes: {
7
+ isAlreadyEngaged: import("prop-types").Requireable<boolean>;
8
+ isRandom: import("prop-types").Requireable<boolean>;
9
+ userAvatarSrc: import("prop-types").Requireable<string>;
10
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
11
+ displayName: import("prop-types").Requireable<string>;
12
+ tooltipText: import("prop-types").Requireable<string>;
13
+ 'aria-label': import("prop-types").Requireable<string>;
14
+ };
15
+ contextTypes: {
16
+ translate: import("prop-types").Requireable<(...args: any[]) => any>;
17
+ };
18
+ };
19
+ export default BattleOpponent;
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/battle-opponent/index.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAkB,EAAC,mBAAmB,EAAC,MAAM,cAAc,CAAC;AAG5D,QAAA,MAAM,cAAc;gHASf,mBAAmB,iBACP,gBAAgB;;;;;;;;;;;;;CAyGhC,CAAC;AAQF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,104 @@
1
+ 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); }
2
+
3
+ import React, { useCallback, useMemo, useState, useRef } from 'react';
4
+ import classnames from 'classnames';
5
+ import { v5 as uuidV5 } from 'uuid';
6
+ import has from 'lodash/fp/has';
7
+ import { NovaCompositionNavigationArrowRight as ArrowRight, NovaCompositionCoorpacademyInformationIcon as InformationIcon } from '@coorpacademy/nova-icons';
8
+ import ToolTip, { toggleStateOnKeyPress } from '../tooltip';
9
+ import Provider, { GetTranslateFromContext } from '../provider';
10
+ import propTypes from './prop-types';
11
+ import style from './style.css';
12
+
13
+ const BattleOpponent = ({
14
+ isAlreadyEngaged,
15
+ isRandom,
16
+ userAvatarSrc,
17
+ onClick,
18
+ displayName,
19
+ tooltipText,
20
+ 'aria-label': ariaLabel
21
+ }, legacyContext) => {
22
+ const translate = GetTranslateFromContext(legacyContext);
23
+ const wrapperClassnames = useMemo(() => classnames(style.card, style['opponent-card'], isRandom ? style.random : null), [isRandom]);
24
+ const displayNameClassnames = useMemo(() => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null), [isAlreadyEngaged]);
25
+ const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);
26
+ const [toolTipIsVisible, setToolTipIsVisible] = useState(false); // to be replaced by useId when React17 is bumped to React18
27
+
28
+ const [battleOpponentInfoId] = useState(isAlreadyEngaged ? uuidV5('engaged-battle-', uuidV5.URL) : undefined);
29
+ const buttonRef = useRef(null);
30
+ const handleMouseOver = useCallback(() => {
31
+ mouseLeaveTimer && clearTimeout(mouseLeaveTimer); // @ts-expect-error (error: focus does not exists on type never)
32
+
33
+ /* istanbul ignore next */
34
+
35
+ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();
36
+ setToolTipIsVisible(true);
37
+ }, [mouseLeaveTimer]);
38
+ const handleMouseLeave = useCallback(() => {
39
+ setMouseLeaveTimer(setTimeout(() => {
40
+ setToolTipIsVisible(false); // @ts-expect-error (error: blur does not exists on type never)
41
+
42
+ /* istanbul ignore next */
43
+
44
+ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();
45
+ }, 500));
46
+ }, []);
47
+ const handleKeyPress = useCallback(event => {
48
+ toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);
49
+ }, [toolTipIsVisible]);
50
+ const TooltipContent = useCallback(_props => /*#__PURE__*/React.createElement("p", _extends({}, _props, {
51
+ onMouseOver: handleMouseOver,
52
+ onMouseLeave: handleMouseLeave,
53
+ "data-testid": "battle-opponent-tooltip-content"
54
+ }), tooltipText), [handleMouseLeave, handleMouseOver, tooltipText]);
55
+ return /*#__PURE__*/React.createElement("li", _extends({}, !isAlreadyEngaged && {
56
+ onClick
57
+ }, {
58
+ className: wrapperClassnames,
59
+ "data-testid": "battle-opponent-wrapper",
60
+ tabIndex: 0
61
+ }), /*#__PURE__*/React.createElement("div", {
62
+ className: style.avatar
63
+ }, isRandom ? null : /*#__PURE__*/React.createElement("img", {
64
+ src: userAvatarSrc,
65
+ alt: ""
66
+ })), /*#__PURE__*/React.createElement("p", {
67
+ className: displayNameClassnames,
68
+ tabIndex: 0
69
+ }, displayName), isAlreadyEngaged ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
70
+ ref: buttonRef,
71
+ tabIndex: 0,
72
+ type: "button",
73
+ className: style.tooltipIconContainer,
74
+ "data-testid": "battle-engaged-opponent-information-button",
75
+ onKeyDown: handleKeyPress,
76
+ onMouseLeave: handleMouseLeave,
77
+ onMouseOver: handleMouseOver,
78
+ "data-for": battleOpponentInfoId,
79
+ "data-tooltip-place": "left",
80
+ "data-tip": isAlreadyEngaged,
81
+ "aria-label": ariaLabel
82
+ }, /*#__PURE__*/React.createElement(InformationIcon, {
83
+ className: style.informationIcon,
84
+ width: 20,
85
+ height: 20
86
+ })), /*#__PURE__*/React.createElement(ToolTip, {
87
+ fontSize: 12,
88
+ anchorId: battleOpponentInfoId,
89
+ toolTipIsVisible: toolTipIsVisible,
90
+ TooltipContent: TooltipContent,
91
+ closeToolTipInformationTextAriaLabel: translate('Press the escape key to close the information text')
92
+ })) : /*#__PURE__*/React.createElement(ArrowRight, {
93
+ className: style.rightArrow,
94
+ width: 16,
95
+ height: 16
96
+ }));
97
+ };
98
+
99
+ BattleOpponent.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
100
+ BattleOpponent.contextTypes = {
101
+ translate: Provider.childContextTypes.translate
102
+ };
103
+ export default BattleOpponent;
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","useState","useRef","classnames","v5","uuidV5","has","NovaCompositionNavigationArrowRight","ArrowRight","NovaCompositionCoorpacademyInformationIcon","InformationIcon","ToolTip","toggleStateOnKeyPress","Provider","GetTranslateFromContext","propTypes","style","BattleOpponent","isAlreadyEngaged","isRandom","userAvatarSrc","onClick","displayName","tooltipText","ariaLabel","legacyContext","translate","wrapperClassnames","card","random","displayNameClassnames","name","alreadyEngaged","mouseLeaveTimer","setMouseLeaveTimer","undefined","toolTipIsVisible","setToolTipIsVisible","battleOpponentInfoId","URL","buttonRef","handleMouseOver","clearTimeout","current","focus","handleMouseLeave","setTimeout","blur","handleKeyPress","event","TooltipContent","_props","avatar","tooltipIconContainer","informationIcon","rightArrow","contextTypes","childContextTypes"],"sources":["../../../src/atom/battle-opponent/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState, useRef} from 'react';\nimport classnames from 'classnames';\nimport {v5 as uuidV5} from 'uuid';\nimport has from 'lodash/fp/has';\nimport {\n NovaCompositionNavigationArrowRight as ArrowRight,\n NovaCompositionCoorpacademyInformationIcon as InformationIcon\n} from '@coorpacademy/nova-icons';\nimport ToolTip, {toggleStateOnKeyPress} from '../tooltip';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport propTypes, {BattleOpponentProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponent = (\n {\n isAlreadyEngaged,\n isRandom,\n userAvatarSrc,\n onClick,\n displayName,\n tooltipText,\n 'aria-label': ariaLabel\n }: BattleOpponentProps,\n legacyContext: WebContextValues\n) => {\n const translate: Required<WebContextValues>['translate'] = GetTranslateFromContext(legacyContext);\n const wrapperClassnames = useMemo(\n () => classnames(style.card, style['opponent-card'], isRandom ? style.random : null),\n [isRandom]\n );\n\n const displayNameClassnames = useMemo(\n () => classnames(style.name, isAlreadyEngaged ? style.alreadyEngaged : null),\n [isAlreadyEngaged]\n );\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState<number | undefined>(undefined);\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n // to be replaced by useId when React17 is bumped to React18\n const [battleOpponentInfoId] = useState(\n isAlreadyEngaged ? uuidV5('engaged-battle-', uuidV5.URL) : undefined\n );\n\n const buttonRef = useRef(null);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n // @ts-expect-error (error: focus does not exists on type never)\n /* istanbul ignore next */ has(['current', 'focus'], buttonRef) && buttonRef.current.focus();\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(\n setTimeout(() => {\n setToolTipIsVisible(false);\n // @ts-expect-error (error: blur does not exists on type never)\n /* istanbul ignore next */ has(['current', 'blur'], buttonRef) && buttonRef.current.blur();\n }, 500) as unknown as number\n );\n }, []);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible, buttonRef)(event);\n },\n [toolTipIsVisible]\n );\n\n const TooltipContent = useCallback(\n _props => (\n <p\n {..._props}\n onMouseOver={handleMouseOver}\n onMouseLeave={handleMouseLeave}\n data-testid=\"battle-opponent-tooltip-content\"\n >\n {tooltipText}\n </p>\n ),\n [handleMouseLeave, handleMouseOver, tooltipText]\n );\n\n return (\n <li\n {...(!isAlreadyEngaged && {onClick})}\n className={wrapperClassnames}\n data-testid=\"battle-opponent-wrapper\"\n tabIndex={0}\n >\n <div className={style.avatar}>{isRandom ? null : <img src={userAvatarSrc} alt=\"\" />}</div>\n <p className={displayNameClassnames} tabIndex={0}>\n {displayName}\n </p>\n {isAlreadyEngaged ? (\n <>\n <button\n ref={buttonRef}\n tabIndex={0}\n type=\"button\"\n className={style.tooltipIconContainer}\n data-testid=\"battle-engaged-opponent-information-button\"\n onKeyDown={handleKeyPress}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n data-for={battleOpponentInfoId}\n data-tooltip-place=\"left\"\n data-tip={isAlreadyEngaged}\n aria-label={ariaLabel}\n >\n <InformationIcon className={style.informationIcon} width={20} height={20} />\n </button>\n <ToolTip\n fontSize={12}\n anchorId={battleOpponentInfoId}\n toolTipIsVisible={toolTipIsVisible}\n TooltipContent={TooltipContent}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n />\n </>\n ) : (\n <ArrowRight className={style.rightArrow} width={16} height={16} />\n )}\n </li>\n );\n};\n\nBattleOpponent.propTypes = propTypes;\n\nBattleOpponent.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default BattleOpponent;\n"],"mappings":";;AAAA,OAAOA,KAAP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AAC4C,iBAAT,CAA2B/B;AADV,CAA9B;AAIA,eAAeT,cAAf"}
@@ -0,0 +1,21 @@
1
+ import PropTypes from 'prop-types';
2
+ declare const propTypes: {
3
+ isAlreadyEngaged: PropTypes.Requireable<boolean>;
4
+ isRandom: PropTypes.Requireable<boolean>;
5
+ userAvatarSrc: PropTypes.Requireable<string>;
6
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
7
+ displayName: PropTypes.Requireable<string>;
8
+ tooltipText: PropTypes.Requireable<string>;
9
+ 'aria-label': PropTypes.Requireable<string>;
10
+ };
11
+ export declare type BattleOpponentProps = {
12
+ isAlreadyEngaged?: boolean;
13
+ isRandom?: boolean;
14
+ userAvatarSrc?: string;
15
+ onClick?: () => void;
16
+ displayName: string;
17
+ tooltipText?: string;
18
+ 'aria-label'?: string;
19
+ };
20
+ export default propTypes;
21
+ //# sourceMappingURL=prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/atom/battle-opponent/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;CAQd,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ import PropTypes from 'prop-types';
2
+ const propTypes = {
3
+ isAlreadyEngaged: PropTypes.bool,
4
+ isRandom: PropTypes.bool,
5
+ userAvatarSrc: PropTypes.string,
6
+ onClick: PropTypes.func,
7
+ displayName: PropTypes.string,
8
+ tooltipText: PropTypes.string,
9
+ 'aria-label': PropTypes.string
10
+ };
11
+ export default propTypes;
12
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.js","names":["PropTypes","propTypes","isAlreadyEngaged","bool","isRandom","userAvatarSrc","string","onClick","func","displayName","tooltipText"],"sources":["../../../src/atom/battle-opponent/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n isAlreadyEngaged: PropTypes.bool,\n isRandom: PropTypes.bool,\n userAvatarSrc: PropTypes.string,\n onClick: PropTypes.func,\n displayName: PropTypes.string,\n tooltipText: PropTypes.string,\n 'aria-label': PropTypes.string\n};\n\nexport type BattleOpponentProps = {\n isAlreadyEngaged?: boolean;\n isRandom?: boolean;\n userAvatarSrc?: string;\n onClick?: () => void;\n displayName: string;\n tooltipText?: string;\n 'aria-label'?: string;\n};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,MAAMC,SAAS,GAAG;EAChBC,gBAAgB,EAAEF,SAAS,CAACG,IADZ;EAEhBC,QAAQ,EAAEJ,SAAS,CAACG,IAFJ;EAGhBE,aAAa,EAAEL,SAAS,CAACM,MAHT;EAIhBC,OAAO,EAAEP,SAAS,CAACQ,IAJH;EAKhBC,WAAW,EAAET,SAAS,CAACM,MALP;EAMhBI,WAAW,EAAEV,SAAS,CAACM,MANP;EAOhB,cAAcN,SAAS,CAACM;AAPR,CAAlB;AAoBA,eAAeL,SAAf"}
@@ -0,0 +1,133 @@
1
+ @value breakpoints: "../../variables/breakpoints.css";
2
+ @value mobile from breakpoints;
3
+ @value colors: "../../variables/colors.css";
4
+ @value white from colors;
5
+ @value dark from colors;
6
+ @value black from colors;
7
+ @value cm_grey_75 from colors;
8
+ @value medium from colors;
9
+ @value light from colors;
10
+ @value brand from colors;
11
+
12
+ .rightArrow {
13
+ position: flex;
14
+ padding: 9px;
15
+ cursor: pointer;
16
+ opacity: 1;
17
+ user-select: none;
18
+ text-align: right;
19
+ color: dark;
20
+ }
21
+
22
+ .card {
23
+ margin: 5px;
24
+ }
25
+
26
+ .opponent-card {
27
+ flex: 1 1 350px;
28
+ height: 80px;
29
+ background-color: white;
30
+ box-shadow: 0 0 4px 1px rgba(0,0,0,0.10);
31
+ border-radius: 3px;
32
+ padding: 20px;
33
+ box-sizing: border-box;
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: space-between;
37
+ cursor: pointer;
38
+ }
39
+
40
+ .opponent-card .name {
41
+ font-family: 'Gilroy';
42
+ font-size: 15px;
43
+ font-weight: 700;
44
+ color: black;
45
+ flex-grow: 1;
46
+ }
47
+
48
+
49
+ .opponent-card .rightArrow {
50
+ margin-left: 20px;
51
+ }
52
+
53
+ .avatar {
54
+ width: 50px;
55
+ height: 50px;
56
+ border-radius: 50%;
57
+ overflow: hidden;
58
+ background-color: light;
59
+ margin-right: 20px;
60
+ flex-shrink: 0;
61
+ }
62
+
63
+ .avatar img {
64
+ width: 100%;
65
+ height: auto;
66
+ }
67
+
68
+
69
+ .random {
70
+ color: medium;
71
+ }
72
+
73
+ .alreadyEngaged.name,
74
+ .random .name {
75
+ color: medium;
76
+ }
77
+
78
+ .random .avatar {
79
+ background-color: brand;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ }
84
+
85
+ .random .avatar:before {
86
+ content: '?';
87
+ font-family: 'Gilroy';
88
+ font-size: 32px;
89
+ font-weight: 600;
90
+ color: white;
91
+ text-align: center;
92
+ }
93
+
94
+ .random .avatar img {
95
+ display: none;
96
+ }
97
+
98
+ .opponent-card:hover {
99
+ background-color: cm_grey_75;
100
+ }
101
+
102
+ .informationIcon {
103
+ color: cm_grey_500;
104
+ }
105
+
106
+ .tooltipIconContainer {
107
+ display: flex;
108
+ justify-content: flex-end;
109
+ border: none;
110
+ background: transparent;
111
+ height: 25px;
112
+ align-items: center;
113
+ }
114
+
115
+ @media mobile {
116
+ .opponent-card {
117
+ width: 100%;
118
+ padding: 10px;
119
+ }
120
+
121
+ .opponent-card .avatar {
122
+ margin-right: 10px;
123
+ }
124
+
125
+ .opponent-card .rightArrow {
126
+ margin-left: 10px;
127
+ }
128
+
129
+ .card {
130
+ margin: 0 0 10px;
131
+ }
132
+ }
133
+
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link-icon-only/index.js"],"names":[],"mappings":";AAiCA,6DA+CC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button-link-icon-only/index.js"],"names":[],"mappings":";AAkCA,6DA+CC"}
@@ -7,7 +7,8 @@ import React, { useMemo } from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import classnames from 'classnames';
9
9
  import { ICONS } from '../../util/button-icons';
10
- import Link from '../link';
10
+ import Link from '../link'; // eslint-disable-next-line css-modules/no-unused-class
11
+
11
12
  import style from './style.css';
12
13
 
13
14
  const getButtonContent = icon => {
@@ -51,7 +52,7 @@ const ButtonLinkIconOnly = props => {
51
52
  className
52
53
  } = props;
53
54
  const contentView = getButtonContent(icon);
54
- const styleButton = classnames(getSizeStyle(size), link && style.link, disabled && style.disabled, className);
55
+ const styleButton = classnames(getSizeStyle(size), link && style.link, disabled && style.disabled, style[className]);
55
56
  const handleOnClick = useMemo(() => () => onClick(), [onClick]);
56
57
 
57
58
  if (link) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","ICONS","Link","style","getButtonContent","icon","Icon","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIconOnly","props","disabled","dataName","ariaLabel","link","onClick","className","contentView","styleButton","handleOnClick","propTypes","oneOf","string","func","shape","href","download","bool","target"],"sources":["../../../src/atom/button-link-icon-only/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport Link from '../link';\nimport style from './style.css';\n\nconst getButtonContent = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n className\n );\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n title={ariaLabel}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLinkIconOnly.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport default ButtonLinkIconOnly;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,KAAP,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T,IAOGI,WAPH,CADF;EAWD;;EAED,oBACE;IACE,IAAI,EAAC,QADP;IAEE,cAAYJ,SAFd;IAGE,aAAWD,QAHb;IAIE,KAAK,EAAEC,SAJT;IAKE,SAAS,EAAEK,WALb;IAME,OAAO,EAAEC;EANX,GAQGF,WARH,CADF;AAYD,CA/CD;;AAiDAR,kBAAkB,CAACW,SAAnB,2CAA+B;EAC7Bf,IAAI,EAAEV,SAAS,CAAC0B,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,YAArB,CAAhB,CADuB;EAE7B,cAAc1B,SAAS,CAAC2B,MAFK;EAG7B,aAAa3B,SAAS,CAAC2B,MAHM;EAI7BrB,IAAI,EAAEN,SAAS,CAAC0B,KAAV,CAAgB,MAAKxB,KAAL,CAAhB,CAJuB;EAK7BkB,OAAO,EAAEpB,SAAS,CAAC4B,IALU;EAM7BT,IAAI,EAAEnB,SAAS,CAAC6B,KAAV,CAAgB;IACpBC,IAAI,EAAE9B,SAAS,CAAC2B,MADI;IAEpBI,QAAQ,EAAE/B,SAAS,CAACgC,IAFA;IAGpBC,MAAM,EAAEjC,SAAS,CAAC0B,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CANuB;EAW7BV,QAAQ,EAAEhB,SAAS,CAACgC,IAXS;EAY7BX,SAAS,EAAErB,SAAS,CAAC2B;AAZQ,CAA/B;AAeA,eAAeb,kBAAf"}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","ICONS","Link","style","getButtonContent","icon","Icon","buttonContent","getSizeStyle","size","small","responsive","default","ButtonLinkIconOnly","props","disabled","dataName","ariaLabel","link","onClick","className","contentView","styleButton","handleOnClick","propTypes","oneOf","string","func","shape","href","download","bool","target"],"sources":["../../../src/atom/button-link-icon-only/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport Link from '../link';\n// eslint-disable-next-line css-modules/no-unused-class\nimport style from './style.css';\n\nconst getButtonContent = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n};\n\nconst getSizeStyle = size => {\n switch (size) {\n case 'small':\n return style.small;\n case 'responsive':\n return style.responsive;\n default:\n return style.default;\n }\n};\n\nconst ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick,\n className\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n getSizeStyle(size),\n link && style.link,\n disabled && style.disabled,\n style[className]\n );\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {contentView}\n </Link>\n );\n }\n\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n title={ariaLabel}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLinkIconOnly.propTypes = {\n size: PropTypes.oneOf(['default', 'small', 'responsive']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool,\n className: PropTypes.string\n};\n\nexport default ButtonLinkIconOnly;\n"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,KAAR,QAAoB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;MAEE,SAAS,EAAEI,WAFb;MAGE,aAAWN,QAHb;MAIE,cAAYC,SAJd;MAKE,KAAK,EAAEA;IALT,IAOGI,WAPH,CADF;EAWD;;EAED,oBACE;IACE,IAAI,EAAC,QADP;IAEE,cAAYJ,SAFd;IAGE,aAAWD,QAHb;IAIE,KAAK,EAAEC,SAJT;IAKE,SAAS,EAAEK,WALb;IAME,OAAO,EAAEC;EANX,GAQGF,WARH,CADF;AAYD,CA/CD;;AAiDAR,kBAAkB,CAACW,SAAnB,2CAA+B;EAC7Bf,IAAI,EAAEV,SAAS,CAAC0B,KAAV,CAAgB,CAAC,SAAD,EAAY,OAAZ,EAAqB,YAArB,CAAhB,CADuB;EAE7B,cAAc1B,SAAS,CAAC2B,MAFK;EAG7B,aAAa3B,SAAS,CAAC2B,MAHM;EAI7BrB,IAAI,EAAEN,SAAS,CAAC0B,KAAV,CAAgB,MAAKxB,KAAL,CAAhB,CAJuB;EAK7BkB,OAAO,EAAEpB,SAAS,CAAC4B,IALU;EAM7BT,IAAI,EAAEnB,SAAS,CAAC6B,KAAV,CAAgB;IACpBC,IAAI,EAAE9B,SAAS,CAAC2B,MADI;IAEpBI,QAAQ,EAAE/B,SAAS,CAACgC,IAFA;IAGpBC,MAAM,EAAEjC,SAAS,CAAC0B,KAAV,CAAgB,CAAC,OAAD,EAAU,QAAV,EAAoB,SAApB,EAA+B,MAA/B,CAAhB;EAHY,CAAhB,CANuB;EAW7BV,QAAQ,EAAEhB,SAAS,CAACgC,IAXS;EAY7BX,SAAS,EAAErB,SAAS,CAAC2B;AAZQ,CAA/B;AAeA,eAAeb,kBAAf"}
@@ -91,3 +91,26 @@
91
91
  width: 12px;
92
92
  height: 12px;
93
93
  }
94
+
95
+ /* ----------------- CM bulk style ------------------------- */
96
+
97
+ .bulkArrowDown {
98
+ composes: button;
99
+ width: 24px;
100
+ height: 24px;
101
+ background-color: white;
102
+ border: 1px solid cm_grey_200;
103
+ border-radius: 5px;
104
+ padding: 10px;
105
+ opacity: 0.5;
106
+ }
107
+
108
+ .bulkArrowDown .icon {
109
+ width: 8px;
110
+ height: 8px;
111
+ }
112
+
113
+ .bulkArrowUp {
114
+ composes: bulkArrowDown;
115
+ transform: rotate(180deg);
116
+ }
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import { HeaderStepItemProps } from './types';
3
- declare const ReviewHeaderStepItem: {
4
- (props: HeaderStepItemProps): JSX.Element;
2
+ import { StatusItemProps } from './types';
3
+ declare const StatusItem: {
4
+ (props: StatusItemProps): JSX.Element;
5
5
  propTypes: {
6
6
  current: import("prop-types").Requireable<boolean>;
7
7
  icon: import("prop-types").Requireable<string>;
8
8
  value: import("prop-types").Requireable<string>;
9
9
  };
10
10
  };
11
- export default ReviewHeaderStepItem;
11
+ export default StatusItem;
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/status-item/index.tsx"],"names":[],"mappings":";AASA,OAAkB,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAqFnD,QAAA,MAAM,UAAU;YAAW,eAAe;;;;;;CAkBzC,CAAC;AAWF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,104 @@
1
+ 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); }
2
+
3
+ import React from 'react';
4
+ import classnames from 'classnames';
5
+ import { NovaCompositionCoorpacademyCheck as RightIcon, NovaSolidStatusClose as WrongIcon } from '@coorpacademy/nova-icons';
6
+ import Provider, { GetTranslateFromContext } from '../provider';
7
+ import style from './style.css';
8
+ import propTypes from './types';
9
+
10
+ const Content = (props, legacyContext) => {
11
+ const {
12
+ icon,
13
+ current,
14
+ value
15
+ } = props;
16
+ const translate = GetTranslateFromContext(legacyContext);
17
+ let child;
18
+ let contentAriaLabel;
19
+
20
+ switch (icon) {
21
+ case 'no-answer':
22
+ child = value;
23
+ contentAriaLabel = translate('review_header_step_item.not_answered_question', {
24
+ current: current ? 'current ' : '',
25
+ headerStepValue: value
26
+ });
27
+ break;
28
+
29
+ case 'right':
30
+ child = /*#__PURE__*/React.createElement(RightIcon, {
31
+ className: classnames(style.rightIcon, current && style.currentRightIcon),
32
+ role: "status",
33
+ "aria-label": translate('review_header_step_item.correct_question', {
34
+ current: current ? 'current ' : '',
35
+ headerStepValue: value
36
+ })
37
+ });
38
+ break;
39
+
40
+ case 'wrong':
41
+ child = /*#__PURE__*/React.createElement(WrongIcon, {
42
+ className: classnames(style.wrongIcon, current && style.currentWrongIcon),
43
+ role: "alert",
44
+ "aria-label": translate('review_header_step_item.incorrect_question', {
45
+ current: current ? 'current ' : '',
46
+ headerStepValue: value
47
+ })
48
+ });
49
+ break;
50
+
51
+ case 'errors-number':
52
+ child = value;
53
+ contentAriaLabel = translate('bulk_import.errors_number', {
54
+ bulkImportErrorsNumber: value
55
+ });
56
+ break;
57
+
58
+ case 'valid':
59
+ child = /*#__PURE__*/React.createElement(RightIcon, {
60
+ className: classnames(style.validIcon),
61
+ role: "status",
62
+ "aria-label": translate('bulk_import.valid_scorm')
63
+ });
64
+ break;
65
+
66
+ case 'invalid':
67
+ child = /*#__PURE__*/React.createElement(WrongIcon, {
68
+ className: classnames(style.invalidIcon),
69
+ role: "alert",
70
+ "aria-label": translate('bulk_import.invalid_scorm')
71
+ });
72
+ break;
73
+
74
+ default:
75
+ return null;
76
+ }
77
+
78
+ return /*#__PURE__*/React.createElement("span", _extends({}, icon === 'no-answer' || icon === 'errors-number' ? {
79
+ 'aria-label': contentAriaLabel,
80
+ role: 'status'
81
+ } : {}, {
82
+ className: style.value
83
+ }), child);
84
+ };
85
+
86
+ const StatusItem = props => {
87
+ const {
88
+ icon,
89
+ current
90
+ } = props;
91
+ return /*#__PURE__*/React.createElement("div", {
92
+ className: classnames(style.default, icon === 'right' && style.right, icon === 'wrong' && style.wrong, current && style.current, icon === 'valid' && style.valid, icon === 'invalid' && style.invalid, icon === 'errors-number' && style.errorsNumber),
93
+ "data-name": "status-item"
94
+ }, /*#__PURE__*/React.createElement(Content, props));
95
+ };
96
+
97
+ Content.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
98
+ Content.contextTypes = {
99
+ skin: Provider.childContextTypes.skin,
100
+ translate: Provider.childContextTypes.translate
101
+ };
102
+ StatusItem.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
103
+ export default StatusItem;
104
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["React","classnames","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","Provider","GetTranslateFromContext","style","propTypes","Content","props","legacyContext","icon","current","value","translate","child","contentAriaLabel","headerStepValue","rightIcon","currentRightIcon","wrongIcon","currentWrongIcon","bulkImportErrorsNumber","validIcon","invalidIcon","role","StatusItem","default","right","wrong","valid","invalid","errorsNumber","contextTypes","skin","childContextTypes"],"sources":["../../../src/atom/status-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport Provider, {GetTranslateFromContext} from '../provider';\nimport {WebContextValues} from '../provider/web-context';\nimport style from './style.css';\nimport propTypes, {StatusItemProps} from './types';\n\nconst Content = (props: StatusItemProps, legacyContext: WebContextValues) => {\n const {icon, current, value} = props;\n const translate = GetTranslateFromContext(legacyContext);\n let child;\n let contentAriaLabel;\n switch (icon) {\n case 'no-answer':\n child = value;\n contentAriaLabel = translate('review_header_step_item.not_answered_question', {\n current: current ? 'current ' : '',\n headerStepValue: value\n });\n break;\n\n case 'right':\n child = (\n <RightIcon\n className={classnames(style.rightIcon, current && style.currentRightIcon)}\n role=\"status\"\n aria-label={translate('review_header_step_item.correct_question', {\n current: current ? 'current ' : '',\n headerStepValue: value\n })}\n />\n );\n break;\n\n case 'wrong':\n child = (\n <WrongIcon\n className={classnames(style.wrongIcon, current && style.currentWrongIcon)}\n role=\"alert\"\n aria-label={translate('review_header_step_item.incorrect_question', {\n current: current ? 'current ' : '',\n headerStepValue: value\n })}\n />\n );\n break;\n\n case 'errors-number':\n child = value;\n contentAriaLabel = translate('bulk_import.errors_number', {\n bulkImportErrorsNumber: value\n });\n break;\n\n case 'valid':\n child = (\n <RightIcon\n className={classnames(style.validIcon)}\n role=\"status\"\n aria-label={translate('bulk_import.valid_scorm')}\n />\n );\n break;\n\n case 'invalid':\n child = (\n <WrongIcon\n className={classnames(style.invalidIcon)}\n role=\"alert\"\n aria-label={translate('bulk_import.invalid_scorm')}\n />\n );\n break;\n\n default:\n return null;\n }\n\n return (\n <span\n {...(icon === 'no-answer' || icon === 'errors-number'\n ? {'aria-label': contentAriaLabel, role: 'status'}\n : {})}\n className={style.value}\n >\n {child}\n </span>\n );\n};\n\nconst StatusItem = (props: StatusItemProps) => {\n const {icon, current} = props;\n return (\n <div\n className={classnames(\n style.default,\n icon === 'right' && style.right,\n icon === 'wrong' && style.wrong,\n current && style.current,\n icon === 'valid' && style.valid,\n icon === 'invalid' && style.invalid,\n icon === 'errors-number' && style.errorsNumber\n )}\n data-name=\"status-item\"\n >\n <Content {...props} />\n </div>\n );\n};\n\nContent.propTypes = propTypes;\n\nContent.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nStatusItem.propTypes = propTypes;\n\nexport default StatusItem;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,gCAAgC,IAAIC,SADtC,EAEEC,oBAAoB,IAAIC,SAF1B,QAGO,0BAHP;AAIA,OAAOC,QAAP,IAAkBC,uBAAlB,QAAgD,aAAhD;AAEA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,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,GAAuB;EACrBC,IAAI,EAAE9B,QAAQ,CAAC+B,iBAAT,CAA2BD,IADZ;EAErBpB,SAAS,EAAEV,QAAQ,CAAC+B,iBAAT,CAA2BrB;AAFjB,CAAvB;AAKAY,UAAU,CAACnB,SAAX,2CAAuBA,SAAvB;AAEA,eAAemB,UAAf"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { StatusItemProps } from './types';
3
+ declare const Step: ({ value, icon, current }: StatusItemProps) => JSX.Element | null;
4
+ export default Step;
5
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../../../src/atom/status-item/index.native.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AA6CxC,QAAA,MAAM,IAAI,6BAA4B,eAAe,uBA2BpD,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';
3
3
  import { NovaCompositionCoorpacademyCheck as RightIcon, NovaSolidStatusClose as WrongIcon } from '@coorpacademy/nova-icons';
4
4
  import { COLORS } from '../../variables/colors';
5
5
 
6
- const createStyle = (current, icon) => {
6
+ const createStyle = (icon, current) => {
7
7
  let backgroundColor;
8
8
 
9
9
  switch (icon) {
@@ -49,7 +49,7 @@ const Step = ({
49
49
  }) => {
50
50
  const [style, setStyle] = useState(null);
51
51
  useEffect(() => {
52
- const _style = createStyle(current, icon);
52
+ const _style = createStyle(icon, current);
53
53
 
54
54
  setStyle(_style);
55
55
  }, [current, icon]);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","names":["React","useEffect","useState","StyleSheet","Text","View","NovaCompositionCoorpacademyCheck","RightIcon","NovaSolidStatusClose","WrongIcon","COLORS","createStyle","icon","current","backgroundColor","positive","negative","gray","create","step","width","height","opacity","marginHorizontal","alignItems","justifyContent","borderRadius","stepText","fontWeight","fontSize","Step","value","style","setStyle","_style","child"],"sources":["../../../src/atom/status-item/index.native.tsx"],"sourcesContent":["import React, {useEffect, useState} from 'react';\nimport {StyleSheet, Text, TextStyle, View, ViewStyle} from 'react-native';\nimport {\n NovaCompositionCoorpacademyCheck as RightIcon,\n NovaSolidStatusClose as WrongIcon\n} from '@coorpacademy/nova-icons';\nimport {COLORS} from '../../variables/colors';\nimport {StatusItemProps} from './types';\n\ntype StyleSheetType = {\n step: ViewStyle;\n stepText: TextStyle;\n icon: ViewStyle;\n};\n\nconst createStyle = (icon: StatusItemProps['icon'], current?: boolean): StyleSheetType => {\n let backgroundColor;\n\n switch (icon) {\n case 'right':\n backgroundColor = COLORS.positive;\n break;\n case 'wrong':\n backgroundColor = COLORS.negative;\n break;\n case 'no-answer':\n default:\n backgroundColor = COLORS.gray;\n }\n\n return StyleSheet.create({\n step: {\n width: current ? 40 : 32,\n height: current ? 40 : 32,\n opacity: current ? 1 : 0.5,\n marginHorizontal: 8,\n backgroundColor,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 50\n },\n stepText: {\n fontWeight: '600',\n fontSize: current ? 16 : 12\n },\n icon: {\n width: current ? 14 : 12,\n height: current ? 14 : 12\n }\n });\n};\n\nconst Step = ({value, icon, current}: StatusItemProps) => {\n const [style, setStyle] = useState<StyleSheetType | null>(null);\n\n useEffect(() => {\n const _style = createStyle(icon, current);\n setStyle(_style);\n }, [current, icon]);\n\n if (!style) {\n return null;\n }\n\n let child;\n\n switch (icon) {\n case 'right':\n child = <RightIcon style={style.icon} color=\"#fff\" />;\n break;\n case 'wrong':\n child = <WrongIcon style={style.icon} color=\"#fff\" />;\n break;\n case 'no-answer':\n default:\n child = <Text style={style.stepText}>{value}</Text>;\n }\n\n return <View style={style.step}>{child}</View>;\n};\n\nexport default Step;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,SAAf,EAA0BC,QAA1B,QAAyC,OAAzC;AACA,SAAQC,UAAR,EAAoBC,IAApB,EAAqCC,IAArC,QAA2D,cAA3D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AAD,EAAOC,OAAP,CAA1B;;IACAoB,QAAQ,CAACC,MAAD,CAAR;EACD,CAHQ,EAGN,CAACrB,OAAD,EAAUD,IAAV,CAHM,CAAT;;EAKA,IAAI,CAACoB,KAAL,EAAY;IACV,OAAO,IAAP;EACD;;EAED,IAAIG,KAAJ;;EAEA,QAAQvB,IAAR;IACE,KAAK,OAAL;MACEuB,KAAK,gBAAG,oBAAC,SAAD;QAAW,KAAK,EAAEH,KAAK,CAACpB,IAAxB;QAA8B,KAAK,EAAC;MAApC,EAAR;MACA;;IACF,KAAK,OAAL;MACEuB,KAAK,gBAAG,oBAAC,SAAD;QAAW,KAAK,EAAEH,KAAK,CAACpB,IAAxB;QAA8B,KAAK,EAAC;MAApC,EAAR;MACA;;IACF,KAAK,WAAL;IACA;MACEuB,KAAK,gBAAG,oBAAC,IAAD;QAAM,KAAK,EAAEH,KAAK,CAACL;MAAnB,GAA8BI,KAA9B,CAAR;EATJ;;EAYA,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAEC,KAAK,CAACb;EAAnB,GAA0BgB,KAA1B,CAAP;AACD,CA3BD;;AA6BA,eAAeL,IAAf"}
@@ -3,6 +3,12 @@
3
3
  @value cm_positive_100 from colors;
4
4
  @value cm_negative_100 from colors;
5
5
  @value white from colors;
6
+ @value positive from colors;
7
+ @value negative from colors;
8
+ @value cm_negative_50 from colors;
9
+ @value cm_green_secondary_200 from colors;
10
+ @value cm_green_secondary_100 from colors;
11
+ @value cm_pink_50 from colors;
6
12
 
7
13
  .default {
8
14
  width: 32px;
@@ -62,4 +68,45 @@
62
68
  transform: scale(1.5);
63
69
  }
64
70
 
71
+ /* ----------------- CM bulk theme ------------------------- */
65
72
 
73
+
74
+ .valid {
75
+ opacity: 1;
76
+ width: 24px;
77
+ height: 24px;
78
+ background-color: cm_green_secondary_100;
79
+ }
80
+
81
+ .validIcon {
82
+ color: cm_green_secondary_200;
83
+ width: 12px;
84
+ height: 10px;
85
+ transition: transform 0.25s ease;
86
+ }
87
+
88
+ .invalid {
89
+ opacity: 1;
90
+ width: 24px;
91
+ height: 24px;
92
+ background-color: cm_negative_50;
93
+ }
94
+
95
+ .invalidIcon {
96
+ color: cm_negative_100;
97
+ width: 10px;
98
+ height: 10px;
99
+ transition: color 0.25s ease;
100
+ }
101
+
102
+ .errorsNumber {
103
+ opacity: 1;
104
+ width: 24px;
105
+ height: 24px;
106
+ background-color: cm_pink_50;
107
+ color: cm_negative_100;
108
+ font-family: 'Gilroy';
109
+ font-style: normal;
110
+ font-weight: 600;
111
+ font-size: 14px;
112
+ }