@grupo-elo-editorial/shared-ui-react 1.1.0 → 1.2.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.
- package/CHANGELOG.md +44 -0
- package/dist/components/molecules/ProductCard.d.ts +5 -0
- package/dist/components/prd/Footer.d.ts +10 -0
- package/dist/components/prd/MegaMenu.d.ts +16 -0
- package/dist/components/prd/TopAccessibilityBar.d.ts +1 -0
- package/dist/components/prd/index.d.ts +4 -0
- package/dist/index.js +1339 -730
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,50 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) · Versioning:
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.2.1] — 2026-05-24 (Hotfix — exports.development leaking into published tarball)
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`exports` resolution in npm-consumed dev mode**: the package.json `exports."." .development` condition resolved to `./src/index.ts`, but `src/` was not included in the published tarball (`files: ["dist", ...]`). This worked silently when the package was consumed from the workspace (where `src/` exists), but broke any consumer that pulled `@grupo-elo-editorial/shared-ui-react` from npm and ran a tool that matches the `development` export condition (Webpack/Turbopack in Next.js dev mode, Vite dev). The failure mode was a hard *Module not found: Can't resolve '@grupo-elo-editorial/shared-ui-react'* with no obvious cause — webpack honored the condition, tried `./src/index.ts`, didn't find it, and gave up instead of falling through to `import`.
|
|
12
|
+
|
|
13
|
+
Fix removes the `development` condition entirely. Both workspace consumers and npm consumers now resolve via `import: ./dist/index.js`, which works in both contexts. Workspace developers can run `pnpm build --watch` if they need source HMR.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- `package.json` `version` bumped `1.2.0 → 1.2.1`.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## [1.2.0] — 2026-05-24 (HeroCarousel aspect ratios + RSC compatibility)
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- **`TopAccessibilityBar`**: the bar background was `var(--background)` — identical to the page background, so the bar blended in and visually disappeared. The "Ferramentas de Acessibilidade" label was also hidden below the `md:` (768px) breakpoint. Switched the bar to `var(--card)` so it sits on the elevated surface (matching the mockup), and dropped the label breakpoint from `md:` to `sm:` (640px) so the label is visible on most desktops/tablets, hiding only on narrow phones.
|
|
26
|
+
|
|
27
|
+
- **`Footer`**: the catalog navigation column had two entries pointing to the same `href` (`/livros/catalogo` for both "Livros" and "Mais Vendidos"), and the `<li>` `map` used `key={link.href}` — triggering a React duplicate-key warning on every render. Switched the key to `link.label` (unique within a column) and made "Mais Vendidos" point to `/livros/catalogo?ordem=mais_vendidos`. Also redirected "Lançamentos" from the non-existent `/lancamentos` route to `/livros/catalogo?ordem=recentes`, so the link now lands on the catalog with the right sort applied instead of 404'ing.
|
|
28
|
+
|
|
29
|
+
- **`HeroCarousel`**: the `<img>` aspect ratio was `aspect-[3/4] md:aspect-video` for every breakpoint ≥768px. On desktop this produced a ~720px-tall hero in a 1280px viewport — significantly taller than the mockup (440px) and mismatched against the panoramic desktop banner artwork specified by the site-multibrand PRD (F3 — desktop 1920×700, ratio ~2.74:1). Updated to `aspect-[5/6] md:aspect-video lg:aspect-[1920/700]`, which now matches the PRD-specified artwork dimensions at each breakpoint: mobile 750×900, tablet 1024×576, desktop 1920×700.
|
|
30
|
+
|
|
31
|
+
- **React Server Components compatibility**: six components used React hooks (`useState`, `useEffect`) without a `'use client'` directive. When consumed from npm as built `dist/` they worked because Vite preserved the runtime behavior, but when resolved via the `development` export condition to the raw `src/` (e.g. when linked into a Next.js App Router project from the workspace) they failed with *"You're importing a component that needs `useState`. This React Hook only works in a Client Component."* Added `'use client'` to:
|
|
32
|
+
- `atoms/Avatar.tsx`
|
|
33
|
+
- `atoms/Rating.tsx`
|
|
34
|
+
- `figma/ImageWithFallback.tsx`
|
|
35
|
+
- `molecules/SearchBar.tsx`
|
|
36
|
+
- `prd/HeroCarousel.tsx`
|
|
37
|
+
- `prd/TopAccessibilityBar.tsx`
|
|
38
|
+
|
|
39
|
+
Other client components (`prd/Footer.tsx`, `prd/MegaMenu.tsx`, plus the `ui/` Radix wrappers) already had the directive.
|
|
40
|
+
|
|
41
|
+
### Migration
|
|
42
|
+
|
|
43
|
+
No API change. Consumers passing custom `className` to `<HeroCarousel>` continue to work as before. Visual change only — the hero will be shorter on desktop and slightly less tall on mobile. If a consumer was depending on the previous heights, override via `className` on the wrapper to constrain max-height.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- `package.json` `version` bumped `1.1.0 → 1.2.0`.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
7
51
|
## [1.1.0] — 2026-05-20 (Layout primitives + Figma shared-ui sync)
|
|
8
52
|
|
|
9
53
|
Additive sync with the upstream Figma shared-ui file (`q4V5CYymU4oU5nlbbHNmh8`) and with `@grupo-elo-editorial/design-tokens@3.1.0`. No breaking changes; consumers of `^1.0.0` can bump to `^1.1.0` with zero code changes.
|
|
@@ -2,6 +2,7 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
export interface ProductCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
image: string;
|
|
4
4
|
title: string;
|
|
5
|
+
author?: string;
|
|
5
6
|
price: number;
|
|
6
7
|
originalPrice?: number;
|
|
7
8
|
rating?: number;
|
|
@@ -13,6 +14,10 @@ export interface ProductCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
14
|
onAddToCart?: () => void;
|
|
14
15
|
onToggleFavorite?: () => void;
|
|
15
16
|
isFavorite?: boolean;
|
|
17
|
+
/** Makes the card image and title clickable as a link. */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** 'vertical' (default) stacks image above content; 'horizontal' places a compact image to the left. */
|
|
20
|
+
orientation?: 'vertical' | 'horizontal';
|
|
16
21
|
}
|
|
17
22
|
declare const ProductCard: import("react").ForwardRefExoticComponent<ProductCardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
23
|
export { ProductCard };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface FooterProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
brand?: 'elo-editora' | 'perabook';
|
|
4
|
+
onNewsletterSubmit?: (email: string) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const Footer: {
|
|
7
|
+
({ brand, onNewsletterSubmit, className, ...props }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export { Footer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface NavItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
children?: NavItem[];
|
|
7
|
+
}
|
|
8
|
+
export interface MegaMenuProps extends HTMLAttributes<HTMLElement> {
|
|
9
|
+
items: NavItem[];
|
|
10
|
+
logo?: React.ReactNode;
|
|
11
|
+
rightSlot?: React.ReactNode;
|
|
12
|
+
searchSlot?: React.ReactNode;
|
|
13
|
+
drawerFooter?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const MegaMenu: import("react").ForwardRefExoticComponent<MegaMenuProps & import("react").RefAttributes<HTMLElement>>;
|
|
16
|
+
export { MegaMenu };
|
|
@@ -2,6 +2,7 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
export interface TopAccessibilityBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
onThemeChange?: (theme: 'light' | 'dark') => void;
|
|
4
4
|
onFontSizeChange?: (size: number) => void;
|
|
5
|
+
showA11yLink?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare const TopAccessibilityBar: import("react").ForwardRefExoticComponent<TopAccessibilityBarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
8
|
export { TopAccessibilityBar };
|
|
@@ -2,3 +2,7 @@ export { TopAccessibilityBar } from './TopAccessibilityBar';
|
|
|
2
2
|
export type { TopAccessibilityBarProps } from './TopAccessibilityBar';
|
|
3
3
|
export { HeroCarousel } from './HeroCarousel';
|
|
4
4
|
export type { HeroCarouselProps, HeroSlide } from './HeroCarousel';
|
|
5
|
+
export { MegaMenu } from './MegaMenu';
|
|
6
|
+
export type { MegaMenuProps, NavItem } from './MegaMenu';
|
|
7
|
+
export { Footer } from './Footer';
|
|
8
|
+
export type { FooterProps } from './Footer';
|