From e709f44e42fafaf12df56233fb57a412f0a7ee21 Mon Sep 17 00:00:00 2001 From: Alejandro-Vega Date: Thu, 7 Dec 2023 13:42:19 -0500 Subject: [PATCH 1/3] Removed @mui/styles and any withStyles used --- package-lock.json | 340 +++++++++--------- package.json | 1 - .../Questionnaire/FormContainer.tsx | 85 ++--- .../ReviewDataListingProperty.tsx | 3 +- .../TableFileTypeAndExtensionInput.tsx | 176 ++++----- .../Questionnaire/TableTextInput.tsx | 58 ++- src/components/Questionnaire/TextInput.tsx | 199 +++++----- src/content/questionnaire/FormView.tsx | 252 +++++++------ src/content/questionnaire/sections/D.tsx | 2 +- 9 files changed, 518 insertions(+), 598 deletions(-) diff --git a/package-lock.json b/package-lock.json index d5356bf5..16032900 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@mui/icons-material": "^5.11.16", "@mui/lab": "^5.0.0-alpha.130", "@mui/material": "^5.13.1", - "@mui/styles": "^5.13.1", "@mui/x-charts": "^6.0.0-alpha.12", "@mui/x-date-pickers": "^6.8.0", "@testing-library/jest-dom": "^5.16.5", @@ -2577,6 +2576,26 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/@eslint/js": { "version": "8.42.0", "license": "MIT", @@ -3557,45 +3576,6 @@ } } }, - "node_modules/@mui/styles": { - "version": "5.13.2", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.21.0", - "@emotion/hash": "^0.9.1", - "@mui/private-theming": "^5.13.1", - "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", - "clsx": "^1.2.1", - "csstype": "^3.1.2", - "hoist-non-react-statics": "^3.3.2", - "jss": "^10.10.0", - "jss-plugin-camel-case": "^10.10.0", - "jss-plugin-default-unit": "^10.10.0", - "jss-plugin-global": "^10.10.0", - "jss-plugin-nested": "^10.10.0", - "jss-plugin-props-sort": "^10.10.0", - "jss-plugin-rule-value-function": "^10.10.0", - "jss-plugin-vendor-prefixer": "^10.10.0", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@mui/system": { "version": "5.13.2", "license": "MIT", @@ -5839,12 +5819,13 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "license": "MIT", + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dependencies": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" }, "funding": { @@ -5867,31 +5848,6 @@ } } }, - "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv-formats/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "license": "MIT", - "peerDependencies": { - "ajv": "^6.9.1" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "license": "MIT", @@ -6281,6 +6237,34 @@ "webpack": ">=2" } }, + "node_modules/babel-loader/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/babel-loader/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/babel-loader/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/babel-loader/node_modules/schema-utils": { "version": "2.7.1", "license": "MIT", @@ -7408,20 +7392,6 @@ } } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/css-minimizer-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "license": "MIT", @@ -7432,10 +7402,6 @@ "ajv": "^8.8.2" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/css-minimizer-webpack-plugin/node_modules/schema-utils": { "version": "4.2.0", "license": "MIT", @@ -8999,20 +8965,6 @@ "webpack": "^5.0.0" } }, - "node_modules/eslint-webpack-plugin/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/eslint-webpack-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "license": "MIT", @@ -9035,10 +8987,6 @@ "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0" } }, - "node_modules/eslint-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/eslint-webpack-plugin/node_modules/schema-utils": { "version": "4.2.0", "license": "MIT", @@ -9069,6 +9017,21 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "license": "MIT", @@ -9104,6 +9067,11 @@ "node": ">=4.0" } }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/espree": { "version": "9.5.2", "license": "BSD-2-Clause", @@ -9592,6 +9560,29 @@ } } }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/chalk": { "version": "4.1.2", "license": "MIT", @@ -9633,6 +9624,11 @@ "node": ">=10" } }, + "node_modules/fork-ts-checker-webpack-plugin/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/schema-utils": { "version": "2.7.0", "license": "MIT", @@ -12251,8 +12247,9 @@ "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { - "version": "0.4.1", - "license": "MIT" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -13254,20 +13251,6 @@ "webpack": "^5.0.0" } }, - "node_modules/mini-css-extract-plugin/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/mini-css-extract-plugin/node_modules/ajv-keywords": { "version": "5.1.0", "license": "MIT", @@ -13278,10 +13261,6 @@ "ajv": "^8.8.2" } }, - "node_modules/mini-css-extract-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { "version": "4.2.0", "license": "MIT", @@ -16248,6 +16227,34 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/select-hose": { "version": "2.0.0", "license": "MIT" @@ -17008,6 +17015,29 @@ "webpack": "^4.0.0 || ^5.0.0" } }, + "node_modules/svg-url-loader/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/svg-url-loader/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, "node_modules/svg-url-loader/node_modules/file-loader": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-6.0.0.tgz", @@ -17027,6 +17057,11 @@ "webpack": "^4.0.0 || ^5.0.0" } }, + "node_modules/svg-url-loader/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, "node_modules/svg-url-loader/node_modules/schema-utils": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", @@ -17648,7 +17683,6 @@ }, "node_modules/typescript": { "version": "5.1.3", - "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -18217,20 +18251,6 @@ "webpack": "^4.0.0 || ^5.0.0" } }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { "version": "5.1.0", "license": "MIT", @@ -18241,10 +18261,6 @@ "ajv": "^8.8.2" } }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { "version": "4.2.0", "license": "MIT", @@ -18319,20 +18335,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/webpack-dev-server/node_modules/ajv-keywords": { "version": "5.1.0", "license": "MIT", @@ -18343,10 +18345,6 @@ "ajv": "^8.8.2" } }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/webpack-dev-server/node_modules/schema-utils": { "version": "4.2.0", "license": "MIT", @@ -18629,20 +18627,6 @@ "node": ">=10.0.0" } }, - "node_modules/workbox-build/node_modules/ajv": { - "version": "8.12.0", - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/workbox-build/node_modules/fs-extra": { "version": "9.1.0", "license": "MIT", @@ -18656,10 +18640,6 @@ "node": ">=10" } }, - "node_modules/workbox-build/node_modules/json-schema-traverse": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/workbox-build/node_modules/source-map": { "version": "0.8.0-beta.0", "license": "BSD-3-Clause", diff --git a/package.json b/package.json index 9f93053c..bf22a0fd 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "@mui/icons-material": "^5.11.16", "@mui/lab": "^5.0.0-alpha.130", "@mui/material": "^5.13.1", - "@mui/styles": "^5.13.1", "@mui/x-charts": "^6.0.0-alpha.12", "@mui/x-date-pickers": "^6.8.0", "@testing-library/jest-dom": "^5.16.5", diff --git a/src/components/Questionnaire/FormContainer.tsx b/src/components/Questionnaire/FormContainer.tsx index cb1a90e6..f98e44e9 100644 --- a/src/components/Questionnaire/FormContainer.tsx +++ b/src/components/Questionnaire/FormContainer.tsx @@ -1,6 +1,5 @@ import React, { HTMLProps, MutableRefObject, forwardRef, useId } from 'react'; import { Button, ButtonProps, Typography, styled } from '@mui/material'; -import { WithStyles, withStyles } from '@mui/styles'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import { useNavigate } from 'react-router-dom'; import useFormMode from '../../content/questionnaire/sections/hooks/useFormMode'; @@ -37,8 +36,29 @@ const StyledFormContainer = styled("div", { scrollMarginTop: "0px", })); +const StyledForm = styled("form")(() => ({ + fontWeight: 400, + fontSize: '16px', + fontFamily: "'Nunito', 'Rubik', sans-serif", +})); + +const StyledTitleGroup = styled("div")(() => ({ + background: "transparent", + color: "#337E90", + paddingBottom: "40px", + borderRadius: "8px 8px 0 0", + display: "flex", + alignItems: "center", +})); + +const StyledSectionTitle = styled(Typography)(() => ({ + fontWeight: 700, + fontSize: "24px", + fontFamily: "'Nunito', 'Rubik', sans-serif", + lineHeight: "32.74px", +})); + type Props = { - classes: WithStyles['classes']; description: string; hideReturnToSubmissions?: boolean; children: React.ReactNode; @@ -53,7 +73,6 @@ type Props = { */ const FormContainer = forwardRef(({ description, - classes, children, formRef, hideReturnToSubmissions = true, @@ -76,66 +95,20 @@ const FormContainer = forwardRef(({ Return to all Submissions -
- + + {description} - -
-
+ + e.preventDefault()} > {children} - +
); }); -const styles = () => ({ - formContainer: { - background: "transparent", - borderRadius: "8px", - paddingBottom: "25px", - marginTop: "0px !important", - scrollMarginTop: "30px" - }, - form: { - fontWeight: 400, - fontSize: '16px', - fontFamily: "'Nunito', 'Rubik', sans-serif", - }, - titleGroup: { - background: "transparent", - color: "#337E90", - paddingBottom: "40px", - borderRadius: "8px 8px 0 0", - display: "flex", - alignItems: "center", - }, - sectionTitle: { - fontWeight: 700, - fontSize: "24px", - fontFamily: "'Nunito', 'Rubik', sans-serif", - lineHeight: "32.74px", - }, - returnToSubmissions: { - fontWeight: 700, - fontSize: "14px", - fontFamily: "'Nunito', 'Rubik', sans-serif", - lineHeight: "19.6px", - color: "#2E5481", - padding: 0, - marginBottom: "16px", - display: "flex", - alignItems: "center", - verticalAlign: "middle", - textTranform: "initial", - "& svg": { - marginRight: "8px" - } - }, -}); - -export default withStyles(styles, { withTheme: true })(FormContainer); +export default FormContainer; diff --git a/src/components/Questionnaire/ReviewDataListingProperty.tsx b/src/components/Questionnaire/ReviewDataListingProperty.tsx index 4c93e3e9..03ce4b1e 100644 --- a/src/components/Questionnaire/ReviewDataListingProperty.tsx +++ b/src/components/Questionnaire/ReviewDataListingProperty.tsx @@ -1,6 +1,5 @@ import { Grid, Stack, styled } from "@mui/material"; -import { CSSProperties } from "@mui/styles"; -import { FC, useMemo, useState } from "react"; +import { CSSProperties, FC, useMemo, useState } from "react"; export const StyledLabel = styled("span")(() => ({ color: "#000000", diff --git a/src/components/Questionnaire/TableFileTypeAndExtensionInput.tsx b/src/components/Questionnaire/TableFileTypeAndExtensionInput.tsx index 3ab3a3b6..dfd692cb 100644 --- a/src/components/Questionnaire/TableFileTypeAndExtensionInput.tsx +++ b/src/components/Questionnaire/TableFileTypeAndExtensionInput.tsx @@ -5,9 +5,9 @@ import { TableCell, Tooltip, TooltipProps, - styled + styled, + Paper } from "@mui/material"; -import { WithStyles, withStyles } from "@mui/styles"; import dropdownArrowsIcon from "../../assets/icons/dropdown_arrows.svg"; import { fileTypeExtensions } from "../../config/FileTypeConfig"; import useFormMode from "../../content/questionnaire/sections/hooks/useFormMode"; @@ -22,7 +22,6 @@ const DropdownArrowsIcon = styled("div")(() => ({ type Props = { inputID: string; - classes: WithStyles["classes"]; typeValue: string; extensionValue: string; options: string[]; @@ -48,6 +47,75 @@ const StyledTooltip = styled((props: TooltipProps) => ( }, })); +const StyledTableCell = styled(TableCell)(() => ({ + borderTop: "1px solid #6B7294 !important", + borderRight: "1px solid #6B7294 !important", + borderBottom: "none!important", + borderLeft: "none!important", + padding: "0", + "& .MuiStack-root": { + width: "auto", + } +})); + +const StyledPaper = styled(Paper)(() => ({ + borderRadius: "8px", + border: "1px solid #6B7294", + marginTop: "2px", + "& .MuiAutocomplete-listbox": { + padding: 0 + }, + "& .MuiAutocomplete-option[aria-selected='true']": { + color: "#083A50", + background: "#FFFFFF" + }, + "& .MuiAutocomplete-option": { + padding: "0 10px", + height: "35px", + color: "#083A50", + background: "#FFFFFF" + }, + "& .MuiAutocomplete-option:hover": { + backgroundColor: "#3E7E6D", + color: "#FFFFFF" + }, + "& .MuiAutocomplete-option.Mui-focused": { + backgroundColor: "#3E7E6D !important", + color: "#FFFFFF" + }, +})); + +const StyledAutocomplete = styled(Autocomplete)(({ readOnly } : { readOnly? : boolean }) => ({ + "& .MuiInputBase-root": { + backgroundColor: readOnly ? "#E5EEF4" : "#FFFFFF", + "&.MuiAutocomplete-inputRoot.MuiInputBase-root": { + display: 'flex', + alignItems: 'center', + padding: 0, + }, + "& .MuiInputBase-input": { + fontWeight: 400, + fontSize: "16px", + fontFamily: "'Nunito', 'Rubik', sans-serif", + padding: "10px 12px 10px 12px !important", + color: readOnly ? "#083A50" : "initial", + cursor: readOnly ? "not-allowed !important" : "initial", + }, + "& ::placeholder": { + color: "#87878C", + fontWeight: 400, + opacity: 1 + }, + "& .MuiAutocomplete-endAdornment": { + right: "8px", + }, + "&.Mui-focused": { + boxShadow: + "2px 2px 2px 1px rgba(38, 184, 147, 0.10), -2px -2px 2px 1px rgba(38, 184, 147, 0.20)", + }, + }, +})); + /** * Generates a generic autocomplete select box with a label and help text * @@ -56,7 +124,6 @@ const StyledTooltip = styled((props: TooltipProps) => ( */ const TableAutocompleteInput: FC = ({ inputID, - classes, typeValue, extensionValue, name, @@ -137,9 +204,10 @@ const TableAutocompleteInput: FC = ({ useEffect(() => { onExtensionValChangeWrapper(null, extensionValue, null); }, [extensionValue]); + return ( <> - + = ({ id={inputID.concat("-type")} size="small" value={typeVal || ""} - classes={{ root: classes.inputInTable }} onChange={onTypeValChangeWrapper} popupIcon={} readOnly={readOnlyInputs} freeSolo + PaperComponent={StyledPaper} slotProps={{ - paper: { - className: classes.paper - }, popper: { disablePortal: true, sx: { @@ -206,8 +271,8 @@ const TableAutocompleteInput: FC = ({ )} {...rest} /> - - + + = ({ id={inputID.concat("-extension")} size="small" value={extensionVal || ""} - classes={{ root: classes.inputInTable }} onChange={onExtensionValChangeWrapper} popupIcon={} readOnly={readOnlyInputs} freeSolo + PaperComponent={StyledPaper} slotProps={{ - paper: { - className: classes.paper - }, popper: { disablePortal: true, sx: { @@ -273,89 +335,9 @@ const TableAutocompleteInput: FC = ({ )} options={fileTypeExtensions[typeVal] || []} /> - + ); }; -const StyledAutocomplete = styled(Autocomplete)(({ readOnly } : { readOnly? : boolean }) => ({ - "& .MuiInputBase-root": { - backgroundColor: readOnly ? "#D9DEE4" : "#FFFFFF", - "&.MuiAutocomplete-inputRoot.MuiInputBase-root": { - display: 'flex', - alignItems: 'center', - padding: 0, - }, - "& .MuiInputBase-input": { - fontWeight: 400, - fontSize: "16px", - fontFamily: "'Nunito', 'Rubik', sans-serif", - padding: "10px 12px 10px 12px !important", - cursor: readOnly ? "not-allowed !important" : "initial", - }, - "& .MuiAutocomplete-endAdornment": { - right: "8px", - }, - "&.Mui-focused": { - boxShadow: - "2px 2px 2px 1px rgba(38, 184, 147, 0.10), -2px -2px 2px 1px rgba(38, 184, 147, 0.20)", - }, - }, -})); - -const styles = () => ({ - paper: { - borderRadius: "8px", - border: "1px solid #6B7294", - marginTop: "2px", - "& .MuiAutocomplete-listbox": { - padding: 0 - }, - "& .MuiAutocomplete-option[aria-selected='true']": { - color: "#083A50", - background: "#FFFFFF" - }, - "& .MuiAutocomplete-option": { - padding: "0 10px", - height: "35px", - color: "#083A50", - background: "#FFFFFF" - }, - "& .MuiAutocomplete-option:hover": { - backgroundColor: "#3E7E6D", - color: "#FFFFFF" - }, - "& .MuiAutocomplete-option.Mui-focused": { - backgroundColor: "#3E7E6D !important", - color: "#FFFFFF" - }, - }, - inputInTable: { - backgroundColor: "#fff", - "& .MuiAutocomplete-inputRoot.MuiInputBase-root": { - padding: 0, - }, - "& ::placeholder": { - color: "#87878C", - fontWeight: 400, - opacity: 1 - }, - "& .MuiAutocomplete-input:read-only": { - backgroundColor: "#E5EEF4", - color: "#083A50", - cursor: "not-allowed", - }, - }, - autocomplete: { - borderTop: "1px solid #6B7294 !important", - borderRight: "1px solid #6B7294 !important", - borderBottom: "none!important", - borderLeft: "none!important", - padding: "0", - "& .MuiStack-root": { - width: "auto", - } - } -}); - -export default withStyles(styles, { withTheme: true })(TableAutocompleteInput); +export default TableAutocompleteInput; diff --git a/src/components/Questionnaire/TableTextInput.tsx b/src/components/Questionnaire/TableTextInput.tsx index 98b208a5..ec44d287 100644 --- a/src/components/Questionnaire/TableTextInput.tsx +++ b/src/components/Questionnaire/TableTextInput.tsx @@ -6,7 +6,6 @@ import { TooltipProps, styled, } from "@mui/material"; -import { WithStyles, withStyles } from "@mui/styles"; import useFormMode from "../../content/questionnaire/sections/hooks/useFormMode"; import { updateInputValidity } from '../../utils'; /* @@ -17,7 +16,6 @@ type Props = { patternValidityMessage?: string; maxLength?: number; filter?: (input: string) => string; - classes: WithStyles["classes"]; } & InputProps; const StyledTooltip = styled((props: TooltipProps) => ( @@ -32,6 +30,32 @@ const StyledTooltip = styled((props: TooltipProps) => ( color: "#2B528B", }, })); + +const StyledInput = styled(Input)(() => ({ + "&.MuiInputBase-root": { + "& .MuiInputBase-input": { + padding: "0px", + color: "#083A50", + fontWeight: 400, + fontSize: "16px", + fontFamily: "'Nunito', 'Rubik', sans-serif", + height: "20px", + width: "100%" + }, + "& ::placeholder": { + color: "#87878C", + fontWeight: 400, + opacity: 1, + height: "20px", + }, + "& .MuiInputBase-input:read-only": { + backgroundColor: "#E5EEF4", + color: "#083A50", + cursor: "not-allowed", + }, + } +})); + /** * Generates a generic text input with a label and help text * @@ -99,10 +123,9 @@ const TableTextInput: FC = ({ disableTouchListener open={showError} > - = ({ ); }; -const styles = () => ({ - input: { - "&.MuiInputBase-input": { - padding: "0px", - color: "#083A50", - fontWeight: 400, - fontSize: "16px", - fontFamily: "'Nunito', 'Rubik', sans-serif", - height: "20px", - width: "100%" - }, - "&::placeholder": { - color: "#87878C", - fontWeight: 400, - opacity: 1, - height: "20px", - }, - "&.MuiInputBase-input:read-only": { - backgroundColor: "#E5EEF4", - color: "#083A50", - cursor: "not-allowed", - }, - }, -}); - -export default withStyles(styles, { withTheme: true })(TableTextInput); +export default TableTextInput; diff --git a/src/components/Questionnaire/TextInput.tsx b/src/components/Questionnaire/TextInput.tsx index b7382163..42c062a2 100644 --- a/src/components/Questionnaire/TextInput.tsx +++ b/src/components/Questionnaire/TextInput.tsx @@ -5,13 +5,100 @@ import { Grid, OutlinedInput, OutlinedInputProps, + styled, } from "@mui/material"; -import { WithStyles, withStyles } from "@mui/styles"; import { updateInputValidity } from "../../utils"; import Tooltip from "../Tooltip"; +const StyledGridWrapper = styled(Grid)(({ theme }) => ({ + "& .MuiFormHelperText-root": { + color: "#083A50", + marginLeft: "0", + [theme.breakpoints.up("lg")]: { + whiteSpace: "nowrap", + }, + }, + "& .MuiFormHelperText-root.Mui-error": { + color: "#D54309 !important", + }, +})); + +const StyledFormControl = styled(FormControl)(() => ({ + height: "100%", + justifyContent: "end", +})); + +const StyledLabel = styled("label")(() => ({ + fontWeight: 700, + fontSize: "16px", + lineHeight: "19.6px", + minHeight: "20px", + color: "#083A50", + marginBottom: "4px", +})); + +const StyledAsterisk = styled("span")(() => ({ + color: "#D54309", + marginLeft: "2px", +})); + +const StyledHelperText = styled(FormHelperText)(() => ({ + marginTop: "4px", + minHeight: "20px", +})); + +const StyledOutlinedInput = styled(OutlinedInput)(() => ({ + borderRadius: "8px", + backgroundColor: "#fff", + color: "#083A50", + "& .MuiInputBase-input": { + fontWeight: 400, + fontSize: "16px", + fontFamily: "'Nunito', 'Rubik', sans-serif", + lineHeight: "19.6px", + padding: "12px", + height: "20px", + }, + "&.MuiInputBase-multiline": { + padding: "12px", + }, + "&.MuiInputBase-multiline .MuiInputBase-input": { + lineHeight: "25px", + padding: 0, + }, + "& .MuiOutlinedInput-notchedOutline": { + borderColor: "#6B7294", + }, + "&.Mui-focused .MuiOutlinedInput-notchedOutline": { + border: "1px solid #209D7D", + boxShadow: "2px 2px 4px 0px rgba(38, 184, 147, 0.10), -1px -1px 6px 0px rgba(38, 184, 147, 0.20)", + }, + "& .MuiInputBase-input::placeholder": { + color: "#87878C", + fontWeight: 400, + opacity: 1 + }, + // Override the input error border color + "&.Mui-error fieldset": { + borderColor: "#D54309 !important", + }, + // Target readOnly