@coorpacademy/components 10.1.6 → 10.1.10
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 +7 -23
- package/es/atom/button-link/index.js.map +1 -1
- package/es/atom/button-link/style.css +4 -2
- 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-icon-only/test/button-link-icon-only.js +25 -0
- 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/atom/button-link-icon-only/test/fixtures.js +21 -0
- package/es/atom/button-link-icon-only/test/fixtures.js.map +1 -0
- package/es/atom/button-menu/index.js +66 -0
- package/es/atom/button-menu/index.js.map +1 -0
- package/es/atom/button-menu/style.css +51 -0
- package/es/atom/button-menu/test/fixtures/default.js +20 -0
- package/es/atom/button-menu/test/fixtures/default.js.map +1 -0
- package/es/atom/button-menu/test/fixtures/multiple-buttons.js +15 -0
- package/es/atom/button-menu/test/fixtures/multiple-buttons.js.map +1 -0
- package/es/atom/button-menu/test/fixtures.js +15 -0
- package/es/atom/button-menu/test/fixtures.js.map +1 -0
- package/es/atom/empty-search-result/index.js +24 -0
- package/es/atom/empty-search-result/index.js.map +1 -0
- package/es/atom/empty-search-result/style.css +25 -0
- package/es/atom/empty-search-result/test/fixtures/default.js +7 -0
- package/es/atom/empty-search-result/test/fixtures/default.js.map +1 -0
- package/es/atom/empty-search-result/test/fixtures.js +13 -0
- package/es/atom/empty-search-result/test/fixtures.js.map +1 -0
- package/es/atom/input-text/index.js +3 -2
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/tag/index.js +3 -2
- package/es/atom/tag/index.js.map +1 -1
- package/es/atom/tag/style.css +5 -1
- package/es/atom/tag/test/fixtures/draft.js +7 -0
- package/es/atom/tag/test/fixtures/draft.js.map +1 -0
- package/es/atom/tag/test/fixtures/{revision.js → revised.js} +2 -2
- package/es/atom/tag/test/fixtures/revised.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/index.js +51 -0
- package/es/molecule/bullet-point-menu-button/index.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/style.css +52 -0
- package/es/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js +34 -0
- package/es/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/default.js +11 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/default.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js +13 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js.map +1 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures.js +15 -0
- package/es/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
- 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/molecule/vertical-tabs/index.js +8 -3
- package/es/molecule/vertical-tabs/index.js.map +1 -1
- package/es/molecule/vertical-tabs/test/fixtures/default.js +2 -1
- package/es/molecule/vertical-tabs/test/fixtures/default.js.map +1 -1
- package/es/molecule/vertical-tabs/test/fixtures/with-selected-item.js +2 -1
- package/es/molecule/vertical-tabs/test/fixtures/with-selected-item.js.map +1 -1
- package/es/organism/course-selection/index.js +57 -0
- package/es/organism/course-selection/index.js.map +1 -0
- package/es/organism/course-selection/style.css +23 -0
- package/es/organism/course-selection/test/fixtures/default.js +34 -0
- package/es/organism/course-selection/test/fixtures/default.js.map +1 -0
- package/es/organism/course-selection/test/fixtures/empty.js +18 -0
- package/es/organism/course-selection/test/fixtures/empty.js.map +1 -0
- package/es/organism/course-selection/test/fixtures/filtered.js +24 -0
- package/es/organism/course-selection/test/fixtures/filtered.js.map +1 -0
- package/es/organism/course-selection/test/fixtures/sorted-selected.js +31 -0
- package/es/organism/course-selection/test/fixtures/sorted-selected.js.map +1 -0
- package/es/organism/course-selection/test/fixtures/unsorted-selected.js +31 -0
- package/es/organism/course-selection/test/fixtures/unsorted-selected.js.map +1 -0
- package/es/organism/course-selection/test/fixtures.js +21 -0
- package/es/organism/course-selection/test/fixtures.js.map +1 -0
- package/es/organism/playlist-translation/index.js +63 -0
- package/es/organism/playlist-translation/index.js.map +1 -0
- package/es/organism/playlist-translation/style.css +45 -0
- package/es/organism/playlist-translation/test/fixtures/default.js +24 -0
- package/es/organism/playlist-translation/test/fixtures/default.js.map +1 -0
- package/es/organism/playlist-translation/test/fixtures/delete.js +18 -0
- package/es/organism/playlist-translation/test/fixtures/delete.js.map +1 -0
- package/es/organism/playlist-translation/test/fixtures.js +15 -0
- package/es/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/es/organism/search-and-chips-results/index.js +3 -8
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +0 -22
- 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/template/teams-dashboard/index.js +4 -3
- package/es/template/teams-dashboard/index.js.map +1 -1
- package/es/util/button-icons.js +16 -0
- package/es/util/button-icons.js.map +1 -0
- package/lib/atom/button-link/index.js +9 -25
- package/lib/atom/button-link/index.js.map +1 -1
- package/lib/atom/button-link/style.css +4 -2
- 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-icon-only/test/button-link-icon-only.js +37 -0
- package/lib/atom/button-link-icon-only/test/button-link-icon-only.js.map +1 -0
- package/lib/atom/button-link-icon-only/test/fixtures/button-icon-bullet.js +15 -0
- 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/atom/button-link-icon-only/test/fixtures.js +34 -0
- package/lib/atom/button-link-icon-only/test/fixtures.js.map +1 -0
- package/lib/atom/button-menu/index.js +82 -0
- package/lib/atom/button-menu/index.js.map +1 -0
- package/lib/atom/button-menu/style.css +51 -0
- package/lib/atom/button-menu/test/fixtures/default.js +27 -0
- package/lib/atom/button-menu/test/fixtures/default.js.map +1 -0
- package/lib/atom/button-menu/test/fixtures/multiple-buttons.js +23 -0
- package/lib/atom/button-menu/test/fixtures/multiple-buttons.js.map +1 -0
- package/lib/atom/button-menu/test/fixtures.js +25 -0
- package/lib/atom/button-menu/test/fixtures.js.map +1 -0
- package/lib/atom/empty-search-result/index.js +34 -0
- package/lib/atom/empty-search-result/index.js.map +1 -0
- package/lib/atom/empty-search-result/style.css +25 -0
- package/lib/atom/empty-search-result/test/fixtures/default.js +12 -0
- package/lib/atom/empty-search-result/test/fixtures/default.js.map +1 -0
- package/lib/atom/empty-search-result/test/fixtures.js +22 -0
- package/lib/atom/empty-search-result/test/fixtures.js.map +1 -0
- package/lib/atom/input-text/index.js +3 -2
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/tag/index.js +3 -2
- package/lib/atom/tag/index.js.map +1 -1
- package/lib/atom/tag/style.css +5 -1
- package/lib/atom/tag/test/fixtures/draft.js +12 -0
- package/lib/atom/tag/test/fixtures/draft.js.map +1 -0
- package/lib/atom/tag/test/fixtures/{revision.js → revised.js} +2 -2
- package/lib/atom/tag/test/fixtures/revised.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/index.js +69 -0
- package/lib/molecule/bullet-point-menu-button/index.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/style.css +52 -0
- package/lib/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js +46 -0
- package/lib/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/default.js +18 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/default.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js +25 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js.map +1 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js +25 -0
- package/lib/molecule/bullet-point-menu-button/test/fixtures.js.map +1 -0
- 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/molecule/vertical-tabs/index.js +8 -3
- package/lib/molecule/vertical-tabs/index.js.map +1 -1
- package/lib/molecule/vertical-tabs/test/fixtures/default.js +2 -1
- package/lib/molecule/vertical-tabs/test/fixtures/default.js.map +1 -1
- package/lib/molecule/vertical-tabs/test/fixtures/with-selected-item.js +2 -1
- package/lib/molecule/vertical-tabs/test/fixtures/with-selected-item.js.map +1 -1
- package/lib/organism/course-selection/index.js +70 -0
- package/lib/organism/course-selection/index.js.map +1 -0
- package/lib/organism/course-selection/style.css +23 -0
- package/lib/organism/course-selection/test/fixtures/default.js +47 -0
- package/lib/organism/course-selection/test/fixtures/default.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures/empty.js +23 -0
- package/lib/organism/course-selection/test/fixtures/empty.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures/filtered.js +36 -0
- package/lib/organism/course-selection/test/fixtures/filtered.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures/sorted-selected.js +44 -0
- package/lib/organism/course-selection/test/fixtures/sorted-selected.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures/unsorted-selected.js +44 -0
- package/lib/organism/course-selection/test/fixtures/unsorted-selected.js.map +1 -0
- package/lib/organism/course-selection/test/fixtures.js +34 -0
- package/lib/organism/course-selection/test/fixtures.js.map +1 -0
- package/lib/organism/playlist-translation/index.js +78 -0
- package/lib/organism/playlist-translation/index.js.map +1 -0
- package/lib/organism/playlist-translation/style.css +45 -0
- package/lib/organism/playlist-translation/test/fixtures/default.js +35 -0
- package/lib/organism/playlist-translation/test/fixtures/default.js.map +1 -0
- package/lib/organism/playlist-translation/test/fixtures/delete.js +29 -0
- package/lib/organism/playlist-translation/test/fixtures/delete.js.map +1 -0
- package/lib/organism/playlist-translation/test/fixtures.js +25 -0
- package/lib/organism/playlist-translation/test/fixtures.js.map +1 -0
- package/lib/organism/search-and-chips-results/index.js +4 -8
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +0 -22
- 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/template/teams-dashboard/index.js +3 -1
- package/lib/template/teams-dashboard/index.js.map +1 -1
- package/lib/util/button-icons.js +23 -0
- package/lib/util/button-icons.js.map +1 -0
- package/package.json +3 -3
- package/es/atom/button-link/test/fixtures/icon-button.js.map +0 -1
- package/es/atom/tag/test/fixtures/revision.js.map +0 -1
- package/lib/atom/button-link/test/fixtures/icon-button.js.map +0 -1
- package/lib/atom/tag/test/fixtures/revision.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-menu/test/fixtures/default.js"],"names":["actionButtonProps","label","onClick","console","log","type","deleteButtonProps","props","buttons"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB,GAAG;AAC/B,eAAa,qBADkB;AAE/BC,EAAAA,KAAK,EAAE,SAFwB;AAG/BC,EAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,SAAZ,CAHgB;AAI/BC,EAAAA,IAAI,EAAE;AAJyB,CAA1B;AAOP,OAAO,MAAMC,iBAAiB,GAAG;AAC/B,eAAa,oBADkB;AAE/BL,EAAAA,KAAK,EAAE,QAFwB;AAG/BC,EAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,QAAZ,CAHgB;AAI/BC,EAAAA,IAAI,EAAE;AAJyB,CAA1B;AAOP,eAAe;AACbE,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,CAACR,iBAAD,EAAoBM,iBAApB,CADJ;AAEL,kBAAc,aAFT;AAGL,iBAAa;AAHR;AADM,CAAf","sourcesContent":["export const actionButtonProps = {\n 'data-name': 'menu-publish-button',\n label: 'Publish',\n onClick: () => console.log('Publish'),\n type: 'default'\n};\n\nexport const deleteButtonProps = {\n 'data-name': 'menu-delete-button',\n label: 'Delete',\n onClick: () => console.log('Delete'),\n type: 'dangerous'\n};\n\nexport default {\n props: {\n buttons: [actionButtonProps, deleteButtonProps],\n 'aria-label': 'aria button',\n 'data-name': 'default-menu'\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { actionButtonProps, deleteButtonProps } from './default';
|
|
2
|
+
export const disabledButtonProps = {
|
|
3
|
+
'data-name': 'menu-disabled-button',
|
|
4
|
+
label: 'Disabled',
|
|
5
|
+
onClick: () => console.log('Disabled'),
|
|
6
|
+
disabled: true
|
|
7
|
+
};
|
|
8
|
+
export default {
|
|
9
|
+
props: {
|
|
10
|
+
buttons: [actionButtonProps, disabledButtonProps, deleteButtonProps],
|
|
11
|
+
'aria-label': 'aria button 2',
|
|
12
|
+
'data-name': 'default-menu-2'
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=multiple-buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/button-menu/test/fixtures/multiple-buttons.js"],"names":["actionButtonProps","deleteButtonProps","disabledButtonProps","label","onClick","console","log","disabled","props","buttons"],"mappings":"AAAA,SAAQA,iBAAR,EAA2BC,iBAA3B,QAAmD,WAAnD;AAEA,OAAO,MAAMC,mBAAmB,GAAG;AACjC,eAAa,sBADoB;AAEjCC,EAAAA,KAAK,EAAE,UAF0B;AAGjCC,EAAAA,OAAO,EAAE,MAAMC,OAAO,CAACC,GAAR,CAAY,UAAZ,CAHkB;AAIjCC,EAAAA,QAAQ,EAAE;AAJuB,CAA5B;AAOP,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,CAACT,iBAAD,EAAoBE,mBAApB,EAAyCD,iBAAzC,CADJ;AAEL,kBAAc,eAFT;AAGL,iBAAa;AAHR;AADM,CAAf","sourcesContent":["import {actionButtonProps, deleteButtonProps} from './default';\n\nexport const disabledButtonProps = {\n 'data-name': 'menu-disabled-button',\n label: 'Disabled',\n onClick: () => console.log('Disabled'),\n disabled: true\n};\n\nexport default {\n props: {\n buttons: [actionButtonProps, disabledButtonProps, deleteButtonProps],\n 'aria-label': 'aria button 2',\n 'data-name': 'default-menu-2'\n }\n};\n"],"file":"multiple-buttons.js"}
|
|
@@ -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 AtomButtonMenu from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureMultipleButtons from './fixtures/multiple-buttons';
|
|
7
|
+
test('Atom › AtomButtonMenu > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(AtomButtonMenu.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Atom.AtomButtonMenu.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Atom › AtomButtonMenu › Default › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureDefault);
|
|
14
|
+
test('Atom › AtomButtonMenu › MultipleButtons › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureMultipleButtons);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/button-menu/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomButtonMenu","fixtureDefault","fixtureMultipleButtons","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,sBAAP,MAAmC,6BAAnC;AAEAL,IAAI,CAAC,qDAAD,EAAwDM,CAAC,IAAI;AAC/DA,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,+CAA8CF,GAAI,mEAA3E;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,cAA/E,EAA+FC,cAA/F,CAAJ;AACAJ,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,cAAvF,EAAuGE,sBAAvG,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomButtonMenu from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureMultipleButtons from './fixtures/multiple-buttons';\n\ntest('Atom › AtomButtonMenu > should have valid propTypes', t => {\n t.pass();\n forEach(AtomButtonMenu.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomButtonMenu.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomButtonMenu › Default › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureDefault);\ntest('Atom › AtomButtonMenu › MultipleButtons › should be rendered', renderComponentMacro, AtomButtonMenu, fixtureMultipleButtons);\n"],"file":"fixtures.js"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import style from './style.css';
|
|
4
|
+
|
|
5
|
+
const EmptySearchResult = props => {
|
|
6
|
+
const {
|
|
7
|
+
firstMessage,
|
|
8
|
+
secondMessage
|
|
9
|
+
} = props;
|
|
10
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: style.container
|
|
12
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
13
|
+
className: style.firstMessage
|
|
14
|
+
}, firstMessage), /*#__PURE__*/React.createElement("span", {
|
|
15
|
+
className: style.secondMessage
|
|
16
|
+
}, secondMessage));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
EmptySearchResult.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
20
|
+
firstMessage: PropTypes.string.isRequired,
|
|
21
|
+
secondMessage: PropTypes.string.isRequired
|
|
22
|
+
} : {};
|
|
23
|
+
export default EmptySearchResult;
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/empty-search-result/index.js"],"names":["React","PropTypes","style","EmptySearchResult","props","firstMessage","secondMessage","container","propTypes","string","isRequired"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,KAAP,MAAkB,aAAlB;;AAEA,MAAMC,iBAAiB,GAAGC,KAAK,IAAI;AACjC,QAAM;AAACC,IAAAA,YAAD;AAAeC,IAAAA;AAAf,MAAgCF,KAAtC;AACA,sBACE;AAAK,IAAA,SAAS,EAAEF,KAAK,CAACK;AAAtB,kBACE;AAAM,IAAA,SAAS,EAAEL,KAAK,CAACG;AAAvB,KAAsCA,YAAtC,CADF,eAEE;AAAM,IAAA,SAAS,EAAEH,KAAK,CAACI;AAAvB,KAAuCA,aAAvC,CAFF,CADF;AAMD,CARD;;AAUAH,iBAAiB,CAACK,SAAlB,2CAA8B;AAC5BH,EAAAA,YAAY,EAAEJ,SAAS,CAACQ,MAAV,CAAiBC,UADH;AAE5BJ,EAAAA,aAAa,EAAEL,SAAS,CAACQ,MAAV,CAAiBC;AAFJ,CAA9B;AAKA,eAAeP,iBAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport style from './style.css';\n\nconst EmptySearchResult = props => {\n const {firstMessage, secondMessage} = props;\n return (\n <div className={style.container}>\n <span className={style.firstMessage}>{firstMessage}</span>\n <span className={style.secondMessage}>{secondMessage}</span>\n </div>\n );\n};\n\nEmptySearchResult.propTypes = {\n firstMessage: PropTypes.string.isRequired,\n secondMessage: PropTypes.string.isRequired\n};\n\nexport default EmptySearchResult;\n"],"file":"index.js"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value cm_primary_blue from colors;
|
|
3
|
+
@value cm_grey_900 from colors;
|
|
4
|
+
|
|
5
|
+
.container {
|
|
6
|
+
margin: 48px 0;
|
|
7
|
+
width: 100%;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: bold;
|
|
13
|
+
font-family: Gilroy;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.firstMessage {
|
|
18
|
+
color: cm_grey_900;
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.secondMessage {
|
|
23
|
+
color: cm_primary_blue;
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/empty-search-result/test/fixtures/default.js"],"names":["props","firstMessage","secondMessage"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,YAAY,EAAE,eADT;AAELC,IAAAA,aAAa,EAAE;AAFV;AADM,CAAf","sourcesContent":["export default {\n props: {\n firstMessage: 'No results...',\n secondMessage: 'Try something else'\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import AtomEmptySearchResult from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
test('Atom › AtomEmptySearchResult > should have valid propTypes', t => {
|
|
7
|
+
t.pass();
|
|
8
|
+
forEach(AtomEmptySearchResult.propTypes, (value, key) => {
|
|
9
|
+
t.not(value, undefined, `PropType for "Atom.AtomEmptySearchResult.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
test('Atom › AtomEmptySearchResult › Default › should be rendered', renderComponentMacro, AtomEmptySearchResult, fixtureDefault);
|
|
13
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/atom/empty-search-result/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","AtomEmptySearchResult","fixtureDefault","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,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAJ,IAAI,CAAC,4DAAD,EAA+DK,CAAC,IAAI;AACtEA,EAAAA,CAAC,CAACC,IAAF;AACAL,EAAAA,OAAO,CAACE,qBAAqB,CAACI,SAAvB,EAAkC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACvDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,sDAAqDF,GAAI,mEAAlF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAT,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,qBAAtF,EAA6GC,cAA7G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport AtomEmptySearchResult from '..';\nimport fixtureDefault from './fixtures/default';\n\ntest('Atom › AtomEmptySearchResult > should have valid propTypes', t => {\n t.pass();\n forEach(AtomEmptySearchResult.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Atom.AtomEmptySearchResult.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Atom › AtomEmptySearchResult › Default › should be rendered', renderComponentMacro, AtomEmptySearchResult, fixtureDefault);\n"],"file":"fixtures.js"}
|
|
@@ -32,6 +32,7 @@ const InputText = props => {
|
|
|
32
32
|
modified = false,
|
|
33
33
|
title: propsTitle
|
|
34
34
|
} = props;
|
|
35
|
+
const isCMTheme = theme === 'coorpmanager';
|
|
35
36
|
const title = `${propsTitle}${required ? '*' : ''}`;
|
|
36
37
|
const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);
|
|
37
38
|
const mainClass = themeStyle[theme];
|
|
@@ -53,10 +54,10 @@ const InputText = props => {
|
|
|
53
54
|
__html: error || hint
|
|
54
55
|
}
|
|
55
56
|
}) : null;
|
|
56
|
-
const errorIconView = error ? /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
57
|
+
const errorIconView = isCMTheme && error ? /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
57
58
|
className: style.leftIcon
|
|
58
59
|
}) : null;
|
|
59
|
-
const validIconView = valid ? /*#__PURE__*/React.createElement(CheckIcon, {
|
|
60
|
+
const validIconView = isCMTheme && valid ? /*#__PURE__*/React.createElement(CheckIcon, {
|
|
60
61
|
className: style.leftIcon
|
|
61
62
|
}) : null;
|
|
62
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/input-text/index.js"],"names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","InputText","props","autoFocus","placeholder","value","hint","defaultValue","onChange","error","valid","theme","description","disabled","required","modified","title","propsTitle","handleChange","e","target","mainClass","className","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","isNoTitle","noValue","input","propTypes","bool","string","oneOf","func"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAeC,OAAf,QAA6B,OAA7B;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,SACEC,2BAA2B,IAAIC,SADjC,EAEEC,oBAAoB,IAAIC,SAF1B,EAGEC,0CAA0C,IAAIC,QAHhD,QAIO,0BAJP;AAKA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEF,KAAK,CAACE,KADI;AAEjBC,EAAAA,YAAY,EAAEH,KAAK,CAACG,YAFH;AAGjBC,EAAAA,OAAO,EAAEJ,KAAK,CAACI,OAHE;AAIjBC,EAAAA,OAAO,EAAEL,KAAK,CAACK;AAJE,CAAnB;;AAMA,MAAMC,SAAS,GAAGC,KAAK,IAAI;AACzB,QAAM;AACJC,IAAAA,SAAS,GAAG,KADR;AAEJC,IAAAA,WAAW,GAAG,EAFV;AAGJC,IAAAA,KAHI;AAIJC,IAAAA,IAJI;AAKJC,IAAAA,YALI;AAMJC,IAAAA,QAAQ,QANJ;AAOJC,IAAAA,KAPI;AAQJC,IAAAA,KARI;AASJC,IAAAA,KAAK,GAAG,SATJ;AAUJC,IAAAA,WAVI;AAWJC,IAAAA,QAXI;AAYJC,IAAAA,QAZI;AAaJC,IAAAA,QAAQ,GAAG,KAbP;AAcJC,IAAAA,KAAK,EAAEC;AAdH,MAeFf,KAfJ;AAiBA,
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/input-text/index.js"],"names":["React","useMemo","PropTypes","NovaSolidStatusCheckCircle2","CheckIcon","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","classnames","getClassState","style","themeStyle","setup","coorpmanager","cockpit","default","InputText","props","autoFocus","placeholder","value","hint","defaultValue","onChange","error","valid","theme","description","disabled","required","modified","title","propsTitle","isCMTheme","handleChange","e","target","mainClass","className","descriptionView","toolTipView","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","errorIconView","leftIcon","validIconView","isNoTitle","noValue","input","propTypes","bool","string","oneOf","func"],"mappings":"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","sourcesContent":["import React, {useMemo} from 'react';\nimport PropTypes from 'prop-types';\nimport {noop, isNil, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaSolidStatusCheckCircle2 as CheckIcon,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport classnames from 'classnames';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n coorpmanager: style.coorpmanager,\n cockpit: style.cockpit,\n default: style.default\n};\nconst InputText = props => {\n const {\n autoFocus = false,\n placeholder = '',\n value,\n hint,\n defaultValue,\n onChange = noop,\n error,\n valid,\n theme = 'default',\n description,\n disabled,\n required,\n modified = false,\n title: propsTitle\n } = props;\n\n const isCMTheme = theme === 'coorpmanager';\n const title = `${propsTitle}${required ? '*' : ''}`;\n const handleChange = useMemo(() => e => onChange(e.target.value), [onChange]);\n const mainClass = themeStyle[theme];\n const className = getClassState(style.default, style.modified, style.error, modified, error);\n const descriptionView =\n description && theme !== 'coorpmanager' ? (\n <div className={style.description}>{description}</div>\n ) : null;\n const toolTipView =\n description && theme === 'coorpmanager' ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null;\n const hintView =\n theme === 'coorpmanager' ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n const errorIconView = isCMTheme && error ? <ErrorIcon className={style.leftIcon} /> : null;\n const validIconView = isCMTheme && valid ? <CheckIcon className={style.leftIcon} /> : null;\n\n return (\n <div\n className={classnames(\n mainClass,\n className,\n disabled && style.disabled,\n isNil(propsTitle) && style.isNoTitle\n )}\n >\n <label>\n <span className={classnames(style.title, isEmpty(value) && style.noValue)}>\n {title}\n {toolTipView}\n </span>\n\n <input\n autoFocus={autoFocus}\n type=\"text\"\n name={title}\n className={style.input}\n placeholder={placeholder}\n defaultValue={defaultValue}\n autoComplete={'off'}\n value={value}\n onInput={handleChange}\n disabled={disabled}\n onChange={noop}\n />\n {errorIconView}\n {validIconView}\n {hintView}\n </label>\n {descriptionView}\n </div>\n );\n};\n\nInputText.propTypes = {\n autoFocus: PropTypes.bool,\n title: PropTypes.string,\n placeholder: PropTypes.string,\n defaultValue: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle)),\n disabled: PropTypes.bool,\n required: PropTypes.bool,\n value: PropTypes.string,\n hint: PropTypes.string,\n error: PropTypes.string,\n onChange: PropTypes.func,\n description: PropTypes.string,\n modified: PropTypes.bool,\n valid: PropTypes.bool\n};\nexport default InputText;\n"],"file":"index.js"}
|
package/es/atom/tag/index.js
CHANGED
|
@@ -5,8 +5,9 @@ import style from './style.css';
|
|
|
5
5
|
const TAG_STYLES = {
|
|
6
6
|
default: style.default,
|
|
7
7
|
published: style.published,
|
|
8
|
-
|
|
9
|
-
archived: style.archived
|
|
8
|
+
revised: style.revised,
|
|
9
|
+
archived: style.archived,
|
|
10
|
+
draft: style.draft
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
const Tag = props => {
|
package/es/atom/tag/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/atom/tag/index.js"],"names":["React","PropTypes","style","TAG_STYLES","default","published","
|
|
1
|
+
{"version":3,"sources":["../../../src/atom/tag/index.js"],"names":["React","PropTypes","style","TAG_STYLES","default","published","revised","archived","draft","Tag","props","label","type","propTypes","string","oneOf"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,OAAO,EAAEF,KAAK,CAACE,OADE;AAEjBC,EAAAA,SAAS,EAAEH,KAAK,CAACG,SAFA;AAGjBC,EAAAA,OAAO,EAAEJ,KAAK,CAACI,OAHE;AAIjBC,EAAAA,QAAQ,EAAEL,KAAK,CAACK,QAJC;AAKjBC,EAAAA,KAAK,EAAEN,KAAK,CAACM;AALI,CAAnB;;AAQA,MAAMC,GAAG,GAAGC,KAAK,IAAI;AACnB,QAAM;AAACC,IAAAA,KAAD;AAAQC,IAAAA,IAAI,GAAG;AAAf,MAA4BF,KAAlC;AAEA,sBAAO;AAAM,IAAA,SAAS,EAAEP,UAAU,CAACS,IAAD;AAA3B,KAAoCD,KAApC,CAAP;AACD,CAJD;;AAMAF,GAAG,CAACI,SAAJ,2CAAgB;AACdF,EAAAA,KAAK,EAAEV,SAAS,CAACa,MADH;AAEdF,EAAAA,IAAI,EAAEX,SAAS,CAACc,KAAV,CAAgB,MAAKZ,UAAL,CAAhB;AAFQ,CAAhB;AAKA,eAAeM,GAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys} from 'lodash/fp';\nimport style from './style.css';\n\nconst TAG_STYLES = {\n default: style.default,\n published: style.published,\n revised: style.revised,\n archived: style.archived,\n draft: style.draft\n};\n\nconst Tag = props => {\n const {label, type = 'default'} = props;\n\n return <span className={TAG_STYLES[type]}>{label}</span>;\n};\n\nTag.propTypes = {\n label: PropTypes.string,\n type: PropTypes.oneOf(keys(TAG_STYLES))\n};\n\nexport default Tag;\n"],"file":"index.js"}
|
package/es/atom/tag/style.css
CHANGED
|
@@ -19,12 +19,16 @@
|
|
|
19
19
|
color: black;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.
|
|
22
|
+
.revised {
|
|
23
23
|
composes: tag;
|
|
24
24
|
background-color: color(cm_yellow_200 a(15%));
|
|
25
25
|
color: cm_yellow_200;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
.draft {
|
|
29
|
+
composes: revised;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
.published {
|
|
29
33
|
composes: tag;
|
|
30
34
|
background-color: color(cm_positive_100 a(15%));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/tag/test/fixtures/draft.js"],"names":["props","label","type"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,OADF;AAELC,IAAAA,IAAI,EAAE;AAFD;AADM,CAAf","sourcesContent":["export default {\n props: {\n label: 'Draft',\n type: 'draft'\n }\n};\n"],"file":"draft.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/atom/tag/test/fixtures/revised.js"],"names":["props","label","type"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,iBADF;AAELC,IAAAA,IAAI,EAAE;AAFD;AADM,CAAf","sourcesContent":["export default {\n props: {\n label: 'Ongoing changes',\n type: 'revised'\n }\n};\n"],"file":"revised.js"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import ButtonLinkIconOnly from '../../atom/button-link-icon-only';
|
|
6
|
+
import ButtonMenu from '../../atom/button-menu';
|
|
7
|
+
import style from './style.css';
|
|
8
|
+
|
|
9
|
+
const BulletPointMenuButton = props => {
|
|
10
|
+
const {
|
|
11
|
+
disabled = false,
|
|
12
|
+
buttonAriaLabel,
|
|
13
|
+
menuAriaLabel,
|
|
14
|
+
onClick,
|
|
15
|
+
buttons
|
|
16
|
+
} = props;
|
|
17
|
+
const handleOnClick = useCallback(() => onClick(), [onClick]);
|
|
18
|
+
const menuProps = {
|
|
19
|
+
'data-name': 'button-menu',
|
|
20
|
+
buttons
|
|
21
|
+
};
|
|
22
|
+
const menu = /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: style.bulletPointMenu,
|
|
24
|
+
"data-name": "menu-wrapper",
|
|
25
|
+
"aria-label": menuAriaLabel
|
|
26
|
+
}, /*#__PURE__*/React.createElement(ButtonMenu, menuProps));
|
|
27
|
+
const bulletPointButtonProps = {
|
|
28
|
+
size: 'default',
|
|
29
|
+
'aria-label': buttonAriaLabel,
|
|
30
|
+
'data-name': 'bullet-point-button',
|
|
31
|
+
icon: 'bullet-point',
|
|
32
|
+
onClick: handleOnClick,
|
|
33
|
+
disabled
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: style.bulletPointWrapper,
|
|
37
|
+
"data-name": "bullet-point-wrapper"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(ButtonLinkIconOnly, _extends({}, bulletPointButtonProps, {
|
|
39
|
+
className: style.bulletPointButton
|
|
40
|
+
})), menu);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
BulletPointMenuButton.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
44
|
+
disabled: PropTypes.bool,
|
|
45
|
+
buttonAriaLabel: PropTypes.string,
|
|
46
|
+
menuAriaLabel: PropTypes.string,
|
|
47
|
+
buttons: ButtonMenu.propTypes.buttons,
|
|
48
|
+
onClick: PropTypes.func
|
|
49
|
+
} : {};
|
|
50
|
+
export default BulletPointMenuButton;
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@value colors: "../../variables/colors.css";
|
|
2
|
+
@value transparent from colors;
|
|
3
|
+
@value cm_grey_100 from colors;
|
|
4
|
+
|
|
5
|
+
.bulletPointWrapper {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column-reverse;
|
|
8
|
+
justify-content: flex-end;
|
|
9
|
+
width: 44px;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.bulletPointButton {
|
|
14
|
+
position: relative;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bulletPointMenu {
|
|
19
|
+
min-width: 80px;
|
|
20
|
+
/* positioning */
|
|
21
|
+
position: absolute;
|
|
22
|
+
align-self: flex-end;
|
|
23
|
+
bottom: 54px;
|
|
24
|
+
right: 0px;
|
|
25
|
+
/* elevation shadow */
|
|
26
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 12px 28px 0px, rgba(0, 0, 0, 0.1) 0px 2px 4px 0px, rgba(255, 255, 255, 0.05) 0px 0px 0px 1px inset;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
/* round corners */
|
|
29
|
+
border-radius: 7px;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
background-color: cm_grey_100;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Fade-in - Fade-out */
|
|
35
|
+
.bulletPointButton,button + .bulletPointMenu {
|
|
36
|
+
max-height: 0;
|
|
37
|
+
/* fade out combo */
|
|
38
|
+
visibility: hidden;
|
|
39
|
+
opacity:0;
|
|
40
|
+
transition:visibility 0.5s ease,opacity 0.5s ease;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.bulletPointButton,button:focus + .bulletPointMenu {
|
|
44
|
+
/* fade in combo */
|
|
45
|
+
max-height: max-content;
|
|
46
|
+
visibility:visible;
|
|
47
|
+
opacity:1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Recover - unset pointer-events */
|
|
51
|
+
.bulletPointButton,button:focus { pointer-events: none; }
|
|
52
|
+
.bulletPointButton,button:not(:focus) { pointer-events: auto; }
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _identity from "lodash/fp/identity";
|
|
2
|
+
import browserEnv from 'browser-env';
|
|
3
|
+
import test from 'ava';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { mount, configure } from 'enzyme';
|
|
6
|
+
import Adapter from 'enzyme-adapter-react-16';
|
|
7
|
+
import BulletPointMenuButton from '..';
|
|
8
|
+
import defaultFixture from './fixtures/default';
|
|
9
|
+
browserEnv();
|
|
10
|
+
configure({
|
|
11
|
+
adapter: new Adapter()
|
|
12
|
+
});
|
|
13
|
+
const translate = _identity;
|
|
14
|
+
test('should launch onClick, should find the button menu and have clickable buttons', t => {
|
|
15
|
+
const wrapper = mount( /*#__PURE__*/React.createElement(BulletPointMenuButton, defaultFixture.props), {
|
|
16
|
+
context: {
|
|
17
|
+
translate
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const button = wrapper.find('[data-name="bullet-point-button"]');
|
|
21
|
+
t.true(button.exists());
|
|
22
|
+
button.first().simulate('click', {});
|
|
23
|
+
const menu = wrapper.find('[data-name="button-menu"]').children().first();
|
|
24
|
+
t.true(menu.exists());
|
|
25
|
+
t.is(menu.children().length, 2);
|
|
26
|
+
const publishButton = menu.find('[data-name="menu-publish-button"]');
|
|
27
|
+
t.true(publishButton.exists());
|
|
28
|
+
publishButton.first().simulate('click', {});
|
|
29
|
+
const deleteButton = menu.find('[data-name="menu-delete-button"]');
|
|
30
|
+
t.true(deleteButton.exists());
|
|
31
|
+
deleteButton.first().simulate('click', {});
|
|
32
|
+
t.pass();
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=bullet-point-menu-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/bullet-point-menu-button/test/bullet-point-menu-button.js"],"names":["browserEnv","test","React","mount","configure","Adapter","BulletPointMenuButton","defaultFixture","adapter","translate","t","wrapper","props","context","button","find","true","exists","first","simulate","menu","children","is","length","publishButton","deleteButton","pass"],"mappings":";AAAA,OAAOA,UAAP,MAAuB,aAAvB;AACA,OAAOC,IAAP,MAAiB,KAAjB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAAQC,KAAR,EAAeC,SAAf,QAA+B,QAA/B;AAEA,OAAOC,OAAP,MAAoB,yBAApB;AACA,OAAOC,qBAAP,MAAkC,IAAlC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AAEAP,UAAU;AACVI,SAAS,CAAC;AAACI,EAAAA,OAAO,EAAE,IAAIH,OAAJ;AAAV,CAAD,CAAT;AACA,MAAMI,SAAS,YAAf;AAEAR,IAAI,CAAC,+EAAD,EAAkFS,CAAC,IAAI;AACzF,QAAMC,OAAO,GAAGR,KAAK,eAAC,oBAAC,qBAAD,EAA2BI,cAAc,CAACK,KAA1C,CAAD,EAAsD;AACzEC,IAAAA,OAAO,EAAE;AAACJ,MAAAA;AAAD;AADgE,GAAtD,CAArB;AAGA,QAAMK,MAAM,GAAGH,OAAO,CAACI,IAAR,CAAa,mCAAb,CAAf;AACAL,EAAAA,CAAC,CAACM,IAAF,CAAOF,MAAM,CAACG,MAAP,EAAP;AACAH,EAAAA,MAAM,CAACI,KAAP,GAAeC,QAAf,CAAwB,OAAxB,EAAiC,EAAjC;AACA,QAAMC,IAAI,GAAGT,OAAO,CAACI,IAAR,CAAa,2BAAb,EAA0CM,QAA1C,GAAqDH,KAArD,EAAb;AACAR,EAAAA,CAAC,CAACM,IAAF,CAAOI,IAAI,CAACH,MAAL,EAAP;AACAP,EAAAA,CAAC,CAACY,EAAF,CAAKF,IAAI,CAACC,QAAL,GAAgBE,MAArB,EAA6B,CAA7B;AACA,QAAMC,aAAa,GAAGJ,IAAI,CAACL,IAAL,CAAU,mCAAV,CAAtB;AACAL,EAAAA,CAAC,CAACM,IAAF,CAAOQ,aAAa,CAACP,MAAd,EAAP;AACAO,EAAAA,aAAa,CAACN,KAAd,GAAsBC,QAAtB,CAA+B,OAA/B,EAAwC,EAAxC;AACA,QAAMM,YAAY,GAAGL,IAAI,CAACL,IAAL,CAAU,kCAAV,CAArB;AACAL,EAAAA,CAAC,CAACM,IAAF,CAAOS,YAAY,CAACR,MAAb,EAAP;AACAQ,EAAAA,YAAY,CAACP,KAAb,GAAqBC,QAArB,CAA8B,OAA9B,EAAuC,EAAvC;AACAT,EAAAA,CAAC,CAACgB,IAAF;AACD,CAjBG,CAAJ","sourcesContent":["import browserEnv from 'browser-env';\nimport test from 'ava';\nimport React from 'react';\nimport {mount, configure} from 'enzyme';\nimport {identity} from 'lodash/fp';\nimport Adapter from 'enzyme-adapter-react-16';\nimport BulletPointMenuButton from '..';\nimport defaultFixture from './fixtures/default';\n\nbrowserEnv();\nconfigure({adapter: new Adapter()});\nconst translate = identity;\n\ntest('should launch onClick, should find the button menu and have clickable buttons', t => {\n const wrapper = mount(<BulletPointMenuButton {...defaultFixture.props} />, {\n context: {translate}\n });\n const button = wrapper.find('[data-name=\"bullet-point-button\"]');\n t.true(button.exists());\n button.first().simulate('click', {});\n const menu = wrapper.find('[data-name=\"button-menu\"]').children().first();\n t.true(menu.exists());\n t.is(menu.children().length, 2);\n const publishButton = menu.find('[data-name=\"menu-publish-button\"]');\n t.true(publishButton.exists());\n publishButton.first().simulate('click', {});\n const deleteButton = menu.find('[data-name=\"menu-delete-button\"]');\n t.true(deleteButton.exists());\n deleteButton.first().simulate('click', {});\n t.pass();\n});\n"],"file":"bullet-point-menu-button.js"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { actionButtonProps, deleteButtonProps } from '../../../../atom/button-menu/test/fixtures/default';
|
|
2
|
+
export default {
|
|
3
|
+
props: {
|
|
4
|
+
buttonAriaLabel: 'aria button',
|
|
5
|
+
menuAriaLabel: 'aria menu',
|
|
6
|
+
buttons: [actionButtonProps, deleteButtonProps],
|
|
7
|
+
onClick: () => console.log('click on bullet point button - test in a bigger component to see the menu'),
|
|
8
|
+
componentKey: 'bullet-key'
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/bullet-point-menu-button/test/fixtures/default.js"],"names":["actionButtonProps","deleteButtonProps","props","buttonAriaLabel","menuAriaLabel","buttons","onClick","console","log","componentKey"],"mappings":"AAAA,SACEA,iBADF,EAEEC,iBAFF,QAGO,oDAHP;AAKA,eAAe;AACbC,EAAAA,KAAK,EAAE;AACLC,IAAAA,eAAe,EAAE,aADZ;AAELC,IAAAA,aAAa,EAAE,WAFV;AAGLC,IAAAA,OAAO,EAAE,CAACL,iBAAD,EAAoBC,iBAApB,CAHJ;AAILK,IAAAA,OAAO,EAAE,MACPC,OAAO,CAACC,GAAR,CAAY,2EAAZ,CALG;AAMLC,IAAAA,YAAY,EAAE;AANT;AADM,CAAf","sourcesContent":["import {\n actionButtonProps,\n deleteButtonProps\n} from '../../../../atom/button-menu/test/fixtures/default';\n\nexport default {\n props: {\n buttonAriaLabel: 'aria button',\n menuAriaLabel: 'aria menu',\n buttons: [actionButtonProps, deleteButtonProps],\n onClick: () =>\n console.log('click on bullet point button - test in a bigger component to see the menu'),\n componentKey: 'bullet-key'\n }\n};\n"],"file":"default.js"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import defaultsDeep from 'lodash/fp/defaultsDeep';
|
|
2
|
+
import { actionButtonProps, deleteButtonProps } from '../../../../atom/button-menu/test/fixtures/default';
|
|
3
|
+
import { disabledButtonProps } from '../../../../atom/button-menu/test/fixtures/multiple-buttons';
|
|
4
|
+
import Default from './default';
|
|
5
|
+
const {
|
|
6
|
+
props
|
|
7
|
+
} = Default;
|
|
8
|
+
export default {
|
|
9
|
+
props: defaultsDeep(props, {
|
|
10
|
+
buttons: [actionButtonProps, disabledButtonProps, deleteButtonProps]
|
|
11
|
+
})
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=multiple-buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/molecule/bullet-point-menu-button/test/fixtures/multiple-buttons.js"],"names":["defaultsDeep","actionButtonProps","deleteButtonProps","disabledButtonProps","Default","props","buttons"],"mappings":"AAAA,OAAOA,YAAP,MAAyB,wBAAzB;AACA,SACEC,iBADF,EAEEC,iBAFF,QAGO,oDAHP;AAIA,SAAQC,mBAAR,QAAkC,6DAAlC;AACA,OAAOC,OAAP,MAAoB,WAApB;AAEA,MAAM;AAACC,EAAAA;AAAD,IAAUD,OAAhB;AAEA,eAAe;AACbC,EAAAA,KAAK,EAAEL,YAAY,CAACK,KAAD,EAAQ;AACzBC,IAAAA,OAAO,EAAE,CAACL,iBAAD,EAAoBE,mBAApB,EAAyCD,iBAAzC;AADgB,GAAR;AADN,CAAf","sourcesContent":["import defaultsDeep from 'lodash/fp/defaultsDeep';\nimport {\n actionButtonProps,\n deleteButtonProps\n} from '../../../../atom/button-menu/test/fixtures/default';\nimport {disabledButtonProps} from '../../../../atom/button-menu/test/fixtures/multiple-buttons';\nimport Default from './default';\n\nconst {props} = Default;\n\nexport default {\n props: defaultsDeep(props, {\n buttons: [actionButtonProps, disabledButtonProps, deleteButtonProps]\n })\n};\n"],"file":"multiple-buttons.js"}
|
|
@@ -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 MoleculeBulletPointMenuButton from '..';
|
|
5
|
+
import fixtureDefault from './fixtures/default';
|
|
6
|
+
import fixtureMultipleButtons from './fixtures/multiple-buttons';
|
|
7
|
+
test('Molecule › MoleculeBulletPointMenuButton > should have valid propTypes', t => {
|
|
8
|
+
t.pass();
|
|
9
|
+
forEach(MoleculeBulletPointMenuButton.propTypes, (value, key) => {
|
|
10
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeBulletPointMenuButton.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
test('Molecule › MoleculeBulletPointMenuButton › Default › should be rendered', renderComponentMacro, MoleculeBulletPointMenuButton, fixtureDefault);
|
|
14
|
+
test('Molecule › MoleculeBulletPointMenuButton › MultipleButtons › should be rendered', renderComponentMacro, MoleculeBulletPointMenuButton, fixtureMultipleButtons);
|
|
15
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/bullet-point-menu-button/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBulletPointMenuButton","fixtureDefault","fixtureMultipleButtons","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,6BAAP,MAA0C,IAA1C;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AAEAL,IAAI,CAAC,wEAAD,EAA2EM,CAAC,IAAI;AAClFA,EAAAA,CAAC,CAACC,IAAF;AACAN,EAAAA,OAAO,CAACE,6BAA6B,CAACK,SAA/B,EAA0C,CAACC,KAAD,EAAQC,GAAR,KAAgB;AAC/DJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,kEAAiEF,GAAI,mEAA9F;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAV,IAAI,CAAC,yEAAD,EAA4EE,oBAA5E,EAAkGC,6BAAlG,EAAiIC,cAAjI,CAAJ;AACAJ,IAAI,CAAC,iFAAD,EAAoFE,oBAApF,EAA0GC,6BAA1G,EAAyIE,sBAAzI,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBulletPointMenuButton from '..';\nimport fixtureDefault from './fixtures/default';\nimport fixtureMultipleButtons from './fixtures/multiple-buttons';\n\ntest('Molecule › MoleculeBulletPointMenuButton > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBulletPointMenuButton.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBulletPointMenuButton.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBulletPointMenuButton › Default › should be rendered', renderComponentMacro, MoleculeBulletPointMenuButton, fixtureDefault);\ntest('Molecule › MoleculeBulletPointMenuButton › MultipleButtons › should be rendered', renderComponentMacro, MoleculeBulletPointMenuButton, fixtureMultipleButtons);\n"],"file":"fixtures.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":"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","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;
|