@coorpacademy/components 11.38.3-alpha.1 → 11.38.3-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 (55) hide show
  1. package/es/atom/checkbox-with-title/style.css +0 -1
  2. package/es/atom/input-search/index.d.ts.map +1 -1
  3. package/es/atom/input-search/index.js +27 -11
  4. package/es/atom/input-search/index.js.map +1 -1
  5. package/es/atom/input-search/style.css +76 -0
  6. package/es/molecule/base-modal/index.d.ts.map +1 -1
  7. package/es/molecule/base-modal/index.js +3 -3
  8. package/es/molecule/base-modal/index.js.map +1 -1
  9. package/es/molecule/base-modal/style.css +4 -1
  10. package/es/molecule/search-form/index.d.ts +1 -0
  11. package/es/molecule/search-form/index.d.ts.map +1 -1
  12. package/es/molecule/search-form/index.js +14 -15
  13. package/es/molecule/search-form/index.js.map +1 -1
  14. package/es/molecule/search-form/style.css +21 -6
  15. package/es/organism/content-skill-modal/index.d.ts.map +1 -1
  16. package/es/organism/content-skill-modal/index.js +5 -5
  17. package/es/organism/content-skill-modal/index.js.map +1 -1
  18. package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
  19. package/es/organism/filter-checkbox-and-search/index.js +3 -3
  20. package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
  21. package/es/organism/list-item/style.css +1 -1
  22. package/es/organism/mooc-header/index.d.ts +9 -0
  23. package/es/organism/mooc-header/index.d.ts.map +1 -1
  24. package/es/organism/mooc-header/index.js +102 -13
  25. package/es/organism/mooc-header/index.js.map +1 -1
  26. package/es/organism/mooc-header/style.css +184 -8
  27. package/es/template/back-office/brand-update/style.css +1 -2
  28. package/lib/atom/checkbox-with-title/style.css +0 -1
  29. package/lib/atom/input-search/index.d.ts.map +1 -1
  30. package/lib/atom/input-search/index.js +27 -11
  31. package/lib/atom/input-search/index.js.map +1 -1
  32. package/lib/atom/input-search/style.css +76 -0
  33. package/lib/molecule/base-modal/index.d.ts.map +1 -1
  34. package/lib/molecule/base-modal/index.js +3 -3
  35. package/lib/molecule/base-modal/index.js.map +1 -1
  36. package/lib/molecule/base-modal/style.css +4 -1
  37. package/lib/molecule/search-form/index.d.ts +1 -0
  38. package/lib/molecule/search-form/index.d.ts.map +1 -1
  39. package/lib/molecule/search-form/index.js +15 -16
  40. package/lib/molecule/search-form/index.js.map +1 -1
  41. package/lib/molecule/search-form/style.css +21 -6
  42. package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
  43. package/lib/organism/content-skill-modal/index.js +5 -5
  44. package/lib/organism/content-skill-modal/index.js.map +1 -1
  45. package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
  46. package/lib/organism/filter-checkbox-and-search/index.js +3 -3
  47. package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
  48. package/lib/organism/list-item/style.css +1 -1
  49. package/lib/organism/mooc-header/index.d.ts +9 -0
  50. package/lib/organism/mooc-header/index.d.ts.map +1 -1
  51. package/lib/organism/mooc-header/index.js +102 -13
  52. package/lib/organism/mooc-header/index.js.map +1 -1
  53. package/lib/organism/mooc-header/style.css +184 -8
  54. package/lib/template/back-office/brand-update/style.css +1 -2
  55. package/package.json +2 -2
@@ -35,7 +35,6 @@
35
35
  justify-content: center;
36
36
  align-items: center;
37
37
  border-radius: 4px;
38
- cursor: pointer;
39
38
  }
40
39
 
41
40
  .container:hover .label {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDAkDC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAYA,iDAmEC"}
@@ -18,23 +18,39 @@ const Search = props => {
18
18
  dataTestId
19
19
  } = props;
20
20
  const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
21
- const cmStyle = classnames(style.coorpmanager);
22
- const isDefaultTheme = theme === 'default';
21
+ const isCoorpManager = theme === 'coorpmanager';
22
+ const isMooc = theme === 'mooc';
23
+ const isDefault = theme === 'default';
24
+ const wrapperClass = classnames({
25
+ [style.wrapperSearch]: isDefault,
26
+ [style.coorpmanager]: isCoorpManager,
27
+ [style.wrapperMooc]: isMooc
28
+ });
29
+ const wrapperParentClass = classnames({
30
+ [style.wrapperMoocParent]: isMooc
31
+ });
32
+ const searchClass = classnames({
33
+ [style.search]: true,
34
+ [style.moocSearch]: isMooc
35
+ });
36
+ const SearchIconComponent = isCoorpManager ? CMSearchIcon : SearchIcon;
37
+ const showTitle = isCoorpManager;
38
+ const showClearIcon = value && isCoorpManager;
23
39
  return /*#__PURE__*/React.createElement("div", {
24
- className: isDefaultTheme ? style.wrapperSearch : cmStyle
40
+ className: wrapperParentClass
41
+ }, /*#__PURE__*/React.createElement("div", {
42
+ className: wrapperClass
25
43
  }, /*#__PURE__*/React.createElement("label", {
26
44
  htmlFor: "search",
27
45
  title: placeholder
28
- }, !isDefaultTheme ? /*#__PURE__*/React.createElement(CMSearchIcon, {
46
+ }, /*#__PURE__*/React.createElement(SearchIconComponent, {
29
47
  className: style.searchIcon
30
- }) : /*#__PURE__*/React.createElement(SearchIcon, {
31
- className: style.searchIcon
32
- }), !isDefaultTheme ? /*#__PURE__*/React.createElement("span", {
48
+ }), showTitle ? /*#__PURE__*/React.createElement("span", {
33
49
  className: classnames(style.title, _isEmpty(value) && style.noValue)
34
50
  }, placeholder) : null), /*#__PURE__*/React.createElement("input", {
35
51
  "data-name": "search-input",
36
52
  "data-testid": dataTestId,
37
- className: style.search,
53
+ className: searchClass,
38
54
  "aria-label": placeholder,
39
55
  type: "text",
40
56
  name: "search",
@@ -46,10 +62,10 @@ const Search = props => {
46
62
  onFocus: onFocus,
47
63
  onChange: _noop,
48
64
  onBlur: onBlur
49
- }), value && !isDefaultTheme ? /*#__PURE__*/React.createElement(CloseIcon, {
65
+ }), showClearIcon ? /*#__PURE__*/React.createElement(CloseIcon, {
50
66
  onClick: onClear,
51
67
  className: style.clearIcon
52
- }) : null);
68
+ }) : null));
53
69
  };
54
70
  Search.contextTypes = {
55
71
  skin: Provider.childContextTypes.skin
@@ -61,7 +77,7 @@ Search.propTypes = process.env.NODE_ENV !== "production" ? {
61
77
  onClear: PropTypes.func,
62
78
  onFocus: PropTypes.func,
63
79
  onBlur: PropTypes.func,
64
- theme: PropTypes.oneOf(['default', 'coorpmanager']),
80
+ theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),
65
81
  dataTestId: PropTypes.string
66
82
  } : {};
