@grupo-elo-editorial/shared-ui-react 1.3.17 → 1.4.0
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/CHANGELOG.md +16 -0
- package/dist/components/molecules/ProductCard.d.ts +26 -1
- package/dist/components/molecules/index.d.ts +1 -1
- package/dist/components/organisms/ProductGrid.d.ts +6 -1
- package/dist/components/prd/Footer.d.ts +11 -1
- package/dist/components/prd/index.d.ts +1 -1
- package/dist/index.js +512 -512
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) · Versioning:
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.4.0] — 2026-06-10 (Footer navColumns + ProductCard/ProductGrid renderImage)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`Footer`**: nova prop opcional `navColumns: FooterNavColumn[]` para que o app consumidor injete suas próprias colunas de navegação. Quando omitida, mantém o default do pacote (comportamento anterior preservado — sem breaking change). Novo tipo exportado `FooterNavColumn` (`{ id, title, links }`). (ELO-379)
|
|
12
|
+
- **`ProductCard`** e **`ProductGrid`**: nova prop opcional `renderImage` (tipo `ProductImageRenderer`) para injetar a renderização da imagem da capa. Mantém o pacote framework-agnóstico — o default é um `<img>` nativo com `loading="lazy"` + `decoding="async"`; consumidores Next.js podem injetar `next/image` (modo `fill`) para WebP/AVIF + resize dinâmico. Novo tipo exportado `ProductImageRenderer`. (ELO-383)
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **`ProductCard`**: as imagens das capas (layouts vertical e horizontal) agora passam por `renderImage`. O container da imagem horizontal recebeu `relative` para suportar `next/image` em modo `fill`. Sem mudança no comportamento visual default.
|
|
17
|
+
- `package.json` `version` bumped `1.3.17 → 1.4.0` (minor — props opcionais, retrocompatível).
|
|
18
|
+
|
|
19
|
+
> Nota: o `HeroCarousel` NÃO foi alterado. Ele usa `<picture>` com 3 crops distintos (desktop/tablet/mobile) — *art-direction* — onde `next/image` não encaixa bem; já é responsivo (srcSet 1x/2x) + lazy.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
7
23
|
## [1.3.17] — 2026-06-05 (Footer — logo Elo Editora aumentada para h-14)
|
|
8
24
|
|
|
9
25
|
### Fixed
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Render function injetável para a imagem da capa.
|
|
4
|
+
*
|
|
5
|
+
* O pacote é framework-agnóstico (sem dependência de Next.js). Por padrão
|
|
6
|
+
* renderiza um `<img>` nativo com `loading="lazy"`. Um consumidor Next.js pode
|
|
7
|
+
* injetar `next/image` (modo `fill`) para ganhar WebP/AVIF + resize dinâmico —
|
|
8
|
+
* o container da imagem é `position: relative`, então `fill` funciona.
|
|
9
|
+
*
|
|
10
|
+
* Exemplo (site-multibrand):
|
|
11
|
+
* renderImage={({ src, alt, className }) => (
|
|
12
|
+
* <Image src={src} alt={alt} className={className} fill sizes="(max-width:768px) 50vw, 25vw" />
|
|
13
|
+
* )}
|
|
14
|
+
*
|
|
15
|
+
* ELO-383
|
|
16
|
+
*/
|
|
17
|
+
export type ProductImageRenderer = (props: {
|
|
18
|
+
src: string;
|
|
19
|
+
alt: string;
|
|
20
|
+
className: string;
|
|
21
|
+
}) => ReactNode;
|
|
2
22
|
export interface ProductCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
23
|
image: string;
|
|
4
24
|
title: string;
|
|
@@ -18,6 +38,11 @@ export interface ProductCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
18
38
|
href?: string;
|
|
19
39
|
/** 'vertical' (default) stacks image above content; 'horizontal' places a compact image to the left. */
|
|
20
40
|
orientation?: 'vertical' | 'horizontal';
|
|
41
|
+
/**
|
|
42
|
+
* Render function opcional para a imagem da capa. Default: `<img loading="lazy">`.
|
|
43
|
+
* Consumidores Next.js podem injetar `next/image` (modo `fill`). Ver `ProductImageRenderer`.
|
|
44
|
+
*/
|
|
45
|
+
renderImage?: ProductImageRenderer;
|
|
21
46
|
}
|
|
22
47
|
declare const ProductCard: import("react").ForwardRefExoticComponent<ProductCardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
48
|
export { ProductCard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ProductCard } from './ProductCard';
|
|
2
|
-
export type { ProductCardProps } from './ProductCard';
|
|
2
|
+
export type { ProductCardProps, ProductImageRenderer } from './ProductCard';
|
|
3
3
|
export { SearchBar } from './SearchBar';
|
|
4
4
|
export type { SearchBarProps } from './SearchBar';
|
|
5
5
|
export { PriceDisplay } from './PriceDisplay';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { ProductCardProps } from '../molecules/ProductCard';
|
|
2
|
+
import { ProductCardProps, type ProductImageRenderer } from '../molecules/ProductCard';
|
|
3
3
|
export interface ProductGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
products: ProductCardProps[];
|
|
5
5
|
columns?: 2 | 3 | 4 | 5;
|
|
@@ -8,6 +8,11 @@ export interface ProductGridProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
skeletonCount?: number;
|
|
9
9
|
emptyStateMessage?: string;
|
|
10
10
|
onEmptyAction?: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Render function aplicada à imagem de todos os cards (default: `<img loading="lazy">`).
|
|
13
|
+
* Consumidores Next.js podem injetar `next/image`. Ver `ProductImageRenderer`. ELO-383.
|
|
14
|
+
*/
|
|
15
|
+
renderImage?: ProductImageRenderer;
|
|
11
16
|
}
|
|
12
17
|
declare const ProductGrid: import("react").ForwardRefExoticComponent<ProductGridProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
18
|
export { ProductGrid };
|
|
@@ -16,6 +16,14 @@ export interface OrgInfo {
|
|
|
16
16
|
/** URL do badge da App Store (tema escuro) */
|
|
17
17
|
appStoreBadgeUrlDark?: string;
|
|
18
18
|
}
|
|
19
|
+
export interface FooterNavColumn {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
links: {
|
|
23
|
+
label: string;
|
|
24
|
+
href: string;
|
|
25
|
+
}[];
|
|
26
|
+
}
|
|
19
27
|
export interface FooterProps extends HTMLAttributes<HTMLElement> {
|
|
20
28
|
brand?: 'elo-editora' | 'perabook';
|
|
21
29
|
onNewsletterSubmit?: (email: string) => void;
|
|
@@ -27,9 +35,11 @@ export interface FooterProps extends HTMLAttributes<HTMLElement> {
|
|
|
27
35
|
appStoreUrl?: string;
|
|
28
36
|
/** Dados da organização vindos do Firestore (sites/{brand}/org_grupo_elo/info). */
|
|
29
37
|
orgInfo?: OrgInfo;
|
|
38
|
+
/** Colunas de navegação. Quando omitido, usa o default do pacote. */
|
|
39
|
+
navColumns?: FooterNavColumn[];
|
|
30
40
|
}
|
|
31
41
|
declare const Footer: {
|
|
32
|
-
({ brand, onNewsletterSubmit, newsletterSlot, playStoreUrl, appStoreUrl, orgInfo, className, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
({ brand, onNewsletterSubmit, newsletterSlot, playStoreUrl, appStoreUrl, orgInfo, navColumns, className, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
33
43
|
displayName: string;
|
|
34
44
|
};
|
|
35
45
|
export { Footer };
|
|
@@ -5,4 +5,4 @@ export type { HeroCarouselProps, HeroSlide } from './HeroCarousel';
|
|
|
5
5
|
export { MegaMenu } from './MegaMenu';
|
|
6
6
|
export type { MegaMenuProps, NavItem } from './MegaMenu';
|
|
7
7
|
export { Footer } from './Footer';
|
|
8
|
-
export type { FooterProps, OrgInfo } from './Footer';
|
|
8
|
+
export type { FooterProps, OrgInfo, FooterNavColumn } from './Footer';
|