@open-tender/store 1.1.4 → 1.1.5

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 (276) hide show
  1. package/LICENSE.md +21 -21
  2. package/README.md +3 -3
  3. package/dist/cjs/components/Allergen.d.ts +8 -0
  4. package/dist/cjs/components/Allergen.js +10 -0
  5. package/dist/cjs/components/Applied.d.ts +6 -0
  6. package/dist/cjs/components/Applied.js +10 -0
  7. package/dist/cjs/components/ButtonLink.d.ts +9 -0
  8. package/dist/cjs/components/ButtonLink.js +10 -0
  9. package/dist/cjs/components/Card.d.ts +7 -0
  10. package/dist/cjs/components/Card.js +10 -0
  11. package/dist/cjs/components/Cart.d.ts +7 -0
  12. package/dist/cjs/components/Cart.js +41 -0
  13. package/dist/cjs/components/CartItem.d.ts +11 -0
  14. package/dist/cjs/components/CartItem.js +31 -0
  15. package/dist/cjs/components/CartUpsellItem.d.ts +10 -0
  16. package/dist/cjs/components/CartUpsellItem.js +24 -0
  17. package/dist/cjs/components/CartUpsells.d.ts +6 -0
  18. package/dist/cjs/components/CartUpsells.js +25 -0
  19. package/dist/cjs/components/CategoryItem.d.ts +11 -0
  20. package/dist/cjs/components/CategoryItem.js +27 -0
  21. package/dist/cjs/components/CategoryNav.d.ts +7 -0
  22. package/dist/cjs/components/CategoryNav.js +26 -0
  23. package/dist/cjs/components/CategoryNavItem.d.ts +9 -0
  24. package/dist/cjs/components/CategoryNavItem.js +27 -0
  25. package/dist/cjs/components/CategoryNavOther.d.ts +9 -0
  26. package/dist/cjs/components/CategoryNavOther.js +19 -0
  27. package/dist/cjs/components/CheckTotals.d.ts +8 -0
  28. package/dist/cjs/components/CheckTotals.js +10 -0
  29. package/dist/cjs/components/Discount.d.ts +8 -0
  30. package/dist/cjs/components/Discount.js +12 -0
  31. package/dist/cjs/components/ErrorMessage.d.ts +9 -0
  32. package/dist/cjs/components/ErrorMessage.js +10 -0
  33. package/dist/cjs/components/Header.d.ts +9 -0
  34. package/dist/cjs/components/Header.js +26 -0
  35. package/dist/cjs/components/Ingredients.d.ts +10 -0
  36. package/dist/cjs/components/Ingredients.js +11 -0
  37. package/dist/cjs/components/Input.d.ts +11 -0
  38. package/dist/cjs/components/Input.js +22 -0
  39. package/dist/cjs/components/ItemGroup.d.ts +9 -0
  40. package/dist/cjs/components/ItemGroup.js +18 -0
  41. package/dist/cjs/components/ItemGroups.d.ts +11 -0
  42. package/dist/cjs/components/ItemGroups.js +25 -0
  43. package/dist/cjs/components/ItemOption.d.ts +11 -0
  44. package/dist/cjs/components/ItemOption.js +30 -0
  45. package/dist/cjs/components/ItemSelections.d.ts +11 -0
  46. package/dist/cjs/components/ItemSelections.js +23 -0
  47. package/dist/cjs/components/Label.d.ts +10 -0
  48. package/dist/cjs/components/Label.js +10 -0
  49. package/dist/cjs/components/Loader.d.ts +8 -0
  50. package/dist/cjs/components/Loader.js +10 -0
  51. package/dist/cjs/components/MadeForNotes.d.ts +14 -0
  52. package/dist/cjs/components/MadeForNotes.js +29 -0
  53. package/dist/cjs/components/MenuCategory.d.ts +3 -3
  54. package/dist/cjs/components/MenuCategory.js +5 -5
  55. package/dist/cjs/components/MenuOther.d.ts +12 -0
  56. package/dist/cjs/components/MenuOther.js +16 -0
  57. package/dist/cjs/components/Modal.d.ts +9 -0
  58. package/dist/cjs/components/Modal.js +16 -0
  59. package/dist/cjs/components/ModalContent.d.ts +14 -0
  60. package/dist/cjs/components/ModalContent.js +20 -0
  61. package/dist/cjs/components/ModalHeader.d.ts +8 -0
  62. package/dist/cjs/components/ModalHeader.js +10 -0
  63. package/dist/cjs/components/NutritionalInfo.d.ts +11 -0
  64. package/dist/cjs/components/NutritionalInfo.js +18 -0
  65. package/dist/cjs/components/Option.d.ts +11 -0
  66. package/dist/cjs/components/Option.js +24 -0
  67. package/dist/cjs/components/OrderCard.d.ts +9 -0
  68. package/dist/cjs/components/OrderCard.js +56 -0
  69. package/dist/cjs/components/PointsReward.d.ts +10 -0
  70. package/dist/cjs/components/PointsReward.js +62 -0
  71. package/dist/cjs/components/PointsRewards.d.ts +6 -0
  72. package/dist/cjs/components/PointsRewards.js +24 -0
  73. package/dist/cjs/components/PromoCode.d.ts +7 -0
  74. package/dist/cjs/components/PromoCode.js +52 -0
  75. package/dist/cjs/components/Quantity.d.ts +13 -0
  76. package/dist/cjs/components/Quantity.js +19 -0
  77. package/dist/cjs/components/Reward.d.ts +10 -0
  78. package/dist/cjs/components/Reward.js +39 -0
  79. package/dist/cjs/components/Rewards.d.ts +10 -0
  80. package/dist/cjs/components/Rewards.js +15 -0
  81. package/dist/cjs/components/SignIn.d.ts +11 -0
  82. package/dist/cjs/components/SignIn.js +37 -0
  83. package/dist/cjs/components/SignInButton.d.ts +8 -0
  84. package/dist/cjs/components/SignInButton.js +41 -0
  85. package/dist/cjs/components/SignInCheckout.d.ts +9 -0
  86. package/dist/cjs/components/SignInCheckout.js +38 -0
  87. package/dist/cjs/components/SignInOptions.d.ts +7 -0
  88. package/dist/cjs/components/SignInOptions.js +28 -0
  89. package/dist/cjs/components/SignInPhone.d.ts +7 -0
  90. package/dist/cjs/components/SignInPhone.js +59 -0
  91. package/dist/cjs/components/SignInQr.d.ts +7 -0
  92. package/dist/cjs/components/SignInQr.js +61 -0
  93. package/dist/cjs/components/SuccessMessage.d.ts +9 -0
  94. package/dist/cjs/components/SuccessMessage.js +10 -0
  95. package/dist/cjs/components/Tag.d.ts +8 -0
  96. package/dist/cjs/components/Tag.js +10 -0
  97. package/dist/cjs/components/TextArea.d.ts +11 -0
  98. package/dist/cjs/components/TextArea.js +22 -0
  99. package/dist/cjs/components/UpsellItem.d.ts +10 -0
  100. package/dist/cjs/components/UpsellItem.js +24 -0
  101. package/dist/cjs/components/Upsells.d.ts +8 -0
  102. package/dist/cjs/components/Upsells.js +25 -0
  103. package/dist/cjs/components/index.d.ts +47 -1
  104. package/dist/cjs/components/index.js +93 -1
  105. package/dist/cjs/config/index.js +1 -1
  106. package/dist/cjs/hooks/useBarcode.js +1 -1
  107. package/dist/cjs/hooks/useChipDNATender/useChipDNATender.js +1 -1
  108. package/dist/cjs/hooks/useEmployee.js +8 -4
  109. package/dist/cjs/hooks/useGiftCardBalance.js +1 -1
  110. package/dist/cjs/hooks/useOrderValidate.js +1 -1
  111. package/dist/cjs/hooks/usePunch.js +1 -1
  112. package/dist/cjs/slices/alerts.js +1 -1
  113. package/dist/cjs/slices/arrivals.js +32 -36
  114. package/dist/cjs/slices/checkout.d.ts +1 -1
  115. package/dist/cjs/slices/checkout.js +329 -351
  116. package/dist/cjs/slices/config.js +79 -81
  117. package/dist/cjs/slices/customer.js +17 -19
  118. package/dist/cjs/slices/customerIdentify.js +16 -18
  119. package/dist/cjs/slices/deals.js +16 -18
  120. package/dist/cjs/slices/discounts.js +19 -21
  121. package/dist/cjs/slices/errorAlerts.d.ts +1 -1
  122. package/dist/cjs/slices/errorAlerts.js +34 -38
  123. package/dist/cjs/slices/kds.js +253 -275
  124. package/dist/cjs/slices/kiosk.d.ts +1 -1
  125. package/dist/cjs/slices/kiosk.js +50 -52
  126. package/dist/cjs/slices/menu.js +24 -26
  127. package/dist/cjs/slices/menuPages.js +16 -18
  128. package/dist/cjs/slices/notifications.js +1 -1
  129. package/dist/cjs/slices/offlineAuths.js +32 -36
  130. package/dist/cjs/slices/order.js +25 -27
  131. package/dist/cjs/slices/pos.js +59 -65
  132. package/dist/cjs/slices/punches.d.ts +1 -1
  133. package/dist/cjs/slices/punches.js +16 -18
  134. package/dist/cjs/slices/refund.js +54 -60
  135. package/dist/cjs/slices/settings.js +56 -62
  136. package/dist/cjs/slices/surcharges.js +19 -21
  137. package/dist/cjs/slices/taxes.js +19 -21
  138. package/dist/cjs/utils/punches.js +1 -1
  139. package/dist/esm/components/Allergen.d.ts +8 -0
  140. package/dist/esm/components/Allergen.js +8 -0
  141. package/dist/esm/components/Applied.d.ts +6 -0
  142. package/dist/esm/components/Applied.js +8 -0
  143. package/dist/esm/components/ButtonLink.d.ts +9 -0
  144. package/dist/esm/components/ButtonLink.js +8 -0
  145. package/dist/esm/components/Card.d.ts +7 -0
  146. package/dist/esm/components/Card.js +8 -0
  147. package/dist/esm/components/Cart.d.ts +7 -0
  148. package/dist/esm/components/Cart.js +38 -0
  149. package/dist/esm/components/CartItem.d.ts +11 -0
  150. package/dist/esm/components/CartItem.js +28 -0
  151. package/dist/esm/components/CartUpsellItem.d.ts +10 -0
  152. package/dist/esm/components/CartUpsellItem.js +22 -0
  153. package/dist/esm/components/CartUpsells.d.ts +6 -0
  154. package/dist/esm/components/CartUpsells.js +22 -0
  155. package/dist/esm/components/CategoryItem.d.ts +11 -0
  156. package/dist/esm/components/CategoryItem.js +25 -0
  157. package/dist/esm/components/CategoryNav.d.ts +7 -0
  158. package/dist/esm/components/CategoryNav.js +23 -0
  159. package/dist/esm/components/CategoryNavItem.d.ts +9 -0
  160. package/dist/esm/components/CategoryNavItem.js +25 -0
  161. package/dist/esm/components/CategoryNavOther.d.ts +9 -0
  162. package/dist/esm/components/CategoryNavOther.js +17 -0
  163. package/dist/esm/components/CheckTotals.d.ts +8 -0
  164. package/dist/esm/components/CheckTotals.js +8 -0
  165. package/dist/esm/components/Discount.d.ts +8 -0
  166. package/dist/esm/components/Discount.js +10 -0
  167. package/dist/esm/components/ErrorMessage.d.ts +9 -0
  168. package/dist/esm/components/ErrorMessage.js +8 -0
  169. package/dist/esm/components/Header.d.ts +9 -0
  170. package/dist/esm/components/Header.js +23 -0
  171. package/dist/esm/components/Ingredients.d.ts +10 -0
  172. package/dist/esm/components/Ingredients.js +9 -0
  173. package/dist/esm/components/Input.d.ts +11 -0
  174. package/dist/esm/components/Input.js +20 -0
  175. package/dist/esm/components/ItemGroup.d.ts +9 -0
  176. package/dist/esm/components/ItemGroup.js +16 -0
  177. package/dist/esm/components/ItemGroups.d.ts +11 -0
  178. package/dist/esm/components/ItemGroups.js +22 -0
  179. package/dist/esm/components/ItemOption.d.ts +11 -0
  180. package/dist/esm/components/ItemOption.js +28 -0
  181. package/dist/esm/components/ItemSelections.d.ts +11 -0
  182. package/dist/esm/components/ItemSelections.js +20 -0
  183. package/dist/esm/components/Label.d.ts +10 -0
  184. package/dist/esm/components/Label.js +8 -0
  185. package/dist/esm/components/Loader.d.ts +8 -0
  186. package/dist/esm/components/Loader.js +8 -0
  187. package/dist/esm/components/MadeForNotes.d.ts +14 -0
  188. package/dist/esm/components/MadeForNotes.js +26 -0
  189. package/dist/esm/components/MenuCategory.d.ts +3 -3
  190. package/dist/esm/components/MenuCategory.js +1 -1
  191. package/dist/esm/components/MenuOther.d.ts +12 -0
  192. package/dist/esm/components/MenuOther.js +14 -0
  193. package/dist/esm/components/Modal.d.ts +9 -0
  194. package/dist/esm/components/Modal.js +13 -0
  195. package/dist/esm/components/ModalContent.d.ts +14 -0
  196. package/dist/esm/components/ModalContent.js +18 -0
  197. package/dist/esm/components/ModalHeader.d.ts +8 -0
  198. package/dist/esm/components/ModalHeader.js +8 -0
  199. package/dist/esm/components/NutritionalInfo.d.ts +11 -0
  200. package/dist/esm/components/NutritionalInfo.js +16 -0
  201. package/dist/esm/components/Option.d.ts +11 -0
  202. package/dist/esm/components/Option.js +22 -0
  203. package/dist/esm/components/OrderCard.d.ts +9 -0
  204. package/dist/esm/components/OrderCard.js +53 -0
  205. package/dist/esm/components/PointsReward.d.ts +10 -0
  206. package/dist/esm/components/PointsReward.js +60 -0
  207. package/dist/esm/components/PointsRewards.d.ts +6 -0
  208. package/dist/esm/components/PointsRewards.js +21 -0
  209. package/dist/esm/components/PromoCode.d.ts +7 -0
  210. package/dist/esm/components/PromoCode.js +49 -0
  211. package/dist/esm/components/Quantity.d.ts +13 -0
  212. package/dist/esm/components/Quantity.js +17 -0
  213. package/dist/esm/components/Reward.d.ts +10 -0
  214. package/dist/esm/components/Reward.js +36 -0
  215. package/dist/esm/components/Rewards.d.ts +10 -0
  216. package/dist/esm/components/Rewards.js +12 -0
  217. package/dist/esm/components/SignIn.d.ts +11 -0
  218. package/dist/esm/components/SignIn.js +35 -0
  219. package/dist/esm/components/SignInButton.d.ts +8 -0
  220. package/dist/esm/components/SignInButton.js +39 -0
  221. package/dist/esm/components/SignInCheckout.d.ts +9 -0
  222. package/dist/esm/components/SignInCheckout.js +36 -0
  223. package/dist/esm/components/SignInOptions.d.ts +7 -0
  224. package/dist/esm/components/SignInOptions.js +25 -0
  225. package/dist/esm/components/SignInPhone.d.ts +7 -0
  226. package/dist/esm/components/SignInPhone.js +56 -0
  227. package/dist/esm/components/SignInQr.d.ts +7 -0
  228. package/dist/esm/components/SignInQr.js +59 -0
  229. package/dist/esm/components/SuccessMessage.d.ts +9 -0
  230. package/dist/esm/components/SuccessMessage.js +8 -0
  231. package/dist/esm/components/Tag.d.ts +8 -0
  232. package/dist/esm/components/Tag.js +8 -0
  233. package/dist/esm/components/TextArea.d.ts +11 -0
  234. package/dist/esm/components/TextArea.js +20 -0
  235. package/dist/esm/components/UpsellItem.d.ts +10 -0
  236. package/dist/esm/components/UpsellItem.js +22 -0
  237. package/dist/esm/components/Upsells.d.ts +8 -0
  238. package/dist/esm/components/Upsells.js +22 -0
  239. package/dist/esm/components/index.d.ts +47 -1
  240. package/dist/esm/components/index.js +47 -1
  241. package/dist/esm/config/index.js +1 -1
  242. package/dist/esm/hooks/useBarcode.js +1 -1
  243. package/dist/esm/hooks/useChipDNATender/useChipDNATender.js +1 -1
  244. package/dist/esm/hooks/useEmployee.js +9 -5
  245. package/dist/esm/hooks/useGiftCardBalance.js +1 -1
  246. package/dist/esm/hooks/useOrderValidate.js +1 -1
  247. package/dist/esm/hooks/usePunch.js +1 -1
  248. package/dist/esm/slices/alerts.js +1 -1
  249. package/dist/esm/slices/arrivals.js +32 -36
  250. package/dist/esm/slices/checkout.d.ts +1 -1
  251. package/dist/esm/slices/checkout.js +329 -351
  252. package/dist/esm/slices/config.js +79 -81
  253. package/dist/esm/slices/customer.js +17 -19
  254. package/dist/esm/slices/customerIdentify.js +16 -18
  255. package/dist/esm/slices/deals.js +16 -18
  256. package/dist/esm/slices/discounts.js +19 -21
  257. package/dist/esm/slices/errorAlerts.d.ts +1 -1
  258. package/dist/esm/slices/errorAlerts.js +34 -38
  259. package/dist/esm/slices/kds.js +253 -275
  260. package/dist/esm/slices/kiosk.d.ts +1 -1
  261. package/dist/esm/slices/kiosk.js +50 -52
  262. package/dist/esm/slices/menu.js +24 -26
  263. package/dist/esm/slices/menuPages.js +16 -18
  264. package/dist/esm/slices/notifications.js +1 -1
  265. package/dist/esm/slices/offlineAuths.js +32 -36
  266. package/dist/esm/slices/order.js +25 -27
  267. package/dist/esm/slices/pos.js +59 -65
  268. package/dist/esm/slices/punches.d.ts +1 -1
  269. package/dist/esm/slices/punches.js +16 -18
  270. package/dist/esm/slices/refund.js +54 -60
  271. package/dist/esm/slices/settings.js +56 -62
  272. package/dist/esm/slices/surcharges.js +19 -21
  273. package/dist/esm/slices/taxes.js +19 -21
  274. package/dist/esm/utils/punches.js +1 -1
  275. package/package.json +82 -75
  276. package/dist/.DS_Store +0 -0
