UNPKG

react-fdt-gradient

Version:

A React component library for gradient-based designs, including text, background, and border gradients.

3 lines (2 loc) 1.28 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("react/jsx-runtime"),e=function(){return e=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r},e.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;exports.GradientBackground=function(n){var t=n.children,a=n.gradientColors,i=n.style,o=n.className,s="linear-gradient(90deg, ".concat(a.join(", "),")");return r.jsx("div",{className:o,style:e({background:s},i),children:t})},exports.GradientBorder=function(n){var t=n.children,a=n.gradientColors,i=n.borderWidth,o=void 0===i?2:i,s=n.style,d=n.className,c="linear-gradient(90deg, ".concat(a.join(", "),")");return r.jsx("div",{className:d,style:e({padding:o,borderRadius:"8px",background:c},s),children:r.jsx("div",{style:{background:"#fff",borderRadius:"inherit"},children:t})})},exports.GradientText=function(e){var n=e.text,t=e.direction,a=e.gradientColors,i=e.className,o="linear-gradient(".concat(t,", ").concat(a.join(", "),")");return r.jsx("span",{className:i,style:{background:o,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",display:"inline-block"},children:n})}; //# sourceMappingURL=index.js.map