@salla.sa/twilight-theme-engine 1.0.84 → 1.0.86
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/{AddToCartForm-JUMFLSKN.js → AddToCartForm-5X2WZDWR.js} +3 -3
- package/dist/{AddToCartForm-JUMFLSKN.js.map → AddToCartForm-5X2WZDWR.js.map} +1 -1
- package/dist/{BlogAuthorPage-LFAUMKC7.js → BlogAuthorPage-LO7FSSJR.js} +12 -10
- package/dist/BlogAuthorPage-LO7FSSJR.js.map +1 -0
- package/dist/{BlogCategoryPage-NWYFFPCD.js → BlogCategoryPage-KKFQ3PGR.js} +12 -10
- package/dist/BlogCategoryPage-KKFQ3PGR.js.map +1 -0
- package/dist/{BlogPage-BOHXFV7E.js → BlogPage-VLF3NSGE.js} +11 -9
- package/dist/BlogPage-VLF3NSGE.js.map +1 -0
- package/dist/{BlogSinglePage-FYEXQPMB.js → BlogSinglePage-AVK535IW.js} +11 -9
- package/dist/BlogSinglePage-AVK535IW.js.map +1 -0
- package/dist/{BlogTagPage-DAM3RNVA.js → BlogTagPage-F3T4D7RH.js} +12 -10
- package/dist/BlogTagPage-F3T4D7RH.js.map +1 -0
- package/dist/{BrandsPage-GAKQCE6O.js → BrandsPage-LVSBZSVC.js} +11 -9
- package/dist/BrandsPage-LVSBZSVC.js.map +1 -0
- package/dist/{Breadcrumb-NAYSZNRV.js → Breadcrumb-VLFTXRFC.js} +11 -9
- package/dist/Breadcrumb-VLFTXRFC.js.map +1 -0
- package/dist/{CartItem-ZRVLIZT3.js → CartItem-G3H34GW6.js} +11 -9
- package/dist/CartItem-G3H34GW6.js.map +1 -0
- package/dist/{CartSummary-U2TVLG35.js → CartSummary-VH37RPUI.js} +11 -9
- package/dist/CartSummary-VH37RPUI.js.map +1 -0
- package/dist/{Copyright-2LSBADZD.js → Copyright-HE5ZWINZ.js} +3 -3
- package/dist/{Copyright-2LSBADZD.js.map → Copyright-HE5ZWINZ.js.map} +1 -1
- package/dist/{CustomerLayout-WSKXWI7D.js → CustomerLayout-LKBLOAVW.js} +11 -9
- package/dist/CustomerLayout-LKBLOAVW.js.map +1 -0
- package/dist/{Footer-ONNRJU4G.js → Footer-HHXAST72.js} +5 -5
- package/dist/{Footer-ONNRJU4G.js.map → Footer-HHXAST72.js.map} +1 -1
- package/dist/{Header-C6VXLLUC.js → Header-GEVZM2YG.js} +8 -6
- package/dist/{Header-C6VXLLUC.js.map → Header-GEVZM2YG.js.map} +1 -1
- package/dist/{LoyaltyPage-IG5KSYNO.js → LoyaltyPage-M5CT3CFD.js} +11 -9
- package/dist/LoyaltyPage-M5CT3CFD.js.map +1 -0
- package/dist/{LoyaltyPointsPage-RKO56ZER.js → LoyaltyPointsPage-SDJB52U6.js} +10 -3
- package/dist/LoyaltyPointsPage-SDJB52U6.js.map +1 -0
- package/dist/{MainMenu-USOYTKPU.js → MainMenu-I7EYS752.js} +3 -3
- package/dist/{MainMenu-USOYTKPU.js.map → MainMenu-I7EYS752.js.map} +1 -1
- package/dist/{MasterLayout-2W24ACEK.js → MasterLayout-QDK4T3NE.js} +11 -9
- package/dist/{MasterLayout-2W24ACEK.js.map → MasterLayout-QDK4T3NE.js.map} +1 -1
- package/dist/{MobileMenu-E4X2GOZ3.js → MobileMenu-7VTCWAVJ.js} +11 -9
- package/dist/MobileMenu-7VTCWAVJ.js.map +1 -0
- package/dist/{NotificationsPage-BJ5XVWEG.js → NotificationsPage-QCABE6QD.js} +11 -9
- package/dist/NotificationsPage-QCABE6QD.js.map +1 -0
- package/dist/{OrderSinglePage-544E36FJ.js → OrderSinglePage-2HVBKBG4.js} +11 -9
- package/dist/OrderSinglePage-2HVBKBG4.js.map +1 -0
- package/dist/{OrdersPage-AFBWVTZU.js → OrdersPage-5MNCPCM3.js} +11 -9
- package/dist/OrdersPage-5MNCPCM3.js.map +1 -0
- package/dist/{PageSingle-H2EJIL74.js → PageSingle-EN5XIM2B.js} +3 -3
- package/dist/{PageSingle-H2EJIL74.js.map → PageSingle-EN5XIM2B.js.map} +1 -1
- package/dist/{ProductDetails-SDZHALU6.js → ProductDetails-UEWQPPDZ.js} +13 -6
- package/dist/ProductDetails-UEWQPPDZ.js.map +1 -0
- package/dist/{ProfilePage-V5KV6GQK.js → ProfilePage-TZSU3GHZ.js} +11 -9
- package/dist/ProfilePage-TZSU3GHZ.js.map +1 -0
- package/dist/{ReviewsPage-CXKJABXP.js → ReviewsPage-WYZ6CHF2.js} +3 -3
- package/dist/{ReviewsPage-CXKJABXP.js.map → ReviewsPage-WYZ6CHF2.js.map} +1 -1
- package/dist/{SeoCartWidget-JAV6M3X5.js → SeoCartWidget-5JR5RXQM.js} +11 -9
- package/dist/SeoCartWidget-5JR5RXQM.js.map +1 -0
- package/dist/{SettingsPage-43SUCLQR.js → SettingsPage-DIDRQXMM.js} +11 -9
- package/dist/SettingsPage-DIDRQXMM.js.map +1 -0
- package/dist/{StoreClosedNotification-MINBJOGZ.js → StoreClosedNotification-C2G32E34.js} +12 -10
- package/dist/{StoreClosedNotification-MINBJOGZ.js.map → StoreClosedNotification-C2G32E34.js.map} +1 -1
- package/dist/{TestimonialsPage-RLLIDLOA.js → TestimonialsPage-XPHFRBZ7.js} +3 -3
- package/dist/{TestimonialsPage-RLLIDLOA.js.map → TestimonialsPage-XPHFRBZ7.js.map} +1 -1
- package/dist/{ThankYouPage-52SSZ7FV.js → ThankYouPage-UA6YYFB2.js} +11 -9
- package/dist/ThankYouPage-UA6YYFB2.js.map +1 -0
- package/dist/{WalletPage-4AN4UJ52.js → WalletPage-AJVV7LVL.js} +11 -9
- package/dist/WalletPage-AJVV7LVL.js.map +1 -0
- package/dist/{WishlistPage-L6IYJUJZ.js → WishlistPage-UW6LJLSW.js} +11 -9
- package/dist/WishlistPage-UW6LJLSW.js.map +1 -0
- package/dist/api/advertisement.d.ts +33 -0
- package/dist/api/advertisement.d.ts.map +1 -0
- package/dist/api/advertisement.js +8 -0
- package/dist/api/advertisement.js.map +1 -0
- package/dist/boot/critical-style.d.ts +3 -0
- package/dist/boot/critical-style.d.ts.map +1 -0
- package/dist/boot/index.d.ts +15 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/boot.d.ts +1 -0
- package/dist/boot.js +69 -0
- package/dist/boot.js.map +1 -0
- package/dist/{chunk-R5BQDCDK.js → chunk-2HCCIHU7.js} +4 -4
- package/dist/{chunk-R5BQDCDK.js.map → chunk-2HCCIHU7.js.map} +1 -1
- package/dist/chunk-4FJGZQD3.js +6 -0
- package/dist/chunk-4FJGZQD3.js.map +1 -0
- package/dist/{chunk-UNEZZMQA.js → chunk-4WVJJ7SN.js} +20 -4
- package/dist/chunk-4WVJJ7SN.js.map +1 -0
- package/dist/{chunk-FFWSQJLV.js → chunk-BAYGWTNM.js} +3 -3
- package/dist/{chunk-FFWSQJLV.js.map → chunk-BAYGWTNM.js.map} +1 -1
- package/dist/{chunk-WSRVPR7V.js → chunk-CLBFF2CY.js} +3 -3
- package/dist/{chunk-WSRVPR7V.js.map → chunk-CLBFF2CY.js.map} +1 -1
- package/dist/chunk-DBW7XXNE.js +103 -0
- package/dist/chunk-DBW7XXNE.js.map +1 -0
- package/dist/{chunk-CCUE2FMU.js → chunk-DBXH3EMJ.js} +3 -3
- package/dist/{chunk-CCUE2FMU.js.map → chunk-DBXH3EMJ.js.map} +1 -1
- package/dist/{chunk-MECSOKS7.js → chunk-E26YG3AO.js} +4 -4
- package/dist/{chunk-MECSOKS7.js.map → chunk-E26YG3AO.js.map} +1 -1
- package/dist/{chunk-22SH7OVF.js → chunk-E7WWO3V3.js} +3 -3
- package/dist/{chunk-22SH7OVF.js.map → chunk-E7WWO3V3.js.map} +1 -1
- package/dist/{chunk-IC6XW3PD.js → chunk-HQ7WA37L.js} +7 -7
- package/dist/{chunk-IC6XW3PD.js.map → chunk-HQ7WA37L.js.map} +1 -1
- package/dist/chunk-IVBOLREE.js +29 -0
- package/dist/chunk-IVBOLREE.js.map +1 -0
- package/dist/{chunk-RRGEASAL.js → chunk-KP3VYG4F.js} +6 -6
- package/dist/{chunk-RRGEASAL.js.map → chunk-KP3VYG4F.js.map} +1 -1
- package/dist/{chunk-EFF2WO6W.js → chunk-PWTXR4RR.js} +10 -10
- package/dist/{chunk-EFF2WO6W.js.map → chunk-PWTXR4RR.js.map} +1 -1
- package/dist/chunk-QJYUTRAQ.js +14 -0
- package/dist/{chunk-4EA56R6I.js.map → chunk-QJYUTRAQ.js.map} +1 -1
- package/dist/{chunk-YFQUSAET.js → chunk-U55ZJC2X.js} +4 -4
- package/dist/{chunk-YFQUSAET.js.map → chunk-U55ZJC2X.js.map} +1 -1
- package/dist/{chunk-R54GSKJS.js → chunk-WSDG4ZRI.js} +30 -16
- package/dist/chunk-WSDG4ZRI.js.map +1 -0
- package/dist/{chunk-3PWARKZX.js → chunk-X54QP332.js} +8 -8
- package/dist/chunk-X54QP332.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +9 -7
- package/dist/components/home/HomePageRenderer.d.ts +6 -0
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/index.js +11 -9
- package/dist/components/layout/PageAdvertisements.d.ts +7 -0
- package/dist/components/layout/PageAdvertisements.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +8 -1
- package/dist/components/product/index.js +10 -8
- package/dist/components/store/index.js +11 -9
- package/dist/components/store/index.js.map +1 -1
- package/dist/{document-class-SD6BUMZN.js → document-class-7AXAAWGZ.js} +6 -5
- package/dist/{document-class-SD6BUMZN.js.map → document-class-7AXAAWGZ.js.map} +1 -1
- package/dist/hooks/index.js +9 -7
- package/dist/hooks/useGtm.js +9 -7
- package/dist/hooks/useMoney.js +9 -7
- package/dist/hooks/useStore.js +9 -7
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/{not-found-TUU7WQLL.js → not-found-3EEMQZMU.js} +11 -9
- package/dist/not-found-3EEMQZMU.js.map +1 -0
- package/dist/providers/index.js +9 -7
- package/dist/routes/account/orders.js +1 -1
- package/dist/routes/account.js +6 -6
- package/dist/routes/blog.js +5 -5
- package/dist/routes/brands.js +1 -1
- package/dist/routes/cart.js +13 -11
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +12 -10
- package/dist/routes/loyalty.js +2 -2
- package/dist/routes/page.js +1 -1
- package/dist/routes/product-listing.js +11 -9
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +11 -9
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/root/beforeLoad.d.ts +2 -2
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/root/head.d.ts.map +1 -1
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +1 -1
- package/dist/skeleton.js +12 -10
- package/dist/tanstack/document-class.d.ts.map +1 -1
- package/dist/tanstack/index.d.ts +1 -0
- package/dist/tanstack/index.d.ts.map +1 -1
- package/dist/tanstack/stylesheet.d.ts +15 -0
- package/dist/tanstack/stylesheet.d.ts.map +1 -0
- package/dist/tanstack.js +34 -5
- package/dist/tanstack.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +12 -3
- package/tailwind/components/Component.tsx.txt +21 -0
- package/tailwind/components/ComponentRegistry.ts.txt +66 -0
- package/tailwind/components/cart/CartItem.tsx.txt +211 -0
- package/tailwind/components/cart/CartSummary.tsx.txt +269 -0
- package/tailwind/components/cart/PreOrderNotification.tsx.txt +16 -0
- package/tailwind/components/cart/PriceQuoteButton.tsx.txt +21 -0
- package/tailwind/components/cart/SeoCartWidget.tsx.txt +99 -0
- package/tailwind/components/cart/index.ts.txt +11 -0
- package/tailwind/components/cart/lazy.ts.txt +15 -0
- package/tailwind/components/collapse/Collapse.tsx.txt +95 -0
- package/tailwind/components/collapse/index.ts.txt +41 -0
- package/tailwind/components/common/Breadcrumb.tsx.txt +27 -0
- package/tailwind/components/common/BreadcrumbJsonLd.tsx.txt +40 -0
- package/tailwind/components/common/BreadcrumbTrail.tsx.txt +97 -0
- package/tailwind/components/common/CurrencySymbol.tsx.txt +8 -0
- package/tailwind/components/common/DeferredData.tsx.txt +122 -0
- package/tailwind/components/common/ErrorPage.tsx.txt +69 -0
- package/tailwind/components/common/Image.tsx.txt +119 -0
- package/tailwind/components/common/Link.tsx.txt +36 -0
- package/tailwind/components/common/Link.types.ts.txt +85 -0
- package/tailwind/components/common/NoContent.tsx.txt +27 -0
- package/tailwind/components/common/RenderWhenVisible.tsx.txt +92 -0
- package/tailwind/components/common/index.ts.txt +42 -0
- package/tailwind/components/common/lazy.ts.txt +28 -0
- package/tailwind/components/defineComponent.ts.txt +32 -0
- package/tailwind/components/drawer/Drawer.tsx.txt +219 -0
- package/tailwind/components/drawer/index.ts.txt +38 -0
- package/tailwind/components/dropdown/Dropdown.tsx.txt +166 -0
- package/tailwind/components/dropdown/index.ts.txt +40 -0
- package/tailwind/components/home/BundleComponent.tsx.txt +35 -0
- package/tailwind/components/home/ComponentErrorBoundary.tsx.txt +98 -0
- package/tailwind/components/home/FeaturedProductsStyle1.tsx.txt +125 -0
- package/tailwind/components/home/FeaturedProductsStyle2.tsx.txt +127 -0
- package/tailwind/components/home/FeaturedProductsStyle3.tsx.txt +71 -0
- package/tailwind/components/home/FixedBanner.tsx.txt +68 -0
- package/tailwind/components/home/FixedProducts.tsx.txt +72 -0
- package/tailwind/components/home/HomePageRenderer.tsx.txt +284 -0
- package/tailwind/components/home/PageBlocks.tsx.txt +24 -0
- package/tailwind/components/home/ParallaxBackground.tsx.txt +50 -0
- package/tailwind/components/home/PhotosSlider.tsx.txt +61 -0
- package/tailwind/components/home/ProductsSlider.tsx.txt +87 -0
- package/tailwind/components/home/ReorderProducts.tsx.txt +38 -0
- package/tailwind/components/home/SquarePhotos.tsx.txt +68 -0
- package/tailwind/components/home/StoreFeatures.tsx.txt +34 -0
- package/tailwind/components/home/Testimonials.tsx.txt +36 -0
- package/tailwind/components/home/Youtube.tsx.txt +48 -0
- package/tailwind/components/home/index.ts.txt +50 -0
- package/tailwind/components/home/lazy.ts.txt +17 -0
- package/tailwind/components/home/register.ts.txt +44 -0
- package/tailwind/components/home/reorder-hooks.ts.txt +52 -0
- package/tailwind/components/home/types.ts.txt +4 -0
- package/tailwind/components/layout/Copyright.tsx.txt +23 -0
- package/tailwind/components/layout/CustomerLayout.tsx.txt +91 -0
- package/tailwind/components/layout/Footer.tsx.txt +343 -0
- package/tailwind/components/layout/Header.tsx.txt +154 -0
- package/tailwind/components/layout/MasterLayout.tsx.txt +63 -0
- package/tailwind/components/layout/PageAdvertisements.tsx.txt +131 -0
- package/tailwind/components/layout/WidgetHead.tsx.txt +53 -0
- package/tailwind/components/layout/index.ts.txt +27 -0
- package/tailwind/components/layout/lazy.ts.txt +25 -0
- package/tailwind/components/layout/types.ts.txt +11 -0
- package/tailwind/components/modal/ImageModal.tsx.txt +70 -0
- package/tailwind/components/modal/Modal.tsx.txt +245 -0
- package/tailwind/components/modal/index.ts.txt +39 -0
- package/tailwind/components/modal/lazy.ts.txt +10 -0
- package/tailwind/components/navigation/MainMenu.tsx.txt +94 -0
- package/tailwind/components/navigation/MobileMenu.tsx.txt +160 -0
- package/tailwind/components/navigation/index.ts.txt +4 -0
- package/tailwind/components/navigation/lazy.ts.txt +11 -0
- package/tailwind/components/product/AddToCartForm.tsx.txt +365 -0
- package/tailwind/components/product/ProductCard.tsx.txt +305 -0
- package/tailwind/components/product/ProductDetails.tsx.txt +267 -0
- package/tailwind/components/product/ProductGallery.tsx.txt +234 -0
- package/tailwind/components/product/index.ts.txt +15 -0
- package/tailwind/components/product/lazy.ts.txt +9 -0
- package/tailwind/components/snippets/AppsSnippets.tsx.txt +225 -0
- package/tailwind/components/snippets/SallaSdkScripts.tsx.txt +14 -0
- package/tailwind/components/snippets/index.ts.txt +4 -0
- package/tailwind/components/store/StoreClosedNotification.tsx.txt +73 -0
- package/tailwind/components/store/index.ts.txt +8 -0
- package/tailwind/components/store/lazy.ts.txt +8 -0
- package/tailwind/components/toast/Toaster.tsx.txt +177 -0
- package/tailwind/components/toast/index.ts.txt +10 -0
- package/tailwind/components/toast/types.ts.txt +38 -0
- package/tailwind/components/toast/useToast.ts.txt +61 -0
- package/tailwind/components/tracking/GoogleTag.tsx.txt +77 -0
- package/tailwind/components/tracking/SiftSnippet.tsx.txt +49 -0
- package/tailwind/components/tracking/TwilightBundles.tsx.txt +67 -0
- package/tailwind/components/tracking/index.ts.txt +11 -0
- package/tailwind/components/tracking/lazy.ts.txt +11 -0
- package/tailwind/components/useComponent.ts.txt +12 -0
- package/tailwind/routes/account/index.tsx.txt +16 -0
- package/tailwind/routes/account/notifications/NotificationsPage.tsx.txt +54 -0
- package/tailwind/routes/account/notifications/index.tsx.txt +39 -0
- package/tailwind/routes/account/notifications/loader.ts.txt +22 -0
- package/tailwind/routes/account/notifications/types.ts.txt +18 -0
- package/tailwind/routes/account/orders/OrderSinglePage.tsx.txt +181 -0
- package/tailwind/routes/account/orders/OrdersPage.tsx.txt +28 -0
- package/tailwind/routes/account/orders/index.tsx.txt +86 -0
- package/tailwind/routes/account/orders/loader.ts.txt +66 -0
- package/tailwind/routes/account/orders/single/OrderActions.tsx.txt +197 -0
- package/tailwind/routes/account/orders/single/OrderHeader.tsx.txt +143 -0
- package/tailwind/routes/account/orders/single/OrderItemRow.tsx.txt +209 -0
- package/tailwind/routes/account/orders/single/OrderSections.tsx.txt +215 -0
- package/tailwind/routes/account/orders/single/types.ts.txt +38 -0
- package/tailwind/routes/account/orders/types.ts.txt +29 -0
- package/tailwind/routes/account/profile/ProfilePage.tsx.txt +30 -0
- package/tailwind/routes/account/profile/index.tsx.txt +39 -0
- package/tailwind/routes/account/profile/loader.ts.txt +16 -0
- package/tailwind/routes/account/profile/types.ts.txt +5 -0
- package/tailwind/routes/account/settings/SettingsPage.tsx.txt +13 -0
- package/tailwind/routes/account/settings/index.tsx.txt +39 -0
- package/tailwind/routes/account/settings/loader.ts.txt +13 -0
- package/tailwind/routes/account/settings/types.ts.txt +5 -0
- package/tailwind/routes/account/types.ts.txt +320 -0
- package/tailwind/routes/account/wallet/WalletPage.tsx.txt +195 -0
- package/tailwind/routes/account/wallet/index.tsx.txt +38 -0
- package/tailwind/routes/account/wallet/loader.ts.txt +27 -0
- package/tailwind/routes/account/wallet/types.ts.txt +11 -0
- package/tailwind/routes/account/wishlist/WishlistPage.tsx.txt +314 -0
- package/tailwind/routes/account/wishlist/WishlistShare.tsx.txt +248 -0
- package/tailwind/routes/account/wishlist/index.tsx.txt +40 -0
- package/tailwind/routes/account/wishlist/loader.ts.txt +26 -0
- package/tailwind/routes/account/wishlist/types.ts.txt +9 -0
- package/tailwind/routes/blog/BlogAuthorPage.tsx.txt +82 -0
- package/tailwind/routes/blog/BlogCategoryPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogPage.tsx.txt +191 -0
- package/tailwind/routes/blog/BlogSinglePage.tsx.txt +168 -0
- package/tailwind/routes/blog/BlogTagPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogTags.tsx.txt +54 -0
- package/tailwind/routes/blog/components.tsx.txt +87 -0
- package/tailwind/routes/blog/index.tsx.txt +238 -0
- package/tailwind/routes/blog/loader.ts.txt +173 -0
- package/tailwind/routes/blog/types.ts.txt +106 -0
- package/tailwind/routes/brands/BrandsPage.tsx.txt +179 -0
- package/tailwind/routes/brands/index.tsx.txt +47 -0
- package/tailwind/routes/brands/loader.ts.txt +14 -0
- package/tailwind/routes/brands/types.ts.txt +53 -0
- package/tailwind/routes/cart/CartPage.tsx.txt +112 -0
- package/tailwind/routes/cart/index.tsx.txt +39 -0
- package/tailwind/routes/cart/loader.ts.txt +15 -0
- package/tailwind/routes/cart/types.ts.txt +6 -0
- package/tailwind/routes/home/HomePage.tsx.txt +53 -0
- package/tailwind/routes/home/index.tsx.txt +56 -0
- package/tailwind/routes/home/loader.ts.txt +24 -0
- package/tailwind/routes/home/types.ts.txt +11 -0
- package/tailwind/routes/index.ts.txt +94 -0
- package/tailwind/routes/lazy.ts.txt +105 -0
- package/tailwind/routes/loyalty/LoyaltyPage.tsx.txt +17 -0
- package/tailwind/routes/loyalty/LoyaltyPointsPage.tsx.txt +11 -0
- package/tailwind/routes/loyalty/index.tsx.txt +81 -0
- package/tailwind/routes/loyalty/loader.ts.txt +53 -0
- package/tailwind/routes/loyalty/types.ts.txt +109 -0
- package/tailwind/routes/not-found.tsx.txt +50 -0
- package/tailwind/routes/page/PageSingle.tsx.txt +34 -0
- package/tailwind/routes/page/index.tsx.txt +60 -0
- package/tailwind/routes/page/loader.ts.txt +19 -0
- package/tailwind/routes/page/types.ts.txt +34 -0
- package/tailwind/routes/product/ProductPage.tsx.txt +77 -0
- package/tailwind/routes/product/index.tsx.txt +157 -0
- package/tailwind/routes/product/loader.ts.txt +35 -0
- package/tailwind/routes/product/types.ts.txt +6 -0
- package/tailwind/routes/product-listing/ProductListPage.tsx.txt +321 -0
- package/tailwind/routes/product-listing/index.tsx.txt +95 -0
- package/tailwind/routes/product-listing/loader.ts.txt +323 -0
- package/tailwind/routes/product-listing/types.ts.txt +96 -0
- package/tailwind/routes/product-listing/useAppliedFilters.ts.txt +130 -0
- package/tailwind/routes/product-short-link.ts.txt +104 -0
- package/tailwind/routes/root/beforeLoad.ts.txt +354 -0
- package/tailwind/routes/root/head.ts.txt +424 -0
- package/tailwind/routes/root/index.ts.txt +2 -0
- package/tailwind/routes/seo-redirects.ts.txt +82 -0
- package/tailwind/routes/testimonials/ReviewsPage.tsx.txt +12 -0
- package/tailwind/routes/testimonials/TestimonialsPage.tsx.txt +80 -0
- package/tailwind/routes/testimonials/index.tsx.txt +80 -0
- package/tailwind/routes/testimonials/loader.ts.txt +29 -0
- package/tailwind/routes/testimonials/types.ts.txt +9 -0
- package/tailwind/routes/thank-you/ThankYouPage.tsx.txt +241 -0
- package/tailwind/routes/thank-you/index.tsx.txt +49 -0
- package/tailwind/routes/thank-you/loader.ts.txt +40 -0
- package/tailwind/routes/thank-you/types.ts.txt +16 -0
- package/tailwind/routes/types.ts.txt +41 -0
- package/dist/BlogAuthorPage-LFAUMKC7.js.map +0 -1
- package/dist/BlogCategoryPage-NWYFFPCD.js.map +0 -1
- package/dist/BlogPage-BOHXFV7E.js.map +0 -1
- package/dist/BlogSinglePage-FYEXQPMB.js.map +0 -1
- package/dist/BlogTagPage-DAM3RNVA.js.map +0 -1
- package/dist/BrandsPage-GAKQCE6O.js.map +0 -1
- package/dist/Breadcrumb-NAYSZNRV.js.map +0 -1
- package/dist/CartItem-ZRVLIZT3.js.map +0 -1
- package/dist/CartSummary-U2TVLG35.js.map +0 -1
- package/dist/CustomerLayout-WSKXWI7D.js.map +0 -1
- package/dist/LoyaltyPage-IG5KSYNO.js.map +0 -1
- package/dist/LoyaltyPointsPage-RKO56ZER.js.map +0 -1
- package/dist/MobileMenu-E4X2GOZ3.js.map +0 -1
- package/dist/NotificationsPage-BJ5XVWEG.js.map +0 -1
- package/dist/OrderSinglePage-544E36FJ.js.map +0 -1
- package/dist/OrdersPage-AFBWVTZU.js.map +0 -1
- package/dist/ProductDetails-SDZHALU6.js.map +0 -1
- package/dist/ProfilePage-V5KV6GQK.js.map +0 -1
- package/dist/SeoCartWidget-JAV6M3X5.js.map +0 -1
- package/dist/SettingsPage-43SUCLQR.js.map +0 -1
- package/dist/ThankYouPage-52SSZ7FV.js.map +0 -1
- package/dist/WalletPage-4AN4UJ52.js.map +0 -1
- package/dist/WishlistPage-L6IYJUJZ.js.map +0 -1
- package/dist/chunk-3PWARKZX.js.map +0 -1
- package/dist/chunk-4EA56R6I.js +0 -14
- package/dist/chunk-R54GSKJS.js.map +0 -1
- package/dist/chunk-UNEZZMQA.js.map +0 -1
- package/dist/not-found-TUU7WQLL.js.map +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { memo } from 'react';
|
|
2
|
+
import { getCdnImageSrcSet, getCdnImageUrl } from '../../utils/cdn-image';
|
|
3
|
+
|
|
4
|
+
export interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
5
|
+
/** Image source URL */
|
|
6
|
+
src?: string;
|
|
7
|
+
/** Alt text for accessibility */
|
|
8
|
+
alt: string;
|
|
9
|
+
/** Whether this image is above the fold / LCP candidate */
|
|
10
|
+
priority?: boolean;
|
|
11
|
+
/** Aspect ratio for CLS prevention (e.g. "16/9", "1/1", "4/3") */
|
|
12
|
+
aspectRatio?: string;
|
|
13
|
+
/** Object fit mode */
|
|
14
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
15
|
+
/** Mobile image source for <picture> element */
|
|
16
|
+
mobileSrc?: string;
|
|
17
|
+
/** Mobile breakpoint for <source> media query (default: 768px) */
|
|
18
|
+
mobileBreakpoint?: number;
|
|
19
|
+
/** Skip the wrapper div */
|
|
20
|
+
noWrapper?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* CDN widths for a density `srcset`. Pass `sizes` so the browser picks a
|
|
23
|
+
* candidate close to the displayed CSS size.
|
|
24
|
+
*/
|
|
25
|
+
srcSetWidths?: readonly number[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Optimized Image component with native browser lazy loading.
|
|
30
|
+
*
|
|
31
|
+
* - Uses `loading="lazy"` + `decoding="async"` by default for below-the-fold images.
|
|
32
|
+
* - Uses `loading="eager"` + `fetchPriority="high"` for priority (above-the-fold / LCP) images.
|
|
33
|
+
* - Supports responsive `<picture>` with mobile source.
|
|
34
|
+
* - Provides `aspectRatio` for CLS prevention.
|
|
35
|
+
* - When `srcSetWidths` + `sizes` are set, emits a sized CDN `srcset`.
|
|
36
|
+
*/
|
|
37
|
+
export const Image = memo(function Image({
|
|
38
|
+
src,
|
|
39
|
+
alt,
|
|
40
|
+
priority = false,
|
|
41
|
+
aspectRatio,
|
|
42
|
+
objectFit = 'cover',
|
|
43
|
+
mobileSrc,
|
|
44
|
+
mobileBreakpoint = 768,
|
|
45
|
+
noWrapper = false,
|
|
46
|
+
className = '',
|
|
47
|
+
style,
|
|
48
|
+
width,
|
|
49
|
+
height,
|
|
50
|
+
sizes,
|
|
51
|
+
srcSet: srcSetProp,
|
|
52
|
+
srcSetWidths,
|
|
53
|
+
...rest
|
|
54
|
+
}: ImageProps) {
|
|
55
|
+
if (!src) return null;
|
|
56
|
+
|
|
57
|
+
const generatedSrcSet =
|
|
58
|
+
srcSetProp || (srcSetWidths?.length ? getCdnImageSrcSet(src, srcSetWidths) : undefined);
|
|
59
|
+
const generatedMobileSrcSet =
|
|
60
|
+
srcSetWidths?.length && mobileSrc ? getCdnImageSrcSet(mobileSrc, srcSetWidths) : undefined;
|
|
61
|
+
const cdnWidth = srcSetWidths?.length
|
|
62
|
+
? width != null && srcSetWidths.includes(Number(width))
|
|
63
|
+
? Number(width)
|
|
64
|
+
: srcSetWidths[0]
|
|
65
|
+
: width;
|
|
66
|
+
// Width-only CDN URLs so `src` matches a srcset candidate for preload.
|
|
67
|
+
const cdnOptions = generatedSrcSet ? { width: cdnWidth } : { width: cdnWidth, height };
|
|
68
|
+
|
|
69
|
+
const optimizedSrc = getCdnImageUrl(src, cdnOptions);
|
|
70
|
+
const optimizedMobileSrc = getCdnImageUrl(mobileSrc, cdnOptions);
|
|
71
|
+
|
|
72
|
+
const objectFitClass = `object-${objectFit}`;
|
|
73
|
+
const imgClasses = [className, objectFitClass].filter(Boolean).join(' ');
|
|
74
|
+
|
|
75
|
+
const loadingProps: React.ImgHTMLAttributes<HTMLImageElement> = priority
|
|
76
|
+
? { loading: 'eager' as const, fetchPriority: 'high' as const, decoding: 'sync' as const }
|
|
77
|
+
: { loading: 'lazy' as const, decoding: 'async' as const };
|
|
78
|
+
|
|
79
|
+
const hasWrapper = !noWrapper && !!aspectRatio;
|
|
80
|
+
|
|
81
|
+
const img = (
|
|
82
|
+
<img
|
|
83
|
+
src={optimizedSrc}
|
|
84
|
+
alt={alt}
|
|
85
|
+
className={imgClasses}
|
|
86
|
+
width={width}
|
|
87
|
+
height={height}
|
|
88
|
+
sizes={sizes}
|
|
89
|
+
srcSet={generatedSrcSet}
|
|
90
|
+
// With a wrapper, `style` goes to the wrapper; otherwise it must land on the <img>.
|
|
91
|
+
style={hasWrapper ? undefined : style}
|
|
92
|
+
{...loadingProps}
|
|
93
|
+
{...rest}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const imgElement = optimizedMobileSrc ? (
|
|
98
|
+
<picture>
|
|
99
|
+
<source
|
|
100
|
+
media={`(max-width: ${mobileBreakpoint}px)`}
|
|
101
|
+
srcSet={generatedMobileSrcSet || optimizedMobileSrc}
|
|
102
|
+
sizes={generatedMobileSrcSet ? sizes : undefined}
|
|
103
|
+
/>
|
|
104
|
+
{img}
|
|
105
|
+
</picture>
|
|
106
|
+
) : (
|
|
107
|
+
img
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
if (!hasWrapper) {
|
|
111
|
+
return imgElement;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<div className="relative overflow-hidden" style={{ aspectRatio, ...style }}>
|
|
116
|
+
{imgElement}
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { useLinkAdapter } from '../../providers/LinkProvider';
|
|
3
|
+
import type { BaseLinkProps } from './Link.types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Framework-agnostic Link component.
|
|
7
|
+
*
|
|
8
|
+
* Uses the LinkProvider context to render the framework-specific Link adapter.
|
|
9
|
+
* Works with TanStack Router, Next.js, or any configured adapter.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Basic usage
|
|
14
|
+
* <Link to="/products">View Products</Link>
|
|
15
|
+
*
|
|
16
|
+
* // With preloading
|
|
17
|
+
* <Link to="/product/123" preload="intent">Product Details</Link>
|
|
18
|
+
*
|
|
19
|
+
* // With styling
|
|
20
|
+
* <Link to="/cart" className="nav-link" style={{ fontWeight: 'bold' }}>Cart</Link>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export const Link = forwardRef<HTMLAnchorElement, BaseLinkProps>(
|
|
24
|
+
({ to, href, children, ...props }, ref) => {
|
|
25
|
+
const Adapter = useLinkAdapter();
|
|
26
|
+
const destination = to ?? href ?? '/';
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Adapter ref={ref} to={destination} {...props} data-spa-link="">
|
|
30
|
+
{children}
|
|
31
|
+
</Adapter>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
Link.displayName = 'Link';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ReactNode, CSSProperties, MouseEventHandler, Ref } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Preload behavior for Link component
|
|
5
|
+
*/
|
|
6
|
+
export type LinkPreload = 'intent' | 'render' | false;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Framework-agnostic Link props.
|
|
10
|
+
* Supported across TanStack Router, Next.js, and other React frameworks.
|
|
11
|
+
*/
|
|
12
|
+
export interface BaseLinkProps {
|
|
13
|
+
/**
|
|
14
|
+
* The destination path
|
|
15
|
+
*/
|
|
16
|
+
to?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Alternative to `to` - supported for compatibility
|
|
19
|
+
*/
|
|
20
|
+
href?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Children elements
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Optional className for styling
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Inline styles
|
|
31
|
+
*/
|
|
32
|
+
style?: CSSProperties;
|
|
33
|
+
/**
|
|
34
|
+
* Optional title attribute
|
|
35
|
+
*/
|
|
36
|
+
title?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Target attribute for the anchor
|
|
39
|
+
*/
|
|
40
|
+
target?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Rel attribute for the anchor
|
|
43
|
+
*/
|
|
44
|
+
rel?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Click handler
|
|
47
|
+
*/
|
|
48
|
+
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
49
|
+
/**
|
|
50
|
+
* Preload behavior:
|
|
51
|
+
* - 'intent': Preload on hover/focus (default for TanStack)
|
|
52
|
+
* - 'render': Preload when link renders
|
|
53
|
+
* - false: No preloading
|
|
54
|
+
*/
|
|
55
|
+
preload?: LinkPreload;
|
|
56
|
+
/**
|
|
57
|
+
* Replace current history entry instead of pushing
|
|
58
|
+
*/
|
|
59
|
+
replace?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* ARIA label for accessibility
|
|
62
|
+
*/
|
|
63
|
+
'aria-label'?: string;
|
|
64
|
+
/**
|
|
65
|
+
* HTML microdata itemProp attribute
|
|
66
|
+
*/
|
|
67
|
+
itemProp?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Ref forwarding
|
|
70
|
+
*/
|
|
71
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Link adapter component type
|
|
76
|
+
*/
|
|
77
|
+
export type LinkAdapter = React.ComponentType<BaseLinkProps>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Props for LinkProvider
|
|
81
|
+
*/
|
|
82
|
+
export interface LinkProviderProps {
|
|
83
|
+
adapter: LinkAdapter;
|
|
84
|
+
children: ReactNode;
|
|
85
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Link } from './Link';
|
|
2
|
+
|
|
3
|
+
interface NoContentProps {
|
|
4
|
+
icon?: string;
|
|
5
|
+
message: string;
|
|
6
|
+
actionLabel?: string;
|
|
7
|
+
actionUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function NoContent({
|
|
11
|
+
icon = 'sicon-shopping-bag',
|
|
12
|
+
message,
|
|
13
|
+
actionLabel,
|
|
14
|
+
actionUrl = '/',
|
|
15
|
+
}: NoContentProps) {
|
|
16
|
+
return (
|
|
17
|
+
<div className="no-content-placeholder">
|
|
18
|
+
<i className={`${icon} icon`}></i>
|
|
19
|
+
<p>{message}</p>
|
|
20
|
+
{actionLabel && (
|
|
21
|
+
<Link to={actionUrl} className="btn btn--outline-primary btn--rounded-full">
|
|
22
|
+
{actionLabel}
|
|
23
|
+
</Link>
|
|
24
|
+
)}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { memo, useState, useEffect, useRef, Suspense, type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
function DefaultSkeleton({ height }: { height: string }) {
|
|
4
|
+
return <div style={{ minHeight: height }} className="animate-pulse rounded bg-gray-100" />;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/** Sibling of the children inside Suspense: its effect only runs once the boundary resolves. */
|
|
8
|
+
function MarkMounted({ onMount }: { onMount: (mounted: boolean) => void }) {
|
|
9
|
+
useEffect(() => onMount(true), [onMount]);
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface RenderWhenVisibleProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
rootMargin?: string;
|
|
16
|
+
placeholder?: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
estimatedHeight?: string;
|
|
20
|
+
renderOnMount?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* RenderWhenVisible — defers mounting children until the container enters the viewport.
|
|
25
|
+
*
|
|
26
|
+
* Children are NOT in the React tree at all until the Intersection Observer fires,
|
|
27
|
+
* so no effects, API calls, or renders happen for off-screen sections.
|
|
28
|
+
* Once rendered, children stay mounted permanently (no re-unmount on scroll away).
|
|
29
|
+
*
|
|
30
|
+
* The `estimatedHeight` prop prevents the zero-height collapse problem: without it
|
|
31
|
+
* every unrendered section stacks at the top with 0px height, causing all observers
|
|
32
|
+
* to fire at once on mount. It applies as a min-height until the children have
|
|
33
|
+
* actually committed — through the Suspense window too, since a custom placeholder
|
|
34
|
+
* may be shorter than the estimate. After that the section's height is owned by its
|
|
35
|
+
* content, so shorter blocks don't leave reserved dead space below them.
|
|
36
|
+
*/
|
|
37
|
+
export const RenderWhenVisible = memo(function RenderWhenVisible({
|
|
38
|
+
children,
|
|
39
|
+
rootMargin = '50px',
|
|
40
|
+
placeholder,
|
|
41
|
+
className,
|
|
42
|
+
id,
|
|
43
|
+
estimatedHeight = '400px',
|
|
44
|
+
renderOnMount = false,
|
|
45
|
+
}: RenderWhenVisibleProps) {
|
|
46
|
+
const ref = useRef<HTMLElement>(null);
|
|
47
|
+
const [visible, setVisible] = useState(renderOnMount);
|
|
48
|
+
const [mounted, setMounted] = useState(false);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (renderOnMount || visible) return;
|
|
52
|
+
const el = ref.current;
|
|
53
|
+
if (!el) return;
|
|
54
|
+
|
|
55
|
+
const observer = new IntersectionObserver(
|
|
56
|
+
(entries) => {
|
|
57
|
+
// A busy main thread (e.g. mounting a page while the user is already
|
|
58
|
+
// scrolling) batches entries; reading only the first drops a
|
|
59
|
+
// [false, true] pair and the observer never fires again.
|
|
60
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
61
|
+
setVisible(true);
|
|
62
|
+
observer.disconnect();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{ rootMargin }
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
observer.observe(el);
|
|
69
|
+
|
|
70
|
+
return () => observer.disconnect();
|
|
71
|
+
}, [renderOnMount, visible, rootMargin]);
|
|
72
|
+
|
|
73
|
+
const fallback = placeholder ?? <DefaultSkeleton height={estimatedHeight} />;
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<section
|
|
77
|
+
ref={!visible ? ref : undefined}
|
|
78
|
+
className={className}
|
|
79
|
+
id={id}
|
|
80
|
+
style={{ minHeight: mounted ? undefined : estimatedHeight }}
|
|
81
|
+
>
|
|
82
|
+
{visible ? (
|
|
83
|
+
<Suspense fallback={fallback}>
|
|
84
|
+
{children}
|
|
85
|
+
<MarkMounted onMount={setMounted} />
|
|
86
|
+
</Suspense>
|
|
87
|
+
) : (
|
|
88
|
+
fallback
|
|
89
|
+
)}
|
|
90
|
+
</section>
|
|
91
|
+
);
|
|
92
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LazyBreadcrumb,
|
|
3
|
+
LazyNoContent,
|
|
4
|
+
LazyRenderWhenVisible,
|
|
5
|
+
LazyCurrencySymbol,
|
|
6
|
+
LazyErrorPage,
|
|
7
|
+
} from './lazy';
|
|
8
|
+
import { Image } from './Image';
|
|
9
|
+
import { Link } from './Link';
|
|
10
|
+
|
|
11
|
+
// Lazy-loaded common components (code-split)
|
|
12
|
+
export {
|
|
13
|
+
LazyBreadcrumb as Breadcrumb,
|
|
14
|
+
LazyNoContent as NoContent,
|
|
15
|
+
LazyRenderWhenVisible as RenderWhenVisible,
|
|
16
|
+
LazyCurrencySymbol as CurrencySymbol,
|
|
17
|
+
LazyErrorPage as ErrorPage,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Eager components (statically imported in multiple places)
|
|
21
|
+
export { Image, Link };
|
|
22
|
+
|
|
23
|
+
// Skeleton components — sourced from @salla.sa/twilight-components-react (kept eager for instant render during loading)
|
|
24
|
+
export {
|
|
25
|
+
PageSkeleton,
|
|
26
|
+
ProductDetailSkeleton,
|
|
27
|
+
BlogSkeleton,
|
|
28
|
+
BreadcrumbSkeleton,
|
|
29
|
+
ProductCardSkeleton,
|
|
30
|
+
ProductGridSkeleton,
|
|
31
|
+
SkeletonPulse,
|
|
32
|
+
CustomerPageSkeleton,
|
|
33
|
+
CustomerLayoutSkeleton,
|
|
34
|
+
} from '@salla.sa/twilight-components-react';
|
|
35
|
+
export type { PageSkeletonProps } from '@salla.sa/twilight-components-react';
|
|
36
|
+
|
|
37
|
+
// DeferredData - React 19 Suspense + use() pattern (eager, lightweight)
|
|
38
|
+
export { DeferredData, resolveDeferred } from './DeferredData';
|
|
39
|
+
export type { DeferredDataProps } from './DeferredData';
|
|
40
|
+
|
|
41
|
+
// Shared types (exported for external use)
|
|
42
|
+
export type { BaseLinkProps as LinkProps, LinkPreload } from './Link.types';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lazy-loaded common components
|
|
5
|
+
* Use these for code-splitting non-critical components
|
|
6
|
+
*
|
|
7
|
+
* NOTE: Skeleton components are sourced from @salla.sa/twilight-components-react
|
|
8
|
+
* because they must render instantly during route transitions.
|
|
9
|
+
*/
|
|
10
|
+
export const LazyBreadcrumb = lazy(() =>
|
|
11
|
+
import('./Breadcrumb').then((m) => ({ default: m.Breadcrumb }))
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const LazyNoContent = lazy(() =>
|
|
15
|
+
import('./NoContent').then((m) => ({ default: m.NoContent }))
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const LazyRenderWhenVisible = lazy(() =>
|
|
19
|
+
import('./RenderWhenVisible').then((m) => ({ default: m.RenderWhenVisible }))
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const LazyCurrencySymbol = lazy(() =>
|
|
23
|
+
import('./CurrencySymbol').then((m) => ({ default: m.CurrencySymbol }))
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const LazyErrorPage = lazy(() =>
|
|
27
|
+
import('./ErrorPage').then((m) => ({ default: m.ErrorPage }))
|
|
28
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { registry } from './ComponentRegistry';
|
|
2
|
+
import type { ComponentType } from '../types';
|
|
3
|
+
|
|
4
|
+
interface DefineComponentConfig<P = Record<string, unknown>> {
|
|
5
|
+
name: string;
|
|
6
|
+
component: ComponentType<P>;
|
|
7
|
+
override?: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function defineComponent<P = Record<string, unknown>>(
|
|
11
|
+
config: DefineComponentConfig<P>
|
|
12
|
+
): ComponentType<P> {
|
|
13
|
+
if (config.override) {
|
|
14
|
+
registry.override(config.name, config.component);
|
|
15
|
+
} else {
|
|
16
|
+
registry.register(config.name, config.component);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return config.component;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function registerComponents(components: Record<string, ComponentType>): void {
|
|
23
|
+
for (const [name, component] of Object.entries(components)) {
|
|
24
|
+
registry.register(name, component);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function overrideComponents(components: Record<string, ComponentType>): void {
|
|
29
|
+
for (const [name, component] of Object.entries(components)) {
|
|
30
|
+
registry.override(name, component);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drawer Component
|
|
3
|
+
*
|
|
4
|
+
* A slide-in panel from the side of the screen, commonly used for mobile menus.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useEffect, useCallback, useRef, type ReactNode, type HTMLAttributes } from 'react';
|
|
8
|
+
import { createPortal } from 'react-dom';
|
|
9
|
+
import { useTwilight } from '../../providers/TwilightProvider';
|
|
10
|
+
|
|
11
|
+
export interface DrawerProps {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Width of the drawer
|
|
17
|
+
* @default 'md'
|
|
18
|
+
*/
|
|
19
|
+
size?: 'sm' | 'md' | 'lg' | 'full';
|
|
20
|
+
/**
|
|
21
|
+
* Close drawer when clicking backdrop
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
closeOnBackdropClick?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Close drawer on Escape key
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
closeOnEscape?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Prevent body scroll when drawer is open
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
preventBodyScroll?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Additional className for the drawer content
|
|
37
|
+
*/
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const sizeClasses = {
|
|
42
|
+
sm: 'w-64',
|
|
43
|
+
md: 'w-80',
|
|
44
|
+
lg: 'w-96',
|
|
45
|
+
full: 'w-full',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export function Drawer({
|
|
49
|
+
isOpen,
|
|
50
|
+
onClose,
|
|
51
|
+
children,
|
|
52
|
+
size = 'md',
|
|
53
|
+
closeOnBackdropClick = true,
|
|
54
|
+
closeOnEscape = true,
|
|
55
|
+
preventBodyScroll = true,
|
|
56
|
+
className,
|
|
57
|
+
}: DrawerProps) {
|
|
58
|
+
const drawerRef = useRef<HTMLDivElement>(null);
|
|
59
|
+
const previousActiveElement = useRef<HTMLElement | null>(null);
|
|
60
|
+
// Use TwilightProvider to get theme direction
|
|
61
|
+
// Position is automatically determined: left for LTR, right for RTL
|
|
62
|
+
const { theme } = useTwilight();
|
|
63
|
+
const isRtl = theme?.is_rtl ?? false;
|
|
64
|
+
const position = isRtl ? 'right' : 'left';
|
|
65
|
+
|
|
66
|
+
// Handle Escape key
|
|
67
|
+
const handleKeyDown = useCallback(
|
|
68
|
+
(event: KeyboardEvent) => {
|
|
69
|
+
if (event.key === 'Escape' && closeOnEscape) {
|
|
70
|
+
onClose();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[closeOnEscape, onClose]
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
// Handle backdrop click
|
|
77
|
+
const handleBackdropClick = useCallback(
|
|
78
|
+
(_event: React.MouseEvent) => {
|
|
79
|
+
if (closeOnBackdropClick) {
|
|
80
|
+
onClose();
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
[closeOnBackdropClick, onClose]
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// Focus management and body scroll
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (isOpen) {
|
|
89
|
+
// Store the previously focused element
|
|
90
|
+
previousActiveElement.current = document.activeElement as HTMLElement;
|
|
91
|
+
|
|
92
|
+
// Focus the drawer
|
|
93
|
+
drawerRef.current?.focus();
|
|
94
|
+
|
|
95
|
+
// Prevent body scroll
|
|
96
|
+
if (preventBodyScroll) {
|
|
97
|
+
document.body.classList.add('menu-opened');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Add keyboard listener
|
|
101
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return () => {
|
|
105
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
106
|
+
|
|
107
|
+
// Restore body scroll
|
|
108
|
+
if (preventBodyScroll) {
|
|
109
|
+
document.body.classList.remove('menu-opened');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Restore focus
|
|
113
|
+
previousActiveElement.current?.focus();
|
|
114
|
+
};
|
|
115
|
+
}, [isOpen, handleKeyDown, preventBodyScroll]);
|
|
116
|
+
|
|
117
|
+
if (!isOpen || typeof document === 'undefined') {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Translate classes: left drawer slides from -100%, right drawer slides from +100%
|
|
122
|
+
const translateClass = isOpen
|
|
123
|
+
? 'translate-x-0'
|
|
124
|
+
: position === 'left'
|
|
125
|
+
? '-translate-x-full'
|
|
126
|
+
: 'translate-x-full';
|
|
127
|
+
|
|
128
|
+
return createPortal(
|
|
129
|
+
<div className="fixed inset-0 z-[200]" aria-modal="true" role="dialog">
|
|
130
|
+
{/* Backdrop */}
|
|
131
|
+
<div
|
|
132
|
+
className={`absolute inset-0 bg-black/50 transition-opacity duration-300 ${isOpen ? 'opacity-100' : 'opacity-0'}`}
|
|
133
|
+
onClick={handleBackdropClick}
|
|
134
|
+
onKeyDown={(e) => {
|
|
135
|
+
if ((e.key === 'Enter' || e.key === ' ') && closeOnBackdropClick) {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
onClose();
|
|
138
|
+
}
|
|
139
|
+
}}
|
|
140
|
+
role="presentation"
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
{/* Drawer Content */}
|
|
144
|
+
<div
|
|
145
|
+
ref={drawerRef}
|
|
146
|
+
tabIndex={-1}
|
|
147
|
+
className={`fixed top-0 bottom-0 flex flex-col bg-white shadow-xl ${sizeClasses[size]} ${position === 'left' ? 'left-0' : 'right-0'} transform transition-transform duration-300 ease-out ${translateClass} ${className || ''}`}
|
|
148
|
+
>
|
|
149
|
+
{children}
|
|
150
|
+
</div>
|
|
151
|
+
</div>,
|
|
152
|
+
document.body
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Drawer Sub-components
|
|
157
|
+
export interface DrawerHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
158
|
+
children: ReactNode;
|
|
159
|
+
showCloseButton?: boolean;
|
|
160
|
+
onClose?: () => void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
Drawer.Header = function DrawerHeader({
|
|
164
|
+
children,
|
|
165
|
+
showCloseButton = true,
|
|
166
|
+
onClose,
|
|
167
|
+
className,
|
|
168
|
+
...props
|
|
169
|
+
}: DrawerHeaderProps) {
|
|
170
|
+
return (
|
|
171
|
+
<div
|
|
172
|
+
className={`flex items-center justify-between border-b border-gray-200 px-4 py-3 ${className || ''}`}
|
|
173
|
+
{...props}
|
|
174
|
+
>
|
|
175
|
+
<h2 className="text-lg font-semibold text-gray-900">{children}</h2>
|
|
176
|
+
{showCloseButton && onClose && (
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
onClick={onClose}
|
|
180
|
+
className="rounded-md p-2 text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-500"
|
|
181
|
+
>
|
|
182
|
+
<span className="sr-only">Close</span>
|
|
183
|
+
<svg className="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
184
|
+
<path
|
|
185
|
+
strokeLinecap="round"
|
|
186
|
+
strokeLinejoin="round"
|
|
187
|
+
strokeWidth={2}
|
|
188
|
+
d="M6 18L18 6M6 6l12 12"
|
|
189
|
+
/>
|
|
190
|
+
</svg>
|
|
191
|
+
</button>
|
|
192
|
+
)}
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export interface DrawerBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
198
|
+
children: ReactNode;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
Drawer.Body = function DrawerBody({ children, className, ...props }: DrawerBodyProps) {
|
|
202
|
+
return (
|
|
203
|
+
<div className={`flex-1 overflow-y-auto px-4 py-3 ${className || ''}`} {...props}>
|
|
204
|
+
{children}
|
|
205
|
+
</div>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export interface DrawerFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
210
|
+
children: ReactNode;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
Drawer.Footer = function DrawerFooter({ children, className, ...props }: DrawerFooterProps) {
|
|
214
|
+
return (
|
|
215
|
+
<div className={`border-t border-gray-200 px-4 py-3 ${className || ''}`} {...props}>
|
|
216
|
+
{children}
|
|
217
|
+
</div>
|
|
218
|
+
);
|
|
219
|
+
};
|