67
83
  export default Search;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","_noop","onClear","onFocus","onBlur","theme","dataTestId","handleChange","e","target","cmStyle","coorpmanager","isDefaultTheme","createElement","className","wrapperSearch","htmlFor","title","searchIcon","_isEmpty","noValue","search","type","name","id","onInput","onClick","clearIcon","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default',\n dataTestId\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const cmStyle = classnames(style.coorpmanager);\n const isDefaultTheme = theme === 'default';\n\n return (\n <div className={isDefaultTheme ? style.wrapperSearch : cmStyle}>\n <label htmlFor=\"search\" title={placeholder}>\n {!isDefaultTheme ? (\n <CMSearchIcon className={style.searchIcon} />\n ) : (\n <SearchIcon className={style.searchIcon} />\n )}\n {!isDefaultTheme ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n data-testid={dataTestId}\n className={style.search}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n title={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {value && !isDefaultTheme ? (\n <CloseIcon onClick={onClear} className={style.clearIcon} />\n ) : null}\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager']),\n dataTestId: PropTypes.string\n};\n\nexport default Search;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qCAAqC,IAAIC,YAAY,EACrDC,iCAAiC,IAAIC,UAAU,EAC/CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AAEjC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ,GAAAC,KAAO;IACfC,OAAO,GAAAD,KAAO;IACdE,OAAO;IACPC,MAAM;IACNC,KAAK,GAAG,SAAS;IACjBC;EACF,CAAC,GAAGT,KAAK;EACT,MAAMU,YAAY,GAAGtB,OAAO,CAAC,MAAMuB,CAAC,IAAIR,QAAQ,CAACQ,CAAC,CA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A,CAACpB,SAAS;IAACiC,OAAO,EAAExB,OAAQ;IAACY,SAAS,EAAEnB,KAAK,CAACgC;EAAU,CAAE,CAAC,GACzD,IACD,CAAC;AAEV,CAAC;AAED/B,MAAM,CAACgC,YAAY,GAAG;EACpBC,IAAI,EAAEnC,QAAQ,CAACoC,iBAAiB,CAACD;AACnC,CAAC;AAEDjC,MAAM,CAACmC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjBpC,KAAK,EAAEZ,SAAS,CAACiD,MAAM;EACvBpC,WAAW,EAAEb,SAAS,CAACiD,MAAM,CAACC,UAAU;EACxCpC,QAAQ,EAAEd,SAAS,CAACmD,IAAI;EACxBnC,OAAO,EAAEhB,SAAS,CAACmD,IAAI;EACvBlC,OAAO,EAAEjB,SAAS,CAACmD,IAAI;EACvBjC,MAAM,EAAElB,SAAS,CAACmD,IAAI;EACtBhC,KAAK,EAAEnB,SAAS,CAACoD,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;EACnDhC,UAAU,EAAEpB,SAAS,CAACiD;AACxB,CAAC;AAED,eAAevC,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","Search","props","value","placeholder","onChange","_noop","onClear","onFocus","onBlur","theme","dataTestId","handleChange","e","target","isCoorpManager","isMooc","isDefault","wrapperClass","wrapperSearch","coorpmanager","wrapperMooc","wrapperParentClass","wrapperMoocParent","searchClass","search","moocSearch","SearchIconComponent","showTitle","showClearIcon","createElement","className","htmlFor","title","searchIcon","_isEmpty","noValue","type","name","id","onInput","onClick","clearIcon","contextTypes","skin","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n NovaCompositionCoorpacademySearchThin as CMSearchIcon,\n NovaCompositionCoorpacademySearch as SearchIcon,\n NovaSolidStatusClose as CloseIcon\n} from '@coorpacademy/nova-icons';\nimport {noop, isEmpty} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n theme = 'default',\n dataTestId\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const isCoorpManager = theme === 'coorpmanager';\n const isMooc = theme === 'mooc';\n const isDefault = theme === 'default';\n\n const wrapperClass = classnames({\n [style.wrapperSearch]: isDefault,\n [style.coorpmanager]: isCoorpManager,\n [style.wrapperMooc]: isMooc\n });\n\n const wrapperParentClass = classnames({\n [style.wrapperMoocParent]: isMooc\n });\n\n const searchClass = classnames({\n [style.search]: true,\n [style.moocSearch]: isMooc\n });\n\n const SearchIconComponent = isCoorpManager ? CMSearchIcon : SearchIcon;\n const showTitle = isCoorpManager;\n const showClearIcon = value && isCoorpManager;\n\n return (\n <div className={wrapperParentClass}>\n <div className={wrapperClass}>\n <label htmlFor=\"search\" title={placeholder}>\n <SearchIconComponent className={style.searchIcon} />\n {showTitle ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n data-name=\"search-input\"\n data-testid={dataTestId}\n className={searchClass}\n aria-label={placeholder}\n type=\"text\"\n name=\"search\"\n id=\"search\"\n placeholder={placeholder}\n title={placeholder}\n value={value}\n onInput={handleChange}\n onFocus={onFocus}\n onChange={noop}\n onBlur={onBlur}\n />\n {showClearIcon ? <CloseIcon onClick={onClear} className={style.clearIcon} /> : null}\n </div>\n </div>\n );\n};\n\nSearch.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSearch.propTypes = {\n value: PropTypes.string,\n placeholder: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onClear: PropTypes.func,\n onFocus: PropTypes.func,\n onBlur: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),\n dataTestId: PropTypes.string\n};\n\nexport default Search;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qCAAqC,IAAIC,YAAY,EACrDC,iCAAiC,IAAIC,UAAU,EAC/CC,oBAAoB,IAAIC,SAAS,QAC5B,0BAA0B;AAEjC,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,MAAM,GAAGC,KAAK,IAAI;EACtB,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,QAAQ,GAAAC,KAAO;IACfC,OAAO,GAAAD,KAAO;IACdE,OAAO;IACPC,MAAM;IACNC,KAAK,GAAG,SAAS;IACjBC;EACF,CAAC,GAAGT,KAAK;EACT,MAAMU,YAAY,GAAGtB,OAAO,CAAC,MAAMuB,CAAC,IAAIR,QAAQ,CAACQ,CAAC,CAACC,MAAM,CAACX,KAAK,CAAC,EAAE,CAACE,QAAQ,CAAC,CAAC;EAE7E,MAAMU,cAAc,GAAGL,KAAK,KAAK,cAAc;EAC/C,MAAMM,MAAM,GAAGN,KAAK,KAAK,MAAM;EAC/B,MAAMO,SAAS,GAAGP,KAAK,KAAK,SAAS;EAErC,MAAMQ,YAAY,GAAG1B,UAAU,CAAC;IAC9B,CAACQ,KAAK,CAACmB,aAAa,GAAGF,SAAS;IAChC,CAACjB,KAAK,CAACoB,YAAY,GAAGL,cAAc;IACpC,CAACf,KAAK,CAACqB,WAAW,GAAGL;EACvB,CAAC,CAAC;EAEF,MAAMM,kBAAkB,GAAG9B,UAAU,CAAC;IACpC,CAACQ,KAAK,CAACuB,iBAAiB,GAAGP;EAC7B,CAAC,CAAC;EAEF,MAAMQ,WAAW,GAAGhC,UA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AACwB,SAAS,EAAE/B,KAAK,CAAC0C;EAAU,CAAE,CAAC,GAAG,IAC5E,CACF,CAAC;AAEV,CAAC;AAEDzC,MAAM,CAAC0C,YAAY,GAAG;EACpBC,IAAI,EAAE7C,QAAQ,CAAC8C,iBAAiB,CAACD;AACnC,CAAC;AAED3C,MAAM,CAAC6C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjB9C,KAAK,EAAEZ,SAAS,CAAC2D,MAAM;EACvB9C,WAAW,EAAEb,SAAS,CAAC2D,MAAM,CAACC,UAAU;EACxC9C,QAAQ,EAAEd,SAAS,CAAC6D,IAAI;EACxB7C,OAAO,EAAEhB,SAAS,CAAC6D,IAAI;EACvB5C,OAAO,EAAEjB,SAAS,CAAC6D,IAAI;EACvB3C,MAAM,EAAElB,SAAS,CAAC6D,IAAI;EACtB1C,KAAK,EAAEnB,SAAS,CAAC8D,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;EAC3D1C,UAAU,EAAEpB,SAAS,CAAC2D;AACxB,CAAC;AAED,eAAejD,MAAM","ignoreList":[]}
