@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,258 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
6
-
7
- import { cn } from "../../lib/utils"
8
-
9
- function DropdownMenu({
10
- ...props
11
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
12
- return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
13
- }
14
-
15
- function DropdownMenuPortal({
16
- ...props
17
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
18
- return (
19
- <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
20
- )
21
- }
22
-
23
- function DropdownMenuTrigger({
24
- ...props
25
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
26
- return (
27
- <DropdownMenuPrimitive.Trigger
28
- data-slot="dropdown-menu-trigger"
29
- {...props}
30
- />
31
- )
32
- }
33
-
34
- function DropdownMenuContent({
35
- className,
36
- sideOffset = 4,
37
- ...props
38
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
39
- return (
40
- <DropdownMenuPrimitive.Portal>
41
- <DropdownMenuPrimitive.Content
42
- data-slot="dropdown-menu-content"
43
- sideOffset={sideOffset}
44
- className={cn(
45
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
46
- className
47
- )}
48
- {...props}
49
- />
50
- </DropdownMenuPrimitive.Portal>
51
- )
52
- }
53
-
54
- function DropdownMenuGroup({
55
- ...props
56
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
57
- return (
58
- <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
59
- )
60
- }
61
-
62
- function DropdownMenuItem({
63
- className,
64
- inset,
65
- variant = "default",
66
- ...props
67
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
68
- inset?: boolean
69
- variant?: "default" | "destructive"
70
- }) {
71
- return (
72
- <DropdownMenuPrimitive.Item
73
- data-slot="dropdown-menu-item"
74
- data-inset={inset}
75
- data-variant={variant}
76
- className={cn(
77
-
78
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 ",
79
- className
80
- )}
81
- {...props}
82
- />
83
- )
84
- }
85
-
86
- function DropdownMenuCheckboxItem({
87
- className,
88
- children,
89
- checked,
90
- ...props
91
- }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
92
- return (
93
- <DropdownMenuPrimitive.CheckboxItem
94
- data-slot="dropdown-menu-checkbox-item"
95
- className={cn(
96
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
97
- className
98
- )}
99
- checked={checked}
100
- {...props}
101
- >
102
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
103
- <DropdownMenuPrimitive.ItemIndicator>
104
- <CheckIcon className="size-4" />
105
- </DropdownMenuPrimitive.ItemIndicator>
106
- </span>
107
- {children}
108
- </DropdownMenuPrimitive.CheckboxItem>
109
- )
110
- }
111
-
112
- function DropdownMenuRadioGroup({
113
- ...props
114
- }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
115
- return (
116
- <DropdownMenuPrimitive.RadioGroup
117
- data-slot="dropdown-menu-radio-group"
118
- {...props}
119
- />
120
- )
121
- }
122
-
123
- function DropdownMenuRadioItem({
124
- className,
125
- children,
126
- ...props
127
- }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
128
- return (
129
- <DropdownMenuPrimitive.RadioItem
130
- data-slot="dropdown-menu-radio-item"
131
- className={cn(
132
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
133
- className
134
- )}
135
- {...props}
136
- >
137
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
138
- <DropdownMenuPrimitive.ItemIndicator>
139
- <CircleIcon className="size-2 fill-current" />
140
- </DropdownMenuPrimitive.ItemIndicator>
141
- </span>
142
- {children}
143
- </DropdownMenuPrimitive.RadioItem>
144
- )
145
- }
146
-
147
- function DropdownMenuLabel({
148
- className,
149
- inset,
150
- ...props
151
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
152
- inset?: boolean
153
- }) {
154
- return (
155
- <DropdownMenuPrimitive.Label
156
- data-slot="dropdown-menu-label"
157
- data-inset={inset}
158
- className={cn(
159
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
160
- className
161
- )}
162
- {...props}
163
- />
164
- )
165
- }
166
-
167
- function DropdownMenuSeparator({
168
- className,
169
- ...props
170
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
171
- return (
172
- <DropdownMenuPrimitive.Separator
173
- data-slot="dropdown-menu-separator"
174
- className={cn("bg-border -mx-1 my-1 h-px", className)}
175
- {...props}
176
- />
177
- )
178
- }
179
-
180
- function DropdownMenuShortcut({
181
- className,
182
- ...props
183
- }: React.ComponentProps<"span">) {
184
- return (
185
- <span
186
- data-slot="dropdown-menu-shortcut"
187
- className={cn(
188
- "text-muted-foreground ml-auto text-xs tracking-widest",
189
- className
190
- )}
191
- {...props}
192
- />
193
- )
194
- }
195
-
196
- function DropdownMenuSub({
197
- ...props
198
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
199
- return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
200
- }
201
-
202
- function DropdownMenuSubTrigger({
203
- className,
204
- inset,
205
- children,
206
- ...props
207
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
208
- inset?: boolean
209
- }) {
210
- return (
211
- <DropdownMenuPrimitive.SubTrigger
212
- data-slot="dropdown-menu-sub-trigger"
213
- data-inset={inset}
214
- className={cn(
215
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
216
- className
217
- )}
218
- {...props}
219
- >
220
- {children}
221
- <ChevronRightIcon className="ml-auto size-4" />
222
- </DropdownMenuPrimitive.SubTrigger>
223
- )
224
- }
225
-
226
- function DropdownMenuSubContent({
227
- className,
228
- ...props
229
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
230
- return (
231
- <DropdownMenuPrimitive.SubContent
232
- data-slot="dropdown-menu-sub-content"
233
- className={cn(
234
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
235
- className
236
- )}
237
- {...props}
238
- />
239
- )
240
- }
241
-
242
- export {
243
- DropdownMenu,
244
- DropdownMenuPortal,
245
- DropdownMenuTrigger,
246
- DropdownMenuContent,
247
- DropdownMenuGroup,
248
- DropdownMenuLabel,
249
- DropdownMenuItem,
250
- DropdownMenuCheckboxItem,
251
- DropdownMenuRadioGroup,
252
- DropdownMenuRadioItem,
253
- DropdownMenuSeparator,
254
- DropdownMenuShortcut,
255
- DropdownMenuSub,
256
- DropdownMenuSubTrigger,
257
- DropdownMenuSubContent,
258
- }
@@ -1,167 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
5
- import { Slot } from "@radix-ui/react-slot"
6
- import {
7
- Controller,
8
- FormProvider,
9
- useFormContext,
10
- useFormState,
11
- type ControllerProps,
12
- type FieldPath,
13
- type FieldValues,
14
- } from "react-hook-form"
15
-
16
- import { cn } from "../../lib/utils"
17
- import { Label } from "./label"
18
-
19
- const Form = FormProvider
20
-
21
- type FormFieldContextValue<
22
- TFieldValues extends FieldValues = FieldValues,
23
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
24
- > = {
25
- name: TName
26
- }
27
-
28
- const FormFieldContext = React.createContext<FormFieldContextValue>(
29
- {} as FormFieldContextValue
30
- )
31
-
32
- const FormField = <
33
- TFieldValues extends FieldValues = FieldValues,
34
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
35
- >({
36
- ...props
37
- }: ControllerProps<TFieldValues, TName>) => {
38
- return (
39
- <FormFieldContext.Provider value={{ name: props.name }}>
40
- <Controller {...props} />
41
- </FormFieldContext.Provider>
42
- )
43
- }
44
-
45
- const useFormField = () => {
46
- const fieldContext = React.useContext(FormFieldContext)
47
- const itemContext = React.useContext(FormItemContext)
48
- const { getFieldState } = useFormContext()
49
- const formState = useFormState({ name: fieldContext.name })
50
- const fieldState = getFieldState(fieldContext.name, formState)
51
-
52
- if (!fieldContext) {
53
- throw new Error("useFormField should be used within <FormField>")
54
- }
55
-
56
- const { id } = itemContext
57
-
58
- return {
59
- id,
60
- name: fieldContext.name,
61
- formItemId: `${id}-form-item`,
62
- formDescriptionId: `${id}-form-item-description`,
63
- formMessageId: `${id}-form-item-message`,
64
- ...fieldState,
65
- }
66
- }
67
-
68
- type FormItemContextValue = {
69
- id: string
70
- }
71
-
72
- const FormItemContext = React.createContext<FormItemContextValue>(
73
- {} as FormItemContextValue
74
- )
75
-
76
- function FormItem({ className, ...props }: React.ComponentProps<"div">) {
77
- const id = React.useId()
78
-
79
- return (
80
- <FormItemContext.Provider value={{ id }}>
81
- <div
82
- data-slot="form-item"
83
- className={cn("grid gap-2", className)}
84
- {...props}
85
- />
86
- </FormItemContext.Provider>
87
- )
88
- }
89
-
90
- function FormLabel({
91
- className,
92
- ...props
93
- }: React.ComponentProps<typeof LabelPrimitive.Root>) {
94
- const { error, formItemId } = useFormField()
95
-
96
- return (
97
- <Label
98
- data-slot="form-label"
99
- data-error={!!error}
100
- className={cn("data-[error=true]:text-destructive", className)}
101
- htmlFor={formItemId}
102
- {...props}
103
- />
104
- )
105
- }
106
-
107
- function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
108
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
109
-
110
- return (
111
- <Slot
112
- data-slot="form-control"
113
- id={formItemId}
114
- aria-describedby={
115
- !error
116
- ? `${formDescriptionId}`
117
- : `${formDescriptionId} ${formMessageId}`
118
- }
119
- aria-invalid={!!error}
120
- {...props}
121
- />
122
- )
123
- }
124
-
125
- function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
126
- const { formDescriptionId } = useFormField()
127
-
128
- return (
129
- <p
130
- data-slot="form-description"
131
- id={formDescriptionId}
132
- className={cn("text-muted-foreground text-sm", className)}
133
- {...props}
134
- />
135
- )
136
- }
137
-
138
- function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
139
- const { error, formMessageId } = useFormField()
140
- const body = error ? String(error?.message ?? "") : props.children
141
-
142
- if (!body) {
143
- return null
144
- }
145
-
146
- return (
147
- <p
148
- data-slot="form-message"
149
- id={formMessageId}
150
- className={cn("text-destructive text-sm", className)}
151
- {...props}
152
- >
153
- {body}
154
- </p>
155
- )
156
- }
157
-
158
- export {
159
- useFormField,
160
- Form,
161
- FormItem,
162
- FormLabel,
163
- FormControl,
164
- FormDescription,
165
- FormMessage,
166
- FormField,
167
- }
@@ -1,60 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../../lib/utils"
4
-
5
- interface InputProps extends React.ComponentProps<"input"> {
6
- right?: React.ReactNode
7
- left?: React.ReactNode
8
- }
9
-
10
- const Input = React.forwardRef<HTMLInputElement, InputProps>(
11
- ({ className, type, right, left, ...props }, ref) => {
12
- if (!right && !left) {
13
- return (
14
- <input
15
- ref={ref}
16
- type={type}
17
- data-slot="input"
18
- className={cn(
19
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
20
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[1px]",
21
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
22
- className
23
- )}
24
- {...props}
25
- />
26
- )
27
- }
28
-
29
- return (
30
- <div className={cn(
31
- "relative flex items-center w-full",
32
- className
33
- )}>
34
- <input
35
- ref={ref}
36
- type={type}
37
- data-slot="input"
38
- className={cn(
39
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
40
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[1px]",
41
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
42
- left && "pl-10",
43
- right && "pr-10",
44
- )}
45
- {...props}
46
- />
47
- <span className="absolute left-3 flex items-center pointer-events-none h-full top-0">
48
- {left}
49
- </span>
50
- <span className="absolute right-3 flex items-center h-full top-0">
51
- {right}
52
- </span>
53
- </div>
54
- )
55
- }
56
- )
57
-
58
- Input.displayName = "Input"
59
-
60
- export { Input }
@@ -1,24 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- function Label({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
- return (
13
- <LabelPrimitive.Root
14
- data-slot="label"
15
- className={cn(
16
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
- className
18
- )}
19
- {...props}
20
- />
21
- )
22
- }
23
-
24
- export { Label }
@@ -1,48 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as PopoverPrimitive from "@radix-ui/react-popover"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- function Popover({
9
- ...props
10
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
- return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
- }
13
-
14
- function PopoverTrigger({
15
- ...props
16
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
- }
19
-
20
- function PopoverContent({
21
- className,
22
- align = "center",
23
- sideOffset = 4,
24
- ...props
25
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
- return (
27
- <PopoverPrimitive.Portal>
28
- <PopoverPrimitive.Content
29
- data-slot="popover-content"
30
- align={align}
31
- sideOffset={sideOffset}
32
- className={cn(
33
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-[200] w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
34
- className
35
- )}
36
- {...props}
37
- />
38
- </PopoverPrimitive.Portal>
39
- )
40
- }
41
-
42
- function PopoverAnchor({
43
- ...props
44
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
45
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
46
- }
47
-
48
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -1,58 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- function ScrollArea({
9
- className,
10
- children,
11
- ...props
12
- }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
13
- return (
14
- <ScrollAreaPrimitive.Root
15
- data-slot="scroll-area"
16
- className={cn("relative", className)}
17
- {...props}
18
- >
19
- <ScrollAreaPrimitive.Viewport
20
- data-slot="scroll-area-viewport"
21
- className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
22
- >
23
- {children}
24
- </ScrollAreaPrimitive.Viewport>
25
- <ScrollBar />
26
- <ScrollAreaPrimitive.Corner />
27
- </ScrollAreaPrimitive.Root>
28
- )
29
- }
30
-
31
- function ScrollBar({
32
- className,
33
- orientation = "vertical",
34
- ...props
35
- }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
36
- return (
37
- <ScrollAreaPrimitive.ScrollAreaScrollbar
38
- data-slot="scroll-area-scrollbar"
39
- orientation={orientation}
40
- className={cn(
41
- "flex touch-none p-px transition-colors select-none",
42
- orientation === "vertical" &&
43
- "h-full w-2.5 border-l border-l-transparent",
44
- orientation === "horizontal" &&
45
- "h-2.5 flex-col border-t border-t-transparent",
46
- className
47
- )}
48
- {...props}
49
- >
50
- <ScrollAreaPrimitive.ScrollAreaThumb
51
- data-slot="scroll-area-thumb"
52
- className="bg-border relative flex-1 rounded-full"
53
- />
54
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
55
- )
56
- }
57
-
58
- export { ScrollArea, ScrollBar }