@uiw/react-card
Advanced tools
Comparing version 5.0.0-bate-5 to 5.0.0-bate-6
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -12,11 +10,6 @@ value: true | ||
exports["default"] = void 0; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _style = require("./style"); | ||
Object.keys(_style).forEach(function (key) { | ||
@@ -33,24 +26,21 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["prefixCls", "className", "title", "extra", "footer", "bordered", "noHover", "active", "bodyStyle", "bodyClassName", "children"]; | ||
var _default = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) { | ||
var _props$prefixCls = props.prefixCls, | ||
prefixCls = _props$prefixCls === void 0 ? 'w-card' : _props$prefixCls, | ||
className = props.className, | ||
title = props.title, | ||
extra = props.extra, | ||
footer = props.footer, | ||
_props$bordered = props.bordered, | ||
bordered = _props$bordered === void 0 ? true : _props$bordered, | ||
_props$noHover = props.noHover, | ||
noHover = _props$noHover === void 0 ? false : _props$noHover, | ||
_props$active = props.active, | ||
active = _props$active === void 0 ? false : _props$active, | ||
bodyStyle = props.bodyStyle, | ||
bodyClassName = props.bodyClassName, | ||
children = props.children, | ||
resetProps = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
prefixCls = _props$prefixCls === void 0 ? 'w-card' : _props$prefixCls, | ||
className = props.className, | ||
title = props.title, | ||
extra = props.extra, | ||
footer = props.footer, | ||
_props$bordered = props.bordered, | ||
bordered = _props$bordered === void 0 ? true : _props$bordered, | ||
_props$noHover = props.noHover, | ||
noHover = _props$noHover === void 0 ? false : _props$noHover, | ||
_props$active = props.active, | ||
active = _props$active === void 0 ? false : _props$active, | ||
bodyStyle = props.bodyStyle, | ||
bodyClassName = props.bodyClassName, | ||
children = props.children, | ||
resetProps = (0, _objectWithoutProperties2["default"])(props, _excluded); | ||
var cls = (0, _react.useMemo)(function () { | ||
@@ -85,4 +75,3 @@ return [prefixCls, className, bordered ? "".concat(prefixCls, "-bordered") : null, noHover ? "".concat(prefixCls, "-no-hover") : null, active ? 'active' : null].filter(Boolean).join(' ').trim(); | ||
}); | ||
exports["default"] = _default; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -18,21 +16,12 @@ value: true | ||
exports.CardStyleWarp = void 0; | ||
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _styledComponents = _interopRequireWildcard(require("styled-components")); | ||
var _utils = require("@uiw/utils"); | ||
var _utils2 = require("./utils"); | ||
var _theme = require("./theme"); | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7; | ||
var propsTheme = { | ||
defaultTheme: (0, _objectSpread2["default"])({}, _theme.CardStyleTheme) | ||
}; | ||
var CardStyleHead = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n line-height: ", ";\n padding: ", ";\n border-radius: ", ";\n zoom: 1;\n"])), function (props) { | ||
@@ -43,9 +32,7 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'heightCardStyleHead'); | ||
}, function (props) { | ||
return "\n ".concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'paddingVerticalCardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)(props, 'paddingHorizontalCardStyleHead'), "\n "); | ||
return "\n ".concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'paddingVerticalCardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'paddingHorizontalCardStyleHead'), "\n "); | ||
}, function (props) { | ||
return "\n ".concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'borderRadius1CardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)(props, 'borderRadius2CardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'borderRadius3CardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)(props, 'borderRadius4CardStyleHead'), "\n "); | ||
return "\n ".concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'borderRadius1CardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)(props, 'borderRadius2CardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'borderRadius3CardStyleHead'), " ").concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'borderRadius4CardStyleHead'), "\n "); | ||
}); | ||
exports.CardStyleHead = CardStyleHead; | ||
var CardStyleHeadTitle = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n text-overflow: ellipsis;\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n color: ", ";\n font-weight: 500;\n display: inline-block;\n"])), function (props) { | ||
@@ -56,5 +43,3 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'fontSizeDefault'); | ||
}); | ||
exports.CardStyleHeadTitle = CardStyleHeadTitle; | ||
var CardStyleHeadExtra = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: ", ";\n top: ", ";\n"])), function (props) { | ||
@@ -65,5 +50,3 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'rightCardStyleHeadExtra'); | ||
}); | ||
exports.CardStyleHeadExtra = CardStyleHeadExtra; | ||
var CardBody = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n ", " + & {\n border-top: ", ";\n }\n"])), function (props) { | ||
@@ -74,5 +57,3 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'paddingCardBody'); | ||
}); | ||
exports.CardBody = CardBody; | ||
var CardStyleFooter = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n color: ", ";\n a {\n color: ", ";\n }\n ", " + & {\n border-top: ", ";\n }\n"])), function (props) { | ||
@@ -87,5 +68,3 @@ return "\n ".concat((0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'paddingVerticalCardStyleFooter'), " ").concat((0, _utils.getThemeVariantValue)(props, 'paddingHorizontalCardStyleFooter'), " \n "); | ||
}); | ||
exports.CardStyleFooter = CardStyleFooter; | ||
var CardStyleWarp = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n background: ", ";\n border-radius: ", ";\n font-size: ", ";\n line-height: ", ";\n position: relative;\n transition: all 0.3s;\n ", "\n ", "\n ", "\n"])), function (props) { | ||
@@ -108,22 +87,3 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'backgroundColorBase'); | ||
}); | ||
exports.CardStyleWarp = CardStyleWarp; | ||
CardStyleWarp.defaultProps = { | ||
defaultTheme: _theme.CardStyleTheme | ||
}; | ||
CardStyleHead.defaultProps = { | ||
defaultTheme: _theme.CardStyleTheme | ||
}; | ||
CardStyleHeadTitle.defaultProps = { | ||
defaultTheme: _theme.CardStyleTheme | ||
}; | ||
CardStyleHeadExtra.defaultProps = { | ||
defaultTheme: _theme.CardStyleTheme | ||
}; | ||
CardBody.defaultProps = { | ||
defaultTheme: _theme.CardStyleTheme | ||
}; | ||
CardStyleFooter.defaultProps = { | ||
defaultTheme: _theme.CardStyleTheme | ||
}; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,19 +8,11 @@ value: true | ||
exports.getNoHover = exports.getActive = void 0; | ||
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _styledComponents = require("styled-components"); | ||
var _utils = require("@uiw/utils"); | ||
var _theme = require("./theme"); | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
var propsTheme = { | ||
defaultTheme: (0, _objectSpread2["default"])({}, _theme.CardStyleTheme) | ||
}; | ||
var getHoverOrActive = function getHoverOrActive(props) { | ||
@@ -34,5 +25,3 @@ return (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-shadow: 0 1px 6px ", ";\n border-color: ", ";\n"])), function () { | ||
}; | ||
console.log('333', _theme.CardStyleTheme, (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])({}, propsTheme), 'borderColorBaseActive')); | ||
var getNoHover = function getNoHover(props) { | ||
@@ -44,8 +33,5 @@ if (!props.noHover) { | ||
} | ||
return (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""]))); | ||
}; | ||
exports.getNoHover = getNoHover; | ||
var getActive = function getActive(props) { | ||
@@ -55,7 +41,5 @@ if (props.active) { | ||
} | ||
return ""; | ||
}; | ||
exports.getActive = getActive; | ||
//# sourceMappingURL=utils.js.map |
@@ -11,16 +11,15 @@ import _extends from "@babel/runtime/helpers/extends"; | ||
var { | ||
prefixCls = 'w-card', | ||
className, | ||
title, | ||
extra, | ||
footer, | ||
bordered = true, | ||
noHover = false, | ||
active = false, | ||
bodyStyle, | ||
bodyClassName, | ||
children | ||
} = props, | ||
resetProps = _objectWithoutPropertiesLoose(props, _excluded); | ||
prefixCls = 'w-card', | ||
className, | ||
title, | ||
extra, | ||
footer, | ||
bordered = true, | ||
noHover = false, | ||
active = false, | ||
bodyStyle, | ||
bodyClassName, | ||
children | ||
} = props, | ||
resetProps = _objectWithoutPropertiesLoose(props, _excluded); | ||
var cls = useMemo(() => [prefixCls, className, bordered ? prefixCls + "-bordered" : null, noHover ? prefixCls + "-no-hover" : null, active ? 'active' : null].filter(Boolean).join(' ').trim(), [prefixCls, className, bordered, noHover]); | ||
@@ -27,0 +26,0 @@ return /*#__PURE__*/_jsxs(CardStyleWarp, _extends({}, resetProps, { |
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7; | ||
import styled, { css } from 'styled-components'; | ||
@@ -14,3 +12,3 @@ import { getThemeVariantValue } from '@uiw/utils'; | ||
}; | ||
export var CardStyleHead = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n height: ", ";\n line-height: ", ";\n padding: ", ";\n border-radius: ", ";\n zoom: 1;\n"])), props => getThemeVariantValue(_extends({}, props, propsTheme), 'heightCardStyleHead'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'heightCardStyleHead'), props => "\n " + getThemeVariantValue(_extends({}, props, propsTheme), 'paddingVerticalCardStyleHead') + " " + getThemeVariantValue(props, 'paddingHorizontalCardStyleHead') + "\n ", props => "\n " + getThemeVariantValue(_extends({}, props, propsTheme), 'borderRadius1CardStyleHead') + " " + getThemeVariantValue(props, 'borderRadius2CardStyleHead') + " " + getThemeVariantValue(_extends({}, props, propsTheme), 'borderRadius3CardStyleHead') + " " + getThemeVariantValue(props, 'borderRadius4CardStyleHead') + "\n "); | ||
export var CardStyleHead = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n height: ", ";\n line-height: ", ";\n padding: ", ";\n border-radius: ", ";\n zoom: 1;\n"])), props => getThemeVariantValue(_extends({}, props, propsTheme), 'heightCardStyleHead'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'heightCardStyleHead'), props => "\n " + getThemeVariantValue(_extends({}, props, propsTheme), 'paddingVerticalCardStyleHead') + " " + getThemeVariantValue(_extends({}, props, propsTheme), 'paddingHorizontalCardStyleHead') + "\n ", props => "\n " + getThemeVariantValue(_extends({}, props, propsTheme), 'borderRadius1CardStyleHead') + " " + getThemeVariantValue(props, 'borderRadius2CardStyleHead') + " " + getThemeVariantValue(_extends({}, props, propsTheme), 'borderRadius3CardStyleHead') + " " + getThemeVariantValue(_extends({}, props, propsTheme), 'borderRadius4CardStyleHead') + "\n "); | ||
export var CardStyleHeadTitle = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n font-size: ", ";\n text-overflow: ellipsis;\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n color: ", ";\n font-weight: 500;\n display: inline-block;\n"])), props => getThemeVariantValue(_extends({}, props, propsTheme), 'fontSizeDefault'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'colorBase')); | ||
@@ -21,20 +19,2 @@ export var CardStyleHeadExtra = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n position: absolute;\n right: ", ";\n top: ", ";\n"])), props => getThemeVariantValue(_extends({}, props, propsTheme), 'rightCardStyleHeadExtra'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'topCardStyleHeadExtra')); | ||
export var CardStyleWarp = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteralLoose(["\n background: ", ";\n border-radius: ", ";\n font-size: ", ";\n line-height: ", ";\n position: relative;\n transition: all 0.3s;\n ", "\n ", "\n ", "\n"])), props => getThemeVariantValue(_extends({}, props, propsTheme), 'backgroundColorBase'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'borderRadiusLarge'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'fontSizeDefault'), props => getThemeVariantValue(_extends({}, props, propsTheme), 'lineHeightDefault'), props => props.bordered && css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteralLoose(["\n border: 1px solid ", ";\n "])), props => getThemeVariantValue(_extends({}, props, propsTheme), 'borderColorBase')), props => getNoHover(props), props => getActive(props)); | ||
CardStyleWarp.defaultProps = { | ||
defaultTheme: CardStyleTheme | ||
}; | ||
CardStyleHead.defaultProps = { | ||
defaultTheme: CardStyleTheme | ||
}; | ||
CardStyleHeadTitle.defaultProps = { | ||
defaultTheme: CardStyleTheme | ||
}; | ||
CardStyleHeadExtra.defaultProps = { | ||
defaultTheme: CardStyleTheme | ||
}; | ||
CardBody.defaultProps = { | ||
defaultTheme: CardStyleTheme | ||
}; | ||
CardStyleFooter.defaultProps = { | ||
defaultTheme: CardStyleTheme | ||
}; | ||
//# sourceMappingURL=index.js.map |
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
import { css } from 'styled-components'; | ||
@@ -12,5 +10,3 @@ import { getThemeVariantValue } from '@uiw/utils'; | ||
}; | ||
var getHoverOrActive = props => css(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n box-shadow: 0 1px 6px ", ";\n border-color: ", ";\n"])), () => getThemeVariantValue(_extends({}, props, propsTheme), 'borderColorBaseActive'), () => getThemeVariantValue(_extends({}, props, propsTheme), 'borderColorBaseActive')); | ||
console.log('333', CardStyleTheme, getThemeVariantValue(_extends({}, propsTheme), 'borderColorBaseActive')); | ||
@@ -21,3 +17,2 @@ export var getNoHover = props => { | ||
} | ||
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose([""]))); | ||
@@ -29,5 +24,4 @@ }; | ||
} | ||
return ""; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@uiw/react-card", | ||
"version": "5.0.0-bate-5", | ||
"version": "5.0.0-bate-6", | ||
"description": "Card component", | ||
@@ -48,3 +48,3 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@uiw/utils": "^5.0.0-bate-5" | ||
"@uiw/utils": "^5.0.0-bate-6" | ||
}, | ||
@@ -51,0 +51,0 @@ "devDependencies": { |
@@ -20,3 +20,3 @@ import styled, { css } from 'styled-components'; | ||
${getThemeVariantValue({ ...props, ...propsTheme }, 'paddingVerticalCardStyleHead')} ${getThemeVariantValue( | ||
props, | ||
{ ...props, ...propsTheme }, | ||
'paddingHorizontalCardStyleHead', | ||
@@ -30,3 +30,3 @@ )} | ||
)} ${getThemeVariantValue({ ...props, ...propsTheme }, 'borderRadius3CardStyleHead')} ${getThemeVariantValue( | ||
props, | ||
{ ...props, ...propsTheme }, | ||
'borderRadius4CardStyleHead', | ||
@@ -94,13 +94,1 @@ )} | ||
`; | ||
CardStyleWarp.defaultProps = { defaultTheme: CardStyleTheme }; | ||
CardStyleHead.defaultProps = { defaultTheme: CardStyleTheme }; | ||
CardStyleHeadTitle.defaultProps = { defaultTheme: CardStyleTheme }; | ||
CardStyleHeadExtra.defaultProps = { defaultTheme: CardStyleTheme }; | ||
CardBody.defaultProps = { defaultTheme: CardStyleTheme }; | ||
CardStyleFooter.defaultProps = { defaultTheme: CardStyleTheme }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74791
720
Updated@uiw/utils@^5.0.0-bate-6