@@ -8,11 +8,13 @@
8
8
  @value white from colors;
9
9
  @value dark from colors;
10
10
  @value black from colors;
11
+ @value cm_grey_75 from colors;
11
12
  @value cm_grey_100 from colors;
12
13
  @value cm_grey_150 from colors;
13
14
  @value cm_grey_400 from colors;
14
15
  @value cm_grey_500 from colors;
15
16
  @value cm_grey_700 from colors;
17
+ @value brand from colors;
16
18
 
17
19
  .wrapperSearch {
18
20
  display: flex;
@@ -66,6 +68,7 @@
66
68
  color: medium;
67
69
  }
68
70
 
71
+ /* Theme: coorpmanager */
69
72
  .coorpmanager {
70
73
  position: relative;
71
74
  }
@@ -177,6 +180,65 @@
177
180
  line-height: 16px;
178
181
  }
179
182
 
183
+ /* Theme: mooc */
184
+ .wrapperMooc {
185
+ display: flex;
186
+ flex-flow: nowrap;
187
+ flex-direction: row;
188
+ align-items: center;
189
+ overflow: hidden;
190
+ border-radius: 12px;
191
+ transition: box-shadow 0.3s ease-in-out;
192
+ background: cm_grey_100;
193
+ padding: 2px;
194
+ width: 100%;
195
+ flex: 1;
196
+ }
197
+
198
+ .wrapperMoocParent {
199
+ width: 100%;
200
+ flex: 1;
201
+ border-radius: 12px;
202
+ transition: box-shadow 0.3s ease-in-out;
203
+ background: transparent;
204
+ }
205
+
206
+ .moocSearch {
207
+ background-color: cm_grey_100;
208
+ border-radius: 12px;
209
+ height: 44px;
210
+ margin: 0;
211
+ font-family: Gilroy;
212
+ font-size: 14px;
213
+ font-weight: 500;
214
+ color: cm_grey_700;
215
+ padding: 0 0 0 45px;
216
+ padding-right: 48px;
217
+ outline: none;
218
+ }
219
+
220
+ .moocSearch:focus-within {
221
+ background-color: cm_grey_75;
222
+ }
223
+
224
+ .wrapperMoocParent:focus-within .wrapperMooc {
225
+ background: transparent;
226
+ box-shadow: 0 0 0 2px rgba(255,255,255,0), 0 0 0 2px brand;
227
+ }
228
+
229
+ .wrapperMooc:hover {
230
+ box-shadow: 0 0 0 2px brand;
231
+ }
232
+
233
+ .wrapperMooc .clearIcon {
234
+ position: relative;
235
+ right: 26px;
236
+ color: cm_grey_400;
237
+ width: 14px;
238
+ height: 14px;
239
+ cursor: pointer;
240
+ }
241
+
180
242
  input:-webkit-autofill,
181
243
  input:-webkit-autofill:hover,
182
244
  input:-webkit-autofill:focus,
@@ -194,6 +256,10 @@ input:-webkit-autofill:active{
194
256
  font-size: 12px;
195
257
  color: medium;
196
258
  }
259
+
260
+ .wrapperMoocParent {
261
+ min-width: 100%;
262
+ }
197
263
  }
198
264
 
199
265
  @media mobile {
@@ -204,4 +270,14 @@ input:-webkit-autofill:active{
204
270
  .search::placeholder {
205
271
  font-size: 12px;
206
272
  }
273
+
274
+ .wrapperMoocParent {
275
+ max-width: 100%;
276
+ box-sizing: border-box;
277
+ }
278
+
279
+ .wrapperMooc {
280
+ max-width: 100%;
281
+ box-sizing: border-box;
282
+ }
207
283
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";AAUA,yEA8KC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/base-modal/index.js"],"names":[],"mappings":";AAUA,yEA+KC"}
@@ -137,8 +137,7 @@ const BaseModal = (props, context) => {
137
137
  className: style.modalWrapper,
138
138
  "data-testid": "modal"
139
139
  }, /*#__PURE__*/React.createElement("div", {
140
- className: style.modal,
141
- style: customStyle
140
+ className: style.modal
142
141
  }, /*#__PURE__*/React.createElement("header", {
143
142
  className: style.header
144
143
  }, headerIcon?.name ? /*#__PURE__*/React.createElement("div", {
@@ -172,7 +171,8 @@ const BaseModal = (props, context) => {
172
171
  ref: bodyRef,
173
172
  className: isScrollbarVisible ? style.body : style.bodyWithoutScrollbar,
174
173
  onScroll: onScroll,
175
- "data-testid": "modal-body"
174
+ "data-testid": "modal-body",
175
+ style: customStyle
176
176
  }, children), /*#__PURE__*/React.createElement(Footer, null)));
177
177
  };
