diff --git a/package.json b/package.json index cfaaf61c..1d7e7bb5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.5", "description": "UI elements for building a frontend for conda-store", "scripts": { - "build": "tsc --build", + "build": "REACT_APP_VERSION=$npm_package_version tsc --build", "build:watch": "tsc --build --watch", "clean": "rimraf coverage lib storybook-static types .env *.tsbuildinfo", "clean:slate": "yarn run clean && rimraf node_modules", @@ -11,7 +11,7 @@ "eslint:check": "eslint . --ext .ts,.tsx", "prepare": "yarnpkg run build && husky install", "prepublishOnly": "yarnpkg run clean && yarnpkg run webpack:prod", - "start": "webpack server --history-api-fallback", + "start": "REACT_APP_VERSION=$npm_package_version webpack server --history-api-fallback", "start:chromium": "webpack serve --open 'chromium'", "start:prod": "NODE_ENV=production webpack serve", "storybook": "start-storybook -p 6006", @@ -19,9 +19,9 @@ "test": "jest --coverage", "report": "open ./coverage/lcov-report/index.html", "watch": "npm-run-all -p *:watch", - "webpack": "webpack --color", - "webpack:prod": "NODE_ENV=production webpack --color", - "webpack:watch": "webpack --color --watch" + "webpack": "REACT_APP_VERSION=$npm_package_version webpack --color", + "webpack:prod": "REACT_APP_VERSION=$npm_package_version NODE_ENV=production webpack --color", + "webpack:watch": "REACT_APP_VERSION=$npm_package_version webpack --color --watch" }, "keywords": [ "conda-store" diff --git a/src/App.tsx b/src/App.tsx index 987933d3..dae49ed7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,7 +12,7 @@ import { prefGlobal } from "./preferences"; import { store } from "./store"; -import { theme } from "./theme"; +import { condaStoreTheme, grayscaleTheme } from "./theme"; import "../style/index.css"; @@ -78,7 +78,13 @@ export class App< render(): React.ReactNode { return ( - + diff --git a/src/colors.tsx b/src/colors.tsx new file mode 100644 index 00000000..f6e97ea7 --- /dev/null +++ b/src/colors.tsx @@ -0,0 +1,48 @@ +export const green = { + 50: "#D6EEDC", + 100: "#ADDCBA", + 200: "#85CB97", + 300: "#5CB975", + 400: "#36AB55", + 500: "#298642", + 600: "#206532", + 700: "#144321", + 800: "#0A2210", + 900: "#051108" +}; + +export const gray = { + 50: "#F7F8F8", + 100: "#E1E3E4", + 200: "#C3C7CB", + 300: "#A6ACB2", + 400: "#90969C", + 500: "#5B5F63", + 600: "#44474A", + 700: "#3C3C3B", + 800: "#242628", + 900: "#1A1C1D" +}; + +export const purple = { + 50: "#E7E0F0", + 100: "#D0C0E5", + 200: "#B9A1DA", + 300: "#A78BD0", + 400: "#8966C2", + 500: "#6643A8", + 600: "#55309D", + 700: "#3B216E", + 800: "#2F1957", + 900: "#231240" +}; + +export const red = "#D72D47"; + +export const orange = "#F66A0A"; + +export const blue = "#276BE9"; + +export const white = "#FFFFFF"; + +export const black = "#000000"; diff --git a/src/components/BlockContainerEditMode.tsx b/src/components/BlockContainerEditMode.tsx index b12f5dc6..814ec744 100644 --- a/src/components/BlockContainerEditMode.tsx +++ b/src/components/BlockContainerEditMode.tsx @@ -1,8 +1,9 @@ import React from "react"; import Box from "@mui/material/Box"; +import Grid from "@mui/material/Grid"; import Typography from "@mui/material/Typography"; -import Switch from "@mui/material/Switch"; -import FormControlLabel from "@mui/material/FormControlLabel"; +import { CodeIcon } from "../components"; +import { StyledSwitch } from "../styles"; interface IBlockContainerProps { title: string; @@ -43,21 +44,46 @@ export const BlockContainerEditMode = ({ > {title} - + + + GUI + + + + onToggleEditMode(!isEditMode)} + icon={} + checkedIcon={} /> - } - label={ - - {isEditMode - ? "Switch to Standard View" - : "Switch to YAML Editor"} + + + + YAML - } - /> + + ", "<", ">=", "<="]; const selectedConstraint = constraint === "==" ? "=" : constraint; - const inputStyles = getStylesForStyleType( - { - padding: "7px 9px !important", - backgroundColor: "#ECECEC", - borderRadius: "0px" - }, - { - padding: "7px 9px !important", - backgroundColor: "#fff", - borderRadius: "0px" - } - ); - return (