@coorpacademy/components 10.5.6 → 10.5.7-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/es/atom/range/handle.css +18 -2
  2. package/es/atom/range/handle.js +7 -3
  3. package/es/atom/range/handle.js.map +1 -1
  4. package/es/atom/range/style.css +2 -2
  5. package/es/atom/select/index.js +38 -20
  6. package/es/atom/select/index.js.map +1 -1
  7. package/es/atom/select/style.css +150 -42
  8. package/es/atom/select/test/fixtures/player.js +11 -0
  9. package/es/atom/select/test/fixtures/player.js.map +1 -0
  10. package/es/atom/select/test/fixtures.js +2 -0
  11. package/es/atom/select/test/fixtures.js.map +1 -1
  12. package/es/atom/select/test/select.js +49 -0
  13. package/es/atom/select/test/select.js.map +1 -0
  14. package/es/molecule/course-sections/test/fixtures.js +15 -0
  15. package/es/molecule/course-sections/test/fixtures.js.map +1 -0
  16. package/es/molecule/draggable-list/test/fixtures.js +2 -0
  17. package/es/molecule/draggable-list/test/fixtures.js.map +1 -1
  18. package/es/molecule/questions/drop-down/index.js +1 -6
  19. package/es/molecule/questions/drop-down/index.js.map +1 -1
  20. package/es/molecule/questions/free-text/index.js +35 -15
  21. package/es/molecule/questions/free-text/index.js.map +1 -1
  22. package/es/molecule/questions/free-text/style.css +39 -15
  23. package/es/molecule/questions/free-text/test/fixtures/default.js +1 -1
  24. package/es/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  25. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js +9 -0
  26. package/es/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  27. package/es/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  28. package/es/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  29. package/es/molecule/questions/free-text/test/fixtures.js +4 -2
  30. package/es/molecule/questions/free-text/test/fixtures.js.map +1 -1
  31. package/es/molecule/questions/free-text/test/free-text.js +106 -0
  32. package/es/molecule/questions/free-text/test/free-text.js.map +1 -0
  33. package/es/molecule/questions/qcm/index.js +37 -25
  34. package/es/molecule/questions/qcm/index.js.map +1 -1
  35. package/es/molecule/questions/qcm/style.css +48 -14
  36. package/es/molecule/questions/qcm/test/fixtures/default.js +8 -0
  37. package/es/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  38. package/es/molecule/questions/qcm/test/qcm.js +103 -0
  39. package/es/molecule/questions/qcm/test/qcm.js.map +1 -0
  40. package/es/molecule/questions/qcm-graphic/index.js +35 -17
  41. package/es/molecule/questions/qcm-graphic/index.js.map +1 -1
  42. package/es/molecule/questions/qcm-graphic/style.css +64 -13
  43. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js +65 -0
  44. package/es/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  45. package/es/molecule/questions/question-range/style.css +9 -8
  46. package/es/molecule/questions/template/index.js +13 -10
  47. package/es/molecule/questions/template/index.js.map +1 -1
  48. package/es/molecule/wizard-summary/test/fixtures.js +2 -0
  49. package/es/molecule/wizard-summary/test/fixtures.js.map +1 -1
  50. package/es/organism/wizard-contents/test/fixtures.js +2 -0
  51. package/es/organism/wizard-contents/test/fixtures.js.map +1 -1
  52. package/es/template/back-office/brand-update/test/fixtures.js +2 -0
  53. package/es/template/back-office/brand-update/test/fixtures.js.map +1 -1
  54. package/es/util/get-shadow-box-color-from-primary.js +4 -0
  55. package/es/util/get-shadow-box-color-from-primary.js.map +1 -0
  56. package/es/util/test/get-shadow-box-color-from-primary.js +33 -0
  57. package/es/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  58. package/es/variables/colors.css +3 -0
  59. package/lib/atom/range/handle.css +18 -2
  60. package/lib/atom/range/handle.js +8 -3
  61. package/lib/atom/range/handle.js.map +1 -1
  62. package/lib/atom/range/style.css +2 -2
  63. package/lib/atom/select/index.js +40 -17
  64. package/lib/atom/select/index.js.map +1 -1
  65. package/lib/atom/select/style.css +150 -42
  66. package/lib/atom/select/test/fixtures/player.js +21 -0
  67. package/lib/atom/select/test/fixtures/player.js.map +1 -0
  68. package/lib/atom/select/test/fixtures.js +3 -0
  69. package/lib/atom/select/test/fixtures.js.map +1 -1
  70. package/lib/atom/select/test/select.js +62 -0
  71. package/lib/atom/select/test/select.js.map +1 -0
  72. package/lib/molecule/course-sections/test/fixtures.js +25 -0
  73. package/lib/molecule/course-sections/test/fixtures.js.map +1 -0
  74. package/lib/molecule/draggable-list/test/fixtures.js +3 -0
  75. package/lib/molecule/draggable-list/test/fixtures.js.map +1 -1
  76. package/lib/molecule/questions/drop-down/index.js +1 -5
  77. package/lib/molecule/questions/drop-down/index.js.map +1 -1
  78. package/lib/molecule/questions/free-text/index.js +32 -14
  79. package/lib/molecule/questions/free-text/index.js.map +1 -1
  80. package/lib/molecule/questions/free-text/style.css +39 -15
  81. package/lib/molecule/questions/free-text/test/fixtures/default.js +1 -1
  82. package/lib/molecule/questions/free-text/test/fixtures/default.js.map +1 -1
  83. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js +14 -0
  84. package/lib/molecule/questions/free-text/test/fixtures/with-value-on-change.js.map +1 -0
  85. package/lib/molecule/questions/free-text/test/fixtures/{with-default-value.js → with-value.js} +2 -2
  86. package/lib/molecule/questions/free-text/test/fixtures/with-value.js.map +1 -0
  87. package/lib/molecule/questions/free-text/test/fixtures.js +5 -2
  88. package/lib/molecule/questions/free-text/test/fixtures.js.map +1 -1
  89. package/lib/molecule/questions/free-text/test/free-text.js +119 -0
  90. package/lib/molecule/questions/free-text/test/free-text.js.map +1 -0
  91. package/lib/molecule/questions/qcm/index.js +44 -23
  92. package/lib/molecule/questions/qcm/index.js.map +1 -1
  93. package/lib/molecule/questions/qcm/style.css +48 -14
  94. package/lib/molecule/questions/qcm/test/fixtures/default.js +8 -0
  95. package/lib/molecule/questions/qcm/test/fixtures/default.js.map +1 -1
  96. package/lib/molecule/questions/qcm/test/qcm.js +115 -0
  97. package/lib/molecule/questions/qcm/test/qcm.js.map +1 -0
  98. package/lib/molecule/questions/qcm-graphic/index.js +33 -15
  99. package/lib/molecule/questions/qcm-graphic/index.js.map +1 -1
  100. package/lib/molecule/questions/qcm-graphic/style.css +64 -13
  101. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js +76 -0
  102. package/lib/molecule/questions/qcm-graphic/test/qcm-graphic.js.map +1 -0
  103. package/lib/molecule/questions/question-range/style.css +9 -8
  104. package/lib/molecule/questions/template/index.js +13 -10
  105. package/lib/molecule/questions/template/index.js.map +1 -1
  106. package/lib/molecule/wizard-summary/test/fixtures.js +3 -0
  107. package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -1
  108. package/lib/organism/wizard-contents/test/fixtures.js +3 -0
  109. package/lib/organism/wizard-contents/test/fixtures.js.map +1 -1
  110. package/lib/template/back-office/brand-update/test/fixtures.js +3 -0
  111. package/lib/template/back-office/brand-update/test/fixtures.js.map +1 -1
  112. package/lib/util/get-shadow-box-color-from-primary.js +12 -0
  113. package/lib/util/get-shadow-box-color-from-primary.js.map +1 -0
  114. package/lib/util/test/get-shadow-box-color-from-primary.js +40 -0
  115. package/lib/util/test/get-shadow-box-color-from-primary.js.map +1 -0
  116. package/lib/variables/colors.css +3 -0
  117. package/package.json +2 -2
  118. package/es/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  119. package/es/molecule/search/test/fixtures.js +0 -15
  120. package/es/molecule/search/test/fixtures.js.map +0 -1
  121. package/lib/molecule/questions/free-text/test/fixtures/with-default-value.js.map +0 -1
  122. package/lib/molecule/search/test/fixtures.js +0 -25
  123. package/lib/molecule/search/test/fixtures.js.map +0 -1
