Quotes Mallow
v1.0A minimal SaaS quoting app for an equipment sales team: configure products into quotes, get discounts approved and watch customers open them live, in blush neutrals with one raspberry accent.
صفحے کا پتہ: /
پہلے سے شامل
آپ کو کیا ملتا ہے- لائٹ اور ڈارکآپ کی تھیم کے رنگ استعمال کرتا ہے
- ڈیسک ٹاپ، ٹیبلٹ، اور فونوہ اسکرینز جن کے لیے یہ بنایا گیا
- پیکجز…
- کوڈ کا سائز…
- بیٹری پر ہلکا30 fps، ساکن ہو تو رک جاتا ہے
- چھپنے پر رک جاتا ہےاسکرین سے باہر یا دوسرا ٹیب
- کم حرکتجو لوگ کہیں ان کے لیے پرسکون
ہر تبدیلی پر جانچ
سکیورٹی جانچ 3 دسمبر- ٹائپ چیکTypeScript strict
- لنٹ اور فارمیٹESLint · Prettier
- ٹیسٹ اور بلڈلائٹ اور ڈارک اسکرین شاٹس
- سکیورٹی آڈٹکوئی ہائی یا کریٹیکل ایڈوائزری نہیں
- پیکج کی عمرہر ورژن 7+ دن سے عوامی
- فارغ CPUآرام میں آدھے کور سے کم، ≤ 30 fps
کوڈ
quotes-mallowReact
- quotes-mallow.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.
- approvals.tsxThe approvals queue: each discount over a rep's limit as a card (who asks, how much against the limit, the margin it leaves against the floor, their note) with a reply and Approve or Decline; the decided ones below a tab.
- customers.tsxThe customers list: search, each account's owner, quotes, open value, won value and win rate in 40px rows; a row opens its sheet (?c=<id>) with the quote history, and New customer opens the form.
- overview.tsxThe overview: the KPI strip (open quote value, win rate, awaiting approval, expiring), the quote funnel and the recent quotes beside the live activity feed.
- products.tsxThe product catalog: category filters with counts, search, and each product's glyph, list price, margin, options, rules and lead time; a row opens it in the product form (?p=<id>), New product opens a blank one.
- quote-builder.tsxThe quote builder (#/quotes/<id>): the quote's title, customer, template and expiry, its line items from the catalog, and the summary beside them where the totals roll and the margin gauge bends as the discount moves. A draft saves itself as you go; once it has gone out its lines lock.
- quotes.tsxThe quotes list: status filters with counts, search, sortable columns, picked rows with a bulk bar (duplicate, delete), and Show more. #/quotes/<id> opens the builder instead.
- reports.tsxReports: the year in four numbers, win rate and average discount by month, win rate by discount band (does a bigger discount win more?) and each rep's record.
- settings.tsxSettings in four tabs: approval rules (manager limit, margin floor), quote defaults (validity, tax, number prefix), each person's discount limit, and Appearance (theme and language).
- 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.
- templates.tsxTemplates: one card per quote layout with its preview, how many quotes use it, Make default and Edit (?t=<id>); New template opens a blank one.
- 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).
- bits.tsxThe small pieces every page shares: the page head, a quote's status badge, the filter links and the search box.
- bottom-tabs.tsxThe phone's tab bar: the four pages used most, and More for the rest (the sidebar in a sheet). It sticks to the bottom of the screen under the page.
- customer-sheet.tsxA customer's sheet (their contact, terms, totals and every quote they have had, with New quote) and the customer form for adding or editing one.
- feed.tsxThe activity feed: what customers and the team did, newest first; a live open slides in on top and the rest glide down.
- funnel.tsxThe quote funnel: the last 30 days' quotes stage by stage (drafted, sent, viewed, accepted), each bar as long as its count, with its value and how much of the drafted it kept.
- line-items.tsxThe builder's line items: each product with its glyph, an option picker per group, a quantity stepper and the line's price; a broken option rule shows under its line. An added line slides in, the rest glide to make room.
- margin-gauge.tsxThe margin gauge: a half dial from 0 to 60% margin whose arc bends and needle swings as the discount moves, with a tick at the margin floor; green above it with room, amber close to it, red under it.
- product-form.tsxThe product form in a sheet: name, SKU, category, price, cost and lead time, the option groups with their prices, and the rules between options (one needs another, two can't go together).
- product-picker.tsxThe product picker: the catalog in a dialog, searchable and filtered by category; Add puts the product on the quote with its default options and the dialog stays open for the next one.
- quote-actions.tsxWhat a quote can do next: a draft sends (or asks for approval when its discount is over the owner's limit), a quote out with the customer is marked accepted or declined, and any quote can be duplicated or deleted.
- quote-rows.tsxThe quote list every page shows: id and title, customer, status, views, expiry and value in 40px rows; on the Quotes page each row has a checkbox, the heads sort, and rows glide to their new places when the order changes. A quote a customer just opened flashes once.
- quote-summary.tsxThe builder's summary: the discount slider, the money rolling like an odometer (subtotal, discount, net, tax, total), the margin gauge bending with the discount, and what the discount needs (within the limit, approved, waiting, over).
- sidebar.tsxThe sidebar: the brand, search with the ⌘K shortcut, the pages in three groups with their counts and a pill that glides to the current one, and the live strap with its pause.
- 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.
- template-form.tsxThe template form in a sheet: name, layout, opening line and which blocks a quote shows, with the preview redrawn as you change them.
- template-preview.tsxA small drawing of a quote laid out with a template: cover band, opening line, lines (option prices on the itemized layout), total, terms and signature, each there only when the template has it.
- top-bar.tsxThe top bar: the menu button on tablets, where you are, the Live chip (it runs the live clock while it shows), New quote, the theme switch and the account menu. Nothing behind it at rest; it frosts once the page scrolls under it.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- flip.ts
- rowsWhat several sections share.
- rise.tsThe rise row motion: each row on screen rises 4px from faint.
- 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 backdrop: the app is Solid, so its own soft lights stay faded out (--quotes-mallow-glass is 0) and the still blush ground shows; 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.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
- 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.
- flip.tsFLIP for a list that re-sorts or filters: after each change every row that stayed glides from where it was to where it is now, and a new row slides in. Rows carry data-flip="<id>"; positions are measured inside the list, so a page scroll never reads as a move.
- format.tsHow numbers, money and dates are written: by Intl, the current language's way ("$29,800", "29.800 US$"; "Nov 19", "19 nov."; "4 min ago").
- icons.tsxThe logo, the line icons and the catalog's product glyphs, drawn on a 24-unit grid with round ends.
- kpi-strip.tsxThe KPI strip: four numbers in one bordered box, each with its line under it; a changed number rolls to its new value. The page passes every word.
- 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 few seconds a customer opens a quote (data/live.ts), the pages reload so counts, rows and the feed follow, and an accepted quote shows a toast. It runs only while the Live chip is on screen, the tab is visible and Live isn't 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.
- odometer.tsxA number that rolls like an odometer: each digit is a column of 0-9 that slides to its new place, so a total changing from $48,210 to $51,940 turns over digit by digit. Screen readers get the plain text.
- 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.
- pricing.tsHow a quote's money is worked out, the same in the fake API and in the builder while you drag: unit prices from a product and its picked options, totals, margin and whether the configuration breaks one of the product's rules.
- 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.
- 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.
- 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. Maren runs the sales team, so the approvals queue is hers.
- api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
- db.tsThe fake API's memory: copies of the seed that saves change, kept for the visit (a reload starts over), plus the lookups and totals every answer is built from.
- live.tsWhat customers do while you watch: a quote that went out gets opened, opened again, and now and then accepted. A real backend would push these (a webhook from the quote link); here one step runs on each live tick.
- now.tsThe demo's "now": today's real date at a busy hour (10:40 in the morning), moving on with real time, so today always has a full morning of activity.
- seed-catalog.tsThe pretend catalog and people of Northfield Air & Process, an industrial equipment dealer: products with option groups and rules, the 15-person sales team, customers, quote layouts and the team's settings.
- seed-quotes.tsThe pretend quotes: about a year of the team's work, newest first. The first 28 are hand-placed (open drafts, approvals waiting, quotes out with customers, a few expiring), the rest are the year behind them, and a monthly history feeds the reports.
- types.tsThe shapes the fake API answers with: the catalog, customers, quotes and their lines, approvals, templates and settings.
- views.tsWhat each page is answered with, built from the fake API's memory: quote rows, the overview, approvals, customers and the reports.
- 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}).
quotes-mallow.tsx
The page: the sections in order.
لوڈ ہو رہا ہے…
- کس کے لیے بہتر
- Sales teams that quote configurable products, need discounts over a limit approved and want to see when a quote is opened.
- یہ کیسے کام کرتا ہے
- Add a line and it slides in, totals roll like an odometer and the margin gauge bends as you drag the discount.
- استعمال کا طریقہ
- Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.