@coorpacademy/components 10.1.5 → 10.1.9
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 -6
- package/es/atom/button-link/test/fixtures.js +31 -0
- package/es/atom/button-link/test/fixtures.js.map +1 -0
- 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/chips/test/fixtures.js +17 -0
- package/es/atom/chips/test/fixtures.js.map +1 -0
- package/es/atom/content-badge/test/fixtures.js +27 -0
- package/es/atom/content-badge/test/fixtures.js.map +1 -0
- package/es/atom/input-search/test/fixtures.js +19 -0
- package/es/atom/input-search/test/fixtures.js.map +1 -0
- package/es/atom/input-text/index.js.map +1 -1
- package/es/atom/input-text/test/fixtures.js +2 -0
- package/es/atom/input-text/test/fixtures.js.map +1 -1
- package/es/atom/input-textarea/test/fixtures.js +4 -0
- package/es/atom/input-textarea/test/fixtures.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/atom/tag/test/fixtures.js +19 -0
- package/es/atom/tag/test/fixtures.js.map +1 -0
- package/es/atom/wizard-steps/test/fixtures.js +17 -0
- package/es/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/es/molecule/banner/index.js +19 -10
- package/es/molecule/banner/index.js.map +1 -1
- package/es/molecule/banner/style.css +10 -8
- package/es/molecule/banner/test/fixtures.js +15 -0
- package/es/molecule/banner/test/fixtures.js.map +1 -0
- package/es/molecule/brand-form-group/index.js +20 -5
- package/es/molecule/brand-form-group/index.js.map +1 -1
- package/es/molecule/brand-form-group/style.css +19 -0
- package/es/molecule/brand-form-group/test/fixtures.js +2 -0
- package/es/molecule/brand-form-group/test/fixtures.js.map +1 -1
- 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/card/test/fixtures.js +4 -0
- package/es/molecule/card/test/fixtures.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/cm-popin/test/fixtures.js +17 -0
- package/es/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/es/molecule/empty-search-result/test/fixtures.js +13 -0
- package/es/molecule/empty-search-result/test/fixtures.js.map +1 -0
- package/es/molecule/feedback/test/fixtures.js +0 -2
- package/es/molecule/feedback/test/fixtures.js.map +1 -1
- 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/molecule/vertical-tabs/test/fixtures.js +15 -0
- package/es/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/es/molecule/wizard-summary/index.js +3 -1
- package/es/molecule/wizard-summary/index.js.map +1 -1
- package/es/molecule/wizard-summary/style.css +8 -0
- package/es/molecule/wizard-summary/test/fixtures.js +21 -0
- package/es/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
- package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -0
- package/es/organism/brand-form/test/fixtures.js +2 -0
- package/es/organism/brand-form/test/fixtures.js.map +1 -1
- 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 +1 -0
- package/es/organism/search-and-chips-results/index.js.map +1 -1
- package/es/organism/search-and-chips-results/style.css +1 -1
- package/es/organism/search-and-chips-results/test/fixtures.js +21 -0
- package/es/organism/search-and-chips-results/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/template/app-player/popin-end/test/fixtures.js +0 -2
- package/es/template/app-player/popin-end/test/fixtures.js.map +1 -1
- 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/es/variables/colors.css +2 -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 -6
- package/lib/atom/button-link/test/fixtures.js +49 -0
- package/lib/atom/button-link/test/fixtures.js.map +1 -0
- 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/chips/test/fixtures.js +28 -0
- package/lib/atom/chips/test/fixtures.js.map +1 -0
- package/lib/atom/content-badge/test/fixtures.js +43 -0
- package/lib/atom/content-badge/test/fixtures.js.map +1 -0
- package/lib/atom/input-search/test/fixtures.js +31 -0
- package/lib/atom/input-search/test/fixtures.js.map +1 -0
- package/lib/atom/input-text/index.js.map +1 -1
- package/lib/atom/input-text/test/fixtures.js +3 -0
- package/lib/atom/input-text/test/fixtures.js.map +1 -1
- package/lib/atom/input-textarea/test/fixtures.js +6 -0
- package/lib/atom/input-textarea/test/fixtures.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/atom/tag/test/fixtures.js +31 -0
- package/lib/atom/tag/test/fixtures.js.map +1 -0
- package/lib/atom/wizard-steps/test/fixtures.js +28 -0
- package/lib/atom/wizard-steps/test/fixtures.js.map +1 -0
- package/lib/molecule/banner/index.js +19 -10
- package/lib/molecule/banner/index.js.map +1 -1
- package/lib/molecule/banner/style.css +10 -8
- package/lib/molecule/banner/test/fixtures.js +25 -0
- package/lib/molecule/banner/test/fixtures.js.map +1 -0
- package/lib/molecule/brand-form-group/index.js +22 -5
- package/lib/molecule/brand-form-group/index.js.map +1 -1
- package/lib/molecule/brand-form-group/style.css +19 -0
- package/lib/molecule/brand-form-group/test/fixtures.js +3 -0
- package/lib/molecule/brand-form-group/test/fixtures.js.map +1 -1
- 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/card/test/fixtures.js +6 -0
- package/lib/molecule/card/test/fixtures.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/cm-popin/test/fixtures.js +28 -0
- package/lib/molecule/cm-popin/test/fixtures.js.map +1 -0
- package/lib/molecule/empty-search-result/test/fixtures.js +22 -0
- package/lib/molecule/empty-search-result/test/fixtures.js.map +1 -0
- package/lib/molecule/feedback/test/fixtures.js +0 -3
- package/lib/molecule/feedback/test/fixtures.js.map +1 -1
- 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/molecule/vertical-tabs/test/fixtures.js +25 -0
- package/lib/molecule/vertical-tabs/test/fixtures.js.map +1 -0
- package/lib/molecule/wizard-summary/index.js +3 -1
- package/lib/molecule/wizard-summary/index.js.map +1 -1
- package/lib/molecule/wizard-summary/style.css +8 -0
- package/lib/molecule/wizard-summary/test/fixtures.js +34 -0
- package/lib/molecule/wizard-summary/test/fixtures.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +31 -0
- package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -0
- package/lib/organism/brand-form/test/fixtures.js +3 -0
- package/lib/organism/brand-form/test/fixtures.js.map +1 -1
- 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 +1 -0
- package/lib/organism/search-and-chips-results/index.js.map +1 -1
- package/lib/organism/search-and-chips-results/style.css +1 -1
- package/lib/organism/search-and-chips-results/test/fixtures.js +34 -0
- package/lib/organism/search-and-chips-results/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/template/app-player/popin-end/test/fixtures.js +0 -3
- package/lib/template/app-player/popin-end/test/fixtures.js.map +1 -1
- 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/lib/variables/colors.css +2 -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/es/molecule/cockpit-popin/test/fixtures.js +0 -17
- package/es/molecule/cockpit-popin/test/fixtures.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
- package/lib/molecule/cockpit-popin/test/fixtures.js +0 -28
- package/lib/molecule/cockpit-popin/test/fixtures.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _snakeCase from "lodash/fp/snakeCase";
|
|
2
2
|
import _map from "lodash/fp/map";
|
|
3
|
+
import _keys from "lodash/fp/keys";
|
|
3
4
|
|
|
4
5
|
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
|
|
|
@@ -26,6 +27,11 @@ import SetupSections from '../setup-sections';
|
|
|
26
27
|
import Title from '../../atom/title';
|
|
27
28
|
import Roles from '../coorp-manager-roles';
|
|
28
29
|
import style from './style.css';
|
|
30
|
+
const inputContainerStyle = {
|
|
31
|
+
default: style.defaultWidth,
|
|
32
|
+
medium: style.mediumWidth,
|
|
33
|
+
large: style.largeWidth
|
|
34
|
+
};
|
|
29
35
|
|
|
30
36
|
const buildInput = field => {
|
|
31
37
|
const {
|
|
@@ -95,8 +101,13 @@ const buildInput = field => {
|
|
|
95
101
|
|
|
96
102
|
const buildField = (field, index) => {
|
|
97
103
|
const input = buildInput(field);
|
|
104
|
+
const {
|
|
105
|
+
theme,
|
|
106
|
+
size = 'default'
|
|
107
|
+
} = field;
|
|
108
|
+
const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;
|
|
98
109
|
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
className:
|
|
110
|
+
className: styleInput,
|
|
100
111
|
key: index
|
|
101
112
|
}, input);
|
|
102
113
|
};
|
|
@@ -134,7 +145,8 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
134
145
|
fieldsLayout: PropTypes.string,
|
|
135
146
|
groupLayout: PropTypes.string,
|
|
136
147
|
fields: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape(_extends(_extends({}, Autocomplete.propTypes), {}, {
|
|
137
|
-
type: PropTypes.oneOf(['autoComplete'])
|
|
148
|
+
type: PropTypes.oneOf(['autoComplete']),
|
|
149
|
+
size: PropTypes.oneOf(_keys(inputContainerStyle))
|
|
138
150
|
})), PropTypes.shape(_extends(_extends({}, InputColor.propTypes), {}, {
|
|
139
151
|
type: PropTypes.oneOf(['color'])
|
|
140
152
|
})), PropTypes.shape(_extends(_extends({}, InputReadonly.propTypes), {}, {
|
|
@@ -142,13 +154,15 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
142
154
|
})), PropTypes.shape(_extends(_extends({}, InputSwitch.propTypes), {}, {
|
|
143
155
|
type: PropTypes.oneOf(['switch'])
|
|
144
156
|
})), PropTypes.shape(_extends(_extends({}, InputTextarea.propTypes), {}, {
|
|
145
|
-
type: PropTypes.oneOf(['textarea'])
|
|
157
|
+
type: PropTypes.oneOf(['textarea']),
|
|
158
|
+
size: PropTypes.oneOf(_keys(inputContainerStyle))
|
|
146
159
|
})), PropTypes.shape(_extends(_extends({}, InputHTML.propTypes), {}, {
|
|
147
160
|
type: PropTypes.oneOf(['html'])
|
|
148
161
|
})), PropTypes.shape(_extends(_extends({}, InputDoublestep.propTypes), {}, {
|
|
149
162
|
type: PropTypes.oneOf(['doublestep'])
|
|
150
163
|
})), PropTypes.shape(_extends(_extends({}, Select.propTypes), {}, {
|
|
151
|
-
type: PropTypes.oneOf(['select'])
|
|
164
|
+
type: PropTypes.oneOf(['select']),
|
|
165
|
+
size: PropTypes.oneOf(_keys(inputContainerStyle))
|
|
152
166
|
})), PropTypes.shape(_extends(_extends({}, InputCheckbox.propTypes), {}, {
|
|
153
167
|
type: PropTypes.oneOf(['checkbox'])
|
|
154
168
|
})), PropTypes.shape(_extends(_extends({}, ImageUpload.propTypes), {}, {
|
|
@@ -158,7 +172,8 @@ BrandFormGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
158
172
|
})), PropTypes.shape(_extends(_extends({}, SetupSections.propTypes), {}, {
|
|
159
173
|
type: PropTypes.oneOf(['sections'])
|
|
160
174
|
})), PropTypes.shape(_extends(_extends({}, InputText.propTypes), {}, {
|
|
161
|
-
type: PropTypes.oneOf(['text'])
|
|
175
|
+
type: PropTypes.oneOf(['text']),
|
|
176
|
+
size: PropTypes.oneOf(_keys(inputContainerStyle))
|
|
162
177
|
})), PropTypes.shape(_extends(_extends({}, BrandDownloadBox.propTypes), {}, {
|
|
163
178
|
type: PropTypes.oneOf(['downloadbox'])
|
|
164
179
|
})), PropTypes.shape(_extends(_extends({}, BrandUploadBox.propTypes), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["React","PropTypes","classNames","Autocomplete","Select","SelectMultiple","InputText","InputColor","InputCheckbox","InputReadonly","InputSwitch","BrandUploadBox","BrandDownloadBox","Button","InputTextarea","InputHTML","InputDoublestep","ImageUpload","SetupSlider","SetupSections","Title","Roles","style","buildInput","field","type","buildField","index","input","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","string","arrayOf","oneOfType","shape","oneOf"],"mappings":";;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,eAAP,MAA4B,6BAA5B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,KAAP,MAAkB,kBAAlB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SADpB;AAEElB,IAAAA,IAAI,EAAExB,SAAS,CAAC+C,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KAzDkB,EA6DlB/C,SAAS,CAAC8C,KAAV,uBACKlC,MAAM,CAAC8B,SADZ;AAEElB,IAAAA,IAAI,EAAExB,SAAS,CAAC+C,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KA7DkB,EAiElB/C,SAAS,CAAC8C,KAAV,uBACK1C,cAAc,CAACsC,SADpB;AAEElB,IAAAA,IAAI,EAAExB,SAAS,CAAC+C,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KAjEkB,EAqElB/C,SAAS,CAAC8C,KAAV,uBACK1B,KAAK,CAACsB,SADX;AAEElB,IAAAA,IAAI,EAAExB,SAAS,CAAC+C,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KArEkB,EAyElB/C,SAAS,CAAC8C,KAAV,CAAgBzC,SAAS,CAACqC,SAA1B,CAzEkB,CAApB,CADM;AALiB,CAA3B;AAmFA,eAAed,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <ImageUpload {...field} />;\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n\n return (\n <div className={style.field} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete'])\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea'])\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select'])\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text'])\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/molecule/brand-form-group/index.js"],"names":["React","PropTypes","classNames","Autocomplete","Select","SelectMultiple","InputText","InputColor","InputCheckbox","InputReadonly","InputSwitch","BrandUploadBox","BrandDownloadBox","Button","InputTextarea","InputHTML","InputDoublestep","ImageUpload","SetupSlider","SetupSections","Title","Roles","style","inputContainerStyle","default","defaultWidth","medium","mediumWidth","large","largeWidth","buildInput","field","type","buildField","index","input","theme","size","styleInput","BrandFormGroup","props","title","subtitle","fieldsLayout","groupLayout","fields","fieldsList","convert","cap","wrapper","groupGrid","titleWrapper","grid","propTypes","string","arrayOf","oneOfType","shape","oneOf"],"mappings":";;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,UAAP,MAAuB,wBAAvB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,cAAP,MAA2B,qBAA3B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,MAAP,MAAmB,mBAAnB;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,SAAP,MAAsB,uBAAtB;AACA,OAAOC,eAAP,MAA4B,6BAA5B;AACA,OAAOC,WAAP,MAAwB,yBAAxB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,KAAP,MAAkB,kBAAlB;AACA,OAAOC,KAAP,MAAkB,wBAAlB;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,mBAAmB,GAAG;AAC1BC,EAAAA,OAAO,EAAEF,KAAK,CAACG,YADW;AAE1BC,EAAAA,MAAM,EAAEJ,KAAK,CAACK,WAFY;AAG1BC,EAAAA,KAAK,EAAEN,KAAK,CAACO;AAHa,CAA5B;;AAMA,MAAMC,UAAU,GAAGC,KAAK,IAAI;AAC1B,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CAAC+C,SADf;AAEErB,IAAAA,IAAI,EAAE/B,SAAS,CAACyD,KAAV,CAAgB,CAAC,MAAD,CAAhB,CAFR;AAGErB,IAAAA,IAAI,EAAEpC,SAAS,CAACyD,KAAV,CAAgB,MAAKnC,mBAAL,CAAhB;AAHR,KApDkB,EAyDlBtB,SAAS,CAACwD,KAAV,uBACK7C,gBAAgB,CAACyC,SADtB;AAEErB,IAAAA,IAAI,EAAE/B,SAAS,CAACyD,KAAV,CAAgB,CAAC,aAAD,CAAhB;AAFR,KAzDkB,EA6DlBzD,SAAS,CAACwD,KAAV,uBACK9C,cAAc,CAAC0C,SADpB;AAEErB,IAAAA,IAAI,EAAE/B,SAAS,CAACyD,KAAV,CAAgB,CAAC,WAAD,CAAhB;AAFR,KA7DkB,EAiElBzD,SAAS,CAACwD,KAAV,uBACK5C,MAAM,CAACwC,SADZ;AAEErB,IAAAA,IAAI,EAAE/B,SAAS,CAACyD,KAAV,CAAgB,CAAC,QAAD,CAAhB;AAFR,KAjEkB,EAqElBzD,SAAS,CAACwD,KAAV,uBACKpD,cAAc,CAACgD,SADpB;AAEErB,IAAAA,IAAI,EAAE/B,SAAS,CAACyD,KAAV,CAAgB,CAAC,gBAAD,CAAhB;AAFR,KArEkB,EAyElBzD,SAAS,CAACwD,KAAV,uBACKpC,KAAK,CAACgC,SADX;AAEErB,IAAAA,IAAI,EAAE/B,SAAS,CAACyD,KAAV,CAAgB,CAAC,OAAD,CAAhB;AAFR,KAzEkB,EA6ElBzD,SAAS,CAACwD,KAAV,CAAgBnD,SAAS,CAAC+C,SAA1B,CA7EkB,CAApB,CADM;AALiB,CAA3B;AAuFA,eAAed,cAAf","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport {keys, map, snakeCase} from 'lodash/fp';\nimport classNames from 'classnames';\nimport Autocomplete from '../../atom/autocomplete';\nimport Select from '../../atom/select';\nimport SelectMultiple from '../select-multiple';\nimport InputText from '../../atom/input-text';\nimport InputColor from '../../atom/input-color';\nimport InputCheckbox from '../../atom/input-checkbox';\nimport InputReadonly from '../../atom/input-readonly';\nimport InputSwitch from '../../atom/input-switch';\nimport BrandUploadBox from '../brand-upload-box';\nimport BrandDownloadBox from '../brand-download-box';\nimport Button from '../../atom/button';\nimport InputTextarea from '../../atom/input-textarea';\nimport InputHTML from '../../atom/input-html';\nimport InputDoublestep from '../../atom/input-doublestep';\nimport ImageUpload from '../../atom/image-upload';\nimport SetupSlider from '../setup-slider';\nimport SetupSections from '../setup-sections';\nimport Title from '../../atom/title';\nimport Roles from '../coorp-manager-roles';\nimport style from './style.css';\n\nconst inputContainerStyle = {\n default: style.defaultWidth,\n medium: style.mediumWidth,\n large: style.largeWidth\n};\n\nconst buildInput = field => {\n const {type} = field;\n\n switch (type) {\n case 'autoComplete':\n return <Autocomplete {...field} />;\n case 'color':\n return <InputColor {...field} />;\n case 'readonly':\n return <InputReadonly {...field} />;\n case 'switch':\n return <InputSwitch {...field} />;\n case 'textarea':\n return <InputTextarea {...field} />;\n case 'html':\n return <InputHTML {...field} />;\n case 'doublestep':\n return <InputDoublestep {...field} />;\n case 'select':\n return <Select {...field} />;\n case 'selectMultiple':\n return <SelectMultiple {...field} />;\n case 'checkbox':\n return <InputCheckbox {...field} />;\n case 'image':\n return <ImageUpload {...field} />;\n case 'slider':\n return <SetupSlider {...field} />;\n case 'sections':\n return <SetupSections {...field} />;\n case 'text':\n return <InputText {...field} />;\n case 'downloadbox':\n return <BrandDownloadBox {...field} />;\n case 'uploadbox':\n return <BrandUploadBox {...field} />;\n case 'button':\n case 'link':\n return <Button {...field} />;\n case 'roles':\n return <Roles {...field} />;\n default:\n return <InputText {...field} />;\n }\n};\n\nconst buildField = (field, index) => {\n const input = buildInput(field);\n const {theme, size = 'default'} = field;\n const styleInput = theme === 'coorpmanager' ? inputContainerStyle[size] : style.field;\n\n return (\n <div className={styleInput} key={index}>\n {input}\n </div>\n );\n};\n\nconst BrandFormGroup = props => {\n const {title, subtitle = '', fieldsLayout = '', groupLayout = '', fields = []} = props;\n const fieldsList = map.convert({cap: false})(buildField, fields);\n\n return (\n <div\n data-name={`brand_form_group_${snakeCase(title)}`}\n className={classNames(style.wrapper, groupLayout === 'grid' && style.groupGrid)}\n >\n <div className={style.titleWrapper}>\n <Title title={title} subtitle={subtitle} type={'form-group'} />\n </div>\n <div className={fieldsLayout === 'grid' ? style.grid : null}>{fieldsList}</div>\n </div>\n );\n};\n\nBrandFormGroup.propTypes = {\n title: PropTypes.string,\n subtitle: PropTypes.string,\n fieldsLayout: PropTypes.string,\n groupLayout: PropTypes.string,\n fields: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n ...Autocomplete.propTypes,\n type: PropTypes.oneOf(['autoComplete']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputColor.propTypes,\n type: PropTypes.oneOf(['color'])\n }),\n PropTypes.shape({\n ...InputReadonly.propTypes,\n type: PropTypes.oneOf(['readonly'])\n }),\n PropTypes.shape({\n ...InputSwitch.propTypes,\n type: PropTypes.oneOf(['switch'])\n }),\n PropTypes.shape({\n ...InputTextarea.propTypes,\n type: PropTypes.oneOf(['textarea']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputHTML.propTypes,\n type: PropTypes.oneOf(['html'])\n }),\n PropTypes.shape({\n ...InputDoublestep.propTypes,\n type: PropTypes.oneOf(['doublestep'])\n }),\n PropTypes.shape({\n ...Select.propTypes,\n type: PropTypes.oneOf(['select']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...InputCheckbox.propTypes,\n type: PropTypes.oneOf(['checkbox'])\n }),\n PropTypes.shape({\n ...ImageUpload.propTypes,\n type: PropTypes.oneOf(['image'])\n }),\n PropTypes.shape({\n ...SetupSlider.propTypes,\n type: PropTypes.oneOf(['slider'])\n }),\n PropTypes.shape({\n ...SetupSections.propTypes,\n type: PropTypes.oneOf(['sections'])\n }),\n PropTypes.shape({\n ...InputText.propTypes,\n type: PropTypes.oneOf(['text']),\n size: PropTypes.oneOf(keys(inputContainerStyle))\n }),\n PropTypes.shape({\n ...BrandDownloadBox.propTypes,\n type: PropTypes.oneOf(['downloadbox'])\n }),\n PropTypes.shape({\n ...BrandUploadBox.propTypes,\n type: PropTypes.oneOf(['uploadbox'])\n }),\n PropTypes.shape({\n ...Button.propTypes,\n type: PropTypes.oneOf(['button'])\n }),\n PropTypes.shape({\n ...SelectMultiple.propTypes,\n type: PropTypes.oneOf(['selectMultiple'])\n }),\n PropTypes.shape({\n ...Roles.propTypes,\n type: PropTypes.oneOf(['roles'])\n }),\n PropTypes.shape(InputText.propTypes)\n ])\n )\n};\nexport default BrandFormGroup;\n"],"file":"index.js"}
|
|
@@ -50,6 +50,25 @@
|
|
|
50
50
|
margin-bottom: 0;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
.fieldCoorpmanager {
|
|
54
|
+
margin: 0 0 32px 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.defaultWidth {
|
|
58
|
+
composes: fieldCoorpmanager;
|
|
59
|
+
width: 300px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mediumWidth {
|
|
63
|
+
composes: fieldCoorpmanager;
|
|
64
|
+
width: 444px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.largeWidth {
|
|
68
|
+
composes: fieldCoorpmanager;
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
53
72
|
@media desktop {
|
|
54
73
|
.groupGrid {
|
|
55
74
|
flex-direction: column;
|
|
@@ -4,6 +4,7 @@ import renderComponentMacro from '../../../test/helpers/render-component';
|
|
|
4
4
|
import MoleculeBrandFormGroup from '..';
|
|
5
5
|
import fixtureAnalytics from './fixtures/analytics';
|
|
6
6
|
import fixtureAnimations from './fixtures/animations';
|
|
7
|
+
import fixtureCmDefault from './fixtures/cm-default';
|
|
7
8
|
import fixtureCohort from './fixtures/cohort';
|
|
8
9
|
import fixtureDashboard from './fixtures/dashboard';
|
|
9
10
|
import fixtureDefault from './fixtures/default';
|
|
@@ -21,6 +22,7 @@ test('Molecule › MoleculeBrandFormGroup > should have valid propTypes', t => {
|
|
|
21
22
|
});
|
|
22
23
|
test('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnalytics);
|
|
23
24
|
test('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnimations);
|
|
25
|
+
test('Molecule › MoleculeBrandFormGroup › CmDefault › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCmDefault);
|
|
24
26
|
test('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCohort);
|
|
25
27
|
test('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDashboard);
|
|
26
28
|
test('Molecule › MoleculeBrandFormGroup › Default › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDefault);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBrandFormGroup","fixtureAnalytics","fixtureAnimations","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso","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,sBAAP,MAAmC,IAAnC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,UAAP,MAAuB,gBAAvB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/brand-form-group/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeBrandFormGroup","fixtureAnalytics","fixtureAnimations","fixtureCmDefault","fixtureCohort","fixtureDashboard","fixtureDefault","fixtureDoublefield","fixtureImages","fixtureLookandfeel","fixtureRoles","fixtureSlider","fixtureSso","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,sBAAP,MAAmC,IAAnC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,gBAAP,MAA6B,uBAA7B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AAEAf,IAAI,CAAC,iEAAD,EAAoEgB,CAAC,IAAI;AAC3EA,EAAAA,CAAC,CAACC,IAAF;AACAhB,EAAAA,OAAO,CAACE,sBAAsB,CAACe,SAAxB,EAAmC,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACxDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,2DAA0DF,GAAI,mEAAvF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOApB,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,sBAA7F,EAAqHC,gBAArH,CAAJ;AACAJ,IAAI,CAAC,qEAAD,EAAwEE,oBAAxE,EAA8FC,sBAA9F,EAAsHE,iBAAtH,CAAJ;AACAL,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,sBAA7F,EAAqHG,gBAArH,CAAJ;AACAN,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,sBAA1F,EAAkHI,aAAlH,CAAJ;AACAP,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,sBAA7F,EAAqHK,gBAArH,CAAJ;AACAR,IAAI,CAAC,kEAAD,EAAqEE,oBAArE,EAA2FC,sBAA3F,EAAmHM,cAAnH,CAAJ;AACAT,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,sBAA/F,EAAuHO,kBAAvH,CAAJ;AACAV,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,sBAA1F,EAAkHQ,aAAlH,CAAJ;AACAX,IAAI,CAAC,sEAAD,EAAyEE,oBAAzE,EAA+FC,sBAA/F,EAAuHS,kBAAvH,CAAJ;AACAZ,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,sBAAzF,EAAiHU,YAAjH,CAAJ;AACAb,IAAI,CAAC,iEAAD,EAAoEE,oBAApE,EAA0FC,sBAA1F,EAAkHW,aAAlH,CAAJ;AACAd,IAAI,CAAC,8DAAD,EAAiEE,oBAAjE,EAAuFC,sBAAvF,EAA+GY,UAA/G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeBrandFormGroup from '..';\nimport fixtureAnalytics from './fixtures/analytics';\nimport fixtureAnimations from './fixtures/animations';\nimport fixtureCmDefault from './fixtures/cm-default';\nimport fixtureCohort from './fixtures/cohort';\nimport fixtureDashboard from './fixtures/dashboard';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDoublefield from './fixtures/doublefield';\nimport fixtureImages from './fixtures/images';\nimport fixtureLookandfeel from './fixtures/lookandfeel';\nimport fixtureRoles from './fixtures/roles';\nimport fixtureSlider from './fixtures/slider';\nimport fixtureSso from './fixtures/sso';\n\ntest('Molecule › MoleculeBrandFormGroup > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeBrandFormGroup.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeBrandFormGroup.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeBrandFormGroup › Analytics › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnalytics);\ntest('Molecule › MoleculeBrandFormGroup › Animations › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureAnimations);\ntest('Molecule › MoleculeBrandFormGroup › CmDefault › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCmDefault);\ntest('Molecule › MoleculeBrandFormGroup › Cohort › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureCohort);\ntest('Molecule › MoleculeBrandFormGroup › Dashboard › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDashboard);\ntest('Molecule › MoleculeBrandFormGroup › Default › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDefault);\ntest('Molecule › MoleculeBrandFormGroup › Doublefield › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureDoublefield);\ntest('Molecule › MoleculeBrandFormGroup › Images › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureImages);\ntest('Molecule › MoleculeBrandFormGroup › Lookandfeel › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureLookandfeel);\ntest('Molecule › MoleculeBrandFormGroup › Roles › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureRoles);\ntest('Molecule › MoleculeBrandFormGroup › Slider › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSlider);\ntest('Molecule › MoleculeBrandFormGroup › Sso › should be rendered', renderComponentMacro, MoleculeBrandFormGroup, fixtureSso);\n"],"file":"fixtures.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"}
|
|
@@ -15,6 +15,8 @@ import fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';
|
|
|
15
15
|
import fixtureFreerun from './fixtures/freerun';
|
|
16
16
|
import fixturePodcast from './fixtures/podcast';
|
|
17
17
|
import fixtureScorm from './fixtures/scorm';
|
|
18
|
+
import fixtureSelectableFalse from './fixtures/selectable-false';
|
|
19
|
+
import fixtureSelectableTrue from './fixtures/selectable-true';
|
|
18
20
|
import fixtureVideo from './fixtures/video';
|
|
19
21
|
test('Molecule › MoleculeCard > should have valid propTypes', t => {
|
|
20
22
|
t.pass();
|
|
@@ -35,5 +37,7 @@ test('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered',
|
|
|
35
37
|
test('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);
|
|
36
38
|
test('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);
|
|
37
39
|
test('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);
|
|
40
|
+
test('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);
|
|
41
|
+
test('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);
|
|
38
42
|
test('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);
|
|
39
43
|
//# sourceMappingURL=fixtures.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCard","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureVideo","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,YAAP,MAAyB,IAAzB;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/card/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCard","fixtureAdaptivAndDisabled","fixtureAdaptiv","fixtureArabic","fixtureArticle","fixtureDefault","fixtureDisabled","fixtureEmpty","fixtureExternalContent","fixtureFavorite","fixtureFreerunAndDisabled","fixtureFreerun","fixturePodcast","fixtureScorm","fixtureSelectableFalse","fixtureSelectableTrue","fixtureVideo","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,YAAP,MAAyB,IAAzB;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;AACA,OAAOC,eAAP,MAA4B,qBAA5B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kFC,YAAlF,EAAgGS,eAAhG,CAAJ;AACAZ,IAAI,CAAC,mEAAD,EAAsEE,oBAAtE,EAA4FC,YAA5F,EAA0GU,yBAA1G,CAAJ;AACAb,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,YAAjF,EAA+FW,cAA/F,CAAJ;AACAd,IAAI,CAAC,wDAAD,EAA2DE,oBAA3D,EAAiFC,YAAjF,EAA+FY,cAA/F,CAAJ;AACAf,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,YAA/E,EAA6Fa,YAA7F,CAAJ;AACAhB,IAAI,CAAC,gEAAD,EAAmEE,oBAAnE,EAAyFC,YAAzF,EAAuGc,sBAAvG,CAAJ;AACAjB,IAAI,CAAC,+DAAD,EAAkEE,oBAAlE,EAAwFC,YAAxF,EAAsGe,qBAAtG,CAAJ;AACAlB,IAAI,CAAC,sDAAD,EAAyDE,oBAAzD,EAA+EC,YAA/E,EAA6FgB,YAA7F,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCard from '..';\nimport fixtureAdaptivAndDisabled from './fixtures/adaptiv-and-disabled';\nimport fixtureAdaptiv from './fixtures/adaptiv';\nimport fixtureArabic from './fixtures/arabic';\nimport fixtureArticle from './fixtures/article';\nimport fixtureDefault from './fixtures/default';\nimport fixtureDisabled from './fixtures/disabled';\nimport fixtureEmpty from './fixtures/empty';\nimport fixtureExternalContent from './fixtures/external-content';\nimport fixtureFavorite from './fixtures/favorite';\nimport fixtureFreerunAndDisabled from './fixtures/freerun-and-disabled';\nimport fixtureFreerun from './fixtures/freerun';\nimport fixturePodcast from './fixtures/podcast';\nimport fixtureScorm from './fixtures/scorm';\nimport fixtureSelectableFalse from './fixtures/selectable-false';\nimport fixtureSelectableTrue from './fixtures/selectable-true';\nimport fixtureVideo from './fixtures/video';\n\ntest('Molecule › MoleculeCard > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCard.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCard.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCard › AdaptivAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptivAndDisabled);\ntest('Molecule › MoleculeCard › Adaptiv › should be rendered', renderComponentMacro, MoleculeCard, fixtureAdaptiv);\ntest('Molecule › MoleculeCard › Arabic › should be rendered', renderComponentMacro, MoleculeCard, fixtureArabic);\ntest('Molecule › MoleculeCard › Article › should be rendered', renderComponentMacro, MoleculeCard, fixtureArticle);\ntest('Molecule › MoleculeCard › Default › should be rendered', renderComponentMacro, MoleculeCard, fixtureDefault);\ntest('Molecule › MoleculeCard › Disabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureDisabled);\ntest('Molecule › MoleculeCard › Empty › should be rendered', renderComponentMacro, MoleculeCard, fixtureEmpty);\ntest('Molecule › MoleculeCard › ExternalContent › should be rendered', renderComponentMacro, MoleculeCard, fixtureExternalContent);\ntest('Molecule › MoleculeCard › Favorite › should be rendered', renderComponentMacro, MoleculeCard, fixtureFavorite);\ntest('Molecule › MoleculeCard › FreerunAndDisabled › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerunAndDisabled);\ntest('Molecule › MoleculeCard › Freerun › should be rendered', renderComponentMacro, MoleculeCard, fixtureFreerun);\ntest('Molecule › MoleculeCard › Podcast › should be rendered', renderComponentMacro, MoleculeCard, fixturePodcast);\ntest('Molecule › MoleculeCard › Scorm › should be rendered', renderComponentMacro, MoleculeCard, fixtureScorm);\ntest('Molecule › MoleculeCard › SelectableFalse › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableFalse);\ntest('Molecule › MoleculeCard › SelectableTrue › should be rendered', renderComponentMacro, MoleculeCard, fixtureSelectableTrue);\ntest('Molecule › MoleculeCard › Video › should be rendered', renderComponentMacro, MoleculeCard, fixtureVideo);\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":"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,IAD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,EAAEZ,SAAS,CAAC6B,KAAV,CAAgB;AAC5BL,IAAAA,KAAK,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,17 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import forEach from 'lodash/forEach';
|
|
3
|
+
import renderComponentMacro from '../../../test/helpers/render-component';
|
|
4
|
+
import MoleculeCmPopin from '..';
|
|
5
|
+
import fixtureDangerous from './fixtures/dangerous';
|
|
6
|
+
import fixtureDefault from './fixtures/default';
|
|
7
|
+
import fixtureWarningWithClose from './fixtures/warning-with-close';
|
|
8
|
+
test('Molecule › MoleculeCmPopin > should have valid propTypes', t => {
|
|
9
|
+
t.pass();
|
|
10
|
+
forEach(MoleculeCmPopin.propTypes, (value, key) => {
|
|
11
|
+
t.not(value, undefined, `PropType for "Molecule.MoleculeCmPopin.propTypes.${key}" may not be undefined. Did you mistype the propTypes definition?`);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
test('Molecule › MoleculeCmPopin › Dangerous › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureDangerous);
|
|
15
|
+
test('Molecule › MoleculeCmPopin › Default › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureDefault);
|
|
16
|
+
test('Molecule › MoleculeCmPopin › WarningWithClose › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureWarningWithClose);
|
|
17
|
+
//# sourceMappingURL=fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/molecule/cm-popin/test/fixtures.js"],"names":["test","forEach","renderComponentMacro","MoleculeCmPopin","fixtureDangerous","fixtureDefault","fixtureWarningWithClose","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,eAAP,MAA4B,IAA5B;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AAEAN,IAAI,CAAC,0DAAD,EAA6DO,CAAC,IAAI;AACpEA,EAAAA,CAAC,CAACC,IAAF;AACAP,EAAAA,OAAO,CAACE,eAAe,CAACM,SAAjB,EAA4B,CAACC,KAAD,EAAQC,GAAR,KAAgB;AACjDJ,IAAAA,CAAC,CAACK,GAAF,CAAMF,KAAN,EAAaG,SAAb,EAAyB,oDAAmDF,GAAI,mEAAhF;AACD,GAFM,CAAP;AAGD,CALG,CAAJ;AAOAX,IAAI,CAAC,6DAAD,EAAgEE,oBAAhE,EAAsFC,eAAtF,EAAuGC,gBAAvG,CAAJ;AACAJ,IAAI,CAAC,2DAAD,EAA8DE,oBAA9D,EAAoFC,eAApF,EAAqGE,cAArG,CAAJ;AACAL,IAAI,CAAC,oEAAD,EAAuEE,oBAAvE,EAA6FC,eAA7F,EAA8GG,uBAA9G,CAAJ","sourcesContent":["import test from 'ava';\nimport forEach from 'lodash/forEach';\nimport renderComponentMacro from '../../../test/helpers/render-component';\nimport MoleculeCmPopin from '..';\nimport fixtureDangerous from './fixtures/dangerous';\nimport fixtureDefault from './fixtures/default';\nimport fixtureWarningWithClose from './fixtures/warning-with-close';\n\ntest('Molecule › MoleculeCmPopin > should have valid propTypes', t => {\n t.pass();\n forEach(MoleculeCmPopin.propTypes, (value, key) => {\n t.not(value, undefined, `PropType for \"Molecule.MoleculeCmPopin.propTypes.${key}\" may not be undefined. Did you mistype the propTypes definition?`);\n });\n});\n\ntest('Molecule › MoleculeCmPopin › Dangerous › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureDangerous);\ntest('Molecule › MoleculeCmPopin › Default › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureDefault);\ntest('Molecule › MoleculeCmPopin › WarningWithClose › should be rendered', renderComponentMacro, MoleculeCmPopin, fixtureWarningWithClose);\n"],"file":"fixtures.js"}
|