@jaw.id/ui 0.0.3 → 0.0.4

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.
Files changed (66) hide show
  1. package/cjs-error.cjs +3 -0
  2. package/dist/{ccip-BYa9WTP9.js → ccip-yRQNp5zr.js} +1 -1
  3. package/dist/{index-DBYNWeek.js → index-BcDVfcdq.js} +20832 -20511
  4. package/dist/index.js +1 -1
  5. package/package.json +8 -2
  6. package/.babelrc +0 -12
  7. package/CHANGELOG.md +0 -23
  8. package/components.json +0 -22
  9. package/postcss.config.cjs +0 -6
  10. package/src/components/ConnectDialog/index.tsx +0 -270
  11. package/src/components/ConnectDialog/types.ts +0 -34
  12. package/src/components/DefaultDialog/index.tsx +0 -99
  13. package/src/components/Eip712Dialog/index.tsx +0 -525
  14. package/src/components/Eip712Dialog/types.ts +0 -27
  15. package/src/components/FeeTokenSelector/index.tsx +0 -308
  16. package/src/components/OnboardingDialog/index.tsx +0 -317
  17. package/src/components/OnboardingDialog/types.ts +0 -43
  18. package/src/components/OrSeparator/index.tsx +0 -13
  19. package/src/components/PermissionDialog/index.tsx +0 -598
  20. package/src/components/PermissionDialog/types.ts +0 -77
  21. package/src/components/SignatureDialog/index.tsx +0 -180
  22. package/src/components/SignatureDialog/types.ts +0 -27
  23. package/src/components/SiweDialog/index.tsx +0 -231
  24. package/src/components/SiweDialog/types.ts +0 -34
  25. package/src/components/TransactionDialog/DecodedCalldata.tsx +0 -79
  26. package/src/components/TransactionDialog/index.tsx +0 -663
  27. package/src/components/TransactionDialog/types.ts +0 -54
  28. package/src/components/ui/accordion.tsx +0 -66
  29. package/src/components/ui/avatar.tsx +0 -53
  30. package/src/components/ui/button.tsx +0 -59
  31. package/src/components/ui/card.tsx +0 -92
  32. package/src/components/ui/checkbox.tsx +0 -32
  33. package/src/components/ui/dialog.tsx +0 -183
  34. package/src/components/ui/dropdown-menu.tsx +0 -258
  35. package/src/components/ui/form.tsx +0 -167
  36. package/src/components/ui/input.tsx +0 -60
  37. package/src/components/ui/label.tsx +0 -24
  38. package/src/components/ui/popover.tsx +0 -48
  39. package/src/components/ui/scroll-area.tsx +0 -58
  40. package/src/components/ui/select.tsx +0 -160
  41. package/src/components/ui/separator.tsx +0 -28
  42. package/src/components/ui/sheet.tsx +0 -169
  43. package/src/components/ui/spinner.tsx +0 -18
  44. package/src/components/ui/tabs.tsx +0 -69
  45. package/src/components/ui/tooltip.tsx +0 -61
  46. package/src/hooks/index.ts +0 -5
  47. package/src/hooks/useChainIconURI.tsx +0 -117
  48. package/src/hooks/useDecodedCalldata.ts +0 -128
  49. package/src/hooks/useFeeTokenPrice.tsx +0 -36
  50. package/src/hooks/useGasEstimation.ts +0 -474
  51. package/src/hooks/useIsMobile.ts +0 -36
  52. package/src/icons/index.tsx +0 -114
  53. package/src/index.ts +0 -19
  54. package/src/lib/utils.ts +0 -6
  55. package/src/react/ReactUIHandler.tsx +0 -3004
  56. package/src/react/index.ts +0 -2
  57. package/src/styles.css +0 -210
  58. package/src/utils/formatAddress.ts +0 -24
  59. package/src/utils/index.ts +0 -4
  60. package/src/utils/justaNameInstance.ts +0 -25
  61. package/src/utils/tokenBalance.ts +0 -41
  62. package/src/utils/tokenPrice.ts +0 -58
  63. package/tailwind.config.js +0 -130
  64. package/tsconfig.json +0 -19
  65. package/tsconfig.lib.json +0 -43
  66. package/vite.config.ts +0 -45
