cloudcommerce 0.21.0 → 0.22.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.
Files changed (188) hide show
  1. package/.gitmodules +3 -0
  2. package/.nvmrc +1 -0
  3. package/.vscode/settings.json +2 -1
  4. package/CHANGELOG.md +36 -0
  5. package/action.yml +37 -13
  6. package/ecomplus-stores/iluminim/.devcontainer/devcontainer.json +30 -0
  7. package/ecomplus-stores/iluminim/.eslintrc.cjs +3 -0
  8. package/ecomplus-stores/iluminim/.firebaserc +5 -0
  9. package/ecomplus-stores/iluminim/.github/renovate.json +5 -0
  10. package/ecomplus-stores/iluminim/.github/workflows/build-and-deploy.yml +36 -0
  11. package/ecomplus-stores/iluminim/.github/workflows/calibreapp-image-actions.yml +23 -0
  12. package/ecomplus-stores/iluminim/.gitpod.yml +12 -0
  13. package/ecomplus-stores/iluminim/.nvmrc +1 -0
  14. package/ecomplus-stores/iluminim/.vscode/extensions.json +8 -0
  15. package/ecomplus-stores/iluminim/.vscode/launch.json +11 -0
  16. package/ecomplus-stores/iluminim/.vscode/settings.json +10 -0
  17. package/ecomplus-stores/iluminim/README.md +113 -0
  18. package/ecomplus-stores/iluminim/README.pt-BR.md +113 -0
  19. package/ecomplus-stores/iluminim/functions/config.json +3 -0
  20. package/ecomplus-stores/iluminim/functions/example.env +10 -0
  21. package/ecomplus-stores/iluminim/functions/many/index.js +14 -0
  22. package/ecomplus-stores/iluminim/functions/many/package.json +22 -0
  23. package/ecomplus-stores/iluminim/functions/ssr/.eslintrc.cjs +6 -0
  24. package/ecomplus-stores/iluminim/functions/ssr/astro.config.mjs +4 -0
  25. package/ecomplus-stores/iluminim/functions/ssr/content/blog/.gitkeep +0 -0
  26. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/.gitkeep +0 -0
  27. package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +33 -0
  28. package/ecomplus-stores/iluminim/functions/ssr/content/pages/home.json +70 -0
  29. package/ecomplus-stores/iluminim/functions/ssr/content/settings.json +49 -0
  30. package/ecomplus-stores/iluminim/functions/ssr/index.js +18 -0
  31. package/ecomplus-stores/iluminim/functions/ssr/package.json +31 -0
  32. package/ecomplus-stores/iluminim/functions/ssr/public/admin/.gitkeep +2 -0
  33. package/ecomplus-stores/iluminim/functions/ssr/public/img/icon.png +0 -0
  34. package/ecomplus-stores/iluminim/functions/ssr/public/img/large-icon.png +0 -0
  35. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner-chamada-desktop-9x81zmd91q.webp +0 -0
  36. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/banner2.webp +0 -0
  37. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/chamada-mobile-q1c6om6jx4.webp +0 -0
  38. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/ecom-icon.png +0 -0
  39. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/headphone.webp +0 -0
  40. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/logo.webp +0 -0
  41. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/og-image.png +0 -0
  42. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/passion.webp +0 -0
  43. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect8589.png +0 -0
  44. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect859.png +0 -0
  45. package/ecomplus-stores/iluminim/functions/ssr/public/img/uploads/rect89.webp +0 -0
  46. package/ecomplus-stores/iluminim/functions/ssr/public/robots.txt +8 -0
  47. package/ecomplus-stores/iluminim/functions/ssr/scripts/build.sh +14 -0
  48. package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +65 -0
  49. package/ecomplus-stores/iluminim/functions/ssr/src/components/AccountMenu.vue +104 -0
  50. package/ecomplus-stores/iluminim/functions/ssr/src/components/Banner.vue +59 -0
  51. package/ecomplus-stores/iluminim/functions/ssr/src/components/BannersGrid.astro +25 -0
  52. package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +35 -0
  53. package/ecomplus-stores/iluminim/functions/ssr/src/components/Countdown.vue +79 -0
  54. package/ecomplus-stores/iluminim/functions/ssr/src/components/HeroSlider.vue +52 -0
  55. package/ecomplus-stores/iluminim/functions/ssr/src/components/PitchBar.vue +57 -0
  56. package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +96 -0
  57. package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductCard.vue +118 -0
  58. package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductShelf.vue +60 -0
  59. package/ecomplus-stores/iluminim/functions/ssr/src/components/ProductsCountdown.vue +20 -0
  60. package/ecomplus-stores/iluminim/functions/ssr/src/components/SearchModal.vue +6 -0
  61. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +137 -0
  62. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderMenu.vue +58 -0
  63. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeaderSubmenu.vue +88 -0
  64. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenav.vue +61 -0
  65. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopSidenavCategory.vue +78 -0
  66. package/ecomplus-stores/iluminim/functions/ssr/src/env.d.ts +13 -0
  67. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Base.astro +16 -0
  68. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/Checkout.astro +0 -0
  69. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +33 -0
  70. package/ecomplus-stores/iluminim/functions/ssr/src/main/Fallback.astro +10 -0
  71. package/ecomplus-stores/iluminim/functions/ssr/src/main/Home.astro +49 -0
  72. package/ecomplus-stores/iluminim/functions/ssr/src/main/Sections.astro +42 -0
  73. package/ecomplus-stores/iluminim/functions/ssr/src/main/Wildcard.astro +18 -0
  74. package/ecomplus-stores/iluminim/functions/ssr/src/pages/[...slug].astro +40 -0
  75. package/ecomplus-stores/iluminim/functions/ssr/src/pages/_vue.ts +3 -0
  76. package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/account.astro +0 -0
  77. package/ecomplus-stores/iluminim/functions/ssr/src/pages/app/index.astro +0 -0
  78. package/ecomplus-stores/iluminim/functions/ssr/src/pages/fallback.astro +25 -0
  79. package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +35 -0
  80. package/ecomplus-stores/iluminim/functions/ssr/src/scripts/InlineScripts.astro +10 -0
  81. package/ecomplus-stores/iluminim/functions/ssr/tailwind.config.cjs +13 -0
  82. package/ecomplus-stores/iluminim/functions/ssr/tsconfig.json +12 -0
  83. package/ecomplus-stores/iluminim/functions/ssr/uno.config.cjs +5 -0
  84. package/ecomplus-stores/iluminim/functions/with-apps/index.js +12 -0
  85. package/ecomplus-stores/iluminim/functions/with-apps/package.json +22 -0
  86. package/ecomplus-stores/iluminim/package.json +28 -0
  87. package/ecomplus-stores/iluminim/scripts/install.sh +14 -0
  88. package/ecomplus-stores/monocard/.eslintrc.cjs +3 -0
  89. package/ecomplus-stores/monocard/.nvmrc +1 -0
  90. package/ecomplus-stores/tia-sonia/.eslintrc.cjs +3 -0
  91. package/ecomplus-stores/tia-sonia/.nvmrc +1 -0
  92. package/package.json +6 -6
  93. package/packages/api/package.json +1 -1
  94. package/packages/api/types.d.ts +1 -1
  95. package/packages/apps/affilate-program/package.json +1 -1
  96. package/packages/apps/correios/package.json +1 -1
  97. package/packages/apps/custom-payment/package.json +1 -1
  98. package/packages/apps/custom-shipping/package.json +1 -1
  99. package/packages/apps/datafrete/package.json +1 -1
  100. package/packages/apps/discounts/package.json +1 -1
  101. package/packages/apps/emails/package.json +1 -1
  102. package/packages/apps/fb-conversions/package.json +2 -2
  103. package/packages/apps/flash-courier/package.json +1 -1
  104. package/packages/apps/frenet/package.json +1 -1
  105. package/packages/apps/galaxpay/package.json +1 -1
  106. package/packages/apps/google-analytics/package.json +1 -1
  107. package/packages/apps/jadlog/package.json +1 -1
  108. package/packages/apps/loyalty-points/package.json +1 -1
  109. package/packages/apps/melhor-envio/package.json +1 -1
  110. package/packages/apps/mercadopago/package.json +1 -1
  111. package/packages/apps/pagarme/package.json +1 -1
  112. package/packages/apps/paghiper/package.json +1 -1
  113. package/packages/apps/pix/package.json +1 -1
  114. package/packages/apps/tiny-erp/package.json +1 -1
  115. package/packages/apps/webhooks/package.json +1 -1
  116. package/packages/cli/lib/build.js +15 -4
  117. package/packages/cli/lib/cli.js +3 -3
  118. package/packages/cli/package.json +1 -1
  119. package/packages/cli/src/build.ts +17 -4
  120. package/packages/cli/src/cli.ts +3 -3
  121. package/packages/config/package.json +1 -1
  122. package/packages/emails/package.json +1 -1
  123. package/packages/events/package.json +1 -1
  124. package/packages/feeds/package.json +1 -1
  125. package/packages/firebase/package.json +1 -1
  126. package/packages/i18n/lib/dirname.js +3 -1
  127. package/packages/i18n/lib/dirname.js.map +1 -1
  128. package/packages/i18n/lib/en_us/i19hour.txt +1 -0
  129. package/packages/i18n/lib/en_us/i19hours.txt +1 -0
  130. package/packages/i18n/lib/en_us/i19milliseconds.txt +1 -0
  131. package/packages/i18n/lib/en_us/i19minute.txt +1 -0
  132. package/packages/i18n/lib/en_us/i19minutes.txt +1 -0
  133. package/packages/i18n/lib/en_us/i19second.txt +1 -0
  134. package/packages/i18n/lib/en_us/i19seconds.txt +1 -0
  135. package/packages/i18n/lib/en_us.d.ts +7 -0
  136. package/packages/i18n/lib/en_us.js +7 -0
  137. package/packages/i18n/lib/en_us.js.map +1 -1
  138. package/packages/i18n/lib/pt_br/i19home.txt +1 -1
  139. package/packages/i18n/lib/pt_br/i19hour.txt +1 -0
  140. package/packages/i18n/lib/pt_br/i19hours.txt +1 -0
  141. package/packages/i18n/lib/pt_br/i19milliseconds.txt +1 -0
  142. package/packages/i18n/lib/pt_br/i19minute.txt +1 -0
  143. package/packages/i18n/lib/pt_br/i19minutes.txt +1 -0
  144. package/packages/i18n/lib/pt_br/i19second.txt +1 -0
  145. package/packages/i18n/lib/pt_br/i19seconds.txt +1 -0
  146. package/packages/i18n/lib/pt_br.d.ts +8 -1
  147. package/packages/i18n/lib/pt_br.js +8 -1
  148. package/packages/i18n/lib/pt_br.js.map +1 -1
  149. package/packages/i18n/package.json +1 -1
  150. package/packages/i18n/scripts/build-txt.mjs +2 -1
  151. package/packages/i18n/src/dirname.ts +3 -1
  152. package/packages/i18n/src/en_us.ts +7 -0
  153. package/packages/i18n/src/pt_br.ts +8 -1
  154. package/packages/modules/package.json +1 -1
  155. package/packages/passport/package.json +1 -1
  156. package/packages/ssr/package.json +2 -2
  157. package/packages/storefront/.eslintrc.cjs +8 -1
  158. package/packages/storefront/astro.config.mjs +2 -1
  159. package/packages/storefront/dist/client/_astro/HeroSlider.0890631f.js +1 -0
  160. package/packages/storefront/dist/client/_astro/{_...slug_.c85b8978.css → _...slug_.2f4f6929.css} +1 -1
  161. package/packages/storefront/dist/client/assets/.gitkeep +2 -0
  162. package/packages/storefront/dist/client/sw.js +1 -1
  163. package/packages/storefront/dist/server/chunks/{_...49a92e87.mjs → _...d496b072.mjs} +4 -4
  164. package/packages/storefront/dist/server/chunks/{account@_@astro.5388531b.mjs → account@_@astro.1b311a3d.mjs} +4 -4
  165. package/packages/storefront/dist/server/chunks/{astro.161c5a41.mjs → astro.e0968ba7.mjs} +841 -765
  166. package/packages/storefront/dist/server/chunks/{endpoint@_@js.fe113d0d.mjs → endpoint@_@js.631ff6c5.mjs} +4 -4
  167. package/packages/storefront/dist/server/chunks/{fallback@_@astro.23b17e3d.mjs → fallback@_@astro.12cf85ba.mjs} +4 -4
  168. package/packages/storefront/dist/server/chunks/{index@_@astro.2527898d.mjs → index@_@astro.69eb5e8a.mjs} +4 -4
  169. package/packages/storefront/dist/server/chunks/{index@_@astro.433809ce.mjs → index@_@astro.a20d91aa.mjs} +4 -4
  170. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.1d0e7f10.mjs → _...slug_.astro.c93fc36d.mjs} +12 -12
  171. package/packages/storefront/dist/server/chunks/pages/{account.astro.7539e037.mjs → account.astro.0003ca94.mjs} +3 -3
  172. package/packages/storefront/dist/server/chunks/pages/{endpoint.js.b71736ca.mjs → endpoint.js.630b1212.mjs} +1 -1
  173. package/packages/storefront/dist/server/chunks/pages/{fallback.astro.15292657.mjs → fallback.astro.58c7e581.mjs} +5 -5
  174. package/packages/storefront/dist/server/chunks/pages/{index.astro.9592fbd6.mjs → index.astro.6efe85be.mjs} +32 -31
  175. package/packages/storefront/dist/server/entry.mjs +10 -10
  176. package/packages/storefront/dist/server/renderers.mjs +3 -3
  177. package/packages/storefront/package.json +5 -5
  178. package/packages/storefront/src/lib/layouts/use-page-main.ts +18 -5
  179. package/packages/types/package.json +1 -1
  180. package/pnpm-workspace.yaml +2 -2
  181. package/packages/storefront/dist/client/_astro/HeroSlider.eb156f18.js +0 -1
  182. package/packages/storefront/src/lib/composables/use-hero-slider.ts +0 -26
  183. /package/{packages/storefront/dist/client → ecomplus-stores/iluminim/functions/ssr/public}/assets/cms-preview.css +0 -0
  184. /package/{packages/storefront/dist/client → ecomplus-stores/iluminim/functions/ssr/public}/assets/cms.css +0 -0
  185. /package/{packages/storefront/dist/client → ecomplus-stores/iluminim/functions/ssr/public}/assets/cvv.png +0 -0
  186. /package/{packages/storefront/dist/client → ecomplus-stores/iluminim/functions/ssr/public}/assets/img-placeholder.png +0 -0
  187. /package/{packages/storefront/dist/client → ecomplus-stores/iluminim/functions/ssr/public}/assets/payments.png +0 -0
  188. /package/{packages/storefront/dist/client → ecomplus-stores/iluminim/functions/ssr/public}/assets/ssl-safe.png +0 -0
