Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / dist / components / atoms / MaterialIcon / renderProps.js
Size: Mime:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

const tslib_1 = require("tslib");

const react_1 = tslib_1.__importDefault(require("react"));

const styled_1 = require("./styled");

const Vector_1 = tslib_1.__importDefault(require("../Vector"));

const wording_1 = require("./wording");

const defaultRenderIcon = props => {
  const {
    type,
    pathAliases,
    paths,
    customPaths,
    className,
    onClick,
    isDisabled
  } = props; // NOTE:  this mechanism allows for us to have shorter names....

  const name = pathAliases[type] || type;
  const iconPath = customPaths && customPaths[name] || paths[name];
  const iconWords = wording_1.wording[name];
  const attributes = Object.assign({
    className,
    onClick: isDisabled ? undefined : onClick
  }, iconWords);
  return react_1.default.createElement(Vector_1.default, Object.assign({}, attributes, {
    viewBox: "0 0 24 24"
  }), react_1.default.createElement("path", {
    d: "M0 0h24v24H0z",
    fill: "none"
  }), react_1.default.createElement("g", null, iconPath));
};

exports.defaultRenderIcon = defaultRenderIcon;

const defaultWrapper = (props, attributes, icon) => {
  const {
    isDisabled,
    isSelected,
    isInteractive
  } = attributes;
  const wrapperProps = {
    className: props.className,
    isDisabled,
    isSelected,
    isInteractive,
    'data-qa': props['data-qa']
  };
  return props.nowrap ? react_1.default.createElement(react_1.default.Fragment, null, icon) : react_1.default.createElement(styled_1.Wrapper, Object.assign({}, wrapperProps), icon);
};

exports.defaultWrapper = defaultWrapper; //# sourceMappingURL=renderProps.js.map