From 812d4b71701ce54d38c31dc2c4dee92857102e4d Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Mon, 19 Oct 2026 14:55:48 -0300 Subject: [PATCH] feat(web): green, warm-paper theme with a matching dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - New light palette (warm off-white background, white cards, grocery green primary) and a green-tinted charcoal dark mode; larger radius. - Items render as one grouped card; bought items live in a collapsible "Comprados · N" card with a muted header. - Pill-shaped add-item input (shadcn input-group) with a round add button. - Progress summary ("N pendientes · M comprados" + bar) above the input. - Active bottom-nav item uses the primary color with a dot. - theme-color metas and PWA manifest follow the new background. Co-Authored-By: Claude Opus 5.5 --- apps/web/index.html | 4 +- .../src/components/items/bought-item-list.tsx | 44 +++--- .../src/components/items/create-item-form.tsx | 55 ++++--- apps/web/src/components/items/item-list.tsx | 32 ++-- apps/web/src/components/items/item-row.tsx | 77 +++++----- .../src/components/items/list-progress.tsx | 39 +++++ apps/web/src/components/layout/bottom-nav.tsx | 9 +- apps/web/src/components/ui/input-group.tsx | 142 ++++++++++++++++++ apps/web/src/components/ui/progress.tsx | 28 ++++ apps/web/src/index.css | 126 ++++++++-------- apps/web/src/routes/_authenticated/index.tsx | 3 + .../_authenticated/lists/$listId/index.tsx | 3 + apps/web/vite.config.ts | 4 +- 13 files changed, 399 insertions(+), 167 deletions(-) create mode 100644 apps/web/src/components/items/list-progress.tsx create mode 100644 apps/web/src/components/ui/input-group.tsx create mode 100644 apps/web/src/components/ui/progress.tsx diff --git a/apps/web/index.html b/apps/web/index.html index a126cf5..f8d8187 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -8,8 +8,8 @@ name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> - - + + diff --git a/apps/web/src/components/items/bought-item-list.tsx b/apps/web/src/components/items/bought-item-list.tsx index cb9d308..450f75f 100644 --- a/apps/web/src/components/items/bought-item-list.tsx +++ b/apps/web/src/components/items/bought-item-list.tsx @@ -1,6 +1,7 @@ import type { ListItem } from '@superlist/shared' import { ChevronDownIcon } from 'lucide-react' +import { Card } from '@/components/ui/card' import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible' import type { useUpdateItem } from '@/hooks/use-items' @@ -13,30 +14,31 @@ type BoughtItemListProps = { } /** - * Collapsible "Comprados hoy" section below the pending items. Expanded by - * default so marking an item visibly moves it down; the user can fold it. - * Tapping an item here un-buys it and it returns to the pending list. + * Collapsible "Comprados" card below the pending items. Expanded by default so + * marking an item visibly moves it down; the user can fold it. Tapping an item + * here un-buys it and it returns to the pending list. */ export function BoughtItemList({ items, updateItem, savingIds }: BoughtItemListProps) { return ( - - - - Comprados hoy - ({items.length}) - - -
    - {items.map((item) => ( - - ))} -
-
+ + + + + Comprados · {items.length} + + +
    + {items.map((item) => ( + + ))} +
