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.4.0 to 0.4.1

14

CHANGELOG.md

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

<a name="0.4.1"></a>
## [0.4.1](https://github.com/AusBOM/bom-design-system/compare/@ausbom/card@0.4.0...@ausbom/card@0.4.1) (2020-02-06)
### Bug Fixes
* a11y[#1](https://github.com/AusBOM/bom-design-system/issues/1) remove aria-label from cards as recommended by intopia ([732fa02](https://github.com/AusBOM/bom-design-system/commit/732fa02))
* a11y[#3](https://github.com/AusBOM/bom-design-system/issues/3) add more descriptive alt text to card images ([83649dd](https://github.com/AusBOM/bom-design-system/commit/83649dd))
* fixes icon not showing when img is hidden and stacks img on mobile ([4a612d2](https://github.com/AusBOM/bom-design-system/commit/4a612d2))
<a name="0.4.0"></a>

@@ -8,0 +22,0 @@ # [0.4.0](https://github.com/AusBOM/bom-design-system/compare/@ausbom/card@0.3.2...@ausbom/card@0.4.0) (2020-02-03)

2

lib/components/Card/Card.js

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

"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,horizontal=_ref.horizontal,id=_ref.id,icon=_ref.icon,image=_ref.image,hideImageOnMobile=_ref.hideImageOnMobile,title=_ref.title,TitleTag=_ref.titleTag,innerRef=_ref.innerRef,restProps=(0,_objectWithoutProperties2["default"])(_ref,["as","children","className","horizontal","id","icon","image","hideImageOnMobile","title","titleTag","innerRef"]);var classes=(0,_classnames["default"])(className,"bom-card ",{"bom-card--stacked":!horizontal,"bom-card--with-image":image,"bom-card--hide-image-mobile":hideImageOnMobile});return _react["default"].createElement(Tag,(0,_extends2["default"])({className:classes,"aria-label":title,"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})),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});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;
"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,horizontal=_ref.horizontal,id=_ref.id,icon=_ref.icon,image=_ref.image,hideImageOnMobile=_ref.hideImageOnMobile,title=_ref.title,TitleTag=_ref.titleTag,innerRef=_ref.innerRef,restProps=(0,_objectWithoutProperties2["default"])(_ref,["as","children","className","horizontal","id","icon","image","hideImageOnMobile","title","titleTag","innerRef"]);var classes=(0,_classnames["default"])(className,"bom-card ",{"bom-card--stacked":!horizontal,"bom-card--with-image":image,"bom-card--hide-image-mobile":hideImageOnMobile});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})),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});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;
"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 _classnames=_interopRequireDefault(require("classnames"));var _react=_interopRequireDefault(require("react"));var MediaCard=/*#__PURE__*/function(_React$PureComponent){(0,_inherits2["default"])(MediaCard,_React$PureComponent);function MediaCard(){(0,_classCallCheck2["default"])(this,MediaCard);return(0,_possibleConstructorReturn2["default"])(this,(0,_getPrototypeOf2["default"])(MediaCard).apply(this,arguments))}(0,_createClass2["default"])(MediaCard,[{key:"render",value:function render(){var _ref=this.props,Tag=_ref.as,className=_ref.className,id=_ref.id,image=_ref.image,title=_ref.title,TitleTag=_ref.titleTag,horizontal=_ref.horizontal,meta=_ref.meta,innerRef=_ref.innerRef,children=_ref.children,restProps=(0,_objectWithoutProperties2["default"])(_ref,["as","className","id","image","title","titleTag","horizontal","meta","innerRef","children"]);// eslint-disable-line no-empty-pattern
var classes=(0,_classnames["default"])(className,"bom-media-card",{"bom-media-card--stacked":!horizontal,"bom-media-card--with-image":!!image});var metaItems=_react["default"].Children.map(meta,function(data){return _react["default"].createElement("li",{className:"bom-media-card-meta__item"},data)});return _react["default"].createElement(Tag,(0,_extends2["default"])({className:classes,"aria-label":title,"aria-describedby":meta?id:undefined,ref:innerRef},restProps),image&&_react["default"].createElement("div",{className:"bom-media-card__img"},image),_react["default"].createElement("div",{className:"bom-media-card__text"},_react["default"].createElement(TitleTag,{className:"bom-media-card__title"},title),metaItems&&metaItems.length&&_react["default"].createElement("ul",{className:"bom-media-card-meta"},metaItems),children&&_react["default"].createElement("div",{id:id,className:"bom-media-card__desc"},children)))}}]);return MediaCard}(_react["default"].PureComponent);(0,_defineProperty2["default"])(MediaCard,"defaultProps",{as:"a",titleTag:"h3",horizontal:false});var MediaCardWithRef=_react["default"].forwardRef(function(props,ref){return _react["default"].createElement(MediaCard,(0,_extends2["default"])({innerRef:ref},props))});MediaCardWithRef.displayName="MediaCard";var _default=MediaCardWithRef;exports["default"]=_default;
var classes=(0,_classnames["default"])(className,"bom-media-card",{"bom-media-card--stacked":!horizontal,"bom-media-card--with-image":!!image});var metaItems=_react["default"].Children.map(meta,function(data){return _react["default"].createElement("li",{className:"bom-media-card-meta__item"},data)});return _react["default"].createElement(Tag,(0,_extends2["default"])({className:classes,"aria-describedby":meta?id:undefined,ref:innerRef},restProps),image&&_react["default"].createElement("div",{className:"bom-media-card__img"},image),_react["default"].createElement("div",{className:"bom-media-card__text"},_react["default"].createElement(TitleTag,{className:"bom-media-card__title"},title),metaItems&&metaItems.length&&_react["default"].createElement("ul",{className:"bom-media-card-meta"},metaItems),children&&_react["default"].createElement("div",{id:id,className:"bom-media-card__desc"},children)))}}]);return MediaCard}(_react["default"].PureComponent);(0,_defineProperty2["default"])(MediaCard,"defaultProps",{as:"a",titleTag:"h3",horizontal:false});var MediaCardWithRef=_react["default"].forwardRef(function(props,ref){return _react["default"].createElement(MediaCard,(0,_extends2["default"])({innerRef:ref},props))});MediaCardWithRef.displayName="MediaCard";var _default=MediaCardWithRef;exports["default"]=_default;
{
"name": "@ausbom/card",
"version": "0.4.0",
"version": "0.4.1",
"description": "",

@@ -42,7 +42,7 @@ "keywords": [],

"@ausbom/grid": "^0.4.2",
"@ausbom/icon": "^0.7.1",
"@ausbom/icon": "^0.7.2",
"@ausbom/styles": "^0.8.0",
"@ausbom/typography": "^0.3.2"
},
"gitHead": "b5d0c0ea030bcd4ebfcc0f932f9a4a9898f3b0cc"
"gitHead": "0bb41622bdf84e61f307486f61542472513fc72d"
}

@@ -22,3 +22,3 @@ # @ausbom/card

<Card
image={(<img src={image} alt="placeholder alt text" />)}
image={(<img src={image} />)}
title="Card with image and no text"

@@ -25,0 +25,0 @@ id="card-image-1"

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