@tallyui/components 3.14.0 → 3.15.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 CHANGED
@@ -661,6 +661,10 @@ interface CartLineProps extends Omit<HStackProps, 'children'> {
661
661
  lineTotal: Money;
662
662
  /** Show the Price column (default true); the Cart passes false on a narrow cart or a phone, as CartColumnHeads does. */
663
663
  showPrice?: boolean;
664
+ /** Replaces the quantity's text, e.g. a LinePopover that edits it (Cart's `lineEditor="popover"`). */
665
+ quantitySlot?: ReactNode;
666
+ /** Replaces the unit price's text (the struck regular price stays above it). */
667
+ priceSlot?: ReactNode;
664
668
  locale?: string;
665
669
  className?: string;
666
670
  }
@@ -672,7 +676,7 @@ interface CartLineProps extends Omit<HStackProps, 'children'> {
672
676
  * <CartLine name="Coffee" quantity={2} unitPrice={unitPrice} lineTotal={lineTotal} />
673
677
  * ```
674
678
  */
675
- declare function CartLine({ name, attributes, quantity, unitPrice, regularUnitPrice, lineTotal, showPrice, locale, className, ...props }: CartLineProps): react_jsx_runtime.JSX.Element;
679
+ declare function CartLine({ name, attributes, quantity, unitPrice, regularUnitPrice, lineTotal, showPrice, quantitySlot, priceSlot, locale, className, ...props }: CartLineProps): react_jsx_runtime.JSX.Element;
676
680
 
677
681
  interface CartColumnHeadsProps extends Omit<ViewProps, 'children'> {
678
682
  /** Show the Price head (default true); pass the same value as each CartLine's `showPrice`. */
@@ -759,6 +763,32 @@ interface CartLineActionsProps extends Omit<ViewProps, 'children'> {
759
763
  }
760
764
  declare function CartLineActions({ children, actions, className, ...viewProps }: CartLineActionsProps): react_jsx_runtime.JSX.Element;
761
765
 
766
+ interface CartFootAction {
767
+ label: string;
768
+ onPress: () => void;
769
+ /** Shown in the destructive colour, e.g. a Void. */
770
+ destructive?: boolean;
771
+ }
772
+ interface CartFootProps {
773
+ total: Money;
774
+ onCheckout: () => void;
775
+ /** The ⋮ menu's items; the ⋮ is left out when there are none. */
776
+ actions?: readonly CartFootAction[];
777
+ /** Disables Checkout only; the menu stays usable. */
778
+ disabled?: boolean;
779
+ locale?: string;
780
+ className?: string;
781
+ }
782
+ /**
783
+ * The cart's foot: a ⋮ menu of the host's actions beside one "Checkout {total}" button, as in WCPOS v2.
784
+ * v2's ⋮ opens its Order details sheet; here the host passes the items, so it can pass one that opens its own sheet.
785
+ *
786
+ * ```tsx
787
+ * <CartFoot total={total} onCheckout={startCheckout} actions={[{ label: 'Void', onPress: voidSale, destructive: true }]} />
788
+ * ```
789
+ */
790
+ declare function CartFoot({ total, onCheckout, actions, disabled, locale, className }: CartFootProps): react_jsx_runtime.JSX.Element;
791
+
762
792
  interface SearchInputProps extends Omit<TextInputProps, 'value' | 'onChangeText'> {
763
793
  value: string;
764
794
  onChangeText: (text: string) => void;
@@ -804,6 +834,28 @@ interface QuantityStepperProps extends Omit<ViewProps, 'children'> {
804
834
  }
805
835
  declare function QuantityStepper({ defaultQuantity, quantity: controlledQuantity, onChangeQuantity, min, max, className, ...viewProps }: QuantityStepperProps): react_jsx_runtime.JSX.Element;
806
836
 
837
+ interface KeypadKey {
838
+ /** What a press reports: a digit, `decimal`, `backspace`, or the caller's own key. */
839
+ name: string;
840
+ /** The accessible name: the digit, or the caller's own ("Delete last digit"). */
841
+ label: string;
842
+ /** The key's text when it is not its label (`⌫`, named "Delete last digit"). */
843
+ text?: string;
844
+ /** The cells the key takes in its row (default 1). */
845
+ span?: number;
846
+ }
847
+ interface KeypadProps {
848
+ rows: readonly (readonly KeypadKey[])[];
849
+ onPress: (name: string) => void;
850
+ /** A key is `<testID>-key-<name>`. */
851
+ testID?: string;
852
+ className?: string;
853
+ }
854
+ /** v2's DIGIT_ROWS: 123 / 456 / 789; the caller adds its own last row. */
855
+ declare const DIGIT_ROWS: KeypadKey[][];
856
+ /** Rows of keys with no display or value, as v2's Keypad: the caller owns the entry. */
857
+ declare function Keypad({ rows, onPress, testID, className }: KeypadProps): react_jsx_runtime.JSX.Element;
858
+
807
859
  interface CustomerCardProps<Doc = any> extends Omit<VStackProps, 'children'> {
808
860
  doc: Doc;
809
861
  traits?: CustomerTraits<Doc>;
@@ -1475,7 +1527,7 @@ interface DisplaySettingsProps {
1475
1527
  declare function DisplaySettings({ settings, setSetting, className }: DisplaySettingsProps): JSX.Element;
1476
1528
 
1477
1529
  /** `taxLabel` names each tax row; VAT isn't universal, so a platform passes its own (medusapos passes `VAT ${rate}%`). */
1478
- declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscounts, taxClasses, afterSubtotal, couponDiscountMinor, orderActions }: {
1530
+ declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscounts, taxClasses, afterSubtotal, couponDiscountMinor, orderActions, checkout, lineEditor }: {
1479
1531
  sale: ReturnType<typeof useSale>;
1480
1532
  taxLabel?: (ratePpm: number) => string;
1481
1533
  taxClasses?: ReadonlyArray<{
@@ -1502,6 +1554,15 @@ declare function Cart({ sale, taxLabel, canEditPrice, onPriceChange, quickDiscou
1502
1554
  /** Cart's own Order discount and Add charge controls; pass `false` when the app hosts them in its own menu (v2's
1503
1555
  * cart "+" menu). Applied discounts and charges still show and can be removed. */
1504
1556
  orderActions?: boolean;
1557
+ /** Swaps the Cash and Card terminal row for v2's foot, `CartFoot`: "Checkout {total}" calls `onCheckout`, and the
1558
+ * ⋮ menu lists `actions`. Absent: the Cash and Card terminal row. */
1559
+ checkout?: {
1560
+ onCheckout: () => void;
1561
+ actions?: readonly CartFootAction[];
1562
+ };
1563
+ /** `popover`: tapping a line's quantity or price opens v2's keypad (WCPOS cart cells/quantity-keypad.tsx and
1564
+ * cells/price.tsx), the price one with the quick-discount keys. Default `inline`: the − / + buttons and Price form. */
1565
+ lineEditor?: 'inline' | 'popover';
1505
1566
  }): react_jsx_runtime.JSX.Element;
1506
1567
 
1507
1568
  /** Phone mode's cart summary (medusapos ADR 0009): the whole bar is one button; the total is the cart's own Total row. */
@@ -1576,6 +1637,27 @@ declare function PriceForm({ lineName, currency, currentMinor, onApply, onClose,
1576
1637
  quickDiscounts?: readonly number[];
1577
1638
  }): JSX.Element;
1578
1639
 
1640
+ interface LinePopoverProps {
1641
+ /** `quantity` takes whole numbers only, with no decimal key (decimal quantities need an ADR first, TallyUI#486). */
1642
+ kind: 'quantity' | 'price';
1643
+ lineName: string;
1644
+ /** The order's currency: the price's format and its decimal places. */
1645
+ currency: string;
1646
+ /** The stored quantity, or the unit price in integer minor units. */
1647
+ value: number;
1648
+ /** Writes the new value; returns a refusal to show, or null once applied. */
1649
+ onApply: (value: number) => string | null;
1650
+ /** Price only: v2's quick-discount keys, the first three valid percentages (as PriceForm's). */
1651
+ quickDiscounts?: readonly number[];
1652
+ /** The trigger's text classes (the cell's alignment and tone). */
1653
+ textClassName?: string;
1654
+ }
1655
+ /**
1656
+ * A cart line's quantity or price that opens v2's keypad: the cashier types (or picks a quick discount),
1657
+ * Apply writes through `onApply`, and Cancel, Escape or a press outside close without writing.
1658
+ */
1659
+ declare function LinePopover({ kind, lineName, currency, value, onApply, quickDiscounts, textClassName }: LinePopoverProps): react_jsx_runtime.JSX.Element;
1660
+
1579
1661
  interface ChargeFormProps {
1580
1662
  currency: string;
1581
1663
  lineTax?: {
@@ -2042,4 +2124,4 @@ interface FontProviderProps {
2042
2124
  declare function FontProvider({ font, autoTypeSet, loadFonts, children }: FontProviderProps): React$1.JSX.Element;
2043
2125
  declare function useFontType(): FontState;
2044
2126
 
2045
- export { APPROVAL_REQUIRED_TEXT, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cart, type CartAction, CartBar, CartColumnHeads, type CartColumnHeadsProps, 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, CategoryTile, type CategoryTileProps, 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, CustomerDisplayScreen, CustomerForm, type CustomerFormProps, type CustomerFormValues, CustomerOrderHistory, type CustomerOrderHistoryProps, CustomerPicker, type CustomerPickerProps, CustomerSelect, type CustomerSelectProps, DEFAULT_PRODUCT_FILTERS, 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, HandoverSlip, type HandoverSlipProps, HoverCard, HoverCardContent, HoverCardTrigger, Icon, IconButton, type IconButtonProps, type IconProps, InCartBadge, type InCartBadgeProps, Input, InputField, InputRoot, type InputRootProps, InputSlot, Label, type LabelProps, LiveTabScreen, type LiveTabScreenProps, type LiveTabScreenState, Loader, type LoaderProps, MovementSheet, type MovementSheetProps, NavDrawer, type NavDrawerProps, NavRail, type NavRailProps, 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, PRODUCT_FILTER_CHIPS, ParkedSales, type ParkedSalesProps, type PaymentMethod, PaymentMethodCard, type PaymentMethodCardProps, PaymentSelector, type PaymentSelectorProps, Popover, PopoverContent, PopoverTrigger, PriceForm, ProductCard, type ProductCardProps, ProductFilterBar, type ProductFilterBarProps, type ProductFilterChip, type ProductFilters, 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, type ShellNavItem, Slider, type SliderProps, SplitTender, StoreSettingsChoiceScreen, type StoreSettingsChoiceScreenProps, type SvgIconProps, Switch, SwitchConfirm, type SwitchConfirmProps, SyncStatus, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tender, TenderPane, type TenderPaneProps, 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 };
2127
+ export { APPROVAL_REQUIRED_TEXT, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellProps, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Cart, type CartAction, CartBar, CartColumnHeads, type CartColumnHeadsProps, CartFoot, type CartFootAction, type CartFootProps, 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, CategoryTile, type CategoryTileProps, 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, CustomerDisplayScreen, CustomerForm, type CustomerFormProps, type CustomerFormValues, CustomerOrderHistory, type CustomerOrderHistoryProps, CustomerPicker, type CustomerPickerProps, CustomerSelect, type CustomerSelectProps, DEFAULT_PRODUCT_FILTERS, DIGIT_ROWS, 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, HandoverSlip, type HandoverSlipProps, HoverCard, HoverCardContent, HoverCardTrigger, Icon, IconButton, type IconButtonProps, type IconProps, InCartBadge, type InCartBadgeProps, Input, InputField, InputRoot, type InputRootProps, InputSlot, Keypad, type KeypadKey, type KeypadProps, Label, type LabelProps, LinePopover, type LinePopoverProps, LiveTabScreen, type LiveTabScreenProps, type LiveTabScreenState, Loader, type LoaderProps, MovementSheet, type MovementSheetProps, NavDrawer, type NavDrawerProps, NavRail, type NavRailProps, 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, PRODUCT_FILTER_CHIPS, ParkedSales, type ParkedSalesProps, type PaymentMethod, PaymentMethodCard, type PaymentMethodCardProps, PaymentSelector, type PaymentSelectorProps, Popover, PopoverContent, PopoverTrigger, PriceForm, ProductCard, type ProductCardProps, ProductFilterBar, type ProductFilterBarProps, type ProductFilterChip, type ProductFilters, 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, type ShellNavItem, Slider, type SliderProps, SplitTender, StoreSettingsChoiceScreen, type StoreSettingsChoiceScreenProps, type SvgIconProps, Switch, SwitchConfirm, type SwitchConfirmProps, SyncStatus, Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tender, TenderPane, type TenderPaneProps, 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 };