@coorpacademy/components 10.3.5 → 10.3.6
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/provider/index.js +4 -0
- package/es/atom/provider/index.js.map +1 -1
- package/es/atom/radio-group/index.js +11 -2
- package/es/atom/radio-group/index.js.map +1 -1
- package/es/atom/radio-group/item.css +48 -1
- package/es/atom/radio-group/item.js +12 -3
- package/es/atom/radio-group/item.js.map +1 -1
- package/es/atom/radio-group/style.css +9 -1
- package/es/molecule/banner/test/fixtures.js +0 -8
- package/es/molecule/banner/test/fixtures.js.map +1 -1
- package/es/molecule/select-multiple/test/fixtures.js +0 -8
- package/es/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/es/organism/content-translation/index.js +2 -2
- package/es/organism/content-translation/index.js.map +1 -1
- package/es/organism/content-translation/test/fixtures/delete.js +1 -1
- package/es/organism/content-translation/test/fixtures/delete.js.map +1 -1
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/template/back-office/brand-list/index.js +7 -2
- package/es/template/back-office/brand-list/index.js.map +1 -1
- package/es/template/back-office/brand-list/style.css +13 -0
- package/es/template/back-office/brand-list/test/fixtures/default.js +15 -0
- package/es/template/back-office/brand-list/test/fixtures/default.js.map +1 -1
- package/es/template/back-office/brand-update/test/fixtures.js +2 -20
- package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/lib/atom/provider/index.js +4 -0
- package/lib/atom/provider/index.js.map +1 -1
- package/lib/atom/radio-group/index.js +11 -2
- package/lib/atom/radio-group/index.js.map +1 -1
- package/lib/atom/radio-group/item.css +48 -1
- package/lib/atom/radio-group/item.js +13 -3
- package/lib/atom/radio-group/item.js.map +1 -1
- package/lib/atom/radio-group/style.css +9 -1
- package/lib/molecule/banner/test/fixtures.js +0 -12
- package/lib/molecule/banner/test/fixtures.js.map +1 -1
- package/lib/molecule/select-multiple/test/fixtures.js +0 -12
- package/lib/molecule/select-multiple/test/fixtures.js.map +1 -1
- package/lib/organism/content-translation/index.js +2 -2
- package/lib/organism/content-translation/index.js.map +1 -1
- package/lib/organism/content-translation/test/fixtures/delete.js +1 -1
- package/lib/organism/content-translation/test/fixtures/delete.js.map +1 -1
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/template/back-office/brand-list/index.js +8 -2
- package/lib/template/back-office/brand-list/index.js.map +1 -1
- package/lib/template/back-office/brand-list/style.css +13 -0
- package/lib/template/back-office/brand-list/test/fixtures/default.js +15 -0
- package/lib/template/back-office/brand-list/test/fixtures/default.js.map +1 -1
- package/lib/template/back-office/brand-update/test/fixtures.js +3 -30
- package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
- package/package.json +2 -2
- package/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/es/organism/content-translation/test/fixtures.js +0 -15
- package/es/organism/content-translation/test/fixtures.js.map +0 -1
- package/es/organism/list-item/test/fixtures.js +0 -19
- package/es/organism/list-item/test/fixtures.js.map +0 -1
- package/es/organism/list-items/test/fixtures.js +0 -17
- package/es/organism/list-items/test/fixtures.js.map +0 -1
- package/es/organism/wizard-contents/test/fixtures.js +0 -21
- package/es/organism/wizard-contents/test/fixtures.js.map +0 -1
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
- package/lib/organism/content-translation/test/fixtures.js +0 -25
- package/lib/organism/content-translation/test/fixtures.js.map +0 -1
- package/lib/organism/list-item/test/fixtures.js +0 -31
- package/lib/organism/list-item/test/fixtures.js.map +0 -1
- package/lib/organism/list-items/test/fixtures.js +0 -28
- package/lib/organism/list-items/test/fixtures.js.map +0 -1
- package/lib/organism/wizard-contents/test/fixtures.js +0 -34
- package/lib/organism/wizard-contents/test/fixtures.js.map +0 -1
|
@@ -7,6 +7,10 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { SrcPropType, ColorPropType, HexPropType } from '../../util/proptypes';
|
|
8
8
|
const DEFAULT_SKIN = {
|
|
9
9
|
common: {
|
|
10
|
+
good: '#24b694',
|
|
11
|
+
bad: '#ed1c24',
|
|
12
|
+
primary: '#00B0FF',
|
|
13
|
+
life: '#ed1c24',
|
|
10
14
|
brand: '#00B0FF',
|
|
11
15
|
primaryAdd1: '#B3E5FC',
|
|
12
16
|
primaryAdd2: '#0091EA',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/provider/index.js"],"names":["React","PropTypes","SrcPropType","ColorPropType","HexPropType","DEFAULT_SKIN","common","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","shape","createHref","func","push","skinShape","objectOf","images","logo","login","icons","mod","courses","arrayOf","texts","translateShape","Provider","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","isRequired","object","propTypes","node"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,WAAR,EAAqBC,aAArB,EAAoCC,WAApC,QAAsD,sBAAtD;AAEA,MAAMC,YAAY,GAAG;AACnBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/provider/index.js"],"names":["React","PropTypes","SrcPropType","ColorPropType","HexPropType","DEFAULT_SKIN","common","good","bad","primary","life","brand","primaryAdd1","primaryAdd2","primaryAdd3","primaryAdd4","xtraLightGrey","light","medium","dark","grey","orangeAdd","orange","positive","lightGreen","negative","battle","white","black","mergeSkin","skin","historyShape","shape","createHref","func","push","skinShape","objectOf","images","logo","login","icons","mod","courses","arrayOf","texts","translateShape","Provider","Component","getDerivedStateFromProps","props","history","translate","constructor","context","Vimeo","state","getChildContext","render","children","Children","only","isRequired","object","propTypes","node"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SAAQC,WAAR,EAAqBC,aAArB,EAAoCC,WAApC,QAAsD,sBAAtD;AAEA,MAAMC,YAAY,GAAG;AACnBC,EAAAA,MAAM,EAAE;AACNC,IAAAA,IAAI,EAAE,SADA;AAENC,IAAAA,GAAG,EAAE,SAFC;AAGNC,IAAAA,OAAO,EAAE,SAHH;AAINC,IAAAA,IAAI,EAAE,SAJA;AAKNC,IAAAA,KAAK,EAAE,SALD;AAMNC,IAAAA,WAAW,EAAE,SANP;AAONC,IAAAA,WAAW,EAAE,SAPP;AAQNC,IAAAA,WAAW,EAAE,SARP;AASNC,IAAAA,WAAW,EAAE,SATP;AAUNC,IAAAA,aAAa,EAAE,SAVT;AAWNC,IAAAA,KAAK,EAAE,SAXD;AAYNC,IAAAA,MAAM,EAAE,SAZF;AAaNC,IAAAA,IAAI,EAAE,SAbA;AAcNC,IAAAA,IAAI,EAAE,SAdA;AAeNC,IAAAA,SAAS,EAAE,SAfL;AAgBNC,IAAAA,MAAM,EAAE,SAhBF;AAiBNC,IAAAA,QAAQ,EAAE,SAjBJ;AAkBNC,IAAAA,UAAU,EAAE,SAlBN;AAmBNC,IAAAA,QAAQ,EAAE,SAnBJ;AAoBNC,IAAAA,MAAM,EAAE,SApBF;AAqBNC,IAAAA,KAAK,EAAE,SArBD;AAsBNC,IAAAA,KAAK,EAAE;AAtBD;AADW,CAArB;;AA2BA,MAAMC,SAAS,GAAG,CAACC,IAAI,GAAG,EAAR,KAAe,cAAaA,IAAb,EAAmBzB,YAAnB,CAAjC;;AAEA,MAAM0B,YAAY,GAAG9B,SAAS,CAAC+B,KAAV,CAAgB;AACnCC,EAAAA,UAAU,EAAEhC,SAAS,CAACiC,IADa;AAEnCC,EAAAA,IAAI,EAAElC,SAAS,CA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,SAAKM,KAAL,GAAa;AAACL,MAAAA,OAAD;AAAUrB,MAAAA,IAAI,EAAED,SAAS,CAACC,IAAD,CAAzB;AAAiCsB,MAAAA,SAAjC;AAA4CG,MAAAA;AAA5C,KAAb;AACD;;AAEDE,EAAAA,eAAe,GAAG;AAChB,WAAO,KAAKD,KAAZ;AACD;;AAEDE,EAAAA,MAAM,GAAG;AACP,UAAM;AAACC,MAAAA;AAAD,QAAa,KAAKT,KAAxB;AACA,WAAOlD,KAAK,CAAC4D,QAAN,CAAeC,IAAf,CAAoBF,QAApB,CAAP;AACD;;AA1CoC;;gBAAjCZ,Q,uBAWuB;AACzBI,EAAAA,OAAO,EAAEpB,YADgB;AAEzBD,EAAAA,IAAI,EAAEM,SAFmB;AAGzBgB,EAAAA,SAAS,EAAEN,cAAc,CAACgB,UAHD;AAIzBP,EAAAA,KAAK,EAAEtD,SAAS,CAAC8D;AAJQ,C;;AAXvBhB,Q,CACGiB,S,2CAAY;AACjBb,EAAAA,OAAO,EAAEpB,YADQ;AAEjBD,EAAAA,IAAI,EAAEM,SAFW;AAGjBgB,EAAAA,SAAS,EAAEN,cAHM;AAIjBa,EAAAA,QAAQ,EAAE1D,SAAS,CAACgE,IAAV,CAAeH,UAJR;AAKjBP,EAAAA,KAAK,EAAEtD,SAAS,CAAC+B,KAAV,CAAgB;AACrB1B,IAAAA,MAAM,EAAEL,SAAS,CAACiC;AADG,GAAhB;AALU,C;AA4CrB,eAAea,QAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {defaultsDeep} from 'lodash/fp';\nimport {SrcPropType, ColorPropType, HexPropType} from '../../util/proptypes';\n\nconst DEFAULT_SKIN = {\n common: {\n good: '#24b694',\n bad: '#ed1c24',\n primary: '#00B0FF',\n life: '#ed1c24',\n brand: '#00B0FF',\n primaryAdd1: '#B3E5FC',\n primaryAdd2: '#0091EA',\n primaryAdd3: '#0277BD',\n primaryAdd4: '#015798',\n xtraLightGrey: '#FAFAFA',\n light: '#ECEFF1',\n medium: '#90A4AE',\n dark: '#546E7A',\n grey: '#607D8B',\n orangeAdd: '#FF7043',\n orange: '#FFA000',\n positive: '#3EC483',\n lightGreen: '#66BB6A',\n negative: '#F73F52',\n battle: '#FFE100',\n white: '#FFFFFF',\n black: '#14171A'\n }\n};\n\nconst mergeSkin = (skin = {}) => defaultsDeep(skin, DEFAULT_SKIN);\n\nconst historyShape = PropTypes.shape({\n createHref: PropTypes.func,\n push: PropTypes.func\n});\n\nconst skinShape = PropTypes.shape({\n common: PropTypes.objectOf(ColorPropType),\n images: PropTypes.shape({\n 'logo-mobile': SrcPropType,\n logo: SrcPropType,\n 'logo-email': SrcPropType,\n login: SrcPropType\n }),\n icons: PropTypes.objectOf(HexPropType),\n mod: PropTypes.objectOf(ColorPropType),\n courses: PropTypes.arrayOf(ColorPropType),\n texts: PropTypes.objectOf(ColorPropType)\n});\n\nconst translateShape = PropTypes.func;\n\nclass Provider extends React.Component {\n static propTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape,\n children: PropTypes.node.isRequired,\n Vimeo: PropTypes.shape({\n common: PropTypes.func\n })\n };\n\n static childContextTypes = {\n history: historyShape,\n skin: skinShape,\n translate: translateShape.isRequired,\n Vimeo: PropTypes.object\n };\n\n static getDerivedStateFromProps(props) {\n const {history, skin, translate} = props;\n\n return {\n history,\n skin: mergeSkin(skin),\n translate\n };\n }\n\n constructor(props, context) {\n super(props, context);\n const {history, skin, translate, Vimeo} = props;\n // eslint-disable-next-line react/no-unused-state\n this.state = {history, skin: mergeSkin(skin), translate, Vimeo};\n }\n\n getChildContext() {\n return this.state;\n }\n\n render() {\n const {children} = this.props;\n return React.Children.only(children);\n }\n}\n\nexport default Provider;\n"],"file":"index.js"}
|
|
@@ -9,13 +9,18 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import Provider from '../provider';
|
|
10
10
|
import style from './style.css';
|
|
11
11
|
import Item from './item';
|
|
12
|
+
const themeStyle = {
|
|
13
|
+
setup: style.setup,
|
|
14
|
+
coorpmanager: style.coorpmanager
|
|
15
|
+
};
|
|
12
16
|
|
|
13
17
|
const RadioGroup = (props, context) => {
|
|
14
18
|
const {
|
|
15
19
|
list = [],
|
|
16
20
|
onChange,
|
|
17
21
|
color,
|
|
18
|
-
className
|
|
22
|
+
className,
|
|
23
|
+
theme = 'setup'
|
|
19
24
|
} = props;
|
|
20
25
|
const {
|
|
21
26
|
skin
|
|
@@ -23,16 +28,19 @@ const RadioGroup = (props, context) => {
|
|
|
23
28
|
|
|
24
29
|
const borderColor = color || _get('common.primary', skin);
|
|
25
30
|
|
|
31
|
+
const mainClass = themeStyle[theme];
|
|
32
|
+
|
|
26
33
|
const items = _map(itemProps => {
|
|
27
34
|
return /*#__PURE__*/React.createElement(Item, _extends({}, itemProps, {
|
|
28
35
|
color: color,
|
|
36
|
+
theme: theme,
|
|
29
37
|
onChange: onChange,
|
|
30
38
|
key: itemProps.value
|
|
31
39
|
}));
|
|
32
40
|
}, list);
|
|
33
41
|
|
|
34
42
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: classnames([style.container, className]),
|
|
43
|
+
className: classnames([mainClass, style.container, className]),
|
|
36
44
|
style: {
|
|
37
45
|
borderColor
|
|
38
46
|
}
|
|
@@ -44,6 +52,7 @@ RadioGroup.contextTypes = {
|
|
|
44
52
|
};
|
|
45
53
|
RadioGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
46
54
|
color: PropTypes.string,
|
|
55
|
+
theme: PropTypes.string,
|
|
47
56
|
className: PropTypes.string,
|
|
48
57
|
list: PropTypes.arrayOf(PropTypes.shape(Item.propTypes)),
|
|
49
58
|
onChange: PropTypes.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/radio-group/index.js"],"names":["classnames","React","PropTypes","Provider","style","Item","RadioGroup","props","context","list","onChange","color","className","skin","borderColor","items","itemProps","value","container","contextTypes","childContextTypes","propTypes","string","arrayOf","shape","func"],"mappings":";;;;;AAAA,OAAOA,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,OAAOC,IAAP,MAAiB,QAAjB
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/radio-group/index.js"],"names":["classnames","React","PropTypes","Provider","style","Item","themeStyle","setup","coorpmanager","RadioGroup","props","context","list","onChange","color","className","theme","skin","borderColor","mainClass","items","itemProps","value","container","contextTypes","childContextTypes","propTypes","string","arrayOf","shape","func"],"mappings":";;;;;AAAA,OAAOA,UAAP,MAAuB,YAAvB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEH,KAAK,CAACG,KADI;AAEjBC,EAAAA,YAAY,EAAEJ,KAAK,CAACI;AAFH,CAAnB;;AAKA,MAAMC,UAAU,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AACrC,QAAM;AAACC,IAAAA,IAAI,GAAG,EAAR;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA,KAAtB;AAA6BC,IAAAA,SAA7B;AAAwCC,IAAAA,KAAK,GAAG;AAAhD,MAA2DN,KAAjE;AACA,QAAM;AAACO,IAAAA;AAAD,MAASN,OAAf;;AACA,QAAMO,WAAW,GAAGJ,KAAK,IAAI,KAAI,gBAAJ,EAAsBG,IAAtB,CAA7B;;AACA,QAAME,SAAS,GAAGb,UAAU,CAACU,KAAD,CAA5B;;AACA,QAAMI,KAAK,GAAG,KAAIC,SAAS,IAAI;AAC7B,wBACE,oBAAC,IAAD,eAAUA,SAAV;AAAqB,MAAA,KAAK,EAAEP,KAA5B;AAAmC,MAAA,KAAK,EAAEE,KAA1C;AAAiD,MAAA,QAAQ,EAAEH,QAA3D;AAAqE,MAAA,GAAG,EAAEQ,SAAS,CAACC;AAApF,OADF;AAGD,GAJa,EAIXV,IAJW,CAAd;;AAMA,sBACE;AAAK,IAAA,SAAS,EAAEZ,UAAU,CAAC,CAACmB,SAAD,EAAYf,KAAK,CAACmB,SAAlB,EAA6BR,SAA7B,CAAD,CAA1B;AAAqE,IAAA,KAAK,EAAE;AAACG,MAAAA;AAAD;AAA5E,KACGE,KADH,CADF;AAKD,CAhBD;;AAkBAX,UAAU,CAACe,YAAX,GAA0B;AACxBP,EAAAA,IAAI,EAAEd,QAAQ,CAACsB,iBAAT,CAA2BR;AADT,CAA1B;AAIAR,UAAU,CAACiB,SAAX,2CAAuB;AACrBZ,EAAAA,KAAK,EAAEZ,SAAS,CAACyB,MADI;AAErBX,EAAAA,KAAK,EAAEd,SAAS,CAACyB,MAFI;AAGrBZ,EAAAA,SAAS,EAAEb,SAAS,CAACyB,MAHA;AAIrBf,EAAAA,IAAI,EAAEV,SAAS,CAAC0B,OAAV,CAAkB1B,SAAS,CAAC2B,KAAV,CAAgBxB,IAAI,CAACqB,SAArB,CAAlB,CAJe;AAKrBb,EAAAA,QAAQ,EAAEX,SAAS,CAAC4B;AALC,CAAvB;AAQA,eAAerB,UAAf","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 RadioGroup = (props, context) => {\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 list: PropTypes.arrayOf(PropTypes.shape(Item.propTypes)),\n onChange: PropTypes.func\n};\n\nexport default RadioGroup;\n"],"file":"index.js"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_primary_blue from colors;
|
|
3
|
+
@value cm_blue_50 from colors;
|
|
4
|
+
@value cm_grey_400 from colors;
|
|
5
|
+
|
|
6
|
+
|
|
1
7
|
.radio {
|
|
2
8
|
visibility: hidden;
|
|
3
9
|
display: none;
|
|
@@ -6,7 +12,6 @@
|
|
|
6
12
|
.normal {
|
|
7
13
|
flex: 1 1 0;
|
|
8
14
|
line-height: 30px;
|
|
9
|
-
border-right: solid 1px;
|
|
10
15
|
color: white;
|
|
11
16
|
cursor: pointer;
|
|
12
17
|
min-width: 33%;
|
|
@@ -29,8 +34,50 @@
|
|
|
29
34
|
white-space: nowrap;
|
|
30
35
|
text-align: center;
|
|
31
36
|
box-sizing: border-box;
|
|
37
|
+
user-select: none;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
.normal:last-child {
|
|
35
41
|
border-right-width: 0;
|
|
36
42
|
}
|
|
43
|
+
|
|
44
|
+
.setup.normal{
|
|
45
|
+
border-right: solid 1px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.coorpmanager label {
|
|
49
|
+
flex-grow: 0;
|
|
50
|
+
box-sizing: border-box;;
|
|
51
|
+
font-family: Gilroy;
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
font-weight: bold;
|
|
54
|
+
font-stretch: normal;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
line-height: 1.43;
|
|
57
|
+
letter-spacing: normal;
|
|
58
|
+
text-align: left;
|
|
59
|
+
height: 36px;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
|
|
66
|
+
border-radius: 5px;
|
|
67
|
+
}
|
|
68
|
+
.coorpmanager.normal{
|
|
69
|
+
border: 0px;
|
|
70
|
+
border-radius: 5px;
|
|
71
|
+
overflow: hidden;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.coorpmanager .label.selected .labelSpan{
|
|
75
|
+
color: cm_primary_blue;
|
|
76
|
+
background-color: cm_blue_50;
|
|
77
|
+
}
|
|
78
|
+
.coorpmanager .labelSpan {
|
|
79
|
+
color: cm_grey_400;
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
padding: 8px 16px;
|
|
82
|
+
transition: color 0.5s linear;
|
|
83
|
+
}
|
|
@@ -4,11 +4,17 @@ import _pipe from "lodash/fp/pipe";
|
|
|
4
4
|
import _get from "lodash/fp/get";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
+
import classNames from 'classnames';
|
|
7
8
|
import Provider from '../provider';
|
|
8
9
|
import style from './item.css';
|
|
9
10
|
|
|
10
11
|
const getTargetValueAndCall = fun => _pipe(_get('target.value'), fun);
|
|
11
12
|
|
|
13
|
+
const themeStyle = {
|
|
14
|
+
setup: style.setup,
|
|
15
|
+
coorpmanager: style.coorpmanager
|
|
16
|
+
};
|
|
17
|
+
|
|
12
18
|
const Item = (props, context) => {
|
|
13
19
|
const idRadioButton = _uniqueId('inputRadioButton');
|
|
14
20
|
|
|
@@ -21,13 +27,15 @@ const Item = (props, context) => {
|
|
|
21
27
|
value,
|
|
22
28
|
checked,
|
|
23
29
|
label,
|
|
24
|
-
onChange = _identity
|
|
30
|
+
onChange = _identity,
|
|
31
|
+
theme
|
|
25
32
|
} = props;
|
|
26
33
|
|
|
27
34
|
const defaultColor = color || _get('common.primary', skin);
|
|
28
35
|
|
|
36
|
+
const mainClass = themeStyle[theme];
|
|
29
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: style.normal,
|
|
38
|
+
className: classNames(style.normal, mainClass),
|
|
31
39
|
style: {
|
|
32
40
|
backgroundColor: checked && defaultColor,
|
|
33
41
|
borderRightColor: defaultColor,
|
|
@@ -42,7 +50,7 @@ const Item = (props, context) => {
|
|
|
42
50
|
checked: checked,
|
|
43
51
|
onChange: getTargetValueAndCall(onChange)
|
|
44
52
|
}), /*#__PURE__*/React.createElement("label", {
|
|
45
|
-
className: style.label,
|
|
53
|
+
className: classNames(style.label, checked && style.selected),
|
|
46
54
|
style: {
|
|
47
55
|
color: !checked && defaultColor
|
|
48
56
|
},
|
|
@@ -61,6 +69,7 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
61
69
|
color: PropTypes.string,
|
|
62
70
|
value: PropTypes.string.isRequired,
|
|
63
71
|
name: PropTypes.string,
|
|
72
|
+
theme: PropTypes.string,
|
|
64
73
|
checked: PropTypes.bool,
|
|
65
74
|
label: PropTypes.string,
|
|
66
75
|
onChange: PropTypes.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/radio-group/item.js"],"names":["React","PropTypes","Provider","style","getTargetValueAndCall","fun","Item","props","context","idRadioButton","skin","color","name","value","checked","label","onChange","defaultColor","normal","backgroundColor","borderRightColor","radio","labelSpan","contextTypes","childContextTypes","propTypes","string","isRequired","bool","func"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,YAAlB;;AAEA,MAAMC,qBAAqB,GAAGC,GAAG,IAAI,MAAK,KAAI,cAAJ,CAAL,EAA0BA,GAA1B,CAArC;;AAEA,MAAMC,IAAI,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AAC/B,QAAMC,aAAa,GAAG,UAAS,kBAAT,CAAtB;;AACA,QAAM;AAACC,IAAAA;AAAD,MAASF,OAAf;AACA,QAAM;AAACG,IAAAA,KAAD;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA,OAArB;AAA8BC,IAAAA,KAA9B;AAAqCC,IAAAA,QAAQ;
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/radio-group/item.js"],"names":["React","PropTypes","classNames","Provider","style","getTargetValueAndCall","fun","themeStyle","setup","coorpmanager","Item","props","context","idRadioButton","skin","color","name","value","checked","label","onChange","theme","defaultColor","mainClass","normal","backgroundColor","borderRightColor","radio","selected","labelSpan","contextTypes","childContextTypes","propTypes","string","isRequired","bool","func"],"mappings":";;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,YAAlB;;AAEA,MAAMC,qBAAqB,GAAGC,GAAG,IAAI,MAAK,KAAI,cAAJ,CAAL,EAA0BA,GAA1B,CAArC;;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEJ,KAAK,CAACI,KADI;AAEjBC,EAAAA,YAAY,EAAEL,KAAK,CAACK;AAFH,CAAnB;;AAKA,MAAMC,IAAI,GAAG,CAACC,KAAD,EAAQC,OAAR,KAAoB;AAC/B,QAAMC,aAAa,GAAG,UAAS,kBAAT,CAAtB;;AACA,QAAM;AAACC,IAAAA;AAAD,MAASF,OAAf;AACA,QAAM;AAACG,IAAAA,KAAD;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA,OAArB;AAA8BC,IAAAA,KAA9B;AAAqCC,IAAAA,QAAQ,YAA7C;AAA0DC,IAAAA;AAA1D,MAAmEV,KAAzE;;AACA,QAAMW,YAAY,GAAGP,KAAK,IAAI,KAAI,gBAAJ,EAAsBD,IAAtB,CAA9B;;AACA,QA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AAIfZ,EAAAA,KAAK,EAAEpB,SAAS,CAACgC,MAJF;AAKff,EAAAA,OAAO,EAAEjB,SAAS,CAACkC,IALJ;AAMfhB,EAAAA,KAAK,EAAElB,SAAS,CAACgC,MANF;AAOfb,EAAAA,QAAQ,EAAEnB,SAAS,CAACmC;AAPL,CAAjB;AAUA,eAAe1B,IAAf","sourcesContent":["import React from 'react';\nimport {get, pipe, identity, uniqueId} from 'lodash/fp';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Provider from '../provider';\nimport style from './item.css';\n\nconst getTargetValueAndCall = fun => pipe(get('target.value'), fun);\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager\n};\n\nconst Item = (props, context) => {\n const idRadioButton = uniqueId('inputRadioButton');\n const {skin} = context;\n const {color, name, value, checked, label, onChange = identity, theme} = props;\n const defaultColor = color || get('common.primary', skin);\n const mainClass = themeStyle[theme];\n return (\n <div\n className={classNames(style.normal, mainClass)}\n style={{\n backgroundColor: checked && defaultColor,\n borderRightColor: defaultColor,\n color: !checked && defaultColor\n }}\n >\n <input\n type=\"radio\"\n id={idRadioButton}\n className={style.radio}\n name={name}\n value={value}\n checked={checked}\n onChange={getTargetValueAndCall(onChange)}\n />\n <label\n className={classNames(style.label, checked && style.selected)}\n style={{\n color: !checked && defaultColor\n }}\n htmlFor={idRadioButton}\n >\n <span className={style.labelSpan} data-name={`radio-${value}`} title={label}>\n {label}\n </span>\n </label>\n </div>\n );\n};\n\nItem.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\nItem.propTypes = {\n color: PropTypes.string,\n value: PropTypes.string.isRequired,\n name: PropTypes.string,\n theme: PropTypes.string,\n checked: PropTypes.bool,\n label: PropTypes.string,\n onChange: PropTypes.func\n};\n\nexport default Item;\n"],"file":"item.js"}
|
|
@@ -4,10 +4,6 @@ import renderComponentMacro from '../../../test/helpers/render-component';
|
|
|
4
4
|
import MoleculeBanner from '..';
|
|
5
5
|
import fixtureDefault from './fixtures/default';
|
|
6
6
|
import fixtureErrorBanner from './fixtures/error-banner';
|
|
7
|
-
import fixtureErrorTemporaryBanner from './fixtures/error-temporary-banner';
|
|
8
|
-
import fixtureSuccessBanner from './fixtures/success-banner';
|
|
9
|
-
import fixtureSuccessTemporaryBanner from './fixtures/success-temporary-banner';
|
|
10
|
-
import fixtureWarningTemporaryBanner from './fixtures/warning-temporary-banner';
|
|
11
7
|
test('Molecule › MoleculeBanner > should have valid propTypes', t => {
|
|
12
8
|
t.pass();
|
|
13
9
|
forEach(MoleculeBanner.propTypes, (value, key) => {
|
|
@@ -16,8 +12,4 @@ test('Molecule › MoleculeBanner > should have valid propTypes', t => {
|
|
|
16
12
|
});
|
|
17
13
|
test('Molecule › MoleculeBanner › Default › should be rendered', renderComponentMacro, MoleculeBanner, fixtureDefault);
|
|
18
14
|
test('Molecule › MoleculeBanner › ErrorBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureErrorBanner);
|
|
19
|
-
test('Molecule › MoleculeBanner › ErrorTemporaryBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureErrorTemporaryBanner);
|
|
20
|
-
test('Molecule › MoleculeBanner › SuccessBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureSuccessBanner);
|
|
21
|
-
test('Molecule › MoleculeBanner › SuccessTemporaryBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureSuccessTemporaryBanner);
|
|
22
|
-
test('Molecule › MoleculeBanner › WarningTemporaryBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureWarningTemporaryBanner);
|
|
23
15
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/banner/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBanner","fixtureDefault","fixtureErrorBanner","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/banner/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBanner","fixtureDefault","fixtureErrorBanner","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEAL,IAAI,CAAC,yDAAD,EAA4DM,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,cAAnF,EAAmGC,cAAnG,CAAJ;AACAJ,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,cAAvF,EAAuGE,kBAAvG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBanner from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureErrorBanner from './fixtures/error-banner';\n\ntest('Molecule › MoleculeBanner > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBanner.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBanner.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBanner › Default › should be rendered', renderComponentMacro, MoleculeBanner, fixtureDefault);\ntest('Molecule › MoleculeBanner › ErrorBanner › should be rendered', renderComponentMacro, MoleculeBanner, fixtureErrorBanner);\n"],"file":"fixtures.js"}
|
|
@@ -2,10 +2,6 @@ import test from 'ava';
|
|
|
2
2
|
import forEach from 'lodash/forEach';
|
|
3
3
|
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
4
|
import MoleculeSelectMultiple from '..';
|
|
5
|
-
import fixtureCheckedCmThemeDisabled from './fixtures/checked-cm-theme-disabled';
|
|
6
|
-
import fixtureCheckedCmThemeError from './fixtures/checked-cm-theme-error';
|
|
7
|
-
import fixtureCheckedCmThemeMultiple from './fixtures/checked-cm-theme-multiple';
|
|
8
|
-
import fixtureCheckedCmTheme from './fixtures/checked-cm-theme';
|
|
9
5
|
import fixtureCheckedCockpitTheme from './fixtures/checked-cockpit-theme';
|
|
10
6
|
import fixtureCheckedSetupTheme from './fixtures/checked-setup-theme';
|
|
11
7
|
import fixtureChecked from './fixtures/checked';
|
|
@@ -18,10 +14,6 @@ test('Molecule › MoleculeSelectMultiple > should have valid propTypes', t => {
|
|
|
18
14
|
t.not(value, undefined, `PropType for "Molecule.MoleculeSelectMultiple.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
19
15
|
});
|
|
20
16
|
});
|
|
21
|
-
test('Molecule › MoleculeSelectMultiple › CheckedCmThemeDisabled › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedCmThemeDisabled);
|
|
22
|
-
test('Molecule › MoleculeSelectMultiple › CheckedCmThemeError › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedCmThemeError);
|
|
23
|
-
test('Molecule › MoleculeSelectMultiple › CheckedCmThemeMultiple › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedCmThemeMultiple);
|
|
24
|
-
test('Molecule › MoleculeSelectMultiple › CheckedCmTheme › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedCmTheme);
|
|
25
17
|
test('Molecule › MoleculeSelectMultiple › CheckedCockpitTheme › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedCockpitTheme);
|
|
26
18
|
test('Molecule › MoleculeSelectMultiple › CheckedSetupTheme › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedSetupTheme);
|
|
27
19
|
test('Molecule › MoleculeSelectMultiple › Checked › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureChecked);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/select-multiple/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSelectMultiple","
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/select-multiple/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSelectMultiple","fixtureCheckedCockpitTheme","fixtureCheckedSetupTheme","fixtureChecked","fixtureDefault","fixtureSetupThemeError","fixtureSetupTheme","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,sBAAP,MAAmC,IAAnC;AACA,OAAOC,0BAAP,MAAuC,kCAAvC;AACA,OAAOC,wBAAP,MAAqC,gCAArC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,sBAAP,MAAmC,8BAAnC;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AAEAT,IAAI,CAAC,iEAAD,EAAoEU,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACAV,EAAAA,OAAO,CAACE,sBAAsB,CAACS,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAd,IAAI,CAAC,8EAAD,EAAiFE,oBAAjF,EAAuGC,sBAAvG,EAA+HC,0BAA/H,CAAJ;AACAJ,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,sBAArG,EAA6HE,wBAA7H,CAAJ;AACAL,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHG,cAAnH,CAAJ;AACAN,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHI,cAAnH,CAAJ;AACAP,IAAI,CAAC,0EAAD,EAA6EE,oBAA7E,EAAmGC,sBAAnG,EAA2HK,sBAA3H,CAAJ;AACAR,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,sBAA9F,EAAsHM,iBAAtH,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSelectMultiple from '..';\nimport fixtureCheckedCockpitTheme from './fixtures/checked-cockpit-theme';\nimport fixtureCheckedSetupTheme from './fixtures/checked-setup-theme';\nimport fixtureChecked from './fixtures/checked';\nimport fixtureDefault from './fixtures/default';\nimport fixtureSetupThemeError from './fixtures/setup-theme-error';\nimport fixtureSetupTheme from './fixtures/setup-theme';\n\ntest('Molecule › MoleculeSelectMultiple > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSelectMultiple.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSelectMultiple.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSelectMultiple › CheckedCockpitTheme › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedCockpitTheme);\ntest('Molecule › MoleculeSelectMultiple › CheckedSetupTheme › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureCheckedSetupTheme);\ntest('Molecule › MoleculeSelectMultiple › Checked › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureChecked);\ntest('Molecule › MoleculeSelectMultiple › Default › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureDefault);\ntest('Molecule › MoleculeSelectMultiple › SetupThemeError › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureSetupThemeError);\ntest('Molecule › MoleculeSelectMultiple › SetupTheme › should be rendered', renderComponentMacro, MoleculeSelectMultiple, fixtureSetupTheme);\n"],"file":"fixtures.js"}
|
|
@@ -17,7 +17,7 @@ const buildCtaButton = cta => {
|
|
|
17
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
18
|
className: classNames(style.button, style.binButton)
|
|
19
19
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
20
|
-
onClick: cta.
|
|
20
|
+
onClick: cta.handleOnClick,
|
|
21
21
|
type: "text",
|
|
22
22
|
icon: {
|
|
23
23
|
type: 'bin',
|
|
@@ -63,7 +63,7 @@ PlayListTranslation.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
63
63
|
})),
|
|
64
64
|
cta: PropTypes.shape({
|
|
65
65
|
label: PropTypes.string,
|
|
66
|
-
|
|
66
|
+
handleOnClick: PropTypes.func,
|
|
67
67
|
type: PropTypes.oneOf(['delete'])
|
|
68
68
|
}),
|
|
69
69
|
'list-aria-label': PropTypes.string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/organism/content-translation/index.js"],"names":["React","PropTypes","classNames","VerticalLanguageMenu","InputText","TextArea","Button","style","buildCtaButton","cta","button","binButton","
|
|
1
|
+
{"version":3,"sources":["../../../src/organism/content-translation/index.js"],"names":["React","PropTypes","classNames","VerticalLanguageMenu","InputText","TextArea","Button","style","buildCtaButton","cta","button","binButton","handleOnClick","type","position","label","PlayListTranslation","props","languageTabs","inputText","textArea","listAriaLabel","ctaButton","ariaLabel","container","menu","horizontalSection","input","propTypes","tabs","shape","theme","string","func","oneOf"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,QAAP,MAAqB,2BAArB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cD,CAnBD;;AAqBAN,mBAAmB,CAACY,SAApB,2CAAgC;AAC9BV,EAAAA,YAAY,EAAEf,oBAAoB,CAACyB,SAArB,CAA+BC,IADf;AAE9BV,EAAAA,SAAS,EAAElB,SAAS,CAAC6B,KAAV,uBAAoB1B,SAAS,CAACwB,SAA9B;AAAyCG,IAAAA,KAAK,EAAE9B,SAAS,CAAC+B;AAA1D,KAFmB;AAG9BZ,EAAAA,QAAQ,EAAEnB,SAAS,CAAC6B,KAAV,uBAAoBzB,QAAQ,CAACuB,SAA7B;AAAwCG,IAAAA,KAAK,EAAE9B,SAAS,CAAC+B;AAAzD,KAHoB;AAI9BvB,EAAAA,GAAG,EAAER,SAAS,CAAC6B,KAAV,CAAgB;AACnBf,IAAAA,KAAK,EAAEd,SAAS,CAAC+B,MADE;AAEnBpB,IAAAA,aAAa,EAAEX,SAAS,CAACgC,IAFN;AAGnBpB,IAAAA,IAAI,EAAEZ,SAAS,CAACiC,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAHa,GAAhB,CAJyB;AAS9B,qBAAmBjC,SAAS,CAAC+B;AATC,CAAhC;AAYA,eAAehB,mBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport VerticalLanguageMenu from '../../molecule/vertical-tabs';\nimport InputText from '../../atom/input-text';\nimport TextArea from '../../atom/input-textarea';\nimport Button from '../../atom/button-link';\nimport style from './style.css';\n\nconst buildCtaButton = cta => {\n if (!cta) {\n return;\n }\n\n return (\n <div className={classNames(style.button, style.binButton)}>\n <Button\n onClick={cta.handleOnClick}\n type=\"text\"\n icon={{type: 'bin', position: 'left'}}\n label={cta.label}\n />\n </div>\n );\n};\n\nconst PlayListTranslation = props => {\n const {languageTabs, inputText, textArea, cta, 'list-aria-label': listAriaLabel} = props;\n const ctaButton = buildCtaButton(cta);\n\n const ariaLabel = {'aria-label': listAriaLabel};\n return (\n <div className={style.container}>\n <VerticalLanguageMenu {...ariaLabel} className={style.menu} tabs={languageTabs} />\n <div className={style.horizontalSection}>\n <div className={style.input}>\n <InputText {...inputText} />\n </div>\n <div className={style.input}>\n <TextArea {...textArea} />\n </div>\n {ctaButton}\n </div>\n </div>\n );\n};\n\nPlayListTranslation.propTypes = {\n languageTabs: VerticalLanguageMenu.propTypes.tabs,\n inputText: PropTypes.shape({...InputText.propTypes, theme: PropTypes.string}),\n textArea: PropTypes.shape({...TextArea.propTypes, theme: PropTypes.string}),\n cta: PropTypes.shape({\n label: PropTypes.string,\n handleOnClick: PropTypes.func,\n type: PropTypes.oneOf(['delete'])\n }),\n 'list-aria-label': PropTypes.string\n};\n\nexport default PlayListTranslation;\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/organism/content-translation/test/fixtures/delete.js"],"names":["vericalMenu","inputText","textArea","languageTabs","props","tabs","cta","label","type","handleOnClick"],"mappings":"AAAA,OAAOA,WAAP,MAAwB,qEAAxB;AACA,OAAOC,SAAP,MAAsB,sDAAtB;AACA,OAAOC,QAAP,MAAqB,0DAArB;AAEA,MAAMC,YAAY,GAAGH,WAAW,CAACI,KAAZ,CAAkBC,IAAvC;AAEA,eAAe;AACbD,EAAAA,KAAK,EAAE;AACLD,IAAAA,YADK;AAELF,IAAAA,SAAS,EAAEA,SAAS,CAACG,KAFhB;AAGLF,IAAAA,QAAQ,EAAEA,QAAQ,CAACE,KAHd;AAILE,IAAAA,GAAG,EAAE;AACHC,MAAAA,KAAK,EAAE,oBADJ;AAEHC,MAAAA,IAAI,EAAE,QAFH;AAGHC,MAAAA,aAAa,EAAE,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/organism/content-translation/test/fixtures/delete.js"],"names":["vericalMenu","inputText","textArea","languageTabs","props","tabs","cta","label","type","handleOnClick","console","log"],"mappings":"AAAA,OAAOA,WAAP,MAAwB,qEAAxB;AACA,OAAOC,SAAP,MAAsB,sDAAtB;AACA,OAAOC,QAAP,MAAqB,0DAArB;AAEA,MAAMC,YAAY,GAAGH,WAAW,CAACI,KAAZ,CAAkBC,IAAvC;AAEA,eAAe;AACbD,EAAAA,KAAK,EAAE;AACLD,IAAAA,YADK;AAELF,IAAAA,SAAS,EAAEA,SAAS,CAACG,KAFhB;AAGLF,IAAAA,QAAQ,EAAEA,QAAQ,CAACE,KAHd;AAILE,IAAAA,GAAG,EAAE;AACHC,MAAAA,KAAK,EAAE,oBADJ;AAEHC,MAAAA,IAAI,EAAE,QAFH;AAGHC,MAAAA,aAAa,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,gBAAZ;AAHlB,KAJA;AASL,uBAAmB;AATd;AADM,CAAf","sourcesContent":["import vericalMenu from '../../../../molecule/vertical-tabs/test/fixtures/with-selected-item';\nimport inputText from '../../../../atom/input-text/test/fixtures/cm-default';\nimport textArea from '../../../../atom/input-textarea/test/fixtures/cm-default';\n\nconst languageTabs = vericalMenu.props.tabs;\n\nexport default {\n props: {\n languageTabs,\n inputText: inputText.props,\n textArea: textArea.props,\n cta: {\n label: 'Delete translation',\n type: 'delete',\n handleOnClick: () => console.log('delete locales')\n },\n 'list-aria-label': 'Languages list'\n }\n};\n"],"file":"delete.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import OrganismPlaylistTranslation from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureDelete from './fixtures/delete';
|
|
7
|
+
test('Organism › OrganismPlaylistTranslation > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(OrganismPlaylistTranslation.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Organism.OrganismPlaylistTranslation.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Organism › OrganismPlaylistTranslation › Default › should be rendered', renderComponentMacro, OrganismPlaylistTranslation, fixtureDefault);
|
|
14
|
+
test('Organism › OrganismPlaylistTranslation › Delete › should be rendered', renderComponentMacro, OrganismPlaylistTranslation, fixtureDelete);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/organism/playlist-translation/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","OrganismPlaylistTranslation","fixtureDefault","fixtureDelete","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,2BAAP,MAAwC,IAAxC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEAL,IAAI,CAAC,sEAAD,EAAyEM,CAAC,IAAI;AAChFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,2BAA2B,CAACK,SAA7B,EAAwC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC7DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,gEAA+DF,GAAI,mEAA5F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,uEAAD,EAA0EE,oBAA1E,EAAgGC,2BAAhG,EAA6HC,cAA7H,CAAJ;AACAJ,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,2BAA/F,EAA4HE,aAA5H,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport OrganismPlaylistTranslation from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDelete from './fixtures/delete';\n\ntest('Organism › OrganismPlaylistTranslation > should have valid propTypes', t => {\n t.pass();\n forEach(OrganismPlaylistTranslation.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Organism.OrganismPlaylistTranslation.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Organism › OrganismPlaylistTranslation › Default › should be rendered', renderComponentMacro, OrganismPlaylistTranslation, fixtureDefault);\ntest('Organism › OrganismPlaylistTranslation › Delete › should be rendered', renderComponentMacro, OrganismPlaylistTranslation, fixtureDelete);\n"],"file":"fixtures.js"}
|
|
@@ -6,13 +6,15 @@ import GridList from '../../../organism/grid-list';
|
|
|
6
6
|
import BrandCard from '../../../molecule/brand-card';
|
|
7
7
|
import BrandCardCreate from '../../../molecule/brand-card-create';
|
|
8
8
|
import Search from '../../../atom/input-search';
|
|
9
|
+
import RadioGroup from '../../../atom/radio-group';
|
|
9
10
|
import Layout from '../layout';
|
|
10
11
|
import style from './style.css';
|
|
11
12
|
const BrandList = Layout(props => {
|
|
12
13
|
const {
|
|
13
14
|
brands = [],
|
|
14
15
|
create,
|
|
15
|
-
search
|
|
16
|
+
search,
|
|
17
|
+
filter
|
|
16
18
|
} = props;
|
|
17
19
|
const brandCards = brands.map((brand, index) => {
|
|
18
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -30,7 +32,9 @@ const BrandList = Layout(props => {
|
|
|
30
32
|
|
|
31
33
|
return /*#__PURE__*/React.createElement("div", {
|
|
32
34
|
className: style.container
|
|
33
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
}, filter ? /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: style.filterBar
|
|
37
|
+
}, /*#__PURE__*/React.createElement(RadioGroup, filter)) : null, /*#__PURE__*/React.createElement("div", {
|
|
34
38
|
className: style.searchBar
|
|
35
39
|
}, /*#__PURE__*/React.createElement(Search, _extends({}, search, {
|
|
36
40
|
theme: "coorpmanager"
|
|
@@ -40,6 +44,7 @@ const BrandList = Layout(props => {
|
|
|
40
44
|
});
|
|
41
45
|
BrandList.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
42
46
|
brands: PropTypes.arrayOf(PropTypes.shape(BrandCard.propTypes)),
|
|
47
|
+
filter: PropTypes.shape(RadioGroup.propTypes),
|
|
43
48
|
search: PropTypes.shape(Search.propTypes),
|
|
44
49
|
create: PropTypes.shape(BrandCardCreate.propTypes)
|
|
45
50
|
} : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/template/back-office/brand-list/index.js"],"names":["React","PropTypes","GridList","BrandCard","BrandCardCreate","Search","Layout","style","BrandList","props","brands","create","search","brandCards","map","brand","index","title","push","container","searchBar","wrapper","propTypes","arrayOf","shape"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,6BAArB;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,OAAOC,eAAP,MAA4B,qCAA5B;AACA,OAAOC,MAAP,MAAmB,4BAAnB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,SAAS,GAAGF,MAAM,CAACG,KAAK,IAAI;AAChC,QAAM;AAACC,IAAAA,MAAM,GAAG,EAAV;AAAcC,IAAAA,MAAd;AAAsBC,IAAAA;
|
|
1
|
+
{"version":3,"sources":["../../../../src/template/back-office/brand-list/index.js"],"names":["React","PropTypes","GridList","BrandCard","BrandCardCreate","Search","RadioGroup","Layout","style","BrandList","props","brands","create","search","filter","brandCards","map","brand","index","title","push","container","filterBar","searchBar","wrapper","propTypes","arrayOf","shape"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,6BAArB;AACA,OAAOC,SAAP,MAAsB,8BAAtB;AACA,OAAOC,eAAP,MAA4B,qCAA5B;AACA,OAAOC,MAAP,MAAmB,4BAAnB;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,OAAO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CAAlB,CADY;AAEpBX,EAAAA,MAAM,EAAEb,SAAS,CAAC0B,KAAV,CAAgBrB,UAAU,CAACmB,SAA3B,CAFY;AAGpBZ,EAAAA,MAAM,EAAEZ,SAAS,CAAC0B,KAAV,CAAgBtB,MAAM,CAACoB,SAAvB,CAHY;AAIpBb,EAAAA,MAAM,EAAEX,SAAS,CAAC0B,KAAV,CAAgBvB,eAAe,CAACqB,SAAhC;AAJY,CAAtB;AAOA,eAAehB,SAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport GridList from '../../../organism/grid-list';\nimport BrandCard from '../../../molecule/brand-card';\nimport BrandCardCreate from '../../../molecule/brand-card-create';\nimport Search from '../../../atom/input-search';\nimport RadioGroup from '../../../atom/radio-group';\nimport Layout from '../layout';\nimport style from './style.css';\n\nconst BrandList = Layout(props => {\n const {brands = [], create, search, filter} = props;\n\n const brandCards = brands.map((brand, index) => {\n return (\n <div key={brand.title} className={style.brand}>\n <BrandCard {...brand} />\n </div>\n );\n });\n\n if (create) {\n brandCards.push(\n <div key=\"new\" className={style.brand}>\n <BrandCardCreate {...create} />\n </div>\n );\n }\n\n return (\n <div className={style.container}>\n {filter ? (\n <div className={style.filterBar}>\n <RadioGroup {...filter} />\n </div>\n ) : null}\n <div className={style.searchBar}>\n <Search {...search} theme=\"coorpmanager\" />\n </div>\n <div className={style.wrapper}>\n <GridList>{brandCards}</GridList>\n </div>\n </div>\n );\n});\n\nBrandList.propTypes = {\n brands: PropTypes.arrayOf(PropTypes.shape(BrandCard.propTypes)),\n filter: PropTypes.shape(RadioGroup.propTypes),\n search: PropTypes.shape(Search.propTypes),\n create: PropTypes.shape(BrandCardCreate.propTypes)\n};\n\nexport default BrandList;\n"],"file":"index.js"}
|
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
border-radius: 2px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
.filterBar {
|
|
34
|
+
width: 400px;
|
|
35
|
+
margin: auto;
|
|
36
|
+
padding-bottom: 20px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
33
40
|
@media desktop {
|
|
34
41
|
.wrapper {
|
|
35
42
|
width: 960px;
|
|
@@ -50,6 +57,12 @@
|
|
|
50
57
|
margin: 0 30px;
|
|
51
58
|
box-sizing: content-box;
|
|
52
59
|
}
|
|
60
|
+
|
|
61
|
+
.filterBar {
|
|
62
|
+
width: auto;
|
|
63
|
+
margin: 0 30px;
|
|
64
|
+
box-sizing: content-box;
|
|
65
|
+
}
|
|
53
66
|
}
|
|
54
67
|
|
|
55
68
|
@media mobile {
|
|
@@ -16,6 +16,21 @@ export default {
|
|
|
16
16
|
placeholder: 'Search brand',
|
|
17
17
|
onChange: () => {}
|
|
18
18
|
},
|
|
19
|
+
filter: {
|
|
20
|
+
list: [{
|
|
21
|
+
name: 'customer',
|
|
22
|
+
value: 'customer',
|
|
23
|
+
checked: false,
|
|
24
|
+
label: 'Customer platforms'
|
|
25
|
+
}, {
|
|
26
|
+
name: 'team',
|
|
27
|
+
value: 'team',
|
|
28
|
+
checked: true,
|
|
29
|
+
label: 'Team platforms'
|
|
30
|
+
}],
|
|
31
|
+
theme: 'coorpmanager',
|
|
32
|
+
onChange: value => console.log(value)
|
|
33
|
+
},
|
|
19
34
|
create: {
|
|
20
35
|
edit: 'Create a new platform',
|
|
21
36
|
editHref: '#'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/template/back-office/brand-list/test/fixtures/default.js"],"names":["BrandCard","Header","props","header","isHome","brands","search","value","placeholder","onChange","create","edit","editHref"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,0DAAtB;AACA,OAAOC,MAAP,MAAmB,4DAAnB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUF,SAAhB;AAEA,eAAe;AACbE,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,wBAAMF,MAAM,CAACC,KAAb;AAAoBE,MAAAA,MAAM,EAAE;AAA5B,MADD;AAELC,IAAAA,MAAM,EAAE,CAACH,KAAD,EAAQA,KAAR,EAAeA,KAAf,EAAsBA,KAAtB,EAA6BA,KAA7B,CAFH;AAGLI,IAAAA,MAAM,EAAE;AACNC,MAAAA,KAAK,EAAE,EADD;AAENC,MAAAA,WAAW,EAAE,cAFP;AAGNC,MAAAA,QAAQ,EAAE,MAAM,CAAE;AAHZ,KAHH;AAQLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,uBADA;AAENC,MAAAA,QAAQ,EAAE;AAFJ;
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/template/back-office/brand-list/test/fixtures/default.js"],"names":["BrandCard","Header","props","header","isHome","brands","search","value","placeholder","onChange","filter","list","name","checked","label","theme","console","log","create","edit","editHref"],"mappings":";;AAAA,OAAOA,SAAP,MAAsB,0DAAtB;AACA,OAAOC,MAAP,MAAmB,4DAAnB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUF,SAAhB;AAEA,eAAe;AACbE,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,wBAAMF,MAAM,CAACC,KAAb;AAAoBE,MAAAA,MAAM,EAAE;AAA5B,MADD;AAELC,IAAAA,MAAM,EAAE,CAACH,KAAD,EAAQA,KAAR,EAAeA,KAAf,EAAsBA,KAAtB,EAA6BA,KAA7B,CAFH;AAGLI,IAAAA,MAAM,EAAE;AACNC,MAAAA,KAAK,EAAE,EADD;AAENC,MAAAA,WAAW,EAAE,cAFP;AAGNC,MAAAA,QAAQ,EAAE,MAAM,CAAE;AAHZ,KAHH;AAQLC,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,CACJ;AACEC,QAAAA,IAAI,EAAE,UADR;AAEEL,QAAAA,KAAK,EAAE,UAFT;AAGEM,QAAAA,OAAO,EAAE,KAHX;AAIEC,QAAAA,KAAK,EAAE;AAJT,OADI,EAOJ;AACEF,QAAAA,IAAI,EAAE,MADR;AAEEL,QAAAA,KAAK,EAAE,MAFT;AAGEM,QAAAA,OAAO,EAAE,IAHX;AAIEC,QAAAA,KAAK,EAAE;AAJT,OAPI,CADA;AAeNC,MAAAA,KAAK,EAAE,cAfD;AAgBNN,MAAAA,QAAQ,EAAEF,KAAK,IAAIS,OAAO,CAACC,GAAR,CAAYV,KAAZ;AAhBb,KARH;AA0BLW,IAAAA,MAAM,EAAE;AACNC,MAAAA,IAAI,EAAE,uBADA;AAENC,MAAAA,QAAQ,EAAE;AAFJ;AA1BH;AADM,CAAf","sourcesContent":["import BrandCard from '../../../../../molecule/brand-card/test/fixtures/default';\nimport Header from '../../../../../organism/setup-header/test/fixtures/default';\n\nconst {props} = BrandCard;\n\nexport default {\n props: {\n header: {...Header.props, isHome: true},\n brands: [props, props, props, props, props],\n search: {\n value: '',\n placeholder: 'Search brand',\n onChange: () => {}\n },\n filter: {\n list: [\n {\n name: 'customer',\n value: 'customer',\n checked: false,\n label: 'Customer platforms'\n },\n {\n name: 'team',\n value: 'team',\n checked: true,\n label: 'Team platforms'\n }\n ],\n theme: 'coorpmanager',\n onChange: value => console.log(value)\n },\n create: {\n edit: 'Create a new platform',\n editHref: '#'\n }\n }\n};\n"],"file":"default.js"}
|