@tabres/react 1.0.50 → 1.0.52

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 (105) hide show
  1. package/dist/components/AllergenIcons/AllergenIcons.d.ts +25 -0
  2. package/dist/components/AllergenIcons/AllergenIcons.test.d.ts +1 -0
  3. package/dist/components/AllergenIcons/icons/Buckwheat.d.ts +3 -0
  4. package/dist/components/AllergenIcons/icons/Celery.d.ts +3 -0
  5. package/dist/components/AllergenIcons/icons/Crustaceans.d.ts +3 -0
  6. package/dist/components/AllergenIcons/icons/Eggs.d.ts +3 -0
  7. package/dist/components/AllergenIcons/icons/Fish.d.ts +3 -0
  8. package/dist/components/AllergenIcons/icons/Gluten.d.ts +3 -0
  9. package/dist/components/AllergenIcons/icons/Lupin.d.ts +3 -0
  10. package/dist/components/AllergenIcons/icons/Milk.d.ts +3 -0
  11. package/dist/components/AllergenIcons/icons/Molluscs.d.ts +3 -0
  12. package/dist/components/AllergenIcons/icons/Mustard.d.ts +3 -0
  13. package/dist/components/AllergenIcons/icons/Peanuts.d.ts +3 -0
  14. package/dist/components/AllergenIcons/icons/Sesame.d.ts +3 -0
  15. package/dist/components/AllergenIcons/icons/Soy.d.ts +3 -0
  16. package/dist/components/AllergenIcons/icons/Sulphites.d.ts +3 -0
  17. package/dist/components/AllergenIcons/icons/TreeNuts.d.ts +3 -0
  18. package/dist/components/AllergenIcons/icons/index.d.ts +19 -0
  19. package/dist/components/AllergenIcons/index.d.ts +2 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.esm.js +1 -1
  22. package/dist/index.esm.js.map +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/models/index.esm.js +1 -1
  26. package/dist/models/index.esm.js.map +1 -1
  27. package/dist/models/index.js +1 -1
  28. package/dist/models/index.js.map +1 -1
  29. package/dist/models/modules/order/constants.d.ts +4 -1
  30. package/dist/models/modules/order/models.d.ts +12 -2
  31. package/dist/models/modules/product/models.d.ts +58 -0
  32. package/dist/models/modules/product/utils.d.ts +21 -1
  33. package/dist/models/services/translation/locales/az/index.d.ts +7 -1
  34. package/dist/models/services/translation/locales/az/order.d.ts +7 -1
  35. package/dist/models/services/translation/locales/es/index.d.ts +7 -1
  36. package/dist/models/services/translation/locales/es/order.d.ts +7 -1
  37. package/dist/models/services/translation/locales/et/index.d.ts +7 -1
  38. package/dist/models/services/translation/locales/et/order.d.ts +7 -1
  39. package/dist/models/services/translation/locales/hr/index.d.ts +7 -1
  40. package/dist/models/services/translation/locales/hr/order.d.ts +7 -1
  41. package/dist/models/services/translation/locales/index.d.ts +63 -9
  42. package/dist/models/services/translation/locales/nl/index.d.ts +7 -1
  43. package/dist/models/services/translation/locales/nl/order.d.ts +7 -1
  44. package/dist/models/services/translation/locales/pl/index.d.ts +7 -1
  45. package/dist/models/services/translation/locales/pl/order.d.ts +7 -1
  46. package/dist/models/services/translation/locales/pt/index.d.ts +7 -1
  47. package/dist/models/services/translation/locales/pt/order.d.ts +7 -1
  48. package/dist/models/services/translation/locales/ru/index.d.ts +7 -1
  49. package/dist/models/services/translation/locales/ru/order.d.ts +7 -1
  50. package/dist/models/services/translation/locales/tr/index.d.ts +7 -1
  51. package/dist/models/services/translation/locales/tr/order.d.ts +7 -1
  52. package/dist/modules/order/constants.d.ts +4 -1
  53. package/dist/modules/order/models.d.ts +12 -2
  54. package/dist/modules/product/models.d.ts +58 -0
  55. package/dist/modules/product/utils.d.ts +21 -1
  56. package/dist/modules/product/utils.test.d.ts +1 -0
  57. package/dist/services/translation/locales/az/index.d.ts +7 -1
  58. package/dist/services/translation/locales/az/order.d.ts +7 -1
  59. package/dist/services/translation/locales/es/index.d.ts +7 -1
  60. package/dist/services/translation/locales/es/order.d.ts +7 -1
  61. package/dist/services/translation/locales/et/index.d.ts +7 -1
  62. package/dist/services/translation/locales/et/order.d.ts +7 -1
  63. package/dist/services/translation/locales/hr/index.d.ts +7 -1
  64. package/dist/services/translation/locales/hr/order.d.ts +7 -1
  65. package/dist/services/translation/locales/index.d.ts +63 -9
  66. package/dist/services/translation/locales/nl/index.d.ts +7 -1
  67. package/dist/services/translation/locales/nl/order.d.ts +7 -1
  68. package/dist/services/translation/locales/pl/index.d.ts +7 -1
  69. package/dist/services/translation/locales/pl/order.d.ts +7 -1
  70. package/dist/services/translation/locales/pt/index.d.ts +7 -1
  71. package/dist/services/translation/locales/pt/order.d.ts +7 -1
  72. package/dist/services/translation/locales/ru/index.d.ts +7 -1
  73. package/dist/services/translation/locales/ru/order.d.ts +7 -1
  74. package/dist/services/translation/locales/tr/index.d.ts +7 -1
  75. package/dist/services/translation/locales/tr/order.d.ts +7 -1
  76. package/dist/styles/ui.css +1 -1
  77. package/dist/styles/ui.css.map +1 -1
  78. package/dist/utils/index.esm.js +1 -1
  79. package/dist/utils/index.esm.js.map +1 -1
  80. package/dist/utils/index.js +1 -1
  81. package/dist/utils/index.js.map +1 -1
  82. package/dist/utils/modules/order/constants.d.ts +4 -1
  83. package/dist/utils/modules/order/models.d.ts +12 -2
  84. package/dist/utils/modules/product/models.d.ts +58 -0
  85. package/dist/utils/modules/product/utils.d.ts +21 -1
  86. package/dist/utils/services/translation/locales/az/index.d.ts +7 -1
  87. package/dist/utils/services/translation/locales/az/order.d.ts +7 -1
  88. package/dist/utils/services/translation/locales/es/index.d.ts +7 -1
  89. package/dist/utils/services/translation/locales/es/order.d.ts +7 -1
  90. package/dist/utils/services/translation/locales/et/index.d.ts +7 -1
  91. package/dist/utils/services/translation/locales/et/order.d.ts +7 -1
  92. package/dist/utils/services/translation/locales/hr/index.d.ts +7 -1
  93. package/dist/utils/services/translation/locales/hr/order.d.ts +7 -1
  94. package/dist/utils/services/translation/locales/index.d.ts +63 -9
  95. package/dist/utils/services/translation/locales/nl/index.d.ts +7 -1
  96. package/dist/utils/services/translation/locales/nl/order.d.ts +7 -1
  97. package/dist/utils/services/translation/locales/pl/index.d.ts +7 -1
  98. package/dist/utils/services/translation/locales/pl/order.d.ts +7 -1
  99. package/dist/utils/services/translation/locales/pt/index.d.ts +7 -1
  100. package/dist/utils/services/translation/locales/pt/order.d.ts +7 -1
  101. package/dist/utils/services/translation/locales/ru/index.d.ts +7 -1
  102. package/dist/utils/services/translation/locales/ru/order.d.ts +7 -1
  103. package/dist/utils/services/translation/locales/tr/index.d.ts +7 -1
  104. package/dist/utils/services/translation/locales/tr/order.d.ts +7 -1
  105. package/package.json +13 -13
@@ -0,0 +1,25 @@
1
+ import { SIZE } from "@sorocraft/ui";
2
+ import { models as productModels } from "src/modules/product";
3
+ interface Props {
4
+ product: Pick<productModels.Product, "allergenDetails">;
5
+ language?: string;
6
+ /** Reveal each allergen's name on hover/tap. Off in the menu listing. */
7
+ withTooltip?: boolean;
8
+ size?: SIZE;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * The allergen row shown on a product. The glyphs inherit `currentColor`, so
13
+ * the caller decides the colour by styling the wrapper — that keeps them
14
+ * readable both on a business's custom product-card background and on the
15
+ * white details modal. Renders nothing when the product declares no allergens,
16
+ * so menus that never fill them in are untouched.
17
+ *
18
+ * Names come from the product payload, not from this package's locale files:
19
+ * the API translates its own allergen catalog into every language the business
20
+ * publishes, which is the only way wording stays in step with a catalog that
21
+ * grows server-side — and the only way it covers the ~110 platform languages
22
+ * rather than the handful this package bundles.
23
+ */
24
+ declare const AllergenIcons: ({ product, language, withTooltip, size, className, }: Props) => import("react").JSX.Element;
25
+ export default AllergenIcons;
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom";
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Buckwheat: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Buckwheat;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Celery: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Celery;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Crustaceans: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Crustaceans;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Eggs: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Eggs;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Fish: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Fish;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Gluten: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Gluten;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Lupin: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Lupin;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Milk: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Milk;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Molluscs: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Molluscs;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Mustard: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Mustard;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Peanuts: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Peanuts;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Sesame: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Sesame;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Soy: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Soy;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Sulphites: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default Sulphites;
@@ -0,0 +1,3 @@
1
+ import type { SVGProps } from "react";
2
+ declare const TreeNuts: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
3
+ export default TreeNuts;
@@ -0,0 +1,19 @@
1
+ import { IconType } from "@sorocraft/ui";
2
+ import { models as productModels } from "src/modules/product";
3
+ /**
4
+ * Line-art glyph per allergen code, drawn on the same 24x24 grid and stroke
5
+ * weight as the @sorocraft/ui icon set (which ships no allergen icons of its
6
+ * own). Every path uses `stroke="currentColor"`, so an icon takes the text
7
+ * colour of whatever it sits in — that is what lets the same glyph work on a
8
+ * business's custom product-card background and inside the details modal.
9
+ */
10
+ export declare const ALLERGEN_ICONS: Record<productModels.Allergen, IconType>;
11
+ /**
12
+ * The glyph for an allergen code, falling back to a generic alert mark for a
13
+ * code the API has that this package has no drawing for yet. The fallback is
14
+ * the point: the guest sees "this product declares something" and gets the
15
+ * name from the label, instead of the allergen disappearing until someone
16
+ * ships an icon. `AlertCircle` comes from the same icon set, so it sits at the
17
+ * same weight as the real glyphs.
18
+ */
19
+ export declare const getAllergenIcon: (code: productModels.AllergenCode) => IconType;
@@ -0,0 +1,2 @@
1
+ export { default } from "./AllergenIcons";
2
+ export { ALLERGEN_ICONS } from "./icons";
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ export { default as OrderMethods } from "./components/PublicMenu/OrderMethods";
8
8
  export { default as OrderPaymentSummary } from "./components/PublicMenu/OrderPaymentSummary";
9
9
  export { default as OrderTableUI } from "./components/PublicMenu/OrderDrawer/OrderTable/OrderTableUI";
10
10
  export { default as OrderFAB } from "./components/PublicMenu/OrderFAB";
11
+ export { default as AllergenIcons } from "./components/AllergenIcons";
11
12
  export * from "./store/order";