@brightleaf/elements
Version:
React UI elements styled with Bulma CSS
339 lines (311 loc) • 13.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.allTheClasses = exports.Responsive = exports.Helpers = exports.FontWeight = exports.Size = exports.Sized = exports.BackgroundColor = exports.HasText = exports.StyleOrState = exports.Screens = exports.Sizes = exports.Colors = void 0;
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var Colors = function Colors(_ref) {
var isPrimary = _ref.isPrimary,
isSuccess = _ref.isSuccess,
isInfo = _ref.isInfo,
isWarning = _ref.isWarning,
isDanger = _ref.isDanger,
isLink = _ref.isLink,
isLight = _ref.isLight,
isWhite = _ref.isWhite,
isDark = _ref.isDark,
isBlack = _ref.isBlack,
isText = _ref.isText;
return {
'is-primary': isPrimary,
'is-success': isSuccess,
'is-info': isInfo,
'is-warning': isWarning,
'is-danger': isDanger,
'is-link': isLink,
'is-light': isLight,
'is-white': isWhite,
'is-dark': isDark,
'is-black': isBlack,
'is-text': isText
};
};
exports.Colors = Colors;
var Sizes = function Sizes(_ref2) {
var isSmall = _ref2.isSmall,
isNormal = _ref2.isNormal,
isMedium = _ref2.isMedium,
isLarge = _ref2.isLarge,
isFullWidth = _ref2.isFullWidth;
return {
'is-small': isSmall,
'is-normal': isNormal,
'is-medium': isMedium,
'is-large': isLarge,
'is-fullwidth': isFullWidth
};
};
exports.Sizes = Sizes;
var Screens = function Screens(_ref3) {
var isMobile = _ref3.isMobile,
isFluid = _ref3.isFluid,
isWideScreen = _ref3.isWideScreen,
isFullHD = _ref3.isFullHD,
isFullHeight = _ref3.isFullHeight,
isFullHeightWithNavBar = _ref3.isFullHeightWithNavBar;
return {
'is-mobile': isMobile,
'is-fluid': isFluid,
'is-widescreen': isWideScreen,
'is-fullhd': isFullHD,
'is-fullheight': isFullHeight,
'is-fullheight-with-navbar': isFullHeightWithNavBar
};
};
exports.Screens = Screens;
var StyleOrState = function StyleOrState(_ref4) {
var isOutlined = _ref4.isOutlined,
isInverted = _ref4.isInverted,
isLoading = _ref4.isLoading,
isActive = _ref4.isActive,
isFocused = _ref4.isFocused,
isHovered = _ref4.isHovered,
isRounded = _ref4.isRounded,
isStatic = _ref4.isStatic,
isSelected = _ref4.isSelected;
return {
'is-loading': isLoading,
'is-outlined': isOutlined,
'is-active': isActive,
'is-focused': isFocused,
'is-inverted': isInverted,
'is-hovered': isHovered,
'is-rounded': isRounded,
'is-static': isStatic,
'is-selected': isSelected
};
};
exports.StyleOrState = StyleOrState;
var HasText = function HasText(_ref5) {
var hasTextWhite = _ref5.hasTextWhite,
hasTextBlack = _ref5.hasTextBlack,
hasTextLight = _ref5.hasTextLight,
hasTextDark = _ref5.hasTextDark,
hasTextPrimary = _ref5.hasTextPrimary,
hasTextInfo = _ref5.hasTextInfo,
hasTextLink = _ref5.hasTextLink,
hasTextSuccess = _ref5.hasTextSuccess,
hasTextWarning = _ref5.hasTextWarning,
hasTextDanger = _ref5.hasTextDanger,
hasTextBlackBis = _ref5.hasTextBlackBis,
hasTextBlackTer = _ref5.hasTextBlackTer,
hasTextGreyDarker = _ref5.hasTextGreyDarker,
hasTextGreyDark = _ref5.hasTextGreyDark,
hasTextGrey = _ref5.hasTextGrey,
hasTextGreyLight = _ref5.hasTextGreyLight,
hasTextGreyLighter = _ref5.hasTextGreyLighter,
hasTextWhiteTer = _ref5.hasTextWhiteTer,
hasTextWhiteBis = _ref5.hasTextWhiteBis,
hasTextCentered = _ref5.hasTextCentered;
return {
'has-text-white': hasTextWhite,
'has-text-black': hasTextBlack,
'has-text-light': hasTextLight,
'has-text-dark': hasTextDark,
'has-text-primary': hasTextPrimary,
'has-text-info': hasTextInfo,
'has-text-link': hasTextLink,
'has-text-success': hasTextSuccess,
'has-text-warning ': hasTextWarning,
'has-text-danger': hasTextDanger,
'has-text-black-bis': hasTextBlackBis,
'has-text-black-ter': hasTextBlackTer,
'has-text-grey-darker': hasTextGreyDarker,
'has-text-grey-dark': hasTextGreyDark,
'has-text-grey': hasTextGrey,
'has-text-grey-light': hasTextGreyLight,
'has-text-grey-lighter': hasTextGreyLighter,
'has-text-white-ter': hasTextWhiteTer,
'has-text-white-bis': hasTextWhiteBis,
'has-text-centered': hasTextCentered
};
};
exports.HasText = HasText;
var BackgroundColor = function BackgroundColor(_ref6) {
var hasBackgroundWhite = _ref6.hasBackgroundWhite,
hasBackgroundBlack = _ref6.hasBackgroundBlack,
hasBackgroundLight = _ref6.hasBackgroundLight,
hasBackgroundDark = _ref6.hasBackgroundDark,
hasBackgroundPrimary = _ref6.hasBackgroundPrimary,
hasBackgroundInfo = _ref6.hasBackgroundInfo,
hasBackgroundLink = _ref6.hasBackgroundLink,
hasBackgroundSuccess = _ref6.hasBackgroundSuccess,
hasBackgroundWarning = _ref6.hasBackgroundWarning,
hasBackgroundDanger = _ref6.hasBackgroundDanger,
hasBackgroundBlackBis = _ref6.hasBackgroundBlackBis,
hasBackgroundBlackTer = _ref6.hasBackgroundBlackTer,
hasBackgroundGreyDarker = _ref6.hasBackgroundGreyDarker,
hasBackgroundGreyDark = _ref6.hasBackgroundGreyDark,
hasBackgroundGrey = _ref6.hasBackgroundGrey,
hasBackgroundGreyLight = _ref6.hasBackgroundGreyLight,
hasBackgroundGreyLighter = _ref6.hasBackgroundGreyLighter,
hasBackgroundWhiteTer = _ref6.hasBackgroundWhiteTer,
hasBackgroundWhiteBis = _ref6.hasBackgroundWhiteBis;
return {
'has-background-white': hasBackgroundWhite,
'has-background-black': hasBackgroundBlack,
'has-background-light': hasBackgroundLight,
'has-background-dark': hasBackgroundDark,
'has-background-primary': hasBackgroundPrimary,
'has-background-info': hasBackgroundInfo,
'has-background-link': hasBackgroundLink,
'has-background-success': hasBackgroundSuccess,
'has-background-warning ': hasBackgroundWarning,
'has-background-danger': hasBackgroundDanger,
'has-background-black-bis': hasBackgroundBlackBis,
'has-background-black-ter': hasBackgroundBlackTer,
'has-background-grey-darker': hasBackgroundGreyDarker,
'has-background-grey-dark': hasBackgroundGreyDark,
'has-background-grey': hasBackgroundGrey,
'has-background-grey-light': hasBackgroundGreyLight,
'has-background-grey-lighter': hasBackgroundGreyLighter,
'has-background-white-ter': hasBackgroundWhiteTer,
'has-background-white-bis': hasBackgroundWhiteBis
};
};
exports.BackgroundColor = BackgroundColor;
var Sized = function Sized(_ref7) {
var isSize1 = _ref7.isSize1,
isSize2 = _ref7.isSize2,
isSize3 = _ref7.isSize3,
isSize4 = _ref7.isSize4,
isSize5 = _ref7.isSize5,
isSize6 = _ref7.isSize6,
isSize7 = _ref7.isSize7;
return {
'is-size-1': isSize1,
'is-size-2': isSize2,
'is-size-3': isSize3,
'is-size-4': isSize4,
'is-size-5': isSize5,
'is-size-6': isSize6,
'is-size-7': isSize7
};
};
exports.Sized = Sized;
var Size = function Size(_ref8) {
var size = _ref8.size;
var classes = {};
classes["is-size-".concat(size)] = !!size;
return classes;
};
exports.Size = Size;
var FontWeight = function FontWeight(_ref9) {
var hasTextWeightLight = _ref9.hasTextWeightLight,
hasTextWeightNormal = _ref9.hasTextWeightNormal,
hasTextWeightMedium = _ref9.hasTextWeightMedium,
hasTextWeightSemiBold = _ref9.hasTextWeightSemiBold,
hasTextWeightBold = _ref9.hasTextWeightBold;
return {
'has-text-weight-light': hasTextWeightLight,
'has-text-weight-normal': hasTextWeightNormal,
'has-text-weight-medium': hasTextWeightMedium,
'has-text-weight-semibold': hasTextWeightSemiBold,
'has-text-weight-bold': hasTextWeightBold
};
};
exports.FontWeight = FontWeight;
var Helpers = function Helpers(_ref10) {
var isClearfix = _ref10.isClearfix,
isPulledLeft = _ref10.isPulledLeft,
isPulledRight = _ref10.isPulledRight,
isMarginless = _ref10.isMarginless,
isPaddingless = _ref10.isPaddingless,
isOverlay = _ref10.isOverlay,
isClipped = _ref10.isClipped,
isRadiusless = _ref10.isRadiusless,
isShadowless = _ref10.isShadowless,
isUnselectable = _ref10.isUnselectable,
isInvisible = _ref10.isInvisible,
isHidden = _ref10.isHidden,
isScreenReaderOnly = _ref10.isScreenReaderOnly,
isRelative = _ref10.isRelative;
return {
'is-clearfix': isClearfix,
'is-pulled-left': isPulledLeft,
'is-pulled-right': isPulledRight,
'is-marginless': isMarginless,
'is-paddingless': isPaddingless,
'is-overlay': isOverlay,
'is-clipped': isClipped,
'is-radiusless': isRadiusless,
'is-shadowless': isShadowless,
'is-unselectable': isUnselectable,
'is-invisible': isInvisible,
'is-hidden': isHidden,
'is-sr-only': isScreenReaderOnly,
'is-relative': isRelative
};
};
exports.Helpers = Helpers;
var Responsive = function Responsive(_ref11) {
var isBlock = _ref11.isBlock,
isBlockMobile = _ref11.isBlockMobile,
isBlockDesktopOnly = _ref11.isBlockDesktopOnly,
isBlockTabletOnly = _ref11.isBlockTabletOnly,
isBlockWideScreenOnly = _ref11.isBlockWideScreenOnly,
isFlex = _ref11.isFlex,
isFlexMobile = _ref11.isFlexMobile,
isFlexDesktopOnly = _ref11.isFlexDesktopOnly,
isFlexTabletOnly = _ref11.isFlexTabletOnly,
isFlexWideScreenOnly = _ref11.isFlexWideScreenOnly,
isInline = _ref11.isInline,
isInlineMobile = _ref11.isInlineMobile,
isInlineDesktopOnly = _ref11.isInlineDesktopOnly,
isInlineTabletOnly = _ref11.isInlineTabletOnly,
isInlineWideScreenOnly = _ref11.isInlineWideScreenOnly,
isInlineBlock = _ref11.isInlineBlock,
isInlineBlockMobile = _ref11.isInlineBlockMobile,
isInlineBlockDesktopOnly = _ref11.isInlineBlockDesktopOnly,
isInlineBlockTabletOnly = _ref11.isInlineBlockTabletOnly,
isInlineBlockWideScreenOnly = _ref11.isInlineBlockWideScreenOnly,
isInlineFlex = _ref11.isInlineFlex,
isInlineFlexMobile = _ref11.isInlineFlexMobile,
isInlineFlexTabletOnly = _ref11.isInlineFlexTabletOnly,
isInlineFlexDesktopOnly = _ref11.isInlineFlexDesktopOnly,
isInlineFlexWideScreenOnly = _ref11.isInlineFlexWideScreenOnly;
return {
'is-block': isBlock,
'is-block-mobile': isBlockMobile,
'is-block-tablet-only': isBlockTabletOnly,
'is-block-desktop-only': isBlockDesktopOnly,
'is-blockis-widescreen-only': isBlockWideScreenOnly,
'is-flex': isFlex,
'is-flex-mobile': isFlexMobile,
'is-flex-tablet-only': isFlexTabletOnly,
'is-flex-desktop-only': isFlexDesktopOnly,
'is-flex-widescreen-only': isFlexWideScreenOnly,
'is-inline': isInline,
'is-inline-mobile': isInlineMobile,
'is-inline-tablet-only': isInlineTabletOnly,
'is-inline-desktop-only': isInlineDesktopOnly,
'is-inline-widescreen-only': isInlineWideScreenOnly,
'is-inline-block': isInlineBlock,
'is-inline-block-mobile': isInlineBlockMobile,
'is-inline-block-tablet-only': isInlineBlockTabletOnly,
'is-inline-block-desktop-only': isInlineBlockDesktopOnly,
'is-inline-block-widescreen-only': isInlineBlockWideScreenOnly,
'is-inline-flex': isInlineFlex,
'is-inline-flex-mobile': isInlineFlexMobile,
'is-inline-flex-tablet-only': isInlineFlexTabletOnly,
'is-inline-flex-desktop-only': isInlineFlexDesktopOnly,
'is-inline-flex-widescreen-only': isInlineFlexWideScreenOnly
};
};
exports.Responsive = Responsive;
var allTheClasses = function allTheClasses(props) {
return _objectSpread({}, Sized(props), {}, BackgroundColor(props), {}, Colors(props), {}, HasText(props), {}, StyleOrState(props), {}, Screens(props), {}, Sizes(props), {}, Colors(props), {}, Size(props), {}, FontWeight(props), {}, Helpers(props), {}, Responsive(props));
};
exports.allTheClasses = allTheClasses;