178
178
  BaseModal.contextTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","PropTypes","convert","Provider","Icon","ButtonLink","COLORS","style","BaseModal","props","context","title","description","headerIcon","children","isOpen","footer","onClose","onScroll","detectScrollbar","customStyle","skin","bodyRef","isScrollbarVisible","setIsScrollbarVisible","checkScrollbar","bodyElement","current","scrollHeight","clientHeight","debouncedCheckScrollbar","_debounce","mutationObserver","MutationObserver","observe","childList","subtree","resizeObserver","ResizeObserver","disconnect","cancel","Footer","_isEmpty","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","color","buttonConfirmColor","_get","createElement","className","footerCTAWrapper","button","type","onClick","_extends","backgroundColor","paddingLeft","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","size","padding","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","iconColor","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","ref","body","bodyWithoutScrollbar","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","node","bool","oneOfType","func","boolean","objectOf","number"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get, debounce} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {\n title,\n description,\n headerIcon,\n children,\n isOpen,\n footer,\n onClose,\n onScroll,\n detectScrollbar = false,\n customStyle\n } = props;\n const {skin} = context;\n const bodyRef = useRef(null);\n const [isScrollbarVisible, setIsScrollbarVisible] = useState(!detectScrollbar);\n\n const checkScrollbar = () => {\n const bodyElement = bodyRef.current;\n if (bodyElement) {\n setIsScrollbarVisible(bodyElement.scrollHeight > bodyElement.clientHeight);\n }\n };\n\n useEffect(() => {\n if (!detectScrollbar) return;\n const bodyElement = bodyRef.current;\n\n if (!bodyElement) return;\n\n const debouncedCheckScrollbar = debounce(100, () => {\n checkScrollbar();\n });\n\n // Observer of the body content\n const mutationObserver = new MutationObserver(() => {\n debouncedCheckScrollbar();\n });\n\n mutationObserver.observe(bodyElement, {childList: true, subtree: true});\n\n // Observer of the body size\n const resizeObserver = new ResizeObserver(() => {\n debouncedCheckScrollbar();\n });\n\n if (bodyRef.current) {\n resizeObserver.observe(bodyRef.current);\n }\n\n checkScrollbar();\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n debouncedCheckScrollbar.cancel();\n };\n }, [children, detectScrollbar]);\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName,\n color\n } = confirmButton || {};\n const buttonConfirmColor = color || get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.button,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled,\n 'data-testid': `button-link-${cancelLabel}`\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div>\n <ButtonLink\n {...{\n customStyle: {backgroundColor: buttonConfirmColor, paddingLeft: '16px'},\n hoverBackgroundColor: convert(\n `hsl(from ${buttonConfirmColor} h s calc(l*(1 - 0.08)))`\n ),\n hoverColor: COLORS.white,\n className: style.button,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: COLORS.white,\n size: 14,\n customStyle: {padding: 0}\n }\n }\n }\n : {}),\n 'data-testid': `button-link-${confirmLabel}`\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, skin]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper} data-testid=\"modal\">\n <div className={style.modal} style={customStyle}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose} data-testid=\"close-icon\">\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div\n ref={bodyRef}\n className={isScrollbarVisible ? style.body : style.bodyWithoutScrollbar}\n onScroll={onScroll}\n data-testid=\"modal-body\"\n >\n {children}\n </div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool,\n color: PropTypes.string\n })\n })\n ]),\n onClose: PropTypes.func,\n onScroll: PropTypes.func,\n detectScrollbar: PropTypes.bool,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default BaseModal;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,OAAO;AACrE,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,SAAS,GAAGA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AS,CAACqG,KAAK,CAAC;MAC7BvD,KAAK,EAAE9C,SAAS,CAACoG,MAAM;MACvBhD,SAAS,EAAEpD,SAAS,CAACyG,IAAI;MACzBnD,QAAQ,EAAEtD,SAAS,CAACoG,MAAM;MAC1BnD,QAAQ,EAAEjD,SAAS,CAACuG,IAAI;MACxBhD,KAAK,EAAEvD,SAAS,CAACoG;IACnB,CAAC;EACH,CAAC,CAAC,CACH,CAAC;EACFpF,OAAO,EAAEhB,SAAS,CAACyG,IAAI;EACvBxF,QAAQ,EAAEjB,SAAS,CAACyG,IAAI;EACxBvF,eAAe,EAAElB,SAAS,CAACuG,IAAI;EAC/BpF,WAAW,EAAEnB,SAAS,CAAC2G,QAAQ,CAAC3G,SAAS,CAACwG,SAAS,CAAC,CAACxG,SAAS,CAACoG,MAAM,EAAEpG,SAAS,CAAC4G,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,eAAerG,SAAS","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useEffect","useRef","useState","PropTypes","convert","Provider","Icon","ButtonLink","COLORS","style","BaseModal","props","context","title","description","headerIcon","children","isOpen","footer","onClose","onScroll","detectScrollbar","customStyle","skin","bodyRef","isScrollbarVisible","setIsScrollbarVisible","checkScrollbar","bodyElement","current","scrollHeight","clientHeight","debouncedCheckScrollbar","_debounce","mutationObserver","MutationObserver","observe","childList","subtree","resizeObserver","ResizeObserver","disconnect","cancel","Footer","_isEmpty","cancelButton","confirmButton","text","isError","label","cancelLabel","onCancel","disabled","cancelDisabled","confirmLabel","onConfirm","confirmDisabled","iconName","color","buttonConfirmColor","_get","createElement","className","footerCTAWrapper","button","type","onClick","_extends","backgroundColor","paddingLeft","hoverBackgroundColor","hoverColor","white","icon","position","faIcon","name","size","padding","footerDescription","footerDescriptionError","handleOnClose","e","stopPropagation","modalWrapper","modal","header","iconColor","faSize","wrapperSize","headerContent","headerTitle","headerDescription","headerCloseIcon","ref","body","bodyWithoutScrollbar","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","shape","node","bool","oneOfType","func","boolean","objectOf","number"],"sources":["../../../src/molecule/base-modal/index.js"],"sourcesContent":["import React, {useCallback, useEffect, useRef, useState} from 'react';\nimport PropTypes from 'prop-types';\nimport {isEmpty, get, debounce} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport Provider from '../../atom/provider';\nimport Icon from '../../atom/icon';\nimport ButtonLink from '../../atom/button-link';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\n\nconst BaseModal = (props, context) => {\n const {\n title,\n description,\n headerIcon,\n children,\n isOpen,\n footer,\n onClose,\n onScroll,\n detectScrollbar = false,\n customStyle\n } = props;\n const {skin} = context;\n const bodyRef = useRef(null);\n const [isScrollbarVisible, setIsScrollbarVisible] = useState(!detectScrollbar);\n\n const checkScrollbar = () => {\n const bodyElement = bodyRef.current;\n if (bodyElement) {\n setIsScrollbarVisible(bodyElement.scrollHeight > bodyElement.clientHeight);\n }\n };\n\n useEffect(() => {\n if (!detectScrollbar) return;\n const bodyElement = bodyRef.current;\n\n if (!bodyElement) return;\n\n const debouncedCheckScrollbar = debounce(100, () => {\n checkScrollbar();\n });\n\n // Observer of the body content\n const mutationObserver = new MutationObserver(() => {\n debouncedCheckScrollbar();\n });\n\n mutationObserver.observe(bodyElement, {childList: true, subtree: true});\n\n // Observer of the body size\n const resizeObserver = new ResizeObserver(() => {\n debouncedCheckScrollbar();\n });\n\n if (bodyRef.current) {\n resizeObserver.observe(bodyRef.current);\n }\n\n checkScrollbar();\n\n return () => {\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n debouncedCheckScrollbar.cancel();\n };\n }, [children, detectScrollbar]);\n\n const Footer = useCallback(() => {\n if (isEmpty(footer)) return null;\n if (typeof footer === 'function') return footer();\n\n const {cancelButton, confirmButton, text, isError} = footer;\n const {label: cancelLabel, onCancel, disabled: cancelDisabled} = cancelButton || {};\n const {\n label: confirmLabel,\n onConfirm,\n disabled: confirmDisabled,\n iconName,\n color\n } = confirmButton || {};\n const buttonConfirmColor = color || get('common.primary', skin);\n\n return (\n <div className={style.footer}>\n <div className={style.footerCTAWrapper}>\n {onCancel && cancelLabel ? (\n <ButtonLink\n {...{\n className: style.button,\n type: 'secondary',\n onClick: onCancel,\n label: cancelLabel,\n disabled: cancelDisabled,\n 'data-testid': `button-link-${cancelLabel}`\n }}\n />\n ) : null}\n {onConfirm && confirmLabel ? (\n <div>\n <ButtonLink\n {...{\n customStyle: {backgroundColor: buttonConfirmColor, paddingLeft: '16px'},\n hoverBackgroundColor: convert(\n `hsl(from ${buttonConfirmColor} h s calc(l*(1 - 0.08)))`\n ),\n hoverColor: COLORS.white,\n className: style.button,\n type: 'primary',\n onClick: onConfirm,\n label: confirmLabel,\n disabled: confirmDisabled,\n ...(iconName\n ? {\n icon: {\n position: 'left',\n faIcon: {\n name: iconName,\n color: COLORS.white,\n size: 14,\n customStyle: {padding: 0}\n }\n }\n }\n : {}),\n 'data-testid': `button-link-${confirmLabel}`\n }}\n />\n </div>\n ) : null}\n </div>\n {text ? (\n <div\n className={`${style.footerDescription} ${isError ? style.footerDescriptionError : ''}`}\n >\n {text}\n </div>\n ) : null}\n </div>\n );\n }, [footer, skin]);\n\n if (!isOpen || !title || !children) return null;\n\n function handleOnClose(e) {\n e?.stopPropagation();\n onClose();\n }\n\n return (\n <div className={style.modalWrapper} data-testid=\"modal\">\n <div className={style.modal}>\n <header className={style.header}>\n {headerIcon?.name ? (\n <div className={style.headerIcon}>\n <Icon\n iconName={headerIcon.name}\n iconColor={headerIcon.color}\n backgroundColor={headerIcon.backgroundColor}\n size={{faSize: 20, wrapperSize: 48}}\n />\n </div>\n ) : null}\n <div className={style.headerContent}>\n <div className={style.headerTitle}>{title}</div>\n {description ? <div className={style.headerDescription}>{description}</div> : null}\n </div>\n <div className={style.headerCloseIcon} onClick={handleOnClose} data-testid=\"close-icon\">\n <Icon iconName=\"close\" backgroundColor=\"#F4F4F5\" size={{faSize: 14, wrapperSize: 28}} />\n </div>\n </header>\n <div\n ref={bodyRef}\n className={isScrollbarVisible ? style.body : style.bodyWithoutScrollbar}\n onScroll={onScroll}\n data-testid=\"modal-body\"\n style={customStyle}\n >\n {children}\n </div>\n <Footer />\n </div>\n </div>\n );\n};\n\nBaseModal.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nBaseModal.propTypes = {\n title: PropTypes.string,\n headerIcon: PropTypes.shape({\n name: PropTypes.string,\n color: PropTypes.string,\n backgroundColor: PropTypes.string\n }),\n description: PropTypes.string,\n children: PropTypes.node,\n isOpen: PropTypes.bool,\n footer: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.shape({\n text: PropTypes.string,\n isError: PropTypes.boolean,\n cancelButton: PropTypes.shape({\n label: PropTypes.string,\n onCancel: PropTypes.func,\n disabled: PropTypes.bool\n }),\n confirmButton: PropTypes.shape({\n label: PropTypes.string,\n onConfirm: PropTypes.func,\n iconName: PropTypes.string,\n disabled: PropTypes.bool,\n color: PropTypes.string\n })\n })\n ]),\n onClose: PropTypes.func,\n onScroll: PropTypes.func,\n detectScrollbar: PropTypes.bool,\n customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number]))\n};\n\nexport default BaseModal;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAO,OAAO;AACrE,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,OAAO,QAAO,oBAAoB;AAC1C,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,UAAU,MAAM,wBAAwB;AAC/C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,SAAS,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EACpC,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,UAAU;IACVC,QAAQ;IACRC,MAAM;IACNC,MA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AAQ,EAAEtD,SAAS,CAACoG,MAAM;MAC1BnD,QAAQ,EAAEjD,SAAS,CAACuG,IAAI;MACxBhD,KAAK,EAAEvD,SAAS,CAACoG;IACnB,CAAC;EACH,CAAC,CAAC,CACH,CAAC;EACFpF,OAAO,EAAEhB,SAAS,CAACyG,IAAI;EACvBxF,QAAQ,EAAEjB,SAAS,CAACyG,IAAI;EACxBvF,eAAe,EAAElB,SAAS,CAACuG,IAAI;EAC/BpF,WAAW,EAAEnB,SAAS,CAAC2G,QAAQ,CAAC3G,SAAS,CAACwG,SAAS,CAAC,CAACxG,SAAS,CAACoG,MAAM,EAAEpG,SAAS,CAAC4G,MAAM,CAAC,CAAC;AAC3F,CAAC;AAED,eAAerG,SAAS","ignoreList":[]}
