UNPKG

@kiwicom/orbit-components

Version:

<div align="center"> <a href="https://orbit.kiwi" target="_blank"> <img alt="orbit-components" src="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components.png" srcset="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components@2x.png 2x"

103 lines (84 loc) 4.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StyledModalSection = undefined; var _templateObject = _taggedTemplateLiteral(["\n padding: ", ";\n \n &:first-of-type {\n margin: ", ";\n }\n &:last-of-type {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n & ~ ", " {\n margin: ", ";\n }\n }\n "], ["\n padding: ", ";\n \n &:first-of-type {\n margin: ", ";\n }\n &:last-of-type {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n & ~ ", " {\n margin: ", ";\n }\n }\n "]); var _react = require("react"); var React = _interopRequireWildcard(_react); var _styledComponents = require("styled-components"); var _styledComponents2 = _interopRequireDefault(_styledComponents); var _defaultTokens = require("../../defaultTokens"); var _defaultTokens2 = _interopRequireDefault(_defaultTokens); var _media = require("../../utils/media"); var _media2 = _interopRequireDefault(_media); var _ModalFooter = require("../ModalFooter"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var StyledModalSection = exports.StyledModalSection = _styledComponents2.default.section.withConfig({ displayName: "ModalSection__StyledModalSection" })(["width:100%;padding:", ";background-color:", ";border-bottom:1px solid ", ";box-sizing:border-box;&:first-of-type{border-top:", ";border-top-left-radius:", ";border-top-right-radius:", ";margin:", ";}&:last-of-type{border-bottom:", ";& ~ ", "{margin:", ";}}", ";"], function (_ref) { var theme = _ref.theme; return theme.orbit.spaceLarge + " " + theme.orbit.spaceMedium; }, function (_ref2) { var theme = _ref2.theme, suppressed = _ref2.suppressed; return suppressed ? theme.orbit.paletteCloudLight : theme.orbit.paletteWhite; }, function (_ref3) { var theme = _ref3.theme; return theme.orbit.paletteCloudNormal; }, function (_ref4) { var suppressed = _ref4.suppressed, theme = _ref4.theme; return suppressed && "1px solid " + theme.orbit.paletteCloudNormal; }, function (_ref5) { var theme = _ref5.theme; return theme.orbit.borderRadiusNormal; }, function (_ref6) { var theme = _ref6.theme; return theme.orbit.borderRadiusNormal; }, function (_ref7) { var suppressed = _ref7.suppressed, theme = _ref7.theme; return suppressed && theme.orbit.spaceLarge + " 0 0 0"; }, function (_ref8) { var suppressed = _ref8.suppressed, theme = _ref8.theme; return suppressed ? "1px solid " + theme.orbit.paletteCloudNormal : "0"; }, _ModalFooter.StyledModalFooter, function (_ref9) { var theme = _ref9.theme, suppressed = _ref9.suppressed; return suppressed && theme.orbit.spaceMedium + " 0 0 0"; }, _media2.default.desktop(_templateObject, function (_ref10) { var theme = _ref10.theme; return theme.orbit.spaceXXLarge; }, function (_ref11) { var suppressed = _ref11.suppressed, theme = _ref11.theme; return suppressed && theme.orbit.spaceXXLarge + " 0 0 0"; }, function (_ref12) { var theme = _ref12.theme; return theme.orbit.borderRadiusNormal; }, function (_ref13) { var theme = _ref13.theme; return theme.orbit.borderRadiusNormal; }, _ModalFooter.StyledModalFooter, function (_ref14) { var suppressed = _ref14.suppressed, theme = _ref14.theme; return suppressed && theme.orbit.spaceXXLarge + " 0 0 0"; })); StyledModalSection.defaultProps = { theme: _defaultTokens2.default }; var ModalSection = function ModalSection(props) { var suppressed = props.suppressed, children = props.children, dataTest = props.dataTest; return React.createElement( StyledModalSection, { suppressed: suppressed, "data-test": dataTest }, children ); }; exports.default = ModalSection;