@occmundial/occ-atomic 2.0.0-beta.1 → 2.0.0-beta.11
Sign up to get free protection for your applications and to get access to all the features.
- package/.prettierrc +6 -0
- package/.whitesource +12 -0
- package/CHANGELOG.md +1361 -584
- package/CONTRIBUTING.md +24 -0
- package/README.md +21 -21
- package/build/Autocomplete/Autocomplete.js +217 -117
- package/build/Autocomplete/Autocomplete.test.js +90 -74
- package/build/Autocomplete/__snapshots__/Autocomplete.test.js.snap +20 -0
- package/build/Autocomplete/index.js +6 -1
- package/build/Autocomplete/styles.js +2 -5
- package/build/Avatar/Avatar.js +66 -28
- package/build/Avatar/Avatar.test.js +36 -13
- package/build/Avatar/AvatarContent/AvatarContent.js +11 -14
- package/build/Avatar/AvatarContent/AvatarContent.test.js +55 -50
- package/build/Avatar/AvatarContent/__snapshots__/AvatarContent.test.js.snap +41 -0
- package/build/Avatar/AvatarContent/index.js +6 -1
- package/build/Avatar/AvatarContent/styles.js +12 -11
- package/build/Avatar/__snapshots__/Avatar.test.js.snap +17 -0
- package/build/Avatar/index.js +22 -1
- package/build/Avatar/styles.js +2 -6
- package/build/Banner/Banner.js +76 -0
- package/build/Banner/Banner.test.js +40 -0
- package/build/Banner/__snapshots__/Banner.test.js.snap +33 -0
- package/build/Banner/index.js +18 -0
- package/build/Banner/styles.js +41 -0
- package/build/Button/Button.js +134 -61
- package/build/Button/Button.test.js +69 -20
- package/build/Button/Loading.js +82 -0
- package/build/Button/__snapshots__/Button.test.js.snap +322 -0
- package/build/Button/index.js +22 -1
- package/build/Button/styles.js +187 -178
- package/build/ButtonAlign/ButtonAlign.js +20 -16
- package/build/ButtonAlign/ButtonAlign.test.js +3 -3
- package/build/ButtonAlign/__snapshots__/ButtonAlign.test.js.snap +19 -0
- package/build/Card/Card.js +4 -5
- package/build/Card/Card.test.js +40 -35
- package/build/Card/__snapshots__/Card.test.js.snap +46 -0
- package/build/Card/index.js +22 -1
- package/build/Card/styles.js +2 -4
- package/build/Check/Check.js +18 -14
- package/build/Check/Check.test.js +7 -7
- package/build/Check/__snapshots__/Check.test.js.snap +92 -0
- package/build/Check/styles.js +2 -2
- package/build/Checkbox/Checkbox.js +106 -60
- package/build/Checkbox/Checkbox.test.js +58 -42
- package/build/Checkbox/__snapshots__/Checkbox.test.js.snap +92 -0
- package/build/Checkbox/index.js +4 -2
- package/build/Checkbox/styles.js +2 -5
- package/build/Column/Column.js +1 -1
- package/build/Column/Column.test.js +3 -3
- package/build/Column/__snapshots__/Column.test.js.snap +647 -0
- package/build/Container/Container.js +1 -1
- package/build/Container/Container.test.js +4 -4
- package/build/Container/__snapshots__/Container.test.js.snap +43 -0
- package/build/Droplist/Droplist.js +474 -227
- package/build/Droplist/Droplist.test.js +111 -87
- package/build/Droplist/__snapshots__/Droplist.test.js.snap +65 -0
- package/build/Droplist/functions.js +9 -2
- package/build/Droplist/index.js +22 -1
- package/build/Droplist/styles.js +41 -15
- package/build/Flexbox/Flexbox.js +64 -29
- package/build/Flexbox/Flexbox.test.js +32 -14
- package/build/Flexbox/__snapshots__/Flexbox.test.js.snap +106 -0
- package/build/Flexbox/index.js +22 -1
- package/build/Flexbox/styles.js +2 -6
- package/build/Footer/Footer.js +42 -30
- package/build/Footer/Footer.test.js +2 -2
- package/build/Footer/List/List.js +32 -25
- package/build/Footer/__snapshots__/Footer.test.js.snap +90 -0
- package/build/Footer/styles.js +5 -0
- package/build/Grid/Col/Col.js +15 -22
- package/build/Grid/Col/Col.test.js +33 -13
- package/build/Grid/Col/__snapshots__/Col.test.js.snap +963 -0
- package/build/Grid/Col/index.js +22 -1
- package/build/Grid/Col/styles.js +97 -116
- package/build/Grid/Grid.js +18 -12
- package/build/Grid/Row/Row.js +1 -1
- package/build/Grid/Row/Row.test.js +2 -2
- package/build/Grid/Row/__snapshots__/Row.test.js.snap +22 -0
- package/build/Grid/Row/index.js +4 -2
- package/build/Grid/index.js +4 -2
- package/build/Header/Header.js +35 -31
- package/build/Header/Header.test.js +8 -8
- package/build/Header/Menu/Menu.js +23 -19
- package/build/Header/Menu/Menu.test.js +7 -7
- package/build/Header/Menu/__snapshots__/Menu.test.js.snap +113 -0
- package/build/Header/Nav/Nav.js +19 -15
- package/build/Header/Nav/Nav.test.js +5 -5
- package/build/Header/Nav/__snapshots__/Nav.test.js.snap +101 -0
- package/build/Header/__snapshots__/Header.test.js.snap +79 -0
- package/build/Hidden/Hidden.js +17 -13
- package/build/Hidden/Hidden.test.js +6 -6
- package/build/Hidden/__snapshots__/Hidden.test.js.snap +3 -0
- package/build/Hidden/index.js +4 -2
- package/build/Icon/Icon.js +90 -15
- package/build/Icon/Icon.test.js +49 -56
- package/build/Icon/__snapshots__/Icon.test.js.snap +32 -0
- package/build/Icon/index.js +22 -1
- package/build/Icon/styles.js +16 -9
- package/build/Input/Input.js +29 -25
- package/build/Input/Input.test.js +21 -21
- package/build/Input/__snapshots__/Input.test.js.snap +194 -0
- package/build/Input/index.js +17 -13
- package/build/Label/Label.js +17 -13
- package/build/Label/Label.test.js +6 -6
- package/build/Label/__snapshots__/Label.test.js.snap +82 -0
- package/build/LayerApp/LayerApp.js +22 -18
- package/build/LayerApp/LayerApp.test.js +4 -4
- package/build/LayerApp/__snapshots__/LayerApp.test.js.snap +37 -0
- package/build/Modal/Modal.js +55 -37
- package/build/Modal/Modal.test.js +15 -12
- package/build/Modal/__snapshots__/Modal.test.js.snap +208 -0
- package/build/Modal/index.js +19 -13
- package/build/Modal/styles.js +43 -31
- package/build/NavAside/NavAside.js +24 -19
- package/build/NavAside/NavAside.test.js +15 -13
- package/build/NavAside/__snapshots__/NavAside.test.js.snap +116 -0
- package/build/NavAside/index.js +16 -12
- package/build/NavIcon/NavIcon.js +41 -20
- package/build/NavIcon/styles.js +6 -16
- package/build/NavItem/NavItem.js +29 -16
- package/build/NavTab/NavTab.js +38 -29
- package/build/NavTop/NavTop.js +20 -16
- package/build/OrderBy/OrderBy.js +23 -19
- package/build/OrderBy/OrderBy.test.js +6 -6
- package/build/OrderBy/__snapshots__/OrderBy.test.js.snap +54 -0
- package/build/Pager/Break/Break.js +1 -1
- package/build/Pager/Break/Break.test.js +4 -4
- package/build/Pager/Break/__snapshots__/Break.test.js.snap +13 -0
- package/build/Pager/Page/Page.js +1 -1
- package/build/Pager/Page/Page.test.js +5 -5
- package/build/Pager/Page/__snapshots__/Page.test.js.snap +27 -0
- package/build/Pager/Pager.js +21 -17
- package/build/Pager/Pager.test.js +12 -12
- package/build/Pager/__snapshots__/Pager.test.js.snap +50 -0
- package/build/Pager/styles.js +1 -1
- package/build/Pill/Choice/Choice.js +23 -18
- package/build/Pill/Choice/styles.js +8 -3
- package/build/Pill/Group/Group.js +7 -4
- package/build/Pill/Group/styles.js +7 -4
- package/build/Pill/Pill.js +36 -23
- package/build/Pill/Pill.test.js +12 -12
- package/build/Pill/Stack/Stack.js +10 -7
- package/build/Pill/Stack/styles.js +4 -1
- package/build/Pill/__snapshots__/Pill.test.js.snap +62 -0
- package/build/Pill/styles.js +6 -2
- package/build/Placeholder/Placeholder.js +2 -2
- package/build/Placeholder/Placeholder.test.js +3 -3
- package/build/Placeholder/__snapshots__/Placeholder.test.js.snap +130 -0
- package/build/Placeholder/styles.js +23 -16
- package/build/Provider/Provider.js +89 -0
- package/build/Provider/index.js +13 -0
- package/build/Provider/useAtomic.js +17 -0
- package/build/{hooks → Provider}/usePrevious.js +1 -1
- package/build/Radio/Radio.js +29 -15
- package/build/Radio/Radio.test.js +6 -6
- package/build/Radio/__snapshots__/Radio.test.js.snap +83 -0
- package/build/RangeCounter/RangeCounter.js +17 -13
- package/build/RangeCounter/RangeCounter.test.js +3 -3
- package/build/RangeCounter/__snapshots__/RangeCounter.test.js.snap +20 -0
- package/build/RangeCounter/styles.js +1 -1
- package/build/Row/Row.js +1 -1
- package/build/Row/Row.test.js +2 -2
- package/build/Row/__snapshots__/Row.test.js.snap +22 -0
- package/build/SightLogo/SightLogo.js +2 -2
- package/build/SightLogo/SightLogo.test.js +2 -2
- package/build/SightLogo/__snapshots__/SightLogo.test.js.snap +24 -0
- package/build/SlideDown/SlideDown.js +41 -27
- package/build/SlideDown/SlideDown.test.js +22 -16
- package/build/SlideDown/__snapshots__/SlideDown.test.js.snap +42 -0
- package/build/SlideToggle/SlideToggle.js +31 -17
- package/build/SlideToggle/SlideToggle.test.js +7 -7
- package/build/SlideToggle/__snapshots__/SlideToggle.test.js.snap +62 -0
- package/build/SubHeader/SubHeader.js +20 -16
- package/build/SubHeader/SubHeader.test.js +7 -7
- package/build/SubHeader/__snapshots__/SubHeader.test.js.snap +50 -0
- package/build/SwitchGroup/SwitchGroup.js +17 -13
- package/build/SwitchGroup/SwitchGroup.test.js +6 -6
- package/build/SwitchGroup/__snapshots__/SwitchGroup.test.js.snap +52 -0
- package/build/SwitchGroup/styles.js +1 -1
- package/build/Tag/Tag.js +27 -10
- package/build/Tag/Tag.test.js +8 -8
- package/build/Tag/__snapshots__/Tag.test.js.snap +137 -0
- package/build/Tag/styles.js +72 -27
- package/build/Text/Text.js +454 -122
- package/build/Text/Text.test.js +13 -13
- package/build/Text/__snapshots__/Text.test.js.snap +216 -0
- package/build/Text/styles.js +171 -78
- package/build/TextField/TextField.js +455 -302
- package/build/TextField/TextField.test.js +138 -146
- package/build/TextField/__snapshots__/TextField.test.js.snap +258 -0
- package/build/TextField/index.js +6 -1
- package/build/TextField/styles.js +99 -33
- package/build/Tip/Tip.js +91 -27
- package/build/Tip/Tip.test.js +8 -8
- package/build/Tip/__snapshots__/Tip.test.js.snap +49 -0
- package/build/Tip/styles.js +32 -12
- package/build/Title/Title.js +16 -12
- package/build/Title/Title.test.js +3 -3
- package/build/Title/__snapshots__/Title.test.js.snap +31 -0
- package/build/Toaster/Toast/Toast.js +13 -13
- package/build/Toaster/Toaster.js +27 -23
- package/build/Toaster/Toaster.test.js +6 -6
- package/build/Toaster/__snapshots__/Toaster.test.js.snap +5 -0
- package/build/Tooltip/Tooltip.js +210 -0
- package/build/Tooltip/Tooltip.test.js +35 -0
- package/build/Tooltip/__snapshots__/Tooltip.test.js.snap +33 -0
- package/build/Tooltip/hooks.js +132 -0
- package/build/Tooltip/index.js +18 -0
- package/build/Tooltip/styles.js +44 -0
- package/build/TourTip/TourTip.js +15 -11
- package/build/TourTip/TourTip.test.js +2 -2
- package/build/TourTip/__snapshots__/TourTip.test.js.snap +74 -0
- package/build/Visible/Visible.js +16 -12
- package/build/Visible/Visible.test.js +4 -4
- package/build/Visible/__snapshots__/Visible.test.js.snap +3 -0
- package/build/WindowSize/WindowSize.js +17 -11
- package/build/WindowSize/WindowSize.test.js +4 -4
- package/build/WindowSize/__snapshots__/WindowSize.test.js.snap +3 -0
- package/build/index.js +82 -8
- package/build/plugin/babel.js +61 -0
- package/build/subatomic/colors.js +8 -3
- package/build/subatomic/fonts.js +1 -1
- package/build/subatomic/icons/attachment.js +23 -0
- package/build/subatomic/icons/attachmentSolid.js +23 -0
- package/build/subatomic/icons/avatarSmile.js +23 -0
- package/build/subatomic/icons/book.js +23 -0
- package/build/subatomic/icons/cash.js +23 -0
- package/build/subatomic/icons/copy.js +23 -0
- package/build/subatomic/icons/copySolid.js +23 -0
- package/build/subatomic/icons/crossSolid.js +23 -0
- package/build/subatomic/icons/dislike.js +1 -1
- package/build/subatomic/icons/dislikeSolid.js +23 -0
- package/build/subatomic/icons/energy.js +23 -0
- package/build/subatomic/icons/energySolid.js +23 -0
- package/build/subatomic/icons/eye.js +1 -1
- package/build/subatomic/icons/eyeClosed.js +1 -1
- package/build/subatomic/icons/eyeClosedSolid.js +23 -0
- package/build/subatomic/icons/eyeSolid.js +23 -0
- package/build/subatomic/icons/hourGlass.js +23 -0
- package/build/subatomic/icons/like.js +1 -1
- package/build/subatomic/icons/likeSolid.js +23 -0
- package/build/subatomic/icons/location.js +23 -0
- package/build/subatomic/icons/locationSolid.js +23 -0
- package/build/subatomic/icons/matchJob.js +23 -0
- package/build/subatomic/icons/messages.js +1 -1
- package/build/subatomic/icons/messagesSolid.js +1 -1
- package/build/subatomic/icons/moreOptionsHorizontal.js +23 -0
- package/build/subatomic/icons/noMessages.js +23 -0
- package/build/subatomic/icons/noMessagesSolid.js +23 -0
- package/build/subatomic/icons/occDart.js +25 -8
- package/build/subatomic/icons/occHorizontal.js +25 -8
- package/build/subatomic/icons/occLogo.js +65 -0
- package/build/subatomic/icons/occVertical.js +25 -8
- package/build/subatomic/icons/profile.js +23 -0
- package/build/subatomic/icons/profileSolid.js +23 -0
- package/build/subatomic/icons/profileView.js +23 -0
- package/build/subatomic/icons/refresh.js +23 -0
- package/build/subatomic/icons/refreshSolid.js +23 -0
- package/build/subatomic/icons/sendMessage.js +23 -0
- package/build/subatomic/icons/sendMessageSolid.js +23 -0
- package/build/subatomic/icons/starsSolid.js +23 -0
- package/build/subatomic/icons/suitcase.js +23 -0
- package/build/subatomic/icons/suitcaseSolid.js +23 -0
- package/build/subatomic/icons/tag.js +1 -1
- package/build/subatomic/icons/tagSolid.js +23 -0
- package/build/subatomic/icons/trash.js +1 -1
- package/build/subatomic/icons/trashSolid.js +1 -1
- package/build/subatomic/icons/warning.js +23 -0
- package/build/subatomic/icons/warningSolid.js +23 -0
- package/build/subatomic/icons/webSite.js +23 -0
- package/build/subatomic/icons/webSiteSolid.js +23 -0
- package/build/subatomic/icons.js +230 -112
- package/build/subatomic/mappedIcons.js +171 -0
- package/build/tokens/borderRadius.json +8 -0
- package/build/tokens/colors.json +567 -0
- package/build/tokens/fonts.json +231 -0
- package/build/tokens/index.js +47 -0
- package/build/tokens/shadows.json +13 -0
- package/build/tokens/spacing.json +16 -0
- package/commitlint.config.js +6 -0
- package/package.json +124 -113
- package/playroom/FrameComponent.js +31 -0
- package/playroom/styles.js +14 -0
- package/playroom.config.js +7 -7
- package/build/Grid/Grid.test.js +0 -22
- package/build/Grid/Row/Rowdsd.js +0 -39
- package/build/hooks/useEventListener.js +0 -23
- package/yarn-error.log +0 -10737
package/build/Label/Label.js
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
4
6
|
value: true
|
5
7
|
});
|
@@ -11,34 +13,36 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13
15
|
|
14
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
15
|
-
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
17
17
|
|
18
18
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
19
19
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
21
21
|
|
22
|
-
function
|
22
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
23
23
|
|
24
|
-
function
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
25
25
|
|
26
|
-
function
|
26
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
27
27
|
|
28
|
-
function
|
28
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
29
29
|
|
30
|
-
function
|
30
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
31
|
+
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
33
|
+
|
34
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
31
35
|
|
32
36
|
/** Label component with different themes. The label can trigger some actions on click. */
|
33
|
-
var Label =
|
34
|
-
/*#__PURE__*/
|
35
|
-
function (_React$Component) {
|
37
|
+
var Label = /*#__PURE__*/function (_React$Component) {
|
36
38
|
_inherits(Label, _React$Component);
|
37
39
|
|
40
|
+
var _super = _createSuper(Label);
|
41
|
+
|
38
42
|
function Label() {
|
39
43
|
_classCallCheck(this, Label);
|
40
44
|
|
41
|
-
return
|
45
|
+
return _super.apply(this, arguments);
|
42
46
|
}
|
43
47
|
|
44
48
|
_createClass(Label, [{
|
@@ -53,12 +57,12 @@ function (_React$Component) {
|
|
53
57
|
onClose = _this$props.onClose,
|
54
58
|
onClick = _this$props.onClick,
|
55
59
|
theme = _this$props.theme;
|
56
|
-
return _react["default"].createElement("label", {
|
60
|
+
return /*#__PURE__*/_react["default"].createElement("label", {
|
57
61
|
className: "".concat(classes.label, " ").concat(theme ? classes[theme] : classes["default"]).concat(onClick ? " ".concat(classes.cursor) : '').concat(className ? " ".concat(className) : ''),
|
58
62
|
id: id,
|
59
63
|
style: style,
|
60
64
|
onClick: onClick
|
61
|
-
}, children, onClose && _react["default"].createElement("span", {
|
65
|
+
}, children, onClose && /*#__PURE__*/_react["default"].createElement("span", {
|
62
66
|
className: classes.close,
|
63
67
|
onClick: function onClick(e) {
|
64
68
|
e.stopPropagation();
|
@@ -21,20 +21,20 @@ var reduceClasses = function reduceClasses(prev, curr) {
|
|
21
21
|
var classes = Object.keys(_styles["default"]).reduce(reduceClasses, {});
|
22
22
|
describe("Label", function () {
|
23
23
|
it('matches the snapshot', function () {
|
24
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Label["default"], {
|
24
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
25
25
|
classes: classes
|
26
26
|
}, "Label"));
|
27
27
|
expect(wrapper).toMatchSnapshot();
|
28
28
|
});
|
29
29
|
it('shows the children content', function () {
|
30
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Label["default"], {
|
30
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
31
31
|
classes: classes
|
32
32
|
}, "Label"));
|
33
33
|
expect(wrapper.text()).toEqual('Label');
|
34
34
|
});
|
35
35
|
it('calls onClick function', function () {
|
36
36
|
var onClick = jest.fn();
|
37
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Label["default"], {
|
37
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
38
38
|
classes: classes,
|
39
39
|
onClick: onClick
|
40
40
|
}, "Label"));
|
@@ -43,7 +43,7 @@ describe("Label", function () {
|
|
43
43
|
});
|
44
44
|
it('calls onClose function', function () {
|
45
45
|
var onClose = jest.fn();
|
46
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Label["default"], {
|
46
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
47
47
|
classes: classes,
|
48
48
|
onClose: onClose
|
49
49
|
}, "Label"));
|
@@ -53,7 +53,7 @@ describe("Label", function () {
|
|
53
53
|
expect(onClose.mock.calls.length).toBe(1);
|
54
54
|
});
|
55
55
|
it('has the right theme', function () {
|
56
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_Label["default"], {
|
56
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
57
57
|
classes: classes,
|
58
58
|
theme: "default"
|
59
59
|
}, "Label"));
|
@@ -62,7 +62,7 @@ describe("Label", function () {
|
|
62
62
|
});
|
63
63
|
describe("LabelJSS", function () {
|
64
64
|
it('matches the snapshot', function () {
|
65
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_index["default"], null, "Label"));
|
65
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], null, "Label"));
|
66
66
|
expect(wrapper).toMatchSnapshot();
|
67
67
|
});
|
68
68
|
});
|
@@ -0,0 +1,82 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`Label matches the snapshot 1`] = `ShallowWrapper {}`;
|
4
|
+
|
5
|
+
exports[`Label styles matches the snapshot 1`] = `
|
6
|
+
Object {
|
7
|
+
"blue": Object {
|
8
|
+
"& $close": Object {
|
9
|
+
"&:after": Object {
|
10
|
+
"background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICAJIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KICAgICAgICAgICAgPHBvbHlnb24gZmlsbD0iI2ZmZmZmZiIgcG9pbnRzPSI1LjQsNCA0LDUuNCAxMC43LDEyLjEgNC4yLDE4LjYgNS42LDIwIDEyLjEsMTMuNSAxOC40LDE5LjggMTkuOCwxOC40IDEzLjUsMTIuMSAyMCw1LjYgMTguNiw0LjIKICAgICAgICAgICAgCTEyLjEsMTAuNyAiLz4KICAgICAgICAgICAgPC9zdmc+)",
|
11
|
+
},
|
12
|
+
"&:before": Object {
|
13
|
+
"background": "#083cae",
|
14
|
+
},
|
15
|
+
},
|
16
|
+
"background": "#083cae",
|
17
|
+
"borderColor": "#083cae",
|
18
|
+
"color": "#ffffff",
|
19
|
+
},
|
20
|
+
"close": Object {
|
21
|
+
"&:after": Object {
|
22
|
+
"background": "url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgogICAgICAgICAgICAJIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KICAgICAgICAgICAgPHBvbHlnb24gZmlsbD0iI2FiYjZiZCIgcG9pbnRzPSI1LjQsNCA0LDUuNCAxMC43LDEyLjEgNC4yLDE4LjYgNS42LDIwIDEyLjEsMTMuNSAxOC40LDE5LjggMTkuOCwxOC40IDEzLjUsMTIuMSAyMCw1LjYgMTguNiw0LjIKICAgICAgICAgICAgCTEyLjEsMTAuNyAiLz4KICAgICAgICAgICAgPC9zdmc+)",
|
23
|
+
"content": "\\"\\"",
|
24
|
+
"height": "18px",
|
25
|
+
"left": "0",
|
26
|
+
"position": "absolute",
|
27
|
+
"top": "0",
|
28
|
+
"width": "18px",
|
29
|
+
},
|
30
|
+
"&:before": Object {
|
31
|
+
"background": "#ffffff",
|
32
|
+
"borderRadius": "50%",
|
33
|
+
"content": "\\"\\"",
|
34
|
+
"filter": "blur(10px)",
|
35
|
+
"height": "50px",
|
36
|
+
"left": "-16px",
|
37
|
+
"position": "absolute",
|
38
|
+
"top": "-16px",
|
39
|
+
"width": "50px",
|
40
|
+
},
|
41
|
+
"&:hover": Object {
|
42
|
+
"opacity": "1",
|
43
|
+
},
|
44
|
+
"borderRadius": "50%",
|
45
|
+
"cursor": "pointer",
|
46
|
+
"display": "block",
|
47
|
+
"height": "18px",
|
48
|
+
"opacity": "0",
|
49
|
+
"position": "absolute",
|
50
|
+
"right": "4px",
|
51
|
+
"top": "1px",
|
52
|
+
"transition": "0.3s all",
|
53
|
+
"width": "18px",
|
54
|
+
},
|
55
|
+
"cursor": Object {
|
56
|
+
"cursor": "pointer",
|
57
|
+
},
|
58
|
+
"default": Object {
|
59
|
+
"background": "#ffffff",
|
60
|
+
"borderColor": "#979797",
|
61
|
+
"color": "#979797",
|
62
|
+
},
|
63
|
+
"label": Object {
|
64
|
+
"border": "1px solid",
|
65
|
+
"borderRadius": "11px",
|
66
|
+
"boxSizing": "border-box",
|
67
|
+
"display": "inline-block",
|
68
|
+
"fontFamily": "'OccText', sans-serif",
|
69
|
+
"fontSize": "11px",
|
70
|
+
"fontWeight": "normal",
|
71
|
+
"height": "22px",
|
72
|
+
"lineHeight": "20px",
|
73
|
+
"marginRight": "5px",
|
74
|
+
"overflow": "hidden",
|
75
|
+
"padding": "0 15px",
|
76
|
+
"position": "relative",
|
77
|
+
"textAlign": "center",
|
78
|
+
},
|
79
|
+
}
|
80
|
+
`;
|
81
|
+
|
82
|
+
exports[`LabelJSS matches the snapshot 1`] = `ShallowWrapper {}`;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
4
6
|
value: true
|
5
7
|
});
|
@@ -13,38 +15,40 @@ var _SubHeader = _interopRequireDefault(require("../SubHeader"));
|
|
13
15
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
15
17
|
|
16
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
17
|
-
|
18
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19
19
|
|
20
20
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
21
21
|
|
22
22
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
23
23
|
|
24
|
-
function
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
25
25
|
|
26
|
-
function
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
27
27
|
|
28
|
-
function
|
28
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
29
29
|
|
30
|
-
function
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
31
31
|
|
32
|
-
function
|
32
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
33
|
+
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
*
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
37
|
+
|
38
|
+
/**
|
39
|
+
* The LayerApp component is a wrapper for the SubHeader component that also includes a content block.
|
40
|
+
* It is meant to be used as an overlay screen, in front of the main content.
|
41
|
+
* There are no examples included, since the LayerApp component occupies the whole screen in first plane.
|
38
42
|
*/
|
39
|
-
var LayerApp =
|
40
|
-
/*#__PURE__*/
|
41
|
-
function (_React$Component) {
|
43
|
+
var LayerApp = /*#__PURE__*/function (_React$Component) {
|
42
44
|
_inherits(LayerApp, _React$Component);
|
43
45
|
|
46
|
+
var _super = _createSuper(LayerApp);
|
47
|
+
|
44
48
|
function LayerApp() {
|
45
49
|
_classCallCheck(this, LayerApp);
|
46
50
|
|
47
|
-
return
|
51
|
+
return _super.apply(this, arguments);
|
48
52
|
}
|
49
53
|
|
50
54
|
_createClass(LayerApp, [{
|
@@ -65,15 +69,15 @@ function (_React$Component) {
|
|
65
69
|
left = _this$props.left,
|
66
70
|
right = _this$props.right,
|
67
71
|
center = _this$props.center;
|
68
|
-
return _react["default"].createElement("div", {
|
72
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
69
73
|
className: "".concat(classes.layerApp, " ").concat(classes[theme])
|
70
|
-
}, _react["default"].createElement(_SubHeader["default"], {
|
74
|
+
}, /*#__PURE__*/_react["default"].createElement(_SubHeader["default"], {
|
71
75
|
theme: theme,
|
72
76
|
left: left,
|
73
77
|
right: right,
|
74
78
|
center: center,
|
75
79
|
fixed: fixed
|
76
|
-
}), _react["default"].createElement("div", {
|
80
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
77
81
|
className: classes.content
|
78
82
|
}, children));
|
79
83
|
}
|
@@ -21,13 +21,13 @@ var reduceClasses = function reduceClasses(prev, curr) {
|
|
21
21
|
var classes = Object.keys(_styles["default"]).reduce(reduceClasses, {});
|
22
22
|
describe("LayerApp", function () {
|
23
23
|
it('matches the snapshot', function () {
|
24
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_LayerApp["default"], {
|
24
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_LayerApp["default"], {
|
25
25
|
classes: classes
|
26
26
|
}));
|
27
27
|
expect(wrapper).toMatchSnapshot();
|
28
28
|
});
|
29
29
|
it('renders the LayerApp with the right theme', function () {
|
30
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_LayerApp["default"], {
|
30
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_LayerApp["default"], {
|
31
31
|
classes: classes
|
32
32
|
}));
|
33
33
|
expect(wrapper.find('.layerApp').hasClass('blue')).toEqual(true);
|
@@ -37,7 +37,7 @@ describe("LayerApp", function () {
|
|
37
37
|
expect(wrapper.find('.layerApp').hasClass('white')).toEqual(true);
|
38
38
|
});
|
39
39
|
it('renders the child content', function () {
|
40
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_LayerApp["default"], {
|
40
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_LayerApp["default"], {
|
41
41
|
classes: classes
|
42
42
|
}, "Child content"));
|
43
43
|
expect(wrapper.find('.content').text()).toEqual('Child content');
|
@@ -45,7 +45,7 @@ describe("LayerApp", function () {
|
|
45
45
|
});
|
46
46
|
describe("LayerAppJSS", function () {
|
47
47
|
it('matches the snapshot', function () {
|
48
|
-
var wrapper = (0, _enzyme.shallow)(_react["default"].createElement(_index["default"], null));
|
48
|
+
var wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react["default"].createElement(_index["default"], null));
|
49
49
|
expect(wrapper).toMatchSnapshot();
|
50
50
|
});
|
51
51
|
});
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`LayerApp matches the snapshot 1`] = `ShallowWrapper {}`;
|
4
|
+
|
5
|
+
exports[`LayerApp styles matches the snapshot 1`] = `
|
6
|
+
Object {
|
7
|
+
"blue": Object {
|
8
|
+
"background": "#ffffff",
|
9
|
+
},
|
10
|
+
"content": Object {
|
11
|
+
"boxSizing": "border-box",
|
12
|
+
"height": "calc(100% - 60px)",
|
13
|
+
"left": "0",
|
14
|
+
"paddingBottom": "50px",
|
15
|
+
"paddingTop": "30px",
|
16
|
+
"position": "absolute",
|
17
|
+
"top": "60px",
|
18
|
+
"width": "100%",
|
19
|
+
"zIndex": "1",
|
20
|
+
},
|
21
|
+
"layerApp": Object {
|
22
|
+
"boxSizing": "border-box",
|
23
|
+
"fontFamily": "'OccText', sans-serif",
|
24
|
+
"height": "100%",
|
25
|
+
"left": "0",
|
26
|
+
"overflow": "auto",
|
27
|
+
"position": "fixed",
|
28
|
+
"top": "0",
|
29
|
+
"width": "100%",
|
30
|
+
},
|
31
|
+
"white": Object {
|
32
|
+
"background": "#f7f7f7",
|
33
|
+
},
|
34
|
+
}
|
35
|
+
`;
|
36
|
+
|
37
|
+
exports[`LayerAppJSS matches the snapshot 1`] = `ShallowWrapper {}`;
|
package/build/Modal/Modal.js
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
+
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
4
6
|
value: true
|
5
7
|
});
|
@@ -25,7 +27,7 @@ var _grid = _interopRequireDefault(require("../subatomic/grid"));
|
|
25
27
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
27
29
|
|
28
|
-
function
|
30
|
+
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); }
|
29
31
|
|
30
32
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
31
33
|
|
@@ -33,32 +35,36 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
33
35
|
|
34
36
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
35
37
|
|
36
|
-
function
|
38
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
37
39
|
|
38
|
-
function
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
41
|
+
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
43
|
+
|
44
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
39
45
|
|
40
46
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
41
47
|
|
42
|
-
function
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
43
49
|
|
44
|
-
function
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
45
51
|
|
46
52
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
47
53
|
|
48
|
-
/**
|
49
|
-
* The Modal component is rendered in any given container, avoiding z-index an position conflicts. Your application must have the logic to show or hide the Modal component.
|
50
|
-
*/
|
51
|
-
var Modal =
|
52
|
-
/*#__PURE__*/
|
53
|
-
function (_React$Component) {
|
54
|
+
/**
|
55
|
+
* The Modal component is rendered in any given container, avoiding z-index an position conflicts. Your application must have the logic to show or hide the Modal component.
|
56
|
+
*/
|
57
|
+
var Modal = /*#__PURE__*/function (_React$Component) {
|
54
58
|
_inherits(Modal, _React$Component);
|
55
59
|
|
60
|
+
var _super = _createSuper(Modal);
|
61
|
+
|
56
62
|
function Modal(props) {
|
57
63
|
var _this;
|
58
64
|
|
59
65
|
_classCallCheck(this, Modal);
|
60
66
|
|
61
|
-
_this =
|
67
|
+
_this = _super.call(this, props);
|
62
68
|
|
63
69
|
_defineProperty(_assertThisInitialized(_this), "resize", function () {
|
64
70
|
_this.setState({
|
@@ -114,62 +120,66 @@ function (_React$Component) {
|
|
114
120
|
imgTop = _this$props.imgTop,
|
115
121
|
imgLeft = _this$props.imgLeft,
|
116
122
|
onTransitionEnd = _this$props.onTransitionEnd,
|
117
|
-
fullSize = _this$props.fullSize
|
123
|
+
fullSize = _this$props.fullSize,
|
124
|
+
testId = _this$props.testId;
|
118
125
|
|
119
|
-
var closeButton = _react["default"].createElement("div", {
|
126
|
+
var closeButton = /*#__PURE__*/_react["default"].createElement("div", {
|
120
127
|
className: classes.closeIcon
|
121
|
-
}, _react["default"].createElement(_Icon["default"], {
|
128
|
+
}, /*#__PURE__*/_react["default"].createElement(_Icon["default"], _extends({
|
122
129
|
iconName: "close",
|
123
130
|
width: 24,
|
124
131
|
height: 24,
|
125
132
|
colors: [_colors["default"].grey900],
|
126
133
|
onClick: onClose
|
127
|
-
}
|
134
|
+
}, testId && {
|
135
|
+
testId: "".concat(testId, "__close-icon")
|
136
|
+
})));
|
128
137
|
|
129
|
-
return _react["default"].createElement("div", {
|
138
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
139
|
+
"data-testid": testId,
|
130
140
|
className: "".concat(classes.overlay, " ").concat(show ? classes.overlayShow : classes.overlayHide).concat(!onClose ? " ".concat(classes.noClose) : ''),
|
131
141
|
onClick: onClose,
|
132
142
|
onTransitionEnd: onTransitionEnd
|
133
|
-
}, _react["default"].createElement("div", {
|
143
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
134
144
|
className: classes.cardWrapper
|
135
|
-
}, _react["default"].createElement("div", {
|
145
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
136
146
|
className: classes.cardBlock,
|
137
147
|
onClick: this.avoidClose
|
138
|
-
}, _react["default"].createElement(_Card["default"], {
|
148
|
+
}, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
139
149
|
shadow: 5,
|
140
150
|
className: "".concat(classes.card).concat(size ? " ".concat(classes[size]) : '').concat(show ? " ".concat(classes.cardShow) : " ".concat(classes.cardHide))
|
141
|
-
}, _react["default"].createElement(_Flexbox["default"], {
|
151
|
+
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
142
152
|
display: "flex",
|
143
153
|
direction: imgLeft.img ? 'row' : 'col'
|
144
|
-
}, (imgLeft.img || imgTop.img) && _react["default"].createElement("div", {
|
154
|
+
}, (imgLeft.img || imgTop.img) && /*#__PURE__*/_react["default"].createElement("div", {
|
145
155
|
className: imgLeft.img ? classes.imgLeft : classes.imgTop
|
146
|
-
}, imgTop.img && onClose && _react["default"].createElement("div", {
|
156
|
+
}, imgTop.img && onClose && /*#__PURE__*/_react["default"].createElement("div", {
|
147
157
|
className: classes.closePosition
|
148
|
-
}, closeButton)), _react["default"].createElement(_Flexbox["default"], {
|
158
|
+
}, closeButton)), /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
149
159
|
flex: imgLeft.img ? '1' : null
|
150
|
-
}, fullSize && mobile ? _react["default"].createElement("div", {
|
160
|
+
}, fullSize && mobile ? /*#__PURE__*/_react["default"].createElement("div", {
|
151
161
|
className: classes.top
|
152
|
-
}, _react["default"].createElement(_Flexbox["default"], {
|
162
|
+
}, /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
153
163
|
alignItems: "end",
|
154
164
|
className: classes.top
|
155
|
-
}, !imgTop.img && onClose && closeButton), title && _react["default"].createElement(_Text["default"], {
|
165
|
+
}, !imgTop.img && onClose && closeButton), title && /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
156
166
|
heading: true,
|
157
167
|
className: classes.title
|
158
|
-
}, title)) : _react["default"].createElement(_Flexbox["default"], {
|
168
|
+
}, title)) : /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
159
169
|
display: "flex",
|
160
170
|
justifyContent: "end",
|
161
171
|
alignItems: "start",
|
162
172
|
className: classes.top
|
163
|
-
}, title && _react["default"].createElement(_Flexbox["default"], {
|
173
|
+
}, title && /*#__PURE__*/_react["default"].createElement(_Flexbox["default"], {
|
164
174
|
flex: "1"
|
165
|
-
}, _react["default"].createElement(_Text["default"], {
|
175
|
+
}, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
166
176
|
heading: true,
|
167
177
|
className: classes.title
|
168
|
-
}, title)), !imgTop.img && onClose && closeButton), _react["default"].createElement("div", {
|
178
|
+
}, title)), !imgTop.img && onClose && closeButton), /*#__PURE__*/_react["default"].createElement("div", {
|
169
179
|
className: classes.content
|
170
|
-
}, children), mainBtn && _react["default"].createElement("div", {
|
180
|
+
}, children), mainBtn && /*#__PURE__*/_react["default"].createElement("div", {
|
171
181
|
className: classes.bottom
|
172
|
-
}, secBtn && _react["default"].createElement(_Button["default"], {
|
182
|
+
}, secBtn && /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
173
183
|
theme: "ghostGrey",
|
174
184
|
className: classes.secBtn,
|
175
185
|
onClick: secBtn.onClick,
|
@@ -178,7 +188,9 @@ function (_React$Component) {
|
|
178
188
|
loading: secBtn.loading,
|
179
189
|
disabled: secBtn.disabled,
|
180
190
|
id: secBtn.id
|
181
|
-
},
|
191
|
+
}, testId && {
|
192
|
+
testId: "".concat(testId, "__button_secondary")
|
193
|
+
}), secBtn.text), /*#__PURE__*/_react["default"].createElement(_Button["default"], _extends({
|
182
194
|
className: classes.mainBtn,
|
183
195
|
onClick: mainBtn.onClick,
|
184
196
|
href: mainBtn.href,
|
@@ -186,7 +198,9 @@ function (_React$Component) {
|
|
186
198
|
loading: mainBtn.loading,
|
187
199
|
disabled: mainBtn.disabled,
|
188
200
|
id: mainBtn.id
|
189
|
-
},
|
201
|
+
}, testId && {
|
202
|
+
testId: "".concat(testId, "__button_main")
|
203
|
+
}), mainBtn.text))))))));
|
190
204
|
}
|
191
205
|
}]);
|
192
206
|
|
@@ -243,7 +257,8 @@ Modal.propTypes = {
|
|
243
257
|
img: _propTypes["default"].string,
|
244
258
|
color: _propTypes["default"].string,
|
245
259
|
position: _propTypes["default"].oneOf(['left', 'center', 'right']),
|
246
|
-
size: _propTypes["default"].oneOf(['contain', 'cover'])
|
260
|
+
size: _propTypes["default"].oneOf(['contain', 'cover', _propTypes["default"].string]),
|
261
|
+
height: _propTypes["default"].number
|
247
262
|
}),
|
248
263
|
|
249
264
|
/** Image url to render it on the left of the modal dialog. */
|
@@ -258,7 +273,10 @@ Modal.propTypes = {
|
|
258
273
|
onTransitionEnd: _propTypes["default"].func,
|
259
274
|
|
260
275
|
/** Boolean value to make full size the Modal component in mobile size. */
|
261
|
-
fullSize: _propTypes["default"].bool
|
276
|
+
fullSize: _propTypes["default"].bool,
|
277
|
+
|
278
|
+
/** The testId property adds the data attribute data-testid to the main element and should be used for testing only. */
|
279
|
+
testId: _propTypes["default"].string
|
262
280
|
};
|
263
281
|
var _default = Modal;
|
264
282
|
exports["default"] = _default;
|