@@ -24,6 +24,10 @@
24
24
  }
25
25
 
26
26
  .modal {
27
+ max-width: 71vw;
28
+ max-height: 86vh;
29
+ min-width: 450px;
30
+ min-height: 165px;
27
31
  overflow: hidden;
28
32
  border-radius: 16px;
29
33
  background-color: white;
@@ -73,7 +77,6 @@
73
77
  min-height: 100px;
74
78
  border-top: 1px solid cm_grey_150;
75
79
  border-bottom: 1px solid cm_grey_150;
76
- flex: 1;
77
80
  }
78
81
 
79
82
  .bodyWithoutScrollbar {
@@ -20,6 +20,7 @@ declare namespace SearchForm {
20
20
  }>>;
21
21
  'search-reset-aria-label': PropTypes.Requireable<string>;
22
22
  dataTestId: PropTypes.Requireable<string>;
23
+ theme: PropTypes.Requireable<string>;
23
24
  };
24
25
  }
25
26
  import PropTypes from "prop-types";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/search-form/index.js"],"names":[],"mappings":";AAOA,mEA0CC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/search-form/index.js"],"names":[],"mappings":";AAOA,mEAqDC"}
@@ -1,8 +1,8 @@
1
- import _get from "lodash/fp/get";
2
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
2
  import React, { useMemo } from 'react';
4
3
  import PropTypes from 'prop-types';
5
- import { NovaCompositionNavigationMore as ClearIcon } from '@coorpacademy/nova-icons';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
+ import classnames from 'classnames';
6
6
  import Search from '../../atom/input-search';
7
7
  import style from './style.css';
8
8
  const SearchForm = (props, context) => {
@@ -15,16 +15,15 @@ const SearchForm = (props, context) => {
15
15
  onSearchFocus,
16
16
  onSearchBlur,
17
17
  'search-reset-aria-label': searchResetAriaLabel,
18
- dataTestId
18
+ dataTestId,
19
+ theme
19
20
  } = props;
20
21
  const handleSubmit = useMemo(() => evt => {
21
22
  evt.preventDefault();
22
23
  return onSubmit && onSubmit(evt);
23
24
  }, [onSubmit]);
24
- const {
25
- skin
26
- } = context;
27
- const dark = _get('common.dark', skin);
25
+ const isMooc = theme === 'mooc';
26
+ const clearClassName = search.value ? classnames(style.wrapperClear, isMooc && style.wrapperClearMooc) : style.wrapperNoClear;
28
27
  return /*#__PURE__*/React.createElement("form", {
29
28
  className: style.form,
30
29
  action: action,
@@ -35,17 +34,16 @@ const SearchForm = (props, context) => {
35
34
  }, /*#__PURE__*/React.createElement(Search, _extends({}, search, {
36
35
  onFocus: onSearchFocus,
37
36
  onBlur: onSearchBlur,
38
- dataTestId: dataTestId
37
+ dataTestId: dataTestId,
38
+ theme: theme
39
39
  })), /*#__PURE__*/React.createElement("div", {
40
40
  "data-name": "search-form-reset",
41
41
  "aria-label": searchResetAriaLabel,
42
42
  onClick: onReset,
43
- className: search.value ? style.wrapperClear : style.wrapperNoClear
44
- }, /*#__PURE__*/React.createElement(ClearIcon, {
45
- style: {
46
- color: dark
47
- },
48
- className: style.clear
43
+ className: clearClassName
44
+ }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
45
+ icon: "xmark",
46
+ className: style.clearIcon
49
47
  })));
50
48
  };
