@restaround/react 1.0.1

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.
@@ -0,0 +1,6 @@
1
+ import * as branchModels from "src/models/branch";
2
+ interface Props {
3
+ branches: branchModels.Branch[];
4
+ }
5
+ declare const Branches: ({ branches }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default Branches;
@@ -0,0 +1 @@
1
+ export { default } from "./Branches";
@@ -0,0 +1,9 @@
1
+ import * as categoryModels from "src/models/category";
2
+ interface Props {
3
+ categories: categoryModels.Category[];
4
+ language: string;
5
+ selectedCategoryId: number;
6
+ onSelectCategory: (id: number) => void;
7
+ }
8
+ declare const Categories: ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default Categories;
@@ -0,0 +1,11 @@
1
+ import * as branchModels from "src/models/branch";
2
+ interface Props {
3
+ branch?: branchModels.Branch;
4
+ coverImage?: string;
5
+ logoImage?: string;
6
+ defaultCover?: string;
7
+ defaultLogo?: string;
8
+ name: string;
9
+ }
10
+ declare const Header: ({ branch, coverImage, logoImage, name, defaultCover, defaultLogo, }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default Header;
@@ -0,0 +1 @@
1
+ export { default } from "./Header";
@@ -0,0 +1,14 @@
1
+ import { RefObject } from "react";
2
+ import { DivElementMap } from "@sorocraft/ui";
3
+ import * as productModels from "src/models/product";
4
+ import * as categoryModels from "src/models/category";
5
+ interface Props {
6
+ products: productModels.Product[];
7
+ categories: categoryModels.Category[];
8
+ productBlocksRef: RefObject<DivElementMap>;
9
+ currency: string;
10
+ language: string;
11
+ onCategoryInView: (categoryId: number) => void;
12
+ }
13
+ declare const Products: ({ products, categories, currency, language, productBlocksRef, onCategoryInView, }: Props) => import("react/jsx-runtime").JSX.Element;
14
+ export default Products;
@@ -0,0 +1 @@
1
+ export { default } from "./Products";
@@ -0,0 +1,8 @@
1
+ import * as productModels from "src/models/product";
2
+ interface Props {
3
+ product: productModels.Product;
4
+ currency: string;
5
+ language: string;
6
+ }
7
+ declare const ProductsListItem: ({ product, currency, language }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default ProductsListItem;
@@ -0,0 +1 @@
1
+ export { default } from "./ProductsListItem";
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_CURRENCY = "AZN";
@@ -0,0 +1,6 @@
1
+ import * as menuModels from "src/models/menu";
2
+ interface Props {
3
+ data: menuModels.PublicMenuData;
4
+ }
5
+ declare const PublicMenu: ({ data }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default PublicMenu;
@@ -0,0 +1 @@
1
+ export { default } from "./PublicMenu";
@@ -0,0 +1 @@
1
+ export { default as PublicMenu } from "./components/PublicMenu";
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as r,Fragment as a}from"react/jsx-runtime";import{useRef as t,useEffect as i,useState as n}from"react";import{Column as c,IconLink as l,Row as o,SVGIcon as s,Carousel as d,CarouselItem as m,Chip as u,UIElementType as h,Container as _,Card as g,Flex as v}from"@sorocraft/ui";import{Wifi as f,Phone as p,Whatsapp as I,Instagram as N,Telegram as b,Tiktok as y,Facebook as P,MarkerPin as L}from"@sorocraft/ui/icons";import{isEmpty as C,priceFormatter as H,groupBy as A}from"@sorocraft/js-utils";var w="PublicMenu-module_container__QLN6U",j="PublicMenu-module_categories__Iy6NC",k="Header-module_container__tenlF",z="Header-module_cover__BAWZK",B="Header-module_content__Gx4Al",E="Header-module_logo__4MTCm",O="Header-module_info__IchYA",x="Header-module_name__30wyw",F="Header-module_address__WOxXc",M="Header-module_labels__gYyth",R="Header-module_social__AoP0z",V="Header-module_links__EeQxg";const W=({branch:a,coverImage:t,logoImage:i,name:n,defaultCover:d="",defaultLogo:m=""})=>{const{address:u,latitude:h,longitude:_}=a||{},g=C(a),v=i||m,H=`https://www.google.com/maps/place/${h},${_}`;return e("div",{className:k,children:[r("img",{src:t||d,alt:n,className:z}),e("div",{className:B,children:[r(g?()=>e(c,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[r("img",{src:v,alt:n,className:E}),r("div",{className:O,children:r("h1",{className:x,children:n})})]}):()=>e(o,{gap:1,children:[r("img",{src:v,alt:n,className:E}),e("div",{className:O,children:[r("h1",{className:x,children:n}),r("a",{className:F,href:H,target:"_blank",rel:"noopener noreferrer",children:e(o,{alignItems:"center",gap:.5,children:[r(s,{icon:L,theme:"dark"}),r("span",{children:u})]})})]})]}),{}),!g&&r("div",{className:M,children:r(c,{alignItems:"center",justifyContent:"center",gap:.75,fullHeight:!0,children:r(l,{icon:f,href:"/",size:"sm",shape:"circle"})})})]}),!g&&r("div",{className:R,children:r("div",{className:V,children:e(o,{alignItems:"center",justifyContent:"center",gap:.5,children:[r(l,{icon:p,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:I,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:N,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:b,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:y,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:P,href:"/",size:"sm",shape:"circle",theme:"light"})]})})})]})},Y=({categories:e,language:a,selectedCategoryId:i,onSelectCategory:n})=>{const c=t({}),l=e=>{(e=>{var r;const a=null===(r=null==c?void 0:c.current)||void 0===r?void 0:r[e];a&&a.scrollIntoView({behavior:"smooth",inline:"center"})})(e),n(e)};return r("div",{className:j,children:r(d,{gap:1,children:e.map((({id:e,translations:t})=>{const{name:n}=t.find((e=>e.language===a))||{};return r(m,{children:r(u,{onClick:()=>l(e),type:h.BORDERED_PRIMARY,active:e===i,children:r("div",{ref:r=>c.current[e]=r,children:n})})},e)}))})})};var D={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var T={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const S=({product:a,currency:t,language:i})=>{const{translations:n,price:l,imageUrl:s}=a||{},{name:d,description:m}=n.find((e=>e.language===i))||{},u=H(l,t||"AZN",i);return r("div",{className:T.container,children:e(o,{justifyContent:"space-between",children:[r("div",{className:T.data,children:e(c,{gap:.5,children:[r("h3",{className:T.name,children:d}),r("div",{className:T.description,children:m}),r("div",{className:T.price,children:u})]})}),s&&r("img",{src:s,alt:d,className:T.image})]})})},Z=({products:a,categories:t,currency:n,language:l,productBlocksRef:o,onCategoryInView:s})=>{const d=A(a,"categoryId");return i((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const r=Number(e.target.getAttribute("data-category-id"));s(r)}}))}),{root:null,threshold:.5});return Object.values((null==o?void 0:o.current)||{}).forEach((r=>{r&&e.observe(r)})),()=>{e.disconnect()}}),[o,s]),r("div",{className:D.container,children:r(c,{children:Object.keys(d).map((a=>{const i=t.find((({id:e})=>e===Number(a)))||{},{name:s}=((e,r)=>{var a,t;return(null===(t=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===t?void 0:t.call(a,(e=>e.language===r)))||{}})(i,l);return e("div",{className:D.products,ref:e=>o.current[i.id]=e,"data-category-id":a,children:[r("h2",{className:D.category,children:s}),r("div",{className:D.list,children:r(c,{gap:2,children:d[a].map((e=>r(S,{product:e,currency:n,language:l},e.id)))})})]},a)}))})})};var J="Branches-module_branches__sOuoV",K="Branches-module_list__vYoT2",Q="Branches-module_name__K0Z-4";const U=({branches:e=[]})=>r("div",{className:J,children:r(_,{className:K,children:e.map((({id:e,name:a})=>r("a",{href:"/",children:r(g,{noBottomMargin:!0,children:r(v,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:r("h2",{className:Q,children:a})})})},e)))})}),$=({data:i})=>{var c;const{name:l,coverImage:o,logoImage:s,branches:d=[],branchId:m,language:u,categories:h,products:_,currency:g}=i||{},v=d.length<=1,f=d.find((e=>e.id===Number(m))),p=v||!(null==f?void 0:f.name)?l:(null==f?void 0:f.name)||"",[I,N]=n(null===(c=null==h?void 0:h[0])||void 0===c?void 0:c.id),b=t({});return e("div",{className:w,children:[r(W,{branch:f,name:p,coverImage:o,logoImage:s}),v||m?e(a,{children:[r(Y,{categories:h,language:u,selectedCategoryId:I,onSelectCategory:e=>{N(e),(e=>{var r;const a=null===(r=null==b?void 0:b.current)||void 0===r?void 0:r[e];a&&a.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),r(Z,{categories:h,products:_,currency:g,language:u,productBlocksRef:b,onCategoryInView:e=>{e!==I&&N(e)}})]}):r(U,{branches:d})]})};export{$ as PublicMenu};
2
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranch?: branchModels.Branch;\n\tcoverImage?: string;\n\tlogoImage?: string;\n\tdefaultCover?: string;\n\tdefaultLogo?: string;\n\tname: string;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tdefaultCover = \"\",\n\tdefaultLogo = \"\",\n}: Props) => {\n\tconst { address, latitude, longitude } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst coverImageSource = coverImage || defaultCover;\n\tconst logoImageSource = logoImage || defaultLogo;\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImageSource} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>\n\t\t\t\t{noBranch ? <BusinessInfo /> : <BranchInfo />}\n\t\t\t\t{!noBranch && (\n\t\t\t\t\t<div className={styles.labels}>\n\t\t\t\t\t\t<Column alignItems=\"center\" justifyContent=\"center\" gap={0.75} fullHeight>\n\t\t\t\t\t\t\t<IconLink icon={Wifi} href=\"/\" size=\"sm\" shape=\"circle\" />\n\t\t\t\t\t\t</Column>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t<IconLink icon={Phone} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Whatsapp} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Instagram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Telegram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Tiktok} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Facebook} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Products.module.scss\";\n\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\n\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = ({\n\tproducts,\n\tcategories,\n\tcurrency,\n\tlanguage,\n\tproductBlocksRef,\n\tonCategoryInView,\n}: Props) => {\n\t// const [layout, setLayout] = useState<\"list\" | \"grid\">(\"list\");\n\n\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\tuseEffect(() => {\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\t\tonCategoryInView(categoryId); // Notify the parent when a category is in view\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: null, // Use the viewport as the container\n\t\t\t\tthreshold: 0.5, // Trigger when 50% of the product block is in view\n\t\t\t}\n\t\t);\n\n\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\tif (block) {\n\t\t\t\tobserver.observe(block);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tobserver.disconnect(); // Clean up the observer on component unmount\n\t\t};\n\t}, [productBlocksRef, onCategoryInView]);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t{/* <div className={styles.header}>\n\t\t\t\t<Row>\n\t\t\t\t\t<IconButton icon={List} onClick={() => setLayout(\"list\")} isActive={layout === \"list\"} />\n\t\t\t\t\t<IconButton icon={Grid} onClick={() => setLayout(\"grid\")} isActive={layout === \"grid\"} />\n\t\t\t\t</Row>\n\t\t\t</div> */}\n\t\t\t<Column>\n\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Column>\n\t\t</div>\n\t);\n};\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n}\n\nconst Branches = ({ branches = [] }: Props) => {\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<a key={id} href=\"/\">\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</a>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={coverImage}\n\t\t\t\tlogoImage={logoImage}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","defaultCover","defaultLogo","address","latitude","longitude","noBranch","isEmpty","logoImageSource","googleMapLink","_jsxs","className","styles","children","_jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Wifi","size","shape","Phone","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","useEffect","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","Number","getAttribute","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","Branches","branches","Container","Card","noBottomMargin","Flex","PublicMenu","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","_Fragment","productBlock","scrollToProductBlock"],"mappings":"g5BA0BA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,eAAe,GACfC,cAAc,OAEd,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,GAAcR,GAAU,CAAA,EAC7CS,EAAWC,EAAQV,GAGnBW,EAAkBT,GAAaG,EAE/BO,EAAgB,qCAAqCL,KAAYC,IAgCvE,OACCK,EAAA,MAAA,CAAKC,UAAWC,EAAgBC,SAAA,CAC/BC,EAAK,MAAA,CAAAC,IArCkBjB,GAAcG,EAqCTe,IAAKhB,EAAMW,UAAWC,IAClDF,EAAK,MAAA,CAAAC,UAAWC,YACHE,EAAXR,EAbiB,IACpBI,EAACO,EAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DR,SAAA,CAAAC,EAAA,MAAA,CAAKC,IAAKP,EAAiBQ,IAAKhB,EAAMW,UAAWC,IACjDE,EAAK,MAAA,CAAAH,UAAWC,WACfE,EAAI,KAAA,CAAAH,UAAWC,EAAcC,SAAA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,EAAClB,EAAM,CACNC,OAAQ4H,EACRzH,KAAM0H,EACN5H,WAAYA,EACZC,UAAWA,IAEVwH,GAAoBD,EAGrB5G,EAAAmH,EAAA,CAAAhH,SAAA,CACCC,EAAC2B,EAAU,CACVC,WAAYA,EACZC,SAAUA,EACVC,mBAAoBA,EACpBC,iBA5ByBK,IAC7ByE,EAAsBzE,GARM,CAACA,UAC7B,MAAM4E,EAA2C,QAA5B1E,EAAAiC,aAAA,EAAAA,EAAkBhC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5C4E,GAELA,EAAaxE,eAAe,CAAEC,SAAU,SAAU+C,MAAO,SAAU,EAMnEyB,CAAqB7E,EAAW,IA2B7BpC,EAACqE,EACA,CAAAzC,WAAYA,EACZ0C,SAAUA,EACVV,SAAUA,EACV/B,SAAUA,EACV0C,iBAAkBA,EAClBC,iBA9ByBpC,IACzBA,IAAeN,GAClB+E,EAAsBzE,EACtB,OAYCpC,EAACiG,EAAQ,CAACC,SAAUA,MAoBrB"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),s=require("react"),r=require("@sorocraft/ui"),n=require("@sorocraft/ui/icons"),i=require("@sorocraft/js-utils"),a="PublicMenu-module_container__QLN6U",t="PublicMenu-module_categories__Iy6NC",c="Header-module_container__tenlF",l="Header-module_cover__BAWZK",o="Header-module_content__Gx4Al",d="Header-module_logo__4MTCm",u="Header-module_info__IchYA",m="Header-module_name__30wyw",h="Header-module_address__WOxXc",g="Header-module_labels__gYyth",_="Header-module_social__AoP0z",j="Header-module_links__EeQxg";const x=({branch:s,coverImage:a,logoImage:t,name:x,defaultCover:v="",defaultLogo:f=""})=>{const{address:p,latitude:I,longitude:N}=s||{},y=i.isEmpty(s),b=a||v,C=t||f,L=`https://www.google.com/maps/place/${I},${N}`;return e.jsxs("div",{className:c,children:[e.jsx("img",{src:b,alt:x,className:l}),e.jsxs("div",{className:o,children:[y?e.jsx((()=>e.jsxs(r.Column,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e.jsx("img",{src:C,alt:x,className:d}),e.jsx("div",{className:u,children:e.jsx("h1",{className:m,children:x})})]})),{}):e.jsx((()=>e.jsxs(r.Row,{gap:1,children:[e.jsx("img",{src:C,alt:x,className:d}),e.jsxs("div",{className:u,children:[e.jsx("h1",{className:m,children:x}),e.jsx("a",{className:h,href:L,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(r.Row,{alignItems:"center",gap:.5,children:[e.jsx(r.SVGIcon,{icon:n.MarkerPin,theme:"dark"}),e.jsx("span",{children:p})]})})]})]})),{}),!y&&e.jsx("div",{className:g,children:e.jsx(r.Column,{alignItems:"center",justifyContent:"center",gap:.75,fullHeight:!0,children:e.jsx(r.IconLink,{icon:n.Wifi,href:"/",size:"sm",shape:"circle"})})})]}),!y&&e.jsx("div",{className:_,children:e.jsx("div",{className:j,children:e.jsxs(r.Row,{alignItems:"center",justifyContent:"center",gap:.5,children:[e.jsx(r.IconLink,{icon:n.Phone,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Whatsapp,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Instagram,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Telegram,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Tiktok,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Facebook,href:"/",size:"sm",shape:"circle",theme:"light"})]})})})]})},v=({categories:n,language:i,selectedCategoryId:a,onSelectCategory:c})=>{const l=s.useRef({}),o=e=>{(e=>{var s;const r=null===(s=null==l?void 0:l.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",inline:"center"})})(e),c(e)};return e.jsx("div",{className:t,children:e.jsx(r.Carousel,{gap:1,children:n.map((({id:s,translations:n})=>{const{name:t}=n.find((e=>e.language===i))||{};return e.jsx(r.CarouselItem,{children:e.jsx(r.Chip,{onClick:()=>o(s),type:r.UIElementType.BORDERED_PRIMARY,active:s===a,children:e.jsx("div",{ref:e=>l.current[s]=e,children:t})})},s)}))})})};var f={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var p={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const I=({product:s,currency:n,language:a})=>{const{translations:t,price:c,imageUrl:l}=s||{},{name:o,description:d}=t.find((e=>e.language===a))||{},u=i.priceFormatter(c,n||"AZN",a);return e.jsx("div",{className:p.container,children:e.jsxs(r.Row,{justifyContent:"space-between",children:[e.jsx("div",{className:p.data,children:e.jsxs(r.Column,{gap:.5,children:[e.jsx("h3",{className:p.name,children:o}),e.jsx("div",{className:p.description,children:d}),e.jsx("div",{className:p.price,children:u})]})}),l&&e.jsx("img",{src:l,alt:o,className:p.image})]})})},N=({products:n,categories:a,currency:t,language:c,productBlocksRef:l,onCategoryInView:o})=>{const d=i.groupBy(n,"categoryId");return s.useEffect((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const s=Number(e.target.getAttribute("data-category-id"));o(s)}}))}),{root:null,threshold:.5});return Object.values((null==l?void 0:l.current)||{}).forEach((s=>{s&&e.observe(s)})),()=>{e.disconnect()}}),[l,o]),e.jsx("div",{className:f.container,children:e.jsx(r.Column,{children:Object.keys(d).map((s=>{const n=a.find((({id:e})=>e===Number(s)))||{},{name:i}=((e,s)=>{var r,n;return(null===(n=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===n?void 0:n.call(r,(e=>e.language===s)))||{}})(n,c);return e.jsxs("div",{className:f.products,ref:e=>l.current[n.id]=e,"data-category-id":s,children:[e.jsx("h2",{className:f.category,children:i}),e.jsx("div",{className:f.list,children:e.jsx(r.Column,{gap:2,children:d[s].map((s=>e.jsx(I,{product:s,currency:t,language:c},s.id)))})})]},s)}))})})};var y="Branches-module_branches__sOuoV",b="Branches-module_list__vYoT2",C="Branches-module_name__K0Z-4";const L=({branches:s=[]})=>e.jsx("div",{className:y,children:e.jsx(r.Container,{className:b,children:s.map((({id:s,name:n})=>e.jsx("a",{href:"/",children:e.jsx(r.Card,{noBottomMargin:!0,children:e.jsx(r.Flex,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e.jsx("h2",{className:C,children:n})})})},s)))})});exports.PublicMenu=({data:r})=>{var n;const{name:i,coverImage:t,logoImage:c,branches:l=[],branchId:o,language:d,categories:u,products:m,currency:h}=r||{},g=l.length<=1,_=l.find((e=>e.id===Number(o))),j=g||!(null==_?void 0:_.name)?i:(null==_?void 0:_.name)||"",[f,p]=s.useState(null===(n=null==u?void 0:u[0])||void 0===n?void 0:n.id),I=s.useRef({});return e.jsxs("div",{className:a,children:[e.jsx(x,{branch:_,name:j,coverImage:t,logoImage:c}),g||o?e.jsxs(e.Fragment,{children:[e.jsx(v,{categories:u,language:d,selectedCategoryId:f,onSelectCategory:e=>{p(e),(e=>{var s;const r=null===(s=null==I?void 0:I.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),e.jsx(N,{categories:u,products:m,currency:h,language:d,productBlocksRef:I,onCategoryInView:e=>{e!==f&&p(e)}})]}):e.jsx(L,{branches:l})]})};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranch?: branchModels.Branch;\n\tcoverImage?: string;\n\tlogoImage?: string;\n\tdefaultCover?: string;\n\tdefaultLogo?: string;\n\tname: string;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tdefaultCover = \"\",\n\tdefaultLogo = \"\",\n}: Props) => {\n\tconst { address, latitude, longitude } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst coverImageSource = coverImage || defaultCover;\n\tconst logoImageSource = logoImage || defaultLogo;\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImageSource} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>\n\t\t\t\t{noBranch ? <BusinessInfo /> : <BranchInfo />}\n\t\t\t\t{!noBranch && (\n\t\t\t\t\t<div className={styles.labels}>\n\t\t\t\t\t\t<Column alignItems=\"center\" justifyContent=\"center\" gap={0.75} fullHeight>\n\t\t\t\t\t\t\t<IconLink icon={Wifi} href=\"/\" size=\"sm\" shape=\"circle\" />\n\t\t\t\t\t\t</Column>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t<IconLink icon={Phone} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Whatsapp} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Instagram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Telegram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Tiktok} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Facebook} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Products.module.scss\";\n\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\n\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = ({\n\tproducts,\n\tcategories,\n\tcurrency,\n\tlanguage,\n\tproductBlocksRef,\n\tonCategoryInView,\n}: Props) => {\n\t// const [layout, setLayout] = useState<\"list\" | \"grid\">(\"list\");\n\n\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\tuseEffect(() => {\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\t\tonCategoryInView(categoryId); // Notify the parent when a category is in view\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: null, // Use the viewport as the container\n\t\t\t\tthreshold: 0.5, // Trigger when 50% of the product block is in view\n\t\t\t}\n\t\t);\n\n\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\tif (block) {\n\t\t\t\tobserver.observe(block);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tobserver.disconnect(); // Clean up the observer on component unmount\n\t\t};\n\t}, [productBlocksRef, onCategoryInView]);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t{/* <div className={styles.header}>\n\t\t\t\t<Row>\n\t\t\t\t\t<IconButton icon={List} onClick={() => setLayout(\"list\")} isActive={layout === \"list\"} />\n\t\t\t\t\t<IconButton icon={Grid} onClick={() => setLayout(\"grid\")} isActive={layout === \"grid\"} />\n\t\t\t\t</Row>\n\t\t\t</div> */}\n\t\t\t<Column>\n\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Column>\n\t\t</div>\n\t);\n};\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n}\n\nconst Branches = ({ branches = [] }: Props) => {\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<a key={id} href=\"/\">\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</a>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={coverImage}\n\t\t\t\tlogoImage={logoImage}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","defaultCover","defaultLogo","address","latitude","longitude","noBranch","isEmpty","coverImageSource","logoImageSource","googleMapLink","_jsxs","jsxs","className","styles","children","_jsx","jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Wifi","size","shape","Phone","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","useEffect","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","Number","getAttribute","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","Branches","branches","Container","Card","noBottomMargin","Flex","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","_Fragment","Fragment","productBlock","scrollToProductBlock"],"mappings":"4iBA0BA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,eAAe,GACfC,cAAc,OAEd,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,GAAcR,GAAU,CAAA,EAC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mBAAoBA,EACpBC,iBA5ByBK,IAC7BwE,EAAsBxE,GARM,CAACA,UAC7B,MAAM4E,EAA2C,QAA5B1E,EAAAiC,aAAA,EAAAA,EAAkBhC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5C4E,GAELA,EAAaxE,eAAe,CAAEC,SAAU,SAAU+C,MAAO,SAAU,EAMnEyB,CAAqB7E,EAAW,IA2B7BrC,EAAAA,IAACsE,EACA,CAAAzC,WAAYA,EACZ0C,SAAUA,EACVV,SAAUA,EACV/B,SAAUA,EACV0C,iBAAkBA,EAClBC,iBA9ByBpC,IACzBA,IAAeN,GAClB8E,EAAsBxE,EACtB,OAYCrC,EAAAA,IAACkG,EAAQ,CAACC,SAAUA,MAoBrB"}
@@ -0,0 +1,11 @@
1
+ export interface Branch {
2
+ id: number;
3
+ name: string;
4
+ businessId: number;
5
+ address: string;
6
+ longitude?: number;
7
+ latitude?: number;
8
+ phone?: string;
9
+ wifiPassword?: string;
10
+ createdAt?: number;
11
+ }
@@ -0,0 +1,10 @@
1
+ export interface CategoryTranslation {
2
+ name: string;
3
+ language: string;
4
+ categoryId: number;
5
+ }
6
+ export interface Category {
7
+ id: number;
8
+ businessId: number;
9
+ translations: CategoryTranslation[];
10
+ }
@@ -0,0 +1,14 @@
1
+ import * as branchModels from "./branch";
2
+ import * as productModels from "./product";
3
+ import * as categoryModels from "./category";
4
+ export interface PublicMenuData {
5
+ branches: branchModels.Branch[];
6
+ branchId: number | null | undefined;
7
+ coverImage?: string;
8
+ logoImage?: string;
9
+ name: string;
10
+ currency: string;
11
+ products: productModels.Product[];
12
+ categories: categoryModels.Category[];
13
+ language: string;
14
+ }
@@ -0,0 +1,16 @@
1
+ export interface ProductTranslation {
2
+ id: number;
3
+ name: string;
4
+ description?: string;
5
+ language: string;
6
+ productId: number;
7
+ }
8
+ export interface Product {
9
+ id: number;
10
+ categoryId: number;
11
+ vat?: number;
12
+ price: number;
13
+ volume?: string;
14
+ imageUrl?: string;
15
+ translations: ProductTranslation[];
16
+ }
@@ -0,0 +1,2 @@
1
+ @keyframes PublicMenu-module_flexWide__M9IEY{0%{flex:0}to{flex:1}}@keyframes PublicMenu-module_slidein__kwZ1c{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes PublicMenu-module_fadeInOut__ORUVR{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes PublicMenu-module_heightAnimation__Upf4B{0%{height:0}to{height:100%}}@keyframes PublicMenu-module_fadein__Q7QsJ{0%{opacity:0}to{opacity:1}}@keyframes PublicMenu-module_floatAnimation__IxmsY{0%{transform:translateY(0)}to{transform:translateY(-20px)}}.PublicMenu-module_container__QLN6U{background-color:#fff;position:relative}.PublicMenu-module_container__QLN6U .PublicMenu-module_description__Qlb4s{font-size:.9rem;padding:1rem 1rem .5rem;text-align:center}.PublicMenu-module_container__QLN6U .PublicMenu-module_contact__Jtkor{padding:1rem}.PublicMenu-module_container__QLN6U .PublicMenu-module_contact__Jtkor svg path{fill:#fff}.PublicMenu-module_container__QLN6U .PublicMenu-module_categories__Iy6NC{background-color:#fff;left:0;max-width:100%;padding:.5rem 1rem;position:sticky;right:0;top:-2rem;z-index:1}@keyframes Header-module_flexWide__XiQ6l{0%{flex:0}to{flex:1}}@keyframes Header-module_slidein__srDhG{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes Header-module_fadeInOut__CRL2N{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes Header-module_heightAnimation__YItGG{0%{height:0}to{height:100%}}@keyframes Header-module_fadein__3t3t-{0%{opacity:0}to{opacity:1}}@keyframes Header-module_floatAnimation__yIXwQ{0%{transform:translateY(0)}to{transform:translateY(-20px)}}.Header-module_container__tenlF{height:12.5rem;margin-bottom:3rem;position:relative;width:100%}.Header-module_container__tenlF .Header-module_cover__BAWZK{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.Header-module_container__tenlF .Header-module_content__Gx4Al{align-items:flex-end;background:linear-gradient(0deg,rgba(0,0,0,.5) 20%,transparent);bottom:0;color:#fff;display:flex;left:0;padding:1rem;position:absolute;right:0;top:0;width:100%}.Header-module_container__tenlF .Header-module_content__Gx4Al .Header-module_logo__4MTCm{border-radius:50%;height:6rem;overflow:hidden;width:6rem}.Header-module_container__tenlF .Header-module_content__Gx4Al .Header-module_info__IchYA .Header-module_name__30wyw{font-size:1.5rem;margin:0}.Header-module_container__tenlF .Header-module_content__Gx4Al .Header-module_info__IchYA .Header-module_address__WOxXc{color:#fff;font-size:.9rem}.Header-module_container__tenlF .Header-module_content__Gx4Al .Header-module_labels__gYyth{bottom:0;height:100%;padding:.75rem;position:absolute;right:0;scrollbar-width:none;top:0}.Header-module_container__tenlF .Header-module_content__Gx4Al .Header-module_labels__gYyth::-webkit-scrollbar{background:transparent;height:0;width:0}.Header-module_container__tenlF .Header-module_social__AoP0z{bottom:-1.25rem;display:flex;justify-content:center;left:0;position:absolute;right:0}.Header-module_container__tenlF .Header-module_links__EeQxg{background-color:#fff;border-radius:1.5rem;box-shadow:0 0 50px 0 rgba(0,0,0,.15);padding:.25rem .75rem;width:-moz-fit-content;width:fit-content}.Products-module_container__bF2LF{padding:1rem}.Products-module_container__bF2LF .Products-module_header__0EFvL{margin-bottom:-1rem}.Products-module_container__bF2LF .Products-module_products__AoDrY{padding:3rem 0 0;width:100%}.Products-module_container__bF2LF .Products-module_products__AoDrY .Products-module_list__LH4v5{width:100%}@keyframes ProductsListItem-module_flexWide__Ds6LE{0%{flex:0}to{flex:1}}@keyframes ProductsListItem-module_slidein__rEzMI{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes ProductsListItem-module_fadeInOut__i1FNq{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes ProductsListItem-module_heightAnimation__2fk7l{0%{height:0}to{height:100%}}@keyframes ProductsListItem-module_fadein__tPTJ6{0%{opacity:0}to{opacity:1}}@keyframes ProductsListItem-module_floatAnimation__vugAV{0%{transform:translateY(0)}to{transform:translateY(-20px)}}.ProductsListItem-module_container__i9tFs{width:100%}.ProductsListItem-module_container__i9tFs .ProductsListItem-module_data__Mb3SF{flex:1}.ProductsListItem-module_container__i9tFs .ProductsListItem-module_data__Mb3SF .ProductsListItem-module_name__T1gyJ{font-size:1.25rem;font-weight:500;margin:0}.ProductsListItem-module_container__i9tFs .ProductsListItem-module_data__Mb3SF .ProductsListItem-module_description__oL4CH{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#a1a5b7;display:-webkit-box;font-size:.9rem;overflow:hidden;text-overflow:ellipsis;white-space:normal}.ProductsListItem-module_container__i9tFs .ProductsListItem-module_image__h6Wbi{border-radius:.475rem;width:10rem}@keyframes Branches-module_flexWide__-waUA{0%{flex:0}to{flex:1}}@keyframes Branches-module_slidein__6gTfw{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes Branches-module_fadeInOut__lplH2{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}@keyframes Branches-module_heightAnimation__pcTJk{0%{height:0}to{height:100%}}@keyframes Branches-module_fadein__U1Mpr{0%{opacity:0}to{opacity:1}}@keyframes Branches-module_floatAnimation__sU2p3{0%{transform:translateY(0)}to{transform:translateY(-20px)}}.Branches-module_branches__sOuoV{background-color:#fff}.Branches-module_branches__sOuoV .Branches-module_list__vYoT2{display:grid;gap:2rem;grid-auto-rows:1fr;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));padding-bottom:2rem}@media (max-width:580px){.Branches-module_branches__sOuoV .Branches-module_list__vYoT2{grid-template-columns:1fr}}.Branches-module_branches__sOuoV .Branches-module_list__vYoT2 .Branches-module_name__K0Z-4{font-size:1.25rem;font-weight:500;margin:0;text-align:center}
2
+ /*# sourceMappingURL=ui.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PublicMenu.module.scss","Header.module.scss","Products.module.scss","ProductsListItem.module.scss","Branches.module.scss"],"names":[],"mappings":"AA0BA,6CACE,GACE,MACF,CACA,GACE,MACF,CACF,CACA,4CACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,8CACE,GACE,UACF,CACA,IACE,SACF,CACA,GACE,UACF,CACF,CACA,oDACE,GACE,QACF,CACA,GACE,WACF,CACF,CACA,2CACE,GACE,SACF,CACA,GACE,SACF,CACF,CA4BA,mDACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,oCACE,qBAAyB,CACzB,iBACF,CACA,0EAGE,eAAiB,CAFjB,uBAAyB,CACzB,iBAEF,CACA,sEACE,YACF,CACA,+EACE,SACF,CACA,yEAOE,qBAAyB,CAHzB,MAAO,CAHP,cAAe,CAOf,kBAAoB,CANpB,eAAgB,CAGhB,OAAQ,CACR,SAAU,CAHV,SAMF,CCtGA,yCACE,GACE,MACF,CACA,GACE,MACF,CACF,CACA,wCACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,0CACE,GACE,UACF,CACA,IACE,SACF,CACA,GACE,UACF,CACF,CACA,gDACE,GACE,QACF,CACA,GACE,WACF,CACF,CACA,uCACE,GACE,SACF,CACA,GACE,SACF,CACF,CA4BA,+CACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,gCAEE,cAAe,CAEf,kBAAmB,CADnB,iBAAkB,CAFlB,UAIF,CACA,4DAEE,WAAY,CACZ,mBAAiB,CAAjB,gBAAiB,CAFjB,UAGF,CACA,8DAWE,oBAAqB,CAFrB,+DAA2E,CAN3E,QAAS,CAKT,UAAc,CAEd,YAAa,CANb,MAAO,CAGP,YAAa,CANb,iBAAkB,CAIlB,OAAQ,CAHR,KAAM,CAIN,UAMF,CACA,yFAGE,iBAAkB,CADlB,WAAY,CAEZ,eAAgB,CAHhB,UAIF,CACA,oHACE,gBAAiB,CACjB,QACF,CACA,uHACE,UAAc,CACd,eACF,CACA,2FAGE,QAAS,CAET,WAAY,CACZ,cAAgB,CALhB,iBAAkB,CAGlB,OAAQ,CAGR,oBAAqB,CALrB,KAMF,CACA,8GAGE,sBAAuB,CAFvB,QAAS,CACT,OAEF,CACA,6DAEE,eAAgB,CAGhB,YAAa,CACb,sBAAuB,CAHvB,MAAO,CAFP,iBAAkB,CAGlB,OAGF,CACA,4DAEE,qBAAyB,CACzB,oBAAqB,CACrB,qCAAgD,CAHhD,qBAAwB,CAIxB,sBAAkB,CAAlB,iBACF,CC1KA,kCACE,YACF,CACA,iEACE,mBACF,CACA,mEAEE,gBAAiB,CADjB,UAEF,CACA,gGACE,UACF,CCcA,mDACE,GACE,MACF,CACA,GACE,MACF,CACF,CACA,kDACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,oDACE,GACE,UACF,CACA,IACE,SACF,CACA,GACE,UACF,CACF,CACA,0DACE,GACE,QACF,CACA,GACE,WACF,CACF,CACA,iDACE,GACE,SACF,CACA,GACE,SACF,CACF,CA4BA,yDACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,0CACE,UACF,CACA,+EACE,MACF,CACA,oHACE,iBAAkB,CAClB,eAAgB,CAChB,QACF,CACA,2HAEE,YAAa,CACb,oBAAqB,CACrB,2BAA4B,CAI5B,aAAc,CAPd,mBAAoB,CAQpB,eAAiB,CAJjB,eAAgB,CAChB,sBAAuB,CACvB,kBAGF,CACA,gFAEE,qBAAuB,CADvB,WAEF,CCvGA,2CACE,GACE,MACF,CACA,GACE,MACF,CACF,CACA,0CACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,4CACE,GACE,UACF,CACA,IACE,SACF,CACA,GACE,UACF,CACF,CACA,kDACE,GACE,QACF,CACA,GACE,WACF,CACF,CACA,yCACE,GACE,SACF,CACA,GACE,SACF,CACF,CA4BA,iDACE,GACE,uBACF,CACA,GACE,2BACF,CACF,CACA,iCACE,qBACF,CACA,8DAEE,YAAa,CACb,QAAS,CACT,kBAAmB,CACnB,wDAA2D,CAJ3D,mBAKF,CACA,yBACE,8DACE,yBACF,CACF,CACA,2FAGE,iBAAkB,CADlB,eAAgB,CAEhB,QAAS,CAHT,iBAIF","file":"ui.css","sourcesContent":["/* Text */\n/* Input */\n/* Button */\n/* TABLE */\n/* Modal */\n/* Bagde */\n/* Menu */\n/* Notification */\n/* Border radius */\n/* Fonts */\n/* BUTTON */\n/* WIDTH */\n/* HEIGHT */\n/* CARD */\n/* TABLE */\n/* MODAL */\n/* BADGE */\n/* Menu */\n/* Input */\n/* EDITOR */\n/* HEADER */\n/* Z-INDEX */\n/* SIZES */\n/* SHADOW */\n/**/\n/* RESPONSIVE */\n@keyframes flexWide {\n from {\n flex: 0;\n }\n to {\n flex: 1;\n }\n}\n@keyframes slidein {\n from {\n transform: translateX(0%);\n }\n to {\n transform: translateX(-100%);\n }\n}\n@keyframes fadeInOut {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@keyframes heightAnimation {\n 0% {\n height: 0%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Firefox < 16 */\n@-moz-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Safari, Chrome and Opera > 12.1 */\n@-webkit-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Internet Explorer */\n@-ms-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes floatAnimation {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-20px);\n }\n}\n.container {\n background-color: #ffffff;\n position: relative;\n}\n.container .description {\n padding: 1rem 1rem 0.5rem;\n text-align: center;\n font-size: 0.9rem;\n}\n.container .contact {\n padding: 1rem;\n}\n.container .contact svg path {\n fill: #ffffff;\n}\n.container .categories {\n max-width: 100%;\n position: sticky;\n z-index: 1;\n left: 0;\n right: 0;\n top: -2rem;\n background-color: #ffffff;\n padding: 0.5rem 1rem;\n}","/* Text */\n/* Input */\n/* Button */\n/* TABLE */\n/* Modal */\n/* Bagde */\n/* Menu */\n/* Notification */\n/* Border radius */\n/* Fonts */\n/* BUTTON */\n/* WIDTH */\n/* HEIGHT */\n/* CARD */\n/* TABLE */\n/* MODAL */\n/* BADGE */\n/* Menu */\n/* Input */\n/* EDITOR */\n/* HEADER */\n/* Z-INDEX */\n/* SIZES */\n/* SHADOW */\n/**/\n/* RESPONSIVE */\n@keyframes flexWide {\n from {\n flex: 0;\n }\n to {\n flex: 1;\n }\n}\n@keyframes slidein {\n from {\n transform: translateX(0%);\n }\n to {\n transform: translateX(-100%);\n }\n}\n@keyframes fadeInOut {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@keyframes heightAnimation {\n 0% {\n height: 0%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Firefox < 16 */\n@-moz-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Safari, Chrome and Opera > 12.1 */\n@-webkit-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Internet Explorer */\n@-ms-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes floatAnimation {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-20px);\n }\n}\n.container {\n width: 100%;\n height: 12.5rem;\n position: relative;\n margin-bottom: 3rem;\n}\n.container .cover {\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n.container .content {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n padding: 1rem;\n color: #ffffff;\n background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 20%, transparent 100%);\n display: flex;\n align-items: flex-end;\n}\n.container .content .logo {\n width: 6rem;\n height: 6rem;\n border-radius: 50%;\n overflow: hidden;\n}\n.container .content .info .name {\n font-size: 1.5rem;\n margin: 0;\n}\n.container .content .info .address {\n color: #ffffff;\n font-size: 0.9rem;\n}\n.container .content .labels {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n height: 100%;\n padding: 0.75rem;\n scrollbar-width: none;\n}\n.container .content .labels::-webkit-scrollbar {\n height: 0;\n width: 0;\n background: transparent;\n}\n.container .social {\n position: absolute;\n bottom: -1.25rem;\n left: 0;\n right: 0;\n display: flex;\n justify-content: center;\n}\n.container .links {\n padding: 0.25rem 0.75rem;\n background-color: #ffffff;\n border-radius: 1.5rem;\n box-shadow: 0px 0px 50px 0px rgba(0, 0, 0, 0.15);\n width: fit-content;\n}",".container {\n padding: 1rem;\n}\n.container .header {\n margin-bottom: -1rem;\n}\n.container .products {\n width: 100%;\n padding: 3rem 0 0;\n}\n.container .products .list {\n width: 100%;\n}","/* Text */\n/* Input */\n/* Button */\n/* TABLE */\n/* Modal */\n/* Bagde */\n/* Menu */\n/* Notification */\n/* Border radius */\n/* Fonts */\n/* BUTTON */\n/* WIDTH */\n/* HEIGHT */\n/* CARD */\n/* TABLE */\n/* MODAL */\n/* BADGE */\n/* Menu */\n/* Input */\n/* EDITOR */\n/* HEADER */\n/* Z-INDEX */\n/* SIZES */\n/* SHADOW */\n/**/\n/* RESPONSIVE */\n@keyframes flexWide {\n from {\n flex: 0;\n }\n to {\n flex: 1;\n }\n}\n@keyframes slidein {\n from {\n transform: translateX(0%);\n }\n to {\n transform: translateX(-100%);\n }\n}\n@keyframes fadeInOut {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@keyframes heightAnimation {\n 0% {\n height: 0%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Firefox < 16 */\n@-moz-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Safari, Chrome and Opera > 12.1 */\n@-webkit-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Internet Explorer */\n@-ms-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes floatAnimation {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-20px);\n }\n}\n.container {\n width: 100%;\n}\n.container .data {\n flex: 1;\n}\n.container .data .name {\n font-size: 1.25rem;\n font-weight: 500;\n margin: 0;\n}\n.container .data .description {\n display: -webkit-box;\n line-clamp: 2;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: normal;\n color: #a1a5b7;\n font-size: 0.9rem;\n}\n.container .image {\n width: 10rem;\n border-radius: 0.475rem;\n}","/* Text */\n/* Input */\n/* Button */\n/* TABLE */\n/* Modal */\n/* Bagde */\n/* Menu */\n/* Notification */\n/* Border radius */\n/* Fonts */\n/* BUTTON */\n/* WIDTH */\n/* HEIGHT */\n/* CARD */\n/* TABLE */\n/* MODAL */\n/* BADGE */\n/* Menu */\n/* Input */\n/* EDITOR */\n/* HEADER */\n/* Z-INDEX */\n/* SIZES */\n/* SHADOW */\n/**/\n/* RESPONSIVE */\n@keyframes flexWide {\n from {\n flex: 0;\n }\n to {\n flex: 1;\n }\n}\n@keyframes slidein {\n from {\n transform: translateX(0%);\n }\n to {\n transform: translateX(-100%);\n }\n}\n@keyframes fadeInOut {\n 0% {\n opacity: 0.5;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n opacity: 0.5;\n }\n}\n@keyframes heightAnimation {\n 0% {\n height: 0%;\n }\n 100% {\n height: 100%;\n }\n}\n@keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Firefox < 16 */\n@-moz-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Safari, Chrome and Opera > 12.1 */\n@-webkit-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n/* Internet Explorer */\n@-ms-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes floatAnimation {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(-20px);\n }\n}\n.branches {\n background-color: #ffffff;\n}\n.branches .list {\n padding-bottom: 2rem;\n display: grid;\n gap: 2rem;\n grid-auto-rows: 1fr;\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n}\n@media (max-width: 580px) {\n .branches .list {\n grid-template-columns: 1fr;\n }\n}\n.branches .list .name {\n text-align: center;\n font-weight: 500;\n font-size: 1.25rem;\n margin: 0;\n}"]}
@@ -0,0 +1,2 @@
1
+ import { Category, CategoryTranslation } from "src/models/category";
2
+ export declare const getCategoryTranslation: (category: Category, language: string) => CategoryTranslation;
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@restaround/react",
3
+ "version": "1.0.1",
4
+ "description": "React Library by restaround.co",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "require": "./dist/index.js",
15
+ "import": "./dist/index.esm.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "./styles/ui.css": "./dist/styles/ui.css"
19
+ },
20
+ "typesVersions": {
21
+ "*": {}
22
+ },
23
+ "scripts": {
24
+ "clean": "rimraf dist",
25
+ "build": "npm run clean && rollup -c",
26
+ "dev": "npm run clean && rollup -c -w",
27
+ "lint": "eslint src",
28
+ "pub": "git add . && git commit -m \"New version\" && npm version patch && npm run build && npm publish --access public"
29
+ },
30
+ "author": "restaround.co",
31
+ "license": "MIT",
32
+ "homepage": "https://restaround.co",
33
+ "peerDependencies": {
34
+ "@sorocraft/js-utils": ">=1.0.10",
35
+ "@sorocraft/ui": "^1.0.59",
36
+ "react": ">=18.2.0",
37
+ "react-dom": ">=18.2.0"
38
+ },
39
+ "devDependencies": {
40
+ "@rollup/plugin-commonjs": "^28.0.1",
41
+ "@rollup/plugin-node-resolve": "^15.3.0",
42
+ "@rollup/plugin-terser": "^0.4.4",
43
+ "@rollup/plugin-typescript": "^12.1.1",
44
+ "@types/react": "^18.3.11",
45
+ "@types/react-dom": "^18.3.1",
46
+ "autoprefixer": "^10.4.20",
47
+ "eslint": "^9.13.0",
48
+ "rimraf": "^6.0.1",
49
+ "rollup-plugin-copy": "^3.5.0",
50
+ "rollup-plugin-peer-deps-external": "^2.2.4",
51
+ "rollup-plugin-postcss": "^4.0.2",
52
+ "sass": "^1.80.3",
53
+ "tslib": "^2.8.0",
54
+ "typescript": "^5.6.3"
55
+ }
56
+ }