UNPKG

@braineet/ui

Version:

Braineet design system

84 lines 3.49 kB
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable no-underscore-dangle */ import { borderRadius as utilsBorderRadius, fluid, lighten as _lighten, darken, hashCode, getInitials, border, safeInvoke, useDebounce, light, dark, numberFormat, currencyFormat } from '../../utils'; import borderRadius from './borderRadius'; import colors from './colors'; import elevations from './elevations'; import fonts from './fonts'; import _getAvatarProps from './getAvatarProps'; import _getBackground from './getBackground'; import _getFills from './getFills'; import _getFontFamily from './getFontFamily'; import _getHeadingStyle from './getHeadingStyle'; import _getIconColor from './getIconColor'; import _getTextStyle from './getTextStyle'; import heading from './heading'; import spaces from './spaces'; import text from './text'; import typo from './typo'; import { getPalette as _getPalette, textColorContrast as _textColorContrast, getContrast as _getContrast } from './utils'; import zIndex from './zIndex'; export default (function (overrides) { if (overrides === void 0) { overrides = {}; } var _colors = colors(overrides.colors || {}); return _extends({}, overrides, { colors: _colors, zIndex: zIndex(overrides.zIndex || {}), typo: typo(overrides.typo || {}), spaces: spaces(overrides.spaces || {}), space: [], borderRadius: borderRadius(overrides.borderRadius || {}), elevations: elevations(overrides.elevations || {}, colors(overrides.colors || {})), utils: { borderRadius: utilsBorderRadius, fluid: fluid, lighten: function lighten(color, percent) { return _lighten(color, percent, _colors); }, darken: darken, hashCode: hashCode, getInitials: getInitials, border: border, safeInvoke: safeInvoke, useDebounce: useDebounce, light: light, dark: dark, numberFormat: numberFormat, currencyFormat: currencyFormat }, helpers: _extends({}, overrides.helpers, { getFills: function getFills(opts) { return _getFills(opts, _colors); }, getAvatarProps: function getAvatarProps(opts) { return _getAvatarProps(opts, _colors); }, getFontFamily: function getFontFamily(opts) { return _getFontFamily(opts, fonts(overrides.fonts || {})); }, getHeadingStyle: function getHeadingStyle(opts) { return _getHeadingStyle(opts, heading(overrides.heading || {}, fonts(overrides.fonts || {}))); }, getTextStyle: function getTextStyle(opts) { return _getTextStyle(opts, text(overrides.text || {})); }, getIconColor: function getIconColor(opts) { return _getIconColor(opts, _colors); }, getBackground: function getBackground(opts) { return _getBackground(opts, _colors); }, getPalette: function getPalette(color, selector) { return _getPalette(_colors, color, selector); }, getContrast: function getContrast(bgColor, textColor) { return _getContrast(bgColor, textColor); }, textColorContrast: function textColorContrast(color, lightColor, darkColor) { return _textColorContrast(color, lightColor, darkColor); } }) }); });