@coorpacademy/components 11.40.11 → 11.40.12

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.
@@ -1,5 +1,5 @@
1
1
  export default Search;
2
- declare function Search(props: any): JSX.Element;
2
+ declare function Search(props: any, context: any): JSX.Element;
3
3
  declare namespace Search {
4
4
  namespace contextTypes {
5
5
  const skin: PropTypes.Requireable<PropTypes.InferProps<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAiBA,iDAwFC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-search/index.js"],"names":[],"mappings":";AAsCA,+DAsHC"}
@@ -1,6 +1,7 @@
1
+ import _get from "lodash/fp/get";
1
2
  import _isEmpty from "lodash/fp/isEmpty";
2
3
  import _noop from "lodash/fp/noop";
3
- import React, { useMemo } from 'react';
4
+ import React, { useMemo, useState, useRef } from 'react';
4
5
  import PropTypes from 'prop-types';
5
6
  import classnames from 'classnames';
6
7
  import { NovaCompositionCoorpacademySearchThin as CMSearchIcon, NovaCompositionCoorpacademySearch as SearchIcon, NovaSolidStatusClose as CloseIcon } from '@coorpacademy/nova-icons';
@@ -10,7 +11,25 @@ const handleMouseDown = e => {
10
11
  e.preventDefault();
11
12
  e.stopPropagation();
12
13
  };
13
- const Search = props => {
14
+ function useHoverAndFocusWithin() {
15
+ const [isFocusWithin, setIsFocusWithin] = useState(false);
16
+ const [hovered, setHovered] = useState(false);
17
+ const ref = useRef(null);
18
+ return {
19
+ ref,
20
+ isFocusWithin,
21
+ hovered,
22
+ onMouseEnter: () => setHovered(true),
23
+ onMouseLeave: () => setHovered(false),
24
+ onFocus: () => setIsFocusWithin(true),
25
+ onBlur: e => {
26
+ if (ref.current && !ref.current.contains(e.relatedTarget)) {
27
+ setIsFocusWithin(false);
28
+ }
29
+ }
30
+ };
31
+ }
32
+ const Search = (props, context) => {
14
33
  const {
15
34
  value,
16
35
  placeholder,
@@ -24,7 +43,20 @@ const Search = props => {
24
43
  dataTestId,
25
44
  searchIconAriaLabel
26
45
  } = props;
46
+ const {
47
+ skin
48
+ } = context;
49
+ const primaryColor = _get('common.primary', skin);
27
50
  const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
51
+ const {
52
+ ref,
53
+ isFocusWithin,
54
+ onFocus: onSearchFocus,
55
+ onBlur: onSearchBlur,
56
+ hovered,
57
+ onMouseEnter,
58
+ onMouseLeave
59
+ } = useHoverAndFocusWithin();
28
60
  const handleKeyDown = useMemo(() => e => {
29
61
  if (onKeyDown) {
30
62
  onKeyDown(e);
@@ -50,9 +82,18 @@ const Search = props => {
50
82
  const showTitle = isCoorpManager;
51
83
  const showClearIcon = value && isCoorpManager;
52
84
  return /*#__PURE__*/React.createElement("div", {
53
- className: wrapperParentClass
85
+ className: wrapperParentClass,
86
+ ref: ref,
87
+ onFocus: onSearchFocus,
88
+ onBlur: onSearchBlur,
89
+ onMouseEnter: onMouseEnter,
90
+ onMouseLeave: onMouseLeave
54
91
  }, /*#__PURE__*/React.createElement("div", {
55
- className: wrapperClass
92
+ className: wrapperClass,
93
+ style: isMooc ? {
94
+ boxShadow: isFocusWithin || hovered ? `0 0 0 2px ${primaryColor}` : `0 0 0 2px white, 0 0 0 2px ${primaryColor}`,
95
+ transition: 'box-shadow 0.3s ease-in-out'
96
+ } : undefined
56
97
  }, /*#__PURE__*/React.createElement("label", {
57
98
  htmlFor: "search",
58
99
  title: placeholder
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","handleMouseDown","e","preventDefault","stopPropagation","Search","props","value","placeholder","onChange","_noop","onClear","onFocus","onBlur","onKeyDown","inputRef","theme","dataTestId","searchIconAriaLabel","handleChange","target","handleKeyDown","isCoorpManager","isMooc","isDefault","wrapperClass","wrapperSearch","coorpmanager","wrapperMooc","wrapperParentClass","wrapperMoocParent","wrapperCoorpManagerParent","searchClass","search","moocSearch","SearchIconComponent","showTitle","showClearIcon","createElement","className","htmlFor","title","searchIcon","onMouseDown","role","_isEmpty","noValue","ref","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 handleMouseDown = e => {\n e.preventDefault();\n e.stopPropagation();\n};\n\nconst Search = props => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n onKeyDown,\n inputRef,\n theme = 'default',\n dataTestId,\n searchIconAriaLabel\n } = props;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n\n const handleKeyDown = useMemo(\n () => e => {\n if (onKeyDown) {\n onKeyDown(e);\n }\n },\n [onKeyDown]\n );\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 [style.wrapperCoorpManagerParent]: isCoorpManager\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\n className={style.searchIcon}\n data-name=\"search-icon\"\n onMouseDown={handleMouseDown}\n aria-label={searchIconAriaLabel}\n role=\"img\"\n />\n {showTitle ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n ref={inputRef}\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 onKeyDown={handleKeyDown}\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 onKeyDown: PropTypes.func,\n inputRef: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),\n dataTestId: PropTypes.string,\n searchIconAriaLabel: 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,eAAe,GAAGC,CAAC,IAAI;EAC3BA,CAAC,CAACC,cAAc,CAAC,CAAC;EAClBD,CAAC,CAACE,eAA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Q;IAAC4B,SAAS,EAAEvC,KAAK,CAACqD;EAAU,CAAE,CAAC,GAAG,IAC5E,CACF,CAAC;AAEV,CAAC;AAEDhD,MAAM,CAACiD,YAAY,GAAG;EACpBC,IAAI,EAAExD,QAAQ,CAACyD,iBAAiB,CAACD;AACnC,CAAC;AAEDlD,MAAM,CAACoD,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG;EACjBrD,KAAK,EAAEhB,SAAS,CAACsE,MAAM;EACvBrD,WAAW,EAAEjB,SAAS,CAACsE,MAAM,CAACC,UAAU;EACxCrD,QAAQ,EAAElB,SAAS,CAACwE,IAAI;EACxBpD,OAAO,EAAEpB,SAAS,CAACwE,IAAI;EACvBnD,OAAO,EAAErB,SAAS,CAACwE,IAAI;EACvBlD,MAAM,EAAEtB,SAAS,CAACwE,IAAI;EACtBjD,SAAS,EAAEvB,SAAS,CAACwE,IAAI;EACzBhD,QAAQ,EAAExB,SAAS,CAACwE,IAAI;EACxB/C,KAAK,EAAEzB,SAAS,CAACyE,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;EAC3D/C,UAAU,EAAE1B,SAAS,CAACsE,MAAM;EAC5B3C,mBAAmB,EAAE3B,SAAS,CAACsE;AACjC,CAAC;AAED,eAAexD,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useMemo","useState","useRef","PropTypes","classnames","NovaCompositionCoorpacademySearchThin","CMSearchIcon","NovaCompositionCoorpacademySearch","SearchIcon","NovaSolidStatusClose","CloseIcon","Provider","style","handleMouseDown","e","preventDefault","stopPropagation","useHoverAndFocusWithin","isFocusWithin","setIsFocusWithin","hovered","setHovered","ref","onMouseEnter","onMouseLeave","onFocus","onBlur","current","contains","relatedTarget","Search","props","context","value","placeholder","onChange","_noop","onClear","onKeyDown","inputRef","theme","dataTestId","searchIconAriaLabel","skin","primaryColor","_get","handleChange","target","onSearchFocus","onSearchBlur","handleKeyDown","isCoorpManager","isMooc","isDefault","wrapperClass","wrapperSearch","coorpmanager","wrapperMooc","wrapperParentClass","wrapperMoocParent","wrapperCoorpManagerParent","searchClass","search","moocSearch","SearchIconComponent","showTitle","showClearIcon","createElement","className","boxShadow","transition","undefined","htmlFor","title","searchIcon","onMouseDown","role","_isEmpty","noValue","type","name","id","onInput","onClick","clearIcon","contextTypes","childContextTypes","propTypes","process","env","NODE_ENV","string","isRequired","func","oneOf"],"sources":["../../../src/atom/input-search/index.js"],"sourcesContent":["import React, {useMemo, useState, useRef} 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, get} from 'lodash/fp';\nimport Provider from '../provider';\nimport style from './style.css';\n\nconst handleMouseDown = e => {\n e.preventDefault();\n e.stopPropagation();\n};\n\nfunction useHoverAndFocusWithin() {\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const [hovered, setHovered] = useState(false);\n\n const ref = useRef(null);\n\n return {\n ref,\n isFocusWithin,\n hovered,\n onMouseEnter: () => setHovered(true),\n onMouseLeave: () => setHovered(false),\n onFocus: () => setIsFocusWithin(true),\n onBlur: e => {\n if (ref.current && !ref.current.contains(e.relatedTarget)) {\n setIsFocusWithin(false);\n }\n }\n };\n}\n\nconst Search = (props, context) => {\n const {\n value,\n placeholder,\n onChange = noop,\n onClear = noop,\n onFocus,\n onBlur,\n onKeyDown,\n inputRef,\n theme = 'default',\n dataTestId,\n searchIconAriaLabel\n } = props;\n const {skin} = context;\n const primaryColor = get('common.primary', skin);\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const {\n ref,\n isFocusWithin,\n onFocus: onSearchFocus,\n onBlur: onSearchBlur,\n hovered,\n onMouseEnter,\n onMouseLeave\n } = useHoverAndFocusWithin();\n const handleKeyDown = useMemo(\n () => e => {\n if (onKeyDown) {\n onKeyDown(e);\n }\n },\n [onKeyDown]\n );\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 [style.wrapperCoorpManagerParent]: isCoorpManager\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\n className={wrapperParentClass}\n ref={ref}\n onFocus={onSearchFocus}\n onBlur={onSearchBlur}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n <div\n className={wrapperClass}\n style={\n isMooc\n ? {\n boxShadow:\n isFocusWithin || hovered\n ? `0 0 0 2px ${primaryColor}`\n : `0 0 0 2px white, 0 0 0 2px ${primaryColor}`,\n transition: 'box-shadow 0.3s ease-in-out'\n }\n : undefined\n }\n >\n <label htmlFor=\"search\" title={placeholder}>\n <SearchIconComponent\n className={style.searchIcon}\n data-name=\"search-icon\"\n onMouseDown={handleMouseDown}\n aria-label={searchIconAriaLabel}\n role=\"img\"\n />\n {showTitle ? (\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {placeholder}\n </span>\n ) : null}\n </label>\n <input\n ref={inputRef}\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 onKeyDown={handleKeyDown}\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 onKeyDown: PropTypes.func,\n inputRef: PropTypes.func,\n theme: PropTypes.oneOf(['default', 'coorpmanager', 'mooc']),\n dataTestId: PropTypes.string,\n searchIconAriaLabel: PropTypes.string\n};\n\nexport default Search;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAO,OAAO;AACtD,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,eAAe,GAAGC,CAAC,IAAI;EAC3BA,CAAC,CAACC,cAAc,CAAC,CAAC;EAClBD,CAAC,CAACE,eAAe,CAAC,CAAC;AACrB,CAAC;AAED,SAASC,sBAAsBA,CAAA,EAAG;EAChC,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGlB,QAAQ,CAAC,KAAK,CAAC;EACzD,MAAM,CAACmB,OAAO,EAAEC,UAAU,CAAC,GAAGpB,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAMqB,GAAG,GAAGpB,MAAM,CAAC,IAAI,CAAC;EAExB,OAAO;IACLoB,GAAG;IACHJ,aAAa;IACbE,OAAO;IACPG,YAAY,EAAEA,CAAA,KAAMF,UAAU,CAAC,IAAI,CAAC;IACpCG,YAAY,EAAEA,CAAA,KAAMH,UAAU,CAAC,KAAK,CAAC;IACrCI,OAAO,EAAEA,CAAA,KAAMN,gBAAgB,CAAC,IAAI,CAAC;IACrCO,MAAM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E,OAAO,EAAEtB,SAAS,CAAC0F,IAAI;EACvBnE,MAAM,EAAEvB,SAAS,CAAC0F,IAAI;EACtBvD,SAAS,EAAEnC,SAAS,CAAC0F,IAAI;EACzBtD,QAAQ,EAAEpC,SAAS,CAAC0F,IAAI;EACxBrD,KAAK,EAAErC,SAAS,CAAC2F,KAAK,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;EAC3DrD,UAAU,EAAEtC,SAAS,CAACwF,MAAM;EAC5BjD,mBAAmB,EAAEvC,SAAS,CAACwF;AACjC,CAAC;AAED,eAAe7D,MAAM","ignoreList":[]}
@@ -14,7 +14,6 @@
14
14
  @value cm_grey_400 from colors;
15
15
  @value cm_grey_500 from colors;
16
16
  @value cm_grey_700 from colors;
17
- @value brand from colors;
18
17
 
19
18
  .wrapperSearch {
20
19
  display: flex;
@@ -188,7 +187,6 @@
188
187
  align-items: center;
189
188
  overflow: hidden;
190
189
  border-radius: 12px;
191
- transition: box-shadow 0.3s ease-in-out;
192
190
  background: cm_grey_100;
193
191
  padding: 2px;
194
192
  width: 100%;
@@ -227,12 +225,8 @@
227
225
 
228
226
  .wrapperMoocParent:focus-within .wrapperMooc {
229
227
  background: transparent;
230
- box-shadow: 0 0 0 2px rgba(255,255,255,0), 0 0 0 2px brand;
231
228
  }
232
229
 
233
- .wrapperMooc:hover {
234
- box-shadow: 0 0 0 2px brand;
235
- }
236
230
 
237
231
  .wrapperMooc .clearIcon {
238
232
  position: relative;
@@ -1,5 +1,47 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
+ import { WebContextValues } from '../provider/web-context';
2
3
  import type { InputSelectProps } from './types';
3
- declare const InputSelect: React.FC<InputSelectProps>;
4
+ declare const InputSelect: {
5
+ (props: InputSelectProps, context: WebContextValues): JSX.Element;
6
+ propTypes: {
7
+ options: import("prop-types").Validator<Required<import("prop-types").InferProps<{
8
+ value: import("prop-types").Validator<string>;
9
+ label: import("prop-types").Validator<string>;
10
+ icon: import("prop-types").Requireable<string>;
11
+ 'data-name': import("prop-types").Requireable<string>;
12
+ }>>[]>;
13
+ value: import("prop-types").Requireable<string>;
14
+ onChange: import("prop-types").Validator<(...args: any[]) => any>;
15
+ placeholder: import("prop-types").Requireable<string>;
16
+ className: import("prop-types").Requireable<string>;
17
+ 'aria-label': import("prop-types").Requireable<string>;
18
+ iconClosed: import("prop-types").Requireable<string>;
19
+ selectedIcon: import("prop-types").Requireable<string>;
20
+ 'button-data-testid': import("prop-types").Requireable<string>;
21
+ };
22
+ contextTypes: {
23
+ skin: import("prop-types").Requireable<import("prop-types").InferProps<{
24
+ common: import("prop-types").Requireable<{
25
+ [x: string]: any;
26
+ }>;
27
+ images: import("prop-types").Requireable<import("prop-types").InferProps<{
28
+ 'logo-mobile': import("prop-types").Requireable<any>;
29
+ logo: import("prop-types").Requireable<any>;
30
+ 'logo-email': import("prop-types").Requireable<any>;
31
+ login: import("prop-types").Requireable<any>;
32
+ }>>;
33
+ icons: import("prop-types").Requireable<{
34
+ [x: string]: any;
35
+ }>;
36
+ mod: import("prop-types").Requireable<{
37
+ [x: string]: any;
38
+ }>;
39
+ courses: import("prop-types").Requireable<any[]>;
40
+ texts: import("prop-types").Requireable<{
41
+ [x: string]: any;
42
+ }>;
43
+ }>>;
44
+ };
45
+ };
4
46
  export default InputSelect;
5
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAK9C,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiH3C,CAAC;AAIF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/input-select/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAGzD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAK9C,QAAA,MAAM,WAAW;YAAW,gBAAgB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHtE,CAAC;AAMF,eAAe,WAAW,CAAC"}
@@ -1,20 +1,25 @@
1
+ import _get from "lodash/fp/get";
1
2
  import React, { useState, useRef, useCallback } from 'react';
2
3
  import classnames from 'classnames';
3
4
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
+ import Provider, { GetSkinFromContext } from '../provider';
4
6
  import style from './style.css';
5
7
  import propTypes from './types';
6
8
  const COMPONENT_ID = 'input-select';
7
- const InputSelect = ({
8
- options = [],
9
- value,
10
- onChange,
11
- placeholder,
12
- className,
13
- 'aria-label': ariaLabel,
14
- iconClosed = 'chevron-down',
15
- selectedIcon = 'circle-check',
16
- 'button-data-testid': buttonDataTestId = 'select-input'
17
- }) => {
9
+ const InputSelect = (props, context) => {
10
+ const {
11
+ options = [],
12
+ value,
13
+ onChange,
14
+ placeholder,
15
+ className,
16
+ 'aria-label': ariaLabel,
17
+ iconClosed = 'chevron-down',
18
+ selectedIcon = 'circle-check',
19
+ 'button-data-testid': buttonDataTestId = 'select-input'
20
+ } = props;
21
+ const skin = GetSkinFromContext(context);
22
+ const primaryColor = _get('common.primary', skin);
18
23
  const [open, setOpen] = useState(false);
19
24
  const wrapperRef = useRef(null);
20
25
  const componentId = `${COMPONENT_ID}-${placeholder?.toLowerCase().replace(/\s+/g, '-') || 'default'}`;
@@ -49,14 +54,20 @@ const InputSelect = ({
49
54
  onClick: handleClick,
50
55
  "data-testid": `option-${option.value}`,
51
56
  "data-name": option['data-name']
52
- }, /*#__PURE__*/React.createElement("span", {
57
+ }, /*#__PURE__*/React.createElement("div", {
58
+ className: style.backgroundOption,
59
+ style: {
60
+ backgroundColor: primaryColor
61
+ }
62
+ }), /*#__PURE__*/React.createElement("span", {
53
63
  className: style.optionIcon
54
64
  }, option.icon), /*#__PURE__*/React.createElement("span", {
55
65
  className: style.optionLabel
56
66
  }, option.label), isSelected ? /*#__PURE__*/React.createElement("span", {
57
67
  className: style.checkIcon
58
68
  }, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
59
- icon: selectedIcon
69
+ icon: selectedIcon,
70
+ color: primaryColor
60
71
  })) : null);
61
72
  };
62
73
  const shouldBeScrollable = options.length > 6;
@@ -64,10 +75,13 @@ const InputSelect = ({
64
75
  className: style.container,
65
76
  ref: wrapperRef
66
77
  }, /*#__PURE__*/React.createElement("div", {
78
+ style: {
79
+ boxShadow: open ? `0 0 0 2px white, 0 0 0 4px${primaryColor}` : `0 0 0 2px ${primaryColor}`
80
+ },
67
81
  className: classnames(style.outerWrapper, {
68
82
  [style.open]: open
69
83
  })
70
- }, /*#__PURE__*/React.createElement("div", {
84
+ }), /*#__PURE__*/React.createElement("div", {
71
85
  className: classnames(style.wrapper, className),
72
86
  "aria-label": ariaLabel
73
87
  }, /*#__PURE__*/React.createElement("button", {
@@ -94,7 +108,7 @@ const InputSelect = ({
94
108
  [style.rotated]: open
95
109
  }),
96
110
  icon: iconClosed
97
- }))))), open ? /*#__PURE__*/React.createElement("div", {
111
+ })))), open ? /*#__PURE__*/React.createElement("div", {
98
112
  className: classnames(style.menuWrapper, {
99
113
  [style.showFade]: shouldBeScrollable
100
114
  })
@@ -105,5 +119,8 @@ const InputSelect = ({
105
119
  }, options.map(renderOption))) : null);
106
120
  };
107
121
  InputSelect.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
122
+ InputSelect.contextTypes = {
123
+ skin: Provider.childContextTypes.skin
124
+ };
108
125
  export default InputSelect;
109
126
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","useState","useRef","useCallback","classnames","FontAwesomeIcon","style","propTypes","COMPONENT_ID","InputSelect","options","value","onChange","placeholder","className","ariaLabel","iconClosed","selectedIcon","buttonDataTestId","open","setOpen","wrapperRef","componentId","toLowerCase","replace","handleToggle","o","handleOnOptionClick","optionValue","useEffect","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","selectedOption","find","opt","renderOption","option","handleClick","isSelected","createElement","key","selected","role","onClick","optionIcon","icon","optionLabel","label","checkIcon","shouldBeScrollable","length","container","ref","outerWrapper","wrapper","type","display","undefined","id","content","iconWrapper","rotated","menuWrapper","showFade","menu","map","process","env","NODE_ENV"],"sources":["../../../src/atom/input-select/index.tsx"],"sourcesContent":["import React, {useState, useRef, useCallback} from 'react';\nimport classnames from 'classnames';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {IconName} from '@fortawesome/fontawesome-svg-core';\nimport style from './style.css';\nimport type {InputSelectProps} from './types';\nimport propTypes from './types';\n\nconst COMPONENT_ID = 'input-select';\n\nconst InputSelect: React.FC<InputSelectProps> = ({\n options = [],\n value,\n onChange,\n placeholder,\n className,\n 'aria-label': ariaLabel,\n iconClosed = 'chevron-down',\n selectedIcon = 'circle-check',\n 'button-data-testid': buttonDataTestId = 'select-input'\n}) => {\n const [open, setOpen] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const componentId = `${COMPONENT_ID}-${\n placeholder?.toLowerCase().replace(/\\s+/g, '-') || 'default'\n }`;\n\n const handleToggle = useCallback(() => {\n setOpen(o => !o);\n }, []);\n\n const handleOnOptionClick = useCallback(\n (optionValue: string) => {\n onChange(optionValue);\n setOpen(false);\n },\n [onChange]\n );\n\n React.useEffect(() => {\n if (!open) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (!wrapperRef.current?.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, [open]);\n\n const selectedOption = options.find(opt => opt.value === value);\n\n const renderOption = (option: InputSelectProps['options'][0]) => {\n function handleClick() {\n handleOnOptionClick(option.value);\n }\n\n const isSelected = option.value === value;\n\n return (\n <li\n key={option.value}\n className={classnames(style.option, isSelected && style.selected)}\n role=\"option\"\n aria-selected={isSelected}\n onClick={handleClick}\n data-testid={`option-${option.value}`}\n data-name={option['data-name']}\n >\n <span className={style.optionIcon}>{option.icon}</span>\n <span className={style.optionLabel}>{option.label}</span>\n {isSelected ? (\n <span className={style.checkIcon}>\n <FontAwesomeIcon icon={selectedIcon as IconName} />\n </span>\n ) : null}\n </li>\n );\n };\n\n const shouldBeScrollable = options.length > 6;\n\n return (\n <div className={style.container} ref={wrapperRef}>\n <div\n className={classnames(style.outerWrapper, {\n [style.open]: open\n })}\n >\n <div className={classnames(style.wrapper, className)} aria-label={ariaLabel}>\n <button\n type=\"button\"\n className={style.display}\n onClick={handleToggle}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? `${componentId}-listbox` : undefined}\n id={componentId}\n data-testid={buttonDataTestId}\n >\n <div className={style.content}>\n <span className={style.label}>{placeholder}</span>\n {selectedOption ? <span className={style.value}>{selectedOption.label}</span> : null}\n </div>\n <span className={classnames(style.iconWrapper, {[style.open]: open})}>\n <FontAwesomeIcon\n className={classnames(style.icon, {[style.rotated]: open})}\n icon={iconClosed as IconName}\n />\n </span>\n </button>\n </div>\n </div>\n {open ? (\n <div className={classnames(style.menuWrapper, {[style.showFade]: shouldBeScrollable})}>\n <ul id={`${componentId}-listbox`} className={style.menu} role=\"listbox\">\n {options.map(renderOption)}\n </ul>\n </div>\n ) : null}\n </div>\n );\n};\n\nInputSelect.propTypes = propTypes;\n\nexport default InputSelect;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAGC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QAAO,OAAO;AAC1D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAAQC,eAAe,QAAO,gCAAgC;AAE9D,OAAOC,KAAK,MAAM,aAAa;AAE/B,OAAOC,SAAS,MAAM,SAAS;AAE/B,MAAMC,YAAY,GAAG,cAAc;AAEnC,MA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AEV,UAAU,CAACE,KAAK,CAAC8D,WAAW,EAAE;MAAC,CAAC9D,KAAK,CAAC+D,QAAQ,GAAGd;IAAkB,CAAC;EAAE,gBACpFvD,KAAA,CAAA6C,aAAA;IAAImB,EAAE,EAAE,GAAG1C,WAAW,UAAW;IAACR,SAAS,EAAER,KAAK,CAACgE,IAAK;IAACtB,IAAI,EAAC;EAAS,GACpEtC,OAAO,CAAC6D,GAAG,CAAC9B,YAAY,CACvB,CACD,CAAC,GACJ,IACD,CAAC;AAEV,CAAC;AAEDhC,WAAW,CAACF,SAAS,GAAAiE,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGnE,SAAS;AAEjC,eAAeE,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","useState","useRef","useCallback","classnames","FontAwesomeIcon","Provider","GetSkinFromContext","style","propTypes","COMPONENT_ID","InputSelect","props","context","options","value","onChange","placeholder","className","ariaLabel","iconClosed","selectedIcon","buttonDataTestId","skin","primaryColor","_get","open","setOpen","wrapperRef","componentId","toLowerCase","replace","handleToggle","o","handleOnOptionClick","optionValue","useEffect","handleClickOutside","event","current","contains","target","document","addEventListener","removeEventListener","selectedOption","find","opt","renderOption","option","handleClick","isSelected","createElement","key","selected","role","onClick","backgroundOption","backgroundColor","optionIcon","icon","optionLabel","label","checkIcon","color","shouldBeScrollable","length","container","ref","boxShadow","outerWrapper","wrapper","type","display","undefined","id","content","iconWrapper","rotated","menuWrapper","showFade","menu","map","process","env","NODE_ENV","contextTypes","childContextTypes"],"sources":["../../../src/atom/input-select/index.tsx"],"sourcesContent":["import React, {useState, useRef, useCallback} from 'react';\nimport classnames from 'classnames';\nimport {FontAwesomeIcon} from '@fortawesome/react-fontawesome';\nimport {IconName} from '@fortawesome/fontawesome-svg-core';\nimport {get} from 'lodash/fp';\nimport {WebContextValues} from '../provider/web-context';\nimport Provider, {GetSkinFromContext} from '../provider';\nimport style from './style.css';\nimport type {InputSelectProps} from './types';\nimport propTypes from './types';\n\nconst COMPONENT_ID = 'input-select';\n\nconst InputSelect = (props: InputSelectProps, context: WebContextValues) => {\n const {\n options = [],\n value,\n onChange,\n placeholder,\n className,\n 'aria-label': ariaLabel,\n iconClosed = 'chevron-down',\n selectedIcon = 'circle-check',\n 'button-data-testid': buttonDataTestId = 'select-input'\n } = props;\n const skin = GetSkinFromContext(context);\n const primaryColor = get('common.primary', skin);\n const [open, setOpen] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const componentId = `${COMPONENT_ID}-${\n placeholder?.toLowerCase().replace(/\\s+/g, '-') || 'default'\n }`;\n\n const handleToggle = useCallback(() => {\n setOpen(o => !o);\n }, []);\n\n const handleOnOptionClick = useCallback(\n (optionValue: string) => {\n onChange(optionValue);\n setOpen(false);\n },\n [onChange]\n );\n\n React.useEffect(() => {\n if (!open) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (!wrapperRef.current?.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, [open]);\n\n const selectedOption = options.find(opt => opt.value === value);\n\n const renderOption = (option: InputSelectProps['options'][0]) => {\n function handleClick() {\n handleOnOptionClick(option.value);\n }\n\n const isSelected = option.value === value;\n\n return (\n <li\n key={option.value}\n className={classnames(style.option, isSelected && style.selected)}\n role=\"option\"\n aria-selected={isSelected}\n onClick={handleClick}\n data-testid={`option-${option.value}`}\n data-name={option['data-name']}\n >\n <div className={style.backgroundOption} style={{backgroundColor: primaryColor}} />\n <span className={style.optionIcon}>{option.icon}</span>\n <span className={style.optionLabel}>{option.label}</span>\n {isSelected ? (\n <span className={style.checkIcon}>\n <FontAwesomeIcon icon={selectedIcon as IconName} color={primaryColor} />\n </span>\n ) : null}\n </li>\n );\n };\n\n const shouldBeScrollable = options.length > 6;\n\n return (\n <div className={style.container} ref={wrapperRef}>\n <div\n style={{\n boxShadow: open\n ? `0 0 0 2px white, 0 0 0 4px${primaryColor}`\n : `0 0 0 2px ${primaryColor}`\n }}\n className={classnames(style.outerWrapper, {\n [style.open]: open\n })}\n />\n <div className={classnames(style.wrapper, className)} aria-label={ariaLabel}>\n <button\n type=\"button\"\n className={style.display}\n onClick={handleToggle}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? `${componentId}-listbox` : undefined}\n id={componentId}\n data-testid={buttonDataTestId}\n >\n <div className={style.content}>\n <span className={style.label}>{placeholder}</span>\n {selectedOption ? <span className={style.value}>{selectedOption.label}</span> : null}\n </div>\n <span className={classnames(style.iconWrapper, {[style.open]: open})}>\n <FontAwesomeIcon\n className={classnames(style.icon, {[style.rotated]: open})}\n icon={iconClosed as IconName}\n />\n </span>\n </button>\n </div>\n {open ? (\n <div className={classnames(style.menuWrapper, {[style.showFade]: shouldBeScrollable})}>\n <ul id={`${componentId}-listbox`} className={style.menu} role=\"listbox\">\n {options.map(renderOption)}\n </ul>\n </div>\n ) : null}\n </div>\n );\n};\n\nInputSelect.propTypes = propTypes;\nInputSelect.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\nexport default InputSelect;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAGC,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QAAO,OAAO;AAC1D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAAQC,eAAe,QAAO,gCAAgC;AAI9D,OAAOC,QAAQ,IAAGC,kBAAkB,QAAO,aAAa;AACxD,OAAOC,KAAK,MAAM,aAAa;AAE/B,OAAOC,SAAS,MAAM,SAAS;AAE/B,MAAMC,YAAY,GAAG,cAAc;AAEnC,MAAMC,WAAW,GAAGA,CAACC,KAAuB,EAAEC,OAAyB,KAAK;EAC1E,MAAM;IACJC,OAAO,GAAG,EAAE;IACZC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC,SAAS;IACT,YAAY,EAAEC,SAAS;IACvBC,UAAU,GAAG,cAAc;IAC3BC,YAAY,GAAG,cAAc;IAC7B,oBAAoB,EAAEC,gBAAgB,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,CAACoD,IAAI,EAAE;MAAC,CAACpD,KAAK,CAACsE,OAAO,GAAGpD;IAAI,CAAC,CAAE;IAC3DkC,IAAI,EAAExC;EAAuB,CAC9B,CACG,CACA,CACL,CAAC,EACLM,IAAI,gBACH1B,KAAA,CAAAoD,aAAA;IAAKlC,SAAS,EAAEd,UAAU,CAACI,KAAK,CAACuE,WAAW,EAAE;MAAC,CAACvE,KAAK,CAACwE,QAAQ,GAAGf;IAAkB,CAAC;EAAE,gBACpFjE,KAAA,CAAAoD,aAAA;IAAIuB,EAAE,EAAE,GAAG9C,WAAW,UAAW;IAACX,SAAS,EAAEV,KAAK,CAACyE,IAAK;IAAC1B,IAAI,EAAC;EAAS,GACpEzC,OAAO,CAACoE,GAAG,CAAClC,YAAY,CACvB,CACD,CAAC,GACJ,IACD,CAAC;AAEV,CAAC;AAEDrC,WAAW,CAACF,SAAS,GAAA0E,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAG5E,SAAS;AACjCE,WAAW,CAAC2E,YAAY,GAAG;EACzB/D,IAAI,EAAEjB,QAAQ,CAACiF,iBAAiB,CAAChE;AACnC,CAAC;AACD,eAAeZ,WAAW","ignoreList":[]}
@@ -6,7 +6,6 @@
6
6
  @value cm_negative_300 from colors;
7
7
  @value white from colors;
8
8
  @value cm_grey_100 from colors;
9
- @value brand from colors;
10
9
  @value cm_primary_blue from colors;
11
10
  @value primary_100 from colors;
12
11
  @value cm_blue_50 from colors;
@@ -23,15 +22,18 @@
23
22
  .outerWrapper {
24
23
  width: 100%;
25
24
  border-radius: 12px;
26
- transition: box-shadow 0.2s;
25
+ transition: all 0.2s;
26
+ opacity: 0;
27
+ position: absolute;
28
+ height: 100%;
27
29
  }
28
30
 
29
- .outerWrapper:hover {
30
- box-shadow: 0 0 0 2px brand;
31
+ .container:hover .outerWrapper {
32
+ opacity: 1;
31
33
  }
32
34
 
33
35
  .outerWrapper.open {
34
- box-shadow: 0 0 0 2px white, 0 0 0 4px brand;
36
+ opacity: 1;
35
37
  }
36
38
 
37
39
  .wrapper {
@@ -157,17 +159,26 @@
157
159
  box-sizing: border-box;
158
160
  border-radius: 12px;
159
161
  margin-bottom: 4px;
162
+ position: relative;
163
+ overflow: hidden;
160
164
  }
161
165
 
162
- .option.selected {
163
- background-color: color(brand lightness(95%));
166
+ .option.selected .backgroundOption{
167
+ opacity: 0.1;
164
168
  }
165
169
 
166
- .option.selected:hover,
167
- .option.selected:focus {
168
- background-color: color(brand lightness(90%));
170
+ .option.selected:hover .backgroundOption,
171
+ .option.selected:focus .backgroundOption{
172
+ opacity: 0.2;
173
+ }
174
+ .backgroundOption {
175
+ position: absolute;
176
+ top: 0;
177
+ left: 0;
178
+ width: 100%;
179
+ height: 100%;
180
+ opacity: 0
169
181
  }
170
-
171
182
  .option:hover:not(.selected),
172
183
  .option:focus:not(.selected) {
173
184
  background: cm_grey_100;
@@ -193,7 +204,6 @@
193
204
  }
194
205
 
195
206
  .checkIcon {
196
- color: brand;
197
207
  display: inline-flex;
198
208
  align-items: center;
199
209
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAuBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyGE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAiCC;IA/BC,kBAAuD;IACvD;;;;;;;MAOC;IA8FH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAgBC;IAED,0BAKC;IAED,sBAIC;IAED,qBAoBC;IAaD,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IAED,sCAKC;IAzMC,kBAAwB;IACxB,oBAA0B;IA0B5B,gCAEC;IAED,kCAEC;IAED,qCAqBC;IAqFD,sCASC;IA9ID,0BAEC;IAED,2EASC;IAED,6BAEC;IAkCC,kBAAsB;IAgJxB,0DAcE;IAEF,6BA6iBC;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/mooc-header/index.js"],"names":[],"mappings":";AAuBA;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyGE;IAEF;;;;;;;;;;;;;;;;;;;;;;;MAGE;IAEF,wBAiCC;IA/BC,kBAAuD;IACvD;;;;;;;MAOC;IA8FH,6BAIC;IAED,yBAGC;IAxBD,qCAQC;IAED,wBAGC;IAjBD,+BAEC;IA4BD,2BAgBC;IAED,0BAKC;IAED,sBAIC;IAED,qBAoBC;IAaD,yBAQC;IAED,0BAQC;IAED,0BAIC;IAED,2BAIC;IAED,iCAUC;IAED,sCAKC;IAzMC,kBAAwB;IACxB,oBAA0B;IA0B5B,gCAEC;IAED,kCAEC;IAED,qCAqBC;IAqFD,sCASC;IA9ID,0BAEC;IAED,2EASC;IAED,6BAEC;IAkCC,kBAAsB;IAgJxB,0DAcE;IAEF,6BAmjBC;CACF"}
@@ -586,8 +586,14 @@ class MoocHeader extends React.Component {
586
586
  ref: this.setMenuSettings
587
587
  }, /*#__PURE__*/React.createElement("div", {
588
588
  "data-name": "user-avatar-wrapper",
589
- className: classnames(style.userAvatarWrapper, isSettingsOpen && style.userAvatarOpen)
590
- }, /*#__PURE__*/React.createElement(Link, {
589
+ className: style.userAvatarWrapper
590
+ }, /*#__PURE__*/React.createElement("div", {
591
+ className: classnames(style.userAvatarBoxShadow, isSettingsOpen && style.open),
592
+ style: {
593
+ boxShadow: isSettingsOpen ? `0 0 0 1px white, 0 0 0 3px ${primaryColor}` : `0 0 0 2px ${primaryColor}`,
594
+ transition: 'box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1)'
595
+ }
596
+ }), /*#__PURE__*/React.createElement(Link, {
591
597
  className: classnames(style.userLinkAvatar),
592
598
  onClick: this.handleSettingsToggle,
593
599
  "aria-expanded": isSettingsOpen,