@coorpacademy/components 11.14.1-alpha.2 → 11.14.1-alpha.28
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/button/index.d.ts.map +1 -1
- package/es/atom/button/index.js +13 -18
- package/es/atom/button/index.js.map +1 -1
- package/es/molecule/cm-popin/index.d.ts.map +1 -1
- package/es/molecule/cm-popin/index.js +4 -5
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +40 -61
- package/es/molecule/expandable-item/index.d.ts +19 -0
- package/es/molecule/expandable-item/index.d.ts.map +1 -0
- package/es/molecule/expandable-item/index.js +44 -0
- package/es/molecule/expandable-item/index.js.map +1 -0
- package/es/molecule/expandable-item/style.css +135 -0
- package/es/molecule/expandable-item/types.d.ts +20 -0
- package/es/molecule/expandable-item/types.d.ts.map +1 -0
- package/es/molecule/expandable-item/types.js +11 -0
- package/es/molecule/expandable-item/types.js.map +1 -0
- package/es/molecule/expandable-list/index.d.ts +18 -0
- package/es/molecule/expandable-list/index.d.ts.map +1 -0
- package/es/molecule/expandable-list/index.js +22 -0
- package/es/molecule/expandable-list/index.js.map +1 -0
- package/es/molecule/expandable-list/style.css +20 -0
- package/es/molecule/expandable-list/types.d.ts +17 -0
- package/es/molecule/expandable-list/types.d.ts.map +1 -0
- package/es/molecule/expandable-list/types.js +6 -0
- package/es/molecule/expandable-list/types.js.map +1 -0
- package/es/molecule/hero/index.d.ts +30 -26
- package/es/molecule/hero/index.d.ts.map +1 -1
- package/es/molecule/hero/index.js +14 -13
- package/es/molecule/hero/index.js.map +1 -1
- package/es/molecule/hero/style.css +42 -0
- package/es/molecule/hero/types.d.ts +22 -0
- package/es/molecule/hero/types.d.ts.map +1 -0
- package/es/molecule/hero/types.js +14 -0
- package/es/molecule/hero/types.js.map +1 -0
- package/es/molecule/menu-links/index.d.ts +22 -0
- package/es/molecule/menu-links/index.d.ts.map +1 -0
- package/es/molecule/menu-links/index.js +70 -0
- package/es/molecule/menu-links/index.js.map +1 -0
- package/es/molecule/menu-links/style.css +161 -0
- package/es/molecule/menu-links/types.d.ts +35 -0
- package/es/molecule/menu-links/types.d.ts.map +1 -0
- package/es/molecule/menu-links/types.js +17 -0
- package/es/molecule/menu-links/types.js.map +1 -0
- package/es/molecule/privacy-policy-contact/index.d.ts +14 -0
- package/es/molecule/privacy-policy-contact/index.d.ts.map +1 -0
- package/es/molecule/privacy-policy-contact/index.js +28 -0
- package/es/molecule/privacy-policy-contact/index.js.map +1 -0
- package/es/molecule/privacy-policy-contact/style.css +38 -0
- package/es/molecule/privacy-policy-contact/types.d.ts +10 -0
- package/es/molecule/privacy-policy-contact/types.d.ts.map +1 -0
- package/es/molecule/privacy-policy-contact/types.js +6 -0
- package/es/molecule/privacy-policy-contact/types.js.map +1 -0
- package/es/molecule/privacy-policy-download/index.d.ts +38 -0
- package/es/molecule/privacy-policy-download/index.d.ts.map +1 -0
- package/es/molecule/privacy-policy-download/index.js +27 -0
- package/es/molecule/privacy-policy-download/index.js.map +1 -0
- package/es/molecule/privacy-policy-download/style.css +65 -0
- package/es/molecule/privacy-policy-download/types.d.ts +50 -0
- package/es/molecule/privacy-policy-download/types.d.ts.map +1 -0
- package/es/molecule/privacy-policy-download/types.js +8 -0
- package/es/molecule/privacy-policy-download/types.js.map +1 -0
- package/es/molecule/quick-access-card/index.d.ts +1 -0
- package/es/molecule/quick-access-card/index.d.ts.map +1 -1
- package/es/molecule/quick-access-card/index.js +77 -21
- package/es/molecule/quick-access-card/index.js.map +1 -1
- package/es/molecule/quick-access-card/style.css +28 -17
- package/es/molecule/quick-access-cards-group/index.d.ts +1 -0
- package/es/organism/brand-dashboard/index.d.ts +1 -0
- package/es/template/back-office/brand-update/index.d.ts +1 -0
- package/es/template/common/faq-article-page/index.d.ts +27 -0
- package/es/template/common/faq-article-page/index.d.ts.map +1 -0
- package/es/template/common/faq-article-page/index.js +50 -0
- package/es/template/common/faq-article-page/index.js.map +1 -0
- package/es/template/common/faq-article-page/style.css +110 -0
- package/es/template/common/faq-article-page/types.d.ts +40 -0
- package/es/template/common/faq-article-page/types.d.ts.map +1 -0
- package/es/template/common/faq-article-page/types.js +20 -0
- package/es/template/common/faq-article-page/types.js.map +1 -0
- package/es/template/common/faq-cards-page/index.d.ts +33 -0
- package/es/template/common/faq-cards-page/index.d.ts.map +1 -0
- package/es/template/common/faq-cards-page/index.js +45 -0
- package/es/template/common/faq-cards-page/index.js.map +1 -0
- package/es/template/common/faq-cards-page/style.css +95 -0
- package/es/template/common/faq-cards-page/types.d.ts +42 -0
- package/es/template/common/faq-cards-page/types.d.ts.map +1 -0
- package/es/template/common/faq-cards-page/types.js +12 -0
- package/es/template/common/faq-cards-page/types.js.map +1 -0
- package/es/template/common/faq-page/index.d.ts +80 -0
- package/es/template/common/faq-page/index.d.ts.map +1 -0
- package/es/template/common/faq-page/index.js +44 -0
- package/es/template/common/faq-page/index.js.map +1 -0
- package/es/template/common/faq-page/style.css +104 -0
- package/es/template/common/faq-page/types.d.ts +86 -0
- package/es/template/common/faq-page/types.d.ts.map +1 -0
- package/es/template/common/faq-page/types.js +13 -0
- package/es/template/common/faq-page/types.js.map +1 -0
- package/es/template/common/privacy-policy-page/index.d.ts +80 -0
- package/es/template/common/privacy-policy-page/index.d.ts.map +1 -0
- package/es/template/common/privacy-policy-page/index.js +50 -0
- package/es/template/common/privacy-policy-page/index.js.map +1 -0
- package/es/template/common/privacy-policy-page/style.css +123 -0
- package/es/template/common/privacy-policy-page/types.d.ts +86 -0
- package/es/template/common/privacy-policy-page/types.d.ts.map +1 -0
- package/es/template/common/privacy-policy-page/types.js +13 -0
- package/es/template/common/privacy-policy-page/types.js.map +1 -0
- package/es/template/external-course/index.d.ts +21 -69
- package/es/template/external-course/index.d.ts.map +1 -1
- package/es/template/external-course/index.js +56 -73
- package/es/template/external-course/index.js.map +1 -1
- package/es/template/external-course/style.css +1 -1
- package/es/util/button-icons.d.ts +1 -0
- package/es/util/button-icons.d.ts.map +1 -1
- package/es/util/button-icons.js +3 -2
- package/es/util/button-icons.js.map +1 -1
- package/es/variables/breakpoints.css +1 -1
- package/lib/atom/button/index.d.ts.map +1 -1
- package/lib/atom/button/index.js +13 -18
- package/lib/atom/button/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.d.ts.map +1 -1
- package/lib/molecule/cm-popin/index.js +3 -4
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +40 -61
- package/lib/molecule/expandable-item/index.d.ts +19 -0
- package/lib/molecule/expandable-item/index.d.ts.map +1 -0
- package/lib/molecule/expandable-item/index.js +58 -0
- package/lib/molecule/expandable-item/index.js.map +1 -0
- package/lib/molecule/expandable-item/style.css +135 -0
- package/lib/molecule/expandable-item/types.d.ts +20 -0
- package/lib/molecule/expandable-item/types.d.ts.map +1 -0
- package/lib/molecule/expandable-item/types.js +20 -0
- package/lib/molecule/expandable-item/types.js.map +1 -0
- package/lib/molecule/expandable-list/index.d.ts +18 -0
- package/lib/molecule/expandable-list/index.d.ts.map +1 -0
- package/lib/molecule/expandable-list/index.js +33 -0
- package/lib/molecule/expandable-list/index.js.map +1 -0
- package/lib/molecule/expandable-list/style.css +20 -0
- package/lib/molecule/expandable-list/types.d.ts +17 -0
- package/lib/molecule/expandable-list/types.d.ts.map +1 -0
- package/lib/molecule/expandable-list/types.js +16 -0
- package/lib/molecule/expandable-list/types.js.map +1 -0
- package/lib/molecule/hero/index.d.ts +30 -26
- package/lib/molecule/hero/index.d.ts.map +1 -1
- package/lib/molecule/hero/index.js +15 -14
- package/lib/molecule/hero/index.js.map +1 -1
- package/lib/molecule/hero/style.css +42 -0
- package/lib/molecule/hero/types.d.ts +22 -0
- package/lib/molecule/hero/types.d.ts.map +1 -0
- package/lib/molecule/hero/types.js +25 -0
- package/lib/molecule/hero/types.js.map +1 -0
- package/lib/molecule/menu-links/index.d.ts +22 -0
- package/lib/molecule/menu-links/index.d.ts.map +1 -0
- package/lib/molecule/menu-links/index.js +88 -0
- package/lib/molecule/menu-links/index.js.map +1 -0
- package/lib/molecule/menu-links/style.css +161 -0
- package/lib/molecule/menu-links/types.d.ts +35 -0
- package/lib/molecule/menu-links/types.d.ts.map +1 -0
- package/lib/molecule/menu-links/types.js +26 -0
- package/lib/molecule/menu-links/types.js.map +1 -0
- package/lib/molecule/privacy-policy-contact/index.d.ts +14 -0
- package/lib/molecule/privacy-policy-contact/index.d.ts.map +1 -0
- package/lib/molecule/privacy-policy-contact/index.js +41 -0
- package/lib/molecule/privacy-policy-contact/index.js.map +1 -0
- package/lib/molecule/privacy-policy-contact/style.css +38 -0
- package/lib/molecule/privacy-policy-contact/types.d.ts +10 -0
- package/lib/molecule/privacy-policy-contact/types.d.ts.map +1 -0
- package/lib/molecule/privacy-policy-contact/types.js +15 -0
- package/lib/molecule/privacy-policy-contact/types.js.map +1 -0
- package/lib/molecule/privacy-policy-download/index.d.ts +38 -0
- package/lib/molecule/privacy-policy-download/index.d.ts.map +1 -0
- package/lib/molecule/privacy-policy-download/index.js +38 -0
- package/lib/molecule/privacy-policy-download/index.js.map +1 -0
- package/lib/molecule/privacy-policy-download/style.css +65 -0
- package/lib/molecule/privacy-policy-download/types.d.ts +50 -0
- package/lib/molecule/privacy-policy-download/types.d.ts.map +1 -0
- package/lib/molecule/privacy-policy-download/types.js +18 -0
- package/lib/molecule/privacy-policy-download/types.js.map +1 -0
- package/lib/molecule/quick-access-card/index.d.ts +1 -0
- package/lib/molecule/quick-access-card/index.d.ts.map +1 -1
- package/lib/molecule/quick-access-card/index.js +76 -20
- package/lib/molecule/quick-access-card/index.js.map +1 -1
- package/lib/molecule/quick-access-card/style.css +28 -17
- package/lib/molecule/quick-access-cards-group/index.d.ts +1 -0
- package/lib/organism/brand-dashboard/index.d.ts +1 -0
- package/lib/template/back-office/brand-update/index.d.ts +1 -0
- package/lib/template/common/faq-article-page/index.d.ts +27 -0
- package/lib/template/common/faq-article-page/index.d.ts.map +1 -0
- package/lib/template/common/faq-article-page/index.js +63 -0
- package/lib/template/common/faq-article-page/index.js.map +1 -0
- package/lib/template/common/faq-article-page/style.css +110 -0
- package/lib/template/common/faq-article-page/types.d.ts +40 -0
- package/lib/template/common/faq-article-page/types.d.ts.map +1 -0
- package/lib/template/common/faq-article-page/types.js +30 -0
- package/lib/template/common/faq-article-page/types.js.map +1 -0
- package/lib/template/common/faq-cards-page/index.d.ts +33 -0
- package/lib/template/common/faq-cards-page/index.d.ts.map +1 -0
- package/lib/template/common/faq-cards-page/index.js +58 -0
- package/lib/template/common/faq-cards-page/index.js.map +1 -0
- package/lib/template/common/faq-cards-page/style.css +95 -0
- package/lib/template/common/faq-cards-page/types.d.ts +42 -0
- package/lib/template/common/faq-cards-page/types.d.ts.map +1 -0
- package/lib/template/common/faq-cards-page/types.js +24 -0
- package/lib/template/common/faq-cards-page/types.js.map +1 -0
- package/lib/template/common/faq-page/index.d.ts +80 -0
- package/lib/template/common/faq-page/index.d.ts.map +1 -0
- package/lib/template/common/faq-page/index.js +58 -0
- package/lib/template/common/faq-page/index.js.map +1 -0
- package/lib/template/common/faq-page/style.css +104 -0
- package/lib/template/common/faq-page/types.d.ts +86 -0
- package/lib/template/common/faq-page/types.d.ts.map +1 -0
- package/lib/template/common/faq-page/types.js +24 -0
- package/lib/template/common/faq-page/types.js.map +1 -0
- package/lib/template/common/privacy-policy-page/index.d.ts +80 -0
- package/lib/template/common/privacy-policy-page/index.d.ts.map +1 -0
- package/lib/template/common/privacy-policy-page/index.js +65 -0
- package/lib/template/common/privacy-policy-page/index.js.map +1 -0
- package/lib/template/common/privacy-policy-page/style.css +123 -0
- package/lib/template/common/privacy-policy-page/types.d.ts +86 -0
- package/lib/template/common/privacy-policy-page/types.d.ts.map +1 -0
- package/lib/template/common/privacy-policy-page/types.js +24 -0
- package/lib/template/common/privacy-policy-page/types.js.map +1 -0
- package/lib/template/external-course/index.d.ts +21 -69
- package/lib/template/external-course/index.d.ts.map +1 -1
- package/lib/template/external-course/index.js +54 -76
- package/lib/template/external-course/index.js.map +1 -1
- package/lib/template/external-course/style.css +1 -1
- package/lib/util/button-icons.d.ts +1 -0
- package/lib/util/button-icons.d.ts.map +1 -1
- package/lib/util/button-icons.js +2 -1
- package/lib/util/button-icons.js.map +1 -1
- package/lib/variables/breakpoints.css +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/atom/button/index.js"],"names":[],"mappings":";AA0IA,iDAgCC"}
|
package/es/atom/button/index.js
CHANGED
|
@@ -48,8 +48,7 @@ const ButtonContent = props => {
|
|
|
48
48
|
target: target,
|
|
49
49
|
className: anchorClassName,
|
|
50
50
|
style: style,
|
|
51
|
-
"aria-label": ariaLabel
|
|
52
|
-
"data-testid": dataTestid
|
|
51
|
+
"aria-label": ariaLabel
|
|
53
52
|
}, submitValue || children || 'submit');
|
|
54
53
|
|
|
55
54
|
case 'a':
|
|
@@ -59,8 +58,7 @@ const ButtonContent = props => {
|
|
|
59
58
|
target: target,
|
|
60
59
|
className: anchorClassName,
|
|
61
60
|
onClick: anchorOnClick,
|
|
62
|
-
style: style
|
|
63
|
-
"data-testid": dataTestid
|
|
61
|
+
style: style
|
|
64
62
|
}, submitValue || children);
|
|
65
63
|
|
|
66
64
|
case 'button':
|
|
@@ -84,20 +82,17 @@ const ButtonContent = props => {
|
|
|
84
82
|
// falls through in case type is button BUT no button tag is needed, for retro-compatibility
|
|
85
83
|
|
|
86
84
|
default:
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, style)
|
|
99
|
-
});
|
|
100
|
-
}
|
|
85
|
+
return /*#__PURE__*/React.createElement("input", {
|
|
86
|
+
"data-name": dataName,
|
|
87
|
+
type: type,
|
|
88
|
+
value: submitValue,
|
|
89
|
+
disabled: disabled,
|
|
90
|
+
onClick: onClick,
|
|
91
|
+
className: inputClassName,
|
|
92
|
+
style: _extends({
|
|
93
|
+
color
|
|
94
|
+
}, style)
|
|
95
|
+
});
|
|
101
96
|
}
|
|
102
97
|
};
|
|
103
98
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","noop","ColorPropType","Link","cssStyle","ButtonContent","props","color","submitValue","disabled","download","href","target","onClick","className","children","type","style","dataName","ariaLabel","dataTestid","useButtonTag","buttonRef","dataFor","dataTooltipPlace","dataTip","onKeyDown","onMouseLeave","onMouseOver","anchorClassName","disabledAnchor","anchorOnClick","anchorHref","inputClassName","buttonDisabled","favorite","propTypes","string","bool","oneOf","node","shape","func","Button","buttonContentClassName","isLinkDisabled","useWrapper","buttonWrapperClassNames","button","contentClassName","buttonContent"],"sources":["../../../src/atom/button/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport noop from 'lodash/fp/noop';\nimport {ColorPropType} from '../../util/proptypes';\nimport Link from '../link';\nimport cssStyle from './style.css';\n\nconst ButtonContent = props => {\n const {\n color,\n submitValue,\n disabled,\n download,\n href,\n target,\n onClick,\n className,\n children,\n type,\n style,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestid,\n useButtonTag,\n buttonRef,\n 'data-for': dataFor,\n 'data-tooltip-place': dataTooltipPlace,\n 'data-tip': dataTip,\n onKeyDown = noop,\n onMouseLeave = noop,\n onMouseOver = noop\n } = props;\n const anchorClassName = (disabled && `${className} ${cssStyle.disabledAnchor}`) || className;\n const anchorOnClick = (disabled && null) || onClick;\n const anchorHref = (disabled && null) || href;\n const inputClassName = (disabled && `${className} ${cssStyle.buttonDisabled}`) || className;\n\n switch (type) {\n case 'link':\n return (\n <Link\n data-name={dataName}\n href={anchorHref}\n download={download}\n onClick={anchorOnClick}\n target={target}\n className={anchorClassName}\n style={style}\n aria-label={ariaLabel}\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","useMemo","PropTypes","classnames","noop","ColorPropType","Link","cssStyle","ButtonContent","props","color","submitValue","disabled","download","href","target","onClick","className","children","type","style","dataName","ariaLabel","dataTestid","useButtonTag","buttonRef","dataFor","dataTooltipPlace","dataTip","onKeyDown","onMouseLeave","onMouseOver","anchorClassName","disabledAnchor","anchorOnClick","anchorHref","inputClassName","buttonDisabled","favorite","propTypes","string","bool","oneOf","node","shape","func","Button","buttonContentClassName","isLinkDisabled","useWrapper","buttonWrapperClassNames","button","contentClassName","buttonContent"],"sources":["../../../src/atom/button/index.js"],"sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport noop from 'lodash/fp/noop';\nimport {ColorPropType} from '../../util/proptypes';\nimport Link from '../link';\nimport cssStyle from './style.css';\n\nconst ButtonContent = props => {\n const {\n color,\n submitValue,\n disabled,\n download,\n href,\n target,\n onClick,\n className,\n children,\n type,\n style,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n 'data-testid': dataTestid,\n useButtonTag,\n buttonRef,\n 'data-for': dataFor,\n 'data-tooltip-place': dataTooltipPlace,\n 'data-tip': dataTip,\n onKeyDown = noop,\n onMouseLeave = noop,\n onMouseOver = noop\n } = props;\n const anchorClassName = (disabled && `${className} ${cssStyle.disabledAnchor}`) || className;\n const anchorOnClick = (disabled && null) || onClick;\n const anchorHref = (disabled && null) || href;\n const inputClassName = (disabled && `${className} ${cssStyle.buttonDisabled}`) || className;\n\n switch (type) {\n case 'link':\n return (\n <Link\n data-name={dataName}\n href={anchorHref}\n download={download}\n onClick={anchorOnClick}\n target={target}\n className={anchorClassName}\n style={style}\n aria-label={ariaLabel}\n >\n {submitValue || children || 'submit'}\n </Link>\n );\n\n case 'a':\n return (\n <a\n data-name={dataName}\n href={anchorHref}\n target={target}\n className={anchorClassName}\n onClick={anchorOnClick}\n style={style}\n >\n {submitValue || children}\n </a>\n );\n\n case 'button':\n if (useButtonTag)\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n data-for={dataFor}\n data-tooltip-place={dataTooltipPlace}\n data-tip={dataTip}\n data-name={dataName}\n data-testid={dataTestid}\n aria-label={ariaLabel.favorite}\n className={className}\n onClick={onClick}\n style={style}\n onKeyDown={onKeyDown}\n onMouseLeave={onMouseLeave}\n onMouseOver={onMouseOver}\n tabIndex={0}\n >\n {children}\n </button>\n );\n // falls through in case type is button BUT no button tag is needed, for retro-compatibility\n default:\n return (\n <input\n data-name={dataName}\n type={type}\n value={submitValue}\n disabled={disabled}\n onClick={onClick}\n className={inputClassName}\n style={{\n color,\n ...style\n }}\n />\n );\n }\n};\n\nButtonContent.propTypes = {\n color: ColorPropType,\n submitValue: PropTypes.string,\n disabled: PropTypes.bool,\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),\n type: PropTypes.string,\n children: PropTypes.node,\n className: PropTypes.string,\n style: PropTypes.shape({}),\n 'data-name': PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-testid': PropTypes.string,\n useButtonTag: PropTypes.bool,\n // event handlers\n onClick: PropTypes.func,\n onKeyDown: PropTypes.func,\n onMouseLeave: PropTypes.func,\n onMouseOver: PropTypes.func,\n // for ReactTooltip handling\n buttonRef: PropTypes.shape({}),\n 'data-for': PropTypes.string,\n 'data-tooltip-place': PropTypes.string,\n 'data-tip': PropTypes.bool\n};\n\nconst Button = props => {\n const {\n className,\n buttonContentClassName,\n isLinkDisabled,\n type = 'submit',\n children,\n useWrapper = true\n } = props;\n const buttonWrapperClassNames = useMemo(\n () =>\n (isLinkDisabled && classnames([cssStyle.disabledAnchor, className])) ||\n classnames([cssStyle.button, className]),\n [className, isLinkDisabled]\n );\n\n const contentClassName = useMemo(\n () => (buttonContentClassName ? buttonContentClassName : cssStyle.buttonContent),\n [buttonContentClassName]\n );\n\n return useWrapper ? (\n <div className={buttonWrapperClassNames}>\n <ButtonContent {...props} type={type} className={contentClassName}>\n {children}\n </ButtonContent>\n </div>\n ) : (\n <ButtonContent {...props} type={type} className={contentClassName}>\n {children}\n </ButtonContent>\n );\n};\n\nButton.propTypes = {\n isLinkDisabled: PropTypes.bool,\n useWrapper: PropTypes.bool,\n buttonContentClassName: PropTypes.string,\n ...ButtonContent.propTypes\n};\n\nexport default Button;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;AACA,SAAQC,aAAR,QAA4B,sBAA5B;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,QAAP,MAAqB,aAArB;;AAEA,MAAMC,aAAa,GAAGC,KAAK,IAAI;EAC7B,MAAM;IACJC,KADI;IAEJC,WAFI;IAGJC,QAHI;IAIJC,QAJI;IAKJC,IALI;IAMJC,MANI;IAOJC,OAPI;IAQJC,SARI;IASJC,QATI;IAUJC,IAVI;IAWJC,KAXI;IAYJ,aAAaC,QAZT;IAaJ,cAAcC,SAbV;IAcJ,eAAeC,UAdX;IAeJC,YAfI;IAgBJC,SAhBI;IAiBJ,YAAYC,OAjBR;IAkBJ,sBAAsBC,gBAlBlB;IAmBJ,YAAYC,OAnBR;IAoBJC,SAAS,GAAGzB,IApBR;IAqBJ0B,YAAY,GAAG1B,IArBX;IAsBJ2B,WAAW,GAAG3B;EAtBV,IAuBFK,KAvBJ;EAwBA,MAAMuB,eAAe,GAAIpB,QAAQ,IAAK,GAAEK,SAAU,IAAGV,QAAQ,CAAC0B,cAAe,EAArD,IAA2DhB,SAAnF;EACA,MAAMiB,aAAa,GAAItB,QAAQ,IAAI,IAAb,IAAsBI,OAA5C;EACA,MAAMmB,UAAU,GAAIvB,QAAQ,IAAI,IAA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G,QAJH;IAKJD,QALI;IAMJ+B,UAAU,GAAG;EANT,IAOFxC,KAPJ;EAQA,MAAMyC,uBAAuB,GAAGjD,OAAO,CACrC,MACG+C,cAAc,IAAI7C,UAAU,CAAC,CAACI,QAAQ,CAAC0B,cAAV,EAA0BhB,SAA1B,CAAD,CAA7B,IACAd,UAAU,CAAC,CAACI,QAAQ,CAAC4C,MAAV,EAAkBlC,SAAlB,CAAD,CAHyB,EAIrC,CAACA,SAAD,EAAY+B,cAAZ,CAJqC,CAAvC;EAOA,MAAMI,gBAAgB,GAAGnD,OAAO,CAC9B,MAAO8C,sBAAsB,GAAGA,sBAAH,GAA4BxC,QAAQ,CAAC8C,aADpC,EAE9B,CAACN,sBAAD,CAF8B,CAAhC;EAKA,OAAOE,UAAU,gBACf;IAAK,SAAS,EAAEC;EAAhB,gBACE,oBAAC,aAAD,eAAmBzC,KAAnB;IAA0B,IAAI,EAAEU,IAAhC;IAAsC,SAAS,EAAEiC;EAAjD,IACGlC,QADH,CADF,CADe,gBAOf,oBAAC,aAAD,eAAmBT,KAAnB;IAA0B,IAAI,EAAEU,IAAhC;IAAsC,SAAS,EAAEiC;EAAjD,IACGlC,QADH,CAPF;AAWD,CAhCD;;AAkCA4B,MAAM,CAACP,SAAP;EACES,cAAc,EAAE9C,SAAS,CAACuC,IAD5B;EAEEQ,UAAU,EAAE/C,SAAS,CAACuC,IAFxB;EAGEM,sBAAsB,EAAE7C,SAAS,CAACsC;AAHpC,GAIKhC,aAAa,CAAC+B,SAJnB;AAOA,eAAeO,MAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/cm-popin/index.js"],"names":[],"mappings":";AAcA,kDAiLC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket
|
|
2
|
+
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload, NovaLineSettingsCookie as Cookie, NovaSolidSpaceMoonRocket as MoonRocket } from '@coorpacademy/nova-icons';
|
|
3
3
|
import map from 'lodash/fp/map';
|
|
4
4
|
import Cta from '../../atom/button-link';
|
|
5
5
|
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
@@ -26,8 +26,7 @@ const CMPopin = props => {
|
|
|
26
26
|
const logo = {
|
|
27
27
|
AlertDiamond,
|
|
28
28
|
WindowUpload,
|
|
29
|
-
MoonRocket
|
|
30
|
-
CheckCircle1
|
|
29
|
+
MoonRocket
|
|
31
30
|
};
|
|
32
31
|
const LogoComponent = logo[icon];
|
|
33
32
|
const backgroundImageStyle = backgroundImageUrl ? {
|
|
@@ -136,7 +135,7 @@ const CMPopin = props => {
|
|
|
136
135
|
}
|
|
137
136
|
}) : null), descriptionBtnTxt ? /*#__PURE__*/React.createElement("div", {
|
|
138
137
|
className: style.descriptionBtn
|
|
139
|
-
}, descriptionBtnTxt) : null, renderBtnSwitch(),
|
|
138
|
+
}, descriptionBtnTxt) : null, renderBtnSwitch(), /*#__PURE__*/React.createElement("div", {
|
|
140
139
|
className: style.buttonContainer
|
|
141
140
|
}, firstButton ? /*#__PURE__*/React.createElement("div", {
|
|
142
141
|
className: firstButton.largeButton ? style.largeButton : style.button
|
|
@@ -165,7 +164,7 @@ const CMPopin = props => {
|
|
|
165
164
|
"aria-label": thirdButton['aria-label'],
|
|
166
165
|
type: thirdButton.type,
|
|
167
166
|
customStyle: thirdButton.customStyle
|
|
168
|
-
})) : null)
|
|
167
|
+
})) : null)));
|
|
169
168
|
};
|
|
170
169
|
|
|
171
170
|
CMPopin.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","NovaLineStatusCheckCircle1","CheckCircle1","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket,\n NovaLineStatusCheckCircle1 as CheckCircle1\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket,\n CheckCircle1\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n {firstButton || secondButton || thirdButton ? (\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n ) : null}\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,EAKEC,0BAA0B,IAAIC,YALhC,QAMO,0BANP;AAOA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAA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ADF,CADU,GAWR,IAZN,EAaGzD,YAAY,gBACX;IAAK,SAAS,EAAEA,YAAY,CAACqD,WAAb,GAA2B5D,KAAK,CAAC4D,WAAjC,GAA+C5D,KAAK,CAAC6D;EAArE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEtD,YAAY,CAACuD,KADtB;IAEE,OAAO,EAAEvD,YAAY,CAACwD,aAFxB;IAGE,aAAY,gBAAexD,YAAY,CAAC+B,IAAK,EAH/C;IAIE,cAAY/B,YAAY,CAAC,YAAD,CAJ1B;IAKE,IAAI,EAAEA,YAAY,CAAC+B,IALrB;IAME,WAAW,EAAE/B,YAAY,CAACyD;EAN5B,EADF,CADW,GAWT,IAxBN,EAyBGnD,WAAW,gBACV;IAAK,SAAS,EAAEA,WAAW,CAAC+C,WAAZ,GAA0B5D,KAAK,CAAC4D,WAAhC,GAA8C5D,KAAK,CAAC6D;EAApE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEhD,WAAW,CAACiD,KADrB;IAEE,OAAO,EAAEjD,WAAW,CAACkD,aAFvB;IAGE,aAAY,gBAAelD,WAAW,CAACyB,IAAK,EAH9C;IAIE,cAAYzB,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CADD,GAuCG,IAhFN,CALF,CADF;AA0FD,CApLD;;AAsLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","NovaLineSettingsCookie","Cookie","NovaSolidSpaceMoonRocket","MoonRocket","map","Cta","ButtonLinkIconOnly","InputSwitch","style","propTypes","CMPopin","props","content","mode","firstButton","secondButton","onClose","header","icon","backgroundImageUrl","descriptionText","thirdButton","cookieTitle","descriptionBtnTxt","listBtnSwicth","logo","LogoComponent","backgroundImageStyle","backgroundImage","backgroundSize","renderHeader","headerBackground","cookieHeader","cookieIconContainer","cookieIcon","getClassBtnSwitch","index","btnList","firstBtnSwitchContainer","length","lastBtnSwitchContainer","singleSwitchContainer","renderBtnSwitch","convert","cap","el","type","title","value","onChange","titlePosition","theme","details","requiredSelection","disabled","id","dataName","background","popinCookie","popin","popinHeader","cookieTitleContainer","titleContainer","contentSection","message","__html","descriptionBtn","buttonContainer","largeButton","button","label","handleOnclick","customStyle"],"sources":["../../../src/molecule/cm-popin/index.js"],"sourcesContent":["import React from 'react';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload,\n NovaLineSettingsCookie as Cookie,\n NovaSolidSpaceMoonRocket as MoonRocket\n} from '@coorpacademy/nova-icons';\nimport map from 'lodash/fp/map';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport InputSwitch from '../../atom/input-switch';\nimport style from './style.css';\nimport propTypes from './types';\n\nconst CMPopin = props => {\n const {\n content,\n mode = 'alert',\n firstButton,\n secondButton,\n onClose,\n header,\n icon,\n backgroundImageUrl,\n descriptionText,\n thirdButton,\n cookieTitle,\n descriptionBtnTxt,\n listBtnSwicth\n } = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload,\n MoonRocket\n };\n const LogoComponent = logo[icon];\n\n const backgroundImageStyle = backgroundImageUrl\n ? {\n backgroundImage: `url(${backgroundImageUrl})`,\n backgroundSize: 'cover'\n }\n : null;\n const renderHeader = () => {\n if (header) return <img className={style.headerBackground} src={header} />;\n if (mode === 'cookie')\n return (\n <div className={style.cookieHeader}>\n <div className={style.cookieIconContainer}>\n <Cookie className={style.cookieIcon} />\n </div>\n <div className={style.cookieTitle}>{cookieTitle}</div>\n </div>\n );\n return null;\n };\n const getClassBtnSwitch = (index, btnList) => {\n switch (index) {\n case 0:\n return style.firstBtnSwitchContainer;\n case btnList.length - 1:\n return style.lastBtnSwitchContainer;\n default:\n return style.singleSwitchContainer;\n }\n };\n const renderBtnSwitch = () => {\n return map.convert({cap: false})((el, index) => {\n const {\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n } = el;\n return (\n <div key={index} className={getClassBtnSwitch(index, listBtnSwicth)}>\n <InputSwitch\n {...{\n type,\n title,\n value,\n onChange,\n titlePosition,\n theme,\n details,\n requiredSelection,\n disabled,\n id,\n 'data-name': dataName\n }}\n />\n </div>\n );\n })(listBtnSwicth);\n };\n return (\n <div\n className={mode !== 'cookie' ? style.background : null}\n style={backgroundImageStyle}\n data-name={'cm-popin-container'}\n >\n <div className={mode === 'cookie' ? style.popinCookie : style.popin}>\n <header className={style.popinHeader}>\n {renderHeader()}\n {onClose ? (\n <ButtonLinkIconOnly\n onClick={onClose}\n data-name={'close-icon'}\n aria-label={'close-icon'}\n size=\"small\"\n icon=\"close\"\n />\n ) : null}\n </header>\n <div\n className={\n mode === 'cookie' || mode === 'information'\n ? style.cookieTitleContainer\n : style.titleContainer\n }\n >\n <div className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n {content ? (\n <p\n className={mode === 'alert' ? style.content : style.message}\n data-name={'cm-popin-content'}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n ) : null}\n </div>\n {descriptionText ? (\n <p\n className={style.descriptionText}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: descriptionText}}\n />\n ) : null}\n </div>\n {descriptionBtnTxt ? <div className={style.descriptionBtn}>{descriptionBtnTxt}</div> : null}\n {renderBtnSwitch()}\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={firstButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={firstButton.label}\n onClick={firstButton.handleOnclick}\n data-name={'cm-popin-cta'}\n aria-label={firstButton['aria-label']}\n type={firstButton.type}\n customStyle={firstButton.customStyle}\n />\n </div>\n ) : null}\n {secondButton ? (\n <div className={secondButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={secondButton['aria-label']}\n type={secondButton.type}\n customStyle={secondButton.customStyle}\n />\n </div>\n ) : null}\n {thirdButton ? (\n <div className={thirdButton.largeButton ? style.largeButton : style.button}>\n <Cta\n label={thirdButton.label}\n onClick={thirdButton.handleOnclick}\n data-name={`cm-popin-cta-${thirdButton.type}`}\n aria-label={thirdButton['aria-label']}\n type={thirdButton.type}\n customStyle={thirdButton.customStyle}\n />\n </div>\n ) : null}\n </div>\n </div>\n </div>\n );\n};\n\nCMPopin.propTypes = propTypes;\n\nexport default CMPopin;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,EAGEC,sBAAsB,IAAIC,MAH5B,EAIEC,wBAAwB,IAAIC,UAJ9B,QAKO,0BALP;AAMA,OAAOC,GAAP,MAAgB,eAAhB;AACA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AACA,OAAOC,SAAP,MAAsB,SAAtB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;EACvB,MAAM;IACJC,OADI;IAEJC,IAAI,GAAG,OAFH;IAGJC,WAHI;IAIJC,YAJI;IAKJC,OALI;IAMJC,MANI;IAOJC,IAPI;IAQJC,kBARI;IASJC,eATI;IAUJC,WAVI;IAWJC,WAXI;IAYJC,iBAZI;IAaJC;EAbI,IAcFb,KAdJ;EAgBA,MAAMc,IAAI,GAAG;IACX5B,YADW;IAEXE,YAFW;IAGXI;EAHW,CAAb;EAKA,MAAMuB,aAAa,GAAGD,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AK,CAAC6D;EAApE,gBACE,oBAAC,GAAD;IACE,KAAK,EAAEhD,WAAW,CAACiD,KADrB;IAEE,OAAO,EAAEjD,WAAW,CAACkD,aAFvB;IAGE,aAAY,gBAAelD,WAAW,CAACyB,IAAK,EAH9C;IAIE,cAAYzB,WAAW,CAAC,YAAD,CAJzB;IAKE,IAAI,EAAEA,WAAW,CAACyB,IALpB;IAME,WAAW,EAAEzB,WAAW,CAACmD;EAN3B,EADF,CADU,GAWR,IApCN,CAzCF,CALF,CADF;AAwFD,CAjLD;;AAmLA9D,OAAO,CAACD,SAAR,2CAAoBA,SAApB;AAEA,eAAeC,OAAf"}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
.popin {
|
|
49
49
|
overflow: auto;
|
|
50
|
-
width:
|
|
50
|
+
width: 500px;
|
|
51
51
|
flex-grow: 0;
|
|
52
52
|
margin: 16px;
|
|
53
53
|
padding: 16px 16px 20px 16px;
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
|
|
115
115
|
.button {
|
|
116
116
|
min-width: max-content;
|
|
117
|
-
width:
|
|
117
|
+
width: 160px;
|
|
118
118
|
padding: 8px;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.largeButton {
|
|
122
|
-
width:
|
|
122
|
+
width: 100%;
|
|
123
123
|
padding: 8px;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -147,11 +147,7 @@
|
|
|
147
147
|
color: cm_grey_500;
|
|
148
148
|
font-style: normal;
|
|
149
149
|
white-space: pre-line;
|
|
150
|
-
margin: 0px
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.content {
|
|
154
|
-
margin: 20px 32px;
|
|
150
|
+
margin-top: 0px;
|
|
155
151
|
}
|
|
156
152
|
|
|
157
153
|
.cookieTitleContainer {
|
|
@@ -282,21 +278,29 @@ a {
|
|
|
282
278
|
}
|
|
283
279
|
|
|
284
280
|
@media tablet {
|
|
281
|
+
.popin {
|
|
282
|
+
position: fixed;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
285
|
.popin {
|
|
286
286
|
width: 80%;
|
|
287
|
-
overflow: hidden;
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
.buttonContainer {
|
|
291
290
|
display: flex;
|
|
292
291
|
flex-wrap: wrap-reverse;
|
|
293
|
-
margin:
|
|
292
|
+
margin: 48px 24px 32px 24px;
|
|
293
|
+
width: 85%;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
.
|
|
296
|
+
.button {
|
|
297
297
|
width: 100%;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
.titleContainer {
|
|
301
|
+
width: 85%;
|
|
302
|
+
}
|
|
303
|
+
|
|
300
304
|
.popinCookie {
|
|
301
305
|
position: fixed;
|
|
302
306
|
bottom: 10px;
|
|
@@ -306,66 +310,40 @@ a {
|
|
|
306
310
|
overflow-x: hidden;
|
|
307
311
|
overflow-y: auto;
|
|
308
312
|
}
|
|
309
|
-
.popinCookie .button
|
|
313
|
+
.popinCookie .button{
|
|
310
314
|
width: 100%;
|
|
311
315
|
padding: 0px 0px 8px 0px
|
|
312
316
|
}
|
|
313
317
|
|
|
314
318
|
.popinCookie .largeButton {
|
|
315
|
-
padding: 8px 0px 0px 0px
|
|
319
|
+
padding: 8px 0px 0px 0px
|
|
316
320
|
}
|
|
317
321
|
.popinCookie .message {
|
|
318
322
|
padding: 24px 24px 0px 24px
|
|
319
323
|
}
|
|
320
|
-
.descriptionText {
|
|
321
|
-
margin: 0px 16px;
|
|
322
|
-
}
|
|
323
|
-
.content {
|
|
324
|
-
margin: 20px 16px;
|
|
325
|
-
}
|
|
326
|
-
.message {
|
|
327
|
-
padding: 40px 16px 0px;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
@media mobile {
|
|
332
|
-
.background {
|
|
333
|
-
padding: 0;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.popin {
|
|
337
|
-
width: 80%;
|
|
338
|
-
overflow: hidden;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.buttonContainer {
|
|
342
|
-
display: flex;
|
|
343
|
-
margin: 12px 16px 32px 16px;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.button {
|
|
347
|
-
width: 100%;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
.titleContainer {
|
|
351
|
-
width: 100%;
|
|
352
|
-
margin: 0px 16px;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
.descriptionText {
|
|
356
|
-
margin: 0px 16px;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.content {
|
|
360
|
-
margin: 16px 32px;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.largeButton {
|
|
364
|
-
margin: 0px 32px;
|
|
365
|
-
}
|
|
366
324
|
|
|
367
|
-
|
|
368
|
-
|
|
325
|
+
@media mobile {
|
|
326
|
+
.popin {
|
|
327
|
+
position: fixed;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.popin {
|
|
331
|
+
width: 80%;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.buttonContainer {
|
|
335
|
+
display: flex;
|
|
336
|
+
margin: 48px 24px 32px 24px;
|
|
337
|
+
width: 85%;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.button {
|
|
341
|
+
width: 100%;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.titleContainer {
|
|
345
|
+
width: 85%;
|
|
346
|
+
}
|
|
369
347
|
}
|
|
370
348
|
}
|
|
371
349
|
|
|
@@ -377,6 +355,7 @@ button {
|
|
|
377
355
|
}
|
|
378
356
|
|
|
379
357
|
_:-ms-fullscreen,
|
|
358
|
+
.descriptionText,
|
|
380
359
|
.buttonContainer {
|
|
381
360
|
width: 85%;
|
|
382
361
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Props } from './types';
|
|
3
|
+
export declare const ICONS: {
|
|
4
|
+
arrow: any;
|
|
5
|
+
};
|
|
6
|
+
declare const ExpandableItem: {
|
|
7
|
+
({ icon, title, isExpended, isLink, content, onClick, image }: Props): JSX.Element;
|
|
8
|
+
propTypes: {
|
|
9
|
+
title: import("prop-types").Requireable<string>;
|
|
10
|
+
icon: import("prop-types").Requireable<string>;
|
|
11
|
+
isExpended: import("prop-types").Requireable<boolean>;
|
|
12
|
+
isLink: import("prop-types").Requireable<boolean>;
|
|
13
|
+
content: import("prop-types").Requireable<string>;
|
|
14
|
+
image: import("prop-types").Requireable<string>;
|
|
15
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default ExpandableItem;
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;mEAAgE,KAAK;;;;;;;;;;CA2BxF,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { NovaCompositionNavigationArrowDown as ArrowIcon } from '@coorpacademy/nova-icons';
|
|
4
|
+
import { propTypes } from './types';
|
|
5
|
+
import styles from './style.css';
|
|
6
|
+
export const ICONS = {
|
|
7
|
+
arrow: ArrowIcon
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const ExpandableItem = ({
|
|
11
|
+
icon,
|
|
12
|
+
title,
|
|
13
|
+
isExpended,
|
|
14
|
+
isLink,
|
|
15
|
+
content,
|
|
16
|
+
onClick,
|
|
17
|
+
image
|
|
18
|
+
}) => {
|
|
19
|
+
const Icon = ICONS[icon];
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: isExpended ? styles.expendedContainer : styles.container,
|
|
22
|
+
onClick: onClick
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: classnames(styles.header, isExpended ? styles.expendedHeader : null)
|
|
25
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
26
|
+
className: styles.title
|
|
27
|
+
}, title), Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
className: classnames(styles.icon, isExpended ? styles.expendedIcon : null, isLink ? styles.linkIcon : null)
|
|
29
|
+
}) : null), isExpended ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: styles.content // eslint-disable-next-line react/no-danger
|
|
31
|
+
,
|
|
32
|
+
dangerouslySetInnerHTML: {
|
|
33
|
+
__html: content
|
|
34
|
+
}
|
|
35
|
+
}), image ? /*#__PURE__*/React.createElement("img", {
|
|
36
|
+
className: styles.image,
|
|
37
|
+
src: image,
|
|
38
|
+
alt: ''
|
|
39
|
+
}) : null) : null);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
ExpandableItem.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};
|
|
43
|
+
export default ExpandableItem;
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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, title, isExpended, isLink, content, onClick, image}: Props) => {\n const Icon = ICONS[icon];\n return (\n <div className={isExpended ? styles.expendedContainer : styles.container} onClick={onClick}>\n <div className={classnames(styles.header, isExpended ? styles.expendedHeader : null)}>\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 {isExpended ? (\n <div>\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;AACA,SAAQC,SAAR,QAA+B,SAA/B;AACA,OAAOC,MAAP,MAAmB,aAAnB;AAEA,OAAO,MAAMC,KAAK,GAAG;EACnBC,KAAK,EAAEJ;AADY,CAAd;;AAIP,MAAMK,cAAc,GAAG,CAAC;EAACC,IAAD;EAAOC,KAAP;EAAcC,UAAd;EAA0BC,MAA1B;EAAkCC,OAAlC;EAA2CC,OAA3C;EAAoDC;AAApD,CAAD,KAAuE;EAC5F,MAAMC,IAAI,GAAGV,KAAK,CAACG,IAAD,CAAlB;EACA,oBACE;IAAK,SAAS,EAAEE,UAAU,GAAGN,MAAM,CAACY,iBAAV,GAA8BZ,MAAM,CAACa,SAA/D;IAA0E,OAAO,EAAEJ;EAAnF,gBACE;IAAK,SAAS,EAAEb,UAAU,CAACI,MAAM,CAACc,MAAR,EAAgBR,UAAU,GAAGN,MAAM,CAACe,cAAV,GAA2B,IAArD;EAA1B,gBACE;IAAI,SAAS,EAAEf,MAAM,CAACK;EAAtB,GAA8BA,KAA9B,CADF,EAEGM,IAAI,gBACH,oBAAC,IAAD;IACE,SAAS,EAAEf,UAAU,CACnBI,MAAM,CAACI,IADY,EAEnBE,UAAU,GAAGN,MAAM,CAACgB,YAAV,GAAyB,IAFhB,EAGnBT,MAAM,GAAGP,MAAM,CAACiB,QAAV,GAAqB,IAHR;EADvB,EADG,GAQD,IAVN,CADF,EAaGX,UAAU,gBACT,8CACE;IACE,SAAS,EAAEN,MAAM,CAACQ,OADpB,CAC6B;IAD7B;IAEE,uBAAuB,EAAE;MAACU,MAAM,EAAEV;IAAT;EAF3B,EADF,EAKGE,KAAK,gBAAG;IAAK,SAAS,EAAEV,MAAM,CAACU,KAAvB;IAA8B,GAAG,EAAEA,KAAnC;IAA0C,GAAG,EAAE;EAA/C,EAAH,GAA2D,IALnE,CADS,GAQP,IArBN,CADF;AAyBD,CA3BD;;AA6BAP,cAAc,CAACJ,SAAf,2CAA2BA,SAA3B;AACA,eAAeI,cAAf"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value breakpoints: "../../variables/breakpoints.css";
|
|
3
|
+
@value mobile from breakpoints;
|
|
4
|
+
@value tablet from breakpoints;
|
|
5
|
+
@value cm_primary_blue from colors;
|
|
6
|
+
@value cm_grey_500 from colors;
|
|
7
|
+
@value cm_grey_600 from colors;
|
|
8
|
+
@value cm_grey_800 from colors;
|
|
9
|
+
@value cm_grey_700 from colors;
|
|
10
|
+
@value white from colors;
|
|
11
|
+
|
|
12
|
+
.container {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
background: white;
|
|
16
|
+
gap: 16px;
|
|
17
|
+
border-radius: 8px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
display: flex;
|
|
20
|
+
height: 72px;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.header {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
flex: none;
|
|
28
|
+
order: 0;
|
|
29
|
+
flex-grow: 0;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
padding: 24px;
|
|
34
|
+
gap: 16px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.expendedContainer {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
background: white;
|
|
41
|
+
gap: 16px;
|
|
42
|
+
border-radius: 2px;
|
|
43
|
+
width: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.expendedHeader {
|
|
49
|
+
padding: 24px 24px 0px 24px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.title {
|
|
53
|
+
font-family: Gilroy;
|
|
54
|
+
color: cm_grey_700;
|
|
55
|
+
margin: 0;
|
|
56
|
+
font-weight: inherit;
|
|
57
|
+
font-family: Gilroy;
|
|
58
|
+
font-size: 18px;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
line-height: 24px;
|
|
61
|
+
letter-spacing: 0px;
|
|
62
|
+
text-align: left;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.icon {
|
|
66
|
+
width: 16px;
|
|
67
|
+
height: 16px;
|
|
68
|
+
width: 14px;
|
|
69
|
+
left: 5px;
|
|
70
|
+
top: 9px;
|
|
71
|
+
border-radius: 0px;
|
|
72
|
+
color: cm_grey_500;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
min-width: 16px;
|
|
75
|
+
flex-basis: 16px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.expendedIcon {
|
|
79
|
+
transform: rotateZ(180deg);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.linkIcon {
|
|
83
|
+
transform: rotateZ(270deg);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.content {
|
|
87
|
+
font-family: Gilroy;
|
|
88
|
+
font-size: 20px;
|
|
89
|
+
font-weight: 400;
|
|
90
|
+
line-height: 28px;
|
|
91
|
+
letter-spacing: 0px;
|
|
92
|
+
text-align: left;
|
|
93
|
+
padding: 0px 40px 32px 40px;
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.image {
|
|
98
|
+
width: 100%;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.content span{
|
|
102
|
+
font-family: Gilroy;
|
|
103
|
+
font-size: 20px;
|
|
104
|
+
font-weight: 400;
|
|
105
|
+
line-height: 28px;
|
|
106
|
+
letter-spacing: 0px;
|
|
107
|
+
text-align: left;
|
|
108
|
+
color: cm_grey_600;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media mobile {
|
|
112
|
+
.container {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
background: white;
|
|
116
|
+
gap: 16px;
|
|
117
|
+
border-radius: 2px;
|
|
118
|
+
width: 100%;
|
|
119
|
+
display: flex;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
height: max-content;
|
|
122
|
+
}
|
|
123
|
+
.header {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: row;
|
|
126
|
+
flex: none;
|
|
127
|
+
order: 0;
|
|
128
|
+
flex-grow: 0;
|
|
129
|
+
justify-content: space-between;
|
|
130
|
+
align-items: center;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
padding: 12px 40px;
|
|
133
|
+
height: max-content;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export declare const propTypes: {
|
|
3
|
+
title: PropTypes.Requireable<string>;
|
|
4
|
+
icon: PropTypes.Requireable<string>;
|
|
5
|
+
isExpended: PropTypes.Requireable<boolean>;
|
|
6
|
+
isLink: PropTypes.Requireable<boolean>;
|
|
7
|
+
content: PropTypes.Requireable<string>;
|
|
8
|
+
image: PropTypes.Requireable<string>;
|
|
9
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
+
};
|
|
11
|
+
export declare type Props = {
|
|
12
|
+
title: string;
|
|
13
|
+
icon: 'arrow';
|
|
14
|
+
isExpended: boolean;
|
|
15
|
+
content: string;
|
|
16
|
+
isLink?: boolean;
|
|
17
|
+
image?: string;
|
|
18
|
+
onClick: () => void;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;CAQrB,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,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export const propTypes = {
|
|
3
|
+
title: PropTypes.string,
|
|
4
|
+
icon: PropTypes.oneOf(['arrow']),
|
|
5
|
+
isExpended: PropTypes.bool,
|
|
6
|
+
isLink: PropTypes.bool,
|
|
7
|
+
content: PropTypes.string,
|
|
8
|
+
image: PropTypes.string,
|
|
9
|
+
onClick: PropTypes.func
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +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;AAPI,CAAlB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Props } from './types';
|
|
3
|
+
declare const ExpandableList: {
|
|
4
|
+
({ items }: Props): JSX.Element;
|
|
5
|
+
propTypes: {
|
|
6
|
+
items: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
7
|
+
title: import("prop-types").Requireable<string>;
|
|
8
|
+
icon: import("prop-types").Requireable<string>;
|
|
9
|
+
isExpended: import("prop-types").Requireable<boolean>;
|
|
10
|
+
isLink: import("prop-types").Requireable<boolean>;
|
|
11
|
+
content: import("prop-types").Requireable<string>;
|
|
12
|
+
image: import("prop-types").Requireable<string>;
|
|
13
|
+
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
14
|
+
}> | null | undefined)[]>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default ExpandableList;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;CAYrC,CAAC;AAIF,eAAe,cAAc,CAAC"}
|