@@ -0,0 +1,70 @@
1
+ {
2
+ "meta_title": "",
3
+ "meta_description": "",
4
+ "hero": {
5
+ "autoplay": 9000,
6
+ "slides": [
7
+ {
8
+ "start": "",
9
+ "end": "",
10
+ "img": "/img/uploads/banner-chamada-desktop-9x81zmd91q.webp",
11
+ "alt": "LED Ofertas - Confira preços imbatíveis",
12
+ "mobile_img": "/img/uploads/chamada-mobile-q1c6om6jx4.webp",
13
+ "href": "",
14
+ "title": "",
15
+ "subtitle": "",
16
+ "button_link": "",
17
+ "button_text": ""
18
+ },
19
+ {
20
+ "start": "",
21
+ "end": "",
22
+ "img": "/img/uploads/rect89.webp",
23
+ "alt": "Headset banner",
24
+ "mobile_img": "/img/uploads/headphone.webp",
25
+ "href": "/headset",
26
+ "title": "20% off on first purchase",
27
+ "subtitle": "At demoStore you can shop the best tech of 2023. Enjoy and get 10% off on your first purchase!",
28
+ "button_link": "/",
29
+ "button_text": "See"
30
+ }
31
+ ]
32
+ },
33
+ "sections": [
34
+ {
35
+ "type": "product-shelf",
36
+ "collection_id": null,
37
+ "sort": "-price_discount",
38
+ "title": "",
39
+ "headless": false,
40
+ "shuffle": false,
41
+ "limit": 12,
42
+ "page": 1
43
+ },
44
+ {
45
+ "type": "banners-grid",
46
+ "banners": [
47
+ {
48
+ "img": "/img/uploads/rect8589.png",
49
+ "href": "/banner-1"
50
+ },
51
+ {
52
+ "img": "/img/uploads/passion.webp",
53
+ "href": "/banner-2"
54
+ },
55
+ {
56
+ "img": "/img/uploads/rect89.webp",
57
+ "href": "/banner-3",
58
+ "mobile_img": "/img/uploads/headphone.webp"
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "type": "c:products-countdown",
64
+ "skus": [
65
+ "PG-RT36WBN-30X60-KIT50",
66
+ "FII4749"
67
+ ]
68
+ }
69
+ ]
70
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "domain": "ecom2iluminim.web.app",
3
+ "name": "Iluminim LED",
4
+ "description": "Iluminim LED",
5
+ "logo": "/img/uploads/logo.webp",
6
+ "icon": "/img/uploads/ecom-icon.png",
7
+ "primary_color": "#d00b11",
8
+ "secondary_color": "#a2373a",
9
+ "email": "",
10
+ "phone": "",
11
+ "address": "",
12
+ "corporate_name": "",
13
+ "doc_number": "",
14
+ "lang": "pt_br",
15
+ "currency": "BRL",
16
+ "currency_symbol": "R$",
17
+ "country_code": "BR",
18
+ "whatsapp": "(31) 9 8272-1558",
19
+ "instagram": "https://www.instagram.com/ecomclub/",
20
+ "facebook": "https://www.facebook.com/ecom.clubpage/",
21
+ "twitter": "",
22
+ "youtube": "https://www.youtube.com/channel/UCBlIxK5JAub0E1EX_qHdzmA",
23
+ "tiktok": "",
24
+ "pinterest": "",
25
+ "modules": {
26
+ "list_payments": {
27
+ "installments_option": {
28
+ "max_number": 12,
29
+ "monthly_interest": 0,
30
+ "min_installment": 5
31
+ },
32
+ "discount_option": {
33
+ "label": "Boleto",
34
+ "apply_at": "subtotal",
35
+ "type": "percentage",
36
+ "value": 5
37
+ },
38
+ "loyalty_points_program": {
39
+ "id": null,
40
+ "name": null,
41
+ "ratio": null,
42
+ "earn_percentage": null
43
+ }
44
+ },
45
+ "calculate_shipping": {
46
+ "free_shipping_from_value": 299.9
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,18 @@
1
+ import config from '@cloudcommerce/firebase/config';
2
+ // eslint-ignore-next-line import/no-unresolved
3
+ import { handler as renderStorefront } from './dist/server/entry.mjs';
4
+ import mergeConfig from './config.json' assert { type: 'json' };
5
+
6
+ config.set({
7
+ ...mergeConfig,
8
+ hello: 'from store',
9
+ /*
10
+ httpsFunctionOptions: {
11
+ minInstances: 1,
12
+ },
13
+ */
14
+ });
15
+
16
+ global.$renderStorefront = renderStorefront;
17
+
18
+ export * from '@cloudcommerce/ssr/firebase';
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "iluminim-ssr",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "astro dev --host",
7
+ "build": "bash scripts/build.sh",
8
+ "build:static": "BUILD_OUTPUT=static astro build",
9
+ "serve": "firebase emulators:start --only functions",
10
+ "shell": "firebase functions:shell",
11
+ "start": "npm run shell",
12
+ "deploy": "firebase deploy --only functions",
13
+ "logs": "firebase functions:log"
14
+ },
15
+ "engines": {
16
+ "node": "18"
17
+ },
18
+ "main": "index.js",
19
+ "dependencies": {
20
+ "@cloudcommerce/api": "^0.22.0",
21
+ "@cloudcommerce/firebase": "^0.22.0",
22
+ "@cloudcommerce/ssr": "^0.22.0"
23
+ },
24
+ "devDependencies": {
25
+ "@cloudcommerce/i18n": "^0.22.0",
26
+ "@cloudcommerce/storefront": "^0.22.0",
27
+ "@cloudcommerce/types": "^0.22.0",
28
+ "@fontsource-variable/heebo": "^5.0.5",
29
+ "@iconify-json/carbon": "^1.1.18"
30
+ }
31
+ }
@@ -0,0 +1,2 @@
1
+ #index.html
2
+ #assets/
@@ -0,0 +1,8 @@
1
+ User-agent: *
2
+ Allow: /
3
+ Disallow: /app/
4
+ Disallow: /search$
5
+ Disallow: /search?
6
+ Disallow: /search.html$
7
+ Disallow: /search.html?
8
+ Disallow: /admin/
@@ -0,0 +1,14 @@
1
+ #!/bin/bash
2
+
3
+ # workaround for cloudcommerce pnpm monorepo
4
+ filename="../../../packages/storefront/scripts/build-prod.sh"
5
+ if [[ -f $filename ]]; then
6
+ sh $filename
7
+ elif [[ -f "../$filename" ]]; then
8
+ sh "../$filename"
9
+ else
10
+ echo '> npx storefront build'
11
+ npx storefront build
12
+ fi
13
+
14
+ exit 0
@@ -0,0 +1,65 @@
1
+ :root {
2
+ --custom-font-sans: "Heebo Variable";
3
+ }
4
+ html {
5
+ scroll-behavior: smooth;
6
+ }
7
+ body {
8
+ overflow-x: hidden;
9
+ }
10
+ a, button, button > * {
11
+ transition: background-color var(--transition),
12
+ color var(--transition), border-color var(--transition),
13
+ opacity var(--transition), transform var(--transition-fast);
14
+ }
15
+
16
+ .ui-link {
17
+ @apply not-prose font-semibold text-primary underline underline-offset-4
18
+ hover:text-primary-bold active:text-primary-subtle;
19
+ }
20
+
21
+ [class*=ui-btn] {
22
+ @apply not-prose inline-block text-base font-medium px-4 py-2 rounded
23
+ border-2 border-transparent active:ring-2;
24
+ }
25
+ .ui-btn-sm {
26
+ @apply text-sm px-3 py-1.5 border-1;
27
+ }
28
+ .ui-btn-lg {
29
+ @apply font-bold px-6 py-2.5 active:ring-3;
30
+ }
31
+ .ui-btn-primary {
32
+ @apply primary border-primary hover:primary-bold ring-primary/30;
33
+ }
34
+ .ui-btn-secondary {
35
+ @apply bg-secondary-100/50 text-secondary border-secondary
36
+ hover:secondary ring-secondary/30;
37
+ }
38
+ .ui-btn-contrast {
39
+ @apply bg-white text-primary hover:bg-primary-100 ring-white/30;
40
+ }
41
+
42
+ .ui-text-brand, .ui-title {
43
+ @apply font-brand font-bold italic uppercase tracking-tight;
44
+ }
45
+ .ui-title {
46
+ @apply font-black not-prose text-3xl xl:text-5xl;
47
+ }
48
+
49
+ [class*=ui-badge] {
50
+ @apply text-center px-2.5 py-0.5 rounded-md font-semibold
51
+ inline-block bg-secondary-200 text-secondary-900;
52
+ }
53
+ [class*=ui-badge-pill] {
54
+ @apply py-0 rounded-full;
55
+ }
56
+ .ui-badge-pill-sm {
57
+ @apply text-xs min-w-[1rem] px-0.5;
58
+ }
59
+ .ui-badge-pill-lg {
60
+ @apply text-lg min-w-[1.75rem] px-2;
61
+ }
62
+
63
+ .ui-section {
64
+ @apply container mx-auto px-4 sm:px-0 my-6 md:my-8;
65
+ }
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <Menu
3
+ as="div"
4
+ class="relative text-center text-sm text-base-800"
5
+ v-slot="{ open }"
6
+ >
7
+ <div v-if="open">
8
+ <span v-once>{{ initializeFirebaseAuth() }}</span>
9
+ </div>
10
+ <MenuButton class="outline-none">
11
+ <slot name="button" v-bind="{ open }" />
12
+ </MenuButton>
13
+ <Fade>
14
+ <MenuItems class="absolute -right-8 mt-2 w-56
15
+ rounded shadow ring-1 ring-black/5 bg-white
16
+ divide-y divide-base-100 focus:outline-none">
17
+ <div class="p-3 text-base-600">
18
+ {{ `${$t.i19hello} ${customerName || $t.i19visitor}` }}
19
+ <AccountLink role="button" class="ui-btn-sm ui-btn-primary block my-1">
20
+ {{ $t.i19accessMyAccount }}
21
+ </AccountLink>
22
+ <AccountLink v-if="!isLogged" is-sign-up class="ui-link block">
23
+ {{ $t.i19createAnAccount }}
24
+ </AccountLink>
25
+ </div>
26
+ <ul class="list-none">
27
+ <MenuItem as="li" v-slot="{ active }">
28
+ <AccountLink
29
+ to="orders"
30
+ class="block p-2"
31
+ :class="active ? 'bg-base-100 text-primary' : null"
32
+ >
33
+ {{ $t.i19myOrders }}
34
+ </AccountLink>
35
+ </MenuItem>
36
+ <MenuItem as="li" v-slot="{ active }">
37
+ <AccountLink
38
+ to="favorites"
39
+ class="block p-2"
40
+ :class="active ? 'bg-base-100 text-primary' : null"
41
+ >
42
+ <i class="i-heart mr-1"></i>
43
+ {{ $t.i19myFavorites }}
44
+ </AccountLink>
45
+ </MenuItem>
46
+ <MenuItem
47
+ as="li"
48
+ v-slot="{ active }"
49
+ v-for="({ title, href }, i) in serviceLinks"
50
+ :key="`s-${i}`"
51
+ >
52
+ <ALink
53
+ :href="href"
54
+ class="block p-2"
55
+ :class="active ? 'bg-base-100 text-primary' : null"
56
+ >
57
+ {{ title }}
58
+ </ALink>
59
+ </MenuItem>
60
+ <MenuItem as="li">
61
+ <div class="flex justify-center gap-2 p-2 text-base-500 text-base">
62
+ <span v-for="(href, network) in socialNetworks" :key="network">
63
+ <SocialNetworkLink :network="network" class="p-1 hover:text-primary" />
64
+ </span>
65
+ </div>
66
+ </MenuItem>
67
+ <MenuItem v-if="isLogged" as="li">
68
+ <button @click="logout" class="p-2 text-right text-base-800">
69
+ <span class="text-base-600">{{ $t.i19logout }}</span>
70
+ <i class="i-arrow-right-on-rectangle text-lg ml-1"></i>
71
+ </button>
72
+ </MenuItem>
73
+ </ul>
74
+ </MenuItems>
75
+ </Fade>
76
+ </Menu>
77
+ </template>
78
+
79
+ <script setup lang="ts">
80
+ import {
81
+ Menu,
82
+ MenuButton,
83
+ MenuItems,
84
+ MenuItem,
85
+ } from '@headlessui/vue';
86
+ import { socialNetworks } from '@@sf/server-data';
87
+ import {
88
+ customerName,
89
+ initializeFirebaseAuth,
90
+ isLogged,
91
+ logout,
92
+ } from '@@sf/state/customer-session';
93
+ import AccountLink from '@@sf/components/AccountLink.vue';
94
+ import SocialNetworkLink from '@@sf/components/SocialNetworkLink.vue';
95
+
96
+ export interface Props {
97
+ serviceLinks?: Array<{
98
+ title: string;
99
+ href: string;
100
+ }>;
101
+ }
102
+
103
+ defineProps<Props>();
104
+ </script>
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <div
3
+ class="mx-auto overflow-x-hidden"
4
+ :class="hasHeader ? 'grid grid-cols-1 md:grid-cols-2 items-center' : null"
5
+ >
6
+ <component
7
+ :is="href ? 'a-link' : 'span'"
8
+ :href="href"
9
+ class="[&_img]:rounded-lg"
10
+ :class="hasHeader ? 'basis-1/2 grow-0 md:order-last' : '[&_img]:w-full'"
11
+ >
12
+ <slot name="picture" />
13
+ </component>
14
+ <div
15
+ v-if="hasHeader"
16
+ class="basis-1/2 grow-0 p-12 xl:ps-32 mb-3 md:mb-0"
17
+ >
18
+ <Component
19
+ v-if="parsedTitle"
20
+ :is="headingTag"
21
+ class="ui-title mt-1"
22
+ >
23
+ {{ parsedTitle }}
24
+ </Component>
25
+ <p v-if="parsedSubtitle" class="text-lg mt-4 md:mt-6">
26
+ {{ parsedSubtitle }}
27
+ </p>
28
+ <component
29
+ v-if="parsedButtonText"
30
+ :is="buttonLink ? 'a-link' : 'span'"
31
+ :href="buttonLink"
32
+ class="ui-btn-lg ui-btn-contrast min-w-[150px] mt-7 md:mt-10"
33
+ >
34
+ {{ parsedButtonText }}
35
+ </component>
36
+ </div>
37
+ </div>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import {
42
+ type Props as UseBannerProps,
43
+ useBanner,
44
+ } from '@@sf/composables/use-banner';
45
+
46
+ export type Props = UseBannerProps & {
47
+ headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
48
+ }
49
+
50
+ const props = withDefaults(defineProps<Props>(), {
51
+ headingTag: 'h3',
52
+ });
53
+ const {
54
+ hasHeader,
55
+ parsedTitle,
56
+ parsedSubtitle,
57
+ parsedButtonText,
58
+ } = useBanner(props);
59
+ </script>
@@ -0,0 +1,25 @@
1
+ ---
2
+ import type { Props as UseBannerProps } from '@@sf/composables/use-banner';
3
+ import BannerPictures from '@@sf/components/BannerPictures.astro';
4
+ import Banner from '~/components/Banner.vue';
5
+
6
+ export type Props = {
7
+ title?: string;
8
+ titleLink?: string;
9
+ banners: UseBannerProps[];
10
+ }
11
+
12
+ const { banners } = Astro.props;
13
+ ---
14
+
15
+ <section class="ui-section">
16
+ <ul class="flex flex-wrap lg:flex-nowrap gap-4">
17
+ {banners.map((banner) => (
18
+ <li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">
19
+ <Banner {...banner}>
20
+ <BannerPictures {...banner} slot="picture" />
21
+ </Banner>
22
+ </li>
23
+ ))}
24
+ </ul>
25
+ </section>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <aside class="flex flex-col h-full">
3
+ <header class="px-6 py-4 flex justify-end items-center gap-3">
4
+ <span class="text-right text-base text-base-600 font-medium">
5
+ {{ $t.i19myShoppingCart }}
6
+ </span>
7
+ <span class="ui-badge-pill-lg">
8
+ {{ totalItems }}
9
+ </span>
10
+ </header>
11
+ <article class="grow bg-base-50 border-t-2 border-b-2 border-base-100">
12
+ <div v-if="freeShippingFromValue" class="text-sm text-center">
13
+ <div
14
+ v-if="freeShippingFromValue > shoppingCart.subtotal"
15
+ class="p-3 secondary-subtle"
16
+ >
17
+ {{ $t.i19add$1ToEarn.replace('$1',
18
+ $money(freeShippingFromValue - shoppingCart.subtotal)) }}
19
+ <strong class="lowercase">{{ $t.i19freeShipping }}</strong>
20
+ </div>
21
+ <div v-else class="p-3 bg-success-50 text-success-800">
22
+ <i class="text-success-900 i-check mr-1"></i>
23
+ {{ $t.i19freeShippingFrom }} {{ $money(freeShippingFromValue) }}
24
+ </div>
25
+ </div>
26
+ </article>
27
+ <footer class="p-5 shadow">
28
+ </footer>
29
+ </aside>
30
+ </template>
31
+
32
+ <script setup lang="ts">
33
+ import { freeShippingFromValue } from '@@sf/state/modules-info';
34
+ import { shoppingCart, totalItems } from '@@sf/state/shopping-cart';
35
+ </script>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <div class="flex w-[300px] justify-between">
3
+ <div>
4
+ <strong class="text-lg">{{ hours }}</strong>
5
+ <span>{{ $t.i19about }}</span>
6
+ </div>
7
+ <span>:</span>
8
+ <div>
9
+ {{ minutes }}
10
+ </div>
11
+ <span>:</span>
12
+ <div>
13
+ {{ seconds }}
14
+ </div>
15
+ <span>:</span>
16
+ <div>
17
+ {{ ms }}
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import {
24
+ ref,
25
+ computed,
26
+ watch,
27
+ watchEffect,
28
+ } from 'vue';
29
+ import { useIntervalFn } from '@vueuse/core';
30
+
31
+ export interface Props {
32
+ endsAt?: string;
33
+ maxHours?: number;
34
+ }
35
+
36
+ const props = withDefaults(defineProps<Props>(), {
37
+ maxHours: 8,
38
+ });
39
+ const endTimestamp = computed(() => {
40
+ if (props.endsAt) {
41
+ return new Date(props.endsAt).getTime();
42
+ }
43
+ return null;
44
+ });
45
+ const hours = ref<number | null>(null);
46
+ const minutes = ref<number>(59);
47
+ const seconds = ref<number>(59);
48
+ const ms = ref<number>(999);
49
+ watchEffect(() => {
50
+ if (endTimestamp.value) {
51
+ const timeDiff = endTimestamp.value - Date.now();
52
+ if (timeDiff > 0) {
53
+ const diffHours = Math.floor(timeDiff / (1000 * 60 * 60));
54
+ hours.value = Math.min(diffHours, props.maxHours);
55
+ }
56
+ return;
57
+ }
58
+ hours.value = props.maxHours;
59
+ });
60
+ useIntervalFn(() => {
61
+ ms.value -= 1;
62
+ if (ms.value < 0) {
63
+ ms.value = 999;
64
+ }
65
+ }, 1);
66
+ watch([ms], () => {
67
+ if (ms.value === 0) {
68
+ seconds.value -= 1;
69
+ if (seconds.value < 0) {
70
+ seconds.value = 59;
71
+ minutes.value -= 1;
72
+ if (minutes.value < 0) {
73
+ minutes.value = 59;
74
+ hours.value = Math.min((hours.value as number) - 1, 0);
75
+ }
76
+ }
77
+ }
78
+ });
79
+ </script>
@@ -0,0 +1,52 @@
1
+ <template>
2
+ <section class="bg-base-100 py-3">
3
+ <div class="relative container mx-auto">
4
+ <Carousel :autoplay="autoplay" class="[&>*]:items-center">
5
+ <li
6
+ v-for="(slide, i) in slides"
7
+ :key="i"
8
+ class="shrink-0 basis-full"
9
+ >
10
+ <Banner
11
+ v-bind="{ ...slide, headingTag: i === 0 ? 'h2' : 'h3' }"
12
+ class="w-full"
13
+ >
14
+ <template #picture>
15
+ <slot :name="`picture-${i}`" />
16
+ </template>
17
+ </Banner>
18
+ </li>
19
+ <template #controls>
20
+ <div
21
+ v-show="slides.length > 1"
22
+ class="absolute z-10 bottom-5 right-5 flex justify-end items-center"
23
+ >
24
+ <div class="relative w-20 h-10 rounded-full
25
+ bg-primary/80 text-on-primary shadow-sm ring-1 ring-black/5">
26
+ <CarouselControl class="w-10 h-10 rounded-full hover:bg-primary" is-prev>
27
+ <i class="i-arrow-left"></i>
28
+ </CarouselControl>
29
+ <CarouselControl class="w-10 h-10 rounded-full hover:bg-primary">
30
+ <i class="i-arrow-right"></i>
31
+ </CarouselControl>
32
+ </div>
33
+ </div>
34
+ </template>
35
+ </Carousel>
36
+ </div>
37
+ </section>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import type { Props as UseBannerProps } from '@@sf/composables/use-banner';
42
+ import Carousel from '@@sf/components/Carousel.vue';
43
+ import CarouselControl from '@@sf/components/CarouselControl.vue';
44
+ import Banner from '~/components/Banner.vue';
45
+
46
+ export type Props = {
47
+ autoplay?: number;
48
+ slides: UseBannerProps[];
49
+ }
50
+
51
+ defineProps<Props>();
52
+ </script>