@nuvler/theme-default 1.0.6 → 1.0.8

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 (46) hide show
  1. package/dist/nuvler.theme.json +151 -8
  2. package/dist/src/banner-carousel.d.ts +7 -10
  3. package/dist/src/banner-carousel.js +21 -7
  4. package/dist/src/banner-carousel.js.map +1 -1
  5. package/dist/src/carousel-frame.js +5 -2
  6. package/dist/src/carousel-frame.js.map +1 -1
  7. package/dist/src/definition.d.ts +2 -0
  8. package/dist/src/definition.js +2 -1
  9. package/dist/src/definition.js.map +1 -1
  10. package/dist/src/footer.d.ts +3 -1
  11. package/dist/src/footer.js +3 -2
  12. package/dist/src/footer.js.map +1 -1
  13. package/dist/src/header-interactions.d.ts +5 -4
  14. package/dist/src/header-interactions.js +35 -19
  15. package/dist/src/header-interactions.js.map +1 -1
  16. package/dist/src/header.d.ts +1 -1
  17. package/dist/src/header.js +21 -9
  18. package/dist/src/header.js.map +1 -1
  19. package/dist/src/home.d.ts +1 -1
  20. package/dist/src/home.js +60 -44
  21. package/dist/src/home.js.map +1 -1
  22. package/dist/src/index.d.ts +2 -1
  23. package/dist/src/index.js +1 -0
  24. package/dist/src/index.js.map +1 -1
  25. package/dist/src/not-found.d.ts +2 -0
  26. package/dist/src/not-found.js +14 -0
  27. package/dist/src/not-found.js.map +1 -0
  28. package/dist/src/product-carousel.d.ts +2 -2
  29. package/dist/src/product-carousel.js.map +1 -1
  30. package/dist/src/product-detail-interactive.d.ts +2 -1
  31. package/dist/src/product-detail-interactive.js +6 -3
  32. package/dist/src/product-detail-interactive.js.map +1 -1
  33. package/dist/src/product-detail.js +24 -3
  34. package/dist/src/product-detail.js.map +1 -1
  35. package/dist/src/products.js +13 -2
  36. package/dist/src/products.js.map +1 -1
  37. package/dist/src/server-shell.d.ts +3 -2
  38. package/dist/src/server-shell.js +6 -4
  39. package/dist/src/server-shell.js.map +1 -1
  40. package/dist/src/theme-component.d.ts +1 -0
  41. package/dist/src/theme-component.js +37 -10
  42. package/dist/src/theme-component.js.map +1 -1
  43. package/dist/src/theme-config.js +12 -12
  44. package/dist/src/theme-config.js.map +1 -1
  45. package/dist/theme.css +1733 -171
  46. package/package.json +2 -2
@@ -2,9 +2,9 @@
2
2
  "schemaVersion": 1,
3
3
  "id": "nuvler-default",
4
4
  "name": "Nuvler Default",
5
- "version": "1.0.6",
5
+ "version": "1.0.8",
6
6
  "runtimeVersion": "1",
7
- "sdkVersion": "^1.3.1",
7
+ "sdkVersion": "^1.3.3",
8
8
  "entry": "src/theme.tsx",
9
9
  "styles": [
10
10
  "src/theme.css"
@@ -15,15 +15,15 @@
15
15
  "colors": {
16
16
  "primary": "#176b3a",
17
17
  "secondary": "#d99b31",
18
- "background": "#f7f7f2",
19
- "text": "#18221b",
18
+ "background": "#fbfcfa",
19
+ "text": "#172019",
20
20
  "primaryText": "#ffffff",
21
21
  "secondaryText": "#18221b",
22
22
  "accent": "#b45309",
23
23
  "surface": "#ffffff",
24
- "surfaceAlt": "#eef2e9",
24
+ "surfaceAlt": "#f4f7f3",
25
25
  "textMuted": "#657068",
26
- "border": "#dfe4dd",
26
+ "border": "#dce3dc",
27
27
  "headerBackground": "#ffffff",
28
28
  "headerText": "#18221b",
29
29
  "footerBackground": "#14251a",
@@ -31,7 +31,150 @@
31
31
  },
32
32
  "layout": {
33
33
  "containerWidth": 1280,
34
- "borderRadius": 18
35
- }
34
+ "borderRadius": 16
35
+ },
36
+ "homeComponents": [
37
+ {
38
+ "key": "benefits",
39
+ "name": "Diferenciais da loja",
40
+ "description": "Exibe benefícios configurados pela loja em cards reutilizáveis.",
41
+ "category": "Destaques",
42
+ "schemaVersion": 1,
43
+ "fields": [
44
+ {
45
+ "key": "eyebrow",
46
+ "label": "Sobretítulo",
47
+ "control": "text",
48
+ "maxLength": 80
49
+ },
50
+ {
51
+ "key": "title",
52
+ "label": "Título",
53
+ "control": "text",
54
+ "maxLength": 120
55
+ },
56
+ {
57
+ "key": "items",
58
+ "label": "Diferenciais",
59
+ "control": "repeater",
60
+ "maxItems": 6,
61
+ "itemFields": [
62
+ {
63
+ "key": "title",
64
+ "label": "Título",
65
+ "control": "text",
66
+ "required": true,
67
+ "maxLength": 100
68
+ },
69
+ {
70
+ "key": "description",
71
+ "label": "Descrição",
72
+ "control": "textarea",
73
+ "maxLength": 240
74
+ },
75
+ {
76
+ "key": "url",
77
+ "label": "Link opcional",
78
+ "control": "url"
79
+ }
80
+ ]
81
+ }
82
+ ]
83
+ },
84
+ {
85
+ "key": "brands",
86
+ "name": "Marcas",
87
+ "description": "Exibe marcas e parceiros configurados pela loja.",
88
+ "category": "Destaques",
89
+ "schemaVersion": 1,
90
+ "fields": [
91
+ {
92
+ "key": "eyebrow",
93
+ "label": "Sobretítulo",
94
+ "control": "text",
95
+ "maxLength": 80
96
+ },
97
+ {
98
+ "key": "title",
99
+ "label": "Título",
100
+ "control": "text",
101
+ "maxLength": 120
102
+ },
103
+ {
104
+ "key": "items",
105
+ "label": "Marcas",
106
+ "control": "repeater",
107
+ "maxItems": 20,
108
+ "itemFields": [
109
+ {
110
+ "key": "title",
111
+ "label": "Nome",
112
+ "control": "text",
113
+ "required": true,
114
+ "maxLength": 100
115
+ },
116
+ {
117
+ "key": "image",
118
+ "label": "Logo",
119
+ "control": "image"
120
+ },
121
+ {
122
+ "key": "url",
123
+ "label": "Link opcional",
124
+ "control": "url"
125
+ }
126
+ ]
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "key": "newsletter-form",
132
+ "name": "Cadastro de novidades",
133
+ "description": "Capta contatos para comunicações da loja.",
134
+ "category": "Formulários",
135
+ "schemaVersion": 1,
136
+ "fields": [
137
+ {
138
+ "key": "eyebrow",
139
+ "label": "Sobretítulo",
140
+ "control": "text",
141
+ "maxLength": 80
142
+ },
143
+ {
144
+ "key": "title",
145
+ "label": "Título",
146
+ "control": "text",
147
+ "maxLength": 120
148
+ },
149
+ {
150
+ "key": "description",
151
+ "label": "Descrição",
152
+ "control": "textarea",
153
+ "maxLength": 400
154
+ },
155
+ {
156
+ "key": "submitLabel",
157
+ "label": "Texto do botão",
158
+ "control": "text",
159
+ "maxLength": 60
160
+ },
161
+ {
162
+ "key": "successMessage",
163
+ "label": "Mensagem de sucesso",
164
+ "control": "text",
165
+ "maxLength": 240
166
+ },
167
+ {
168
+ "key": "fields",
169
+ "label": "Campos do formulário",
170
+ "control": "contact-fields"
171
+ }
172
+ ],
173
+ "action": {
174
+ "type": "contact.submit",
175
+ "formKey": "newsletter-form"
176
+ }
177
+ }
178
+ ]
36
179
  }
37
180
  }