@@ -1,54 +0,0 @@
1
- import { FeeTokenOption } from '../FeeTokenSelector';
2
-
3
- export interface TransactionData {
4
- to: string;
5
- data?: string;
6
- value?: string;
7
- chainId: number;
8
- // To check if needed
9
- stepId?: string;
10
- description?: string;
11
- action?: string;
12
- }
13
-
14
- export interface TransactionDialogProps {
15
- open: boolean;
16
- onOpenChange: (open: boolean) => void;
17
-
18
- // Transaction data
19
- transactions: TransactionData[];
20
-
21
- // Wallet info
22
- walletAddress: string;
23
-
24
- // Gas estimation
25
- gasFee: string;
26
- gasFeeLoading: boolean;
27
- gasEstimationError: string;
28
- sponsored: boolean;
29
-
30
- // Actions
31
- onConfirm: () => Promise<void>;
32
- onCancel: () => void;
33
- isProcessing: boolean;
34
-
35
- // Status
36
- transactionStatus: string;
37
-
38
- // Display utilities
39
- networkName: string;
40
- apiKey?: string;
41
-
42
- // Fee token selection (for ERC-20 paymaster)
43
- feeTokens?: FeeTokenOption[];
44
- feeTokensLoading?: boolean;
45
- selectedFeeToken?: FeeTokenOption | null;
46
- onFeeTokenSelect?: (token: FeeTokenOption) => void;
47
- showFeeTokenSelector?: boolean;
48
-
49
- // ERC-20 payment indicator (when user selected non-native token)
50
- isPayingWithErc20?: boolean;
51
-
52
- // RPC configuration
53
- mainnetRpcUrl: string;
54
- }
@@ -1,66 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as AccordionPrimitive from "@radix-ui/react-accordion"
5
- import { ChevronDownIcon } from "lucide-react"
6
-
7
- import { cn } from "../../lib/utils"
8
-
9
- function Accordion({
10
- ...props
11
- }: React.ComponentProps<typeof AccordionPrimitive.Root>) {
12
- return <AccordionPrimitive.Root data-slot="accordion" {...props} />
13
- }
14
-
15
- function AccordionItem({
16
- className,
17
- ...props
18
- }: React.ComponentProps<typeof AccordionPrimitive.Item>) {
19
- return (
20
- <AccordionPrimitive.Item
21
- data-slot="accordion-item"
22
- className={cn("border-b ", className)}
23
- {...props}
24
- />
25
- )
26
- }
27
-
28
- function AccordionTrigger({
29
- className,
30
- children,
31
- ...props
32
- }: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
33
- return (
34
- <AccordionPrimitive.Header className="flex">
35
- <AccordionPrimitive.Trigger
36
- data-slot="accordion-trigger"
37
- className={cn(
38
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
39
- className
40
- )}
41
- {...props}
42
- >
43
- {children}
44
- <ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
45
- </AccordionPrimitive.Trigger>
46
- </AccordionPrimitive.Header>
47
- )
48
- }
49
-
50
- function AccordionContent({
51
- className,
52
- children,
53
- ...props
54
- }: React.ComponentProps<typeof AccordionPrimitive.Content>) {
55
- return (
56
- <AccordionPrimitive.Content
57
- data-slot="accordion-content"
58
- className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
59
- {...props}
60
- >
61
- <div className={cn("pt-0 pb-4", className)}>{children}</div>
62
- </AccordionPrimitive.Content>
63
- )
64
- }
65
-
66
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -1,53 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as AvatarPrimitive from "@radix-ui/react-avatar"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- function Avatar({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof AvatarPrimitive.Root>) {
12
- return (
13
- <AvatarPrimitive.Root
14
- data-slot="avatar"
15
- className={cn(
16
- "relative flex size-8 shrink-0 overflow-hidden rounded-full",
17
- className
18
- )}
19
- {...props}
20
- />
21
- )
22
- }
23
-
24
- function AvatarImage({
25
- className,
26
- ...props
27
- }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
28
- return (
29
- <AvatarPrimitive.Image
30
- data-slot="avatar-image"
31
- className={cn("aspect-square size-full", className)}
32
- {...props}
33
- />
34
- )
35
- }
36
-
37
- function AvatarFallback({
38
- className,
39
- ...props
40
- }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
41
- return (
42
- <AvatarPrimitive.Fallback
43
- data-slot="avatar-fallback"
44
- className={cn(
45
- "bg-muted flex size-full items-center justify-center rounded-full",
46
- className
47
- )}
48
- {...props}
49
- />
50
- )
51
- }
52
-
53
- export { Avatar, AvatarImage, AvatarFallback }
@@ -1,59 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "../../lib/utils"
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
14
- destructive:
15
- "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
16
- outline:
17
- "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
18
- secondary:
19
- "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
20
- ghost:
21
- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22
- link: "text-primary underline-offset-4 hover:underline",
23
- },
24
- size: {
25
- default: "h-10 px-4 py-2 has-[>svg]:px-3",
26
- sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
27
- lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
28
- icon: "size-9",
29
- },
30
- },
31
- defaultVariants: {
32
- variant: "default",
33
- size: "default",
34
- },
35
- }
36
- )
37
-
38
- function Button({
39
- className,
40
- variant,
41
- size,
42
- asChild = false,
43
- ...props
44
- }: React.ComponentProps<"button"> &
45
- VariantProps<typeof buttonVariants> & {
46
- asChild?: boolean
47
- }) {
48
- const Comp = asChild ? Slot : "button"
49
-
50
- return (
51
- <Comp
52
- data-slot="button"
53
- className={cn(buttonVariants({ variant, size, className }))}
54
- {...props}
55
- />
56
- )
57
- }
58
-
59
- export { Button, buttonVariants }
@@ -1,92 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../../lib/utils"
4
-
5
- function Card({ className, ...props }: React.ComponentProps<"div">) {
6
- return (
7
- <div
8
- data-slot="card"
9
- className={cn(
10
- "bg-card text-card-foreground flex flex-col gap-5 rounded-xl border p-5 shadow-sm",
11
- className
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
19
- return (
20
- <div
21
- data-slot="card-header"
22
- className={cn(
23
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-[5px] has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
24
- className
25
- )}
26
- {...props}
27
- />
28
- )
29
- }
30
-
31
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
32
- return (
33
- <div
34
- data-slot="card-title"
35
- className={cn("leading-none font-semibold", className)}
36
- {...props}
37
- />
38
- )
39
- }
40
-
41
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
42
- return (
43
- <div
44
- data-slot="card-description"
45
- className={cn("text-muted-foreground text-sm", className)}
46
- {...props}
47
- />
48
- )
49
- }
50
-
51
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
52
- return (
53
- <div
54
- data-slot="card-action"
55
- className={cn(
56
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
57
- className
58
- )}
59
- {...props}
60
- />
61
- )
62
- }
63
-
64
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
65
- return (
66
- <div
67
- data-slot="card-content"
68
- className={cn(className)}
69
- {...props}
70
- />
71
- )
72
- }
73
-
74
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
75
- return (
76
- <div
77
- data-slot="card-footer"
78
- className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
79
- {...props}
80
- />
81
- )
82
- }
83
-
84
- export {
85
- Card,
86
- CardHeader,
87
- CardFooter,
88
- CardTitle,
89
- CardAction,
90
- CardDescription,
91
- CardContent,
92
- }
@@ -1,32 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
5
- import { CheckIcon } from "lucide-react"
6
-
7
- import { cn } from "../../lib/utils"
8
-
9
- function Checkbox({
10
- className,
11
- ...props
12
- }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
13
- return (
14
- <CheckboxPrimitive.Root
15
- data-slot="checkbox"
16
- className={cn(
17
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
18
- className
19
- )}
20
- {...props}
21
- >
22
- <CheckboxPrimitive.Indicator
23
- data-slot="checkbox-indicator"
24
- className="flex items-center justify-center text-current transition-none"
25
- >
26
- <CheckIcon className="size-3.5" />
27
- </CheckboxPrimitive.Indicator>
28
- </CheckboxPrimitive.Root>
29
- )
30
- }
31
-
32
- export { Checkbox }
@@ -1,183 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as DialogPrimitive from "@radix-ui/react-dialog"
5
- import { XIcon } from "lucide-react"
6
-
7
- import { cn } from "../../lib/utils"
8
-
9
- function Dialog({
10
- open,
11
- ...props
12
- }: React.ComponentProps<typeof DialogPrimitive.Root>) {
13
- const prevOpenRef = React.useRef(open);
14
-
15
- // Cleanup pointer-events when dialog closes OR unmounts
16
- React.useEffect(() => {
17
- // Track when dialog transitions from open to closed
18
- if (prevOpenRef.current === true && open === false) {
19
- // Wait for close animation to complete (200ms duration-200) plus buffer
20
- const cleanup = setTimeout(() => {
21
- document.body.style.removeProperty('pointer-events');
22
- }, 250);
23
-
24
- prevOpenRef.current = open;
25
- return () => clearTimeout(cleanup);
26
- }
27
-
28
- prevOpenRef.current = open;
29
-
30
- // Cleanup on unmount - remove pointer-events if dialog was open
31
- return () => {
32
- if (open === true) {
33
- setTimeout(() => {
34
- document.body.style.removeProperty('pointer-events');
35
- }, 250);
36
- }
37
- };
38
- }, [open]);
39
-
40
- return <DialogPrimitive.Root data-slot="dialog" open={open} {...props} />
41
- }
42
-
43
- function DialogTrigger({
44
- ...props
45
- }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
46
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
47
- }
48
-
49
- function DialogPortal({
50
- ...props
51
- }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
52
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
53
- }
54
-
55
- function DialogClose({
56
- ...props
57
- }: React.ComponentProps<typeof DialogPrimitive.Close>) {
58
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
59
- }
60
-
61
- function DialogOverlay({
62
- className,
63
- onClick,
64
- ...props
65
- }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
66
- return (
67
- <DialogPrimitive.Overlay
68
- data-slot="dialog-overlay"
69
- className={cn(
70
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[100] bg-black/50",
71
- className
72
- )}
73
- onClick={(e) => {
74
- // Stop propagation to prevent interference with dialogs underneath
75
- e.stopPropagation();
76
- onClick?.(e);
77
- }}
78
- {...props}
79
- />
80
- )
81
- }
82
-
83
- interface DialogContentProps
84
- extends React.ComponentProps<typeof DialogPrimitive.Content> {
85
- showCloseButton?: boolean;
86
- fullScreen?: boolean;
87
- }
88
-
89
- function DialogContent({
90
- className,
91
- children,
92
- showCloseButton = true,
93
- fullScreen = false,
94
- ...props
95
- }: DialogContentProps) {
96
- return (
97
- <DialogPortal data-slot="dialog-portal">
98
- <DialogOverlay />
99
- <DialogPrimitive.Content
100
- data-slot="dialog-content"
101
- className={cn(
102
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-[100] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
103
- fullScreen ? 'w-[100vw] h-[100vh] min-w-[100vw] min-h-[100vh] translate-x-0 translate-y-0' : '',
104
- className
105
- )}
106
- {...props}
107
- >
108
- {children}
109
- {showCloseButton && (
110
- <DialogPrimitive.Close
111
- data-slot="dialog-close"
112
- className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 "
113
- >
114
- <XIcon />
115
- <span className="sr-only">Close</span>
116
- </DialogPrimitive.Close>
117
- )}
118
- </DialogPrimitive.Content>
119
- </DialogPortal>
120
- )
121
- }
122
-
123
- function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
124
- return (
125
- <div
126
- data-slot="dialog-header"
127
- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
128
- {...props}
129
- />
130
- )
131
- }
132
-
133
- function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
134
- return (
135
- <div
136
- data-slot="dialog-footer"
137
- className={cn(
138
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
139
- className
140
- )}
141
- {...props}
142
- />
143
- )
144
- }
145
-
146
- function DialogTitle({
147
- className,
148
- ...props
149
- }: React.ComponentProps<typeof DialogPrimitive.Title>) {
150
- return (
151
- <DialogPrimitive.Title
152
- data-slot="dialog-title"
153
- className={cn("text-lg leading-none font-semibold", className)}
154
- {...props}
155
- />
156
- )
157
- }
158
-
159
- function DialogDescription({
160
- className,
161
- ...props
162
- }: React.ComponentProps<typeof DialogPrimitive.Description>) {
163
- return (
164
- <DialogPrimitive.Description
165
- data-slot="dialog-description"
166
- className={cn("text-muted-foreground text-sm", className)}
167
- {...props}
168
- />
169
- )
170
- }
171
-
172
- export {
173
- Dialog,
174
- DialogClose,
175
- DialogContent,
176
- DialogDescription,
177
- DialogFooter,
178
- DialogHeader,
179
- DialogOverlay,
180
- DialogPortal,
181
- DialogTitle,
182
- DialogTrigger,
183
- }