From 4045baaa04a02eca0fe0b0a6669d2d8070e099a3 Mon Sep 17 00:00:00 2001 From: Emily Tiry <7997357+etiry@users.noreply.github.com> Date: Sat, 6 Apr 2024 20:36:10 -0400 Subject: [PATCH] List and Manage List styling (#63) * List name header styling and component * Heading bottom margin and share list styling * List header bottom margin * Moved colors object in theme into extend to allow use of Tailwind colors * Delete List button styling * Added tailwindcss-forms plugin, basic list item styling without purchase urgency pill * Created dynamic list item urgency label as component, added hover color to palette, changed urgency return 'Kind of soon' to 'Kinda soon' * Urgency label text styling, list item wrapping * Adjusted responsiveness for label and delete button * Cleaned up List view logic * Added no listpath logic for ManageList view, match header section nesting in List and ManageList views * List view filter styling * Added default icon to list item names * WIP - Style add item form * Finish styling add item form * Adjusted new item and filter form input widths, filter form button responsive styling * Refactored ListItem with grid for better aesthetics, removed unneeded code from AddItem, refactored grid templates for tiny screen size into one. * Changed all form input backgrounds to default white --------- Co-authored-by: andiedoescode Co-authored-by: Andrea Pang <98671035+andiedoescode@users.noreply.github.com> --- package-lock.json | 22 ++++++++ package.json | 1 + src/components/AddItem.jsx | 62 +++++++++++++---------- src/components/ListHeader.jsx | 7 +++ src/components/ListItem.jsx | 44 +++++++++------- src/components/UrgencyLabel.jsx | 32 ++++++++++++ src/utils/hooks.js | 2 +- src/views/Layout.jsx | 8 +-- src/views/List.jsx | 89 ++++++++++++++++++--------------- src/views/ManageList.jsx | 79 ++++++++++++++++++++++------- tailwind.config.js | 30 +++++++---- 11 files changed, 260 insertions(+), 116 deletions(-) create mode 100644 src/components/ListHeader.jsx create mode 100644 src/components/UrgencyLabel.jsx diff --git a/package-lock.json b/package-lock.json index b1fd255..4af87de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@nabla/vite-plugin-eslint": "^1.5.0", + "@tailwindcss/forms": "^0.5.7", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", @@ -3856,6 +3857,18 @@ "@svgr/core": "*" } }, + "node_modules/@tailwindcss/forms": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", + "integrity": "sha512-QE7X69iQI+ZXwldE+rzasvbJiyV/ju1FGHH0Qn2W3FKbuYtqp8LKcy6iSw79fVUT5/Vvf+0XgLCeYVG+UV6hOw==", + "dev": true, + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" + } + }, "node_modules/@testing-library/dom": { "version": "9.3.4", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.4.tgz", @@ -9234,6 +9247,15 @@ "node": ">=4" } }, + "node_modules/mini-svg-data-uri": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", + "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==", + "dev": true, + "bin": { + "mini-svg-data-uri": "cli.js" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", diff --git a/package.json b/package.json index eb94608..aa863ba 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.21.11", "@nabla/vite-plugin-eslint": "^1.5.0", + "@tailwindcss/forms": "^0.5.7", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", diff --git a/src/components/AddItem.jsx b/src/components/AddItem.jsx index ec830c5..1771a21 100644 --- a/src/components/AddItem.jsx +++ b/src/components/AddItem.jsx @@ -48,34 +48,44 @@ export function AddItem({ data, listPath }) { }; return ( -
-
-