@tallyui/components 3.11.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +230 -17
- package/dist/index.js +2207 -1286
- package/package.json +9 -9
- package/src/fonts/font-provider.tsx +65 -0
- package/src/fonts/index.ts +1 -0
- package/src/index.ts +23 -1
- package/src/order/index.ts +2 -0
- package/src/order/refund-form.tsx +204 -0
- package/src/order/refund-modal.tsx +32 -0
- package/src/register/closure-sheet.tsx +11 -1
- package/src/reports/cards.tsx +197 -0
- package/src/reports/filters-bar.tsx +95 -0
- package/src/reports/hero.tsx +111 -0
- package/src/reports/index.ts +4 -0
- package/src/reports/sales-room.tsx +28 -0
- package/src/sale/cart.tsx +7 -2
- package/src/sale/catalogue.tsx +44 -4
- package/src/sale/index.ts +1 -0
- package/src/sale/open-sale-tabs.tsx +67 -0
- package/src/sale/order-reference.ts +3 -0
- package/src/sale/orders-list.tsx +17 -3
- package/src/sale/receipt.tsx +47 -22
- package/src/scale/index.ts +3 -0
- package/src/scale/scale-provider.tsx +70 -0
- package/src/scale/use-pointer.ts +23 -0
- package/src/settings/display-settings.tsx +122 -0
- package/src/settings/index.ts +1 -0
- package/src/ui/text/font-text.tsx +25 -0
- package/src/ui/text/index.tsx +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
8
8
|
import { SvgProps } from 'react-native-svg';
|
|
9
9
|
import { Separator as Separator$1, Label as Label$1, Tabs as Tabs$1, Dialog as Dialog$1, AlertDialog as AlertDialog$1, Select as Select$1, Combobox as Combobox$1, DropdownMenu as DropdownMenu$1, ContextMenu as ContextMenu$1, Popover as Popover$1, Tooltip as Tooltip$1, HoverCard as HoverCard$1, Accordion as Accordion$1, Collapsible as Collapsible$1, Checkbox as Checkbox$1, Switch as Switch$1, RadioGroup as RadioGroup$1, Toggle as Toggle$1, ToggleGroup as ToggleGroup$1, Progress as Progress$1, Slider as Slider$1, Image } from '@tallyui/primitives';
|
|
10
10
|
export { TextClassContext } from '@tallyui/primitives';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { ScaleOverride, ScaleVariables, ScaleStep, Pointer, TypeSetId, ThemeFontFamily, ThemeType } from '@tallyui/theme';
|
|
12
|
+
import { CatalogueView, ProductSortValue, ProductSort, RefundableOrderLine, EarlierRefund, useRegisterSession, RegisterSession, MovementType, AppSettings, useAppSettings, useSale, AppliedDiscount, Discount, CatalogueEntry, CatalogueViewState, SentOrder, PosOrder, ReceiptData, OutboxState, ParkedOrderSummary, OpenSale, SalesFigures, DatePreset, DayRange } from '@tallyui/pos';
|
|
13
|
+
import { ProductTraits, TraitContext, Money, CustomerTraits, Customer, CustomerInput, OrderRefundPayload, ProductCategory, SyncNotice, StoreSettingsChoices, StoreSettingsChoice } from '@tallyui/core';
|
|
13
14
|
|
|
14
15
|
declare const textVariants: (props?: ({
|
|
15
16
|
variant?: "link" | "default" | null | undefined;
|
|
@@ -17,7 +18,7 @@ declare const textVariants: (props?: ({
|
|
|
17
18
|
type TextProps = React$1.ComponentPropsWithoutRef<typeof Text$1> & VariantProps<typeof textVariants> & {
|
|
18
19
|
asChild?: boolean;
|
|
19
20
|
};
|
|
20
|
-
declare function Text({ className, variant, asChild, children, ...props }: TextProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function Text({ className, variant, asChild, children, maxFontSizeMultiplier, ...props }: TextProps): react_jsx_runtime.JSX.Element;
|
|
21
22
|
|
|
22
23
|
declare const hstackVariants: (props?: ({
|
|
23
24
|
space?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
@@ -325,6 +326,33 @@ declare const TableRow: React$1.ForwardRefExoticComponent<ViewProps & React$1.Re
|
|
|
325
326
|
declare const TableHead: React$1.ForwardRefExoticComponent<ViewProps & React$1.RefAttributes<View>>;
|
|
326
327
|
declare const TableCell: React$1.ForwardRefExoticComponent<ViewProps & React$1.RefAttributes<View>>;
|
|
327
328
|
|
|
329
|
+
/**
|
|
330
|
+
* Port of WCPOS v2 `packages/core/src/contexts/scale/index.tsx` and
|
|
331
|
+
* `packages/components/src/lib/device.ts`.
|
|
332
|
+
* The native scope is a prop so components do not depend on Uniwind's ScopedVariables.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
interface ScaleScopeProps {
|
|
336
|
+
variables: ScaleVariables;
|
|
337
|
+
children?: React$1.ReactNode;
|
|
338
|
+
}
|
|
339
|
+
interface ScaleState {
|
|
340
|
+
step: ScaleStep;
|
|
341
|
+
pointer: Pointer;
|
|
342
|
+
variables: ScaleVariables;
|
|
343
|
+
}
|
|
344
|
+
interface ScaleProviderProps {
|
|
345
|
+
/** The app's stored `ui.scale` setting (from `useAppSettings` in `@tallyui/pos`); missing or unknown means Auto. */
|
|
346
|
+
scale?: ScaleOverride | null;
|
|
347
|
+
/** Scopes the variables below it on native, e.g. Uniwind's ScopedVariables. Optional: the web root mirror covers the web. */
|
|
348
|
+
scope?: React$1.ComponentType<ScaleScopeProps>;
|
|
349
|
+
children?: React$1.ReactNode;
|
|
350
|
+
}
|
|
351
|
+
declare function ScaleProvider({ scale, scope: Scope, children }: ScaleProviderProps): React$1.JSX.Element;
|
|
352
|
+
declare function useScale(): ScaleState;
|
|
353
|
+
|
|
354
|
+
declare function usePointer(): Pointer;
|
|
355
|
+
|
|
328
356
|
interface ProductTitleProps extends Omit<TextProps, 'children'> {
|
|
329
357
|
/** The raw RxDB product document (connector-specific shape) */
|
|
330
358
|
doc: any;
|
|
@@ -982,6 +1010,49 @@ interface OrderDetailProps extends Omit<ViewProps, 'children'> {
|
|
|
982
1010
|
}
|
|
983
1011
|
declare function OrderDetail({ orderNumber, status, lineItems, subtotal, tax, total, customerSlot, paymentSlot, footerSlot, className, ...viewProps }: OrderDetailProps): react_jsx_runtime.JSX.Element;
|
|
984
1012
|
|
|
1013
|
+
/** What the form hands back: the order.refund v1 payload minus the ids, session and clock the caller adds. */
|
|
1014
|
+
type RefundFormValue = Pick<OrderRefundPayload, 'lines' | 'shippingMinor' | 'adjustmentMinor' | 'totalMinor' | 'destination' | 'reason'>;
|
|
1015
|
+
interface RefundFormProps {
|
|
1016
|
+
/** The order's lines; a StoreOrderLine fits. */
|
|
1017
|
+
lines: ReadonlyArray<RefundableOrderLine & {
|
|
1018
|
+
name: string;
|
|
1019
|
+
}>;
|
|
1020
|
+
/** Earlier refunds' lines, subtracted by order line id. */
|
|
1021
|
+
refunds: readonly EarlierRefund[];
|
|
1022
|
+
currency: string;
|
|
1023
|
+
/** The order number the store shows, for the confirmation. */
|
|
1024
|
+
orderReference: string;
|
|
1025
|
+
/** The order total with tax. */
|
|
1026
|
+
orderTotalMinor: number;
|
|
1027
|
+
/** Money already refunded on the order, positive; default 0. */
|
|
1028
|
+
refundedMinor?: number;
|
|
1029
|
+
/** Shipping still refundable, with tax; 0 or absent hides the shipping field. */
|
|
1030
|
+
refundableShippingMinor?: number;
|
|
1031
|
+
/** The sale's payment method; omit for a cash sale, which always refunds in cash. */
|
|
1032
|
+
originalMethod?: {
|
|
1033
|
+
title: string;
|
|
1034
|
+
available: boolean;
|
|
1035
|
+
};
|
|
1036
|
+
/** Each line's restock starting value; default true. */
|
|
1037
|
+
defaultRestock?: boolean;
|
|
1038
|
+
/** Refunds are online only (ADR-080); false disables confirming. Default true. */
|
|
1039
|
+
online?: boolean;
|
|
1040
|
+
/** A refusal from the caller's last attempt, shown above the actions. */
|
|
1041
|
+
error?: string;
|
|
1042
|
+
/** Called once per confirmation; the form stays busy until a returned promise settles. */
|
|
1043
|
+
onConfirm: (refund: RefundFormValue) => void | Promise<unknown>;
|
|
1044
|
+
onCancel: () => void;
|
|
1045
|
+
}
|
|
1046
|
+
/** Ports WCPOS v2 form.tsx, monorepo main 5ac185b0e; the till never prices lines itself (priceRefund). */
|
|
1047
|
+
declare function RefundForm({ lines, refunds, currency, orderReference, orderTotalMinor, refundedMinor, refundableShippingMinor, originalMethod, defaultRestock, online, error, onConfirm, onCancel, }: RefundFormProps): JSX.Element;
|
|
1048
|
+
|
|
1049
|
+
interface RefundModalProps extends Omit<RefundFormProps, 'onCancel'> {
|
|
1050
|
+
open: boolean;
|
|
1051
|
+
onOpenChange: (open: boolean) => void;
|
|
1052
|
+
}
|
|
1053
|
+
/** Ports WCPOS v2 modal.tsx: a bounded panel around the refund form. */
|
|
1054
|
+
declare function RefundModal({ open, onOpenChange, ...formProps }: RefundModalProps): JSX.Element;
|
|
1055
|
+
|
|
985
1056
|
interface Denomination {
|
|
986
1057
|
label: string;
|
|
987
1058
|
value: number;
|
|
@@ -1274,8 +1345,16 @@ interface ConnectorStatusProps extends Omit<ViewProps, 'children'> {
|
|
|
1274
1345
|
}
|
|
1275
1346
|
declare function ConnectorStatus({ name, status, lastSync, error, className, unsoldCount, unsoldStale, formatUnsold, ...viewProps }: ConnectorStatusProps): react_jsx_runtime.JSX.Element;
|
|
1276
1347
|
|
|
1348
|
+
interface DisplaySettingsProps {
|
|
1349
|
+
/** The hook's settings: `<DisplaySettings {...useAppSettings(db.app_settings)} />`. */
|
|
1350
|
+
settings: Pick<AppSettings, 'ui.theme' | 'ui.scale' | 'ui.font'>;
|
|
1351
|
+
setSetting: ReturnType<typeof useAppSettings>['setSetting'];
|
|
1352
|
+
className?: string;
|
|
1353
|
+
}
|
|
1354
|
+
declare function DisplaySettings({ settings, setSetting, className }: DisplaySettingsProps): JSX.Element;
|
|
1355
|
+
|
|
1277
1356
|
/** `taxLabel` names each tax row; VAT isn't universal, so a platform passes its own (medusapos passes `VAT ${rate}%`). */
|
|
1278
|
-
declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, taxClasses, afterSubtotal }: {
|
|
1357
|
+
declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, taxClasses, afterSubtotal, couponDiscountMinor }: {
|
|
1279
1358
|
sale: ReturnType<typeof useSale>;
|
|
1280
1359
|
taxLabel?: (ratePpm: number) => string;
|
|
1281
1360
|
taxClasses?: ReadonlyArray<{
|
|
@@ -1293,6 +1372,10 @@ declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, taxClasses,
|
|
|
1293
1372
|
}) => void;
|
|
1294
1373
|
/** Rows under the totals' Subtotal, e.g. the platform's coupon chips (passed to CartTotal). */
|
|
1295
1374
|
afterSubtotal?: ReactNode;
|
|
1375
|
+
/** The coupon amount the app itemises in `afterSubtotal` (e.g. Σ `order.display.coupons`), in integer minor units of
|
|
1376
|
+
* the order's currency, in the display mode. When given, the Discount row shows the other discounts only (the
|
|
1377
|
+
* totals' discount minus this) and is hidden when they come to 0. Absent: the Discount row is the whole discount. */
|
|
1378
|
+
couponDiscountMinor?: number;
|
|
1296
1379
|
}): react_jsx_runtime.JSX.Element;
|
|
1297
1380
|
|
|
1298
1381
|
/** Phone mode's cart summary (medusapos ADR 0009): the whole bar is one button; the total is the cart's own Total row. */
|
|
@@ -1369,7 +1452,7 @@ interface ChargeFormProps {
|
|
|
1369
1452
|
declare function ChargeForm({ currency, lineTax, taxClasses, shippingTaxFromStore, onApply, onClose }: ChargeFormProps): react_jsx_runtime.JSX.Element;
|
|
1370
1453
|
|
|
1371
1454
|
declare function formatStockSyncTime(time: Date, locale?: string, hour12?: boolean, now?: Date): string;
|
|
1372
|
-
declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusText, statusAccessory, lastSyncedAt, loading, pullError, lastStockCheckAt, hour12, minCodeLength, viewState, defaultViewState, loadViewState, saveViewState, onViewStateError, onStateChange, showViewToggle, items, onQueryChange, showCategoryNav, categories }: {
|
|
1455
|
+
declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusText, statusAccessory, lastSyncedAt, loading, pullError, lastStockCheckAt, hour12, minCodeLength, viewState, defaultViewState, loadViewState, saveViewState, onViewStateError, onStateChange, showViewToggle, items, onQueryChange, showCategoryNav, categories, pickAnyOptions }: {
|
|
1373
1456
|
products: Doc[];
|
|
1374
1457
|
traits: ProductTraits<Doc>;
|
|
1375
1458
|
currency: string;
|
|
@@ -1417,11 +1500,20 @@ declare function Catalogue<Doc>({ products, traits, currency, onSelect, statusTe
|
|
|
1417
1500
|
items?: Doc[];
|
|
1418
1501
|
/** Search text on every input change, for apps that filter items themselves. */
|
|
1419
1502
|
onQueryChange?: (query: string) => void;
|
|
1503
|
+
/** Ask for a value for each of a variant's local "Any" option groups before onSelect (#495); set it only when the store accepts order.create version 6. */
|
|
1504
|
+
pickAnyOptions?: boolean;
|
|
1420
1505
|
}): react_jsx_runtime.JSX.Element;
|
|
1421
1506
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1507
|
+
type ReceiptProps = {
|
|
1508
|
+
newSale: () => void;
|
|
1509
|
+
taxLabel?: (ratePpm: number) => string;
|
|
1510
|
+
topInset?: number;
|
|
1511
|
+
formatDate?: (iso: string) => string;
|
|
1512
|
+
/** Prints after the Change row and above the on-screen buttons (e.g. an app's register/software block). */
|
|
1513
|
+
footerSlot?: ReactNode;
|
|
1514
|
+
/** The second button's text; default `New sale`. */
|
|
1515
|
+
doneLabel?: string;
|
|
1516
|
+
} & ({
|
|
1425
1517
|
order: SentOrder;
|
|
1426
1518
|
store: {
|
|
1427
1519
|
name: string;
|
|
@@ -1429,18 +1521,26 @@ declare function Receipt({ order, posOrder, store, cashier, registerId, register
|
|
|
1429
1521
|
};
|
|
1430
1522
|
cashier: string;
|
|
1431
1523
|
registerId: string;
|
|
1432
|
-
newSale: () => void;
|
|
1433
1524
|
/** The register's name, printed as `Register: <name>`; the id is never printed. */
|
|
1434
1525
|
registerName?: string;
|
|
1435
1526
|
/** The finalized order (useSale's receipt stage has it). With it the receipt prints its reference and time, the
|
|
1436
1527
|
* same as Orders; without it (a preview before finalize) the sale id is marked as a draft. */
|
|
1437
1528
|
posOrder?: PosOrder;
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1529
|
+
receipt?: never;
|
|
1530
|
+
} | {
|
|
1531
|
+
/** A prebuilt receipt, e.g. a reprint from `buildReceiptDataFromPosOrder`/`buildReceiptDataFromStoreOrder` (ADR-081). */
|
|
1532
|
+
receipt: ReceiptData;
|
|
1533
|
+
/** With it the receipt prints its reference, the same as Orders; without it, the receipt's own order number. */
|
|
1534
|
+
posOrder?: PosOrder;
|
|
1535
|
+
order?: never;
|
|
1536
|
+
store?: never;
|
|
1537
|
+
cashier?: never;
|
|
1538
|
+
registerId?: never;
|
|
1539
|
+
registerName?: never;
|
|
1540
|
+
});
|
|
1541
|
+
/** `store`/`taxLabel`/`topInset`/`formatDate` replace the app's Medusa settings, hard-coded VAT (default matches
|
|
1542
|
+
* TV6a's `Cart`), outbox strip and date util, so `Receipt` stays platform-neutral (ADR-052). */
|
|
1543
|
+
declare function Receipt(props: ReceiptProps): react_jsx_runtime.JSX.Element;
|
|
1444
1544
|
|
|
1445
1545
|
/** The order reference a visitor sees on the receipt and in Orders (front desk ruling, 2026-10-06): the finalized
|
|
1446
1546
|
* PosOrder id's last 8 characters, then the backend's display id once the store has one. */
|
|
@@ -1479,14 +1579,16 @@ type OrderHistoryRow = {
|
|
|
1479
1579
|
* `onRetry` is the outbox's `requeue`; `formatDate` replaces the app's date util; `footer` is the app's own content
|
|
1480
1580
|
* (medusapos: the feedback link). The router and session redirect stay in the app. `stuck` is the outbox's
|
|
1481
1581
|
* `state.stuck` (`useOrderOutbox`): those pending orders need attention too, each with its own entry's reason and since.
|
|
1582
|
+
* `onOpen` adds an Open button to each row that passes its order to the app.
|
|
1482
1583
|
* `history` adds read-only store order rows to Recent (ADR-052 amendment 1). */
|
|
1483
|
-
declare function OrdersList({ orders, onRetry, formatDate, footer, stuck, history }: {
|
|
1584
|
+
declare function OrdersList({ orders, onRetry, formatDate, footer, stuck, history, onOpen }: {
|
|
1484
1585
|
orders: PosOrder[];
|
|
1485
1586
|
onRetry(orderIds: string[]): Promise<number>;
|
|
1486
1587
|
formatDate?: (iso: string) => string;
|
|
1487
1588
|
footer?: ReactNode;
|
|
1488
1589
|
stuck?: OutboxState['stuck'];
|
|
1489
1590
|
history?: OrderHistoryRow[];
|
|
1591
|
+
onOpen?: (row: PosOrder | OrderHistoryRow) => void;
|
|
1490
1592
|
}): react_jsx_runtime.JSX.Element;
|
|
1491
1593
|
|
|
1492
1594
|
/** Pass `useParkedSales(drafts)`'s `parked` and `discard`, or your own parked store's list and handlers (`onPark`, `onResume`, `onDiscard`) with the same results. */
|
|
@@ -1503,6 +1605,19 @@ interface ParkedSalesProps {
|
|
|
1503
1605
|
}
|
|
1504
1606
|
declare function ParkedSales({ sale, parked, onDiscard, onPark, onResume, currency, open, onOpenChange, hour12 }: ParkedSalesProps): JSX.Element;
|
|
1505
1607
|
|
|
1608
|
+
/** Pass `openSales(sale.order, useParkedSales(drafts).parked)`; `onSelect` and `onNew` call `sale.switchSale(id)` and `sale.switchSale(null)`. */
|
|
1609
|
+
interface OpenSaleTabsProps {
|
|
1610
|
+
sales: OpenSale[];
|
|
1611
|
+
currency: string;
|
|
1612
|
+
onSelect: (id: string) => void;
|
|
1613
|
+
onNew: () => void;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* The open sales as cart tabs (v2 cart/tabs.tsx): who, then the Partly paid chip or else the total. The open sale's
|
|
1617
|
+
* tab is underlined even when it is the only one; a blank cart has no tab, the + cell is its tab and reads "New".
|
|
1618
|
+
*/
|
|
1619
|
+
declare function OpenSaleTabs({ sales, currency, onSelect, onNew }: OpenSaleTabsProps): JSX.Element;
|
|
1620
|
+
|
|
1506
1621
|
interface POSLayoutProps extends Omit<ViewProps, 'children'> {
|
|
1507
1622
|
browseSlot: ReactNode;
|
|
1508
1623
|
cartSlot: ReactNode;
|
|
@@ -1581,4 +1696,102 @@ interface StoreSettingsChoiceScreenProps extends Omit<ViewProps, 'children'> {
|
|
|
1581
1696
|
*/
|
|
1582
1697
|
declare function StoreSettingsChoiceScreen({ choices, initial, onSubmit, countryName, locale, title, body, regionLabel, countryLabel, channelLabel, submitLabel, className, ...viewProps }: StoreSettingsChoiceScreenProps): react_jsx_runtime.JSX.Element;
|
|
1583
1698
|
|
|
1584
|
-
|
|
1699
|
+
/**
|
|
1700
|
+
* The Sales room's cards over unit 10's figures. Port of WCPOS v2 `screens/main/reports/cards/`
|
|
1701
|
+
* (`card.tsx`, `primitives.tsx`, `orders.tsx`, `payments.tsx`, `top-products.tsx`,
|
|
1702
|
+
* `categories.tsx`, `taxes.tsx`, `refunds.tsx`); copy is v2's English (`core.json`). An unknown
|
|
1703
|
+
* figure (margin with no costed line, kept share of no sales) shows `—`, never 0.
|
|
1704
|
+
*/
|
|
1705
|
+
|
|
1706
|
+
type SalesCardId = 'orders' | 'payments' | 'products' | 'categories' | 'taxes' | 'refunds';
|
|
1707
|
+
interface SalesCardsProps {
|
|
1708
|
+
figures: SalesFigures;
|
|
1709
|
+
currency: string;
|
|
1710
|
+
/** Opens the card's panel. */
|
|
1711
|
+
onOpenCard?: (card: SalesCardId) => void;
|
|
1712
|
+
}
|
|
1713
|
+
declare function SalesCards({ figures, currency, onOpenCard }: SalesCardsProps): JSX.Element;
|
|
1714
|
+
|
|
1715
|
+
/**
|
|
1716
|
+
* The Sales room's filters: the period presets (worked out in store time by pos `presetRange`),
|
|
1717
|
+
* status, cashier and register. Port of WCPOS v2 `screens/main/reports/date-button.tsx` and the
|
|
1718
|
+
* filter choices in its `LEDGER.md`; copy is v2's English (`core.json`).
|
|
1719
|
+
*/
|
|
1720
|
+
|
|
1721
|
+
interface SalesOption {
|
|
1722
|
+
value: string;
|
|
1723
|
+
label: string;
|
|
1724
|
+
}
|
|
1725
|
+
interface SalesFilters {
|
|
1726
|
+
preset: DatePreset;
|
|
1727
|
+
range: DayRange;
|
|
1728
|
+
/** A single day's comparison: the day before or the same weekday last week. */
|
|
1729
|
+
compare: 'previous' | 'week';
|
|
1730
|
+
status: string;
|
|
1731
|
+
cashierId: string | null;
|
|
1732
|
+
registerId: string | null;
|
|
1733
|
+
}
|
|
1734
|
+
interface SalesFiltersBarProps {
|
|
1735
|
+
filters: SalesFilters;
|
|
1736
|
+
onFiltersChange: (next: SalesFilters) => void;
|
|
1737
|
+
/** IANA zone of the store, or 'device'. */
|
|
1738
|
+
timezone: string;
|
|
1739
|
+
/** The clock presets are worked out from; defaults to the time of the press. */
|
|
1740
|
+
now?: () => Date;
|
|
1741
|
+
statusOptions: SalesOption[];
|
|
1742
|
+
cashierOptions: SalesOption[];
|
|
1743
|
+
registerOptions: SalesOption[];
|
|
1744
|
+
}
|
|
1745
|
+
declare function SalesFiltersBar({ filters, onFiltersChange, timezone, now, statusOptions, cashierOptions, registerOptions, }: SalesFiltersBarProps): JSX.Element;
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* The Reports screen's Sales room: filters, hero and cards over one `SalesFigures` result.
|
|
1749
|
+
* Port of the WCPOS v2 Sales room layout (`screens/main/reports/`, `LEDGER.md`). It takes the
|
|
1750
|
+
* figures and the filter state as props; the screen works the figures out and owns the state.
|
|
1751
|
+
*/
|
|
1752
|
+
|
|
1753
|
+
interface SalesRoomProps extends SalesFiltersBarProps {
|
|
1754
|
+
figures: SalesFigures;
|
|
1755
|
+
currency: string;
|
|
1756
|
+
/** Opens a card's panel. */
|
|
1757
|
+
onOpenCard?: (card: SalesCardId) => void;
|
|
1758
|
+
}
|
|
1759
|
+
declare function SalesRoom({ figures, filters, onFiltersChange, currency, onOpenCard, ...bar }: SalesRoomProps): JSX.Element;
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* The Sales room's hero: the period's gross, its change against the comparison period and a
|
|
1763
|
+
* daily chart of both. Port of WCPOS v2 `screens/main/reports/hero/index.tsx` (`Difference`, the
|
|
1764
|
+
* companions Orders · Average order · Items) and the comparison labels of its `LEDGER.md`.
|
|
1765
|
+
* The bars are Views with theme token classes, so the chart takes its colours from the theme.
|
|
1766
|
+
*/
|
|
1767
|
+
|
|
1768
|
+
interface SalesHeroProps {
|
|
1769
|
+
figures: SalesFigures;
|
|
1770
|
+
filters: SalesFilters;
|
|
1771
|
+
onFiltersChange: (next: SalesFilters) => void;
|
|
1772
|
+
currency: string;
|
|
1773
|
+
}
|
|
1774
|
+
declare function SalesHero({ figures, filters, onFiltersChange, currency }: SalesHeroProps): JSX.Element;
|
|
1775
|
+
|
|
1776
|
+
type FontStatus = 'loading' | 'loaded' | 'failed';
|
|
1777
|
+
interface FontState {
|
|
1778
|
+
setId: TypeSetId;
|
|
1779
|
+
type: ThemeType;
|
|
1780
|
+
status: FontStatus;
|
|
1781
|
+
}
|
|
1782
|
+
interface FontProviderProps {
|
|
1783
|
+
/** The app's stored `ui.font` setting (from `useAppSettings` in `@tallyui/pos`); missing or unknown means Auto. */
|
|
1784
|
+
font?: string | null;
|
|
1785
|
+
/** The set Auto resolves to. Default `'system'`: TallyUI themes carry no type set. */
|
|
1786
|
+
autoTypeSet?: TypeSetId;
|
|
1787
|
+
/**
|
|
1788
|
+
* Registers the bundled faces of these families, e.g. with expo-font `loadAsync`. The app owns
|
|
1789
|
+
* the OFL files. Without a loader the faces are taken as already registered (e.g. web @font-face).
|
|
1790
|
+
*/
|
|
1791
|
+
loadFonts?: (families: ThemeFontFamily[]) => Promise<void>;
|
|
1792
|
+
children?: React$1.ReactNode;
|
|
1793
|
+
}
|
|
1794
|
+
declare function FontProvider({ font, autoTypeSet, loadFonts, children }: FontProviderProps): React$1.JSX.Element;
|
|
1795
|
+
declare function useFontType(): FontState;
|
|
1796
|
+
|
|
1797
|
+
export { APPROVAL_REQUIRED_TEXT, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cart, type CartAction, CartBar, CartLine, CartLineActions, type CartLineActionsProps, type CartLineProps, CartNoteInput, type CartNoteInputProps, CartPanel, type CartPanelProps, CartTotal, type CartTotalProps, CashCountInput, type CashCountInputProps, CashTendered, type CashTenderedProps, Catalogue, type CategoryItem, CategoryNav, type CategoryNavProps, ChangeDisplay, type ChangeDisplayProps, ChargeForm, type ChargeFormProps, Checkbox, CheckoutLayout, type CheckoutLayoutProps, type ChipItem, ClosureSheet, type ClosureSheetProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxTrigger, type ConnectionStatus, ConnectorStatus, type ConnectorStatusProps, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CustomerCard, type CustomerCardProps, CustomerForm, type CustomerFormProps, type CustomerFormValues, CustomerOrderHistory, type CustomerOrderHistoryProps, CustomerPicker, type CustomerPickerProps, CustomerSelect, type CustomerSelectProps, type Denomination, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiscountBadge, type DiscountBadgeProps, DiscountChips, DiscountForm, DisplaySettings, type DisplaySettingsProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FilterChip, FilterChipGroup, type FilterChipGroupProps, type FilterChipProps, FontProvider, type FontProviderProps, type FontState, type FontStatus, HStack, type HStackProps, HoverCard, HoverCardContent, HoverCardTrigger, Icon, IconButton, type IconButtonProps, type IconProps, Input, InputField, InputRoot, type InputRootProps, InputSlot, Label, type LabelProps, LiveTabScreen, type LiveTabScreenProps, type LiveTabScreenState, Loader, type LoaderProps, MovementSheet, type MovementSheetProps, OpenRegisterCard, type OpenRegisterCardProps, OpenSaleTabs, type OpenSaleTabsProps, OrderCard, type OrderCardProps, OrderDetail, type OrderDetailLineItem, type OrderDetailProps, type OrderHistoryRow, OrderList, type OrderListProps, type OrderStatus, OrderStatusBadge, type OrderStatusBadgeProps, OrderSummary, OrderSummaryLine, type OrderSummaryLineProps, type OrderSummaryPayment, type OrderSummaryProps, OrdersList, POSLayout, type POSLayoutProps, ParkedSales, type ParkedSalesProps, type PaymentMethod, PaymentMethodCard, type PaymentMethodCardProps, PaymentSelector, type PaymentSelectorProps, Popover, PopoverContent, PopoverTrigger, PriceForm, ProductCard, type ProductCardProps, ProductGrid, type ProductGridProps, ProductImage, type ProductImageProps, ProductList, type ProductListProps, ProductPrice, type ProductPriceProps, ProductSku, type ProductSkuProps, ProductStockBadge, type ProductStockBadgeProps, ProductTable, type ProductTableColumn, type ProductTableProps, ProductTitle, type ProductTitleProps, ProductVariantPicker, type ProductVariantPickerProps, Progress, type ProgressProps, QuantityStepper, type QuantityStepperProps, RadioGroup, RadioGroupItem, Receipt, type ReceiptItem, ReceiptPreview, type ReceiptPreviewProps, RefundForm, type RefundFormProps, type RefundFormValue, RefundModal, type RefundModalProps, RegisterBar, type RegisterBarPill, type RegisterBarProps, RegisterColumn, type RegisterColumnProps, RegisterCount, type RegisterCountProps, RegisterOpenClose, type RegisterOpenCloseProps, RegisterPanel, type RegisterPanelProps, RegisterPicker, type RegisterPickerProps, type RegisterPickerRegister, RegisterSummary, type RegisterSummaryProps, type SalesCardId, SalesCards, type SalesCardsProps, type SalesFilters, SalesFiltersBar, type SalesFiltersBarProps, SalesHero, type SalesHeroProps, type SalesOption, SalesRoom, type SalesRoomProps, ScaleProvider, type ScaleProviderProps, type ScaleScopeProps, type ScaleState, SearchIcon, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, SettingsGroup, type SettingsGroupProps, SettingsLayout, type SettingsLayoutProps, SettingsRow, type SettingsRowProps, Slider, type SliderProps, SplitTender, StoreSettingsChoiceScreen, type StoreSettingsChoiceScreenProps, type SvgIconProps, Switch, SyncStatus, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tender, Text, type TextProps, Textarea, type TextareaProps, Toast, ToastClose, ToastDescription, type ToastProps, ToastTitle, Toggle, ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps, type ToggleProps, Tooltip, TooltipContent, TooltipTrigger, type TransactionSummary, VStack, type VStackProps, type VariantOption, ViewToggle, type ViewToggleProps, XIcon, avatarVariants, badgeTextVariants, badgeVariants, buttonTextVariants, buttonVariants, createSvgIcon, defaultProductColumns, describeRegisterBarPill, discountLabel, formatStockSyncTime, hstackVariants, iconButtonVariants, iconVariants, injectPrintStyle, loaderVariants, orderReference, parseDiscount, parsePrice, textVariants, toastVariants, toggleTextVariants, toggleVariants, useDefaultProductColumns, useFontType, useInputContext, usePointer, useScale, vstackVariants };
|