Skip to content

Commit

Permalink
v2.2.0 (#64)
Browse files Browse the repository at this point in the history
* bump deps, regenerate lib

* message card, release chip design elements

* tidy message card icon styling

* propagate styling updates

* prepare v2.2.0
  • Loading branch information
sampsonj authored Apr 11, 2023
1 parent 01ced3e commit 83e9e1f
Show file tree
Hide file tree
Showing 121 changed files with 5,854 additions and 3,160 deletions.
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module.exports = {
'<rootDir>/src/',
],
moduleNameMapper: {
'@fontsource/inter': '<rootDir>/src/__mocks__/fileMock.js',
'@stomp/stompjs': '<rootDir>/src/__mocks__/fileMock.js',
'@stomp/rx-stomp': '<rootDir>/src/__mocks__/fileMock.js',
'(pdfjs-dist/legacy/build/pdf.worker)': '<rootDir>/src/__mocks__/constructorMock.js',
'\\.(css|less)$': '<rootDir>/src/__mocks__/styleMock.js',
'\\.(svg)$': '<rootDir>/src/__mocks__/svgMock.js',
Expand Down
4 changes: 2 additions & 2 deletions lib/components/AopDataViewer/AopDataViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var MIN_IFRAME_WIDTH = 240;

Expand Down
5 changes: 0 additions & 5 deletions lib/components/Bundles/DataProductBundleCard.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React from 'react';
export interface DataProductBundleCardClasses {
card?: string;
cardContent?: string;
cardContentFlexContainer?: string;
cardContentContainer?: string;
cardIcon?: string;
}
export interface DataProductBundleCardProps {
Expand All @@ -12,7 +8,6 @@ export interface DataProductBundleCardProps {
subTitleContent?: React.ReactNode;
customContent?: React.ReactNode;
isSplit?: boolean;
showIcon?: boolean;
classes?: DataProductBundleCardClasses;
}
declare const DataProductBundleCard: React.FC<DataProductBundleCardProps>;
Expand Down
77 changes: 28 additions & 49 deletions lib/components/Bundles/DataProductBundleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,33 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
var _CardContent = _interopRequireDefault(require("@material-ui/core/CardContent"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
var _styles = require("@material-ui/core/styles");
var _reactFontawesome = require("@fortawesome/react-fontawesome");
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
var _InfoMessageCard = _interopRequireDefault(require("../Card/InfoMessageCard"));
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
var _typeUtil = require("../../util/typeUtil");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var useStyles = (0, _styles.makeStyles)(function (theme) {
return {
card: {
backgroundColor: _Theme.default.colors.GOLD[50],
borderColor: _Theme.default.colors.GOLD[200],
marginTop: theme.spacing(1)
},
cardContent: {
padding: theme.spacing(2),
paddingBottom: "".concat(theme.spacing(2), "px !important")
},
cardContentFlexContainer: {
display: 'flex',
alignItems: 'center',
padding: theme.spacing(2),
paddingBottom: "".concat(theme.spacing(2), "px !important")
},
cardContentContainer: {
flexGrow: 1
},
cardIcon: {
color: theme.colors.GOLD[700],
padding: '5px',
fontSize: '2.3875em',
color: 'rgba(0, 0, 0, 0.9)',
padding: '5px 0px',
fontSize: '1.5em',
marginRight: theme.spacing(2)
},
cardIconBoxesStacked: {
color: theme.colors.GOLD[700],
fontSize: '2.3875em',
marginRight: theme.spacing(2)
cardSecondaryIcon: {
color: 'rgba(138, 191, 236, 0.9)',
// theme.colors.LIGHT_BLUE[200] with 'a' value applied
marginLeft: theme.spacing(2),
fontSize: '1.5rem'
},
cardTitleContentContainer: {
padding: theme.spacing(2, 2.5, 0.5, 2.5)
},
cardMessageContentContainer: {
padding: theme.spacing(0.25, 2.5, 2, 2.5)
}
};
});
Expand All @@ -54,12 +42,7 @@ var DataProductBundleCard = function DataProductBundleCard(props) {
detailContent = props.detailContent,
customContent = props.customContent,
isSplit = props.isSplit,
showIcon = props.showIcon,
customClasses = props.classes;
var customCardClass = customClasses ? customClasses.card : undefined;
var customCardContentClass = customClasses ? customClasses.cardContent : undefined;
var customCardContentFlexContainerClass = customClasses ? customClasses.cardContentFlexContainer : undefined;
var customCardContentContainerClass = customClasses ? customClasses.cardContentContainer : undefined;
var customIconClass = customClasses ? customClasses.cardIcon : undefined;
var renderContent = function renderContent() {
if ((0, _typeUtil.exists)(customContent)) {
Expand All @@ -75,31 +58,27 @@ var DataProductBundleCard = function DataProductBundleCard(props) {
variant: "body2"
}, subTitleContent));
};
var renderCardContent = function renderCardContent() {
if (!showIcon) {
return renderContent();
}
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
return /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, {
title: "Data Product Bundle",
messageContent: renderContent(),
icon: /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
icon: isSplit ? _freeSolidSvgIcons.faBoxesStacked : _freeSolidSvgIcons.faBox,
size: "2x",
className: customIconClass || isSplit ? classes.cardIconBoxesStacked : classes.cardIcon
}), /*#__PURE__*/_react.default.createElement("div", {
className: customCardContentContainerClass || classes.cardContentContainer
}, renderContent()));
};
return /*#__PURE__*/_react.default.createElement(_Card.default, {
className: customCardClass || classes.card
}, /*#__PURE__*/_react.default.createElement(_CardContent.default, {
className: showIcon ? customCardContentFlexContainerClass || classes.cardContentFlexContainer : customCardContentClass || classes.cardContent
}, renderCardContent()));
size: "1x",
className: customIconClass || classes.cardIcon
}),
classes: {
secondaryIcon: classes.cardSecondaryIcon,
cardTitleContentContainer: classes.cardTitleContentContainer,
messageContentContainer: classes.cardMessageContentContainer
}
});
};
DataProductBundleCard.defaultProps = {
titleContent: undefined,
detailContent: undefined,
subTitleContent: undefined,
customContent: undefined,
isSplit: false,
showIcon: true,
classes: undefined
};
var _default = DataProductBundleCard;
Expand Down
4 changes: 2 additions & 2 deletions lib/components/Button/SplitButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var SplitButton = function SplitButton(props) {
var name = props.name,
Expand Down
8 changes: 4 additions & 4 deletions lib/components/Card/BaseCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ var useStyles = (0, _styles.makeStyles)(function (muiTheme) {
})
);
});
var CardType;
exports.CardType = CardType;
(function (CardType) {
var CardType = /*#__PURE__*/function (CardType) {
CardType["INFO"] = "INFO";
CardType["WARN"] = "WARN";
CardType["ERROR"] = "ERROR";
})(CardType || (exports.CardType = CardType = {}));
return CardType;
}({});
exports.CardType = CardType;
var BaseCard = function BaseCard(props) {
var classes = useStyles(_Theme.default);
var type = props.type,
Expand Down
22 changes: 22 additions & 0 deletions lib/components/Card/BaseMessageCard.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
export declare enum MessageCardType {
INFO = "INFO"
}
export interface BaseMessageCardClasses {
card: string;
primaryIcon: string;
secondaryIcon: string;
cardTitleContentContainer?: string;
messageContentContainer?: string;
}
export interface BaseMessageCardProps {
type: MessageCardType;
messageCardClasses: BaseMessageCardClasses;
icon?: React.ReactNode;
title?: string;
titleContent?: React.ReactNode;
message?: string;
messageContent?: React.ReactNode;
}
declare const BaseMessageCard: React.FC<BaseMessageCardProps>;
export default BaseMessageCard;
121 changes: 121 additions & 0 deletions lib/components/Card/BaseMessageCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.MessageCardType = void 0;
var _react = _interopRequireDefault(require("react"));
var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
var _CardContent = _interopRequireDefault(require("@material-ui/core/CardContent"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
var _styles = require("@material-ui/core/styles");
var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined"));
var _Theme = _interopRequireDefault(require("../Theme/Theme"));
var _typeUtil = require("../../util/typeUtil");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* eslint-disable react/require-default-props */

var useStyles = (0, _styles.makeStyles)(function (muiTheme) {
return (
// eslint-disable-next-line implicit-arrow-linebreak
(0, _styles.createStyles)({
startFlex: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center'
},
titleContentContainer: {
padding: muiTheme.spacing(2, 2.5, 1.5, 2.5)
},
textTitleContent: {
flexGrow: 1,
textTransform: 'uppercase',
fontSize: '0.775rem'
},
messageContainer: {
padding: muiTheme.spacing(0, 3, 3, 3)
}
})
);
});
var MessageCardType = /*#__PURE__*/function (MessageCardType) {
MessageCardType["INFO"] = "INFO";
return MessageCardType;
}({});
exports.MessageCardType = MessageCardType;
var BaseMessageCard = function BaseMessageCard(props) {
var classes = useStyles(_Theme.default);
var type = props.type,
messageCardClasses = props.messageCardClasses,
icon = props.icon,
title = props.title,
titleContent = props.titleContent,
message = props.message,
messageContent = props.messageContent;
var appliedTitleContentContainer = classes.titleContentContainer;
if (messageCardClasses && messageCardClasses.cardTitleContentContainer) {
appliedTitleContentContainer = messageCardClasses.cardTitleContentContainer;
}
var iconContent = /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, {
fontSize: "small",
className: messageCardClasses.primaryIcon
});
var secondaryIconContent = null;
switch (type) {
case MessageCardType.INFO:
if ((0, _typeUtil.exists)(icon)) {
// eslint-disable-next-line react/jsx-no-useless-fragment
iconContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, icon);
}
secondaryIconContent = /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, {
fontSize: "large",
className: messageCardClasses.secondaryIcon
});
break;
default:
break;
}
var renderTitle = function renderTitle() {
var titleTextContent = null;
if ((0, _typeUtil.isStringNonEmpty)(title)) {
titleTextContent = /*#__PURE__*/_react.default.createElement(_Typography.default, {
variant: "subtitle2",
className: classes.textTitleContent
}, title);
}
var appliedTitleContent = null;
if ((0, _typeUtil.exists)(titleContent)) {
appliedTitleContent = /*#__PURE__*/_react.default.createElement("div", {
style: {
flexGrow: 1
}
}, titleContent);
}
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent, secondaryIconContent);
};
var renderMessage = function renderMessage() {
var hasCustomClass = messageCardClasses && messageCardClasses.messageContentContainer;
var injectedMessageContainerClass = hasCustomClass ? messageCardClasses.messageContentContainer : classes.messageContainer;
if ((0, _typeUtil.exists)(messageContent)) {
return /*#__PURE__*/_react.default.createElement("div", {
className: injectedMessageContainerClass
}, messageContent);
}
if ((0, _typeUtil.isStringNonEmpty)(message)) {
return /*#__PURE__*/_react.default.createElement("div", {
className: injectedMessageContainerClass
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
variant: "body2"
}, message));
}
return null;
};
var content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, {
className: "".concat(classes.startFlex, " ").concat(appliedTitleContentContainer)
}, renderTitle()), renderMessage());
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Card.default, {
className: messageCardClasses.card
}, content));
};
var _default = BaseMessageCard;
exports.default = _default;
2 changes: 1 addition & 1 deletion lib/components/Card/ErrorCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); } /* eslint-disable react/require-default-props */
var useStyles = (0, _styles.makeStyles)(function (muiTheme) {
return (
// eslint-disable-next-line implicit-arrow-linebreak
Expand Down
Loading

0 comments on commit 83e9e1f

Please sign in to comment.