+
+
) } diff --git a/apps/web/src/components/items/create-item-form.tsx b/apps/web/src/components/items/create-item-form.tsx index 8aa2d4a..6fbc5bd 100644 --- a/apps/web/src/components/items/create-item-form.tsx +++ b/apps/web/src/components/items/create-item-form.tsx @@ -1,11 +1,15 @@ import { zodResolver } from '@hookform/resolvers/zod' -import { PlusIcon } from 'lucide-react' +import { PlusIcon, SearchIcon } from 'lucide-react' import { useForm } from 'react-hook-form' import { z } from 'zod' -import { Button } from '@/components/ui/button' import { Field, FieldError } from '@/components/ui/field' -import { Input } from '@/components/ui/input' +import { + InputGroup, + InputGroupAddon, + InputGroupButton, + InputGroupInput, +} from '@/components/ui/input-group' import { useCreateItem } from '@/hooks/use-items' import { ApiError } from '@/lib/api-client' @@ -70,23 +74,36 @@ export function CreateItemForm({ listId, autoFocus = false }: CreateItemFormProp }) return ( -
- - - + + + + + + + + + + + + + + - - ) } diff --git a/apps/web/src/components/items/item-list.tsx b/apps/web/src/components/items/item-list.tsx index ffed105..507eaa2 100644 --- a/apps/web/src/components/items/item-list.tsx +++ b/apps/web/src/components/items/item-list.tsx @@ -2,7 +2,6 @@ import { ShoppingBasketIcon } from 'lucide-react' import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' import { Card, CardContent } from '@/components/ui/card' -import { Separator } from '@/components/ui/separator' import { Skeleton } from '@/components/ui/skeleton' import { useItems, usePendingItemUpdates, useUpdateItem } from '@/hooks/use-items' import { useListEvents } from '@/hooks/use-list-events' @@ -19,7 +18,7 @@ type ItemListProps = { /** * Items loaded from the API, pending ones first. Tapping an item marks it as - * bought; bought items move to a collapsible "Comprados hoy" section below + * bought; bought items move to a collapsible "Comprados" card below * and are only shown on the day they were bought. */ export function ItemList({ listId }: ItemListProps) { @@ -75,25 +74,24 @@ export function ItemList({ listId }: ItemListProps) { } return ( -
+
{pending.length > 0 && ( -
    - {pending.map((item) => ( - - ))} -
+ +
    + {pending.map((item) => ( + + ))} +
+
)} {boughtToday.length > 0 && ( - <> - {pending.length > 0 && } - - + )}
) diff --git a/apps/web/src/components/items/item-row.tsx b/apps/web/src/components/items/item-row.tsx index b5b25ec..187c428 100644 --- a/apps/web/src/components/items/item-row.tsx +++ b/apps/web/src/components/items/item-row.tsx @@ -2,7 +2,6 @@ import type { ListItem } from '@superlist/shared' import { CheckIcon } from 'lucide-react' import { refocusNewItemInput } from '@/components/items/create-item-form' -import { Card, CardContent } from '@/components/ui/card' import { isOptimisticItem, type useUpdateItem } from '@/hooks/use-items' import { cn } from '@/lib/utils' @@ -13,49 +12,45 @@ type ItemRowProps = { isSaving: boolean } -/** A single item row: tapping it toggles its bought state. */ +/** A single item row inside a grouped card: tapping it toggles its bought state. */ export function ItemRow({ item, updateItem, isSaving }: ItemRowProps) { return (
  • - - - - - +
  • ) } diff --git a/apps/web/src/components/items/list-progress.tsx b/apps/web/src/components/items/list-progress.tsx new file mode 100644 index 0000000..3849cfe --- /dev/null +++ b/apps/web/src/components/items/list-progress.tsx @@ -0,0 +1,39 @@ +import { Progress } from '@/components/ui/progress' +import { useItems } from '@/hooks/use-items' +import { useToday } from '@/hooks/use-today' +import { splitItems } from '@/lib/items' + +type ListProgressProps = { + listId: string +} + +/** + * "4 pendientes · 7 comprados" plus a bar for today's progress. Reads the items + * query the list already loads, so it adds no request; renders nothing until + * the items are in or when the list is empty. + */ +export function ListProgress({ listId }: ListProgressProps) { + const { data: items } = useItems(listId) + const today = useToday() + + if (!items) return null + + const { pending, boughtToday } = splitItems(items, today) + const total = pending.length + boughtToday.length + + if (total === 0) return null + + return ( +
    +

    + {pending.length} {pending.length === 1 ? 'pendiente' : 'pendientes'} · {boughtToday.length}{' '} + {boughtToday.length === 1 ? 'comprado' : 'comprados'} +

    + +
    + ) +} diff --git a/apps/web/src/components/layout/bottom-nav.tsx b/apps/web/src/components/layout/bottom-nav.tsx index 359a801..54a6c6a 100644 --- a/apps/web/src/components/layout/bottom-nav.tsx +++ b/apps/web/src/components/layout/bottom-nav.tsx @@ -9,7 +9,7 @@ export function BottomNav() { return (