1 line
3.7 KiB
JSON
1 line
3.7 KiB
JSON
|
{"ast":null,"code":"import React, { useMemo } from 'react';\nimport { Color } from \"../color\";\nimport { generateColor } from \"../util\";\nvar Gradient = function Gradient(_ref) {\n var colors = _ref.colors,\n children = _ref.children,\n _ref$direction = _ref.direction,\n direction = _ref$direction === void 0 ? 'to right' : _ref$direction,\n type = _ref.type,\n prefixCls = _ref.prefixCls;\n var gradientColors = useMemo(function () {\n return colors.map(function (color, idx) {\n var result = generateColor(color);\n if (type === 'alpha' && idx === colors.length - 1) {\n result = new Color(result.setA(1));\n }\n return result.toRgbString();\n }).join(',');\n }, [colors, type]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-gradient\"),\n style: {\n position: 'absolute',\n inset: 0,\n background: \"linear-gradient(\".concat(direction, \", \").concat(gradientColors, \")\")\n }\n }, children);\n};\nexport default Gradient;","map":{"version":3,"names":["React","useMemo","Color","generateColor","Gradient","_ref","colors","children","_ref$direction","direction","type","prefixCls","gradientColors","map","color","idx","result","length","setA","toRgbString","join","createElement","className","concat","style","position","inset","background"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/@rc-component/color-picker/es/components/Gradient.js"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Color } from \"../color\";\nimport { generateColor } from \"../util\";\nvar Gradient = function Gradient(_ref) {\n var colors = _ref.colors,\n children = _ref.children,\n _ref$direction = _ref.direction,\n direction = _ref$direction === void 0 ? 'to right' : _ref$direction,\n type = _ref.type,\n prefixCls = _ref.prefixCls;\n var gradientColors = useMemo(function () {\n return colors.map(function (color, idx) {\n var result = generateColor(color);\n if (type === 'alpha' && idx === colors.length - 1) {\n result = new Color(result.setA(1));\n }\n return result.toRgbString();\n }).join(',');\n }, [colors, type]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-gradient\"),\n style: {\n position: 'absolute',\n inset: 0,\n background: \"linear-gradient(\".concat(direction, \", \").concat(gradientColors,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