@coorpacademy/components 11.15.3 → 11.16.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/atom/autocomplete/index.d.ts.map +1 -1
- package/es/atom/autocomplete/index.js +13 -5
- package/es/atom/autocomplete/index.js.map +1 -1
- package/es/atom/autocomplete/style.css +83 -0
- package/es/atom/select/style.css +2 -2
- package/es/molecule/expandable-item/index.d.ts +2 -1
- package/es/molecule/expandable-item/index.d.ts.map +1 -1
- package/es/molecule/expandable-item/index.js +20 -4
- package/es/molecule/expandable-item/index.js.map +1 -1
- package/es/molecule/expandable-item/types.d.ts +2 -0
- package/es/molecule/expandable-item/types.d.ts.map +1 -1
- package/es/molecule/expandable-item/types.js +2 -1
- package/es/molecule/expandable-item/types.js.map +1 -1
- package/es/molecule/expandable-list/index.d.ts +1 -0
- package/es/molecule/expandable-list/index.d.ts.map +1 -1
- package/es/molecule/expandable-list/types.d.ts +1 -0
- package/es/molecule/expandable-list/types.d.ts.map +1 -1
- package/es/molecule/menu-links/index.d.ts +1 -0
- package/es/molecule/menu-links/index.d.ts.map +1 -1
- package/es/molecule/menu-links/index.js +5 -4
- package/es/molecule/menu-links/index.js.map +1 -1
- package/es/molecule/menu-links/style.css +3 -2
- package/es/molecule/menu-links/types.d.ts +2 -0
- package/es/molecule/menu-links/types.d.ts.map +1 -1
- package/es/molecule/menu-links/types.js +2 -1
- package/es/molecule/menu-links/types.js.map +1 -1
- package/es/molecule/privacy-policy-contact/index.js +1 -1
- package/es/molecule/privacy-policy-contact/index.js.map +1 -1
- package/es/molecule/select-multiple/index.d.ts.map +1 -1
- package/es/molecule/select-multiple/index.js +2 -4
- package/es/molecule/select-multiple/index.js.map +1 -1
- package/es/molecule/select-multiple/style.css +5 -11
- package/es/organism/brand-form/index.d.ts +1 -0
- package/es/organism/brand-form/index.d.ts.map +1 -1
- package/es/organism/brand-form/index.js +17 -7
- package/es/organism/brand-form/index.js.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +1 -0
- package/es/template/back-office/brand-update/index.d.ts +1 -0
- package/es/template/back-office/brand-update/style.css +2 -1
- package/es/template/common/faq-article-page/index.d.ts +3 -0
- package/es/template/common/faq-article-page/index.d.ts.map +1 -1
- package/es/template/common/faq-article-page/types.d.ts +6 -0
- package/es/template/common/faq-article-page/types.d.ts.map +1 -1
- package/es/template/common/faq-article-page/types.js +4 -1
- package/es/template/common/faq-article-page/types.js.map +1 -1
- package/es/template/common/faq-page/index.d.ts +2 -0
- package/es/template/common/faq-page/index.d.ts.map +1 -1
- package/es/template/common/faq-page/types.d.ts +2 -0
- package/es/template/common/faq-page/types.d.ts.map +1 -1
- package/es/template/common/privacy-policy-page/index.d.ts +2 -0
- package/es/template/common/privacy-policy-page/index.d.ts.map +1 -1
- package/es/template/common/privacy-policy-page/types.d.ts +2 -0
- package/es/template/common/privacy-policy-page/types.d.ts.map +1 -1
- package/lib/atom/autocomplete/index.d.ts.map +1 -1
- package/lib/atom/autocomplete/index.js +12 -4
- package/lib/atom/autocomplete/index.js.map +1 -1
- package/lib/atom/autocomplete/style.css +83 -0
- package/lib/atom/select/style.css +2 -2
- package/lib/molecule/expandable-item/index.d.ts +2 -1
- package/lib/molecule/expandable-item/index.d.ts.map +1 -1
- package/lib/molecule/expandable-item/index.js +20 -4
- package/lib/molecule/expandable-item/index.js.map +1 -1
- package/lib/molecule/expandable-item/types.d.ts +2 -0
- package/lib/molecule/expandable-item/types.d.ts.map +1 -1
- package/lib/molecule/expandable-item/types.js +2 -1
- package/lib/molecule/expandable-item/types.js.map +1 -1
- package/lib/molecule/expandable-list/index.d.ts +1 -0
- package/lib/molecule/expandable-list/index.d.ts.map +1 -1
- package/lib/molecule/expandable-list/types.d.ts +1 -0
- package/lib/molecule/expandable-list/types.d.ts.map +1 -1
- package/lib/molecule/menu-links/index.d.ts +1 -0
- package/lib/molecule/menu-links/index.d.ts.map +1 -1
- package/lib/molecule/menu-links/index.js +5 -4
- package/lib/molecule/menu-links/index.js.map +1 -1
- package/lib/molecule/menu-links/style.css +3 -2
- package/lib/molecule/menu-links/types.d.ts +2 -0
- package/lib/molecule/menu-links/types.d.ts.map +1 -1
- package/lib/molecule/menu-links/types.js +2 -1
- package/lib/molecule/menu-links/types.js.map +1 -1
- package/lib/molecule/privacy-policy-contact/index.js +1 -1
- package/lib/molecule/privacy-policy-contact/index.js.map +1 -1
- package/lib/molecule/select-multiple/index.d.ts.map +1 -1
- package/lib/molecule/select-multiple/index.js +2 -4
- package/lib/molecule/select-multiple/index.js.map +1 -1
- package/lib/molecule/select-multiple/style.css +5 -11
- package/lib/organism/brand-form/index.d.ts +1 -0
- package/lib/organism/brand-form/index.d.ts.map +1 -1
- package/lib/organism/brand-form/index.js +18 -7
- package/lib/organism/brand-form/index.js.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +1 -0
- package/lib/template/back-office/brand-update/index.d.ts +1 -0
- package/lib/template/back-office/brand-update/style.css +2 -1
- package/lib/template/common/faq-article-page/index.d.ts +3 -0
- package/lib/template/common/faq-article-page/index.d.ts.map +1 -1
- package/lib/template/common/faq-article-page/types.d.ts +6 -0
- package/lib/template/common/faq-article-page/types.d.ts.map +1 -1
- package/lib/template/common/faq-article-page/types.js +4 -1
- package/lib/template/common/faq-article-page/types.js.map +1 -1
- package/lib/template/common/faq-page/index.d.ts +2 -0
- package/lib/template/common/faq-page/index.d.ts.map +1 -1
- package/lib/template/common/faq-page/types.d.ts +2 -0
- package/lib/template/common/faq-page/types.d.ts.map +1 -1
- package/lib/template/common/privacy-policy-page/index.d.ts +2 -0
- package/lib/template/common/privacy-policy-page/index.d.ts.map +1 -1
- package/lib/template/common/privacy-policy-page/types.d.ts +2 -0
- package/lib/template/common/privacy-policy-page/types.d.ts.map +1 -1
- package/locales/.mtslconfig.json +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/autocomplete/index.js"],"names":[],"mappings":";AAmBA,uDA8GC"}
|
|
@@ -6,7 +6,7 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
6
6
|
import Autosuggest from 'react-autosuggest';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import classnames from 'classnames';
|
|
9
|
-
import { NovaSolidStatusClose as ErrorIcon } from '@coorpacademy/nova-icons';
|
|
9
|
+
import { NovaSolidStatusClose as ErrorIcon, NovaCompositionCoorpacademyInformationIcon as InfoIcon } from '@coorpacademy/nova-icons';
|
|
10
10
|
import getClassState from '../../util/get-class-state';
|
|
11
11
|
import style from './style.css';
|
|
12
12
|
const THEME_STYLE = {
|
|
@@ -52,6 +52,16 @@ const Autocomplete = props => {
|
|
|
52
52
|
onInput: handleInput,
|
|
53
53
|
'data-testid': 'autocomplete-input'
|
|
54
54
|
};
|
|
55
|
+
const descriptionView = description && theme !== 'coorpmanager' ? /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: style.description
|
|
57
|
+
}, description) : null;
|
|
58
|
+
const toolTipView = description && theme === 'coorpmanager' ? /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
className: style.infoIconWrapper
|
|
60
|
+
}, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
61
|
+
className: style.infoIcon
|
|
62
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: style.descriptionLabel
|
|
64
|
+
}, description)) : null;
|
|
55
65
|
const errorIconView = theme === 'coorpmanager' && error ? /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
56
66
|
className: style.leftIcon
|
|
57
67
|
}) : null;
|
|
@@ -66,7 +76,7 @@ const Autocomplete = props => {
|
|
|
66
76
|
className: classnames(mainClass, className, _isNil(propsTitle) && style.isNoTitle)
|
|
67
77
|
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
68
78
|
className: classnames(style.title, _isEmpty(value) && style.noValue)
|
|
69
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
}, title, toolTipView), /*#__PURE__*/React.createElement("div", {
|
|
70
80
|
className: style.inputContainer
|
|
71
81
|
}, /*#__PURE__*/React.createElement(Autosuggest, {
|
|
72
82
|
theme: {
|
|
@@ -86,9 +96,7 @@ const Autocomplete = props => {
|
|
|
86
96
|
inputProps: inputProps,
|
|
87
97
|
focusInputOnSuggestionClick: false,
|
|
88
98
|
onSuggestionSelected: handleSuggestionsSelected
|
|
89
|
-
}), errorIconView, errorText)),
|
|
90
|
-
className: style.description
|
|
91
|
-
}, description));
|
|
99
|
+
}), errorIconView, errorText)), descriptionView);
|
|
92
100
|
};
|
|
93
101
|
|
|
94
102
|
Autocomplete.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","Autosuggest","PropTypes","classnames","NovaSolidStatusClose","ErrorIcon","getClassState","style","THEME_STYLE","coorpmanager","default","renderSuggestion","suggestion","name","Autocomplete","props","placeholder","value","description","required","modified","error","errorMessage","suggestions","onInput","onFetch","onClear","onBlur","onSuggestionSelected","title","propsTitle","theme","mainClass","className","handleInput","e","handleBlur","selectedSuggestion","handleSuggestionsFetchRequested","handleSuggestionsClearRequested","handleSuggestionsSelected","data","inputProps","onChange","errorIconView","leftIcon","errorText","__html","isNoTitle","noValue","inputContainer","container","input","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestionHighlighted","propTypes","string","bool","arrayOf","shape","oneOfType","number","oneOf","func"],"sources":["../../../src/atom/autocomplete/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport Autosuggest from 'react-autosuggest';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {noop, isNil, isEmpty, keys} from 'lodash/fp';\nimport {NovaSolidStatusClose as ErrorIcon} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst THEME_STYLE = {\n coorpmanager: style.coorpmanager,\n default: style.default\n};\n\nconst renderSuggestion = suggestion => <span>{suggestion.name}</span>;\n\nconst Autocomplete = props => {\n const {\n placeholder = '',\n value,\n description,\n required,\n modified = false,\n error = false,\n errorMessage,\n suggestions = [],\n onInput = noop,\n onFetch = noop,\n onClear = noop,\n onBlur = noop,\n onSuggestionSelected = noop,\n title: propsTitle,\n theme = 'default'\n } = props;\n\n const mainClass = THEME_STYLE[theme];\n const title = useMemo(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);\n const className = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [modified, error]\n );\n\n const handleInput = useCallback(\n e => {\n onInput(e);\n },\n [onInput]\n );\n const handleBlur = useCallback(\n (e, selectedSuggestion) => onBlur(e, selectedSuggestion),\n [onBlur]\n );\n const handleSuggestionsFetchRequested = useCallback(e => onFetch(e), [onFetch]);\n const handleSuggestionsClearRequested = useCallback(e => onClear(e), [onClear]);\n const handleSuggestionsSelected = useCallback(\n (e, data) => onSuggestionSelected(data),\n [onSuggestionSelected]\n );\n\n const inputProps = {\n placeholder,\n value,\n onChange: noop,\n onBlur: handleBlur,\n onInput: handleInput,\n 'data-testid': 'autocomplete-input'\n };\n\n const errorIconView =\n theme === 'coorpmanager' && error ? <ErrorIcon className={style.leftIcon} /> : null;\n\n const errorText =\n theme === 'coorpmanager' && error ? (\n <div\n className={style.errorText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: errorMessage}}\n />\n ) : null;\n return (\n <div className={classnames(mainClass, className, isNil(propsTitle) && style.isNoTitle)}>\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>{title}</span>\n <div className={style.inputContainer}>\n <Autosuggest\n theme={{\n container: style.container,\n input: style.input,\n suggestionsContainer: style.suggestionsContainer,\n suggestionsContainerOpen: style.suggestionsContainerOpen,\n suggestionsList: style.suggestionsList,\n suggestion: style.suggestion,\n suggestionHighlighted: style.suggestionHighlighted\n }}\n suggestions={suggestions}\n onSuggestionsFetchRequested={handleSuggestionsFetchRequested}\n onSuggestionsClearRequested={handleSuggestionsClearRequested}\n getSuggestionValue={noop}\n renderSuggestion={renderSuggestion}\n inputProps={inputProps}\n focusInputOnSuggestionClick={false}\n onSuggestionSelected={handleSuggestionsSelected}\n />\n {errorIconView}\n {errorText}\n </div>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nAutocomplete.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n description: PropTypes.string,\n required: PropTypes.bool,\n modified: PropTypes.bool,\n error: PropTypes.bool,\n errorMessage: PropTypes.string,\n suggestions: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n })\n ),\n theme: PropTypes.oneOf(keys(THEME_STYLE)),\n onInput: PropTypes.func,\n onFetch: PropTypes.func,\n onClear: PropTypes.func,\n onBlur: PropTypes.func,\n onSuggestionSelected: PropTypes.func\n};\n\nexport default Autocomplete;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAA0C,OAA1C;AACA,OAAOC,WAAP,MAAwB,mBAAxB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,oBAAoB,IAAIC,SAAhC,QAAgD,0BAAhD;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,WAAW,GAAG;EAClBC,YAAY,EAAEF,KAAK,CAACE,YADF;EAElBC,OAAO,EAAEH,KAAK,CAACG;AAFG,CAApB;;AAKA,MAAMC,gBAAgB,GAAGC,UAAU,iBAAI,kCAAOA,UAAU,CAACC,IAAlB,CAAvC;;AAEA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC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,IAjBI;EAkBvBvC,OAAO,EAAExB,SAAS,CAAC+D,IAlBI;EAmBvBtC,MAAM,EAAEzB,SAAS,CAAC+D,IAnBK;EAoBvBrC,oBAAoB,EAAE1B,SAAS,CAAC+D;AApBT,CAAzB;AAuBA,eAAenD,YAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useCallback","useMemo","Autosuggest","PropTypes","classnames","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","getClassState","style","THEME_STYLE","coorpmanager","default","renderSuggestion","suggestion","name","Autocomplete","props","placeholder","value","description","required","modified","error","errorMessage","suggestions","onInput","onFetch","onClear","onBlur","onSuggestionSelected","title","propsTitle","theme","mainClass","className","handleInput","e","handleBlur","selectedSuggestion","handleSuggestionsFetchRequested","handleSuggestionsClearRequested","handleSuggestionsSelected","data","inputProps","onChange","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","errorIconView","leftIcon","errorText","__html","isNoTitle","noValue","inputContainer","container","input","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestionHighlighted","propTypes","string","bool","arrayOf","shape","oneOfType","number","oneOf","func"],"sources":["../../../src/atom/autocomplete/index.js"],"sourcesContent":["import React, {useCallback, useMemo} from 'react';\nimport Autosuggest from 'react-autosuggest';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {noop, isNil, isEmpty, keys} from 'lodash/fp';\nimport {\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst THEME_STYLE = {\n coorpmanager: style.coorpmanager,\n default: style.default\n};\n\nconst renderSuggestion = suggestion => <span>{suggestion.name}</span>;\n\nconst Autocomplete = props => {\n const {\n placeholder = '',\n value,\n description,\n required,\n modified = false,\n error = false,\n errorMessage,\n suggestions = [],\n onInput = noop,\n onFetch = noop,\n onClear = noop,\n onBlur = noop,\n onSuggestionSelected = noop,\n title: propsTitle,\n theme = 'default'\n } = props;\n\n const mainClass = THEME_STYLE[theme];\n const title = useMemo(() => `${propsTitle}${required ? '*' : ''}`, [propsTitle, required]);\n const className = useMemo(\n () => getClassState(style.default, style.modified, style.error, modified, error),\n [modified, error]\n );\n\n const handleInput = useCallback(\n e => {\n onInput(e);\n },\n [onInput]\n );\n const handleBlur = useCallback(\n (e, selectedSuggestion) => onBlur(e, selectedSuggestion),\n [onBlur]\n );\n const handleSuggestionsFetchRequested = useCallback(e => onFetch(e), [onFetch]);\n const handleSuggestionsClearRequested = useCallback(e => onClear(e), [onClear]);\n const handleSuggestionsSelected = useCallback(\n (e, data) => onSuggestionSelected(data),\n [onSuggestionSelected]\n );\n\n const inputProps = {\n placeholder,\n value,\n onChange: noop,\n onBlur: handleBlur,\n onInput: handleInput,\n 'data-testid': 'autocomplete-input'\n };\n\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n\n const errorIconView =\n theme === 'coorpmanager' && error ? <ErrorIcon className={style.leftIcon} /> : null;\n\n const errorText =\n theme === 'coorpmanager' && error ? (\n <div\n className={style.errorText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: errorMessage}}\n />\n ) : null;\n return (\n <div className={classnames(mainClass, className, isNil(propsTitle) && style.isNoTitle)}>\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {title}\n {toolTipView}\n </span>\n <div className={style.inputContainer}>\n <Autosuggest\n theme={{\n container: style.container,\n input: style.input,\n suggestionsContainer: style.suggestionsContainer,\n suggestionsContainerOpen: style.suggestionsContainerOpen,\n suggestionsList: style.suggestionsList,\n suggestion: style.suggestion,\n suggestionHighlighted: style.suggestionHighlighted\n }}\n suggestions={suggestions}\n onSuggestionsFetchRequested={handleSuggestionsFetchRequested}\n onSuggestionsClearRequested={handleSuggestionsClearRequested}\n getSuggestionValue={noop}\n renderSuggestion={renderSuggestion}\n inputProps={inputProps}\n focusInputOnSuggestionClick={false}\n onSuggestionSelected={handleSuggestionsSelected}\n />\n {errorIconView}\n {errorText}\n </div>\n </label>\n {descriptionView}\n </div>\n );\n};\n\nAutocomplete.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n value: PropTypes.string,\n description: PropTypes.string,\n required: PropTypes.bool,\n modified: PropTypes.bool,\n error: PropTypes.bool,\n errorMessage: PropTypes.string,\n suggestions: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])\n })\n ),\n theme: PropTypes.oneOf(keys(THEME_STYLE)),\n onInput: PropTypes.func,\n onFetch: PropTypes.func,\n onClear: PropTypes.func,\n onBlur: PropTypes.func,\n onSuggestionSelected: PropTypes.func\n};\n\nexport default Autocomplete;\n"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,EAA4BC,OAA5B,QAA0C,OAA1C;AACA,OAAOC,WAAP,MAAwB,mBAAxB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,oBAAoB,IAAIC,SAD1B,EAEEC,0CAA0C,IAAIC,QAFhD,QAGO,0BAHP;AAIA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,WAAW,GAAG;EAClBC,YAAY,EAAEF,KAAK,CAACE,YADF;EAElBC,OAAO,EAAEH,KAAK,CAACG;AAFG,CAApB;;AAKA,MAAMC,gBAAgB,GAAGC,UAAU,iBAAI,kCAAOA,UAAU,CAACC,IAAlB,CAAvC;;AAEA,MAAMC,YAAY,GAAGC,KAAK,IAAI;EAC5B,MAAM;IACJC,WAAW,GAAG,EADV;IAEJC,KA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+D,MADF;IAEd9C,KAAK,EAAEjB,SAAS,CAACmE,SAAV,CAAoB,CAACnE,SAAS,CAAC+D,MAAX,EAAmB/D,SAAS,CAACoE,MAA7B,CAApB;EAFO,CAAhB,CADW,CATU;EAevBrC,KAAK,EAAE/B,SAAS,CAACqE,KAAV,CAAgB,MAAK7D,WAAL,CAAhB,CAfgB;EAgBvBgB,OAAO,EAAExB,SAAS,CAACsE,IAhBI;EAiBvB7C,OAAO,EAAEzB,SAAS,CAACsE,IAjBI;EAkBvB5C,OAAO,EAAE1B,SAAS,CAACsE,IAlBI;EAmBvB3C,MAAM,EAAE3B,SAAS,CAACsE,IAnBK;EAoBvB1C,oBAAoB,EAAE5B,SAAS,CAACsE;AApBT,CAAzB;AAuBA,eAAexD,YAAf"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
@value cm_grey_100 from colors;
|
|
11
11
|
@value cm_grey_150 from colors;
|
|
12
12
|
@value cm_grey_400 from colors;
|
|
13
|
+
@value cm_grey_500 from colors;
|
|
13
14
|
@value cm_grey_700 from colors;
|
|
14
15
|
|
|
15
16
|
.default {
|
|
@@ -193,6 +194,20 @@
|
|
|
193
194
|
top: 7px;
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
.coorpmanager:focus-within .title.noValue .infoIcon {
|
|
198
|
+
width: 8px;
|
|
199
|
+
height: 8px;
|
|
200
|
+
line-height: 12px;
|
|
201
|
+
color: cm_grey_400;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.coorpmanager .title.noValue .infoIcon {
|
|
205
|
+
height: 10px;
|
|
206
|
+
width: 10px;
|
|
207
|
+
line-height: 12px;
|
|
208
|
+
color: cm_grey_500;
|
|
209
|
+
}
|
|
210
|
+
|
|
196
211
|
.coorpmanager .inputContainer {
|
|
197
212
|
width: 100%
|
|
198
213
|
}
|
|
@@ -277,3 +292,71 @@
|
|
|
277
292
|
padding-top: 8px;
|
|
278
293
|
color: cm_negative_100;
|
|
279
294
|
}
|
|
295
|
+
|
|
296
|
+
.coorpmanager .infoIconWrapper {
|
|
297
|
+
overflow: visible;
|
|
298
|
+
height: 12px;
|
|
299
|
+
margin: 0px 4px;
|
|
300
|
+
cursor: pointer;
|
|
301
|
+
pointer-events: fill;
|
|
302
|
+
position: relative;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.coorpmanager .infoIcon {
|
|
306
|
+
cursor: pointer;
|
|
307
|
+
width: 8px;
|
|
308
|
+
height: 8px;
|
|
309
|
+
line-height: 16px;
|
|
310
|
+
color: cm_grey_400;
|
|
311
|
+
transition: all 0.25s linear;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.coorpmanager .infoIconWrapper:hover .descriptionLabel {
|
|
315
|
+
visibility: visible;
|
|
316
|
+
opacity: 1;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.coorpmanager .descriptionLabel {
|
|
320
|
+
margin: 0 1px 18px 0;
|
|
321
|
+
padding: 8px 16px;
|
|
322
|
+
border-radius: 7px;
|
|
323
|
+
background-color: cm_grey_700;
|
|
324
|
+
flex-grow: 0;
|
|
325
|
+
font-family: Gilroy;
|
|
326
|
+
font-size: 14px;
|
|
327
|
+
font-weight: 500;
|
|
328
|
+
font-stretch: normal;
|
|
329
|
+
font-style: normal;
|
|
330
|
+
line-height: 1.43;
|
|
331
|
+
letter-spacing: normal;
|
|
332
|
+
text-align: center;
|
|
333
|
+
color: white;
|
|
334
|
+
padding: 8px 16px;
|
|
335
|
+
max-width: 348px;
|
|
336
|
+
width: max-content;
|
|
337
|
+
position: absolute;
|
|
338
|
+
left: -24px;
|
|
339
|
+
z-index: 3;
|
|
340
|
+
bottom: 5px;
|
|
341
|
+
visibility: hidden;
|
|
342
|
+
opacity: 0;
|
|
343
|
+
overflow-wrap: break-word;
|
|
344
|
+
white-space: break-spaces;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.coorpmanager .descriptionLabel::after{
|
|
348
|
+
content:'';
|
|
349
|
+
border-left: 6px solid transparent;
|
|
350
|
+
border-right: 6px solid transparent;
|
|
351
|
+
border-top: 6px solid cm_grey_700;
|
|
352
|
+
position: absolute;
|
|
353
|
+
bottom: -6px;
|
|
354
|
+
left: 21px;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.coorpmanager .title.noValue .descriptionLabel::after{
|
|
358
|
+
left: 22px;
|
|
359
|
+
}
|
|
360
|
+
.coorpmanager:focus-within .title.noValue .descriptionLabel::after{
|
|
361
|
+
left: 21px;
|
|
362
|
+
}
|
package/es/atom/select/style.css
CHANGED
|
@@ -85,7 +85,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
85
85
|
.selectSpan {
|
|
86
86
|
display: none;
|
|
87
87
|
position: relative;
|
|
88
|
-
z-index:
|
|
88
|
+
z-index: 1;
|
|
89
89
|
white-space: nowrap;
|
|
90
90
|
pointer-events: none;
|
|
91
91
|
height: 18px;
|
|
@@ -167,7 +167,7 @@ div.coorpmanager label.selectWrapper {
|
|
|
167
167
|
pointer-events: none;
|
|
168
168
|
width: 12px;
|
|
169
169
|
height: 12px;
|
|
170
|
-
z-index:
|
|
170
|
+
z-index: 2;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
.selectedArrow {
|
|
@@ -4,7 +4,7 @@ export declare const ICONS: {
|
|
|
4
4
|
arrow: any;
|
|
5
5
|
};
|
|
6
6
|
declare const ExpandableItem: {
|
|
7
|
-
({ icon, title, isExpended, isLink, content, onClick, image }: Props): JSX.Element;
|
|
7
|
+
({ icon, title, isExpended, isLink, content, onClick, image, ariaLabel }: Props): JSX.Element;
|
|
8
8
|
propTypes: {
|
|
9
9
|
title: import("prop-types").Requireable<string>;
|
|
10
10
|
icon: import("prop-types").Requireable<string>;
|
|
@@ -13,6 +13,7 @@ declare const ExpandableItem: {
|
|
|
13
13
|
content: import("prop-types").Requireable<string>;
|
|
14
14
|
image: import("prop-types").Requireable<string>;
|
|
15
15
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
16
|
+
ariaLabel: import("prop-types").Requireable<string>;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
export default ExpandableItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-item/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAGzC,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,QAAA,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-item/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAGzC,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,QAAA,MAAM,cAAc;8EASjB,KAAK;;;;;;;;;;;CAwDP,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
|
@@ -14,19 +14,35 @@ const ExpandableItem = ({
|
|
|
14
14
|
isLink,
|
|
15
15
|
content,
|
|
16
16
|
onClick,
|
|
17
|
-
image
|
|
17
|
+
image,
|
|
18
|
+
ariaLabel
|
|
18
19
|
}) => {
|
|
19
20
|
const Icon = ICONS[icon];
|
|
20
21
|
return /*#__PURE__*/React.createElement("div", {
|
|
21
22
|
className: isExpended ? styles.expendedContainer : styles.container
|
|
22
|
-
}, /*#__PURE__*/React.createElement("
|
|
23
|
+
}, isLink ? /*#__PURE__*/React.createElement("a", {
|
|
23
24
|
className: classnames(styles.header, isExpended ? styles.expendedHeader : null),
|
|
24
|
-
onClick: onClick
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
"aria-label": ariaLabel
|
|
25
27
|
}, /*#__PURE__*/React.createElement("h3", {
|
|
26
28
|
className: styles.title
|
|
27
29
|
}, title), Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
28
30
|
className: classnames(styles.icon, isExpended ? styles.expendedIcon : null, isLink ? styles.linkIcon : null)
|
|
29
|
-
}) : null)
|
|
31
|
+
}) : null) : /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: classnames(styles.header, isExpended ? styles.expendedHeader : null),
|
|
33
|
+
onClick: onClick,
|
|
34
|
+
id: `${title}_expended_item_id`,
|
|
35
|
+
"aria-controls": `${title}_expended_item_aria-controls`,
|
|
36
|
+
"aria-expanded": isExpended
|
|
37
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
38
|
+
className: styles.title
|
|
39
|
+
}, title), Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
40
|
+
className: classnames(styles.icon, isExpended ? styles.expendedIcon : null, isLink ? styles.linkIcon : null)
|
|
41
|
+
}) : null), isExpended ? /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
id: `${title}_expended_item_aria-controls`,
|
|
43
|
+
role: "region",
|
|
44
|
+
"aria-labelledby": `${title}_expended_item_id`
|
|
45
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
30
46
|
className: styles.content // eslint-disable-next-line react/no-danger
|
|
31
47
|
,
|
|
32
48
|
dangerouslySetInnerHTML: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","classnames","NovaCompositionNavigationArrowDown","ArrowIcon","propTypes","styles","ICONS","arrow","ExpandableItem","icon","title","isExpended","isLink","content","onClick","image","Icon","expendedContainer","container","header","expendedHeader","expendedIcon","linkIcon","__html"],"sources":["../../../src/molecule/expandable-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowDown as ArrowIcon} from '@coorpacademy/nova-icons';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nexport const ICONS = {\n arrow: ArrowIcon\n};\n\nconst ExpandableItem = ({icon
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","classnames","NovaCompositionNavigationArrowDown","ArrowIcon","propTypes","styles","ICONS","arrow","ExpandableItem","icon","title","isExpended","isLink","content","onClick","image","ariaLabel","Icon","expendedContainer","container","header","expendedHeader","expendedIcon","linkIcon","__html"],"sources":["../../../src/molecule/expandable-item/index.tsx"],"sourcesContent":["import React from 'react';\nimport classnames from 'classnames';\nimport {NovaCompositionNavigationArrowDown as ArrowIcon} from '@coorpacademy/nova-icons';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nexport const ICONS = {\n arrow: ArrowIcon\n};\n\nconst ExpandableItem = ({\n icon,\n title,\n isExpended,\n isLink,\n content,\n onClick,\n image,\n ariaLabel\n}: Props) => {\n const Icon = ICONS[icon];\n return (\n <div className={isExpended ? styles.expendedContainer : styles.container}>\n {isLink ? (\n <a\n className={classnames(styles.header, isExpended ? styles.expendedHeader : null)}\n onClick={onClick}\n aria-label={ariaLabel}\n >\n <h3 className={styles.title}>{title}</h3>\n {Icon ? (\n <Icon\n className={classnames(\n styles.icon,\n isExpended ? styles.expendedIcon : null,\n isLink ? styles.linkIcon : null\n )}\n />\n ) : null}\n </a>\n ) : (\n <div\n className={classnames(styles.header, isExpended ? styles.expendedHeader : null)}\n onClick={onClick}\n id={`${title}_expended_item_id`}\n aria-controls={`${title}_expended_item_aria-controls`}\n aria-expanded={isExpended}\n >\n <h3 className={styles.title}>{title}</h3>\n {Icon ? (\n <Icon\n className={classnames(\n styles.icon,\n isExpended ? styles.expendedIcon : null,\n isLink ? styles.linkIcon : null\n )}\n />\n ) : null}\n </div>\n )}\n {isExpended ? (\n <div\n id={`${title}_expended_item_aria-controls`}\n role=\"region\"\n aria-labelledby={`${title}_expended_item_id`}\n >\n <div\n className={styles.content} // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n {image ? <img className={styles.image} src={image} alt={''} /> : null}\n </div>\n ) : null}\n </div>\n );\n};\n\nExpandableItem.propTypes = propTypes;\nexport default ExpandableItem;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;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,SAAS,EAAEhB,UAAU,CACnBI,MAAM,CAACI,IADY,EAEnBE,UAAU,GAAGN,MAAM,CAACiB,YAAV,GAAyB,IAFhB,EAGnBV,MAAM,GAAGP,MAAM,CAACkB,QAAV,GAAqB,IAHR;EADvB,EADG,GAQD,IAhBN,CAnBJ,EAsCGZ,UAAU,gBACT;IACE,EAAE,EAAG,GAAED,KAAM,8BADf;IAEE,IAAI,EAAC,QAFP;IAGE,mBAAkB,GAAEA,KAAM;EAH5B,gBAKE;IACE,SAAS,EAAEL,MAAM,CAACQ,OADpB,CAC6B;IAD7B;IAEE,uBAAuB,EAAE;MAACW,MAAM,EAAEX;IAAT;EAF3B,EALF,EASGE,KAAK,gBAAG;IAAK,SAAS,EAAEV,MAAM,CAACU,KAAvB;IAA8B,GAAG,EAAEA,KAAnC;IAA0C,GAAG,EAAE;EAA/C,EAAH,GAA2D,IATnE,CADS,GAYP,IAlDN,CADF;AAsDD,CAjED;;AAmEAP,cAAc,CAACJ,SAAf,2CAA2BA,SAA3B;AACA,eAAeI,cAAf"}
|
|
@@ -7,12 +7,14 @@ export declare const propTypes: {
|
|
|
7
7
|
content: PropTypes.Requireable<string>;
|
|
8
8
|
image: PropTypes.Requireable<string>;
|
|
9
9
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
10
11
|
};
|
|
11
12
|
export declare type Props = {
|
|
12
13
|
title: string;
|
|
13
14
|
icon: 'arrow';
|
|
14
15
|
isExpended: boolean;
|
|
15
16
|
content: string;
|
|
17
|
+
ariaLabel?: string;
|
|
16
18
|
isLink?: boolean;
|
|
17
19
|
image?: string;
|
|
18
20
|
onClick: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","propTypes","title","string","icon","oneOf","isExpended","bool","isLink","content","image","onClick","func"],"sources":["../../../src/molecule/expandable-item/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const propTypes = {\n title: PropTypes.string,\n icon: PropTypes.oneOf(['arrow']),\n isExpended: PropTypes.bool,\n isLink: PropTypes.bool,\n content: PropTypes.string,\n image: PropTypes.string,\n onClick: PropTypes.func\n};\n\nexport type Props = {\n title: string;\n icon: 'arrow';\n isExpended: boolean;\n content: string;\n isLink?: boolean;\n image?: string;\n onClick: () => void;\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEF,SAAS,CAACG,MADM;EAEvBC,IAAI,EAAEJ,SAAS,CAACK,KAAV,CAAgB,CAAC,OAAD,CAAhB,CAFiB;EAGvBC,UAAU,EAAEN,SAAS,CAACO,IAHC;EAIvBC,MAAM,EAAER,SAAS,CAACO,IAJK;EAKvBE,OAAO,EAAET,SAAS,CAACG,MALI;EAMvBO,KAAK,EAAEV,SAAS,CAACG,MANM;EAOvBQ,OAAO,EAAEX,SAAS,CAACY;
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","propTypes","title","string","icon","oneOf","isExpended","bool","isLink","content","image","onClick","func","ariaLabel"],"sources":["../../../src/molecule/expandable-item/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const propTypes = {\n title: PropTypes.string,\n icon: PropTypes.oneOf(['arrow']),\n isExpended: PropTypes.bool,\n isLink: PropTypes.bool,\n content: PropTypes.string,\n image: PropTypes.string,\n onClick: PropTypes.func,\n ariaLabel: PropTypes.string\n};\n\nexport type Props = {\n title: string;\n icon: 'arrow';\n isExpended: boolean;\n content: string;\n ariaLabel?: string;\n isLink?: boolean;\n image?: string;\n onClick: () => void;\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEF,SAAS,CAACG,MADM;EAEvBC,IAAI,EAAEJ,SAAS,CAACK,KAAV,CAAgB,CAAC,OAAD,CAAhB,CAFiB;EAGvBC,UAAU,EAAEN,SAAS,CAACO,IAHC;EAIvBC,MAAM,EAAER,SAAS,CAACO,IAJK;EAKvBE,OAAO,EAAET,SAAS,CAACG,MALI;EAMvBO,KAAK,EAAEV,SAAS,CAACG,MANM;EAOvBQ,OAAO,EAAEX,SAAS,CAACY,IAPI;EAQvBC,SAAS,EAAEb,SAAS,CAACG;AARE,CAAlB"}
|
|
@@ -11,6 +11,7 @@ declare const ExpandableList: {
|
|
|
11
11
|
content: import("prop-types").Requireable<string>;
|
|
12
12
|
image: import("prop-types").Requireable<string>;
|
|
13
13
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
ariaLabel: import("prop-types").Requireable<string>;
|
|
14
15
|
}> | null | undefined)[]>;
|
|
15
16
|
};
|
|
16
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-list/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAGzC,QAAA,MAAM,cAAc;gBAAa,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-list/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAGzC,QAAA,MAAM,cAAc;gBAAa,KAAK;;;;;;;;;;;;;CAgBrC,CAAC;AAIF,eAAe,cAAc,CAAC"}
|
|
@@ -9,6 +9,7 @@ export declare const propTypes: {
|
|
|
9
9
|
content: PropTypes.Requireable<string>;
|
|
10
10
|
image: PropTypes.Requireable<string>;
|
|
11
11
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
12
13
|
}> | null | undefined)[]>;
|
|
13
14
|
};
|
|
14
15
|
export declare type Props = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-list/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,KAAK,IAAI,SAAS,EAA6B,MAAM,0BAA0B,CAAC;AAExF,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/expandable-list/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,KAAK,IAAI,SAAS,EAA6B,MAAM,0BAA0B,CAAC;AAExF,eAAO,MAAM,SAAS;;;;;;;;;;;CAErB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC"}
|
|
@@ -16,6 +16,7 @@ declare const MenuLinks: {
|
|
|
16
16
|
text: import("prop-types").Requireable<string>;
|
|
17
17
|
isSelected: import("prop-types").Requireable<boolean>;
|
|
18
18
|
handleOnclick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
19
|
+
ariaLabel: import("prop-types").Requireable<string>;
|
|
19
20
|
}> | null | undefined)[]>;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/menu-links/index.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAWzC,QAAA,MAAM,SAAS;wFAOZ,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/menu-links/index.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAY,KAAK,EAAC,MAAM,SAAS,CAAC;AAWzC,QAAA,MAAM,SAAS;wFAOZ,KAAK;;;;;;;;;;;;;;;;;;CAsEP,CAAC;AAIF,eAAe,SAAS,CAAC"}
|
|
@@ -25,7 +25,7 @@ const MenuLinks = ({
|
|
|
25
25
|
|
|
26
26
|
const handleOnclickShowMore = () => setIsOpen(!isOpen);
|
|
27
27
|
|
|
28
|
-
return /*#__PURE__*/React.createElement("
|
|
28
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
29
29
|
className: styles.container
|
|
30
30
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
31
31
|
className: styles.title
|
|
@@ -54,10 +54,11 @@ const MenuLinks = ({
|
|
|
54
54
|
className: styles.flexContainer
|
|
55
55
|
}, Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
56
56
|
className: classnames(styles.icon, item.isSelected ? styles.selectedIcon : null)
|
|
57
|
-
}) : null,
|
|
57
|
+
}) : null, /*#__PURE__*/React.createElement("a", {
|
|
58
58
|
className: styles.link,
|
|
59
|
-
href: `#menu-link-item-${index}`
|
|
60
|
-
|
|
59
|
+
href: withScroll ? `#menu-link-item-${index}` : undefined,
|
|
60
|
+
"aria-label": item.ariaLabel
|
|
61
|
+
}, Item)));
|
|
61
62
|
}), !isDesktopMode ? /*#__PURE__*/React.createElement("li", {
|
|
62
63
|
// eslint-disable-next-line react/jsx-no-bind
|
|
63
64
|
onClick: handleOnclickShowMore,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useState","classnames","NovaCompositionNavigationArrowDown","ArrowIcon","NovaLinePhoneMobilePhone","MobilePhone","NovaLineMessagesChatChatBubbleCircleQuestionMark","ChatBubbleCircleQuestionMark","NovaLineNetworkNetworkAlert","NetworkAlert","NovaLineObjectsBinoculars","Binoculaire","NovaLineContentEditionContentBook","ContentBook","propTypes","styles","ICONS","mobilePhone","chatBubbleCircleQuestionMark","networkAlert","binoculaire","contentBook","MenuLinks","items","title","showMoreItem","numberOfDisplayedItems","isDesktopMode","withScroll","isOpen","setIsOpen","itemsToDisplay","handleOnclickShowMore","container","list","map","item","index","handleOnclick","Icon","icon","Item","flexContainer","isSelected","selectedItem","undefined","text","arrowIcon","selectedIcon","border","selectedBorder","link","showLessText","showMoreText","showLessIcon","showMoreIcon"],"sources":["../../../src/molecule/menu-links/index.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionNavigationArrowDown as ArrowIcon,\n NovaLinePhoneMobilePhone as MobilePhone,\n NovaLineMessagesChatChatBubbleCircleQuestionMark as ChatBubbleCircleQuestionMark,\n NovaLineNetworkNetworkAlert as NetworkAlert,\n NovaLineObjectsBinoculars as Binoculaire,\n NovaLineContentEditionContentBook as ContentBook\n} from '@coorpacademy/nova-icons';\nimport {slice} from 'lodash/fp';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nconst ICONS = {\n mobilePhone: MobilePhone,\n chatBubbleCircleQuestionMark: ChatBubbleCircleQuestionMark,\n networkAlert: NetworkAlert,\n binoculaire: Binoculaire,\n contentBook: ContentBook\n};\n\nconst MenuLinks = ({\n items,\n title,\n showMoreItem,\n numberOfDisplayedItems,\n isDesktopMode,\n withScroll = false\n}: Props) => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const itemsToDisplay = isDesktopMode || isOpen ? items : slice(0, numberOfDisplayedItems, items);\n const handleOnclickShowMore = () => setIsOpen(!isOpen);\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useState","classnames","NovaCompositionNavigationArrowDown","ArrowIcon","NovaLinePhoneMobilePhone","MobilePhone","NovaLineMessagesChatChatBubbleCircleQuestionMark","ChatBubbleCircleQuestionMark","NovaLineNetworkNetworkAlert","NetworkAlert","NovaLineObjectsBinoculars","Binoculaire","NovaLineContentEditionContentBook","ContentBook","propTypes","styles","ICONS","mobilePhone","chatBubbleCircleQuestionMark","networkAlert","binoculaire","contentBook","MenuLinks","items","title","showMoreItem","numberOfDisplayedItems","isDesktopMode","withScroll","isOpen","setIsOpen","itemsToDisplay","handleOnclickShowMore","container","list","map","item","index","handleOnclick","Icon","icon","Item","flexContainer","isSelected","selectedItem","undefined","text","arrowIcon","selectedIcon","border","selectedBorder","link","ariaLabel","showLessText","showMoreText","showLessIcon","showMoreIcon"],"sources":["../../../src/molecule/menu-links/index.tsx"],"sourcesContent":["import React, {useState} from 'react';\nimport classnames from 'classnames';\nimport {\n NovaCompositionNavigationArrowDown as ArrowIcon,\n NovaLinePhoneMobilePhone as MobilePhone,\n NovaLineMessagesChatChatBubbleCircleQuestionMark as ChatBubbleCircleQuestionMark,\n NovaLineNetworkNetworkAlert as NetworkAlert,\n NovaLineObjectsBinoculars as Binoculaire,\n NovaLineContentEditionContentBook as ContentBook\n} from '@coorpacademy/nova-icons';\nimport {slice} from 'lodash/fp';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nconst ICONS = {\n mobilePhone: MobilePhone,\n chatBubbleCircleQuestionMark: ChatBubbleCircleQuestionMark,\n networkAlert: NetworkAlert,\n binoculaire: Binoculaire,\n contentBook: ContentBook\n};\n\nconst MenuLinks = ({\n items,\n title,\n showMoreItem,\n numberOfDisplayedItems,\n isDesktopMode,\n withScroll = false\n}: Props) => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const itemsToDisplay = isDesktopMode || isOpen ? items : slice(0, numberOfDisplayedItems, items);\n const handleOnclickShowMore = () => setIsOpen(!isOpen);\n\n return (\n <nav className={styles.container}>\n <h2 className={styles.title}>{title}</h2>\n <ul className={styles.list} data-name=\"menu-links\">\n {itemsToDisplay.map((item, index) => {\n const {handleOnclick} = item;\n const Icon = item.icon ? ICONS[item.icon] : null;\n const Item = (\n <div className={styles.flexContainer}>\n <span className={item.isSelected ? styles.selectedItem : undefined}>{item.text}</span>\n {Icon ? (\n <ArrowIcon\n className={classnames(\n styles.arrowIcon,\n item.isSelected ? styles.selectedIcon : null\n )}\n />\n ) : null}\n </div>\n );\n return (\n <li onClick={handleOnclick} key={`menu-link-item-${index}`} className={styles.item}>\n <div\n className={classnames(\n styles.border,\n item.isSelected ? styles.selectedBorder : null\n )}\n />\n <div className={styles.flexContainer}>\n {Icon ? (\n <Icon\n className={classnames(\n styles.icon,\n item.isSelected ? styles.selectedIcon : null\n )}\n />\n ) : null}\n <a\n className={styles.link}\n href={withScroll ? `#menu-link-item-${index}` : undefined}\n aria-label={item.ariaLabel}\n >\n {Item}\n </a>\n </div>\n </li>\n );\n })}\n {!isDesktopMode ? (\n <li\n // eslint-disable-next-line react/jsx-no-bind\n onClick={handleOnclickShowMore}\n key={`menu-link-item-show-more`}\n className={classnames(styles.showMoreItem, styles.item)}\n >\n <div className={styles.border} />\n <span>\n {isOpen ? showMoreItem.showLessText : showMoreItem.showMoreText}\n <ArrowIcon className={isOpen ? styles.showLessIcon : styles.showMoreIcon} />\n </span>\n </li>\n ) : null}\n </ul>\n </nav>\n );\n};\n\nMenuLinks.propTypes = propTypes;\n\nexport default MenuLinks;\n"],"mappings":";AAAA,OAAOA,KAAP,IAAeC,QAAf,QAA8B,OAA9B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SACEC,kCAAkC,IAAIC,SADxC,EAEEC,wBAAwB,IAAIC,WAF9B,EAGE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,GAA+B5B,YAAY,CAAC6B,YADrD,eAEE,oBAAC,SAAD;IAAW,SAAS,EAAEzB,MAAM,GAAGd,MAAM,CAACwC,YAAV,GAAyBxC,MAAM,CAACyC;EAA5D,EAFF,CAPF,CADD,GAaG,IA1DN,CAFF,CADF;AAiED,CA7ED;;AA+EAlC,SAAS,CAACR,SAAV,2CAAsBA,SAAtB;AAEA,eAAeQ,SAAf"}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
.link {
|
|
26
26
|
text-decoration: none;
|
|
27
27
|
color: cm_grey_700;
|
|
28
|
+
flex: 1;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.title {
|
|
@@ -68,9 +69,9 @@
|
|
|
68
69
|
|
|
69
70
|
.flexContainer {
|
|
70
71
|
display: flex;
|
|
71
|
-
justify-content: space-between;
|
|
72
72
|
align-items: center;
|
|
73
73
|
width: 100%;
|
|
74
|
+
justify-content: space-between;
|
|
74
75
|
}
|
|
75
76
|
.border {
|
|
76
77
|
width: 4px;
|
|
@@ -117,7 +118,7 @@
|
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
.selectedItem:hover {
|
|
120
|
-
text-decoration-color: cm_primary_blue
|
|
121
|
+
text-decoration-color: cm_primary_blue;
|
|
121
122
|
color: cm_primary_blue;
|
|
122
123
|
}
|
|
123
124
|
.showMoreIcon {
|
|
@@ -13,11 +13,13 @@ export declare const propTypes: {
|
|
|
13
13
|
text: PropTypes.Requireable<string>;
|
|
14
14
|
isSelected: PropTypes.Requireable<boolean>;
|
|
15
15
|
handleOnclick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
16
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
16
17
|
}> | null | undefined)[]>;
|
|
17
18
|
};
|
|
18
19
|
export declare type Item = {
|
|
19
20
|
text: string;
|
|
20
21
|
isSelected?: boolean;
|
|
22
|
+
ariaLabel?: string;
|
|
21
23
|
handleOnclick: () => void;
|
|
22
24
|
icon?: IconsType;
|
|
23
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/menu-links/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/molecule/menu-links/types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;CAkBrB,CAAC;AAEF,oBAAY,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,SAAS,GACjB,aAAa,GACb,8BAA8B,GAC9B,cAAc,GACd,aAAa,GACb,aAAa,CAAC;AAElB,oBAAY,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,YAAY,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC"}
|
|
@@ -12,7 +12,8 @@ export const propTypes = {
|
|
|
12
12
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
13
13
|
text: PropTypes.string,
|
|
14
14
|
isSelected: PropTypes.bool,
|
|
15
|
-
handleOnclick: PropTypes.func
|
|
15
|
+
handleOnclick: PropTypes.func,
|
|
16
|
+
ariaLabel: PropTypes.string
|
|
16
17
|
}))
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["PropTypes","propTypes","title","string","numberOfDisplayedItems","number","isDesktopMode","bool","withScroll","showMoreItem","shape","showMoreText","showLessText","isSelected","items","arrayOf","text","handleOnclick","func"],"sources":["../../../src/molecule/menu-links/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const propTypes = {\n title: PropTypes.string,\n numberOfDisplayedItems: PropTypes.number,\n isDesktopMode: PropTypes.bool,\n withScroll: PropTypes.bool,\n showMoreItem: PropTypes.shape({\n showMoreText: PropTypes.string,\n showLessText: PropTypes.string,\n isSelected: PropTypes.bool\n }),\n items: PropTypes.arrayOf(\n PropTypes.shape({\n text: PropTypes.string,\n isSelected: PropTypes.bool,\n handleOnclick: PropTypes.func\n })\n )\n};\n\nexport type Item = {\n text: string;\n isSelected?: boolean;\n handleOnclick: () => void;\n icon?: IconsType;\n};\n\nexport type ShowMoreItem = {\n showMoreText: string;\n showLessText: string;\n};\n\nexport type IconsType =\n | 'mobilePhone'\n | 'chatBubbleCircleQuestionMark'\n | 'networkAlert'\n | 'binoculaire'\n | 'contentBook';\n\nexport type Props = {\n title: string;\n isDesktopMode: boolean;\n withScroll?: boolean;\n showMoreItem: ShowMoreItem;\n numberOfDisplayedItems: number;\n items: Item[];\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEF,SAAS,CAACG,MADM;EAEvBC,sBAAsB,EAAEJ,SAAS,CAACK,MAFX;EAGvBC,aAAa,EAAEN,SAAS,CAACO,IAHF;EAIvBC,UAAU,EAAER,SAAS,CAACO,IAJC;EAKvBE,YAAY,EAAET,SAAS,CAACU,KAAV,CAAgB;IAC5BC,YAAY,EAAEX,SAAS,CAACG,MADI;IAE5BS,YAAY,EAAEZ,SAAS,CAACG,MAFI;IAG5BU,UAAU,EAAEb,SAAS,CAACO;EAHM,CAAhB,CALS;EAUvBO,KAAK,EAAEd,SAAS,CAACe,OAAV,CACLf,SAAS,CAACU,KAAV,CAAgB;IACdM,IAAI,EAAEhB,SAAS,CAACG,MADF;IAEdU,UAAU,EAAEb,SAAS,CAACO,IAFR;IAGdU,aAAa,EAAEjB,SAAS,CAACkB;
|
|
1
|
+
{"version":3,"file":"types.js","names":["PropTypes","propTypes","title","string","numberOfDisplayedItems","number","isDesktopMode","bool","withScroll","showMoreItem","shape","showMoreText","showLessText","isSelected","items","arrayOf","text","handleOnclick","func","ariaLabel"],"sources":["../../../src/molecule/menu-links/types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const propTypes = {\n title: PropTypes.string,\n numberOfDisplayedItems: PropTypes.number,\n isDesktopMode: PropTypes.bool,\n withScroll: PropTypes.bool,\n showMoreItem: PropTypes.shape({\n showMoreText: PropTypes.string,\n showLessText: PropTypes.string,\n isSelected: PropTypes.bool\n }),\n items: PropTypes.arrayOf(\n PropTypes.shape({\n text: PropTypes.string,\n isSelected: PropTypes.bool,\n handleOnclick: PropTypes.func,\n ariaLabel: PropTypes.string\n })\n )\n};\n\nexport type Item = {\n text: string;\n isSelected?: boolean;\n ariaLabel?: string;\n handleOnclick: () => void;\n icon?: IconsType;\n};\n\nexport type ShowMoreItem = {\n showMoreText: string;\n showLessText: string;\n};\n\nexport type IconsType =\n | 'mobilePhone'\n | 'chatBubbleCircleQuestionMark'\n | 'networkAlert'\n | 'binoculaire'\n | 'contentBook';\n\nexport type Props = {\n title: string;\n isDesktopMode: boolean;\n withScroll?: boolean;\n showMoreItem: ShowMoreItem;\n numberOfDisplayedItems: number;\n items: Item[];\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,OAAO,MAAMC,SAAS,GAAG;EACvBC,KAAK,EAAEF,SAAS,CAACG,MADM;EAEvBC,sBAAsB,EAAEJ,SAAS,CAACK,MAFX;EAGvBC,aAAa,EAAEN,SAAS,CAACO,IAHF;EAIvBC,UAAU,EAAER,SAAS,CAACO,IAJC;EAKvBE,YAAY,EAAET,SAAS,CAACU,KAAV,CAAgB;IAC5BC,YAAY,EAAEX,SAAS,CAACG,MADI;IAE5BS,YAAY,EAAEZ,SAAS,CAACG,MAFI;IAG5BU,UAAU,EAAEb,SAAS,CAACO;EAHM,CAAhB,CALS;EAUvBO,KAAK,EAAEd,SAAS,CAACe,OAAV,CACLf,SAAS,CAACU,KAAV,CAAgB;IACdM,IAAI,EAAEhB,SAAS,CAACG,MADF;IAEdU,UAAU,EAAEb,SAAS,CAACO,IAFR;IAGdU,aAAa,EAAEjB,SAAS,CAACkB,IAHX;IAIdC,SAAS,EAAEnB,SAAS,CAACG;EAJP,CAAhB,CADK;AAVgB,CAAlB"}
|
|
@@ -12,7 +12,7 @@ const PrivacyPolicyContact = ({
|
|
|
12
12
|
}) => {
|
|
13
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
14
|
className: styles.container
|
|
15
|
-
}, /*#__PURE__*/React.createElement("
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
className: styles.title // eslint-disable-next-line react/no-danger
|
|
17
17
|
,
|
|
18
18
|
dangerouslySetInnerHTML: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","NovaCompositionNavigationArrowDown","ArrowIcon","propTypes","styles","ICONS","arrow","PrivacyPolicyContact","title","content","container","__html"],"sources":["../../../src/molecule/privacy-policy-contact/index.tsx"],"sourcesContent":["import React from 'react';\nimport {NovaCompositionNavigationArrowDown as ArrowIcon} from '@coorpacademy/nova-icons';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nexport const ICONS = {\n arrow: ArrowIcon\n};\n\nconst PrivacyPolicyContact = ({title, content}: Props) => {\n return (\n <div className={styles.container}>\n <
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","NovaCompositionNavigationArrowDown","ArrowIcon","propTypes","styles","ICONS","arrow","PrivacyPolicyContact","title","content","container","__html"],"sources":["../../../src/molecule/privacy-policy-contact/index.tsx"],"sourcesContent":["import React from 'react';\nimport {NovaCompositionNavigationArrowDown as ArrowIcon} from '@coorpacademy/nova-icons';\nimport {propTypes, Props} from './types';\nimport styles from './style.css';\n\nexport const ICONS = {\n arrow: ArrowIcon\n};\n\nconst PrivacyPolicyContact = ({title, content}: Props) => {\n return (\n <div className={styles.container}>\n <div\n className={styles.title}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: title}}\n />\n <p className={styles.content}>{content}</p>\n </div>\n );\n};\n\nPrivacyPolicyContact.propTypes = propTypes;\n\nexport default PrivacyPolicyContact;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,SAAQC,SAAR,QAA+B,SAA/B;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,OAAO,MAAMC,KAAK,GAAG;EACnBC,KAAK,EAAEJ;AADY,CAAd;;AAIP,MAAMK,oBAAoB,GAAG,CAAC;EAACC,KAAD;EAAQC;AAAR,CAAD,KAA6B;EACxD,oBACE;IAAK,SAAS,EAAEL,MAAM,CAACM;EAAvB,gBACE;IACE,SAAS,EAAEN,MAAM,CAACI,KADpB,CAEE;IAFF;IAGE,uBAAuB,EAAE;MAACG,MAAM,EAAEH;IAAT;EAH3B,EADF,eAME;IAAG,SAAS,EAAEJ,MAAM,CAACK;EAArB,GAA+BA,OAA/B,CANF,CADF;AAUD,CAXD;;AAaAF,oBAAoB,CAACJ,SAArB,2CAAiCA,SAAjC;AAEA,eAAeI,oBAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/select-multiple/index.js"],"names":[],"mappings":"AAsBO,oEAcN;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/select-multiple/index.js"],"names":[],"mappings":"AAsBO,oEAcN;;AAwBD;;;;;;;;;;;;;;;gBAoLC"}
|
|
@@ -47,10 +47,8 @@ const CMMultipleView = ({
|
|
|
47
47
|
choice,
|
|
48
48
|
onChange
|
|
49
49
|
}) => {
|
|
50
|
-
const handleChange = useCallback(
|
|
51
|
-
return onChange(
|
|
52
|
-
selected: checked
|
|
53
|
-
}));
|
|
50
|
+
const handleChange = useCallback(() => {
|
|
51
|
+
return onChange(choice);
|
|
54
52
|
}, [onChange, choice]);
|
|
55
53
|
return multiple ? /*#__PURE__*/React.createElement("div", {
|
|
56
54
|
className: style.item
|