UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

50 lines (47 loc) • 2.43 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var Icon_android_exports = {}; __export(Icon_android_exports, { Icon: () => Icon }); module.exports = __toCommonJS(Icon_android_exports); var import_react = require("react"); var import_compose = require("../compose.android.js"); function Icon(param) { var { icons, colorRole, color } = param; var _icons_android_props_size, _ref, _ref1; var _icons_android_props_composeStyle, _icons_android_props_composeStyle1; if (!/* @__PURE__ */ (0, import_react.isValidElement)(icons.android) || icons.android.type !== import_compose.Compose.Icon) throw new Error("One.UI.Icon icons.android must be a One.Android.Icon element"); var size = (_icons_android_props_size = icons.android.props.size) !== null && _icons_android_props_size !== void 0 ? _icons_android_props_size : 24; return (0, import_compose.renderIcon)({ ...icons.android.props, style: [{ width: size, height: size }, icons.android.props.style], composeStyle: { ...icons.android.props.composeStyle, width: (_ref = (_icons_android_props_composeStyle = icons.android.props.composeStyle) === null || _icons_android_props_composeStyle === void 0 ? void 0 : _icons_android_props_composeStyle.width) !== null && _ref !== void 0 ? _ref : size, height: (_ref1 = (_icons_android_props_composeStyle1 = icons.android.props.composeStyle) === null || _icons_android_props_composeStyle1 === void 0 ? void 0 : _icons_android_props_composeStyle1.height) !== null && _ref1 !== void 0 ? _ref1 : size, foregroundColor: color } }, color === void 0 ? colorRole !== null && colorRole !== void 0 ? colorRole : "primary" : void 0); } //# sourceMappingURL=Icon.android.js.map