Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH - Design system implementation #310

Merged
merged 25 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
12a94c7
Add new colors and define green theme
steff456 Sep 15, 2023
77c870c
Fix primary button style
steff456 Sep 19, 2023
59322c6
Add new colors for roles and fix the shade used previously
steff456 Sep 19, 2023
bc3786a
Merge branch 'add-colors' into buttons
steff456 Sep 19, 2023
0cb733a
update main shade of color
steff456 Sep 20, 2023
e08cee7
Merge branch 'add-colors' into buttons
steff456 Sep 20, 2023
fdc3e2c
Fix icon buttons behavior and use across the UI
steff456 Sep 21, 2023
a7fe55c
Change name to condaStoreTheme, define more colors and refactor baseT…
steff456 Sep 21, 2023
a37e72b
Merge branch 'add-colors' into buttons
steff456 Sep 21, 2023
2fa7e4d
Add rule for component in the baseTheme
steff456 Sep 21, 2023
9ca3ef4
ENH - Redefine new themes and colours (#292)
steff456 Sep 25, 2023
eaefbbc
Merge branch 'design-system-implementation' into buttons
steff456 Sep 25, 2023
79f70d0
Set input focus in purple
steff456 Sep 29, 2023
26c85d2
Adjust all input components to design system using green
steff456 Sep 29, 2023
8ab908a
Merge branch 'design-system-implementation' into inputs
steff456 Sep 29, 2023
3dc126e
Add new style for disabled buttons and hover state
steff456 Oct 3, 2023
d5e7311
Merge branch 'buttons' of github.com:steff456/conda-store-ui into but…
steff456 Oct 3, 2023
e6c8d07
Implement new toggle switch design
steff456 Oct 19, 2023
38d2746
Fix border colors across the UI
steff456 Oct 19, 2023
02eae03
add missing semicolon to fix linting issues
steff456 Oct 25, 2023
b687895
Merge branch 'inputs' of github.com:steff456/conda-store-ui into inputs
steff456 Oct 25, 2023
7545a5b
Add new design to links (#320)
steff456 Oct 27, 2023
0d31098
Merge pull request #304 from steff456/buttons
costrouc Oct 31, 2023
7dc9228
Merge pull request #313 from steff456/inputs
costrouc Oct 31, 2023
26e9a12
ENH - Add new sidebar design (#331)
steff456 Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
"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",
"eslint": "eslint . --ext .ts,.tsx --fix",
"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",
"storybook:build": "build-storybook",
"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"
Expand Down
10 changes: 8 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -78,7 +78,13 @@ export class App<
render(): React.ReactNode {
return (
<PrefContext.Provider value={this.state.pref}>
<ThemeProvider theme={theme}>
<ThemeProvider
theme={
this.state.pref.styleType === "grayscale"
? grayscaleTheme
: condaStoreTheme
}
>
<Provider store={store}>
<AppRouter />
</Provider>
Expand Down
48 changes: 48 additions & 0 deletions src/colors.tsx
Original file line number Diff line number Diff line change
@@ -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";
52 changes: 39 additions & 13 deletions src/components/BlockContainerEditMode.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -43,21 +44,46 @@ export const BlockContainerEditMode = ({
>
{title}
</Typography>
<FormControlLabel
control={
<Switch
<Grid
component="label"
container
spacing={1}
justifyContent={"center"}
sx={{ width: "auto" }}
>
<Grid item sx={{ alignSelf: "baseline" }}>
<Typography
data-testid="block-container-title"
sx={{
fontSize: "14px",
color: "#333",
fontWeight: isEditMode ? "400" : "600"
}}
>
GUI
</Typography>
</Grid>
<Grid item sx={{ alignSelf: "baseline" }}>
<StyledSwitch
checked={isEditMode}
onClick={e => onToggleEditMode(!isEditMode)}
icon={<CodeIcon />}
checkedIcon={<CodeIcon />}
/>
}
label={
<Typography sx={{ fontSize: "13px", color: "#333" }}>
{isEditMode
? "Switch to Standard View"
: "Switch to YAML Editor"}
</Grid>
<Grid item sx={{ alignSelf: "baseline" }}>
<Typography
data-testid="block-container-title"
sx={{
fontSize: "14px",
color: "#333",
fontWeight: isEditMode ? "600" : "400"
}}
>
YAML
</Typography>
}
/>
</Grid>
</Grid>
</Box>
</Box>
<Box
Expand Down
24 changes: 9 additions & 15 deletions src/components/ConstraintSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Select from "@mui/material/Select";
import MenuItem from "@mui/material/MenuItem";
import React from "react";
import { getStylesForStyleType } from "../utils/helpers";

interface IConstraintSelectProps {
/**
Expand All @@ -18,19 +17,6 @@ export const ConstraintSelect = ({
const constraints = ["=", ">", "<", ">=", "<="];
const selectedConstraint = constraint === "==" ? "=" : constraint;

const inputStyles = getStylesForStyleType(
{
padding: "7px 9px !important",
backgroundColor: "#ECECEC",
borderRadius: "0px"
},
{
padding: "7px 9px !important",
backgroundColor: "#fff",
borderRadius: "0px"
}
);

return (
<Select
defaultValue={selectedConstraint}
Expand All @@ -44,8 +30,16 @@ export const ConstraintSelect = ({
borderRadius: "0px",
width: "44px"
}}
notched={false}
inputProps={{
sx: inputStyles,
sx: {
padding: "7px 9px !important",
borderRadius: "0px",
"&::placeholder": {
fontSize: "14px",
fontWeight: 400
}
},
"data-testid": "ConstraintSelectTest"
}}
>
Expand Down
9 changes: 1 addition & 8 deletions src/components/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@ export const AlertDialog = ({
</DialogContentText>
</DialogContent>
<DialogActions>
<StyledButtonPrimary
sx={{
backgroundColor: "#b1b3b5"
}}
onClick={closeAction}
>
Cancel
</StyledButtonPrimary>
<StyledButtonPrimary onClick={closeAction}>Cancel</StyledButtonPrimary>
<StyledButtonPrimary onClick={() => confirmAction()}>
Delete
</StyledButtonPrimary>
Expand Down
20 changes: 6 additions & 14 deletions src/components/VersionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ export const VersionSelect = ({

const [triggerQuery] = useLazyGetPackageVersionSuggestionsQuery();

const inputStyles = getStylesForStyleType(
{
padding: "7px 9px !important",
backgroundColor: "#ECECEC",
borderRadius: "0px"
},
{
padding: "7px 9px !important",
backgroundColor: "#fff",
borderRadius: "0px"
}
);

const iconStyles = getStylesForStyleType(
{
backgroundColor: "#ECECEC",
Expand Down Expand Up @@ -165,13 +152,18 @@ export const VersionSelect = ({
</IconButton>
)}
MenuProps={{ PaperProps: { sx: { maxHeight: 200 } } }}
notched={false}
sx={{
borderRadius: "0px",
width: "110px",
border: "none"
}}
inputProps={{
sx: inputStyles,
sx: {
padding: "7px 9px !important",
backgroundColor: palette.common.white,
borderRadius: "0px"
},
"data-testid": "VersionSelectTest"
}}
>
Expand Down
7 changes: 6 additions & 1 deletion src/components/icons/ArrowIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React from "react";
import { useTheme } from "@mui/material/styles";

export const ArrowIcon = (props: React.SVGProps<SVGSVGElement>) => {
const theme = useTheme();
return (
<svg
width={7}
Expand All @@ -10,7 +12,10 @@ export const ArrowIcon = (props: React.SVGProps<SVGSVGElement>) => {
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path d="M0 12.82l6.29-6.41L0 0v12.82z" fill="#5F6368" />
<path
d="M0 12.82l6.29-6.41L0 0v12.82z"
fill={theme.palette.secondary.dark}
/>
</svg>
);
};
52 changes: 52 additions & 0 deletions src/components/icons/BookIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as React from "react";
import { useTheme } from "@mui/material/styles";

export const BookIcon = (props: React.SVGProps<SVGSVGElement>) => {
const theme = useTheme();
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width={16}
height={16}
viewBox="0 0 16 16"
fill="none"
{...props}
>
<path
d="M8 4.3335V12.3335"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
<path
d="M13.667 4.3335V12.3335"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
<path
d="M2.33301 4.3335V12.3335"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
<path
d="M13.6667 12.3333C13.6667 12.3333 13 11 10.6667 11C8.33333 11 8 12.3333 8 12.3333"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
<path
d="M2.33333 12.3333C2.33333 12.3333 3 11 5.33333 11C7.66667 11 8 12.3333 8 12.3333"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
<path
d="M13.6667 4.33333C13.6667 4.33333 13 3 10.6667 3C8.33333 3 8 4.33333 8 4.33333"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
<path
d="M2.33333 4.33333C2.33333 4.33333 3 3 5.33333 3C7.66667 3 8 4.33333 8 4.33333"
stroke={theme.palette.secondary.main}
strokeLinecap="round"
/>
</svg>
);
};
7 changes: 5 additions & 2 deletions src/components/icons/ChannelIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React from "react";
import { useTheme } from "@mui/material/styles";

export const ChannelIcon = ({ color }: any) => {
export const ChannelIcon = (props: React.SVGProps<SVGSVGElement>) => {
const theme = useTheme();
return (
<svg
width={12}
Expand All @@ -9,10 +11,11 @@ export const ChannelIcon = ({ color }: any) => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
style={{ marginRight: "10px", marginLeft: "5px" }}
{...props}
>
<path
d="M3.95 0H1.17A1.17 1.17 0 000 1.17v6.26C0 8.076.524 8.6 1.17 8.6h2.78a1.17 1.17 0 001.17-1.17V1.17A1.17 1.17 0 003.95 0zM3.95 10.07H1.17A1.17 1.17 0 000 11.24v1.96c0 .646.524 1.17 1.17 1.17h2.78a1.17 1.17 0 001.17-1.17v-1.96a1.17 1.17 0 00-1.17-1.17zM7.76 14.38h2.78a1.17 1.17 0 001.17-1.17V6.95a1.17 1.17 0 00-1.17-1.17H7.76a1.17 1.17 0 00-1.17 1.17v6.26c0 .646.524 1.17 1.17 1.17zM7.76 4.31h2.78a1.17 1.17 0 001.17-1.17V1.18A1.17 1.17 0 0010.54.01H7.76a1.17 1.17 0 00-1.17 1.17v1.96c0 .646.524 1.17 1.17 1.17z"
fill={color}
fill={theme.palette.primary.main}
/>
</svg>
);
Expand Down
20 changes: 20 additions & 0 deletions src/components/icons/CodeIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from "react";
import { useTheme } from "@mui/material/styles";

export const CodeIcon = (props: React.SVGProps<SVGSVGElement>) => {
const theme = useTheme();
return (
<svg
width={24}
height={24}
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="m8 18l-6-6l6-6l1.425 1.425l-4.6 4.6L9.4 16.6L8 18Zm8 0l-1.425-1.425l4.6-4.6L14.6 7.4L16 6l6 6l-6 6Z"
fill={theme.palette.primary.contrastText}
/>
</svg>
);
};
Loading
Loading