UNPKG

@activecollab/components

Version:

ActiveCollab Components

91 lines (90 loc) 3 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; const _excluded = ["gradient"]; import React from "react"; import { GradientDefs } from "../../GradientDefs"; /** * @component ProjectIcon * @description * * The React Icon component is a visual element that displays an icon to represent a concept, object, or action. * The Icon component is * customizable, allowing for variations in size, color, and style to fit the needs of the application. * * A pencil (from PencilIcon) crossed at 45 degrees with a ruler, drawn as an * outlined rectangle. The ruler sits behind the pencil, with a transparent * break where the two cross. * * @prop {string} [gradient] - Optional CSS linear-gradient string to apply a custom fill. * Format: "linear-gradient(<angle>deg, <color1>, <color2>, ...)" * * @example * return ( * <ProjectIcon gradient="linear-gradient(135deg, #4da2ed, #f72222)" /> * ) * * @example * return ( * <ProjectIcon className="mr-2" /> * ) * * @see * https://system.activecollab.com/?path=/story/foundation-icons-icons--icons * @see * https://design.activecollab.com/docs/foundations/icons */ const ProjectIcon = /*#__PURE__*/React.forwardRef((_ref, ref) => { let gradient = _ref.gradient, props = _objectWithoutPropertiesLoose(_ref, _excluded); const fillValue = gradient ? "url(#icon-gradient)" : props != null && props.fill ? props.fill : "var(--color-theme-600)"; return /*#__PURE__*/React.createElement("svg", _extends({ xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", "data-testid": "ProjectIcon", fill: fillValue, focusable: false, ref: ref }, props), /*#__PURE__*/React.createElement(GradientDefs, { gradient: gradient }), /*#__PURE__*/React.createElement("mask", { id: "project-icon-ruler-cut", maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24" }, /*#__PURE__*/React.createElement("rect", { x: "0", y: "0", width: "24", height: "24", fill: "white" }), /*#__PURE__*/React.createElement("line", { x1: "-2", y1: "26", x2: "26", y2: "-2", stroke: "black", strokeWidth: "8.5" })), /*#__PURE__*/React.createElement("g", { mask: "url(#project-icon-ruler-cut)" }, /*#__PURE__*/React.createElement("rect", { transform: "rotate(45 12 12)", x: "1.5", y: "9.5", width: "21", height: "5", rx: "1", fill: "none", stroke: fillValue, strokeWidth: "2" })), /*#__PURE__*/React.createElement("path", { fillRule: "evenodd", d: "m14.06 9 .94.94L5.92 19H5v-.92zm3.6-6c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z" })); }); ProjectIcon.displayName = "ProjectIcon"; export default ProjectIcon; //# sourceMappingURL=Project.js.map