@open-tender/store 1.1.4 → 1.1.6

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 +11 -0
  5. package/dist/cjs/components/Applied.d.ts +6 -0
  6. package/dist/cjs/components/Applied.js +11 -0
  7. package/dist/cjs/components/ButtonLink.d.ts +9 -0
  8. package/dist/cjs/components/ButtonLink.js +11 -0
  9. package/dist/cjs/components/Card.d.ts +7 -0
  10. package/dist/cjs/components/Card.js +11 -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 +25 -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 +28 -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 +20 -0
  27. package/dist/cjs/components/CheckTotals.d.ts +8 -0
  28. package/dist/cjs/components/CheckTotals.js +11 -0
  29. package/dist/cjs/components/Discount.d.ts +8 -0
  30. package/dist/cjs/components/Discount.js +13 -0
  31. package/dist/cjs/components/ErrorMessage.d.ts +9 -0
  32. package/dist/cjs/components/ErrorMessage.js +11 -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 +12 -0
  37. package/dist/cjs/components/Input.d.ts +11 -0
  38. package/dist/cjs/components/Input.js +23 -0
  39. package/dist/cjs/components/ItemGroup.d.ts +9 -0
  40. package/dist/cjs/components/ItemGroup.js +19 -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 +31 -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 +11 -0
  49. package/dist/cjs/components/Loader.d.ts +8 -0
  50. package/dist/cjs/components/Loader.js +11 -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 +7 -6
  55. package/dist/cjs/components/MenuOther.d.ts +12 -0
  56. package/dist/cjs/components/MenuOther.js +17 -0
  57. package/dist/cjs/components/Modal.d.ts +9 -0
  58. package/dist/cjs/components/Modal.js +17 -0
  59. package/dist/cjs/components/ModalContent.d.ts +14 -0
  60. package/dist/cjs/components/ModalContent.js +21 -0
  61. package/dist/cjs/components/ModalHeader.d.ts +8 -0
  62. package/dist/cjs/components/ModalHeader.js +11 -0
  63. package/dist/cjs/components/NutritionalInfo.d.ts +11 -0
  64. package/dist/cjs/components/NutritionalInfo.js +19 -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 +48 -1
  104. package/dist/cjs/components/index.js +95 -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 +9 -0
  141. package/dist/esm/components/Applied.d.ts +6 -0
  142. package/dist/esm/components/Applied.js +9 -0
  143. package/dist/esm/components/ButtonLink.d.ts +9 -0
  144. package/dist/esm/components/ButtonLink.js +9 -0
  145. package/dist/esm/components/Card.d.ts +7 -0
  146. package/dist/esm/components/Card.js +9 -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 +23 -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 +26 -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 +18 -0
  163. package/dist/esm/components/CheckTotals.d.ts +8 -0
  164. package/dist/esm/components/CheckTotals.js +9 -0
  165. package/dist/esm/components/Discount.d.ts +8 -0
  166. package/dist/esm/components/Discount.js +11 -0
  167. package/dist/esm/components/ErrorMessage.d.ts +9 -0
  168. package/dist/esm/components/ErrorMessage.js +9 -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 +10 -0
  173. package/dist/esm/components/Input.d.ts +11 -0
  174. package/dist/esm/components/Input.js +21 -0
  175. package/dist/esm/components/ItemGroup.d.ts +9 -0
  176. package/dist/esm/components/ItemGroup.js +17 -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 +29 -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 +9 -0
  185. package/dist/esm/components/Loader.d.ts +8 -0
  186. package/dist/esm/components/Loader.js +9 -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 +3 -2
  191. package/dist/esm/components/MenuOther.d.ts +12 -0
  192. package/dist/esm/components/MenuOther.js +15 -0
  193. package/dist/esm/components/Modal.d.ts +9 -0
  194. package/dist/esm/components/Modal.js +14 -0
  195. package/dist/esm/components/ModalContent.d.ts +14 -0
  196. package/dist/esm/components/ModalContent.js +19 -0
  197. package/dist/esm/components/ModalHeader.d.ts +8 -0
  198. package/dist/esm/components/ModalHeader.js +9 -0
  199. package/dist/esm/components/NutritionalInfo.d.ts +11 -0
  200. package/dist/esm/components/NutritionalInfo.js +17 -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 +48 -1
  240. package/dist/esm/components/index.js +48 -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,26 @@