@@ -1,10 +1,26 @@
1
1
  @value colors: "../../variables/colors.css";
2
- @value brand from colors;
2
+ @value white from colors;
3
+ @value cm_grey_200 from colors;
4
+ @value cm_grey_500 from colors;
5
+
6
+ .wrapper {
7
+ height: 100%;
8
+ width: 100%;
9
+ border-radius: 100%;
10
+ box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.25);
11
+ overflow: hidden;
12
+ }
13
+
14
+ .wrapper:hover {
15
+ box-shadow: none;
16
+ overflow: visible;
17
+ }
3
18
 
4
19
  .default {
5
20
  border-radius: 100%;
6
- border: 1px solid brand;
21
+ border: 4px solid white;
7
22
  box-sizing: border-box;
8
23
  height: 100%;
9
24
  width: 100%;
25
+ border-radius: 100%;
10
26
  }
@@ -6,6 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
  import React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import Provider from '../provider';
9
+ import { getShadowBoxColorFromPrimary } from '../../util/get-shadow-box-color-from-primary';
9
10
  import style from './handle.css';
10
11
  const Hammer = // eslint-disable-next-line no-undef
11
12
  typeof window !== 'undefined' ? require('hammerjs') :
@@ -53,15 +54,18 @@ class Handle extends React.Component {
53
54
 
54
55
  const primaryColor = _getOr('#00B0FF', 'common.primary', skin);
55
56
 
56
- const borderColor = primaryColor;
57
+ const backgroundColor = primaryColor;
57
58
  return /*#__PURE__*/React.createElement("div", {
59
+ className: style.wrapper
60
+ }, /*#__PURE__*/React.createElement("div", {
58
61
  style: {
59
- borderColor
62
+ backgroundColor,
63
+ boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`
60
64
  },
61
65
  className: style.default,
62
66
  ref: this.setHandle,
63
67
  "data-name": 'handle'
64
- });
68
+ }));
65
69
  }
66
70
 
67
71
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/range/handle.js"],"names":["React","PropTypes","Provider","style","Hammer","window","require","undefined","Handle","Component","constructor","props","context","setHandle","bind","componentDidMount","onPanStart","onPanEnd","onPan","hammer","handle","on","componentWillUnmount","stop","destroy","el","render","skin","primaryColor","borderColor","default","childContextTypes","propTypes","func"],"mappings":";;;;;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,KAAP,MAAkB,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AA,KAAK,EAAE;AAACC,QAAAA;AAAD,OADT;AAEE,MAAA,SAAS,EAAE1B,KAAK,CAAC2B,OAFnB;AAGE,MAAA,GAAG,EAAE,KAAKjB,SAHZ;AAIE,mBAAW;AAJb,MADF;AAQD;;AAvDkC;;gBAA/BL,M,kBAOkB;AACpBmB,EAAAA,IAAI,EAAEzB,QAAQ,CAAC6B,iBAAT,CAA2BJ;AADb,C;;AAPlBnB,M,CACGwB,S,2CAAY;AACjBd,EAAAA,KAAK,EAAEjB,SAAS,CAACgC,IADA;AAEjBjB,EAAAA,UAAU,EAAEf,SAAS,CAACgC,IAFL;AAGjBhB,EAAAA,QAAQ,EAAEhB,SAAS,CAACgC;AAHH,C;AAyDrB,eAAezB,MAAf","sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../provider';\nimport style from './handle.css';\n\nconst Hammer =\n // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? require('hammerjs') : /* istanbul ignore next */ undefined;\n\nclass Handle extends React.Component {\n static propTypes = {\n onPan: PropTypes.func,\n onPanStart: PropTypes.func,\n onPanEnd: PropTypes.func\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n\n this.setHandle = this.setHandle.bind(this);\n }\n\n componentDidMount() {\n /* istanbul ignore else */\n if (Hammer) {\n const {onPanStart = noop, onPanEnd = noop, onPan = noop} = this.props;\n\n this.hammer = new Hammer(this.handle);\n this.hammer.on('panstart', onPanStart);\n this.hammer.on('panend', onPanEnd);\n\n this.hammer.on('panleft panright', onPan);\n }\n }\n\n componentWillUnmount() {\n if (this.hammer) {\n this.hammer.stop();\n this.hammer.destroy();\n }\n this.hammer = null;\n }\n\n setHandle(el) {\n this.handle = el;\n }\n\n render() {\n const {skin} = this.context;\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const borderColor = primaryColor;\n\n return (\n <div\n style={{borderColor}}\n className={style.default}\n ref={this.setHandle}\n data-name={'handle'}\n />\n );\n }\n}\n\nexport default Handle;\n"],"file":"handle.js"}
1
+ {"version":3,"sources":["../../../src/atom/range/handle.js"],"names":["React","PropTypes","Provider","getShadowBoxColorFromPrimary","style","Hammer","window","require","undefined","Handle","Component","constructor","props","context","setHandle","bind","componentDidMount","onPanStart","onPanEnd","onPan","hammer","handle","on","componentWillUnmount","stop","destroy","el","render","skin","primaryColor","backgroundColor","wrapper","boxShadow","default","childContextTypes","propTypes","func"],"mappings":";;;;;AACA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,SAAQC,4BAAR,QAA2C,8CAA3C;AACA,OAAOC,KAAP,MAAkB,cAAlB;AAEA,MAAMC,MAAM,GACV;AACA,OAAOC,MAAP,KAAkB,WAAlB,GAAgCC,OAAO,CAAC,UAAD,CAAvC;AAAsD;AAA2BC,SAFnF;;AAIA,MAAMC,MAAN,SAAqBT,KAAK,CAACU,SAA3B,CAAqC;AAWnCC,EAAAA,WAAW,CAACC,KAAD,EAAQC,OAAR,EAAiB;AAC1B,UAAMD,KAAN,EAAaC,OAAb;AAEA,SAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAoB,IAApB,CAAjB;AACD;;AAEDC,EAAAA,iBAAiB,GAAG;AAClB;AACA,QAAIX,MAAJ,EAAY;AACV,YAAM;AAACY,QAAAA,UAAU,QAAX;AAAoBC,QAAAA,QAAQ,QAA5B;AAAqCC,QAAAA,KAAK;AAA1C,UAAqD,KAAKP,KAAhE;AAEA,WAAKQ,MAAL,GAAc,IAAIf,MAAJ,CAAW,KAAKgB,MAAhB,CAAd;AACA,WAAKD,MAAL,CAAYE,EAAZ,CAAe,UAAf,EAA2BL,UAA3B;AACA,WAAKG,MAAL,CAAYE,EAAZ,CAAe,QAAf,EAAyBJ,QAAzB;AAEA,WAAKE,MAAL,CAAYE,EAAZ,CAAe,kBAAf,EAAmCH,KAAnC;AACD;AACF;;AAEDI,EAAAA,oBAAoB,GAAG;AACrB,QAAI,KAAKH,MAAT,EAAiB;AACf,WAAKA,MAAL,CAAYI,IAAZ;AACA,WAAKJ,MAAL,CAAYK,OAAZ;AACD;;AACD,SAAKL,MAAL,GAAc,IAAd;AACD;;AAEDN,EAAAA,SAAS,CAACY,EAAD,EAAK;AACZ,SAAKL,MAAL,GAAcK,EAAd;AACD;;AAEDC,EAAAA,MAAM,GAAG;AACP,UAAM;AAACC,MAAAA;AAAD,QAAS,KAAKf,OAApB;;AACA,UAAMgB,YAAY,GAAG,OAAM,SAAN,EAAiB,gBAAjB,EAAmCD,IAAnC,CAArB;;AACA,UAAME,eAAe,GAAGD,YAAxB;AAEA,wBACE;AAAK,MAAA,SAAS,EAAEzB,KAAK,CAAC2B;AAAtB,oBACE;AACE,MAAA,KAAK,EAAE;AACLD,QAAAA,eADK;AAELE,QAAAA,SAAS,EAAG,gBAAe7B,4BAA4B,CAAC0B,YAAD,CAAe;AAFjE,OADT;AAKE,MAAA,SAAS,EAAEzB,KAAK,CAAC6B,OALnB;AAME,MAAA,GAAG,EAAE,KAAKnB,SANZ;AAOE,mBAAW;AAPb,MADF,CADF;AAaD;;AA5DkC;;gBAA/BL,M,kBAOkB;AACpBmB,EAAAA,IAAI,EAAE1B,QAAQ,CAACgC,iBAAT,CAA2BN;AADb,C;;AAPlBnB,M,CACG0B,S,2CAAY;AACjBhB,EAAAA,KAAK,EAAElB,SAAS,CAACmC,IADA;AAEjBnB,EAAAA,UAAU,EAAEhB,SAAS,CAACmC,IAFL;AAGjBlB,EAAAA,QAAQ,EAAEjB,SAAS,CAACmC;AAHH,C;AA8DrB,eAAe3B,MAAf","sourcesContent":["import {noop, getOr} from 'lodash/fp';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Provider from '../provider';\nimport {getShadowBoxColorFromPrimary} from '../../util/get-shadow-box-color-from-primary';\nimport style from './handle.css';\n\nconst Hammer =\n // eslint-disable-next-line no-undef\n typeof window !== 'undefined' ? require('hammerjs') : /* istanbul ignore next */ undefined;\n\nclass Handle extends React.Component {\n static propTypes = {\n onPan: PropTypes.func,\n onPanStart: PropTypes.func,\n onPanEnd: PropTypes.func\n };\n\n static contextTypes = {\n skin: Provider.childContextTypes.skin\n };\n\n constructor(props, context) {\n super(props, context);\n\n this.setHandle = this.setHandle.bind(this);\n }\n\n componentDidMount() {\n /* istanbul ignore else */\n if (Hammer) {\n const {onPanStart = noop, onPanEnd = noop, onPan = noop} = this.props;\n\n this.hammer = new Hammer(this.handle);\n this.hammer.on('panstart', onPanStart);\n this.hammer.on('panend', onPanEnd);\n\n this.hammer.on('panleft panright', onPan);\n }\n }\n\n componentWillUnmount() {\n if (this.hammer) {\n this.hammer.stop();\n this.hammer.destroy();\n }\n this.hammer = null;\n }\n\n setHandle(el) {\n this.handle = el;\n }\n\n render() {\n const {skin} = this.context;\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n const backgroundColor = primaryColor;\n\n return (\n <div className={style.wrapper}>\n <div\n style={{\n backgroundColor,\n boxShadow: `0px 0px 20px ${getShadowBoxColorFromPrimary(primaryColor)}`\n }}\n className={style.default}\n ref={this.setHandle}\n data-name={'handle'}\n />\n </div>\n );\n }\n}\n\nexport default Handle;\n"],"file":"handle.js"}
@@ -15,9 +15,9 @@
15
15
  }
16
16
 
17
17
  .track {
18
- height: 6px;
18
+ height: 10px;
19
19
  width: 100%;
20
- border-radius: 3px;
20
+ border-radius: 32px;
21
21
  background-color: light;
22
22
  transform: translate3d(0, -50%, 0);
23
23
  position: absolute;
@@ -1,8 +1,14 @@
1
+ import _size from "lodash/fp/size";
2
+ import _includes from "lodash/fp/includes";
1
3
  import _filter from "lodash/fp/filter";
4
+ import _getOr from "lodash/fp/getOr";
2
5
  import _get from "lodash/fp/get";
3
6
  import _map from "lodash/fp/map";
4
7
  import _keys from "lodash/fp/keys";
5
8
  import _find from "lodash/fp/find";
9
+
10
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11
+
6
12
  import React, { useMemo } from 'react';
7
13
  import PropTypes from 'prop-types';
8
14
  import classnames from 'classnames';
@@ -18,7 +24,9 @@ const themeStyle = {
18
24
  question: style.question,
19
25
  sort: style.sort,
20
26
  thematiques: style.thematiques,
21
- template: style.template
27
+ player: style.player,
28
+ template: style.template // we keep template in case it is used anywhere else?
29
+
22
30
  };
23
31
 
24
32
  const Select = (props, context) => {
@@ -40,52 +48,61 @@ const Select = (props, context) => {
40
48
  const {
41
49
  skin
42
50
  } = context;
43
- const title = propTitle ? `${propTitle}${required ? '*' : ''}` : null;
51
+ const title = useMemo(() => propTitle ? `${propTitle}${required ? '*' : ''}` : null, [propTitle, required]);
44
52
  const optionList = options && options.map((option, index) => {
45
53
  return /*#__PURE__*/React.createElement("option", {
46
54
  key: index,
47
- value: option.value
55
+ value: option.value,
56
+ className: style.selectOption
48
57
  }, option.name);
49
58
  });
50
59
  const titleView = title ? /*#__PURE__*/React.createElement("span", {
51
60
  className: style.title
52
61
  }, title, " ") : null;
53
- const selected = multiple ? _map(_get('value'), _filter({
62
+ const selected = useMemo(() => multiple ? _map(_get('value'), _filter({
54
63
  selected: true
55
64
  }, options)) : _get('value', _find({
56
65
  selected: true
57
- }, options));
58
- const selectedLabel = multiple ? _map(_get('name'), _filter({
66
+ }, options)), [multiple, options]);
67
+ const selectedLabel = useMemo(() => multiple ? _map(_get('name'), _filter({
59
68
  selected: true
60
69
  }, options)) : _get('name', _find({
61
70
  selected: true
62
- }, options));
71
+ }, options)), [multiple, options]);
72
+ const isSelectedInValidOption = useMemo(() => theme === 'player' && _getOr(false, 'name', _find({
73
+ validOption: false,
74
+ selected: true
75
+ }, options)), [options, theme]);
63
76
  const handleChange = useMemo(() => multiple ? e => {
64
77
  onChange(_map(_get('value'), e.target.selectedOptions));
65
78
  } : e => {
66
79
  onChange(e.target.value);
67
80
  }, [onChange, multiple]);
68
-
69
- const black = _get('common.black', skin);
70
-
71
- const color = _get('common.primary', skin);
72
-
73
- const skinColor = {
74
- color: selected && (theme === 'question' || theme === 'template') ? color : null
75
- };
81
+ const black = useMemo(() => _getOr('#14171A', 'common.black', skin), [skin]);
82
+ const color = useMemo(() => _getOr('#00B0FF', 'common.primary', skin), [skin]);
83
+ const shouldUseSkinFontColor = useMemo(() => !isSelectedInValidOption && selected && _includes(theme, ['question', 'template', 'player']), [isSelectedInValidOption, selected, theme]);
76
84
  const arrowView = !multiple ? /*#__PURE__*/React.createElement(ArrowDown, {
77
85
  color: selected && (theme === 'question' || theme === 'template') ? color : black,
78
86
  className: style.arrow
79
87
  }) : null;
80
- const behaviourClassName = getClassState(style.default, style.modified, style.error, modified, error);
81
- const composedClassName = classnames(theme ? themeStyle[theme] : behaviourClassName, selected ? style.selected : style.unselected, className);
88
+ const behaviourClassName = useMemo(() => getClassState(style.default, style.modified, style.error, modified, error), [error, modified]);
89
+ const composedClassName = useMemo(() => classnames(theme ? themeStyle[theme] : behaviourClassName, selected ? style.selected : style.unselected, className), [behaviourClassName, className, selected, theme]);
90
+ const labelSize = useMemo(() => _size(selectedLabel), [selectedLabel]);
91
+ const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);
82
92
  return /*#__PURE__*/React.createElement("div", {
83
93
  className: composedClassName
84
94
  }, /*#__PURE__*/React.createElement("label", {
85
- style: skinColor
95
+ "data-name": "select-wrapper",
96
+ style: _extends({}, shouldUseSkinFontColor && {
97
+ color
98
+ }),
99
+ className: style.selectWrapper
86
100
  }, titleView, /*#__PURE__*/React.createElement("span", {
87
- className: classnames(style.label, borderClassName)
101
+ "data-name": "select-span",
102
+ className: classnames(style.selectSpan, _includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template']) ? style.noLabelCommon : null, borderClassName, isLongLabel ? style.longLabel : null)
88
103
  }, selectedLabel), arrowView, /*#__PURE__*/React.createElement("select", {
104
+ "data-name": "native-select",
105
+ className: style.selectBox,
89
106
  title: selectedLabel,
90
107
  name: name,
91
108
  onChange: handleChange,
@@ -100,7 +117,8 @@ const Select = (props, context) => {
100
117
  export const SelectOptionPropTypes = {
101
118
  name: PropTypes.string.isRequired,
102
119
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
103
- selected: PropTypes.bool
120
+ selected: PropTypes.bool,
121
+ validOption: PropTypes.bool
104
122
  };
105
123
  Select.contextTypes = {
106
124
  skin: Provider.childContextTypes.skin
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/atom/select/index.js"],"names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDown","Provider","getClassState","style","themeStyle","filter","invalid","header","mooc","question","sort","thematiques","template","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","titleView","selected","selectedLabel","handleChange","e","target","selectedOptions","black","color","skinColor","arrowView","arrow","behaviourClassName","default","composedClassName","unselected","label","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEF,KAAK,CAACE,MADG;AAEjBC,EAAAA,OAAO,EAAEH,KAAK,CAACG,OAFE;AAGjBC,EAAAA,MAAM,EAAEJ,KAAK,CAACI,MAHG;AAIjBC,EAAAA,IAAI,EAAEL,KAAK,CAACK,IAJK;AAKjB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B7B,EAAAA,IAAI,EAAE7B,QAAQ,CAAC2D,iBAAT,CAA2B9B;AADb,CAAtB;AAIAjB,MAAM,CAACgD,SAAP,2CAAmB;AACjBjC,EAAAA,KAAK,EAAE/B,SAAS,CAACyD,MADA;AAEjBtC,EAAAA,IAAI,EAAEnB,SAAS,CAACyD,MAFC;AAGjBpC,EAAAA,SAAS,EAAErB,SAAS,CAACyD,MAHJ;AAIjBnC,EAAAA,eAAe,EAAEtB,SAAS,CAACyD,MAJV;AAKjBhC,EAAAA,QAAQ,EAAEzB,SAAS,CAAC6D,IALH;AAMjBrC,EAAAA,QAAQ,EAAExB,SAAS,CAAC6D,IANH;AAOjBlC,EAAAA,WAAW,EAAE3B,SAAS,CAACyD,MAPN;AAQjB/B,EAAAA,QAAQ,EAAE1B,SAAS,CAAC6D,IARH;AASjBtC,EAAAA,QAAQ,EAAEvB,SAAS,CAACiE,IATH;AAUjBrC,EAAAA,KAAK,EAAE5B,SAAS,CAACkE,KAAV,CAAgB,MAAK3D,UAAL,CAAhB,CAVU;AAWjBa,EAAAA,OAAO,EAAEpB,SAAS,CAACmE,OAAV,CAAkBnE,SAAS,CAACoE,KAAV,CAAgBZ,qBAAhB,CAAlB,CAXQ;AAYjB3B,EAAAA,QAAQ,EAAE7B,SAAS,CAAC6D,IAZH;AAajB/B,EAAAA,KAAK,EAAE9B,SAAS,CAAC6D;AAbA,CAAnB;AAgBA,eAAe7C,MAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {find, keys, map, get, filter} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n template: style.template\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = propTitle ? `${propTitle}${required ? '*' : ''}` : null;\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options));\n const selectedLabel = multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options));\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = get('common.black', skin);\n const color = get('common.primary', skin);\n const skinColor = {\n color: selected && (theme === 'question' || theme === 'template') ? color : null\n };\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={selected && (theme === 'question' || theme === 'template') ? color : black}\n className={style.arrow}\n />\n ) : null;\n const behaviourClassName = getClassState(\n style.default,\n style.modified,\n style.error,\n modified,\n error\n );\n const composedClassName = classnames(\n theme ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n );\n\n return (\n <div className={composedClassName}>\n <label style={skinColor}>\n {titleView}\n <span className={classnames(style.label, borderClassName)}>{selectedLabel}</span>\n {arrowView}\n <select\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/atom/select/index.js"],"names":["React","useMemo","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDown","Provider","getClassState","style","themeStyle","filter","invalid","header","mooc","question","sort","thematiques","player","template","Select","props","context","name","options","className","borderClassName","onChange","multiple","disabled","required","description","theme","modified","error","title","propTitle","skin","optionList","map","option","index","value","selectOption","titleView","selected","selectedLabel","isSelectedInValidOption","validOption","handleChange","e","target","selectedOptions","black","color","shouldUseSkinFontColor","arrowView","arrow","behaviourClassName","default","composedClassName","unselected","labelSize","isLongLabel","selectWrapper","selectSpan","noLabelCommon","longLabel","selectBox","SelectOptionPropTypes","string","isRequired","oneOfType","number","bool","contextTypes","childContextTypes","propTypes","func","oneOf","arrayOf","shape"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,MAAM,EAAEF,KAAK,CAACE,MADG;AAEjBC,EAAAA,OAAO,EAAEH,KAAK,CAACG,OAFE;AAGjBC,EAAAA,MAAM,EAAEJ,KAAK,CAACI,MAHG;AAIjBC,EAAAA,IAAI,EAAEL,KAAK,CAACK,IAJK;AAKjBC,EAAAA,QAAQ,E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useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {find, keys, map, get, getOr, filter, includes, size} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport Provider from '../provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n filter: style.filter,\n invalid: style.invalid,\n header: style.header,\n mooc: style.mooc,\n question: style.question,\n sort: style.sort,\n thematiques: style.thematiques,\n player: style.player,\n template: style.template // we keep template in case it is used anywhere else?\n};\n\nconst Select = (props, context) => {\n const {\n name,\n options = [],\n className,\n borderClassName,\n onChange,\n multiple = false,\n disabled,\n required,\n description,\n theme,\n modified = false,\n error = false,\n title: propTitle\n } = props;\n\n const {skin} = context;\n\n const title = useMemo(() => (propTitle ? `${propTitle}${required ? '*' : ''}` : null), [\n propTitle,\n required\n ]);\n\n const optionList =\n options &&\n options.map((option, index) => {\n return (\n <option key={index} value={option.value} className={style.selectOption}>\n {option.name}\n </option>\n );\n });\n\n const titleView = title ? <span className={style.title}>{title} </span> : null;\n\n const selected = useMemo(\n () =>\n multiple\n ? map(get('value'), filter({selected: true}, options))\n : get('value', find({selected: true}, options)),\n [multiple, options]\n );\n const selectedLabel = useMemo(\n () =>\n multiple\n ? map(get('name'), filter({selected: true}, options))\n : get('name', find({selected: true}, options)),\n [multiple, options]\n );\n\n const isSelectedInValidOption = useMemo(\n () =>\n theme === 'player' &&\n getOr(false, 'name', find({validOption: false, selected: true}, options)),\n [options, theme]\n );\n\n const handleChange = useMemo(\n () =>\n multiple\n ? e => {\n onChange(map(get('value'), e.target.selectedOptions));\n }\n : e => {\n onChange(e.target.value);\n },\n [onChange, multiple]\n );\n\n const black = useMemo(() => getOr('#14171A', 'common.black', skin), [skin]);\n const color = useMemo(() => getOr('#00B0FF', 'common.primary', skin), [skin]);\n const shouldUseSkinFontColor = useMemo(\n () =>\n !isSelectedInValidOption && selected && includes(theme, ['question', 'template', 'player']),\n [isSelectedInValidOption, selected, theme]\n );\n\n const arrowView = !multiple ? (\n <ArrowDown\n color={selected && (theme === 'question' || theme === 'template') ? color : black}\n className={style.arrow}\n />\n ) : null;\n const behaviourClassName = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [error, modified]\n );\n const composedClassName = useMemo(\n () =>\n classnames(\n theme ? themeStyle[theme] : behaviourClassName,\n selected ? style.selected : style.unselected,\n className\n ),\n [behaviourClassName, className, selected, theme]\n );\n\n const labelSize = useMemo(() => size(selectedLabel), [selectedLabel]);\n\n const isLongLabel = useMemo(() => labelSize >= 65, [labelSize]);\n\n return (\n <div className={composedClassName}>\n <label\n data-name=\"select-wrapper\"\n style={{\n ...(shouldUseSkinFontColor && {\n color\n })\n }}\n className={style.selectWrapper}\n >\n {titleView}\n <span\n data-name=\"select-span\"\n className={classnames(\n style.selectSpan,\n includes(theme, ['player', 'invalid', 'question', 'thematiques', 'template'])\n ? style.noLabelCommon\n : null,\n borderClassName,\n isLongLabel ? style.longLabel : null\n )}\n >\n {selectedLabel}\n </span>\n {arrowView}\n <select\n data-name=\"native-select\"\n className={style.selectBox}\n title={selectedLabel}\n name={name}\n onChange={handleChange}\n value={selected}\n multiple={multiple}\n disabled={disabled}\n >\n {optionList}\n </select>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nexport const SelectOptionPropTypes = {\n name: PropTypes.string.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n selected: PropTypes.bool,\n validOption: PropTypes.bool\n};\n\nSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelect.propTypes = {\n title: PropTypes.string,\n name: PropTypes.string,\n className: PropTypes.string,\n borderClassName: PropTypes.string,\n disabled: PropTypes.bool,\n multiple: PropTypes.bool,\n description: PropTypes.string,\n required: PropTypes.bool,\n onChange: PropTypes.func,\n theme: PropTypes.oneOf(keys(themeStyle)),\n options: PropTypes.arrayOf(PropTypes.shape(SelectOptionPropTypes)),\n modified: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default Select;\n"],"file":"index.js"}
@@ -10,6 +10,8 @@
10
10
  @value white from colors;
11
11
  @value xtraLightGrey from colors;
12
12
  @value transparent from colors;
13
+ @value box_shadow_light_dark from colors;
14
+ @value cm_blue_900 from colors;
13
15
 
14
16
  .default {
15
17
  display: flex;
@@ -23,7 +25,11 @@
23
25
  composes: default;
24
26
  }
25
27
 
26
- .default label {
28
+ .selectWrapper {
29
+ position: relative;
30
+ }
31
+
32
+ .default .selectWrapper {
27
33
  display: flex;
28
34
  align-items: center;
29
35
  height: 50px;
@@ -41,20 +47,16 @@
41
47
  width: 180px;
42
48
  }
43
49
 
44
- .label {
50
+ .selectSpan {
45
51
  display: none;
46
- position: absolute;
52
+ position: relative;
53
+ z-index: 10;
47
54
  white-space: nowrap;
48
- overflow: hidden;
49
- left: 0;
50
- right: 0;
51
- bottom: 0;
52
55
  pointer-events: none;
53
- text-overflow: ellipsis;
54
56
  height: 18px;
55
57
  }
56
58
 
57
- .default select {
59
+ .default .selectBox {
58
60
  font-family: "Gilroy";
59
61
  text-transform: none;
60
62
  padding: 0 15px;
@@ -68,6 +70,22 @@
68
70
  outline: none;
69
71
  appearance: none;
70
72
  cursor: pointer;
73
+ position: absolute;
74
+ left: 0;
75
+ right: 0;
76
+ bottom: 0;
77
+ }
78
+
79
+ .selectOption,
80
+
81
+ .no-label .selectWrapper{
82
+ min-width: min-content;
83
+ height: min-content;
84
+ }
85
+
86
+ .player .selectWrapper {
87
+ min-width: min-content;
88
+ height: min-content;
71
89
  }
72
90
 
73
91
  .modified select {
@@ -112,6 +130,7 @@
112
130
  pointer-events: none;
113
131
  width: 12px;
114
132
  height: 12px;
133
+ z-index: 11;
115
134
  }
116
135
 
117
136
  @media mobile {
@@ -121,7 +140,7 @@
121
140
  }
122
141
  }
123
142
 
124
- .default select[multiple] {
143
+ .default .selectBox[multiple] {
125
144
  padding: 0;
126
145
  height: 80px;
127
146
  }
@@ -130,7 +149,7 @@
130
149
  Filter
131
150
  */
132
151
 
133
- .filter label {
152
+ .filter .selectWrapper {
134
153
  display: flex;
135
154
  align-items: center;
136
155
  position: relative;
@@ -140,7 +159,7 @@
140
159
  margin: 0;
141
160
  }
142
161
 
143
- .filter .label {
162
+ .filter .selectSpan {
144
163
  display: block;
145
164
  padding: 15px 30px 15px 15px;
146
165
  font-size: 12px;
@@ -157,7 +176,7 @@
157
176
  margin-bottom: 10px;
158
177
  }
159
178
 
160
- .filter select {
179
+ .filter .selectBox {
161
180
  display: block;
162
181
  width: 100%;
163
182
  height: 50px;
@@ -186,57 +205,112 @@
186
205
  position: relative;
187
206
  }
188
207
 
189
- .no-label label {
208
+ .no-label .selectWrapper {
190
209
  display: flex;
191
210
  align-items: center;
192
- height: 44px;
211
+ min-height: 54px;
193
212
  position: relative;
194
213
  flex-grow: 0;
195
214
  }
196
215
 
197
- .no-label .label {
216
+ .noLabelCommon {
198
217
  display: block;
199
218
  padding: 0 30px 0 10px;
200
219
  font-size: 14px;
220
+ height: 54px;
221
+ line-height: 52px;
222
+ box-sizing: border-box;
223
+ }
224
+
225
+ div.default label.selectWrapper span.longLabel {
226
+ min-width: 230px;
227
+ max-width: 280px;
228
+ white-space: pre-wrap;
229
+ line-height: 22px;
230
+ padding-top: 15px;
231
+ padding-bottom: 15px;
232
+ height: auto;
233
+ border: none;
234
+ }
235
+
236
+ div:not(.player) .noLabelCommon.selectSpan {
201
237
  border: 1px solid light;
202
238
  background: white;
203
239
  border-radius: 2px;
204
- height: 44px;
205
- line-height: 42px;
206
- box-sizing: border-box;
240
+ min-width: min-content;
241
+ width: 100%;
242
+ }
243
+
244
+ div.player .noLabelCommon.selectSpan {
245
+ box-shadow: 0px 4px 16px box_shadow_light_dark;
246
+ border-radius: 8px;
247
+ min-width: min-content;
248
+ width: 100%;
207
249
  white-space: nowrap;
208
- text-overflow: ellipsis;
209
250
  }
210
251
 
211
- .no-label select {
252
+ .no-label .selectBox {
212
253
  font-family: "Gilroy";
213
254
  text-transform: none;
214
255
  padding: 0 15px;
215
- height: 44px;
256
+ height: 54px;
216
257
  border-radius: 2px;
217
- font-size: 16px;
258
+ font-size: 14px;
218
259
  color: black;
219
260
  font-weight: normal;
220
261
  margin-left: 0;
221
262
  width: 230px;
263
+ max-width: 280px;
222
264
  cursor: pointer;
223
265
  background: white;
224
266
  border: 2px solid xtraLightGrey;
225
267
  }
226
268
 
227
269
  @media mobile {
228
- .no-label select {
229
- height: 100%;
230
- width: 100%;
270
+ div.player .selectBox {
271
+ min-width: 0;
272
+ }
273
+
274
+ .no-label .selectBox {
231
275
  margin-left: 0;
232
276
  border-radius: 0;
277
+ position: absolute;
278
+ left: 0;
279
+ right: 0;
280
+ bottom: 0;
233
281
  }
234
282
 
235
- .no-label label {
283
+ .no-label .selectWrapper {
236
284
  display: block;
237
285
  margin-right: 0;
238
286
  width: 100%;
239
- height: 44px;
287
+ min-height: 44px;
288
+ height: min-content;
289
+ min-width: 250px;
290
+ max-width: 280px;
291
+ }
292
+
293
+ .player .noLabelCommon {
294
+ height: min-content;
295
+ }
296
+
297
+ div.player .noLabelCommon.selectSpan {
298
+ min-width: 250px;
299
+ max-width: 280px;
300
+ white-space: pre-wrap;
301
+ }
302
+
303
+ .noLabelCommon.longLabel {
304
+ line-height: 22px;
305
+ height: 100%;
306
+ }
307
+
308
+ .player.default .selectBox {
309
+ position: absolute;
310
+ top: 0px;
311
+ left: 0px;
312
+ width: 100%;
313
+ height: 100%;
240
314
  }
241
315
  }
242
316
 
@@ -248,12 +322,16 @@
248
322
  composes: no-label;
249
323
  }
250
324
 
251
- .invalid label {
325
+ .invalid .player {
326
+ color: cm_blue_900;
327
+ }
328
+
329
+ .invalid .selectWrapper {
252
330
  height: 54px;
253
331
  color: black;
254
332
  }
255
333
 
256
- .invalid .label {
334
+ .invalid .selectSpan {
257
335
  font-size: 15px;
258
336
  font-weight: 700;
259
337
  border: 2px solid;
@@ -271,7 +349,7 @@
271
349
  width: 150px;
272
350
  }
273
351
 
274
- .mooc label {
352
+ .mooc .selectWrapper {
275
353
  margin: 0;
276
354
  height: 35px;
277
355
  border: 0;
@@ -307,11 +385,11 @@
307
385
  composes: no-label;
308
386
  }
309
387
 
310
- .question label {
388
+ .question .selectWrapper {
311
389
  height: 54px;
312
390
  }
313
391
 
314
- .question .label {
392
+ .question .selectSpan {
315
393
  font-size: 15px;
316
394
  font-weight: 700;
317
395
  border: 2px solid;
@@ -328,7 +406,7 @@
328
406
  margin-bottom: 10px;
329
407
  }
330
408
 
331
- .sort label {
409
+ .sort .selectWrapper {
332
410
  display: flex;
333
411
  align-items: center;
334
412
  position: relative;
@@ -338,7 +416,7 @@
338
416
  margin: 0;
339
417
  }
340
418
 
341
- .sort .label {
419
+ .sort .selectSpan {
342
420
  display: block;
343
421
  padding: 15px 30px 15px 15px;
344
422
  font-size: 12px;
@@ -379,16 +457,46 @@
379
457
  composes: no-label;
380
458
  }
381
459
 
460
+ /*
461
+ Player
462
+ */
463
+
464
+ .player {
465
+ composes: no-label;
466
+ }
467
+
382
468
  /*
383
469
  Header
384
470
  */
385
471
 
386
472
  .header {
387
473
  composes: mooc;
388
- width: auto;
474
+ /* width: auto; */
475
+ }
476
+
477
+ .header .selectBox {
478
+ margin-left: 0;
479
+ }
480
+
481
+ .default .selectWrapper select.selectBox {
482
+ max-width: 280px;
483
+ width: inherit;
484
+ border-radius: 8px;
485
+ padding: 0;
486
+ height: 100%;
487
+ top: 0;
488
+ }
489
+
490
+ .header .title {
491
+ display: flex;
492
+ }
493
+
494
+ .header .selectWrapper select.selectBox {
495
+ padding-left: 10px;
496
+ border-radius: 2px;
389
497
  }
390
498
 
391
- .header select {
499
+ .header .selectBox {
392
500
  background-color: light;
393
501
  border: 0;
394
502
  font-weight: 700;
@@ -420,7 +528,7 @@
420
528
  composes: no-label;
421
529
  }
422
530
 
423
- .template select {
531
+ .template .selectBox {
424
532
  width: auto;
425
533
  height: 54px;
426
534
  padding: 0 50px 0 0;
@@ -428,22 +536,22 @@
428
536
  max-width: 100%;
429
537
  }
430
538
 
431
- .template .label {
539
+ .template .selectSpan {
432
540
  font-size: 15px;
433
541
  font-weight: 700;
434
542
  height: 54px;
435
543
  line-height: 52px;
436
544
  }
437
545
 
438
- .selected.template .label {
546
+ .selected.template .selectSpan {
439
547
  border: 1px solid;
440
548
  }
441
549
 
442
- .unselected.template .label {
550
+ .unselected.template .selectSpan {
443
551
  border: 1px solid color(black lightness(85%));
444
552
  }
445
553
 
446
- .template label {
554
+ .template .selectWrapper {
447
555
  display: block;
448
556
  width: auto;
449
557
  margin-right: 0;
@@ -0,0 +1,11 @@
1
+ import _defaultsDeep from "lodash/fp/defaultsDeep";
2
+ import Default from './default';
3
+ const {
4
+ props
5
+ } = Default;
6
+ export default {
7
+ props: _defaultsDeep(props, {
8
+ theme: 'player'
9
+ })
10
+ };
11
+ //# sourceMappingURL=player.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/atom/select/test/fixtures/player.js"],"names":["Default","props","theme"],"mappings":";AACA,OAAOA,OAAP,MAAoB,WAApB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,OAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAE,cAAaA,KAAb,EAAoB;AACzBC,IAAAA,KAAK,EAAE;AADkB,GAApB;AADM,CAAf","sourcesContent":["import {defaultsDeep} from 'lodash/fp';\nimport Default from './default';\n\nconst {props} = Default;\n\nexport default {\n props: defaultsDeep(props, {\n theme: 'player'\n })\n};\n"],"file":"player.js"}
@@ -11,6 +11,7 @@ import fixtureModified from './fixtures/modified';
11
11
  import fixtureMooc from './fixtures/mooc';
12
12
  import fixtureMultipleSelected from './fixtures/multiple-selected';
13
13
  import fixtureMultiple from './fixtures/multiple';
14
+ import fixturePlayer from './fixtures/player';
14
15
  import fixtureQuestion from './fixtures/question';
15
16
  import fixtureRequiredWithTitle from './fixtures/required-with-title';
16
17
  import fixtureRequired from './fixtures/required';
@@ -33,6 +34,7 @@ test('Atom › AtomSelect › Modified › should be rendered', renderComponentM
33
34
  test('Atom › AtomSelect › Mooc › should be rendered', renderComponentMacro, AtomSelect, fixtureMooc);
34
35
  test('Atom › AtomSelect › MultipleSelected › should be rendered', renderComponentMacro, AtomSelect, fixtureMultipleSelected);
35
36
  test('Atom › AtomSelect › Multiple › should be rendered', renderComponentMacro, AtomSelect, fixtureMultiple);
37
+ test('Atom › AtomSelect › Player › should be rendered', renderComponentMacro, AtomSelect, fixturePlayer);
36
38
  test('Atom › AtomSelect › Question › should be rendered', renderComponentMacro, AtomSelect, fixtureQuestion);
37
39
  test('Atom › AtomSelect › RequiredWithTitle › should be rendered', renderComponentMacro, AtomSelect, fixtureRequiredWithTitle);
38
40
  test('Atom › AtomSelect › Required › should be rendered', renderComponentMacro, AtomSelect, fixtureRequired);