@@ -0,0 +1,25 @@
1
+ import { __assign } from "tslib";
2
+ import { makeOrderItem, rehydrateOrderItem, useOrderItem } from '@open-tender/utils';
3
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
4
+ import { selectCartCounts, selectKioskConfig, selectMenu, setCurrentItem } from '../slices';
5
+ var CategoryItem = function (_a) {
6
+ var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, children = _a.children;
7
+ var dispatch = useAppDispatch();
8
+ var categoryItem = useAppSelector(selectKioskConfig).categoryItem;
9
+ var soldOut = useAppSelector(selectMenu).soldOut;
10
+ var cartCounts = useAppSelector(selectCartCounts);
11
+ var hasPoints = false;
12
+ var displaySettings = {};
13
+ var _b = displaySettings || {}, _c = _b.calories, showCals = _c === void 0 ? false : _c, _d = _b.tags, showTags = _d === void 0 ? false : _d, _e = _b.allergens, showAllergens = _e === void 0 ? false : _e;
14
+ var showDesc = 'SHOW';
15
+ var orderItem = favorite
16
+ ? __assign(__assign({}, rehydrateOrderItem(item, favorite.item)), { index: -1 }) : makeOrderItem(item, undefined, soldOut, undefined, hasPoints);
17
+ var cartItem = useOrderItem(orderItem, favorite, allergenAlerts, cartCounts, showCals, showTags, showAllergens, showDesc);
18
+ var browse = function () {
19
+ dispatch(setCurrentItem(cartItem));
20
+ navigate('/menu/item');
21
+ };
22
+ var handlers = { browse: browse };
23
+ return children({ item: cartItem, config: categoryItem, handlers: handlers });
24
+ };
25
+ export default CategoryItem;
@@ -0,0 +1,7 @@
1
+ import { CategoryNavProps } from '@open-tender/ui';
2
+ import React, { ReactNode } from 'react';
3
+ declare const CategoryNav: ({ children, navigate }: {
4
+ children: (props: CategoryNavProps) => ReactNode;
5
+ navigate: (route: string) => void;
6
+ }) => React.ReactNode;
7
+ export default CategoryNav;
@@ -0,0 +1,23 @@
1
+ import { CategoryNavItem, CategoryNavOther } from '@open-tender/ui';
2
+ import React from 'react';
3
+ import { useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig, selectMenu } from '../slices';
5
+ import { default as CategoryNavItemContainer } from './CategoryNavItem';
6
+ import { default as CategoryNavOtherContainer } from './CategoryNavOther';
7
+ var CategoryNav = function (_a) {
8
+ var children = _a.children, navigate = _a.navigate;
9
+ var categoryNav = useAppSelector(selectKioskConfig).categoryNav;
10
+ var _b = useAppSelector(selectMenu), categories = _b.categories, featured = _b.featured, favorites = _b.favorites, recents = _b.recents;
11
+ var renderCategoryNavOther = function (title, path) { return (React.createElement(CategoryNavOtherContainer, { navigate: navigate, title: title, path: path, children: CategoryNavOther })); };
12
+ var renderCategoryNavItem = function (item) { return (React.createElement(CategoryNavItemContainer, { navigate: navigate, category: item, children: CategoryNavItem })); };
13
+ return children({
14
+ config: categoryNav,
15
+ categories: categories,
16
+ featured: featured,
17
+ favorites: favorites,
18
+ recents: recents,
19
+ renderCategoryNavOther: renderCategoryNavOther,
20
+ renderCategoryNavItem: renderCategoryNavItem
21
+ });
22
+ };
23
+ export default CategoryNav;
@@ -0,0 +1,9 @@
1
+ import { MenuCategory } from '@open-tender/types';
2
+ import { CategoryNavItemProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
+ declare const CategoryNavItem: ({ category, children, navigate }: {
5
+ category: MenuCategory;
6
+ navigate: (route: string) => void;
7
+ children: (props: CategoryNavItemProps) => ReactNode;
8
+ }) => ReactNode;
9
+ export default CategoryNavItem;
@@ -0,0 +1,25 @@
1
+ import { makeImageUrl } from '@open-tender/ui';
2
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
3
+ import { selectCurrentCategory, selectKioskConfig, setCurrentCategory } from '../slices';
4
+ var CategoryNavItem = function (_a) {
5
+ var category = _a.category, children = _a.children, navigate = _a.navigate;
6
+ var dispatch = useAppDispatch();
7
+ var current = useAppSelector(selectCurrentCategory);
8
+ var isCurrent = (current === null || current === void 0 ? void 0 : current.id) === category.id;
9
+ var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
10
+ var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
11
+ var name = category.name;
12
+ var imageUrl = makeImageUrl(category);
13
+ var browse = function () {
14
+ dispatch(setCurrentCategory(category));
15
+ navigate('/menu/category');
16
+ };
17
+ var handlers = { browse: browse };
18
+ return children({
19
+ config: config,
20
+ handlers: handlers,
21
+ title: name,
22
+ imageUrl: imageUrl
23
+ });
24
+ };
25
+ export default CategoryNavItem;
@@ -0,0 +1,9 @@
1
+ import { CategoryNavOtherProps } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const CategoryNavOther: ({ title, path, navigate, children }: {
4
+ title: string;
5
+ path: string;
6
+ navigate: (route: string) => void;
7
+ children: (props: CategoryNavOtherProps) => ReactNode;
8
+ }) => ReactNode;
9
+ export default CategoryNavOther;
@@ -0,0 +1,17 @@
1
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
2
+ import { selectCurrentSection, selectKioskConfig, setCurrentCategory } from '../slices';
3
+ var CategoryNavOther = function (_a) {
4
+ var title = _a.title, path = _a.path, navigate = _a.navigate, children = _a.children;
5
+ var dispatch = useAppDispatch();
6
+ var _b = useAppSelector(selectKioskConfig), categoryNavItem = _b.categoryNavItem, categoryNavItemSelected = _b.categoryNavItemSelected;
7
+ var currentSection = useAppSelector(selectCurrentSection);
8
+ var isCurrent = path === currentSection;
9
+ var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
10
+ var browse = function () {
11
+ dispatch(setCurrentCategory(null));
12
+ navigate(path);
13
+ };
14
+ var handlers = { browse: browse };
15
+ return children({ config: config, handlers: handlers, title: title, imageUrl: null });
16
+ };
17
+ export default CategoryNavOther;
@@ -0,0 +1,8 @@
1
+ import { Order } from '@open-tender/types';
2
+ import { CheckTotalsProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
+ declare const CheckTotals: ({ check, children }: {
5
+ check: Order;
6
+ children: (props: CheckTotalsProps) => ReactNode;
7
+ }) => ReactNode;
8
+ export default CheckTotals;
@@ -0,0 +1,8 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var CheckTotals = function (_a) {
4
+ var check = _a.check, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).checkTotals;
6
+ return children({ config: config, check: check });
7
+ };
8
+ export default CheckTotals;
@@ -0,0 +1,8 @@
1
+ import { Discount as DiscountType } from '@open-tender/types';
2
+ import { DiscountProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
+ declare const Discount: ({ discount, children }: {
5
+ discount: DiscountType;
6
+ children: (props: DiscountProps) => ReactNode;
7
+ }) => ReactNode;
8
+ export default Discount;
@@ -0,0 +1,10 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var Discount = function (_a) {
4
+ var discount = _a.discount, children = _a.children;
5
+ var _b = useAppSelector(selectKioskConfig), config = _b.discount, cardConfig = _b.card;
6
+ if (!config)
7
+ return null;
8
+ return children({ config: config, discount: discount, cardConfig: cardConfig });
9
+ };
10
+ export default Discount;
@@ -0,0 +1,9 @@
1
+ import { ErrorMessageProps, Styles } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const ErrorMessage: ({ content, icon, style, children }: {
4
+ content: string;
5
+ icon?: ReactNode;
6
+ style?: Styles;
7
+ children: (props: ErrorMessageProps) => ReactNode;
8
+ }) => ReactNode;
9
+ export default ErrorMessage;
@@ -0,0 +1,8 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var ErrorMessage = function (_a) {
4
+ var content = _a.content, icon = _a.icon, style = _a.style, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).errorMessage;
6
+ return children({ config: config, icon: icon, style: style, children: content });
7
+ };
8
+ export default ErrorMessage;
@@ -0,0 +1,9 @@
1
+ import { HeaderProps } from '@open-tender/ui';
2
+ import React, { ReactNode } from 'react';
3
+ declare const Header: ({ to, pathname, navigate, children }: {
4
+ to?: string;
5
+ pathname: string;
6
+ navigate: (route: string) => void;
7
+ children: (props: HeaderProps) => ReactNode;
8
+ }) => React.ReactNode;
9
+ export default Header;
@@ -0,0 +1,23 @@
1
+ import { SignInButton } from '@open-tender/ui';
2
+ import React from 'react';
3
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig, toggleSidebar } from '../slices';
5
+ import { default as SignInButtonContainer } from './SignInButton';
6
+ var Header = function (_a) {
7
+ var to = _a.to, pathname = _a.pathname, navigate = _a.navigate, children = _a.children;
8
+ var dispatch = useAppDispatch();
9
+ var header = (useAppSelector(selectKioskConfig) || {}).header;
10
+ var back = function () {
11
+ if (to)
12
+ navigate(to);
13
+ };
14
+ var open = function () {
15
+ dispatch(toggleSidebar());
16
+ };
17
+ var handlers = to ? { back: back, open: open } : null;
18
+ var renderSignInButton = function () { return (React.createElement(SignInButtonContainer, { pathname: pathname, navigate: navigate, children: SignInButton })); };
19
+ if (!header)
20
+ return null;
21
+ return children({ config: header, handlers: handlers, renderSignInButton: renderSignInButton });
22
+ };
23
+ export default Header;
@@ -0,0 +1,10 @@
1
+ import { IngredientsProps } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const Ingredients: ({ title, subtitle, ingredients, close, children }: {
4
+ title: string;
5
+ subtitle?: string;
6
+ ingredients: string;
7
+ close: () => void;
8
+ children: (props: IngredientsProps) => ReactNode;
9
+ }) => ReactNode;
10
+ export default Ingredients;
@@ -0,0 +1,9 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var Ingredients = function (_a) {
4
+ var title = _a.title, subtitle = _a.subtitle, ingredients = _a.ingredients, close = _a.close, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).ingredients;
6
+ var handlers = { close: close };
7
+ return children({ config: config, handlers: handlers, title: title, subtitle: subtitle, ingredients: ingredients });
8
+ };
9
+ export default Ingredients;
@@ -0,0 +1,11 @@
1
+ import { InputProps, Styles } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const Input: ({ label, value, setValue, isRequired, style, children }: {
4
+ label?: string;
5
+ value: string;
6
+ setValue: (value: string) => void;
7
+ isRequired?: boolean;
8
+ style?: Styles;
9
+ children: (props: InputProps) => ReactNode;
10
+ }) => ReactNode;
11
+ export default Input;
@@ -0,0 +1,20 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var Input = function (_a) {
4
+ var label = _a.label, value = _a.value, setValue = _a.setValue, isRequired = _a.isRequired, style = _a.style, children = _a.children;
5
+ var _b = useAppSelector(selectKioskConfig), config = _b.input, labelConfig = _b.label;
6
+ var update = function (evt) {
7
+ setValue(evt.target.value);
8
+ };
9
+ var handlers = { update: update };
10
+ return children({
11
+ config: config,
12
+ handlers: handlers,
13
+ label: label,
14
+ value: value,
15
+ isRequired: isRequired,
16
+ style: style,
17
+ labelConfig: labelConfig
18
+ });
19
+ };
20
+ export default Input;
@@ -0,0 +1,9 @@
1
+ import { CartItemGroup } from '@open-tender/types';
2
+ import { ItemGroupProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
+ declare const ItemGroup: ({ group, content, children }: {
5
+ group: CartItemGroup;
6
+ content: ReactNode;
7
+ children: (props: ItemGroupProps) => ReactNode;
8
+ }) => ReactNode;
9
+ export default ItemGroup;
@@ -0,0 +1,16 @@
1
+ import { useModifierGroup } from '@open-tender/utils';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var ItemGroup = function (_a) {
5
+ var group = _a.group, content = _a.content, children = _a.children;
6
+ var _b = useAppSelector(selectKioskConfig), config = _b.itemGroup, errorMessageConfig = _b.errorMessage, successMessageConfig = _b.successMessage;
7
+ var modifierGroup = useModifierGroup(group);
8
+ return children({
9
+ config: config,
10
+ group: modifierGroup,
11
+ children: content,
12
+ errorMessageConfig: errorMessageConfig,
13
+ successMessageConfig: successMessageConfig
14
+ });
15
+ };
16
+ export default ItemGroup;
@@ -0,0 +1,11 @@
1
+ import { CartItemGroups, CartLevels } from '@open-tender/types';
2
+ import { Handlers, ItemGroupsProps } from '@open-tender/ui';
3
+ import React, { ReactNode } from 'react';
4
+ declare const ItemGroups: ({ handlers, groups, levels, excludeSize, children }: {
5
+ handlers: Handlers;
6
+ groups: CartItemGroups;
7
+ levels: CartLevels;
8
+ excludeSize?: boolean;
9
+ children: (props: ItemGroupsProps) => ReactNode;
10
+ }) => React.ReactNode;
11
+ export default ItemGroups;
@@ -0,0 +1,22 @@
1
+ import { ItemOption, ItemGroup } from '@open-tender/ui';
2
+ import React from 'react';
3
+ import { useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig } from '../slices';
5
+ import { default as ItemGroupContainer } from './ItemGroup';
6
+ import { default as ItemOptionContainer } from './ItemOption';
7
+ var ItemGroups = function (_a) {
8
+ var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, _b = _a.excludeSize, excludeSize = _b === void 0 ? true : _b, children = _a.children;
9
+ var config = useAppSelector(selectKioskConfig).itemGroups;
10
+ var renderItemOption = function (group, option) { return (React.createElement(ItemOptionContainer, { levels: levels, handlers: handlers, group: group, option: option, children: ItemOption })); };
11
+ var renderItemGroup = function (group, content) { return (React.createElement(ItemGroupContainer, { group: group, content: content, children: ItemGroup })); };
12
+ if (!config)
13
+ return null;
14
+ return children({
15
+ config: config,
16
+ groups: groups,
17
+ excludeSize: excludeSize,
18
+ renderItemOption: renderItemOption,
19
+ renderItemGroup: renderItemGroup
20
+ });
21
+ };
22
+ export default ItemGroups;
@@ -0,0 +1,11 @@
1
+ import { CartItemGroup, CartItemOption, CartLevels } from '@open-tender/types';
2
+ import { Handlers, ItemOptionProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
+ declare const ItemOption: ({ handlers, group, option, levels, children }: {
5
+ handlers: Handlers;
6
+ group: CartItemGroup;
7
+ option: CartItemOption;
8
+ levels: CartLevels;
9
+ children: (props: ItemOptionProps) => ReactNode;
10
+ }) => ReactNode;
11
+ export default ItemOption;
@@ -0,0 +1,28 @@
1
+ import { useModifier } from '@open-tender/utils';
2
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig, setCurrentOption } from '../slices';
4
+ var ItemOption = function (_a) {
5
+ var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, children = _a.children;
6
+ var dispatch = useAppDispatch();
7
+ var _b = useAppSelector(selectKioskConfig), config = _b.itemOption, cardConfig = _b.card;
8
+ var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
9
+ var allergenAlerts = [];
10
+ var modifier = useModifier(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
11
+ var showNested = function () {
12
+ // dispatch(setCurrentOption(modifier))
13
+ var currentOption = {
14
+ groupId: group.id,
15
+ optionId: option.id,
16
+ levels: modifier.updatedLevels
17
+ };
18
+ dispatch(setCurrentOption(currentOption));
19
+ };
20
+ return children({
21
+ config: config,
22
+ handlers: { showNested: showNested },
23
+ group: group,
24
+ option: modifier,
25
+ cardConfig: cardConfig
26
+ });
27
+ };
28
+ export default ItemOption;
@@ -0,0 +1,11 @@
1
+ import { CartItemGroups, CartLevels } from '@open-tender/types';
2
+ import { Handlers, ItemSelectionsProps } from '@open-tender/ui';
3
+ import React, { ReactNode } from 'react';
4
+ declare const ItemSelections: ({ handlers, groups, levels, isIncomplete, children }: {
5
+ handlers: Handlers;
6
+ groups: CartItemGroups;
7
+ levels: CartLevels;
8
+ isIncomplete: boolean;
9
+ children: (props: ItemSelectionsProps) => ReactNode;
10
+ }) => React.ReactNode;
11
+ export default ItemSelections;
@@ -0,0 +1,20 @@
1
+ import { ErrorMessage, ItemOption } from '@open-tender/ui';
2
+ import React from 'react';
3
+ import { useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig } from '../slices';
5
+ import { default as ErrorMessageContainer } from './ErrorMessage';
6
+ import { default as ItemOptionContainer } from './ItemOption';
7
+ var ItemSelections = function (_a) {
8
+ var handlers = _a.handlers, groups = _a.groups, levels = _a.levels, isIncomplete = _a.isIncomplete, children = _a.children;
9
+ var config = useAppSelector(selectKioskConfig).itemSelections;
10
+ var renderErrorMessage = function (icon, children) { return (React.createElement(ErrorMessageContainer, { icon: icon, content: children, children: ErrorMessage })); };
11
+ var renderItemOption = function (group, option) { return (React.createElement(ItemOptionContainer, { levels: levels, handlers: handlers, group: group, option: option, children: ItemOption })); };
12
+ return children({
13
+ config: config,
14
+ groups: groups,
15
+ isIncomplete: isIncomplete,
16
+ renderErrorMessage: renderErrorMessage,
17
+ renderItemOption: renderItemOption
18
+ });
19
+ };
20
+ export default ItemSelections;
@@ -0,0 +1,10 @@
1
+ import { LabelProps, Styles } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const Label: ({ content, label, isRequired, style, children }: {
4
+ content: ReactNode;
5
+ label?: string;
6
+ isRequired?: boolean;
7
+ style?: Styles;
8
+ children: (props: LabelProps) => ReactNode;
9
+ }) => ReactNode;
10
+ export default Label;
@@ -0,0 +1,8 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var Label = function (_a) {
4
+ var content = _a.content, label = _a.label, isRequired = _a.isRequired, style = _a.style, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).label;
6
+ return children({ config: config, label: label, isRequired: isRequired, style: style, children: content });
7
+ };
8
+ export default Label;
@@ -0,0 +1,8 @@
1
+ import { LoaderProps, Styles } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const Loader: ({ text, style, children }: {
4
+ text?: string;
5
+ style?: Styles;
6
+ children: (props: LoaderProps) => ReactNode;
7
+ }) => ReactNode;
8
+ export default Loader;
@@ -0,0 +1,8 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var Loader = function (_a) {
4
+ var text = _a.text, style = _a.style, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).loader;
6
+ return children({ config: config, text: text, style: style });
7
+ };
8
+ export default Loader;
@@ -0,0 +1,14 @@
1
+ import { MadeForNotesProps } from '@open-tender/ui';
2
+ import React, { ReactNode } from 'react';
3
+ declare const MadeForNotes: ({ subtitle, hasMadeFor, madeFor, setMadeFor, hasNotes, notes, setNotes, close, children }: {
4
+ subtitle: string;
5
+ hasMadeFor: boolean;
6
+ madeFor: string | null;
7
+ setMadeFor: (madeFor: string) => void;
8
+ hasNotes: boolean;
9
+ notes: string | null;
10
+ setNotes: (notes: string) => void;
11
+ close: () => void;
12
+ children: (props: MadeForNotesProps) => ReactNode;
13
+ }) => React.ReactNode;
14
+ export default MadeForNotes;
@@ -0,0 +1,26 @@
1
+ import { Input } from '@open-tender/ui';
2
+ import React from 'react';
3
+ import { useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig } from '../slices';
5
+ import { default as InputContainer } from './Input';
6
+ import { default as TextAreaContainer } from './TextArea';
7
+ var MadeForNotes = function (_a) {
8
+ var subtitle = _a.subtitle, hasMadeFor = _a.hasMadeFor, madeFor = _a.madeFor, setMadeFor = _a.setMadeFor, hasNotes = _a.hasNotes, notes = _a.notes, setNotes = _a.setNotes, close = _a.close, children = _a.children;
9
+ var _b = useAppSelector(selectKioskConfig), config = _b.madeForNotes, modalContentConfig = _b.modalContent;
10
+ var handlers = { submit: close };
11
+ var renderInput = function (label, value, isRequired, style) { return (React.createElement(InputContainer, { label: label, setValue: setMadeFor, value: value, isRequired: isRequired, style: style, children: Input })); };
12
+ var renderTextArea = function (label, value, isRequired, style) { return (React.createElement(TextAreaContainer, { label: label, setValue: setNotes, value: value, isRequired: isRequired, style: style, children: Input })); };
13
+ return children({
14
+ config: config,
15
+ handlers: handlers,
16
+ subtitle: subtitle,
17
+ hasMadeFor: hasMadeFor,
18
+ madeFor: madeFor,
19
+ hasNotes: hasNotes,
20
+ notes: notes,
21
+ modalContentConfig: modalContentConfig,
22
+ renderInput: renderInput,
23
+ renderTextArea: renderTextArea
24
+ });
25
+ };
26
+ export default MadeForNotes;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { MenuCategory as MenuCategoryType } from '@open-tender/types';
3
2
  import { MenuCategoryProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
4
  declare const MenuCategory: ({ category, navigate, children }: {
5
5
  category: MenuCategoryType;
6
6
  navigate: (route: string) => void;
7
- children: (props: MenuCategoryProps) => React.ReactNode;
8
- }) => import("react").ReactNode;
7
+ children: (props: MenuCategoryProps) => ReactNode;
8
+ }) => ReactNode;
9
9
  export default MenuCategory;