@@ -1,17 +1,14 @@
1
- import type { ThemeImage } from "@nuvler/theme-sdk";
1
+ import type { ThemeBannerImageFit, ThemeHomeBanner } from "@nuvler/theme-sdk";
2
2
  import { type ThemeImageComponent } from "./shared.js";
3
- export interface ThemeBanner {
3
+ export type ThemeBanner = ThemeHomeBanner & {
4
4
  imageUrl: string;
5
- image?: ThemeImage | null;
6
- imageAlt?: string;
7
- title?: string;
8
- description?: string;
9
- buttonLabel?: string;
10
- buttonUrl?: string;
11
- }
12
- export declare function BannerCarousel({ banners, autoplay, priority, ImageComponent }: {
5
+ };
6
+ export declare function BannerCarousel({ banners, autoplay, desktopHeight, mobileHeight, imageFit, priority, ImageComponent }: {
13
7
  banners: ThemeBanner[];
14
8
  autoplay: boolean;
9
+ desktopHeight?: number;
10
+ mobileHeight?: number;
11
+ imageFit?: ThemeBannerImageFit;
15
12
  priority?: boolean;
16
13
  ImageComponent?: ThemeImageComponent;
17
14
  }): import("react").JSX.Element | null;
@@ -1,14 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { BannerCarouselFrame } from "./carousel-frame.js";
3
3
  import { ThemeImageView } from "./shared.js";
4
- export function BannerCarousel({ banners, autoplay, priority = false, ImageComponent = ThemeImageView }) {
4
+ function imageAspectRatio(image) {
5
+ const width = Number(image?.width);
6
+ const height = Number(image?.height);
7
+ return width > 0 && height > 0 ? width / height : null;
8
+ }
9
+ export function BannerCarousel({ banners, autoplay, desktopHeight = 590, mobileHeight = 420, imageFit = "COVER", priority = false, ImageComponent = ThemeImageView }) {
5
10
  if (!banners.length)
6
11
  return null;
7
- return (_jsx(BannerCarouselFrame, { count: banners.length, autoplay: autoplay, children: banners.map((banner, index) => (_jsxs("article", { className: "banner-slide", "data-banner-slide": true, "aria-hidden": index !== 0, children: [_jsx(ImageComponent, { image: banner.image ?? {
8
- url: banner.imageUrl,
9
- alt: banner.imageAlt || banner.title || "Banner",
10
- width: null,
11
- height: null,
12
- }, fallbackAlt: banner.title || "Banner", priority: priority && index === 0, sizes: "100vw", fallbackWidth: 1600, fallbackHeight: 640 }), (banner.title || banner.description || (banner.buttonLabel && banner.buttonUrl)) && (_jsx("div", { className: "banner-overlay", children: _jsx("div", { className: "store-container", children: _jsxs("div", { className: "banner-copy", children: [banner.title && _jsx("h2", { children: banner.title }), banner.description && _jsx("p", { children: banner.description }), banner.buttonLabel && banner.buttonUrl && _jsx("a", { className: "button button-primary", href: banner.buttonUrl, children: banner.buttonLabel })] }) }) }))] }, `${banner.imageUrl}-${index}`))) }));
12
+ const firstBanner = banners.find((banner) => banner.image?.url || banner.imageUrl);
13
+ const desktopAspectRatio = imageAspectRatio(firstBanner?.image);
14
+ const mobileAspectRatio = imageAspectRatio(firstBanner?.mobileImage);
15
+ const style = {
16
+ "--banner-desktop-height": `${desktopHeight}px`,
17
+ "--banner-mobile-height": `${mobileHeight}px`,
18
+ ...(desktopAspectRatio ? { "--banner-desktop-aspect-ratio": String(desktopAspectRatio) } : {}),
19
+ ...(mobileAspectRatio ? { "--banner-mobile-aspect-ratio": String(mobileAspectRatio) } : {}),
20
+ };
21
+ return (_jsx("div", { className: "banner-carousel-settings", "data-image-fit": imageFit.toLowerCase(), style: style, children: _jsx(BannerCarouselFrame, { count: banners.length, autoplay: autoplay, children: banners.map((banner, index) => (_jsxs("article", { className: "banner-slide", "data-banner-slide": true, "aria-hidden": index !== 0, children: [_jsx(ImageComponent, { image: banner.image ?? {
22
+ url: banner.imageUrl,
23
+ alt: banner.imageAlt || banner.title || "Banner",
24
+ width: null,
25
+ height: null,
26
+ }, fallbackAlt: banner.title || "Banner", priority: priority && index === 0, sizes: "100vw", fallbackWidth: 1600, fallbackHeight: 640, className: banner.mobileImage?.url || banner.mobileImageUrl ? "banner-image-desktop" : undefined }), (banner.mobileImage?.url || banner.mobileImageUrl) && _jsx(ImageComponent, { image: banner.mobileImage ?? { url: banner.mobileImageUrl ?? null, alt: banner.mobileImageAlt || banner.imageAlt || banner.title || "Banner", width: null, height: null }, fallbackAlt: banner.title || "Banner", sizes: "100vw", fallbackWidth: 720, fallbackHeight: 900, className: "banner-image-mobile" }), (banner.title || banner.description || (banner.buttonLabel && banner.buttonUrl)) && (_jsx("div", { className: "banner-overlay", children: _jsx("div", { className: "store-container", children: _jsxs("div", { className: "banner-copy", children: [banner.title && _jsx("h2", { children: banner.title }), banner.description && _jsx("p", { children: banner.description }), banner.buttonLabel && banner.buttonUrl && _jsx("a", { className: "button button-primary", href: banner.buttonUrl, children: banner.buttonLabel })] }) }) }))] }, `${banner.imageUrl}-${index}`))) }) }));
13
27
  }
14
28
  //# sourceMappingURL=banner-carousel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banner-carousel.js","sourceRoot":"","sources":["../../src/banner-carousel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAA4B,MAAM,aAAa,CAAC;AAYvE,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,cAAc,GAAG,cAAc,EAKpG;IACC,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACjC,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ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M,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,KAAK,IAAI,QAAQ,EAAE,KAAK,EAAC,OAAO,EAAC,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAC,qBAAqB,GAAG,EACjX,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CACnF,cAAK,SAAS,EAAC,gBAAgB,YAC7B,cAAK,SAAS,EAAC,iBAAiB,YAC9B,eAAK,SAAS,EAAC,aAAa,aACzB,MAAM,CAAC,KAAK,IAAI,uBAAK,MAAM,CAAC,KAAK,GAAM,EACvC,MAAM,CAAC,WAAW,IAAI,sBAAI,MAAM,CAAC,WAAW,GAAK,EACjD,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,SAAS,IAAI,YAAG,SAAS,EAAC,uBAAuB,EAAC,IAAI,EAAE,MAAM,CAAC,SAAS,YAAG,MAAM,CAAC,WAAW,GAAK,IAC5H,GACF,GACF,CACP,KA1BsD,GAAG,MAAM,CAAC,QAAQ,IAAI,KAAK,EAAE,CA2B5E,CACT,CAAC,GACkB,GAClB,CACP,CAAC;AACJ,CAAC"}
@@ -1,6 +1,9 @@
1
1
  "use client";
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useRef, useState } from "react";
4
+ function ArrowIcon({ direction }) {
5
+ return _jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: direction === "previous" ? "m14.5 5-7 7 7 7" : "m9.5 5 7 7-7 7" }) });
6
+ }
4
7
  export function BannerCarouselFrame({ children, count, autoplay, }) {
5
8
  const [active, setActive] = useState(0);
6
9
  const track = useRef(null);
@@ -14,7 +17,7 @@ export function BannerCarouselFrame({ children, count, autoplay, }) {
14
17
  const timer = window.setInterval(() => setActive((current) => (current + 1) % count), 6000);
15
18
  return () => window.clearInterval(timer);
16
19
  }, [autoplay, count]);
