UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

72 lines 2.96 kB
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } import styled from "styled-components"; import { getColor, getSizeBy } from "../../theme/utils"; import Flex from "../templates/flex"; export var StyledTabsWrapper = styled(Flex).attrs(function (props) { return _extends({ column: true, flexWrap: false }, props); }).withConfig({ displayName: "styled__StyledTabsWrapper", componentId: "sc-1n790ui-0" })([""]); export var StyledTabs = styled(Flex).attrs(function (props) { return _extends({ as: "nav", row: true, flexWrap: false, justifyContent: "start", alignItems: "center", padding: [0, 0.5], flex: false, border: !props.noDefaultBorder && { side: "bottom", size: "1px", type: "solid", color: "border" } }, props); }).withConfig({ displayName: "styled__StyledTabs", componentId: "sc-1n790ui-1" })([""]); export var StyledTab = styled(Flex).attrs(function (props) { return _extends({ small: true, padding: [0, 6] }, props); }).withConfig({ displayName: "styled__StyledTab", componentId: "sc-1n790ui-2" })(["white-space:nowrap;border-bottom:1px solid ", ";box-sizing:border-box;border-radius:2px 2px 0 0;max-width:", ";height:", ";cursor:pointer;opacity:", ";background:", ";pointer-events:", ";margin-bottom:-1px;&:hover{border-bottom:1px solid ", ";}& > span{color:", ";}"], function (_ref) { var active = _ref.active, green = _ref.green; return active ? getColor("accent") : green ? getColor(["transparent", "full"]) : getColor("border"); }, function (_ref2) { var maxWidth = _ref2.maxWidth; return maxWidth != null ? maxWidth : getSizeBy(26); }, function (_ref3) { var small = _ref3.small, green = _ref3.green; return green ? small ? getSizeBy(3) : getSizeBy(4) : small ? getSizeBy(4) : getSizeBy(5); }, function (_ref4) { var disabled = _ref4.disabled; return disabled ? 0.4 : 1; }, function (_ref5) { var active = _ref5.active; return active ? getColor("menuItemSelected") : getColor("modalBackground"); }, function (_ref6) { var disabled = _ref6.disabled; return disabled ? "none" : "auto"; }, getColor("primary"), function (_ref7) { var active = _ref7.active; return active ? getColor("primary") : getColor("menuItem"); }); export var StyledTabMenu = styled(Flex).withConfig({ displayName: "styled__StyledTabMenu", componentId: "sc-1n790ui-3" })(["white-space:nowrap;color:", ";padding:4px 8px;background:", ";width:100%;border-radius:4px;cursor:pointer;justify-content:flex-start;&:hover{background:", ";}"], getColor("text"), function (_ref8) { var active = _ref8.active; return active ? getColor("menuItemSelected") : getColor(["transparent", "full"]); }, getColor("menuItemHover"));