fannypack-v5
Version:
An accessible, composable, and friendly React UI Kit
37 lines (33 loc) • 1.89 kB
JavaScript
import 'classnames';
import 'emotion';
import '@emotion/core';
import 'emotion-theming';
import '@emotion/styled';
import { _ as _objectSpread2 } from '../chunk-0c448560.js';
import 'tinycolor2';
import './isFunction.js';
import './get.js';
import './theme.js';
import { tint, shade, readableColor, lighten } from './colors.js';
var generateTextVariants = function generateTextVariants(textColor) {
return {
text100: lighten(0.2, textColor)(),
text200: lighten(0.15, textColor)(),
text300: lighten(0.1, textColor)(),
text400: lighten(0.05, textColor)(),
text: textColor,
textTint: tint(0.8, textColor)(),
textInverted: readableColor(textColor)(),
textTintInverted: shade(0.3, textColor)()
};
};
var generateColorVariants = function generateColorVariants(_ref) {
var _objectSpread2$1;
var color = _ref.color,
paletteKey = _ref.paletteKey,
paletteOverrides = _ref.paletteOverrides;
return _objectSpread2((_objectSpread2$1 = {}, _objectSpread2$1[paletteKey + "100"] = tint(0.7, color)(), _objectSpread2$1[paletteKey + "200"] = tint(0.5, color)(), _objectSpread2$1[paletteKey + "300"] = tint(0.3, color)(), _objectSpread2$1[paletteKey + "400"] = tint(0.1, color)(), _objectSpread2$1[paletteKey] = color, _objectSpread2$1[paletteKey + "500"] = color, _objectSpread2$1[paletteKey + "600"] = shade(0.1, color)(), _objectSpread2$1[paletteKey + "700"] = shade(0.3, color)(), _objectSpread2$1[paletteKey + "800"] = shade(0.5, color)(), _objectSpread2$1[paletteKey + "900"] = shade(0.7, color)(), _objectSpread2$1[paletteKey + "Tint"] = tint(0.9, color)(), _objectSpread2$1[paletteKey + "Inverted"] = readableColor(color)(), _objectSpread2$1[paletteKey + "TintInverted"] = shade(0.5, color)(), _objectSpread2$1), paletteOverrides ? paletteOverrides({
color: color
}) : {});
};
export { generateColorVariants, generateTextVariants };