Aller au contenu

Orders Cumin

v1.0

An order desk for a small spice shop: pick paid orders, press Mark packed and watch them step down the list in a warm saffron-on-roast look.

$69

Adresse de la page : /

Intégré

Ce que vous obtenez
  • Clair et sombreUtilise les couleurs de votre thème
  • Ordinateur, tablette et téléphoneLes écrans pour lesquels il est conçu
  • Paquets…
  • Taille du code…
  • Économe en batterie30 i/s, au repos quand rien ne bouge
  • Pause quand masquéHors écran ou autre onglet
  • Mouvement réduitCalme pour ceux qui le demandent

Vérifié à chaque modification

Sécurité vérifiée le 3 déc.
  • Vérification des typesTypeScript strict
  • Lint et formatESLint · Prettier
  • Tests et buildCaptures claires et sombres
  • Audit de sécuritéAucune vulnérabilité élevée ou critique
  • Ancienneté des paquetsChaque version publique depuis 7 jours ou plus
  • CPU au reposMoins d’un demi-cœur au repos, ≤ 30 i/s

Code

orders-cuminReact
  • orders-cumin.tsxThe page: the sections in order.
  • content.tsEvery word and number: brand, nav links, each section's copy and lists.
  • theme.tsThe colors as CSS variables, and the shared class strings.
  • README.mdHow to install it, and where to change the text, colors and form.
  • pagesOne file per page: the sections it shows, in order.
    • analytics.tsxAnalytics: sales by day over 7, 30 or 90 days (the chart morphs between ranges, the latest day in saffron), the range's revenue, orders, average order and refund rate against the range before, the top products, and sales by category and channel.
    • customers.tsxCustomers: everyone who has ordered, with their city, orders, what they spent and when they last ordered; search, sortable columns, and a click opens them in the side sheet.
    • orders.tsxOrders: every order with a status strip (All, Paid, Packed, Shipped, Delivered, Refunded, with counts), search and a channel filter, sortable columns, and bulk Mark packed / Mark shipped that step the picked rows in a cascade; new orders drop in at the top.
    • overview.tsxThe overview: a greeting with what is due before the pickup, the four numbers, the to-pack list beside the pickup and the low spices, then sales, best sellers and the live feed.
    • products.tsxProducts: the spice catalog with price, stock (stepped up or down in place, a bar against its reorder point) and what sold this week; search, a category and stock filter, sortable columns, and a click opens the product to edit.
    • returns.tsxReturns: each request with its order, item, reason and amount, filtered by stage (Requested, Approved, Restocked, Rejected); a request is approved (the money goes back) or rejected, and an approved one is restocked (the jar goes back on the shelf).
    • settings.tsxSettings: tabs for the store (name, cutoff, pickup), shipping rates, the team and appearance (theme and language), kept in the address (?tab=).
    • sign-in.tsxThe sign-in page (#/sign-in): the logo and the form on one card over the backdrop, without the sidebar and top bar; a quiet single card, like the rest of the shop.
  • sectionsOne file per page section.
    • account-menu.tsxThe account menu under the avatar in the top bar: who is signed in, Settings and Sign out; the arrow keys move through it, Escape, Tab or a click outside closes it.
    • appearance.tsxSettings → Appearance: the theme (System, Dark or Light), each choice shown as a small preview, and the language (System or one of locales/list.ts).
    • bottom-tabs.tsxThe phone's tab bar: Overview, Orders (with what is left to pack), Products and Customers, and More for the rest of the sidebar.
    • customer-form.tsxA customer's details as a form (name, email, city, a note), used to add one in a dialog and to edit one in the customer sheet.
    • customer-sheet.tsxOne customer in the side sheet: who they are and what they are worth, then tabs for their order history (each opens the order) and their details to edit or delete.
    • kpi-strip.tsxThe overview's four numbers: sales today (its hourly line the one saffron highlight), orders, the average order, and what is left to ship as a packed-versus-waiting bar; each rolls to its new value when an order lands or a batch is packed.
    • new-order.tsxTake an order by hand (a phone or wholesale order): the customer, the channel, the shipping rate and one or more spices with how many; the total updates as you go and the order lands at the top of To pack.
    • order-sheet.tsxOne order in the side sheet: who and when, the Paid → Packed → Shipped → Delivered track with the next step as one button, a refund, and tabs for the items, the timeline and the customer.
    • overview-panels.tsxThe overview's bottom row: sales for the last two weeks (today's bar in saffron), today's best sellers, and the live feed of what customers and the team just did.
    • pickup.tsxThe overview's right column: the carrier pickup (time left, how much of today's shipping is packed, who packed it) and the spices running low.
    • product-form.tsxA product to add or edit: name, size, SKU, category, price, stock and the point to reorder at; an existing one can be deleted after a confirm.
    • refund-dialog.tsxRefund an order: how many of each item, the shipping or not, whether the jars go back on the shelf, and a note; the amount updates as you choose and is never more than what is left to refund.
    • return-form.tsxLog a return request: the order (shipped or delivered ones), which item and how many, and why.
    • settings-rates.tsxSettings → Shipping: the shipping rates (zone, carrier, price, free above an order total, days in transit) to add, edit or delete.
    • settings-store.tsxSettings → Store and Team: the shop's name, email, order cutoff, carrier pickup and low-stock point; and the five people who run it, each with a role, plus inviting and removing teammates.
    • sidebar.tsxThe sidebar: logo, search with the command palette shortcut, the page links in two groups under a pill that glides to the current one (Orders, Products and Returns carry their live counts), and the live line with its pause at the foot; collapsed, only the icons show.
    • sign-in-form.tsxThe sign-in form: email and password with their errors under them, show or hide the password, keep me signed in, and the demo account to fill in; a wrong pair says so above the fields.
    • to-pack.tsxThe overview's to-pack list, the app's signature: pick paid orders and press Mark packed; the picked rows step to Packed one after another (their glyphs fill), then glide down into Packed today while the rest close up and every count rolls. New orders drop in at the top as they are paid.
    • top-bar.tsxThe top bar: the menu button on narrow screens, where you are, the page's one primary action, search, the theme switch and the account menu; it frosts over the page only once the page has scrolled.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • sheen.tsThe sheen card style: cards rise, plus one soft light sweep across each card as it lands.
      • rowsWhat several sections share.
        • center.tsThe center row motion: the middle row on screen rises first, then the ripple spreads up and down.
      • core.tsxThe page's build-in: on first load and on every page switch the cards arrive in the app's card style and their contents build: bars grow, lines draw, rings fill, the list rows on screen ripple in in the app's row motion, numbers count. The two picks are wired in ./index.ts.
      • index.tsThe app's two build-in picks, wired here and nowhere else: its card style (cards/) and its row motion (rows/). npm run new-app copies only the two it is given (--cards, --rows).
    • appearance.tsHow the app looks right now: dark or light, Glass or Solid, from Settings → Appearance, the page around it and the Style setting.
    • avatar.tsxA person's initials in a round badge, tinted with the primary.
    • backdrop.tsxThe ground behind the app: a faint saffron and tint glow, kept still; with followBackground it paints your background instead.
    • bar-chart.tsxA bar chart: bars grow in, and the picked bar (in the primary), its guide line and tooltip glide to the bar you point at or pick with the arrow keys; a new range morphs the bars instead of drawing them again.
    • bulk-bar.tsxThe bar that rises over a list once rows are picked: how many, the actions for all of them, and a way to drop the pick.
    • cascade.tsThe app's signature step: picked rows step to their next status one after another (each glyph fills, 70ms apart), then the list settles (`settle` moves them, FLIP glides the rest) while the save runs; with reduced motion they all step at once.
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • confirm.tsxA guarded action's second step: a small dialog that says what will happen, with Cancel and the action in red.
    • csv.tsExport CSV: turns rows into a CSV file and hands it to the browser to save.
    • dialog.tsxA centered modal dialog (a form, a confirm): rises in, plays its way out, Escape or a tap outside closes it, and the focus goes back where it was.
    • drawer.tsxA drawer from the right: a full-height native <dialog> for one thing's details (a client, an order). It springs in, slides out, closes on Esc, the close button or a click beside it, and keeps showing its thing while it slides away.
    • field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
    • filters.tsxA list's search and filters, all kept in the address: a search box, a select per filter, the active ones as chips that remove themselves, and Clear filters.
    • flip.tsFLIP for a list that re-sorts, filters or moves rows between groups: after each change every row that stayed glides from where it was to where it is now. Rows carry data-flip="<id>"; positions are measured inside the list (so a page scroll never reads as a move) and measured again when the list resizes, so a resize never reads as a move either.
    • format.tsHow numbers and dates are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."). Add a helper here when a page needs money, times or a list.
    • icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends.
    • language.tsThe app's language: the words every page reads (useWords), how dates and numbers are written (parts/format.ts) and the reading direction. Picked in Settings → Appearance (or System: the page's own language) and kept in this browser; English is built in, any other language loads only when it shows (locales/list.ts).
    • line-chart.tsxA line chart with a soft area under it, in the primary: the line draws itself in, the latest point marked, and new values roll the line to its new shape.
    • list-view.tsWhat a list does with its rows, whatever it looks like: the sort kept in the address (?sort=name&dir=asc), picked rows with shift-click ranges, pick all shown, and Show more.
    • live-clock.tsxOne shared clock for everything live: it ticks only while something on screen listens, the tab is visible and live isn't paused, and the bare button that pauses it. What a tick does (move the demo's time, bring in an event, reload) is the app's, passed to liveClock.
    • live.tsThe app's one live clock: every 9 seconds a customer checks out, every 14 a packer clears an order or the carrier drops one off, and every page reloads in place. It rests while nothing live is on screen, the tab is hidden or live is paused.
    • moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet and toasts play, timed by their moments in theme.ts.
    • motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
    • popover.tsxA menu that unfolds from its button (a row's actions, the alerts, a sort pick): drawn in the window layer so no table or card clips it; arrow keys walk it, Escape, Tab, a click outside or a scroll folds it away, and it plays its way out unless motion is reduced.
    • read.tsOne read of the fake API by its key, through useApi: useRead("overview"), useRead<"order">(`order:${id}`). Each key keeps one load function, so a page that mounts again finds its answer.
    • router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
    • scroll-to-view.tsScrolls an element into view moving only its own scroll container, never the page around it.
    • select-box.tsxA native select dressed to match the app: no browser arrow, a drawn chevron instead.
    • session.tsWhether someone is signed in: a first visit is signed in as the demo account; Sign out holds until the next sign-in, and a sign-in without Keep me signed in lasts only this tab.
    • sheet.tsxThe phone sheet: a modal panel that springs in from the left with the sidebar; Escape, a tap outside or its close button slides it away.
    • side-sheet.tsxThe side sheet: one order or customer slides in from the end edge over the page, with its own tabs under a gliding underline; Escape, a tap outside or the close button closes it, and it keeps showing its item while it slides away.
    • sparkline.tsxA small smooth line under a number (Catmull-Rom through the points, drawn as cubic Béziers, never a zigzag), in the primary when it is the one highlight and quiet grey otherwise; a new point extends it in place.
    • states.tsxThe data states every page shares: a calm skeleton while loading, an error with Try again, and an empty note with a way out.
    • status.tsxAn order's status as a glyph that fills step by step (an empty ring for Paid, half for Packed, three quarters for Shipped, a full check for Delivered, a struck ring for Refunded), so a status never shows by colour alone; it glides to its new fill when the status steps on.
    • store.tsThe app-wide state several parts share: the theme mode and style (kept in the browser) and the toasts.
    • ticker.tsxA number that counts up while its page builds in, and rolls to its new value whenever it changes.
    • toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
    • use-api.tsLoads data through the fake API with loading, error and retry, remembering each answer so a page you come back to shows at once.
    • use-dialog.tsOpens and closes a native <dialog> as a modal; on close it plays its way out first (data-closing), so dialogs, sheets and the palette never vanish in one frame.
  • dataThe pretend data and the fake API: swap it for your backend.
    • account.tsThe demo account: who is signed in (the account menu shows them) and the email and password the sign-in page takes.
    • api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
    • db.tsThe pretend database every read and save goes through: the catalog, customers, orders, returns, rates, team and store, plus each change a save makes (an order walking to Packed, a refund, stock put back). Wire your backend's writes here.
    • live.tsThe live demo: the shop working while you watch. A new order comes in now and then, and the packers clear the oldest paid orders, through the same database the pages read. Wire your backend's events (webhooks, a socket) here instead.
    • now.tsThe demo's "now": today at 2:20 pm plus the real time since the app loaded, so the shop is mid-afternoon and busy at any hour; every seeded time is set from it. Wire your backend and use the real time.
    • seed-orders.tsThe last seven days of orders, made the same way on every load (a fixed random seed): about 150 a day, busiest at lunch and in the evening, each walked through Paid, Packed, Shipped and Delivered by the time it would be. Also the returns and the morning's activity.
    • seed-people.tsThe shop's people: customers who order spices, the five staff who pack and answer, the shipping rates and the store's own settings.
    • seed-products.tsThe shop's catalog: spices by the jar and pouch, with price, stock and how often each sells.
    • types.tsThe shapes the fake API answers with: what a real backend would send.
    • views.tsWhat each page reads, worked out from the pretend database: the overview's numbers, the order list, one order, the catalog with what sold, customers with their history, returns, analytics by range and the settings. A real backend answers these from its own queries.
  • localesEvery word the app shows, one JSON file a language; list.ts names them.
    • en.jsonOne language's words, with the keys of en.json.
    • es.jsonOne language's words, with the keys of en.json.
    • list.tsThe languages the app offers, in the picker's order: one JSON file each, en.json the source. To remove one, delete its file and its line; to add one, copy es.json, translate it and add a line. English is built in; the rest load only when picked. TypeScript checks each file has en.json's keys, scripts/check/check-locales.mjs the rest (no extra keys, plural forms, {slots}).

orders-cumin.tsx

The page: the sections in order.

Chargement…
Idéal pour
Small online shops with a few staff who pack and ship a hundred-odd orders a day and want one calm place to run it.
Fonctionnement
Orders drop in live; pick a batch, Mark packed, and the rows step to Packed in a cascade while every count rolls.
Utilisation
Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.