+
{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 (
-
-
- {
- updateItem.mutate({ itemId: item.id, completed: !item.completed })
- // Back to the input, so the next item can be typed right away.
- refocusNewItemInput()
- }}
- className="flex w-full cursor-pointer items-center gap-3 p-3 text-left disabled:cursor-default disabled:opacity-60"
- >
-
-
-
-
- {item.name}
-
- {item.quantity && (
- {item.quantity}
- )}
-
-
-
+ {
+ updateItem.mutate({ itemId: item.id, completed: !item.completed })
+ // Back to the input, so the next item can be typed right away.
+ refocusNewItemInput()
+ }}
+ className="hover:bg-muted/50 focus-visible:bg-muted/50 flex w-full cursor-pointer items-center gap-4 px-4 py-3.5 text-left outline-none transition-colors disabled:cursor-default disabled:opacity-60"
+ >
+
+
+
+
+ {item.name}
+
+ {item.quantity && (
+ {item.quantity}
+ )}
+
)
}
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 (
-
+
{NAV_ITEMS.map((item) => {
const active = isNavItemActive(pathname, item.to)
@@ -20,12 +20,15 @@ export function BottomNav() {
onClick={item.to === '/' ? () => focusNewItemInput(pathname) : undefined}
aria-current={active ? 'page' : undefined}
className={cn(
- 'flex flex-col items-center gap-1 rounded-md px-3 py-1.5 text-xs transition-colors',
- active ? 'text-foreground' : 'text-muted-foreground hover:text-foreground',
+ 'relative flex flex-col items-center gap-1 rounded-md px-3 py-1.5 text-xs transition-colors',
+ active ? 'text-primary font-medium' : 'text-muted-foreground hover:text-foreground',
)}
>
{item.title}
+ {active && (
+
+ )}
)
})}
diff --git a/apps/web/src/components/ui/input-group.tsx b/apps/web/src/components/ui/input-group.tsx
new file mode 100644
index 0000000..ece6377
--- /dev/null
+++ b/apps/web/src/components/ui/input-group.tsx
@@ -0,0 +1,142 @@
+import { cva, type VariantProps } from 'class-variance-authority'
+import { cn } from 'cn'
+import * as React from 'react'
+
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Textarea } from '@/components/ui/textarea'
+
+function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
+ return (
+ [data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',
+ className,
+ )}
+ {...props}
+ />
+ )
+}
+
+const inputGroupAddonVariants = cva(
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
+ {
+ variants: {
+ align: {
+ 'inline-start': 'order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]',
+ 'inline-end': 'order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]',
+ 'block-start':
+ 'order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2',
+ 'block-end':
+ 'order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2',
+ },
+ },
+ defaultVariants: {
+ align: 'inline-start',
+ },
+ },
+)
+
+function InputGroupAddon({
+ className,
+ align = 'inline-start',
+ ...props
+}: React.ComponentProps<'div'> & VariantProps
) {
+ return (
+ {
+ if ((e.target as HTMLElement).closest('button')) {
+ return
+ }
+ e.currentTarget.parentElement?.querySelector('input')?.focus()
+ }}
+ {...props}
+ />
+ )
+}
+
+const inputGroupButtonVariants = cva('flex items-center gap-2 text-sm shadow-none', {
+ variants: {
+ size: {
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
+ sm: '',
+ 'icon-xs': 'size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0',
+ 'icon-sm': 'size-8 p-0 has-[>svg]:p-0',
+ },
+ },
+ defaultVariants: {
+ size: 'xs',
+ },
+})
+
+function InputGroupButton({
+ className,
+ type = 'button',
+ variant = 'ghost',
+ size = 'xs',
+ ...props
+}: Omit
, 'size'> &
+ VariantProps) {
+ return (
+
+ )
+}
+
+function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {
+ return (
+
+ )
+}
+
+function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>) {
+ return (
+
+ )
+}
+
+function InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>) {
+ return (
+
+ )
+}
+
+export {
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton,
+ InputGroupInput,
+ InputGroupText,
+ InputGroupTextarea,
+}
diff --git a/apps/web/src/components/ui/progress.tsx b/apps/web/src/components/ui/progress.tsx
new file mode 100644
index 0000000..0dce4b8
--- /dev/null
+++ b/apps/web/src/components/ui/progress.tsx
@@ -0,0 +1,28 @@
+import { cn } from 'cn'
+import { Progress as ProgressPrimitive } from 'radix-ui'
+import * as React from 'react'
+
+function Progress({
+ className,
+ value,
+ ...props
+}: React.ComponentProps) {
+ return (
+
+
+
+ )
+}
+
+export { Progress }
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 6cc085d..9f7fccf 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -49,72 +49,74 @@
}
:root {
- --background: oklch(1 0 0);
- --foreground: oklch(0.145 0 0);
- --card: oklch(1 0 0);
- --card-foreground: oklch(0.145 0 0);
- --popover: oklch(1 0 0);
- --popover-foreground: oklch(0.145 0 0);
- --primary: oklch(0.205 0 0);
- --primary-foreground: oklch(0.985 0 0);
- --secondary: oklch(0.97 0 0);
- --secondary-foreground: oklch(0.205 0 0);
- --muted: oklch(0.97 0 0);
- --muted-foreground: oklch(0.556 0 0);
- --accent: oklch(0.97 0 0);
- --accent-foreground: oklch(0.205 0 0);
- --destructive: oklch(0.577 0.245 27.325);
- --border: oklch(0.922 0 0);
- --input: oklch(0.922 0 0);
- --ring: oklch(0.708 0 0);
- --chart-1: oklch(0.87 0 0);
- --chart-2: oklch(0.556 0 0);
- --chart-3: oklch(0.439 0 0);
- --chart-4: oklch(0.371 0 0);
- --chart-5: oklch(0.269 0 0);
- --radius: 0.625rem;
- --sidebar: oklch(0.985 0 0);
- --sidebar-foreground: oklch(0.145 0 0);
- --sidebar-primary: oklch(0.205 0 0);
- --sidebar-primary-foreground: oklch(0.985 0 0);
- --sidebar-accent: oklch(0.97 0 0);
- --sidebar-accent-foreground: oklch(0.205 0 0);
- --sidebar-border: oklch(0.922 0 0);
- --sidebar-ring: oklch(0.708 0 0);
+ /* Warm paper background, white cards and a grocery green as the accent. */
+ --background: oklch(0.982 0.004 91);
+ --foreground: oklch(0.17 0.005 90);
+ --card: oklch(0.997 0.002 91);
+ --card-foreground: oklch(0.17 0.005 90);
+ --popover: oklch(0.997 0.002 91);
+ --popover-foreground: oklch(0.17 0.005 90);
+ --primary: oklch(0.52 0.13 147);
+ --primary-foreground: oklch(0.99 0.01 147);
+ --secondary: oklch(0.95 0.007 91);
+ --secondary-foreground: oklch(0.24 0.005 90);
+ --muted: oklch(0.95 0.007 91);
+ --muted-foreground: oklch(0.52 0.008 90);
+ --accent: oklch(0.94 0.025 147);
+ --accent-foreground: oklch(0.36 0.09 147);
+ --destructive: oklch(0.577 0.215 27.325);
+ --border: oklch(0.915 0.007 91);
+ --input: oklch(0.9 0.008 91);
+ --ring: oklch(0.52 0.13 147);
+ --chart-1: oklch(0.52 0.13 147);
+ --chart-2: oklch(0.65 0.13 150);
+ --chart-3: oklch(0.75 0.12 85);
+ --chart-4: oklch(0.6 0.12 45);
+ --chart-5: oklch(0.45 0.05 200);
+ --radius: 0.875rem;
+ --sidebar: oklch(0.97 0.005 91);
+ --sidebar-foreground: oklch(0.17 0.005 90);
+ --sidebar-primary: oklch(0.52 0.13 147);
+ --sidebar-primary-foreground: oklch(0.99 0.01 147);
+ --sidebar-accent: oklch(0.94 0.025 147);
+ --sidebar-accent-foreground: oklch(0.36 0.09 147);
+ --sidebar-border: oklch(0.915 0.007 91);
+ --sidebar-ring: oklch(0.52 0.13 147);
}
.dark {
- --background: oklch(0.145 0 0);
- --foreground: oklch(0.985 0 0);
- --card: oklch(0.205 0 0);
- --card-foreground: oklch(0.985 0 0);
- --popover: oklch(0.205 0 0);
- --popover-foreground: oklch(0.985 0 0);
- --primary: oklch(0.922 0 0);
- --primary-foreground: oklch(0.205 0 0);
- --secondary: oklch(0.269 0 0);
- --secondary-foreground: oklch(0.985 0 0);
- --muted: oklch(0.269 0 0);
- --muted-foreground: oklch(0.708 0 0);
- --accent: oklch(0.269 0 0);
- --accent-foreground: oklch(0.985 0 0);
+ /* Deep green-tinted charcoal; the green is lifted so it reads on dark. */
+ --background: oklch(0.165 0.008 155);
+ --foreground: oklch(0.95 0.006 95);
+ --card: oklch(0.21 0.01 155);
+ --card-foreground: oklch(0.95 0.006 95);
+ --popover: oklch(0.23 0.01 155);
+ --popover-foreground: oklch(0.95 0.006 95);
+ --primary: oklch(0.72 0.16 148);
+ --primary-foreground: oklch(0.2 0.04 150);
+ --secondary: oklch(0.26 0.01 155);
+ --secondary-foreground: oklch(0.95 0.006 95);
+ --muted: oklch(0.255 0.01 155);
+ --muted-foreground: oklch(0.7 0.012 120);
+ --accent: oklch(0.3 0.045 150);
+ --accent-foreground: oklch(0.88 0.08 148);
--destructive: oklch(0.704 0.191 22.216);
- --border: oklch(1 0 0 / 10%);
- --input: oklch(1 0 0 / 15%);
- --ring: oklch(0.556 0 0);
- --chart-1: oklch(0.87 0 0);
- --chart-2: oklch(0.556 0 0);
- --chart-3: oklch(0.439 0 0);
- --chart-4: oklch(0.371 0 0);
- --chart-5: oklch(0.269 0 0);
- --sidebar: oklch(0.205 0 0);
- --sidebar-foreground: oklch(0.985 0 0);
- --sidebar-primary: oklch(0.488 0.243 264.376);
- --sidebar-primary-foreground: oklch(0.985 0 0);
- --sidebar-accent: oklch(0.269 0 0);
- --sidebar-accent-foreground: oklch(0.985 0 0);
- --sidebar-border: oklch(1 0 0 / 10%);
- --sidebar-ring: oklch(0.556 0 0);
+ --border: oklch(1 0 0 / 9%);
+ --input: oklch(1 0 0 / 14%);
+ --ring: oklch(0.72 0.16 148);
+ --chart-1: oklch(0.72 0.16 148);
+ --chart-2: oklch(0.62 0.13 150);
+ --chart-3: oklch(0.8 0.12 85);
+ --chart-4: oklch(0.7 0.12 45);
+ --chart-5: oklch(0.65 0.06 200);
+ --sidebar: oklch(0.19 0.009 155);
+ --sidebar-foreground: oklch(0.95 0.006 95);
+ --sidebar-primary: oklch(0.72 0.16 148);
+ --sidebar-primary-foreground: oklch(0.2 0.04 150);
+ --sidebar-accent: oklch(0.3 0.045 150);
+ --sidebar-accent-foreground: oklch(0.88 0.08 148);
+ --sidebar-border: oklch(1 0 0 / 9%);
+ --sidebar-ring: oklch(0.72 0.16 148);
}
@layer base {
diff --git a/apps/web/src/routes/_authenticated/index.tsx b/apps/web/src/routes/_authenticated/index.tsx
index c99b566..bf309ae 100644
--- a/apps/web/src/routes/_authenticated/index.tsx
+++ b/apps/web/src/routes/_authenticated/index.tsx
@@ -3,6 +3,7 @@ import { PlusIcon, ShoppingCartIcon } from 'lucide-react'
import { CreateItemForm } from '@/components/items/create-item-form'
import { ItemList } from '@/components/items/item-list'
+import { ListProgress } from '@/components/items/list-progress'
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
import { Button } from '@/components/ui/button'
import { Card, CardContent } from '@/components/ui/card'
@@ -51,6 +52,8 @@ function HomePage() {
return (
+
+
diff --git a/apps/web/src/routes/_authenticated/lists/$listId/index.tsx b/apps/web/src/routes/_authenticated/lists/$listId/index.tsx
index 4821b5d..610eb11 100644
--- a/apps/web/src/routes/_authenticated/lists/$listId/index.tsx
+++ b/apps/web/src/routes/_authenticated/lists/$listId/index.tsx
@@ -2,6 +2,7 @@ import { createFileRoute } from '@tanstack/react-router'
import { CreateItemForm } from '@/components/items/create-item-form'
import { ItemList } from '@/components/items/item-list'
+import { ListProgress } from '@/components/items/list-progress'
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
import { Skeleton } from '@/components/ui/skeleton'
import { itemsQueryOptions } from '@/hooks/use-items'
@@ -49,6 +50,8 @@ function ListItemsPage() {
return (
+
+
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 64fdf4c..0031b9b 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -30,8 +30,8 @@ export default defineConfig({
scope: '/',
display: 'standalone',
orientation: 'portrait',
- theme_color: '#ffffff',
- background_color: '#ffffff',
+ theme_color: '#f9f8f5',
+ background_color: '#f9f8f5',
icons: [
{ src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' },
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },