@tabres/react 1.0.50 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AllergenIcons/AllergenIcons.d.ts +25 -0
- package/dist/components/AllergenIcons/AllergenIcons.test.d.ts +1 -0
- package/dist/components/AllergenIcons/icons/Buckwheat.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Celery.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Crustaceans.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Eggs.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Fish.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Gluten.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Lupin.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Milk.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Molluscs.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Mustard.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Peanuts.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Sesame.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Soy.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/Sulphites.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/TreeNuts.d.ts +3 -0
- package/dist/components/AllergenIcons/icons/index.d.ts +19 -0
- package/dist/components/AllergenIcons/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/index.esm.js +1 -1
- package/dist/models/index.esm.js.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/modules/product/models.d.ts +58 -0
- package/dist/models/modules/product/utils.d.ts +21 -1
- package/dist/models/services/translation/locales/az/index.d.ts +1 -0
- package/dist/models/services/translation/locales/az/order.d.ts +1 -0
- package/dist/models/services/translation/locales/es/index.d.ts +1 -0
- package/dist/models/services/translation/locales/es/order.d.ts +1 -0
- package/dist/models/services/translation/locales/et/index.d.ts +1 -0
- package/dist/models/services/translation/locales/et/order.d.ts +1 -0
- package/dist/models/services/translation/locales/hr/index.d.ts +1 -0
- package/dist/models/services/translation/locales/hr/order.d.ts +1 -0
- package/dist/models/services/translation/locales/index.d.ts +9 -0
- package/dist/models/services/translation/locales/nl/index.d.ts +1 -0
- package/dist/models/services/translation/locales/nl/order.d.ts +1 -0
- package/dist/models/services/translation/locales/pl/index.d.ts +1 -0
- package/dist/models/services/translation/locales/pl/order.d.ts +1 -0
- package/dist/models/services/translation/locales/pt/index.d.ts +1 -0
- package/dist/models/services/translation/locales/pt/order.d.ts +1 -0
- package/dist/models/services/translation/locales/ru/index.d.ts +1 -0
- package/dist/models/services/translation/locales/ru/order.d.ts +1 -0
- package/dist/models/services/translation/locales/tr/index.d.ts +1 -0
- package/dist/models/services/translation/locales/tr/order.d.ts +1 -0
- package/dist/modules/product/models.d.ts +58 -0
- package/dist/modules/product/utils.d.ts +21 -1
- package/dist/modules/product/utils.test.d.ts +1 -0
- package/dist/services/translation/locales/az/index.d.ts +1 -0
- package/dist/services/translation/locales/az/order.d.ts +1 -0
- package/dist/services/translation/locales/es/index.d.ts +1 -0
- package/dist/services/translation/locales/es/order.d.ts +1 -0
- package/dist/services/translation/locales/et/index.d.ts +1 -0
- package/dist/services/translation/locales/et/order.d.ts +1 -0
- package/dist/services/translation/locales/hr/index.d.ts +1 -0
- package/dist/services/translation/locales/hr/order.d.ts +1 -0
- package/dist/services/translation/locales/index.d.ts +9 -0
- package/dist/services/translation/locales/nl/index.d.ts +1 -0
- package/dist/services/translation/locales/nl/order.d.ts +1 -0
- package/dist/services/translation/locales/pl/index.d.ts +1 -0
- package/dist/services/translation/locales/pl/order.d.ts +1 -0
- package/dist/services/translation/locales/pt/index.d.ts +1 -0
- package/dist/services/translation/locales/pt/order.d.ts +1 -0
- package/dist/services/translation/locales/ru/index.d.ts +1 -0
- package/dist/services/translation/locales/ru/order.d.ts +1 -0
- package/dist/services/translation/locales/tr/index.d.ts +1 -0
- package/dist/services/translation/locales/tr/order.d.ts +1 -0
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/modules/product/models.d.ts +58 -0
- package/dist/utils/modules/product/utils.d.ts +21 -1
- package/dist/utils/services/translation/locales/az/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/az/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/es/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/es/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/et/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/et/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/hr/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/hr/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/index.d.ts +9 -0
- package/dist/utils/services/translation/locales/nl/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/nl/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/pl/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/pl/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/pt/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/pt/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/ru/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/ru/order.d.ts +1 -0
- package/dist/utils/services/translation/locales/tr/index.d.ts +1 -0
- package/dist/utils/services/translation/locales/tr/order.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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,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;
|
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";
|