@popmenu/dashboard
Advanced tools
Comparing version 0.40.3 to 0.42.0
@@ -127,8 +127,8 @@ import * as React from 'react'; | ||
var _path$I; | ||
var _path$2; | ||
function _extends$1m() { _extends$1m = 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$1m.apply(this, arguments); } | ||
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); } | ||
function SvgUser(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1m({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$2({ | ||
viewBox: "0 0 16 16", | ||
@@ -140,3 +140,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$I || (_path$I = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", { | ||
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z", | ||
@@ -374,2 +374,75 @@ stroke: "currentColor" | ||
var getBackground = function (theme) { return function (props) { | ||
var variant = props.variant, severity = props.severity; | ||
var background; | ||
var backgrounds = { | ||
outlined: 'none', | ||
error: 'error.main', | ||
warning: 'warning.main', | ||
info: 'info.light', | ||
success: 'success.light', | ||
}; | ||
if (variant === 'outlined') { | ||
background = backgrounds[variant]; | ||
} | ||
else if (severity) { | ||
var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1]; | ||
background = theme.palette[color][colorVariant]; | ||
} | ||
return background; | ||
}; }; | ||
var getColor = function (theme) { return function (props) { | ||
var variant = props.variant, severity = props.severity; | ||
var textColor; | ||
if (variant === 'outlined' && severity) { | ||
var textColors = { | ||
error: theme.palette.error.main, | ||
info: theme.palette.info.main, | ||
warning: theme.palette.warning.dark, | ||
success: theme.palette.success.dark, | ||
}; | ||
textColor = textColors[severity]; | ||
} | ||
else if (variant === 'outlined' && !severity) { | ||
textColor = theme.palette.grey[700]; | ||
} | ||
else if ((variant === 'default' || variant === undefined) && severity) { | ||
var textColors = { | ||
error: theme.palette.common.white, | ||
info: theme.palette.secondary.main, | ||
warning: theme.palette.secondary.main, | ||
success: theme.palette.secondary.main, | ||
}; | ||
textColor = textColors[severity]; | ||
} | ||
return textColor; | ||
}; }; | ||
var getBorder = function (theme) { return function (props) { | ||
var variant = props.variant, severity = props.severity; | ||
var borderColor; | ||
if (variant === 'outlined' && severity) { | ||
var borderColors = { | ||
error: theme.palette.error.main, | ||
info: theme.palette.info.main, | ||
warning: theme.palette.warning.dark, | ||
success: theme.palette.success.dark, | ||
}; | ||
borderColor = borderColors[severity]; | ||
} | ||
return borderColor; | ||
}; }; | ||
makeStyles$1(function (theme) { return ({ | ||
root: { | ||
background: getBackground(theme), | ||
color: getColor(theme), | ||
borderColor: getBorder(theme), | ||
borderRadius: theme.spacing(0.5), | ||
}, | ||
icon: { | ||
color: 'inherit', | ||
height: theme.spacing(2), | ||
width: theme.spacing(2), | ||
}, | ||
}); }); | ||
var defaultTypographyProps = { | ||
@@ -789,8 +862,8 @@ variant: 'body1', | ||
var _g$G; | ||
var _g$1; | ||
function _extends$1o() { _extends$1o = 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$1o.apply(this, arguments); } | ||
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); } | ||
function SvgTrend(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1o({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1({ | ||
viewBox: "0 0 16 16", | ||
@@ -802,3 +875,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _g$G || (_g$G = /*#__PURE__*/React.createElement("g", { | ||
}, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", { | ||
stroke: "currentColor" | ||
@@ -812,8 +885,8 @@ }, /*#__PURE__*/React.createElement("path", { | ||
var _g$F; | ||
var _g; | ||
function _extends$1n() { _extends$1n = 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$1n.apply(this, arguments); } | ||
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); } | ||
function SvgTrendDown(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1n({ | ||
return /*#__PURE__*/React.createElement("svg", _extends({ | ||
viewBox: "0 0 16 16", | ||
@@ -825,3 +898,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _g$F || (_g$F = /*#__PURE__*/React.createElement("g", { | ||
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", { | ||
stroke: "currentColor" | ||
@@ -828,0 +901,0 @@ }, /*#__PURE__*/React.createElement("path", { |
@@ -172,8 +172,8 @@ 'use strict'; | ||
var _path$I; | ||
var _path$2; | ||
function _extends$1m() { _extends$1m = 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$1m.apply(this, arguments); } | ||
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); } | ||
function SvgUser(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1m({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({ | ||
viewBox: "0 0 16 16", | ||
@@ -185,3 +185,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$I || (_path$I = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z", | ||
@@ -419,2 +419,75 @@ stroke: "currentColor" | ||
var getBackground = function (theme) { return function (props) { | ||
var variant = props.variant, severity = props.severity; | ||
var background; | ||
var backgrounds = { | ||
outlined: 'none', | ||
error: 'error.main', | ||
warning: 'warning.main', | ||
info: 'info.light', | ||
success: 'success.light', | ||
}; | ||
if (variant === 'outlined') { | ||
background = backgrounds[variant]; | ||
} | ||
else if (severity) { | ||
var _a = backgrounds[severity].split('.'), color = _a[0], colorVariant = _a[1]; | ||
background = theme.palette[color][colorVariant]; | ||
} | ||
return background; | ||
}; }; | ||
var getColor = function (theme) { return function (props) { | ||
var variant = props.variant, severity = props.severity; | ||
var textColor; | ||
if (variant === 'outlined' && severity) { | ||
var textColors = { | ||
error: theme.palette.error.main, | ||
info: theme.palette.info.main, | ||
warning: theme.palette.warning.dark, | ||
success: theme.palette.success.dark, | ||
}; | ||
textColor = textColors[severity]; | ||
} | ||
else if (variant === 'outlined' && !severity) { | ||
textColor = theme.palette.grey[700]; | ||
} | ||
else if ((variant === 'default' || variant === undefined) && severity) { | ||
var textColors = { | ||
error: theme.palette.common.white, | ||
info: theme.palette.secondary.main, | ||
warning: theme.palette.secondary.main, | ||
success: theme.palette.secondary.main, | ||
}; | ||
textColor = textColors[severity]; | ||
} | ||
return textColor; | ||
}; }; | ||
var getBorder = function (theme) { return function (props) { | ||
var variant = props.variant, severity = props.severity; | ||
var borderColor; | ||
if (variant === 'outlined' && severity) { | ||
var borderColors = { | ||
error: theme.palette.error.main, | ||
info: theme.palette.info.main, | ||
warning: theme.palette.warning.dark, | ||
success: theme.palette.success.dark, | ||
}; | ||
borderColor = borderColors[severity]; | ||
} | ||
return borderColor; | ||
}; }; | ||
styles.makeStyles(function (theme) { return ({ | ||
root: { | ||
background: getBackground(theme), | ||
color: getColor(theme), | ||
borderColor: getBorder(theme), | ||
borderRadius: theme.spacing(0.5), | ||
}, | ||
icon: { | ||
color: 'inherit', | ||
height: theme.spacing(2), | ||
width: theme.spacing(2), | ||
}, | ||
}); }); | ||
var defaultTypographyProps = { | ||
@@ -834,8 +907,8 @@ variant: 'body1', | ||
var _g$G; | ||
var _g$1; | ||
function _extends$1o() { _extends$1o = 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$1o.apply(this, arguments); } | ||
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); } | ||
function SvgTrend(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1o({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({ | ||
viewBox: "0 0 16 16", | ||
@@ -847,3 +920,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _g$G || (_g$G = /*#__PURE__*/React__namespace.createElement("g", { | ||
}, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", { | ||
stroke: "currentColor" | ||
@@ -857,8 +930,8 @@ }, /*#__PURE__*/React__namespace.createElement("path", { | ||
var _g$F; | ||
var _g; | ||
function _extends$1n() { _extends$1n = 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$1n.apply(this, arguments); } | ||
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); } | ||
function SvgTrendDown(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1n({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends({ | ||
viewBox: "0 0 16 16", | ||
@@ -870,3 +943,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _g$F || (_g$F = /*#__PURE__*/React__namespace.createElement("g", { | ||
}, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", { | ||
stroke: "currentColor" | ||
@@ -873,0 +946,0 @@ }, /*#__PURE__*/React__namespace.createElement("path", { |
{ | ||
"name": "@popmenu/dashboard", | ||
"version": "0.40.3", | ||
"version": "0.42.0", | ||
"license": "MIT", | ||
@@ -32,3 +32,3 @@ "author": "Popmenu Design System Team", | ||
"sideEffects": false, | ||
"gitHead": "4c00105cdaa8a85a0415d0c327de48bffcf84f08" | ||
"gitHead": "24261511bf22790cc6d7804a9b3a7bca83adfb56" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1945
264764