@coorpacademy/components 11.11.5-alpha.0 → 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.
- package/es/atom/battle-opponent/index.d.ts +20 -0
- package/es/atom/battle-opponent/index.d.ts.map +1 -0
- package/es/atom/battle-opponent/index.js +104 -0
- package/es/atom/battle-opponent/index.js.map +1 -0
- package/es/atom/battle-opponent/prop-types.d.ts +21 -0
- package/es/atom/battle-opponent/prop-types.d.ts.map +1 -0
- package/es/atom/battle-opponent/prop-types.js +12 -0
- package/es/atom/battle-opponent/prop-types.js.map +1 -0
- package/es/atom/battle-opponent/style.css +133 -0
- package/es/atom/{review-header-step-item → status-item}/index.d.ts +4 -4
- package/es/atom/status-item/index.d.ts.map +1 -0
- package/es/atom/status-item/index.js +104 -0
- package/es/atom/status-item/index.js.map +1 -0
- package/es/atom/status-item/index.native.d.ts +5 -0
- package/es/atom/status-item/index.native.d.ts.map +1 -0
- package/es/atom/{review-header-step-item → status-item}/index.native.js +2 -2
- package/es/atom/status-item/index.native.js.map +1 -0
- package/es/atom/{review-header-step-item → status-item}/style.css +47 -0
- package/es/atom/{review-header-step-item → status-item}/types.d.ts +5 -5
- package/es/atom/status-item/types.d.ts.map +1 -0
- package/es/atom/{review-header-step-item → status-item}/types.js +1 -1
- package/es/atom/status-item/types.js.map +1 -0
- package/es/atom/tooltip/index.d.ts +3 -1
- package/es/atom/tooltip/index.d.ts.map +1 -1
- package/es/atom/tooltip/index.js +18 -7
- package/es/atom/tooltip/index.js.map +1 -1
- package/es/atom/tooltip/style.css +11 -2
- package/es/globals.d.js.map +1 -1
- package/es/molecule/battle-opponent-list/index.d.ts +18 -0
- package/es/molecule/battle-opponent-list/index.d.ts.map +1 -0
- package/es/molecule/battle-opponent-list/index.js +25 -0
- package/es/molecule/battle-opponent-list/index.js.map +1 -0
- package/es/molecule/battle-opponent-list/prop-types.d.ts +26 -0
- package/es/molecule/battle-opponent-list/prop-types.d.ts.map +1 -0
- package/es/molecule/battle-opponent-list/prop-types.js +14 -0
- package/es/molecule/battle-opponent-list/prop-types.js.map +1 -0
- package/es/molecule/battle-opponent-list/style.css +5 -0
- package/es/molecule/review-header-steps/index.js +2 -2
- package/es/molecule/review-header-steps/index.js.map +1 -1
- package/es/molecule/review-header-steps/prop-types.d.ts +2 -2
- package/es/molecule/review-header-steps/prop-types.d.ts.map +1 -1
- package/es/molecule/review-header-steps/prop-types.js +1 -1
- package/es/molecule/review-header-steps/prop-types.js.map +1 -1
- package/es/organism/review-header/index.native.js +1 -1
- package/es/organism/review-header/index.native.js.map +1 -1
- package/es/organism/review-header/types.d.ts +2 -2
- package/es/organism/review-header/types.d.ts.map +1 -1
- package/es/organism/review-header/types.js.map +1 -1
- package/es/organism/user-preferences/index.d.ts.map +1 -1
- package/es/organism/user-preferences/index.js +6 -3
- package/es/organism/user-preferences/index.js.map +1 -1
- package/es/variables/colors.css +2 -0
- package/lib/atom/battle-opponent/index.d.ts +20 -0
- package/lib/atom/battle-opponent/index.d.ts.map +1 -0
- package/lib/atom/battle-opponent/index.js +124 -0
- package/lib/atom/battle-opponent/index.js.map +1 -0
- package/lib/atom/battle-opponent/prop-types.d.ts +21 -0
- package/lib/atom/battle-opponent/prop-types.d.ts.map +1 -0
- package/lib/atom/battle-opponent/prop-types.js +21 -0
- package/lib/atom/battle-opponent/prop-types.js.map +1 -0
- package/lib/atom/battle-opponent/style.css +133 -0
- package/lib/atom/{review-header-step-item → status-item}/index.d.ts +4 -4
- package/lib/atom/status-item/index.d.ts.map +1 -0
- package/lib/atom/{review-header-step-item → status-item}/index.js +50 -23
- package/lib/atom/status-item/index.js.map +1 -0
- package/lib/atom/status-item/index.native.d.ts +5 -0
- package/lib/atom/status-item/index.native.d.ts.map +1 -0
- package/lib/atom/{review-header-step-item → status-item}/index.native.js +2 -2
- package/lib/atom/status-item/index.native.js.map +1 -0
- package/lib/atom/{review-header-step-item → status-item}/style.css +47 -0
- package/lib/atom/{review-header-step-item → status-item}/types.d.ts +5 -5
- package/lib/atom/status-item/types.d.ts.map +1 -0
- package/lib/atom/{review-header-step-item → status-item}/types.js +1 -1
- package/lib/atom/status-item/types.js.map +1 -0
- package/lib/atom/tooltip/index.d.ts +3 -1
- package/lib/atom/tooltip/index.d.ts.map +1 -1
- package/lib/atom/tooltip/index.js +19 -7
- package/lib/atom/tooltip/index.js.map +1 -1
- package/lib/atom/tooltip/style.css +11 -2
- package/lib/globals.d.js.map +1 -1
- package/lib/molecule/battle-opponent-list/index.d.ts +18 -0
- package/lib/molecule/battle-opponent-list/index.d.ts.map +1 -0
- package/lib/molecule/battle-opponent-list/index.js +43 -0
- package/lib/molecule/battle-opponent-list/index.js.map +1 -0
- package/lib/molecule/battle-opponent-list/prop-types.d.ts +26 -0
- package/lib/molecule/battle-opponent-list/prop-types.d.ts.map +1 -0
- package/lib/molecule/battle-opponent-list/prop-types.js +23 -0
- package/lib/molecule/battle-opponent-list/prop-types.js.map +1 -0
- package/lib/molecule/battle-opponent-list/style.css +5 -0
- package/lib/molecule/review-header-steps/index.js +2 -2
- package/lib/molecule/review-header-steps/index.js.map +1 -1
- package/lib/molecule/review-header-steps/prop-types.d.ts +2 -2
- package/lib/molecule/review-header-steps/prop-types.d.ts.map +1 -1
- package/lib/molecule/review-header-steps/prop-types.js +1 -1
- package/lib/molecule/review-header-steps/prop-types.js.map +1 -1
- package/lib/organism/review-header/index.native.js +1 -1
- package/lib/organism/review-header/index.native.js.map +1 -1
- package/lib/organism/review-header/types.d.ts +2 -2
- package/lib/organism/review-header/types.d.ts.map +1 -1
- package/lib/organism/review-header/types.js.map +1 -1
- package/lib/organism/user-preferences/index.d.ts.map +1 -1
- package/lib/organism/user-preferences/index.js +10 -3
- package/lib/organism/user-preferences/index.js.map +1 -1
- package/lib/variables/colors.css +2 -0
- package/locales/bs/global.json +0 -2
- package/locales/cs/global.json +0 -2
- package/locales/de/global.json +0 -2
- package/locales/en/global.json +8 -5
- package/locales/es/global.json +0 -2
- package/locales/et/global.json +0 -2
- package/locales/fr/global.json +0 -2
- package/locales/hr/global.json +0 -2
- package/locales/hu/global.json +0 -2
- package/locales/hy/global.json +0 -2
- package/locales/it/global.json +0 -2
- package/locales/ja/global.json +0 -2
- package/locales/ko/global.json +0 -2
- package/locales/nl/global.json +0 -2
- package/locales/pl/global.json +0 -2
- package/locales/pt/global.json +0 -2
- package/locales/ro/global.json +0 -2
- package/locales/ru/global.json +0 -2
- package/locales/sk/global.json +0 -2
- package/locales/th/global.json +0 -2
- package/locales/tl/global.json +0 -2
- package/locales/tr/global.json +0 -2
- package/locales/uk/global.json +0 -2
- package/locales/vi/global.json +0 -2
- package/locales/zh/global.json +0 -2
- package/locales/zh_TW/global.json +0 -2
- package/package.json +3 -2
- package/es/atom/review-header-step-item/index.d.ts.map +0 -1
- package/es/atom/review-header-step-item/index.js +0 -77
- package/es/atom/review-header-step-item/index.js.map +0 -1
- package/es/atom/review-header-step-item/index.native.d.ts +0 -5
- package/es/atom/review-header-step-item/index.native.d.ts.map +0 -1
- package/es/atom/review-header-step-item/index.native.js.map +0 -1
- package/es/atom/review-header-step-item/types.d.ts.map +0 -1
- package/es/atom/review-header-step-item/types.js.map +0 -1
- package/lib/atom/review-header-step-item/index.d.ts.map +0 -1
- package/lib/atom/review-header-step-item/index.js.map +0 -1
- package/lib/atom/review-header-step-item/index.native.d.ts +0 -5
- package/lib/atom/review-header-step-item/index.native.d.ts.map +0 -1
- package/lib/atom/review-header-step-item/index.native.js.map +0 -1
- package/lib/atom/review-header-step-item/types.d.ts.map +0 -1
- package/lib/atom/review-header-step-item/types.js.map +0 -1
package/es/atom/tooltip/index.js
CHANGED
|
@@ -3,19 +3,25 @@ import classnames from 'classnames';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import ReactTooltip from 'react-tooltip';
|
|
5
5
|
import isString from 'lodash/fp/isString';
|
|
6
|
+
import keys from 'lodash/fp/keys';
|
|
6
7
|
import { NovaCompositionCoorpacademyInformationIcon as InformationIcon } from '@coorpacademy/nova-icons';
|
|
7
8
|
import style from './style.css';
|
|
8
9
|
const FontSizes = {
|
|
9
10
|
12: style.tooltipContentFontSize12,
|
|
10
11
|
14: style.tooltipContentFontSize14
|
|
11
12
|
};
|
|
13
|
+
const IconSizes = {
|
|
14
|
+
small: 12,
|
|
15
|
+
big: 20
|
|
16
|
+
};
|
|
12
17
|
|
|
13
18
|
const ToolTipWrapper = ({
|
|
14
19
|
toolTipIsVisible,
|
|
15
20
|
anchorId,
|
|
16
21
|
closeToolTipInformationTextAriaLabel,
|
|
17
22
|
content,
|
|
18
|
-
handleContentMouseOver
|
|
23
|
+
handleContentMouseOver,
|
|
24
|
+
iconSize
|
|
19
25
|
}) => {
|
|
20
26
|
if (!toolTipIsVisible) return null;
|
|
21
27
|
|
|
@@ -30,7 +36,7 @@ const ToolTipWrapper = ({
|
|
|
30
36
|
}, content);
|
|
31
37
|
} else {
|
|
32
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
className: style.toolTip,
|
|
39
|
+
className: classnames(style.toolTip, iconSize === 'big' ? style.bigIconToolTip : style.smallIconToolTip),
|
|
34
40
|
"data-testid": "tooltip",
|
|
35
41
|
"aria-label": closeToolTipInformationTextAriaLabel,
|
|
36
42
|
onMouseOver: handleContentMouseOver
|
|
@@ -43,7 +49,8 @@ ToolTipWrapper.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
43
49
|
anchorId: PropTypes.string,
|
|
44
50
|
closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,
|
|
45
51
|
content: PropTypes.node,
|
|
46
|
-
handleContentMouseOver: PropTypes.func
|
|
52
|
+
handleContentMouseOver: PropTypes.func,
|
|
53
|
+
iconSize: PropTypes.oneOf(keys(IconSizes))
|
|
47
54
|
} : {};
|
|
48
55
|
export const toggleStateOnKeyPress = (state, setState, ref) => event => {
|
|
49
56
|
if (event.key === 'Enter') {
|
|
@@ -65,7 +72,8 @@ const ToolTip = ({
|
|
|
65
72
|
toolTipIsVisible: _toolTipIsVisible,
|
|
66
73
|
iconContainerClassName,
|
|
67
74
|
delayHide = 250,
|
|
68
|
-
fontSize = 14
|
|
75
|
+
fontSize = 14,
|
|
76
|
+
iconSize = 'small'
|
|
69
77
|
}) => {
|
|
70
78
|
const isComponent = useMemo(() => !isString(TooltipContent) && /*#__PURE__*/isValidElement(TooltipContent()), [TooltipContent]);
|
|
71
79
|
const [toolTipIsVisible, setToolTipIsVisible] = useState(false);
|
|
@@ -110,8 +118,8 @@ const ToolTip = ({
|
|
|
110
118
|
tabIndex: 0
|
|
111
119
|
}, /*#__PURE__*/React.createElement(InformationIcon, {
|
|
112
120
|
className: style.informationIcon,
|
|
113
|
-
width:
|
|
114
|
-
height:
|
|
121
|
+
width: IconSizes[iconSize],
|
|
122
|
+
height: IconSizes[iconSize],
|
|
115
123
|
"aria-label": ariaLabel
|
|
116
124
|
})), /*#__PURE__*/React.createElement(ToolTipWrapper, {
|
|
117
125
|
toolTipIsVisible: toolTipIsVisible,
|
|
@@ -119,7 +127,8 @@ const ToolTip = ({
|
|
|
119
127
|
closeToolTipInformationTextAriaLabel: closeToolTipInformationTextAriaLabel,
|
|
120
128
|
content: content,
|
|
121
129
|
handleContentMouseOver: handleContentMouseOver,
|
|
122
|
-
fontSize: fontSize
|
|
130
|
+
fontSize: fontSize,
|
|
131
|
+
iconSize: iconSize
|
|
123
132
|
}));
|
|
124
133
|
};
|
|
125
134
|
|
|
@@ -132,9 +141,11 @@ ToolTip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
132
141
|
iconContainerClassName: PropTypes.string,
|
|
133
142
|
delayHide: PropTypes.number,
|
|
134
143
|
fontSize: PropTypes.oneOf([12, 14]),
|
|
144
|
+
iconSize: PropTypes.oneOf(keys(IconSizes)),
|
|
135
145
|
// ---------- React Tooltip exclusive --------------
|
|
136
146
|
// externalHandling: if passed down, React Tooltip is used instead, due to limitations on
|
|
137
147
|
// parents overflow hidden controls
|
|
148
|
+
// data-for={anchorId} && data-tooltip-place="left" are needed on the anchored component
|
|
138
149
|
anchorId: PropTypes.string,
|
|
139
150
|
toolTipIsVisible: PropTypes.bool
|
|
140
151
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","classnames","PropTypes","ReactTooltip","isString","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","FontSizes","tooltipContentFontSize12","tooltipContentFontSize14","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","toolTipReact","toolTip","propTypes","bool","string","isRequired","node","func","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number","oneOf"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={style.toolTip}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={12}\n height={12}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAA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AEE,QAAQ,EAAEC,QAFZ;IAGE,oCAAoC,EAAEC,oCAHxC;IAIE,OAAO,EAAEC,OAJX;IAKE,sBAAsB,EAAEC,sBAL1B;IAME,QAAQ,EAAE0B;EANZ,EAnBF,CAXF;AAwCD,CAxFD;;AA0FAP,OAAO,CAAChB,SAAR,2CAAoB;EAClBiB,cAAc,EAAElC,SAAS,CAACuD,SAAV,CAAoB,CAACvD,SAAS,CAACsB,IAAX,EAAiBtB,SAAS,CAACqB,IAA3B,EAAiCrB,SAAS,CAACmB,MAA3C,CAApB,CADE;EAElB,eAAenB,SAAS,CAACmB,MAFP;EAGlB,cAAcnB,SAAS,CAACmB,MAHN;EAIlBP,oCAAoC,EAAEZ,SAAS,CAACmB,MAAV,CAAiBC,UAJrC;EAKlB;EACAkB,sBAAsB,EAAEtC,SAAS,CAACmB,MANhB;EAOlBoB,SAAS,EAAEvC,SAAS,CAACwD,MAPH;EAQlBhB,QAAQ,EAAExC,SAAS,CAACyD,KAAV,CAAgB,CAAC,EAAD,EAAK,EAAL,CAAhB,CARQ;EASlB;EACA;EACA;EACA9C,QAAQ,EAAEX,SAAS,CAACmB,MAZF;EAalBT,gBAAgB,EAAEV,SAAS,CAACkB;AAbV,CAApB;AAgBA,eAAee,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","isValidElement","useState","useCallback","useMemo","classnames","PropTypes","ReactTooltip","isString","keys","NovaCompositionCoorpacademyInformationIcon","InformationIcon","style","FontSizes","tooltipContentFontSize12","tooltipContentFontSize14","IconSizes","small","big","ToolTipWrapper","toolTipIsVisible","anchorId","closeToolTipInformationTextAriaLabel","content","handleContentMouseOver","iconSize","toolTipReact","toolTip","bigIconToolTip","smallIconToolTip","propTypes","bool","string","isRequired","node","func","oneOf","toggleStateOnKeyPress","state","setState","ref","event","key","current","focus","stopPropagation","preventDefault","ToolTip","TooltipContent","ariaLabel","dataTestId","_toolTipIsVisible","iconContainerClassName","delayHide","fontSize","isComponent","setToolTipIsVisible","mouseLeaveTimer","setMouseLeaveTimer","undefined","handleKeyPress","clearTimeout","handleMouseOver","handleMouseLeave","setTimeout","tooltipContent","tooltipContainer","tooltipIconContainer","informationIcon","oneOfType","number"],"sources":["../../../src/atom/tooltip/index.js"],"sourcesContent":["import React, {isValidElement, useState, useCallback, useMemo} from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport ReactTooltip from 'react-tooltip';\nimport isString from 'lodash/fp/isString';\nimport keys from 'lodash/fp/keys';\nimport {NovaCompositionCoorpacademyInformationIcon as InformationIcon} from '@coorpacademy/nova-icons';\nimport style from './style.css';\n\nconst FontSizes = {\n 12: style.tooltipContentFontSize12,\n 14: style.tooltipContentFontSize14\n};\n\nconst IconSizes = {\n small: 12,\n big: 20\n};\n\nconst ToolTipWrapper = ({\n toolTipIsVisible,\n anchorId,\n closeToolTipInformationTextAriaLabel,\n content,\n handleContentMouseOver,\n iconSize\n}) => {\n if (!toolTipIsVisible) return null;\n if (anchorId) {\n return (\n <ReactTooltip\n id={anchorId}\n className={style.toolTipReact}\n data-event-off=\"click\"\n place=\"left\"\n effect=\"solid\"\n aria-label={closeToolTipInformationTextAriaLabel}\n >\n {content}\n </ReactTooltip>\n );\n } else {\n return (\n <div\n className={classnames(\n style.toolTip,\n iconSize === 'big' ? style.bigIconToolTip : style.smallIconToolTip\n )}\n data-testid=\"tooltip\"\n aria-label={closeToolTipInformationTextAriaLabel}\n onMouseOver={handleContentMouseOver}\n >\n {content}\n </div>\n );\n }\n};\n\nToolTipWrapper.propTypes = {\n toolTipIsVisible: PropTypes.bool,\n anchorId: PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n content: PropTypes.node,\n handleContentMouseOver: PropTypes.func,\n iconSize: PropTypes.oneOf(keys(IconSizes))\n};\n\nexport const toggleStateOnKeyPress = (state, setState, ref) => event => {\n if (event.key === 'Enter') {\n if (ref) ref.current.focus();\n event.stopPropagation();\n event.preventDefault();\n setState(!state);\n } else if (event.key === 'Tab' || event.key === 'Escape') {\n setState(false);\n }\n};\n\nconst ToolTip = ({\n anchorId,\n TooltipContent,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestId,\n closeToolTipInformationTextAriaLabel,\n toolTipIsVisible: _toolTipIsVisible,\n iconContainerClassName,\n delayHide = 250,\n fontSize = 14,\n iconSize = 'small'\n}) => {\n const isComponent = useMemo(\n () => !isString(TooltipContent) && isValidElement(TooltipContent()),\n [TooltipContent]\n );\n\n const [toolTipIsVisible, setToolTipIsVisible] = useState(false);\n\n const [mouseLeaveTimer, setMouseLeaveTimer] = useState(undefined);\n\n const handleKeyPress = useCallback(\n event => {\n toggleStateOnKeyPress(toolTipIsVisible, setToolTipIsVisible)(event);\n },\n [toolTipIsVisible]\n );\n\n const handleContentMouseOver = useCallback(() => {\n mouseLeaveTimer && /* istanbul ignore next */ clearTimeout(mouseLeaveTimer);\n }, [mouseLeaveTimer]);\n\n const handleMouseOver = useCallback(() => {\n mouseLeaveTimer && clearTimeout(mouseLeaveTimer);\n setToolTipIsVisible(true);\n }, [mouseLeaveTimer]);\n\n const handleMouseLeave = useCallback(() => {\n setMouseLeaveTimer(setTimeout(() => setToolTipIsVisible(false), delayHide));\n }, [delayHide]);\n\n const content = useMemo(() => {\n return isComponent ? (\n <TooltipContent />\n ) : (\n <p className={classnames([style.tooltipContent, FontSizes[fontSize]])}>{TooltipContent}</p>\n );\n }, [TooltipContent, fontSize, isComponent]);\n\n return anchorId ? (\n <ToolTipWrapper\n toolTipIsVisible={_toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n fontSize={fontSize}\n />\n ) : (\n <div\n className={style.tooltipContainer}\n onMouseLeave={handleMouseLeave}\n onMouseOver={handleMouseOver}\n >\n <button\n type=\"button\"\n className={classnames([style.tooltipIconContainer, iconContainerClassName])}\n data-testid={dataTestId}\n onKeyDown={handleKeyPress}\n tabIndex={0}\n >\n <InformationIcon\n className={style.informationIcon}\n width={IconSizes[iconSize]}\n height={IconSizes[iconSize]}\n aria-label={ariaLabel}\n />\n </button>\n <ToolTipWrapper\n toolTipIsVisible={toolTipIsVisible}\n anchorId={anchorId}\n closeToolTipInformationTextAriaLabel={closeToolTipInformationTextAriaLabel}\n content={content}\n handleContentMouseOver={handleContentMouseOver}\n fontSize={fontSize}\n iconSize={iconSize}\n />\n </div>\n );\n};\n\nToolTip.propTypes = {\n TooltipContent: PropTypes.oneOfType([PropTypes.func, PropTypes.node, PropTypes.string]),\n 'data-testid': PropTypes.string,\n 'aria-label': PropTypes.string,\n closeToolTipInformationTextAriaLabel: PropTypes.string.isRequired,\n // ---------- Regular Tooltip exclusive --------------\n iconContainerClassName: PropTypes.string,\n delayHide: PropTypes.number,\n fontSize: PropTypes.oneOf([12, 14]),\n iconSize: PropTypes.oneOf(keys(IconSizes)),\n // ---------- React Tooltip exclusive --------------\n // externalHandling: if passed down, React Tooltip is used instead, due to limitations on\n // parents overflow hidden controls\n // data-for={anchorId} && data-tooltip-place=\"left\" are needed on the anchored component\n anchorId: PropTypes.string,\n toolTipIsVisible: PropTypes.bool\n};\n\nexport default ToolTip;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAeC,cAAf,EAA+BC,QAA/B,EAAyCC,WAAzC,EAAsDC,OAAtD,QAAoE,OAApE;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,YAAP,MAAyB,eAAzB;AACA,OAAOC,QAAP,MAAqB,oBAArB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,0CAA0C,IAAIC,eAAtD,QAA4E,0BAA5E;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,SAAS,GAAG;EAChB,IAAID,KAAK,CAACE,wBADM;EAEhB,IAAIF,KAAK,CAACG;AAFM,CAAlB;AAKA,MAAMC,SAAS,GAA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px;
|
|
41
39
|
}
|
|
42
40
|
|
|
41
|
+
.bigIconToolTip {
|
|
42
|
+
right: -71px;
|
|
43
|
+
bottom: 31px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.smallIconToolTip {
|
|
47
|
+
right: -75px;
|
|
48
|
+
bottom: 32px;
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
.toolTip::before {
|
|
44
52
|
content: '';
|
|
45
53
|
display: inline-block;
|
|
@@ -88,6 +96,7 @@
|
|
|
88
96
|
visibility: visible !important;
|
|
89
97
|
opacity: 1 !important;
|
|
90
98
|
left: 5px;
|
|
99
|
+
max-width: 400px;
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
/* for keyboard navigation, the position can't be obtained from the mouse */
|
package/es/globals.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"globals.d.js","names":[],"sources":["../src/globals.d.ts"],"sourcesContent":["declare module '@coorpacademy/nova-icons';\ndeclare module '@coorpacademy/react-native-slider';\ndeclare module '@react-native-community/blur';\ndeclare module '@coorpacademy/translate';\ndeclare module 'browser-env';\ndeclare module 'react-native/*';\ndeclare module 'color';\ndeclare module 'classnames';\ndeclare module '*.css';\n"],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BattleOpponentListProps } from './prop-types';
|
|
3
|
+
declare const BattleOpponentList: {
|
|
4
|
+
({ opponents }: BattleOpponentListProps): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
opponents: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
7
|
+
isAlreadyEngaged: import("prop-types").Requireable<boolean>;
|
|
8
|
+
isRandom: import("prop-types").Requireable<boolean>;
|
|
9
|
+
photo: 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
|
+
user_id: import("prop-types").Requireable<string>;
|
|
14
|
+
}> | null | undefined)[]>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default BattleOpponentList;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"names":[],"mappings":";AAKA,OAAkB,EAAC,uBAAuB,EAAC,MAAM,cAAc,CAAC;AAGhE,QAAA,MAAM,kBAAkB;oBAAiB,uBAAuB;;;;;;;;;;;;CAiB/D,CAAC;AAIF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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, { useMemo } from 'react';
|
|
4
|
+
import get from 'lodash/fp/get';
|
|
5
|
+
import map from 'lodash/fp/map';
|
|
6
|
+
import { v5 as uuidV5 } from 'uuid';
|
|
7
|
+
import BattleOpponent from '../../atom/battle-opponent';
|
|
8
|
+
import propTypes from './prop-types';
|
|
9
|
+
import style from './style.css';
|
|
10
|
+
|
|
11
|
+
const BattleOpponentList = ({
|
|
12
|
+
opponents
|
|
13
|
+
}) => {
|
|
14
|
+
const opponentList = useMemo(() => map(opponent => /*#__PURE__*/React.createElement(BattleOpponent, _extends({}, opponent, {
|
|
15
|
+
key: uuidV5('battle-', uuidV5.URL),
|
|
16
|
+
userAvatarSrc: get('photo', opponent)
|
|
17
|
+
})), opponents), [opponents]);
|
|
18
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
19
|
+
className: style.opponentList
|
|
20
|
+
}, opponentList);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
BattleOpponentList.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
24
|
+
export default BattleOpponentList;
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","get","map","v5","uuidV5","BattleOpponent","propTypes","style","BattleOpponentList","opponents","opponentList","opponent","URL"],"sources":["../../../src/molecule/battle-opponent-list/index.tsx"],"sourcesContent":["import React, {useMemo} from 'react';\nimport get from 'lodash/fp/get';\nimport map from 'lodash/fp/map';\nimport {v5 as uuidV5} from 'uuid';\nimport BattleOpponent from '../../atom/battle-opponent';\nimport propTypes, {BattleOpponentListProps} from './prop-types';\nimport style from './style.css';\n\nconst BattleOpponentList = ({opponents}: BattleOpponentListProps) => {\n const opponentList = useMemo(\n () =>\n map(\n opponent => (\n <BattleOpponent\n {...opponent}\n key={uuidV5('battle-', uuidV5.URL)}\n userAvatarSrc={get('photo', opponent)}\n />\n ),\n opponents\n ),\n [opponents]\n );\n\n return <ul className={style.opponentList}>{opponentList}</ul>;\n};\n\nBattleOpponentList.propTypes = propTypes;\n\nexport default BattleOpponentList;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,SAAQC,EAAE,IAAIC,MAAd,QAA2B,MAA3B;AACA,OAAOC,cAAP,MAA2B,4BAA3B;AACA,OAAOC,SAAP,MAAiD,cAAjD;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,kBAAkB,GAAG,CAAC;EAACC;AAAD,CAAD,KAA0C;EACnE,MAAMC,YAAY,GAAGV,OAAO,CAC1B,MACEE,GAAG,CACDS,QAAQ,iBACN,oBAAC,cAAD,eACMA,QADN;IAEE,GAAG,EAAEP,MAAM,CAAC,SAAD,EAAYA,MAAM,CAACQ,GAAnB,CAFb;IAGE,aAAa,EAAEX,GAAG,CAAC,OAAD,EAAUU,QAAV;EAHpB,GAFD,EAQDF,SARC,CAFqB,EAY1B,CAACA,SAAD,CAZ0B,CAA5B;EAeA,oBAAO;IAAI,SAAS,EAAEF,KAAK,CAACG;EAArB,GAAoCA,YAApC,CAAP;AACD,CAjBD;;AAmBAF,kBAAkB,CAACF,SAAnB,2CAA+BA,SAA/B;AAEA,eAAeE,kBAAf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const propTypes: {
|
|
3
|
+
opponents: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
4
|
+
isAlreadyEngaged: PropTypes.Requireable<boolean>;
|
|
5
|
+
isRandom: PropTypes.Requireable<boolean>;
|
|
6
|
+
photo: PropTypes.Requireable<string>;
|
|
7
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
8
|
+
displayName: PropTypes.Requireable<string>;
|
|
9
|
+
tooltipText: PropTypes.Requireable<string>;
|
|
10
|
+
user_id: PropTypes.Requireable<string>;
|
|
11
|
+
}> | null | undefined)[]>;
|
|
12
|
+
};
|
|
13
|
+
declare type MoocBattleOpponent = {
|
|
14
|
+
isAlreadyEngaged?: boolean;
|
|
15
|
+
isRandom?: boolean;
|
|
16
|
+
photo?: string;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
displayName: string;
|
|
19
|
+
tooltipText: string;
|
|
20
|
+
user_id: string;
|
|
21
|
+
};
|
|
22
|
+
export declare type BattleOpponentListProps = {
|
|
23
|
+
opponents: MoocBattleOpponent[];
|
|
24
|
+
};
|
|
25
|
+
export default propTypes;
|
|
26
|
+
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/battle-opponent-list/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;;;CAYd,CAAC;AAEF,aAAK,kBAAkB,GAAG;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IAAC,SAAS,EAAE,kBAAkB,EAAE,CAAA;CAAC,CAAC;AAExE,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
const propTypes = {
|
|
3
|
+
opponents: PropTypes.arrayOf(PropTypes.shape({
|
|
4
|
+
isAlreadyEngaged: PropTypes.bool,
|
|
5
|
+
isRandom: PropTypes.bool,
|
|
6
|
+
photo: PropTypes.string,
|
|
7
|
+
onClick: PropTypes.func,
|
|
8
|
+
displayName: PropTypes.string,
|
|
9
|
+
tooltipText: PropTypes.string,
|
|
10
|
+
user_id: PropTypes.string
|
|
11
|
+
}))
|
|
12
|
+
};
|
|
13
|
+
export default propTypes;
|
|
14
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["PropTypes","propTypes","opponents","arrayOf","shape","isAlreadyEngaged","bool","isRandom","photo","string","onClick","func","displayName","tooltipText","user_id"],"sources":["../../../src/molecule/battle-opponent-list/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n opponents: PropTypes.arrayOf(\n PropTypes.shape({\n isAlreadyEngaged: PropTypes.bool,\n isRandom: PropTypes.bool,\n photo: PropTypes.string,\n onClick: PropTypes.func,\n displayName: PropTypes.string,\n tooltipText: PropTypes.string,\n user_id: PropTypes.string\n })\n )\n};\n\ntype MoocBattleOpponent = {\n isAlreadyEngaged?: boolean;\n isRandom?: boolean;\n photo?: string;\n onClick?: () => void;\n displayName: string;\n tooltipText: string;\n user_id: string;\n};\n\nexport type BattleOpponentListProps = {opponents: MoocBattleOpponent[]};\n\nexport default propTypes;\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,MAAMC,SAAS,GAAG;EAChBC,SAAS,EAAEF,SAAS,CAACG,OAAV,CACTH,SAAS,CAACI,KAAV,CAAgB;IACdC,gBAAgB,EAAEL,SAAS,CAACM,IADd;IAEdC,QAAQ,EAAEP,SAAS,CAACM,IAFN;IAGdE,KAAK,EAAER,SAAS,CAACS,MAHH;IAIdC,OAAO,EAAEV,SAAS,CAACW,IAJL;IAKdC,WAAW,EAAEZ,SAAS,CAACS,MALT;IAMdI,WAAW,EAAEb,SAAS,CAACS,MANT;IAOdK,OAAO,EAAEd,SAAS,CAACS;EAPL,CAAhB,CADS;AADK,CAAlB;AA0BA,eAAeR,SAAf"}
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import map from 'lodash/fp/map';
|
|
5
|
-
import
|
|
5
|
+
import StatusItem from '../../atom/status-item';
|
|
6
6
|
import style from './style.css';
|
|
7
7
|
import propTypes from './prop-types';
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ const ReviewHeaderSteps = props => {
|
|
|
12
12
|
} = props;
|
|
13
13
|
const items = map.convert({
|
|
14
14
|
cap: false
|
|
15
|
-
})((step, index) => /*#__PURE__*/React.createElement(
|
|
15
|
+
})((step, index) => /*#__PURE__*/React.createElement(StatusItem, _extends({}, step, {
|
|
16
16
|
key: index
|
|
17
17
|
})), steps);
|
|
18
18
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","map","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","map","StatusItem","style","propTypes","ReviewHeaderSteps","props","steps","items","convert","cap","step","index","wrapper"],"sources":["../../../src/molecule/review-header-steps/index.js"],"sourcesContent":["import React from 'react';\nimport map from 'lodash/fp/map';\nimport StatusItem from '../../atom/status-item';\nimport style from './style.css';\nimport propTypes from './prop-types';\n\nconst ReviewHeaderSteps = props => {\n const {steps} = props;\n\n const items = map.convert({cap: false})(\n (step, index) => <StatusItem {...step} key={index} />,\n steps\n );\n\n return (\n <div className={style.wrapper} data-name=\"header-steps\">\n {items}\n </div>\n );\n};\n\nReviewHeaderSteps.propTypes = propTypes;\n\nexport default ReviewHeaderSteps;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,cAAtB;;AAEA,MAAMC,iBAAiB,GAAGC,KAAK,IAAI;EACjC,MAAM;IAACC;EAAD,IAAUD,KAAhB;EAEA,MAAME,KAAK,GAAGP,GAAG,CAACQ,OAAJ,CAAY;IAACC,GAAG,EAAE;EAAN,CAAZ,EACZ,CAACC,IAAD,EAAOC,KAAP,kBAAiB,oBAAC,UAAD,eAAgBD,IAAhB;IAAsB,GAAG,EAAEC;EAA3B,GADL,EAEZL,KAFY,CAAd;EAKA,oBACE;IAAK,SAAS,EAAEJ,KAAK,CAACU,OAAtB;IAA+B,aAAU;EAAzC,GACGL,KADH,CADF;AAKD,CAbD;;AAeAH,iBAAiB,CAACD,SAAlB,2CAA8BA,SAA9B;AAEA,eAAeC,iBAAf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import {
|
|
2
|
+
import { StatusItemProps } from '../../atom/status-item/types';
|
|
3
3
|
declare const propTypes: {
|
|
4
4
|
steps: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
5
5
|
current: PropTypes.Requireable<boolean>;
|
|
@@ -9,6 +9,6 @@ declare const propTypes: {
|
|
|
9
9
|
};
|
|
10
10
|
export default propTypes;
|
|
11
11
|
export declare type ReviewHeaderStepsProps = {
|
|
12
|
-
steps:
|
|
12
|
+
steps: StatusItemProps[];
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-header-steps/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAsC,
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/review-header-steps/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAsC,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE5F,QAAA,MAAM,SAAS;;;;;;CAEd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,sBAAsB,GAAG;IACnC,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import ReviewHeaderStepItemPropTypes from '../../atom/
|
|
2
|
+
import ReviewHeaderStepItemPropTypes from '../../atom/status-item/types';
|
|
3
3
|
const propTypes = {
|
|
4
4
|
steps: PropTypes.arrayOf(PropTypes.shape(ReviewHeaderStepItemPropTypes))
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["PropTypes","ReviewHeaderStepItemPropTypes","propTypes","steps","arrayOf","shape"],"sources":["../../../src/molecule/review-header-steps/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewHeaderStepItemPropTypes, {
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["PropTypes","ReviewHeaderStepItemPropTypes","propTypes","steps","arrayOf","shape"],"sources":["../../../src/molecule/review-header-steps/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nimport ReviewHeaderStepItemPropTypes, {StatusItemProps} from '../../atom/status-item/types';\n\nconst propTypes = {\n steps: PropTypes.arrayOf(PropTypes.shape(ReviewHeaderStepItemPropTypes))\n};\n\nexport default propTypes;\n\nexport type ReviewHeaderStepsProps = {\n steps: StatusItemProps[];\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,OAAOC,6BAAP,MAA6D,8BAA7D;AAEA,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAEH,SAAS,CAACI,OAAV,CAAkBJ,SAAS,CAACK,KAAV,CAAgBJ,6BAAhB,CAAlB;AADS,CAAlB;AAIA,eAAeC,SAAf"}
|
|
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { StyleSheet, View } from 'react-native';
|
|
5
5
|
import { NovaSolidStatusClose as CloseIcon } from '@coorpacademy/nova-icons';
|
|
6
|
-
import Step from '../../atom/
|
|
6
|
+
import Step from '../../atom/status-item/index.native';
|
|
7
7
|
import Touchable from '../../hoc/touchable/index.native';
|
|
8
8
|
const style = StyleSheet.create({
|
|
9
9
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","names":["React","StyleSheet","View","NovaSolidStatusClose","CloseIcon","Step","Touchable","style","create","container","flexDirection","justifyContent","alignItems","alignContent","width","header","height","paddingTop","touchArea","position","right","borderRadius","padding","icon","ReviewHeader","props","steps","onQuitClick","map","step","value"],"sources":["../../../src/organism/review-header/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View, ViewStyle} from 'react-native';\nimport {NovaSolidStatusClose as CloseIcon} from '@coorpacademy/nova-icons';\nimport Step from '../../atom/
|
|
1
|
+
{"version":3,"file":"index.native.js","names":["React","StyleSheet","View","NovaSolidStatusClose","CloseIcon","Step","Touchable","style","create","container","flexDirection","justifyContent","alignItems","alignContent","width","header","height","paddingTop","touchArea","position","right","borderRadius","padding","icon","ReviewHeader","props","steps","onQuitClick","map","step","value"],"sources":["../../../src/organism/review-header/index.native.tsx"],"sourcesContent":["import React from 'react';\nimport {StyleSheet, View, ViewStyle} from 'react-native';\nimport {NovaSolidStatusClose as CloseIcon} from '@coorpacademy/nova-icons';\nimport Step from '../../atom/status-item/index.native';\nimport Touchable from '../../hoc/touchable/index.native';\nimport {HeaderProps} from './types';\n\ntype StyleSheetType = {\n container: ViewStyle;\n header: ViewStyle;\n touchArea: ViewStyle;\n icon: ViewStyle;\n};\n\nconst style: StyleSheetType = StyleSheet.create({\n container: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n alignContent: 'center',\n width: '100%'\n },\n header: {\n width: '80%',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: 70,\n paddingTop: 8\n },\n touchArea: {\n position: 'absolute',\n right: 24,\n borderRadius: 12,\n paddingTop: 16,\n padding: 8\n },\n icon: {\n width: 12,\n height: 12\n }\n});\n\nconst ReviewHeader = (props: HeaderProps) => {\n const {steps, onQuitClick} = props;\n\n return (\n <View style={style.container}>\n <View style={style.header}>\n {steps.map(step => (\n <Step {...step} key={step.value} />\n ))}\n </View>\n <Touchable\n style={style.touchArea}\n isHighlight\n onPress={onQuitClick}\n accessibilityLabel=\"open-popin-button\"\n testID=\"open-popin-button\"\n >\n <CloseIcon style={style.icon} color=\"#06265B\" />\n </Touchable>\n </View>\n );\n};\n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,CAACW,SADf;IAEE,WAAW,MAFb;IAGE,OAAO,EAAES,WAHX;IAIE,kBAAkB,EAAC,mBAJrB;IAKE,MAAM,EAAC;EALT,gBAOE,oBAAC,SAAD;IAAW,KAAK,EAAEpB,KAAK,CAACgB,IAAxB;IAA8B,KAAK,EAAC;EAApC,EAPF,CANF,CADF;AAkBD,CArBD;;AAuBA,eAAeC,YAAf"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import {
|
|
2
|
+
import { StatusItemProps } from '../../atom/status-item/types';
|
|
3
3
|
declare const propTypes: {
|
|
4
4
|
steps: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
5
5
|
current: PropTypes.Requireable<boolean>;
|
|
@@ -15,7 +15,7 @@ declare const propTypes: {
|
|
|
15
15
|
};
|
|
16
16
|
export default propTypes;
|
|
17
17
|
export declare type HeaderProps = {
|
|
18
|
-
steps:
|
|
18
|
+
steps: StatusItemProps[];
|
|
19
19
|
mode: string;
|
|
20
20
|
skillName: string;
|
|
21
21
|
'aria-label': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/review-header/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE7D,QAAA,MAAM,SAAS;;;;;;;;;;;;CAQd,CAAC;AAEF,eAAe,SAAS,CAAC;AAEzB,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","ReviewHeaderStepsPropTypes","propTypes","steps","mode","string","isRequired","skillName","closeButtonAriaLabel","onQuitClick","func","hiddenSteps","bool"],"sources":["../../../src/organism/review-header/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewHeaderStepsPropTypes from '../../molecule/review-header-steps/prop-types';\nimport {
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","ReviewHeaderStepsPropTypes","propTypes","steps","mode","string","isRequired","skillName","closeButtonAriaLabel","onQuitClick","func","hiddenSteps","bool"],"sources":["../../../src/organism/review-header/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport ReviewHeaderStepsPropTypes from '../../molecule/review-header-steps/prop-types';\nimport {StatusItemProps} from '../../atom/status-item/types';\n\nconst propTypes = {\n steps: ReviewHeaderStepsPropTypes.steps,\n mode: PropTypes.string.isRequired,\n skillName: PropTypes.string.isRequired,\n 'aria-label': PropTypes.string,\n closeButtonAriaLabel: PropTypes.string,\n onQuitClick: PropTypes.func,\n hiddenSteps: PropTypes.bool\n};\n\nexport default propTypes;\n\nexport type HeaderProps = {\n steps: StatusItemProps[];\n mode: string;\n skillName: string;\n 'aria-label': string;\n closeButtonAriaLabel: string;\n onQuitClick: () => void;\n hiddenSteps: boolean;\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,0BAAP,MAAuC,+CAAvC;AAGA,MAAMC,SAAS,GAAG;EAChBC,KAAK,EAAEF,0BAA0B,CAACE,KADlB;EAEhBC,IAAI,EAAEJ,SAAS,CAACK,MAAV,CAAiBC,UAFP;EAGhBC,SAAS,EAAEP,SAAS,CAACK,MAAV,CAAiBC,UAHZ;EAIhB,cAAcN,SAAS,CAACK,MAJR;EAKhBG,oBAAoB,EAAER,SAAS,CAACK,MALhB;EAMhBI,WAAW,EAAET,SAAS,CAACU,IANP;EAOhBC,WAAW,EAAEX,SAAS,CAACY;AAPP,CAAlB;AAUA,eAAeV,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/user-preferences/index.js"],"names":[],"mappings":";AA4CA,0DAeC"}
|
|
@@ -8,13 +8,13 @@ import React from 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import isEmpty from 'lodash/fp/isEmpty';
|
|
10
10
|
import map from 'lodash/fp/map';
|
|
11
|
-
import { GetTranslateFromContext } from '../../atom/provider';
|
|
11
|
+
import Provider, { GetTranslateFromContext } from '../../atom/provider';
|
|
12
12
|
import ToolTip from '../../atom/tooltip';
|
|
13
13
|
import InputSwitch from '../../atom/input-switch';
|
|
14
14
|
import style from './style.css';
|
|
15
15
|
|
|
16
|
-
const Settings = props => {
|
|
17
|
-
const translate = GetTranslateFromContext();
|
|
16
|
+
const Settings = (props, legacyContext) => {
|
|
17
|
+
const translate = GetTranslateFromContext(legacyContext);
|
|
18
18
|
|
|
19
19
|
const {
|
|
20
20
|
label,
|
|
@@ -42,6 +42,9 @@ Settings.propTypes = process.env.NODE_ENV !== "production" ? _extends({}, InputS
|
|
|
42
42
|
label: PropTypes.string.isRequired,
|
|
43
43
|
description: PropTypes.string
|
|
44
44
|
}) : {};
|
|
45
|
+
Settings.contextTypes = {
|
|
46
|
+
translate: Provider.childContextTypes.translate
|
|
47
|
+
};
|
|
45
48
|
|
|
46
49
|
const UserPreferences = props => {
|
|
47
50
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","isEmpty","map","GetTranslateFromContext","ToolTip","InputSwitch","style","Settings","props","translate","label","description","moreInfoAriaLabel","settings","infoIconTooltip","propTypes","string","isRequired","UserPreferences","preferences","groupAriaLabel","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = props => {\n const translate = GetTranslateFromContext();\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupAriaLabel: PropTypes.string\n};\n\nexport default UserPreferences;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,mBAApB;AACA,OAAOC,GAAP,MAAgB,eAAhB;AACA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","isEmpty","map","Provider","GetTranslateFromContext","ToolTip","InputSwitch","style","Settings","props","legacyContext","translate","label","description","moreInfoAriaLabel","settings","infoIconTooltip","propTypes","string","isRequired","contextTypes","childContextTypes","UserPreferences","preferences","groupAriaLabel","arrayOf","shape"],"sources":["../../../src/organism/user-preferences/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isEmpty from 'lodash/fp/isEmpty';\nimport map from 'lodash/fp/map';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport ToolTip from '../../atom/tooltip';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\n\nconst Settings = (props, legacyContext) => {\n const translate = GetTranslateFromContext(legacyContext);\n const {label, description, moreInfoAriaLabel, ...settings} = props;\n return (\n <div className={style.settings}>\n <InputSwitch {...settings} />\n <span className={style.label} tabIndex={0}>\n {label}\n </span>\n {isEmpty(description) ? null : (\n <ToolTip\n TooltipContent={description}\n closeToolTipInformationTextAriaLabel={translate(\n 'Press the escape key to close the information text'\n )}\n data-testid=\"user-preferences-tooltip\"\n aria-label={moreInfoAriaLabel}\n iconContainerClassName={style.infoIconTooltip}\n fontSize={12}\n />\n )}\n </div>\n );\n};\n\nSettings.propTypes = {\n ...InputSwitch.propTypes,\n label: PropTypes.string.isRequired,\n description: PropTypes.string\n};\n\nSettings.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nconst UserPreferences = props => {\n const {preferences, moreInfoAriaLabel, groupAriaLabel} = props;\n\n return (\n <form>\n <div className={style.preferences} role=\"group\" aria-label={groupAriaLabel} tabIndex={0}>\n {map(\n settings => (\n <Settings {...settings} key={settings.label} moreInfoAriaLabel={moreInfoAriaLabel} />\n ),\n preferences\n )}\n </div>\n </form>\n );\n};\n\nUserPreferences.propTypes = {\n preferences: PropTypes.arrayOf(PropTypes.shape(Settings.propTypes)),\n moreInfoAriaLabel: PropTypes.string,\n groupA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BV;AADhB,CAAxB;;AAIA,MAAMW,eAAe,GAAGb,KAAK,IAAI;EAC/B,MAAM;IAACc,WAAD;IAAcT,iBAAd;IAAiCU;EAAjC,IAAmDf,KAAzD;EAEA,oBACE,+CACE;IAAK,SAAS,EAAEF,KAAK,CAACgB,WAAtB;IAAmC,IAAI,EAAC,OAAxC;IAAgD,cAAYC,cAA5D;IAA4E,QAAQ,EAAE;EAAtF,GACGtB,GAAG,CACFa,QAAQ,iBACN,oBAAC,QAAD,eAAcA,QAAd;IAAwB,GAAG,EAAEA,QAAQ,CAACH,KAAtC;IAA6C,iBAAiB,EAAEE;EAAhE,GAFA,EAIFS,WAJE,CADN,CADF,CADF;AAYD,CAfD;;AAiBAD,eAAe,CAACL,SAAhB,2CAA4B;EAC1BM,WAAW,EAAEvB,SAAS,CAACyB,OAAV,CAAkBzB,SAAS,CAAC0B,KAAV,CAAgBlB,QAAQ,CAACS,SAAzB,CAAlB,CADa;EAE1BH,iBAAiB,EAAEd,SAAS,CAACkB,MAFH;EAG1BM,cAAc,EAAExB,SAAS,CAACkB;AAHA,CAA5B;AAMA,eAAeI,eAAf"}
|
package/es/variables/colors.css
CHANGED
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
@value cm_negative_50: #ffe5e6;
|
|
52
52
|
@value cm_green_50: #e8fcf8;
|
|
53
53
|
@value cm_green_200: #16ac8c;
|
|
54
|
+
@value cm_green_secondary_100: #D6F5E1;
|
|
55
|
+
@value cm_green_secondary_200: #38CC6C;
|
|
54
56
|
@value cm_orange_200: #FF7043;
|
|
55
57
|
@value cm_orange_700: #FF4105;
|
|
56
58
|
@value cm_pink_50: #ffefeb;
|
|
@@ -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"}
|