UNPKG

@activecollab/components

Version:

ActiveCollab Components

36 lines 1.52 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _excluded = ["active", "alwaysShowIcon", "icon", "label", "value"]; import React, { forwardRef } from "react"; import { StyledValueButton, StyledValueButtonLabel, StyledValueButtonValue } from "./Styles"; export const ValueButton = /*#__PURE__*/forwardRef((_ref, ref) => { let _ref$active = _ref.active, active = _ref$active === void 0 ? false : _ref$active, _ref$alwaysShowIcon = _ref.alwaysShowIcon, alwaysShowIcon = _ref$alwaysShowIcon === void 0 ? false : _ref$alwaysShowIcon, icon = _ref.icon, label = _ref.label, value = _ref.value, args = _objectWithoutPropertiesLoose(_ref, _excluded); return /*#__PURE__*/React.createElement(StyledValueButton, _extends({ className: "c-value-button" }, args, { ref: ref, variant: "text gray", $active: active }), icon && alwaysShowIcon ? /*#__PURE__*/React.cloneElement(icon, { style: { display: "inline-block" } }) : null, label ? /*#__PURE__*/React.createElement(StyledValueButtonLabel, { color: "secondary", weight: "medium", className: "c-value-button__label" }, label, ":") : null, /*#__PURE__*/React.createElement(StyledValueButtonValue, { color: "secondary", weight: "medium", className: "c-value-button__value" }, value)); }); ValueButton.displayName = "ValueButton"; //# sourceMappingURL=ValueButton.js.map