@coorpacademy/components 11.40.2 → 11.40.3-alpha.14
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/chip/index.d.ts +4 -0
- package/es/atom/chip/index.d.ts.map +1 -1
- package/es/atom/chip/index.js +13 -6
- package/es/atom/chip/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +2 -1
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +4 -1
- package/es/atom/radio-with-title/index.d.ts +1 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +1 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/title/index.d.ts +1 -0
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +5 -2
- package/es/atom/title/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +1 -0
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +6 -2
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/base-modal/style.css +5 -0
- package/es/molecule/cm-popin/types.d.ts +2 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.d.ts +20 -0
- package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.js +41 -6
- package/es/molecule/multi-filter-panel/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts +37 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.js +6 -0
- package/es/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/es/molecule/multi-filter-panel/style.css +8 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +21 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +21 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.d.ts +1 -0
- package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.js +5 -2
- package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
- package/es/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/es/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/style.css +2 -0
- package/es/organism/filter-chip/index.d.ts +3 -0
- package/es/organism/filter-chip/index.d.ts.map +1 -1
- package/es/organism/filter-chip/index.js +12 -4
- package/es/organism/filter-chip/index.js.map +1 -1
- package/es/organism/filter-chip/prop-types.d.ts +7 -1
- package/es/organism/filter-chip/prop-types.d.ts.map +1 -1
- package/es/organism/filter-chip/prop-types.js +3 -0
- package/es/organism/filter-chip/prop-types.js.map +1 -1
- package/es/organism/filter-switch/index.d.ts +23 -0
- package/es/organism/filter-switch/index.d.ts.map +1 -0
- package/es/organism/filter-switch/index.js +76 -0
- package/es/organism/filter-switch/index.js.map +1 -0
- package/es/organism/filter-switch/prop-types.d.ts +27 -0
- package/es/organism/filter-switch/prop-types.d.ts.map +1 -0
- package/es/organism/filter-switch/prop-types.js +15 -0
- package/es/organism/filter-switch/prop-types.js.map +1 -0
- package/es/organism/filter-switch/style.css +46 -0
- package/es/organism/list-items/index.d.ts +1 -0
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/title-and-input/index.d.ts +2 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +2 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +1 -0
- package/es/template/app-player/loading/index.d.ts +2 -0
- package/es/template/app-player/player/index.d.ts +4 -0
- package/es/template/app-player/player/slides/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +2 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +2 -0
- package/es/template/app-review/index.d.ts +2 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +2 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +2 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +25 -0
- package/es/template/common/dashboard/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +2 -0
- package/es/template/external-course/index.d.ts +2 -0
- package/lib/atom/chip/index.d.ts +4 -0
- package/lib/atom/chip/index.d.ts.map +1 -1
- package/lib/atom/chip/index.js +13 -6
- package/lib/atom/chip/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +2 -1
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +4 -1
- package/lib/atom/radio-with-title/index.d.ts +1 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +1 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/title/index.d.ts +1 -0
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +5 -2
- package/lib/atom/title/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +1 -0
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +6 -2
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/base-modal/style.css +5 -0
- package/lib/molecule/cm-popin/types.d.ts +2 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.d.ts +20 -0
- package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.js +41 -6
- package/lib/molecule/multi-filter-panel/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts +37 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.js +6 -0
- package/lib/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/lib/molecule/multi-filter-panel/style.css +8 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +21 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +21 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.d.ts +1 -0
- package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.js +5 -2
- package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/lib/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/style.css +2 -0
- package/lib/organism/filter-chip/index.d.ts +3 -0
- package/lib/organism/filter-chip/index.d.ts.map +1 -1
- package/lib/organism/filter-chip/index.js +12 -4
- package/lib/organism/filter-chip/index.js.map +1 -1
- package/lib/organism/filter-chip/prop-types.d.ts +7 -1
- package/lib/organism/filter-chip/prop-types.d.ts.map +1 -1
- package/lib/organism/filter-chip/prop-types.js +3 -0
- package/lib/organism/filter-chip/prop-types.js.map +1 -1
- package/lib/organism/filter-switch/index.d.ts +23 -0
- package/lib/organism/filter-switch/index.d.ts.map +1 -0
- package/lib/organism/filter-switch/index.js +83 -0
- package/lib/organism/filter-switch/index.js.map +1 -0
- package/lib/organism/filter-switch/prop-types.d.ts +27 -0
- package/lib/organism/filter-switch/prop-types.d.ts.map +1 -0
- package/lib/organism/filter-switch/prop-types.js +20 -0
- package/lib/organism/filter-switch/prop-types.js.map +1 -0
- package/lib/organism/filter-switch/style.css +46 -0
- package/lib/organism/list-items/index.d.ts +1 -0
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +2 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +2 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +1 -0
- package/lib/template/app-player/loading/index.d.ts +2 -0
- package/lib/template/app-player/player/index.d.ts +4 -0
- package/lib/template/app-player/player/slides/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +2 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +2 -0
- package/lib/template/app-review/index.d.ts +2 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +2 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +2 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +25 -0
- package/lib/template/common/dashboard/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +2 -0
- package/lib/template/external-course/index.d.ts +2 -0
- package/package.json +2 -2
package/es/atom/chip/index.d.ts
CHANGED
|
@@ -28,11 +28,15 @@ declare namespace Chip {
|
|
|
28
28
|
namespace propTypes {
|
|
29
29
|
const text: PropTypes.Requireable<string>;
|
|
30
30
|
const subText: PropTypes.Requireable<string>;
|
|
31
|
+
const textColor: PropTypes.Requireable<string>;
|
|
31
32
|
const selected: PropTypes.Requireable<boolean>;
|
|
32
33
|
const customIcon: PropTypes.Requireable<string>;
|
|
33
34
|
const backgroundColor: PropTypes.Requireable<string>;
|
|
34
35
|
const onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
36
|
const leftIcon: PropTypes.Requireable<string>;
|
|
37
|
+
const customStyle: PropTypes.Requireable<{
|
|
38
|
+
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
39
|
+
}>;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
import PropTypes from "prop-types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/chip/index.js"],"names":[],"mappings":"AAmBO,qGAG0E;;AAGjF,6DAwEC"}
|
package/es/atom/chip/index.js
CHANGED
|
@@ -22,11 +22,13 @@ const Chip = (props, context) => {
|
|
|
22
22
|
const {
|
|
23
23
|
text,
|
|
24
24
|
subText,
|
|
25
|
+
textColor,
|
|
25
26
|
selected = false,
|
|
26
27
|
customIcon,
|
|
27
28
|
onClick,
|
|
28
29
|
leftIcon,
|
|
29
|
-
backgroundColor = DEFAULT_BACKGROUND_COLOR
|
|
30
|
+
backgroundColor = DEFAULT_BACKGROUND_COLOR,
|
|
31
|
+
customStyle
|
|
30
32
|
} = props;
|
|
31
33
|
const {
|
|
32
34
|
skin
|
|
@@ -46,14 +48,17 @@ const Chip = (props, context) => {
|
|
|
46
48
|
backgroundColor: hoveredSelectedBgColor
|
|
47
49
|
} : {};
|
|
48
50
|
const defaultIcon = selected ? 'fa-check' : 'fa-plus';
|
|
49
|
-
const
|
|
51
|
+
const defaultTextColor = textColor ? textColor : COLORS.cm_grey_700;
|
|
52
|
+
const color = selected ? COLORS.white : defaultTextColor;
|
|
53
|
+
const showIcon = customIcon !== 'none';
|
|
50
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
51
55
|
className: classnames(style.container, !selected && style.unselected),
|
|
52
56
|
style: {
|
|
53
57
|
...(selected && selectedBgColor ? {
|
|
54
58
|
backgroundColor: selectedBgColor
|
|
55
59
|
} : {}),
|
|
56
|
-
...(selected && hoverStyle)
|
|
60
|
+
...(selected && hoverStyle),
|
|
61
|
+
...customStyle
|
|
57
62
|
},
|
|
58
63
|
onClick: handleClick,
|
|
59
64
|
onMouseEnter: handleMouseEnter,
|
|
@@ -80,13 +85,13 @@ const Chip = (props, context) => {
|
|
|
80
85
|
style: {
|
|
81
86
|
color
|
|
82
87
|
}
|
|
83
|
-
}, subText) : null)), /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
88
|
+
}, subText) : null)), showIcon ? /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
84
89
|
style: {
|
|
85
90
|
color
|
|
86
91
|
},
|
|
87
92
|
icon: customIcon ? `fa-${customIcon}` : defaultIcon,
|
|
88
93
|
fontSize: ICON_SIZE
|
|
89
|
-
}));
|
|
94
|
+
}) : null);
|
|
90
95
|
};
|
|
91
96
|
Chip.contextTypes = {
|
|
92
97
|
skin: Provider.childContextTypes.skin
|
|
@@ -94,11 +99,13 @@ Chip.contextTypes = {
|
|
|
94
99
|
Chip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
95
100
|
text: PropTypes.string,
|
|
96
101
|
subText: PropTypes.string,
|
|
102
|
+
textColor: PropTypes.string,
|
|
97
103
|
selected: PropTypes.bool,
|
|
98
104
|
customIcon: PropTypes.string,
|
|
99
105
|
backgroundColor: PropTypes.string,
|
|
100
106
|
onClick: PropTypes.func,
|
|
101
|
-
leftIcon: PropTypes.string
|
|
107
|
+
leftIcon: PropTypes.string,
|
|
108
|
+
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
102
109
|
} : {};
|
|
103
110
|
export default Chip;
|
|
104
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","classnames","get","convert","FontAwesomeIcon","fas","library","Provider","COLORS","style","add","LUMINOSITY_DELTA","cm_primary_blue","DEFAULT_BACKGROUND_COLOR","ICON_SIZE","calculateHoveredSelectedBgColor","selectedBgColor","luminosityDelta","Chip","props","context","text","subText","selected","customIcon","onClick","leftIcon","backgroundColor","skin","skinColor","hoveredSelectedBgColor","isHovered","setIsHovered","handleClick","handleMouseEnter","handleMouseLeave","hoverStyle","defaultIcon","color","white","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","useState","useCallback","PropTypes","classnames","get","convert","FontAwesomeIcon","fas","library","Provider","COLORS","style","add","LUMINOSITY_DELTA","cm_primary_blue","DEFAULT_BACKGROUND_COLOR","ICON_SIZE","calculateHoveredSelectedBgColor","selectedBgColor","luminosityDelta","Chip","props","context","text","subText","textColor","selected","customIcon","onClick","leftIcon","backgroundColor","customStyle","skin","skinColor","hoveredSelectedBgColor","isHovered","setIsHovered","handleClick","handleMouseEnter","handleMouseLeave","hoverStyle","defaultIcon","defaultTextColor","cm_grey_700","color","white","showIcon","createElement","className","container","unselected","onMouseEnter","onMouseLeave","left","icon","fontSize","title","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","bool","func","objectOf","oneOfType","number"],"sources":["../../../src/atom/chip/index.js"],"sourcesContent":["import React, {useMemo, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\n\nimport get from 'lodash/fp/get';\nimport {convert} from 'css-color-function';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {fas} from '@fortawesome/pro-solid-svg-icons';\nimport {library} from '@fortawesome/fontawesome-svg-core';\nimport Provider from '../provider';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nlibrary.add(fas);\n\nconst LUMINOSITY_DELTA = 0.08;\nconst {cm_primary_blue: DEFAULT_BACKGROUND_COLOR} = COLORS;\nconst ICON_SIZE = '12px';\n\nexport const calculateHoveredSelectedBgColor = (\n selectedBgColor,\n luminosityDelta = LUMINOSITY_DELTA\n) => convert(`hsl(from ${selectedBgColor} h s calc(l*(1 - ${luminosityDelta})))`);\n// note: luminosity decrease is relative to the selected color\n\nconst Chip = (props, context) => {\n const {\n text,\n subText,\n textColor,\n selected = false,\n customIcon,\n onClick,\n leftIcon,\n backgroundColor = DEFAULT_BACKGROUND_COLOR,\n customStyle\n } = props;\n const {skin} = context;\n const skinColor = get('common.primary', skin);\n const selectedBgColor = backgroundColor === 'skin' && skinColor ? skinColor : backgroundColor;\n const hoveredSelectedBgColor = calculateHoveredSelectedBgColor(selectedBgColor);\n\n const [isHovered, setIsHovered] = useState(false);\n\n const handleClick = useMemo(() => onClick, [onClick]);\n\n const handleMouseEnter = useCallback(() => {\n setIsHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setIsHovered(false);\n }, []);\n\n const hoverStyle = isHovered ? {backgroundColor: hoveredSelectedBgColor} : {};\n\n const defaultIcon = selected ? 'fa-check' : 'fa-plus';\n const defaultTextColor = textColor ? textColor : COLORS.cm_grey_700;\n const color = selected ? COLORS.white : defaultTextColor;\n const showIcon = customIcon !== 'none';\n\n return (\n <div\n className={classnames(style.container, !selected && style.unselected)}\n style={{\n ...(selected && selectedBgColor ? {backgroundColor: selectedBgColor} : {}),\n ...(selected && hoverStyle),\n ...customStyle\n }}\n onClick={handleClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n aria-label={text}\n data-name={`chip-${text}`}\n >\n <div className={style.left}>\n {leftIcon ? <FontAwesomeIcon style={{color}} icon={leftIcon} fontSize={ICON_SIZE} /> : null}\n <div title={text}>\n <span className={style.text} style={{color}}>\n {text}\n </span>\n {subText ? (\n <span className={style.subText} style={{color}}>\n {subText}\n </span>\n ) : null}\n </div>\n </div>\n {showIcon ? (\n <FontAwesomeIcon\n style={{color}}\n icon={customIcon ? `fa-${customIcon}` : defaultIcon}\n fontSize={ICON_SIZE}\n />\n ) : null}\n </div>\n );\n};\n\nChip.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nChip.propTypes = {\n text: PropTypes.string,\n subText: PropTypes.string,\n textColor: PropTypes.string,\n selected: PropTypes.bool,\n customIcon: PropTypes.string,\n backgroundColor: PropTypes.string,\n onClick: PropTypes.func,\n leftIcon: PropTypes.string,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default Chip;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAO,OAAO;AAC3D,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,GAAG,MAAM,eAAe;AAC/B,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,SAAQC,GAAG,QAAO,kCAAkC;AACpD,SAAQC,OAAO,QA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ceRoot":"","sources":["../../../src/atom/input-switch/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-switch/index.js"],"names":[],"mappings":";AAQA,sDAmGC"}
|
|
@@ -4,6 +4,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import classNames from 'classnames';
|
|
7
8
|
import getClassState from '../../util/get-class-state';
|
|
8
9
|
import style from './style.css';
|
|
9
10
|
const InputSwitch = props => {
|
|
@@ -29,7 +30,7 @@ const InputSwitch = props => {
|
|
|
29
30
|
const isDisabled = disabled ? 'disabled' : '';
|
|
30
31
|
const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);
|
|
31
32
|
const titleView = title ? /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
className: icon ? style.titleContainer : null
|
|
33
|
+
className: classNames(icon ? style.titleContainer : null, theme === 'newMooc' ? style.newMoocTitleContainer : null)
|
|
33
34
|
}, icon ? /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
34
35
|
icon: icon,
|
|
35
36
|
className: style.icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FontAwesomeIcon","getClassState","style","InputSwitch","props","title","name","id","value","disabled","onChange","_noop","description","modified","theme","titlePosition","details","requiredSelection","dataName","ariaLabelledBy","ariaLabel","icon","idSwitch","_uniqueId","isDisabled","handleChange","e","target","checked","titleView","createElement","className","titleContainer","descriptionView","getClass","defaultClass","coorpmanager","modifiedClass","coorpmanagerModified","newMooc","newMoocModified","partielUncheck","defaultStyle","btnSwitchContainer","_extends","type","checkbox","htmlFor","tabIndex","alignedTextContainer","detailsTxt","propTypes","process","env","NODE_ENV","string","bool","func","oneOf"],"sources":["../../../src/atom/input-switch/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst InputSwitch = props => {\n const {\n title,\n name,\n id,\n value,\n disabled,\n onChange = noop,\n description,\n modified = false,\n theme = 'default',\n titlePosition = 'left',\n details = '',\n requiredSelection = false,\n 'data-name': dataName,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-label': ariaLabel,\n icon\n } = props;\n\n const idSwitch = id || uniqueId('input-switch-');\n const isDisabled = disabled ? 'disabled' : '';\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n const titleView = title ? (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FontAwesomeIcon","classNames","getClassState","style","InputSwitch","props","title","name","id","value","disabled","onChange","_noop","description","modified","theme","titlePosition","details","requiredSelection","dataName","ariaLabelledBy","ariaLabel","icon","idSwitch","_uniqueId","isDisabled","handleChange","e","target","checked","titleView","createElement","className","titleContainer","newMoocTitleContainer","descriptionView","getClass","defaultClass","coorpmanager","modifiedClass","coorpmanagerModified","newMooc","newMoocModified","partielUncheck","defaultStyle","btnSwitchContainer","_extends","type","checkbox","htmlFor","tabIndex","alignedTextContainer","detailsTxt","propTypes","process","env","NODE_ENV","string","bool","func","oneOf"],"sources":["../../../src/atom/input-switch/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, uniqueId} from 'lodash/fp';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport classNames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst InputSwitch = props => {\n const {\n title,\n name,\n id,\n value,\n disabled,\n onChange = noop,\n description,\n modified = false,\n theme = 'default',\n titlePosition = 'left',\n details = '',\n requiredSelection = false,\n 'data-name': dataName,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-label': ariaLabel,\n icon\n } = props;\n\n const idSwitch = id || uniqueId('input-switch-');\n const isDisabled = disabled ? 'disabled' : '';\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n const titleView = title ? (\n <div\n className={classNames(\n icon ? style.titleContainer : null,\n theme === 'newMooc' ? style.newMoocTitleContainer : null\n )}\n >\n {icon ? <FontAwesomeIcon icon={icon} className={style.icon} /> : null}\n <span id={`title-view-${dataName}`} className={style.title}>\n {title}\n </span>\n </div>\n ) : null;\n\n const descriptionView = description ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const getClass = () => {\n switch (theme) {\n case 'coorpmanager':\n return {\n defaultClass: style.coorpmanager,\n modifiedClass: style.coorpmanagerModified\n };\n case 'newMooc':\n return {\n defaultClass: style.newMooc,\n modifiedClass: style.newMoocModified\n };\n case 'mooc':\n return {\n defaultClass: style.partielUncheck,\n modifiedClass: style.coorpmanagerModified\n };\n default:\n return {defaultClass: style.defaultStyle, modifiedClass: style.modified};\n }\n };\n const {defaultClass, modifiedClass} = getClass();\n const className = getClassState(defaultClass, modifiedClass, null, modified);\n\n return (\n <div className={className} data-name={`switch-input-${theme}${dataName}`}>\n {titlePosition === 'left' ? titleView : null}\n <div className={requiredSelection ? style.requiredSelection : null}>\n <div className={style.btnSwitchContainer}>\n <input\n {...(ariaLabelledBy ? {'aria-labelledby': ariaLabelledBy} : {})}\n {...(title ? {'aria-labelledby': `title-view-${dataName}`} : {})}\n {...(ariaLabel && !ariaLabelledBy && !title ? {'aria-label': ariaLabel} : {})}\n type=\"checkbox\"\n id={idSwitch}\n name={name}\n onChange={handleChange}\n checked={value}\n disabled={isDisabled}\n className={style.checkbox}\n aria-labelledby={ariaLabelledBy}\n />\n <label\n htmlFor={idSwitch}\n data-name=\"input-switch-label\"\n tabIndex={0}\n aria-label={ariaLabel}\n title={ariaLabel}\n />\n </div>\n </div>\n <div className={!details ? style.alignedTextContainer : null}>\n {titlePosition === 'right' ? titleView : null}\n {details ? <div className={style.detailsTxt}>{details}</div> : null}\n </div>\n {descriptionView}\n </div>\n );\n};\n\nInputSwitch.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n id: PropTypes.string,\n value: PropTypes.bool,\n disabled: PropTypes.bool,\n onChange: PropTypes.func,\n description: PropTypes.string,\n 'aria-labelledby': PropTypes.string,\n 'aria-label': PropTypes.string,\n modified: PropTypes.bool,\n titlePosition: PropTypes.oneOf(['right', 'left']),\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc', 'newMooc']),\n details: PropTypes.string,\n 'data-name': PropTypes.string,\n requiredSelection: PropTypes.bool,\n icon: PropTypes.string\n};\nexport default InputSwitch;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,eAAe,QAAO,gCAAgC;AAC9D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,aAAa,MAAM,4BAA4B;AACtD,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,WAAW,GAAGC,KAAK,IAAI;EAC3B,MAAM;IACJC,KAAK;IACLC,IAAI;IACJC,EAAE;IACFC,KAAK;IACLC,QAAQ;IACRC,QAAQ,GAAAC,KAAO;IACfC,WAAW;IACXC,QAAQ,GAAG,KAAK;IAChBC,KAAK,GAAG,SAAS;IACjBC,aAAa,GAAG,MAAM;IACtBC,OAAO,GAAG,EAAE;IACZC,iBAAiB,GAAG,KAAK;IACzB,WAAW,EAAEC,QAAQ;IACrB,iBAAiB,EAAEC,cAAc;IACjC,YAAY,EAAEC,SAAS;IACvBC;EACF,CAAC,GAAGjB,KAAK;EAET,MAAMkB,QAAQ,GAAGf,EAAE,IAAIgB,SAAA,CAAS,eAAe,CAAC;EAChD,MAAMC,UAAU,GAAGf,QAAQ,GAAG,UAAU,GAAG,EAAE;EAC7C,MAAMgB,YAAY,GAAG5B,OAAO,CAAC,MAAM6B,CAAC,IAA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237,7 +237,6 @@
|
|
|
237
237
|
.newMooc span, .newMoocModified span {
|
|
238
238
|
font-family: Gilroy;
|
|
239
239
|
font-weight: bold;
|
|
240
|
-
color: black;
|
|
241
240
|
font-size: 14px;
|
|
242
241
|
font-weight: 600;
|
|
243
242
|
line-height: 20px;
|
|
@@ -260,6 +259,10 @@
|
|
|
260
259
|
background: white;
|
|
261
260
|
}
|
|
262
261
|
|
|
262
|
+
.newMoocTitleContainer {
|
|
263
|
+
width: 100%;
|
|
264
|
+
}
|
|
265
|
+
|
|
263
266
|
.titleContainer {
|
|
264
267
|
display: flex;
|
|
265
268
|
align-items: center;
|
|
@@ -6,6 +6,7 @@ declare const RadioWithTitle: {
|
|
|
6
6
|
title: import("prop-types").Validator<NonNullable<import("prop-types").InferProps<{
|
|
7
7
|
title: import("prop-types").Requireable<string>;
|
|
8
8
|
subtitle: import("prop-types").Requireable<string>;
|
|
9
|
+
ariaLabel: import("prop-types").Requireable<string>;
|
|
9
10
|
type: import("prop-types").Requireable<string>;
|
|
10
11
|
'data-name': import("prop-types").Requireable<string>;
|
|
11
12
|
titleSize: import("prop-types").Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -4,6 +4,7 @@ export declare const propTypes: {
|
|
|
4
4
|
title: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
5
5
|
title: PropTypes.Requireable<string>;
|
|
6
6
|
subtitle: PropTypes.Requireable<string>;
|
|
7
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
7
8
|
type: PropTypes.Requireable<string>;
|
|
8
9
|
'data-name': PropTypes.Requireable<string>;
|
|
9
10
|
titleSize: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
package/es/atom/title/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare namespace Title {
|
|
|
4
4
|
const propTypes: {
|
|
5
5
|
title: PropTypes.Requireable<string>;
|
|
6
6
|
subtitle: PropTypes.Requireable<string>;
|
|
7
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
7
8
|
type: PropTypes.Requireable<string>;
|
|
8
9
|
'data-name': PropTypes.Requireable<string>;
|
|
9
10
|
titleSize: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";AAsDA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/title/index.js"],"names":[],"mappings":";AAsDA,gDAyCC"}
|
package/es/atom/title/index.js
CHANGED
|
@@ -61,7 +61,8 @@ const Title = props => {
|
|
|
61
61
|
icon,
|
|
62
62
|
tag,
|
|
63
63
|
button,
|
|
64
|
-
required
|
|
64
|
+
required,
|
|
65
|
+
ariaLabel
|
|
65
66
|
} = props;
|
|
66
67
|
const titleStyle = getTitleStyle(type, titleSize);
|
|
67
68
|
const subtitleStyle = getSubtitleStyle(type, subtitleSize);
|
|
@@ -83,7 +84,8 @@ const Title = props => {
|
|
|
83
84
|
className: style.titleContent
|
|
84
85
|
}, /*#__PURE__*/React.createElement("div", {
|
|
85
86
|
className: titleStyle,
|
|
86
|
-
"data-name": dataName
|
|
87
|
+
"data-name": dataName,
|
|
88
|
+
"aria-label": ariaLabel
|
|
87
89
|
}, title, required ? /*#__PURE__*/React.createElement("span", {
|
|
88
90
|
className: style.required
|
|
89
91
|
}, "*") : null, tag ? /*#__PURE__*/React.createElement(Tag, tag) : null), subtitleSection), !_isEmpty(button) ? /*#__PURE__*/React.createElement(ButtonLink, button) : null));
|
|
@@ -91,6 +93,7 @@ const Title = props => {
|
|
|
91
93
|
Title.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
92
94
|
title: PropTypes.string,
|
|
93
95
|
subtitle: PropTypes.string,
|
|
96
|
+
ariaLabel: PropTypes.string,
|
|
94
97
|
type: PropTypes.oneOf(['page', 'form-group']),
|
|
95
98
|
'data-name': PropTypes.string,
|
|
96
99
|
titleSize: PropTypes.oneOf(['xl-strong', 'standard', 'standard-light-weight', 'medium', 'medium-light-color', 'small', 'small-and-light']),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","PropTypes","Icon","Tag","ButtonLink","style","getTitleStyle","type","size","titlePage","titleFormGroup","titleFormGroupLightWeight","xlStrongTitle","mediumTitleFormGroup","mediumAndLightColorTitleFormGroup","smallTitleFormGroup","smallAndLightTitleFormGroup","getSubtitleStyle","subtitlePage","subtitleFormGroup","subtitleFormGroupWithoutMargin","mediumSubtitleFormGroup","smallSubtitleFormGroup","smallSubtitleFormGroupWithoutMargin","extraSmallSubtitleFormGroup","Title","props","title","subtitle","dataName","titleSize","subtitleSize","icon","tag","button","required","titleStyle","subtitleStyle","subtitleSection","createElement","className","dangerouslySetInnerHTML","__html","container","_extends","titleContainer","titleContent","_isEmpty","propTypes","process","env","NODE_ENV","string","oneOf","shape","bool"],"sources":["../../../src/atom/title/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport Icon from '../icon';\nimport Tag from '../tag';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\n\nconst getTitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.titlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.titleFormGroup;\n case 'standard-light-weight':\n return style.titleFormGroupLightWeight;\n case 'xl-strong':\n return style.xlStrongTitle;\n case 'medium':\n return style.mediumTitleFormGroup;\n case 'medium-light-color':\n return style.mediumAndLightColorTitleFormGroup;\n case 'small':\n return style.smallTitleFormGroup;\n case 'small-and-light':\n return style.smallAndLightTitleFormGroup;\n }\n }\n};\n\nconst getSubtitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.subtitlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.subtitleFormGroup;\n case 'standard-without-margin':\n return style.subtitleFormGroupWithoutMargin;\n case 'medium':\n return style.mediumSubtitleFormGroup;\n case 'small':\n return style.smallSubtitleFormGroup;\n case 'small-without-margin':\n return style.smallSubtitleFormGroupWithoutMargin;\n case 'extra-small':\n return style.extraSmallSubtitleFormGroup;\n }\n }\n};\n\nconst Title = props => {\n const {\n title,\n subtitle,\n type,\n 'data-name': dataName,\n titleSize = 'standard',\n subtitleSize = 'standard',\n icon,\n tag,\n button,\n required\n } = props;\n const titleStyle = getTitleStyle(type, titleSize);\n const subtitleStyle = getSubtitleStyle(type, subtitleSize);\n\n const subtitleSection = subtitle ? (\n <div\n className={subtitleStyle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: subtitle}}\n />\n ) : null;\n\n return (\n <div className={style.container}>\n {icon ? <Icon {...icon} className={style.icon} /> : null}\n <div className={style.titleContainer}>\n <div className={style.titleContent}>\n <div className={titleStyle} data-name={dataName}>\n {title}\n {required ? <span className={style.required}>*</span> : null}\n {tag ? <Tag {...tag} /> : null}\n </div>\n {subtitleSection}\n </div>\n {!isEmpty(button) ? <ButtonLink {...button} /> : null}\n </div>\n </div>\n );\n};\n\nTitle.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n type: PropTypes.oneOf(['page', 'form-group']),\n 'data-name': PropTypes.string,\n titleSize: PropTypes.oneOf([\n 'xl-strong',\n 'standard',\n 'standard-light-weight',\n 'medium',\n 'medium-light-color',\n 'small',\n 'small-and-light'\n ]),\n subtitleSize: PropTypes.oneOf([\n 'standard',\n 'standard-without-margin',\n 'medium',\n 'small',\n 'small-without-margin',\n 'extra-small'\n ]),\n icon: PropTypes.shape(Icon.propTypes),\n tag: PropTypes.shape(Tag.propTypes),\n button: PropTypes.shape(ButtonLink.propTypes),\n required: PropTypes.bool\n};\nexport default Title;\n"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;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AAK,GAAGC,KAAK,IAAI;EACrB,MAAM;IACJC,KAAK;IACLC,QAAQ;IACRrB,IAAI;IACJ,WAAW,EAAEsB,QAAQ;IACrBC,SAAS,GAAG,UAAU;IACtBC,YAAY,GAAG,UAAU;IACzBC,IAAI;IACJC,GAAG;IACHC,MAAM;IACNC;EACF,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","PropTypes","Icon","Tag","ButtonLink","style","getTitleStyle","type","size","titlePage","titleFormGroup","titleFormGroupLightWeight","xlStrongTitle","mediumTitleFormGroup","mediumAndLightColorTitleFormGroup","smallTitleFormGroup","smallAndLightTitleFormGroup","getSubtitleStyle","subtitlePage","subtitleFormGroup","subtitleFormGroupWithoutMargin","mediumSubtitleFormGroup","smallSubtitleFormGroup","smallSubtitleFormGroupWithoutMargin","extraSmallSubtitleFormGroup","Title","props","title","subtitle","dataName","titleSize","subtitleSize","icon","tag","button","required","ariaLabel","titleStyle","subtitleStyle","subtitleSection","createElement","className","dangerouslySetInnerHTML","__html","container","_extends","titleContainer","titleContent","_isEmpty","propTypes","process","env","NODE_ENV","string","oneOf","shape","bool"],"sources":["../../../src/atom/title/index.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty} from 'lodash/fp';\nimport Icon from '../icon';\nimport Tag from '../tag';\nimport ButtonLink from '../button-link';\nimport style from './style.css';\n\nconst getTitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.titlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.titleFormGroup;\n case 'standard-light-weight':\n return style.titleFormGroupLightWeight;\n case 'xl-strong':\n return style.xlStrongTitle;\n case 'medium':\n return style.mediumTitleFormGroup;\n case 'medium-light-color':\n return style.mediumAndLightColorTitleFormGroup;\n case 'small':\n return style.smallTitleFormGroup;\n case 'small-and-light':\n return style.smallAndLightTitleFormGroup;\n }\n }\n};\n\nconst getSubtitleStyle = (type, size) => {\n switch (type) {\n case 'page':\n return style.subtitlePage;\n case 'form-group':\n switch (size) {\n case 'standard':\n return style.subtitleFormGroup;\n case 'standard-without-margin':\n return style.subtitleFormGroupWithoutMargin;\n case 'medium':\n return style.mediumSubtitleFormGroup;\n case 'small':\n return style.smallSubtitleFormGroup;\n case 'small-without-margin':\n return style.smallSubtitleFormGroupWithoutMargin;\n case 'extra-small':\n return style.extraSmallSubtitleFormGroup;\n }\n }\n};\n\nconst Title = props => {\n const {\n title,\n subtitle,\n type,\n 'data-name': dataName,\n titleSize = 'standard',\n subtitleSize = 'standard',\n icon,\n tag,\n button,\n required,\n ariaLabel\n } = props;\n const titleStyle = getTitleStyle(type, titleSize);\n const subtitleStyle = getSubtitleStyle(type, subtitleSize);\n\n const subtitleSection = subtitle ? (\n <div\n className={subtitleStyle}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: subtitle}}\n />\n ) : null;\n\n return (\n <div className={style.container}>\n {icon ? <Icon {...icon} className={style.icon} /> : null}\n <div className={style.titleContainer}>\n <div className={style.titleContent}>\n <div className={titleStyle} data-name={dataName} aria-label={ariaLabel}>\n {title}\n {required ? <span className={style.required}>*</span> : null}\n {tag ? <Tag {...tag} /> : null}\n </div>\n {subtitleSection}\n </div>\n {!isEmpty(button) ? <ButtonLink {...button} /> : null}\n </div>\n </div>\n );\n};\n\nTitle.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n ariaLabel: PropTypes.string,\n type: PropTypes.oneOf(['page', 'form-group']),\n 'data-name': PropTypes.string,\n titleSize: PropTypes.oneOf([\n 'xl-strong',\n 'standard',\n 'standard-light-weight',\n 'medium',\n 'medium-light-color',\n 'small',\n 'small-and-light'\n ]),\n subtitleSize: PropTypes.oneOf([\n 'standard',\n 'standard-without-margin',\n 'medium',\n 'small',\n 'small-without-margin',\n 'extra-small'\n ]),\n icon: PropTypes.shape(Icon.propTypes),\n tag: PropTypes.shape(Tag.propTypes),\n button: PropTypes.shape(ButtonLink.propTypes),\n required: PropTypes.bool\n};\nexport default Title;\n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AG,EAAK8B,GAAM,CAAC,GAAG,IACvB,CAAC,EACLM,eACE,CAAC,EACL,CAACS,QAAA,CAAQd,MAAM,CAAC,gBAAGlC,KAAA,CAAAwC,aAAA,CAACpC,UAAU,EAAK8B,MAAS,CAAC,GAAG,IAC9C,CACF,CAAC;AAEV,CAAC;AAEDT,KAAK,CAACwB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EAChBzB,KAAK,EAAE1B,SAAS,CAACoD,MAAM;EACvBzB,QAAQ,EAAE3B,SAAS,CAACoD,MAAM;EAC1BjB,SAAS,EAAEnC,SAAS,CAACoD,MAAM;EAC3B9C,IAAI,EAAEN,SAAS,CAACqD,KAAK,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;EAC7C,WAAW,EAAErD,SAAS,CAACoD,MAAM;EAC7BvB,SAAS,EAAE7B,SAAS,CAACqD,KAAK,CAAC,CACzB,WAAW,EACX,UAAU,EACV,uBAAuB,EACvB,QAAQ,EACR,oBAAoB,EACpB,OAAO,EACP,iBAAiB,CAClB,CAAC;EACFvB,YAAY,EAAE9B,SAAS,CAACqD,KAAK,CAAC,CAC5B,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,OAAO,EACP,sBAAsB,EACtB,aAAa,CACd,CAAC;EACFtB,IAAI,EAAE/B,SAAS,CAACsD,KAAK,CAACrD,IAAI,CAAC+C,SAAS,CAAC;EACrChB,GAAG,EAAEhC,SAAS,CAACsD,KAAK,CAACpD,GAAG,CAAC8C,SAAS,CAAC;EACnCf,MAAM,EAAEjC,SAAS,CAACsD,KAAK,CAACnD,UAAU,CAAC6C,SAAS,CAAC;EAC7Cd,QAAQ,EAAElC,SAAS,CAACuD;AACtB,CAAC;AACD,eAAe/B,KAAK","ignoreList":[]}
|
|
@@ -26,6 +26,7 @@ declare namespace BaseModal {
|
|
|
26
26
|
}
|
|
27
27
|
namespace propTypes {
|
|
28
28
|
const title: PropTypes.Requireable<string>;
|
|
29
|
+
const titleAriaLabel: PropTypes.Requireable<string>;
|
|
29
30
|
const headerIcon: PropTypes.Requireable<PropTypes.InferProps<{
|
|
30
31
|
name: PropTypes.Requireable<string>;
|
|
31
32
|
color: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";AAWA,yEAiMC"}
|
|
@@ -5,6 +5,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
5
5
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { convert } from 'css-color-function';
|
|
8
|
+
import classnames from 'classnames';
|
|
8
9
|
import Provider from '../../atom/provider';
|
|
9
10
|
import Icon from '../../atom/icon';
|
|
10
11
|
import ButtonLink from '../../atom/button-link';
|
|
@@ -13,6 +14,7 @@ import style from './style.css';
|
|
|
13
14
|
const BaseModal = (props, context) => {
|
|
14
15
|
const {
|
|
15
16
|
title,
|
|
17
|
+
titleAriaLabel,
|
|
16
18
|
description,
|
|
17
19
|
headerIcon,
|
|
18
20
|
children,
|
|
@@ -154,7 +156,7 @@ const BaseModal = (props, context) => {
|
|
|
154
156
|
className: style.modal,
|
|
155
157
|
style: customStyle
|
|
156
158
|
}, /*#__PURE__*/React.createElement("header", {
|
|
157
|
-
className: style.header
|
|
159
|
+
className: classnames(style.header, !description && style.headerCentered)
|
|
158
160
|
}, headerIcon?.name ? /*#__PURE__*/React.createElement("div", {
|
|
159
161
|
className: style.headerIcon
|
|
160
162
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -168,7 +170,8 @@ const BaseModal = (props, context) => {
|
|
|
168
170
|
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
169
171
|
className: style.headerContent
|
|
170
172
|
}, /*#__PURE__*/React.createElement("div", {
|
|
171
|
-
className: style.headerTitle
|
|
173
|
+
className: style.headerTitle,
|
|
174
|
+
"aria-label": titleAriaLabel
|
|
172
175
|
}, title), description ? /*#__PURE__*/React.createElement("div", {
|
|
173
176
|
className: style.headerDescription
|
|
174
177
|
}, description) : null), /*#__PURE__*/React.createElement("div", {
|
|
@@ -194,6 +197,7 @@ BaseModal.contextTypes = {
|
|
|
194
197
|
};
|
|
195
198
|
BaseModal.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
196
199
|
title: PropTypes.string,
|
|
200
|
+
titleAriaLabel: PropTypes.string,
|
|
197
201
|
headerIcon: PropTypes.shape({
|
|
198
202
|
name: PropTypes.string,
|
|
199
203
|
color: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","PropTypes","convert","Provider","Icon","ButtonLink","COLORS","style","BaseModal","props","context","title","description","headerIcon","children","isOpen","footer","onClose","onScroll","detectScrollbar","customStyle","skin","bodyRef","isScrollbarVisible","setIsScrollbarVisible","checkScrollbar","bodyElement","current","scrollHeight","clientHeight","debouncedCheckScrollbar","_debounce","mutationObserver","MutationObserver","observe","childList","subtree","resizeObserver","ResizeObserver","disconnect","cancel","handleEscape","event","key","document","addEventListener","removeEventListener","Footer","_isEmpty","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","color","buttonConfirmColor","_get","createElement","className","footerCTAWrapper","button","type","onClick","_extends","backgroundColor","paddingLeft","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","size","padding","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","iconColor","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","ref","body","bodyWithoutScrollbar","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","node","bool","oneOfType","func","boolean","objectOf","number"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get, debounce} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {\n title,\n description,\n headerIcon,\n children,\n isOpen,\n footer,\n onClose,\n onScroll,\n detectScrollbar = false,\n customStyle\n } = props;\n const {skin} = context;\n const bodyRef = useRef(null);\n const [isScrollbarVisible, setIsScrollbarVisible] = useState(!detectScrollbar);\n\n const checkScrollbar = () => {\n const bodyElement = bodyRef.current;\n if (bodyElement) {\n setIsScrollbarVisible(bodyElement.scrollHeight > bodyElement.clientHeight);\n }\n };\n\n useEffect(() => {\n if (!detectScrollbar) return;\n const bodyElement = bodyRef.current;\n\n if (!bodyElement) return;\n\n const debouncedCheckScrollbar = debounce(100, () => {\n checkScrollbar();\n });\n\n // Observer of the body content\n const mutationObserver = new MutationObserver(() => {\n debouncedCheckScrollbar();\n });\n\n mutationObserver.observe(bodyElement, {childList: true, subtree: true});\n\n // Observer of the body size\n const resizeObserver = new ResizeObserver(() => {\n debouncedCheckScrollbar();\n });\n\n if (bodyRef.current) {\n resizeObserver.observe(bodyRef.current);\n }\n\n checkScrollbar();\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n debouncedCheckScrollbar.cancel();\n };\n }, [children, detectScrollbar]);\n\n // Handle escape key press\n useEffect(() => {\n if (!isOpen || !onClose) return;\n\n const handleEscape = event => {\n if (event.key === 'Escape') {\n onClose();\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => {\n document.removeEventListener('keydown', handleEscape);\n };\n }, [isOpen, onClose]);\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName,\n color\n } = confirmButton || {};\n const buttonConfirmColor = color || get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.button,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled,\n 'data-testid': `button-link-${cancelLabel}`\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div>\n <ButtonLink\n {...{\n customStyle: {backgroundColor: buttonConfirmColor, paddingLeft: '16px'},\n hoverBackgroundColor: convert(\n `hsl(from ${buttonConfirmColor} h s calc(l*(1 - 0.08)))`\n ),\n hoverColor: COLORS.white,\n className: style.button,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: COLORS.white,\n size: 14,\n customStyle: {padding: 0}\n }\n }\n }\n : {}),\n 'data-testid': `button-link-${confirmLabel}`\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, skin]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper} data-testid=\"modal\">\n <div className={style.modal} style={customStyle}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose} data-testid=\"close-icon\">\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div\n ref={bodyRef}\n className={isScrollbarVisible ? style.body : style.bodyWithoutScrollbar}\n onScroll={onScroll}\n data-testid=\"modal-body\"\n >\n {children}\n </div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool,\n color: PropTypes.string\n })\n })\n ]),\n onClose: PropTypes.func,\n onScroll: PropTypes.func,\n detectScrollbar: PropTypes.bool,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default BaseModal;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,OAAO;AACrE,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,SAAS,GAA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;EACxB9F,MAAM,EAAEd,SAAS,CAAC6G,IAAI;EACtB9F,MAAM,EAAEf,SAAS,CAAC8G,SAAS,CAAC,CAC1B9G,SAAS,CAAC+G,IAAI,EACd/G,SAAS,CAAC2G,KAAK,CAAC;IACdzD,IAAI,EAAElD,SAAS,CAAC0G,MAAM;IACtBvD,OAAO,EAAEnD,SAAS,CAACgH,OAAO;IAC1BhE,YAAY,EAAEhD,SAAS,CAAC2G,KAAK,CAAC;MAC5BvD,KAAK,EAAEpD,SAAS,CAAC0G,MAAM;MACvBpD,QAAQ,EAAEtD,SAAS,CAAC+G,IAAI;MACxBxD,QAAQ,EAAEvD,SAAS,CAAC6G;IACtB,CAAC,CAAC;IACF5D,aAAa,EAAEjD,SAAS,CAAC2G,KAAK,CAAC;MAC7BvD,KAAK,EAAEpD,SAAS,CAAC0G,MAAM;MACvBhD,SAAS,EAAE1D,SAAS,CAAC+G,IAAI;MACzBnD,QAAQ,EAAE5D,SAAS,CAAC0G,MAAM;MAC1BnD,QAAQ,EAAEvD,SAAS,CAAC6G,IAAI;MACxBhD,KAAK,EAAE7D,SAAS,CAAC0G;IACnB,CAAC;EACH,CAAC,CAAC,CACH,CAAC;EACF1F,OAAO,EAAEhB,SAAS,CAAC+G,IAAI;EACvB9F,QAAQ,EAAEjB,SAAS,CAAC+G,IAAI;EACxB7F,eAAe,EAAElB,SAAS,CAAC6G,IAAI;EAC/B1F,WAAW,EAAEnB,SAAS,CAACiH,QAAQ,CAACjH,SAAS,CAAC8G,SAAS,CAAC,CAAC9G,SAAS,CAAC0G,MAAM,EAAE1G,SAAS,CAACkH,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,eAAe3G,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","PropTypes","convert","classnames","Provider","Icon","ButtonLink","COLORS","style","BaseModal","props","context","title","titleAriaLabel","description","headerIcon","children","isOpen","footer","onClose","onScroll","detectScrollbar","customStyle","skin","bodyRef","isScrollbarVisible","setIsScrollbarVisible","checkScrollbar","bodyElement","current","scrollHeight","clientHeight","debouncedCheckScrollbar","_debounce","mutationObserver","MutationObserver","observe","childList","subtree","resizeObserver","ResizeObserver","disconnect","cancel","handleEscape","event","key","document","addEventListener","removeEventListener","Footer","_isEmpty","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","color","buttonConfirmColor","_get","createElement","className","footerCTAWrapper","button","type","onClick","_extends","backgroundColor","paddingLeft","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","size","padding","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","headerCentered","iconColor","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","ref","body","bodyWithoutScrollbar","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","node","bool","oneOfType","func","boolean","objectOf","number"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get, debounce} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport classnames from 'classnames';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {\n title,\n titleAriaLabel,\n description,\n headerIcon,\n children,\n isOpen,\n footer,\n onClose,\n onScroll,\n detectScrollbar = false,\n customStyle\n } = props;\n const {skin} = context;\n const bodyRef = useRef(null);\n const [isScrollbarVisible, setIsScrollbarVisible] = useState(!detectScrollbar);\n\n const checkScrollbar = () => {\n const bodyElement = bodyRef.current;\n if (bodyElement) {\n setIsScrollbarVisible(bodyElement.scrollHeight > bodyElement.clientHeight);\n }\n };\n\n useEffect(() => {\n if (!detectScrollbar) return;\n const bodyElement = bodyRef.current;\n\n if (!bodyElement) return;\n\n const debouncedCheckScrollbar = debounce(100, () => {\n checkScrollbar();\n });\n\n // Observer of the body content\n const mutationObserver = new MutationObserver(() => {\n debouncedCheckScrollbar();\n });\n\n mutationObserver.observe(bodyElement, {childList: true, subtree: true});\n\n // Observer of the body size\n const resizeObserver = new ResizeObserver(() => {\n debouncedCheckScrollbar();\n });\n\n if (bodyRef.current) {\n resizeObserver.observe(bodyRef.current);\n }\n\n checkScrollbar();\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n debouncedCheckScrollbar.cancel();\n };\n }, [children, detectScrollbar]);\n\n // Handle escape key press\n useEffect(() => {\n if (!isOpen || !onClose) return;\n\n const handleEscape = event => {\n if (event.key === 'Escape') {\n onClose();\n }\n };\n\n document.addEventListener('keydown', handleEscape);\n return () => {\n document.removeEventListener('keydown', handleEscape);\n };\n }, [isOpen, onClose]);\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName,\n color\n } = confirmButton || {};\n const buttonConfirmColor = color || get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.button,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled,\n 'data-testid': `button-link-${cancelLabel}`\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div>\n <ButtonLink\n {...{\n customStyle: {backgroundColor: buttonConfirmColor, paddingLeft: '16px'},\n hoverBackgroundColor: convert(\n `hsl(from ${buttonConfirmColor} h s calc(l*(1 - 0.08)))`\n ),\n hoverColor: COLORS.white,\n className: style.button,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: COLORS.white,\n size: 14,\n customStyle: {padding: 0}\n }\n }\n }\n : {}),\n 'data-testid': `button-link-${confirmLabel}`\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, skin]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper} data-testid=\"modal\">\n <div className={style.modal} style={customStyle}>\n <header className={classnames(style.header, !description && style.headerCentered)}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle} aria-label={titleAriaLabel}>\n {title}\n </div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose} data-testid=\"close-icon\">\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div\n ref={bodyRef}\n className={isScrollbarVisible ? style.body : style.bodyWithoutScrollbar}\n onScroll={onScroll}\n data-testid=\"modal-body\"\n >\n {children}\n </div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n titleAriaLabel: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool,\n color: PropTypes.string\n })\n })\n ]),\n onClose: PropTypes.func,\n onScroll: PropTypes.func,\n detectScrollbar: PropTypes.bool,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default BaseModal;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,OAAO;AACrE,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,SAAS,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EACpC,MAAM;IACJC,KAAK;IACLC,cAAc;IACdC,WAAW;IACXC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,QAAQ;IACRC,eAAe,GAAG,KAAK;IACvBC;EACF,CAAC,GAAGZ,KAAK;EACT,MAAM;IAACa;EAAI,CAAC,GAAGZ,OAAO;EACtB,MAAMa,OAAO,GAAGzB,MAAM,CAAC,IAAI,CAAC;EAC5B,MAAM,CAAC0B,kBAAkB,EAAEC,qBAAqB,CAAC,GAAG1B,QAAQ,CAAC,CAACqB,eAAe,CAAC;EAE9E,MAAMM,cAAc,GAAGA,CAAA,KAAM;IAC3B,MAAMC,WAAW,GAAGJ,OAAO,CAACK,OAAO;IACnC,IAAID,WAAW,EAAE;MACfF,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IAAI;MACxBzD,QAAQ,EAAEzD,SAAS,CAACgH;IACtB,CAAC,CAAC;IACF7D,aAAa,EAAEnD,SAAS,CAAC8G,KAAK,CAAC;MAC7BxD,KAAK,EAAEtD,SAAS,CAAC6G,MAAM;MACvBjD,SAAS,EAAE5D,SAAS,CAACkH,IAAI;MACzBpD,QAAQ,EAAE9D,SAAS,CAAC6G,MAAM;MAC1BpD,QAAQ,EAAEzD,SAAS,CAACgH,IAAI;MACxBjD,KAAK,EAAE/D,SAAS,CAAC6G;IACnB,CAAC;EACH,CAAC,CAAC,CACH,CAAC;EACF3F,OAAO,EAAElB,SAAS,CAACkH,IAAI;EACvB/F,QAAQ,EAAEnB,SAAS,CAACkH,IAAI;EACxB9F,eAAe,EAAEpB,SAAS,CAACgH,IAAI;EAC/B3F,WAAW,EAAErB,SAAS,CAACoH,QAAQ,CAACpH,SAAS,CAACiH,SAAS,CAAC,CAACjH,SAAS,CAAC6G,MAAM,EAAE7G,SAAS,CAACqH,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,eAAe7G,SAAS","ignoreList":[]}
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
position: relative;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
.headerCentered {
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
.headerIcon {
|
|
41
45
|
border-radius: 12px;
|
|
42
46
|
overflow: hidden;
|
|
@@ -103,6 +107,7 @@
|
|
|
103
107
|
.button {
|
|
104
108
|
border-radius: 12px;
|
|
105
109
|
font-weight: 600;
|
|
110
|
+
white-space: nowrap;
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
@media mobile {
|
|
@@ -12,6 +12,7 @@ declare const propTypes: {
|
|
|
12
12
|
title: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
13
|
title: PropTypes.Requireable<string>;
|
|
14
14
|
subtitle: PropTypes.Requireable<string>;
|
|
15
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
15
16
|
type: PropTypes.Requireable<string>;
|
|
16
17
|
'data-name': PropTypes.Requireable<string>;
|
|
17
18
|
titleSize: PropTypes.Requireable<string>;
|
|
@@ -575,6 +576,7 @@ declare const propTypes: {
|
|
|
575
576
|
title: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
576
577
|
title: PropTypes.Requireable<string>;
|
|
577
578
|
subtitle: PropTypes.Requireable<string>;
|
|
579
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
578
580
|
type: PropTypes.Requireable<string>;
|
|
579
581
|
'data-name': PropTypes.Requireable<string>;
|
|
580
582
|
titleSize: PropTypes.Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE3D,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAKnC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAC,SAAS,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE3D,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,MAAM,CAAC;QACzB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IAC1D,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;QACzB,IAAI,EACA,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,GAChD,SAAS,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,SAAS,CAAC,CAAC;KACtD,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;CACpD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -5,17 +5,22 @@ declare const MultiFilterPanel: {
|
|
|
5
5
|
(props: MultiFilterPanelProps, context: WebContextValues): JSX.Element;
|
|
6
6
|
propTypes: {
|
|
7
7
|
title: import("prop-types").Requireable<string>;
|
|
8
|
+
showSelectedFilters: import("prop-types").Requireable<boolean>;
|
|
8
9
|
onClearAll: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
10
|
+
onRemoveSelectedFilter: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
9
11
|
options: import("prop-types").Requireable<(NonNullable<import("prop-types").InferProps<{
|
|
10
12
|
type: import("prop-types").Requireable<string>;
|
|
11
13
|
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
12
14
|
title: import("prop-types").Requireable<string>;
|
|
15
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
13
16
|
onClear: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
17
|
options: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
15
18
|
label: import("prop-types").Requireable<string>;
|
|
16
19
|
type: import("prop-types").Requireable<string>;
|
|
20
|
+
textColor: import("prop-types").Requireable<string>;
|
|
17
21
|
selected: import("prop-types").Requireable<boolean>;
|
|
18
22
|
icon: import("prop-types").Requireable<string>;
|
|
23
|
+
customIcon: import("prop-types").Requireable<string>;
|
|
19
24
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
20
25
|
}> | null | undefined)[]>;
|
|
21
26
|
}>>;
|
|
@@ -23,6 +28,7 @@ declare const MultiFilterPanel: {
|
|
|
23
28
|
type: import("prop-types").Requireable<string>;
|
|
24
29
|
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
25
30
|
title: import("prop-types").Requireable<string>;
|
|
31
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
26
32
|
onClear: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
27
33
|
options: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
28
34
|
label: import("prop-types").Requireable<string>;
|
|
@@ -46,6 +52,20 @@ declare const MultiFilterPanel: {
|
|
|
46
52
|
searchIconAriaLabel: import("prop-types").Requireable<string>;
|
|
47
53
|
}>>;
|
|
48
54
|
}>>;
|
|
55
|
+
}> | import("prop-types").InferProps<{
|
|
56
|
+
type: import("prop-types").Requireable<string>;
|
|
57
|
+
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
58
|
+
title: import("prop-types").Validator<string>;
|
|
59
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
60
|
+
onClear: import("prop-types").Validator<(...args: any[]) => any>;
|
|
61
|
+
options: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
62
|
+
label: import("prop-types").Validator<string>;
|
|
63
|
+
value: import("prop-types").Validator<boolean>;
|
|
64
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
65
|
+
theme: import("prop-types").Validator<string>;
|
|
66
|
+
ariaLabel: import("prop-types").Validator<string>;
|
|
67
|
+
}> | null | undefined)[]>;
|
|
68
|
+
}>>;
|
|
49
69
|
}> | null | undefined> | null | undefined)[]>;
|
|
50
70
|
};
|
|
51
71
|
contextTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/multi-filter-panel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/multi-filter-panel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,qBAAqB,EAAqC,MAAM,cAAc,CAAC;AA+ClG,QAAA,MAAM,gBAAgB;YAAW,qBAAqB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDhF,CAAC;AAQF,eAAe,gBAAgB,CAAC"}
|