@naculus/connect-native 0.8.1 → 0.9.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/dist/ui/index.cjs +980 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +106 -0
- package/dist/ui/index.d.ts +106 -0
- package/dist/ui/index.js +954 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +10 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/index.ts","../../src/ui/AuthorizationConsentNative.tsx","../../src/ui/parts.tsx","../../src/ui/theme.tsx","../../src/ui/AuthorizationListNative.tsx","../../src/ui/PaymentReceiptNative.tsx"],"sourcesContent":["/**\n * React Native payment UI, published as `@naculus/connect-native/ui` so apps\n * that only need the wallet connectors do not load it.\n */\nexport {\n AuthorizationConsentNative,\n type AuthorizationConsentNativeProps,\n} from \"./AuthorizationConsentNative\";\nexport {\n AuthorizationListNative,\n type AuthorizationListNativeProps,\n} from \"./AuthorizationListNative\";\nexport {\n PaymentReceiptNative,\n type PaymentReceiptNativeProps,\n} from \"./PaymentReceiptNative\";\nexport {\n darkPaymentTheme,\n lightPaymentTheme,\n type NativePaymentTheme,\n NativePaymentThemeProvider,\n useNativePaymentTheme,\n} from \"./theme\";\n","import {\n type AuthorizationAssetMetadata,\n type AuthorizationDescription,\n describeAuthorization,\n type SpendExplanation,\n} from \"@naculus/connect-appkit-core\";\nimport type { Authorization, ListedAuthorization } from \"@naculus/connect-core\";\nimport { Image, ScrollView, StyleSheet, Text, View } from \"react-native\";\nimport {\n ActionButton,\n Callout,\n CopyableValue,\n styles as shared,\n} from \"./parts\";\nimport { type NativePaymentTheme, useNativePaymentTheme } from \"./theme\";\n\nexport interface AuthorizationConsentNativeProps {\n /** Who asks: shown as \"Allow {name} to pay?\". */\n requester: { name: string; icon?: string; origin?: string };\n /** A raw authorization, or a description already built by the caller. */\n authorization: Authorization | ListedAuthorization | AuthorizationDescription;\n assets?: Record<string, AuthorizationAssetMetadata>;\n /** `explainSpend` result for the payment that triggered this consent. */\n preview?: SpendExplanation;\n onApprove: () => void;\n onDecline: () => void;\n /** Disables Approve and shows \"Approving…\". */\n busy?: boolean;\n /** Copies a recipient address; the copy button shows only when set. */\n onCopy?: (text: string) => void;\n /** BCP 47 locale for the expiry; English when omitted. */\n locale?: string;\n /** Unix timestamp in seconds, for a stable relative expiry. */\n now?: number;\n theme?: NativePaymentTheme;\n}\n\n/** React Native counterpart of the web `AuthorizationConsent`. */\nexport function AuthorizationConsentNative({\n authorization,\n assets = {},\n locale,\n now,\n requester,\n preview,\n onApprove,\n onDecline,\n busy = false,\n onCopy,\n theme: themeProp,\n}: AuthorizationConsentNativeProps) {\n const theme = useNativePaymentTheme(themeProp);\n const description =\n \"expiry\" in authorization\n ? authorization\n : describeAuthorization(authorization, { assets, locale, now });\n const muted = { color: theme.mutedForeground };\n\n return (\n <View style={[styles.root, { backgroundColor: theme.background }]}>\n <ScrollView contentContainerStyle={styles.content}>\n <View style={styles.requester}>\n {requester.icon ? (\n <Image\n accessibilityIgnoresInvertColors\n source={{ uri: requester.icon }}\n style={styles.avatar}\n />\n ) : (\n <View\n importantForAccessibility=\"no\"\n style={[styles.avatar, { backgroundColor: theme.muted }]}\n >\n <Text style={[styles.initial, { color: theme.foreground }]}>\n {requester.name.slice(0, 1).toUpperCase()}\n </Text>\n </View>\n )}\n <View style={styles.flexShrink}>\n <Text\n accessibilityRole=\"header\"\n style={[shared.heading, { color: theme.foreground }]}\n >\n Allow {requester.name} to pay?\n </Text>\n {requester.origin && (\n <Text style={[styles.small, muted]}>{requester.origin}</Text>\n )}\n </View>\n </View>\n\n {description.warnings.map((warning) => (\n <Callout\n key={warning}\n tone=\"warning\"\n glyph=\"⚠\"\n role=\"alert\"\n theme={theme}\n >\n <Text style={styles.strong}>{warning}</Text>\n </Callout>\n ))}\n\n {preview && (\n <Callout\n tone={preview.allowed ? \"success\" : \"danger\"}\n glyph={preview.allowed ? \"✓\" : \"✕\"}\n theme={theme}\n >\n <Text style={styles.strong}>\n {preview.allowed ? \"Allowed\" : \"Blocked\"}.\n </Text>{\" \"}\n {preview.sentence}\n </Callout>\n )}\n\n {description.grants.map((grant) => (\n <View\n key={`${grant.asset}:${grant.recipients.map((r) => r.full).join(\",\")}:${grant.perPayment.formatted}:${grant.total.formatted}`}\n style={[\n styles.card,\n { backgroundColor: theme.card, borderColor: theme.border },\n ]}\n >\n <Text style={[styles.assetLabel, { color: theme.foreground }]}>\n {grant.assetLabel}\n </Text>\n <View style={styles.limits}>\n <View style={styles.limit}>\n <Text style={[shared.label, muted]}>Per payment</Text>\n <Text style={[styles.amount, { color: theme.foreground }]}>\n {grant.perPayment.formatted}\n </Text>\n </View>\n <View style={styles.limit}>\n <Text style={[shared.label, muted]}>Total limit</Text>\n <Text style={[styles.amount, { color: theme.foreground }]}>\n {grant.total.formatted}\n </Text>\n </View>\n </View>\n\n <Text style={[styles.term, { color: theme.foreground }]}>\n Recipients\n </Text>\n {grant.recipients.length ? (\n grant.recipients.map((recipient) => (\n <CopyableValue\n key={recipient.full}\n value={recipient.full}\n display={recipient.shortened}\n onCopy={onCopy}\n theme={theme}\n />\n ))\n ) : (\n <Text style={[styles.strong, { color: theme.dangerForeground }]}>\n No recipient restriction is displayed\n </Text>\n )}\n\n <Text style={[styles.term, { color: theme.foreground }]}>\n Payment count\n </Text>\n <Text style={[styles.small, muted]}>\n {grant.count === null ? \"No count limit\" : `Up to ${grant.count}`}\n </Text>\n\n <Text style={[styles.term, { color: theme.foreground }]}>\n Payment methods\n </Text>\n <View style={styles.chips}>\n {grant.rails.map((rail) => (\n <View\n key={rail}\n style={[\n shared.chip,\n { backgroundColor: theme.muted, borderColor: theme.border },\n ]}\n >\n <Text style={[shared.chipText, { color: theme.foreground }]}>\n {rail}\n </Text>\n </View>\n ))}\n </View>\n </View>\n ))}\n\n <View style={[styles.expiry, { backgroundColor: theme.muted }]}>\n <Text style={[styles.strong, { color: theme.foreground }]}>\n Expires {description.expiry.relative}\n </Text>\n <Text style={[styles.small, muted]}>\n {description.expiry.absolute}\n </Text>\n </View>\n </ScrollView>\n\n {/* Outside the ScrollView so it stays on screen on short landscape phones. */}\n <View\n testID=\"payment-actions\"\n style={[\n styles.footer,\n { borderTopColor: theme.border, backgroundColor: theme.background },\n ]}\n >\n <ActionButton\n label=\"Decline\"\n variant=\"secondary\"\n onPress={onDecline}\n theme={theme}\n />\n <ActionButton\n label={busy ? \"Approving…\" : \"Approve\"}\n onPress={onApprove}\n disabled={busy}\n busy={busy}\n theme={theme}\n />\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n root: { flex: 1 },\n content: { padding: 16, gap: 12 },\n requester: { flexDirection: \"row\", alignItems: \"center\", gap: 12 },\n avatar: {\n width: 44,\n height: 44,\n borderRadius: 12,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n initial: { fontSize: 18, fontWeight: \"600\" },\n flexShrink: { flexShrink: 1 },\n small: { fontSize: 12 },\n strong: { fontWeight: \"700\" },\n card: { borderWidth: 1, borderRadius: 12, padding: 16, gap: 6 },\n assetLabel: { fontSize: 14, fontWeight: \"600\" },\n limits: { flexDirection: \"row\", gap: 12, marginVertical: 6 },\n limit: { flex: 1 },\n amount: {\n fontSize: 22,\n fontWeight: \"600\",\n fontVariant: [\"tabular-nums\"],\n },\n term: { fontSize: 14, fontWeight: \"500\", marginTop: 8 },\n chips: { flexDirection: \"row\", flexWrap: \"wrap\", gap: 6 },\n expiry: { borderRadius: 10, padding: 12, gap: 2 },\n footer: {\n flexDirection: \"row\",\n gap: 12,\n paddingHorizontal: 16,\n paddingVertical: 12,\n borderTopWidth: 1,\n },\n});\n","import { type ReactNode, useState } from \"react\";\nimport { Pressable, StyleSheet, Text, View } from \"react-native\";\nimport type { NativePaymentTheme } from \"./theme\";\n\nexport type Tone = \"success\" | \"danger\" | \"warning\" | \"neutral\";\n\n/** Fill, border and text color of a tone. */\nexport function toneColors(theme: NativePaymentTheme, tone: Tone) {\n if (tone === \"success\")\n return {\n backgroundColor: theme.successBackground,\n borderColor: theme.successBorder,\n color: theme.successForeground,\n };\n if (tone === \"danger\")\n return {\n backgroundColor: theme.dangerBackground,\n borderColor: theme.dangerBorder,\n color: theme.dangerForeground,\n };\n if (tone === \"warning\")\n return {\n backgroundColor: theme.warningBackground,\n borderColor: theme.warningBorder,\n color: theme.warningForeground,\n };\n return {\n backgroundColor: theme.muted,\n borderColor: theme.border,\n color: theme.foreground,\n };\n}\n\n/** Decorative glyph, hidden from screen readers. */\nexport function Glyph({\n children,\n color,\n}: {\n children: string;\n color: string;\n}) {\n return (\n <Text\n accessible={false}\n importantForAccessibility=\"no\"\n accessibilityElementsHidden\n style={[styles.glyph, { color }]}\n >\n {children}\n </Text>\n );\n}\n\nexport function ActionButton({\n label,\n onPress,\n theme,\n variant = \"primary\",\n disabled = false,\n busy = false,\n}: {\n label: string;\n onPress: () => void;\n theme: NativePaymentTheme;\n variant?: \"primary\" | \"secondary\";\n disabled?: boolean;\n busy?: boolean;\n}) {\n const primary = variant === \"primary\";\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n accessibilityState={{ disabled, busy }}\n disabled={disabled}\n onPress={onPress}\n style={({ pressed }) => [\n styles.button,\n {\n backgroundColor: primary ? theme.primary : theme.background,\n borderColor: primary ? theme.primary : theme.border,\n opacity: disabled ? 0.55 : pressed ? 0.8 : 1,\n },\n ]}\n >\n <Text\n style={[\n styles.buttonLabel,\n { color: primary ? theme.primaryForeground : theme.foreground },\n ]}\n >\n {label}\n </Text>\n </Pressable>\n );\n}\n\n/**\n * An address or hash with an icon-only copy action. The app supplies\n * `onCopy` (Expo Clipboard, RN Clipboard, …); without it no button shows.\n */\nexport function CopyableValue({\n value,\n display,\n onCopy,\n theme,\n color = theme.foreground,\n}: {\n value: string;\n /** Shortened form from the view model; else truncated in the middle. */\n display?: string;\n onCopy?: (text: string) => void;\n theme: NativePaymentTheme;\n color?: string;\n}) {\n const [copied, setCopied] = useState(false);\n return (\n <View style={styles.copyRow}>\n <Text\n accessibilityLabel={value}\n numberOfLines={1}\n ellipsizeMode=\"middle\"\n style={[styles.mono, { color }]}\n >\n {display ?? value}\n </Text>\n {onCopy && (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={copied ? `Copied ${value}` : `Copy ${value}`}\n hitSlop={6}\n onPress={() => {\n onCopy(value);\n setCopied(true);\n }}\n style={({ pressed }) => [\n styles.iconButton,\n { borderColor: theme.border, opacity: pressed ? 0.7 : 1 },\n ]}\n >\n <Glyph color={theme.foreground}>{copied ? \"✓\" : \"⧉\"}</Glyph>\n </Pressable>\n )}\n </View>\n );\n}\n\n/** A colored callout: warnings, preview verdicts, notices. */\nexport function Callout({\n tone,\n glyph,\n theme,\n role,\n children,\n}: {\n tone: Tone;\n glyph: string;\n theme: NativePaymentTheme;\n role?: \"alert\";\n children: ReactNode;\n}) {\n const colors = toneColors(theme, tone);\n return (\n <View\n accessibilityRole={role}\n style={[\n styles.callout,\n {\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n },\n ]}\n >\n <Glyph color={colors.color}>{glyph}</Glyph>\n <Text style={[styles.calloutText, { color: colors.color }]}>\n {children}\n </Text>\n </View>\n );\n}\n\nexport const styles = StyleSheet.create({\n glyph: { fontSize: 16, lineHeight: 20, fontWeight: \"700\" },\n button: {\n flex: 1,\n minHeight: 48,\n minWidth: 44,\n borderRadius: 10,\n borderWidth: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n paddingHorizontal: 16,\n },\n buttonLabel: { fontSize: 16, fontWeight: \"600\" },\n copyRow: { flexDirection: \"row\", alignItems: \"center\", gap: 6 },\n mono: { flexShrink: 1, fontFamily: \"monospace\", fontSize: 13 },\n iconButton: {\n width: 32,\n height: 32,\n borderRadius: 8,\n borderWidth: 1,\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n callout: {\n flexDirection: \"row\",\n gap: 8,\n borderWidth: 1,\n borderRadius: 10,\n padding: 12,\n },\n calloutText: { flex: 1, fontSize: 14, lineHeight: 20 },\n label: { fontSize: 12, fontWeight: \"500\" },\n heading: { fontSize: 18, fontWeight: \"600\" },\n chip: {\n borderWidth: 1,\n borderRadius: 999,\n paddingHorizontal: 10,\n paddingVertical: 4,\n },\n chipText: { fontSize: 12 },\n});\n","import { createContext, type ReactNode, useContext } from \"react\";\nimport { useColorScheme } from \"react-native\";\n\n/**\n * Colors for the payment components. The values come from the appkit tokens\n * (`packages/ui/src/styles/tokens.css`, converted from HSL to hex). Where a\n * token pair falls below 4.5:1 on a payment surface — muted text on the muted\n * fill, the light destructive red as text — the text color is the darker\n * (light) or lighter (dark) step of the same hue, so every text/background\n * pair the components use meets WCAG AA.\n */\nexport interface NativePaymentTheme {\n scheme: \"light\" | \"dark\";\n background: string;\n foreground: string;\n card: string;\n border: string;\n muted: string;\n mutedForeground: string;\n primary: string;\n primaryForeground: string;\n /** Verified receipts and allowed previews only. */\n successBackground: string;\n successBorder: string;\n successForeground: string;\n /** Mismatch / failed receipts, blocked previews, missing restrictions. */\n dangerBackground: string;\n dangerBorder: string;\n dangerForeground: string;\n /** Non-dismissible warnings. */\n warningBackground: string;\n warningBorder: string;\n warningForeground: string;\n}\n\nexport const lightPaymentTheme: NativePaymentTheme = {\n scheme: \"light\",\n background: \"#ffffff\", // --background 0 0% 100%\n foreground: \"#020817\", // --foreground 222.2 84% 4.9%\n card: \"#ffffff\", // --card\n border: \"#e2e8f0\", // --border 214.3 31.8% 91.4%\n muted: \"#f1f5f9\", // --muted 210 40% 96.1%\n mutedForeground: \"#475569\", // --muted-foreground hue, one step darker\n primary: \"#0f172a\", // --primary 222.2 47.4% 11.2%\n primaryForeground: \"#f8fafc\", // --primary-foreground 210 40% 98%\n successBackground: \"#ecfdf5\",\n successBorder: \"#047857\",\n successForeground: \"#064e3b\",\n dangerBackground: \"#fef2f2\",\n dangerBorder: \"#ef4444\", // --destructive 0 84.2% 60.2%\n dangerForeground: \"#991b1b\",\n warningBackground: \"#fffbeb\",\n warningBorder: \"#b45309\",\n warningForeground: \"#451a03\",\n};\n\nexport const darkPaymentTheme: NativePaymentTheme = {\n scheme: \"dark\",\n background: \"#020817\", // .dark --background\n foreground: \"#f8fafc\", // .dark --foreground\n card: \"#020817\", // .dark --card\n border: \"#1e293b\", // .dark --border 217.2 32.6% 17.5%\n muted: \"#1e293b\", // .dark --muted\n mutedForeground: \"#94a3b8\", // .dark --muted-foreground 215 20.2% 65.1%\n primary: \"#f8fafc\", // .dark --primary\n primaryForeground: \"#0f172a\", // .dark --primary-foreground\n successBackground: \"#022c22\",\n successBorder: \"#10b981\",\n successForeground: \"#d1fae5\",\n dangerBackground: \"#450a0a\",\n dangerBorder: \"#f87171\",\n dangerForeground: \"#fecaca\",\n warningBackground: \"#451a03\",\n warningBorder: \"#f59e0b\",\n warningForeground: \"#fef3c7\",\n};\n\nconst ThemeContext = createContext<NativePaymentTheme | undefined>(undefined);\n\nexport function NativePaymentThemeProvider({\n theme,\n children,\n}: {\n theme: NativePaymentTheme;\n children: ReactNode;\n}) {\n return (\n <ThemeContext.Provider value={theme}>{children}</ThemeContext.Provider>\n );\n}\n\n/** The `theme` prop, else the provider's theme, else the system scheme. */\nexport function useNativePaymentTheme(\n override?: NativePaymentTheme,\n): NativePaymentTheme {\n const provided = useContext(ThemeContext);\n const scheme = useColorScheme();\n return (\n override ??\n provided ??\n (scheme === \"dark\" ? darkPaymentTheme : lightPaymentTheme)\n );\n}\n","import {\n type AuthorizationAssetMetadata,\n describeAuthorization,\n formatAuthorizationAmount,\n} from \"@naculus/connect-appkit-core\";\nimport type {\n ListedAuthorization,\n ListedAuthorizationStatus,\n RevokeListedAuthorizationResult,\n} from \"@naculus/connect-core\";\nimport { useState } from \"react\";\nimport { FlatList, StyleSheet, Text, View } from \"react-native\";\nimport {\n ActionButton,\n Callout,\n CopyableValue,\n Glyph,\n styles as shared,\n toneColors,\n} from \"./parts\";\nimport { type NativePaymentTheme, useNativePaymentTheme } from \"./theme\";\n\nexport interface AuthorizationListNativeProps {\n entries: ListedAuthorization[] | { entries: ListedAuthorization[] };\n assets?: Record<string, AuthorizationAssetMetadata>;\n onRevoke: (\n entry: ListedAuthorization,\n ) =>\n | RevokeListedAuthorizationResult\n | Promise<RevokeListedAuthorizationResult>;\n /** keyId of the entry being revoked. */\n revokingId?: string;\n /** BCP 47 locale for expiry dates; English when omitted. */\n locale?: string;\n onCopy?: (text: string) => void;\n theme?: NativePaymentTheme;\n}\n\nconst ENFORCER_LABELS: Record<string, string> = {\n \"evm-session\": \"EVM session key\",\n \"solana-session\": \"Solana session key\",\n \"mpp-voucher\": \"MPP channel key\",\n};\n\nconst STATUS_GLYPHS: Record<ListedAuthorizationStatus, string> = {\n active: \"●\",\n pending: \"◐\",\n revoked: \"✕\",\n expired: \"○\",\n};\n\nfunction StatusBadge({\n status,\n theme,\n}: {\n status: ListedAuthorizationStatus;\n theme: NativePaymentTheme;\n}) {\n const colors =\n status === \"active\"\n ? {\n backgroundColor: theme.primary,\n borderColor: theme.primary,\n color: theme.primaryForeground,\n }\n : status === \"pending\"\n ? {\n backgroundColor: theme.background,\n borderColor: theme.foreground,\n color: theme.foreground,\n }\n : status === \"revoked\"\n ? toneColors(theme, \"danger\")\n : {\n backgroundColor: theme.muted,\n borderColor: theme.border,\n color: theme.mutedForeground,\n };\n return (\n <View\n accessibilityLabel={`Status: ${status}`}\n style={[\n shared.chip,\n styles.badge,\n {\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n },\n ]}\n >\n <Glyph color={colors.color}>{STATUS_GLYPHS[status]}</Glyph>\n <Text style={[styles.badgeText, { color: colors.color }]}>{status}</Text>\n </View>\n );\n}\n\n/** React Native counterpart of the web `AuthorizationList`. */\nexport function AuthorizationListNative({\n entries: input,\n assets = {},\n onRevoke,\n revokingId,\n locale,\n onCopy,\n theme: themeProp,\n}: AuthorizationListNativeProps) {\n const theme = useNativePaymentTheme(themeProp);\n const entries = Array.isArray(input) ? input : input.entries;\n const [confirming, setConfirming] = useState<string | null>(null);\n const [onChain, setOnChain] = useState<ReadonlySet<string>>(new Set());\n const muted = { color: theme.mutedForeground };\n\n const revoke = (entry: ListedAuthorization) =>\n void Promise.resolve(onRevoke(entry)).then((result) => {\n setConfirming(null);\n if (result.onChainRevocationRequired)\n setOnChain((current) => new Set(current).add(entry.keyId));\n });\n\n const renderItem = ({ item: entry }: { item: ListedAuthorization }) => {\n const view = describeAuthorization(entry, { assets, locale });\n const busy = revokingId === entry.keyId;\n const live = entry.status === \"active\" || entry.status === \"pending\";\n return (\n <View\n style={[\n styles.card,\n { backgroundColor: theme.card, borderColor: theme.border },\n ]}\n >\n <View style={styles.cardHeader}>\n <View style={styles.flexShrink}>\n <Text style={[styles.title, { color: theme.foreground }]}>\n {view.label ?? view.grants.map((g) => g.assetLabel).join(\", \")}\n </Text>\n <Text style={[styles.small, muted]}>\n {ENFORCER_LABELS[entry.enforcer] ??\n entry.enforcer.replaceAll(\"-\", \" \")}\n </Text>\n </View>\n <StatusBadge status={entry.status} theme={theme} />\n </View>\n\n {view.grants.map((grant) => {\n const spent = entry.spent?.[grant.asset];\n const total = entry.grants.find(\n (g) => g.asset === grant.asset,\n )?.maxTotal;\n const percent =\n spent !== undefined && total && total > 0n\n ? Math.min(Number((spent * 100n) / total), 100)\n : 0;\n return (\n <View\n key={grant.asset}\n style={[styles.grant, { backgroundColor: theme.muted }]}\n >\n {view.label && (\n <Text style={[styles.strong, { color: theme.foreground }]}>\n {grant.assetLabel}\n </Text>\n )}\n {grant.recipients.map((recipient) => (\n <CopyableValue\n key={recipient.full}\n value={recipient.full}\n display={recipient.shortened}\n onCopy={onCopy}\n theme={theme}\n />\n ))}\n {spent !== undefined && (\n <View>\n <View style={styles.spentRow}>\n <Text style={[styles.small, { color: theme.foreground }]}>\n Spent{\" \"}\n {\n formatAuthorizationAmount(spent, assets[grant.asset])\n .formatted\n }\n </Text>\n <Text style={[styles.small, { color: theme.foreground }]}>\n Total {grant.total.formatted}\n </Text>\n </View>\n <View\n accessibilityRole=\"progressbar\"\n accessibilityLabel={`${grant.assetLabel} spent`}\n accessibilityValue={{ min: 0, max: 100, now: percent }}\n style={[\n styles.track,\n { backgroundColor: theme.background },\n ]}\n >\n <View\n style={[\n styles.fill,\n {\n width: `${percent}%`,\n backgroundColor: theme.primary,\n },\n ]}\n />\n </View>\n </View>\n )}\n </View>\n );\n })}\n\n <Text style={[styles.small, muted]}>\n {entry.status === \"expired\"\n ? \"Expired\"\n : entry.status === \"revoked\"\n ? \"Revoked\"\n : `Expires ${view.expiry.relative}`}{\" \"}\n · {view.expiry.absolute}\n </Text>\n\n {view.warnings.map((warning) => (\n <Callout\n key={warning}\n tone=\"warning\"\n glyph=\"⚠\"\n role=\"alert\"\n theme={theme}\n >\n {warning}\n </Callout>\n ))}\n\n {onChain.has(entry.keyId) && (\n <Callout tone=\"warning\" glyph=\"⛓\" theme={theme}>\n Local access is revoked. Complete the on-chain revocation to stop\n this authorization on chain.\n </Callout>\n )}\n\n {live && (\n <View style={[styles.actions, { borderTopColor: theme.border }]}>\n {confirming === entry.keyId ? (\n <>\n <ActionButton\n label=\"Cancel\"\n variant=\"secondary\"\n onPress={() => setConfirming(null)}\n theme={theme}\n />\n <ActionButton\n label={busy ? \"Revoking…\" : \"Confirm revoke\"}\n disabled={busy}\n busy={busy}\n onPress={() => revoke(entry)}\n theme={theme}\n />\n </>\n ) : (\n <ActionButton\n label=\"Revoke\"\n variant=\"secondary\"\n onPress={() => setConfirming(entry.keyId)}\n theme={theme}\n />\n )}\n </View>\n )}\n </View>\n );\n };\n\n return (\n <FlatList\n data={entries}\n keyExtractor={(entry) => entry.keyId}\n renderItem={renderItem}\n extraData={[confirming, onChain, revokingId, theme]}\n contentContainerStyle={styles.list}\n style={{ backgroundColor: theme.background }}\n ListHeaderComponent={\n entries.length ? (\n <Text\n accessibilityRole=\"header\"\n style={[shared.heading, { color: theme.foreground }]}\n >\n Payment authorizations\n </Text>\n ) : undefined\n }\n ListEmptyComponent={\n <View style={[styles.empty, { borderColor: theme.border }]}>\n <Text\n accessibilityRole=\"header\"\n style={[styles.title, { color: theme.foreground }]}\n >\n No payment authorizations\n </Text>\n <Text style={[styles.body, muted]}>\n Approvals you create will appear here.\n </Text>\n </View>\n }\n />\n );\n}\n\nconst styles = StyleSheet.create({\n list: { padding: 16, gap: 12 },\n card: { borderWidth: 1, borderRadius: 12, padding: 16, gap: 10 },\n cardHeader: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"flex-start\",\n gap: 8,\n },\n flexShrink: { flexShrink: 1 },\n title: { fontSize: 16, fontWeight: \"600\" },\n small: { fontSize: 12 },\n body: { fontSize: 14, textAlign: \"center\" },\n strong: { fontSize: 14, fontWeight: \"500\" },\n badge: { flexDirection: \"row\", alignItems: \"center\", gap: 4 },\n badgeText: { fontSize: 12, fontWeight: \"600\", textTransform: \"capitalize\" },\n grant: { borderRadius: 10, padding: 12, gap: 6 },\n spentRow: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n gap: 8,\n },\n track: { height: 8, borderRadius: 4, overflow: \"hidden\", marginTop: 4 },\n fill: { height: \"100%\" },\n actions: {\n flexDirection: \"row\",\n justifyContent: \"flex-end\",\n gap: 8,\n borderTopWidth: 1,\n paddingTop: 12,\n },\n empty: {\n borderWidth: 1,\n borderStyle: \"dashed\",\n borderRadius: 12,\n padding: 32,\n alignItems: \"center\",\n gap: 4,\n },\n});\n","import {\n type AuthorizationAssetMetadata,\n formatAuthorizationAmount,\n type PaymentRecord,\n type PaymentVerificationStatus,\n} from \"@naculus/connect-appkit-core\";\nimport { Pressable, StyleSheet, Text, View } from \"react-native\";\nimport { CopyableValue, Glyph, type Tone, toneColors } from \"./parts\";\nimport { type NativePaymentTheme, useNativePaymentTheme } from \"./theme\";\n\nexport interface PaymentReceiptNativeProps {\n record: PaymentRecord;\n assets?: Record<string, AuthorizationAssetMetadata>;\n /**\n * Accepted for parity with the other payment components; the receipt has\n * no locale-dependent text yet (amounts use the core formatter).\n */\n locale?: string;\n /** Shows \"View on explorer\" when set and the record has a reference. */\n onOpenExplorer?: (record: PaymentRecord) => void;\n /** Copies the recipient or settlement reference. */\n onCopy?: (text: string) => void;\n theme?: NativePaymentTheme;\n}\n\nconst VERIFICATION: Record<\n PaymentVerificationStatus,\n { title: string; detail: string; glyph: string; tone: Tone }\n> = {\n unverified: {\n title: \"Unverified\",\n detail: \"Reported by the server, not yet checked.\",\n glyph: \"?\",\n tone: \"neutral\",\n },\n pending: {\n title: \"Checking\",\n detail: \"Checking on chain.\",\n glyph: \"…\",\n tone: \"neutral\",\n },\n verified: {\n title: \"Verified\",\n detail: \"Verified on chain.\",\n glyph: \"✓\",\n tone: \"success\",\n },\n mismatch: {\n title: \"Mismatch\",\n detail: \"The on-chain settlement does not match this payment.\",\n glyph: \"!\",\n tone: \"danger\",\n },\n failed: {\n title: \"Verification failed\",\n detail: \"The settlement could not be verified.\",\n glyph: \"!\",\n tone: \"danger\",\n },\n unavailable: {\n title: \"Verification unavailable\",\n detail: \"On-chain checking is unavailable. Retry later.\",\n glyph: \"?\",\n tone: \"neutral\",\n },\n};\n\n/** React Native counterpart of the web `PaymentReceipt`. */\nexport function PaymentReceiptNative({\n record,\n assets = {},\n onOpenExplorer,\n onCopy,\n theme: themeProp,\n}: PaymentReceiptNativeProps) {\n const theme = useNativePaymentTheme(themeProp);\n const status = record.verification.status;\n const state = VERIFICATION[status];\n const colors = toneColors(theme, state.tone);\n const muted = { color: theme.mutedForeground };\n const amount =\n record.amount === null\n ? \"Amount not reported\"\n : /^\\d+$/.test(record.amount)\n ? formatAuthorizationAmount(\n BigInt(record.amount),\n record.asset ? assets[record.asset] : undefined,\n ).formatted\n : `${record.amount} base units`;\n\n return (\n <View\n testID={`verification-${status}`}\n style={[\n styles.card,\n { backgroundColor: theme.card, borderColor: theme.border },\n ]}\n >\n <View style={styles.header}>\n <Text style={[styles.eyebrow, muted]}>PAYMENT RECEIPT</Text>\n <Text\n accessibilityRole=\"header\"\n style={[styles.amount, { color: theme.foreground }]}\n >\n {amount}\n </Text>\n <Text style={[styles.small, muted]}>\n {record.asset\n ? (assets[record.asset]?.symbol ?? record.asset)\n : \"Asset not reported\"}\n </Text>\n </View>\n\n <View\n testID=\"verification-panel\"\n accessibilityLiveRegion=\"polite\"\n accessible\n accessibilityLabel={`${state.title}. ${state.detail}${record.verification.reason ? ` Reason: ${record.verification.reason}` : \"\"}`}\n style={[\n styles.panel,\n {\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n },\n ]}\n >\n <Glyph color={colors.color}>{state.glyph}</Glyph>\n <View style={styles.flexShrink}>\n <Text style={[styles.badge, { color: colors.color }]}>\n {state.title}\n </Text>\n <Text style={[styles.body, { color: colors.color }]}>\n {state.detail}\n </Text>\n {record.verification.reason && (\n <Text\n numberOfLines={2}\n style={[styles.body, styles.strong, { color: colors.color }]}\n >\n Reason: {record.verification.reason}\n </Text>\n )}\n </View>\n </View>\n\n <View style={styles.field}>\n <Text style={[styles.small, muted]}>Recipient</Text>\n {record.payTo ? (\n <CopyableValue value={record.payTo} onCopy={onCopy} theme={theme} />\n ) : (\n <Text style={[styles.body, { color: theme.foreground }]}>\n Not reported\n </Text>\n )}\n </View>\n <View style={styles.row}>\n <View style={styles.cell}>\n <Text style={[styles.small, muted]}>Protocol</Text>\n <Text style={[styles.body, { color: theme.foreground }]}>\n {record.protocol === \"mpp\" ? \"MPP\" : record.protocol}\n </Text>\n </View>\n <View style={styles.cell}>\n <Text style={[styles.small, muted]}>Time</Text>\n <Text style={[styles.body, { color: theme.foreground }]}>\n Not recorded\n </Text>\n </View>\n </View>\n <View style={styles.field}>\n <Text style={[styles.small, muted]}>Settlement reference</Text>\n {record.reference ? (\n <>\n <CopyableValue\n value={record.reference}\n onCopy={onCopy}\n theme={theme}\n />\n {onOpenExplorer && (\n <Pressable\n accessibilityRole=\"link\"\n accessibilityLabel=\"View on explorer\"\n onPress={() => onOpenExplorer(record)}\n style={styles.link}\n >\n <Text style={[styles.linkText, { color: theme.foreground }]}>\n View on explorer ↗\n </Text>\n </Pressable>\n )}\n </>\n ) : (\n <Text style={[styles.body, { color: theme.foreground }]}>\n Not reported\n </Text>\n )}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n card: { borderWidth: 1, borderRadius: 16, padding: 20, gap: 16 },\n header: { alignItems: \"center\", gap: 4 },\n eyebrow: { fontSize: 12, fontWeight: \"500\", letterSpacing: 0.6 },\n amount: {\n fontSize: 32,\n fontWeight: \"600\",\n fontVariant: [\"tabular-nums\"],\n textAlign: \"center\",\n },\n small: { fontSize: 12 },\n body: { fontSize: 14, lineHeight: 20 },\n strong: { fontWeight: \"600\" },\n // Fixed height: badge, explanation and a two-line reason fit, so the card\n // does not jump as verification moves from pending to its final state.\n panel: {\n height: 128,\n flexDirection: \"row\",\n gap: 8,\n borderWidth: 1,\n borderRadius: 10,\n padding: 12,\n overflow: \"hidden\",\n },\n flexShrink: { flexShrink: 1 },\n badge: { fontSize: 13, fontWeight: \"700\", marginBottom: 2 },\n field: { gap: 4 },\n row: { flexDirection: \"row\", gap: 12 },\n cell: { flex: 1, gap: 4 },\n link: { minHeight: 44, minWidth: 44, justifyContent: \"center\" },\n linkText: {\n fontSize: 13,\n fontWeight: \"500\",\n textDecorationLine: \"underline\",\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iCAKO;AAEP,IAAAA,uBAA0D;;;ACP1D,mBAAyC;AACzC,0BAAkD;AAyC9C;AAnCG,SAAS,WAAW,OAA2B,MAAY;AAChE,MAAI,SAAS;AACX,WAAO;AAAA,MACL,iBAAiB,MAAM;AAAA,MACvB,aAAa,MAAM;AAAA,MACnB,OAAO,MAAM;AAAA,IACf;AACF,MAAI,SAAS;AACX,WAAO;AAAA,MACL,iBAAiB,MAAM;AAAA,MACvB,aAAa,MAAM;AAA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import_react_native","import_jsx_runtime","import_jsx_runtime","styles","import_connect_appkit_core","import_react","import_react_native","import_jsx_runtime","styles","import_connect_appkit_core","import_react_native","import_jsx_runtime","styles"]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { AuthorizationDescription, AuthorizationAssetMetadata, SpendExplanation, PaymentRecord } from '@naculus/connect-appkit-core';
|
|
4
|
+
import { Authorization, ListedAuthorization, RevokeListedAuthorizationResult } from '@naculus/connect-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Colors for the payment components. The values come from the appkit tokens
|
|
8
|
+
* (`packages/ui/src/styles/tokens.css`, converted from HSL to hex). Where a
|
|
9
|
+
* token pair falls below 4.5:1 on a payment surface — muted text on the muted
|
|
10
|
+
* fill, the light destructive red as text — the text color is the darker
|
|
11
|
+
* (light) or lighter (dark) step of the same hue, so every text/background
|
|
12
|
+
* pair the components use meets WCAG AA.
|
|
13
|
+
*/
|
|
14
|
+
interface NativePaymentTheme {
|
|
15
|
+
scheme: "light" | "dark";
|
|
16
|
+
background: string;
|
|
17
|
+
foreground: string;
|
|
18
|
+
card: string;
|
|
19
|
+
border: string;
|
|
20
|
+
muted: string;
|
|
21
|
+
mutedForeground: string;
|
|
22
|
+
primary: string;
|
|
23
|
+
primaryForeground: string;
|
|
24
|
+
/** Verified receipts and allowed previews only. */
|
|
25
|
+
successBackground: string;
|
|
26
|
+
successBorder: string;
|
|
27
|
+
successForeground: string;
|
|
28
|
+
/** Mismatch / failed receipts, blocked previews, missing restrictions. */
|
|
29
|
+
dangerBackground: string;
|
|
30
|
+
dangerBorder: string;
|
|
31
|
+
dangerForeground: string;
|
|
32
|
+
/** Non-dismissible warnings. */
|
|
33
|
+
warningBackground: string;
|
|
34
|
+
warningBorder: string;
|
|
35
|
+
warningForeground: string;
|
|
36
|
+
}
|
|
37
|
+
declare const lightPaymentTheme: NativePaymentTheme;
|
|
38
|
+
declare const darkPaymentTheme: NativePaymentTheme;
|
|
39
|
+
declare function NativePaymentThemeProvider({ theme, children, }: {
|
|
40
|
+
theme: NativePaymentTheme;
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}): react.JSX.Element;
|
|
43
|
+
/** The `theme` prop, else the provider's theme, else the system scheme. */
|
|
44
|
+
declare function useNativePaymentTheme(override?: NativePaymentTheme): NativePaymentTheme;
|
|
45
|
+
|
|
46
|
+
interface AuthorizationConsentNativeProps {
|
|
47
|
+
/** Who asks: shown as "Allow {name} to pay?". */
|
|
48
|
+
requester: {
|
|
49
|
+
name: string;
|
|
50
|
+
icon?: string;
|
|
51
|
+
origin?: string;
|
|
52
|
+
};
|
|
53
|
+
/** A raw authorization, or a description already built by the caller. */
|
|
54
|
+
authorization: Authorization | ListedAuthorization | AuthorizationDescription;
|
|
55
|
+
assets?: Record<string, AuthorizationAssetMetadata>;
|
|
56
|
+
/** `explainSpend` result for the payment that triggered this consent. */
|
|
57
|
+
preview?: SpendExplanation;
|
|
58
|
+
onApprove: () => void;
|
|
59
|
+
onDecline: () => void;
|
|
60
|
+
/** Disables Approve and shows "Approving…". */
|
|
61
|
+
busy?: boolean;
|
|
62
|
+
/** Copies a recipient address; the copy button shows only when set. */
|
|
63
|
+
onCopy?: (text: string) => void;
|
|
64
|
+
/** BCP 47 locale for the expiry; English when omitted. */
|
|
65
|
+
locale?: string;
|
|
66
|
+
/** Unix timestamp in seconds, for a stable relative expiry. */
|
|
67
|
+
now?: number;
|
|
68
|
+
theme?: NativePaymentTheme;
|
|
69
|
+
}
|
|
70
|
+
/** React Native counterpart of the web `AuthorizationConsent`. */
|
|
71
|
+
declare function AuthorizationConsentNative({ authorization, assets, locale, now, requester, preview, onApprove, onDecline, busy, onCopy, theme: themeProp, }: AuthorizationConsentNativeProps): react.JSX.Element;
|
|
72
|
+
|
|
73
|
+
interface AuthorizationListNativeProps {
|
|
74
|
+
entries: ListedAuthorization[] | {
|
|
75
|
+
entries: ListedAuthorization[];
|
|
76
|
+
};
|
|
77
|
+
assets?: Record<string, AuthorizationAssetMetadata>;
|
|
78
|
+
onRevoke: (entry: ListedAuthorization) => RevokeListedAuthorizationResult | Promise<RevokeListedAuthorizationResult>;
|
|
79
|
+
/** keyId of the entry being revoked. */
|
|
80
|
+
revokingId?: string;
|
|
81
|
+
/** BCP 47 locale for expiry dates; English when omitted. */
|
|
82
|
+
locale?: string;
|
|
83
|
+
onCopy?: (text: string) => void;
|
|
84
|
+
theme?: NativePaymentTheme;
|
|
85
|
+
}
|
|
86
|
+
/** React Native counterpart of the web `AuthorizationList`. */
|
|
87
|
+
declare function AuthorizationListNative({ entries: input, assets, onRevoke, revokingId, locale, onCopy, theme: themeProp, }: AuthorizationListNativeProps): react.JSX.Element;
|
|
88
|
+
|
|
89
|
+
interface PaymentReceiptNativeProps {
|
|
90
|
+
record: PaymentRecord;
|
|
91
|
+
assets?: Record<string, AuthorizationAssetMetadata>;
|
|
92
|
+
/**
|
|
93
|
+
* Accepted for parity with the other payment components; the receipt has
|
|
94
|
+
* no locale-dependent text yet (amounts use the core formatter).
|
|
95
|
+
*/
|
|
96
|
+
locale?: string;
|
|
97
|
+
/** Shows "View on explorer" when set and the record has a reference. */
|
|
98
|
+
onOpenExplorer?: (record: PaymentRecord) => void;
|
|
99
|
+
/** Copies the recipient or settlement reference. */
|
|
100
|
+
onCopy?: (text: string) => void;
|
|
101
|
+
theme?: NativePaymentTheme;
|
|
102
|
+
}
|
|
103
|
+
/** React Native counterpart of the web `PaymentReceipt`. */
|
|
104
|
+
declare function PaymentReceiptNative({ record, assets, onOpenExplorer, onCopy, theme: themeProp, }: PaymentReceiptNativeProps): react.JSX.Element;
|
|
105
|
+
|
|
106
|
+
export { AuthorizationConsentNative, type AuthorizationConsentNativeProps, AuthorizationListNative, type AuthorizationListNativeProps, type NativePaymentTheme, NativePaymentThemeProvider, PaymentReceiptNative, type PaymentReceiptNativeProps, darkPaymentTheme, lightPaymentTheme, useNativePaymentTheme };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { AuthorizationDescription, AuthorizationAssetMetadata, SpendExplanation, PaymentRecord } from '@naculus/connect-appkit-core';
|
|
4
|
+
import { Authorization, ListedAuthorization, RevokeListedAuthorizationResult } from '@naculus/connect-core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Colors for the payment components. The values come from the appkit tokens
|
|
8
|
+
* (`packages/ui/src/styles/tokens.css`, converted from HSL to hex). Where a
|
|
9
|
+
* token pair falls below 4.5:1 on a payment surface — muted text on the muted
|
|
10
|
+
* fill, the light destructive red as text — the text color is the darker
|
|
11
|
+
* (light) or lighter (dark) step of the same hue, so every text/background
|
|
12
|
+
* pair the components use meets WCAG AA.
|
|
13
|
+
*/
|
|
14
|
+
interface NativePaymentTheme {
|
|
15
|
+
scheme: "light" | "dark";
|
|
16
|
+
background: string;
|
|
17
|
+
foreground: string;
|
|
18
|
+
card: string;
|
|
19
|
+
border: string;
|
|
20
|
+
muted: string;
|
|
21
|
+
mutedForeground: string;
|
|
22
|
+
primary: string;
|
|
23
|
+
primaryForeground: string;
|
|
24
|
+
/** Verified receipts and allowed previews only. */
|
|
25
|
+
successBackground: string;
|
|
26
|
+
successBorder: string;
|
|
27
|
+
successForeground: string;
|
|
28
|
+
/** Mismatch / failed receipts, blocked previews, missing restrictions. */
|
|
29
|
+
dangerBackground: string;
|
|
30
|
+
dangerBorder: string;
|
|
31
|
+
dangerForeground: string;
|
|
32
|
+
/** Non-dismissible warnings. */
|
|
33
|
+
warningBackground: string;
|
|
34
|
+
warningBorder: string;
|
|
35
|
+
warningForeground: string;
|
|
36
|
+
}
|
|
37
|
+
declare const lightPaymentTheme: NativePaymentTheme;
|
|
38
|
+
declare const darkPaymentTheme: NativePaymentTheme;
|
|
39
|
+
declare function NativePaymentThemeProvider({ theme, children, }: {
|
|
40
|
+
theme: NativePaymentTheme;
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}): react.JSX.Element;
|
|
43
|
+
/** The `theme` prop, else the provider's theme, else the system scheme. */
|
|
44
|
+
declare function useNativePaymentTheme(override?: NativePaymentTheme): NativePaymentTheme;
|
|
45
|
+
|
|
46
|
+
interface AuthorizationConsentNativeProps {
|
|
47
|
+
/** Who asks: shown as "Allow {name} to pay?". */
|
|
48
|
+
requester: {
|
|
49
|
+
name: string;
|
|
50
|
+
icon?: string;
|
|
51
|
+
origin?: string;
|
|
52
|
+
};
|
|
53
|
+
/** A raw authorization, or a description already built by the caller. */
|
|
54
|
+
authorization: Authorization | ListedAuthorization | AuthorizationDescription;
|
|
55
|
+
assets?: Record<string, AuthorizationAssetMetadata>;
|
|
56
|
+
/** `explainSpend` result for the payment that triggered this consent. */
|
|
57
|
+
preview?: SpendExplanation;
|
|
58
|
+
onApprove: () => void;
|
|
59
|
+
onDecline: () => void;
|
|
60
|
+
/** Disables Approve and shows "Approving…". */
|
|
61
|
+
busy?: boolean;
|
|
62
|
+
/** Copies a recipient address; the copy button shows only when set. */
|
|
63
|
+
onCopy?: (text: string) => void;
|
|
64
|
+
/** BCP 47 locale for the expiry; English when omitted. */
|
|
65
|
+
locale?: string;
|
|
66
|
+
/** Unix timestamp in seconds, for a stable relative expiry. */
|
|
67
|
+
now?: number;
|
|
68
|
+
theme?: NativePaymentTheme;
|
|
69
|
+
}
|
|
70
|
+
/** React Native counterpart of the web `AuthorizationConsent`. */
|
|
71
|
+
declare function AuthorizationConsentNative({ authorization, assets, locale, now, requester, preview, onApprove, onDecline, busy, onCopy, theme: themeProp, }: AuthorizationConsentNativeProps): react.JSX.Element;
|
|
72
|
+
|
|
73
|
+
interface AuthorizationListNativeProps {
|
|
74
|
+
entries: ListedAuthorization[] | {
|
|
75
|
+
entries: ListedAuthorization[];
|
|
76
|
+
};
|
|
77
|
+
assets?: Record<string, AuthorizationAssetMetadata>;
|
|
78
|
+
onRevoke: (entry: ListedAuthorization) => RevokeListedAuthorizationResult | Promise<RevokeListedAuthorizationResult>;
|
|
79
|
+
/** keyId of the entry being revoked. */
|
|
80
|
+
revokingId?: string;
|
|
81
|
+
/** BCP 47 locale for expiry dates; English when omitted. */
|
|
82
|
+
locale?: string;
|
|
83
|
+
onCopy?: (text: string) => void;
|
|
84
|
+
theme?: NativePaymentTheme;
|
|
85
|
+
}
|
|
86
|
+
/** React Native counterpart of the web `AuthorizationList`. */
|
|
87
|
+
declare function AuthorizationListNative({ entries: input, assets, onRevoke, revokingId, locale, onCopy, theme: themeProp, }: AuthorizationListNativeProps): react.JSX.Element;
|
|
88
|
+
|
|
89
|
+
interface PaymentReceiptNativeProps {
|
|
90
|
+
record: PaymentRecord;
|
|
91
|
+
assets?: Record<string, AuthorizationAssetMetadata>;
|
|
92
|
+
/**
|
|
93
|
+
* Accepted for parity with the other payment components; the receipt has
|
|
94
|
+
* no locale-dependent text yet (amounts use the core formatter).
|
|
95
|
+
*/
|
|
96
|
+
locale?: string;
|
|
97
|
+
/** Shows "View on explorer" when set and the record has a reference. */
|
|
98
|
+
onOpenExplorer?: (record: PaymentRecord) => void;
|
|
99
|
+
/** Copies the recipient or settlement reference. */
|
|
100
|
+
onCopy?: (text: string) => void;
|
|
101
|
+
theme?: NativePaymentTheme;
|
|
102
|
+
}
|
|
103
|
+
/** React Native counterpart of the web `PaymentReceipt`. */
|
|
104
|
+
declare function PaymentReceiptNative({ record, assets, onOpenExplorer, onCopy, theme: themeProp, }: PaymentReceiptNativeProps): react.JSX.Element;
|
|
105
|
+
|
|
106
|
+
export { AuthorizationConsentNative, type AuthorizationConsentNativeProps, AuthorizationListNative, type AuthorizationListNativeProps, type NativePaymentTheme, NativePaymentThemeProvider, PaymentReceiptNative, type PaymentReceiptNativeProps, darkPaymentTheme, lightPaymentTheme, useNativePaymentTheme };
|