Files
zeekayandHanzo Dev 57f9435929 Keep every package in one directory
The workspace declared pkg/* and pkgs/* both, so one repo had two names
for one concept and a package's home was a coin toss. The shared build
tooling already lived in pkg/ui/scripts and pkgs reached back into it
two levels up; now it is a sibling. hanzo.yml gates on pkg/ui, so the
published library stays where CI already looks and the rest joins it.

The publish glob follows: one root, one pattern, nothing invisible to it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 23:50:28 -07:00

48 lines
1.2 KiB
TypeScript

/**
* @hanzo/shop
*
* Unified embeddable payment topup widget for Hanzo apps.
* Drop a single <TopupButton> anywhere to let users add funds.
*
* @example
* ```tsx
* import { TopupButton } from '@hanzo/shop'
*
* // Minimal usage — token falls back to localStorage 'hanzo-auth-token'
* <TopupButton userId="user_123" />
*
* // With explicit token and custom amount
* <TopupButton
* userId="user_123"
* token={iamToken}
* defaultAmount={50_00} // cents
* onSuccess={(balance) => console.log('new balance', balance)}
* />
* ```
*/
// Components
export { TopupButton } from './components/TopupButton'
export { HanzoTopup } from './components/HanzoTopup'
export { PaymentStep } from './components/PaymentStep'
export { CardInput } from './components/CardInput'
export { CryptoInput } from './components/CryptoInput'
export { BankInput } from './components/BankInput'
export { SuccessStep } from './components/SuccessStep'
// Hooks
export { useTopup } from './hooks/useTopup'
export { useSquareCard } from './hooks/useSquareCard'
// Types
export type {
TopupConfig,
PaymentTab,
TopupStatus,
PresetAmount,
CryptoChain,
WalletAddress,
} from './types'
export { PRESET_AMOUNTS, MIN_AMOUNT_CENTS, CRYPTO_CHAINS } from './types'