UNPKG

alpaca-react-tabtab

Version:

A mobile support, draggable, editable and api based Tab for ReactJS

44 lines (32 loc) 2.4 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _templateObject = _taggedTemplateLiteral(['\n border-bottom: 1px solid #eee;\n'], ['\n border-bottom: 1px solid #eee;\n']), _templateObject2 = _taggedTemplateLiteral(['\n border-top-left-radius: .25rem;\n border-top-right-radius: .25rem;\n transition: color .3s cubic-bezier(.645, .045, .355, 1);\n transition: background-color .3s cubic-bezier(.645, .045, .355, 1);\n color: ', ';\n border: 1px solid transparent;\n ', '\n ', '\n ', '\n'], ['\n border-top-left-radius: .25rem;\n border-top-right-radius: .25rem;\n transition: color .3s cubic-bezier(.645, .045, .355, 1);\n transition: background-color .3s cubic-bezier(.645, .045, .355, 1);\n color: ', ';\n border: 1px solid transparent;\n ', '\n ', '\n ', '\n']); var _styledComponents = require('styled-components'); var _styledComponents2 = _interopRequireDefault(_styledComponents); var _ = require('../../'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var TabListStyle = _.styled.TabListStyle, ActionButtonStyle = _.styled.ActionButtonStyle, TabStyle = _.styled.TabStyle, PanelStyle = _.styled.PanelStyle; TabListStyle = (0, _styledComponents2.default)(TabListStyle)(_templateObject); TabStyle = (0, _styledComponents2.default)(TabStyle)(_templateObject2, function (props) { return props.active ? 'black' : '#007bff'; }, function (props) { return props.vertical ? '\n border-top: 1px solid transparent;\n border-bottom: 1px solid #efefef;\n border-left: 1px solid #efefef;\n border-right: 1px solid #efefef;\n border-radius: 0;\n &:first-child {\n border-top: 1px solid #efefef; \n }\n ' : '\n &:hover {\n border-color: #ddd #ddd #fff;\n }\n '; }, function (props) { return props.active && props.vertical ? '\n background-color: #eee;\n ' : null; }, function (props) { return props.active && !props.vertical ? '\n border-color: #ddd #ddd #fff;\n ' : null; }); exports.default = { TabList: TabListStyle, ActionButton: ActionButtonStyle, Tab: TabStyle, Panel: PanelStyle }; module.exports = exports['default'];