@retailmenot/anchor
Version:
A React UI Library by RetailMeNot
121 lines (102 loc) • 4.43 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var __chunk_1 = require('./anchor-chunk-24f232e7.js');
var __chunk_2 = require('./anchor-chunk-9d9a5df6.js');
var __chunk_6 = require('./anchor-chunk-cd6fece5.js');
var React = require('react');
var classNames = _interopDefault(require('classnames'));
var styled = require('@xstyled/styled-components');
var styled__default = _interopDefault(styled);
var system = require('@xstyled/system');
require('./anchor-chunk-1efd6395.js');
function _templateObject3() {
var data = __chunk_1._taggedTemplateLiteral(["\n text-shadow: 0 0.125rem 0.125rem rgba(0, 0, 0, 0.04);\n position: relative;\n display: block;\n ", "\n"]);
_templateObject3 = function _templateObject3() {
return data;
};
return data;
}
function _templateObject2() {
var data = __chunk_1._taggedTemplateLiteral(["\n text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.09);\n position: relative;\n ", "\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = __chunk_1._taggedTemplateLiteral(["\n box-sizing: border-box;\n position: relative;\n width: 100%;\n margin: 0 auto;\n display: block;\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", "\n ", "\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
var StyledHero = styled__default('section')(_templateObject(), function (_ref) {
var background = _ref.background,
_ref$color = _ref.color,
color = _ref$color === void 0 ? 'white' : _ref$color,
align = _ref.align,
minHeight = _ref.minHeight;
return styled.css({
background: system.th.color(background),
color: color,
minHeight: minHeight,
textAlign: align
});
}, system.space);
var Hero = function Hero(_a) {
var _a$background = _a.background,
background = _a$background === void 0 ? 'transparent' : _a$background,
_a$align = _a.align,
align = _a$align === void 0 ? 'center' : _a$align,
_a$minHeight = _a.minHeight,
minHeight = _a$minHeight === void 0 ? '7.5rem' : _a$minHeight,
className = _a.className,
children = _a.children,
props = __chunk_2.__rest(_a, ["background", "align", "minHeight", "className", "children"]);
return React.createElement(StyledHero, Object.assign({
className: classNames('anchor-hero', className),
background: background,
align: align,
minHeight: minHeight
}, props), children);
}; // Hero.Title
// ------------------------------------------------------------------------------------------------------------------
var StyledTitle = styled__default(__chunk_6.Typography)(_templateObject2(), system.space);
var HeroTitle = function HeroTitle(_a) {
var className = _a.className,
children = _a.children,
_a$weight = _a.weight,
weight = _a$weight === void 0 ? 600 : _a$weight,
_a$scale = _a.scale,
scale = _a$scale === void 0 ? 32 : _a$scale,
_a$as = _a.as,
as = _a$as === void 0 ? 'h1' : _a$as,
props = __chunk_2.__rest(_a, ["className", "children", "weight", "scale", "as"]);
return React.createElement(StyledTitle, Object.assign({
className: classNames('anchor-hero-title', className),
weight: weight,
scale: scale,
as: as
}, props), children);
};
Hero.Title = HeroTitle; // Hero.Subtitle
// ------------------------------------------------------------------------------------------------------------------
var StyledSubtitle = styled__default(__chunk_6.Typography)(_templateObject3(), system.space);
var HeroSubtitle = function HeroSubtitle(_a) {
var className = _a.className,
children = _a.children,
_a$scale2 = _a.scale,
scale = _a$scale2 === void 0 ? 18 : _a$scale2,
_a$weight2 = _a.weight,
weight = _a$weight2 === void 0 ? 600 : _a$weight2,
props = __chunk_2.__rest(_a, ["className", "children", "scale", "weight"]);
return React.createElement(StyledSubtitle, Object.assign({
className: classNames('anchor-hero-subtitle', className),
scale: scale,
weight: weight
}, props), children);
};
Hero.Subtitle = HeroSubtitle;
exports.Hero = Hero;
//# sourceMappingURL=hero.js.map