diff --git a/.env.example b/.env.example deleted file mode 100644 index 449cb7e2..00000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_BACKEND_URL=http://localhost:5050 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5b918750..ebdce9b9 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ .env.development.local .env.test.local .env.production.local +.history npm-debug.log* yarn-debug.log* diff --git a/.history/.prettierrc_20250226134824.js b/.history/.prettierrc_20250226134824.js new file mode 100644 index 00000000..64dc4468 --- /dev/null +++ b/.history/.prettierrc_20250226134824.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 4, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226140041.js b/.history/.prettierrc_20250226140041.js new file mode 100644 index 00000000..47ecbfee --- /dev/null +++ b/.history/.prettierrc_20250226140041.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 2, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226154205.js b/.history/.prettierrc_20250226154205.js new file mode 100644 index 00000000..ce8623ca --- /dev/null +++ b/.history/.prettierrc_20250226154205.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 2, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226164717.js b/.history/.prettierrc_20250226164717.js new file mode 100644 index 00000000..24673dbb --- /dev/null +++ b/.history/.prettierrc_20250226164717.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 4, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226164741.js b/.history/.prettierrc_20250226164741.js new file mode 100644 index 00000000..ce8623ca --- /dev/null +++ b/.history/.prettierrc_20250226164741.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 2, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226165903.js b/.history/.prettierrc_20250226165903.js new file mode 100644 index 00000000..24673dbb --- /dev/null +++ b/.history/.prettierrc_20250226165903.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 4, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226165911.js b/.history/.prettierrc_20250226165911.js new file mode 100644 index 00000000..ce8623ca --- /dev/null +++ b/.history/.prettierrc_20250226165911.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 2, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226170025.js b/.history/.prettierrc_20250226170025.js new file mode 100644 index 00000000..24673dbb --- /dev/null +++ b/.history/.prettierrc_20250226170025.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 4, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/.prettierrc_20250226170311.js b/.history/.prettierrc_20250226170311.js new file mode 100644 index 00000000..ce8623ca --- /dev/null +++ b/.history/.prettierrc_20250226170311.js @@ -0,0 +1,18 @@ +module.exports = { + trailingComma: 'es5', + tabWidth: 2, + semi: true, + singleQuote: true, + printWidth: 80, + jsxSingleQuote: true, + proseWrap: 'always', + plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], + importOrder: [ + '^react$', + '', + '^(common|pages)/(.*)$', + '^[./]', + ], + importOrderSeparation: true, + importOrderSortSpecifiers: true, +}; diff --git a/.history/jsconfig_20250219202759.json b/.history/jsconfig_20250219202759.json new file mode 100644 index 00000000..ef66e1dc --- /dev/null +++ b/.history/jsconfig_20250219202759.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "baseUrl": "src", + "jsx": "react" + }, + "include": ["src"] +} diff --git a/.history/jsconfig_20250226134748.json b/.history/jsconfig_20250226134748.json new file mode 100644 index 00000000..7eab209e --- /dev/null +++ b/.history/jsconfig_20250226134748.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": "src", + "jsx": "react", + "paths": { + "@/*": ["src/*"] + } + }, + "include": ["src"] +} diff --git a/.history/package_20250219202759.json b/.history/package_20250219202759.json new file mode 100644 index 00000000..1b4e33b9 --- /dev/null +++ b/.history/package_20250219202759.json @@ -0,0 +1,58 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "cra-template": "1.2.0", + "prop-types": "^15.8.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.2", + "react-scripts": "5.0.1", + "styled-components": "^6.1.13", + "web-vitals": "^4.2.4" + }, + "scripts": { + "start": "PORT=3001 react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "check-imports": "prettier --check --plugin @trivago/prettier-plugin-sort-imports \"src/**/*.{js,jsx,mjs,cjs}\"" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@eslint/js": "^9.16.0", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.13.0", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0" + } +} diff --git a/.history/package_20250219205120.json b/.history/package_20250219205120.json new file mode 100644 index 00000000..b79ef30d --- /dev/null +++ b/.history/package_20250219205120.json @@ -0,0 +1,58 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "cra-template": "1.2.0", + "prop-types": "^15.8.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.2", + "react-scripts": "5.0.1", + "styled-components": "^6.1.13", + "web-vitals": "^4.2.4" + }, + "scripts": { + "start": "PORT=3000 react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "check-imports": "prettier --check --plugin @trivago/prettier-plugin-sort-imports \"src/**/*.{js,jsx,mjs,cjs}\"" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@eslint/js": "^9.16.0", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.13.0", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0" + } +} diff --git a/.history/package_20250219205207.json b/.history/package_20250219205207.json new file mode 100644 index 00000000..14f918ed --- /dev/null +++ b/.history/package_20250219205207.json @@ -0,0 +1,58 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "cra-template": "1.2.0", + "prop-types": "^15.8.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.2", + "react-scripts": "5.0.1", + "styled-components": "^6.1.13", + "web-vitals": "^4.2.4" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "check-imports": "prettier --check --plugin @trivago/prettier-plugin-sort-imports \"src/**/*.{js,jsx,mjs,cjs}\"" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@eslint/js": "^9.16.0", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.13.0", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0" + } +} diff --git a/.history/package_20250226133050.json b/.history/package_20250226133050.json new file mode 100644 index 00000000..b79ef30d --- /dev/null +++ b/.history/package_20250226133050.json @@ -0,0 +1,58 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "cra-template": "1.2.0", + "prop-types": "^15.8.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.2", + "react-scripts": "5.0.1", + "styled-components": "^6.1.13", + "web-vitals": "^4.2.4" + }, + "scripts": { + "start": "PORT=3000 react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "check-imports": "prettier --check --plugin @trivago/prettier-plugin-sort-imports \"src/**/*.{js,jsx,mjs,cjs}\"" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@eslint/js": "^9.16.0", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.13.0", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0" + } +} diff --git a/.history/package_20250226133101.json b/.history/package_20250226133101.json new file mode 100644 index 00000000..1b4e33b9 --- /dev/null +++ b/.history/package_20250226133101.json @@ -0,0 +1,58 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "cra-template": "1.2.0", + "prop-types": "^15.8.1", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.2", + "react-scripts": "5.0.1", + "styled-components": "^6.1.13", + "web-vitals": "^4.2.4" + }, + "scripts": { + "start": "PORT=3001 react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "check-imports": "prettier --check --plugin @trivago/prettier-plugin-sort-imports \"src/**/*.{js,jsx,mjs,cjs}\"" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@eslint/js": "^9.16.0", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.13.0", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0" + } +} diff --git a/.history/package_20250226191527.json b/.history/package_20250226191527.json new file mode 100644 index 00000000..6a7da040 --- /dev/null +++ b/.history/package_20250226191527.json @@ -0,0 +1,73 @@ +{ + "name": "frontend", + "version": "0.1.0", + "private": true, + "dependencies": { + "@radix-ui/colors": "^3.0.0", + "@radix-ui/react-dialog": "^1.1.6", + "@radix-ui/react-icons": "^1.3.2", + "@tailwindcss/cli": "^4.0.9", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cra-template": "1.2.0", + "lucide-react": "^0.476.0", + "primeicons": "^7.0.0", + "primereact": "^10.9.2", + "prop-types": "^15.8.1", + "radix-ui": "^1.1.3", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-router-dom": "^7.0.2", + "react-scripts": "5.0.1", + "styled-components": "^6.1.13", + "tailwind-merge": "^3.0.2", + "tailwindcss-animate": "^1.0.7", + "web-vitals": "^4.2.4" + }, + "scripts": { + "start": "PORT=3001 react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "format": "prettier --write \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "format:check": "prettier --check \"src/**/*.{js,jsx,mjs,cjs,json,css,scss,md}\"", + "check-imports": "prettier --check --plugin @trivago/prettier-plugin-sort-imports \"src/**/*.{js,jsx,mjs,cjs}\"" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "devDependencies": { + "@babel/plugin-transform-private-property-in-object": "^7.25.9", + "@eslint/js": "^9.16.0", + "@trivago/prettier-plugin-sort-imports": "^5.2.0", + "autoprefixer": "^10.4.20", + "eslint": "^8.57.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-no-relative-import-paths": "^1.5.5", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react": "^7.37.2", + "globals": "^15.13.0", + "postcss": "^8.5.3", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0", + "tailwindcss": "^4.0.9" + } +} diff --git a/.history/src/App_20250219202759.css b/.history/src/App_20250219202759.css new file mode 100644 index 00000000..161800f9 --- /dev/null +++ b/.history/src/App_20250219202759.css @@ -0,0 +1,13 @@ +/* global color presets */ +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} diff --git a/.history/src/App_20250226134257.css b/.history/src/App_20250226134257.css new file mode 100644 index 00000000..0f533e38 --- /dev/null +++ b/.history/src/App_20250226134257.css @@ -0,0 +1,15 @@ +/* global color presets */ +@import "tailwindcss"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} diff --git a/.history/src/App_20250226134425.jsx b/.history/src/App_20250226134425.jsx new file mode 100644 index 00000000..4ddd65ae --- /dev/null +++ b/.history/src/App_20250226134425.jsx @@ -0,0 +1,52 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } + /> + } + /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226153700.jsx b/.history/src/App_20250226153700.jsx new file mode 100644 index 00000000..9a6e3eff --- /dev/null +++ b/.history/src/App_20250226153700.jsx @@ -0,0 +1,46 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226153747.jsx b/.history/src/App_20250226153747.jsx new file mode 100644 index 00000000..9a6e3eff --- /dev/null +++ b/.history/src/App_20250226153747.jsx @@ -0,0 +1,46 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226153839.jsx b/.history/src/App_20250226153839.jsx new file mode 100644 index 00000000..9a6e3eff --- /dev/null +++ b/.history/src/App_20250226153839.jsx @@ -0,0 +1,46 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226154043.jsx b/.history/src/App_20250226154043.jsx new file mode 100644 index 00000000..697863b4 --- /dev/null +++ b/.history/src/App_20250226154043.jsx @@ -0,0 +1,48 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import DialogDemo from 'common/components/FormPopup'; +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226154058.jsx b/.history/src/App_20250226154058.jsx new file mode 100644 index 00000000..697863b4 --- /dev/null +++ b/.history/src/App_20250226154058.jsx @@ -0,0 +1,48 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import DialogDemo from 'common/components/FormPopup'; +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226154252.jsx b/.history/src/App_20250226154252.jsx new file mode 100644 index 00000000..88076686 --- /dev/null +++ b/.history/src/App_20250226154252.jsx @@ -0,0 +1,48 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import DialogDemo from 'common/components/FormPopup'; +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } /> + } /> + } /> + + + + + + ); +} diff --git a/.history/src/App_20250226154303.jsx b/.history/src/App_20250226154303.jsx new file mode 100644 index 00000000..9a6e3eff --- /dev/null +++ b/.history/src/App_20250226154303.jsx @@ -0,0 +1,46 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/.history/src/App_20250226155035.css b/.history/src/App_20250226155035.css new file mode 100644 index 00000000..7f744a42 --- /dev/null +++ b/.history/src/App_20250226155035.css @@ -0,0 +1,176 @@ +/* global color presets */ +@import "tailwindcss"; +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.DialogOverlay { + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} + +.DialogContent { + background-color: var(--gray-1); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.DialogContent:focus { + outline: none; +} + +.DialogTitle { + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +} + +.DialogDescription { + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +} + +.Button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; +} +.Button:focus:not(:focus-visible) { + outline: 0; +} +.Button:focus-visible { + outline: 2px solid var(--violet-6); + outline-offset: 1px; +} +.Button.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); +} +.Button.violet:hover { + background-color: var(--mauve-3); +} +.Button.green { + background-color: var(--green-4); + color: var(--green-11); + outline-color: var(--green-7); +} +.Button.green:hover { + background-color: var(--green-5); +} + +.IconButton { + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); +} +.IconButton:hover { + background-color: var(--violet-4); +} +.IconButton:focus { + box-shadow: 0 0 0 2px var(--violet-7); +} + +.Fieldset { + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +} + +.Label { + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +} + +.Input { + width: 100%; + flex: 1; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; +} +.Input:focus { + box-shadow: 0 0 0 2px var(--violet-8); +} + +@keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } +} + diff --git a/.history/src/App_20250226155356.css b/.history/src/App_20250226155356.css new file mode 100644 index 00000000..7ee095d9 --- /dev/null +++ b/.history/src/App_20250226155356.css @@ -0,0 +1,176 @@ +/* global color presets */ +@import "tailwindcss"; +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.DialogOverlay { + background-color: var(--darkgrey); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} + +.DialogContent { + background-color: var(--gray-1); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.DialogContent:focus { + outline: none; +} + +.DialogTitle { + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +} + +.DialogDescription { + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +} + +.Button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; +} +.Button:focus:not(:focus-visible) { + outline: 0; +} +.Button:focus-visible { + outline: 2px solid var(--violet-6); + outline-offset: 1px; +} +.Button.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); +} +.Button.violet:hover { + background-color: var(--mauve-3); +} +.Button.green { + background-color: var(--green-4); + color: var(--green-11); + outline-color: var(--green-7); +} +.Button.green:hover { + background-color: var(--green-5); +} + +.IconButton { + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); +} +.IconButton:hover { + background-color: var(--violet-4); +} +.IconButton:focus { + box-shadow: 0 0 0 2px var(--violet-7); +} + +.Fieldset { + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +} + +.Label { + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +} + +.Input { + width: 100%; + flex: 1; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; +} +.Input:focus { + box-shadow: 0 0 0 2px var(--violet-8); +} + +@keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } +} + diff --git a/.history/src/App_20250226155414.css b/.history/src/App_20250226155414.css new file mode 100644 index 00000000..7f744a42 --- /dev/null +++ b/.history/src/App_20250226155414.css @@ -0,0 +1,176 @@ +/* global color presets */ +@import "tailwindcss"; +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.DialogOverlay { + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} + +.DialogContent { + background-color: var(--gray-1); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.DialogContent:focus { + outline: none; +} + +.DialogTitle { + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +} + +.DialogDescription { + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +} + +.Button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; +} +.Button:focus:not(:focus-visible) { + outline: 0; +} +.Button:focus-visible { + outline: 2px solid var(--violet-6); + outline-offset: 1px; +} +.Button.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); +} +.Button.violet:hover { + background-color: var(--mauve-3); +} +.Button.green { + background-color: var(--green-4); + color: var(--green-11); + outline-color: var(--green-7); +} +.Button.green:hover { + background-color: var(--green-5); +} + +.IconButton { + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); +} +.IconButton:hover { + background-color: var(--violet-4); +} +.IconButton:focus { + box-shadow: 0 0 0 2px var(--violet-7); +} + +.Fieldset { + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +} + +.Label { + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +} + +.Input { + width: 100%; + flex: 1; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; +} +.Input:focus { + box-shadow: 0 0 0 2px var(--violet-8); +} + +@keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } +} + diff --git a/.history/src/App_20250226155418.css b/.history/src/App_20250226155418.css new file mode 100644 index 00000000..3803ee74 --- /dev/null +++ b/.history/src/App_20250226155418.css @@ -0,0 +1,176 @@ +/* global color presets */ +@import "tailwindcss"; +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.DialogOverlay { + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} + +.DialogContent { + background-color: var(--darkgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.DialogContent:focus { + outline: none; +} + +.DialogTitle { + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +} + +.DialogDescription { + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +} + +.Button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; +} +.Button:focus:not(:focus-visible) { + outline: 0; +} +.Button:focus-visible { + outline: 2px solid var(--violet-6); + outline-offset: 1px; +} +.Button.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); +} +.Button.violet:hover { + background-color: var(--mauve-3); +} +.Button.green { + background-color: var(--green-4); + color: var(--green-11); + outline-color: var(--green-7); +} +.Button.green:hover { + background-color: var(--green-5); +} + +.IconButton { + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); +} +.IconButton:hover { + background-color: var(--violet-4); +} +.IconButton:focus { + box-shadow: 0 0 0 2px var(--violet-7); +} + +.Fieldset { + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +} + +.Label { + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +} + +.Input { + width: 100%; + flex: 1; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; +} +.Input:focus { + box-shadow: 0 0 0 2px var(--violet-8); +} + +@keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } +} + diff --git a/.history/src/App_20250226155436.css b/.history/src/App_20250226155436.css new file mode 100644 index 00000000..51952e84 --- /dev/null +++ b/.history/src/App_20250226155436.css @@ -0,0 +1,176 @@ +/* global color presets */ +@import "tailwindcss"; +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.DialogOverlay { + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} + +.DialogContent { + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.DialogContent:focus { + outline: none; +} + +.DialogTitle { + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +} + +.DialogDescription { + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +} + +.Button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; +} +.Button:focus:not(:focus-visible) { + outline: 0; +} +.Button:focus-visible { + outline: 2px solid var(--violet-6); + outline-offset: 1px; +} +.Button.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); +} +.Button.violet:hover { + background-color: var(--mauve-3); +} +.Button.green { + background-color: var(--green-4); + color: var(--green-11); + outline-color: var(--green-7); +} +.Button.green:hover { + background-color: var(--green-5); +} + +.IconButton { + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); +} +.IconButton:hover { + background-color: var(--violet-4); +} +.IconButton:focus { + box-shadow: 0 0 0 2px var(--violet-7); +} + +.Fieldset { + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +} + +.Label { + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +} + +.Input { + width: 100%; + flex: 1; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; +} +.Input:focus { + box-shadow: 0 0 0 2px var(--violet-8); +} + +@keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } +} + diff --git a/.history/src/App_20250226155503.css b/.history/src/App_20250226155503.css new file mode 100644 index 00000000..84384f1b --- /dev/null +++ b/.history/src/App_20250226155503.css @@ -0,0 +1,175 @@ +/* global color presets */ +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} + +/* reset */ +button, +fieldset, +input { + all: unset; +} + +.DialogOverlay { + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} + +.DialogContent { + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +} +.DialogContent:focus { + outline: none; +} + +.DialogTitle { + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +} + +.DialogDescription { + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +} + +.Button { + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; +} +.Button:focus:not(:focus-visible) { + outline: 0; +} +.Button:focus-visible { + outline: 2px solid var(--violet-6); + outline-offset: 1px; +} +.Button.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); +} +.Button.violet:hover { + background-color: var(--mauve-3); +} +.Button.green { + background-color: var(--green-4); + color: var(--green-11); + outline-color: var(--green-7); +} +.Button.green:hover { + background-color: var(--green-5); +} + +.IconButton { + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); +} +.IconButton:hover { + background-color: var(--violet-4); +} +.IconButton:focus { + box-shadow: 0 0 0 2px var(--violet-7); +} + +.Fieldset { + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +} + +.Label { + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +} + +.Input { + width: 100%; + flex: 1; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; +} +.Input:focus { + box-shadow: 0 0 0 2px var(--violet-8); +} + +@keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } +} + diff --git a/.history/src/App_20250226155634.css b/.history/src/App_20250226155634.css new file mode 100644 index 00000000..3645395f --- /dev/null +++ b/.history/src/App_20250226155634.css @@ -0,0 +1,18 @@ +/* global color presets */ +@import "@radix-ui/colors/black-alpha.css"; +@import "@radix-ui/colors/green.css"; +@import "@radix-ui/colors/mauve.css"; +@import "@radix-ui/colors/violet.css"; + +:root { + --primary-green: #45bf84; + --secondary-lightgrey: #f3f3f3; + --darkgrey: #747474; + --white: #fff; + --text: #191a23; +} + +* { + font-family: Verdana, sans-serif; + color: var(--text); +} diff --git a/.history/src/App_20250226155645.jsx b/.history/src/App_20250226155645.jsx new file mode 100644 index 00000000..9a6e3eff --- /dev/null +++ b/.history/src/App_20250226155645.jsx @@ -0,0 +1,46 @@ +import React from 'react'; + +import { BrowserRouter, Route, Routes } from 'react-router-dom'; + +import { + PrivateRoute, + PublicOnlyRoute, +} from 'common/components/routes/ProtectedRoutes'; +import { UserProvider } from 'common/contexts/UserContext'; +import NavLayout from 'common/layouts/NavLayout'; +import AuthCallback from 'pages/account/AuthCallback'; +import Login from 'pages/account/Login'; +import RequestPasswordReset from 'pages/account/RequestPasswordReset'; +import ResetPassword from 'pages/account/ResetPassword'; +import SignUp from 'pages/account/SignUp'; +import Home from 'pages/home/Home'; +import NotFound from 'pages/not-found/NotFound'; + +import './App.css'; + +export default function App() { + return ( + + + + }> + }> + } /> + + }> + } /> + } /> + } + /> + + } /> + } /> + } /> + + + + + ); +} diff --git a/src/common/components/Button.js b/.history/src/common/components/Button_20250219202759.js similarity index 100% rename from src/common/components/Button.js rename to .history/src/common/components/Button_20250219202759.js diff --git a/.history/src/common/components/Button_20250226140619.js b/.history/src/common/components/Button_20250226140619.js new file mode 100644 index 00000000..ab016464 --- /dev/null +++ b/.history/src/common/components/Button_20250226140619.js @@ -0,0 +1,37 @@ +import styled from 'styled-components'; + +const ButtonBase = styled.button` + font-size: 0.8em; + padding: 8px 20px; + border-radius: 5px; + border: solid 1px var(--text); + color: var(--text); + cursor: pointer; +`; + +const ButtonPrimary = styled(ButtonBase)` + background-color: var(--primary-green); + border-color: var(--primary-green); + color: var(--white); +`; + +const ButtonSecondary = styled(ButtonBase)` + background-color: var(--secondary-lightgrey); + border-color: var(--text); +`; + +const ButtonTransparent = styled(ButtonBase)` + background-color: transparent; +`; + +const ButtonInvisible = styled(ButtonBase)` + background-color: transparent; + border-color: transparent; +`; + +export const Button = { + Primary: ButtonPrimary, + Secondary: ButtonSecondary, + Transparent: ButtonTransparent, + Invisible: ButtonInvisible, +}; diff --git a/.history/src/common/components/Button_20250226152747.js b/.history/src/common/components/Button_20250226152747.js new file mode 100644 index 00000000..a14a6bbf --- /dev/null +++ b/.history/src/common/components/Button_20250226152747.js @@ -0,0 +1,37 @@ +import styled from 'styled-components'; + +const ButtonBase = styled.button` + font-size: 0.8em; + padding: 8px 20px; + border-radius: 5px; + border: solid 1px var(--text); + color: var(--text); + cursor: pointer; +`; + +const ButtonPrimary = styled(ButtonBase)` + background-color: var(--primary-green); + border-color: var(--primary-green); + color: var(--white); +`; + +const ButtonSecondary = styled(ButtonBase)` + background-color: var(--secondary-lightgrey); + border-color: var(--text); +`; + +const ButtonTransparent = styled(ButtonBase)` + background-color: transparent; +`; + +const ButtonInvisible = styled(ButtonBase)` + background-color: transparent; + border-color: transparent; +`; + +export const Button = { + Primary: ButtonPrimary, + Secondary: ButtonSecondary, + Transparent: ButtonTransparent, + Invisible: ButtonInvisible, +}; diff --git a/.history/src/common/components/FormPopup_20250226132140.jsx b/.history/src/common/components/FormPopup_20250226132140.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226132140.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226132154.jsx b/.history/src/common/components/FormPopup_20250226132154.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226132154.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226140843.jsx b/.history/src/common/components/FormPopup_20250226140843.jsx new file mode 100644 index 00000000..b8a152d0 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226140843.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226152728.jsx b/.history/src/common/components/FormPopup_20250226152728.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226152728.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226153114.jsx b/.history/src/common/components/FormPopup_20250226153114.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226153114.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226153232.jsx b/.history/src/common/components/FormPopup_20250226153232.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226153232.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226153235.jsx b/.history/src/common/components/FormPopup_20250226153235.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226153235.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226153300.jsx b/.history/src/common/components/FormPopup_20250226153300.jsx new file mode 100644 index 00000000..27f4a5d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226153300.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; + +// import styled from 'styled-components'; + +export default function FormPopup() { + return ( +
+

