@deframe-sdk/components 0.1.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.
@@ -0,0 +1,556 @@
1
+ import * as React$1 from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ /** Primary UI component for user interaction */
6
+ declare function ActionButton({ children, disabled, className, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
7
+
8
+ /** Primary UI component for user interaction */
9
+ declare function PercentageButton({ children, disabled, className, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
10
+
11
+ /** Primary UI component for user interaction - uses brand-primary color for theming */
12
+ declare function PrimaryButton({ children, disabled, className, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
13
+
14
+ /** Primary UI component for user interaction */
15
+ declare function SecondaryButton({ children, disabled, className, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
16
+
17
+ /** Primary UI component for user interaction */
18
+ declare function TertiaryButton({ children, disabled, className, type, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
19
+
20
+ interface ButtonProps {
21
+ /**
22
+ * The content of the button
23
+ */
24
+ children: React.ReactNode;
25
+ /**
26
+ * Whether the button is disabled
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * Additional CSS class names
31
+ */
32
+ className?: string;
33
+ /**
34
+ * Type of the button
35
+ */
36
+ type?: 'button' | 'submit' | 'reset';
37
+ /**
38
+ * Optional click handler
39
+ */
40
+ onClick?: () => void;
41
+ }
42
+
43
+ declare function Input({ label, error, placeholder, type, repassword, disabled, className, ...props }: InputProps): react_jsx_runtime.JSX.Element;
44
+
45
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
46
+ /**
47
+ * Label for the input (optional, for accessibility)
48
+ */
49
+ label?: string;
50
+ /**
51
+ * Error message to display below
52
+ */
53
+ error?: string;
54
+ /**
55
+ * Helper text (non-error)
56
+ */
57
+ helperText?: string;
58
+ /**
59
+ * Link for repassword
60
+ */
61
+ repassword?: string;
62
+ }
63
+
64
+ interface ListItemProps {
65
+ children: React__default.ReactNode;
66
+ /**
67
+ * Applies to the inner content wrapper
68
+ */
69
+ className?: string;
70
+ /**
71
+ * Applies to the outer bordered container
72
+ */
73
+ containerClassName?: string;
74
+ onClick?: () => void;
75
+ }
76
+ declare const ListItem: React__default.FC<ListItemProps>;
77
+ declare const ListItemLeftSide: React__default.FC<{
78
+ children: React__default.ReactNode;
79
+ className?: string;
80
+ }>;
81
+ declare const ListItemContent: React__default.FC<{
82
+ children: React__default.ReactNode;
83
+ className?: string;
84
+ }>;
85
+ declare const ListItemRightSide: React__default.FC<{
86
+ children: React__default.ReactNode;
87
+ className?: string;
88
+ }>;
89
+
90
+ interface WalletOption {
91
+ /** Unique identifier for the wallet */
92
+ id: string;
93
+ /** Display name of the wallet */
94
+ name: string;
95
+ /** Wallet icon - can be an image URL or React component */
96
+ icon: string | React.ReactNode;
97
+ /** Click handler for wallet selection */
98
+ onClick?: () => void;
99
+ }
100
+ interface ConnectWalletListProps {
101
+ /** List of wallet options */
102
+ wallets: WalletOption[];
103
+ /** Additional CSS class names */
104
+ className?: string;
105
+ }
106
+ /**
107
+ * ConnectWalletList - Displays a list of wallet options for connection
108
+ * Includes title, subtitle, and clickable wallet items
109
+ */
110
+ declare function ConnectWalletList({ wallets, className, }: ConnectWalletListProps): react_jsx_runtime.JSX.Element;
111
+
112
+ interface WalletItemProps {
113
+ /** Unique identifier for the wallet */
114
+ id: string;
115
+ /** Display name of the wallet */
116
+ name: string;
117
+ /** Wallet icon - can be an image URL or React component */
118
+ icon: string | React.ReactNode;
119
+ /** Click handler for wallet selection */
120
+ onClick?: () => void;
121
+ /** Additional CSS class names */
122
+ className?: string;
123
+ }
124
+ /**
125
+ * WalletItem - Individual wallet button component
126
+ * Displays a clickable wallet option with icon, name, and chevron
127
+ */
128
+ declare function WalletItem({ id, name, icon, onClick, className, }: WalletItemProps): react_jsx_runtime.JSX.Element;
129
+
130
+ interface WalletListContainerProps {
131
+ /** Child components (typically WalletItem components) */
132
+ children: ReactNode;
133
+ /** Additional CSS class names */
134
+ className?: string;
135
+ }
136
+ /**
137
+ * WalletListContainer - Container wrapper for wallet list items
138
+ * Provides consistent spacing and layout for wallet options
139
+ */
140
+ declare function WalletListContainer({ children, className, }: WalletListContainerProps): react_jsx_runtime.JSX.Element;
141
+
142
+ /** Flexible currency display component supporting fiat and crypto */
143
+ declare function Currency(props: CurrencyProps | FiatProps): react_jsx_runtime.JSX.Element;
144
+
145
+ type CurrencyType = 'USD' | 'BRL' | 'EUR' | 'BTC' | 'ETH' | 'USDC' | 'USDT';
146
+ interface FiatProps {
147
+ /**
148
+ * The numeric amount to display
149
+ */
150
+ amount: string;
151
+ /**
152
+ * The USD value of the amount
153
+ */
154
+ usdValue: string;
155
+ /**
156
+ * Alignment of the display
157
+ */
158
+ align?: 'left' | 'center' | 'right';
159
+ /**
160
+ * Size variant
161
+ */
162
+ size?: 'sm' | 'md' | 'lg';
163
+ /**
164
+ * Additional CSS classes
165
+ */
166
+ className?: string;
167
+ }
168
+ interface CurrencyProps {
169
+ /**
170
+ * The numeric amount to display
171
+ */
172
+ amount: string;
173
+ /**
174
+ * Currency type
175
+ */
176
+ currency?: CurrencyType;
177
+ /**
178
+ * Secondary amount (e.g., USD value for crypto)
179
+ */
180
+ secondaryAmount?: string;
181
+ /**
182
+ * Secondary currency type
183
+ */
184
+ secondaryCurrency?: CurrencyType;
185
+ /**
186
+ * Alignment of the display
187
+ */
188
+ align?: 'left' | 'center' | 'right';
189
+ /**
190
+ * Size variant
191
+ */
192
+ size?: 'sm' | 'md' | 'lg';
193
+ /**
194
+ * Show currency symbol
195
+ */
196
+ showSymbol?: boolean;
197
+ /**
198
+ * Show currency label (e.g., USD, BRL)
199
+ */
200
+ showLabel?: boolean;
201
+ /**
202
+ * Additional CSS classes
203
+ */
204
+ className?: string;
205
+ }
206
+
207
+ interface TextProps extends React$1.HTMLAttributes<HTMLElement> {
208
+ as?: keyof React$1.JSX.IntrinsicElements;
209
+ variantClass?: string;
210
+ }
211
+ /**
212
+ * Base Text component used internally by other text variants.
213
+ * Handles tag selection, base font, and class merging.
214
+ */
215
+ declare const Text: React$1.ForwardRefExoticComponent<TextProps & React$1.RefAttributes<HTMLElement>>;
216
+
217
+ declare const accentVariants: {
218
+ readonly 'accent-large': "text-[15px] leading-[140%] font-semibold";
219
+ readonly 'accent-medium': "text-[14px] leading-[140%] font-semibold";
220
+ readonly 'accent-small': "text-[12px] leading-[140%] font-semibold";
221
+ };
222
+ interface TextAccentProps extends React$1.HTMLAttributes<HTMLElement> {
223
+ variant?: keyof typeof accentVariants;
224
+ as?: keyof React$1.JSX.IntrinsicElements;
225
+ }
226
+ declare const TextAccent: React$1.ForwardRefExoticComponent<TextAccentProps & React$1.RefAttributes<HTMLElement>>;
227
+
228
+ declare const bodyVariants: {
229
+ readonly 'text-large': "text-[15px] leading-[140%] font-normal";
230
+ readonly 'text-medium': "text-[14px] leading-[140%] font-normal";
231
+ readonly 'text-small': "text-[12px] leading-[140%] font-normal";
232
+ };
233
+ interface TextBodyProps extends React$1.HTMLAttributes<HTMLElement> {
234
+ variant?: keyof typeof bodyVariants;
235
+ as?: keyof React$1.JSX.IntrinsicElements;
236
+ }
237
+ declare const TextBody: React$1.ForwardRefExoticComponent<TextBodyProps & React$1.RefAttributes<HTMLElement>>;
238
+
239
+ declare const headingVariants: {
240
+ readonly 'h-large': "text-[56px] leading-[100%] tracking-[0] font-extrabold";
241
+ readonly h1: "text-[40px] leading-[110%] font-extrabold";
242
+ readonly h2: "text-[28px] leading-[130%] font-extrabold";
243
+ readonly h3: "text-[22px] leading-[120%] font-extrabold";
244
+ readonly h4: "text-[18px] leading-[120%] font-extrabold";
245
+ readonly h5: "text-[16px] leading-[120%] font-bold";
246
+ };
247
+ interface TextHeadingProps extends React$1.HTMLAttributes<HTMLElement> {
248
+ variant?: keyof typeof headingVariants;
249
+ as?: keyof React$1.JSX.IntrinsicElements;
250
+ }
251
+ declare const TextHeading: React$1.ForwardRefExoticComponent<TextHeadingProps & React$1.RefAttributes<HTMLElement>>;
252
+
253
+ /** Link component for navigation and external links */
254
+ declare function Link({ children, href, className, target, ...props }: LinkProps): react_jsx_runtime.JSX.Element;
255
+
256
+ /**
257
+ * Title component for headings and page titles
258
+ * This is an alias for TextHeading with h1 variant as default
259
+ */
260
+ declare function Title({ variant, ...props }: TextHeadingProps): react_jsx_runtime.JSX.Element;
261
+
262
+ interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
263
+ /**
264
+ * The URL to link to
265
+ */
266
+ href: string;
267
+ /**
268
+ * The content of the link
269
+ */
270
+ children: React.ReactNode;
271
+ /**
272
+ * Additional CSS class names
273
+ */
274
+ className?: string;
275
+ }
276
+
277
+ type TabsVariant = 'primary' | 'secondary' | 'default' | 'light' | 'medium' | 'dark' | 'header';
278
+ interface TabsProps extends React$1.HTMLAttributes<HTMLDivElement> {
279
+ value?: string;
280
+ onValueChange?: (value: string) => void;
281
+ defaultValue?: string;
282
+ variant?: TabsVariant;
283
+ }
284
+ declare const Tabs: React$1.ForwardRefExoticComponent<TabsProps & React$1.RefAttributes<HTMLDivElement>>;
285
+ interface TabsListProps extends React$1.HTMLAttributes<HTMLDivElement> {
286
+ }
287
+ declare const TabsList: React$1.ForwardRefExoticComponent<TabsListProps & React$1.RefAttributes<HTMLDivElement>>;
288
+ interface TabsTriggerProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
289
+ value: string;
290
+ icon?: React$1.ReactNode;
291
+ }
292
+ declare const TabsTrigger: React$1.ForwardRefExoticComponent<TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
293
+ interface TabsContentProps extends React$1.HTMLAttributes<HTMLDivElement> {
294
+ value: string;
295
+ }
296
+ declare const TabsContent: React$1.ForwardRefExoticComponent<TabsContentProps & React$1.RefAttributes<HTMLDivElement>>;
297
+
298
+ interface SelectProps {
299
+ value: string;
300
+ onValueChange: (value: string) => void;
301
+ disabled?: boolean;
302
+ children: React$1.ReactNode;
303
+ className?: string;
304
+ }
305
+ interface SelectTriggerProps {
306
+ placeholder?: string;
307
+ className?: string;
308
+ children?: React$1.ReactNode;
309
+ _isOpen?: boolean;
310
+ _disabled?: boolean;
311
+ _onToggle?: () => void;
312
+ }
313
+ interface SelectContentProps {
314
+ className?: string;
315
+ children: React$1.ReactNode;
316
+ _isOpen?: boolean;
317
+ _value?: string;
318
+ _onSelect?: (value: string) => void;
319
+ _highlightedIndex?: number;
320
+ _setHighlightedIndex?: (index: number) => void;
321
+ }
322
+ interface SelectItemProps {
323
+ value: string;
324
+ disabled?: boolean;
325
+ className?: string;
326
+ children: React$1.ReactNode;
327
+ _index?: number;
328
+ _isSelected?: boolean;
329
+ _isHighlighted?: boolean;
330
+ _onSelect?: (value: string) => void;
331
+ _onHighlight?: (index: number) => void;
332
+ }
333
+ declare const Select: React$1.FC<SelectProps>;
334
+ declare const SelectTrigger: React$1.ForwardRefExoticComponent<SelectTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
335
+ declare const SelectContent: React$1.ForwardRefExoticComponent<SelectContentProps & React$1.RefAttributes<HTMLUListElement>>;
336
+ declare const SelectItem: React$1.ForwardRefExoticComponent<SelectItemProps & React$1.RefAttributes<HTMLLIElement>>;
337
+
338
+ interface SkeletonProps extends React$1.HTMLAttributes<HTMLDivElement> {
339
+ /** Width of the skeleton block (px, %, rem, etc.) */
340
+ width?: string | number;
341
+ /** Height of the skeleton block (px, %, rem, etc.) */
342
+ height?: string | number;
343
+ /** Shape of the skeleton */
344
+ variant?: 'rect' | 'circle' | 'text';
345
+ /** Enables shimmer animation */
346
+ shimmer?: boolean;
347
+ /** Custom background color (Tailwind classes) */
348
+ colorClass?: string;
349
+ }
350
+ declare const Skeleton: React$1.FC<SkeletonProps>;
351
+
352
+ interface BannerNotificationProps extends React$1.HTMLAttributes<HTMLDivElement> {
353
+ /** Type of notification - inline (default) or toast */
354
+ type?: 'inline' | 'toast';
355
+ /** Variant type that determines colors and icon */
356
+ variant?: 'info' | 'warning' | 'error' | 'success';
357
+ /** The title of the banner */
358
+ title?: string;
359
+ /** The message to display in the banner */
360
+ message: string;
361
+ /** Position for toast notifications */
362
+ position?: 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
363
+ /** Auto hide duration in milliseconds (default: 5000, set to 0 to disable) */
364
+ autoHideDuration?: number;
365
+ /** Control visibility for toast notifications */
366
+ show?: boolean;
367
+ /** Callback when notification is closed */
368
+ onClose?: () => void;
369
+ }
370
+ declare const BannerNotification: React$1.FC<BannerNotificationProps>;
371
+
372
+ interface AddressDisplayProps {
373
+ /** The full address to display */
374
+ address: string;
375
+ /** Callback when copy button is clicked */
376
+ onCopy?: (address: string) => void;
377
+ /** Custom className for the container */
378
+ className?: string;
379
+ /** Custom className for the text */
380
+ textClassName?: string;
381
+ /** Show copy button */
382
+ showCopyButton?: boolean;
383
+ }
384
+ declare const AddressDisplay: React$1.FC<AddressDisplayProps>;
385
+
386
+ interface DetailItem {
387
+ /** Label for the detail row */
388
+ label: string;
389
+ /** Value to display */
390
+ value: string | React$1.ReactNode;
391
+ /** Optional custom className for the value */
392
+ valueClassName?: string;
393
+ /** Optional custom className for the label */
394
+ labelClassName?: string;
395
+ }
396
+ interface SummaryDetailsProps {
397
+ /** Title displayed in the summary header */
398
+ title: string;
399
+ /** Array of detail items to render */
400
+ items: DetailItem[];
401
+ /** Whether the details are open by default */
402
+ defaultOpen?: boolean;
403
+ /** Custom className for the details container */
404
+ className?: string;
405
+ /** Custom className for the summary header */
406
+ summaryClassName?: string;
407
+ /** Custom className for the content area */
408
+ contentClassName?: string;
409
+ /** Show dividers between items */
410
+ showDividers?: boolean;
411
+ }
412
+ declare const SummaryDetails: React$1.FC<SummaryDetailsProps>;
413
+
414
+ interface ActionSheetProps {
415
+ /** Unique identifier for this action sheet */
416
+ id: string;
417
+ /** Current action sheet ID from state */
418
+ currentActionSheetId: string | null;
419
+ /** Whether the action sheet is open */
420
+ isOpen: boolean;
421
+ /** Function to close the action sheet */
422
+ onClose: () => void;
423
+ /** Custom content to render */
424
+ children: React$1.ReactNode;
425
+ /** Custom className for the container */
426
+ className?: string;
427
+ /** Custom className for the content area */
428
+ contentClassName?: string;
429
+ /** Position of the action sheet */
430
+ position?: 'bottom' | 'center';
431
+ /** Height of the sheet */
432
+ height?: 'auto' | 'full' | 'half';
433
+ /** Whether clicking the backdrop should close the sheet (default: true) */
434
+ closeOnBackdropClick?: boolean;
435
+ }
436
+ /**
437
+ * ActionSheet - A flexible bottom sheet / modal component
438
+ *
439
+ * Pure custom content mode for maximum flexibility.
440
+ * Compose your content using existing library components.
441
+ *
442
+ * Features:
443
+ * - Smooth framer-motion animations with spring physics
444
+ * - Multiple height options (auto, full, half)
445
+ * - Position options (bottom, center)
446
+ * - Dark mode support via CSS custom properties
447
+ * - Keyboard navigation (ESC to close)
448
+ * - Backdrop click to dismiss
449
+ * - ARIA labels for accessibility
450
+ *
451
+ * @example
452
+ * <ActionSheet
453
+ * id="token-selector"
454
+ * currentActionSheetId={currentId}
455
+ * isOpen={isOpen}
456
+ * height="full"
457
+ * onClose={handleClose}
458
+ * >
459
+ * <div className="flex flex-col h-full bg-black p-6">
460
+ * <h2>Select Token</h2>
461
+ * <Input placeholder="Search here..." />
462
+ * <ListItem>...</ListItem>
463
+ * </div>
464
+ * </ActionSheet>
465
+ */
466
+ declare const ActionSheet: React$1.FC<ActionSheetProps>;
467
+
468
+ /**
469
+ * Theme color configuration for Deframe components
470
+ */
471
+ interface DeframeThemeColors {
472
+ /** Primary brand color - used for buttons, links, accents */
473
+ brandPrimary?: string;
474
+ /** Secondary brand color - used for secondary accents */
475
+ brandSecondary?: string;
476
+ /** Main background color */
477
+ bgDefault?: string;
478
+ /** Subtle background color */
479
+ bgSubtle?: string;
480
+ /** Muted/disabled background color */
481
+ bgMuted?: string;
482
+ /** Primary text color */
483
+ textPrimary?: string;
484
+ /** Secondary text color */
485
+ textSecondary?: string;
486
+ /** Disabled text color */
487
+ textDisabled?: string;
488
+ /** Text color for dark backgrounds */
489
+ textInverse?: string;
490
+ /** Success state color */
491
+ stateSuccess?: string;
492
+ /** Error state color */
493
+ stateError?: string;
494
+ /** Warning state color */
495
+ stateWarning?: string;
496
+ }
497
+ /**
498
+ * Complete theme configuration for Deframe components
499
+ */
500
+ interface DeframeTheme {
501
+ colors?: DeframeThemeColors;
502
+ }
503
+ /**
504
+ * Theme mode - controls light/dark appearance
505
+ */
506
+ type ThemeMode = 'light' | 'dark' | 'auto';
507
+ /**
508
+ * Theme preset - predefined color schemes
509
+ */
510
+ type ThemePreset = 'default' | 'cryptocontrol';
511
+ /**
512
+ * Structured theme configuration with mode, preset, and overrides
513
+ */
514
+ interface DeframeThemeConfig {
515
+ /** Theme mode: 'light', 'dark', or 'auto' (follows system preference) */
516
+ mode?: ThemeMode;
517
+ /** Theme preset: 'default' or 'cryptocontrol' */
518
+ preset?: ThemePreset;
519
+ /** Custom color overrides for each mode */
520
+ overrides?: {
521
+ light?: DeframeTheme;
522
+ dark?: DeframeTheme;
523
+ };
524
+ }
525
+ /**
526
+ * Default theme values - these serve as fallbacks when no custom theme is provided
527
+ */
528
+ declare const defaultThemeColors: Required<DeframeThemeColors>;
529
+ /**
530
+ * Dark mode theme values
531
+ */
532
+ declare const darkThemeColors: Required<DeframeThemeColors>;
533
+ /**
534
+ * Cryptocontrol theme values
535
+ */
536
+ declare const cryptocontrolThemeColors: Required<DeframeThemeColors>;
537
+ /**
538
+ * Convert theme colors to CSS variable style object
539
+ */
540
+ declare function themeToCSS(theme?: DeframeTheme): React.CSSProperties;
541
+
542
+ interface DeframeComponentsProviderProps {
543
+ /** Theme preset: 'light' | 'dark' | 'cryptocontrol' (legacy) */
544
+ theme?: string;
545
+ /** Structured theme configuration (preferred) */
546
+ themeConfig?: DeframeThemeConfig;
547
+ /** Custom theme colors that override the preset */
548
+ customTheme?: DeframeTheme;
549
+ /** Optional extra className applied to the `.deframe-widget` root */
550
+ className?: string;
551
+ /** Child components */
552
+ children: React.ReactNode;
553
+ }
554
+ declare function DeframeComponentsProvider({ theme, themeConfig, customTheme, className, children }: DeframeComponentsProviderProps): react_jsx_runtime.JSX.Element;
555
+
556
+ export { ActionButton, ActionSheet, type ActionSheetProps, AddressDisplay, type AddressDisplayProps, BannerNotification, type BannerNotificationProps, type ButtonProps, ConnectWalletList, type ConnectWalletListProps, Currency, type CurrencyProps, type CurrencyType, DeframeComponentsProvider, type DeframeTheme, type DeframeThemeColors, type DeframeThemeConfig, type DetailItem, Currency as Fiat, type FiatProps, Input, type InputProps, Link, type LinkProps, ListItem, ListItemContent, ListItemLeftSide, type ListItemProps, ListItemRightSide, PercentageButton, PrimaryButton, SecondaryButton, Select, SelectContent, type SelectContentProps, SelectItem, type SelectItemProps, type SelectProps, SelectTrigger, type SelectTriggerProps, Skeleton, type SkeletonProps, SummaryDetails, type SummaryDetailsProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, TertiaryButton, Text, TextAccent, type TextAccentProps, TextBody, type TextBodyProps, TextHeading, type TextHeadingProps, type TextProps, type ThemeMode, type ThemePreset, Title, WalletItem, type WalletItemProps, ConnectWalletList as WalletList, WalletListContainer, type WalletListContainerProps, type ConnectWalletListProps as WalletListProps, type WalletOption, cryptocontrolThemeColors, darkThemeColors, defaultThemeColors, themeToCSS };