@tabres/react 1.0.39 → 1.0.41

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.
Files changed (106) hide show
  1. package/dist/components/PublicMenu/OrderDrawer/OrderTip/OrderTip.d.ts +2 -0
  2. package/dist/components/PublicMenu/OrderDrawer/OrderTip/OrderTip.test.d.ts +1 -0
  3. package/dist/components/PublicMenu/OrderDrawer/OrderTip/index.d.ts +1 -0
  4. package/dist/components/PublicMenu/OrderPaymentSummary/OrderPaymentSummary.d.ts +7 -1
  5. package/dist/components/PublicMenu/OrderPaymentSummary/OrderPaymentSummary.test.d.ts +1 -0
  6. package/dist/constants/constants/index.d.ts +2 -0
  7. package/dist/constants/index.d.ts +2 -0
  8. package/dist/constants/index.esm.js +1 -1
  9. package/dist/constants/index.esm.js.map +1 -1
  10. package/dist/constants/index.js +1 -1
  11. package/dist/constants/index.js.map +1 -1
  12. package/dist/constants/modules/pos/constants/countries.d.ts +6 -0
  13. package/dist/constants/modules/pos/constants/posCompliance.d.ts +22 -0
  14. package/dist/constants/modules/pos/models/compliance.d.ts +9 -0
  15. package/dist/index.esm.js +1 -1
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/models/index.esm.js.map +1 -1
  20. package/dist/models/index.js.map +1 -1
  21. package/dist/models/modules/order/constants.d.ts +1 -0
  22. package/dist/models/modules/order/models.d.ts +9 -0
  23. package/dist/models/modules/order/utils.d.ts +2 -0
  24. package/dist/models/services/translation/locales/az/index.d.ts +6 -0
  25. package/dist/models/services/translation/locales/az/order.d.ts +6 -0
  26. package/dist/models/services/translation/locales/es/index.d.ts +6 -0
  27. package/dist/models/services/translation/locales/es/order.d.ts +6 -0
  28. package/dist/models/services/translation/locales/et/index.d.ts +6 -0
  29. package/dist/models/services/translation/locales/et/order.d.ts +6 -0
  30. package/dist/models/services/translation/locales/hr/index.d.ts +6 -0
  31. package/dist/models/services/translation/locales/hr/order.d.ts +6 -0
  32. package/dist/models/services/translation/locales/index.d.ts +54 -0
  33. package/dist/models/services/translation/locales/nl/index.d.ts +6 -0
  34. package/dist/models/services/translation/locales/nl/order.d.ts +6 -0
  35. package/dist/models/services/translation/locales/pl/index.d.ts +6 -0
  36. package/dist/models/services/translation/locales/pl/order.d.ts +6 -0
  37. package/dist/models/services/translation/locales/pt/index.d.ts +6 -0
  38. package/dist/models/services/translation/locales/pt/order.d.ts +6 -0
  39. package/dist/models/services/translation/locales/ru/index.d.ts +6 -0
  40. package/dist/models/services/translation/locales/ru/order.d.ts +6 -0
  41. package/dist/models/services/translation/locales/tr/index.d.ts +6 -0
  42. package/dist/models/services/translation/locales/tr/order.d.ts +6 -0
  43. package/dist/modules/order/constants.d.ts +1 -0
  44. package/dist/modules/order/models.d.ts +9 -0
  45. package/dist/modules/order/utils.d.ts +2 -0
  46. package/dist/modules/pos/constants/countries.d.ts +6 -0
  47. package/dist/modules/pos/constants/posCompliance.d.ts +22 -0
  48. package/dist/modules/pos/models/compliance.d.ts +9 -0
  49. package/dist/modules/pos/utils/index.d.ts +1 -0
  50. package/dist/modules/pos/utils/posCompliance.d.ts +10 -0
  51. package/dist/modules/pos/utils/posCompliance.test.d.ts +1 -0
  52. package/dist/services/translation/locales/az/index.d.ts +6 -0
  53. package/dist/services/translation/locales/az/order.d.ts +6 -0
  54. package/dist/services/translation/locales/es/index.d.ts +6 -0
  55. package/dist/services/translation/locales/es/order.d.ts +6 -0
  56. package/dist/services/translation/locales/et/index.d.ts +6 -0
  57. package/dist/services/translation/locales/et/order.d.ts +6 -0
  58. package/dist/services/translation/locales/hr/index.d.ts +6 -0
  59. package/dist/services/translation/locales/hr/order.d.ts +6 -0
  60. package/dist/services/translation/locales/index.d.ts +54 -0
  61. package/dist/services/translation/locales/nl/index.d.ts +6 -0
  62. package/dist/services/translation/locales/nl/order.d.ts +6 -0
  63. package/dist/services/translation/locales/pl/index.d.ts +6 -0
  64. package/dist/services/translation/locales/pl/order.d.ts +6 -0
  65. package/dist/services/translation/locales/pt/index.d.ts +6 -0
  66. package/dist/services/translation/locales/pt/order.d.ts +6 -0
  67. package/dist/services/translation/locales/ru/index.d.ts +6 -0
  68. package/dist/services/translation/locales/ru/order.d.ts +6 -0
  69. package/dist/services/translation/locales/tr/index.d.ts +6 -0
  70. package/dist/services/translation/locales/tr/order.d.ts +6 -0
  71. package/dist/styles/ui.css +1 -1
  72. package/dist/styles/ui.css.map +1 -1
  73. package/dist/utils/index.d.ts +1 -0
  74. package/dist/utils/index.esm.js +1 -1
  75. package/dist/utils/index.esm.js.map +1 -1
  76. package/dist/utils/index.js +1 -1
  77. package/dist/utils/index.js.map +1 -1
  78. package/dist/utils/modules/order/constants.d.ts +1 -0
  79. package/dist/utils/modules/order/models.d.ts +9 -0
  80. package/dist/utils/modules/order/utils.d.ts +2 -0
  81. package/dist/utils/modules/pos/constants/countries.d.ts +6 -0
  82. package/dist/utils/modules/pos/constants/posCompliance.d.ts +22 -0
  83. package/dist/utils/modules/pos/models/compliance.d.ts +9 -0
  84. package/dist/utils/modules/pos/utils/index.d.ts +1 -0
  85. package/dist/utils/modules/pos/utils/posCompliance.d.ts +10 -0
  86. package/dist/utils/services/translation/locales/az/index.d.ts +6 -0
  87. package/dist/utils/services/translation/locales/az/order.d.ts +6 -0
  88. package/dist/utils/services/translation/locales/es/index.d.ts +6 -0
  89. package/dist/utils/services/translation/locales/es/order.d.ts +6 -0
  90. package/dist/utils/services/translation/locales/et/index.d.ts +6 -0
  91. package/dist/utils/services/translation/locales/et/order.d.ts +6 -0
  92. package/dist/utils/services/translation/locales/hr/index.d.ts +6 -0
  93. package/dist/utils/services/translation/locales/hr/order.d.ts +6 -0
  94. package/dist/utils/services/translation/locales/index.d.ts +54 -0
  95. package/dist/utils/services/translation/locales/nl/index.d.ts +6 -0
  96. package/dist/utils/services/translation/locales/nl/order.d.ts +6 -0
  97. package/dist/utils/services/translation/locales/pl/index.d.ts +6 -0
  98. package/dist/utils/services/translation/locales/pl/order.d.ts +6 -0
  99. package/dist/utils/services/translation/locales/pt/index.d.ts +6 -0
  100. package/dist/utils/services/translation/locales/pt/order.d.ts +6 -0
  101. package/dist/utils/services/translation/locales/ru/index.d.ts +6 -0
  102. package/dist/utils/services/translation/locales/ru/order.d.ts +6 -0
  103. package/dist/utils/services/translation/locales/tr/index.d.ts +6 -0
  104. package/dist/utils/services/translation/locales/tr/order.d.ts +6 -0
  105. package/dist/utils/utils/index.d.ts +1 -0
  106. package/package.json +1 -1