FormPopup

+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250226153620.jsx b/.history/src/common/components/FormPopup_20250226153620.jsx new file mode 100644 index 00000000..bc65d197 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226153620.jsx @@ -0,0 +1,71 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +const DialogDemo = () => ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+); + +export default DialogDemo; + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250226153635.jsx b/.history/src/common/components/FormPopup_20250226153635.jsx new file mode 100644 index 00000000..4df18495 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226153635.jsx @@ -0,0 +1,72 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +const DialogDemo = () => ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+); + +export default DialogDemo; + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250226155659.jsx b/.history/src/common/components/FormPopup_20250226155659.jsx new file mode 100644 index 00000000..76bcf56c --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226155659.jsx @@ -0,0 +1,228 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +/* reset */ +// button, +// fieldset, +// input { +// all: unset; +// } + +// .DialogOverlay { +// background-color: var(--black-a9); +// position: fixed; +// inset: 0; +// animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } + +// .DialogContent { +// background-color: var(--secondary-lightgrey); +// border-radius: 6px; +// box-shadow: var(--shadow-6); +// position: fixed; +// top: 50%; +// left: 50%; +// transform: translate(-50%, -50%); +// width: 90vw; +// max-width: 500px; +// max-height: 85vh; +// padding: 25px; +// animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } +// .DialogContent:focus { +// outline: none; +// } + +// .DialogTitle { +// margin: 0; +// font-weight: 500; +// color: var(--mauve-12); +// font-size: 17px; +// } + +// .DialogDescription { +// margin: 10px 0 20px; +// color: var(--mauve-11); +// font-size: 15px; +// line-height: 1.5; +// } + +// .Button { +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 15px; +// font-size: 15px; +// line-height: 1; +// font-weight: 500; +// height: 35px; +// user-select: none; +// } +// .Button:focus:not(:focus-visible) { +// outline: 0; +// } +// .Button:focus-visible { +// outline: 2px solid var(--violet-6); +// outline-offset: 1px; +// } +// .Button.violet { +// background-color: var(--violet-4); +// color: var(--violet-12); +// outline-color: var(--violet-6); +// } +// .Button.violet:hover { +// background-color: var(--mauve-3); +// } +// .Button.green { +// background-color: var(--green-4); +// color: var(--green-11); +// outline-color: var(--green-7); +// } +// .Button.green:hover { +// background-color: var(--green-5); +// } + +// .IconButton { +// all: unset; +// font-family: inherit; +// border-radius: 100%; +// height: 25px; +// width: 25px; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// color: var(--violet-11); +// position: absolute; +// top: 10px; +// right: 10px; +// background-color: var(--gray-3); +// } +// .IconButton:hover { +// background-color: var(--violet-4); +// } +// .IconButton:focus { +// box-shadow: 0 0 0 2px var(--violet-7); +// } + +// .Fieldset { +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// } + +// .Label { +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// } + +// .Input { +// width: 100%; +// flex: 1; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// } +// .Input:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } + +// @keyframes overlayShow { +// from { +// opacity: 0; +// } +// to { +// opacity: 1; +// } +// } + +// @keyframes contentShow { +// from { +// opacity: 0; +// transform: translate(-50%, -48%) scale(0.96); +// } +// to { +// opacity: 1; +// transform: translate(-50%, -50%) scale(1); +// } +// } + +const DialogDemo = () => ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+); + +export default DialogDemo; + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250226155939.jsx b/.history/src/common/components/FormPopup_20250226155939.jsx new file mode 100644 index 00000000..a1d99a2d --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226155939.jsx @@ -0,0 +1,230 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +/* reset */ +// button, +// fieldset, +// input { +// all: unset; +// } + +// .DialogOverlay { +// background-color: var(--black-a9); +// position: fixed; +// inset: 0; +// animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } + +// .DialogContent { +// background-color: var(--secondary-lightgrey); +// border-radius: 6px; +// box-shadow: var(--shadow-6); +// position: fixed; +// top: 50%; +// left: 50%; +// transform: translate(-50%, -50%); +// width: 90vw; +// max-width: 500px; +// max-height: 85vh; +// padding: 25px; +// animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } +// .DialogContent:focus { +// outline: none; +// } + +// .DialogTitle { +// margin: 0; +// font-weight: 500; +// color: var(--mauve-12); +// font-size: 17px; +// } + +// .DialogDescription { +// margin: 10px 0 20px; +// color: var(--mauve-11); +// font-size: 15px; +// line-height: 1.5; +// } + +// .Button { +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 15px; +// font-size: 15px; +// line-height: 1; +// font-weight: 500; +// height: 35px; +// user-select: none; +// } +// .Button:focus:not(:focus-visible) { +// outline: 0; +// } +// .Button:focus-visible { +// outline: 2px solid var(--violet-6); +// outline-offset: 1px; +// } +// .Button.violet { +// background-color: var(--violet-4); +// color: var(--violet-12); +// outline-color: var(--violet-6); +// } +// .Button.violet:hover { +// background-color: var(--mauve-3); +// } +// .Button.green { +// background-color: var(--green-4); +// color: var(--green-11); +// outline-color: var(--green-7); +// } +// .Button.green:hover { +// background-color: var(--green-5); +// } + +// .IconButton { +// all: unset; +// font-family: inherit; +// border-radius: 100%; +// height: 25px; +// width: 25px; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// color: var(--violet-11); +// position: absolute; +// top: 10px; +// right: 10px; +// background-color: var(--gray-3); +// } +// .IconButton:hover { +// background-color: var(--violet-4); +// } +// .IconButton:focus { +// box-shadow: 0 0 0 2px var(--violet-7); +// } + +// .Fieldset { +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// } + +// .Label { +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// } + +// .Input { +// width: 100%; +// flex: 1; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// } +// .Input:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } + +// @keyframes overlayShow { +// from { +// opacity: 0; +// } +// to { +// opacity: 1; +// } +// } + +// @keyframes contentShow { +// from { +// opacity: 0; +// transform: translate(-50%, -48%) scale(0.96); +// } +// to { +// opacity: 1; +// transform: translate(-50%, -50%) scale(1); +// } +// } +export default function FormPopup() { + return( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+ ); +} + + +export default DialogDemo; + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250226160000.jsx b/.history/src/common/components/FormPopup_20250226160000.jsx new file mode 100644 index 00000000..e7a9c7d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226160000.jsx @@ -0,0 +1,231 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +/* reset */ +// button, +// fieldset, +// input { +// all: unset; +// } + +// .DialogOverlay { +// background-color: var(--black-a9); +// position: fixed; +// inset: 0; +// animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } + +// .DialogContent { +// background-color: var(--secondary-lightgrey); +// border-radius: 6px; +// box-shadow: var(--shadow-6); +// position: fixed; +// top: 50%; +// left: 50%; +// transform: translate(-50%, -50%); +// width: 90vw; +// max-width: 500px; +// max-height: 85vh; +// padding: 25px; +// animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } +// .DialogContent:focus { +// outline: none; +// } + +// .DialogTitle { +// margin: 0; +// font-weight: 500; +// color: var(--mauve-12); +// font-size: 17px; +// } + +// .DialogDescription { +// margin: 10px 0 20px; +// color: var(--mauve-11); +// font-size: 15px; +// line-height: 1.5; +// } + +// .Button { +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 15px; +// font-size: 15px; +// line-height: 1; +// font-weight: 500; +// height: 35px; +// user-select: none; +// } +// .Button:focus:not(:focus-visible) { +// outline: 0; +// } +// .Button:focus-visible { +// outline: 2px solid var(--violet-6); +// outline-offset: 1px; +// } +// .Button.violet { +// background-color: var(--violet-4); +// color: var(--violet-12); +// outline-color: var(--violet-6); +// } +// .Button.violet:hover { +// background-color: var(--mauve-3); +// } +// .Button.green { +// background-color: var(--green-4); +// color: var(--green-11); +// outline-color: var(--green-7); +// } +// .Button.green:hover { +// background-color: var(--green-5); +// } + +// .IconButton { +// all: unset; +// font-family: inherit; +// border-radius: 100%; +// height: 25px; +// width: 25px; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// color: var(--violet-11); +// position: absolute; +// top: 10px; +// right: 10px; +// background-color: var(--gray-3); +// } +// .IconButton:hover { +// background-color: var(--violet-4); +// } +// .IconButton:focus { +// box-shadow: 0 0 0 2px var(--violet-7); +// } + +// .Fieldset { +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// } + +// .Label { +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// } + +// .Input { +// width: 100%; +// flex: 1; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// } +// .Input:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } + +// @keyframes overlayShow { +// from { +// opacity: 0; +// } +// to { +// opacity: 1; +// } +// } + +// @keyframes contentShow { +// from { +// opacity: 0; +// transform: translate(-50%, -48%) scale(0.96); +// } +// to { +// opacity: 1; +// transform: translate(-50%, -50%) scale(1); +// } +// } +export default function FormPopup() { + return ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+ ); +} + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250226160002.jsx b/.history/src/common/components/FormPopup_20250226160002.jsx new file mode 100644 index 00000000..e7a9c7d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226160002.jsx @@ -0,0 +1,231 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +/* reset */ +// button, +// fieldset, +// input { +// all: unset; +// } + +// .DialogOverlay { +// background-color: var(--black-a9); +// position: fixed; +// inset: 0; +// animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } + +// .DialogContent { +// background-color: var(--secondary-lightgrey); +// border-radius: 6px; +// box-shadow: var(--shadow-6); +// position: fixed; +// top: 50%; +// left: 50%; +// transform: translate(-50%, -50%); +// width: 90vw; +// max-width: 500px; +// max-height: 85vh; +// padding: 25px; +// animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } +// .DialogContent:focus { +// outline: none; +// } + +// .DialogTitle { +// margin: 0; +// font-weight: 500; +// color: var(--mauve-12); +// font-size: 17px; +// } + +// .DialogDescription { +// margin: 10px 0 20px; +// color: var(--mauve-11); +// font-size: 15px; +// line-height: 1.5; +// } + +// .Button { +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 15px; +// font-size: 15px; +// line-height: 1; +// font-weight: 500; +// height: 35px; +// user-select: none; +// } +// .Button:focus:not(:focus-visible) { +// outline: 0; +// } +// .Button:focus-visible { +// outline: 2px solid var(--violet-6); +// outline-offset: 1px; +// } +// .Button.violet { +// background-color: var(--violet-4); +// color: var(--violet-12); +// outline-color: var(--violet-6); +// } +// .Button.violet:hover { +// background-color: var(--mauve-3); +// } +// .Button.green { +// background-color: var(--green-4); +// color: var(--green-11); +// outline-color: var(--green-7); +// } +// .Button.green:hover { +// background-color: var(--green-5); +// } + +// .IconButton { +// all: unset; +// font-family: inherit; +// border-radius: 100%; +// height: 25px; +// width: 25px; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// color: var(--violet-11); +// position: absolute; +// top: 10px; +// right: 10px; +// background-color: var(--gray-3); +// } +// .IconButton:hover { +// background-color: var(--violet-4); +// } +// .IconButton:focus { +// box-shadow: 0 0 0 2px var(--violet-7); +// } + +// .Fieldset { +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// } + +// .Label { +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// } + +// .Input { +// width: 100%; +// flex: 1; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// } +// .Input:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } + +// @keyframes overlayShow { +// from { +// opacity: 0; +// } +// to { +// opacity: 1; +// } +// } + +// @keyframes contentShow { +// from { +// opacity: 0; +// transform: translate(-50%, -48%) scale(0.96); +// } +// to { +// opacity: 1; +// transform: translate(-50%, -50%) scale(1); +// } +// } +export default function FormPopup() { + return ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+ ); +} + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250226160350.jsx b/.history/src/common/components/FormPopup_20250226160350.jsx new file mode 100644 index 00000000..f060ce31 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226160350.jsx @@ -0,0 +1,188 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// Define styled components scoped to this component +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup() { + return ( + + + Edit profile + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + + + Name + + + + Username + + +
+ + Save changes + +
+ + + + + +
+
+
+ ); +} diff --git a/.history/src/common/components/FormPopup_20250226173723.jsx b/.history/src/common/components/FormPopup_20250226173723.jsx new file mode 100644 index 00000000..4f2e5361 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250226173723.jsx @@ -0,0 +1,192 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// Define styled components scoped to this component +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup() { + return ( + + + Edit profile + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + + + Name + + + + Username + + + + Item Name + + +
+ + Save changes + +
+ + + + + +
+
+
+ ); +} diff --git a/.history/src/common/components/FormPopup_20250227222951.jsx b/.history/src/common/components/FormPopup_20250227222951.jsx new file mode 100644 index 00000000..5554b428 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227222951.jsx @@ -0,0 +1,207 @@ +import { default as PropTypes, default as React } from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// Define styled components scoped to this component +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup() { + return ( + + + Edit profile + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + + + Name + + + + Username + + + + Item Name + + +
+ + Save changes + +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250227223057.jsx b/.history/src/common/components/FormPopup_20250227223057.jsx new file mode 100644 index 00000000..989a5c34 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227223057.jsx @@ -0,0 +1,208 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// Define styled components scoped to this component +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup() { + return ( + + + Edit profile + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + + + Name + + + + Username + + + + Item Name + + +
+ + Save changes + +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250227223259.jsx b/.history/src/common/components/FormPopup_20250227223259.jsx new file mode 100644 index 00000000..b6c73715 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227223259.jsx @@ -0,0 +1,208 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup() { + return ( + + + Edit profile + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + + + Name + + + + Username + + + + Item Name + + +
+ + Save changes + +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250227223652.jsx b/.history/src/common/components/FormPopup_20250227223652.jsx new file mode 100644 index 00000000..59f71342 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227223652.jsx @@ -0,0 +1,209 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup() { + return ( + + + Edit profile + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + + + Name + + + + Username + + + + Item Name + + +
+ + Save changes + +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + promptText: PropTypes.string, + placeholderText: PropTypes.string, + submitButtonText: PropTypes.string, + cancelButtonText: PropTypes.string, + onSubmit: PropTypes.func, +}; + +FormPopup.defaultProps = { + promptText: 'Prompt', + placeholderText: 'Enter text here', + submitButtonText: 'Submit', + cancelButtonText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250227224428.jsx b/.history/src/common/components/FormPopup_20250227224428.jsx new file mode 100644 index 00000000..172ab18b --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227224428.jsx @@ -0,0 +1,196 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup({ title, description, children, onSubmit }) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, +}; + +FormPopup.defaultProps = { + description: '', +}; diff --git a/.history/src/common/components/FormPopup_20250227232142.jsx b/.history/src/common/components/FormPopup_20250227232142.jsx new file mode 100644 index 00000000..71c68680 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227232142.jsx @@ -0,0 +1,204 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: ${(props) => props.width || '90vw'}; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + width, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + width: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + width: '90vw', +}; diff --git a/.history/src/common/components/FormPopup_20250227232255.jsx b/.history/src/common/components/FormPopup_20250227232255.jsx new file mode 100644 index 00000000..7e48c6ac --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227232255.jsx @@ -0,0 +1,204 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: ${(props) => props.width || '90vw'}; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + width, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + width: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + width: '90vw', +}; diff --git a/.history/src/common/components/FormPopup_20250227232338.jsx b/.history/src/common/components/FormPopup_20250227232338.jsx new file mode 100644 index 00000000..71c68680 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227232338.jsx @@ -0,0 +1,204 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: ${(props) => props.width || '90vw'}; + max-width: 500px; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + width, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + width: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + width: '90vw', +}; diff --git a/.history/src/common/components/FormPopup_20250227232439.jsx b/.history/src/common/components/FormPopup_20250227232439.jsx new file mode 100644 index 00000000..972323e5 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227232439.jsx @@ -0,0 +1,204 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', +}; diff --git a/.history/src/common/components/FormPopup_20250227234152.jsx b/.history/src/common/components/FormPopup_20250227234152.jsx new file mode 100644 index 00000000..ba1e3a32 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250227234152.jsx @@ -0,0 +1,205 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 25px; + width: 25px; + display: inline-flex; + align-items: center; + justify-content: center; + color: var(--violet-11); + position: absolute; + top: 10px; + right: 10px; + background-color: var(--gray-3); + &:hover { + background-color: var(--violet-4); + } + &:focus { + box-shadow: 0 0 0 2px var(--violet-7); + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', +}; diff --git a/.history/src/common/components/FormPopup_20250228142210.jsx b/.history/src/common/components/FormPopup_20250228142210.jsx new file mode 100644 index 00000000..0620c9ad --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228142210.jsx @@ -0,0 +1,222 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} +
+ + + Save changes + + +
+
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228142433.jsx b/.history/src/common/components/FormPopup_20250228142433.jsx new file mode 100644 index 00000000..da703881 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228142433.jsx @@ -0,0 +1,224 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {defaultSubmit && ( +
+ + + Save changes + + +
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228142534.jsx b/.history/src/common/components/FormPopup_20250228142534.jsx new file mode 100644 index 00000000..7b0dec0a --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228142534.jsx @@ -0,0 +1,225 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ + + Save changes + + +
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228142801.jsx b/.history/src/common/components/FormPopup_20250228142801.jsx new file mode 100644 index 00000000..122ff766 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228142801.jsx @@ -0,0 +1,225 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ + + Save changes + + +
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228155411.jsx b/.history/src/common/components/FormPopup_20250228155411.jsx new file mode 100644 index 00000000..f4263f72 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228155411.jsx @@ -0,0 +1,228 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ + + Save changes + + + Cancel + + +
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228155451.jsx b/.history/src/common/components/FormPopup_20250228155451.jsx new file mode 100644 index 00000000..fc66c201 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228155451.jsx @@ -0,0 +1,230 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228155641.jsx b/.history/src/common/components/FormPopup_20250228155641.jsx new file mode 100644 index 00000000..a795b46c --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228155641.jsx @@ -0,0 +1,230 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250228155955.jsx b/.history/src/common/components/FormPopup_20250228155955.jsx new file mode 100644 index 00000000..89e1d401 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250228155955.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301222736.jsx b/.history/src/common/components/FormPopup_20250301222736.jsx new file mode 100644 index 00000000..e7a9c7d6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301222736.jsx @@ -0,0 +1,231 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; + +/* reset */ +// button, +// fieldset, +// input { +// all: unset; +// } + +// .DialogOverlay { +// background-color: var(--black-a9); +// position: fixed; +// inset: 0; +// animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } + +// .DialogContent { +// background-color: var(--secondary-lightgrey); +// border-radius: 6px; +// box-shadow: var(--shadow-6); +// position: fixed; +// top: 50%; +// left: 50%; +// transform: translate(-50%, -50%); +// width: 90vw; +// max-width: 500px; +// max-height: 85vh; +// padding: 25px; +// animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +// } +// .DialogContent:focus { +// outline: none; +// } + +// .DialogTitle { +// margin: 0; +// font-weight: 500; +// color: var(--mauve-12); +// font-size: 17px; +// } + +// .DialogDescription { +// margin: 10px 0 20px; +// color: var(--mauve-11); +// font-size: 15px; +// line-height: 1.5; +// } + +// .Button { +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 15px; +// font-size: 15px; +// line-height: 1; +// font-weight: 500; +// height: 35px; +// user-select: none; +// } +// .Button:focus:not(:focus-visible) { +// outline: 0; +// } +// .Button:focus-visible { +// outline: 2px solid var(--violet-6); +// outline-offset: 1px; +// } +// .Button.violet { +// background-color: var(--violet-4); +// color: var(--violet-12); +// outline-color: var(--violet-6); +// } +// .Button.violet:hover { +// background-color: var(--mauve-3); +// } +// .Button.green { +// background-color: var(--green-4); +// color: var(--green-11); +// outline-color: var(--green-7); +// } +// .Button.green:hover { +// background-color: var(--green-5); +// } + +// .IconButton { +// all: unset; +// font-family: inherit; +// border-radius: 100%; +// height: 25px; +// width: 25px; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// color: var(--violet-11); +// position: absolute; +// top: 10px; +// right: 10px; +// background-color: var(--gray-3); +// } +// .IconButton:hover { +// background-color: var(--violet-4); +// } +// .IconButton:focus { +// box-shadow: 0 0 0 2px var(--violet-7); +// } + +// .Fieldset { +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// } + +// .Label { +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// } + +// .Input { +// width: 100%; +// flex: 1; +// display: inline-flex; +// align-items: center; +// justify-content: center; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// } +// .Input:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } + +// @keyframes overlayShow { +// from { +// opacity: 0; +// } +// to { +// opacity: 1; +// } +// } + +// @keyframes contentShow { +// from { +// opacity: 0; +// transform: translate(-50%, -48%) scale(0.96); +// } +// to { +// opacity: 1; +// transform: translate(-50%, -50%) scale(1); +// } +// } +export default function FormPopup() { + return ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+ ); +} + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250301223722.jsx b/.history/src/common/components/FormPopup_20250301223722.jsx new file mode 100644 index 00000000..09581e45 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301223722.jsx @@ -0,0 +1,238 @@ +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +//import PropTypes from 'prop-types'; +// import styled from 'styled-components'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +const StyledFieldset = styled.fieldset` + display: flex; + gap: 20px; + align-items: center; + margin-bottom: 15px; +`; + +const StyledLabel = styled.label` + font-size: 15px; + color: var(--violet-11); + width: 90px; + text-align: right; +`; + +const StyledInput = styled.input` + width: 100%; + flex: 1; + border-radius: 4px; + padding: 0 10px; + font-size: 15px; + line-height: 1; + color: var(--violet-11); + box-shadow: 0 0 0 1px var(--violet-7); + height: 35px; + &:focus { + box-shadow: 0 0 0 2px var(--violet-8); + } +`; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, +}) { + return ( + + + + + + + + Edit profile + + Make changes to your profile here. Click save when you're done. + +
+ + +
+
+ + +
+
+ + + +
+ + + +
+
+
+ ); +} + +// export default function FormPopup() { +// return ( +//
+//

