UNPKG

@metamask/design-system-react-native

Version:
31 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateIconClassNames = void 0; /* eslint-disable jsdoc/check-param-names */ /* eslint-disable jsdoc/require-param */ const types_1 = require("../../types/index.cjs"); /** * Generates a Tailwind class name for the icon based on color and optional additional classes. * * @param color - The color of the icon, mapped to a Tailwind class. * @param size - Different sizes map to specific pixel dimensions * @param twClassName - Additional Tailwind class names for customization. * @returns A combined string of class names. * * Example: * ``` * const classNames = generateIconClassNames({ * color: IconColor.IconDefault, * size: IconSize.Md * }); * * console.log(classNames); * // Output: "text-icon-default w-[20px] h-[20px]" * ``` */ const generateIconClassNames = ({ color = types_1.IconColor.IconDefault, size = types_1.IconSize.Md, twClassName = '', }) => { const mergedClassnames = `${color} w-[${size}px] h-[${size}px] ${twClassName}`; return mergedClassnames; }; exports.generateIconClassNames = generateIconClassNames; //# sourceMappingURL=Icon.utilities.cjs.map