@@ -1,5 +1,5 @@
1
- import { useKioskImageUrl } from '../hooks';
2
1
  import { useAppDispatch, useAppSelector } from '../app/hooks';
2
+ import { useKioskImageUrl } from '../hooks';
3
3
  import { selectKioskConfig, setCurrentCategory } from '../slices';
4
4
  var MenuCategory = function (_a) {
5
5
  var category = _a.category, navigate = _a.navigate, children = _a.children;
@@ -0,0 +1,12 @@
1
+ import { MenuItem } from '@open-tender/types';
2
+ import { MenuOtherProps } from '@open-tender/ui';
3
+ import { ReactNode } from 'react';
4
+ declare const MenuOther: ({ title, subtitle, path, item, children, navigate }: {
5
+ title: string;
6
+ subtitle: string;
7
+ path: string;
8
+ item: MenuItem;
9
+ navigate: (route: string) => void;
10
+ children: (props: MenuOtherProps) => ReactNode;
11
+ }) => ReactNode;
12
+ export default MenuOther;
@@ -0,0 +1,14 @@
1
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig, setCurrentCategory } from '../slices';
3
+ var MenuOther = function (_a) {
4
+ var title = _a.title, subtitle = _a.subtitle, path = _a.path, item = _a.item, children = _a.children, navigate = _a.navigate;
5
+ var dispatch = useAppDispatch();
6
+ var menuCategory = useAppSelector(selectKioskConfig).menuCategory;
7
+ var browse = function () {
8
+ dispatch(setCurrentCategory(null));
9
+ navigate(path);
10
+ };
11
+ var handlers = { browse: browse };
12
+ return children({ config: menuCategory, handlers: handlers, title: title, subtitle: subtitle, item: item });
13
+ };
14
+ export default MenuOther;
@@ -0,0 +1,9 @@
1
+ import { ModalProps } from '@open-tender/ui';
2
+ import React, { ReactNode } from 'react';
3
+ declare const Modal: ({ show, close, content, children }: {
4
+ show: boolean;
5
+ close: () => void;
6
+ content: ReactNode;
7
+ children: (props: ModalProps) => ReactNode;
8
+ }) => React.JSX.Element | null;
9
+ export default Modal;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { CSSTransition, TransitionGroup } from 'react-transition-group';
3
+ import { useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig } from '../slices';
5
+ var Modal = function (_a) {
6
+ var show = _a.show, close = _a.close, content = _a.content, children = _a.children;
7
+ var config = useAppSelector(selectKioskConfig).modal;
8
+ var handlers = { close: close };
9
+ if (!config)
10
+ return null;
11
+ return (React.createElement(TransitionGroup, { component: null }, show ? (React.createElement(CSSTransition, { key: "modal", classNames: "md", timeout: { enter: 250, exit: 250 } }, children({ config: config, handlers: handlers, children: content }))) : null));
12
+ };
13
+ export default Modal;
@@ -0,0 +1,14 @@
1
+ import { ModalContentProps, Styles } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const ModalContent: ({ title, subtitle, content, submit, submitText, cancel, cancelText, style, children }: {
4
+ title: string;
5
+ subtitle?: string | null;
6
+ content: ReactNode;
7
+ submit?: () => void;
8
+ submitText?: string;
9
+ cancel: () => void;
10
+ cancelText?: string;
11
+ style?: Styles;
12
+ children: (props: ModalContentProps) => ReactNode;
13
+ }) => ReactNode;
14
+ export default ModalContent;
@@ -0,0 +1,18 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var ModalContent = function (_a) {
4
+ var title = _a.title, subtitle = _a.subtitle, content = _a.content, submit = _a.submit, submitText = _a.submitText, cancel = _a.cancel, cancelText = _a.cancelText, style = _a.style, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).modalContent;
6
+ return children({
7
+ config: config,
8
+ title: title,
9
+ subtitle: subtitle,
10
+ children: content,
11
+ submit: submit,
12
+ submitText: submitText,
13
+ cancel: cancel,
14
+ cancelText: cancelText,
15
+ style: style
16
+ });
17
+ };
18
+ export default ModalContent;
@@ -0,0 +1,8 @@
1
+ import { ModalHeaderProps } from '@open-tender/ui';
2
+ import { ReactNode } from 'react';
3
+ declare const ModalHeader: ({ title, subtitle, children }: {
4
+ title: string;
5
+ subtitle?: string;
6
+ children: (props: ModalHeaderProps) => ReactNode;
7
+ }) => ReactNode;
8
+ export default ModalHeader;
@@ -0,0 +1,8 @@
1
+ import { useAppSelector } from '../app/hooks';
2
+ import { selectKioskConfig } from '../slices';
3
+ var ModalHeader = function (_a) {
4
+ var title = _a.title, subtitle = _a.subtitle, children = _a.children;
5
+ var config = useAppSelector(selectKioskConfig).modalHeader;
6
+ return children({ config: config, title: title, subtitle: subtitle });
7
+ };
8
+ export default ModalHeader;