FormPopup

+//
+// ); +// } + +// FormPopup.propTypes = { +// promptText: PropTypes.string, +// placeholderText: PropTypes.string, +// submitButtonText: PropTypes.string, +// cancelButtonText: PropTypes.string, +// onSubmit: PropTypes.func, +// }; + +// FormPopup.defaultProps = { +// promptText: 'Prompt', +// placeholderText: 'Enter text here', +// submitButtonText: 'Submit', +// cancelButtonText: 'Cancel', +// }; diff --git a/.history/src/common/components/FormPopup_20250301223907.jsx b/.history/src/common/components/FormPopup_20250301223907.jsx new file mode 100644 index 00000000..89e1d401 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301223907.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: rgb(255, 74, 74); // same color from Figma + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: red; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230227.jsx b/.history/src/common/components/FormPopup_20250301230227.jsx new file mode 100644 index 00000000..3c8c4da6 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230227.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: white; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: white; + } + + &:hover { + background-color: gray; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230243.jsx b/.history/src/common/components/FormPopup_20250301230243.jsx new file mode 100644 index 00000000..291a0377 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230243.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: white; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: gray; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230256.jsx b/.history/src/common/components/FormPopup_20250301230256.jsx new file mode 100644 index 00000000..a34cff97 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230256.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: gray; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230319.jsx b/.history/src/common/components/FormPopup_20250301230319.jsx new file mode 100644 index 00000000..cf00ae26 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230319.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + opacity: 0.8; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230352.jsx b/.history/src/common/components/FormPopup_20250301230352.jsx new file mode 100644 index 00000000..8ace819f --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230352.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230435.jsx b/.history/src/common/components/FormPopup_20250301230435.jsx new file mode 100644 index 00000000..d93bdd6f --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230435.jsx @@ -0,0 +1,236 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg > path { + height: 50px; + width: 50px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230524.jsx b/.history/src/common/components/FormPopup_20250301230524.jsx new file mode 100644 index 00000000..20295ee2 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230524.jsx @@ -0,0 +1,236 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.1s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg > path { + height: 50px; + width: 50px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230536.jsx b/.history/src/common/components/FormPopup_20250301230536.jsx new file mode 100644 index 00000000..d93bdd6f --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230536.jsx @@ -0,0 +1,236 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg > path { + height: 50px; + width: 50px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230548.jsx b/.history/src/common/components/FormPopup_20250301230548.jsx new file mode 100644 index 00000000..caadb934 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230548.jsx @@ -0,0 +1,236 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 50px; + width: 50px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230603.jsx b/.history/src/common/components/FormPopup_20250301230603.jsx new file mode 100644 index 00000000..27021434 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230603.jsx @@ -0,0 +1,236 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 42px; + width: 42px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230620.jsx b/.history/src/common/components/FormPopup_20250301230620.jsx new file mode 100644 index 00000000..c40547b4 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230620.jsx @@ -0,0 +1,236 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 25px; + width: 25px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230654.jsx b/.history/src/common/components/FormPopup_20250301230654.jsx new file mode 100644 index 00000000..d419e4ff --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230654.jsx @@ -0,0 +1,237 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 25px; + width: 25px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + transition: 0.1s; + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230857.jsx b/.history/src/common/components/FormPopup_20250301230857.jsx new file mode 100644 index 00000000..897d024b --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230857.jsx @@ -0,0 +1,237 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 25px; + width: 25px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + transition: 1s; + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230907.jsx b/.history/src/common/components/FormPopup_20250301230907.jsx new file mode 100644 index 00000000..26a4e967 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230907.jsx @@ -0,0 +1,237 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 25px; + width: 25px; + } + } + + &:focus { + box-shadow: 0 0 0 2px red; // button appears a tad bigger when clicked + transition: 0.05s; + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301230952.jsx b/.history/src/common/components/FormPopup_20250301230952.jsx new file mode 100644 index 00000000..ab3dd928 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301230952.jsx @@ -0,0 +1,232 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 25px; + width: 25px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301231315.jsx b/.history/src/common/components/FormPopup_20250301231315.jsx new file mode 100644 index 00000000..bbeffab5 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301231315.jsx @@ -0,0 +1,235 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + svg { + height: 25px; + width: 25px; + } + svg > path { + stroke-width: 1px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301231612.jsx b/.history/src/common/components/FormPopup_20250301231612.jsx new file mode 100644 index 00000000..08225a4b --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301231612.jsx @@ -0,0 +1,235 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 25px; + width: 25px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301231621.jsx b/.history/src/common/components/FormPopup_20250301231621.jsx new file mode 100644 index 00000000..2e7b3c0d --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301231621.jsx @@ -0,0 +1,235 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 30px; + width: 230px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301231624.jsx b/.history/src/common/components/FormPopup_20250301231624.jsx new file mode 100644 index 00000000..ac426433 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301231624.jsx @@ -0,0 +1,235 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 30px; + width: 30px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250301231637.jsx b/.history/src/common/components/FormPopup_20250301231637.jsx new file mode 100644 index 00000000..d824308c --- /dev/null +++ b/.history/src/common/components/FormPopup_20250301231637.jsx @@ -0,0 +1,235 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250302132932.jsx b/.history/src/common/components/FormPopup_20250302132932.jsx new file mode 100644 index 00000000..9917e923 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302132932.jsx @@ -0,0 +1,239 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250302133127.jsx b/.history/src/common/components/FormPopup_20250302133127.jsx new file mode 100644 index 00000000..662a3ef5 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302133127.jsx @@ -0,0 +1,248 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title, + description, + children, + onSubmit, + maxWidth, + defaultSubmit, +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + Save changes + + + Save changes + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, +}; diff --git a/.history/src/common/components/FormPopup_20250302133317.jsx b/.history/src/common/components/FormPopup_20250302133317.jsx new file mode 100644 index 00000000..a35d3e67 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302133317.jsx @@ -0,0 +1,254 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', + description = 'Form Desc.', + children, + onSubmit, + maxWidth = '500px', + defaultSubmit = true, + submitText = 'Submit', + cancelText = 'Cancel', +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250302133535.jsx b/.history/src/common/components/FormPopup_20250302133535.jsx new file mode 100644 index 00000000..ad3ff82a --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302133535.jsx @@ -0,0 +1,255 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; + +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', + description = 'Form Desc.', + children, + onSubmit, + maxWidth = '500px', + defaultSubmit = true, + submitText = 'Submit', + cancelText = 'Cancel', +}) { + return ( + + + Open Form + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', +}; diff --git a/.history/src/common/components/FormPopup_20250302133903.jsx b/.history/src/common/components/FormPopup_20250302133903.jsx new file mode 100644 index 00000000..70ff58b2 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302133903.jsx @@ -0,0 +1,258 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form +}) { + return ( + + + {buttonText} + + + + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', +}; diff --git a/.history/src/common/components/FormPopup_20250302133954.jsx b/.history/src/common/components/FormPopup_20250302133954.jsx new file mode 100644 index 00000000..f0f0667a --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302133954.jsx @@ -0,0 +1,258 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} +
+ {children} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', +}; diff --git a/.history/src/common/components/FormPopup_20250302134057.jsx b/.history/src/common/components/FormPopup_20250302134057.jsx new file mode 100644 index 00000000..17c196ff --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302134057.jsx @@ -0,0 +1,259 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', +}; diff --git a/.history/src/common/components/FormPopup_20250302134233.jsx b/.history/src/common/components/FormPopup_20250302134233.jsx new file mode 100644 index 00000000..211ab24c --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302134233.jsx @@ -0,0 +1,262 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, +}; + +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', +}; diff --git a/.history/src/common/components/FormPopup_20250302134246.jsx b/.history/src/common/components/FormPopup_20250302134246.jsx new file mode 100644 index 00000000..b0114bfe --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302134246.jsx @@ -0,0 +1,263 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, +}; + +// Reiteration of default values for the FormPopup component +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', +}; diff --git a/.history/src/common/components/FormPopup_20250302134313.jsx b/.history/src/common/components/FormPopup_20250302134313.jsx new file mode 100644 index 00000000..b0114bfe --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302134313.jsx @@ -0,0 +1,263 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, +}; + +// Reiteration of default values for the FormPopup component +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', +}; diff --git a/.history/src/common/components/FormPopup_20250302135329.jsx b/.history/src/common/components/FormPopup_20250302135329.jsx new file mode 100644 index 00000000..126352ac --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302135329.jsx @@ -0,0 +1,268 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form + customForm = false, // if false, then caller must provide input fields. If true, then caller must provide another form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} + {!customForm && ( +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ )} + {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, + customForm: PropTypes.bool, +}; + +// Reiteration of default values for the FormPopup component +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', + customForm: false, +}; diff --git a/.history/src/common/components/FormPopup_20250302135447.jsx b/.history/src/common/components/FormPopup_20250302135447.jsx new file mode 100644 index 00000000..e517d24d --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302135447.jsx @@ -0,0 +1,269 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form + customForm = false, // if false, then caller must provide input fields. If true, then caller must provide another form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} + {customForm && { children }} + {!customForm && ( +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ )} + {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, + customForm: PropTypes.bool, +}; + +// Reiteration of default values for the FormPopup component +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', + customForm: false, +}; diff --git a/.history/src/common/components/FormPopup_20250302135556.jsx b/.history/src/common/components/FormPopup_20250302135556.jsx new file mode 100644 index 00000000..3e6e333b --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302135556.jsx @@ -0,0 +1,269 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form + customForm = false, // if false, then caller must provide input fields. If true, then caller must provide another form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} + {customForm &&
{children}
} + {!customForm && ( +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ )} + {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, + customForm: PropTypes.bool, +}; + +// Reiteration of default values for the FormPopup component +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', + customForm: false, +}; diff --git a/.history/src/common/components/FormPopup_20250302135747.jsx b/.history/src/common/components/FormPopup_20250302135747.jsx new file mode 100644 index 00000000..4e700811 --- /dev/null +++ b/.history/src/common/components/FormPopup_20250302135747.jsx @@ -0,0 +1,271 @@ +// Used for New Order Form, Change Password Form +import React from 'react'; + +import { Cross2Icon } from '@radix-ui/react-icons'; +import PropTypes from 'prop-types'; +import { Dialog } from 'radix-ui'; +import styled from 'styled-components'; + +// MAKE SURE TO STYLE COMPONENT IN SAME FILE IT IS BEING EXPORTED FROM!! +// Below is styling for FormPopup, translated from CSS to styled components +const StyledOverlay = styled(Dialog.Overlay)` + background-color: var(--black-a9); + position: fixed; + inset: 0; + animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1); +`; + +const StyledContent = styled(Dialog.Content)` + background-color: var(--secondary-lightgrey); + border-radius: 6px; + box-shadow: var(--shadow-6); + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 90vw; + max-width: ${(props) => props.maxWidth || '500px'}; + max-height: 85vh; + padding: 25px; + overflow: hidden; + animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1); + &:focus { + outline: none; + } + + @keyframes overlayShow { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes contentShow { + from { + opacity: 0; + transform: translate(-50%, -48%) scale(0.96); + } + to { + opacity: 1; + transform: translate(-50%, -50%) scale(1); + } + } +`; + +const StyledTitle = styled(Dialog.Title)` + margin: 0; + font-weight: 500; + color: var(--mauve-12); + font-size: 17px; +`; + +const StyledDescription = styled(Dialog.Description)` + margin: 10px 0 20px; + color: var(--mauve-11); + font-size: 15px; + line-height: 1.5; +`; +// Below is unused for now, may use later (leaving commented out, ignore until further notice) +// const StyledFieldset = styled.fieldset` +// display: flex; +// gap: 20px; +// align-items: center; +// margin-bottom: 15px; +// `; + +// const StyledLabel = styled.label` +// font-size: 15px; +// color: var(--violet-11); +// width: 90px; +// text-align: right; +// `; + +// const StyledInput = styled.input` +// width: 100%; +// flex: 1; +// border-radius: 4px; +// padding: 0 10px; +// font-size: 15px; +// line-height: 1; +// color: var(--violet-11); +// box-shadow: 0 0 0 1px var(--violet-7); +// height: 35px; +// &:focus { +// box-shadow: 0 0 0 2px var(--violet-8); +// } +// `; + +const StyledButton = styled.button` + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + padding: 0 15px; + font-size: 15px; + line-height: 1; + font-weight: 500; + height: 35px; + user-select: none; + + &.violet { + background-color: var(--violet-4); + color: var(--violet-12); + outline-color: var(--violet-6); + &:hover { + background-color: var(--mauve-3); + } + } + + &.green { + background-color: var(--green-4); + color: var (--green-11); + outline-color: var(--green-7); + &:hover { + background-color: var(--green-5); + } + } + + &.red { + background-color: var(--red-4); + color: var(--red-11); + outline-color: var(--red-7); + &:hover { + background-color: var(--red-5); + } + } +`; + +const IconButton = styled.button` + all: unset; + font-family: inherit; + border-radius: 100%; + height: 40px; + width: 40px; + display: inline-flex; + align-items: center; + justify-content: center; + color: white; + position: absolute; + top: 10px; + right: 10px; + background-color: inherit; + transition: all 0.3s ease; + + svg { + height: 20px; // Set the height of the SVG + width: 20px; // Set the width of the SVG + } + + svg > path { + fill: red; + } + + &:hover { + background-color: #ededed; // button gets darker when they hover + } + + &:focus { + svg { + height: 27px; + width: 27px; + } + } +`; + +export default function FormPopup({ + title = 'Form Popup', // title of the form + description = 'Form Desc.', // form desc. + children, // any additional DOM elts you would want to add to form + onSubmit, // what happens when form is submitted + maxWidth = '500px', // allows us to define how wide this form is + defaultSubmit = true, // if true, then basic 'Submit' and 'Cancel' buttons. If false, then caller expected to provide buttons + submitText = 'Submit', // default 'Submit' text + cancelText = 'Cancel', // default 'Cancel' text + buttonText = 'Open Form', // text that appears over form button --> click --> opens form + customForm = false, // if false, then caller must provide input fields. If true, then caller must provide another form +}) { + return ( + + + {buttonText} + + + {/* allows for 'dimmed' background */} + + {title} + {description} + {/* if custom form is true, then caller must be providing their own form (since form nested in a form is NOT allowed) */} + {customForm &&
{children}
} + {/* if custom form is false, then caller is expecting to use supplied form (not providing their own) */} + {!customForm && ( +
+ {children} {/* what will go in the form */} + {/* if defaultSubmit is NOT true, caller is expected to have another button to submit form */} + {defaultSubmit && ( +
+ +
+ + {submitText} + + + {cancelText} + +
+
+
+ )} +
+ )} + {/* The 'X' close button that allows us to close the form */} + + + + + +
+
+
+ ); +} + +// Form title, children nodes, and onSubmit functionality are required. Title because +// the user must know that the form does, children because the form must include some content, and +// onSubmit because the form must do something when it is completed +FormPopup.propTypes = { + title: PropTypes.string.isRequired, + description: PropTypes.string, + children: PropTypes.node.isRequired, + onSubmit: PropTypes.func.isRequired, + maxWidth: PropTypes.string, + defaultSubmit: PropTypes.bool, + submitText: PropTypes.string, + cancelText: PropTypes.string, + buttonText: PropTypes.string, + customForm: PropTypes.bool, +}; + +// Reiteration of default values for the FormPopup component +FormPopup.defaultProps = { + description: '', + maxWidth: '500px', + defaultSubmit: true, + submitText: 'Submit', + cancelText: 'Cancel', + buttonText: 'Open Form', + customForm: false, +}; diff --git a/src/common/components/GoogleButton.jsx b/.history/src/common/components/GoogleButton_20250219202759.jsx similarity index 100% rename from src/common/components/GoogleButton.jsx rename to .history/src/common/components/GoogleButton_20250219202759.jsx diff --git a/.history/src/common/components/GoogleButton_20250226140618.jsx b/.history/src/common/components/GoogleButton_20250226140618.jsx new file mode 100644 index 00000000..9cdb0157 --- /dev/null +++ b/.history/src/common/components/GoogleButton_20250226140618.jsx @@ -0,0 +1,104 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; +import styled from 'styled-components'; + +const StyledButton = styled.button` + width: 100%; + display: flex; + justify-content: center; + align-items: center; + gap: 8px; + background-color: white; + border: 1px solid #e2e2e2; + border-radius: 4px; + padding: 8px 16px; + color: #5f6368; + font-size: 14px; + cursor: pointer; + transition: background-color 0.2s; + + &:hover { + background-color: #f8f9fa; + } + + &:focus { + outline: none; + box-shadow: 0 0 0 2px #e8e8e8; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } +`; + +const Divider = styled.div` + position: relative; + margin: 24px 0; + text-align: center; + + &::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background-color: #e2e2e2; + } + + span { + position: relative; + background-color: white; + padding: 0 12px; + color: #666; + font-size: 14px; + } +`; + +export default function GoogleButton({ + isLoading, + onClick, + text = 'Sign in with Google', +}) { + return ( + <> + + Or continue with + + + + + + + + + {text} + + + ); +} + +GoogleButton.propTypes = { + isLoading: PropTypes.bool, + onClick: PropTypes.func.isRequired, + text: PropTypes.string, +}; + +GoogleButton.defaultProps = { + isLoading: false, + text: 'Sign in with Google', +}; diff --git a/.history/src/common/components/GoogleButton_20250226152730.jsx b/.history/src/common/components/GoogleButton_20250226152730.jsx new file mode 100644 index 00000000..c1758b7a --- /dev/null +++ b/.history/src/common/components/GoogleButton_20250226152730.jsx @@ -0,0 +1,104 @@ +import React from 'react'; + +import PropTypes from 'prop-types'; +import styled from 'styled-components'; + +const StyledButton = styled.button` + width: 100%; + display: flex; + justify-content: center; + align-items: center; + gap: 8px; + background-color: white; + border: 1px solid #e2e2e2; + border-radius: 4px; + padding: 8px 16px; + color: #5f6368; + font-size: 14px; + cursor: pointer; + transition: background-color 0.2s; + + &:hover { + background-color: #f8f9fa; + } + + &:focus { + outline: none; + box-shadow: 0 0 0 2px #e8e8e8; + } + + &:disabled { + opacity: 0.5; + cursor: not-allowed; + } +`; + +const Divider = styled.div` + position: relative; + margin: 24px 0; + text-align: center; + + &::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background-color: #e2e2e2; + } + + span { + position: relative; + background-color: white; + padding: 0 12px; + color: #666; + font-size: 14px; + } +`; + +export default function GoogleButton({ + isLoading, + onClick, + text = 'Sign in with Google', +}) { + return ( + <> + + Or continue with + + + + + + + + + {text} + + + ); +} + +GoogleButton.propTypes = { + isLoading: PropTypes.bool, + onClick: PropTypes.func.isRequired, + text: PropTypes.string, +}; + +GoogleButton.defaultProps = { + isLoading: false, + text: 'Sign in with Google', +}; diff --git a/.history/src/common/components/NewOrderForm_20250227224353.jsx b/.history/src/common/components/NewOrderForm_20250227224353.jsx new file mode 100644 index 00000000..e69de29b diff --git a/.history/src/common/components/NewOrderForm_20250227224458.jsx b/.history/src/common/components/NewOrderForm_20250227224458.jsx new file mode 100644 index 00000000..94444083 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227224458.jsx @@ -0,0 +1,42 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + return ( + + + + + ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227224956.jsx b/.history/src/common/components/NewOrderForm_20250227224956.jsx new file mode 100644 index 00000000..201faf1d --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227224956.jsx @@ -0,0 +1,45 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + + + + ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225143.jsx b/.history/src/common/components/NewOrderForm_20250227225143.jsx new file mode 100644 index 00000000..c150b7a5 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225143.jsx @@ -0,0 +1,45 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + + + + ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225328.jsx b/.history/src/common/components/NewOrderForm_20250227225328.jsx new file mode 100644 index 00000000..f7851b8d --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225328.jsx @@ -0,0 +1,59 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + + + + + + ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225348.jsx b/.history/src/common/components/NewOrderForm_20250227225348.jsx new file mode 100644 index 00000000..cf174728 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225348.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +

