UNPKG

@activecollab/components

Version:

ActiveCollab Components

36 lines 1.34 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 { active = false, alwaysShowIcon = false, icon, label, value } = _ref, 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