@coorpacademy/components 11.42.0 → 11.42.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/checkbox-with-title/index.d.ts +1 -0
- package/es/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/es/atom/checkbox-with-title/index.js +6 -3
- package/es/atom/checkbox-with-title/index.js.map +1 -1
- package/es/atom/radio-group/index.d.ts +13 -7
- package/es/atom/radio-group/index.d.ts.map +1 -1
- package/es/atom/radio-group/index.js +51 -0
- package/es/atom/radio-group/index.js.map +1 -1
- package/es/atom/radio-group/style.css +37 -0
- package/es/atom/radio-with-title/index.d.ts +3 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/index.js +23 -5
- package/es/atom/radio-with-title/index.js.map +1 -1
- package/es/atom/radio-with-title/style.css +27 -0
- package/es/atom/radio-with-title/types.d.ts +6 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.js +3 -0
- package/es/atom/radio-with-title/types.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +20 -3
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +17 -0
- package/es/molecule/cm-popin/types.d.ts +36 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/cm-popin/types.js +3 -0
- package/es/molecule/cm-popin/types.js.map +1 -1
- package/es/molecule/draggable-list/index.d.ts +12 -0
- package/es/molecule/progress-bar/index.d.ts +16 -7
- package/es/molecule/progress-bar/index.d.ts.map +1 -1
- package/es/molecule/progress-bar/index.js +61 -4
- package/es/molecule/progress-bar/index.js.map +1 -1
- package/es/molecule/progress-bar/style.css +56 -0
- package/es/molecule/setup-section/index.d.ts +6 -0
- package/es/molecule/setup-sections/index.d.ts +6 -0
- package/es/molecule/table/index.d.ts +8 -0
- package/es/molecule/table/index.d.ts.map +1 -1
- package/es/molecule/table/index.js +43 -5
- package/es/molecule/table/index.js.map +1 -1
- package/es/molecule/table/style.css +24 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +3 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +3 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/molecule/wizard-summary/index.d.ts +3 -0
- package/es/molecule/wizard-summary/index.d.ts.map +1 -1
- package/es/molecule/wizard-summary/index.js +35 -3
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +54 -1
- package/es/organism/assignment-audience/index.d.ts +23 -11
- package/es/organism/assignment-audience/index.d.ts.map +1 -1
- package/es/organism/assignment-audience/index.js +100 -59
- package/es/organism/assignment-audience/index.js.map +1 -1
- package/es/organism/assignment-audience/types.d.ts +39 -15
- package/es/organism/assignment-audience/types.d.ts.map +1 -1
- package/es/organism/assignment-audience/types.js +17 -5
- package/es/organism/assignment-audience/types.js.map +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +12 -0
- package/es/organism/brand-table/index.d.ts +8 -0
- package/es/organism/content-selection-list/index.d.ts +95 -0
- package/es/organism/content-selection-list/index.d.ts.map +1 -0
- package/es/organism/content-selection-list/index.js +175 -0
- package/es/organism/content-selection-list/index.js.map +1 -0
- package/es/organism/content-selection-list/style.css +8 -0
- package/es/organism/content-selection-list/types.d.ts +113 -0
- package/es/organism/content-selection-list/types.d.ts.map +1 -0
- package/es/organism/content-selection-list/types.js +58 -0
- package/es/organism/content-selection-list/types.js.map +1 -0
- package/es/organism/content-skill-modal/index.d.ts +7 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +7 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.d.ts +13 -4
- package/es/organism/header-with-actions/index.d.ts.map +1 -1
- package/es/organism/header-with-actions/index.js +31 -6
- package/es/organism/header-with-actions/index.js.map +1 -1
- package/es/organism/header-with-actions/style.css +42 -0
- package/es/organism/header-with-actions/types.d.ts +24 -6
- package/es/organism/header-with-actions/types.d.ts.map +1 -1
- package/es/organism/header-with-actions/types.js +7 -2
- package/es/organism/header-with-actions/types.js.map +1 -1
- package/es/organism/list-item/index.d.ts +9 -1
- package/es/organism/list-item/index.d.ts.map +1 -1
- package/es/organism/list-item/index.js +16 -3
- package/es/organism/list-item/index.js.map +1 -1
- package/es/organism/list-item/style.css +15 -0
- package/es/organism/list-items/index.d.ts +7 -0
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/skill-edition/index.d.ts +8 -3
- package/es/organism/skill-edition/index.d.ts.map +1 -1
- package/es/organism/skill-edition/index.js +3 -168
- package/es/organism/skill-edition/index.js.map +1 -1
- package/es/organism/skill-edition/styles.d.ts +10 -0
- package/es/organism/skill-edition/styles.d.ts.map +1 -0
- package/es/organism/skill-edition/styles.js +10 -0
- package/es/organism/skill-edition/styles.js.map +1 -0
- package/es/organism/skill-edition/types.d.ts +10 -54
- package/es/organism/skill-edition/types.d.ts.map +1 -1
- package/es/organism/skill-edition/types.js +3 -52
- package/es/organism/skill-edition/types.js.map +1 -1
- package/es/organism/title-and-input/index.d.ts +1 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +1 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +4 -0
- package/es/template/app-player/loading/index.d.ts +33 -0
- package/es/template/app-player/player/index.d.ts +66 -0
- package/es/template/app-player/player/slides/index.d.ts +33 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +33 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +33 -0
- package/es/template/app-review/index.d.ts +33 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +33 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +33 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +120 -7
- package/es/template/back-office/brand-update/index.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.js +19 -4
- package/es/template/back-office/brand-update/index.js.map +1 -1
- package/es/template/back-office/brand-update/style.css +18 -0
- package/es/template/certification-detail/index.d.ts +33 -0
- package/es/template/common/dashboard/index.d.ts +66 -0
- package/es/template/common/search-page/index.d.ts +33 -0
- package/es/template/external-course/index.d.ts +33 -0
- package/es/template/playlist-detail/index.d.ts +33 -0
- package/lib/atom/checkbox-with-title/index.d.ts +1 -0
- package/lib/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/lib/atom/checkbox-with-title/index.js +6 -3
- package/lib/atom/checkbox-with-title/index.js.map +1 -1
- package/lib/atom/radio-group/index.d.ts +13 -7
- package/lib/atom/radio-group/index.d.ts.map +1 -1
- package/lib/atom/radio-group/index.js +51 -0
- package/lib/atom/radio-group/index.js.map +1 -1
- package/lib/atom/radio-group/style.css +37 -0
- package/lib/atom/radio-with-title/index.d.ts +3 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/index.js +23 -5
- package/lib/atom/radio-with-title/index.js.map +1 -1
- package/lib/atom/radio-with-title/style.css +27 -0
- package/lib/atom/radio-with-title/types.d.ts +6 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.js +3 -0
- package/lib/atom/radio-with-title/types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +20 -3
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +17 -0
- package/lib/molecule/cm-popin/types.d.ts +36 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/cm-popin/types.js +3 -0
- package/lib/molecule/cm-popin/types.js.map +1 -1
- package/lib/molecule/draggable-list/index.d.ts +12 -0
- package/lib/molecule/progress-bar/index.d.ts +16 -7
- package/lib/molecule/progress-bar/index.d.ts.map +1 -1
- package/lib/molecule/progress-bar/index.js +61 -4
- package/lib/molecule/progress-bar/index.js.map +1 -1
- package/lib/molecule/progress-bar/style.css +56 -0
- package/lib/molecule/setup-section/index.d.ts +6 -0
- package/lib/molecule/setup-sections/index.d.ts +6 -0
- package/lib/molecule/table/index.d.ts +8 -0
- package/lib/molecule/table/index.d.ts.map +1 -1
- package/lib/molecule/table/index.js +43 -5
- package/lib/molecule/table/index.js.map +1 -1
- package/lib/molecule/table/style.css +24 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +3 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +3 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/molecule/wizard-summary/index.d.ts +3 -0
- package/lib/molecule/wizard-summary/index.d.ts.map +1 -1
- package/lib/molecule/wizard-summary/index.js +35 -3
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +54 -1
- package/lib/organism/assignment-audience/index.d.ts +23 -11
- package/lib/organism/assignment-audience/index.d.ts.map +1 -1
- package/lib/organism/assignment-audience/index.js +100 -59
- package/lib/organism/assignment-audience/index.js.map +1 -1
- package/lib/organism/assignment-audience/types.d.ts +39 -15
- package/lib/organism/assignment-audience/types.d.ts.map +1 -1
- package/lib/organism/assignment-audience/types.js +17 -5
- package/lib/organism/assignment-audience/types.js.map +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +12 -0
- package/lib/organism/brand-table/index.d.ts +8 -0
- package/lib/organism/content-selection-list/index.d.ts +95 -0
- package/lib/organism/content-selection-list/index.d.ts.map +1 -0
- package/lib/organism/content-selection-list/index.js +181 -0
- package/lib/organism/content-selection-list/index.js.map +1 -0
- package/lib/organism/content-selection-list/style.css +8 -0
- package/lib/organism/content-selection-list/types.d.ts +113 -0
- package/lib/organism/content-selection-list/types.d.ts.map +1 -0
- package/lib/organism/content-selection-list/types.js +63 -0
- package/lib/organism/content-selection-list/types.js.map +1 -0
- package/lib/organism/content-skill-modal/index.d.ts +7 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +7 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.d.ts +13 -4
- package/lib/organism/header-with-actions/index.d.ts.map +1 -1
- package/lib/organism/header-with-actions/index.js +31 -6
- package/lib/organism/header-with-actions/index.js.map +1 -1
- package/lib/organism/header-with-actions/style.css +42 -0
- package/lib/organism/header-with-actions/types.d.ts +24 -6
- package/lib/organism/header-with-actions/types.d.ts.map +1 -1
- package/lib/organism/header-with-actions/types.js +7 -2
- package/lib/organism/header-with-actions/types.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +9 -1
- package/lib/organism/list-item/index.d.ts.map +1 -1
- package/lib/organism/list-item/index.js +16 -3
- package/lib/organism/list-item/index.js.map +1 -1
- package/lib/organism/list-item/style.css +15 -0
- package/lib/organism/list-items/index.d.ts +7 -0
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.d.ts +8 -3
- package/lib/organism/skill-edition/index.d.ts.map +1 -1
- package/lib/organism/skill-edition/index.js +11 -174
- package/lib/organism/skill-edition/index.js.map +1 -1
- package/lib/organism/skill-edition/styles.d.ts +10 -0
- package/lib/organism/skill-edition/styles.d.ts.map +1 -0
- package/lib/organism/skill-edition/styles.js +15 -0
- package/lib/organism/skill-edition/styles.js.map +1 -0
- package/lib/organism/skill-edition/types.d.ts +10 -54
- package/lib/organism/skill-edition/types.d.ts.map +1 -1
- package/lib/organism/skill-edition/types.js +6 -53
- package/lib/organism/skill-edition/types.js.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +1 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +1 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +4 -0
- package/lib/template/app-player/loading/index.d.ts +33 -0
- package/lib/template/app-player/player/index.d.ts +66 -0
- package/lib/template/app-player/player/slides/index.d.ts +33 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +33 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +33 -0
- package/lib/template/app-review/index.d.ts +33 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +33 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +33 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +120 -7
- package/lib/template/back-office/brand-update/index.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.js +19 -4
- package/lib/template/back-office/brand-update/index.js.map +1 -1
- package/lib/template/back-office/brand-update/style.css +18 -0
- package/lib/template/certification-detail/index.d.ts +33 -0
- package/lib/template/common/dashboard/index.d.ts +66 -0
- package/lib/template/common/search-page/index.d.ts +33 -0
- package/lib/template/external-course/index.d.ts +33 -0
- package/lib/template/playlist-detail/index.d.ts +33 -0
- package/locales/bs/global.json +2 -2
- package/locales/cs/global.json +2 -2
- package/locales/de/global.json +2 -2
- package/locales/es/global.json +2 -2
- package/locales/et/global.json +2 -2
- package/locales/fi/global.json +2 -2
- package/locales/fr/global.json +2 -2
- package/locales/hr/global.json +2 -2
- package/locales/hu/global.json +2 -2
- package/locales/hy/global.json +2 -2
- package/locales/it/global.json +2 -2
- package/locales/ja/global.json +2 -2
- package/locales/ko/global.json +2 -2
- package/locales/lt/global.json +2 -2
- package/locales/nl/global.json +2 -2
- package/locales/pl/global.json +2 -2
- package/locales/pt/global.json +2 -2
- package/locales/ro/global.json +2 -2
- package/locales/ru/global.json +2 -2
- package/locales/sk/global.json +2 -2
- package/locales/sl/global.json +2 -2
- package/locales/sv/global.json +2 -2
- package/locales/tl/global.json +2 -2
- package/locales/tr/global.json +2 -2
- package/locales/uk/global.json +2 -2
- package/locales/vi/global.json +2 -2
- package/locales/zh/global.json +2 -2
- package/locales/zh_TW/global.json +2 -2
- package/package.json +2 -2
|
@@ -17,6 +17,7 @@ declare namespace CheckboxWithTitle {
|
|
|
17
17
|
customStyle: PropTypes.Requireable<{
|
|
18
18
|
[x: string]: NonNullable<string | number | null | undefined> | null | undefined;
|
|
19
19
|
}>;
|
|
20
|
+
className: PropTypes.Requireable<string>;
|
|
20
21
|
};
|
|
21
22
|
namespace contextTypes {
|
|
22
23
|
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/checkbox-with-title/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/checkbox-with-title/index.js"],"names":[],"mappings":";AAWA,0EAkEC"}
|
|
@@ -3,6 +3,7 @@ import _noop from "lodash/fp/noop";
|
|
|
3
3
|
import _getOr from "lodash/fp/getOr";
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import classnames from 'classnames';
|
|
6
7
|
import FaIcon from '../icon';
|
|
7
8
|
import { COLORS } from '../../variables/colors';
|
|
8
9
|
import Provider from '../provider';
|
|
@@ -26,7 +27,8 @@ const CheckboxWithTitle = (props, context) => {
|
|
|
26
27
|
iconColor: 'white',
|
|
27
28
|
preset: 's'
|
|
28
29
|
},
|
|
29
|
-
customStyle = {}
|
|
30
|
+
customStyle = {},
|
|
31
|
+
className
|
|
30
32
|
} = props;
|
|
31
33
|
const {
|
|
32
34
|
skin
|
|
@@ -40,7 +42,7 @@ const CheckboxWithTitle = (props, context) => {
|
|
|
40
42
|
const idCheckbox = useMemo(() => _uniqueId('input-checkbox-'), []);
|
|
41
43
|
const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);
|
|
42
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: style.container,
|
|
45
|
+
className: classnames(style.container, className),
|
|
44
46
|
style: {
|
|
45
47
|
...customStyle
|
|
46
48
|
}
|
|
@@ -94,7 +96,8 @@ CheckboxWithTitle.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
94
96
|
iconColor: PropTypes.string,
|
|
95
97
|
preset: PropTypes.string
|
|
96
98
|
}),
|
|
97
|
-
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))
|
|
99
|
+
customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
100
|
+
className: PropTypes.string
|
|
98
101
|
} : {};
|
|
99
102
|
CheckboxWithTitle.contextTypes = {
|
|
100
103
|
skin: Provider.childContextTypes.skin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FaIcon","COLORS","Provider","style","DEFAULT_ICON_STYLE","padding","width","height","CheckboxWithTitle","props","context","value","title","name","checked","onChange","_noop","dataName","ariaLabel","icon","iconName","iconColor","preset","customStyle","skin","primaryColor","_getOr","cm_primary_blue","idCheckbox","_uniqueId","handleChange","e","target","createElement","
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","FaIcon","COLORS","Provider","style","DEFAULT_ICON_STYLE","padding","width","height","CheckboxWithTitle","props","context","value","title","name","checked","onChange","_noop","dataName","ariaLabel","icon","iconName","iconColor","preset","customStyle","className","skin","primaryColor","_getOr","cm_primary_blue","idCheckbox","_uniqueId","handleChange","e","target","createElement","container","htmlFor","type","id","checkbox","label","background","borderColor","dangerouslySetInnerHTML","__html","propTypes","process","env","NODE_ENV","string","bool","func","shape","objectOf","oneOfType","number","contextTypes","childContextTypes"],"sources":["../../../src/atom/checkbox-with-title/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {getOr, noop, uniqueId} from 'lodash/fp';\nimport FaIcon from '../icon';\nimport {COLORS} from '../../variables/colors';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst DEFAULT_ICON_STYLE = {padding: '0', width: '20px', height: '20px'};\n\nconst CheckboxWithTitle = (props, context) => {\n const {\n value,\n title,\n name,\n checked,\n onChange = noop,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n icon = {iconName: 'check', iconColor: 'white', preset: 's'},\n customStyle = {},\n className\n } = props;\n const {skin} = context;\n const primaryColor = getOr(COLORS.cm_primary_blue, 'common.primary', skin);\n const {iconName, iconColor, preset} = icon;\n const idCheckbox = useMemo(() => uniqueId('input-checkbox-'), []);\n const handleChange = useMemo(() => e => onChange(e.target.checked), [onChange]);\n\n return (\n <div className={classnames(style.container, className)} style={{...customStyle}}>\n {onChange !== noop ? (\n <label htmlFor={idCheckbox}>\n <input\n type=\"checkbox\"\n data-value={value}\n id={idCheckbox}\n name={name}\n onChange={handleChange}\n checked={checked}\n className={style.checkbox}\n data-name={dataName}\n aria-label={ariaLabel}\n />\n <div\n className={style.label}\n style={checked ? {background: primaryColor, borderColor: primaryColor} : null}\n >\n {checked ? (\n <FaIcon\n className={style.icon}\n iconName={iconName}\n iconColor={iconColor}\n preset={preset}\n customStyle={DEFAULT_ICON_STYLE}\n />\n ) : (\n <FaIcon\n className={style.icon}\n iconName={'square'}\n iconColor={'transparent'}\n preset=\"s\"\n customStyle={DEFAULT_ICON_STYLE}\n />\n )}\n </div>\n </label>\n ) : null}\n {title ? (\n <span\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n ) : null}\n </div>\n );\n};\n\nCheckboxWithTitle.propTypes = {\n value: PropTypes.string,\n title: PropTypes.string,\n name: PropTypes.string,\n checked: PropTypes.bool,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n iconName: PropTypes.string,\n iconColor: PropTypes.string,\n preset: PropTypes.string\n }),\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n className: PropTypes.string\n};\n\nCheckboxWithTitle.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\nexport default CheckboxWithTitle;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,MAAM,MAAM,SAAS;AAC5B,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,kBAAkB,GAAG;EAACC,OAAO,EAAE,GAAG;EAAEC,KAAK,EAAE,MAAM;EAAEC,MAAM,EAAE;AAAM,CAAC;AAExE,MAAMC,iBAAiB,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAC5C,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D,MAAM;IAC1B5B,SAAS,EAAEvB,SAAS,CAACmD,MAAM;IAC3B3B,MAAM,EAAExB,SAAS,CAACmD;EACpB,CAAC,CAAC;EACF1B,WAAW,EAAEzB,SAAS,CAACuD,QAAQ,CAACvD,SAAS,CAACwD,SAAS,CAAC,CAACxD,SAAS,CAACmD,MAAM,EAAEnD,SAAS,CAACyD,MAAM,CAAC,CAAC,CAAC;EAC1F/B,SAAS,EAAE1B,SAAS,CAACmD;AACvB,CAAC;AAEDzC,iBAAiB,CAACgD,YAAY,GAAG;EAC/B/B,IAAI,EAAEvB,QAAQ,CAACuD,iBAAiB,CAAChC;AACnC,CAAC;AACD,eAAejB,iBAAiB","ignoreList":[]}
|
|
@@ -24,11 +24,17 @@ declare namespace RadioGroup {
|
|
|
24
24
|
}>;
|
|
25
25
|
}>>;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
const propTypes: {
|
|
28
|
+
color: PropTypes.Requireable<string>;
|
|
29
|
+
theme: PropTypes.Requireable<string>;
|
|
30
|
+
className: PropTypes.Requireable<string>;
|
|
31
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
32
|
+
label: PropTypes.Validator<string>;
|
|
33
|
+
value: PropTypes.Validator<string>;
|
|
34
|
+
}> | null | undefined)[]>;
|
|
35
|
+
value: PropTypes.Requireable<string>;
|
|
36
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
37
|
+
list: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
32
38
|
color: PropTypes.Requireable<string>;
|
|
33
39
|
value: PropTypes.Validator<string>;
|
|
34
40
|
name: PropTypes.Requireable<string>;
|
|
@@ -37,8 +43,8 @@ declare namespace RadioGroup {
|
|
|
37
43
|
label: PropTypes.Requireable<string>;
|
|
38
44
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
45
|
}> | null | undefined)[]>;
|
|
40
|
-
|
|
41
|
-
}
|
|
46
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
+
};
|
|
42
48
|
}
|
|
43
49
|
import PropTypes from "prop-types";
|
|
44
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-group/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-group/index.js"],"names":[],"mappings":";AAsDA,mEAkBC"}
|
|
@@ -11,7 +11,52 @@ const themeStyle = {
|
|
|
11
11
|
setup: style.setup,
|
|
12
12
|
coorpmanager: style.coorpmanager
|
|
13
13
|
};
|
|
14
|
+
const renderSegmentedControl = ({
|
|
15
|
+
options,
|
|
16
|
+
value,
|
|
17
|
+
onChange,
|
|
18
|
+
'aria-label': ariaLabel
|
|
19
|
+
}) => {
|
|
20
|
+
const activate = nextValue => {
|
|
21
|
+
if (nextValue !== value) onChange(nextValue);
|
|
22
|
+
};
|
|
23
|
+
function handleClick(event) {
|
|
24
|
+
activate(event.currentTarget.value);
|
|
25
|
+
}
|
|
26
|
+
function handleKeyDown(event) {
|
|
27
|
+
const {
|
|
28
|
+
key,
|
|
29
|
+
currentTarget
|
|
30
|
+
} = event;
|
|
31
|
+
if (!['ArrowRight', 'ArrowDown', 'ArrowLeft', 'ArrowUp'].includes(key)) return;
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
const index = options.findIndex(option => option.value === currentTarget.value);
|
|
34
|
+
const direction = key === 'ArrowRight' || key === 'ArrowDown' ? 1 : -1;
|
|
35
|
+
const destination = (index + direction + options.length) % options.length;
|
|
36
|
+
currentTarget.parentElement.children[destination].focus();
|
|
37
|
+
activate(options[destination].value);
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
role: "radiogroup",
|
|
41
|
+
"aria-label": ariaLabel,
|
|
42
|
+
className: style.segmented
|
|
43
|
+
}, options.map(option => /*#__PURE__*/React.createElement("button", {
|
|
44
|
+
key: option.value,
|
|
45
|
+
type: "button",
|
|
46
|
+
role: "radio",
|
|
47
|
+
value: option.value,
|
|
48
|
+
"aria-checked": option.value === value,
|
|
49
|
+
tabIndex: option.value === value ? 0 : -1,
|
|
50
|
+
className: style.segmentedOption,
|
|
51
|
+
onClick: handleClick,
|
|
52
|
+
onKeyDown: handleKeyDown
|
|
53
|
+
}, option.label)));
|
|
54
|
+
};
|
|
14
55
|
const RadioGroup = (props, context) => {
|
|
56
|
+
const {
|
|
57
|
+
options
|
|
58
|
+
} = props;
|
|
59
|
+
if (options) return renderSegmentedControl(props);
|
|
15
60
|
const {
|
|
16
61
|
list = [],
|
|
17
62
|
onChange,
|
|
@@ -46,6 +91,12 @@ RadioGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
46
91
|
color: PropTypes.string,
|
|
47
92
|
theme: PropTypes.string,
|
|
48
93
|
className: PropTypes.string,
|
|
94
|
+
options: PropTypes.arrayOf(PropTypes.shape({
|
|
95
|
+
label: PropTypes.string.isRequired,
|
|
96
|
+
value: PropTypes.string.isRequired
|
|
97
|
+
})),
|
|
98
|
+
value: PropTypes.string,
|
|
99
|
+
'aria-label': PropTypes.string,
|
|
49
100
|
list: PropTypes.arrayOf(PropTypes.shape(Item.propTypes)),
|
|
50
101
|
onChange: PropTypes.func
|
|
51
102
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["classnames","React","PropTypes","Provider","style","Item","themeStyle","setup","coorpmanager","
|
|
1
|
+
{"version":3,"file":"index.js","names":["classnames","React","PropTypes","Provider","style","Item","themeStyle","setup","coorpmanager","renderSegmentedControl","options","value","onChange","ariaLabel","activate","nextValue","handleClick","event","currentTarget","handleKeyDown","key","includes","preventDefault","index","findIndex","option","direction","destination","length","parentElement","children","focus","createElement","role","className","segmented","map","type","tabIndex","segmentedOption","onClick","onKeyDown","label","RadioGroup","props","context","list","color","theme","skin","borderColor","_get","mainClass","items","_map","itemProps","_extends","container","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","arrayOf","shape","isRequired","func"],"sources":["../../../src/atom/radio-group/index.js"],"sourcesContent":["import classnames from 'classnames';\nimport React from 'react';\nimport {get, map} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport Provider from '../provider';\nimport style from './style.css';\n\nimport Item from './item';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager\n};\n\nconst renderSegmentedControl = ({options, value, onChange, 'aria-label': ariaLabel}) => {\n const activate = nextValue => {\n if (nextValue !== value) onChange(nextValue);\n };\n function handleClick(event) {\n activate(event.currentTarget.value);\n }\n\n function handleKeyDown(event) {\n const {key, currentTarget} = event;\n if (!['ArrowRight', 'ArrowDown', 'ArrowLeft', 'ArrowUp'].includes(key)) return;\n event.preventDefault();\n const index = options.findIndex(option => option.value === currentTarget.value);\n const direction = key === 'ArrowRight' || key === 'ArrowDown' ? 1 : -1;\n const destination = (index + direction + options.length) % options.length;\n currentTarget.parentElement.children[destination].focus();\n activate(options[destination].value);\n }\n\n return (\n <div role=\"radiogroup\" aria-label={ariaLabel} className={style.segmented}>\n {options.map(option => (\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n value={option.value}\n aria-checked={option.value === value}\n tabIndex={option.value === value ? 0 : -1}\n className={style.segmentedOption}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n {option.label}\n </button>\n ))}\n </div>\n );\n};\n\nconst RadioGroup = (props, context) => {\n const {options} = props;\n if (options) return renderSegmentedControl(props);\n const {list = [], onChange, color, className, theme = 'setup'} = props;\n const {skin} = context;\n const borderColor = color || get('common.primary', skin);\n const mainClass = themeStyle[theme];\n const items = map(itemProps => {\n return (\n <Item {...itemProps} color={color} theme={theme} onChange={onChange} key={itemProps.value} />\n );\n }, list);\n\n return (\n <div className={classnames([mainClass, style.container, className])} style={{borderColor}}>\n {items}\n </div>\n );\n};\n\nRadioGroup.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nRadioGroup.propTypes = {\n color: PropTypes.string,\n theme: PropTypes.string,\n className: PropTypes.string,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired\n })\n ),\n value: PropTypes.string,\n 'aria-label': PropTypes.string,\n list: PropTypes.arrayOf(PropTypes.shape(Item.propTypes)),\n onChange: PropTypes.func\n};\n\nexport default RadioGroup;\n"],"mappings":";;;AAAA,OAAOA,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAMC,UAAU,GAAG;EACjBC,KAAK,EAAEH,KAAK,CAACG,KAAK;EAClBC,YAAY,EAAEJ,KAAK,CAACI;AACtB,CAAC;AAED,MAAMC,sBAAsB,GAAGA,CAAC;EAACC,OAAO;EAAEC,KAAK;EAAEC,QAAQ;EAAE,YAAY,EAAEC;AAAS,CAAC,KAAK;EACtF,MAAMC,QAAQ,GAAGC,SAAS,IAAI;IAC5B,IAAIA,SAAS,KAAKJ,KAAK,EAAEC,QAAQ,CAACG,SAAS,CAAC;EAC9C,CAAC;EACD,SAASC,WAAWA,CAACC,KAAK,EAAE;IAC1BH,QAAQ,CAACG,KAAK,CAACC,aAAa,CAACP,KAAK,CAAC;EACrC;EAEA,SAASQ,aAAaA,CAACF,KAAK,EAAE;IAC5B,MAAM;MAACG,GAAG;MAAEF;IAAa,CAAC,GAAGD,KAAK;IAClC,IAAI,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAACI,QAAQ,CAACD,GAAG,CAAC,EAAE;IACxEH,KAAK,CAACK,cAAc,CAAC,CAAC;IACtB,MAAMC,KAAK,GAAGb,OAAO,CAACc,S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,MAAM,CAACG;EAC1B,CAAC,CACH,CAAC;EACDxD,KAAK,EAAET,SAAS,CAAC8D,MAAM;EACvB,YAAY,EAAE9D,SAAS,CAAC8D,MAAM;EAC9BlB,IAAI,EAAE5C,SAAS,CAAC+D,OAAO,CAAC/D,SAAS,CAACgE,KAAK,CAAC7D,IAAI,CAACuD,SAAS,CAAC,CAAC;EACxDhD,QAAQ,EAAEV,SAAS,CAACkE;AACtB,CAAC;AAED,eAAezB,UAAU","ignoreList":[]}
|
|
@@ -17,3 +17,40 @@
|
|
|
17
17
|
margin: 0px auto;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
|
|
21
|
+
@value colors: "../../variables/colors.css";
|
|
22
|
+
@value cm_primary_blue, cm_blue_50, cm_grey_400 from colors;
|
|
23
|
+
|
|
24
|
+
.segmented {
|
|
25
|
+
composes: container;
|
|
26
|
+
flex-wrap: nowrap;
|
|
27
|
+
border: 0;
|
|
28
|
+
height: 36px;
|
|
29
|
+
gap: 4px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.segmentedOption {
|
|
33
|
+
composes: label from "./item.css";
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
height: 36px;
|
|
37
|
+
padding: 8px 16px;
|
|
38
|
+
border: 0;
|
|
39
|
+
border-radius: 5px;
|
|
40
|
+
background: transparent;
|
|
41
|
+
color: cm_grey_400;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
line-height: 1.43;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.segmentedOption[aria-checked="true"] {
|
|
49
|
+
color: cm_primary_blue;
|
|
50
|
+
background: cm_blue_50;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.segmentedOption:focus {
|
|
54
|
+
outline: 2px solid cm_primary_blue;
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
@@ -83,6 +83,9 @@ declare const RadioWithTitle: {
|
|
|
83
83
|
}>>>;
|
|
84
84
|
name: import("prop-types").Requireable<string>;
|
|
85
85
|
checked: import("prop-types").Requireable<boolean>;
|
|
86
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
87
|
+
example: import("prop-types").Requireable<string>;
|
|
88
|
+
hint: import("prop-types").Requireable<string>;
|
|
86
89
|
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
87
90
|
'aria-label': import("prop-types").Requireable<string>;
|
|
88
91
|
'data-name': 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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/radio-with-title/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAKzC,OAAO,EAAY,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEvD,QAAA,MAAM,cAAc;YAAW,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDjD,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _uniqueId from "lodash/fp/uniqueId";
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
|
+
import classnames from 'classnames';
|
|
4
5
|
import Title from '../title';
|
|
5
6
|
import style from './style.css';
|
|
6
7
|
import { propTypes } from './types';
|
|
@@ -9,14 +10,22 @@ const RadioWithTitle = props => {
|
|
|
9
10
|
title,
|
|
10
11
|
name,
|
|
11
12
|
checked,
|
|
13
|
+
disabled,
|
|
14
|
+
example,
|
|
15
|
+
hint,
|
|
12
16
|
onChange,
|
|
13
17
|
'data-name': dataName,
|
|
14
18
|
'aria-label': ariaLabel
|
|
15
19
|
} = props;
|
|
16
20
|
const idRadio = _uniqueId('input-radio-');
|
|
17
|
-
const
|
|
21
|
+
const hintId = hint ? `${idRadio}-hint` : undefined;
|
|
22
|
+
const handleChange = useCallback(e => {
|
|
23
|
+
if (!disabled) onChange(e.target.checked);
|
|
24
|
+
}, [disabled, onChange]);
|
|
18
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: style.container
|
|
26
|
+
className: classnames(style.container, {
|
|
27
|
+
[style.withHint]: hint
|
|
28
|
+
})
|
|
20
29
|
}, /*#__PURE__*/React.createElement("label", {
|
|
21
30
|
htmlFor: idRadio
|
|
22
31
|
}, /*#__PURE__*/React.createElement("input", {
|
|
@@ -25,15 +34,24 @@ const RadioWithTitle = props => {
|
|
|
25
34
|
name: name,
|
|
26
35
|
onChange: handleChange,
|
|
27
36
|
checked: checked,
|
|
37
|
+
disabled: disabled,
|
|
28
38
|
className: style.radio,
|
|
29
39
|
"data-name": dataName,
|
|
30
|
-
"aria-label": ariaLabel
|
|
40
|
+
"aria-label": ariaLabel,
|
|
41
|
+
"aria-describedby": hintId
|
|
31
42
|
}), /*#__PURE__*/React.createElement("span", {
|
|
32
|
-
className: style.title
|
|
43
|
+
className: classnames(style.title, {
|
|
44
|
+
[style.withExample]: example
|
|
45
|
+
})
|
|
33
46
|
}, /*#__PURE__*/React.createElement(Title, _extends({}, title, {
|
|
34
47
|
titleSize: 'small',
|
|
35
48
|
subtitleSize: 'extra-small'
|
|
36
|
-
}))
|
|
49
|
+
})), example ? /*#__PURE__*/React.createElement("span", {
|
|
50
|
+
className: style.example
|
|
51
|
+
}, example) : null)), hint ? /*#__PURE__*/React.createElement("span", {
|
|
52
|
+
id: hintId,
|
|
53
|
+
className: style.hint
|
|
54
|
+
}, hint) : null);
|
|
37
55
|
};
|
|
38
56
|
RadioWithTitle.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
39
57
|
export default RadioWithTitle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","Title","style","propTypes","RadioWithTitle","props","title","name","checked","onChange","dataName","ariaLabel","idRadio","_uniqueId","handleChange","e","target","createElement","className","container","htmlFor","type","id","radio","_extends","titleSize","subtitleSize","process","env","NODE_ENV"],"sources":["../../../src/atom/radio-with-title/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {uniqueId} from 'lodash/fp';\nimport Title from '../title';\nimport style from './style.css';\nimport {propTypes, RadioWithTitleProps} from './types';\n\nconst RadioWithTitle = (props: RadioWithTitleProps) => {\n const {title
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","classnames","Title","style","propTypes","RadioWithTitle","props","title","name","checked","disabled","example","hint","onChange","dataName","ariaLabel","idRadio","_uniqueId","hintId","undefined","handleChange","e","target","createElement","className","container","withHint","htmlFor","type","id","radio","withExample","_extends","titleSize","subtitleSize","process","env","NODE_ENV"],"sources":["../../../src/atom/radio-with-title/index.tsx"],"sourcesContent":["import React, {useCallback} from 'react';\nimport {uniqueId} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Title from '../title';\nimport style from './style.css';\nimport {propTypes, RadioWithTitleProps} from './types';\n\nconst RadioWithTitle = (props: RadioWithTitleProps) => {\n const {\n title,\n name,\n checked,\n disabled,\n example,\n hint,\n onChange,\n 'data-name': dataName,\n 'aria-label': ariaLabel\n } = props;\n const idRadio = uniqueId('input-radio-');\n const hintId = hint ? `${idRadio}-hint` : undefined;\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (!disabled) onChange(e.target.checked);\n },\n [disabled, onChange]\n );\n\n return (\n <div className={classnames(style.container, {[style.withHint]: hint})}>\n <label htmlFor={idRadio}>\n <input\n type=\"radio\"\n id={idRadio}\n name={name}\n onChange={handleChange}\n checked={checked}\n disabled={disabled}\n className={style.radio}\n data-name={dataName}\n aria-label={ariaLabel}\n aria-describedby={hintId}\n />\n <span className={classnames(style.title, {[style.withExample]: example})}>\n <Title {...title} titleSize={'small'} subtitleSize={'extra-small'} />\n {example ? <span className={style.example}>{example}</span> : null}\n </span>\n </label>\n {hint ? (\n <span id={hintId} className={style.hint}>\n {hint}\n </span>\n ) : null}\n </div>\n );\n};\n\nRadioWithTitle.propTypes = propTypes;\n\nexport default RadioWithTitle;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,WAAW,QAAO,OAAO;AAExC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,KAAK,MAAM,aAAa;AAC/B,SAAQC,SAAS,QAA4B,SAAS;AAEtD,MAAMC,cAAc,GAAIC,KAA0B,IAAK;EACrD,MAAM;IACJC,KAAK;IACLC,IAAI;IACJC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,IAAI;IACJC,QAAQ;IACR,WAAW,EAAEC,QAAQ;IACrB,YAAY,EAAEC;EAChB,CAAC,GAAGT,KAAK;EACT,MAAMU,OAAO,GAAGC,SAAA,CAAS,cAAc,CAAC;EACxC,MAAMC,MAAM,GAAGN,IAAI,GAAG,GAAGI,OAAO,OAAO,GAAGG,SAAS;EACnD,MAAMC,YAAY,GAAGpB,WAAW,CAC7BqB,CAAsC,IAAK;IAC1C,IAAI,CAACX,QAAQ,EAAEG,QAAQ,CAACQ,CAAC,CAACC,MAAM,CAACb,OAAO,CAAC;EAC3C,CAAC,EACD,CAACC,QAAQ,EAAEG,QAAQ,CACrB,CAAC;EAED,oBACEd,KAAA,CAAAwB,aAAA;IAAKC,SAAS,EAAEvB,UAAU,CAACE,KAAK,CAACsB,SAAS,EAAE;MAAC,CAACtB,KAAK,CAACuB,QAAQ,GAAGd;IAAI,CAAC;EAAE,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|
|
42
|
+
|
|
37
43
|
.title {
|
|
38
44
|
font-family: "Gilroy";
|
|
39
45
|
font-weight: 700;
|
|
@@ -46,4 +52,25 @@
|
|
|
46
52
|
color: black;
|
|
47
53
|
}
|
|
48
54
|
|
|
55
|
+
.withExample {
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: flex-start;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.example {
|
|
61
|
+
composes: extraSmallSubtitleFormGroup from "../title/style.css";
|
|
62
|
+
font-style: italic;
|
|
63
|
+
margin-top: 4px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.withHint {
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: flex-start;
|
|
69
|
+
}
|
|
49
70
|
|
|
71
|
+
.hint {
|
|
72
|
+
composes: extraSmallSubtitleFormGroup from "../title/style.css";
|
|
73
|
+
font-style: normal;
|
|
74
|
+
margin-top: 4px;
|
|
75
|
+
margin-left: 40px;
|
|
76
|
+
}
|
|
@@ -81,6 +81,9 @@ export declare const propTypes: {
|
|
|
81
81
|
}>>>;
|
|
82
82
|
name: PropTypes.Requireable<string>;
|
|
83
83
|
checked: PropTypes.Requireable<boolean>;
|
|
84
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
85
|
+
example: PropTypes.Requireable<string>;
|
|
86
|
+
hint: PropTypes.Requireable<string>;
|
|
84
87
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
85
88
|
'aria-label': PropTypes.Requireable<string>;
|
|
86
89
|
'data-name': PropTypes.Requireable<string>;
|
|
@@ -95,6 +98,9 @@ export declare type RadioWithTitleProps = {
|
|
|
95
98
|
};
|
|
96
99
|
name?: string;
|
|
97
100
|
checked: boolean;
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
example?: string;
|
|
103
|
+
hint?: string;
|
|
98
104
|
onChange: (value: boolean) => void;
|
|
99
105
|
'aria-label': string;
|
|
100
106
|
'data-name'?: 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUrB,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,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -4,6 +4,9 @@ export const propTypes = {
|
|
|
4
4
|
title: PropTypes.shape(Title.propTypes).isRequired,
|
|
5
5
|
name: PropTypes.string,
|
|
6
6
|
checked: PropTypes.bool,
|
|
7
|
+
disabled: PropTypes.bool,
|
|
8
|
+
example: PropTypes.string,
|
|
9
|
+
hint: PropTypes.string,
|
|
7
10
|
onChange: PropTypes.func.isRequired,
|
|
8
11
|
'aria-label': PropTypes.string,
|
|
9
12
|
'data-name': PropTypes.string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","Title","propTypes","title","shape","isRequired","name","string","checked","bool","onChange","func"],"sources":["../../../src/atom/radio-with-title/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Title from '../title';\n\nexport const propTypes = {\n title: PropTypes.shape(Title.propTypes).isRequired,\n name: PropTypes.string,\n checked: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\n\nexport type RadioWithTitleProps = {\n title: {\n title: string;\n subtitle: string;\n type: string;\n 'data-name': string;\n subtitleSize: string;\n };\n name?: string;\n checked: boolean;\n onChange: (value: boolean) => void;\n 'aria-label': string;\n 'data-name'?: string;\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,UAAU;AAE5B,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEH,SAAS,CAACI,KAAK,CAACH,KAAK,CAACC,SAAS,CAAC,CAACG,UAAU;EAClDC,IAAI,EAAEN,SAAS,CAACO,MAAM;EACtBC,OAAO,EAAER,SAAS,CAACS,IAAI;EACvBC,QAAQ,EAAEV,SAAS,
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","Title","propTypes","title","shape","isRequired","name","string","checked","bool","disabled","example","hint","onChange","func"],"sources":["../../../src/atom/radio-with-title/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Title from '../title';\n\nexport const propTypes = {\n title: PropTypes.shape(Title.propTypes).isRequired,\n name: PropTypes.string,\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n example: PropTypes.string,\n hint: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string\n};\n\nexport type RadioWithTitleProps = {\n title: {\n title: string;\n subtitle: string;\n type: string;\n 'data-name': string;\n subtitleSize: string;\n };\n name?: string;\n checked: boolean;\n disabled?: boolean;\n example?: string;\n hint?: string;\n onChange: (value: boolean) => void;\n 'aria-label': string;\n 'data-name'?: string;\n};\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,YAAY;AAClC,OAAOC,KAAK,MAAM,UAAU;AAE5B,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEH,SAAS,CAACI,KAAK,CAACH,KAAK,CAACC,SAAS,CAAC,CAACG,UAAU;EAClDC,IAAI,EAAEN,SAAS,CAACO,MAAM;EACtBC,OAAO,EAAER,SAAS,CAACS,IAAI;EACvBC,QAAQ,EAAEV,SAAS,CAACS,IAAI;EACxBE,OAAO,EAAEX,SAAS,CAACO,MAAM;EACzBK,IAAI,EAAEZ,SAAS,CAACO,MAAM;EACtBM,QAAQ,EAAEb,SAAS,CAACc,IAAI,CAACT,UAAU;EACnC,YAAY,EAAEL,SAAS,CAACO,MAAM;EAC9B,WAAW,EAAEP,SAAS,CAACO;AACzB,CAAC","ignoreList":[]}
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -5,4 +5,5 @@ import Player from './template/app-player/player';
|
|
|
5
5
|
import Loading from './template/app-player/loading';
|
|
6
6
|
import PopinNoAccess from './template/app-player/popin-no-access';
|
|
7
7
|
export { Provider, PopinEnd, PopinCorrection, Loading, Player, PopinNoAccess };
|
|
8
|
+
export { default as ContentSelectionList } from './organism/content-selection-list';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Provider","PopinEnd","PopinCorrection","Player","Loading","PopinNoAccess"],"sources":["../src/index.js"],"sourcesContent":["import Provider from './atom/provider';\nimport PopinEnd from './template/app-player/popin-end';\nimport PopinCorrection from './template/app-player/popin-correction';\nimport Player from './template/app-player/player';\nimport Loading from './template/app-player/loading';\nimport PopinNoAccess from './template/app-player/popin-no-access';\n\nexport {Provider, PopinEnd, PopinCorrection, Loading, Player, PopinNoAccess};\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,QAAQ,MAAM,iCAAiC;AACtD,OAAOC,eAAe,MAAM,wCAAwC;AACpE,OAAOC,MAAM,MAAM,8BAA8B;AACjD,OAAOC,OAAO,MAAM,+BAA+B;AACnD,OAAOC,aAAa,MAAM,uCAAuC;AAEjE,SAAQL,QAAQ,EAAEC,QAAQ,EAAEC,eAAe,EAAEE,OAAO,EAAED,MAAM,EAAEE,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["Provider","PopinEnd","PopinCorrection","Player","Loading","PopinNoAccess","default","ContentSelectionList"],"sources":["../src/index.js"],"sourcesContent":["import Provider from './atom/provider';\nimport PopinEnd from './template/app-player/popin-end';\nimport PopinCorrection from './template/app-player/popin-correction';\nimport Player from './template/app-player/player';\nimport Loading from './template/app-player/loading';\nimport PopinNoAccess from './template/app-player/popin-no-access';\n\nexport {Provider, PopinEnd, PopinCorrection, Loading, Player, PopinNoAccess};\nexport {default as ContentSelectionList} from './organism/content-selection-list';\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,QAAQ,MAAM,iCAAiC;AACtD,OAAOC,eAAe,MAAM,wCAAwC;AACpE,OAAOC,MAAM,MAAM,8BAA8B;AACjD,OAAOC,OAAO,MAAM,+BAA+B;AACnD,OAAOC,aAAa,MAAM,uCAAuC;AAEjE,SAAQL,QAAQ,EAAEC,QAAQ,EAAEC,eAAe,EAAEE,OAAO,EAAED,MAAM,EAAEE,aAAa;AAC3E,SAAQC,OAAO,IAAIC,oBAAoB,QAAO,mCAAmC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AA8CA,kDAiTC"}
|
|
@@ -13,6 +13,8 @@ import CardsGrid from '../../organism/cards-grid';
|
|
|
13
13
|
import ListItems from '../../organism/list-items';
|
|
14
14
|
import Link from '../../atom/link';
|
|
15
15
|
import Icon from '../../atom/icon';
|
|
16
|
+
import WizardSummary from '../wizard-summary';
|
|
17
|
+
import Notification from '../../atom/notification';
|
|
16
18
|
import style from './style.css';
|
|
17
19
|
import propTypes from './types';
|
|
18
20
|
|
|
@@ -45,6 +47,8 @@ const CMPopin = props => {
|
|
|
45
47
|
icon,
|
|
46
48
|
backgroundImageUrl,
|
|
47
49
|
descriptionText,
|
|
50
|
+
sections,
|
|
51
|
+
warning,
|
|
48
52
|
thirdButton,
|
|
49
53
|
cookieTitle,
|
|
50
54
|
descriptionBtnTxt,
|
|
@@ -80,7 +84,8 @@ const CMPopin = props => {
|
|
|
80
84
|
};
|
|
81
85
|
}
|
|
82
86
|
}, [handleCloseButton, mode, onClose]);
|
|
83
|
-
const
|
|
87
|
+
const hasImpact = (mode === 'alert' || mode === 'information') && (!isEmpty(sections) || Boolean(warning));
|
|
88
|
+
const wrapperPopinStyle = classNames(style.popin, hasImpact && style.popinImpact, mode === 'cookie' && style.popinCookie, mode === 'list' && style.popinFilesList, mode === 'items' && style.popinItems);
|
|
84
89
|
const buildIcon = () => {
|
|
85
90
|
if (typeof icon === 'string') {
|
|
86
91
|
const LogoComponent = LOGO[icon];
|
|
@@ -248,14 +253,26 @@ const CMPopin = props => {
|
|
|
248
253
|
"data-name": `cm-popin-cta-${thirdButton.type}`
|
|
249
254
|
}))) : null);
|
|
250
255
|
};
|
|
256
|
+
const renderImpact = () => {
|
|
257
|
+
if (mode !== 'alert' && mode !== 'information') return null;
|
|
258
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !isEmpty(sections) ? /*#__PURE__*/React.createElement(WizardSummary, {
|
|
259
|
+
sections: sections,
|
|
260
|
+
inline: true
|
|
261
|
+
}) : null, warning ? /*#__PURE__*/React.createElement("div", {
|
|
262
|
+
role: "alert"
|
|
263
|
+
}, /*#__PURE__*/React.createElement(Notification, {
|
|
264
|
+
type: "warning",
|
|
265
|
+
message: warning
|
|
266
|
+
})) : null);
|
|
267
|
+
};
|
|
251
268
|
return /*#__PURE__*/React.createElement("div", {
|
|
252
|
-
className: mode !== 'cookie' ? style.background : null,
|
|
269
|
+
className: mode !== 'cookie' ? classNames(style.background, hasImpact && style.impactBackground) : null,
|
|
253
270
|
style: backgroundImageStyle,
|
|
254
271
|
"data-name": 'cm-popin-container'
|
|
255
272
|
}, /*#__PURE__*/React.createElement("div", {
|
|
256
273
|
className: wrapperPopinStyle,
|
|
257
274
|
ref: nodeRef
|
|
258
|
-
}, renderHeader(), renderContent(), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
275
|
+
}, renderHeader(), renderContent(), renderImpact(), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
259
276
|
className: style.descriptionBtn
|
|
260
277
|
}, descriptionBtnTxt) : null, renderItems(), renderBtnSwitch(), renderButtons()));
|
|
261
278
|
};
|