@@ -10,5 +10,7 @@ export declare const buildSelectedAddonsPayload: (productAddons?: addonModels.Me
10
10
  export declare const getDefaultOrderType: (settings: branchModels.BranchSettings, isOpen: boolean, isDelivering: boolean) => OrderType | null;
11
11
  export declare const isValidPreviewResponse: (data: unknown) => data is CalculatePreviewResponse;
12
12
  export declare const buildGuestContactRequest: (contact?: GuestContact) => GuestContactRequest | undefined;
13
+ export declare const calculateTipAmount: (base: number, percentage: number) => number;
14
+ export declare const formatTipAmount: (amount: number) => string;
13
15
  export declare const getOrderErrorMessages: (field: keyof Order) => OrderErrors;
14
16
  export * from "./utils/item-price";
@@ -0,0 +1,6 @@
1
+ import { PosAllowance } from "../models/compliance";
2
+ export declare const COUNTRIES: {
3
+ name: string;
4
+ code: string;
5
+ allowsPOS: PosAllowance;
6
+ }[];
@@ -0,0 +1,22 @@
1
+ import { PosAllowance } from "../models/compliance";
2
+ /**
3
+ * Severity of each POS-allowance value, low → high. When the signed-in user's
4
+ * account country and the active branch's country disagree, the stricter
5
+ * (higher-severity) outcome wins — we never under-restrict and expose the
6
+ * merchant (or us) to fiscal penalties.
7
+ */
8
+ export declare const POS_ALLOWANCE_SEVERITY: Record<PosAllowance, number>;
9
+ export declare const BLOCKING_ALLOWANCES: PosAllowance[];
10
+ export declare const WARNING_ALLOWANCES: PosAllowance[];
11
+ export declare const POS_ALLOWANCE_BY_CODE: Record<string, PosAllowance>;
12
+ export interface PosComplianceCopy {
13
+ heading: string;
14
+ body: string;
15
+ note?: string;
16
+ }
17
+ /**
18
+ * Official, liability-protective copy per allowance. "no" and "restricted" share
19
+ * the hard-block message; the two advisory states each have their own; "yes" has
20
+ * none. The strings double as i18n keys (human-readable English fallback).
21
+ */
22
+ export declare const POS_COMPLIANCE_COPY: Record<PosAllowance, PosComplianceCopy | null>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Whether a restaurant can legally run a generic, NON-government-certified POS for HoReCa:
3
+ * - "restricted": Do not operate — comprehensive sanctions/embargo make a Western POS + payments SaaS illegal/unworkable, regardless of local tax law.
4
+ * - "no": Effectively forbidden — the POS software itself must be government-certified/registered before use (vendor is liable), or POS is banned.
5
+ * - "requires_integration": Allowed, but the business must connect to a government e-tax/e-invoice API or use a certified fiscal device/printer.
6
+ * - "own_risk": No certified/real-time mandate, but strict tax & bookkeeping rules apply and the restaurant is responsible.
7
+ * - "yes": No strict POS rules; an uncertified POS won't get the restaurant (or us) fined.
8
+ */
9
+ export type PosAllowance = "restricted" | "no" | "requires_integration" | "own_risk" | "yes";
@@ -0,0 +1 @@
1
+ export * from "./posCompliance";
@@ -0,0 +1,10 @@
1
+ import { PosAllowance } from "../models/compliance";
2
+ export declare const getPosAllowance: (code?: string | null) => PosAllowance | null;
3
+ /**
4
+ * Resolve the effective POS allowance from the user's account country and the
5
+ * active branch's country, taking the stricter of the two (most-restrictive
6
+ * wins). Returns null when neither country is known.
7
+ */
8
+ export declare const resolvePosAllowance: (userCountry?: string | null, branchCountryCode?: string | null) => PosAllowance | null;
9
+ export declare const isBlockingAllowance: (allowance: PosAllowance | null) => boolean;
10
+ export declare const isWarningAllowance: (allowance: PosAllowance | null) => boolean;
@@ -70,6 +70,12 @@ declare const _default: {
70
70
  Discount: string;
71
71
  "Discount ({{rate}}%)": string;
72
72
  "Service Fee ({{rate}}%)": string;
73
+ "Add a tip": string;
74
+ None: string;
75
+ Custom: string;
76
+ Tip: string;
77
+ "Total with tip": string;
78
+ "Enter tip amount": string;
73
79
  };
74
80
  customer: {
75
81
  "Unknown address": string;
@@ -45,5 +45,11 @@ declare const _default: {
45
45
  Discount: string;
46
46
  "Discount ({{rate}}%)": string;
47
47
  "Service Fee ({{rate}}%)": string;
48
+ "Add a tip": string;
49
+ None: string;
50
+ Custom: string;
51
+ Tip: string;
52
+ "Total with tip": string;
53
+ "Enter tip amount": string;
48
54
  };
49
55
  export default _default;
@@ -118,6 +118,12 @@ declare const _default: {
118
118
  "Discount ({{rate}}%)": string;
119
119
  Events: string;
120
120
  "Service Fee ({{rate}}%)": string;
121
+ "Add a tip": string;
122
+ None: string;
123
+ Custom: string;
124
+ Tip: string;
125
+ "Total with tip": string;
126
+ "Enter tip amount": string;
121
127
  };
122
128
  };
123
129
  export default _default;
@@ -46,5 +46,11 @@ declare const _default: {
46
46
  "Discount ({{rate}}%)": string;
47
47
  Events: string;
48
48
  "Service Fee ({{rate}}%)": string;
49
+ "Add a tip": string;
50
+ None: string;
51
+ Custom: string;
52
+ Tip: string;
53
+ "Total with tip": string;
54
+ "Enter tip amount": string;
49
55
  };
50
56
  export default _default;
@@ -69,6 +69,12 @@ declare const _default: {
69
69
  Discount: string;
70
70
  "Discount ({{rate}}%)": string;
71
71
  "Service Fee ({{rate}}%)": string;
72
+ "Add a tip": string;
73
+ None: string;
74
+ Custom: string;
75
+ Tip: string;
76
+ "Total with tip": string;
77
+ "Enter tip amount": string;
72
78
  };
73
79
  customer: {
74
80
  "Unknown address": string;
@@ -44,5 +44,11 @@ declare const _default: {
44
44
  Discount: string;
45
45
  "Discount ({{rate}}%)": string;
46
46
  "Service Fee ({{rate}}%)": string;
47
+ "Add a tip": string;
48
+ None: string;
49
+ Custom: string;
50
+ Tip: string;
51
+ "Total with tip": string;
52
+ "Enter tip amount": string;
47
53
  };
48
54
  export default _default;
@@ -70,6 +70,12 @@ declare const _default: {
70
70
  Discount: string;
71
71
  "Discount ({{rate}}%)": string;
72
72
  "Service Fee ({{rate}}%)": string;
73
+ "Add a tip": string;
74
+ None: string;
75
+ Custom: string;
76
+ Tip: string;
77
+ "Total with tip": string;
78
+ "Enter tip amount": string;
73
79
  };
74
80
  customer: {
75
81
  "Unknown address": string;
@@ -45,5 +45,11 @@ declare const _default: {
45
45
  Discount: string;
46
46
  "Discount ({{rate}}%)": string;
47
47
  "Service Fee ({{rate}}%)": string;
48
+ "Add a tip": string;
49
+ None: string;
50
+ Custom: string;
51
+ Tip: string;
52
+ "Total with tip": string;
53
+ "Enter tip amount": string;
48
54
  };
49
55
  export default _default;
@@ -71,6 +71,12 @@ declare const _default: {
71
71
  Discount: string;
72
72
  "Discount ({{rate}}%)": string;
73
73
  "Service Fee ({{rate}}%)": string;
74
+ "Add a tip": string;
75
+ None: string;
76
+ Custom: string;
77
+ Tip: string;
78
+ "Total with tip": string;
79
+ "Enter tip amount": string;
74
80
  };
75
81
  customer: {
76
82
  "Unknown address": string;
@@ -272,6 +278,12 @@ declare const _default: {
272
278
  "Discount ({{rate}}%)": string;
273
279
  Events: string;
274
280
  "Service Fee ({{rate}}%)": string;
281
+ "Add a tip": string;
282
+ None: string;
283
+ Custom: string;
284
+ Tip: string;
285
+ "Total with tip": string;
286
+ "Enter tip amount": string;
275
287
  };
276
288
  };
277
289
  ru: {
@@ -345,6 +357,12 @@ declare const _default: {
345
357
  Discount: string;
346
358
  "Discount ({{rate}}%)": string;
347
359
  "Service Fee ({{rate}}%)": string;
360
+ "Add a tip": string;
361
+ None: string;
362
+ Custom: string;
363
+ Tip: string;
364
+ "Total with tip": string;
365
+ "Enter tip amount": string;
348
366
  };
349
367
  customer: {
350
368
  "Unknown address": string;
@@ -464,6 +482,12 @@ declare const _default: {
464
482
  Discount: string;
465
483
  "Discount ({{rate}}%)": string;
466
484
  "Service Fee ({{rate}}%)": string;
485
+ "Add a tip": string;
486
+ None: string;
487
+ Custom: string;
488
+ Tip: string;
489
+ "Total with tip": string;
490
+ "Enter tip amount": string;
467
491
  };
468
492
  customer: {
469
493
  "Unknown address": string;
@@ -583,6 +607,12 @@ declare const _default: {
583
607
  Discount: string;
584
608
  "Discount ({{rate}}%)": string;
585
609
  "Service Fee ({{rate}}%)": string;
610
+ "Add a tip": string;
611
+ None: string;
612
+ Custom: string;
613
+ Tip: string;
614
+ "Total with tip": string;
615
+ "Enter tip amount": string;
586
616
  };
587
617
  customer: {
588
618
  "Unknown address": string;
@@ -702,6 +732,12 @@ declare const _default: {
702
732
  Discount: string;
703
733
  "Discount ({{rate}}%)": string;
704
734
  "Service Fee ({{rate}}%)": string;
735
+ "Add a tip": string;
736
+ None: string;
737
+ Custom: string;
738
+ Tip: string;
739
+ "Total with tip": string;
740
+ "Enter tip amount": string;
705
741
  };
706
742
  customer: {
707
743
  "Unknown address": string;
@@ -822,6 +858,12 @@ declare const _default: {
822
858
  Discount: string;
823
859
  "Discount ({{rate}}%)": string;
824
860
  "Service Fee ({{rate}}%)": string;
861
+ "Add a tip": string;
862
+ None: string;
863
+ Custom: string;
864
+ Tip: string;
865
+ "Total with tip": string;
866
+ "Enter tip amount": string;
825
867
  };
826
868
  customer: {
827
869
  "Unknown address": string;
@@ -943,6 +985,12 @@ declare const _default: {
943
985
  Discount: string;
944
986
  "Discount ({{rate}}%)": string;
945
987
  "Service Fee ({{rate}}%)": string;
988
+ "Add a tip": string;
989
+ None: string;
990
+ Custom: string;
991
+ Tip: string;
992
+ "Total with tip": string;
993
+ "Enter tip amount": string;
946
994
  };
947
995
  customer: {
948
996
  "Unknown address": string;
@@ -1064,6 +1112,12 @@ declare const _default: {
1064
1112
  Discount: string;
1065
1113
  "Discount ({{rate}}%)": string;
1066
1114
  "Service Fee ({{rate}}%)": string;
1115
+ "Add a tip": string;
1116
+ None: string;
1117
+ Custom: string;
1118
+ Tip: string;
1119
+ "Total with tip": string;
1120
+ "Enter tip amount": string;
1067
1121
  };
1068
1122
  customer: {
1069
1123
  "Unknown address": string;
@@ -69,6 +69,12 @@ declare const _default: {
69
69
  Discount: string;
70
70
  "Discount ({{rate}}%)": string;
71
71
  "Service Fee ({{rate}}%)": string;
72
+ "Add a tip": string;
73
+ None: string;
74
+ Custom: string;
75
+ Tip: string;
76
+ "Total with tip": string;
77
+ "Enter tip amount": string;
72
78
  };
73
79
  customer: {
74
80
  "Unknown address": string;
@@ -44,5 +44,11 @@ declare const _default: {
44
44
  Discount: string;
45
45
  "Discount ({{rate}}%)": string;
46
46
  "Service Fee ({{rate}}%)": string;
47
+ "Add a tip": string;
48
+ None: string;
49
+ Custom: string;
50
+ Tip: string;
51
+ "Total with tip": string;
52
+ "Enter tip amount": string;
47
53
  };
48
54
  export default _default;
@@ -70,6 +70,12 @@ declare const _default: {
70
70
  Discount: string;
71
71
  "Discount ({{rate}}%)": string;
72
72
  "Service Fee ({{rate}}%)": string;
73
+ "Add a tip": string;
74
+ None: string;
75
+ Custom: string;
76
+ Tip: string;
77
+ "Total with tip": string;
78
+ "Enter tip amount": string;
73
79
  };
74
80
  customer: {
75
81
  "Unknown address": string;
@@ -45,5 +45,11 @@ declare const _default: {
45
45
  Discount: string;
46
46
  "Discount ({{rate}}%)": string;
47
47
  "Service Fee ({{rate}}%)": string;
48
+ "Add a tip": string;
49
+ None: string;
50
+ Custom: string;
51
+ Tip: string;
52
+ "Total with tip": string;
53
+ "Enter tip amount": string;
48
54
  };
49
55
  export default _default;
@@ -70,6 +70,12 @@ declare const _default: {
70
70
  Discount: string;
71
71
  "Discount ({{rate}}%)": string;
72
72
  "Service Fee ({{rate}}%)": string;
73
+ "Add a tip": string;
74
+ None: string;
75
+ Custom: string;
76
+ Tip: string;
77
+ "Total with tip": string;
78
+ "Enter tip amount": string;
73
79
  };
74
80
  customer: {
75
81
  "Unknown address": string;
@@ -45,5 +45,11 @@ declare const _default: {
45
45
  Discount: string;
46
46
  "Discount ({{rate}}%)": string;
47
47
  "Service Fee ({{rate}}%)": string;
48
+ "Add a tip": string;
49
+ None: string;
50
+ Custom: string;
51
+ Tip: string;
52
+ "Total with tip": string;
53
+ "Enter tip amount": string;
48
54
  };
49
55
  export default _default;
@@ -69,6 +69,12 @@ declare const _default: {
69
69
  Discount: string;
70
70
  "Discount ({{rate}}%)": string;
71
71
  "Service Fee ({{rate}}%)": string;
72
+ "Add a tip": string;
73
+ None: string;
74
+ Custom: string;
75
+ Tip: string;
76
+ "Total with tip": string;
77
+ "Enter tip amount": string;
72
78
  };
73
79
  customer: {
74
80
  "Unknown address": string;
@@ -44,5 +44,11 @@ declare const _default: {
44
44
  Discount: string;
45
45
  "Discount ({{rate}}%)": string;
46
46
  "Service Fee ({{rate}}%)": string;
47
+ "Add a tip": string;
48
+ None: string;
49
+ Custom: string;
50
+ Tip: string;
51
+ "Total with tip": string;
52
+ "Enter tip amount": string;
47
53
  };
48
54
  export default _default;
@@ -69,6 +69,12 @@ declare const _default: {
69
69
  Discount: string;
70
70
  "Discount ({{rate}}%)": string;
71
71
  "Service Fee ({{rate}}%)": string;
72
+ "Add a tip": string;
73
+ None: string;
74
+ Custom: string;
75
+ Tip: string;
76
+ "Total with tip": string;
77
+ "Enter tip amount": string;
72
78
  };
73
79
  customer: {
74
80
  "Unknown address": string;
@@ -44,5 +44,11 @@ declare const _default: {
44
44
  Discount: string;
45
45
  "Discount ({{rate}}%)": string;
46
46
  "Service Fee ({{rate}}%)": string;
47
+ "Add a tip": string;
48
+ None: string;
49
+ Custom: string;
50
+ Tip: string;
51
+ "Total with tip": string;
52
+ "Enter tip amount": string;
47
53
  };
48
54
  export default _default;
@@ -7,3 +7,4 @@ export * from "../modules/view/utils";
7
7
  export * from "../modules/category/utils";
8
8
  export * from "../modules/menu/utils";
9
9
  export * from "../modules/user/utils";
10
+ export * from "../modules/pos/utils";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tabres/react",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "React Library by tabres.com",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",