17
- return (_jsxs("section", { className: "banner-carousel", "aria-roledescription": "carrossel", "aria-label": "Banners da loja", children: [_jsx("div", { className: "banner-track", ref: track, style: { transform: `translateX(-${active * 100}%)` }, children: children }), count > 1 && _jsxs(_Fragment, { children: [_jsx("button", { className: "carousel-arrow carousel-arrow-prev", type: "button", "aria-label": "Banner anterior", onClick: () => setActive((active - 1 + count) % count), children: "\u2039" }), _jsx("button", { className: "carousel-arrow carousel-arrow-next", type: "button", "aria-label": "Pr\u00F3ximo banner", onClick: () => setActive((active + 1) % count), children: "\u203A" }), _jsx("div", { className: "carousel-dots", children: Array.from({ length: count }, (_, index) => _jsx("button", { type: "button", className: index === active ? "active" : "", "aria-label": `Ir para banner ${index + 1}`, onClick: () => setActive(index) }, index)) })] })] }));
20
+ return (_jsxs("section", { className: "banner-carousel", "aria-roledescription": "carrossel", "aria-label": "Banners da loja", children: [_jsx("div", { className: "banner-track", ref: track, style: { transform: `translateX(-${active * 100}%)` }, children: children }), count > 1 && _jsxs(_Fragment, { children: [_jsx("button", { className: "carousel-arrow carousel-arrow-prev", type: "button", "aria-label": "Banner anterior", onClick: () => setActive((active - 1 + count) % count), children: _jsx(ArrowIcon, { direction: "previous" }) }), _jsx("button", { className: "carousel-arrow carousel-arrow-next", type: "button", "aria-label": "Pr\u00F3ximo banner", onClick: () => setActive((active + 1) % count), children: _jsx(ArrowIcon, { direction: "next" }) }), _jsx("div", { className: "carousel-dots", children: Array.from({ length: count }, (_, index) => _jsx("button", { type: "button", className: index === active ? "active" : "", "aria-label": `Ir para banner ${index + 1}`, onClick: () => setActive(index) }, index)) })] })] }));
18
21
  }
19
22
  export function ProductCarouselFrame({ children }) {
20
23
  const track = useRef(null);
@@ -22,6 +25,6 @@ export function ProductCarouselFrame({ children }) {
22
25
  left: direction * Math.min(track.current.clientWidth, 900),
23
26
  behavior: "smooth",
24
27
  });
25
- return (_jsxs("div", { className: "product-carousel", children: [_jsx("div", { className: "product-carousel-track", ref: track, children: children }), _jsx("button", { type: "button", className: "carousel-arrow carousel-arrow-prev", onClick: () => move(-1), "aria-label": "Produtos anteriores", children: "\u2039" }), _jsx("button", { type: "button", className: "carousel-arrow carousel-arrow-next", onClick: () => move(1), "aria-label": "Pr\u00F3ximos produtos", children: "\u203A" })] }));
28
+ return (_jsxs("div", { className: "product-carousel", children: [_jsx("div", { className: "product-carousel-track", ref: track, children: children }), _jsx("button", { type: "button", className: "carousel-arrow carousel-arrow-prev", onClick: () => move(-1), "aria-label": "Produtos anteriores", children: _jsx(ArrowIcon, { direction: "previous" }) }), _jsx("button", { type: "button", className: "carousel-arrow carousel-arrow-next", onClick: () => move(1), "aria-label": "Pr\u00F3ximos produtos", children: _jsx(ArrowIcon, { direction: "next" }) })] }));
26
29
  }
27
30
  //# sourceMappingURL=carousel-frame.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel-frame.js","sourceRoot":"","sources":["../../src/carousel-frame.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEpE,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,KAAK,EACL,QAAQ,GAKT;IACC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE3C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAc,qBAAqB,CAAC,CAAC;QACnF,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;IACjG,CAA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AAQ,CAAC;QAC1D,IAAI,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC;QAC1D,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;IAEH,OAAO,CACL,eAAK,SAAS,EAAC,kBAAkB,aAC/B,cAAK,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,KAAK,YAAG,QAAQ,GAAO,EACpE,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,oCAAoC,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAa,qBAAqB,YAAC,KAAC,SAAS,IAAC,SAAS,EAAC,UAAU,GAAG,GAAS,EAC1K,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,oCAAoC,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAa,wBAAmB,YAAC,KAAC,SAAS,IAAC,SAAS,EAAC,MAAM,GAAG,GAAS,IAC/J,CACP,CAAC;AACJ,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Footer } from "./footer.js";
2
2
  import { Header } from "./header.js";
3
3
  import { Home } from "./home.js";
4
+ import { NotFound } from "./not-found.js";
4
5
  import { ProductDetail } from "./product-detail.js";
5
6
  import { ProductGrid } from "./products.js";
6
7
  export { manifest } from "./theme-config.js";
@@ -51,5 +52,6 @@ export declare const nuvlerDefaultTheme: {
51
52
  readonly Home: typeof Home;
52
53
  readonly ProductGrid: typeof ProductGrid;
53
54
  readonly ProductDetail: typeof ProductDetail;
55
+ readonly NotFound: typeof NotFound;
54
56
  };
55
57
  };
@@ -2,6 +2,7 @@ import { defineTheme } from "@nuvler/theme-sdk";
2
2
  import { Footer } from "./footer.js";
3
3
  import { Header } from "./header.js";
4
4
  import { Home } from "./home.js";
5
+ import { NotFound } from "./not-found.js";
5
6
  import { ProductDetail } from "./product-detail.js";
6
7
  import { ProductGrid } from "./products.js";
7
8
  import { manifest, nuvlerDefaultTemplate, nuvlerDefaultTokens, } from "./theme-config.js";
@@ -10,6 +11,6 @@ export const nuvlerDefaultTheme = defineTheme({
10
11
  manifest,
11
12
  tokens: nuvlerDefaultTokens,
12
13
  template: nuvlerDefaultTemplate,
13
- components: { Header, Footer, Home, ProductGrid, ProductDetail },
14
+ components: { Header, Footer, Home, ProductGrid, ProductDetail, NotFound },
14
15
  });
15
16
  //# sourceMappingURL=definition.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;IAC5C,QAAQ;IACR,MAAM,EAAE,mBAAmB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE;CACjE,CAAC,CAAC"}
1
+ {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;IAC5C,QAAQ;IACR,MAAM,EAAE,mBAAmB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE;CAC3E,CAAC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import type { FooterProps } from "@nuvler/theme-sdk";
2
2
  import type { ReactNode } from "react";
3
+ import { type ThemeImageComponent } from "./shared.js";
3
4
  export interface NuvlerDefaultFooterProps extends FooterProps {
4
5
  platformBrand?: ReactNode;
6
+ ImageComponent?: ThemeImageComponent;
5
7
  }
6
- export declare function Footer({ site, pages, template, platformBrand }: NuvlerDefaultFooterProps): import("react").JSX.Element;
8
+ export declare function Footer({ site, pages, template, platformBrand, ImageComponent }: NuvlerDefaultFooterProps): import("react").JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export function Footer({ site, pages, template, platformBrand }) {
2
+ import { ThemeImageView } from "./shared.js";
3
+ export function Footer({ site, pages, template, platformBrand, ImageComponent = ThemeImageView }) {
3
4
  const settings = site.settings;
4
5
  const name = settings?.siteName || site.tenant.name;
5
- return _jsxs("footer", { className: "store-footer", children: [_jsxs("div", { className: "store-container footer-grid", children: [_jsxs("div", { children: [_jsx("strong", { className: "footer-brand", children: name }), _jsx("p", { children: settings?.description || template.footerTagline })] }), _jsxs("div", { children: [_jsx("strong", { children: template.footerNavigationLabel }), site.modules.includes("PRODUCTS") && _jsx("a", { href: "/produtos", children: "Todos os produtos" }), site.modules.includes("BLOG") && _jsx("a", { href: "/blog", children: "Blog" }), site.modules.includes("SERVICES") && _jsx("a", { href: "/servicos", children: "Servi\u00E7os" }), site.modules.includes("CASES") && _jsx("a", { href: "/cases", children: "Cases" }), _jsx("a", { href: "/", children: "In\u00EDcio" })] }), pages.length > 0 && _jsxs("div", { children: [_jsx("strong", { children: "Institucional" }), pages.slice(0, 6).map((page) => _jsx("a", { href: `/${page.slug}`, children: page.title }, page.slug))] }), _jsxs("div", { children: [_jsx("strong", { children: "Atendimento" }), settings?.contact.email && _jsx("a", { href: `mailto:${settings.contact.email}`, children: settings.contact.email }), settings?.contact.phone && _jsx("a", { href: `tel:${settings.contact.phone}`, children: settings.contact.phone }), settings?.contact.address && _jsx("span", { children: settings.contact.address })] }), settings?.social && Object.values(settings.social).some(Boolean) && _jsxs("div", { className: "footer-social", children: [_jsx("strong", { children: template.socialLabel }), settings.social.instagram && _jsx("a", { href: settings.social.instagram, target: "_blank", rel: "noreferrer", children: "Instagram" }), settings.social.facebook && _jsx("a", { href: settings.social.facebook, target: "_blank", rel: "noreferrer", children: "Facebook" }), settings.social.youtube && _jsx("a", { href: settings.social.youtube, target: "_blank", rel: "noreferrer", children: "YouTube" }), settings.social.tiktok && _jsx("a", { href: settings.social.tiktok, target: "_blank", rel: "noreferrer", children: "TikTok" })] })] }), _jsxs("div", { className: "store-container footer-bottom", children: [_jsxs("span", { children: ["\u00A9 ", new Date().getFullYear(), " ", name] }), _jsx("span", { children: template.footerNote }), platformBrand && _jsx("span", { "data-nuvler-platform-brand-slot": true, children: platformBrand })] })] });
6
+ return _jsxs("footer", { className: "store-footer", children: [_jsxs("div", { className: "store-container footer-grid", children: [_jsxs("div", { className: "footer-intro", children: [_jsx("a", { className: "footer-brand", href: "/", "aria-label": `${name} — início`, children: settings?.logo?.url ? _jsx(ImageComponent, { image: settings.logo, fallbackAlt: name, className: "footer-logo", sizes: "200px", fallbackWidth: 240, fallbackHeight: 96 }) : name }), _jsx("p", { children: settings?.description || template.footerTagline }), settings?.contact.whatsapp && _jsxs("a", { className: "footer-contact-cta", href: `https://wa.me/${settings.contact.whatsapp.replace(/\D/g, "")}`, target: "_blank", rel: "noreferrer", children: ["Fale pelo WhatsApp ", _jsx("span", { "aria-hidden": "true", children: "\u2192" })] })] }), _jsxs("div", { children: [_jsx("strong", { children: template.footerNavigationLabel }), site.modules.includes("PRODUCTS") && _jsx("a", { href: "/produtos", children: "Todos os produtos" }), site.modules.includes("BLOG") && _jsx("a", { href: "/blog", children: "Blog" }), site.modules.includes("SERVICES") && _jsx("a", { href: "/servicos", children: "Servi\u00E7os" }), site.modules.includes("CASES") && _jsx("a", { href: "/cases", children: "Cases" }), _jsx("a", { href: "/", children: "In\u00EDcio" })] }), pages.length > 0 && _jsxs("div", { children: [_jsx("strong", { children: "Institucional" }), pages.slice(0, 6).map((page) => _jsx("a", { href: `/${page.slug}`, children: page.title }, page.slug))] }), _jsxs("div", { children: [_jsx("strong", { children: "Atendimento" }), settings?.contact.email && _jsx("a", { href: `mailto:${settings.contact.email}`, children: settings.contact.email }), settings?.contact.phone && _jsx("a", { href: `tel:${settings.contact.phone}`, children: settings.contact.phone }), settings?.contact.address && _jsx("span", { children: settings.contact.address })] }), settings?.social && Object.values(settings.social).some(Boolean) && _jsxs("div", { className: "footer-social", children: [_jsx("strong", { children: template.socialLabel }), settings.social.instagram && _jsx("a", { href: settings.social.instagram, target: "_blank", rel: "noreferrer", children: "Instagram" }), settings.social.facebook && _jsx("a", { href: settings.social.facebook, target: "_blank", rel: "noreferrer", children: "Facebook" }), settings.social.youtube && _jsx("a", { href: settings.social.youtube, target: "_blank", rel: "noreferrer", children: "YouTube" }), settings.social.tiktok && _jsx("a", { href: settings.social.tiktok, target: "_blank", rel: "noreferrer", children: "TikTok" })] })] }), _jsxs("div", { className: "store-container footer-bottom", children: [_jsxs("span", { children: ["\u00A9 ", new Date().getFullYear(), " ", name] }), _jsx("span", { children: template.footerNote }), platformBrand && _jsx("span", { "data-nuvler-platform-brand-slot": true, children: platformBrand })] })] });
6
7
  }
7
8
  //# sourceMappingURL=footer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"footer.js","sourceRoot":"","sources":["../../src/footer.tsx"],"names":[],"mappings":";AAOA,MAAM,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAA4B;IACvF,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,MAAM,IAAI,GAAG,QAAQ,EAAE,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACpD,OAAO,kBAAQ,SAAS,EAAC,cAAc,aAAC,eAAK,SAAS,EAAC,6BAA6B,aAAC,0BAAK,iBAAQ,SAAS,EAAC,cAAc,YAAE,IAAI,GAAU,EAAA,sBAAI,QAAQ,EAAE,WAAW,IAAI,QAAQ,CAAC,aAAa,GAAK,IAAM,EAAA,0BAAK,2BAAS,QAAQ,CAAC,qBAAqB,GAAU,EAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,YAAG,IAAI,EAAC,WAAW,kCAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,YAAG,IAAI,EAAC,OAAO,qBAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,YAAG,IAAI,EAAC,WAAW,8BAAa,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,YAAG,IAAI,EAAC,QAAQ,sBAAU,EAAC,YAAG,IAAI,EAAC,GAAG,4BAAW,IAAM,EAAC,KAAK,CAAC,MAAM,GAAG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AQ,IAAO,IAAS,CAAC;AACpuE,CAAC"}
@@ -1,19 +1,20 @@
1
- import { type ThemeCategory, type ThemeNavigationItem, type ThemePageSummary, type ThemeProduct, type ThemeSite } from "@nuvler/theme-sdk";
1
+ import { type ThemeCategory, type ThemeNavigationItem, type ThemeProduct, type ThemeSite } from "@nuvler/theme-sdk";
2
2
  export declare function CategoryNavigation({ categories: initialCategories }: {
3
3
  categories: ThemeCategory[];
4
4
  }): import("react").JSX.Element;
5
- export declare function ConfiguredNavigation({ menu, categories: initialCategories }: {
5
+ export declare function ConfiguredNavigation({ menu, categories: initialCategories, inline }: {
6
6
  menu: ThemeNavigationItem[];
7
7
  categories: ThemeCategory[];
8
+ inline?: boolean;
8
9
  }): import("react").JSX.Element;
9
10
  export declare function SmartProductSearch({ endpoint, queryParam, searchProducts }: {
10
11
  endpoint?: string;
11
12
  queryParam?: string;
12
13
  searchProducts?: (query: string) => Promise<ThemeProduct[]>;
13
14
  }): import("react").JSX.Element;
14
- export declare function MobileStoreMenu({ site, categories: initialCategories, pages, menu }: {
15
+ export declare function MobileStoreMenu({ site, categories: initialCategories, menu, headerButton }: {
15
16
  site: ThemeSite;
16
17
  categories: ThemeCategory[];
17
- pages: ThemePageSummary[];
18
18
  menu?: ThemeNavigationItem[];
19
+ headerButton?: import("@nuvler/theme-sdk").ThemeNavigationHeaderButton | null;
19
20
  }): import("react").JSX.Element;
@@ -108,24 +108,31 @@ export function CategoryNavigation({ categories: initialCategories }) {
108
108
  return _jsxs("div", { className: "category-nav-group", "data-overflowed": overflowed || undefined, "aria-hidden": overflowed || undefined, ref: (node) => { itemRefs.current[index] = node; }, onPointerEnter: () => { void load(); }, onFocusCapture: () => { void load(); }, children: [_jsxs("a", { href: categoryUrl([category.slug]), children: [category.name, hasSubmenu && _jsx("svg", { className: "category-item-chevron", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "m6 8 4 4 4-4" }) })] }), hasSubmenu && _jsxs("div", { className: "category-nav-submenu", children: [status !== "loaded" && category.children.length === 0 && _jsx("p", { className: "category-nav-status", role: "status", children: status === "error" ? "Não foi possível carregar as subcategorias." : "Carregando subcategorias…" }), category.children?.length > 0 && _jsx(CategoryTree, { categories: category.children, path: [category.slug] })] })] }, category.slug);
109
109
  })] }) });
110
110
  }
111
- export function ConfiguredNavigation({ menu, categories: initialCategories }) {
111
+ export function ConfiguredNavigation({ menu, categories: initialCategories, inline = false }) {
112
112
  const { categories, status, load } = useLazyCategories(initialCategories);
113
- return _jsx("div", { className: "primary-nav-shell", children: _jsxs("nav", { className: "store-container main-nav", "aria-label": "Navega\u00E7\u00E3o principal", children: [_jsx("a", { href: "/", children: "In\u00EDcio" }), menu.map((item) => {
114
- const categorySlug = categorySlugFromMenuItem(item);
115
- if (!categorySlug)
116
- return _jsx("a", { href: item.href, children: item.label }, item.key);
117
- const match = findCategory(categories, categorySlug);
118
- const hasSubcategories = status !== "loaded" || Boolean(match?.category.children.length);
119
- return _jsxs("div", { className: "main-nav-group", onPointerEnter: () => { void load(); }, onFocusCapture: () => { void load(); }, children: [_jsxs("a", { href: item.href, children: [item.label, hasSubcategories && _jsx("svg", { className: "category-item-chevron", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "m6 8 4 4 4-4" }) })] }), hasSubcategories && _jsxs("div", { className: "category-nav-submenu configured-category-submenu", children: [_jsxs("div", { className: "configured-category-heading", children: [_jsxs("div", { children: [_jsx("span", { children: "Explore a categoria" }), _jsx("strong", { children: match?.category.name ?? item.label })] }), _jsx("a", { href: item.href, children: "Ver todos" })] }), status !== "loaded" && !match?.category.children.length && _jsx("p", { className: "category-nav-status", role: "status", children: status === "error" ? "Não foi possível carregar as subcategorias." : "Carregando subcategorias…" }), match?.category.children.length ? _jsx("div", { className: "configured-category-grid", children: _jsx(CategoryTree, { categories: match.category.children, path: match.path }) }) : null] })] }, item.key);
120
- })] }) });
113
+ const navigation = _jsx("nav", { className: `main-nav${inline ? " main-nav-inline" : " store-container"}`, "aria-label": "Navega\u00E7\u00E3o principal", children: menu.map((item) => {
114
+ const categorySlug = categorySlugFromMenuItem(item);
115
+ if (!categorySlug)
116
+ return _jsx("a", { href: item.href, target: item.openInNewTab ? "_blank" : undefined, rel: item.openInNewTab ? "noopener noreferrer" : undefined, children: item.label }, item.key);
117
+ const match = findCategory(categories, categorySlug);
118
+ const hasSubcategories = status !== "loaded" || Boolean(match?.category.children.length);
119
+ return _jsxs("div", { className: "main-nav-group", onPointerEnter: () => { void load(); }, onFocusCapture: () => { void load(); }, children: [_jsxs("a", { href: item.href, children: [item.label, hasSubcategories && _jsx("svg", { className: "category-item-chevron", viewBox: "0 0 20 20", "aria-hidden": "true", children: _jsx("path", { d: "m6 8 4 4 4-4" }) })] }), hasSubcategories && _jsxs("div", { className: "category-nav-submenu configured-category-submenu", children: [status !== "loaded" && !match?.category.children.length && _jsx("p", { className: "category-nav-status", role: "status", children: status === "error" ? "Não foi possível carregar as subcategorias." : "Carregando subcategorias…" }), match?.category.children.length ? _jsx("div", { className: "configured-category-grid", children: _jsx(CategoryTree, { categories: match.category.children, path: match.path }) }) : null] })] }, item.key);
120
+ }) });
121
+ return inline ? navigation : _jsx("div", { className: "primary-nav-shell", children: navigation });
121
122
  }
122
123
  export function SmartProductSearch({ endpoint = "/api/product-suggestions", queryParam = "q", searchProducts }) {
123
124
  const [value, setValue] = useState("");
124
125
  const [results, setResults] = useState([]);
125
126
  const [loading, setLoading] = useState(false);
126
127
  const [open, setOpen] = useState(false);
128
+ const [expanded, setExpanded] = useState(false);
127
129
  const [activeIndex, setActiveIndex] = useState(-1);
128
130
  const root = useRef(null);
131
+ const input = useRef(null);
132
+ useEffect(() => {
133
+ if (expanded)
134
+ window.requestAnimationFrame(() => input.current?.focus());
135
+ }, [expanded]);
129
136
  useEffect(() => {
130
137
  const query = value.trim();
131
138
  if (query.length < 2) {
@@ -163,15 +170,24 @@ export function SmartProductSearch({ endpoint = "/api/product-suggestions", quer
163
170
  return () => { window.clearTimeout(timer); controller.abort(); };
164
171
  }, [endpoint, queryParam, searchProducts, value]);
165
172
  useEffect(() => {
166
- const close = (event) => { if (!root.current?.contains(event.target))
167
- setOpen(false); };
173
+ const close = (event) => {
174
+ if (root.current?.contains(event.target))
175
+ return;
176
+ setOpen(false);
177
+ setExpanded(false);
178
+ };
168
179
  document.addEventListener("pointerdown", close);
169
180
  return () => document.removeEventListener("pointerdown", close);
170
181
  }, []);
171
182
  function handleKeyDown(event) {
172
183
  if (event.key === "Escape") {
173
- setOpen(false);
174
- setActiveIndex(-1);
184
+ if (open) {
185
+ setOpen(false);
186
+ setActiveIndex(-1);
187
+ }
188
+ else {
189
+ setExpanded(false);
190
+ }
175
191
  return;
176
192
  }
177
193
  if (!open || loading || !results.length)
@@ -192,7 +208,7 @@ export function SmartProductSearch({ endpoint = "/api/product-suggestions", quer
192
208
  }
193
209
  const query = value.trim();
194
210
  const resultLabel = `${results.length} ${results.length === 1 ? "resultado" : "resultados"}`;
195
- return _jsxs("div", { className: "header-search-shell", ref: root, children: [_jsxs("form", { className: "header-search", action: "/produtos", children: [_jsx("label", { className: "sr-only", htmlFor: "theme-store-search", children: "Pesquisar produtos" }), _jsx("input", { id: "theme-store-search", name: "busca", type: "search", placeholder: "Busque por produto, marca ou refer\u00EAncia", autoComplete: "off", value: value, onChange: (event) => setValue(event.target.value), onFocus: () => query.length >= 2 && setOpen(true), onKeyDown: handleKeyDown, "aria-expanded": open, "aria-controls": "theme-search-suggestions", "aria-activedescendant": activeIndex >= 0 ? `theme-search-result-${activeIndex}` : undefined, "aria-autocomplete": "list", role: "combobox" }), _jsx("button", { type: "submit", "aria-label": "Pesquisar produtos", children: _jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("path", { d: "m16.5 16.5 4 4" })] }) })] }), open && query.length >= 2 && _jsxs("div", { className: "search-suggestions", id: "theme-search-suggestions", role: "listbox", "aria-label": "Sugest\u00F5es de produtos", children: [_jsxs("div", { className: "search-suggestions-heading", children: [_jsxs("strong", { children: ["Sugest\u00F5es para \u201C", query, "\u201D"] }), !loading && _jsx("span", { children: resultLabel })] }), loading && _jsxs("div", { className: "search-suggestions-loading", children: [_jsx("span", { "aria-hidden": "true" }), _jsx("p", { children: "Procurando os produtos mais pr\u00F3ximos\u2026" })] }), !loading && results.map((product, index) => _jsxs("a", { id: `theme-search-result-${index}`, className: activeIndex === index ? "active" : "", href: productUrl(product), role: "option", "aria-selected": activeIndex === index, onPointerEnter: () => setActiveIndex(index), children: [_jsx("span", { className: "search-suggestion-image", children: _jsx(ThemeImageView, { image: product.image, fallbackAlt: product.title, sizes: "56px", fallbackWidth: 112, fallbackHeight: 112 }) }), _jsxs("span", { className: "search-suggestion-copy", children: [_jsx("strong", { children: product.title }), _jsxs("span", { className: "search-suggestion-meta", children: [product.categories[0]?.name && _jsx("small", { children: product.categories[0].name }), product.sku && _jsxs("small", { children: ["Ref. ", product.sku] })] })] }), displayPrice(product) && _jsx("b", { children: displayPrice(product) }), _jsx("span", { className: "search-suggestion-arrow", "aria-hidden": "true", children: "\u2192" })] }, product.slug)), !loading && !results.length && _jsxs("div", { className: "search-suggestions-empty", children: [_jsx("strong", { children: "Nenhum produto encontrado" }), _jsx("p", { children: "Tente outro nome, marca ou refer\u00EAncia." })] }), !loading && _jsxs("a", { className: "search-all-results", href: `/produtos?busca=${encodeURIComponent(query)}`, children: [_jsx("span", { children: "Ver todos os resultados" }), _jsx("strong", { children: "\u2192" })] })] })] });
211
+ return _jsxs("div", { className: `header-search-shell${expanded ? " is-expanded" : ""}`, ref: root, children: [_jsx("button", { className: "header-search-toggle", type: "button", "aria-label": "Abrir busca", "aria-expanded": expanded, onClick: () => setExpanded(true), children: _jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("path", { d: "m16.5 16.5 4 4" })] }) }), _jsxs("form", { className: "header-search", action: "/produtos", children: [_jsx("label", { className: "sr-only", htmlFor: "theme-store-search", children: "Pesquisar produtos" }), _jsx("input", { ref: input, id: "theme-store-search", name: "busca", type: "search", placeholder: "Busque por produto, marca ou refer\u00EAncia", autoComplete: "off", tabIndex: expanded ? 0 : -1, value: value, onChange: (event) => setValue(event.target.value), onFocus: () => query.length >= 2 && setOpen(true), onKeyDown: handleKeyDown, "aria-expanded": open, "aria-controls": "theme-search-suggestions", "aria-activedescendant": activeIndex >= 0 ? `theme-search-result-${activeIndex}` : undefined, "aria-autocomplete": "list", role: "combobox" }), _jsx("button", { type: "submit", tabIndex: expanded ? 0 : -1, "aria-label": "Pesquisar produtos", children: _jsxs("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("path", { d: "m16.5 16.5 4 4" })] }) }), _jsx("button", { className: "header-search-close", type: "button", tabIndex: expanded ? 0 : -1, "aria-label": "Fechar busca", onClick: () => { setOpen(false); setExpanded(false); }, children: "\u00D7" })] }), open && query.length >= 2 && _jsxs("div", { className: "search-suggestions", id: "theme-search-suggestions", role: "listbox", "aria-label": "Sugest\u00F5es de produtos", children: [_jsxs("div", { className: "search-suggestions-heading", children: [_jsxs("strong", { children: ["Sugest\u00F5es para \u201C", query, "\u201D"] }), !loading && _jsx("span", { children: resultLabel })] }), loading && _jsxs("div", { className: "search-suggestions-loading", children: [_jsx("span", { "aria-hidden": "true" }), _jsx("p", { children: "Procurando os produtos mais pr\u00F3ximos\u2026" })] }), !loading && results.map((product, index) => _jsxs("a", { id: `theme-search-result-${index}`, className: activeIndex === index ? "active" : "", href: productUrl(product), role: "option", "aria-selected": activeIndex === index, onPointerEnter: () => setActiveIndex(index), children: [_jsx("span", { className: "search-suggestion-image", children: _jsx(ThemeImageView, { image: product.image, fallbackAlt: product.title, sizes: "56px", fallbackWidth: 112, fallbackHeight: 112 }) }), _jsxs("span", { className: "search-suggestion-copy", children: [_jsx("strong", { children: product.title }), _jsxs("span", { className: "search-suggestion-meta", children: [product.categories[0]?.name && _jsx("small", { children: product.categories[0].name }), product.sku && _jsxs("small", { children: ["Ref. ", product.sku] })] })] }), displayPrice(product) && _jsx("b", { children: displayPrice(product) }), _jsx("span", { className: "search-suggestion-arrow", "aria-hidden": "true", children: "\u2192" })] }, product.slug)), !loading && !results.length && _jsxs("div", { className: "search-suggestions-empty", children: [_jsx("strong", { children: "Nenhum produto encontrado" }), _jsx("p", { children: "Tente outro nome, marca ou refer\u00EAncia." })] }), !loading && _jsxs("a", { className: "search-all-results", href: `/produtos?busca=${encodeURIComponent(query)}`, children: [_jsx("span", { children: "Ver todos os resultados" }), _jsx("strong", { children: "\u2192" })] })] })] });
196
212
  }
197
213
  function MobileCategories({ categories, path = [] }) {
198
214
  return categories.map((category) => {
@@ -200,7 +216,7 @@ function MobileCategories({ categories, path = [] }) {
200
216
  return category.children?.length ? _jsxs("details", { className: "mobile-menu-category", children: [_jsxs("summary", { children: [_jsx("span", { children: category.name }), _jsx("span", { "aria-hidden": "true", children: "+" })] }), _jsxs("div", { children: [_jsxs("a", { href: categoryUrl(next), children: ["Ver tudo em ", category.name] }), _jsx(MobileCategories, { categories: category.children, path: next })] })] }, category.slug) : _jsx("a", { href: categoryUrl(next), children: category.name }, category.slug);
201
217
  });
202
218
  }
203
- export function MobileStoreMenu({ site, categories: initialCategories, pages, menu = [] }) {
219
+ export function MobileStoreMenu({ site, categories: initialCategories, menu = [], headerButton }) {
204
220
  const [open, setOpen] = useState(false);
205
221
  const { categories, status, load } = useLazyCategories(initialCategories);
206
222
  useEffect(() => {
@@ -213,14 +229,14 @@ export function MobileStoreMenu({ site, categories: initialCategories, pages, me
213
229
  const settings = site.settings;
214
230
  const configuredMenu = [...menu].sort((left, right) => left.order - right.order);
215
231
  const configuredHasCategories = configuredMenu.some((item) => item.type === "CATEGORY");
216
- return _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "mobile-menu-trigger", onClick: () => { setOpen(true); if (!configuredMenu.length || configuredHasCategories)
217
- void load(); }, "aria-label": "Abrir menu", children: _jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "M4 7h16M4 12h16M4 17h16" }) }) }), open && _jsx("div", { className: "mobile-menu-backdrop", role: "presentation", onPointerDown: (event) => event.target === event.currentTarget && setOpen(false), children: _jsxs("aside", { className: "mobile-menu-drawer", "aria-label": "Menu da loja", children: [_jsxs("div", { className: "mobile-menu-heading", children: [_jsxs("div", { children: [_jsx("small", { children: "Navegue pela loja" }), _jsx("strong", { children: settings?.siteName || site.tenant.name })] }), _jsx("button", { type: "button", onClick: () => setOpen(false), "aria-label": "Fechar menu", children: "\u00D7" })] }), _jsxs("nav", { className: "mobile-menu-links", children: [_jsx("a", { href: "/", children: "In\u00EDcio" }), configuredMenu.length ? configuredMenu.map((item) => {
232
+ return _jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "mobile-menu-trigger", onClick: () => { setOpen(true); if (configuredHasCategories)
233
+ void load(); }, "aria-label": "Abrir menu", children: _jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "M4 7h16M4 12h16M4 17h16" }) }) }), open && _jsx("div", { className: "mobile-menu-backdrop", role: "presentation", onPointerDown: (event) => event.target === event.currentTarget && setOpen(false), children: _jsxs("aside", { className: "mobile-menu-drawer", "aria-label": "Menu da loja", children: [_jsxs("div", { className: "mobile-menu-heading", children: [_jsxs("div", { children: [_jsx("small", { children: "Navega\u00E7\u00E3o" }), _jsx("strong", { children: settings?.siteName || site.tenant.name })] }), _jsx("button", { type: "button", onClick: () => setOpen(false), "aria-label": "Fechar menu", children: "\u00D7" })] }), _jsxs("nav", { className: "mobile-menu-links", children: [configuredMenu.map((item) => {
218
234
  const categorySlug = categorySlugFromMenuItem(item);
219
235
  if (!categorySlug)
220
- return _jsx("a", { href: item.href, children: item.label }, item.key);
236
+ return _jsx("a", { href: item.href, target: item.openInNewTab ? "_blank" : undefined, rel: item.openInNewTab ? "noopener noreferrer" : undefined, children: item.label }, item.key);
221
237
  const match = findCategory(categories, categorySlug);
222
238
  const hasSubcategories = status !== "loaded" || Boolean(match?.category.children.length);
223
239
  return hasSubcategories ? _jsxs("details", { className: "mobile-menu-category", children: [_jsxs("summary", { children: [_jsx("span", { children: item.label }), _jsx("span", { "aria-hidden": "true", children: "+" })] }), _jsxs("div", { children: [_jsxs("a", { href: item.href, children: ["Ver tudo em ", item.label] }), status !== "loaded" && !match?.category.children.length && _jsx("p", { className: "mobile-menu-category-status", role: "status", children: status === "error" ? "Não foi possível carregar as subcategorias." : "Carregando subcategorias…" }), match?.category.children.length ? _jsx(MobileCategories, { categories: match.category.children, path: match.path }) : null] })] }, item.key) : _jsx("a", { href: item.href, children: item.label }, item.key);
224
- }) : _jsxs(_Fragment, { children: [site.modules.includes("PRODUCTS") && _jsx("a", { href: "/produtos", children: "Todos os produtos" }), site.modules.includes("BLOG") && _jsx("a", { href: "/blog", children: "Blog" }), site.modules.includes("SERVICES") && _jsx("a", { href: "/servicos", children: "Servi\u00E7os" }), site.modules.includes("CASES") && _jsx("a", { href: "/cases", children: "Cases" }), pages.slice(0, 8).map((page) => _jsx("a", { href: `/${page.slug}`, children: page.title }, page.slug))] })] }), !configuredMenu.length && categories.length > 0 && _jsxs("section", { className: "mobile-menu-categories", children: [_jsx("h2", { children: "Categorias" }), status === "loading" && _jsx("p", { className: "mobile-menu-category-status", role: "status", children: "Carregando categorias\u2026" }), status === "error" && _jsx("p", { className: "mobile-menu-category-status", children: "N\u00E3o foi poss\u00EDvel atualizar as categorias." }), _jsx(MobileCategories, { categories: categories })] })] }) })] });
240
+ }), headerButton?.enabled && _jsx("a", { className: "mobile-menu-highlight", href: headerButton.href, target: headerButton.openInNewTab ? "_blank" : undefined, rel: headerButton.openInNewTab ? "noopener noreferrer" : undefined, style: { backgroundColor: headerButton.backgroundColor, color: headerButton.textColor }, children: headerButton.label })] })] }) })] });
225
241
  }
226
242
  //# sourceMappingURL=header-interactions.js.map