atenea-components 1.4.33 → 1.4.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
+ import { colors } from '../../tokens/colors';
2
3
  type IconBaseProps = {
3
4
  icon: React.ElementType;
4
5
  size?: number | string;
5
- color?: string;
6
+ color?: keyof typeof colors | string;
6
7
  className?: string;
7
8
  };
8
9
  export declare const IconBase: ({ icon: Icon, size, color, className, ...props }: IconBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -16,9 +16,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.IconBase = void 0;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const colors_1 = require("../../tokens/colors");
19
20
  const clsx_1 = __importDefault(require("clsx"));
20
21
  const IconBase = (_a) => {
21
22
  var { icon: Icon, size = 20, color = 'currentColor', className } = _a, props = __rest(_a, ["icon", "size", "color", "className"]);
22
- return ((0, jsx_runtime_1.jsx)(Icon, Object.assign({ size: size, color: color, className: (0, clsx_1.default)('inline-block', className) }, props)));
23
+ const getColor = (colorKey) => {
24
+ const [colorName, shade] = colorKey.split('-');
25
+ const colorObj = colors_1.colors[colorName];
26
+ return colorObj ? colorObj[Number(shade)] : colorKey;
27
+ };
28
+ return ((0, jsx_runtime_1.jsx)(Icon, Object.assign({ size: size, color: typeof color === 'string' && color.includes('-') ? getColor(color) : color, className: (0, clsx_1.default)('inline-block', className) }, props)));
23
29
  };
24
30
  exports.IconBase = IconBase;
package/dist/index.d.ts CHANGED
@@ -81,3 +81,4 @@ export * from "./components/icons/IconSleep2";
81
81
  export * from "./components/icons/IconSleep3";
82
82
  export * from "./components/icons/IconSleep4";
83
83
  export * from "./components/icons/IconSleep5";
84
+ export * from "./components/icons/IconSparkles";
package/dist/index.js CHANGED
@@ -92,3 +92,4 @@ tslib_1.__exportStar(require("./components/icons/IconSleep2"), exports);
92
92
  tslib_1.__exportStar(require("./components/icons/IconSleep3"), exports);
93
93
  tslib_1.__exportStar(require("./components/icons/IconSleep4"), exports);
94
94
  tslib_1.__exportStar(require("./components/icons/IconSleep5"), exports);
95
+ tslib_1.__exportStar(require("./components/icons/IconSparkles"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atenea-components",
3
- "version": "1.4.33",
3
+ "version": "1.4.35",
4
4
  "description": "React component library for Atenea",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",