@coorpacademy/components 10.1.7 → 10.1.8
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-link/index.js +2 -22
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +0 -1
- package/es/atom/button-link/test/fixtures.js +0 -2
- package/es/atom/button-link/test/fixtures.js.map +1 -1
- package/es/atom/button-link-icon-only/index.js +76 -0
- package/es/atom/button-link-icon-only/index.js.map +1 -0
- package/es/atom/button-link-icon-only/style.css +64 -0
- package/es/atom/{button-link/test/button-link.js → button-link-icon-only/test/button-link-icon-only.js} +5 -5
- package/es/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -0
- package/es/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js +10 -0
- package/es/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js.map +1 -0
- package/es/atom/{button-link/test/fixtures/icon-button.js → button-link-icon-only/test/fixtures/default.js} +3 -6
- package/es/atom/button-link-icon-only/test/fixtures/default.js.map +1 -0
- package/es/atom/button-link-icon-only/test/fixtures/no-icon.js +7 -0
- package/es/atom/button-link-icon-only/test/fixtures/no-icon.js.map +1 -0
- package/es/atom/button-link-icon-only/test/fixtures/small-button-disabled.js +11 -0
- package/es/atom/button-link-icon-only/test/fixtures/small-button-disabled.js.map +1 -0
- package/es/atom/button-link-icon-only/test/fixtures/small-link-download.js +13 -0
- package/es/atom/button-link-icon-only/test/fixtures/small-link-download.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/index.js +4 -7
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/es/molecule/cm-popin/index.js +8 -7
- package/es/molecule/cm-popin/index.js.map +1 -1
- package/es/molecule/cm-popin/style.css +0 -25
- package/es/molecule/search/test/fixtures.js +15 -0
- package/es/molecule/search/test/fixtures.js.map +1 -0
- package/es/organism/brand-form/test/fixtures.js +0 -2
- package/es/organism/brand-form/test/fixtures.js.map +1 -1
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/organism/setup-header/index.js +78 -31
- package/es/organism/setup-header/index.js.map +1 -1
- package/es/organism/setup-header/style.css +27 -62
- package/es/util/button-icons.js +16 -0
- package/es/util/button-icons.js.map +1 -0
- package/lib/atom/button-link/index.js +5 -26
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +0 -1
- package/lib/atom/button-link/test/fixtures.js +0 -3
- package/lib/atom/button-link/test/fixtures.js.map +1 -1
- package/lib/atom/button-link-icon-only/index.js +94 -0
- package/lib/atom/button-link-icon-only/index.js.map +1 -0
- package/lib/atom/button-link-icon-only/style.css +64 -0
- package/lib/atom/{button-link/test/button-link.js → button-link-icon-only/test/button-link-icon-only.js} +4 -4
- package/lib/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -0
- package/lib/atom/{button-link/test/fixtures/button-tertiary-icon-bullet.js → button-link-icon-only/test/fixtures/button-icon-bullet.js} +3 -6
- package/lib/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js.map +1 -0
- package/lib/atom/{button-link/test/fixtures/icon-button.js → button-link-icon-only/test/fixtures/default.js} +3 -6
- package/lib/atom/button-link-icon-only/test/fixtures/default.js.map +1 -0
- package/lib/atom/button-link-icon-only/test/fixtures/no-icon.js +12 -0
- package/lib/atom/button-link-icon-only/test/fixtures/no-icon.js.map +1 -0
- package/lib/atom/button-link-icon-only/test/fixtures/small-button-disabled.js +16 -0
- package/lib/atom/button-link-icon-only/test/fixtures/small-button-disabled.js.map +1 -0
- package/lib/atom/button-link-icon-only/test/fixtures/small-link-download.js +18 -0
- package/lib/atom/button-link-icon-only/test/fixtures/small-link-download.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/index.js +4 -7
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
- package/lib/molecule/cm-popin/index.js +8 -6
- package/lib/molecule/cm-popin/index.js.map +1 -1
- package/lib/molecule/cm-popin/style.css +0 -25
- package/lib/molecule/search/test/fixtures.js +25 -0
- package/lib/molecule/search/test/fixtures.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures.js +0 -3
- package/lib/organism/brand-form/test/fixtures.js.map +1 -1
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/organism/setup-header/index.js +80 -32
- package/lib/organism/setup-header/index.js.map +1 -1
- package/lib/organism/setup-header/style.css +27 -62
- package/lib/util/button-icons.js +23 -0
- package/lib/util/button-icons.js.map +1 -0
- package/package.json +2 -2
- package/es/atom/button-link/test/button-link.js.map +0 -1
- package/es/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js +0 -13
- package/es/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js.map +0 -1
- package/es/atom/button-link/test/fixtures/icon-button.js.map +0 -1
- package/es/atom/button-menu/test/fixtures.js +0 -15
- package/es/atom/button-menu/test/fixtures.js.map +0 -1
- package/es/molecule/bullet-point-menu-button/test/fixtures.js +0 -15
- package/es/molecule/bullet-point-menu-button/test/fixtures.js.map +0 -1
- package/lib/atom/button-link/test/button-link.js.map +0 -1
- package/lib/atom/button-link/test/fixtures/button-tertiary-icon-bullet.js.map +0 -1
- package/lib/atom/button-link/test/fixtures/icon-button.js.map +0 -1
- package/lib/atom/button-menu/test/fixtures.js +0 -25
- package/lib/atom/button-menu/test/fixtures.js.map +0 -1
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js +0 -25
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js.map +0 -1
|
@@ -6,21 +6,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import classnames from 'classnames';
|
|
9
|
-
import { NovaSolidRemoveAddAddCircle1 as AddIcon, NovaCompositionCoorpacademyAnalytics as AnalyticsIcon, NovaSolidContentEditionBin as BinIcon, NovaCompositionCoorpacademyBulletPoint as BulletPointIcon, NovaCompositionNavigationArrowLeft as ChevronLeftIcon, NovaCompositionNavigationArrowRight as ChevronRightIcon, NovaCompositionCoorpacademyNext as CloseIcon, NovaSolidContentEditionPencilWrite as EditIcon, NovaCompositionCoorpacademyEye as EyeIcon, NovaSolidComputersSdCard as SaveIcon } from '@coorpacademy/nova-icons';
|
|
10
9
|
import Link from '../link';
|
|
10
|
+
import { ICONS } from '../../util/button-icons';
|
|
11
11
|
import style from './style.css';
|
|
12
|
-
const ICONS = {
|
|
13
|
-
add: AddIcon,
|
|
14
|
-
analytics: AnalyticsIcon,
|
|
15
|
-
bin: BinIcon,
|
|
16
|
-
'bullet-point': BulletPointIcon,
|
|
17
|
-
'chevron-left': ChevronLeftIcon,
|
|
18
|
-
'chevron-right': ChevronRightIcon,
|
|
19
|
-
close: CloseIcon,
|
|
20
|
-
edit: EditIcon,
|
|
21
|
-
save: SaveIcon,
|
|
22
|
-
see: EyeIcon
|
|
23
|
-
};
|
|
24
12
|
|
|
25
13
|
const getButtonContent = (icon, label) => {
|
|
26
14
|
const {
|
|
@@ -38,14 +26,6 @@ const getButtonContent = (icon, label) => {
|
|
|
38
26
|
}, label));
|
|
39
27
|
}
|
|
40
28
|
|
|
41
|
-
if (position === 'center' && Icon) {
|
|
42
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
-
className: style.buttonContent
|
|
44
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
45
|
-
className: style.icon
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
50
30
|
className: style.buttonContent
|
|
51
31
|
}, position === 'left' ? /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -97,7 +77,7 @@ ButtonLink.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
97
77
|
'aria-label': PropTypes.string,
|
|
98
78
|
'data-name': PropTypes.string,
|
|
99
79
|
icon: PropTypes.shape({
|
|
100
|
-
position: PropTypes.oneOf(['right', 'left'
|
|
80
|
+
position: PropTypes.oneOf(['right', 'left']),
|
|
101
81
|
type: PropTypes.oneOf(_keys(ICONS))
|
|
102
82
|
}),
|
|
103
83
|
onClick: PropTypes.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","useCallback","PropTypes","classnames","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/button-link/index.js"],"names":["React","useCallback","PropTypes","classnames","Link","ICONS","style","getButtonContent","icon","label","type","position","Icon","buttonContent","ButtonLink","props","disabled","dataName","ariaLabel","link","onClick","contentView","styleButton","button","primary","secondary","tertiary","text","dangerous","handleOnClick","propTypes","oneOf","string","shape","func","href","download","bool","target"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAG,CAACC,IAAD,EAAOC,KAAP,KAAiB;AACxC,QAAM;AAACC,IAAAA,IAAD;AAAOC,IAAAA;AAAP,MAAmBH,IAAzB;;AACA,QAAMI,IAAI,GAAG,OAAM,IAAN,EAAYF,IAAZ,EAAkBL,KAAlB,CAAb;;AAEA,MAAI,CAACO,IAAL,EAAW;AACT,wBACE;AAAK,MAAA,SAAS,EAAEN,KAAK,CAACO;AAAtB,oBACE;AAAM,MAAA,SAAS,EAAEP,KAAK,CAACG;AAAvB,OAA+BA,KAA/B,CADF,CADF;AAKD;;AAED,sBACE;AAAK,IAAA,SAAS,EAAEH,KAAK,CAACO;AAAtB,KACGF,QAAQ,KAAK,MAAb,gBAAsB,oBAAC,IAAD;AAAM,IAAA,SAAS,EAAEL,KAAK,CAACE;AAAvB,IAAtB,GAA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from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport Link from '../link';\nimport {ICONS} from '../../util/button-icons';\nimport style from './style.css';\n\nconst getButtonContent = (icon, label) => {\n const {type, position} = icon;\n const Icon = getOr(null, type, ICONS);\n\n if (!Icon) {\n return (\n <div className={style.buttonContent}>\n <span className={style.label}>{label}</span>\n </div>\n );\n }\n\n return (\n <div className={style.buttonContent}>\n {position === 'left' ? <Icon className={style.icon} /> : null}\n <span className={style.label}>{label}</span>\n {position === 'right' ? <Icon className={style.icon} /> : null}\n </div>\n );\n};\n\nconst ButtonLink = props => {\n const {\n type,\n label,\n disabled,\n icon = {},\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick\n } = props;\n const contentView = getButtonContent(icon, label);\n const styleButton = classnames(\n style.button,\n type === 'primary' && style.primary,\n type === 'secondary' && style.secondary,\n type === 'tertiary' && style.tertiary,\n type === 'text' && style.text,\n type === 'dangerous' && style.dangerous,\n link && style.link,\n disabled && style.disabled\n );\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n >\n {contentView}\n </Link>\n );\n }\n\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel || label}\n title={ariaLabel || label}\n data-name={dataName}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLink.propTypes = {\n type: PropTypes.oneOf(['primary', 'secondary', 'tertiary', 'text', 'dangerous']),\n label: PropTypes.string,\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.shape({\n position: PropTypes.oneOf(['right', 'left']),\n type: PropTypes.oneOf(keys(ICONS))\n }),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool\n};\n\nexport default ButtonLink;\n"],"file":"index.js"}
|
|
@@ -6,7 +6,6 @@ import fixtureButtonDangerousNoIcon from './fixtures/button-dangerous-no-icon';
|
|
|
6
6
|
import fixtureButtonPrimaryIconLeft from './fixtures/button-primary-icon-left';
|
|
7
7
|
import fixtureButtonPrimaryNoIcon from './fixtures/button-primary-no-icon';
|
|
8
8
|
import fixtureButtonSecondaryNoIconDisabled from './fixtures/button-secondary-no-icon-disabled';
|
|
9
|
-
import fixtureButtonTertiaryIconBullet from './fixtures/button-tertiary-icon-bullet';
|
|
10
9
|
import fixtureButtonTertiaryIconLeft from './fixtures/button-tertiary-icon-left';
|
|
11
10
|
import fixtureIconButton from './fixtures/icon-button';
|
|
12
11
|
import fixtureLinkPrimaryDisabledIconRight from './fixtures/link-primary-disabled-icon-right';
|
|
@@ -24,7 +23,6 @@ test('Atom › AtomButtonLink › ButtonDangerousNoIcon › should be rendered',
|
|
|
24
23
|
test('Atom › AtomButtonLink › ButtonPrimaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryIconLeft);
|
|
25
24
|
test('Atom › AtomButtonLink › ButtonPrimaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryNoIcon);
|
|
26
25
|
test('Atom › AtomButtonLink › ButtonSecondaryNoIconDisabled › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonSecondaryNoIconDisabled);
|
|
27
|
-
test('Atom › AtomButtonLink › ButtonTertiaryIconBullet › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconBullet);
|
|
28
26
|
test('Atom › AtomButtonLink › ButtonTertiaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconLeft);
|
|
29
27
|
test('Atom › AtomButtonLink › IconButton › should be rendered', renderComponentMacro, AtomButtonLink, fixtureIconButton);
|
|
30
28
|
test('Atom › AtomButtonLink › LinkPrimaryDisabledIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkPrimaryDisabledIconRight);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/atom/button-link/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonLink","fixtureButtonDangerousNoIcon","fixtureButtonPrimaryIconLeft","fixtureButtonPrimaryNoIcon","fixtureButtonSecondaryNoIconDisabled","
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-link/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonLink","fixtureButtonDangerousNoIcon","fixtureButtonPrimaryIconLeft","fixtureButtonPrimaryNoIcon","fixtureButtonSecondaryNoIconDisabled","fixtureButtonTertiaryIconLeft","fixtureIconButton","fixtureLinkPrimaryDisabledIconRight","fixtureLinkSecondaryIconRight","fixtureLinkTertiaryNoIcon","fixtureLinkTextIconRightTargetBlank","fixtureLinkTextNoIconDownload","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,4BAAP,MAAyC,qCAAzC;AACA,OAAOC,4BAAP,MAAyC,qCAAzC;AACA,OAAOC,0BAAP,MAAuC,mCAAvC;AACA,OAAOC,oCAAP,MAAiD,8CAAjD;AACA,OAAOC,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,iBAAP,MAA8B,wBAA9B;AACA,OAAOC,mCAAP,MAAgD,6CAAhD;AACA,OAAOC,6BAAP,MAA0C,sCAA1C;AACA,OAAOC,yBAAP,MAAsC,kCAAtC;AACA,OAAOC,mCAAP,MAAgD,8CAAhD;AACA,OAAOC,6BAAP,MAA0C,uCAA1C;AAEAd,IAAI,CAAC,qDAAD,EAAwDe,CAAC,IAAI;AAC/DA,EAAAA,CAAC,CAACC,IAAF;AACAf,EAAAA,OAAO,CAACE,cAAc,CAACc,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,+CAA8CF,GAAI,mEAA3E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAnB,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,cAA7F,EAA6GC,4BAA7G,CAAJ;AACAJ,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,cAA7F,EAA6GE,4BAA7G,CAAJ;AACAL,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,cAA3F,EAA2GG,0BAA3G,CAAJ;AACAN,IAAI,CAAC,4EAAD,EAA+EE,oBAA/E,EAAqGC,cAArG,EAAqHI,oCAArH,CAAJ;AACAP,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GK,6BAA9G,CAAJ;AACAR,IAAI,CAAC,yDAAD,EAA4DE,oBAA5D,EAAkFC,cAAlF,EAAkGM,iBAAlG,CAAJ;AACAT,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,cAApG,EAAoHO,mCAApH,CAAJ;AACAV,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GQ,6BAA9G,CAAJ;AACAX,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,cAA1F,EAA0GS,yBAA1G,CAAJ;AACAZ,IAAI,CAAC,2EAAD,EAA8EE,oBAA9E,EAAoGC,cAApG,EAAoHU,mCAApH,CAAJ;AACAb,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,cAA9F,EAA8GW,6BAA9G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonLink from '..';\nimport fixtureButtonDangerousNoIcon from './fixtures/button-dangerous-no-icon';\nimport fixtureButtonPrimaryIconLeft from './fixtures/button-primary-icon-left';\nimport fixtureButtonPrimaryNoIcon from './fixtures/button-primary-no-icon';\nimport fixtureButtonSecondaryNoIconDisabled from './fixtures/button-secondary-no-icon-disabled';\nimport fixtureButtonTertiaryIconLeft from './fixtures/button-tertiary-icon-left';\nimport fixtureIconButton from './fixtures/icon-button';\nimport fixtureLinkPrimaryDisabledIconRight from './fixtures/link-primary-disabled-icon-right';\nimport fixtureLinkSecondaryIconRight from './fixtures/link-secondary-icon-right';\nimport fixtureLinkTertiaryNoIcon from './fixtures/link-tertiary-no-icon';\nimport fixtureLinkTextIconRightTargetBlank from './fixtures/link-text-icon-right-target-blank';\nimport fixtureLinkTextNoIconDownload from './fixtures/link-text-no-icon-download';\n\ntest('Atom › AtomButtonLink > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonLink.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonLink.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonLink › ButtonDangerousNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonDangerousNoIcon);\ntest('Atom › AtomButtonLink › ButtonPrimaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryIconLeft);\ntest('Atom › AtomButtonLink › ButtonPrimaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonPrimaryNoIcon);\ntest('Atom › AtomButtonLink › ButtonSecondaryNoIconDisabled › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonSecondaryNoIconDisabled);\ntest('Atom › AtomButtonLink › ButtonTertiaryIconLeft › should be rendered', renderComponentMacro, AtomButtonLink, fixtureButtonTertiaryIconLeft);\ntest('Atom › AtomButtonLink › IconButton › should be rendered', renderComponentMacro, AtomButtonLink, fixtureIconButton);\ntest('Atom › AtomButtonLink › LinkPrimaryDisabledIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkPrimaryDisabledIconRight);\ntest('Atom › AtomButtonLink › LinkSecondaryIconRight › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkSecondaryIconRight);\ntest('Atom › AtomButtonLink › LinkTertiaryNoIcon › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTertiaryNoIcon);\ntest('Atom › AtomButtonLink › LinkTextIconRightTargetBlank › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextIconRightTargetBlank);\ntest('Atom › AtomButtonLink › LinkTextNoIconDownload › should be rendered', renderComponentMacro, AtomButtonLink, fixtureLinkTextNoIconDownload);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import _keys from "lodash/fp/keys";
|
|
2
|
+
import _getOr from "lodash/fp/getOr";
|
|
3
|
+
|
|
4
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import { ICONS } from '../../util/button-icons';
|
|
10
|
+
import Link from '../link';
|
|
11
|
+
import style from './style.css';
|
|
12
|
+
|
|
13
|
+
const getButtonContent = icon => {
|
|
14
|
+
const Icon = _getOr(null, icon, ICONS);
|
|
15
|
+
|
|
16
|
+
if (!Icon) {
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: style.buttonContent
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: style.buttonContent
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
className: style.icon
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const ButtonLinkIconOnly = props => {
|
|
30
|
+
const {
|
|
31
|
+
size = 'default',
|
|
32
|
+
disabled,
|
|
33
|
+
icon,
|
|
34
|
+
'data-name': dataName,
|
|
35
|
+
'aria-label': ariaLabel,
|
|
36
|
+
link,
|
|
37
|
+
onClick
|
|
38
|
+
} = props;
|
|
39
|
+
const contentView = getButtonContent(icon);
|
|
40
|
+
const styleButton = classnames(size === 'default' ? style.default : style.small, link && style.link, disabled && style.disabled);
|
|
41
|
+
|
|
42
|
+
if (link) {
|
|
43
|
+
return /*#__PURE__*/React.createElement(Link, _extends({}, link, {
|
|
44
|
+
className: styleButton,
|
|
45
|
+
"data-name": dataName,
|
|
46
|
+
"aria-label": ariaLabel,
|
|
47
|
+
title: ariaLabel
|
|
48
|
+
}), contentView);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const handleOnClick = useMemo(() => () => onClick(), [onClick]);
|
|
52
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-label": ariaLabel,
|
|
55
|
+
"data-name": dataName,
|
|
56
|
+
title: ariaLabel,
|
|
57
|
+
className: styleButton,
|
|
58
|
+
onClick: handleOnClick
|
|
59
|
+
}, contentView);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
ButtonLinkIconOnly.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
63
|
+
size: PropTypes.oneOf(['default', 'small']),
|
|
64
|
+
'aria-label': PropTypes.string,
|
|
65
|
+
'data-name': PropTypes.string,
|
|
66
|
+
icon: PropTypes.oneOf(_keys(ICONS)),
|
|
67
|
+
onClick: PropTypes.func,
|
|
68
|
+
link: PropTypes.shape({
|
|
69
|
+
href: PropTypes.string,
|
|
70
|
+
download: PropTypes.bool,
|
|
71
|
+
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])
|
|
72
|
+
}),
|
|
73
|
+
disabled: PropTypes.bool
|
|
74
|
+
} : {};
|
|
75
|
+
export default ButtonLinkIconOnly;
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/button-link-icon-only/index.js"],"names":["React","useMemo","PropTypes","classnames","ICONS","Link","style","getButtonContent","icon","Icon","buttonContent","ButtonLinkIconOnly","props","size","disabled","dataName","ariaLabel","link","onClick","contentView","styleButton","default","small","handleOnClick","propTypes","oneOf","string","func","shape","href","download","bool","target"],"mappings":";;;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAAQC,KAAR,QAAoB,yBAApB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,gBAAgB,GAAGC,IAAI,IAAI;AAC/B,QAAMC,IAAI,GAAG,OAAM,IAAN,EAAYD,IAAZ,EAAkBJ,KAAlB,CAAb;;AAEA,MAAI,CAACK,IAAL,EAAW;AACT,wBAAO;AAAK,MAAA,SAAS,EAAEH,KAAK,CAACI;AAAtB,MAAP;AACD;;AAED,sBACE;AAAK,IAAA,SAAS,EAAEJ,KAAK,CAACI;AAAtB,kBACE,oBAAC,IAAD;AAAM,IAAA,SAAS,EAAEJ,KAAK,CAACE;AAAvB,IADF,CADF;AAKD,CAZD;;AAcA,MAAMG,kBAAkB,GAAGC,KAAK,IAAI;AAClC,QAAM;AACJC,IAAAA,IAAI,GAAG,SADH;AAEJC,IAAAA,QAFI;AAGJN,IAAAA,IAHI;AAIJ,iBAAaO,QAJT;AAKJ,kBAAcC,SALV;AAMJC,IAAAA,IANI;AAOJC,IAAAA;AAPI,MAQFN,KARJ;AASA,QAAMO,WAAW,GAAGZ,gBAAgB,CAACC,IAAD,CAApC;AACA,QAAMY,WAAW,GAAGjB,UAAU,CAC5BU,IAAI,KAAK,SAAT,GAAqBP,KAAK,CAACe,OAA3B,GAAqCf,KAAK,CAACgB,KADf,EAE5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,SAAS,CAAC6B;AAXS,CAA/B;AAcA,eAAepB,kBAAf","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {getOr, keys} from 'lodash/fp';\nimport classnames from 'classnames';\nimport {ICONS} from '../../util/button-icons';\nimport Link from '../link';\nimport style from './style.css';\n\nconst getButtonContent = icon => {\n const Icon = getOr(null, icon, ICONS);\n\n if (!Icon) {\n return <div className={style.buttonContent} />;\n }\n\n return (\n <div className={style.buttonContent}>\n <Icon className={style.icon} />\n </div>\n );\n};\n\nconst ButtonLinkIconOnly = props => {\n const {\n size = 'default',\n disabled,\n icon,\n 'data-name': dataName,\n 'aria-label': ariaLabel,\n link,\n onClick\n } = props;\n const contentView = getButtonContent(icon);\n const styleButton = classnames(\n size === 'default' ? style.default : style.small,\n link && style.link,\n disabled && style.disabled\n );\n\n if (link) {\n return (\n <Link\n {...link}\n className={styleButton}\n data-name={dataName}\n aria-label={ariaLabel}\n title={ariaLabel}\n >\n {contentView}\n </Link>\n );\n }\n\n const handleOnClick = useMemo(() => () => onClick(), [onClick]);\n return (\n <button\n type=\"button\"\n aria-label={ariaLabel}\n data-name={dataName}\n title={ariaLabel}\n className={styleButton}\n onClick={handleOnClick}\n >\n {contentView}\n </button>\n );\n};\n\nButtonLinkIconOnly.propTypes = {\n size: PropTypes.oneOf(['default', 'small']),\n 'aria-label': PropTypes.string,\n 'data-name': PropTypes.string,\n icon: PropTypes.oneOf(keys(ICONS)),\n onClick: PropTypes.func,\n link: PropTypes.shape({\n href: PropTypes.string,\n download: PropTypes.bool,\n target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top'])\n }),\n disabled: PropTypes.bool\n};\n\nexport default ButtonLinkIconOnly;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_grey_100 from colors;
|
|
3
|
+
@value cm_grey_200 from colors;
|
|
4
|
+
|
|
5
|
+
.button {
|
|
6
|
+
font-family: Gilroy;
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
font-weight: bold;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
border: none;
|
|
14
|
+
background-color: cm_grey_100;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.button:hover {
|
|
18
|
+
background-color: cm_grey_200;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.disabled {
|
|
22
|
+
opacity: 0.3;
|
|
23
|
+
cursor: default;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.disabled:hover {
|
|
28
|
+
background-color: cm_grey_100;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.buttonContent {
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.link {
|
|
38
|
+
color: inherit;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.default {
|
|
43
|
+
composes: button;
|
|
44
|
+
width: 44px;
|
|
45
|
+
height: 44px;
|
|
46
|
+
border-radius: 7px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.small {
|
|
50
|
+
composes: button;
|
|
51
|
+
width: 32px;
|
|
52
|
+
height: 32px;
|
|
53
|
+
border-radius: 5px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.default .icon {
|
|
57
|
+
width: 14px;
|
|
58
|
+
height: 14px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.small .icon {
|
|
62
|
+
width: 12px;
|
|
63
|
+
height: 12px;
|
|
64
|
+
}
|
|
@@ -4,15 +4,15 @@ import test from 'ava';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { shallow, configure } from 'enzyme';
|
|
6
6
|
import Adapter from 'enzyme-adapter-react-16';
|
|
7
|
-
import
|
|
8
|
-
import defaultFixture from './fixtures/button-
|
|
7
|
+
import ButtonLinkIconOnly from '..';
|
|
8
|
+
import defaultFixture from './fixtures/button-icon-bullet';
|
|
9
9
|
browserEnv();
|
|
10
10
|
configure({
|
|
11
11
|
adapter: new Adapter()
|
|
12
12
|
});
|
|
13
13
|
const translate = _identity;
|
|
14
|
-
test('should launch onClick on click event', t => {
|
|
15
|
-
const wrapper = shallow( /*#__PURE__*/React.createElement(
|
|
14
|
+
test('should launch onClick on click event for ButtonLinkIconOnly', t => {
|
|
15
|
+
const wrapper = shallow( /*#__PURE__*/React.createElement(ButtonLinkIconOnly, defaultFixture.props), {
|
|
16
16
|
context: {
|
|
17
17
|
translate
|
|
18
18
|
}
|
|
@@ -22,4 +22,4 @@ test('should launch onClick on click event', t => {
|
|
|
22
22
|
button.first().simulate('click', {});
|
|
23
23
|
t.pass();
|
|
24
24
|
});
|
|
25
|
-
//# sourceMappingURL=button-link.js.map
|
|
25
|
+
//# sourceMappingURL=button-link-icon-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-link-icon-only/test/button-link-icon-only.js"],"names":["browserEnv","test","React","shallow","configure","Adapter","ButtonLinkIconOnly","defaultFixture","adapter","translate","t","wrapper","props","context","button","find","true","exists","first","simulate","pass"],"mappings":";AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,OAAR,EAAiBC,SAAjB,QAAiC,QAAjC;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,kBAAP,MAA+B,IAA/B;AACA,OAAOC,cAAP,MAA2B,+BAA3B;AAEAP,UAAU;AACVI,SAAS,CAAC;AAACI,EAAAA,OAAO,EAAE,IAAIH,OAAJ;AAAV,CAAD,CAAT;AACA,MAAMI,SAAS,YAAf;AAEAR,IAAI,CAAC,6DAAD,EAAgES,CAAC,IAAI;AACvE,QAAMC,OAAO,GAAGR,OAAO,eAAC,oBAAC,kBAAD,EAAwBI,cAAc,CAACK,KAAvC,CAAD,EAAmD;AACxEC,IAAAA,OAAO,EAAE;AAACJ,MAAAA;AAAD;AAD+D,GAAnD,CAAvB;AAGA,QAAMK,MAAM,GAAGH,OAAO,CAACI,IAAR,CAAa,6BAAb,CAAf;AACAL,EAAAA,CAAC,CAACM,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAH,EAAAA,MAAM,CAACI,KAAP,GAAeC,QAAf,CAAwB,OAAxB,EAAiC,EAAjC;AACAT,EAAAA,CAAC,CAACU,IAAF;AACD,CARG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {shallow, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport ButtonLinkIconOnly from '..';\nimport defaultFixture from './fixtures/button-icon-bullet';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('should launch onClick on click event for ButtonLinkIconOnly', t => {\n const wrapper = shallow(<ButtonLinkIconOnly {...defaultFixture.props} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-button\"]');\n t.true(button.exists());\n button.first().simulate('click', {});\n t.pass();\n});\n"],"file":"button-link-icon-only.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js"],"names":["props","size","icon","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAEL,kBAAc,aAFT;AAGL,iBAAa,eAHR;AAILC,IAAAA,IAAI,EAAE,cAJD;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALV;AADM,CAAf","sourcesContent":["export default {\n props: {\n size: 'default',\n 'aria-label': 'aria button',\n 'data-name': 'bullet-button',\n icon: 'bullet-point',\n onClick: () => console.log('click')\n }\n};\n"],"file":"button-icon-bullet.js"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
props: {
|
|
3
|
-
|
|
3
|
+
size: 'default',
|
|
4
4
|
'data-name': 'default-button',
|
|
5
5
|
'aria-label': 'aria button',
|
|
6
|
-
icon:
|
|
7
|
-
position: 'center',
|
|
8
|
-
type: 'close'
|
|
9
|
-
},
|
|
6
|
+
icon: 'close',
|
|
10
7
|
onClick: () => console.log('click')
|
|
11
8
|
}
|
|
12
9
|
};
|
|
13
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-link-icon-only/test/fixtures/default.js"],"names":["props","size","icon","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,SADD;AAEL,iBAAa,gBAFR;AAGL,kBAAc,aAHT;AAILC,IAAAA,IAAI,EAAE,OAJD;AAKLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AALV;AADM,CAAf","sourcesContent":["export default {\n props: {\n size: 'default',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n icon: 'close',\n onClick: () => console.log('click')\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-link-icon-only/test/fixtures/no-icon.js"],"names":["props","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACL,iBAAa,gBADR;AAELC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AAFV;AADM,CAAf","sourcesContent":["export default {\n props: {\n 'data-name': 'default-button',\n onClick: () => console.log('click')\n }\n};\n"],"file":"no-icon.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-link-icon-only/test/fixtures/small-button-disabled.js"],"names":["props","size","icon","disabled","onClick","console","log"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAEL,iBAAa,gBAFR;AAGL,kBAAc,aAHT;AAILC,IAAAA,IAAI,EAAE,OAJD;AAKLC,IAAAA,QAAQ,EAAE,IALL;AAMLC,IAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,OAAZ;AANV;AADM,CAAf","sourcesContent":["export default {\n props: {\n size: 'small',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n icon: 'close',\n disabled: true,\n onClick: () => console.log('click')\n }\n};\n"],"file":"small-button-disabled.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
props: {
|
|
3
|
+
size: 'small',
|
|
4
|
+
icon: 'see',
|
|
5
|
+
'data-name': 'default-button',
|
|
6
|
+
'aria-label': 'aria button',
|
|
7
|
+
link: {
|
|
8
|
+
href: 'https://setup.coorpacademy.com/assets/templates/import-users-template.xlsx',
|
|
9
|
+
download: true
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=small-link-download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-link-icon-only/test/fixtures/small-link-download.js"],"names":["props","size","icon","link","href","download"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,IAAI,EAAE,OADD;AAELC,IAAAA,IAAI,EAAE,KAFD;AAGL,iBAAa,gBAHR;AAIL,kBAAc,aAJT;AAKLC,IAAAA,IAAI,EAAE;AACJC,MAAAA,IAAI,EAAE,4EADF;AAEJC,MAAAA,QAAQ,EAAE;AAFN;AALD;AADM,CAAf","sourcesContent":["export default {\n props: {\n size: 'small',\n icon: 'see',\n 'data-name': 'default-button',\n 'aria-label': 'aria button',\n link: {\n href: 'https://setup.coorpacademy.com/assets/templates/import-users-template.xlsx',\n download: true\n }\n }\n};\n"],"file":"small-link-download.js"}
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import
|
|
5
|
+
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
6
6
|
import ButtonMenu from '../../atom/button-menu';
|
|
7
7
|
import style from './style.css';
|
|
8
8
|
|
|
@@ -25,20 +25,17 @@ const BulletPointMenuButton = props => {
|
|
|
25
25
|
"aria-label": menuAriaLabel
|
|
26
26
|
}, /*#__PURE__*/React.createElement(ButtonMenu, menuProps));
|
|
27
27
|
const bulletPointButtonProps = {
|
|
28
|
-
|
|
28
|
+
size: 'default',
|
|
29
29
|
'aria-label': buttonAriaLabel,
|
|
30
30
|
'data-name': 'bullet-point-button',
|
|
31
|
-
icon:
|
|
32
|
-
position: 'center',
|
|
33
|
-
type: 'bullet-point'
|
|
34
|
-
},
|
|
31
|
+
icon: 'bullet-point',
|
|
35
32
|
onClick: handleOnClick,
|
|
36
33
|
disabled
|
|
37
34
|
};
|
|
38
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
36
|
className: style.bulletPointWrapper,
|
|
40
37
|
"data-name": "bullet-point-wrapper"
|
|
41
|
-
}, /*#__PURE__*/React.createElement(
|
|
38
|
+
}, /*#__PURE__*/React.createElement(ButtonLinkIconOnly, _extends({}, bulletPointButtonProps, {
|
|
42
39
|
className: style.bulletPointButton
|
|
43
40
|
})), menu);
|
|
44
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/bullet-point-menu-button/index.js"],"names":["React","useCallback","PropTypes","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/bullet-point-menu-button/index.js"],"names":["React","useCallback","PropTypes","ButtonLinkIconOnly","ButtonMenu","style","BulletPointMenuButton","props","disabled","buttonAriaLabel","menuAriaLabel","onClick","buttons","handleOnClick","menuProps","menu","bulletPointMenu","bulletPointButtonProps","size","icon","bulletPointWrapper","bulletPointButton","propTypes","bool","string","func"],"mappings":";;AAAA,OAAOA,KAAP,IAAeC,WAAf,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,qBAAqB,GAAGC,KAAK,IAAI;AACrC,QAAM;AAACC,IAAAA,QAAQ,GAAG,KAAZ;AAAmBC,IAAAA,eAAnB;AAAoCC,IAAAA,aAApC;AAAmDC,IAAAA,OAAnD;AAA4DC,IAAAA;AAA5D,MAAuEL,KAA7E;AACA,QAAMM,aAAa,GAAGZ,WAAW,CAAC,MAAMU,OAAO,EAAd,EAAkB,CAACA,OAAD,CAAlB,CAAjC;AAEA,QAAMG,SAAS,GAAG;AAChB,iBAAa,aADG;AAEhBF,IAAAA;AAFgB,GAAlB;AAKA,QAAMG,IAAI,gBACR;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW,eAAtB;AAAuC,iBAAU,cAAjD;AAAgE,kBAAYN;AAA5E,kBACE,oBAAC,UAAD,EAAgBI,SAAhB,CADF,CADF;AAKA,QAAMG,sBAAsB,GAAG;AAC7BC,IAAAA,IAAI,EAAE,SADuB;AAE7B,kBAAcT,eAFe;AAG7B,iBAAa,qBAHgB;AAI7BU,IAAAA,IAAI,EAAE,cAJuB;AAK7BR,IAAAA,OAAO,EAAEE,aALoB;AAM7BL,IAAAA;AAN6B,GAA/B;AASA,sBACE;AAAK,IAAA,SAAS,EAAEH,KAAK,CAACe,kBAAtB;AAA0C,iBAAU;AAApD,kBACE,oBAAC,kBAAD,eAAwBH,sBAAxB;AAAgD,IAAA,SAAS,EAAEZ,KAAK,CAACgB;AAAjE,KADF,EAEGN,IAFH,CADF;AAMD,CA7BD;;AA+BAT,qBAAqB,CAACgB,SAAtB,2CAAkC;AAChCd,EAAAA,QAAQ,EAAEN,SAAS,CAACqB,IADY;AAEhCd,EAAAA,eAAe,EAAEP,SAAS,CAACsB,MAFK;AAGhCd,EAAAA,aAAa,EAAER,SAAS,CAACsB,MAHO;AAIhCZ,EAAAA,OAAO,EAAER,UAAU,CAACkB,SAAX,CAAqBV,OAJE;AAKhCD,EAAAA,OAAO,EAAET,SAAS,CAACuB;AALa,CAAlC;AAQA,eAAenB,qBAAf","sourcesContent":["import React, {useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport ButtonMenu from '../../atom/button-menu';\nimport style from './style.css';\n\nconst BulletPointMenuButton = props => {\n const {disabled = false, buttonAriaLabel, menuAriaLabel, onClick, buttons} = props;\n const handleOnClick = useCallback(() => onClick(), [onClick]);\n\n const menuProps = {\n 'data-name': 'button-menu',\n buttons\n };\n\n const menu = (\n <div className={style.bulletPointMenu} data-name=\"menu-wrapper\" aria-label={menuAriaLabel}>\n <ButtonMenu {...menuProps} />\n </div>\n );\n const bulletPointButtonProps = {\n size: 'default',\n 'aria-label': buttonAriaLabel,\n 'data-name': 'bullet-point-button',\n icon: 'bullet-point',\n onClick: handleOnClick,\n disabled\n };\n\n return (\n <div className={style.bulletPointWrapper} data-name=\"bullet-point-wrapper\">\n <ButtonLinkIconOnly {...bulletPointButtonProps} className={style.bulletPointButton} />\n {menu}\n </div>\n );\n};\n\nBulletPointMenuButton.propTypes = {\n disabled: PropTypes.bool,\n buttonAriaLabel: PropTypes.string,\n menuAriaLabel: PropTypes.string,\n buttons: ButtonMenu.propTypes.buttons,\n onClick: PropTypes.func\n};\n\nexport default BulletPointMenuButton;\n"],"file":"index.js"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload
|
|
3
|
+
import { NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond, NovaSolidApplicationsWindowUpload3 as WindowUpload } from '@coorpacademy/nova-icons';
|
|
4
4
|
import Cta from '../../atom/button-link';
|
|
5
|
+
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
5
6
|
import style from './style.css';
|
|
6
7
|
|
|
7
8
|
const CMPopin = props => {
|
|
@@ -23,13 +24,13 @@ const CMPopin = props => {
|
|
|
23
24
|
className: style.popin
|
|
24
25
|
}, /*#__PURE__*/React.createElement("header", {
|
|
25
26
|
className: style.popinHeader
|
|
26
|
-
}, onClose ? /*#__PURE__*/React.createElement(
|
|
27
|
-
className: style.headerCloseIconContainer,
|
|
27
|
+
}, onClose ? /*#__PURE__*/React.createElement(ButtonLinkIconOnly, {
|
|
28
28
|
onClick: onClose,
|
|
29
|
-
"data-name": 'close-icon'
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
"data-name": 'close-icon',
|
|
30
|
+
"aria-label": 'close-icon',
|
|
31
|
+
size: "small",
|
|
32
|
+
icon: "close"
|
|
33
|
+
}) : null), /*#__PURE__*/React.createElement("div", {
|
|
33
34
|
className: style.contentSection
|
|
34
35
|
}, LogoComponent ? /*#__PURE__*/React.createElement(LogoComponent, {
|
|
35
36
|
className: style.icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/cm-popin/index.js"],"names":["React","PropTypes","NovaSolidInterfaceFeedbackInterfaceAlertDiamond","AlertDiamond","NovaSolidApplicationsWindowUpload3","WindowUpload","Cta","ButtonLinkIconOnly","style","CMPopin","props","content","firstButton","secondButton","onClose","icon","logo","LogoComponent","background","popin","popinHeader","contentSection","__html","buttonContainer","button","label","handleOnclick","type","propTypes","string","shape","func","oneOf"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SACEC,+CAA+C,IAAIC,YADrD,EAEEC,kCAAkC,IAAIC,YAFxC,QAGO,0BAHP;AAIA,OAAOC,GAAP,MAAgB,wBAAhB;AACA,OAAOC,kBAAP,MAA+B,kCAA/B;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,OAAO,GAAGC,KAAK,IAAI;AACvB,QAAM;AAACC,IAAAA,OAAD;AAAUC,IAAAA,WAAV;AAAuBC,IAAAA,YAAvB;AAAqCC,IAAAA,OAArC;AAA8CC,IAAAA;AAA9C,MAAsDL,KAA5D;AAEA,QAAMM,IAAI,GAAG;AACXb,IAAAA,YADW;AAEXE,IAAAA;AAFW,GAAb;AAIA,QAAMY,aAAa,GAAGD,IAAI,CAACD,IAAD,CAA1B;AAEA,sBACE;AAAK,IAAA,SAAS,EAAEP,KAAK,CAACU;AAAtB,kBACE;AAAK,IAAA,SAAS,EAAEV,KAAK,CAACW;AAAtB,kBACE;AAAQ,IAAA,SAAS,EAAEX,KAAK,CAACY;AAAzB,KACGN,OAAO,gBACN,oBAAC,kBAAD;AACE,IAAA,OAAO,EAAEA,OADX;AAEE,iBAAW,YAFb;AAGE,kBAAY,YAHd;AAIE,IAAA,IAAI,EAAC,OAJP;AAKE,IAAA,IAAI,EAAC;AALP,IADM,GAQJ,IATN,CADF,eAYE;AAAK,IAAA,SAAS,EAAEN,KAAK,CAACa;AAAtB,KACGJ,aAAa,gBAAG,oBAAC,aAAD;AAAe,IAAA,SAAS,EAAET,KAAK,CAACO;AAAhC,IAAH,GAA8C,IAD9D,eAEE;AACE,IAAA,SAAS,EAAEP,KAAK,CAACG,OADnB;AAE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AK,EAAExB,SAAS,CAAC4B,MADW;AAE5BH,IAAAA,aAAa,EAAEzB,SAAS,CAAC8B,IAFG;AAG5BJ,IAAAA,IAAI,EAAE1B,SAAS,CAAC+B,KAAV,CAAgB,CAAC,WAAD,EAAc,SAAd,CAAhB,CAHsB;AAI5B,kBAAc/B,SAAS,CAAC4B;AAJI,GAAhB,CARI;AAclBf,EAAAA,OAAO,EAAEb,SAAS,CAAC8B,IAdD;AAelBhB,EAAAA,IAAI,EAAEd,SAAS,CAAC4B;AAfE,CAApB;AAkBA,eAAepB,OAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n NovaSolidInterfaceFeedbackInterfaceAlertDiamond as AlertDiamond,\n NovaSolidApplicationsWindowUpload3 as WindowUpload\n} from '@coorpacademy/nova-icons';\nimport Cta from '../../atom/button-link';\nimport ButtonLinkIconOnly from '../../atom/button-link-icon-only';\nimport style from './style.css';\n\nconst CMPopin = props => {\n const {content, firstButton, secondButton, onClose, icon} = props;\n\n const logo = {\n AlertDiamond,\n WindowUpload\n };\n const LogoComponent = logo[icon];\n\n return (\n <div className={style.background}>\n <div className={style.popin}>\n <header className={style.popinHeader}>\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 className={style.contentSection}>\n {LogoComponent ? <LogoComponent className={style.icon} /> : null}\n <p\n className={style.content}\n data-name={`cm-popin-content`}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: content}}\n />\n </div>\n\n <div className={style.buttonContainer}>\n {firstButton ? (\n <div className={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 />\n </div>\n ) : null}\n {secondButton ? (\n <div className={style.button}>\n <Cta\n label={secondButton.label}\n onClick={secondButton.handleOnclick}\n data-name={`cm-popin-cta-${secondButton.type}`}\n aria-label={firstButton['aria-label']}\n type={secondButton.type}\n />\n </div>\n ) : null}\n </div>\n </div>\n )\n </div>\n );\n};\n\nCMPopin.propTypes = {\n content: PropTypes.string,\n firstButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n 'aria-label': PropTypes.string,\n type: PropTypes.string\n }),\n secondButton: PropTypes.shape({\n label: PropTypes.string,\n handleOnclick: PropTypes.func,\n type: PropTypes.oneOf(['dangerous', 'primary']),\n 'aria-label': PropTypes.string\n }),\n onClose: PropTypes.func,\n icon: PropTypes.string\n};\n\nexport default CMPopin;\n"],"file":"index.js"}
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
@value cm_grey_200 from colors;
|
|
15
15
|
@value cm_blue_600 from colors;
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
.background {
|
|
19
18
|
top: 0px;
|
|
20
19
|
width: 100%;
|
|
@@ -84,30 +83,6 @@
|
|
|
84
83
|
color: cm_grey_800;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
.headerCloseIconContainer {
|
|
88
|
-
width: 44px;
|
|
89
|
-
height: 44px;
|
|
90
|
-
display: flex;
|
|
91
|
-
flex-direction: row;
|
|
92
|
-
justify-content: center;
|
|
93
|
-
align-items: center;
|
|
94
|
-
margin-top: 16px;
|
|
95
|
-
margin-right: 16px;
|
|
96
|
-
border-radius: 7px;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
background-color: cm_grey_100;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.headerCloseIconContainer:hover {
|
|
102
|
-
background-color: cm_grey_200;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.headerCloseIcon {
|
|
106
|
-
width: 18px;
|
|
107
|
-
height: 18px;
|
|
108
|
-
color: cm_grey_800;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
86
|
.popinHeader {
|
|
112
87
|
width: 100%;
|
|
113
88
|
display: flex;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeSearch from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureWithValue from './fixtures/with-value';
|
|
7
|
+
test('Molecule › MoleculeSearch > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeSearch.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeSearch.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);
|
|
14
|
+
test('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/search/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeSearch","fixtureDefault","fixtureWithValue","t","pass","propTypes","value","key","not","undefined"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,oBAAP,MAAiC,wCAAjC;AACA,OAAOC,cAAP,MAA2B,IAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AAEAL,IAAI,CAAC,yDAAD,EAA4DM,CAAC,IAAI;AACnEA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,cAAc,CAACK,SAAhB,EAA2B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAChDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,mDAAkDF,GAAI,mEAA/E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,0DAAD,EAA6DE,oBAA7D,EAAmFC,cAAnF,EAAmGC,cAAnG,CAAJ;AACAJ,IAAI,CAAC,4DAAD,EAA+DE,oBAA/D,EAAqFC,cAArF,EAAqGE,gBAArG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeSearch from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWithValue from './fixtures/with-value';\n\ntest('Molecule › MoleculeSearch > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeSearch.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeSearch.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeSearch › Default › should be rendered', renderComponentMacro, MoleculeSearch, fixtureDefault);\ntest('Molecule › MoleculeSearch › WithValue › should be rendered', renderComponentMacro, MoleculeSearch, fixtureWithValue);\n"],"file":"fixtures.js"}
|
|
@@ -12,7 +12,6 @@ import fixtureLms from './fixtures/lms';
|
|
|
12
12
|
import fixtureLookandfeel from './fixtures/lookandfeel';
|
|
13
13
|
import fixtureManageusersEdit from './fixtures/manageusers-edit';
|
|
14
14
|
import fixtureSso from './fixtures/sso';
|
|
15
|
-
import fixtureWizardPlaylists from './fixtures/wizard-playlists';
|
|
16
15
|
test('Organism › OrganismBrandForm > should have valid propTypes', t => {
|
|
17
16
|
t.pass();
|
|
18
17
|
forEach(OrganismBrandForm.propTypes, (value, key) => {
|
|
@@ -29,5 +28,4 @@ test('Organism › OrganismBrandForm › Lms › should be rendered', renderComp
|
|
|
29
28
|
test('Organism › OrganismBrandForm › Lookandfeel › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureLookandfeel);
|
|
30
29
|
test('Organism › OrganismBrandForm › ManageusersEdit › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureManageusersEdit);
|
|
31
30
|
test('Organism › OrganismBrandForm › Sso › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureSso);
|
|
32
|
-
test('Organism › OrganismBrandForm › WizardPlaylists › should be rendered', renderComponentMacro, OrganismBrandForm, fixtureWizardPlaylists);
|
|
33
31
|
//# sourceMappingURL=fixtures.js.map
|