UNPKG

@retailmenot/anchor

Version:

A React UI Library by RetailMeNot

30 lines 1.3 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; // VENDOR import * as React from 'react'; import classNames from 'classnames'; import styled, { css } from '@xstyled/styled-components'; import { th, space as spaceStyles } from '@xstyled/system'; const StyledPane = styled('div') ` flex-grow: 1; ${spaceStyles} ${({ active, background = 'white', border }) => css({ display: active ? 'block' : 'none', border, background: th.color(background), })} `; export const Pane = (_a) => { var { className, children, padding = '2rem', active = false } = _a, props = __rest(_a, ["className", "children", "padding", "active"]); return (React.createElement(StyledPane, Object.assign({ className: classNames('anchor-tabs-pane', className), active: active, padding: padding }, props), children)); }; //# sourceMappingURL=Pane.component.js.map