@uiw/react-card
Advanced tools
Comparing version 5.0.0-bate-1 to 5.0.0-bate-10
"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 |
import { ThemeVariantValueOptions } from '@uiw/utils'; | ||
import { CardStyleWarpProps } from './utils'; | ||
export declare const CardStyleTheme: { | ||
borderRadiusLarge: string; | ||
fontSizeDefault: string; | ||
lineHeightDefault: number; | ||
borderColorBaseActive: string; | ||
borderColorBase: string; | ||
backgroundColorBase: string; | ||
heightCardStyleHead: string; | ||
paddingVerticalCardStyleHead: number; | ||
paddingHorizontalCardStyleHead: string; | ||
borderRadius1CardStyleHead: string; | ||
borderRadius2CardStyleHead: string; | ||
borderRadius3CardStyleHead: number; | ||
borderRadius4CardStyleHead: number; | ||
colorBase: string; | ||
rightCardStyleHeadExtra: string; | ||
topCardStyleHeadExtra: number; | ||
paddingCardBody: string; | ||
borderTopCardBody: string; | ||
paddingVerticalCardStyleFooter: string; | ||
paddingHorizontalCardStyleFooter: string; | ||
borderTopCardStyleFooter: string; | ||
colorCardStyleFooter: string; | ||
}; | ||
import { CardStyleTheme } from './theme'; | ||
export { CardStyleTheme }; | ||
declare type HTMLDivElements = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>; | ||
@@ -28,0 +6,0 @@ declare type ThemeVar = ThemeVariantValueOptions<typeof CardStyleTheme>; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"]; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"]; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.CardStyleWarp = exports.CardStyleTheme = exports.CardStyleHeadTitle = exports.CardStyleHeadExtra = exports.CardStyleHead = exports.CardStyleFooter = exports.CardBody = void 0; | ||
exports.CardStyleHeadTitle = exports.CardStyleHeadExtra = exports.CardStyleHead = exports.CardStyleFooter = exports.CardBody = void 0; | ||
Object.defineProperty(exports, "CardStyleTheme", { | ||
enumerable: true, | ||
get: function get() { | ||
return _theme.CardStyleTheme; | ||
} | ||
}); | ||
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 CardStyleTheme = { | ||
borderRadiusLarge: '5px', | ||
fontSizeDefault: '14px', | ||
lineHeightDefault: 1.5, | ||
borderColorBaseActive: '#CCCCCC', | ||
borderColorBase: '#e9e9e9', | ||
backgroundColorBase: '#fff', | ||
heightCardStyleHead: '40px', | ||
paddingVerticalCardStyleHead: 0, | ||
paddingHorizontalCardStyleHead: '14px', | ||
borderRadius1CardStyleHead: '2px', | ||
borderRadius2CardStyleHead: '2px', | ||
borderRadius3CardStyleHead: 0, | ||
borderRadius4CardStyleHead: 0, | ||
colorBase: '#393e48', | ||
rightCardStyleHeadExtra: '16px', | ||
topCardStyleHeadExtra: 0, | ||
paddingCardBody: '14px', | ||
borderTopCardBody: '1px solid #e9e9e9', | ||
paddingVerticalCardStyleFooter: '8px', | ||
paddingHorizontalCardStyleFooter: '10px', | ||
borderTopCardStyleFooter: '1px solid #F2F2F2', | ||
colorCardStyleFooter: '#999999' | ||
}; | ||
exports.CardStyleTheme = CardStyleTheme; | ||
var propsTheme = { | ||
defaultTheme: (0, _objectSpread2["default"])({}, CardStyleTheme) | ||
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) { | ||
@@ -58,9 +31,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) { | ||
@@ -71,5 +42,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) { | ||
@@ -80,5 +49,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) { | ||
@@ -89,5 +56,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) { | ||
@@ -102,5 +67,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) { | ||
@@ -123,22 +86,3 @@ return (0, _utils.getThemeVariantValue)((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), propsTheme), 'backgroundColorBase'); | ||
}); | ||
exports.CardStyleWarp = CardStyleWarp; | ||
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 { ThemeVariantValueOptions } from '@uiw/utils'; | ||
import { CardStyleTheme } from './index'; | ||
import { CardStyleTheme } from './theme'; | ||
declare type ThemeVar = ThemeVariantValueOptions<typeof CardStyleTheme>; | ||
@@ -4,0 +4,0 @@ export interface CardStyleWarpProps extends ThemeVar { |
"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 _index = require("./index"); | ||
var _theme = require("./theme"); | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
var propsTheme = { | ||
defaultTheme: (0, _objectSpread2["default"])({}, _index.CardStyleTheme) | ||
defaultTheme: (0, _objectSpread2["default"])({}, _theme.CardStyleTheme) | ||
}; | ||
var getHoverOrActive = function getHoverOrActive(props) { | ||
@@ -34,3 +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) { | ||
@@ -42,8 +33,5 @@ if (!props.noHover) { | ||
} | ||
return (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""]))); | ||
}; | ||
exports.getNoHover = getNoHover; | ||
var getActive = function getActive(props) { | ||
@@ -53,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 { ThemeVariantValueOptions } from '@uiw/utils'; | ||
import { CardStyleWarpProps } from './utils'; | ||
export declare const CardStyleTheme: { | ||
borderRadiusLarge: string; | ||
fontSizeDefault: string; | ||
lineHeightDefault: number; | ||
borderColorBaseActive: string; | ||
borderColorBase: string; | ||
backgroundColorBase: string; | ||
heightCardStyleHead: string; | ||
paddingVerticalCardStyleHead: number; | ||
paddingHorizontalCardStyleHead: string; | ||
borderRadius1CardStyleHead: string; | ||
borderRadius2CardStyleHead: string; | ||
borderRadius3CardStyleHead: number; | ||
borderRadius4CardStyleHead: number; | ||
colorBase: string; | ||
rightCardStyleHeadExtra: string; | ||
topCardStyleHeadExtra: number; | ||
paddingCardBody: string; | ||
borderTopCardBody: string; | ||
paddingVerticalCardStyleFooter: string; | ||
paddingHorizontalCardStyleFooter: string; | ||
borderTopCardStyleFooter: string; | ||
colorCardStyleFooter: string; | ||
}; | ||
import { CardStyleTheme } from './theme'; | ||
export { CardStyleTheme }; | ||
declare type HTMLDivElements = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>; | ||
@@ -28,0 +6,0 @@ declare type ThemeVar = ThemeVariantValueOptions<typeof CardStyleTheme>; |
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'; | ||
import { getThemeVariantValue } from '@uiw/utils'; | ||
import { getActive, getNoHover } from './utils'; | ||
export var CardStyleTheme = { | ||
borderRadiusLarge: '5px', | ||
fontSizeDefault: '14px', | ||
lineHeightDefault: 1.5, | ||
borderColorBaseActive: '#CCCCCC', | ||
borderColorBase: '#e9e9e9', | ||
backgroundColorBase: '#fff', | ||
heightCardStyleHead: '40px', | ||
paddingVerticalCardStyleHead: 0, | ||
paddingHorizontalCardStyleHead: '14px', | ||
borderRadius1CardStyleHead: '2px', | ||
borderRadius2CardStyleHead: '2px', | ||
borderRadius3CardStyleHead: 0, | ||
borderRadius4CardStyleHead: 0, | ||
colorBase: '#393e48', | ||
rightCardStyleHeadExtra: '16px', | ||
topCardStyleHeadExtra: 0, | ||
paddingCardBody: '14px', | ||
borderTopCardBody: '1px solid #e9e9e9', | ||
paddingVerticalCardStyleFooter: '8px', | ||
paddingHorizontalCardStyleFooter: '10px', | ||
borderTopCardStyleFooter: '1px solid #F2F2F2', | ||
colorCardStyleFooter: '#999999' | ||
}; | ||
import { CardStyleTheme } from './theme'; | ||
export { CardStyleTheme }; | ||
var propsTheme = { | ||
defaultTheme: _extends({}, CardStyleTheme) | ||
}; | ||
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')); | ||
@@ -42,20 +18,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 { ThemeVariantValueOptions } from '@uiw/utils'; | ||
import { CardStyleTheme } from './index'; | ||
import { CardStyleTheme } from './theme'; | ||
declare type ThemeVar = ThemeVariantValueOptions<typeof CardStyleTheme>; | ||
@@ -4,0 +4,0 @@ export interface CardStyleWarpProps extends ThemeVar { |
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/taggedTemplateLiteralLoose"; | ||
import _extends from "@babel/runtime/helpers/extends"; | ||
var _templateObject, _templateObject2, _templateObject3, _templateObject4; | ||
import { css } from 'styled-components'; | ||
import { getThemeVariantValue } from '@uiw/utils'; | ||
import { CardStyleTheme } from './index'; | ||
import { CardStyleTheme } from './theme'; | ||
var propsTheme = { | ||
defaultTheme: _extends({}, CardStyleTheme) | ||
}; | ||
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')); | ||
export var getNoHover = props => { | ||
@@ -19,3 +16,2 @@ if (!props.noHover) { | ||
} | ||
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose([""]))); | ||
@@ -27,5 +23,4 @@ }; | ||
} | ||
return ""; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@uiw/react-card", | ||
"version": "5.0.0-bate-1", | ||
"version": "5.0.0-bate-10", | ||
"description": "Card component", | ||
@@ -48,3 +48,3 @@ "author": "Kenny Wong <wowohoo@qq.com>", | ||
"dependencies": { | ||
"@uiw/utils": "^5.0.0-bate-1" | ||
"@uiw/utils": "^5.0.0-bate-10" | ||
}, | ||
@@ -51,0 +51,0 @@ "devDependencies": { |
import styled, { css } from 'styled-components'; | ||
import { getThemeVariantValue, ThemeVariantValueOptions } from '@uiw/utils'; | ||
import { CardStyleWarpProps, getActive, getNoHover } from './utils'; | ||
export const CardStyleTheme = { | ||
borderRadiusLarge: '5px', | ||
fontSizeDefault: '14px', | ||
lineHeightDefault: 1.5, | ||
borderColorBaseActive: '#CCCCCC', | ||
borderColorBase: '#e9e9e9', | ||
backgroundColorBase: '#fff', | ||
heightCardStyleHead: '40px', | ||
paddingVerticalCardStyleHead: 0, | ||
paddingHorizontalCardStyleHead: '14px', | ||
borderRadius1CardStyleHead: '2px', | ||
borderRadius2CardStyleHead: '2px', | ||
borderRadius3CardStyleHead: 0, | ||
borderRadius4CardStyleHead: 0, | ||
colorBase: '#393e48', | ||
rightCardStyleHeadExtra: '16px', | ||
topCardStyleHeadExtra: 0, | ||
paddingCardBody: '14px', | ||
borderTopCardBody: '1px solid #e9e9e9', | ||
paddingVerticalCardStyleFooter: '8px', | ||
paddingHorizontalCardStyleFooter: '10px', | ||
borderTopCardStyleFooter: '1px solid #F2F2F2', | ||
colorCardStyleFooter: '#999999', | ||
}; | ||
import { CardStyleTheme } from './theme'; | ||
export { CardStyleTheme }; | ||
const propsTheme = { | ||
@@ -48,3 +20,3 @@ defaultTheme: { ...CardStyleTheme }, | ||
${getThemeVariantValue({ ...props, ...propsTheme }, 'paddingVerticalCardStyleHead')} ${getThemeVariantValue( | ||
props, | ||
{ ...props, ...propsTheme }, | ||
'paddingHorizontalCardStyleHead', | ||
@@ -58,3 +30,3 @@ )} | ||
)} ${getThemeVariantValue({ ...props, ...propsTheme }, 'borderRadius3CardStyleHead')} ${getThemeVariantValue( | ||
props, | ||
{ ...props, ...propsTheme }, | ||
'borderRadius4CardStyleHead', | ||
@@ -122,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 }; |
import { css } from 'styled-components'; | ||
import { ThemeVariantValueOptions, getThemeVariantValue } from '@uiw/utils'; | ||
import { CardStyleTheme } from './index'; | ||
import { CardStyleTheme } from './theme'; | ||
type ThemeVar = ThemeVariantValueOptions<typeof CardStyleTheme>; | ||
@@ -17,2 +18,3 @@ const propsTheme = { | ||
`; | ||
console.log('333', CardStyleTheme, getThemeVariantValue({ ...propsTheme }, 'borderColorBaseActive')); | ||
@@ -19,0 +21,0 @@ export const getNoHover = (props: CardStyleWarpProps) => { |
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
30
74793
720
Updated@uiw/utils@^5.0.0-bate-10