@availity/app-tiles
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -5,2 +5,14 @@ # Changelog | ||
## [0.1.2](https://github.com/Availity/availity-react/compare/@availity/app-tiles@0.1.1...@availity/app-tiles@0.1.2) (2023-01-17) | ||
### Bug Fixes | ||
* **app-tiles:** fixing error with null parents in AppTiles ([6a8b90e](https://github.com/Availity/availity-react/commit/6a8b90ec8e6286e9a676564c12f0d2e5e1f1613c)) | ||
* **app-tiles:** fixing typescript issues ([f6b8f57](https://github.com/Availity/availity-react/commit/f6b8f57165023946784fcd3ea979b7397f8c552b)) | ||
* **app-tiles:** refactoring AppTiles and updating type from any ([a829ab5](https://github.com/Availity/availity-react/commit/a829ab585c8a590ff9ab40989aeb968d6cae2cdb)) | ||
* **app-tiles:** refactoring AppTiles and updating type from any ([0b728d0](https://github.com/Availity/availity-react/commit/0b728d0c63aa8b2c2d8ad95bc2525a15e9ba9079)) | ||
## [0.1.1](https://github.com/Availity/availity-react/compare/@availity/app-tiles@0.1.0...@availity/app-tiles@0.1.1) (2022-11-28) | ||
@@ -7,0 +19,0 @@ |
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
declare type ValidParent = { | ||
images?: { | ||
name?: string; | ||
shortName?: string; | ||
tile?: string; | ||
}; | ||
shortName?: string; | ||
}; | ||
declare type AppTilesProps = { | ||
@@ -19,3 +27,3 @@ /** For src prop. the alt property for your image source is not found or is loading. */ | ||
/** If parents are provided, it will render up to the first in the icon, ether images.tile or shortName. */ | ||
parents?: any[]; | ||
parents?: (ValidParent | null)[]; | ||
}; | ||
@@ -22,0 +30,0 @@ declare const AppTiles: { |
@@ -977,2 +977,3 @@ var __create = Object.create; | ||
var import_classnames = __toESM(require("classnames")); | ||
var import_prop_types = __toESM(require_prop_types()); | ||
@@ -1006,3 +1007,2 @@ // src/AppTiles.module.scss | ||
// src/AppTiles.tsx | ||
var import_prop_types = __toESM(require_prop_types()); | ||
var AppTiles = ({ | ||
@@ -1019,3 +1019,3 @@ tag: Tag = "span", | ||
}) => { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d, _e, _f; | ||
const classes = (0, import_classnames.default)(className, "app-icon", { | ||
@@ -1036,12 +1036,12 @@ [`app-icon-${color}`]: color && !branded, | ||
} | ||
if ((parents == null ? void 0 : parents.length) && parents[0]) { | ||
parents = parents.slice(0, 4); | ||
if (parents.length === 1) { | ||
const validParents = ((_c = parents == null ? void 0 : parents.filter((parent) => parent != null)) == null ? void 0 : _c.slice(0, 4)) || []; | ||
if (validParents.length > 0) { | ||
if (validParents.length === 1) { | ||
return /* @__PURE__ */ import_react.default.createElement(Tag, { | ||
className: classes | ||
}, ((_c = parents[0].images) == null ? void 0 : _c.tile) ? /* @__PURE__ */ import_react.default.createElement("img", { | ||
}, ((_d = validParents[0].images) == null ? void 0 : _d.tile) ? /* @__PURE__ */ import_react.default.createElement("img", { | ||
className: "w-100 h-100 align-baseline", | ||
src: parents[0].images.tile, | ||
alt: parents[0].images.name | ||
}) : parents[0].shortName); | ||
src: ((_e = validParents[0].images) == null ? void 0 : _e.tile) || "", | ||
alt: ((_f = validParents[0].images) == null ? void 0 : _f.name) || "" | ||
}) : validParents[0].shortName); | ||
} | ||
@@ -1052,3 +1052,3 @@ return /* @__PURE__ */ import_react.default.createElement(Tag, { | ||
className: AppTiles_module_default.container | ||
}, parents.map((parent) => { | ||
}, validParents.map((parent) => { | ||
var _a2; | ||
@@ -1055,0 +1055,0 @@ return ((_a2 = parent.images) == null ? void 0 : _a2.tile) ? /* @__PURE__ */ import_react.default.createElement("img", { |
{ | ||
"name": "@availity/app-tiles", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Availity UI Kit application tiled icon react component.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
103992
2486