@popmenu/table
Advanced tools
Comparing version 0.40.3 to 0.42.0
@@ -141,8 +141,8 @@ import * as React from 'react'; | ||
var _path$I; | ||
var _path$2$1; | ||
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$1() { _extends$2$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$2$1.apply(this, arguments); } | ||
function SvgUser(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1m({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$2$1({ | ||
viewBox: "0 0 16 16", | ||
@@ -154,3 +154,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$I || (_path$I = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$2$1 || (_path$2$1 = /*#__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", | ||
@@ -388,2 +388,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 = { | ||
@@ -735,8 +808,8 @@ variant: 'body1', | ||
var _path$1m; | ||
var _path$3; | ||
function _extends$2k() { _extends$2k = 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$2k.apply(this, arguments); } | ||
function _extends$3() { _extends$3 = 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$3.apply(this, arguments); } | ||
function SvgChevronDown(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$2k({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$3({ | ||
viewBox: "0 0 16 16", | ||
@@ -748,3 +821,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$1m || (_path$1m = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", { | ||
d: "M4 6l4 4 4-4", | ||
@@ -755,8 +828,8 @@ stroke: "currentColor" | ||
var _path$1l; | ||
var _path$2; | ||
function _extends$2j() { _extends$2j = 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$2j.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 SvgChevronUp(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$2j({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$2({ | ||
viewBox: "0 0 16 16", | ||
@@ -768,3 +841,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$1l || (_path$1l = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", { | ||
d: "M12 10L8 6l-4 4", | ||
@@ -775,8 +848,8 @@ stroke: "currentColor" | ||
var _path$U; | ||
var _path$1; | ||
function _extends$1C() { _extends$1C = 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$1C.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 SvgMore(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1C({ | ||
return /*#__PURE__*/React.createElement("svg", _extends$1({ | ||
viewBox: "0 0 16 16", | ||
@@ -788,3 +861,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$U || (_path$U = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", { | ||
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.334A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z", | ||
@@ -795,8 +868,8 @@ stroke: "currentColor" | ||
var _path$Q; | ||
var _path; | ||
function _extends$1x() { _extends$1x = 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$1x.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 SvgSearch(props) { | ||
return /*#__PURE__*/React.createElement("svg", _extends$1x({ | ||
return /*#__PURE__*/React.createElement("svg", _extends({ | ||
viewBox: "0 0 16 16", | ||
@@ -808,3 +881,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$Q || (_path$Q = /*#__PURE__*/React.createElement("path", { | ||
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", { | ||
d: "M7.333 12.667A5.333 5.333 0 107.333 2a5.333 5.333 0 000 10.667zM14 14l-2.9-2.9", | ||
@@ -811,0 +884,0 @@ stroke: "currentColor" |
@@ -182,8 +182,8 @@ 'use strict'; | ||
var _path$I; | ||
var _path$2$1; | ||
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$1() { _extends$2$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$2$1.apply(this, arguments); } | ||
function SvgUser(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1m({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2$1({ | ||
viewBox: "0 0 16 16", | ||
@@ -195,3 +195,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$I || (_path$I = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$2$1 || (_path$2$1 = /*#__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", | ||
@@ -429,2 +429,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 = { | ||
@@ -776,8 +849,8 @@ variant: 'body1', | ||
var _path$1m; | ||
var _path$3; | ||
function _extends$2k() { _extends$2k = 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$2k.apply(this, arguments); } | ||
function _extends$3() { _extends$3 = 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$3.apply(this, arguments); } | ||
function SvgChevronDown(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2k({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({ | ||
viewBox: "0 0 16 16", | ||
@@ -789,3 +862,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$1m || (_path$1m = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M4 6l4 4 4-4", | ||
@@ -796,8 +869,8 @@ stroke: "currentColor" | ||
var _path$1l; | ||
var _path$2; | ||
function _extends$2j() { _extends$2j = 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$2j.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 SvgChevronUp(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2j({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({ | ||
viewBox: "0 0 16 16", | ||
@@ -809,3 +882,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$1l || (_path$1l = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M12 10L8 6l-4 4", | ||
@@ -816,8 +889,8 @@ stroke: "currentColor" | ||
var _path$U; | ||
var _path$1; | ||
function _extends$1C() { _extends$1C = 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$1C.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 SvgMore(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1C({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({ | ||
viewBox: "0 0 16 16", | ||
@@ -829,3 +902,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$U || (_path$U = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.334A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z", | ||
@@ -836,8 +909,8 @@ stroke: "currentColor" | ||
var _path$Q; | ||
var _path; | ||
function _extends$1x() { _extends$1x = 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$1x.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 SvgSearch(props) { | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1x({ | ||
return /*#__PURE__*/React__namespace.createElement("svg", _extends({ | ||
viewBox: "0 0 16 16", | ||
@@ -849,3 +922,3 @@ fill: "none", | ||
height: "1em" | ||
}, props), _path$Q || (_path$Q = /*#__PURE__*/React__namespace.createElement("path", { | ||
}, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", { | ||
d: "M7.333 12.667A5.333 5.333 0 107.333 2a5.333 5.333 0 000 10.667zM14 14l-2.9-2.9", | ||
@@ -852,0 +925,0 @@ stroke: "currentColor" |
{ | ||
"name": "@popmenu/table", | ||
"version": "0.40.3", | ||
"version": "0.42.0", | ||
"license": "MIT", | ||
@@ -31,3 +31,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
2374
297355