Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ausbom/card

Package Overview
Dependencies
Maintainers
5
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ausbom/card - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.7.3](https://github.com/AusBOM/bom-design-system/compare/@ausbom/card@0.7.2...@ausbom/card@0.7.3) (2020-09-09)
### Bug Fixes
* **card:** now displays icon when card is horiztional and no image ([1737103](https://github.com/AusBOM/bom-design-system/commit/17371035bd1ddafcfad094bf6cbd0d0fbbcfc288))
## [0.7.2](https://github.com/AusBOM/bom-design-system/compare/@ausbom/card@0.7.1...@ausbom/card@0.7.2) (2020-08-12)

@@ -8,0 +19,0 @@

2

lib/components/Card/Card.d.ts

@@ -0,1 +1,2 @@

import { IBreakpoints } from '@ausbom/styles/lib/breakpoints.d'
import React from 'react'

@@ -7,2 +8,3 @@

hideImageOnMobile?: boolean // TODO: Remove this later
hideImageBelow?: keyof IBreakpoints
horizontal?: boolean

@@ -9,0 +11,0 @@ icon?: React.ElementType

4

lib/components/Card/Card.js
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _icon=require("@ausbom/icon");var _ArrowRight=_interopRequireDefault(require("@ausbom/icon/lib/icons/system/ArrowRight16"));var _classnames=_interopRequireDefault(require("classnames"));var _react=_interopRequireDefault(require("react"));var Card=/*#__PURE__*/function(_React$PureComponent){(0,_inherits2["default"])(Card,_React$PureComponent);function Card(){(0,_classCallCheck2["default"])(this,Card);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(Card).apply(this,arguments))}(0,_createClass2["default"])(Card,[{key:"render",value:function render(){var _ref=this.props,Tag=_ref.as,children=_ref.children,className=_ref.className,hideImageBelow=_ref.hideImageBelow,hideImageOnMobile=_ref.hideImageOnMobile,horizontal=_ref.horizontal,icon=_ref.icon,id=_ref.id,image=_ref.image,innerRef=_ref.innerRef,meta=_ref.meta,title=_ref.title,TitleTag=_ref.titleTag,restProps=(0,_objectWithoutProperties2["default"])(_ref,["as","children","className","hideImageBelow","hideImageOnMobile","horizontal","icon","id","image","innerRef","meta","title","titleTag"]);// TODO: remove this when bom-react has been updated
if(hideImageOnMobile){console.warn("hideImageOnMobile will be depricated the next major release of Card. Use hideImageBelow")}var classes=(0,_classnames["default"])(className,"bom-card ",{"bom-card--hide-image-mobile":hideImageOnMobile,// TODO: remove this when bom-react has been updated
"bom-card--stacked":!horizontal,"bom-card--with-image":!!image});var imageClasses=(0,_classnames["default"])("bom-card__img",(0,_defineProperty2["default"])({},"bom-hide-below-".concat(hideImageBelow),!!hideImageBelow));var metaItems=_react["default"].Children.map(meta,function(data){return _react["default"].createElement("div",{className:"bom-card-meta__item"},data)});return _react["default"].createElement(Tag,(0,_extends2["default"])({className:classes,"aria-describedby":children?id:undefined,ref:innerRef},restProps),image&&_react["default"].createElement("div",{className:imageClasses},image),_react["default"].createElement("div",{className:"bom-card__text"},_react["default"].createElement(TitleTag,{className:"bom-card__title"},title,_react["default"].createElement(_icon.SystemIcon,{className:"bom-card__icon",size:16,icon:icon||_ArrowRight["default"],"aria-hidden":true})),meta&&meta.length>0&&_react["default"].createElement("div",{className:"bom-card-meta"},metaItems),children&&_react["default"].createElement("div",{id:id,className:"bom-card__desc"},children)))}}]);return Card}(_react["default"].PureComponent);(0,_defineProperty2["default"])(Card,"defaultProps",{as:"a",titleTag:"h3",hideImageOnMobile:false// TODO: Remove this later
if(hideImageOnMobile){console.warn("hideImageOnMobile will be depricated the next major release of Card. Use hideImageBelow")}var classes=(0,_classnames["default"])(className,"bom-card ",(0,_defineProperty2["default"])({"bom-card--hide-image-mobile":hideImageOnMobile,// TODO: remove this when bom-react has been updated
"bom-card--stacked":!horizontal,"bom-card--with-image":!!image},"bom-card--hide-image-below-".concat(hideImageBelow),!!hideImageBelow));var metaItems=_react["default"].Children.map(meta,function(data){return _react["default"].createElement("div",{className:"bom-card-meta__item"},data)});return _react["default"].createElement(Tag,(0,_extends2["default"])({className:classes,"aria-describedby":children?id:undefined,ref:innerRef},restProps),image&&_react["default"].createElement("div",{className:"bom-card__img"},image),_react["default"].createElement("div",{className:"bom-card__text"},_react["default"].createElement(TitleTag,{className:"bom-card__title"},title,_react["default"].createElement(_icon.SystemIcon,{className:"bom-card__icon",size:16,icon:icon||_ArrowRight["default"],"aria-hidden":true})),meta&&meta.length>0&&_react["default"].createElement("div",{className:"bom-card-meta"},metaItems),children&&_react["default"].createElement("div",{id:id,className:"bom-card__desc"},children)))}}]);return Card}(_react["default"].PureComponent);(0,_defineProperty2["default"])(Card,"defaultProps",{as:"a",titleTag:"h3",hideImageOnMobile:false// TODO: Remove this later
});var CardWithRef=_react["default"].forwardRef(function(props,ref){return _react["default"].createElement(Card,(0,_extends2["default"])({innerRef:ref},props))});CardWithRef.displayName="Card";var _default=CardWithRef;exports["default"]=_default;
{
"name": "@ausbom/card",
"version": "0.7.2",
"version": "0.7.3",
"description": "",

@@ -41,3 +41,3 @@ "keywords": [],

"@ausbom/body": "^0.2.5",
"@ausbom/grid": "^0.4.3",
"@ausbom/grid": "^0.4.4",
"@ausbom/icon": "^0.11.0",

@@ -47,3 +47,3 @@ "@ausbom/styles": "^0.8.0",

},
"gitHead": "d2c33424f71dee7262d6fd97b8f6f0285dc19d76"
"gitHead": "e3b62dbe10f6d48b5424cb925dfdc72dd1265c79"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc