Skip to content

feat(react,elements): white-label theming API for the checkout widget#46

Merged
aguilar1x merged 12 commits into
PACTO-LAT:mainfrom
felipevega2x:feat/white-label-theming
Jul 19, 2026
Merged

feat(react,elements): white-label theming API for the checkout widget#46
aguilar1x merged 12 commits into
PACTO-LAT:mainfrom
felipevega2x:feat/white-label-theming

Conversation

@felipevega2x

Copy link
Copy Markdown
Contributor

Implements the white-label theming API for the checkout widget.

What

  • Design tokens as --pacto-* CSS variables (colors, typography, radius,
    spacing), shared by connect-react and connect-elements via connect-core.
  • theme prop/option plus documented raw CSS variables.
  • Brand logo injection (logoUrl/logoAlt) in the checkout header.
  • en/es locale support with deep-mergeable messages overrides and a
    documented path to add locales.
  • Docs page (/theming) covering all three.

Notes

  • Removed duplicated label functions; copy now resolved from a single
    dictionary in connect-core (en defaults unchanged, existing tests green).
  • Fixed a pre-existing broken merge in connect-core/src/index.ts (duplicate
    init/Pacto exports) that blocked the build.

Acceptance criteria

  • Restyle via documented CSS variables, no fork required.
  • The same theme config works in React and the web component.
  • Copy renders in en/es, with a documented path to add more.

Tests

core 61/61 · elements 28/28 · react 16/16 · type-check + biome clean.

Closes #45

@aguilar1x aguilar1x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

…ing build

index.ts carried a broken merge artifact: a full inline SDK implementation
(init/Pacto/PactoSession + FX getQuote) that redeclared exports already
re-exported from ./client.js and referenced names it never imported, so core
failed to type-check and build. client.ts is the real, compiling implementation.

Removes the duplicated inline block so index.ts is a pure barrel over
client.ts and the submodules, and drops the orphaned getQuote/PactoFxQuote
tests (the FX-quote surface never compiled and is unused; the gateway has its
own independent FX implementation). Unblocks the core build required by PACTO-LAT#45.
…nder error

next@14 hoists React 18 to the root while this package pins React 19, so
@testing-library/react and the component under test resolved to two different
React copies — throwing 'Objects are not valid as a React child'. Alias both
React packages to the root copy in the vitest config so tests run against one
instance. Does not affect the shipped build (React stays a peer dependency).
…-check

Pre-existing breakage from the otc-quote merge: the ApiKey model gained a
required quoteSpreadBps column but several test fixtures were never updated,
failing tsc in CI. Not related to the theming feature, but fixed here to keep CI green.
Two pre-existing api-docs generator issues, surfaced by the theming API's
new types:

- next build failed rendering core/react api-reference: JSDoc placeholders
  like {amount}/{escrowId} rendered outside code blocks, which MDX evaluates
  as JS expressions. Escape braces (and keep the existing custom-element
  escaping) in prose so they render literally.
- The freshness check drifted on every commit because TypeDoc embedded the
  HEAD commit SHA in source links. Pin --gitRevision main so links are stable
  and the check can actually pass.

Regenerated core/react/elements api-reference with the fixed generator.
@felipevega2x
felipevega2x force-pushed the feat/white-label-theming branch from 32cfc17 to dfc2e8f Compare July 19, 2026 02:15
@aguilar1x
aguilar1x merged commit 31d39f4 into PACTO-LAT:main Jul 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(react,elements): white-label theming API for the checkout widget

2 participants