1 line
2.3 KiB
JSON
1 line
2.3 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport classNames from 'classnames';\nimport React, { useMemo } from 'react';\nimport { useBootstrapPrefix } from './ThemeProvider';\nimport createWithBsPrefix from './createWithBsPrefix';\nimport divWithClassName from './divWithClassName';\nimport CardContext from './CardContext';\nimport CardImg from './CardImg';\nvar DivStyledAsH5 = divWithClassName('h5');\nvar DivStyledAsH6 = divWithClassName('h6');\nvar CardBody = createWithBsPrefix('card-body');\nvar defaultProps = {\n body: false\n};\nvar Card = React.forwardRef(function (_ref, ref) {\n var bsPrefix = _ref.bsPrefix,\n className = _ref.className,\n bg = _ref.bg,\n text = _ref.text,\n border = _ref.border,\n body = _ref.body,\n children = _ref.children,\n _ref$as = _ref.as,\n Component = _ref$as === void 0 ? 'div' : _ref$as,\n props = _objectWithoutPropertiesLoose(_ref, [\"bsPrefix\", \"className\", \"bg\", \"text\", \"border\", \"body\", \"children\", \"as\"]);\n\n var prefix = useBootstrapPrefix(bsPrefix, 'card');\n var cardContext = useMemo(function () {\n return {\n cardHeaderBsPrefix: prefix + \"-header\"\n };\n }, [prefix]);\n return React.createElement(CardContext.Provider, {\n value: cardContext\n }, React.createElement(Component, _extends({\n ref: ref\n }, props, {\n className: classNames(className, prefix, bg && \"bg-\" + bg, text && \"text-\" + text, border && \"border-\" + border)\n }), body ? React.createElement(CardBody, null, children) : children));\n});\nCard.displayName = 'Card';\nCard.defaultProps = defaultProps;\nCard.Img = CardImg;\nCard.Title = createWithBsPrefix('card-title', {\n Component: DivStyledAsH5\n});\nCard.Subtitle = createWithBsPrefix('card-subtitle', {\n Component: DivStyledAsH6\n});\nCard.Body = CardBody;\nCard.Link = createWithBsPrefix('card-link', {\n Component: 'a'\n});\nCard.Text = createWithBsPrefix('card-text', {\n Component: 'p'\n});\nCard.Header = createWithBsPrefix('card-header');\nCard.Footer = createWithBsPrefix('card-footer');\nCard.ImgOverlay = createWithBsPrefix('card-img-overlay');\nexport default Card;","map":null,"metadata":{},"sourceType":"module"}
|