UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

89 lines 4.53 kB
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 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 _objectSpread({ column: true, flexWrap: false }, props); }).withConfig({ displayName: "styled__StyledTabsWrapper", componentId: "sc-1n790ui-0" })([""]); export var StyledTabs = styled(Flex).attrs(function (props) { return _objectSpread({ 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: "borderSecondary" } }, props); }).withConfig({ displayName: "styled__StyledTabs", componentId: "sc-1n790ui-1" })([""]); export var StyledTab = styled(Flex).attrs(function (props) { return _objectSpread({ flex: "grow" }, props); }).withConfig({ displayName: "styled__StyledTab", componentId: "sc-1n790ui-2" })(["white-space:nowrap;border-bottom:", " solid ", ";box-sizing:border-box;min-width:", ";max-width:", ";height:", ";color:", ";font-weight:", ";cursor:pointer;opacity:", ";background:", ";pointer-events:", ";&:hover{border-bottom:", " solid ", ";}& > span{font-weight:", ";}"], function (_ref) { var small = _ref.small, green = _ref.green; return green ? "1px" : small ? "2px" : "4px"; }, function (_ref2) { var active = _ref2.active; return active ? getColor("accent") : getColor(["transparent", "full"]); }, function (_ref3) { var minWidth = _ref3.minWidth; return minWidth != null ? minWidth : getSizeBy(10); }, function (_ref4) { var maxWidth = _ref4.maxWidth; return maxWidth != null ? maxWidth : getSizeBy(26); }, function (_ref5) { var small = _ref5.small, green = _ref5.green; return green ? small ? getSizeBy(3) : getSizeBy(4) : small ? getSizeBy(4) : getSizeBy(6); }, function (props) { return props.green ? props.active ? getColor("primary")(props) : getColor("menuItem")(props) : getColor("text")(props); }, function (_ref6) { var active = _ref6.active; return active ? "bold" : "normal"; }, function (_ref7) { var disabled = _ref7.disabled; return disabled ? 0.4 : 1; }, function (props) { return props.green ? props.active ? getColor("menuItemSelected")(props) : getColor("modalBackground")(props) : "transparent"; }, function (_ref8) { var disabled = _ref8.disabled; return disabled ? "none" : "auto"; }, function (_ref9) { var small = _ref9.small, green = _ref9.green; return green ? "1px" : small ? "2px" : "4px"; }, getColor("primary"), function (_ref10) { var active = _ref10.active; return active ? "bold" : "normal"; }); 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 (_ref11) { var active = _ref11.active; return active ? getColor("menuItemSelected") : getColor(["transparent", "full"]); }, getColor("menuItemHover"));