51
49
  SearchForm.propTypes = process.env.NODE_ENV !== "production" ? {
@@ -57,7 +55,8 @@ SearchForm.propTypes = process.env.NODE_ENV !== "production" ? {
57
55
  onSearchBlur: PropTypes.func,
58
56
  search: PropTypes.shape(Search.propTypes),
59
57
  'search-reset-aria-label': PropTypes.string,
60
- dataTestId: PropTypes.string
58
+ dataTestId: PropTypes.string,
59
+ theme: PropTypes.string
61
60
  } : {};
62
61
  export default SearchForm;
63
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","NovaCompositionNavigationMore","ClearIcon","Search","style","SearchForm","props","context","action","method","onSubmit","onReset","search","onSearchFocus","onSearchBlur","searchResetAriaLabel","dataTestId","handleSubmit","evt","preventDefault","skin","dark","_get","createElement","className","form","placeholder","_extends","onFocus","onBlur","onClick","value","wrapperClear","wrapperNoClear","color","clear","propTypes","process","env","NODE_ENV","string","func","shape"],"sources":["../../../src/molecule/search-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {get} from 'lodash/fp';\nimport {NovaCompositionNavigationMore as ClearIcon} from '@coorpacademy/nova-icons';\nimport Search from '../../atom/input-search';\nimport style from './style.css';\n\nconst SearchForm = (props, context) => {\n const {\n action,\n method,\n onSubmit,\n onReset,\n search,\n onSearchFocus,\n onSearchBlur,\n 'search-reset-aria-label': searchResetAriaLabel,\n dataTestId\n } = props;\n const handleSubmit = useMemo(\n () => evt => {\n evt.preventDefault();\n return onSubmit && onSubmit(evt);\n },\n [onSubmit]\n );\n const {skin} = context;\n const dark = get('common.dark', skin);\n\n return (\n <form\n className={style.form}\n action={action}\n method={method}\n onSubmit={handleSubmit}\n data-name=\"searchForm\"\n aria-label={search.placeholder}\n >\n <Search {...search} onFocus={onSearchFocus} onBlur={onSearchBlur} dataTestId={dataTestId} />\n <div\n data-name=\"search-form-reset\"\n aria-label={searchResetAriaLabel}\n onClick={onReset}\n className={search.value ? style.wrapperClear : style.wrapperNoClear}\n >\n <ClearIcon style={{color: dark}} className={style.clear} />\n </div>\n </form>\n );\n};\n\nSearchForm.propTypes = {\n action: PropTypes.string,\n method: PropTypes.string,\n onSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSearchFocus: PropTypes.func,\n onSearchBlur: PropTypes.func,\n search: PropTypes.shape(Search.propTypes),\n 'search-reset-aria-label': PropTypes.string,\n dataTestId: PropTypes.string\n};\n\nexport default SearchForm;\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAAQC,6BAA6B,IAAIC,SAAS,QAAO,0BAA0B;AACnF,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,OAAOC,KAAK,MAAM,aAAa;AAE/B,MAAMC,UAAU,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EACrC,MAAM;IACJC,MAAM;IACNC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,aAAa;IACbC,YAAY;IACZ,yBAAyB,EAAEC,oBAAoB;IAC/CC;EACF,CAAC,GAAGV,KAAK;EACT,MAAMW,YAAY,GAAGlB,OAAO,CAC1B,MAAMmB,GAAG,IAAI;IACXA,GAAG,CAACC,cAAc,CAAC,CAAC;IACpB,OAAOT,QAAQ,IAAIA,QAAQ,CAACQ,GAAG,CAAC;EAClC,CAAC,EACD,CAACR,QAAQ,CACX,CAAC;EACD,MAAM;IAACU;EAAI,CAAC,GAAGb,OAAO;EACtB,MAAMc,IAAI,GAAGC,IAAA,CAAI,aAAa,EAAEF,IAAI,CAAC;EAErC,oBACEtB,KAAA,CAAAyB,aAAA;IACEC,SAAS,EAAEpB,KAAK,CAACqB,IAAK;IACtBjB,MAAM,EAAEA,MAAO;IACfC,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEO,YAAa;IACvB,aAAU,YAAY;IACtB,cAAYL,MAAM,CAACc;EAAY,gBAE/B5B,KAAA,CAAAyB,aAAA,CAACpB,MAAM,EAAAwB,QAAA,KAAKf,MAAM;IAAEgB,OAAO,EAAEf,aAAc;IAACgB,MAAM,EAAEf,YAAa;IAACE,UAAU,EAAEA;EAAW,EAAE,CAAC,eAC5FlB,KAAA,CAAAyB,aAAA;IACE,aAAU,mBAAmB;IAC7B,cAAYR,oBAAqB;IACjCe,OAAO,EAAEnB,OAAQ;IACjBa,SAAS,EAAEZ,MAAM,CAACmB,KAAK,GAAG3B,KAAK,CAAC4B,YAAY,GAAG5B,KAAK,CAAC6B;EAAe,gBAEpEnC,KAAA,CAAAyB,aAAA,CAACrB,SAAS;IAACE,KAAK,EAAE;MAAC8B,KAAK,EAAEb;IAAI,CAAE;IAACG,SAAS,EAAEpB,KAAK,CAAC+B;EAAM,CAAE,CACvD,CACD,CAAC;AAEX,CAAC;AAED9B,UAAU,CAAC+B,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACrB/B,MAAM,EAAER,SAAS,CAACwC,MAAM;EACxB/B,MAAM,EAAET,SAAS,CAACwC,MAAM;EACxB9B,QAAQ,EAAEV,SAAS,CAACyC,IAAI;EACxB9B,OAAO,EAAEX,SAAS,CAACyC,IAAI;EACvB5B,aAAa,EAAEb,SAAS,CAACyC,IAAI;EAC7B3B,YAAY,EAAEd,SAAS,CAACyC,IAAI;EAC5B7B,MAAM,EAAEZ,SAAS,CAAC0C,KAAK,CAACvC,MAAM,CAACiC,SAAS,CAAC;EACzC,yBAAyB,EAAEpC,SAAS,CAACwC,MAAM;EAC3CxB,UAAU,EAAEhB,SAAS,CAACwC;AACxB,CAAC;AAED,eAAenC,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","FontAwesomeIcon","classnames","Search","style","SearchForm","props","context","action","method","onSubmit","onReset","search","onSearchFocus","onSearchBlur","searchResetAriaLabel","dataTestId","theme","handleSubmit","evt","preventDefault","isMooc","clearClassName","value","wrapperClear","wrapperClearMooc","wrapperNoClear","createElement","className","form","placeholder","_extends","onFocus","onBlur","onClick","icon","clearIcon","propTypes","process","env","NODE_ENV","string","func","shape"],"sources":["../../../src/molecule/search-form/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport classnames from 'classnames';\nimport Search from '../../atom/input-search';\nimport style from './style.css';\n\nconst SearchForm = (props, context) => {\n const {\n action,\n method,\n onSubmit,\n onReset,\n search,\n onSearchFocus,\n onSearchBlur,\n 'search-reset-aria-label': searchResetAriaLabel,\n dataTestId,\n theme\n } = props;\n const handleSubmit = useMemo(\n () => evt => {\n evt.preventDefault();\n return onSubmit && onSubmit(evt);\n },\n [onSubmit]\n );\n\n const isMooc = theme === 'mooc';\n\n const clearClassName = search.value\n ? classnames(style.wrapperClear, isMooc && style.wrapperClearMooc)\n : style.wrapperNoClear;\n\n return (\n <form\n className={style.form}\n action={action}\n method={method}\n onSubmit={handleSubmit}\n data-name=\"searchForm\"\n aria-label={search.placeholder}\n >\n <Search\n {...search}\n onFocus={onSearchFocus}\n onBlur={onSearchBlur}\n dataTestId={dataTestId}\n theme={theme}\n />\n <div\n data-name=\"search-form-reset\"\n aria-label={searchResetAriaLabel}\n onClick={onReset}\n className={clearClassName}\n >\n <FontAwesomeIcon icon=\"xmark\" className={style.clearIcon} />\n </div>\n </form>\n );\n};\n\nSearchForm.propTypes = {\n action: PropTypes.string,\n method: PropTypes.string,\n onSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onSearchFocus: PropTypes.func,\n onSearchBlur: PropTypes.func,\n search: PropTypes.shape(Search.propTypes),\n 'search-reset-aria-label': PropTypes.string,\n dataTestId: PropTypes.string,\n theme: PropTypes.string\n};\n\nexport default SearchForm;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,OAAO,QAAO,OAAO;AACpC,OAAOC,SAAS,MAAM,YAAY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jCmB,OAAO,EAAEvB,OAAQ;IACjBiB,SAAS,EAAEN;EAAe,gBAE1BxB,KAAA,CAAA6B,aAAA,CAAC1B,eAAe;IAACkC,IAAI,EAAC,OAAO;IAACP,SAAS,EAAExB,KAAK,CAACgC;EAAU,CAAE,CACxD,CACD,CAAC;AAEX,CAAC;AAED/B,UAAU,CAACgC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACrBhC,MAAM,EAAER,SAAS,CAACyC,MAAM;EACxBhC,MAAM,EAAET,SAAS,CAACyC,MAAM;EACxB/B,QAAQ,EAAEV,SAAS,CAAC0C,IAAI;EACxB/B,OAAO,EAAEX,SAAS,CAAC0C,IAAI;EACvB7B,aAAa,EAAEb,SAAS,CAAC0C,IAAI;EAC7B5B,YAAY,EAAEd,SAAS,CAAC0C,IAAI;EAC5B9B,MAAM,EAAEZ,SAAS,CAAC2C,KAAK,CAACxC,MAAM,CAACkC,SAAS,CAAC;EACzC,yBAAyB,EAAErC,SAAS,CAACyC,MAAM;EAC3CzB,UAAU,EAAEhB,SAAS,CAACyC,MAAM;EAC5BxB,KAAK,EAAEjB,SAAS,CAACyC;AACnB,CAAC;AAED,eAAepC,UAAU","ignoreList":[]}
@@ -1,3 +1,6 @@
1
+ @value colors: "../../variables/colors.css";
2
+ @value cm_grey_500 from colors;
3
+
1
4
  .form {
2
5
  display: flex;
3
6
  justify-content: flex-start;
@@ -8,6 +11,7 @@
8
11
  margin: 0;
9
12
  width: 100%;
10
13
  height: 100%;
14
+ position: relative;
11
15
  }
12
16
 
13
17
  .wrapperClear {
@@ -23,11 +27,22 @@
23
27
  display: none;
24
28
  }
25
29
 
26
- .clear {
27
- transform: rotate(45deg);
28
- width: 10px;
29
- height: 10px;
30
+ .clearIcon {
31
+ color: cm_grey_500;
32
+ width: 12px;
33
+ height: 14px;
34
+ }
35
+
36
+ .wrapperClearMooc {
30
37
  position: absolute;
31
- top: 0;
32
- left: 0;
38
+ right: 16px;
39
+ width: 14px;
40
+ height: 14px;
41
+ top: 50%;
42
+ transform: translateY(-50%);
43
+ cursor: pointer;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ z-index: 2002;
33
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/content-skill-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAOlD,OAAkB,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE1D,QAAA,MAAM,iBAAiB;YAAW,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DvD,CAAC;AAQF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/content-skill-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAOlD,OAAkB,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE1D,QAAA,MAAM,iBAAiB;YAAW,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DvD,CAAC;AAQF,eAAe,iBAAiB,CAAC"}
@@ -42,21 +42,21 @@ const ContentSkillModal = props => {
42
42
  color: COLORS.cm_primary_blue
43
43
  }
44
44
  }), [handleCancel, onConfirm]);
45
- const baseModalProps = {
45
+ const baseModal = {
46
46
  title: 'Add content',
47
47
  description: 'Add courses, video, interactive and more to this skill',
48
48
  headerIcon,
49
49
  footer,
50
50
  isOpen,
51
51
  onClose: handleClose,
52
- // fullscreen modal
53
52
  customStyle: {
54
- height: '80vh',
55
- width: '80vw'
53
+ padding: 0,
54
+ height: '60vh',
55
+ overflow: 'hidden'
56
56
  }
57
57
  };
58
58
  if (!isOpen) return null;
59
- return /*#__PURE__*/React.createElement(BaseModal, baseModalProps, /*#__PURE__*/React.createElement("div", {
59
+ return /*#__PURE__*/React.createElement(BaseModal, baseModal, /*#__PURE__*/React.createElement("div", {
60
60
  className: style.container
61
61
  }, /*#__PURE__*/React.createElement("div", {
62
62
  className: style.containerList
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useCallback","useMemo","BaseModal","ListItems","MultiFilterPanel","Provider","COLORS","style","propTypes","ContentSkillModal","props","contentList","filters","modal","isOpen","onCancel","onConfirm","onClose","handleCancel","handleClose","headerIcon","name","color","primary_600","backgroundColor","primary_100","footer","cancelButton","label","confirmButton","iconName","disabled","cm_primary_blue","baseModalProps","title","description","customStyle","height","width","createElement","className","container","containerList","filtersContainer","contextTypes","translate","childContextTypes","process","env","NODE_ENV"],"sources":["../../../src/organism/content-skill-modal/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport BaseModal from '../../molecule/base-modal';\nimport ListItems from '../list-items';\nimport MultiFilterPanel from '../../molecule/multi-filter-panel';\nimport Provider from '../../atom/provider';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\nimport propTypes, {ContentSkillModalProps} from './types';\n\nconst ContentSkillModal = (props: ContentSkillModalProps) => {\n const {contentList, filters, modal} = props;\n const {isOpen, onCancel, onConfirm, onClose} = modal;\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n const handleClose = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const headerIcon = {\n name: 'circle-plus',\n color: COLORS.primary_600,\n backgroundColor: COLORS.primary_100\n };\n const footer = useMemo(\n () => ({\n cancelButton: {\n onCancel: handleCancel,\n label: 'Cancel'\n },\n confirmButton: {\n onConfirm,\n label: 'Add',\n iconName: 'plus',\n disabled: false,\n color: COLORS.cm_primary_blue\n }\n }),\n [handleCancel, onConfirm]\n );\n\n const baseModalProps = {\n title: 'Add content',\n description: 'Add courses, video, interactive and more to this skill',\n headerIcon,\n footer,\n isOpen,\n onClose: handleClose,\n // fullscreen modal\n customStyle: {\n height: '80vh',\n width: '80vw'\n }\n };\n\n if (!isOpen) return null;\n\n return (\n <BaseModal {...baseModalProps}>\n <div className={style.container}>\n <div className={style.containerList}>\n <ListItems {...contentList} />\n </div>\n <div className={style.filtersContainer}>\n <MultiFilterPanel {...filters} />\n </div>\n </div>\n </BaseModal>\n );\n};\n\nContentSkillModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nContentSkillModal.propTypes = propTypes;\n\nexport default ContentSkillModal;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AACjD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,gBAAgB,MAAM,mCAAmC;AAChE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,MAAgC,SAAS;AAEzD,MAAMC,iBAAiB,GAAIC,KAA6B,IAAK;EAC3D,MAAM;IAACC,WAAW;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAGH,KAAK;EAC3C,MAAM;IAACI,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGJ,KAAK;EAEpD,MAAMK,YAAY,GAAGlB,WAAW,CAAC,MAAM;IACrCe,QAAQ,CAAC,CAAC;EACZ,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACd,MAAMI,WAAW,GAAGnB,WAAW,CAAC,MAAM;IACpCiB,OAAO,CAAC,CAAC;EACX,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C,YAAY,GAAG;EAC/BC,SAAS,EAAExC,QAAQ,CAACyC,iBAAiB,CAACD;AACxC,CAAC;AAEDpC,iBAAiB,CAACD,SAAS,GAAAuC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGzC,SAAS;AAEvC,eAAeC,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useCallback","useMemo","BaseModal","ListItems","MultiFilterPanel","Provider","COLORS","style","propTypes","ContentSkillModal","props","contentList","filters","modal","isOpen","onCancel","onConfirm","onClose","handleCancel","handleClose","headerIcon","name","color","primary_600","backgroundColor","primary_100","footer","cancelButton","label","confirmButton","iconName","disabled","cm_primary_blue","baseModal","title","description","customStyle","padding","height","overflow","createElement","className","container","containerList","filtersContainer","contextTypes","translate","childContextTypes","process","env","NODE_ENV"],"sources":["../../../src/organism/content-skill-modal/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport BaseModal from '../../molecule/base-modal';\nimport ListItems from '../list-items';\nimport MultiFilterPanel from '../../molecule/multi-filter-panel';\nimport Provider from '../../atom/provider';\nimport {COLORS} from '../../variables/colors';\nimport style from './style.css';\nimport propTypes, {ContentSkillModalProps} from './types';\n\nconst ContentSkillModal = (props: ContentSkillModalProps) => {\n const {contentList, filters, modal} = props;\n const {isOpen, onCancel, onConfirm, onClose} = modal;\n\n const handleCancel = useCallback(() => {\n onCancel();\n }, [onCancel]);\n const handleClose = useCallback(() => {\n onClose();\n }, [onClose]);\n\n const headerIcon = {\n name: 'circle-plus',\n color: COLORS.primary_600,\n backgroundColor: COLORS.primary_100\n };\n const footer = useMemo(\n () => ({\n cancelButton: {\n onCancel: handleCancel,\n label: 'Cancel'\n },\n confirmButton: {\n onConfirm,\n label: 'Add',\n iconName: 'plus',\n disabled: false,\n color: COLORS.cm_primary_blue\n }\n }),\n [handleCancel, onConfirm]\n );\n const baseModal = {\n title: 'Add content',\n description: 'Add courses, video, interactive and more to this skill',\n headerIcon,\n footer,\n isOpen,\n onClose: handleClose,\n customStyle: {\n padding: 0,\n height: '60vh',\n overflow: 'hidden'\n }\n };\n\n if (!isOpen) return null;\n\n return (\n <BaseModal {...baseModal}>\n <div className={style.container}>\n <div className={style.containerList}>\n <ListItems {...contentList} />\n </div>\n <div className={style.filtersContainer}>\n <MultiFilterPanel {...filters} />\n </div>\n </div>\n </BaseModal>\n );\n};\n\nContentSkillModal.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nContentSkillModal.propTypes = propTypes;\n\nexport default ContentSkillModal;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,WAAW,EAAEC,OAAO,QAAO,OAAO;AACjD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,gBAAgB,MAAM,mCAAmC;AAChE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,SAAQC,MAAM,QAAO,wBAAwB;AAC7C,OAAOC,KAAK,MAAM,aAAa;AAC/B,OAAOC,SAAS,MAAgC,SAAS;AAEzD,MAAMC,iBAAiB,GAAIC,KAA6B,IAAK;EAC3D,MAAM;IAACC,WAAW;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAGH,KAAK;EAC3C,MAAM;IAACI,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAO,CAAC,GAAGJ,KAAK;EAEpD,MAAMK,YAAY,GAAGlB,WAAW,CAAC,MAAM;IACrCe,QAAQ,CAAC,CAAC;EACZ,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EACd,MAAMI,WAAW,GAAGnB,WAAW,CAAC,MAAM;IACpCiB,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,MAAMG,UAAU,GAAG;IACjBC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAEhB,MAAM,CAACiB,WAAW;IACzBC,eAAe,EAAElB,MAAM,CAACmB;EAC1B,CAAC;EACD,MAAMC,MAAM,GAAGzB,OAAO,CACp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":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAiBtE,QAAA,MAAM,uBAAuB;YACpB,4BAA4B,WAC1B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CA+F1B,CAAC;AAQF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAiBtE,QAAA,MAAM,uBAAuB;YACpB,4BAA4B,WAC1B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CAiG1B,CAAC;AAQF,eAAe,uBAAuB,CAAC"}
@@ -21,7 +21,7 @@ const SHOW_BUTTON_STYLE = {
21
21
  fontSize: '14px',
22
22
  fontWeight: '600',
23
23
  fontFamily: 'Gilroy',
24
- padding: '0'
24
+ marginTop: '16px'
25
25
  };
26
26
  const CHECKBOX_TITLE_STYLE = {
27
27
  marginRight: '16px',
@@ -99,7 +99,7 @@ const FilterCheckboxAndSearch = (props, context) => {
99
99
  customStyle: CHECKBOX_TITLE_STYLE
100
100
  }), /*#__PURE__*/React.createElement("p", {
101
101
  className: style.optionCount
102
- }, count)))), _size(options) > INITIAL_VISIBLE_OPTIONS ? /*#__PURE__*/React.createElement(ButtonLink, {
102
+ }, count)))), _size(options) > INITIAL_VISIBLE_OPTIONS ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ButtonLink, {
103
103
  label: showMore ? translate('Show less') : translate('Show more'),
104
104
  type: "text",
105
105
  icon: {
@@ -113,7 +113,7 @@ const FilterCheckboxAndSearch = (props, context) => {
113
113
  customStyle: SHOW_BUTTON_STYLE,
114
114
  onClick: handleShowMore,
115
115
  "data-testid": "filter-checkbox-and-search-show-button"
116
- }) : null);
116
+ })) : null);
117
117
  };
118
118
  FilterCheckboxAndSearch.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
119
119
  FilterCheckboxAndSearch.contextTypes = {