1
+ import { __assign } from "tslib";
2
+ import { CategoryItem as CategoryItemView } from '@open-tender/ui';
3
+ import { makeOrderItem, rehydrateOrderItem, useOrderItem } from '@open-tender/utils';
4
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
5
+ import { selectCartCounts, selectKioskConfig, selectMenu, setCurrentItem } from '../slices';
6
+ var CategoryItem = function (_a) {
7
+ var item = _a.item, favorite = _a.favorite, allergenAlerts = _a.allergenAlerts, navigate = _a.navigate, _b = _a.children, children = _b === void 0 ? CategoryItemView : _b;
8
+ var dispatch = useAppDispatch();
9
+ var categoryItem = useAppSelector(selectKioskConfig).categoryItem;
10
+ var soldOut = useAppSelector(selectMenu).soldOut;
11
+ var cartCounts = useAppSelector(selectCartCounts);
12
+ var hasPoints = false;
13
+ var displaySettings = {};
14
+ var _c = displaySettings || {}, _d = _c.calories, showCals = _d === void 0 ? false : _d, _e = _c.tags, showTags = _e === void 0 ? false : _e, _f = _c.allergens, showAllergens = _f === void 0 ? false : _f;
15
+ var showDesc = 'SHOW';
16
+ var orderItem = favorite
17
+ ? __assign(__assign({}, rehydrateOrderItem(item, favorite.item)), { index: -1 }) : makeOrderItem(item, undefined, soldOut, undefined, hasPoints);
18
+ var cartItem = useOrderItem(orderItem, favorite, allergenAlerts, cartCounts, showCals, showTags, showAllergens, showDesc);
19
+ var browse = function () {
20
+ dispatch(setCurrentItem(cartItem));
21
+ navigate('/menu/item');
22
+ };
23
+ var handlers = { browse: browse };
24
+ return children({ item: cartItem, config: categoryItem, handlers: handlers });
25
+ };
26
+ 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, CategoryNav as CategoryNavView } 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 _b = _a.children, children = _b === void 0 ? CategoryNavView : _b, navigate = _a.navigate;
9
+ var categoryNav = useAppSelector(selectKioskConfig).categoryNav;
10
+ var _c = useAppSelector(selectMenu), categories = _c.categories, featured = _c.featured, favorites = _c.favorites, recents = _c.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, CategoryNavItem as CategoryNavItemView } 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, _b = _a.children, children = _b === void 0 ? CategoryNavItemView : _b, 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 _c = useAppSelector(selectKioskConfig), categoryNavItem = _c.categoryNavItem, categoryNavItemSelected = _c.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,18 @@
1
+ import { CategoryNavOther as CategoryNavOtherView } from '@open-tender/ui';
2
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
3
+ import { selectCurrentSection, selectKioskConfig, setCurrentCategory } from '../slices';
4
+ var CategoryNavOther = function (_a) {
5
+ var title = _a.title, path = _a.path, navigate = _a.navigate, _b = _a.children, children = _b === void 0 ? CategoryNavOtherView : _b;
6
+ var dispatch = useAppDispatch();
7
+ var _c = useAppSelector(selectKioskConfig), categoryNavItem = _c.categoryNavItem, categoryNavItemSelected = _c.categoryNavItemSelected;
8
+ var currentSection = useAppSelector(selectCurrentSection);
9
+ var isCurrent = path === currentSection;
10
+ var config = isCurrent ? categoryNavItemSelected : categoryNavItem;
11
+ var browse = function () {
12
+ dispatch(setCurrentCategory(null));
13
+ navigate(path);
14
+ };
15
+ var handlers = { browse: browse };
16
+ return children({ config: config, handlers: handlers, title: title, imageUrl: null });
17
+ };
18
+ 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,9 @@
1
+ import { CheckTotals as CheckTotalsView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var CheckTotals = function (_a) {
5
+ var check = _a.check, _b = _a.children, children = _b === void 0 ? CheckTotalsView : _b;
6
+ var config = useAppSelector(selectKioskConfig).checkTotals;
7
+ return children({ config: config, check: check });
8
+ };
9
+ 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,11 @@
1
+ import { Discount as DiscountView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var Discount = function (_a) {
5
+ var discount = _a.discount, _b = _a.children, children = _b === void 0 ? DiscountView : _b;
6
+ var _c = useAppSelector(selectKioskConfig), config = _c.discount, cardConfig = _c.card;
7
+ if (!config)
8
+ return null;
9
+ return children({ config: config, discount: discount, cardConfig: cardConfig });
10
+ };
11
+ 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,9 @@
1
+ import { ErrorMessage as ErrorMessageView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var ErrorMessage = function (_a) {
5
+ var content = _a.content, icon = _a.icon, style = _a.style, _b = _a.children, children = _b === void 0 ? ErrorMessageView : _b;
6
+ var config = useAppSelector(selectKioskConfig).errorMessage;
7
+ return children({ config: config, icon: icon, style: style, children: content });
8
+ };
9
+ 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, Header as HeaderView } 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, _b = _a.children, children = _b === void 0 ? HeaderView : _b;
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,10 @@
1
+ import { Ingredients as IngredientsView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var Ingredients = function (_a) {
5
+ var title = _a.title, subtitle = _a.subtitle, ingredients = _a.ingredients, close = _a.close, _b = _a.children, children = _b === void 0 ? IngredientsView : _b;
6
+ var config = useAppSelector(selectKioskConfig).ingredients;
7
+ var handlers = { close: close };
8
+ return children({ config: config, handlers: handlers, title: title, subtitle: subtitle, ingredients: ingredients });
9
+ };
10
+ 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,21 @@
1
+ import { Input as InputView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var Input = function (_a) {
5
+ var label = _a.label, value = _a.value, setValue = _a.setValue, isRequired = _a.isRequired, style = _a.style, _b = _a.children, children = _b === void 0 ? InputView : _b;
6
+ var _c = useAppSelector(selectKioskConfig), config = _c.input, labelConfig = _c.label;
7
+ var update = function (evt) {
8
+ setValue(evt.target.value);
9
+ };
10
+ var handlers = { update: update };
11
+ return children({
12
+ config: config,
13
+ handlers: handlers,
14
+ label: label,
15
+ value: value,
16
+ isRequired: isRequired,
17
+ style: style,
18
+ labelConfig: labelConfig
19
+ });
20
+ };
21
+ 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,17 @@
1
+ import { ItemGroup as ItemGroupView } from '@open-tender/ui';
2
+ import { useModifierGroup } from '@open-tender/utils';
3
+ import { useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig } from '../slices';
5
+ var ItemGroup = function (_a) {
6
+ var group = _a.group, content = _a.content, _b = _a.children, children = _b === void 0 ? ItemGroupView : _b;
7
+ var _c = useAppSelector(selectKioskConfig), config = _c.itemGroup, errorMessageConfig = _c.errorMessage, successMessageConfig = _c.successMessage;
8
+ var modifierGroup = useModifierGroup(group);
9
+ return children({
10
+ config: config,
11
+ group: modifierGroup,
12
+ children: content,
13
+ errorMessageConfig: errorMessageConfig,
14
+ successMessageConfig: successMessageConfig
15
+ });
16
+ };
17
+ 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, ItemGroups as ItemGroupsView } 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, _c = _a.children, children = _c === void 0 ? ItemGroupsView : _c;
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,29 @@
1
+ import { ItemOption as ItemOptionView } from '@open-tender/ui';
2
+ import { useModifier } from '@open-tender/utils';
3
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
4
+ import { selectKioskConfig, setCurrentOption } from '../slices';
5
+ var ItemOption = function (_a) {
6
+ var handlers = _a.handlers, group = _a.group, option = _a.option, levels = _a.levels, _b = _a.children, children = _b === void 0 ? ItemOptionView : _b;
7
+ var dispatch = useAppDispatch();
8
+ var _c = useAppSelector(selectKioskConfig), config = _c.itemOption, cardConfig = _c.card;
9
+ var toggleOption = handlers.toggleOption, incrementOption = handlers.incrementOption, decrementOption = handlers.decrementOption, setOptionQuantity = handlers.setOptionQuantity;
10
+ var allergenAlerts = [];
11
+ var modifier = useModifier(group, option, levels, toggleOption, incrementOption, decrementOption, setOptionQuantity, allergenAlerts);
12
+ var showNested = function () {
13
+ // dispatch(setCurrentOption(modifier))
14
+ var currentOption = {
15
+ groupId: group.id,
16
+ optionId: option.id,
17
+ levels: modifier.updatedLevels
18
+ };
19
+ dispatch(setCurrentOption(currentOption));
20
+ };
21
+ return children({
22
+ config: config,
23
+ handlers: { showNested: showNested },
24
+ group: group,
25
+ option: modifier,
26
+ cardConfig: cardConfig
27
+ });
28
+ };
29
+ 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, ItemSelections as ItemSelectionsView } 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, _b = _a.children, children = _b === void 0 ? ItemSelectionsView : _b;
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,9 @@
1
+ import { Label as LabelView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var Label = function (_a) {
5
+ var content = _a.content, label = _a.label, isRequired = _a.isRequired, style = _a.style, _b = _a.children, children = _b === void 0 ? LabelView : _b;
6
+ var config = useAppSelector(selectKioskConfig).label;
7
+ return children({ config: config, label: label, isRequired: isRequired, style: style, children: content });
8
+ };
9
+ 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,9 @@
1
+ import { Loader as LoaderView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var Loader = function (_a) {
5
+ var text = _a.text, style = _a.style, _b = _a.children, children = _b === void 0 ? LoaderView : _b;
6
+ var config = useAppSelector(selectKioskConfig).loader;
7
+ return children({ config: config, text: text, style: style });
8
+ };
9
+ 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, MadeForNotes as MadeForNotesView } 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, _b = _a.children, children = _b === void 0 ? MadeForNotesView : _b;
9
+ var _c = useAppSelector(selectKioskConfig), config = _c.madeForNotes, modalContentConfig = _c.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,8 +1,9 @@
1
- import { useKioskImageUrl } from '../hooks';
1
+ import { MenuCategory as MenuCategoryView } from '@open-tender/ui';
2
2
  import { useAppDispatch, useAppSelector } from '../app/hooks';
3
+ import { useKioskImageUrl } from '../hooks';
3
4
  import { selectKioskConfig, setCurrentCategory } from '../slices';
4
5
  var MenuCategory = function (_a) {
5
- var category = _a.category, navigate = _a.navigate, children = _a.children;
6
+ var category = _a.category, navigate = _a.navigate, _b = _a.children, children = _b === void 0 ? MenuCategoryView : _b;
6
7
  var dispatch = useAppDispatch();
7
8
  var config = useAppSelector(selectKioskConfig).menuCategory;
8
9
  var imageUrl = useKioskImageUrl(category);
@@ -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,15 @@
1
+ import { MenuOther as MenuOtherView } from '@open-tender/ui';
2
+ import { useAppDispatch, useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig, setCurrentCategory } from '../slices';
4
+ var MenuOther = function (_a) {
5
+ var title = _a.title, subtitle = _a.subtitle, path = _a.path, item = _a.item, _b = _a.children, children = _b === void 0 ? MenuOtherView : _b, navigate = _a.navigate;
6
+ var dispatch = useAppDispatch();
7
+ var menuCategory = useAppSelector(selectKioskConfig).menuCategory;
8
+ var browse = function () {
9
+ dispatch(setCurrentCategory(null));
10
+ navigate(path);
11
+ };
12
+ var handlers = { browse: browse };
13
+ return children({ config: menuCategory, handlers: handlers, title: title, subtitle: subtitle, item: item });
14
+ };
15
+ 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,14 @@
1
+ import { Modal as ModalView } from '@open-tender/ui';
2
+ import React from 'react';
3
+ import { CSSTransition, TransitionGroup } from 'react-transition-group';
4
+ import { useAppSelector } from '../app/hooks';
5
+ import { selectKioskConfig } from '../slices';
6
+ var Modal = function (_a) {
7
+ var show = _a.show, close = _a.close, content = _a.content, _b = _a.children, children = _b === void 0 ? ModalView : _b;
8
+ var config = useAppSelector(selectKioskConfig).modal;
9
+ var handlers = { close: close };
10
+ if (!config)
11
+ return null;
12
+ 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));
13
+ };
14
+ 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,19 @@
1
+ import { ModalContent as ModalContentView } from '@open-tender/ui';
2
+ import { useAppSelector } from '../app/hooks';
3
+ import { selectKioskConfig } from '../slices';
4
+ var ModalContent = function (_a) {
5
+ 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, _b = _a.children, children = _b === void 0 ? ModalContentView : _b;
6
+ var config = useAppSelector(selectKioskConfig).modalContent;
7
+ return children({
8
+ config: config,
9
+ title: title,
10
+ subtitle: subtitle,
11
+ children: content,
12
+ submit: submit,
13
+ submitText: submitText,
14
+ cancel: cancel,
15
+ cancelText: cancelText,
16
+ style: style
17
+ });
18
+ };
19
+ export default ModalContent;