hi

+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225414.jsx b/.history/src/common/components/NewOrderForm_20250227225414.jsx new file mode 100644 index 00000000..d33787d2 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225414.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +

Hi

+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225516.jsx b/.history/src/common/components/NewOrderForm_20250227225516.jsx new file mode 100644 index 00000000..58f6cbaf --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225516.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +

Hi

+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225529.jsx b/.history/src/common/components/NewOrderForm_20250227225529.jsx new file mode 100644 index 00000000..46c2307e --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225529.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
Hi
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225613.jsx b/.history/src/common/components/NewOrderForm_20250227225613.jsx new file mode 100644 index 00000000..81df4a7b --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225613.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
Hi
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225635.jsx b/.history/src/common/components/NewOrderForm_20250227225635.jsx new file mode 100644 index 00000000..e0797337 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225635.jsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
Hi
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225709.jsx b/.history/src/common/components/NewOrderForm_20250227225709.jsx new file mode 100644 index 00000000..3f421656 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225709.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: {{}} +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225721.jsx b/.history/src/common/components/NewOrderForm_20250227225721.jsx new file mode 100644 index 00000000..52849e3b --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225721.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225740.jsx b/.history/src/common/components/NewOrderForm_20250227225740.jsx new file mode 100644 index 00000000..613e2337 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225740.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225812.jsx b/.history/src/common/components/NewOrderForm_20250227225812.jsx new file mode 100644 index 00000000..a7c73495 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225812.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225821.jsx b/.history/src/common/components/NewOrderForm_20250227225821.jsx new file mode 100644 index 00000000..7826d055 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225821.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225841.jsx b/.history/src/common/components/NewOrderForm_20250227225841.jsx new file mode 100644 index 00000000..f67aa682 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225841.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225926.jsx b/.history/src/common/components/NewOrderForm_20250227225926.jsx new file mode 100644 index 00000000..f67aa682 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225926.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleOrderNameChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227225955.jsx b/.history/src/common/components/NewOrderForm_20250227225955.jsx new file mode 100644 index 00000000..1348b4d2 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227225955.jsx @@ -0,0 +1,62 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + +
+ Selected program budget: 4 +
+ + + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230210.jsx b/.history/src/common/components/NewOrderForm_20250227230210.jsx new file mode 100644 index 00000000..5e97347a --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230210.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230227.jsx b/.history/src/common/components/NewOrderForm_20250227230227.jsx new file mode 100644 index 00000000..f9eb1c02 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230227.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230244.jsx b/.history/src/common/components/NewOrderForm_20250227230244.jsx new file mode 100644 index 00000000..5722f1f1 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230244.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230408.jsx b/.history/src/common/components/NewOrderForm_20250227230408.jsx new file mode 100644 index 00000000..3a15b7a2 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230408.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230530.jsx b/.history/src/common/components/NewOrderForm_20250227230530.jsx new file mode 100644 index 00000000..75813afe --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230530.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230539.jsx b/.history/src/common/components/NewOrderForm_20250227230539.jsx new file mode 100644 index 00000000..5ea061c6 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230539.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230540.jsx b/.history/src/common/components/NewOrderForm_20250227230540.jsx new file mode 100644 index 00000000..b395a194 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230540.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230559.jsx b/.history/src/common/components/NewOrderForm_20250227230559.jsx new file mode 100644 index 00000000..be5c090d --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230559.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230614.jsx b/.history/src/common/components/NewOrderForm_20250227230614.jsx new file mode 100644 index 00000000..22fd1134 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230614.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230746.jsx b/.history/src/common/components/NewOrderForm_20250227230746.jsx new file mode 100644 index 00000000..ced8be80 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230746.jsx @@ -0,0 +1,82 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { orderName, orderDescription }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Text Field */} + +
+ ); +} diff --git a/.history/src/common/components/NewOrderForm_20250227230855.jsx b/.history/src/common/components/NewOrderForm_20250227230855.jsx new file mode 100644 index 00000000..8df6d1c9 --- /dev/null +++ b/.history/src/common/components/NewOrderForm_20250227230855.jsx @@ -0,0 +1,112 @@ +import React, { useState } from 'react'; + +import FormPopup from './FormPopup'; +import { Input } from './form/Input'; + +export default function NewOrderForm() { + const [orderName, setOrderName] = useState(''); + const [orderDescription, setOrderDescription] = useState(''); + const [reasonForBuying, setReasonForBuying] = useState(''); + + const handleBudgetChange = (e) => setOrderName(e.target.value); + const handleOrderDescriptionChange = (e) => + setOrderDescription(e.target.value); + const handleReasonForBuyingChange = (e) => setReasonForBuying(e.target.value); + + const handleSubmit = (e) => { + e.preventDefault(); + // Handle new order logic here + console.log('New order created:', { + orderName, + orderDescription, + reasonForBuying, + }); + }; + + // const guidelinesLink = ; + + return ( + + {/* Program Budget Field - Dropdown */} + +
+ Selected program budget: 4 +
+ {/* Link Field - Text Input */} + + {/* PPU Field - Text Input */} + + {/* Quantity Field - Text Input */} + + {/* Priority Level Field - Dropdown */} + + {/* Reason for Buying Field - Textarea */} +
+ +