github.com/minio/console@v1.4.1/web-app/src/screens/Console/Common/FormComponents/common/styleLibrary.ts (about)

     1  // This file is part of MinIO Console Server
     2  // Copyright (c) 2021 MinIO, Inc.
     3  //
     4  // This program is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Affero General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // This program is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  // GNU Affero General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Affero General Public License
    15  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    16  
    17  // This object contains variables that will be used across form components.
    18  
    19  import { breakPoints } from "mds";
    20  import get from "lodash/get";
    21  
    22  export const modalBasic = {
    23    formScrollable: {
    24      maxHeight: "calc(100vh - 300px)" as const,
    25      overflowY: "auto" as const,
    26      marginBottom: 25,
    27    },
    28    clearButton: {
    29      fontFamily: "Inter, sans-serif",
    30      border: "0",
    31      backgroundColor: "transparent",
    32      color: "#393939",
    33      fontWeight: 600,
    34      fontSize: 14,
    35      marginRight: 10,
    36      outline: "0",
    37      padding: "16px 25px 16px 25px",
    38      cursor: "pointer",
    39    },
    40    configureString: {
    41      border: "#EAEAEA 1px solid",
    42      borderRadius: 4,
    43      padding: "24px 50px",
    44      overflowY: "auto" as const,
    45      height: 170,
    46      backgroundColor: "#FBFAFA",
    47    },
    48  };
    49  
    50  export const actionsTray = {
    51    actionsTray: {
    52      display: "flex" as const,
    53      justifyContent: "space-between" as const,
    54      alignItems: "center",
    55      marginBottom: "1rem",
    56      "& button": {
    57        flexGrow: 0,
    58        marginLeft: 8,
    59      },
    60    },
    61  };
    62  
    63  export const typesSelection = {
    64    iconContainer: {
    65      display: "flex" as const,
    66      flexDirection: "row" as const,
    67      maxWidth: 1180,
    68      justifyContent: "start" as const,
    69      flexWrap: "wrap" as const,
    70      width: "100%",
    71    },
    72    logoButton: {
    73      height: "80px",
    74    },
    75    lambdaNotif: {
    76      background: "#ffffff50",
    77      border: "#E5E5E5 1px solid",
    78      borderRadius: 5,
    79      width: 250,
    80      height: 80,
    81      display: "flex",
    82      alignItems: "center",
    83      justifyContent: "start",
    84      marginBottom: 16,
    85      marginRight: 8,
    86      cursor: "pointer",
    87      padding: 0,
    88      overflow: "hidden",
    89      "&:hover": {
    90        backgroundColor: "#ebebeb",
    91      },
    92    },
    93  
    94    lambdaNotifIcon: {
    95      background: "transparent",
    96      display: "flex",
    97      alignItems: "center",
    98      justifyContent: "center",
    99      width: 80,
   100      height: 80,
   101  
   102      "& img": {
   103        maxWidth: 46,
   104        maxHeight: 46,
   105      },
   106    },
   107    lambdaNotifTitle: {
   108      color: "#07193E",
   109      fontSize: 16,
   110      fontFamily: "Inter,sans-serif",
   111      paddingLeft: 18,
   112    },
   113  };
   114  
   115  export const widgetCommon = (theme: any) => ({
   116    "& .singleValueContainer": {
   117      height: 200,
   118      border: `${get(theme, "borderColor", "#eaeaea")} 1px solid`,
   119      borderRadius: 2,
   120      backgroundColor: get(theme, "bgColor", "#fff"),
   121      padding: 16,
   122    },
   123    "& .titleContainer": {
   124      color: get(theme, "mutedText", "#87888d"),
   125      fontSize: 16,
   126      fontWeight: 600,
   127      paddingBottom: 14,
   128      marginBottom: 5,
   129      display: "flex" as const,
   130      justifyContent: "space-between" as const,
   131    },
   132    "& .contentContainer": {
   133      justifyContent: "center" as const,
   134      alignItems: "center" as const,
   135      display: "flex" as const,
   136      width: "100%",
   137      height: 140,
   138    },
   139    "& .singleLegendContainer": {
   140      display: "flex",
   141      alignItems: "center",
   142      padding: "0 10px",
   143      maxWidth: "100%",
   144    },
   145    "& .colorContainer": {
   146      width: 8,
   147      height: 8,
   148      minWidth: 8,
   149      marginRight: 5,
   150    },
   151    "& .legendLabel": {
   152      fontSize: "80%",
   153      color: get(theme, "mutedText", "#87888d"),
   154      whiteSpace: "nowrap" as const,
   155      overflow: "hidden" as const,
   156      textOverflow: "ellipsis" as const,
   157    },
   158    "& .zoomChartCont": {
   159      position: "relative" as const,
   160      height: 340,
   161      width: "100%",
   162    },
   163  });
   164  
   165  export const tooltipCommon = {
   166    customTooltip: {
   167      backgroundColor: "rgba(255, 255, 255, 0.90)",
   168      border: "#eaeaea 1px solid",
   169      borderRadius: 3,
   170      padding: "5px 10px",
   171      maxHeight: 300,
   172      overflowY: "auto" as const,
   173    },
   174    labelContainer: {
   175      display: "flex" as const,
   176      alignItems: "center" as const,
   177    },
   178    labelColor: {
   179      width: 6,
   180      height: 6,
   181      display: "block" as const,
   182      borderRadius: "100%",
   183      marginRight: 5,
   184    },
   185    itemValue: {
   186      fontSize: "75%",
   187      color: "#393939",
   188    },
   189    valueContainer: {
   190      fontWeight: 600,
   191    },
   192    timeStampTitle: {
   193      fontSize: "80%",
   194      color: "#9c9c9c",
   195      textAlign: "center" as const,
   196      marginBottom: 6,
   197    },
   198  };
   199  
   200  export const formFieldStyles: any = {
   201    formFieldRow: {
   202      marginBottom: ".8rem",
   203      "& .MuiInputLabel-root": {
   204        fontWeight: "normal",
   205      },
   206    },
   207  };
   208  
   209  export const modalStyleUtils: any = {
   210    modalButtonBar: {
   211      marginTop: 15,
   212      display: "flex",
   213      alignItems: "center",
   214      justifyContent: "flex-end",
   215      gap: 10,
   216    },
   217    modalFormScrollable: {
   218      maxHeight: "calc(100vh - 300px)",
   219      overflowY: "auto",
   220      paddingTop: 10,
   221    },
   222  };
   223  
   224  export const twoColCssGridLayoutConfig = {
   225    display: "grid",
   226    gridTemplateColumns: "2fr 1fr",
   227    gridAutoFlow: "row",
   228    gap: 10,
   229    [`@media (max-width: ${breakPoints.sm}px)`]: {
   230      gridTemplateColumns: "1fr",
   231      gridAutoFlow: "dense",
   232    },
   233  };