@tallyui/components 3.0.0-next.2 → 3.0.1
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 +6 -1
- package/dist/index.js +744 -732
- package/package.json +9 -9
- package/src/register/register-panel.tsx +11 -2
- package/src/ui/icon/x-icon.tsx +9 -0
- package/src/ui/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -166,13 +166,21 @@ var SearchIcon = createSvgIcon("SearchIcon", () => /* @__PURE__ */ jsxs(Fragment
|
|
|
166
166
|
/* @__PURE__ */ jsx6(Line, { x1: 16.5, y1: 16.5, x2: 21, y2: 21 })
|
|
167
167
|
] }));
|
|
168
168
|
|
|
169
|
+
// src/ui/icon/x-icon.tsx
|
|
170
|
+
import { Line as Line2 } from "react-native-svg";
|
|
171
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
172
|
+
var XIcon = createSvgIcon("XIcon", () => /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
173
|
+
/* @__PURE__ */ jsx7(Line2, { x1: 18, y1: 6, x2: 6, y2: 18 }),
|
|
174
|
+
/* @__PURE__ */ jsx7(Line2, { x1: 6, y1: 6, x2: 18, y2: 18 })
|
|
175
|
+
] }));
|
|
176
|
+
|
|
169
177
|
// src/ui/loader/index.tsx
|
|
170
178
|
import * as React5 from "react";
|
|
171
179
|
import { View as View4 } from "react-native";
|
|
172
180
|
import { TextClassContext as TextClassContext3 } from "@tallyui/primitives";
|
|
173
181
|
import { cn as cn5 } from "@tallyui/theme";
|
|
174
182
|
import { cva as cva5 } from "class-variance-authority";
|
|
175
|
-
import { jsx as
|
|
183
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
176
184
|
var loaderVariants = cva5("animate-spin", {
|
|
177
185
|
variants: {
|
|
178
186
|
size: {
|
|
@@ -187,13 +195,13 @@ var loaderVariants = cva5("animate-spin", {
|
|
|
187
195
|
});
|
|
188
196
|
function Loader({ className, size, ...props }) {
|
|
189
197
|
const textClass = React5.useContext(TextClassContext3);
|
|
190
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ jsx8(
|
|
191
199
|
View4,
|
|
192
200
|
{
|
|
193
201
|
className: cn5(loaderVariants({ size }), textClass, className),
|
|
194
202
|
role: "progressbar",
|
|
195
203
|
...props,
|
|
196
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ jsx8(View4, { className: "h-full w-full rounded-full border-2 border-current border-t-transparent" })
|
|
197
205
|
}
|
|
198
206
|
);
|
|
199
207
|
}
|
|
@@ -202,7 +210,7 @@ function Loader({ className, size, ...props }) {
|
|
|
202
210
|
import { Text as Text2, View as View5 } from "react-native";
|
|
203
211
|
import { cn as cn6 } from "@tallyui/theme";
|
|
204
212
|
import { cva as cva6 } from "class-variance-authority";
|
|
205
|
-
import { jsx as
|
|
213
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
206
214
|
var badgeVariants = cva6(
|
|
207
215
|
"inline-flex items-center rounded-full border px-2.5 py-0.5",
|
|
208
216
|
{
|
|
@@ -239,7 +247,7 @@ var badgeTextVariants = cva6("text-xs font-semibold", {
|
|
|
239
247
|
}
|
|
240
248
|
});
|
|
241
249
|
function Badge({ className, variant, label, children, ...props }) {
|
|
242
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ jsx9(View5, { className: cn6(badgeVariants({ variant }), className), ...props, children: label ? /* @__PURE__ */ jsx9(Text2, { className: badgeTextVariants({ variant }), children: label }) : children });
|
|
243
251
|
}
|
|
244
252
|
|
|
245
253
|
// src/ui/avatar/index.tsx
|
|
@@ -247,7 +255,7 @@ import * as React6 from "react";
|
|
|
247
255
|
import { Image, View as View6, Text as Text3 } from "react-native";
|
|
248
256
|
import { cn as cn7 } from "@tallyui/theme";
|
|
249
257
|
import { cva as cva7 } from "class-variance-authority";
|
|
250
|
-
import { jsx as
|
|
258
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
251
259
|
var avatarVariants = cva7("relative overflow-hidden rounded-full", {
|
|
252
260
|
variants: {
|
|
253
261
|
size: {
|
|
@@ -263,7 +271,7 @@ var avatarVariants = cva7("relative overflow-hidden rounded-full", {
|
|
|
263
271
|
});
|
|
264
272
|
function Avatar({ className, size, src, alt, fallback, ...props }) {
|
|
265
273
|
const [hasError, setHasError] = React6.useState(false);
|
|
266
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ jsx10(View6, { className: cn7(avatarVariants({ size }), className), ...props, children: src && !hasError ? /* @__PURE__ */ jsx10(
|
|
267
275
|
Image,
|
|
268
276
|
{
|
|
269
277
|
source: { uri: src },
|
|
@@ -271,7 +279,7 @@ function Avatar({ className, size, src, alt, fallback, ...props }) {
|
|
|
271
279
|
onError: () => setHasError(true),
|
|
272
280
|
className: "h-full w-full"
|
|
273
281
|
}
|
|
274
|
-
) : /* @__PURE__ */
|
|
282
|
+
) : /* @__PURE__ */ jsx10(View6, { className: "flex h-full w-full items-center justify-center bg-muted", children: /* @__PURE__ */ jsx10(Text3, { className: "text-sm font-medium text-muted-foreground", children: fallback ?? alt?.charAt(0)?.toUpperCase() ?? "?" }) }) });
|
|
275
283
|
}
|
|
276
284
|
|
|
277
285
|
// src/ui/button/index.tsx
|
|
@@ -280,7 +288,7 @@ import { Pressable } from "react-native";
|
|
|
280
288
|
import { TextClassContext as TextClassContext4, Slot as Slot2 } from "@tallyui/primitives";
|
|
281
289
|
import { cn as cn8 } from "@tallyui/theme";
|
|
282
290
|
import { cva as cva8 } from "class-variance-authority";
|
|
283
|
-
import { jsx as
|
|
291
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
284
292
|
var buttonVariants = cva8(
|
|
285
293
|
"inline-flex flex-row items-center justify-center gap-2 rounded-md web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",
|
|
286
294
|
{
|
|
@@ -334,11 +342,11 @@ var buttonTextVariants = cva8(
|
|
|
334
342
|
var Button = React7.forwardRef(
|
|
335
343
|
function Button2({ className, variant, size, asChild = false, disabled, ...props }, ref) {
|
|
336
344
|
const Component = asChild ? Slot2 : Pressable;
|
|
337
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ jsx11(
|
|
338
346
|
TextClassContext4.Provider,
|
|
339
347
|
{
|
|
340
348
|
value: buttonTextVariants({ variant, size }),
|
|
341
|
-
children: /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ jsx11(
|
|
342
350
|
Component,
|
|
343
351
|
{
|
|
344
352
|
ref,
|
|
@@ -364,7 +372,7 @@ import { Pressable as Pressable2 } from "react-native";
|
|
|
364
372
|
import { Slot as Slot3 } from "@tallyui/primitives";
|
|
365
373
|
import { cn as cn9 } from "@tallyui/theme";
|
|
366
374
|
import { cva as cva9 } from "class-variance-authority";
|
|
367
|
-
import { jsx as
|
|
375
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
368
376
|
var iconButtonVariants = cva9(
|
|
369
377
|
"inline-flex items-center justify-center rounded-md web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring",
|
|
370
378
|
{
|
|
@@ -391,7 +399,7 @@ var iconButtonVariants = cva9(
|
|
|
391
399
|
var IconButton = React8.forwardRef(
|
|
392
400
|
function IconButton2({ className, variant, size, asChild = false, disabled, ...props }, ref) {
|
|
393
401
|
const Component = asChild ? Slot3 : Pressable2;
|
|
394
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ jsx12(
|
|
395
403
|
Component,
|
|
396
404
|
{
|
|
397
405
|
ref,
|
|
@@ -414,9 +422,9 @@ import * as React9 from "react";
|
|
|
414
422
|
import { Text as Text4, View as View7 } from "react-native";
|
|
415
423
|
import { TextClassContext as TextClassContext5 } from "@tallyui/primitives";
|
|
416
424
|
import { cn as cn10 } from "@tallyui/theme";
|
|
417
|
-
import { jsx as
|
|
425
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
418
426
|
var Card = React9.forwardRef(function Card2({ className, ...props }, ref) {
|
|
419
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ jsx13(
|
|
420
428
|
View7,
|
|
421
429
|
{
|
|
422
430
|
ref,
|
|
@@ -427,11 +435,11 @@ var Card = React9.forwardRef(function Card2({ className, ...props }, ref) {
|
|
|
427
435
|
});
|
|
428
436
|
Card.displayName = "Card";
|
|
429
437
|
var CardHeader = React9.forwardRef(function CardHeader2({ className, ...props }, ref) {
|
|
430
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ jsx13(View7, { ref, className: cn10("flex flex-col gap-1.5 p-6", className), ...props });
|
|
431
439
|
});
|
|
432
440
|
CardHeader.displayName = "CardHeader";
|
|
433
441
|
var CardTitle = React9.forwardRef(function CardTitle2({ className, ...props }, ref) {
|
|
434
|
-
return /* @__PURE__ */
|
|
442
|
+
return /* @__PURE__ */ jsx13(
|
|
435
443
|
Text4,
|
|
436
444
|
{
|
|
437
445
|
ref,
|
|
@@ -444,15 +452,15 @@ var CardTitle = React9.forwardRef(function CardTitle2({ className, ...props }, r
|
|
|
444
452
|
});
|
|
445
453
|
CardTitle.displayName = "CardTitle";
|
|
446
454
|
var CardDescription = React9.forwardRef(function CardDescription2({ className, ...props }, ref) {
|
|
447
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ jsx13(Text4, { ref, className: cn10("text-sm text-muted-foreground", className), ...props });
|
|
448
456
|
});
|
|
449
457
|
CardDescription.displayName = "CardDescription";
|
|
450
458
|
var CardContent = React9.forwardRef(function CardContent2({ className, ...props }, ref) {
|
|
451
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ jsx13(TextClassContext5.Provider, { value: "text-card-foreground", children: /* @__PURE__ */ jsx13(View7, { ref, className: cn10("p-6 pt-0", className), ...props }) });
|
|
452
460
|
});
|
|
453
461
|
CardContent.displayName = "CardContent";
|
|
454
462
|
var CardFooter = React9.forwardRef(function CardFooter2({ className, ...props }, ref) {
|
|
455
|
-
return /* @__PURE__ */
|
|
463
|
+
return /* @__PURE__ */ jsx13(View7, { ref, className: cn10("flex flex-row items-center p-6 pt-0", className), ...props });
|
|
456
464
|
});
|
|
457
465
|
CardFooter.displayName = "CardFooter";
|
|
458
466
|
|
|
@@ -460,10 +468,10 @@ CardFooter.displayName = "CardFooter";
|
|
|
460
468
|
import * as React10 from "react";
|
|
461
469
|
import { Separator as SeparatorPrimitive } from "@tallyui/primitives";
|
|
462
470
|
import { cn as cn11 } from "@tallyui/theme";
|
|
463
|
-
import { jsx as
|
|
471
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
464
472
|
var Separator = React10.forwardRef(
|
|
465
473
|
function Separator2({ className, orientation = "horizontal", decorative = true, ...props }, ref) {
|
|
466
|
-
return /* @__PURE__ */
|
|
474
|
+
return /* @__PURE__ */ jsx14(
|
|
467
475
|
SeparatorPrimitive.Root,
|
|
468
476
|
{
|
|
469
477
|
ref,
|
|
@@ -485,10 +493,10 @@ Separator.displayName = "Separator";
|
|
|
485
493
|
import * as React11 from "react";
|
|
486
494
|
import { Label as LabelPrimitive } from "@tallyui/primitives";
|
|
487
495
|
import { cn as cn12 } from "@tallyui/theme";
|
|
488
|
-
import { jsx as
|
|
496
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
489
497
|
var Label = React11.forwardRef(
|
|
490
498
|
function Label2({ className, ...props }, ref) {
|
|
491
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ jsx15(
|
|
492
500
|
LabelPrimitive.Root,
|
|
493
501
|
{
|
|
494
502
|
ref,
|
|
@@ -507,7 +515,7 @@ Label.displayName = "Label";
|
|
|
507
515
|
import * as React12 from "react";
|
|
508
516
|
import { TextInput, View as View8 } from "react-native";
|
|
509
517
|
import { cn as cn13 } from "@tallyui/theme";
|
|
510
|
-
import { jsx as
|
|
518
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
511
519
|
var InputContext = React12.createContext({
|
|
512
520
|
focused: false,
|
|
513
521
|
disabled: false
|
|
@@ -518,7 +526,7 @@ function useInputContext() {
|
|
|
518
526
|
var InputRoot = React12.forwardRef(
|
|
519
527
|
function InputRoot2({ className, disabled = false, children, ...props }, ref) {
|
|
520
528
|
const [focused, setFocused] = React12.useState(false);
|
|
521
|
-
return /* @__PURE__ */
|
|
529
|
+
return /* @__PURE__ */ jsx16(InputContext.Provider, { value: { focused, disabled }, children: /* @__PURE__ */ jsx16(
|
|
522
530
|
View8,
|
|
523
531
|
{
|
|
524
532
|
ref,
|
|
@@ -551,14 +559,14 @@ var InputRoot = React12.forwardRef(
|
|
|
551
559
|
InputRoot.displayName = "InputRoot";
|
|
552
560
|
var InputSlot = React12.forwardRef(
|
|
553
561
|
function InputSlot2({ className, ...props }, ref) {
|
|
554
|
-
return /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ jsx16(View8, { ref, className: cn13("justify-center", className), ...props });
|
|
555
563
|
}
|
|
556
564
|
);
|
|
557
565
|
InputSlot.displayName = "InputSlot";
|
|
558
566
|
var InputField = React12.forwardRef(
|
|
559
567
|
function InputField2({ className, ...props }, ref) {
|
|
560
568
|
const { disabled } = useInputContext();
|
|
561
|
-
return /* @__PURE__ */
|
|
569
|
+
return /* @__PURE__ */ jsx16(
|
|
562
570
|
TextInput,
|
|
563
571
|
{
|
|
564
572
|
ref,
|
|
@@ -583,10 +591,10 @@ var Input = Object.assign(InputRoot, {
|
|
|
583
591
|
import * as React13 from "react";
|
|
584
592
|
import { TextInput as TextInput2 } from "react-native";
|
|
585
593
|
import { cn as cn14 } from "@tallyui/theme";
|
|
586
|
-
import { jsx as
|
|
594
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
587
595
|
var Textarea = React13.forwardRef(
|
|
588
596
|
function Textarea2({ className, ...props }, ref) {
|
|
589
|
-
return /* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ jsx17(
|
|
590
598
|
TextInput2,
|
|
591
599
|
{
|
|
592
600
|
ref,
|
|
@@ -607,10 +615,10 @@ Textarea.displayName = "Textarea";
|
|
|
607
615
|
import * as React14 from "react";
|
|
608
616
|
import { Tabs as TabsPrimitive, TextClassContext as TextClassContext6 } from "@tallyui/primitives";
|
|
609
617
|
import { cn as cn15 } from "@tallyui/theme";
|
|
610
|
-
import { jsx as
|
|
618
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
611
619
|
var Tabs = TabsPrimitive.Root;
|
|
612
620
|
function TabsList({ className, ...props }) {
|
|
613
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ jsx18(
|
|
614
622
|
TabsPrimitive.List,
|
|
615
623
|
{
|
|
616
624
|
className: cn15("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1", className),
|
|
@@ -621,14 +629,14 @@ function TabsList({ className, ...props }) {
|
|
|
621
629
|
var TabsTrigger = React14.forwardRef(function TabsTrigger2({ className, ...props }, ref) {
|
|
622
630
|
const { value } = TabsPrimitive.useRootContext();
|
|
623
631
|
const isActive = props.value === value;
|
|
624
|
-
return /* @__PURE__ */
|
|
632
|
+
return /* @__PURE__ */ jsx18(
|
|
625
633
|
TextClassContext6.Provider,
|
|
626
634
|
{
|
|
627
635
|
value: cn15(
|
|
628
636
|
"text-sm font-medium",
|
|
629
637
|
isActive ? "text-foreground" : "text-muted-foreground"
|
|
630
638
|
),
|
|
631
|
-
children: /* @__PURE__ */
|
|
639
|
+
children: /* @__PURE__ */ jsx18(
|
|
632
640
|
TabsPrimitive.Trigger,
|
|
633
641
|
{
|
|
634
642
|
ref,
|
|
@@ -645,7 +653,7 @@ var TabsTrigger = React14.forwardRef(function TabsTrigger2({ className, ...props
|
|
|
645
653
|
});
|
|
646
654
|
TabsTrigger.displayName = "TabsTrigger";
|
|
647
655
|
function TabsContent({ className, ...props }) {
|
|
648
|
-
return /* @__PURE__ */
|
|
656
|
+
return /* @__PURE__ */ jsx18(
|
|
649
657
|
TabsPrimitive.Content,
|
|
650
658
|
{
|
|
651
659
|
className: cn15("mt-2 web:ring-offset-background web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2", className),
|
|
@@ -659,13 +667,13 @@ import * as React15 from "react";
|
|
|
659
667
|
import { View as View9 } from "react-native";
|
|
660
668
|
import { Dialog as DialogPrimitive, TextClassContext as TextClassContext7 } from "@tallyui/primitives";
|
|
661
669
|
import { cn as cn16 } from "@tallyui/theme";
|
|
662
|
-
import { jsx as
|
|
670
|
+
import { jsx as jsx19, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
663
671
|
var Dialog = DialogPrimitive.Root;
|
|
664
672
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
665
673
|
var DialogPortal = DialogPrimitive.Portal;
|
|
666
674
|
var DialogClose = DialogPrimitive.Close;
|
|
667
675
|
var DialogOverlay = React15.forwardRef(function DialogOverlay2({ className, ...props }, ref) {
|
|
668
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ jsx19(
|
|
669
677
|
DialogPrimitive.Overlay,
|
|
670
678
|
{
|
|
671
679
|
ref,
|
|
@@ -676,9 +684,9 @@ var DialogOverlay = React15.forwardRef(function DialogOverlay2({ className, ...p
|
|
|
676
684
|
});
|
|
677
685
|
DialogOverlay.displayName = "DialogOverlay";
|
|
678
686
|
var DialogContent = React15.forwardRef(function DialogContent2({ className, children, ...props }, ref) {
|
|
679
|
-
return /* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
687
|
+
return /* @__PURE__ */ jsxs3(DialogPortal, { children: [
|
|
688
|
+
/* @__PURE__ */ jsx19(DialogOverlay, {}),
|
|
689
|
+
/* @__PURE__ */ jsx19(
|
|
682
690
|
DialogPrimitive.Content,
|
|
683
691
|
{
|
|
684
692
|
ref,
|
|
@@ -694,17 +702,17 @@ var DialogContent = React15.forwardRef(function DialogContent2({ className, chil
|
|
|
694
702
|
});
|
|
695
703
|
DialogContent.displayName = "DialogContent";
|
|
696
704
|
function DialogHeader({ className, ...props }) {
|
|
697
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsx19(View9, { className: cn16("flex flex-col gap-1.5 text-center sm:text-left", className), ...props });
|
|
698
706
|
}
|
|
699
707
|
function DialogFooter({ className, ...props }) {
|
|
700
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsx19(View9, { className: cn16("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2", className), ...props });
|
|
701
709
|
}
|
|
702
710
|
var DialogTitle = React15.forwardRef(function DialogTitle2({ className, ...props }, ref) {
|
|
703
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsx19(TextClassContext7.Provider, { value: "text-lg font-semibold leading-none text-foreground", children: /* @__PURE__ */ jsx19(DialogPrimitive.Title, { ref, className: cn16("text-lg font-semibold leading-none text-foreground", className), ...props }) });
|
|
704
712
|
});
|
|
705
713
|
DialogTitle.displayName = "DialogTitle";
|
|
706
714
|
var DialogDescription = React15.forwardRef(function DialogDescription2({ className, ...props }, ref) {
|
|
707
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ jsx19(DialogPrimitive.Description, { ref, className: cn16("text-sm text-muted-foreground", className), ...props });
|
|
708
716
|
});
|
|
709
717
|
DialogDescription.displayName = "DialogDescription";
|
|
710
718
|
|
|
@@ -713,12 +721,12 @@ import * as React16 from "react";
|
|
|
713
721
|
import { View as View10 } from "react-native";
|
|
714
722
|
import { AlertDialog as AlertDialogPrimitive, TextClassContext as TextClassContext8 } from "@tallyui/primitives";
|
|
715
723
|
import { cn as cn17 } from "@tallyui/theme";
|
|
716
|
-
import { jsx as
|
|
724
|
+
import { jsx as jsx20, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
717
725
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
718
726
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
719
727
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
720
728
|
var AlertDialogOverlay = React16.forwardRef(function AlertDialogOverlay2({ className, ...props }, ref) {
|
|
721
|
-
return /* @__PURE__ */
|
|
729
|
+
return /* @__PURE__ */ jsx20(
|
|
722
730
|
AlertDialogPrimitive.Overlay,
|
|
723
731
|
{
|
|
724
732
|
ref,
|
|
@@ -729,9 +737,9 @@ var AlertDialogOverlay = React16.forwardRef(function AlertDialogOverlay2({ class
|
|
|
729
737
|
});
|
|
730
738
|
AlertDialogOverlay.displayName = "AlertDialogOverlay";
|
|
731
739
|
var AlertDialogContent = React16.forwardRef(function AlertDialogContent2({ className, children, ...props }, ref) {
|
|
732
|
-
return /* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ jsxs4(AlertDialogPortal, { children: [
|
|
741
|
+
/* @__PURE__ */ jsx20(AlertDialogOverlay, {}),
|
|
742
|
+
/* @__PURE__ */ jsx20(
|
|
735
743
|
AlertDialogPrimitive.Content,
|
|
736
744
|
{
|
|
737
745
|
ref,
|
|
@@ -747,17 +755,17 @@ var AlertDialogContent = React16.forwardRef(function AlertDialogContent2({ class
|
|
|
747
755
|
});
|
|
748
756
|
AlertDialogContent.displayName = "AlertDialogContent";
|
|
749
757
|
function AlertDialogHeader({ className, ...props }) {
|
|
750
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ jsx20(View10, { className: cn17("flex flex-col gap-2", className), ...props });
|
|
751
759
|
}
|
|
752
760
|
function AlertDialogFooter({ className, ...props }) {
|
|
753
|
-
return /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ jsx20(View10, { className: cn17("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2", className), ...props });
|
|
754
762
|
}
|
|
755
763
|
var AlertDialogTitle = React16.forwardRef(function AlertDialogTitle2({ className, ...props }, ref) {
|
|
756
|
-
return /* @__PURE__ */
|
|
764
|
+
return /* @__PURE__ */ jsx20(TextClassContext8.Provider, { value: "text-lg font-semibold text-foreground", children: /* @__PURE__ */ jsx20(AlertDialogPrimitive.Title, { ref, className: cn17("text-lg font-semibold text-foreground", className), ...props }) });
|
|
757
765
|
});
|
|
758
766
|
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
759
767
|
var AlertDialogDescription = React16.forwardRef(function AlertDialogDescription2({ className, ...props }, ref) {
|
|
760
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ jsx20(AlertDialogPrimitive.Description, { ref, className: cn17("text-sm text-muted-foreground", className), ...props });
|
|
761
769
|
});
|
|
762
770
|
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
763
771
|
var AlertDialogAction = AlertDialogPrimitive.Action;
|
|
@@ -767,12 +775,12 @@ var AlertDialogCancel = AlertDialogPrimitive.Cancel;
|
|
|
767
775
|
import * as React17 from "react";
|
|
768
776
|
import { Select as SelectPrimitive } from "@tallyui/primitives";
|
|
769
777
|
import { cn as cn18 } from "@tallyui/theme";
|
|
770
|
-
import { jsx as
|
|
778
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
771
779
|
var Select = SelectPrimitive.Root;
|
|
772
780
|
var SelectGroup = SelectPrimitive.Group;
|
|
773
781
|
var SelectValue = SelectPrimitive.Value;
|
|
774
782
|
var SelectTrigger = React17.forwardRef(function SelectTrigger2({ className, children, ...props }, ref) {
|
|
775
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ jsx21(
|
|
776
784
|
SelectPrimitive.Trigger,
|
|
777
785
|
{
|
|
778
786
|
ref,
|
|
@@ -787,7 +795,7 @@ var SelectTrigger = React17.forwardRef(function SelectTrigger2({ className, chil
|
|
|
787
795
|
});
|
|
788
796
|
SelectTrigger.displayName = "SelectTrigger";
|
|
789
797
|
var SelectContent = React17.forwardRef(function SelectContent2({ className, children, ...props }, ref) {
|
|
790
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ jsx21(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx21(
|
|
791
799
|
SelectPrimitive.Content,
|
|
792
800
|
{
|
|
793
801
|
ref,
|
|
@@ -802,11 +810,11 @@ var SelectContent = React17.forwardRef(function SelectContent2({ className, chil
|
|
|
802
810
|
});
|
|
803
811
|
SelectContent.displayName = "SelectContent";
|
|
804
812
|
var SelectLabel = React17.forwardRef(function SelectLabel2({ className, ...props }, ref) {
|
|
805
|
-
return /* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ jsx21(SelectPrimitive.Label, { ref, className: cn18("py-1.5 pl-8 pr-2 text-sm font-semibold", className), ...props });
|
|
806
814
|
});
|
|
807
815
|
SelectLabel.displayName = "SelectLabel";
|
|
808
816
|
var SelectItem = React17.forwardRef(function SelectItem2({ className, ...props }, ref) {
|
|
809
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ jsx21(
|
|
810
818
|
SelectPrimitive.Item,
|
|
811
819
|
{
|
|
812
820
|
ref,
|
|
@@ -820,7 +828,7 @@ var SelectItem = React17.forwardRef(function SelectItem2({ className, ...props }
|
|
|
820
828
|
});
|
|
821
829
|
SelectItem.displayName = "SelectItem";
|
|
822
830
|
var SelectSeparator = React17.forwardRef(function SelectSeparator2({ className, ...props }, ref) {
|
|
823
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ jsx21(SelectPrimitive.Separator, { ref, className: cn18("-mx-1 my-1 h-px bg-muted", className), ...props });
|
|
824
832
|
});
|
|
825
833
|
SelectSeparator.displayName = "SelectSeparator";
|
|
826
834
|
|
|
@@ -829,10 +837,10 @@ import * as React18 from "react";
|
|
|
829
837
|
import { View as View11, Text as Text6 } from "react-native";
|
|
830
838
|
import { Combobox as ComboboxPrimitive, TextClassContext as TextClassContext9 } from "@tallyui/primitives";
|
|
831
839
|
import { cn as cn19 } from "@tallyui/theme";
|
|
832
|
-
import { jsx as
|
|
840
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
833
841
|
var Combobox = ComboboxPrimitive.Root;
|
|
834
842
|
var ComboboxTrigger = React18.forwardRef(function ComboboxTrigger2({ className, children, ...props }, ref) {
|
|
835
|
-
return /* @__PURE__ */
|
|
843
|
+
return /* @__PURE__ */ jsx22(
|
|
836
844
|
ComboboxPrimitive.Trigger,
|
|
837
845
|
{
|
|
838
846
|
ref,
|
|
@@ -847,7 +855,7 @@ var ComboboxTrigger = React18.forwardRef(function ComboboxTrigger2({ className,
|
|
|
847
855
|
});
|
|
848
856
|
ComboboxTrigger.displayName = "ComboboxTrigger";
|
|
849
857
|
var ComboboxInput = React18.forwardRef(function ComboboxInput2({ className, ...props }, ref) {
|
|
850
|
-
return /* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ jsx22(
|
|
851
859
|
ComboboxPrimitive.Input,
|
|
852
860
|
{
|
|
853
861
|
ref,
|
|
@@ -861,7 +869,7 @@ var ComboboxInput = React18.forwardRef(function ComboboxInput2({ className, ...p
|
|
|
861
869
|
});
|
|
862
870
|
ComboboxInput.displayName = "ComboboxInput";
|
|
863
871
|
var ComboboxContent = React18.forwardRef(function ComboboxContent2({ className, children, ...props }, ref) {
|
|
864
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ jsx22(ComboboxPrimitive.Portal, { children: /* @__PURE__ */ jsx22(TextClassContext9.Provider, { value: "text-popover-foreground", children: /* @__PURE__ */ jsx22(
|
|
865
873
|
ComboboxPrimitive.Content,
|
|
866
874
|
{
|
|
867
875
|
ref,
|
|
@@ -876,7 +884,7 @@ var ComboboxContent = React18.forwardRef(function ComboboxContent2({ className,
|
|
|
876
884
|
});
|
|
877
885
|
ComboboxContent.displayName = "ComboboxContent";
|
|
878
886
|
var ComboboxItem = React18.forwardRef(function ComboboxItem2({ className, ...props }, ref) {
|
|
879
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ jsx22(
|
|
880
888
|
ComboboxPrimitive.Item,
|
|
881
889
|
{
|
|
882
890
|
ref,
|
|
@@ -890,7 +898,7 @@ var ComboboxItem = React18.forwardRef(function ComboboxItem2({ className, ...pro
|
|
|
890
898
|
});
|
|
891
899
|
ComboboxItem.displayName = "ComboboxItem";
|
|
892
900
|
var ComboboxEmpty = React18.forwardRef(function ComboboxEmpty2({ className, ...props }, ref) {
|
|
893
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsx22(View11, { ref, className: cn19("py-6 text-center", className), ...props, children: /* @__PURE__ */ jsx22(Text6, { className: "text-sm text-muted-foreground", children: "No results found." }) });
|
|
894
902
|
});
|
|
895
903
|
ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
896
904
|
|
|
@@ -898,7 +906,7 @@ ComboboxEmpty.displayName = "ComboboxEmpty";
|
|
|
898
906
|
import * as React19 from "react";
|
|
899
907
|
import { DropdownMenu as DropdownMenuPrimitive, TextClassContext as TextClassContext10 } from "@tallyui/primitives";
|
|
900
908
|
import { cn as cn20 } from "@tallyui/theme";
|
|
901
|
-
import { jsx as
|
|
909
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
902
910
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
903
911
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
904
912
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
@@ -906,7 +914,7 @@ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
|
906
914
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
907
915
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
908
916
|
var DropdownMenuContent = React19.forwardRef(function DropdownMenuContent2({ className, sideOffset = 4, ...props }, ref) {
|
|
909
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ jsx23(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx23(
|
|
910
918
|
DropdownMenuPrimitive.Content,
|
|
911
919
|
{
|
|
912
920
|
ref,
|
|
@@ -921,7 +929,7 @@ var DropdownMenuContent = React19.forwardRef(function DropdownMenuContent2({ cla
|
|
|
921
929
|
});
|
|
922
930
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
923
931
|
var DropdownMenuItem = React19.forwardRef(function DropdownMenuItem2({ className, inset, ...props }, ref) {
|
|
924
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ jsx23(TextClassContext10.Provider, { value: "select-none text-sm", children: /* @__PURE__ */ jsx23(
|
|
925
933
|
DropdownMenuPrimitive.Item,
|
|
926
934
|
{
|
|
927
935
|
ref,
|
|
@@ -936,7 +944,7 @@ var DropdownMenuItem = React19.forwardRef(function DropdownMenuItem2({ className
|
|
|
936
944
|
});
|
|
937
945
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
938
946
|
var DropdownMenuCheckboxItem = React19.forwardRef(function DropdownMenuCheckboxItem2({ className, children, checked, ...props }, ref) {
|
|
939
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ jsx23(
|
|
940
948
|
DropdownMenuPrimitive.CheckboxItem,
|
|
941
949
|
{
|
|
942
950
|
ref,
|
|
@@ -952,7 +960,7 @@ var DropdownMenuCheckboxItem = React19.forwardRef(function DropdownMenuCheckboxI
|
|
|
952
960
|
});
|
|
953
961
|
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
954
962
|
var DropdownMenuRadioItem = React19.forwardRef(function DropdownMenuRadioItem2({ className, children, ...props }, ref) {
|
|
955
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ jsx23(
|
|
956
964
|
DropdownMenuPrimitive.RadioItem,
|
|
957
965
|
{
|
|
958
966
|
ref,
|
|
@@ -967,7 +975,7 @@ var DropdownMenuRadioItem = React19.forwardRef(function DropdownMenuRadioItem2({
|
|
|
967
975
|
});
|
|
968
976
|
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
969
977
|
var DropdownMenuLabel = React19.forwardRef(function DropdownMenuLabel2({ className, inset, ...props }, ref) {
|
|
970
|
-
return /* @__PURE__ */
|
|
978
|
+
return /* @__PURE__ */ jsx23(
|
|
971
979
|
DropdownMenuPrimitive.Label,
|
|
972
980
|
{
|
|
973
981
|
ref,
|
|
@@ -978,11 +986,11 @@ var DropdownMenuLabel = React19.forwardRef(function DropdownMenuLabel2({ classNa
|
|
|
978
986
|
});
|
|
979
987
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
980
988
|
var DropdownMenuSeparator = React19.forwardRef(function DropdownMenuSeparator2({ className, ...props }, ref) {
|
|
981
|
-
return /* @__PURE__ */
|
|
989
|
+
return /* @__PURE__ */ jsx23(DropdownMenuPrimitive.Separator, { ref, className: cn20("-mx-1 my-1 h-px bg-muted", className), ...props });
|
|
982
990
|
});
|
|
983
991
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
984
992
|
var DropdownMenuSubTrigger = React19.forwardRef(function DropdownMenuSubTrigger2({ className, inset, children, ...props }, ref) {
|
|
985
|
-
return /* @__PURE__ */
|
|
993
|
+
return /* @__PURE__ */ jsx23(TextClassContext10.Provider, { value: "select-none text-sm", children: /* @__PURE__ */ jsx23(
|
|
986
994
|
DropdownMenuPrimitive.SubTrigger,
|
|
987
995
|
{
|
|
988
996
|
ref,
|
|
@@ -998,7 +1006,7 @@ var DropdownMenuSubTrigger = React19.forwardRef(function DropdownMenuSubTrigger2
|
|
|
998
1006
|
});
|
|
999
1007
|
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
1000
1008
|
var DropdownMenuSubContent = React19.forwardRef(function DropdownMenuSubContent2({ className, ...props }, ref) {
|
|
1001
|
-
return /* @__PURE__ */
|
|
1009
|
+
return /* @__PURE__ */ jsx23(
|
|
1002
1010
|
DropdownMenuPrimitive.SubContent,
|
|
1003
1011
|
{
|
|
1004
1012
|
ref,
|
|
@@ -1016,7 +1024,7 @@ DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
|
1016
1024
|
import * as React20 from "react";
|
|
1017
1025
|
import { ContextMenu as ContextMenuPrimitive, TextClassContext as TextClassContext11 } from "@tallyui/primitives";
|
|
1018
1026
|
import { cn as cn21 } from "@tallyui/theme";
|
|
1019
|
-
import { jsx as
|
|
1027
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1020
1028
|
var ContextMenu = ContextMenuPrimitive.Root;
|
|
1021
1029
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1022
1030
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
@@ -1024,7 +1032,7 @@ var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
|
1024
1032
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
1025
1033
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
1026
1034
|
var ContextMenuContent = React20.forwardRef(function ContextMenuContent2({ className, ...props }, ref) {
|
|
1027
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ jsx24(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx24(
|
|
1028
1036
|
ContextMenuPrimitive.Content,
|
|
1029
1037
|
{
|
|
1030
1038
|
ref,
|
|
@@ -1038,7 +1046,7 @@ var ContextMenuContent = React20.forwardRef(function ContextMenuContent2({ class
|
|
|
1038
1046
|
});
|
|
1039
1047
|
ContextMenuContent.displayName = "ContextMenuContent";
|
|
1040
1048
|
var ContextMenuItem = React20.forwardRef(function ContextMenuItem2({ className, inset, ...props }, ref) {
|
|
1041
|
-
return /* @__PURE__ */
|
|
1049
|
+
return /* @__PURE__ */ jsx24(TextClassContext11.Provider, { value: "select-none text-sm", children: /* @__PURE__ */ jsx24(
|
|
1042
1050
|
ContextMenuPrimitive.Item,
|
|
1043
1051
|
{
|
|
1044
1052
|
ref,
|
|
@@ -1053,7 +1061,7 @@ var ContextMenuItem = React20.forwardRef(function ContextMenuItem2({ className,
|
|
|
1053
1061
|
});
|
|
1054
1062
|
ContextMenuItem.displayName = "ContextMenuItem";
|
|
1055
1063
|
var ContextMenuCheckboxItem = React20.forwardRef(function ContextMenuCheckboxItem2({ className, children, checked, ...props }, ref) {
|
|
1056
|
-
return /* @__PURE__ */
|
|
1064
|
+
return /* @__PURE__ */ jsx24(
|
|
1057
1065
|
ContextMenuPrimitive.CheckboxItem,
|
|
1058
1066
|
{
|
|
1059
1067
|
ref,
|
|
@@ -1069,7 +1077,7 @@ var ContextMenuCheckboxItem = React20.forwardRef(function ContextMenuCheckboxIte
|
|
|
1069
1077
|
});
|
|
1070
1078
|
ContextMenuCheckboxItem.displayName = "ContextMenuCheckboxItem";
|
|
1071
1079
|
var ContextMenuRadioItem = React20.forwardRef(function ContextMenuRadioItem2({ className, children, ...props }, ref) {
|
|
1072
|
-
return /* @__PURE__ */
|
|
1080
|
+
return /* @__PURE__ */ jsx24(
|
|
1073
1081
|
ContextMenuPrimitive.RadioItem,
|
|
1074
1082
|
{
|
|
1075
1083
|
ref,
|
|
@@ -1084,7 +1092,7 @@ var ContextMenuRadioItem = React20.forwardRef(function ContextMenuRadioItem2({ c
|
|
|
1084
1092
|
});
|
|
1085
1093
|
ContextMenuRadioItem.displayName = "ContextMenuRadioItem";
|
|
1086
1094
|
var ContextMenuLabel = React20.forwardRef(function ContextMenuLabel2({ className, inset, ...props }, ref) {
|
|
1087
|
-
return /* @__PURE__ */
|
|
1095
|
+
return /* @__PURE__ */ jsx24(
|
|
1088
1096
|
ContextMenuPrimitive.Label,
|
|
1089
1097
|
{
|
|
1090
1098
|
ref,
|
|
@@ -1095,11 +1103,11 @@ var ContextMenuLabel = React20.forwardRef(function ContextMenuLabel2({ className
|
|
|
1095
1103
|
});
|
|
1096
1104
|
ContextMenuLabel.displayName = "ContextMenuLabel";
|
|
1097
1105
|
var ContextMenuSeparator = React20.forwardRef(function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ jsx24(ContextMenuPrimitive.Separator, { ref, className: cn21("-mx-1 my-1 h-px bg-muted", className), ...props });
|
|
1099
1107
|
});
|
|
1100
1108
|
ContextMenuSeparator.displayName = "ContextMenuSeparator";
|
|
1101
1109
|
var ContextMenuSubTrigger = React20.forwardRef(function ContextMenuSubTrigger2({ className, inset, children, ...props }, ref) {
|
|
1102
|
-
return /* @__PURE__ */
|
|
1110
|
+
return /* @__PURE__ */ jsx24(TextClassContext11.Provider, { value: "select-none text-sm", children: /* @__PURE__ */ jsx24(
|
|
1103
1111
|
ContextMenuPrimitive.SubTrigger,
|
|
1104
1112
|
{
|
|
1105
1113
|
ref,
|
|
@@ -1115,7 +1123,7 @@ var ContextMenuSubTrigger = React20.forwardRef(function ContextMenuSubTrigger2({
|
|
|
1115
1123
|
});
|
|
1116
1124
|
ContextMenuSubTrigger.displayName = "ContextMenuSubTrigger";
|
|
1117
1125
|
var ContextMenuSubContent = React20.forwardRef(function ContextMenuSubContent2({ className, ...props }, ref) {
|
|
1118
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ jsx24(
|
|
1119
1127
|
ContextMenuPrimitive.SubContent,
|
|
1120
1128
|
{
|
|
1121
1129
|
ref,
|
|
@@ -1133,11 +1141,11 @@ ContextMenuSubContent.displayName = "ContextMenuSubContent";
|
|
|
1133
1141
|
import * as React21 from "react";
|
|
1134
1142
|
import { Popover as PopoverPrimitive, TextClassContext as TextClassContext12 } from "@tallyui/primitives";
|
|
1135
1143
|
import { cn as cn22 } from "@tallyui/theme";
|
|
1136
|
-
import { jsx as
|
|
1144
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1137
1145
|
var Popover = PopoverPrimitive.Root;
|
|
1138
1146
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
1139
1147
|
var PopoverContent = React21.forwardRef(function PopoverContent2({ className, align = "center", sideOffset = 4, ...props }, ref) {
|
|
1140
|
-
return /* @__PURE__ */
|
|
1148
|
+
return /* @__PURE__ */ jsx25(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx25(TextClassContext12.Provider, { value: "text-popover-foreground", children: /* @__PURE__ */ jsx25(
|
|
1141
1149
|
PopoverPrimitive.Content,
|
|
1142
1150
|
{
|
|
1143
1151
|
ref,
|
|
@@ -1157,11 +1165,11 @@ PopoverContent.displayName = "PopoverContent";
|
|
|
1157
1165
|
import * as React22 from "react";
|
|
1158
1166
|
import { Tooltip as TooltipPrimitive, TextClassContext as TextClassContext13 } from "@tallyui/primitives";
|
|
1159
1167
|
import { cn as cn23 } from "@tallyui/theme";
|
|
1160
|
-
import { jsx as
|
|
1168
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1161
1169
|
var Tooltip = TooltipPrimitive.Root;
|
|
1162
1170
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1163
1171
|
var TooltipContent = React22.forwardRef(function TooltipContent2({ className, sideOffset = 4, ...props }, ref) {
|
|
1164
|
-
return /* @__PURE__ */
|
|
1172
|
+
return /* @__PURE__ */ jsx26(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx26(TextClassContext13.Provider, { value: "text-sm text-popover-foreground", children: /* @__PURE__ */ jsx26(
|
|
1165
1173
|
TooltipPrimitive.Content,
|
|
1166
1174
|
{
|
|
1167
1175
|
ref,
|
|
@@ -1180,11 +1188,11 @@ TooltipContent.displayName = "TooltipContent";
|
|
|
1180
1188
|
import * as React23 from "react";
|
|
1181
1189
|
import { HoverCard as HoverCardPrimitive, TextClassContext as TextClassContext14 } from "@tallyui/primitives";
|
|
1182
1190
|
import { cn as cn24 } from "@tallyui/theme";
|
|
1183
|
-
import { jsx as
|
|
1191
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1184
1192
|
var HoverCard = HoverCardPrimitive.Root;
|
|
1185
1193
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
1186
1194
|
var HoverCardContent = React23.forwardRef(function HoverCardContent2({ className, align = "center", sideOffset = 4, ...props }, ref) {
|
|
1187
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ jsx27(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsx27(TextClassContext14.Provider, { value: "text-popover-foreground", children: /* @__PURE__ */ jsx27(
|
|
1188
1196
|
HoverCardPrimitive.Content,
|
|
1189
1197
|
{
|
|
1190
1198
|
ref,
|
|
@@ -1205,14 +1213,14 @@ import * as React24 from "react";
|
|
|
1205
1213
|
import { View as View12 } from "react-native";
|
|
1206
1214
|
import { Accordion as AccordionPrimitive, TextClassContext as TextClassContext15 } from "@tallyui/primitives";
|
|
1207
1215
|
import { cn as cn25 } from "@tallyui/theme";
|
|
1208
|
-
import { jsx as
|
|
1216
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1209
1217
|
var Accordion = AccordionPrimitive.Root;
|
|
1210
1218
|
var AccordionItem = React24.forwardRef(function AccordionItem2({ className, ...props }, ref) {
|
|
1211
|
-
return /* @__PURE__ */
|
|
1219
|
+
return /* @__PURE__ */ jsx28(AccordionPrimitive.Item, { ref, className: cn25("border-b border-border", className), ...props });
|
|
1212
1220
|
});
|
|
1213
1221
|
AccordionItem.displayName = "AccordionItem";
|
|
1214
1222
|
var AccordionTrigger = React24.forwardRef(function AccordionTrigger2({ className, children, ...props }, ref) {
|
|
1215
|
-
return /* @__PURE__ */
|
|
1223
|
+
return /* @__PURE__ */ jsx28(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsx28(TextClassContext15.Provider, { value: "text-sm font-medium", children: /* @__PURE__ */ jsx28(
|
|
1216
1224
|
AccordionPrimitive.Trigger,
|
|
1217
1225
|
{
|
|
1218
1226
|
ref,
|
|
@@ -1227,13 +1235,13 @@ var AccordionTrigger = React24.forwardRef(function AccordionTrigger2({ className
|
|
|
1227
1235
|
});
|
|
1228
1236
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
1229
1237
|
var AccordionContent = React24.forwardRef(function AccordionContent2({ className, children, ...props }, ref) {
|
|
1230
|
-
return /* @__PURE__ */
|
|
1238
|
+
return /* @__PURE__ */ jsx28(TextClassContext15.Provider, { value: "text-sm", children: /* @__PURE__ */ jsx28(
|
|
1231
1239
|
AccordionPrimitive.Content,
|
|
1232
1240
|
{
|
|
1233
1241
|
ref,
|
|
1234
1242
|
className: cn25("overflow-hidden text-sm web:transition-all", className),
|
|
1235
1243
|
...props,
|
|
1236
|
-
children: /* @__PURE__ */
|
|
1244
|
+
children: /* @__PURE__ */ jsx28(View12, { className: "pb-4 pt-0", children })
|
|
1237
1245
|
}
|
|
1238
1246
|
) });
|
|
1239
1247
|
});
|
|
@@ -1243,11 +1251,11 @@ AccordionContent.displayName = "AccordionContent";
|
|
|
1243
1251
|
import * as React25 from "react";
|
|
1244
1252
|
import { Collapsible as CollapsiblePrimitive, TextClassContext as TextClassContext16 } from "@tallyui/primitives";
|
|
1245
1253
|
import { cn as cn26 } from "@tallyui/theme";
|
|
1246
|
-
import { jsx as
|
|
1254
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1247
1255
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
1248
1256
|
var CollapsibleTrigger = CollapsiblePrimitive.Trigger;
|
|
1249
1257
|
var CollapsibleContent = React25.forwardRef(function CollapsibleContent2({ className, ...props }, ref) {
|
|
1250
|
-
return /* @__PURE__ */
|
|
1258
|
+
return /* @__PURE__ */ jsx29(TextClassContext16.Provider, { value: "text-sm", children: /* @__PURE__ */ jsx29(
|
|
1251
1259
|
CollapsiblePrimitive.Content,
|
|
1252
1260
|
{
|
|
1253
1261
|
ref,
|
|
@@ -1263,9 +1271,9 @@ import * as React26 from "react";
|
|
|
1263
1271
|
import { Text as Text7 } from "react-native";
|
|
1264
1272
|
import { Checkbox as CheckboxPrimitive } from "@tallyui/primitives";
|
|
1265
1273
|
import { cn as cn27 } from "@tallyui/theme";
|
|
1266
|
-
import { jsx as
|
|
1274
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1267
1275
|
var Checkbox = React26.forwardRef(function Checkbox2({ className, ...props }, ref) {
|
|
1268
|
-
return /* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ jsx30(
|
|
1269
1277
|
CheckboxPrimitive.Root,
|
|
1270
1278
|
{
|
|
1271
1279
|
ref,
|
|
@@ -1276,7 +1284,7 @@ var Checkbox = React26.forwardRef(function Checkbox2({ className, ...props }, re
|
|
|
1276
1284
|
className
|
|
1277
1285
|
),
|
|
1278
1286
|
...props,
|
|
1279
|
-
children: /* @__PURE__ */
|
|
1287
|
+
children: /* @__PURE__ */ jsx30(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: /* @__PURE__ */ jsx30(Text7, { className: "text-xs text-primary-foreground", children: "\u2713" }) })
|
|
1280
1288
|
}
|
|
1281
1289
|
);
|
|
1282
1290
|
});
|
|
@@ -1286,9 +1294,9 @@ Checkbox.displayName = "Checkbox";
|
|
|
1286
1294
|
import * as React27 from "react";
|
|
1287
1295
|
import { Switch as SwitchPrimitive } from "@tallyui/primitives";
|
|
1288
1296
|
import { cn as cn28 } from "@tallyui/theme";
|
|
1289
|
-
import { jsx as
|
|
1297
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1290
1298
|
var Switch = React27.forwardRef(function Switch2({ className, ...props }, ref) {
|
|
1291
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ jsx31(
|
|
1292
1300
|
SwitchPrimitive.Root,
|
|
1293
1301
|
{
|
|
1294
1302
|
ref,
|
|
@@ -1299,7 +1307,7 @@ var Switch = React27.forwardRef(function Switch2({ className, ...props }, ref) {
|
|
|
1299
1307
|
className
|
|
1300
1308
|
),
|
|
1301
1309
|
...props,
|
|
1302
|
-
children: /* @__PURE__ */
|
|
1310
|
+
children: /* @__PURE__ */ jsx31(
|
|
1303
1311
|
SwitchPrimitive.Thumb,
|
|
1304
1312
|
{
|
|
1305
1313
|
className: cn28(
|
|
@@ -1318,13 +1326,13 @@ import * as React28 from "react";
|
|
|
1318
1326
|
import { View as View14 } from "react-native";
|
|
1319
1327
|
import { RadioGroup as RadioGroupPrimitive } from "@tallyui/primitives";
|
|
1320
1328
|
import { cn as cn29 } from "@tallyui/theme";
|
|
1321
|
-
import { jsx as
|
|
1329
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1322
1330
|
var RadioGroup = React28.forwardRef(function RadioGroup2({ className, ...props }, ref) {
|
|
1323
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ jsx32(RadioGroupPrimitive.Root, { ref, className: cn29("grid gap-2", className), ...props });
|
|
1324
1332
|
});
|
|
1325
1333
|
RadioGroup.displayName = "RadioGroup";
|
|
1326
1334
|
var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({ className, ...props }, ref) {
|
|
1327
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ jsx32(
|
|
1328
1336
|
RadioGroupPrimitive.Item,
|
|
1329
1337
|
{
|
|
1330
1338
|
ref,
|
|
@@ -1334,7 +1342,7 @@ var RadioGroupItem = React28.forwardRef(function RadioGroupItem2({ className, ..
|
|
|
1334
1342
|
className
|
|
1335
1343
|
),
|
|
1336
1344
|
...props,
|
|
1337
|
-
children: /* @__PURE__ */
|
|
1345
|
+
children: /* @__PURE__ */ jsx32(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx32(View14, { className: "h-2.5 w-2.5 rounded-full bg-current" }) })
|
|
1338
1346
|
}
|
|
1339
1347
|
);
|
|
1340
1348
|
});
|
|
@@ -1345,7 +1353,7 @@ import * as React29 from "react";
|
|
|
1345
1353
|
import { Toggle as TogglePrimitive, TextClassContext as TextClassContext17 } from "@tallyui/primitives";
|
|
1346
1354
|
import { cn as cn30 } from "@tallyui/theme";
|
|
1347
1355
|
import { cva as cva10 } from "class-variance-authority";
|
|
1348
|
-
import { jsx as
|
|
1356
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1349
1357
|
var toggleVariants = cva10(
|
|
1350
1358
|
"inline-flex items-center justify-center rounded-md text-sm font-medium web:ring-offset-background web:transition-colors web:hover:bg-muted web:hover:text-muted-foreground web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2",
|
|
1351
1359
|
{
|
|
@@ -1384,7 +1392,7 @@ var toggleTextVariants = cva10("text-sm font-medium", {
|
|
|
1384
1392
|
}
|
|
1385
1393
|
});
|
|
1386
1394
|
var Toggle = React29.forwardRef(function Toggle2({ className, variant, size, ...props }, ref) {
|
|
1387
|
-
return /* @__PURE__ */
|
|
1395
|
+
return /* @__PURE__ */ jsx33(TextClassContext17.Provider, { value: toggleTextVariants({ variant, size }), children: /* @__PURE__ */ jsx33(
|
|
1388
1396
|
TogglePrimitive.Root,
|
|
1389
1397
|
{
|
|
1390
1398
|
ref,
|
|
@@ -1403,33 +1411,33 @@ Toggle.displayName = "Toggle";
|
|
|
1403
1411
|
import * as React30 from "react";
|
|
1404
1412
|
import { ToggleGroup as ToggleGroupPrimitive, TextClassContext as TextClassContext18 } from "@tallyui/primitives";
|
|
1405
1413
|
import { cn as cn31 } from "@tallyui/theme";
|
|
1406
|
-
import { jsx as
|
|
1414
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1407
1415
|
var ToggleGroupContext = React30.createContext({
|
|
1408
1416
|
size: "default",
|
|
1409
1417
|
variant: "default"
|
|
1410
1418
|
});
|
|
1411
1419
|
var ToggleGroup = React30.forwardRef(function ToggleGroup2({ className, variant, size, children, ...props }, ref) {
|
|
1412
|
-
return /* @__PURE__ */
|
|
1420
|
+
return /* @__PURE__ */ jsx34(
|
|
1413
1421
|
ToggleGroupPrimitive.Root,
|
|
1414
1422
|
{
|
|
1415
1423
|
ref,
|
|
1416
1424
|
className: cn31("flex flex-row items-center justify-center gap-1", className),
|
|
1417
1425
|
...props,
|
|
1418
|
-
children: /* @__PURE__ */
|
|
1426
|
+
children: /* @__PURE__ */ jsx34(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
1419
1427
|
}
|
|
1420
1428
|
);
|
|
1421
1429
|
});
|
|
1422
1430
|
ToggleGroup.displayName = "ToggleGroup";
|
|
1423
1431
|
var ToggleGroupItem = React30.forwardRef(function ToggleGroupItem2({ className, variant, size, ...props }, ref) {
|
|
1424
1432
|
const context = React30.useContext(ToggleGroupContext);
|
|
1425
|
-
return /* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ jsx34(
|
|
1426
1434
|
TextClassContext18.Provider,
|
|
1427
1435
|
{
|
|
1428
1436
|
value: toggleTextVariants({
|
|
1429
1437
|
variant: variant || context.variant,
|
|
1430
1438
|
size: size || context.size
|
|
1431
1439
|
}),
|
|
1432
|
-
children: /* @__PURE__ */
|
|
1440
|
+
children: /* @__PURE__ */ jsx34(
|
|
1433
1441
|
ToggleGroupPrimitive.Item,
|
|
1434
1442
|
{
|
|
1435
1443
|
ref,
|
|
@@ -1452,15 +1460,15 @@ ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
|
1452
1460
|
import * as React31 from "react";
|
|
1453
1461
|
import { Progress as ProgressPrimitive } from "@tallyui/primitives";
|
|
1454
1462
|
import { cn as cn32 } from "@tallyui/theme";
|
|
1455
|
-
import { jsx as
|
|
1463
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1456
1464
|
var Progress = React31.forwardRef(function Progress2({ className, value, ...props }, ref) {
|
|
1457
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ jsx35(
|
|
1458
1466
|
ProgressPrimitive.Root,
|
|
1459
1467
|
{
|
|
1460
1468
|
ref,
|
|
1461
1469
|
className: cn32("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className),
|
|
1462
1470
|
...props,
|
|
1463
|
-
children: /* @__PURE__ */
|
|
1471
|
+
children: /* @__PURE__ */ jsx35(
|
|
1464
1472
|
ProgressPrimitive.Indicator,
|
|
1465
1473
|
{
|
|
1466
1474
|
className: "h-full w-full flex-1 rounded-full bg-primary web:transition-all",
|
|
@@ -1476,17 +1484,17 @@ Progress.displayName = "Progress";
|
|
|
1476
1484
|
import * as React32 from "react";
|
|
1477
1485
|
import { Slider as SliderPrimitive } from "@tallyui/primitives";
|
|
1478
1486
|
import { cn as cn33 } from "@tallyui/theme";
|
|
1479
|
-
import { jsx as
|
|
1487
|
+
import { jsx as jsx36, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1480
1488
|
var Slider = React32.forwardRef(function Slider2({ className, ...props }, ref) {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1489
|
+
return /* @__PURE__ */ jsxs5(
|
|
1482
1490
|
SliderPrimitive.Root,
|
|
1483
1491
|
{
|
|
1484
1492
|
ref,
|
|
1485
1493
|
className: cn33("relative flex w-full touch-none select-none items-center", className),
|
|
1486
1494
|
...props,
|
|
1487
1495
|
children: [
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ jsx36(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: /* @__PURE__ */ jsx36(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }),
|
|
1497
|
+
/* @__PURE__ */ jsx36(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2" })
|
|
1490
1498
|
]
|
|
1491
1499
|
}
|
|
1492
1500
|
);
|
|
@@ -1497,7 +1505,7 @@ Slider.displayName = "Slider";
|
|
|
1497
1505
|
import { View as View15, Text as Text9, Pressable as Pressable5 } from "react-native";
|
|
1498
1506
|
import { cn as cn34 } from "@tallyui/theme";
|
|
1499
1507
|
import { cva as cva11 } from "class-variance-authority";
|
|
1500
|
-
import { jsx as
|
|
1508
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1501
1509
|
var toastVariants = cva11(
|
|
1502
1510
|
"group pointer-events-auto relative flex w-full flex-row items-center justify-between gap-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg",
|
|
1503
1511
|
{
|
|
@@ -1514,16 +1522,16 @@ var toastVariants = cva11(
|
|
|
1514
1522
|
}
|
|
1515
1523
|
);
|
|
1516
1524
|
function Toast({ className, variant, ...props }) {
|
|
1517
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ jsx37(View15, { className: cn34(toastVariants({ variant }), className), ...props });
|
|
1518
1526
|
}
|
|
1519
1527
|
function ToastTitle({ className, ...props }) {
|
|
1520
|
-
return /* @__PURE__ */
|
|
1528
|
+
return /* @__PURE__ */ jsx37(Text9, { className: cn34("text-sm font-semibold", className), ...props });
|
|
1521
1529
|
}
|
|
1522
1530
|
function ToastDescription({ className, ...props }) {
|
|
1523
|
-
return /* @__PURE__ */
|
|
1531
|
+
return /* @__PURE__ */ jsx37(Text9, { className: cn34("text-sm opacity-90", className), ...props });
|
|
1524
1532
|
}
|
|
1525
1533
|
function ToastClose({ className, ...props }) {
|
|
1526
|
-
return /* @__PURE__ */
|
|
1534
|
+
return /* @__PURE__ */ jsx37(
|
|
1527
1535
|
Pressable5,
|
|
1528
1536
|
{
|
|
1529
1537
|
className: cn34(
|
|
@@ -1531,7 +1539,7 @@ function ToastClose({ className, ...props }) {
|
|
|
1531
1539
|
className
|
|
1532
1540
|
),
|
|
1533
1541
|
...props,
|
|
1534
|
-
children: /* @__PURE__ */
|
|
1542
|
+
children: /* @__PURE__ */ jsx37(Text9, { className: "text-sm", children: "\u2715" })
|
|
1535
1543
|
}
|
|
1536
1544
|
);
|
|
1537
1545
|
}
|
|
@@ -1541,25 +1549,25 @@ import * as React33 from "react";
|
|
|
1541
1549
|
import { View as View16 } from "react-native";
|
|
1542
1550
|
import { TextClassContext as TextClassContext19 } from "@tallyui/primitives";
|
|
1543
1551
|
import { cn as cn35 } from "@tallyui/theme";
|
|
1544
|
-
import { jsx as
|
|
1552
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1545
1553
|
var Table = React33.forwardRef(function Table2({ className, ...props }, ref) {
|
|
1546
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ jsx38(View16, { ref, role: "table", className: cn35("w-full", className), ...props });
|
|
1547
1555
|
});
|
|
1548
1556
|
Table.displayName = "Table";
|
|
1549
1557
|
var TableHeader = React33.forwardRef(function TableHeader2({ className, ...props }, ref) {
|
|
1550
|
-
return /* @__PURE__ */
|
|
1558
|
+
return /* @__PURE__ */ jsx38(View16, { ref, role: "rowgroup", className: cn35("border-b border-border", className), ...props });
|
|
1551
1559
|
});
|
|
1552
1560
|
TableHeader.displayName = "TableHeader";
|
|
1553
1561
|
var TableBody = React33.forwardRef(function TableBody2({ className, ...props }, ref) {
|
|
1554
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ jsx38(View16, { ref, role: "rowgroup", className: cn35("[&>*:last-child]:border-0", className), ...props });
|
|
1555
1563
|
});
|
|
1556
1564
|
TableBody.displayName = "TableBody";
|
|
1557
1565
|
var TableFooter = React33.forwardRef(function TableFooter2({ className, ...props }, ref) {
|
|
1558
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsx38(View16, { ref, role: "rowgroup", className: cn35("border-t border-border bg-muted/50 font-medium", className), ...props });
|
|
1559
1567
|
});
|
|
1560
1568
|
TableFooter.displayName = "TableFooter";
|
|
1561
1569
|
var TableRow = React33.forwardRef(function TableRow2({ className, ...props }, ref) {
|
|
1562
|
-
return /* @__PURE__ */
|
|
1570
|
+
return /* @__PURE__ */ jsx38(
|
|
1563
1571
|
View16,
|
|
1564
1572
|
{
|
|
1565
1573
|
ref,
|
|
@@ -1571,7 +1579,7 @@ var TableRow = React33.forwardRef(function TableRow2({ className, ...props }, re
|
|
|
1571
1579
|
});
|
|
1572
1580
|
TableRow.displayName = "TableRow";
|
|
1573
1581
|
var TableHead = React33.forwardRef(function TableHead2({ className, ...props }, ref) {
|
|
1574
|
-
return /* @__PURE__ */
|
|
1582
|
+
return /* @__PURE__ */ jsx38(TextClassContext19.Provider, { value: "text-muted-foreground text-xs uppercase text-left font-medium", children: /* @__PURE__ */ jsx38(
|
|
1575
1583
|
View16,
|
|
1576
1584
|
{
|
|
1577
1585
|
ref,
|
|
@@ -1583,23 +1591,23 @@ var TableHead = React33.forwardRef(function TableHead2({ className, ...props },
|
|
|
1583
1591
|
});
|
|
1584
1592
|
TableHead.displayName = "TableHead";
|
|
1585
1593
|
var TableCell = React33.forwardRef(function TableCell2({ className, ...props }, ref) {
|
|
1586
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ jsx38(View16, { ref, role: "cell", className: cn35("flex-1 px-4 py-4", className), ...props });
|
|
1587
1595
|
});
|
|
1588
1596
|
TableCell.displayName = "TableCell";
|
|
1589
1597
|
|
|
1590
1598
|
// src/product/product-title.tsx
|
|
1591
1599
|
import { useProductTraits } from "@tallyui/core";
|
|
1592
1600
|
import { cn as cn36 } from "@tallyui/theme";
|
|
1593
|
-
import { jsx as
|
|
1601
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1594
1602
|
function ProductTitle({ doc, className, ...textProps }) {
|
|
1595
1603
|
const { getName } = useProductTraits();
|
|
1596
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ jsx39(Text, { className: cn36("font-semibold", className), ...textProps, children: getName(doc) });
|
|
1597
1605
|
}
|
|
1598
1606
|
|
|
1599
1607
|
// src/product/product-price.tsx
|
|
1600
1608
|
import { formatMoney, minorUnitDigits, moneyToMajor, resolvePrice, resolvePriceRange, useProductTraits as useProductTraits2, useTraitContext } from "@tallyui/core";
|
|
1601
1609
|
import { cn as cn37 } from "@tallyui/theme";
|
|
1602
|
-
import { jsx as
|
|
1610
|
+
import { jsx as jsx40, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1603
1611
|
function ProductPrice({ doc, currency, locale, currencySymbol: currencySymbol4 = "$", className, showFromPrice = true, fromLabel, formatFrom, ...textProps }) {
|
|
1604
1612
|
const { getPrices, getVariants } = useProductTraits2();
|
|
1605
1613
|
const traitContext = useTraitContext();
|
|
@@ -1609,7 +1617,7 @@ function ProductPrice({ doc, currency, locale, currencySymbol: currencySymbol4 =
|
|
|
1609
1617
|
const range = variants && variants.length >= 2 ? resolvePriceRange(variants, effectiveCurrency) : void 0;
|
|
1610
1618
|
const applyFormatFrom = formatFrom ?? (fromLabel !== void 0 ? (price) => `${fromLabel} ${price}` : (price) => `from ${price}`);
|
|
1611
1619
|
if (range && range.min.amount !== range.max.amount) {
|
|
1612
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsx40(
|
|
1613
1621
|
Text,
|
|
1614
1622
|
{
|
|
1615
1623
|
className: cn37("text-sm font-medium text-price", className),
|
|
@@ -1621,10 +1629,10 @@ function ProductPrice({ doc, currency, locale, currencySymbol: currencySymbol4 =
|
|
|
1621
1629
|
}
|
|
1622
1630
|
const resolved = resolvePrice(getPrices(doc, traitContext), effectiveCurrency);
|
|
1623
1631
|
if (!resolved) {
|
|
1624
|
-
return /* @__PURE__ */
|
|
1632
|
+
return /* @__PURE__ */ jsx40(Text, { className: cn37("text-sm text-muted-foreground", className), ...textProps, children: "-" });
|
|
1625
1633
|
}
|
|
1626
1634
|
if (resolved.was) {
|
|
1627
|
-
return /* @__PURE__ */
|
|
1635
|
+
return /* @__PURE__ */ jsxs6(
|
|
1628
1636
|
Text,
|
|
1629
1637
|
{
|
|
1630
1638
|
className: cn37("text-sm font-semibold text-sale", className),
|
|
@@ -1633,7 +1641,7 @@ function ProductPrice({ doc, currency, locale, currencySymbol: currencySymbol4 =
|
|
|
1633
1641
|
children: [
|
|
1634
1642
|
format(resolved.current),
|
|
1635
1643
|
" ",
|
|
1636
|
-
/* @__PURE__ */
|
|
1644
|
+
/* @__PURE__ */ jsxs6(Text, { className: "text-muted-foreground line-through", style: { textDecorationLine: "line-through" }, children: [
|
|
1637
1645
|
"(was ",
|
|
1638
1646
|
format(resolved.was),
|
|
1639
1647
|
")"
|
|
@@ -1642,7 +1650,7 @@ function ProductPrice({ doc, currency, locale, currencySymbol: currencySymbol4 =
|
|
|
1642
1650
|
}
|
|
1643
1651
|
);
|
|
1644
1652
|
}
|
|
1645
|
-
return /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ jsx40(
|
|
1646
1654
|
Text,
|
|
1647
1655
|
{
|
|
1648
1656
|
className: cn37("text-sm font-medium text-price", className),
|
|
@@ -1658,25 +1666,25 @@ import { View as View17 } from "react-native";
|
|
|
1658
1666
|
import { Image as Image2 } from "@tallyui/primitives";
|
|
1659
1667
|
import { useProductTraits as useProductTraits3 } from "@tallyui/core";
|
|
1660
1668
|
import { cn as cn38 } from "@tallyui/theme";
|
|
1661
|
-
import { jsx as
|
|
1669
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1662
1670
|
function ProductImage({ doc, size = 60, style, showPlaceholder = false, className, ...imageProps }) {
|
|
1663
1671
|
const { getImageUrl, getName } = useProductTraits3();
|
|
1664
1672
|
const imageUrl = getImageUrl(doc);
|
|
1665
1673
|
if (!imageUrl) {
|
|
1666
1674
|
if (!showPlaceholder) return null;
|
|
1667
1675
|
const name = getName(doc);
|
|
1668
|
-
return /* @__PURE__ */
|
|
1676
|
+
return /* @__PURE__ */ jsx41(
|
|
1669
1677
|
View17,
|
|
1670
1678
|
{
|
|
1671
1679
|
role: "img",
|
|
1672
1680
|
"aria-label": name,
|
|
1673
1681
|
className: cn38("items-center justify-center rounded border border-border bg-primary/10", className),
|
|
1674
1682
|
style: { width: size, height: size },
|
|
1675
|
-
children: /* @__PURE__ */
|
|
1683
|
+
children: /* @__PURE__ */ jsx41(Text, { className: "font-semibold text-primary", style: { fontSize: size * 0.4 }, children: name.trim().charAt(0).toUpperCase() || "?" })
|
|
1676
1684
|
}
|
|
1677
1685
|
);
|
|
1678
1686
|
}
|
|
1679
|
-
return /* @__PURE__ */
|
|
1687
|
+
return /* @__PURE__ */ jsx41(
|
|
1680
1688
|
Image2.Root,
|
|
1681
1689
|
{
|
|
1682
1690
|
source: { uri: imageUrl },
|
|
@@ -1691,19 +1699,19 @@ function ProductImage({ doc, size = 60, style, showPlaceholder = false, classNam
|
|
|
1691
1699
|
// src/product/product-sku.tsx
|
|
1692
1700
|
import { useProductTraits as useProductTraits4 } from "@tallyui/core";
|
|
1693
1701
|
import { cn as cn39 } from "@tallyui/theme";
|
|
1694
|
-
import { jsx as
|
|
1702
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1695
1703
|
function ProductSku({ doc, fallback = "\u2014", className, ...textProps }) {
|
|
1696
1704
|
const { getSku, getVariantCount } = useProductTraits4();
|
|
1697
1705
|
const count2 = getVariantCount(doc);
|
|
1698
1706
|
const sku = getSku(doc);
|
|
1699
|
-
return /* @__PURE__ */
|
|
1707
|
+
return /* @__PURE__ */ jsx42(Text, { className: cn39("text-xs text-muted-foreground", className), ...textProps, children: count2 > 1 ? `${count2} variants` : sku ?? fallback });
|
|
1700
1708
|
}
|
|
1701
1709
|
|
|
1702
1710
|
// src/product/product-stock-badge.tsx
|
|
1703
1711
|
import { View as View18 } from "react-native";
|
|
1704
1712
|
import { useProductStock } from "@tallyui/core";
|
|
1705
1713
|
import { cn as cn40 } from "@tallyui/theme";
|
|
1706
|
-
import { jsx as
|
|
1714
|
+
import { jsx as jsx43, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1707
1715
|
var statusLabels = {
|
|
1708
1716
|
in_stock: "In Stock",
|
|
1709
1717
|
out_of_stock: "Out of Stock",
|
|
@@ -1740,18 +1748,18 @@ function ProductStockBadge({ doc, showQuantity = false, showAsOf = true, classNa
|
|
|
1740
1748
|
const { status, quantity, asOf } = useProductStock(doc);
|
|
1741
1749
|
const label = statusLabels[status] ?? statusLabels.unknown;
|
|
1742
1750
|
const styles = STATUS_STYLES[status] ?? STATUS_STYLES.unknown;
|
|
1743
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ jsxs7(
|
|
1744
1752
|
HStack,
|
|
1745
1753
|
{
|
|
1746
1754
|
space: "none",
|
|
1747
1755
|
className: cn40("gap-1.5 self-start rounded-xl px-2 py-1", styles.badge, className),
|
|
1748
1756
|
...props,
|
|
1749
1757
|
children: [
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ jsx43(View18, { className: cn40("h-1.5 w-1.5 rounded-full", styles.dot) }),
|
|
1759
|
+
/* @__PURE__ */ jsxs7(Text, { className: cn40("text-xs font-semibold", styles.text), children: [
|
|
1752
1760
|
label,
|
|
1753
1761
|
status !== "out_of_stock" && showQuantity && quantity != null ? ` (${quantity})` : "",
|
|
1754
|
-
asOf && showAsOf ? /* @__PURE__ */
|
|
1762
|
+
asOf && showAsOf ? /* @__PURE__ */ jsx43(Text, { className: "text-xs font-normal text-muted-foreground", children: ` \xB7 as of ${formatAsOf(asOf)}` }) : null
|
|
1755
1763
|
] })
|
|
1756
1764
|
]
|
|
1757
1765
|
}
|
|
@@ -1762,7 +1770,7 @@ function ProductStockBadge({ doc, showQuantity = false, showAsOf = true, classNa
|
|
|
1762
1770
|
import { Pressable as Pressable7 } from "react-native";
|
|
1763
1771
|
import { cn as cn41 } from "@tallyui/theme";
|
|
1764
1772
|
import { useProductTraits as useProductTraits5 } from "@tallyui/core";
|
|
1765
|
-
import { jsx as
|
|
1773
|
+
import { jsx as jsx44, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1766
1774
|
function ProductCard({ doc, onPress, imageSize = 80, currencySymbol: currencySymbol4, notSoldLabel = "Not sold here", className, ...props }) {
|
|
1767
1775
|
let traits;
|
|
1768
1776
|
try {
|
|
@@ -1771,24 +1779,24 @@ function ProductCard({ doc, onPress, imageSize = 80, currencySymbol: currencySym
|
|
|
1771
1779
|
traits = void 0;
|
|
1772
1780
|
}
|
|
1773
1781
|
const sellable = !traits || traits.isSellable(doc);
|
|
1774
|
-
const content = /* @__PURE__ */
|
|
1782
|
+
const content = /* @__PURE__ */ jsxs8(
|
|
1775
1783
|
VStack,
|
|
1776
1784
|
{
|
|
1777
1785
|
space: "sm",
|
|
1778
1786
|
className: cn41("items-center rounded-lg border border-border bg-card p-3", className),
|
|
1779
1787
|
...props,
|
|
1780
1788
|
children: [
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
sellable ? /* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ jsx44(ProductImage, { doc, size: imageSize, className: cn41("rounded-md", !sellable && "opacity-50") }),
|
|
1790
|
+
/* @__PURE__ */ jsx44(ProductTitle, { doc, className: cn41("text-sm", !sellable && "opacity-50"), numberOfLines: 2 }),
|
|
1791
|
+
sellable ? /* @__PURE__ */ jsx44(ProductPrice, { doc, currencySymbol: currencySymbol4 }) : /* @__PURE__ */ jsx44(Text, { className: "text-sm text-muted-foreground", children: notSoldLabel })
|
|
1784
1792
|
]
|
|
1785
1793
|
}
|
|
1786
1794
|
);
|
|
1787
1795
|
if (!sellable) {
|
|
1788
|
-
return /* @__PURE__ */
|
|
1796
|
+
return /* @__PURE__ */ jsx44(Pressable7, { disabled: true, "aria-disabled": true, onPress: void 0, children: content });
|
|
1789
1797
|
}
|
|
1790
1798
|
if (onPress) {
|
|
1791
|
-
return /* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ jsx44(Pressable7, { onPress, children: content });
|
|
1792
1800
|
}
|
|
1793
1801
|
return content;
|
|
1794
1802
|
}
|
|
@@ -1797,7 +1805,7 @@ function ProductCard({ doc, onPress, imageSize = 80, currencySymbol: currencySym
|
|
|
1797
1805
|
import { FlatList, View as View19 } from "react-native";
|
|
1798
1806
|
import { cn as cn42 } from "@tallyui/theme";
|
|
1799
1807
|
import { useProductTraits as useProductTraits6 } from "@tallyui/core";
|
|
1800
|
-
import { jsx as
|
|
1808
|
+
import { jsx as jsx45, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1801
1809
|
var INITIAL_ROWS = 8;
|
|
1802
1810
|
var BATCH_ROWS = 8;
|
|
1803
1811
|
var WINDOW_SIZE = 5;
|
|
@@ -1820,10 +1828,10 @@ function ProductGrid({
|
|
|
1820
1828
|
}
|
|
1821
1829
|
const visibleItems = showUnsellable || !traits ? items : items.filter((item) => traits.isSellable(item));
|
|
1822
1830
|
const hasItems = visibleItems.length > 0;
|
|
1823
|
-
return /* @__PURE__ */
|
|
1824
|
-
searchSlot && /* @__PURE__ */
|
|
1825
|
-
filterSlot && /* @__PURE__ */
|
|
1826
|
-
hasItems ? /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ jsxs9(VStack, { space: "none", className: cn42("flex-1", className), ...viewProps, children: [
|
|
1832
|
+
searchSlot && /* @__PURE__ */ jsx45(View19, { className: "px-3 py-2", children: searchSlot }),
|
|
1833
|
+
filterSlot && /* @__PURE__ */ jsx45(View19, { className: "px-3 pb-2", children: filterSlot }),
|
|
1834
|
+
hasItems ? /* @__PURE__ */ jsx45(
|
|
1827
1835
|
FlatList,
|
|
1828
1836
|
{
|
|
1829
1837
|
data: visibleItems,
|
|
@@ -1833,7 +1841,7 @@ function ProductGrid({
|
|
|
1833
1841
|
initialNumToRender: INITIAL_ROWS,
|
|
1834
1842
|
maxToRenderPerBatch: BATCH_ROWS,
|
|
1835
1843
|
windowSize: WINDOW_SIZE,
|
|
1836
|
-
renderItem: ({ item, index }) => /* @__PURE__ */
|
|
1844
|
+
renderItem: ({ item, index }) => /* @__PURE__ */ jsx45(View19, { style: { width: `${100 / numColumns}%` }, className: "p-1", children: renderItem(item, index) })
|
|
1837
1845
|
},
|
|
1838
1846
|
numColumns
|
|
1839
1847
|
) : emptyState ?? null
|
|
@@ -1843,7 +1851,7 @@ function ProductGrid({
|
|
|
1843
1851
|
// src/product/product-list.tsx
|
|
1844
1852
|
import { ScrollView as ScrollView2, View as View20 } from "react-native";
|
|
1845
1853
|
import { cn as cn43 } from "@tallyui/theme";
|
|
1846
|
-
import { jsx as
|
|
1854
|
+
import { jsx as jsx46, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1847
1855
|
function ProductList({
|
|
1848
1856
|
items,
|
|
1849
1857
|
renderItem,
|
|
@@ -1854,17 +1862,17 @@ function ProductList({
|
|
|
1854
1862
|
...viewProps
|
|
1855
1863
|
}) {
|
|
1856
1864
|
const hasItems = items.length > 0;
|
|
1857
|
-
return /* @__PURE__ */
|
|
1858
|
-
searchSlot && /* @__PURE__ */
|
|
1859
|
-
filterSlot && /* @__PURE__ */
|
|
1860
|
-
hasItems ? /* @__PURE__ */
|
|
1865
|
+
return /* @__PURE__ */ jsxs10(View20, { className: cn43("flex-1", className), ...viewProps, children: [
|
|
1866
|
+
searchSlot && /* @__PURE__ */ jsx46(View20, { className: "px-3 py-2", children: searchSlot }),
|
|
1867
|
+
filterSlot && /* @__PURE__ */ jsx46(View20, { className: "px-3 pb-2", children: filterSlot }),
|
|
1868
|
+
hasItems ? /* @__PURE__ */ jsx46(ScrollView2, { className: "flex-1", children: items.map((item, index) => /* @__PURE__ */ jsx46(View20, { className: "border-b border-border", children: renderItem(item, index) }, item.id ?? index)) }) : emptyState ?? null
|
|
1861
1869
|
] });
|
|
1862
1870
|
}
|
|
1863
1871
|
|
|
1864
1872
|
// src/product/category-nav.tsx
|
|
1865
1873
|
import { Pressable as Pressable8, ScrollView as ScrollView3, Text as Text11, View as View21 } from "react-native";
|
|
1866
1874
|
import { cn as cn44 } from "@tallyui/theme";
|
|
1867
|
-
import { jsx as
|
|
1875
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1868
1876
|
function CategoryNav({
|
|
1869
1877
|
categories,
|
|
1870
1878
|
selectedId,
|
|
@@ -1876,7 +1884,7 @@ function CategoryNav({
|
|
|
1876
1884
|
const isHorizontal = orientation === "horizontal";
|
|
1877
1885
|
const content = categories.map((cat) => {
|
|
1878
1886
|
const active = cat.id === selectedId;
|
|
1879
|
-
return /* @__PURE__ */
|
|
1887
|
+
return /* @__PURE__ */ jsx47(
|
|
1880
1888
|
Pressable8,
|
|
1881
1889
|
{
|
|
1882
1890
|
onPress: () => onSelect(cat.id),
|
|
@@ -1884,7 +1892,7 @@ function CategoryNav({
|
|
|
1884
1892
|
"rounded-full px-3 py-1.5",
|
|
1885
1893
|
active ? "bg-primary" : "bg-muted"
|
|
1886
1894
|
),
|
|
1887
|
-
children: /* @__PURE__ */
|
|
1895
|
+
children: /* @__PURE__ */ jsx47(
|
|
1888
1896
|
Text11,
|
|
1889
1897
|
{
|
|
1890
1898
|
className: cn44(
|
|
@@ -1899,7 +1907,7 @@ function CategoryNav({
|
|
|
1899
1907
|
);
|
|
1900
1908
|
});
|
|
1901
1909
|
if (isHorizontal) {
|
|
1902
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ jsx47(
|
|
1903
1911
|
ScrollView3,
|
|
1904
1912
|
{
|
|
1905
1913
|
horizontal: true,
|
|
@@ -1911,13 +1919,13 @@ function CategoryNav({
|
|
|
1911
1919
|
}
|
|
1912
1920
|
);
|
|
1913
1921
|
}
|
|
1914
|
-
return /* @__PURE__ */
|
|
1922
|
+
return /* @__PURE__ */ jsx47(View21, { className: cn44("gap-1 p-2", className), ...viewProps, children: content });
|
|
1915
1923
|
}
|
|
1916
1924
|
|
|
1917
1925
|
// src/product/product-variant-picker.tsx
|
|
1918
1926
|
import { Pressable as Pressable9, Text as Text12, View as View22 } from "react-native";
|
|
1919
1927
|
import { cn as cn45 } from "@tallyui/theme";
|
|
1920
|
-
import { jsx as
|
|
1928
|
+
import { jsx as jsx48, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1921
1929
|
function ProductVariantPicker({
|
|
1922
1930
|
options,
|
|
1923
1931
|
selected = {},
|
|
@@ -1928,11 +1936,11 @@ function ProductVariantPicker({
|
|
|
1928
1936
|
const handleSelect = (optionName, value) => {
|
|
1929
1937
|
onSelect?.({ ...selected, [optionName]: value });
|
|
1930
1938
|
};
|
|
1931
|
-
return /* @__PURE__ */
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1939
|
+
return /* @__PURE__ */ jsx48(View22, { className: cn45("gap-3", className), ...viewProps, children: options.map((option) => /* @__PURE__ */ jsxs11(View22, { className: "gap-1.5", children: [
|
|
1940
|
+
/* @__PURE__ */ jsx48(Text12, { className: "text-xs font-semibold text-muted-foreground", children: option.name }),
|
|
1941
|
+
/* @__PURE__ */ jsx48(View22, { className: "flex-row flex-wrap gap-2", children: option.values.map((value) => {
|
|
1934
1942
|
const active = selected[option.name] === value;
|
|
1935
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ jsx48(
|
|
1936
1944
|
Pressable9,
|
|
1937
1945
|
{
|
|
1938
1946
|
onPress: () => handleSelect(option.name, value),
|
|
@@ -1940,7 +1948,7 @@ function ProductVariantPicker({
|
|
|
1940
1948
|
"rounded-lg border px-3 py-1.5",
|
|
1941
1949
|
active ? "border-primary bg-primary/10" : "border-border bg-card"
|
|
1942
1950
|
),
|
|
1943
|
-
children: /* @__PURE__ */
|
|
1951
|
+
children: /* @__PURE__ */ jsx48(
|
|
1944
1952
|
Text12,
|
|
1945
1953
|
{
|
|
1946
1954
|
className: cn45(
|
|
@@ -1960,21 +1968,21 @@ function ProductVariantPicker({
|
|
|
1960
1968
|
// src/cart/cart-line.tsx
|
|
1961
1969
|
import { formatMoney as formatMoney2 } from "@tallyui/core";
|
|
1962
1970
|
import { cn as cn46 } from "@tallyui/theme";
|
|
1963
|
-
import { jsx as
|
|
1971
|
+
import { jsx as jsx49, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1964
1972
|
function CartLine({ name, quantity, unitPrice, lineTotal, locale, className, ...props }) {
|
|
1965
|
-
return /* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
1973
|
+
return /* @__PURE__ */ jsxs12(HStack, { className: cn46("px-3 py-2.5", className), ...props, children: [
|
|
1974
|
+
/* @__PURE__ */ jsxs12(VStack, { space: "none", className: "flex-1 gap-0.5", children: [
|
|
1975
|
+
/* @__PURE__ */ jsx49(Text, { className: "text-sm font-medium", numberOfLines: 1, children: name }),
|
|
1976
|
+
/* @__PURE__ */ jsx49(Text, { className: "text-xs text-muted-foreground", children: `${formatMoney2(unitPrice, locale) ?? "\u2014"} \xD7 ${quantity}` })
|
|
1969
1977
|
] }),
|
|
1970
|
-
/* @__PURE__ */
|
|
1978
|
+
/* @__PURE__ */ jsx49(Text, { className: "text-sm font-semibold", children: formatMoney2(lineTotal, locale) ?? "\u2014" })
|
|
1971
1979
|
] });
|
|
1972
1980
|
}
|
|
1973
1981
|
|
|
1974
1982
|
// src/cart/cart-total.tsx
|
|
1975
1983
|
import { formatMoney as formatMoney3 } from "@tallyui/core";
|
|
1976
1984
|
import { cn as cn47 } from "@tallyui/theme";
|
|
1977
|
-
import { jsx as
|
|
1985
|
+
import { jsx as jsx50, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1978
1986
|
function CartTotal({
|
|
1979
1987
|
subtotal,
|
|
1980
1988
|
taxLines,
|
|
@@ -1985,25 +1993,25 @@ function CartTotal({
|
|
|
1985
1993
|
className,
|
|
1986
1994
|
...props
|
|
1987
1995
|
}) {
|
|
1988
|
-
return /* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ jsxs13(VStack, { space: "none", className: cn47("gap-1.5 px-3 py-3", className), ...props, children: [
|
|
1997
|
+
/* @__PURE__ */ jsxs13(HStack, { space: "none", className: "justify-between", children: [
|
|
1998
|
+
/* @__PURE__ */ jsx50(Text, { className: "text-sm text-muted-foreground", children: "Subtotal" }),
|
|
1999
|
+
/* @__PURE__ */ jsx50(Text, { className: "text-sm", children: formatMoney3(subtotal, locale) ?? "\u2014" })
|
|
1992
2000
|
] }),
|
|
1993
|
-
discount && discount.amount > 0 && /* @__PURE__ */
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
2001
|
+
discount && discount.amount > 0 && /* @__PURE__ */ jsxs13(HStack, { space: "none", className: "justify-between", children: [
|
|
2002
|
+
/* @__PURE__ */ jsx50(Text, { className: "text-sm text-muted-foreground", children: "Discount" }),
|
|
2003
|
+
/* @__PURE__ */ jsxs13(Text, { className: "text-sm", children: [
|
|
1996
2004
|
"\u2212",
|
|
1997
2005
|
formatMoney3(discount, locale) ?? "\u2014"
|
|
1998
2006
|
] })
|
|
1999
2007
|
] }),
|
|
2000
|
-
taxLines?.map((line, index) => /* @__PURE__ */
|
|
2001
|
-
/* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2008
|
+
taxLines?.map((line, index) => /* @__PURE__ */ jsxs13(HStack, { space: "none", className: "justify-between", children: [
|
|
2009
|
+
/* @__PURE__ */ jsx50(Text, { className: "text-sm text-muted-foreground", children: taxInclusive ? `incl. ${line.label}` : line.label }),
|
|
2010
|
+
/* @__PURE__ */ jsx50(Text, { className: "text-sm", children: formatMoney3(line.amount, locale) ?? "\u2014" })
|
|
2003
2011
|
] }, index)),
|
|
2004
|
-
/* @__PURE__ */
|
|
2005
|
-
/* @__PURE__ */
|
|
2006
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ jsxs13(HStack, { space: "none", className: "mt-1.5 justify-between border-t border-border pt-2", children: [
|
|
2013
|
+
/* @__PURE__ */ jsx50(Text, { className: "font-bold", children: "Total" }),
|
|
2014
|
+
/* @__PURE__ */ jsx50(Text, { className: "font-bold", children: formatMoney3(total, locale) ?? "\u2014" })
|
|
2007
2015
|
] })
|
|
2008
2016
|
] });
|
|
2009
2017
|
}
|
|
@@ -2011,7 +2019,7 @@ function CartTotal({
|
|
|
2011
2019
|
// src/cart/cart-panel.tsx
|
|
2012
2020
|
import { ScrollView as ScrollView4, View as View23 } from "react-native";
|
|
2013
2021
|
import { cn as cn48 } from "@tallyui/theme";
|
|
2014
|
-
import { jsx as
|
|
2022
|
+
import { jsx as jsx51, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2015
2023
|
function defaultKey(item, index) {
|
|
2016
2024
|
const id = item?.id;
|
|
2017
2025
|
return typeof id === "string" || typeof id === "number" ? String(id) : String(index);
|
|
@@ -2028,27 +2036,27 @@ function CartPanel({
|
|
|
2028
2036
|
...props
|
|
2029
2037
|
}) {
|
|
2030
2038
|
const hasItems = items.length > 0;
|
|
2031
|
-
return /* @__PURE__ */
|
|
2032
|
-
header && /* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
hasItems ? items.map((item, index) => /* @__PURE__ */
|
|
2039
|
+
return /* @__PURE__ */ jsxs14(VStack, { space: "none", className: cn48("flex-1 min-h-0", className), ...props, children: [
|
|
2040
|
+
header && /* @__PURE__ */ jsx51(View23, { className: "border-b border-border px-3 py-2", children: header }),
|
|
2041
|
+
/* @__PURE__ */ jsxs14(ScrollView4, { className: "flex-1 min-h-0", contentContainerClassName: "flex-grow", children: [
|
|
2042
|
+
hasItems ? items.map((item, index) => /* @__PURE__ */ jsx51(View23, { children: renderItem(item, index) }, keyExtractor ? keyExtractor(item, index) : defaultKey(item, index))) : emptyState ?? null,
|
|
2035
2043
|
afterItems
|
|
2036
2044
|
] }),
|
|
2037
|
-
footer && /* @__PURE__ */
|
|
2045
|
+
footer && /* @__PURE__ */ jsx51(View23, { className: "border-t border-border px-3 py-2", children: footer })
|
|
2038
2046
|
] });
|
|
2039
2047
|
}
|
|
2040
2048
|
|
|
2041
2049
|
// src/cart/discount-badge.tsx
|
|
2042
2050
|
import { Text as Text13, View as View24 } from "react-native";
|
|
2043
2051
|
import { cn as cn49 } from "@tallyui/theme";
|
|
2044
|
-
import { jsx as
|
|
2052
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2045
2053
|
function DiscountBadge({ label, className, ...viewProps }) {
|
|
2046
|
-
return /* @__PURE__ */
|
|
2054
|
+
return /* @__PURE__ */ jsx52(
|
|
2047
2055
|
View24,
|
|
2048
2056
|
{
|
|
2049
2057
|
className: cn49("flex-row items-center self-start gap-1 rounded-md bg-sale/15 px-1.5 py-0.5", className),
|
|
2050
2058
|
...viewProps,
|
|
2051
|
-
children: /* @__PURE__ */
|
|
2059
|
+
children: /* @__PURE__ */ jsx52(Text13, { className: "text-xs font-semibold text-sale", children: label })
|
|
2052
2060
|
}
|
|
2053
2061
|
);
|
|
2054
2062
|
}
|
|
@@ -2057,7 +2065,7 @@ function DiscountBadge({ label, className, ...viewProps }) {
|
|
|
2057
2065
|
import { useState as useState3 } from "react";
|
|
2058
2066
|
import { Pressable as Pressable10, Text as Text14, TextInput as TextInput4, View as View25 } from "react-native";
|
|
2059
2067
|
import { cn as cn50 } from "@tallyui/theme";
|
|
2060
|
-
import { jsx as
|
|
2068
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2061
2069
|
function CartNoteInput({
|
|
2062
2070
|
value,
|
|
2063
2071
|
onChangeText,
|
|
@@ -2067,17 +2075,17 @@ function CartNoteInput({
|
|
|
2067
2075
|
}) {
|
|
2068
2076
|
const [expanded, setExpanded] = useState3(value.length > 0);
|
|
2069
2077
|
if (!expanded) {
|
|
2070
|
-
return /* @__PURE__ */
|
|
2078
|
+
return /* @__PURE__ */ jsx53(
|
|
2071
2079
|
Pressable10,
|
|
2072
2080
|
{
|
|
2073
2081
|
onPress: () => setExpanded(true),
|
|
2074
2082
|
className: cn50("flex-row items-center gap-1.5 px-3 py-2", className),
|
|
2075
2083
|
...viewProps,
|
|
2076
|
-
children: /* @__PURE__ */
|
|
2084
|
+
children: /* @__PURE__ */ jsx53(Text14, { className: "text-xs text-primary", children: "Add note" })
|
|
2077
2085
|
}
|
|
2078
2086
|
);
|
|
2079
2087
|
}
|
|
2080
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ jsx53(View25, { className: cn50("px-3 py-2", className), ...viewProps, children: /* @__PURE__ */ jsx53(
|
|
2081
2089
|
TextInput4,
|
|
2082
2090
|
{
|
|
2083
2091
|
value,
|
|
@@ -2093,18 +2101,18 @@ function CartNoteInput({
|
|
|
2093
2101
|
// src/cart/cart-line-actions.tsx
|
|
2094
2102
|
import { Pressable as Pressable11, Text as Text15, View as View26 } from "react-native";
|
|
2095
2103
|
import { cn as cn51 } from "@tallyui/theme";
|
|
2096
|
-
import { jsx as
|
|
2104
|
+
import { jsx as jsx54, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2097
2105
|
function CartLineActions({ children, actions, className, ...viewProps }) {
|
|
2098
|
-
return /* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2106
|
+
return /* @__PURE__ */ jsxs15(View26, { className: cn51("flex-row items-center", className), ...viewProps, children: [
|
|
2107
|
+
/* @__PURE__ */ jsx54(View26, { className: "flex-1", children }),
|
|
2108
|
+
/* @__PURE__ */ jsx54(View26, { className: "flex-row gap-1 px-2", children: actions.map((action) => /* @__PURE__ */ jsxs15(
|
|
2101
2109
|
Pressable11,
|
|
2102
2110
|
{
|
|
2103
2111
|
onPress: action.onPress,
|
|
2104
2112
|
className: "rounded-md px-2 py-1.5",
|
|
2105
2113
|
children: [
|
|
2106
2114
|
action.iconSlot,
|
|
2107
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsx54(Text15, { className: cn51("text-xs font-medium", action.color ?? "text-destructive"), children: action.label })
|
|
2108
2116
|
]
|
|
2109
2117
|
},
|
|
2110
2118
|
action.id
|
|
@@ -2117,17 +2125,17 @@ import { useId, useState as useState4 } from "react";
|
|
|
2117
2125
|
import { TextInput as TextInput5, View as View27 } from "react-native";
|
|
2118
2126
|
import { Label as Label3 } from "@tallyui/primitives";
|
|
2119
2127
|
import { cn as cn52 } from "@tallyui/theme";
|
|
2120
|
-
import { jsx as
|
|
2128
|
+
import { jsx as jsx55, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2121
2129
|
function SearchInput({ value, onChangeText, className, placeholder = "Search...", style, onFocus, onBlur, ...props }) {
|
|
2122
2130
|
const labelId = useId();
|
|
2123
2131
|
const [focused, setFocused] = useState4(false);
|
|
2124
|
-
return /* @__PURE__ */
|
|
2132
|
+
return /* @__PURE__ */ jsxs16(HStack, { space: "sm", className: cn52(
|
|
2125
2133
|
"rounded-lg border bg-card px-3 py-2.5",
|
|
2126
2134
|
focused ? "border-ring" : "border-border",
|
|
2127
2135
|
className
|
|
2128
2136
|
), children: [
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ jsx55(Label3.Root, { nativeID: labelId, asChild: true, children: /* @__PURE__ */ jsx55(View27, { "aria-hidden": true, className: "text-muted-foreground", children: /* @__PURE__ */ jsx55(SearchIcon, { size: 16 }) }) }),
|
|
2138
|
+
/* @__PURE__ */ jsx55(
|
|
2131
2139
|
TextInput5,
|
|
2132
2140
|
{
|
|
2133
2141
|
role: "searchbox",
|
|
@@ -2157,16 +2165,16 @@ import { useMemo } from "react";
|
|
|
2157
2165
|
import { Pressable as Pressable12, ScrollView as ScrollView5 } from "react-native";
|
|
2158
2166
|
import { ToggleGroup as ToggleGroup3 } from "@tallyui/primitives";
|
|
2159
2167
|
import { cn as cn53 } from "@tallyui/theme";
|
|
2160
|
-
import { jsx as
|
|
2168
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2161
2169
|
function FilterChip({ label, active, onPress, className }) {
|
|
2162
2170
|
const value = useMemo(() => active ? [label] : [], [active, label]);
|
|
2163
|
-
return /* @__PURE__ */
|
|
2171
|
+
return /* @__PURE__ */ jsx56(
|
|
2164
2172
|
ToggleGroup3.Root,
|
|
2165
2173
|
{
|
|
2166
2174
|
type: "multiple",
|
|
2167
2175
|
value,
|
|
2168
2176
|
onValueChange: () => onPress(),
|
|
2169
|
-
children: /* @__PURE__ */
|
|
2177
|
+
children: /* @__PURE__ */ jsx56(ToggleGroup3.Item, { value: label, asChild: true, children: /* @__PURE__ */ jsx56(
|
|
2170
2178
|
Pressable12,
|
|
2171
2179
|
{
|
|
2172
2180
|
className: cn53(
|
|
@@ -2174,7 +2182,7 @@ function FilterChip({ label, active, onPress, className }) {
|
|
|
2174
2182
|
active ? "bg-primary" : "bg-accent",
|
|
2175
2183
|
className
|
|
2176
2184
|
),
|
|
2177
|
-
children: /* @__PURE__ */
|
|
2185
|
+
children: /* @__PURE__ */ jsx56(Text, { className: cn53("text-xs font-semibold", active ? "text-primary-foreground" : "text-muted-foreground"), children: label })
|
|
2178
2186
|
}
|
|
2179
2187
|
) })
|
|
2180
2188
|
}
|
|
@@ -2199,28 +2207,28 @@ function FilterChipGroup({ chips, onChipPress, className, ...viewProps }) {
|
|
|
2199
2207
|
if (index !== void 0) onChipPress(index);
|
|
2200
2208
|
}
|
|
2201
2209
|
}
|
|
2202
|
-
return /* @__PURE__ */
|
|
2210
|
+
return /* @__PURE__ */ jsx56(
|
|
2203
2211
|
ToggleGroup3.Root,
|
|
2204
2212
|
{
|
|
2205
2213
|
type: "multiple",
|
|
2206
2214
|
value: activeValues,
|
|
2207
2215
|
onValueChange: handleValueChange,
|
|
2208
2216
|
asChild: true,
|
|
2209
|
-
children: /* @__PURE__ */
|
|
2217
|
+
children: /* @__PURE__ */ jsx56(
|
|
2210
2218
|
ScrollView5,
|
|
2211
2219
|
{
|
|
2212
2220
|
horizontal: true,
|
|
2213
2221
|
showsHorizontalScrollIndicator: false,
|
|
2214
2222
|
contentContainerClassName: cn53("flex-row gap-2", className),
|
|
2215
2223
|
...viewProps,
|
|
2216
|
-
children: chips.map((chip) => /* @__PURE__ */
|
|
2224
|
+
children: chips.map((chip) => /* @__PURE__ */ jsx56(ToggleGroup3.Item, { value: chip.label, asChild: true, children: /* @__PURE__ */ jsx56(
|
|
2217
2225
|
Pressable12,
|
|
2218
2226
|
{
|
|
2219
2227
|
className: cn53(
|
|
2220
2228
|
"rounded-full px-3 py-1.5",
|
|
2221
2229
|
chip.active ? "bg-primary" : "bg-accent"
|
|
2222
2230
|
),
|
|
2223
|
-
children: /* @__PURE__ */
|
|
2231
|
+
children: /* @__PURE__ */ jsx56(Text, { className: cn53("text-xs font-semibold", chip.active ? "text-primary-foreground" : "text-muted-foreground"), children: chip.label })
|
|
2224
2232
|
}
|
|
2225
2233
|
) }, chip.label))
|
|
2226
2234
|
}
|
|
@@ -2233,7 +2241,7 @@ function FilterChipGroup({ chips, onChipPress, className, ...viewProps }) {
|
|
|
2233
2241
|
import { useState as useState5 } from "react";
|
|
2234
2242
|
import { Pressable as Pressable13, Text as Text16, View as View28 } from "react-native";
|
|
2235
2243
|
import { cn as cn54 } from "@tallyui/theme";
|
|
2236
|
-
import { jsx as
|
|
2244
|
+
import { jsx as jsx57, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2237
2245
|
function QuantityStepper({
|
|
2238
2246
|
defaultQuantity = 1,
|
|
2239
2247
|
quantity: controlledQuantity,
|
|
@@ -2250,8 +2258,8 @@ function QuantityStepper({
|
|
|
2250
2258
|
if (controlledQuantity === void 0) setInternalQuantity(next);
|
|
2251
2259
|
onChangeQuantity?.(next);
|
|
2252
2260
|
};
|
|
2253
|
-
return /* @__PURE__ */
|
|
2254
|
-
/* @__PURE__ */
|
|
2261
|
+
return /* @__PURE__ */ jsxs17(View28, { className: cn54("flex-row items-center gap-2", className), ...viewProps, children: [
|
|
2262
|
+
/* @__PURE__ */ jsx57(
|
|
2255
2263
|
Pressable13,
|
|
2256
2264
|
{
|
|
2257
2265
|
onPress: () => handleChange(quantity - 1),
|
|
@@ -2260,11 +2268,11 @@ function QuantityStepper({
|
|
|
2260
2268
|
"h-8 w-8 items-center justify-center rounded-lg",
|
|
2261
2269
|
quantity <= min ? "bg-muted/50" : "bg-muted"
|
|
2262
2270
|
),
|
|
2263
|
-
children: /* @__PURE__ */
|
|
2271
|
+
children: /* @__PURE__ */ jsx57(Text16, { className: cn54("text-base font-semibold", quantity <= min ? "text-muted-foreground" : "text-foreground"), children: "\u2212" })
|
|
2264
2272
|
}
|
|
2265
2273
|
),
|
|
2266
|
-
/* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsx57(Text16, { className: "min-w-[2rem] text-center text-base font-semibold text-foreground", children: quantity }),
|
|
2275
|
+
/* @__PURE__ */ jsx57(
|
|
2268
2276
|
Pressable13,
|
|
2269
2277
|
{
|
|
2270
2278
|
onPress: () => handleChange(quantity + 1),
|
|
@@ -2273,7 +2281,7 @@ function QuantityStepper({
|
|
|
2273
2281
|
"h-8 w-8 items-center justify-center rounded-lg",
|
|
2274
2282
|
quantity >= max ? "bg-muted/50" : "bg-muted"
|
|
2275
2283
|
),
|
|
2276
|
-
children: /* @__PURE__ */
|
|
2284
|
+
children: /* @__PURE__ */ jsx57(Text16, { className: cn54("text-base font-semibold", quantity >= max ? "text-muted-foreground" : "text-foreground"), children: "+" })
|
|
2277
2285
|
}
|
|
2278
2286
|
)
|
|
2279
2287
|
] });
|
|
@@ -2282,20 +2290,20 @@ function QuantityStepper({
|
|
|
2282
2290
|
// src/customer/customer-card.tsx
|
|
2283
2291
|
import { useCustomerTraits } from "@tallyui/core";
|
|
2284
2292
|
import { cn as cn55 } from "@tallyui/theme";
|
|
2285
|
-
import { jsx as
|
|
2293
|
+
import { jsx as jsx58, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2286
2294
|
function CustomerCardFromContext(props) {
|
|
2287
2295
|
const traits = useCustomerTraits();
|
|
2288
|
-
return traits ? /* @__PURE__ */
|
|
2296
|
+
return traits ? /* @__PURE__ */ jsx58(CustomerCard, { ...props, traits }) : null;
|
|
2289
2297
|
}
|
|
2290
2298
|
function CustomerCard({ doc, traits, className, ...props }) {
|
|
2291
|
-
if (!traits) return /* @__PURE__ */
|
|
2299
|
+
if (!traits) return /* @__PURE__ */ jsx58(CustomerCardFromContext, { doc, className, ...props });
|
|
2292
2300
|
const name = traits.getName(doc);
|
|
2293
2301
|
const email = traits.getEmail(doc);
|
|
2294
2302
|
const address = traits.getAddressSummary(doc);
|
|
2295
|
-
return /* @__PURE__ */
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
email && /* @__PURE__ */
|
|
2298
|
-
address && /* @__PURE__ */
|
|
2303
|
+
return /* @__PURE__ */ jsxs18(VStack, { space: "none", className: cn55("gap-0.5", className), ...props, children: [
|
|
2304
|
+
/* @__PURE__ */ jsx58(Text, { className: "text-sm font-semibold", children: name }),
|
|
2305
|
+
email && /* @__PURE__ */ jsx58(Text, { className: "text-xs text-muted-foreground", children: email }),
|
|
2306
|
+
address && /* @__PURE__ */ jsx58(Text, { className: "text-xs text-muted-foreground", children: address })
|
|
2299
2307
|
] });
|
|
2300
2308
|
}
|
|
2301
2309
|
|
|
@@ -2304,12 +2312,12 @@ import { Pressable as Pressable14, ScrollView as ScrollView6, View as View29 } f
|
|
|
2304
2312
|
import { Select as Select2 } from "@tallyui/primitives";
|
|
2305
2313
|
import { useCustomerTraits as useCustomerTraits2 } from "@tallyui/core";
|
|
2306
2314
|
import { cn as cn56 } from "@tallyui/theme";
|
|
2307
|
-
import { jsx as
|
|
2315
|
+
import { jsx as jsx59, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2308
2316
|
function CustomerSelect(props) {
|
|
2309
|
-
return props.traits ? /* @__PURE__ */
|
|
2317
|
+
return props.traits ? /* @__PURE__ */ jsx59(CustomerSelectView, { ...props }) : /* @__PURE__ */ jsx59(CustomerSelectFromContext, { ...props });
|
|
2310
2318
|
}
|
|
2311
2319
|
function CustomerSelectFromContext(props) {
|
|
2312
|
-
return /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ jsx59(CustomerSelectView, { ...props, traits: useCustomerTraits2() });
|
|
2313
2321
|
}
|
|
2314
2322
|
function CustomerSelectView({
|
|
2315
2323
|
customers,
|
|
@@ -2332,25 +2340,25 @@ function CustomerSelectView({
|
|
|
2332
2340
|
const doc = customerById.get(option.value);
|
|
2333
2341
|
if (doc) onSelect(doc);
|
|
2334
2342
|
}
|
|
2335
|
-
return /* @__PURE__ */
|
|
2343
|
+
return /* @__PURE__ */ jsx59(
|
|
2336
2344
|
Select2.Root,
|
|
2337
2345
|
{
|
|
2338
2346
|
value: selectedOption,
|
|
2339
2347
|
onValueChange: handleValueChange,
|
|
2340
2348
|
defaultOpen: true,
|
|
2341
|
-
children: /* @__PURE__ */
|
|
2342
|
-
selected && traits && /* @__PURE__ */
|
|
2343
|
-
customers.length > 0 && /* @__PURE__ */
|
|
2349
|
+
children: /* @__PURE__ */ jsxs19(VStack, { space: "sm", className: cn56(className), ...props, children: [
|
|
2350
|
+
selected && traits && /* @__PURE__ */ jsx59(Select2.Trigger, { asChild: true, children: /* @__PURE__ */ jsx59(View29, { className: "rounded-lg border border-primary bg-primary/5 px-3 py-2", children: /* @__PURE__ */ jsx59(CustomerCard, { doc: selected, traits }) }) }),
|
|
2351
|
+
customers.length > 0 && /* @__PURE__ */ jsx59(Select2.Content, { asChild: true, forceMount: true, disablePositioningStyle: true, children: /* @__PURE__ */ jsx59(ScrollView6, { className: "max-h-60", children: customers.map((customer, index) => {
|
|
2344
2352
|
const id = traits?.getId(customer) ?? String(index);
|
|
2345
2353
|
const label = traits?.getName(customer) ?? "";
|
|
2346
2354
|
const email = traits?.getEmail(customer);
|
|
2347
|
-
return /* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ jsx59(
|
|
2348
2356
|
Select2.Item,
|
|
2349
2357
|
{
|
|
2350
2358
|
value: id,
|
|
2351
2359
|
label,
|
|
2352
2360
|
asChild: true,
|
|
2353
|
-
children: /* @__PURE__ */
|
|
2361
|
+
children: /* @__PURE__ */ jsx59(Pressable14, { accessibilityLabel: email ? `${label}, ${email}` : label, className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx59(CustomerCard, { doc: customer, traits }) })
|
|
2354
2362
|
},
|
|
2355
2363
|
id
|
|
2356
2364
|
);
|
|
@@ -2363,16 +2371,16 @@ function CustomerSelectView({
|
|
|
2363
2371
|
// src/customer/customer-form.tsx
|
|
2364
2372
|
import { Pressable as Pressable15, Text as Text17, TextInput as TextInput6, View as View30 } from "react-native";
|
|
2365
2373
|
import { cn as cn57 } from "@tallyui/theme";
|
|
2366
|
-
import { jsx as
|
|
2374
|
+
import { jsx as jsx60, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2367
2375
|
function FormField({
|
|
2368
2376
|
label,
|
|
2369
2377
|
value,
|
|
2370
2378
|
onChangeText,
|
|
2371
2379
|
...props
|
|
2372
2380
|
}) {
|
|
2373
|
-
return /* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
/* @__PURE__ */
|
|
2381
|
+
return /* @__PURE__ */ jsxs20(View30, { className: "gap-1", children: [
|
|
2382
|
+
/* @__PURE__ */ jsx60(Text17, { className: "text-xs font-medium text-muted-foreground", children: label }),
|
|
2383
|
+
/* @__PURE__ */ jsx60(
|
|
2376
2384
|
TextInput6,
|
|
2377
2385
|
{
|
|
2378
2386
|
value,
|
|
@@ -2393,22 +2401,22 @@ function CustomerForm({
|
|
|
2393
2401
|
className,
|
|
2394
2402
|
...viewProps
|
|
2395
2403
|
}) {
|
|
2396
|
-
return /* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
/* @__PURE__ */
|
|
2399
|
-
/* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ jsxs20(View30, { className: cn57("gap-3 p-4", className), ...viewProps, children: [
|
|
2405
|
+
/* @__PURE__ */ jsxs20(View30, { className: "flex-row gap-3", children: [
|
|
2406
|
+
/* @__PURE__ */ jsx60(View30, { className: "flex-1", children: /* @__PURE__ */ jsx60(FormField, { label: "First Name", value: values.firstName, onChangeText: (v) => onChangeField("firstName", v), placeholder: "First name" }) }),
|
|
2407
|
+
/* @__PURE__ */ jsx60(View30, { className: "flex-1", children: /* @__PURE__ */ jsx60(FormField, { label: "Last Name", value: values.lastName, onChangeText: (v) => onChangeField("lastName", v), placeholder: "Last name" }) })
|
|
2400
2408
|
] }),
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
showAddress && /* @__PURE__ */
|
|
2404
|
-
onSubmit && /* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx60(FormField, { label: "Email", value: values.email, onChangeText: (v) => onChangeField("email", v), placeholder: "email@example.com", keyboardType: "email-address" }),
|
|
2410
|
+
/* @__PURE__ */ jsx60(FormField, { label: "Phone", value: values.phone, onChangeText: (v) => onChangeField("phone", v), placeholder: "Phone number", keyboardType: "phone-pad" }),
|
|
2411
|
+
showAddress && /* @__PURE__ */ jsx60(FormField, { label: "Address", value: values.address, onChangeText: (v) => onChangeField("address", v), placeholder: "Street address", multiline: true }),
|
|
2412
|
+
onSubmit && /* @__PURE__ */ jsx60(Pressable15, { onPress: onSubmit, className: "items-center rounded-lg bg-primary px-4 py-3", children: /* @__PURE__ */ jsx60(Text17, { className: "text-sm font-semibold text-primary-foreground", children: submitLabel }) })
|
|
2405
2413
|
] });
|
|
2406
2414
|
}
|
|
2407
2415
|
|
|
2408
2416
|
// src/customer/customer-order-history.tsx
|
|
2409
2417
|
import { ScrollView as ScrollView7, Text as Text18, View as View31 } from "react-native";
|
|
2410
2418
|
import { cn as cn58 } from "@tallyui/theme";
|
|
2411
|
-
import { jsx as
|
|
2419
|
+
import { jsx as jsx61, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2412
2420
|
function CustomerOrderHistory({
|
|
2413
2421
|
orders,
|
|
2414
2422
|
renderItem,
|
|
@@ -2416,9 +2424,9 @@ function CustomerOrderHistory({
|
|
|
2416
2424
|
className,
|
|
2417
2425
|
...viewProps
|
|
2418
2426
|
}) {
|
|
2419
|
-
return /* @__PURE__ */
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
orders.length > 0 ? /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ jsxs21(View31, { className: cn58("flex-1", className), ...viewProps, children: [
|
|
2428
|
+
/* @__PURE__ */ jsx61(Text18, { className: "px-3 py-2 text-xs font-semibold text-muted-foreground", children: "Order History" }),
|
|
2429
|
+
orders.length > 0 ? /* @__PURE__ */ jsx61(ScrollView7, { contentContainerClassName: "gap-2 px-3 pb-3", children: orders.map((order, index) => /* @__PURE__ */ jsx61(View31, { children: renderItem(order, index) }, order.id ?? index)) }) : emptyState ?? null
|
|
2422
2430
|
] });
|
|
2423
2431
|
}
|
|
2424
2432
|
|
|
@@ -2427,7 +2435,7 @@ import { useEffect, useRef, useState as useState6 } from "react";
|
|
|
2427
2435
|
import { Pressable as Pressable16, Text as Text19, TextInput as TextInput7, View as View32 } from "react-native";
|
|
2428
2436
|
import { customerTraits, CustomerServiceError, ConnectorUnauthorizedError } from "@tallyui/core";
|
|
2429
2437
|
import { cn as cn59 } from "@tallyui/theme";
|
|
2430
|
-
import { jsx as
|
|
2438
|
+
import { jsx as jsx62, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2431
2439
|
var EMAIL_MAX = 254;
|
|
2432
2440
|
var EMAIL_SHAPE = /^[^\s@\u0000]+@[^\s@\u0000]+\.[^\s@\u0000]+$/u;
|
|
2433
2441
|
function CustomerPicker({ search, create, selected, onSelect, onError, online, debounceMs = 250, className }) {
|
|
@@ -2495,13 +2503,13 @@ function CustomerPicker({ search, create, selected, onSelect, onError, online, d
|
|
|
2495
2503
|
setCreating(false);
|
|
2496
2504
|
}
|
|
2497
2505
|
}
|
|
2498
|
-
return /* @__PURE__ */
|
|
2499
|
-
selected && /* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsxs22(View32, { className: cn59("gap-3", className), children: [
|
|
2507
|
+
selected && /* @__PURE__ */ jsxs22(View32, { children: [
|
|
2508
|
+
/* @__PURE__ */ jsx62(CustomerCard, { doc: selected, traits: customerTraits }),
|
|
2509
|
+
/* @__PURE__ */ jsx62(Pressable16, { accessibilityRole: "button", className: "items-center rounded-lg border border-border px-4 py-3", onPress: () => onSelect(null), children: /* @__PURE__ */ jsx62(Text19, { className: "text-sm font-semibold text-foreground", children: "Remove customer" }) })
|
|
2502
2510
|
] }),
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx62(Text19, { className: "text-xs font-medium text-muted-foreground", children: "Search customers" }),
|
|
2512
|
+
/* @__PURE__ */ jsx62(
|
|
2505
2513
|
TextInput7,
|
|
2506
2514
|
{
|
|
2507
2515
|
accessibilityLabel: "Search customers",
|
|
@@ -2513,10 +2521,10 @@ function CustomerPicker({ search, create, selected, onSelect, onError, online, d
|
|
|
2513
2521
|
placeholder: "Name or email"
|
|
2514
2522
|
}
|
|
2515
2523
|
),
|
|
2516
|
-
!online && /* @__PURE__ */
|
|
2517
|
-
noResults && /* @__PURE__ */
|
|
2518
|
-
error && /* @__PURE__ */
|
|
2519
|
-
/* @__PURE__ */
|
|
2524
|
+
!online && /* @__PURE__ */ jsx62(Text19, { className: "text-sm text-muted-foreground", children: "Connect to search or add customers." }),
|
|
2525
|
+
noResults && /* @__PURE__ */ jsx62(Text19, { className: "text-sm text-muted-foreground", children: "No customers found." }),
|
|
2526
|
+
error && /* @__PURE__ */ jsx62(Text19, { accessibilityRole: "alert", className: "text-sm text-destructive", children: error }),
|
|
2527
|
+
/* @__PURE__ */ jsx62(
|
|
2520
2528
|
CustomerSelect,
|
|
2521
2529
|
{
|
|
2522
2530
|
customers,
|
|
@@ -2528,18 +2536,18 @@ function CustomerPicker({ search, create, selected, onSelect, onError, online, d
|
|
|
2528
2536
|
}
|
|
2529
2537
|
}
|
|
2530
2538
|
),
|
|
2531
|
-
create && /* @__PURE__ */
|
|
2539
|
+
create && /* @__PURE__ */ jsx62(
|
|
2532
2540
|
Pressable16,
|
|
2533
2541
|
{
|
|
2534
2542
|
accessibilityRole: "button",
|
|
2535
2543
|
disabled: !online || creating,
|
|
2536
2544
|
onPress: () => setShowForm(true),
|
|
2537
2545
|
className: cn59("items-center rounded-lg border border-border px-4 py-3", (!online || creating) && "opacity-50"),
|
|
2538
|
-
children: /* @__PURE__ */
|
|
2546
|
+
children: /* @__PURE__ */ jsx62(Text19, { className: "text-sm font-semibold text-foreground", children: "New customer" })
|
|
2539
2547
|
}
|
|
2540
2548
|
),
|
|
2541
|
-
showForm && /* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2549
|
+
showForm && /* @__PURE__ */ jsxs22(View32, { children: [
|
|
2550
|
+
/* @__PURE__ */ jsx62(
|
|
2543
2551
|
CustomerForm,
|
|
2544
2552
|
{
|
|
2545
2553
|
values,
|
|
@@ -2547,18 +2555,18 @@ function CustomerPicker({ search, create, selected, onSelect, onError, online, d
|
|
|
2547
2555
|
onChangeField: (field, value) => setValues((current) => ({ ...current, [field]: value }))
|
|
2548
2556
|
}
|
|
2549
2557
|
),
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsxs22(View32, { className: "flex-row gap-3", children: [
|
|
2559
|
+
/* @__PURE__ */ jsx62(
|
|
2552
2560
|
Pressable16,
|
|
2553
2561
|
{
|
|
2554
2562
|
accessibilityRole: "button",
|
|
2555
2563
|
disabled: !online || creating || !values.email.trim(),
|
|
2556
2564
|
onPress: submit,
|
|
2557
2565
|
className: cn59("items-center rounded-lg bg-primary px-4 py-3", (!online || creating || !values.email.trim()) && "opacity-50"),
|
|
2558
|
-
children: /* @__PURE__ */
|
|
2566
|
+
children: /* @__PURE__ */ jsx62(Text19, { className: "text-sm font-semibold text-primary-foreground", children: "Save Customer" })
|
|
2559
2567
|
}
|
|
2560
2568
|
),
|
|
2561
|
-
/* @__PURE__ */
|
|
2569
|
+
/* @__PURE__ */ jsx62(
|
|
2562
2570
|
Pressable16,
|
|
2563
2571
|
{
|
|
2564
2572
|
accessibilityRole: "button",
|
|
@@ -2567,7 +2575,7 @@ function CustomerPicker({ search, create, selected, onSelect, onError, online, d
|
|
|
2567
2575
|
setShowForm(false);
|
|
2568
2576
|
setValues({ firstName: "", lastName: "", email: "", phone: "", address: "" });
|
|
2569
2577
|
},
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2578
|
+
children: /* @__PURE__ */ jsx62(Text19, { className: "text-sm font-semibold text-foreground", children: "Cancel" })
|
|
2571
2579
|
}
|
|
2572
2580
|
)
|
|
2573
2581
|
] })
|
|
@@ -2578,9 +2586,9 @@ function CustomerPicker({ search, create, selected, onSelect, onError, online, d
|
|
|
2578
2586
|
// src/checkout/payment-method-card.tsx
|
|
2579
2587
|
import { Pressable as Pressable17, View as View33 } from "react-native";
|
|
2580
2588
|
import { cn as cn60 } from "@tallyui/theme";
|
|
2581
|
-
import { jsx as
|
|
2589
|
+
import { jsx as jsx63, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2582
2590
|
function PaymentMethodCard({ label, selected, onPress, icon, className, ...props }) {
|
|
2583
|
-
return /* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ jsx63(Pressable17, { onPress, ...props, children: /* @__PURE__ */ jsxs23(
|
|
2584
2592
|
HStack,
|
|
2585
2593
|
{
|
|
2586
2594
|
className: cn60(
|
|
@@ -2589,9 +2597,9 @@ function PaymentMethodCard({ label, selected, onPress, icon, className, ...props
|
|
|
2589
2597
|
className
|
|
2590
2598
|
),
|
|
2591
2599
|
children: [
|
|
2592
|
-
icon && /* @__PURE__ */
|
|
2593
|
-
/* @__PURE__ */
|
|
2594
|
-
selected && /* @__PURE__ */
|
|
2600
|
+
icon && /* @__PURE__ */ jsx63(View33, { children: icon }),
|
|
2601
|
+
/* @__PURE__ */ jsx63(Text, { className: cn60("flex-1 text-sm font-medium", selected ? "text-primary" : ""), children: label }),
|
|
2602
|
+
selected && /* @__PURE__ */ jsx63(View33, { className: "h-5 w-5 items-center justify-center rounded-full bg-primary", children: /* @__PURE__ */ jsx63(Text, { className: "text-xs text-primary-foreground", children: "\u2713" }) })
|
|
2595
2603
|
]
|
|
2596
2604
|
}
|
|
2597
2605
|
) });
|
|
@@ -2599,17 +2607,17 @@ function PaymentMethodCard({ label, selected, onPress, icon, className, ...props
|
|
|
2599
2607
|
|
|
2600
2608
|
// src/checkout/order-summary-line.tsx
|
|
2601
2609
|
import { cn as cn61 } from "@tallyui/theme";
|
|
2602
|
-
import { jsx as
|
|
2610
|
+
import { jsx as jsx64, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2603
2611
|
function OrderSummaryLine({ label, amount, bold = false, className, ...props }) {
|
|
2604
|
-
return /* @__PURE__ */
|
|
2605
|
-
/* @__PURE__ */
|
|
2606
|
-
/* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ jsxs24(HStack, { space: "none", className: cn61("justify-between", className), ...props, children: [
|
|
2613
|
+
/* @__PURE__ */ jsx64(Text, { className: cn61("text-sm", bold ? "font-bold" : "text-muted-foreground"), children: label }),
|
|
2614
|
+
/* @__PURE__ */ jsx64(Text, { className: cn61("text-sm", bold && "font-bold"), children: amount })
|
|
2607
2615
|
] });
|
|
2608
2616
|
}
|
|
2609
2617
|
|
|
2610
2618
|
// src/checkout/payment-selector.tsx
|
|
2611
2619
|
import { cn as cn62 } from "@tallyui/theme";
|
|
2612
|
-
import { jsx as
|
|
2620
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
2613
2621
|
function PaymentSelector({
|
|
2614
2622
|
methods,
|
|
2615
2623
|
selected,
|
|
@@ -2617,7 +2625,7 @@ function PaymentSelector({
|
|
|
2617
2625
|
className,
|
|
2618
2626
|
...props
|
|
2619
2627
|
}) {
|
|
2620
|
-
return /* @__PURE__ */
|
|
2628
|
+
return /* @__PURE__ */ jsx65(VStack, { space: "sm", className: cn62(className), ...props, children: methods.map((method) => /* @__PURE__ */ jsx65(
|
|
2621
2629
|
PaymentMethodCard,
|
|
2622
2630
|
{
|
|
2623
2631
|
label: method.label,
|
|
@@ -2632,7 +2640,7 @@ function PaymentSelector({
|
|
|
2632
2640
|
// src/checkout/order-summary.tsx
|
|
2633
2641
|
import { View as View34 } from "react-native";
|
|
2634
2642
|
import { cn as cn63 } from "@tallyui/theme";
|
|
2635
|
-
import { jsx as
|
|
2643
|
+
import { jsx as jsx66, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2636
2644
|
function OrderSummary({
|
|
2637
2645
|
subtotal,
|
|
2638
2646
|
tax,
|
|
@@ -2644,13 +2652,13 @@ function OrderSummary({
|
|
|
2644
2652
|
className,
|
|
2645
2653
|
...props
|
|
2646
2654
|
}) {
|
|
2647
|
-
return /* @__PURE__ */
|
|
2648
|
-
header && /* @__PURE__ */
|
|
2649
|
-
/* @__PURE__ */
|
|
2650
|
-
tax && /* @__PURE__ */
|
|
2651
|
-
/* @__PURE__ */
|
|
2652
|
-
payments && payments.length > 0 && /* @__PURE__ */
|
|
2653
|
-
footer && /* @__PURE__ */
|
|
2655
|
+
return /* @__PURE__ */ jsxs25(VStack, { space: "none", className: cn63("gap-1.5 px-3 py-3", className), ...props, children: [
|
|
2656
|
+
header && /* @__PURE__ */ jsx66(View34, { className: "mb-2", children: header }),
|
|
2657
|
+
/* @__PURE__ */ jsx66(OrderSummaryLine, { label: "Subtotal", amount: subtotal }),
|
|
2658
|
+
tax && /* @__PURE__ */ jsx66(OrderSummaryLine, { label: taxLabel, amount: tax }),
|
|
2659
|
+
/* @__PURE__ */ jsx66(OrderSummaryLine, { label: "Total", amount: total, bold: true }),
|
|
2660
|
+
payments && payments.length > 0 && /* @__PURE__ */ jsx66(VStack, { space: "none", className: "mt-2 gap-1.5 border-t border-border pt-2", children: payments.map((payment) => /* @__PURE__ */ jsx66(OrderSummaryLine, { label: payment.label, amount: payment.amount }, payment.label)) }),
|
|
2661
|
+
footer && /* @__PURE__ */ jsx66(View34, { className: "mt-2", children: footer })
|
|
2654
2662
|
] });
|
|
2655
2663
|
}
|
|
2656
2664
|
|
|
@@ -2658,11 +2666,11 @@ function OrderSummary({
|
|
|
2658
2666
|
import { Text as Text20, View as View35 } from "react-native";
|
|
2659
2667
|
import { formatMoney as formatMoney4 } from "@tallyui/core";
|
|
2660
2668
|
import { cn as cn64 } from "@tallyui/theme";
|
|
2661
|
-
import { jsx as
|
|
2669
|
+
import { jsx as jsx67, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2662
2670
|
function ChangeDisplay({ change, locale, className, ...viewProps }) {
|
|
2663
|
-
return /* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2671
|
+
return /* @__PURE__ */ jsxs26(View35, { className: cn64("items-center gap-1 rounded-xl bg-muted p-4", className), ...viewProps, children: [
|
|
2672
|
+
/* @__PURE__ */ jsx67(Text20, { className: "text-sm text-muted-foreground", children: "Change Due" }),
|
|
2673
|
+
/* @__PURE__ */ jsx67(Text20, { className: "text-3xl font-bold text-success", children: formatMoney4(change, locale) ?? "\u2014" })
|
|
2666
2674
|
] });
|
|
2667
2675
|
}
|
|
2668
2676
|
|
|
@@ -2671,7 +2679,7 @@ import { useEffect as useEffect2, useRef as useRef2, useState as useState7 } fro
|
|
|
2671
2679
|
import { Pressable as Pressable18, Text as Text21, TextInput as TextInput8, View as View36 } from "react-native";
|
|
2672
2680
|
import { formatMoney as formatMoney5, minorUnitDigits as minorUnitDigits2, moneyFromDecimalString } from "@tallyui/core";
|
|
2673
2681
|
import { cn as cn65 } from "@tallyui/theme";
|
|
2674
|
-
import { jsx as
|
|
2682
|
+
import { jsx as jsx68, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2675
2683
|
function defaultQuickAmounts(total) {
|
|
2676
2684
|
const unit = 10 ** minorUnitDigits2(total.currency);
|
|
2677
2685
|
const amounts = [
|
|
@@ -2710,9 +2718,9 @@ function CashTendered({
|
|
|
2710
2718
|
if (controlledAmount === void 0) setInternalAmount(value);
|
|
2711
2719
|
onChangeAmount?.(value);
|
|
2712
2720
|
};
|
|
2713
|
-
return /* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsxs27(View36, { className: cn65("gap-3", className), ...viewProps, children: [
|
|
2722
|
+
/* @__PURE__ */ jsx68(Text21, { className: "text-sm font-semibold text-foreground", children: "Cash Tendered" }),
|
|
2723
|
+
/* @__PURE__ */ jsx68(View36, { className: "flex-row flex-wrap gap-2", children: buttons.map((val) => /* @__PURE__ */ jsx68(
|
|
2716
2724
|
Pressable18,
|
|
2717
2725
|
{
|
|
2718
2726
|
onPress: () => handleChange(val),
|
|
@@ -2720,7 +2728,7 @@ function CashTendered({
|
|
|
2720
2728
|
"rounded-lg border px-4 py-2",
|
|
2721
2729
|
amount.amount === val.amount && amount.currency === val.currency ? "border-primary bg-primary" : "border-input bg-card"
|
|
2722
2730
|
),
|
|
2723
|
-
children: /* @__PURE__ */
|
|
2731
|
+
children: /* @__PURE__ */ jsx68(
|
|
2724
2732
|
Text21,
|
|
2725
2733
|
{
|
|
2726
2734
|
className: cn65(
|
|
@@ -2733,7 +2741,7 @@ function CashTendered({
|
|
|
2733
2741
|
},
|
|
2734
2742
|
`${val.currency}:${val.amount}`
|
|
2735
2743
|
)) }),
|
|
2736
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ jsx68(
|
|
2737
2745
|
TextInput8,
|
|
2738
2746
|
{
|
|
2739
2747
|
value: text,
|
|
@@ -2757,7 +2765,7 @@ function CashTendered({
|
|
|
2757
2765
|
// src/checkout/receipt-preview.tsx
|
|
2758
2766
|
import { Text as Text22, View as View37 } from "react-native";
|
|
2759
2767
|
import { cn as cn66 } from "@tallyui/theme";
|
|
2760
|
-
import { jsx as
|
|
2768
|
+
import { jsx as jsx69, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2761
2769
|
function ReceiptPreview({
|
|
2762
2770
|
items,
|
|
2763
2771
|
subtotal,
|
|
@@ -2769,42 +2777,42 @@ function ReceiptPreview({
|
|
|
2769
2777
|
className,
|
|
2770
2778
|
...viewProps
|
|
2771
2779
|
}) {
|
|
2772
|
-
return /* @__PURE__ */
|
|
2773
|
-
headerSlot && /* @__PURE__ */
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ jsxs28(View37, { className: cn66("rounded-lg border border-border bg-card p-4", className), ...viewProps, children: [
|
|
2781
|
+
headerSlot && /* @__PURE__ */ jsx69(View37, { className: "mb-3 items-center border-b border-dashed border-border pb-3", children: headerSlot }),
|
|
2782
|
+
/* @__PURE__ */ jsx69(View37, { className: "gap-1", children: items.map((item, i) => /* @__PURE__ */ jsxs28(View37, { className: "flex-row justify-between", children: [
|
|
2783
|
+
/* @__PURE__ */ jsxs28(Text22, { className: "flex-1 text-sm text-foreground", children: [
|
|
2776
2784
|
item.name,
|
|
2777
2785
|
" x",
|
|
2778
2786
|
item.quantity
|
|
2779
2787
|
] }),
|
|
2780
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-foreground", children: item.total })
|
|
2781
2789
|
] }, i)) }),
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2784
|
-
/* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ jsxs28(View37, { className: "mt-3 gap-1 border-t border-dashed border-border pt-3", children: [
|
|
2791
|
+
/* @__PURE__ */ jsxs28(View37, { className: "flex-row justify-between", children: [
|
|
2792
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-muted-foreground", children: "Subtotal" }),
|
|
2793
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-foreground", children: subtotal })
|
|
2786
2794
|
] }),
|
|
2787
|
-
/* @__PURE__ */
|
|
2788
|
-
/* @__PURE__ */
|
|
2789
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ jsxs28(View37, { className: "flex-row justify-between", children: [
|
|
2796
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-muted-foreground", children: "Tax" }),
|
|
2797
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-foreground", children: tax })
|
|
2790
2798
|
] }),
|
|
2791
|
-
/* @__PURE__ */
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsxs28(View37, { className: "flex-row justify-between border-t border-border pt-1", children: [
|
|
2800
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm font-bold text-foreground", children: "Total" }),
|
|
2801
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm font-bold text-foreground", children: total })
|
|
2794
2802
|
] })
|
|
2795
2803
|
] }),
|
|
2796
|
-
payments && payments.length > 0 && /* @__PURE__ */
|
|
2797
|
-
/* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2804
|
+
payments && payments.length > 0 && /* @__PURE__ */ jsx69(View37, { className: "mt-3 gap-1 border-t border-dashed border-border pt-3", children: payments.map((p, i) => /* @__PURE__ */ jsxs28(View37, { className: "flex-row justify-between", children: [
|
|
2805
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-muted-foreground", children: p.method }),
|
|
2806
|
+
/* @__PURE__ */ jsx69(Text22, { className: "text-sm text-foreground", children: p.amount })
|
|
2799
2807
|
] }, i)) }),
|
|
2800
|
-
footerSlot && /* @__PURE__ */
|
|
2808
|
+
footerSlot && /* @__PURE__ */ jsx69(View37, { className: "mt-3 items-center border-t border-dashed border-border pt-3", children: footerSlot })
|
|
2801
2809
|
] });
|
|
2802
2810
|
}
|
|
2803
2811
|
|
|
2804
2812
|
// src/order/order-status-badge.tsx
|
|
2805
2813
|
import { Text as Text23, View as View38 } from "react-native";
|
|
2806
2814
|
import { cn as cn67 } from "@tallyui/theme";
|
|
2807
|
-
import { jsx as
|
|
2815
|
+
import { jsx as jsx70, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2808
2816
|
var STATUS_CONFIG = {
|
|
2809
2817
|
pending: { label: "Pending", badge: "bg-warning/15", dot: "bg-warning", text: "text-foreground" },
|
|
2810
2818
|
processing: { label: "Processing", badge: "bg-info/15", dot: "bg-info", text: "text-foreground" },
|
|
@@ -2814,14 +2822,14 @@ var STATUS_CONFIG = {
|
|
|
2814
2822
|
};
|
|
2815
2823
|
function OrderStatusBadge({ status, className, ...viewProps }) {
|
|
2816
2824
|
const config = STATUS_CONFIG[status] ?? STATUS_CONFIG.pending;
|
|
2817
|
-
return /* @__PURE__ */
|
|
2825
|
+
return /* @__PURE__ */ jsxs29(
|
|
2818
2826
|
View38,
|
|
2819
2827
|
{
|
|
2820
2828
|
className: cn67("flex-row items-center self-start gap-1.5 rounded-xl px-2 py-1", config.badge, className),
|
|
2821
2829
|
...viewProps,
|
|
2822
2830
|
children: [
|
|
2823
|
-
/* @__PURE__ */
|
|
2824
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ jsx70(View38, { className: cn67("h-1.5 w-1.5 rounded-full", config.dot) }),
|
|
2832
|
+
/* @__PURE__ */ jsx70(Text23, { className: cn67("text-xs font-semibold", config.text), children: config.label })
|
|
2825
2833
|
]
|
|
2826
2834
|
}
|
|
2827
2835
|
);
|
|
@@ -2830,7 +2838,7 @@ function OrderStatusBadge({ status, className, ...viewProps }) {
|
|
|
2830
2838
|
// src/order/order-card.tsx
|
|
2831
2839
|
import { Pressable as Pressable19, Text as Text24, View as View39 } from "react-native";
|
|
2832
2840
|
import { cn as cn68 } from "@tallyui/theme";
|
|
2833
|
-
import { jsx as
|
|
2841
|
+
import { jsx as jsx71, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2834
2842
|
function OrderCard({
|
|
2835
2843
|
orderNumber,
|
|
2836
2844
|
date,
|
|
@@ -2842,23 +2850,23 @@ function OrderCard({
|
|
|
2842
2850
|
...viewProps
|
|
2843
2851
|
}) {
|
|
2844
2852
|
const Wrapper = onPress ? Pressable19 : View39;
|
|
2845
|
-
return /* @__PURE__ */
|
|
2853
|
+
return /* @__PURE__ */ jsxs30(
|
|
2846
2854
|
Wrapper,
|
|
2847
2855
|
{
|
|
2848
2856
|
onPress,
|
|
2849
2857
|
className: cn68("gap-2 rounded-lg border border-border bg-card p-3", className),
|
|
2850
2858
|
...viewProps,
|
|
2851
2859
|
children: [
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */
|
|
2860
|
+
/* @__PURE__ */ jsxs30(View39, { className: "flex-row items-center justify-between", children: [
|
|
2861
|
+
/* @__PURE__ */ jsx71(Text24, { className: "text-sm font-semibold text-foreground", children: orderNumber }),
|
|
2862
|
+
/* @__PURE__ */ jsx71(OrderStatusBadge, { status })
|
|
2855
2863
|
] }),
|
|
2856
|
-
/* @__PURE__ */
|
|
2857
|
-
/* @__PURE__ */
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
customerName && /* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsxs30(View39, { className: "flex-row items-center justify-between", children: [
|
|
2865
|
+
/* @__PURE__ */ jsxs30(View39, { className: "gap-0.5", children: [
|
|
2866
|
+
/* @__PURE__ */ jsx71(Text24, { className: "text-xs text-muted-foreground", children: date }),
|
|
2867
|
+
customerName && /* @__PURE__ */ jsx71(Text24, { className: "text-xs text-muted-foreground", children: customerName })
|
|
2860
2868
|
] }),
|
|
2861
|
-
/* @__PURE__ */
|
|
2869
|
+
/* @__PURE__ */ jsx71(Text24, { className: "text-sm font-semibold text-foreground", children: total })
|
|
2862
2870
|
] })
|
|
2863
2871
|
]
|
|
2864
2872
|
}
|
|
@@ -2868,7 +2876,7 @@ function OrderCard({
|
|
|
2868
2876
|
// src/order/order-list.tsx
|
|
2869
2877
|
import { ScrollView as ScrollView8, View as View40 } from "react-native";
|
|
2870
2878
|
import { cn as cn69 } from "@tallyui/theme";
|
|
2871
|
-
import { jsx as
|
|
2879
|
+
import { jsx as jsx72, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2872
2880
|
function OrderList({
|
|
2873
2881
|
items,
|
|
2874
2882
|
renderItem,
|
|
@@ -2878,16 +2886,16 @@ function OrderList({
|
|
|
2878
2886
|
...viewProps
|
|
2879
2887
|
}) {
|
|
2880
2888
|
const hasItems = items.length > 0;
|
|
2881
|
-
return /* @__PURE__ */
|
|
2882
|
-
headerSlot && /* @__PURE__ */
|
|
2883
|
-
hasItems ? /* @__PURE__ */
|
|
2889
|
+
return /* @__PURE__ */ jsxs31(View40, { className: cn69("flex-1", className), ...viewProps, children: [
|
|
2890
|
+
headerSlot && /* @__PURE__ */ jsx72(View40, { className: "px-3 py-2", children: headerSlot }),
|
|
2891
|
+
hasItems ? /* @__PURE__ */ jsx72(ScrollView8, { contentContainerClassName: "gap-2 p-3", children: items.map((item, index) => /* @__PURE__ */ jsx72(View40, { children: renderItem(item, index) }, item.id ?? index)) }) : emptyState ?? null
|
|
2884
2892
|
] });
|
|
2885
2893
|
}
|
|
2886
2894
|
|
|
2887
2895
|
// src/order/order-detail.tsx
|
|
2888
2896
|
import { ScrollView as ScrollView9, Text as Text25, View as View41 } from "react-native";
|
|
2889
2897
|
import { cn as cn70 } from "@tallyui/theme";
|
|
2890
|
-
import { jsx as
|
|
2898
|
+
import { jsx as jsx73, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2891
2899
|
function OrderDetail({
|
|
2892
2900
|
orderNumber,
|
|
2893
2901
|
status,
|
|
@@ -2901,39 +2909,39 @@ function OrderDetail({
|
|
|
2901
2909
|
className,
|
|
2902
2910
|
...viewProps
|
|
2903
2911
|
}) {
|
|
2904
|
-
return /* @__PURE__ */
|
|
2905
|
-
/* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2912
|
+
return /* @__PURE__ */ jsx73(ScrollView9, { className: cn70("flex-1", className), ...viewProps, children: /* @__PURE__ */ jsxs32(View41, { className: "gap-4 p-4", children: [
|
|
2913
|
+
/* @__PURE__ */ jsxs32(View41, { className: "flex-row items-center justify-between", children: [
|
|
2914
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-lg font-bold text-foreground", children: orderNumber }),
|
|
2915
|
+
/* @__PURE__ */ jsx73(OrderStatusBadge, { status })
|
|
2908
2916
|
] }),
|
|
2909
|
-
customerSlot && /* @__PURE__ */
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
lineItems.map((item, i) => /* @__PURE__ */
|
|
2913
|
-
/* @__PURE__ */
|
|
2917
|
+
customerSlot && /* @__PURE__ */ jsx73(View41, { className: "border-b border-border pb-3", children: customerSlot }),
|
|
2918
|
+
/* @__PURE__ */ jsxs32(View41, { className: "gap-1", children: [
|
|
2919
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-xs font-semibold text-muted-foreground", children: "Items" }),
|
|
2920
|
+
lineItems.map((item, i) => /* @__PURE__ */ jsxs32(View41, { className: "flex-row items-center justify-between py-1", children: [
|
|
2921
|
+
/* @__PURE__ */ jsxs32(Text25, { className: "flex-1 text-sm text-foreground", children: [
|
|
2914
2922
|
item.name,
|
|
2915
2923
|
" x",
|
|
2916
2924
|
item.quantity
|
|
2917
2925
|
] }),
|
|
2918
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm text-foreground", children: item.total })
|
|
2919
2927
|
] }, i))
|
|
2920
2928
|
] }),
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ jsxs32(View41, { className: "gap-1 border-t border-border pt-3", children: [
|
|
2930
|
+
/* @__PURE__ */ jsxs32(View41, { className: "flex-row justify-between", children: [
|
|
2931
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm text-muted-foreground", children: "Subtotal" }),
|
|
2932
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm text-foreground", children: subtotal })
|
|
2925
2933
|
] }),
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsxs32(View41, { className: "flex-row justify-between", children: [
|
|
2935
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm text-muted-foreground", children: "Tax" }),
|
|
2936
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm text-foreground", children: tax })
|
|
2929
2937
|
] }),
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
/* @__PURE__ */
|
|
2932
|
-
/* @__PURE__ */
|
|
2938
|
+
/* @__PURE__ */ jsxs32(View41, { className: "flex-row justify-between pt-1", children: [
|
|
2939
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm font-bold text-foreground", children: "Total" }),
|
|
2940
|
+
/* @__PURE__ */ jsx73(Text25, { className: "text-sm font-bold text-foreground", children: total })
|
|
2933
2941
|
] })
|
|
2934
2942
|
] }),
|
|
2935
|
-
paymentSlot && /* @__PURE__ */
|
|
2936
|
-
footerSlot && /* @__PURE__ */
|
|
2943
|
+
paymentSlot && /* @__PURE__ */ jsx73(View41, { className: "border-t border-border pt-3", children: paymentSlot }),
|
|
2944
|
+
footerSlot && /* @__PURE__ */ jsx73(View41, { className: "border-t border-border pt-3", children: footerSlot })
|
|
2937
2945
|
] }) });
|
|
2938
2946
|
}
|
|
2939
2947
|
|
|
@@ -2941,7 +2949,7 @@ function OrderDetail({
|
|
|
2941
2949
|
import { useState as useState8 } from "react";
|
|
2942
2950
|
import { Text as Text26, View as View42 } from "react-native";
|
|
2943
2951
|
import { cn as cn71 } from "@tallyui/theme";
|
|
2944
|
-
import { jsx as
|
|
2952
|
+
import { jsx as jsx74, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2945
2953
|
var DEFAULT_DENOMINATIONS = [
|
|
2946
2954
|
{ label: "$100", value: 100 },
|
|
2947
2955
|
{ label: "$50", value: 50 },
|
|
@@ -2979,10 +2987,10 @@ function CashCountInput({
|
|
|
2979
2987
|
);
|
|
2980
2988
|
onChangeTotal?.(newTotal);
|
|
2981
2989
|
};
|
|
2982
|
-
return /* @__PURE__ */
|
|
2983
|
-
denominations2.map((d) => /* @__PURE__ */
|
|
2984
|
-
/* @__PURE__ */
|
|
2985
|
-
/* @__PURE__ */
|
|
2990
|
+
return /* @__PURE__ */ jsxs33(View42, { className: cn71("gap-2", className), ...viewProps, children: [
|
|
2991
|
+
denominations2.map((d) => /* @__PURE__ */ jsxs33(View42, { className: "flex-row items-center justify-between px-3 py-1", children: [
|
|
2992
|
+
/* @__PURE__ */ jsx74(Text26, { className: "w-16 text-sm font-medium text-foreground", children: d.label }),
|
|
2993
|
+
/* @__PURE__ */ jsx74(
|
|
2986
2994
|
QuantityStepper,
|
|
2987
2995
|
{
|
|
2988
2996
|
quantity: counts[d.value] ?? 0,
|
|
@@ -2990,9 +2998,9 @@ function CashCountInput({
|
|
|
2990
2998
|
onChangeQuantity: (qty) => handleCountChange(d.value, qty)
|
|
2991
2999
|
}
|
|
2992
3000
|
),
|
|
2993
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx74(Text26, { className: "w-20 text-right text-sm text-muted-foreground", children: (d.value * (counts[d.value] ?? 0)).toFixed(2) })
|
|
2994
3002
|
] }, d.value)),
|
|
2995
|
-
/* @__PURE__ */
|
|
3003
|
+
/* @__PURE__ */ jsx74(View42, { className: "border-t border-border px-3 pt-2", children: /* @__PURE__ */ jsxs33(Text26, { className: "text-right text-base font-bold text-foreground", children: [
|
|
2996
3004
|
"Total: ",
|
|
2997
3005
|
total.toFixed(2)
|
|
2998
3006
|
] }) })
|
|
@@ -3002,7 +3010,7 @@ function CashCountInput({
|
|
|
3002
3010
|
// src/register/register-summary.tsx
|
|
3003
3011
|
import { Text as Text27, View as View43 } from "react-native";
|
|
3004
3012
|
import { cn as cn72 } from "@tallyui/theme";
|
|
3005
|
-
import { jsx as
|
|
3013
|
+
import { jsx as jsx75, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3006
3014
|
function RegisterSummary({
|
|
3007
3015
|
expectedCash,
|
|
3008
3016
|
actualCash,
|
|
@@ -3013,37 +3021,37 @@ function RegisterSummary({
|
|
|
3013
3021
|
...viewProps
|
|
3014
3022
|
}) {
|
|
3015
3023
|
const discrepancy = actualCash - expectedCash;
|
|
3016
|
-
return /* @__PURE__ */
|
|
3024
|
+
return /* @__PURE__ */ jsxs34(View43, { className: cn72("gap-4 rounded-lg border border-border bg-card p-4", className), ...viewProps, children: [
|
|
3017
3025
|
headerSlot,
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
/* @__PURE__ */
|
|
3021
|
-
/* @__PURE__ */
|
|
3022
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsxs34(View43, { className: "gap-2", children: [
|
|
3027
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-xs font-semibold text-muted-foreground", children: "Cash Drawer" }),
|
|
3028
|
+
/* @__PURE__ */ jsxs34(View43, { className: "flex-row justify-between", children: [
|
|
3029
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm text-foreground", children: "Expected" }),
|
|
3030
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm text-foreground", children: expectedCash.toFixed(2) })
|
|
3023
3031
|
] }),
|
|
3024
|
-
/* @__PURE__ */
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsxs34(View43, { className: "flex-row justify-between", children: [
|
|
3033
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm text-foreground", children: "Actual" }),
|
|
3034
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm text-foreground", children: actualCash.toFixed(2) })
|
|
3027
3035
|
] }),
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3030
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ jsxs34(View43, { className: "flex-row justify-between border-t border-border pt-1", children: [
|
|
3037
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm font-semibold text-foreground", children: "Discrepancy" }),
|
|
3038
|
+
/* @__PURE__ */ jsxs34(Text27, { className: cn72("text-sm font-semibold", discrepancy === 0 ? "text-success" : "text-destructive"), children: [
|
|
3031
3039
|
discrepancy >= 0 ? "" : "-",
|
|
3032
3040
|
Math.abs(discrepancy).toFixed(2)
|
|
3033
3041
|
] })
|
|
3034
3042
|
] })
|
|
3035
3043
|
] }),
|
|
3036
|
-
transactions.length > 0 && /* @__PURE__ */
|
|
3037
|
-
/* @__PURE__ */
|
|
3038
|
-
transactions.map((t) => /* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
/* @__PURE__ */
|
|
3044
|
+
transactions.length > 0 && /* @__PURE__ */ jsxs34(View43, { className: "gap-2", children: [
|
|
3045
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-xs font-semibold text-muted-foreground", children: "Transactions" }),
|
|
3046
|
+
transactions.map((t) => /* @__PURE__ */ jsxs34(View43, { className: "flex-row items-center justify-between", children: [
|
|
3047
|
+
/* @__PURE__ */ jsxs34(View43, { className: "gap-0.5", children: [
|
|
3048
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm text-foreground", children: t.method }),
|
|
3049
|
+
/* @__PURE__ */ jsxs34(Text27, { className: "text-xs text-muted-foreground", children: [
|
|
3042
3050
|
t.count,
|
|
3043
3051
|
" transactions"
|
|
3044
3052
|
] })
|
|
3045
3053
|
] }),
|
|
3046
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ jsx75(Text27, { className: "text-sm font-semibold text-foreground", children: t.total.toFixed(2) })
|
|
3047
3055
|
] }, t.method))
|
|
3048
3056
|
] }),
|
|
3049
3057
|
footerSlot
|
|
@@ -3053,7 +3061,7 @@ function RegisterSummary({
|
|
|
3053
3061
|
// src/register/register-open-close.tsx
|
|
3054
3062
|
import { Pressable as Pressable20, Text as Text28, View as View44 } from "react-native";
|
|
3055
3063
|
import { cn as cn73 } from "@tallyui/theme";
|
|
3056
|
-
import { jsx as
|
|
3064
|
+
import { jsx as jsx76, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3057
3065
|
function RegisterOpenClose({
|
|
3058
3066
|
isOpen,
|
|
3059
3067
|
onOpen,
|
|
@@ -3064,20 +3072,20 @@ function RegisterOpenClose({
|
|
|
3064
3072
|
className,
|
|
3065
3073
|
...viewProps
|
|
3066
3074
|
}) {
|
|
3067
|
-
return /* @__PURE__ */
|
|
3068
|
-
/* @__PURE__ */
|
|
3069
|
-
isOpen && expectedBalance != null && /* @__PURE__ */
|
|
3070
|
-
/* @__PURE__ */
|
|
3071
|
-
/* @__PURE__ */
|
|
3075
|
+
return /* @__PURE__ */ jsxs35(View44, { className: cn73("gap-4 p-4", className), ...viewProps, children: [
|
|
3076
|
+
/* @__PURE__ */ jsx76(Text28, { className: "text-lg font-bold text-foreground", children: isOpen ? "Close Register" : "Open Register" }),
|
|
3077
|
+
isOpen && expectedBalance != null && /* @__PURE__ */ jsxs35(View44, { className: "flex-row justify-between rounded-lg bg-muted px-3 py-2", children: [
|
|
3078
|
+
/* @__PURE__ */ jsx76(Text28, { className: "text-sm text-muted-foreground", children: "Expected Balance" }),
|
|
3079
|
+
/* @__PURE__ */ jsx76(Text28, { className: "text-sm font-semibold text-foreground", children: expectedBalance.toFixed(2) })
|
|
3072
3080
|
] }),
|
|
3073
|
-
cashCountSlot && /* @__PURE__ */
|
|
3074
|
-
notesSlot && /* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3081
|
+
cashCountSlot && /* @__PURE__ */ jsx76(View44, { children: cashCountSlot }),
|
|
3082
|
+
notesSlot && /* @__PURE__ */ jsx76(View44, { children: notesSlot }),
|
|
3083
|
+
/* @__PURE__ */ jsx76(
|
|
3076
3084
|
Pressable20,
|
|
3077
3085
|
{
|
|
3078
3086
|
onPress: isOpen ? onClose : onOpen,
|
|
3079
3087
|
className: "items-center rounded-lg bg-primary px-4 py-3",
|
|
3080
|
-
children: /* @__PURE__ */
|
|
3088
|
+
children: /* @__PURE__ */ jsx76(Text28, { className: "text-sm font-semibold text-primary-foreground", children: isOpen ? "Close Register" : "Open Register" })
|
|
3081
3089
|
}
|
|
3082
3090
|
)
|
|
3083
3091
|
] });
|
|
@@ -3085,26 +3093,26 @@ function RegisterOpenClose({
|
|
|
3085
3093
|
|
|
3086
3094
|
// src/register/register-picker.tsx
|
|
3087
3095
|
import { ScrollView as ScrollView10 } from "react-native";
|
|
3088
|
-
import { jsx as
|
|
3096
|
+
import { jsx as jsx77, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3089
3097
|
function RegisterPicker({ registers, onPick, className }) {
|
|
3090
|
-
return /* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
registers.map((register) => /* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ jsxs36(Card, { testID: "register-picker", className, children: [
|
|
3099
|
+
/* @__PURE__ */ jsx77(CardHeader, { children: /* @__PURE__ */ jsx77(CardTitle, { children: "Choose a register" }) }),
|
|
3100
|
+
/* @__PURE__ */ jsx77(CardContent, { children: /* @__PURE__ */ jsxs36(ScrollView10, { children: [
|
|
3101
|
+
registers.map((register) => /* @__PURE__ */ jsx77(
|
|
3094
3102
|
Button,
|
|
3095
3103
|
{
|
|
3096
3104
|
testID: `register-picker-row-${register.id}`,
|
|
3097
3105
|
variant: "ghost",
|
|
3098
3106
|
className: "h-auto min-h-11 items-start justify-start py-2",
|
|
3099
3107
|
onPress: () => onPick(register.id),
|
|
3100
|
-
children: /* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
/* @__PURE__ */
|
|
3108
|
+
children: /* @__PURE__ */ jsxs36(VStack, { space: "none", children: [
|
|
3109
|
+
/* @__PURE__ */ jsx77(Text, { numberOfLines: 1, children: register.name }),
|
|
3110
|
+
/* @__PURE__ */ jsx77(Text, { testID: `register-picker-row-${register.id}-status`, className: "text-muted-foreground text-sm", children: "Not opened" })
|
|
3103
3111
|
] })
|
|
3104
3112
|
},
|
|
3105
3113
|
register.id
|
|
3106
3114
|
)),
|
|
3107
|
-
registers.length === 0 && /* @__PURE__ */
|
|
3115
|
+
registers.length === 0 && /* @__PURE__ */ jsx77(Text, { testID: "register-picker-empty", className: "text-muted-foreground p-4", children: "No registers are set up for this store yet." })
|
|
3108
3116
|
] }) })
|
|
3109
3117
|
] });
|
|
3110
3118
|
}
|
|
@@ -3115,7 +3123,7 @@ import { View as View45 } from "react-native";
|
|
|
3115
3123
|
import { parseMinor, validAmount } from "@tallyui/pos";
|
|
3116
3124
|
import { currencySymbol, formatMoney as formatMoney6, minorUnitDigits as minorUnitDigits3 } from "@tallyui/core";
|
|
3117
3125
|
import { cn as cn74 } from "@tallyui/theme";
|
|
3118
|
-
import { jsx as
|
|
3126
|
+
import { jsx as jsx78, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3119
3127
|
var AMOUNT_LABEL_ID = "open-register-amount-label";
|
|
3120
3128
|
function OpenRegisterCard({ register, currency, configuredFloatMinor, className }) {
|
|
3121
3129
|
const digits = minorUnitDigits3(currency);
|
|
@@ -3140,10 +3148,10 @@ function OpenRegisterCard({ register, currency, configuredFloatMinor, className
|
|
|
3140
3148
|
}
|
|
3141
3149
|
};
|
|
3142
3150
|
const amountLabel = `Cash in the drawer to start (${currencySymbol(currency)})`;
|
|
3143
|
-
return /* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
/* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ jsxs37(View45, { testID: "open-register-card", className: cn74("bg-card gap-3 rounded-md p-4", className), children: [
|
|
3152
|
+
/* @__PURE__ */ jsx78(Text, { className: "text-lg font-semibold", children: "Open register" }),
|
|
3153
|
+
/* @__PURE__ */ jsx78(Label, { testID: "open-register-amount-label", nativeID: AMOUNT_LABEL_ID, children: amountLabel }),
|
|
3154
|
+
/* @__PURE__ */ jsx78(Input, { children: /* @__PURE__ */ jsx78(
|
|
3147
3155
|
Input.Field,
|
|
3148
3156
|
{
|
|
3149
3157
|
testID: "open-register-amount",
|
|
@@ -3154,40 +3162,40 @@ function OpenRegisterCard({ register, currency, configuredFloatMinor, className
|
|
|
3154
3162
|
accessibilityLabelledBy: AMOUNT_LABEL_ID
|
|
3155
3163
|
}
|
|
3156
3164
|
) }),
|
|
3157
|
-
configuredFloatMinor != null && /* @__PURE__ */
|
|
3165
|
+
configuredFloatMinor != null && /* @__PURE__ */ jsx78(
|
|
3158
3166
|
Button,
|
|
3159
3167
|
{
|
|
3160
3168
|
testID: "open-register-chip-configured",
|
|
3161
3169
|
variant: "outline",
|
|
3162
3170
|
className: "min-h-11",
|
|
3163
3171
|
onPress: () => setEnteredAmount(decimal(configuredFloatMinor, digits)),
|
|
3164
|
-
children: /* @__PURE__ */
|
|
3172
|
+
children: /* @__PURE__ */ jsxs37(Text, { children: [
|
|
3165
3173
|
"Use the configured float (",
|
|
3166
3174
|
formatMoney6({ amount: configuredFloatMinor, currency }),
|
|
3167
3175
|
")"
|
|
3168
3176
|
] })
|
|
3169
3177
|
}
|
|
3170
3178
|
),
|
|
3171
|
-
lastCountedMinor != null && /* @__PURE__ */
|
|
3179
|
+
lastCountedMinor != null && /* @__PURE__ */ jsx78(
|
|
3172
3180
|
Button,
|
|
3173
3181
|
{
|
|
3174
3182
|
testID: "open-register-chip-last",
|
|
3175
3183
|
variant: "outline",
|
|
3176
3184
|
className: "min-h-11",
|
|
3177
3185
|
onPress: () => setEnteredAmount(decimal(lastCountedMinor, digits)),
|
|
3178
|
-
children: /* @__PURE__ */
|
|
3186
|
+
children: /* @__PURE__ */ jsxs37(Text, { children: [
|
|
3179
3187
|
"Use the last counted cash (",
|
|
3180
3188
|
formatMoney6({ amount: lastCountedMinor, currency }),
|
|
3181
3189
|
")"
|
|
3182
3190
|
] })
|
|
3183
3191
|
}
|
|
3184
3192
|
),
|
|
3185
|
-
expectedFloatMinor !== null && valid && countedMinor !== expectedFloatMinor && /* @__PURE__ */
|
|
3193
|
+
expectedFloatMinor !== null && valid && countedMinor !== expectedFloatMinor && /* @__PURE__ */ jsxs37(Text, { testID: "opening-variance", children: [
|
|
3186
3194
|
formatMoney6({ amount: countedMinor - expectedFloatMinor, currency }),
|
|
3187
3195
|
" vs the expected float"
|
|
3188
3196
|
] }),
|
|
3189
|
-
!!error && /* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3197
|
+
!!error && /* @__PURE__ */ jsx78(Text, { className: "text-destructive", children: error }),
|
|
3198
|
+
/* @__PURE__ */ jsx78(Button, { testID: "open-register-button", className: "min-h-14", disabled: busy || !valid, onPress: open, children: /* @__PURE__ */ jsx78(Text, { children: busy ? "Opening\u2026" : "Open register" }) })
|
|
3191
3199
|
] });
|
|
3192
3200
|
}
|
|
3193
3201
|
function decimal(minor, digits) {
|
|
@@ -3220,7 +3228,7 @@ function describeRegisterBarPill({
|
|
|
3220
3228
|
}
|
|
3221
3229
|
|
|
3222
3230
|
// src/register/register-bar.tsx
|
|
3223
|
-
import { jsx as
|
|
3231
|
+
import { jsx as jsx79, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3224
3232
|
function RegisterBar({
|
|
3225
3233
|
register,
|
|
3226
3234
|
registerId,
|
|
@@ -3241,10 +3249,10 @@ function RegisterBar({
|
|
|
3241
3249
|
sessionsOn: enabled,
|
|
3242
3250
|
closing
|
|
3243
3251
|
});
|
|
3244
|
-
return /* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
pill && (onPressPill ? /* @__PURE__ */
|
|
3247
|
-
(session || lastClosure) && /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ jsxs38(HStack, { testID: "register-bar", className: cn75("bg-card border-border h-12 border-b px-3", className), children: [
|
|
3253
|
+
/* @__PURE__ */ jsx79(View46, { className: "min-w-0 flex-1 shrink", children: multiRegister && registerId !== null && /* @__PURE__ */ jsx79(Text, { testID: "register-bar-name", numberOfLines: 1, children: registerName }) }),
|
|
3254
|
+
pill && (onPressPill ? /* @__PURE__ */ jsx79(Pressable21, { testID: "register-bar-pill", accessibilityRole: "button", accessibilityLabel: pill, onPress: onPressPill, children: /* @__PURE__ */ jsx79(Badge, { label: pill, variant: "warning" }) }) : /* @__PURE__ */ jsx79(Badge, { testID: "register-bar-pill", label: pill, variant: "warning" })),
|
|
3255
|
+
(session || lastClosure) && /* @__PURE__ */ jsx79(
|
|
3248
3256
|
Button,
|
|
3249
3257
|
{
|
|
3250
3258
|
variant: "ghost",
|
|
@@ -3252,7 +3260,7 @@ function RegisterBar({
|
|
|
3252
3260
|
testID: "register-bar-open-panel",
|
|
3253
3261
|
accessibilityLabel: "Open register panel",
|
|
3254
3262
|
onPress: onOpenPanel,
|
|
3255
|
-
children: /* @__PURE__ */
|
|
3263
|
+
children: /* @__PURE__ */ jsx79(Text, { className: overdue ? "text-warning" : void 0, children: "Register \u203A" })
|
|
3256
3264
|
}
|
|
3257
3265
|
)
|
|
3258
3266
|
] });
|
|
@@ -3262,7 +3270,7 @@ function RegisterBar({
|
|
|
3262
3270
|
import { useRef as useRef3, useState as useState10 } from "react";
|
|
3263
3271
|
import { movementFieldError, normalizeAmount, parseMinor as parseMinor2 } from "@tallyui/pos";
|
|
3264
3272
|
import { currencySymbol as currencySymbol2, minorUnitDigits as minorUnitDigits4 } from "@tallyui/core";
|
|
3265
|
-
import { Fragment as
|
|
3273
|
+
import { Fragment as Fragment3, jsx as jsx80, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3266
3274
|
var LABELS = {
|
|
3267
3275
|
paid_in: "Paid in",
|
|
3268
3276
|
paid_out: "Paid out",
|
|
@@ -3298,11 +3306,11 @@ function MovementSheet({ register, type, currency, onDone, onOpenChange, onOpenD
|
|
|
3298
3306
|
setBusy(false);
|
|
3299
3307
|
}
|
|
3300
3308
|
};
|
|
3301
|
-
return /* @__PURE__ */
|
|
3302
|
-
/* @__PURE__ */
|
|
3303
|
-
type !== "no_sale" && /* @__PURE__ */
|
|
3304
|
-
/* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsx80(Dialog, { open: true, onOpenChange, children: /* @__PURE__ */ jsxs39(DialogContent, { testID: "movement-sheet", children: [
|
|
3310
|
+
/* @__PURE__ */ jsx80(DialogTitle, { children: LABELS[type] }),
|
|
3311
|
+
type !== "no_sale" && /* @__PURE__ */ jsxs39(Fragment3, { children: [
|
|
3312
|
+
/* @__PURE__ */ jsx80(Label, { testID: "movement-amount-label", nativeID: AMOUNT_LABEL_ID2, children: `Amount (${currencySymbol2(currency)})` }),
|
|
3313
|
+
/* @__PURE__ */ jsx80(Input, { children: /* @__PURE__ */ jsx80(
|
|
3306
3314
|
Input.Field,
|
|
3307
3315
|
{
|
|
3308
3316
|
testID: "movement-amount",
|
|
@@ -3314,8 +3322,8 @@ function MovementSheet({ register, type, currency, onDone, onOpenChange, onOpenD
|
|
|
3314
3322
|
}
|
|
3315
3323
|
) })
|
|
3316
3324
|
] }),
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3325
|
+
/* @__PURE__ */ jsx80(Label, { testID: "movement-reason-label", nativeID: REASON_LABEL_ID, children: "Reason" }),
|
|
3326
|
+
/* @__PURE__ */ jsx80(Input, { children: /* @__PURE__ */ jsx80(
|
|
3319
3327
|
Input.Field,
|
|
3320
3328
|
{
|
|
3321
3329
|
testID: "movement-reason",
|
|
@@ -3326,9 +3334,9 @@ function MovementSheet({ register, type, currency, onDone, onOpenChange, onOpenD
|
|
|
3326
3334
|
accessibilityLabelledBy: REASON_LABEL_ID
|
|
3327
3335
|
}
|
|
3328
3336
|
) }),
|
|
3329
|
-
!!error && /* @__PURE__ */
|
|
3330
|
-
!!invalid && /* @__PURE__ */
|
|
3331
|
-
/* @__PURE__ */
|
|
3337
|
+
!!error && /* @__PURE__ */ jsx80(Text, { className: "text-destructive", children: error }),
|
|
3338
|
+
!!invalid && /* @__PURE__ */ jsx80(Text, { testID: "movement-invalid", className: "text-muted-foreground", children: invalid === "amount" ? "Enter a valid amount." : "Enter a reason." }),
|
|
3339
|
+
/* @__PURE__ */ jsx80(Button, { testID: "movement-confirm", disabled: !!invalid || busy, onPress: confirm, children: /* @__PURE__ */ jsx80(Text, { children: busy ? "Recording\u2026" : "Record" }) })
|
|
3332
3340
|
] }) });
|
|
3333
3341
|
}
|
|
3334
3342
|
|
|
@@ -3336,7 +3344,7 @@ function MovementSheet({ register, type, currency, onDone, onOpenChange, onOpenD
|
|
|
3336
3344
|
import { useState as useState11 } from "react";
|
|
3337
3345
|
import { ScrollView as ScrollView11, useWindowDimensions, View as View47 } from "react-native";
|
|
3338
3346
|
import { formatMoney as formatMoney7 } from "@tallyui/core";
|
|
3339
|
-
import { jsx as
|
|
3347
|
+
import { jsx as jsx81, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3340
3348
|
var DIALOG_VERTICAL_MARGIN = 64;
|
|
3341
3349
|
function RegisterPanel({ register, currency, registerName, open, onOpenChange, className }) {
|
|
3342
3350
|
const { session, expected, salesCount, blind, movements, lastClosure, actions } = register;
|
|
@@ -3356,22 +3364,25 @@ function RegisterPanel({ register, currency, registerName, open, onOpenChange, c
|
|
|
3356
3364
|
const activeMovements = movements.filter(
|
|
3357
3365
|
(row) => row.type !== "void" && !row.voided_by && !movements.some((entry) => entry.voids === row.id)
|
|
3358
3366
|
);
|
|
3359
|
-
return /* @__PURE__ */
|
|
3367
|
+
return /* @__PURE__ */ jsx81(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs40(
|
|
3360
3368
|
DialogContent,
|
|
3361
3369
|
{
|
|
3362
3370
|
testID: "register-panel",
|
|
3363
3371
|
className: `flex-col overflow-hidden ${className ?? ""}`,
|
|
3364
3372
|
style: { maxHeight },
|
|
3365
3373
|
children: [
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
|
|
3374
|
+
/* @__PURE__ */ jsxs40(View47, { className: "flex-row items-center justify-between gap-2", children: [
|
|
3375
|
+
/* @__PURE__ */ jsx81(DialogTitle, { testID: "register-panel-amount", children: registerName ?? "Register" }),
|
|
3376
|
+
/* @__PURE__ */ jsx81(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx81(IconButton, { variant: "ghost", size: "sm", testID: "register-panel-dismiss", accessibilityLabel: "Close panel", children: /* @__PURE__ */ jsx81(XIcon, { size: 16 }) }) })
|
|
3377
|
+
] }),
|
|
3378
|
+
/* @__PURE__ */ jsxs40(Text, { testID: "register-panel-sales-count", children: [
|
|
3368
3379
|
salesCount,
|
|
3369
3380
|
" sale",
|
|
3370
3381
|
salesCount === 1 ? "" : "s",
|
|
3371
3382
|
" this session"
|
|
3372
3383
|
] }),
|
|
3373
|
-
/* @__PURE__ */
|
|
3374
|
-
/* @__PURE__ */
|
|
3384
|
+
/* @__PURE__ */ jsxs40(ScrollView11, { testID: "register-panel-body", className: "flex-1", contentContainerClassName: "gap-3", children: [
|
|
3385
|
+
/* @__PURE__ */ jsx81(View47, { className: "flex-row gap-2", children: ["paid_in", "paid_out", "no_sale"].map((type) => /* @__PURE__ */ jsx81(
|
|
3375
3386
|
Button,
|
|
3376
3387
|
{
|
|
3377
3388
|
testID: `register-panel-${type.replace("_", "-")}`,
|
|
@@ -3379,33 +3390,33 @@ function RegisterPanel({ register, currency, registerName, open, onOpenChange, c
|
|
|
3379
3390
|
variant: "outline",
|
|
3380
3391
|
disabled: session?.status !== "open",
|
|
3381
3392
|
onPress: () => setMovementType(type),
|
|
3382
|
-
children: /* @__PURE__ */
|
|
3393
|
+
children: /* @__PURE__ */ jsx81(Text, { children: type === "paid_in" ? "Paid in" : type === "paid_out" ? "Paid out" : "No sale" })
|
|
3383
3394
|
},
|
|
3384
3395
|
type
|
|
3385
3396
|
)) }),
|
|
3386
|
-
!blind && /* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */
|
|
3388
|
-
Object.entries(expected).map(([method, amount]) => /* @__PURE__ */
|
|
3389
|
-
/* @__PURE__ */
|
|
3390
|
-
/* @__PURE__ */
|
|
3397
|
+
!blind && /* @__PURE__ */ jsxs40(View47, { testID: "register-panel-expected", className: "gap-1", children: [
|
|
3398
|
+
/* @__PURE__ */ jsx81(Text, { className: "text-muted-foreground text-sm font-semibold", children: "Expected in the drawer" }),
|
|
3399
|
+
Object.entries(expected).map(([method, amount]) => /* @__PURE__ */ jsxs40(View47, { className: "min-h-11 flex-row items-center justify-between", children: [
|
|
3400
|
+
/* @__PURE__ */ jsx81(Text, { className: "capitalize", children: method === "cash" ? "Cash" : method }),
|
|
3401
|
+
/* @__PURE__ */ jsx81(Text, { className: "tabular-nums", children: formatMoney7({ amount, currency }) })
|
|
3391
3402
|
] }, method))
|
|
3392
3403
|
] }),
|
|
3393
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ jsx81(
|
|
3394
3405
|
Button,
|
|
3395
3406
|
{
|
|
3396
3407
|
testID: "register-panel-movements",
|
|
3397
3408
|
variant: "ghost",
|
|
3398
3409
|
className: "min-h-11",
|
|
3399
3410
|
onPress: () => setExpanded(!expanded),
|
|
3400
|
-
children: /* @__PURE__ */
|
|
3411
|
+
children: /* @__PURE__ */ jsx81(Text, { children: "Paid in / out" })
|
|
3401
3412
|
}
|
|
3402
3413
|
),
|
|
3403
|
-
expanded && activeMovements.map((row) => /* @__PURE__ */
|
|
3404
|
-
/* @__PURE__ */
|
|
3414
|
+
expanded && activeMovements.map((row) => /* @__PURE__ */ jsxs40(View47, { className: "min-h-11 flex-row items-center gap-2", children: [
|
|
3415
|
+
/* @__PURE__ */ jsxs40(Text, { testID: `movement-row-${row.id}`, className: "flex-1", children: [
|
|
3405
3416
|
row.type === "paid_in" ? "Paid in" : row.type === "paid_out" ? "Paid out" : "No sale",
|
|
3406
3417
|
!blind ? ` \xB7 ${formatMoney7({ amount: row.amountMinor, currency })} \xB7 ${row.reason}` : ""
|
|
3407
3418
|
] }),
|
|
3408
|
-
/* @__PURE__ */
|
|
3419
|
+
/* @__PURE__ */ jsx81(
|
|
3409
3420
|
Button,
|
|
3410
3421
|
{
|
|
3411
3422
|
variant: "ghost",
|
|
@@ -3413,12 +3424,12 @@ function RegisterPanel({ register, currency, registerName, open, onOpenChange, c
|
|
|
3413
3424
|
testID: `movement-void-${row.id}`,
|
|
3414
3425
|
disabled: session?.status !== "open",
|
|
3415
3426
|
onPress: () => attempt(() => actions.voidMovement(row.id)),
|
|
3416
|
-
children: /* @__PURE__ */
|
|
3427
|
+
children: /* @__PURE__ */ jsx81(Text, { children: "Undo" })
|
|
3417
3428
|
}
|
|
3418
3429
|
)
|
|
3419
3430
|
] }, row.id)),
|
|
3420
|
-
!!error && /* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3431
|
+
!!error && /* @__PURE__ */ jsx81(Text, { className: "text-destructive", children: error }),
|
|
3432
|
+
/* @__PURE__ */ jsx81(
|
|
3422
3433
|
Button,
|
|
3423
3434
|
{
|
|
3424
3435
|
testID: "register-panel-close",
|
|
@@ -3429,11 +3440,11 @@ function RegisterPanel({ register, currency, registerName, open, onOpenChange, c
|
|
|
3429
3440
|
await actions.startCounting();
|
|
3430
3441
|
onOpenChange(false);
|
|
3431
3442
|
}),
|
|
3432
|
-
children: /* @__PURE__ */
|
|
3443
|
+
children: /* @__PURE__ */ jsx81(Text, { children: "Close register" })
|
|
3433
3444
|
}
|
|
3434
3445
|
)
|
|
3435
3446
|
] }),
|
|
3436
|
-
movementType && /* @__PURE__ */
|
|
3447
|
+
movementType && /* @__PURE__ */ jsx81(
|
|
3437
3448
|
MovementSheet,
|
|
3438
3449
|
{
|
|
3439
3450
|
register,
|
|
@@ -3453,7 +3464,7 @@ function RegisterPanel({ register, currency, registerName, open, onOpenChange, c
|
|
|
3453
3464
|
// src/register/register-column.tsx
|
|
3454
3465
|
import { useState as useState12 } from "react";
|
|
3455
3466
|
import { View as View48 } from "react-native";
|
|
3456
|
-
import { Fragment as
|
|
3467
|
+
import { Fragment as Fragment4, jsx as jsx82, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3457
3468
|
function RegisterColumn({
|
|
3458
3469
|
register,
|
|
3459
3470
|
registerId,
|
|
@@ -3467,28 +3478,28 @@ function RegisterColumn({
|
|
|
3467
3478
|
}) {
|
|
3468
3479
|
const [finishing, setFinishing] = useState12(false);
|
|
3469
3480
|
if (registerId === null) {
|
|
3470
|
-
return /* @__PURE__ */
|
|
3481
|
+
return /* @__PURE__ */ jsx82(RegisterPicker, { registers, onPick, className: "flex-1" });
|
|
3471
3482
|
}
|
|
3472
3483
|
if (register.session?.status === "closed") {
|
|
3473
|
-
return register.closing && !finishing ? /* @__PURE__ */
|
|
3484
|
+
return register.closing && !finishing ? /* @__PURE__ */ jsx82(Fragment4, { children: countSlot }) : /* @__PURE__ */ jsx82(FinishClose, { register, busy: finishing, setBusy: setFinishing });
|
|
3474
3485
|
}
|
|
3475
3486
|
if (!register.session) {
|
|
3476
|
-
return /* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ jsx82(OpenRegisterCard, { register, currency, configuredFloatMinor, className: "flex-1" });
|
|
3477
3488
|
}
|
|
3478
3489
|
if (register.session.status === "counting") {
|
|
3479
|
-
return /* @__PURE__ */
|
|
3490
|
+
return /* @__PURE__ */ jsx82(Fragment4, { children: countSlot });
|
|
3480
3491
|
}
|
|
3481
|
-
return /* @__PURE__ */
|
|
3482
|
-
register.overdue && cartEmpty && /* @__PURE__ */
|
|
3483
|
-
/* @__PURE__ */
|
|
3484
|
-
/* @__PURE__ */
|
|
3492
|
+
return /* @__PURE__ */ jsxs41(View48, { testID: "register-column", className: "flex-1", children: [
|
|
3493
|
+
register.overdue && cartEmpty && /* @__PURE__ */ jsxs41(View48, { testID: "register-column-overdue", className: "bg-warning/10 flex-row items-center justify-between gap-2 px-3 py-2", children: [
|
|
3494
|
+
/* @__PURE__ */ jsx82(Text, { className: "flex-1", children: "This register is overdue for closing." }),
|
|
3495
|
+
/* @__PURE__ */ jsx82(
|
|
3485
3496
|
Button,
|
|
3486
3497
|
{
|
|
3487
3498
|
testID: "register-column-close-overdue",
|
|
3488
3499
|
variant: "outline",
|
|
3489
3500
|
className: "min-h-11",
|
|
3490
3501
|
onPress: () => register.actions.startCounting(),
|
|
3491
|
-
children: /* @__PURE__ */
|
|
3502
|
+
children: /* @__PURE__ */ jsx82(Text, { children: "Close register" })
|
|
3492
3503
|
}
|
|
3493
3504
|
)
|
|
3494
3505
|
] }),
|
|
@@ -3508,10 +3519,10 @@ function FinishClose({ register, busy, setBusy }) {
|
|
|
3508
3519
|
setBusy(false);
|
|
3509
3520
|
}
|
|
3510
3521
|
};
|
|
3511
|
-
return /* @__PURE__ */
|
|
3512
|
-
/* @__PURE__ */
|
|
3513
|
-
/* @__PURE__ */
|
|
3514
|
-
!!error && /* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ jsxs41(View48, { testID: "register-column-finish-close", className: "flex-1 gap-3 p-4", children: [
|
|
3523
|
+
/* @__PURE__ */ jsx82(Text, { children: "The last close didn't finish." }),
|
|
3524
|
+
/* @__PURE__ */ jsx82(Button, { testID: "register-column-finish-close-button", nativeID: "register-column-finish-close-button", disabled: busy, onPress: finish, children: /* @__PURE__ */ jsx82(Text, { children: "Finish closing" }) }),
|
|
3525
|
+
!!error && /* @__PURE__ */ jsx82(Text, { testID: "register-column-finish-close-error", className: "text-destructive", children: error })
|
|
3515
3526
|
] });
|
|
3516
3527
|
}
|
|
3517
3528
|
|
|
@@ -3530,7 +3541,7 @@ import {
|
|
|
3530
3541
|
} from "@tallyui/pos";
|
|
3531
3542
|
import { currencySymbol as currencySymbol3, formatMoney as formatMoney8, minorUnitDigits as minorUnitDigits5 } from "@tallyui/core";
|
|
3532
3543
|
import { cn as cn76 } from "@tallyui/theme";
|
|
3533
|
-
import { jsx as
|
|
3544
|
+
import { jsx as jsx83, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3534
3545
|
var AMOUNT_LABEL_ID3 = "count-amount-label";
|
|
3535
3546
|
var APPROVAL_REQUIRED_TEXT = "Manager approval needed. Ask a manager to approve, or count again.";
|
|
3536
3547
|
function varianceWord(key) {
|
|
@@ -3561,7 +3572,7 @@ function DenominationTile({ value, count: count2, currency, onAdd }) {
|
|
|
3561
3572
|
timer.current = void 0;
|
|
3562
3573
|
};
|
|
3563
3574
|
useEffect3(() => stop, []);
|
|
3564
|
-
return /* @__PURE__ */
|
|
3575
|
+
return /* @__PURE__ */ jsxs42(
|
|
3565
3576
|
Pressable22,
|
|
3566
3577
|
{
|
|
3567
3578
|
testID: `den-tile-${value}`,
|
|
@@ -3583,8 +3594,8 @@ function DenominationTile({ value, count: count2, currency, onAdd }) {
|
|
|
3583
3594
|
if (!held.current) onAdd(1);
|
|
3584
3595
|
},
|
|
3585
3596
|
children: [
|
|
3586
|
-
/* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */
|
|
3597
|
+
/* @__PURE__ */ jsx83(Text, { className: "text-sm tabular-nums", numberOfLines: 1, children: label }),
|
|
3598
|
+
/* @__PURE__ */ jsx83(Text, { testID: `den-count-${value}`, className: "bg-background min-w-6 rounded-full px-1.5 text-center text-xs tabular-nums", children: count2 })
|
|
3588
3599
|
]
|
|
3589
3600
|
}
|
|
3590
3601
|
);
|
|
@@ -3654,11 +3665,11 @@ function RegisterCount({ register, currency, approve, className }) {
|
|
|
3654
3665
|
void attempt(() => actions.closeSession({ counted }));
|
|
3655
3666
|
};
|
|
3656
3667
|
if (!session) return null;
|
|
3657
|
-
return /* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
/* @__PURE__ */
|
|
3668
|
+
return /* @__PURE__ */ jsxs42(View49, { testID: "register-count", className: cn76("bg-card flex-1 rounded-md", className), children: [
|
|
3669
|
+
/* @__PURE__ */ jsxs42(ScrollView12, { className: "flex-1", contentContainerClassName: "gap-3 p-4", children: [
|
|
3670
|
+
/* @__PURE__ */ jsx83(Text, { className: "min-h-11 text-lg font-semibold", children: "Count the drawer" }),
|
|
3671
|
+
/* @__PURE__ */ jsx83(Label, { testID: "count-amount-label", nativeID: AMOUNT_LABEL_ID3, children: `Cash counted (${currencySymbol3(currency)})` }),
|
|
3672
|
+
/* @__PURE__ */ jsx83(Input, { children: /* @__PURE__ */ jsx83(
|
|
3662
3673
|
Input.Field,
|
|
3663
3674
|
{
|
|
3664
3675
|
testID: "count-amount",
|
|
@@ -3672,16 +3683,16 @@ function RegisterCount({ register, currency, approve, className }) {
|
|
|
3672
3683
|
accessibilityLabelledBy: AMOUNT_LABEL_ID3
|
|
3673
3684
|
}
|
|
3674
3685
|
) }),
|
|
3675
|
-
!blind && valid && /* @__PURE__ */
|
|
3686
|
+
!blind && valid && /* @__PURE__ */ jsx83(Text, { testID: "count-variance", className: "min-h-11 tabular-nums", children: `Expected ${formatMoney8({ amount: expected.cash ?? 0, currency })} \xB7 ${varianceText(
|
|
3676
3687
|
variance,
|
|
3677
3688
|
digits,
|
|
3678
3689
|
(major) => formatMoney8({ amount: Math.round(major * 10 ** digits), currency }) ?? "",
|
|
3679
3690
|
varianceWord
|
|
3680
3691
|
)}` }),
|
|
3681
|
-
/* @__PURE__ */
|
|
3682
|
-
Array.from({ length: Math.ceil(faces.length / columns) }, (_, row) => /* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsxs42(View49, { testID: "count-denominations", className: "gap-2", children: [
|
|
3693
|
+
Array.from({ length: Math.ceil(faces.length / columns) }, (_, row) => /* @__PURE__ */ jsx83(View49, { className: "flex-row gap-2", children: Array.from({ length: columns }, (_2, column) => {
|
|
3683
3694
|
const value = faces[row * columns + column];
|
|
3684
|
-
return value ? /* @__PURE__ */
|
|
3695
|
+
return value ? /* @__PURE__ */ jsx83(
|
|
3685
3696
|
DenominationTile,
|
|
3686
3697
|
{
|
|
3687
3698
|
value,
|
|
@@ -3690,9 +3701,9 @@ function RegisterCount({ register, currency, approve, className }) {
|
|
|
3690
3701
|
onAdd: (n) => addPieces(value, n)
|
|
3691
3702
|
},
|
|
3692
3703
|
value
|
|
3693
|
-
) : /* @__PURE__ */
|
|
3704
|
+
) : /* @__PURE__ */ jsx83(View49, { className: "flex-1" }, column);
|
|
3694
3705
|
}) }, row)),
|
|
3695
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ jsx83(
|
|
3696
3707
|
Button,
|
|
3697
3708
|
{
|
|
3698
3709
|
testID: "count-clear",
|
|
@@ -3702,16 +3713,16 @@ function RegisterCount({ register, currency, approve, className }) {
|
|
|
3702
3713
|
setPieces({});
|
|
3703
3714
|
setCashText(minorToDecimal(0, digits));
|
|
3704
3715
|
},
|
|
3705
|
-
children: /* @__PURE__ */
|
|
3716
|
+
children: /* @__PURE__ */ jsx83(Text, { children: "Clear" })
|
|
3706
3717
|
}
|
|
3707
3718
|
)
|
|
3708
3719
|
] }),
|
|
3709
3720
|
otherMethods.map((method) => {
|
|
3710
3721
|
const labelId = `count-tender-${method}-label`;
|
|
3711
3722
|
const label = `${tenderLabel(method)} counted (${currencySymbol3(currency)})`;
|
|
3712
|
-
return /* @__PURE__ */
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3723
|
+
return /* @__PURE__ */ jsxs42(View49, { className: "gap-2", children: [
|
|
3724
|
+
/* @__PURE__ */ jsx83(Label, { testID: labelId, nativeID: labelId, children: label }),
|
|
3725
|
+
/* @__PURE__ */ jsx83(Input, { children: /* @__PURE__ */ jsx83(
|
|
3715
3726
|
Input.Field,
|
|
3716
3727
|
{
|
|
3717
3728
|
testID: `count-tender-${method}`,
|
|
@@ -3724,11 +3735,11 @@ function RegisterCount({ register, currency, approve, className }) {
|
|
|
3724
3735
|
) })
|
|
3725
3736
|
] }, method);
|
|
3726
3737
|
}),
|
|
3727
|
-
!!refusal && /* @__PURE__ */
|
|
3728
|
-
!!error && /* @__PURE__ */
|
|
3738
|
+
!!refusal && /* @__PURE__ */ jsx83(Text, { testID: "count-manager-line", className: "text-warning min-h-11", children: refusal }),
|
|
3739
|
+
!!error && /* @__PURE__ */ jsx83(Text, { testID: "count-error", className: "text-destructive min-h-11", children: error })
|
|
3729
3740
|
] }),
|
|
3730
|
-
/* @__PURE__ */
|
|
3731
|
-
/* @__PURE__ */
|
|
3741
|
+
/* @__PURE__ */ jsxs42(View49, { className: "gap-2 border-t border-border p-4", children: [
|
|
3742
|
+
/* @__PURE__ */ jsx83(
|
|
3732
3743
|
Button,
|
|
3733
3744
|
{
|
|
3734
3745
|
testID: "count-back",
|
|
@@ -3736,17 +3747,17 @@ function RegisterCount({ register, currency, approve, className }) {
|
|
|
3736
3747
|
className: "min-h-11",
|
|
3737
3748
|
disabled: busy,
|
|
3738
3749
|
onPress: () => attempt(actions.backToSelling),
|
|
3739
|
-
children: /* @__PURE__ */
|
|
3750
|
+
children: /* @__PURE__ */ jsx83(Text, { children: "Back to selling" })
|
|
3740
3751
|
}
|
|
3741
3752
|
),
|
|
3742
|
-
/* @__PURE__ */
|
|
3753
|
+
/* @__PURE__ */ jsx83(
|
|
3743
3754
|
Button,
|
|
3744
3755
|
{
|
|
3745
3756
|
testID: "count-close",
|
|
3746
3757
|
className: "min-h-14",
|
|
3747
3758
|
disabled: !valid || otherTendersInvalid || busy,
|
|
3748
3759
|
onPress: onClose,
|
|
3749
|
-
children: /* @__PURE__ */
|
|
3760
|
+
children: /* @__PURE__ */ jsx83(Text, { children: busy ? "Closing\u2026" : "Close register" })
|
|
3750
3761
|
}
|
|
3751
3762
|
)
|
|
3752
3763
|
] })
|
|
@@ -3758,7 +3769,7 @@ import { useEffect as useEffect4, useRef as useRef5, useState as useState14 } fr
|
|
|
3758
3769
|
import { AccessibilityInfo, Animated, View as View50 } from "react-native";
|
|
3759
3770
|
import { countVariance as countVariance2, TAX_ROUNDING_MIXED_NOTE, varianceText as varianceText2 } from "@tallyui/pos";
|
|
3760
3771
|
import { formatMoney as formatMoney9, minorUnitDigits as minorUnitDigits6 } from "@tallyui/core";
|
|
3761
|
-
import { jsx as
|
|
3772
|
+
import { jsx as jsx84, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3762
3773
|
function useCompletionMotion() {
|
|
3763
3774
|
const opacity = useRef5(new Animated.Value(0)).current;
|
|
3764
3775
|
const scale = useRef5(new Animated.Value(0.6)).current;
|
|
@@ -3805,34 +3816,34 @@ function ClosureSheet({ register, currency, onPrint, onDone }) {
|
|
|
3805
3816
|
setBusy(false);
|
|
3806
3817
|
}
|
|
3807
3818
|
};
|
|
3808
|
-
return /* @__PURE__ */
|
|
3819
|
+
return /* @__PURE__ */ jsx84(
|
|
3809
3820
|
Dialog,
|
|
3810
3821
|
{
|
|
3811
3822
|
open: true,
|
|
3812
3823
|
onOpenChange: (open) => {
|
|
3813
3824
|
if (!open) onDone();
|
|
3814
3825
|
},
|
|
3815
|
-
children: /* @__PURE__ */
|
|
3816
|
-
/* @__PURE__ */
|
|
3826
|
+
children: /* @__PURE__ */ jsxs43(DialogContent, { testID: "closure-sheet", children: [
|
|
3827
|
+
/* @__PURE__ */ jsx84(
|
|
3817
3828
|
Animated.View,
|
|
3818
3829
|
{
|
|
3819
3830
|
testID: "closure-check",
|
|
3820
3831
|
style: { opacity, transform: [{ scale }] },
|
|
3821
3832
|
className: "bg-success/10 h-10 w-10 items-center justify-center rounded-full",
|
|
3822
|
-
children: /* @__PURE__ */
|
|
3833
|
+
children: /* @__PURE__ */ jsx84(Text, { className: "text-success text-lg font-bold", accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: "\u2713" })
|
|
3823
3834
|
}
|
|
3824
3835
|
),
|
|
3825
|
-
/* @__PURE__ */
|
|
3826
|
-
/* @__PURE__ */
|
|
3827
|
-
!blind && /* @__PURE__ */
|
|
3836
|
+
/* @__PURE__ */ jsx84(DialogTitle, { testID: "closure-title", children: "Register closed" }),
|
|
3837
|
+
/* @__PURE__ */ jsx84(Text, { testID: "closure-number", className: "text-muted-foreground min-h-11", children: `Closure #${closure.number}` }),
|
|
3838
|
+
!blind && /* @__PURE__ */ jsx84(View50, { testID: "closure-figures", className: "gap-3", children: methods.map((method) => {
|
|
3828
3839
|
const countedMinor = closure.counted[method] ?? 0;
|
|
3829
3840
|
const expectedMinor = closure.expected[method] ?? 0;
|
|
3830
3841
|
const varianceMinor = closure.variance[method] ?? countVariance2(countedMinor, expectedMinor);
|
|
3831
|
-
return /* @__PURE__ */
|
|
3832
|
-
/* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
3834
|
-
/* @__PURE__ */
|
|
3835
|
-
/* @__PURE__ */
|
|
3842
|
+
return /* @__PURE__ */ jsxs43(View50, { className: "gap-1", children: [
|
|
3843
|
+
/* @__PURE__ */ jsx84(Text, { className: "text-muted-foreground text-xs font-semibold", children: tenderLabel(method) }),
|
|
3844
|
+
/* @__PURE__ */ jsx84(Text, { testID: `closure-counted-${method}`, className: "min-h-11 tabular-nums", children: `Counted ${formatMoney9({ amount: countedMinor, currency })}` }),
|
|
3845
|
+
/* @__PURE__ */ jsx84(Text, { testID: `closure-expected-${method}`, className: "min-h-11 tabular-nums", children: `Expected ${formatMoney9({ amount: expectedMinor, currency })}` }),
|
|
3846
|
+
/* @__PURE__ */ jsx84(Text, { testID: `closure-variance-${method}`, className: "min-h-11 tabular-nums", children: varianceText2(
|
|
3836
3847
|
varianceMinor,
|
|
3837
3848
|
digits,
|
|
3838
3849
|
(major) => formatMoney9({ amount: Math.round(major * 10 ** digits), currency }) ?? "",
|
|
@@ -3840,14 +3851,14 @@ function ClosureSheet({ register, currency, onPrint, onDone }) {
|
|
|
3840
3851
|
) })
|
|
3841
3852
|
] }, method);
|
|
3842
3853
|
}) }),
|
|
3843
|
-
!!approvedBy && /* @__PURE__ */
|
|
3854
|
+
!!approvedBy && /* @__PURE__ */ jsxs43(Text, { testID: "closure-approved-by", children: [
|
|
3844
3855
|
"Approved by ",
|
|
3845
3856
|
approvedBy
|
|
3846
3857
|
] }),
|
|
3847
|
-
closure.breakdowns.tax_rounding_mixed === true && /* @__PURE__ */
|
|
3848
|
-
!!error && /* @__PURE__ */
|
|
3849
|
-
!blind && !!onPrint && /* @__PURE__ */
|
|
3850
|
-
/* @__PURE__ */
|
|
3858
|
+
closure.breakdowns.tax_rounding_mixed === true && /* @__PURE__ */ jsx84(Text, { testID: "closure-tax-rounding-mixed", className: "text-muted-foreground", children: TAX_ROUNDING_MIXED_NOTE }),
|
|
3859
|
+
!!error && /* @__PURE__ */ jsx84(Text, { testID: "closure-print-error", className: "text-destructive", children: error }),
|
|
3860
|
+
!blind && !!onPrint && /* @__PURE__ */ jsx84(Button, { testID: "closure-print", className: "min-h-14", disabled: busy, onPress: print, children: /* @__PURE__ */ jsx84(Text, { children: busy ? "Printing\u2026" : "Print the Z report" }) }),
|
|
3861
|
+
/* @__PURE__ */ jsx84(Button, { testID: "closure-done", variant: "outline", className: "min-h-14", onPress: onDone, children: /* @__PURE__ */ jsx84(Text, { children: "Done" }) })
|
|
3851
3862
|
] })
|
|
3852
3863
|
}
|
|
3853
3864
|
);
|
|
@@ -3856,35 +3867,35 @@ function ClosureSheet({ register, currency, onPrint, onDone }) {
|
|
|
3856
3867
|
// src/settings/settings-row.tsx
|
|
3857
3868
|
import { Text as Text29, View as View51 } from "react-native";
|
|
3858
3869
|
import { cn as cn77 } from "@tallyui/theme";
|
|
3859
|
-
import { jsx as
|
|
3870
|
+
import { jsx as jsx85, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3860
3871
|
function SettingsRow({ label, description, action, className, ...viewProps }) {
|
|
3861
|
-
return /* @__PURE__ */
|
|
3862
|
-
/* @__PURE__ */
|
|
3863
|
-
/* @__PURE__ */
|
|
3864
|
-
description && /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ jsxs44(View51, { className: cn77("flex-row items-center gap-3 px-4 py-3", className), ...viewProps, children: [
|
|
3873
|
+
/* @__PURE__ */ jsxs44(View51, { className: "flex-1 gap-0.5", children: [
|
|
3874
|
+
/* @__PURE__ */ jsx85(Text29, { className: "text-sm font-medium text-foreground", children: label }),
|
|
3875
|
+
description && /* @__PURE__ */ jsx85(Text29, { className: "text-xs text-muted-foreground", children: description })
|
|
3865
3876
|
] }),
|
|
3866
|
-
action && /* @__PURE__ */
|
|
3877
|
+
action && /* @__PURE__ */ jsx85(View51, { children: action })
|
|
3867
3878
|
] });
|
|
3868
3879
|
}
|
|
3869
3880
|
|
|
3870
3881
|
// src/settings/settings-group.tsx
|
|
3871
3882
|
import { Text as Text30, View as View52 } from "react-native";
|
|
3872
3883
|
import { cn as cn78 } from "@tallyui/theme";
|
|
3873
|
-
import { jsx as
|
|
3884
|
+
import { jsx as jsx86, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3874
3885
|
function SettingsGroup({ title, description, children, className, ...viewProps }) {
|
|
3875
|
-
return /* @__PURE__ */
|
|
3876
|
-
/* @__PURE__ */
|
|
3877
|
-
/* @__PURE__ */
|
|
3878
|
-
description && /* @__PURE__ */
|
|
3886
|
+
return /* @__PURE__ */ jsxs45(View52, { className: cn78("gap-1", className), ...viewProps, children: [
|
|
3887
|
+
/* @__PURE__ */ jsxs45(View52, { className: "px-4 py-2", children: [
|
|
3888
|
+
/* @__PURE__ */ jsx86(Text30, { className: "text-sm font-semibold text-foreground", children: title }),
|
|
3889
|
+
description && /* @__PURE__ */ jsx86(Text30, { className: "text-xs text-muted-foreground", children: description })
|
|
3879
3890
|
] }),
|
|
3880
|
-
/* @__PURE__ */
|
|
3891
|
+
/* @__PURE__ */ jsx86(View52, { className: "rounded-lg border border-border bg-card", children })
|
|
3881
3892
|
] });
|
|
3882
3893
|
}
|
|
3883
3894
|
|
|
3884
3895
|
// src/settings/connector-status.tsx
|
|
3885
3896
|
import { Text as Text31, View as View53 } from "react-native";
|
|
3886
3897
|
import { cn as cn79 } from "@tallyui/theme";
|
|
3887
|
-
import { jsx as
|
|
3898
|
+
import { jsx as jsx87, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3888
3899
|
function defaultFormatUnsold(count2, stale) {
|
|
3889
3900
|
return `${count2} ${count2 === 1 ? "product" : "products"} not sold in this channel${stale ? " (last check failed)" : ""}`;
|
|
3890
3901
|
}
|
|
@@ -3906,20 +3917,20 @@ function ConnectorStatus({
|
|
|
3906
3917
|
...viewProps
|
|
3907
3918
|
}) {
|
|
3908
3919
|
const config = STATUS_CONFIG2[status];
|
|
3909
|
-
return /* @__PURE__ */
|
|
3910
|
-
/* @__PURE__ */
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
/* @__PURE__ */
|
|
3913
|
-
/* @__PURE__ */
|
|
3914
|
-
/* @__PURE__ */
|
|
3920
|
+
return /* @__PURE__ */ jsxs46(View53, { className: cn79("gap-2 rounded-lg border border-border bg-card p-3", className), ...viewProps, children: [
|
|
3921
|
+
/* @__PURE__ */ jsxs46(View53, { className: "flex-row items-center justify-between", children: [
|
|
3922
|
+
/* @__PURE__ */ jsx87(Text31, { className: "text-sm font-semibold text-foreground", children: name }),
|
|
3923
|
+
/* @__PURE__ */ jsxs46(View53, { className: "flex-row items-center gap-1.5", children: [
|
|
3924
|
+
/* @__PURE__ */ jsx87(View53, { className: cn79("h-2 w-2 rounded-full", config.dot) }),
|
|
3925
|
+
/* @__PURE__ */ jsx87(Text31, { className: cn79("text-xs font-medium", config.text), children: config.label })
|
|
3915
3926
|
] })
|
|
3916
3927
|
] }),
|
|
3917
|
-
lastSync && /* @__PURE__ */
|
|
3928
|
+
lastSync && /* @__PURE__ */ jsxs46(Text31, { className: "text-xs text-muted-foreground", children: [
|
|
3918
3929
|
"Last sync: ",
|
|
3919
3930
|
lastSync
|
|
3920
3931
|
] }),
|
|
3921
|
-
error && /* @__PURE__ */
|
|
3922
|
-
!!unsoldCount && /* @__PURE__ */
|
|
3932
|
+
error && /* @__PURE__ */ jsx87(Text31, { className: "text-xs text-destructive", children: error }),
|
|
3933
|
+
!!unsoldCount && /* @__PURE__ */ jsx87(Text31, { className: cn79("text-xs", unsoldStale ? "text-muted-foreground" : "text-warning"), children: formatUnsold(unsoldCount, !!unsoldStale) })
|
|
3923
3934
|
] });
|
|
3924
3935
|
}
|
|
3925
3936
|
|
|
@@ -3932,7 +3943,7 @@ import { buildReceiptData } from "@tallyui/pos";
|
|
|
3932
3943
|
import { useState as useState15 } from "react";
|
|
3933
3944
|
import { Pressable as Pressable23, Text as Text32, TextInput as TextInput9, View as View54 } from "react-native";
|
|
3934
3945
|
import { formatMoney as formatMoney10, minorUnitDigits as minorUnitDigits7, moneyFromDecimalString as moneyFromDecimalString2 } from "@tallyui/core";
|
|
3935
|
-
import { jsx as
|
|
3946
|
+
import { jsx as jsx88, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
3936
3947
|
function parseDiscount(type, text, currency) {
|
|
3937
3948
|
const raw = text.trim();
|
|
3938
3949
|
const trimmed = raw.split(",").length === 2 ? raw.replace(",", ".") : raw;
|
|
@@ -3958,21 +3969,21 @@ function DiscountForm({ title, currency, onApply, onClose }) {
|
|
|
3958
3969
|
setError(refused);
|
|
3959
3970
|
if (refused === null) onClose();
|
|
3960
3971
|
}
|
|
3961
|
-
return /* @__PURE__ */
|
|
3962
|
-
/* @__PURE__ */
|
|
3963
|
-
/* @__PURE__ */
|
|
3964
|
-
["percentage", "fixed"].map((option) => /* @__PURE__ */
|
|
3972
|
+
return /* @__PURE__ */ jsxs47(View54, { role: "group", accessibilityLabel: title, className: "gap-2 px-3 py-2", children: [
|
|
3973
|
+
/* @__PURE__ */ jsx88(Text32, { className: "font-semibold text-foreground", children: title }),
|
|
3974
|
+
/* @__PURE__ */ jsxs47(View54, { className: "flex-row gap-2", children: [
|
|
3975
|
+
["percentage", "fixed"].map((option) => /* @__PURE__ */ jsx88(
|
|
3965
3976
|
Pressable23,
|
|
3966
3977
|
{
|
|
3967
3978
|
accessibilityRole: "button",
|
|
3968
3979
|
accessibilityState: { selected: type === option },
|
|
3969
3980
|
onPress: () => setType(option),
|
|
3970
3981
|
className: `${button} ${type === option ? "bg-primary" : "bg-card"}`,
|
|
3971
|
-
children: /* @__PURE__ */
|
|
3982
|
+
children: /* @__PURE__ */ jsx88(Text32, { className: type === option ? "text-primary-foreground" : "text-foreground", children: option === "percentage" ? "Percent" : "Amount" })
|
|
3972
3983
|
},
|
|
3973
3984
|
option
|
|
3974
3985
|
)),
|
|
3975
|
-
/* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ jsx88(
|
|
3976
3987
|
TextInput9,
|
|
3977
3988
|
{
|
|
3978
3989
|
accessibilityLabel: "Discount value",
|
|
@@ -3985,16 +3996,16 @@ function DiscountForm({ title, currency, onApply, onClose }) {
|
|
|
3985
3996
|
}
|
|
3986
3997
|
)
|
|
3987
3998
|
] }),
|
|
3988
|
-
error ? /* @__PURE__ */
|
|
3989
|
-
/* @__PURE__ */
|
|
3990
|
-
/* @__PURE__ */
|
|
3991
|
-
/* @__PURE__ */
|
|
3999
|
+
error ? /* @__PURE__ */ jsx88(Text32, { accessibilityRole: "alert", className: "text-destructive", children: error }) : null,
|
|
4000
|
+
/* @__PURE__ */ jsxs47(View54, { className: "flex-row gap-2", children: [
|
|
4001
|
+
/* @__PURE__ */ jsx88(Pressable23, { accessibilityRole: "button", onPress: apply, className: `${button} bg-primary`, children: /* @__PURE__ */ jsx88(Text32, { className: "font-semibold text-primary-foreground", children: "Apply" }) }),
|
|
4002
|
+
/* @__PURE__ */ jsx88(Pressable23, { accessibilityRole: "button", onPress: onClose, className: `${button} bg-card`, children: /* @__PURE__ */ jsx88(Text32, { className: "text-foreground", children: "Cancel" }) })
|
|
3992
4003
|
] })
|
|
3993
4004
|
] });
|
|
3994
4005
|
}
|
|
3995
4006
|
function DiscountChips({ discounts, currency, onRemove, prefix, amounts = [] }) {
|
|
3996
4007
|
if (!discounts.length) return null;
|
|
3997
|
-
return /* @__PURE__ */
|
|
4008
|
+
return /* @__PURE__ */ jsx88(View54, { className: "flex-row flex-wrap gap-2 px-3", children: discounts.map((discount) => {
|
|
3998
4009
|
const amount = amounts.find((row) => row.discountId === discount.id)?.amountMinor;
|
|
3999
4010
|
const own = discountLabel(discount, currency);
|
|
4000
4011
|
const label = [
|
|
@@ -4002,7 +4013,7 @@ function DiscountChips({ discounts, currency, onRemove, prefix, amounts = [] })
|
|
|
4002
4013
|
amount === void 0 ? prefix ? `\u2212${own}` : own : discount.type === "percentage" ? own : null,
|
|
4003
4014
|
amount === void 0 ? null : `\u2212${formatMoney10({ amount, currency })}`
|
|
4004
4015
|
].filter(Boolean).join(" ");
|
|
4005
|
-
return /* @__PURE__ */
|
|
4016
|
+
return /* @__PURE__ */ jsxs47(
|
|
4006
4017
|
Pressable23,
|
|
4007
4018
|
{
|
|
4008
4019
|
accessibilityRole: "button",
|
|
@@ -4010,8 +4021,8 @@ function DiscountChips({ discounts, currency, onRemove, prefix, amounts = [] })
|
|
|
4010
4021
|
onPress: () => onRemove(discount.id),
|
|
4011
4022
|
className: "min-h-11 flex-row items-center gap-1",
|
|
4012
4023
|
children: [
|
|
4013
|
-
/* @__PURE__ */
|
|
4014
|
-
/* @__PURE__ */
|
|
4024
|
+
/* @__PURE__ */ jsx88(DiscountBadge, { label, className: "self-center" }),
|
|
4025
|
+
/* @__PURE__ */ jsx88(Text32, { className: "text-muted-foreground", children: "\u2715" })
|
|
4015
4026
|
]
|
|
4016
4027
|
},
|
|
4017
4028
|
discount.id
|
|
@@ -4020,7 +4031,7 @@ function DiscountChips({ discounts, currency, onRemove, prefix, amounts = [] })
|
|
|
4020
4031
|
}
|
|
4021
4032
|
|
|
4022
4033
|
// src/sale/cart.tsx
|
|
4023
|
-
import { Fragment as
|
|
4034
|
+
import { Fragment as Fragment5, jsx as jsx89, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
4024
4035
|
function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
4025
4036
|
const { order } = sale;
|
|
4026
4037
|
const money = (amount) => ({ amount, currency: order.currency });
|
|
@@ -4029,7 +4040,7 @@ function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
|
4029
4040
|
const display = (lineId) => order.display.lines.find((line) => line.lineId === lineId);
|
|
4030
4041
|
const orderAmounts = order.discounts.length === 1 ? [{ discountId: order.discounts[0].id, amountMinor: order.display.orderDiscountMinor }] : [];
|
|
4031
4042
|
const [form, setForm] = useState16(null);
|
|
4032
|
-
const discountForm = (lineId, title) => form?.lineId === lineId ? /* @__PURE__ */
|
|
4043
|
+
const discountForm = (lineId, title) => form?.lineId === lineId ? /* @__PURE__ */ jsx89(
|
|
4033
4044
|
DiscountForm,
|
|
4034
4045
|
{
|
|
4035
4046
|
title,
|
|
@@ -4040,8 +4051,8 @@ function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
|
4040
4051
|
lineId ?? "order"
|
|
4041
4052
|
) : null;
|
|
4042
4053
|
const pay = `min-h-12 flex-1 justify-center rounded-md bg-primary px-4 py-3 ${!order.lineItems.length ? "opacity-50" : ""}`;
|
|
4043
|
-
const renderItem = (line) => /* @__PURE__ */
|
|
4044
|
-
/* @__PURE__ */
|
|
4054
|
+
const renderItem = (line) => /* @__PURE__ */ jsxs48(Fragment5, { children: [
|
|
4055
|
+
/* @__PURE__ */ jsx89(CartLineActions, { actions: [{ id: "discount", label: "Discount", color: "text-primary", onPress: () => setForm({ lineId: line.id }) }], children: /* @__PURE__ */ jsx89(
|
|
4045
4056
|
CartLine,
|
|
4046
4057
|
{
|
|
4047
4058
|
name: line.name,
|
|
@@ -4050,50 +4061,50 @@ function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
|
4050
4061
|
lineTotal: money(display(line.id).amountMinor)
|
|
4051
4062
|
}
|
|
4052
4063
|
) }),
|
|
4053
|
-
/* @__PURE__ */
|
|
4054
|
-
/* @__PURE__ */
|
|
4055
|
-
/* @__PURE__ */
|
|
4064
|
+
/* @__PURE__ */ jsx89(DiscountChips, { discounts: line.discounts, amounts: display(line.id).discounts, currency: order.currency, onRemove: sale.removeDiscount }),
|
|
4065
|
+
/* @__PURE__ */ jsxs48(View55, { className: "flex-row gap-4 px-3 py-2", children: [
|
|
4066
|
+
/* @__PURE__ */ jsx89(
|
|
4056
4067
|
Pressable24,
|
|
4057
4068
|
{
|
|
4058
4069
|
accessibilityRole: "button",
|
|
4059
4070
|
accessibilityLabel: `Decrease ${line.name}`,
|
|
4060
4071
|
onPress: () => sale.setQuantity(line.id, line.quantity - 1),
|
|
4061
4072
|
className: "rounded-md border border-border bg-card px-3 py-2 min-h-11 min-w-11 items-center justify-center",
|
|
4062
|
-
children: /* @__PURE__ */
|
|
4073
|
+
children: /* @__PURE__ */ jsx89(Text33, { className: "text-center text-foreground", children: "\u2212" })
|
|
4063
4074
|
}
|
|
4064
4075
|
),
|
|
4065
|
-
/* @__PURE__ */
|
|
4076
|
+
/* @__PURE__ */ jsx89(
|
|
4066
4077
|
Pressable24,
|
|
4067
4078
|
{
|
|
4068
4079
|
accessibilityRole: "button",
|
|
4069
4080
|
accessibilityLabel: `Increase ${line.name}`,
|
|
4070
4081
|
onPress: () => sale.setQuantity(line.id, line.quantity + 1),
|
|
4071
4082
|
className: "rounded-md border border-border bg-card px-3 py-2 min-h-11 min-w-11 items-center justify-center",
|
|
4072
|
-
children: /* @__PURE__ */
|
|
4083
|
+
children: /* @__PURE__ */ jsx89(Text33, { className: "text-center text-foreground", children: "+" })
|
|
4073
4084
|
}
|
|
4074
4085
|
),
|
|
4075
|
-
/* @__PURE__ */
|
|
4086
|
+
/* @__PURE__ */ jsx89(
|
|
4076
4087
|
Pressable24,
|
|
4077
4088
|
{
|
|
4078
4089
|
accessibilityRole: "button",
|
|
4079
4090
|
accessibilityLabel: `Remove ${line.name}`,
|
|
4080
4091
|
onPress: () => sale.remove(line.id),
|
|
4081
4092
|
className: "rounded-md border border-border bg-card px-3 py-2 min-h-11 min-w-11 items-center justify-center",
|
|
4082
|
-
children: /* @__PURE__ */
|
|
4093
|
+
children: /* @__PURE__ */ jsx89(Text33, { className: "text-center text-foreground", children: "Remove" })
|
|
4083
4094
|
}
|
|
4084
4095
|
)
|
|
4085
4096
|
] }),
|
|
4086
4097
|
discountForm(line.id, `Discount on ${line.name}`)
|
|
4087
4098
|
] });
|
|
4088
|
-
return /* @__PURE__ */
|
|
4099
|
+
return /* @__PURE__ */ jsx89(
|
|
4089
4100
|
CartPanel,
|
|
4090
4101
|
{
|
|
4091
4102
|
dataSet: { print: "hide" },
|
|
4092
4103
|
items: order.lineItems,
|
|
4093
4104
|
renderItem,
|
|
4094
|
-
emptyState: /* @__PURE__ */
|
|
4095
|
-
afterItems: order.lineItems.length ? /* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4105
|
+
emptyState: /* @__PURE__ */ jsx89(Text33, { className: "text-muted-foreground", children: "Scan or tap a product to start a sale." }),
|
|
4106
|
+
afterItems: order.lineItems.length ? /* @__PURE__ */ jsxs48(View55, { className: "gap-3 px-3 py-2", children: [
|
|
4107
|
+
/* @__PURE__ */ jsx89(
|
|
4097
4108
|
DiscountChips,
|
|
4098
4109
|
{
|
|
4099
4110
|
discounts: order.discounts,
|
|
@@ -4103,18 +4114,18 @@ function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
|
4103
4114
|
prefix: "Order discount"
|
|
4104
4115
|
}
|
|
4105
4116
|
),
|
|
4106
|
-
form?.lineId === null ? discountForm(null, "Order discount") : /* @__PURE__ */
|
|
4117
|
+
form?.lineId === null ? discountForm(null, "Order discount") : /* @__PURE__ */ jsx89(
|
|
4107
4118
|
Pressable24,
|
|
4108
4119
|
{
|
|
4109
4120
|
accessibilityRole: "button",
|
|
4110
4121
|
onPress: () => setForm({ lineId: null }),
|
|
4111
4122
|
className: "self-start rounded-md border border-border bg-card px-4 py-2 min-h-11 justify-center",
|
|
4112
|
-
children: /* @__PURE__ */
|
|
4123
|
+
children: /* @__PURE__ */ jsx89(Text33, { className: "text-foreground", children: "Order discount" })
|
|
4113
4124
|
}
|
|
4114
4125
|
)
|
|
4115
4126
|
] }) : void 0,
|
|
4116
|
-
footer: /* @__PURE__ */
|
|
4117
|
-
/* @__PURE__ */
|
|
4127
|
+
footer: /* @__PURE__ */ jsxs48(View55, { testID: "cart-footer", className: "gap-3 pb-4", children: [
|
|
4128
|
+
/* @__PURE__ */ jsx89(
|
|
4118
4129
|
CartTotal,
|
|
4119
4130
|
{
|
|
4120
4131
|
subtotal: money(totals.subtotalMinor),
|
|
@@ -4124,10 +4135,10 @@ function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
|
4124
4135
|
taxInclusive: totals.taxInclusive
|
|
4125
4136
|
}
|
|
4126
4137
|
),
|
|
4127
|
-
sale.error ? /* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */
|
|
4129
|
-
/* @__PURE__ */
|
|
4130
|
-
/* @__PURE__ */
|
|
4138
|
+
sale.error ? /* @__PURE__ */ jsx89(Text33, { accessibilityRole: "alert", className: "text-destructive", children: sale.error }) : null,
|
|
4139
|
+
/* @__PURE__ */ jsxs48(View55, { className: "flex-row gap-3", children: [
|
|
4140
|
+
/* @__PURE__ */ jsx89(Pressable24, { accessibilityRole: "button", disabled: !order.lineItems.length, onPress: () => sale.startTender("cash"), className: pay, children: /* @__PURE__ */ jsx89(Text33, { className: "text-center font-semibold text-primary-foreground", children: "Cash" }) }),
|
|
4141
|
+
/* @__PURE__ */ jsx89(Pressable24, { accessibilityRole: "button", disabled: !order.lineItems.length, onPress: () => sale.startTender("external"), className: pay, children: /* @__PURE__ */ jsx89(Text33, { className: "text-center font-semibold text-primary-foreground", children: "Card terminal" }) })
|
|
4131
4142
|
] })
|
|
4132
4143
|
] })
|
|
4133
4144
|
}
|
|
@@ -4138,13 +4149,13 @@ function Cart({ sale, taxLabel = (ratePpm) => `Tax ${ratePpm / 1e4}%` }) {
|
|
|
4138
4149
|
import { Pressable as Pressable25, Text as Text34 } from "react-native";
|
|
4139
4150
|
import { formatMoney as formatMoney11 } from "@tallyui/core";
|
|
4140
4151
|
import { buildReceiptData as buildReceiptData2 } from "@tallyui/pos";
|
|
4141
|
-
import { jsx as
|
|
4152
|
+
import { jsx as jsx90, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4142
4153
|
function CartBar({ sale, onOpen }) {
|
|
4143
4154
|
const { order } = sale;
|
|
4144
4155
|
const count2 = order.lineItems.reduce((sum, line) => sum + line.quantity, 0);
|
|
4145
4156
|
const total = formatMoney11({ amount: buildReceiptData2(order, { storeName: "" }).totals.totalMinor, currency: order.currency });
|
|
4146
4157
|
const items = `${count2} ${count2 === 1 ? "item" : "items"}`;
|
|
4147
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ jsxs49(
|
|
4148
4159
|
Pressable25,
|
|
4149
4160
|
{
|
|
4150
4161
|
accessibilityRole: "button",
|
|
@@ -4153,8 +4164,8 @@ function CartBar({ sale, onOpen }) {
|
|
|
4153
4164
|
onPress: onOpen,
|
|
4154
4165
|
className: `min-h-14 mx-3 mb-3 flex-row items-center justify-between rounded-md bg-primary px-4 py-3 ${count2 ? "" : "opacity-50"}`,
|
|
4155
4166
|
children: [
|
|
4156
|
-
/* @__PURE__ */
|
|
4157
|
-
count2 ? /* @__PURE__ */
|
|
4167
|
+
/* @__PURE__ */ jsx90(Text34, { className: "font-bold text-primary-foreground", children: count2 ? `Cart \xB7 ${items}` : "Cart is empty" }),
|
|
4168
|
+
count2 ? /* @__PURE__ */ jsxs49(Text34, { className: "font-bold text-primary-foreground", children: [
|
|
4158
4169
|
total,
|
|
4159
4170
|
" \u203A"
|
|
4160
4171
|
] }) : null
|
|
@@ -4166,15 +4177,15 @@ function CartBar({ sale, onOpen }) {
|
|
|
4166
4177
|
// src/sale/tender.tsx
|
|
4167
4178
|
import { Pressable as Pressable26, Text as Text35, TextInput as TextInput10, View as View56 } from "react-native";
|
|
4168
4179
|
import { formatMoney as formatMoney12 } from "@tallyui/core";
|
|
4169
|
-
import { Fragment as
|
|
4180
|
+
import { Fragment as Fragment6, jsx as jsx91, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4170
4181
|
var REFERENCE_MAX = 255;
|
|
4171
4182
|
function Tender({ sale }) {
|
|
4172
4183
|
const { order, stage } = sale;
|
|
4173
4184
|
if (stage.kind !== "tender") return null;
|
|
4174
4185
|
const money = (amount) => ({ amount, currency: order.currency });
|
|
4175
|
-
return /* @__PURE__ */
|
|
4176
|
-
stage.method === "cash" ? /* @__PURE__ */
|
|
4177
|
-
/* @__PURE__ */
|
|
4186
|
+
return /* @__PURE__ */ jsxs50(View56, { dataSet: { print: "hide" }, className: "gap-4 p-4", children: [
|
|
4187
|
+
stage.method === "cash" ? /* @__PURE__ */ jsxs50(Fragment6, { children: [
|
|
4188
|
+
/* @__PURE__ */ jsx91(
|
|
4178
4189
|
CashTendered,
|
|
4179
4190
|
{
|
|
4180
4191
|
total: money(order.totalMinor),
|
|
@@ -4182,18 +4193,18 @@ function Tender({ sale }) {
|
|
|
4182
4193
|
onChangeAmount: (amount) => sale.setTender({ method: "cash", amountMinor: amount.amount })
|
|
4183
4194
|
}
|
|
4184
4195
|
),
|
|
4185
|
-
/* @__PURE__ */
|
|
4186
|
-
order.balanceDueMinor > 0 ? /* @__PURE__ */
|
|
4196
|
+
/* @__PURE__ */ jsx91(ChangeDisplay, { change: money(order.changeDueMinor) }),
|
|
4197
|
+
order.balanceDueMinor > 0 ? /* @__PURE__ */ jsxs50(Text35, { className: "text-foreground", children: [
|
|
4187
4198
|
"Balance due: ",
|
|
4188
4199
|
formatMoney12(money(order.balanceDueMinor))
|
|
4189
4200
|
] }) : null,
|
|
4190
|
-
/* @__PURE__ */
|
|
4191
|
-
] }) : /* @__PURE__ */
|
|
4192
|
-
/* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ jsx91(Pressable26, { accessibilityRole: "button", disabled: order.balanceDueMinor > 0, onPress: sale.complete, className: `rounded-md bg-primary px-4 py-3 ${order.balanceDueMinor > 0 ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsx91(Text35, { className: "text-center font-semibold text-primary-foreground", children: "Complete sale" }) })
|
|
4202
|
+
] }) : /* @__PURE__ */ jsxs50(Fragment6, { children: [
|
|
4203
|
+
/* @__PURE__ */ jsxs50(Text35, { className: "text-foreground", children: [
|
|
4193
4204
|
"Card terminal: ",
|
|
4194
4205
|
formatMoney12(money(order.totalMinor))
|
|
4195
4206
|
] }),
|
|
4196
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsx91(
|
|
4197
4208
|
TextInput10,
|
|
4198
4209
|
{
|
|
4199
4210
|
accessibilityLabel: "Terminal reference",
|
|
@@ -4204,14 +4215,14 @@ function Tender({ sale }) {
|
|
|
4204
4215
|
className: "rounded-md border border-border px-3 py-2 text-foreground"
|
|
4205
4216
|
}
|
|
4206
4217
|
),
|
|
4207
|
-
/* @__PURE__ */
|
|
4218
|
+
/* @__PURE__ */ jsx91(Pressable26, { accessibilityRole: "button", onPress: sale.complete, className: "rounded-md bg-primary px-4 py-3", children: /* @__PURE__ */ jsx91(Text35, { className: "text-center font-semibold text-primary-foreground", children: "Payment approved on terminal" }) })
|
|
4208
4219
|
] }),
|
|
4209
|
-
sale.error ? /* @__PURE__ */
|
|
4210
|
-
sale.canContinue ? /* @__PURE__ */
|
|
4211
|
-
/* @__PURE__ */
|
|
4212
|
-
/* @__PURE__ */
|
|
4220
|
+
sale.error ? /* @__PURE__ */ jsx91(Text35, { accessibilityRole: "alert", className: "text-destructive", children: sale.error }) : null,
|
|
4221
|
+
sale.canContinue ? /* @__PURE__ */ jsxs50(Fragment6, { children: [
|
|
4222
|
+
/* @__PURE__ */ jsx91(Text35, { className: "text-foreground", children: "This sale is stored and will be sent. Continue to the next sale." }),
|
|
4223
|
+
/* @__PURE__ */ jsx91(Pressable26, { accessibilityRole: "button", onPress: () => sale.continueSale(), className: "rounded-md bg-primary px-4 py-3", children: /* @__PURE__ */ jsx91(Text35, { className: "text-center font-semibold text-primary-foreground", children: "Continue" }) })
|
|
4213
4224
|
] }) : null,
|
|
4214
|
-
/* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ jsx91(Pressable26, { accessibilityRole: "button", onPress: sale.cancelTender, className: "rounded-md border border-border bg-card px-4 py-3", children: /* @__PURE__ */ jsx91(Text35, { className: "text-center text-foreground", children: "Back" }) })
|
|
4215
4226
|
] });
|
|
4216
4227
|
}
|
|
4217
4228
|
|
|
@@ -4220,7 +4231,7 @@ import { useEffect as useEffect5, useMemo as useMemo2, useState as useState17 }
|
|
|
4220
4231
|
import { Pressable as Pressable27, Text as Text36, View as View57 } from "react-native";
|
|
4221
4232
|
import { useStockOverlaid, useStockOverlayAsOf } from "@tallyui/core";
|
|
4222
4233
|
import { catalogueEntries, findEntryByCode, searchProducts, variantPriceLabel } from "@tallyui/pos";
|
|
4223
|
-
import { jsx as
|
|
4234
|
+
import { jsx as jsx92, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4224
4235
|
var MIN_TILE_WIDTH = 160;
|
|
4225
4236
|
var STOCK_LABEL = {
|
|
4226
4237
|
in_stock: "In Stock",
|
|
@@ -4259,9 +4270,9 @@ function Catalogue({ products, traits, currency, onSelect, statusText, statusAcc
|
|
|
4259
4270
|
onSelect(entry);
|
|
4260
4271
|
setChooserId(null);
|
|
4261
4272
|
}
|
|
4262
|
-
return /* @__PURE__ */
|
|
4263
|
-
/* @__PURE__ */
|
|
4264
|
-
/* @__PURE__ */
|
|
4273
|
+
return /* @__PURE__ */ jsxs51(View57, { className: "flex-1", onLayout: (event) => setWidth(event.nativeEvent.layout.width), children: [
|
|
4274
|
+
/* @__PURE__ */ jsxs51(View57, { className: "gap-2 border-b border-border bg-card px-4 pb-3 pt-3", children: [
|
|
4275
|
+
/* @__PURE__ */ jsx92(
|
|
4265
4276
|
SearchInput,
|
|
4266
4277
|
{
|
|
4267
4278
|
value: query,
|
|
@@ -4278,25 +4289,25 @@ function Catalogue({ products, traits, currency, onSelect, statusText, statusAcc
|
|
|
4278
4289
|
}
|
|
4279
4290
|
}
|
|
4280
4291
|
),
|
|
4281
|
-
statusText || statusAccessory ? /* @__PURE__ */
|
|
4282
|
-
statusText ? /* @__PURE__ */
|
|
4292
|
+
statusText || statusAccessory ? /* @__PURE__ */ jsxs51(View57, { testID: "catalogue-status-row", className: "flex-row items-center gap-2", children: [
|
|
4293
|
+
statusText ? /* @__PURE__ */ jsxs51(Text36, { className: "flex-1 text-xs text-muted-foreground", numberOfLines: statusAccessory ? 1 : void 0, children: [
|
|
4283
4294
|
statusText,
|
|
4284
4295
|
query.trim() ? ` \xB7 ${results.length.toLocaleString()} matching` : ""
|
|
4285
4296
|
] }) : null,
|
|
4286
4297
|
statusAccessory
|
|
4287
4298
|
] }) : null,
|
|
4288
|
-
choices.length > 0 ? /* @__PURE__ */
|
|
4289
|
-
choices.map((entry) => /* @__PURE__ */
|
|
4299
|
+
choices.length > 0 ? /* @__PURE__ */ jsxs51(View57, { accessibilityLabel: "Choose variant", className: "gap-2", children: [
|
|
4300
|
+
choices.map((entry) => /* @__PURE__ */ jsxs51(
|
|
4290
4301
|
Pressable27,
|
|
4291
4302
|
{
|
|
4292
4303
|
accessibilityRole: "button",
|
|
4293
4304
|
onPress: () => select(entry),
|
|
4294
4305
|
className: "gap-1 rounded-md border border-border p-3",
|
|
4295
4306
|
children: [
|
|
4296
|
-
/* @__PURE__ */
|
|
4297
|
-
/* @__PURE__ */
|
|
4298
|
-
/* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4307
|
+
/* @__PURE__ */ jsx92(Text36, { className: "font-semibold text-foreground", children: entry.variant.title }),
|
|
4308
|
+
/* @__PURE__ */ jsx92(Text36, { className: "text-muted-foreground", children: entry.variant.sku }),
|
|
4309
|
+
/* @__PURE__ */ jsx92(Text36, { className: "text-foreground", children: variantPriceLabel(entry.variant, currency) }),
|
|
4310
|
+
/* @__PURE__ */ jsxs51(Text36, { className: "text-muted-foreground", children: [
|
|
4300
4311
|
STOCK_LABEL[entry.variant.stock.status],
|
|
4301
4312
|
" \xB7 ",
|
|
4302
4313
|
stockAsOf ? `as of ${formatStockSyncTime(stockAsOf, void 0, hour12)}` : "not yet synced"
|
|
@@ -4305,10 +4316,10 @@ function Catalogue({ products, traits, currency, onSelect, statusText, statusAcc
|
|
|
4305
4316
|
},
|
|
4306
4317
|
entry.variant.id
|
|
4307
4318
|
)),
|
|
4308
|
-
/* @__PURE__ */
|
|
4319
|
+
/* @__PURE__ */ jsx92(Pressable27, { accessibilityRole: "button", onPress: () => setChooserId(null), className: "rounded-md border border-border bg-card px-4 py-3", children: /* @__PURE__ */ jsx92(Text36, { className: "text-center text-foreground", children: "Cancel" }) })
|
|
4309
4320
|
] }) : null
|
|
4310
4321
|
] }),
|
|
4311
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ jsx92(
|
|
4312
4323
|
ProductGrid,
|
|
4313
4324
|
{
|
|
4314
4325
|
items: results,
|
|
@@ -4317,18 +4328,18 @@ function Catalogue({ products, traits, currency, onSelect, statusText, statusAcc
|
|
|
4317
4328
|
// TallyUI's ProductCard has no children slot, so the tile is composed directly here
|
|
4318
4329
|
// (same structure/classes as ProductCard) to add the stock badge as a fourth child,
|
|
4319
4330
|
// inside the card and centred with the rest, rather than adding a slot to ProductCard (out of scope for TV6b).
|
|
4320
|
-
/* @__PURE__ */
|
|
4331
|
+
/* @__PURE__ */ jsx92(Pressable27, { accessibilityRole: "button", testID: `product-tile-${traits.getName(product)}`, onPress: () => {
|
|
4321
4332
|
const variants = entries.filter((entry) => entry.product === product);
|
|
4322
4333
|
if (variants.length === 1) select(variants[0]);
|
|
4323
4334
|
else setChooserId(traits.getId(product));
|
|
4324
|
-
}, children: /* @__PURE__ */
|
|
4325
|
-
/* @__PURE__ */
|
|
4326
|
-
/* @__PURE__ */
|
|
4327
|
-
/* @__PURE__ */
|
|
4328
|
-
/* @__PURE__ */
|
|
4335
|
+
}, children: /* @__PURE__ */ jsxs51(VStack, { space: "sm", className: "items-center rounded-lg border border-border bg-card p-3", children: [
|
|
4336
|
+
/* @__PURE__ */ jsx92(ProductImage, { doc: product, size: 80, className: "rounded-md" }),
|
|
4337
|
+
/* @__PURE__ */ jsx92(ProductTitle, { doc: product, className: "text-sm", numberOfLines: 2 }),
|
|
4338
|
+
/* @__PURE__ */ jsx92(ProductPrice, { doc: product }),
|
|
4339
|
+
/* @__PURE__ */ jsx92(ProductStockBadge, { doc: product, showAsOf: false, className: "self-center" })
|
|
4329
4340
|
] }) })
|
|
4330
4341
|
),
|
|
4331
|
-
emptyState: /* @__PURE__ */
|
|
4342
|
+
emptyState: /* @__PURE__ */ jsx92(Text36, { className: "mt-10 text-center text-sm text-muted-foreground", children: query.trim() ? `No products match "${query.trim()}".` : "No products yet." })
|
|
4332
4343
|
}
|
|
4333
4344
|
)
|
|
4334
4345
|
] });
|
|
@@ -4351,7 +4362,7 @@ function injectPrintStyle() {
|
|
|
4351
4362
|
}
|
|
4352
4363
|
|
|
4353
4364
|
// src/sale/receipt.tsx
|
|
4354
|
-
import { Fragment as
|
|
4365
|
+
import { Fragment as Fragment7, jsx as jsx93, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
4355
4366
|
var defaultFormatDate = (iso) => new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(new Date(iso));
|
|
4356
4367
|
function Receipt({
|
|
4357
4368
|
order,
|
|
@@ -4371,34 +4382,34 @@ function Receipt({
|
|
|
4371
4382
|
register: registerId
|
|
4372
4383
|
});
|
|
4373
4384
|
const money = (amount) => formatMoney13({ amount, currency: receipt.currency }) ?? "";
|
|
4374
|
-
const row = (label, amount, bold = false, key) => /* @__PURE__ */
|
|
4375
|
-
/* @__PURE__ */
|
|
4376
|
-
/* @__PURE__ */
|
|
4385
|
+
const row = (label, amount, bold = false, key) => /* @__PURE__ */ jsxs52(View58, { accessibilityLabel: `${label}: ${amount}`, className: "flex-row justify-between gap-4", children: [
|
|
4386
|
+
/* @__PURE__ */ jsx93(Text37, { className: `text-foreground ${bold ? "font-semibold" : ""}`, children: label }),
|
|
4387
|
+
/* @__PURE__ */ jsx93(Text37, { className: `text-right text-foreground ${bold ? "font-semibold" : ""}`, children: amount })
|
|
4377
4388
|
] }, key);
|
|
4378
4389
|
const { totals } = receipt;
|
|
4379
4390
|
const taxRows = totals.taxLines.map((line, index) => row(`${totals.taxInclusive ? "incl. " : ""}${taxLabel(line.ratePpm)}`, money(line.amountMinor), false, index));
|
|
4380
|
-
return /* @__PURE__ */
|
|
4381
|
-
topInset > 0 ? /* @__PURE__ */
|
|
4382
|
-
/* @__PURE__ */
|
|
4383
|
-
/* @__PURE__ */
|
|
4384
|
-
receipt.header.storeAddress ? /* @__PURE__ */
|
|
4385
|
-
/* @__PURE__ */
|
|
4391
|
+
return /* @__PURE__ */ jsxs52(Fragment7, { children: [
|
|
4392
|
+
topInset > 0 ? /* @__PURE__ */ jsx93(View58, { dataSet: { print: "hide" }, style: { height: topInset, flexShrink: 0 } }) : null,
|
|
4393
|
+
/* @__PURE__ */ jsxs52(View58, { className: "w-full max-w-md self-center gap-3 p-4 bg-card", children: [
|
|
4394
|
+
/* @__PURE__ */ jsx93(Text37, { className: "text-lg font-semibold text-foreground", children: receipt.header.storeName }),
|
|
4395
|
+
receipt.header.storeAddress ? /* @__PURE__ */ jsx93(Text37, { className: "text-muted-foreground", children: receipt.header.storeAddress }) : null,
|
|
4396
|
+
/* @__PURE__ */ jsxs52(Text37, { className: "text-foreground", children: [
|
|
4386
4397
|
"Order ",
|
|
4387
4398
|
receipt.header.orderNumber.slice(-8)
|
|
4388
4399
|
] }),
|
|
4389
|
-
/* @__PURE__ */
|
|
4390
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ jsx93(Text37, { className: "text-muted-foreground", children: formatDate(receipt.header.date) }),
|
|
4401
|
+
/* @__PURE__ */ jsxs52(Text37, { className: "text-muted-foreground", children: [
|
|
4391
4402
|
"Cashier: ",
|
|
4392
4403
|
receipt.header.cashier
|
|
4393
4404
|
] }),
|
|
4394
|
-
receipt.header.customer && /* @__PURE__ */
|
|
4405
|
+
receipt.header.customer && /* @__PURE__ */ jsxs52(Text37, { className: "text-muted-foreground", children: [
|
|
4395
4406
|
"Customer: ",
|
|
4396
4407
|
receipt.header.customer
|
|
4397
4408
|
] }),
|
|
4398
|
-
receipt.lineItems.map((line, index) => /* @__PURE__ */
|
|
4399
|
-
/* @__PURE__ */
|
|
4409
|
+
receipt.lineItems.map((line, index) => /* @__PURE__ */ jsxs52(View58, { children: [
|
|
4410
|
+
/* @__PURE__ */ jsx93(Text37, { className: "text-foreground", children: line.name }),
|
|
4400
4411
|
row(`${line.quantity} \xD7 ${money(line.unitPriceMinor)}`, money(line.displayAmountMinor)),
|
|
4401
|
-
line.displayDiscounts.map((discount, i) => /* @__PURE__ */
|
|
4412
|
+
line.displayDiscounts.map((discount, i) => /* @__PURE__ */ jsx93(View58, { className: "pl-4", children: row(`${discountLabel(
|
|
4402
4413
|
order.lineItems[index].discounts[i],
|
|
4403
4414
|
receipt.currency
|
|
4404
4415
|
)} off`, `\u2212${money(discount.amountMinor)}`) }, i))
|
|
@@ -4415,11 +4426,11 @@ function Receipt({
|
|
|
4415
4426
|
index
|
|
4416
4427
|
)),
|
|
4417
4428
|
row("Change", money(receipt.changeDueMinor)),
|
|
4418
|
-
/* @__PURE__ */
|
|
4419
|
-
/* @__PURE__ */
|
|
4429
|
+
/* @__PURE__ */ jsxs52(View58, { dataSet: { print: "hide" }, className: "flex-row gap-4", children: [
|
|
4430
|
+
/* @__PURE__ */ jsx93(Pressable28, { accessibilityRole: "button", onPress: () => {
|
|
4420
4431
|
if (typeof window !== "undefined" && typeof window.print === "function") window.print();
|
|
4421
|
-
}, className: "rounded-md border border-border bg-card px-4 py-3", children: /* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4432
|
+
}, className: "rounded-md border border-border bg-card px-4 py-3", children: /* @__PURE__ */ jsx93(Text37, { className: "text-center text-foreground", children: "Print receipt" }) }),
|
|
4433
|
+
/* @__PURE__ */ jsx93(Pressable28, { accessibilityRole: "button", onPress: newSale, className: "rounded-md bg-primary px-4 py-3", children: /* @__PURE__ */ jsx93(Text37, { className: "text-center font-semibold text-primary-foreground", children: "New sale" }) })
|
|
4423
4434
|
] })
|
|
4424
4435
|
] })
|
|
4425
4436
|
] });
|
|
@@ -4436,7 +4447,7 @@ function sinceText(clock) {
|
|
|
4436
4447
|
}
|
|
4437
4448
|
|
|
4438
4449
|
// src/sale/sync-status.tsx
|
|
4439
|
-
import { Fragment as
|
|
4450
|
+
import { Fragment as Fragment8, jsx as jsx94, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4440
4451
|
var PULL_NOTICE_TEXT = {
|
|
4441
4452
|
unauthorized: {
|
|
4442
4453
|
line: () => "Products aren't updating: this till needs to sign in to the online store again.",
|
|
@@ -4512,15 +4523,15 @@ function SyncStatus({ state, registerState, pluginName = "the POS plugin", pullN
|
|
|
4512
4523
|
const notice = pullNotice && text && { line: text.line(pluginName), detail: text.detail(pullNotice, pluginName) };
|
|
4513
4524
|
useAnnounceOnIos(notice?.line, spoken);
|
|
4514
4525
|
const oneDetail = pullNotice?.code === "missing_plugin" && !!backendMissing;
|
|
4515
|
-
return /* @__PURE__ */
|
|
4516
|
-
notice ? /* @__PURE__ */
|
|
4517
|
-
/* @__PURE__ */
|
|
4518
|
-
oneDetail ? null : /* @__PURE__ */
|
|
4526
|
+
return /* @__PURE__ */ jsxs53(View59, { children: [
|
|
4527
|
+
notice ? /* @__PURE__ */ jsxs53(Fragment8, { children: [
|
|
4528
|
+
/* @__PURE__ */ jsx94(Text38, { accessibilityLiveRegion: "polite", className: "px-4 py-2 text-xs text-muted-foreground", children: notice.line }),
|
|
4529
|
+
oneDetail ? null : /* @__PURE__ */ jsx94(Text38, { className: "px-4 pb-2 text-xs text-muted-foreground", children: notice.detail })
|
|
4519
4530
|
] }) : null,
|
|
4520
|
-
/* @__PURE__ */
|
|
4521
|
-
doing ? /* @__PURE__ */
|
|
4522
|
-
refused ? /* @__PURE__ */
|
|
4523
|
-
oneDetail && notice ? /* @__PURE__ */
|
|
4531
|
+
/* @__PURE__ */ jsx94(Text38, { accessibilityLabel: spoken, accessibilityLiveRegion: "polite", className: "px-4 py-2 text-xs text-muted-foreground", children: spoken }),
|
|
4532
|
+
doing ? /* @__PURE__ */ jsx94(Text38, { className: "px-4 pb-2 text-xs text-muted-foreground", children: doing }) : null,
|
|
4533
|
+
refused ? /* @__PURE__ */ jsx94(Text38, { className: "px-4 pb-2 text-xs text-muted-foreground", children: REFUSED_DETAIL }) : null,
|
|
4534
|
+
oneDetail && notice ? /* @__PURE__ */ jsx94(Text38, { className: "px-4 pb-2 text-xs text-muted-foreground", children: notice.detail }) : backendMissing ? /* @__PURE__ */ jsx94(Text38, { className: "px-4 pb-2 text-xs text-muted-foreground", children: BACKEND_MISSING_DETAIL.replace("{pluginName}", () => pluginName).replace("{lastTime}", () => upToDate ? " the last time it checked" : "") }) : null
|
|
4524
4535
|
] });
|
|
4525
4536
|
}
|
|
4526
4537
|
|
|
@@ -4529,7 +4540,7 @@ import { useEffect as useEffect8, useRef as useRef7, useState as useState19 } fr
|
|
|
4529
4540
|
import { Pressable as Pressable29, ScrollView as ScrollView13, Text as Text39, View as View60 } from "react-native";
|
|
4530
4541
|
import { formatMoney as formatMoney14, knownWarnings } from "@tallyui/core";
|
|
4531
4542
|
import { needsAttention } from "@tallyui/pos";
|
|
4532
|
-
import { jsx as
|
|
4543
|
+
import { jsx as jsx95, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4533
4544
|
var STATUS_LABEL = { pending: "Waiting to sync", applied: "Synced", rejected: "Not accepted" };
|
|
4534
4545
|
var FIGURE_LABELS = /* @__PURE__ */ new Map([["subtotalMinor", "Subtotal"], ["taxMinor", "Tax"], ["discountMinor", "Discount"]]);
|
|
4535
4546
|
var REFUSAL_SENTENCES = /* @__PURE__ */ new Map([
|
|
@@ -4560,31 +4571,31 @@ function OrdersList({ orders, onRetry, formatDate = defaultFormatDate2, footer,
|
|
|
4560
4571
|
}
|
|
4561
4572
|
setRetryingIds(new Set(retrying.current));
|
|
4562
4573
|
}, [orders]);
|
|
4563
|
-
return /* @__PURE__ */
|
|
4564
|
-
[{ title: "Needs attention", orders: needsAttention(orders, { stuckCommandIds: stuck?.commandIds }) }, { title: "Recent", orders }].filter((section) => section.title === "Recent" || section.orders.length > 0).map((section) => /* @__PURE__ */
|
|
4565
|
-
/* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ jsxs54(ScrollView13, { className: "flex-1 bg-background p-4", children: [
|
|
4575
|
+
[{ title: "Needs attention", orders: needsAttention(orders, { stuckCommandIds: stuck?.commandIds }) }, { title: "Recent", orders }].filter((section) => section.title === "Recent" || section.orders.length > 0).map((section) => /* @__PURE__ */ jsxs54(View60, { className: "mb-6 gap-3", children: [
|
|
4576
|
+
/* @__PURE__ */ jsx95(Text39, { accessibilityRole: "header", className: "text-xl font-semibold text-foreground", children: section.title }),
|
|
4566
4577
|
section.orders.map((order) => {
|
|
4567
4578
|
const count2 = order.lines.reduce((sum, line) => sum + line.quantity, 0);
|
|
4568
4579
|
const stuckEntry = order.syncStatus === "pending" ? stuck?.orders.find((entry) => entry.commandId === order.commandId) : void 0;
|
|
4569
|
-
return /* @__PURE__ */
|
|
4570
|
-
/* @__PURE__ */
|
|
4580
|
+
return /* @__PURE__ */ jsxs54(View60, { className: "gap-1 rounded-md border border-border bg-card p-3", children: [
|
|
4581
|
+
/* @__PURE__ */ jsxs54(Text39, { className: "text-foreground", children: [
|
|
4571
4582
|
order.serverRefs?.displayId ? `Order #${order.serverRefs.displayId} \xB7 ` : "",
|
|
4572
4583
|
count2,
|
|
4573
4584
|
" ",
|
|
4574
4585
|
count2 === 1 ? "item" : "items"
|
|
4575
4586
|
] }),
|
|
4576
|
-
/* @__PURE__ */
|
|
4587
|
+
/* @__PURE__ */ jsxs54(Text39, { className: "text-muted-foreground", children: [
|
|
4577
4588
|
formatDate(order.createdAt),
|
|
4578
4589
|
" \xB7 ",
|
|
4579
4590
|
formatMoney14({ amount: order.totalMinor, currency: order.currency }),
|
|
4580
4591
|
" \xB7 ",
|
|
4581
4592
|
STATUS_LABEL[order.syncStatus]
|
|
4582
4593
|
] }),
|
|
4583
|
-
stuckEntry ? /* @__PURE__ */
|
|
4584
|
-
order.syncStatus === "rejected" ? /* @__PURE__ */
|
|
4585
|
-
order.lateSessionId !== void 0 ? /* @__PURE__ */
|
|
4586
|
-
order.localWarnings?.map((warning, index) => /* @__PURE__ */
|
|
4587
|
-
section.title === "Needs attention" && order.syncStatus === "rejected" && order.error?.code !== "idempotency_mismatch" ? /* @__PURE__ */
|
|
4594
|
+
stuckEntry ? /* @__PURE__ */ jsx95(Text39, { className: "text-destructive", children: `Hasn't reached the online store since ${sinceText(stuckEntry)}.` }) : null,
|
|
4595
|
+
order.syncStatus === "rejected" ? /* @__PURE__ */ jsx95(Text39, { className: "text-destructive", children: refusalSentence(order.error?.code) }) : null,
|
|
4596
|
+
order.lateSessionId !== void 0 ? /* @__PURE__ */ jsx95(Text39, { className: "text-foreground", children: "Taken after the register closed. It is not in that register's closure." }) : null,
|
|
4597
|
+
order.localWarnings?.map((warning, index) => /* @__PURE__ */ jsx95(Text39, { className: "text-foreground", children: warning.code === "customer_omitted" ? `The customer's ${warning.field} couldn't be sent to the store, so the order isn't linked to them.` : "The terminal's payment reference couldn't be kept; the payment is recorded without it." }, index)),
|
|
4598
|
+
section.title === "Needs attention" && order.syncStatus === "rejected" && order.error?.code !== "idempotency_mismatch" ? /* @__PURE__ */ jsx95(Pressable29, { accessibilityRole: "button", disabled: retryingIds.has(order.id), onPress: async () => {
|
|
4588
4599
|
if (retrying.current.has(order.id)) return;
|
|
4589
4600
|
retrying.current.add(order.id);
|
|
4590
4601
|
setRetryingIds(new Set(retrying.current));
|
|
@@ -4592,8 +4603,8 @@ function OrdersList({ orders, onRetry, formatDate = defaultFormatDate2, footer,
|
|
|
4592
4603
|
retrying.current.delete(order.id);
|
|
4593
4604
|
setRetryingIds(new Set(retrying.current));
|
|
4594
4605
|
}
|
|
4595
|
-
}, className: "rounded-md bg-primary px-4 py-2", children: /* @__PURE__ */
|
|
4596
|
-
knownWarnings(order.warnings).map((warning, index) => /* @__PURE__ */
|
|
4606
|
+
}, className: "rounded-md bg-primary px-4 py-2", children: /* @__PURE__ */ jsx95(Text39, { className: "text-center font-semibold text-primary-foreground", children: "Retry" }) }) : null,
|
|
4607
|
+
knownWarnings(order.warnings).map((warning, index) => /* @__PURE__ */ jsx95(View60, { className: "border-l-4 border-warning pl-2", children: /* @__PURE__ */ jsx95(Text39, { className: "text-foreground", children: warning.code === "insufficient_stock" ? `Stock short by ${warning.quantity} for ${order.lines.find((line) => line.variantId === warning.variantId)?.name}` : warning.code === "tax_rate_mismatch" ? `Tax at ${(warning.ratePpm / 1e4).toLocaleString(void 0, { maximumFractionDigits: 4 })}%: store ${formatMoney14({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney14({ amount: warning.expectedMinor, currency: order.currency })}` : warning.code === "customer_ignored" ? `The online store didn't recognise the customer on this sale, so it was saved as a guest sale. Customer id: ${warning.customerId}.` : warning.code === "figures_mismatch" ? `The online store worked out different figures for this sale. ${warning.fields.map(({ field, tillMinor, serverMinor }) => `${FIGURE_LABELS.get(field) ?? field}: till ${formatMoney14({ amount: tillMinor, currency: order.currency })}, store ${formatMoney14({ amount: serverMinor, currency: order.currency })}.`).join(" ")}` : warning.bridgeMinor !== void 0 ? `Store calculated ${formatMoney14({ amount: warning.serverMinor, currency: order.currency })}; a rounding line of ${warning.bridgeMinor > 0 ? "+" : ""}${formatMoney14({ amount: warning.bridgeMinor, currency: order.currency })} brought it to ${formatMoney14({ amount: warning.expectedMinor, currency: order.currency })}` : `Store total ${formatMoney14({ amount: warning.serverMinor, currency: order.currency })} vs POS ${formatMoney14({ amount: warning.expectedMinor, currency: order.currency })}` }) }, index))
|
|
4597
4608
|
] }, order.id);
|
|
4598
4609
|
})
|
|
4599
4610
|
] }, section.title)),
|
|
@@ -4605,7 +4616,7 @@ function OrdersList({ orders, onRetry, formatDate = defaultFormatDate2, footer,
|
|
|
4605
4616
|
import { useState as useState20 } from "react";
|
|
4606
4617
|
import { Pressable as Pressable30, Text as Text40, View as View61, useWindowDimensions as useWindowDimensions3 } from "react-native";
|
|
4607
4618
|
import { cn as cn80 } from "@tallyui/theme";
|
|
4608
|
-
import { Fragment as
|
|
4619
|
+
import { Fragment as Fragment9, jsx as jsx96, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
4609
4620
|
function POSLayout({
|
|
4610
4621
|
browseSlot,
|
|
4611
4622
|
cartSlot,
|
|
@@ -4618,31 +4629,31 @@ function POSLayout({
|
|
|
4618
4629
|
const { width } = useWindowDimensions3();
|
|
4619
4630
|
const layout = layoutProp ?? (width >= breakpoint ? "split" : "stacked");
|
|
4620
4631
|
const [activeTab, setActiveTab] = useState20("browse");
|
|
4621
|
-
return /* @__PURE__ */
|
|
4622
|
-
headerSlot && /* @__PURE__ */
|
|
4623
|
-
layout === "split" ? /* @__PURE__ */
|
|
4624
|
-
/* @__PURE__ */
|
|
4625
|
-
/* @__PURE__ */
|
|
4626
|
-
] }) : /* @__PURE__ */
|
|
4627
|
-
/* @__PURE__ */
|
|
4628
|
-
/* @__PURE__ */
|
|
4632
|
+
return /* @__PURE__ */ jsxs55(View61, { className: cn80("flex-1 bg-bg", className), ...viewProps, children: [
|
|
4633
|
+
headerSlot && /* @__PURE__ */ jsx96(View61, { className: "border-b border-border", children: headerSlot }),
|
|
4634
|
+
layout === "split" ? /* @__PURE__ */ jsxs55(View61, { className: "flex-1 flex-row", children: [
|
|
4635
|
+
/* @__PURE__ */ jsx96(View61, { className: "flex-[3]", children: browseSlot }),
|
|
4636
|
+
/* @__PURE__ */ jsx96(View61, { className: "flex-[2] border-l border-border", children: cartSlot })
|
|
4637
|
+
] }) : /* @__PURE__ */ jsxs55(Fragment9, { children: [
|
|
4638
|
+
/* @__PURE__ */ jsxs55(View61, { className: "flex-row border-b border-border", children: [
|
|
4639
|
+
/* @__PURE__ */ jsx96(
|
|
4629
4640
|
Pressable30,
|
|
4630
4641
|
{
|
|
4631
4642
|
onPress: () => setActiveTab("browse"),
|
|
4632
4643
|
className: cn80("flex-1 py-3", activeTab === "browse" && "border-b-2 border-primary"),
|
|
4633
|
-
children: /* @__PURE__ */
|
|
4644
|
+
children: /* @__PURE__ */ jsx96(Text40, { className: cn80("text-center text-sm font-semibold", activeTab === "browse" ? "text-primary" : "text-muted-foreground"), children: "Browse" })
|
|
4634
4645
|
}
|
|
4635
4646
|
),
|
|
4636
|
-
/* @__PURE__ */
|
|
4647
|
+
/* @__PURE__ */ jsx96(
|
|
4637
4648
|
Pressable30,
|
|
4638
4649
|
{
|
|
4639
4650
|
onPress: () => setActiveTab("cart"),
|
|
4640
4651
|
className: cn80("flex-1 py-3", activeTab === "cart" && "border-b-2 border-primary"),
|
|
4641
|
-
children: /* @__PURE__ */
|
|
4652
|
+
children: /* @__PURE__ */ jsx96(Text40, { className: cn80("text-center text-sm font-semibold", activeTab === "cart" ? "text-primary" : "text-muted-foreground"), children: "Cart" })
|
|
4642
4653
|
}
|
|
4643
4654
|
)
|
|
4644
4655
|
] }),
|
|
4645
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsx96(View61, { className: "flex-1", children: activeTab === "browse" ? browseSlot : cartSlot })
|
|
4646
4657
|
] })
|
|
4647
4658
|
] });
|
|
4648
4659
|
}
|
|
@@ -4650,7 +4661,7 @@ function POSLayout({
|
|
|
4650
4661
|
// src/layout/checkout-layout.tsx
|
|
4651
4662
|
import { ScrollView as ScrollView14, View as View62, useWindowDimensions as useWindowDimensions4 } from "react-native";
|
|
4652
4663
|
import { cn as cn81 } from "@tallyui/theme";
|
|
4653
|
-
import { jsx as
|
|
4664
|
+
import { jsx as jsx97, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4654
4665
|
function CheckoutLayout({
|
|
4655
4666
|
summarySlot,
|
|
4656
4667
|
paymentSlot,
|
|
@@ -4662,12 +4673,12 @@ function CheckoutLayout({
|
|
|
4662
4673
|
}) {
|
|
4663
4674
|
const { width } = useWindowDimensions4();
|
|
4664
4675
|
const layout = layoutProp ?? (width >= breakpoint ? "split" : "stacked");
|
|
4665
|
-
return /* @__PURE__ */
|
|
4666
|
-
headerSlot && /* @__PURE__ */
|
|
4667
|
-
layout === "split" ? /* @__PURE__ */
|
|
4668
|
-
/* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4670
|
-
] }) : /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsxs56(View62, { className: cn81("flex-1 bg-bg", className), ...viewProps, children: [
|
|
4677
|
+
headerSlot && /* @__PURE__ */ jsx97(View62, { className: "border-b border-border", children: headerSlot }),
|
|
4678
|
+
layout === "split" ? /* @__PURE__ */ jsxs56(View62, { className: "flex-1 flex-row", children: [
|
|
4679
|
+
/* @__PURE__ */ jsx97(View62, { className: "flex-1 border-r border-border", children: summarySlot }),
|
|
4680
|
+
/* @__PURE__ */ jsx97(View62, { className: "flex-1", children: paymentSlot })
|
|
4681
|
+
] }) : /* @__PURE__ */ jsx97(ScrollView14, { className: "flex-1", children: /* @__PURE__ */ jsxs56(View62, { className: "gap-4 p-4", children: [
|
|
4671
4682
|
summarySlot,
|
|
4672
4683
|
paymentSlot
|
|
4673
4684
|
] }) })
|
|
@@ -4678,7 +4689,7 @@ function CheckoutLayout({
|
|
|
4678
4689
|
import { useState as useState21 } from "react";
|
|
4679
4690
|
import { Pressable as Pressable31, Text as Text41, View as View63, useWindowDimensions as useWindowDimensions5 } from "react-native";
|
|
4680
4691
|
import { cn as cn82 } from "@tallyui/theme";
|
|
4681
|
-
import { jsx as
|
|
4692
|
+
import { jsx as jsx98, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
4682
4693
|
function SettingsLayout({
|
|
4683
4694
|
navSlot,
|
|
4684
4695
|
contentSlot,
|
|
@@ -4691,16 +4702,16 @@ function SettingsLayout({
|
|
|
4691
4702
|
const { width } = useWindowDimensions5();
|
|
4692
4703
|
const layout = layoutProp ?? (width >= breakpoint ? "split" : "stacked");
|
|
4693
4704
|
const [showNav, setShowNav] = useState21(false);
|
|
4694
|
-
return /* @__PURE__ */
|
|
4695
|
-
headerSlot && /* @__PURE__ */
|
|
4696
|
-
layout === "split" ? /* @__PURE__ */
|
|
4697
|
-
/* @__PURE__ */
|
|
4698
|
-
/* @__PURE__ */
|
|
4699
|
-
] }) : /* @__PURE__ */
|
|
4705
|
+
return /* @__PURE__ */ jsxs57(View63, { className: cn82("flex-1 bg-bg", className), ...viewProps, children: [
|
|
4706
|
+
headerSlot && /* @__PURE__ */ jsx98(View63, { className: "border-b border-border", children: headerSlot }),
|
|
4707
|
+
layout === "split" ? /* @__PURE__ */ jsxs57(View63, { className: "flex-1 flex-row", children: [
|
|
4708
|
+
/* @__PURE__ */ jsx98(View63, { className: "w-64 border-r border-border", children: navSlot }),
|
|
4709
|
+
/* @__PURE__ */ jsx98(View63, { className: "flex-1", children: contentSlot })
|
|
4710
|
+
] }) : /* @__PURE__ */ jsx98(View63, { className: "flex-1", children: showNav ? /* @__PURE__ */ jsxs57(View63, { className: "flex-1", children: [
|
|
4700
4711
|
navSlot,
|
|
4701
|
-
/* @__PURE__ */
|
|
4702
|
-
] }) : /* @__PURE__ */
|
|
4703
|
-
/* @__PURE__ */
|
|
4712
|
+
/* @__PURE__ */ jsx98(Pressable31, { onPress: () => setShowNav(false), className: "border-t border-border p-3", children: /* @__PURE__ */ jsx98(Text41, { className: "text-center text-sm font-medium text-primary", children: "Done" }) })
|
|
4713
|
+
] }) : /* @__PURE__ */ jsxs57(View63, { className: "flex-1", children: [
|
|
4714
|
+
/* @__PURE__ */ jsx98(Pressable31, { onPress: () => setShowNav(true), className: "border-b border-border px-4 py-2", children: /* @__PURE__ */ jsx98(Text41, { className: "text-sm font-medium text-primary", children: "Menu" }) }),
|
|
4704
4715
|
contentSlot
|
|
4705
4716
|
] }) })
|
|
4706
4717
|
] });
|
|
@@ -4709,7 +4720,7 @@ function SettingsLayout({
|
|
|
4709
4720
|
// src/layout/live-tab-screen.tsx
|
|
4710
4721
|
import { Pressable as Pressable32, Text as Text42, View as View64 } from "react-native";
|
|
4711
4722
|
import { cn as cn83 } from "@tallyui/theme";
|
|
4712
|
-
import { jsx as
|
|
4723
|
+
import { jsx as jsx99, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
4713
4724
|
function LiveTabScreen({
|
|
4714
4725
|
state,
|
|
4715
4726
|
onUseHere,
|
|
@@ -4726,10 +4737,10 @@ function LiveTabScreen({
|
|
|
4726
4737
|
const body = state === "parked" ? parkedBody : blockedBody;
|
|
4727
4738
|
const buttonLabel = state === "parked" ? useHereLabel : reloadLabel;
|
|
4728
4739
|
const onPress = state === "parked" ? onUseHere : onReload;
|
|
4729
|
-
return /* @__PURE__ */
|
|
4730
|
-
/* @__PURE__ */
|
|
4731
|
-
/* @__PURE__ */
|
|
4732
|
-
/* @__PURE__ */
|
|
4740
|
+
return /* @__PURE__ */ jsxs58(View64, { className: cn83("flex-1 items-center justify-center gap-4 bg-bg p-6", className), ...viewProps, children: [
|
|
4741
|
+
/* @__PURE__ */ jsx99(Text42, { className: "text-center text-lg font-bold text-foreground", children: parkedTitle }),
|
|
4742
|
+
/* @__PURE__ */ jsx99(Text42, { className: "text-center text-sm text-muted-foreground", children: body }),
|
|
4743
|
+
/* @__PURE__ */ jsx99(Pressable32, { onPress, className: "items-center rounded-lg bg-primary px-4 py-3", children: /* @__PURE__ */ jsx99(Text42, { className: "text-sm font-semibold text-primary-foreground", children: buttonLabel }) })
|
|
4733
4744
|
] });
|
|
4734
4745
|
}
|
|
4735
4746
|
|
|
@@ -4737,7 +4748,7 @@ function LiveTabScreen({
|
|
|
4737
4748
|
import { useState as useState22 } from "react";
|
|
4738
4749
|
import { Pressable as Pressable33, Text as Text43, View as View65 } from "react-native";
|
|
4739
4750
|
import { cn as cn84 } from "@tallyui/theme";
|
|
4740
|
-
import { jsx as
|
|
4751
|
+
import { jsx as jsx100, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
4741
4752
|
function useSectionSelection(options, initialValue) {
|
|
4742
4753
|
const preset = options.length === 1 ? options[0].value : options.find((o) => o.value === initialValue)?.value;
|
|
4743
4754
|
return useState22(preset);
|
|
@@ -4786,31 +4797,31 @@ function StoreSettingsChoiceScreen({
|
|
|
4786
4797
|
else if (initial?.channel !== void 0) choice.channel = initial.channel;
|
|
4787
4798
|
onSubmit(choice);
|
|
4788
4799
|
};
|
|
4789
|
-
return /* @__PURE__ */
|
|
4790
|
-
/* @__PURE__ */
|
|
4791
|
-
/* @__PURE__ */
|
|
4792
|
-
/* @__PURE__ */
|
|
4800
|
+
return /* @__PURE__ */ jsxs59(View65, { className: cn84("w-full max-w-[560px] flex-1 self-center gap-6 bg-bg p-6", className), ...viewProps, children: [
|
|
4801
|
+
/* @__PURE__ */ jsxs59(View65, { className: "gap-2", children: [
|
|
4802
|
+
/* @__PURE__ */ jsx100(Text43, { className: "text-lg font-bold text-foreground", children: title }),
|
|
4803
|
+
/* @__PURE__ */ jsx100(Text43, { className: "text-sm text-muted-foreground", children: body })
|
|
4793
4804
|
] }),
|
|
4794
|
-
showRegions && /* @__PURE__ */
|
|
4795
|
-
showCountries && /* @__PURE__ */
|
|
4796
|
-
showChannels && /* @__PURE__ */
|
|
4797
|
-
/* @__PURE__ */
|
|
4805
|
+
showRegions && /* @__PURE__ */ jsx100(ChoiceSection, { label: regionLabel, options: regionOptions, selected: region, onSelect: setRegion }),
|
|
4806
|
+
showCountries && /* @__PURE__ */ jsx100(ChoiceSection, { label: countryLabel, options: countryOptions, selected: country, onSelect: setCountry }),
|
|
4807
|
+
showChannels && /* @__PURE__ */ jsx100(ChoiceSection, { label: channelLabel, options: channelOptions, selected: channel, onSelect: setChannel }),
|
|
4808
|
+
/* @__PURE__ */ jsx100(
|
|
4798
4809
|
Pressable33,
|
|
4799
4810
|
{
|
|
4800
4811
|
onPress: handleSubmit,
|
|
4801
4812
|
disabled: !complete,
|
|
4802
4813
|
className: cn84("items-center rounded-lg bg-primary px-4 py-3", !complete && "opacity-50"),
|
|
4803
|
-
children: /* @__PURE__ */
|
|
4814
|
+
children: /* @__PURE__ */ jsx100(Text43, { className: "text-sm font-semibold text-primary-foreground", children: submitLabel })
|
|
4804
4815
|
}
|
|
4805
4816
|
)
|
|
4806
4817
|
] });
|
|
4807
4818
|
}
|
|
4808
4819
|
function ChoiceSection({ label, options, selected, onSelect }) {
|
|
4809
|
-
return /* @__PURE__ */
|
|
4810
|
-
/* @__PURE__ */
|
|
4811
|
-
/* @__PURE__ */
|
|
4820
|
+
return /* @__PURE__ */ jsxs59(View65, { className: "gap-1.5", children: [
|
|
4821
|
+
/* @__PURE__ */ jsx100(Text43, { className: "text-xs font-semibold text-muted-foreground", children: label }),
|
|
4822
|
+
/* @__PURE__ */ jsx100(View65, { className: "rounded-lg border border-border", children: options.map((option, index) => {
|
|
4812
4823
|
const checked = option.value === selected;
|
|
4813
|
-
return /* @__PURE__ */
|
|
4824
|
+
return /* @__PURE__ */ jsxs59(
|
|
4814
4825
|
Pressable33,
|
|
4815
4826
|
{
|
|
4816
4827
|
onPress: () => onSelect(option.value),
|
|
@@ -4819,8 +4830,8 @@ function ChoiceSection({ label, options, selected, onSelect }) {
|
|
|
4819
4830
|
testID: `choice-option-${option.value}`,
|
|
4820
4831
|
className: cn84("flex-row items-center gap-3 px-4 py-3", index > 0 && "border-t border-border", checked && "bg-primary/10"),
|
|
4821
4832
|
children: [
|
|
4822
|
-
/* @__PURE__ */
|
|
4823
|
-
/* @__PURE__ */
|
|
4833
|
+
/* @__PURE__ */ jsx100(View65, { className: "h-4 w-4 items-center justify-center rounded-full border border-primary", children: checked && /* @__PURE__ */ jsx100(View65, { testID: `choice-option-${option.value}-dot`, className: "h-2.5 w-2.5 rounded-full bg-primary" }) }),
|
|
4834
|
+
/* @__PURE__ */ jsx100(Text43, { className: cn84("text-sm", checked ? "font-semibold text-primary" : "text-foreground"), children: option.label })
|
|
4824
4835
|
]
|
|
4825
4836
|
},
|
|
4826
4837
|
option.value
|
|
@@ -5021,6 +5032,7 @@ export {
|
|
|
5021
5032
|
TooltipContent,
|
|
5022
5033
|
TooltipTrigger,
|
|
5023
5034
|
VStack,
|
|
5035
|
+
XIcon,
|
|
5024
5036
|
avatarVariants,
|
|
5025
5037
|
badgeTextVariants,
|
|
5026
5038
|
badgeVariants,
|