UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

64 lines (59 loc) 2.55 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var createMemoStyles = require('../../theme/create-memo-styles.js'); var hexToRgba = require('../../theme/utils/hex-to-rgba/hex-to-rgba.js'); var getThemeColor = require('../../theme/utils/get-theme-color/get-theme-color.js'); var getSizeValue = require('../../theme/utils/get-size-value/get-size-value.js'); var getFontStyles = require('../../theme/utils/get-font-styles/get-font-styles.js'); var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); const sizes = { xs: 16, sm: 20, md: 26, lg: 32, xl: 40 }; var useStyles = createMemoStyles.createMemoStyles({ light: ({ theme, color }) => ({ backgroundColor: hexToRgba.hexToRgba(getThemeColor.getThemeColor({ theme, color, shade: theme.colorScheme === "dark" ? 9 : 0 }), theme.colorScheme === "dark" ? 0.3 : 1), color: getThemeColor.getThemeColor({ theme, color, shade: theme.colorScheme === "dark" ? 3 : 9 }) }), filled: ({ theme, color }) => ({ backgroundColor: getThemeColor.getThemeColor({ theme, color, shade: 7 }), color: theme.white, textShadow: `1px 1px 0 ${getThemeColor.getThemeColor({ theme, color, shade: 9 })}` }), root: ({ theme, size, radius }) => { const iconSize = getSizeValue.getSizeValue({ size, sizes }); return __spreadProps(__spreadValues({}, getFontStyles.getFontStyles(theme)), { display: "inline-flex", alignItems: "center", justifyContent: "center", boxSizing: "border-box", width: iconSize, height: iconSize, borderRadius: getSizeValue.getSizeValue({ size: radius, sizes: theme.radius }) }); } }); exports.default = useStyles; exports.sizes = sizes; //# sourceMappingURL=ThemeIcon.styles.js.map